Commits

Anonymous committed e313fb7

working on fixing a bug in update

Comments (0)

Files changed (7)

 to alleviate any pains. But be apprised: we have yet to feel any pains from it.
 
 # Random Complaints
-The standards for committing are ridiculous. They are so unfriendly to human or
+The standards for committing are ridiculous. They are so unfriendly to human and
 machine.
 
 The nomenclature for files and their statuses is absurd. It changes all over the
 
 Comments don't explain why a method does something.
 
-Committing is fucking insane.
+Committing is fucking insane.
   dir  = "test_#{rand(1000)}"
   repo = nil # scoping
   
-  b.number  22
+  b.number 22
   
   # hint, because the functionality isn't there
-  b.desc    "`amp update` fails to switch between branches"
+  b.desc   "`amp update` fails to switch between branches"
   
   b.setup do
     # Create the repo
   end
   
   b.success do
-    repo.update 'default'
-    repo[nil].branch == 'default' # repo[nil] is the working directory's changeset
+    begin
+      repo.update 'default'
+      repo[nil].branch == 'default' # repo[nil] is the working directory's changeset
+    rescue
+      false
+    end
   end
   
   b.cleanup { FileUtils.rm_rf Dir['test_*'] } # destory all similar looking dirs
   dir  = "test_#{rand(1000)}"
   repo = nil # scoping
   
-  b.number  23
-  
-  b.desc    "`amp update` fails to replay uncommitted changes"
+  b.number 23
+           
+  b.desc   "`amp update` fails to replay uncommitted changes"
   
   b.setup do
     repo = Amp::Repositories::Mercurial::LocalRepository.new dir, true # Create the repo
   dir  = "test_#{rand(1000)}"
   repo = nil # scoping
   
-  b.number  23
-  
-  b.desc    "Unable to change branches"
+  b.number 23
+           
+  b.desc   "Unable to change branches"
   
   b.setup do
     repo = Amp::Repositories::Mercurial::LocalRepository.new dir, true # Create the repo

lib/amp/extensions/bugs.rb

     c.on_run do |o, a|
       a.each {|bug| load "bugs/#{bug}.rb" }
       
+      # default to loading all
+      if a.empty?
+        Dir['bugs/*.rb'].map {|f| load f }
+      end
+      
       # hide output
       if o[:stfu]
         # just fyi, it'd be more efficient to create a "bottomless pit"

lib/amp/repository/mercurial/repositories/local_repository.rb

         def changelog
           return @changelog if @changelog
           
+          p ['>>>>>>>>>>', @store.opener.class]
           @changelog = Amp::Mercurial::ChangeLog.new @store.opener
           
           if path = ENV['HG_PENDING']

lib/amp/repository/mercurial/revlogs/changelog.rb

       # and start saving any new info to memory/other files. Used when the
       # changelog has to be the last file saved.
       def delay_update
+        p [';;;;;;;', @opener.class]
         @_real_opener = @opener
         @opener = DelayedOpener.new(@_real_opener, self) # Our fake Opener
         @delay_count = self.size