amp 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,21 @@
1
- === 0.1.1 / 2009-07-24
1
+ === 0.5.2 / 2009-11-28
2
+
3
+ * Bug Fixes
4
+
5
+ * Fixed amp commands that do not rely on a repository (such as `amp init`) (seydar)
6
+ * Bug fixes in pulling, still investigating.
7
+
8
+ === 0.5.1 / 2009-11-27
9
+
10
+ * Bug Fixes
11
+
12
+ * Ported Guy Decoux's BZ2 library to Ruby 1.9.1+. (adgar)
13
+ * Building on Ruby 1.9+ should work. (adgar)
14
+
15
+ === 0.5.0 / 2009-11-22
2
16
 
3
17
  * First public release
4
18
 
5
19
  * Full implementation of Mercurial in Ruby.
6
20
  * Spiffy command system.
21
+ * Lots more.
data/LICENSE CHANGED
@@ -8,6 +8,9 @@ associated with it.
8
8
  2. BZ2 (Ruby License) - Guy Decoux
9
9
  This code has been copied verbatim into our repository.
10
10
 
11
+ 11/27/2009 - Michael Edgar added Ruby 1.9+ compatibility. This involved adding conditional compilation
12
+ due to changes in Ruby (MRI)'s C API.
13
+
11
14
  "This extension module is copyrighted free software by Guy Decoux
12
15
 
13
16
  You can redistribute it and/or modify it under the same term as
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- Amp Release v0.5.0 (John Locke)
1
+ Amp Release v0.5.1 (John Locke)
2
2
  ==============================
3
3
 
4
4
  **Homepage**: [http://amp.carboni.ca](http://amp.carboni.ca)
data/lib/amp.rb CHANGED
@@ -152,7 +152,7 @@ end
152
152
  require "amp/repository/repository.rb"
153
153
 
154
154
  module Amp
155
- VERSION = '0.5.1'
155
+ VERSION = '0.5.2'
156
156
  VERSION_TITLE = "John Locke"
157
157
 
158
158
  def self.new_irb_session(bndng)
@@ -91,6 +91,7 @@ HELP
91
91
 
92
92
  [source, dest_repo]
93
93
  rescue
94
+ p "RESCUE ME"
94
95
  FileUtils.remove_entry dest # kill the dir if we've had any problems
95
96
  end
96
97
  end
@@ -69,7 +69,7 @@ module Amp
69
69
  begin
70
70
  cmd_opts[:repository] = Repositories.pick(local_config, global_opts[:repository])
71
71
  rescue
72
- unless Command::NO_REPO_ALLOWED[cmd] || Command::MAYBE_REPO_ALLOWED[cmd]
72
+ unless Command::NO_REPO_ALLOWED[cmd.to_sym] || Command::MAYBE_REPO_ALLOWED[cmd.to_sym]
73
73
  raise
74
74
  end
75
75
  end
@@ -123,8 +123,6 @@ module Amp
123
123
  rescue AbortError => e
124
124
  puts e.to_s
125
125
  end
126
-
127
- #Amp::Support::Logger.outdent.info("</#{command.name}>")
128
126
  end
129
127
 
130
128
  ##
@@ -48,6 +48,7 @@ module Amp
48
48
  # the use of @index.index is deliberate!
49
49
  @index.index << RevlogSupport::IndexEntry.new(0,0,0,-1,-1,-1,-1,NULL_ID)
50
50
  end
51
+
51
52
  end
52
53
  alias_method :revlog_initialize, :initialize
53
54
 
@@ -718,6 +719,7 @@ module Amp
718
719
  data_offset = data_start_for_index trindex
719
720
  tr.add @data_file, data_offset
720
721
  df = open(@data_file, 'w')
722
+
721
723
  begin
722
724
  calc = @index.entry_size
723
725
  self.size.times do |r|
@@ -730,11 +732,23 @@ module Amp
730
732
  ensure
731
733
  df.close
732
734
  end
735
+
733
736
  fp.close
734
737
 
735
- ############ TODO
736
- # FINISH THIS METHOD
737
- ############ TODO
738
+ open(@index_file, 'w') do |fp| # automatically atomic
739
+ @version &= ~ RevlogSupport::Support::REVLOG_NG_INLINE_DATA
740
+ @inline = false
741
+ each do |i|
742
+ # THE FOLLOWING LINE IS NOT CORRECT
743
+ # IT IS DIRECTLY TRANSLATED PYTHON CODE
744
+ # I HAVE NO IDEA HOW WE DID THIS BEFORE
745
+ e = @io.pack_entry @index[i], @node, @version, i
746
+ fp.write e
747
+ end
748
+ end
749
+
750
+ tr.replace @index_file, trindex * calc
751
+ @chunk_cache = nil # reset the cache
738
752
  end
739
753
 
740
754
  ##
@@ -754,6 +768,7 @@ module Amp
754
768
  prev = curr - 1
755
769
  base = self[prev].base_rev
756
770
  offset = data_end_for_index prev
771
+
757
772
  if curr > 0
758
773
  if d.nil? || d.empty?
759
774
  ptext = decompress_revision node_id_for_index(prev)
@@ -763,12 +778,14 @@ module Amp
763
778
  len = data[:compression].size + data[:text].size
764
779
  dist = len + offset - data_start_for_index(base)
765
780
  end
781
+
766
782
  # Compressed diff > size of actual file
767
783
  if curr == 0 || dist > text.size * 2
768
784
  data = RevlogSupport::Support.compress text
769
785
  len = data[:compression].size + data[:text].size
770
786
  base = curr
771
787
  end
788
+
772
789
  entry = RevlogSupport::IndexEntry.new(RevlogSupport::Support.offset_version(offset, 0),
773
790
  len, text.size, base, link, rev(p1), rev(p2), node)
774
791
  @index << entry
@@ -920,10 +937,7 @@ module Amp
920
937
  end
921
938
  chk = add_revision(text, journal, link, parent1, parent2,
922
939
  nil, index_file_handle)
923
- # if (! data_file_handle) && (! @index.inline?)
924
- # data_file_handle = open(@data_file, "a")
925
- # index_file_handle = open(@index_file, "a")
926
- # end
940
+
927
941
  if chk != node
928
942
  raise RevlogSupport::RevlogError.new("consistency error "+
929
943
  "adding group")
@@ -85,11 +85,11 @@ module Amp
85
85
  position = 0
86
86
  while position < size
87
87
  newposition = position + 2**20
88
- p << deflater.deflate(text[position..(newposition-1)], Zlib::NO_FLUSH)
88
+ parts << deflater.deflate(text[position..(newposition-1)], Zlib::NO_FLUSH)
89
89
  position = newposition
90
90
  end
91
- p << deflater.flush
92
- binary = p.join if p.map {|e| e.size}.sum < size # only add it if
91
+ parts << deflater.flush
92
+ binary = parts.join if parts.map {|e| e.size}.sum < size # only add it if
93
93
  # compression made it smaller
94
94
  else #tiny, just compress it
95
95
  binary = Zlib::Deflate.deflate text
@@ -15,7 +15,7 @@
15
15
  .rounded.bigbox.pink
16
16
  %h1#latest-version
17
17
  Get Amp
18
- %span.red-text v0.2.3
18
+ %span.red-text v0.5.1
19
19
  %ul{:style => "margin-left:2px;"}
20
20
  %li== 1. Get #{ruby_link}. 2. sudo gem install #{blue_amp} --no-wrappers
21
21
  .floatleft{ :style => "width:100%;padding:10px 0em 6px;" }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Edgar
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-11-27 00:00:00 -05:00
13
+ date: 2009-11-28 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency