Rev 103: Loosen requirements about text parents a bit - check text sha1s instead. in file:///data/jelmer/bzr-rebase/trunk/

Jelmer Vernooij jelmer at samba.org
Sun Aug 31 21:30:23 BST 2008


At file:///data/jelmer/bzr-rebase/trunk/

------------------------------------------------------------
revno: 103
revision-id: jelmer at samba.org-20080831203021-42yc10rrvcp08ybl
parent: vmiklos at frugalware.org-20080803083633-ypioh4lxc20c30s0
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Sun 2008-08-31 22:30:21 +0200
message:
  Loosen requirements about text parents a bit - check text sha1s instead.
modified:
  rebase.py                      rebase.py-20070626221123-ellanmf93nw8z9r1-1
  test_rebase.py                 test_rebase.py-20070626221123-ellanmf93nw8z9r1-2
=== modified file 'rebase.py'
--- a/rebase.py	2008-07-19 08:08:45 +0000
+++ b/rebase.py	2008-08-31 20:30:21 +0000
@@ -380,7 +380,7 @@
                     # make sure at least one of the new parents contains 
                     # the ie.file_id, ie.revision combination
                     if (len(filter(lambda inv: ie.file_id in inv and
-                        inv[ie.file_id].revision == ie.revision, parent_invs))
+                        inv[ie.file_id].text_sha1 == ie.text_sha1, parent_invs))
                         == 0):
                         raise ReplayParentsInconsistent(ie.file_id, ie.revision)
                 i += 1

=== modified file 'test_rebase.py'
--- a/test_rebase.py	2008-07-19 08:08:45 +0000
+++ b/test_rebase.py	2008-08-31 20:30:21 +0000
@@ -387,14 +387,14 @@
 
     def test_two_revisions(self):
         wt = self.make_branch_and_tree("old")
-        self.build_tree(['old/afile', 'old/notherfile'])
+        self.build_tree_contents([('old/afile', 'afilecontents'), ('old/notherfile', 'notherfilecontents')])
         wt.add(["afile"], ["somefileid"])
         wt.commit("bla", rev_id="oldparent")
         wt.add(["notherfile"])
         wt.commit("bla", rev_id="oldcommit")
         oldrepos = wt.branch.repository
         wt = self.make_branch_and_tree("new")
-        self.build_tree(['new/afile', 'new/notherfile'])
+        self.build_tree_contents([('new/afile', 'afilecontents'), ('new/notherfile', 'notherfilecontents')])
         wt.add(["afile"], ["afileid"])
         wt.commit("bla", rev_id="newparent")
         wt.branch.repository.fetch(oldrepos)
@@ -435,7 +435,9 @@
 
     def test_multi_revisions(self):
         wt = self.make_branch_and_tree("old")
-        self.build_tree(['old/afile', 'old/sfile', 'old/notherfile'])
+        self.build_tree_contents([('old/afile', 'afilecontent'), 
+                         ('old/sfile', 'sfilecontent'),
+                         ('old/notherfile', 'notherfilecontent')])
         wt.add(['sfile'])
         wt.add(["afile"], ["somefileid"])
         wt.commit("bla", rev_id="oldgrandparent")
@@ -445,7 +447,9 @@
         wt.commit("bla", rev_id="oldcommit")
         oldrepos = wt.branch.repository
         wt = self.make_branch_and_tree("new")
-        self.build_tree(['new/afile', 'new/sfile', 'new/notherfile'])
+        self.build_tree_contents([('new/afile', 'afilecontent'), 
+                         ('new/sfile', 'sfilecontent'),
+                         ('new/notherfile', 'notherfilecontent')])
         wt.add(['sfile'])
         wt.add(["afile"], ["afileid"])
         wt.commit("bla", rev_id="newgrandparent")




More information about the bazaar-commits mailing list