[Pkg-bazaar-commits] ./bzr/unstable r717: - correctly set parent list when committing first

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:20:49 UTC 2009


------------------------------------------------------------
revno: 717
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Mon 2005-06-20 14:57:46 +1000
message:
  - correctly set parent list when committing first
    revision to a branch
modified:
  bzrlib/commit.py
-------------- next part --------------
=== modified file 'bzrlib/commit.py'
--- a/bzrlib/commit.py	2005-06-17 10:10:09 +0000
+++ b/bzrlib/commit.py	2005-06-20 04:57:46 +0000
@@ -118,13 +118,6 @@
         # ever actually does anything special
         inv_sha1 = branch.get_inventory_sha1(inv_id)
 
-        precursor_id = branch.last_patch()
-        if precursor_id:
-            precursor_sha1 = branch.get_revision_sha1(precursor_id)
-        else:
-            precursor_sha1 = None
-        parent = RevisionReference(precursor_id, precursor_sha1)
-
         branch._write_inventory(work_inv)
 
         if timestamp == None:
@@ -144,7 +137,11 @@
                        inventory_id=inv_id,
                        inventory_sha1=inv_sha1,
                        revision_id=rev_id)
-        rev.parents = [parent]
+
+        precursor_id = branch.last_patch()
+        if precursor_id:
+            precursor_sha1 = branch.get_revision_sha1(precursor_id)
+            rev.parents = [RevisionReference(precursor_id, precursor_sha1)]
 
         rev_tmp = tempfile.TemporaryFile()
         rev.write_xml(rev_tmp)



More information about the Pkg-bazaar-commits mailing list