Don't require new revisions on empty commits.
authorW. Trevor King <wking@drexel.edu>
Mon, 14 Dec 2009 00:58:50 +0000 (19:58 -0500)
committerW. Trevor King <wking@drexel.edu>
Mon, 14 Dec 2009 00:58:50 +0000 (19:58 -0500)
For example, hg can't:
  $ mkdir x; cd x;
  x$ hg init;
  x$ echo a> b; hg add b;
  x$ hg commit -m 'r1';
  x$ hg commit -m 'r2';
  nothing changed
  x$ hg log;
  changeset:   0:e30558c36fca
  tag:         tip
  user:        W. Trevor King <wking@drexel.edu>
  date:        Sun Dec 13 19:48:47 2009 -0500
  summary:     hi
  x$ cd ..; rm -rf x

We shouldn't need this functionality anyway ;).

libbe/storage/base.py

index 56b59ba286432761e6b87a0ff3e2674ed6958168..dd35586e5bc6a2546bbb2f6a691ea2c2fbfe0413 100644 (file)
@@ -758,11 +758,14 @@ if TESTING == True:
             """
             Commit / revision_id should agree on revision ids.
             """
+            def val(i):
+                return '%s:%d' % (self.val, i+1)
+            self.s.add(self.id, directory=False)
             revs = []
-            for s in range(10):
-                revs.append(self.s.commit(self.commit_msg,
-                                          self.commit_body,
-                                          allow_empty=True))
+            for i in range(10):
+                self.s.set(self.id, val(i))
+                revs.append(self.s.commit('%s: %d' % (self.commit_msg, i),
+                                          self.commit_body))
             for i in range(10):
                 rev = self.s.revision_id(i+1) 
                 self.failUnless(rev == revs[i],