Rev 3615: (jam) In reference to bug #232188, in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Aug 8 03:45:40 BST 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3615
revision-id: pqm at pqm.ubuntu.com-20080808024534-ff7wyd3vnhtpbat2
parent: pqm at pqm.ubuntu.com-20080807233123-dgabwwjxlfwzvz51
parent: john at arbash-meinel.com-20080808021019-e08to54j55sumn1g
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2008-08-08 03:45:34 +0100
message:
  (jam) In reference to bug #232188,
  	always pick a revision which modified a line,
  	rather than a merge revision.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/annotate.py             annotate.py-20050922133147-7c60541d2614f022
  bzrlib/tests/test_annotate.py  test_annotate.py-20061213215015-sttc9agsxomls7q0-1
    ------------------------------------------------------------
    revno: 3588.3.2
    revision-id: john at arbash-meinel.com-20080808021019-e08to54j55sumn1g
    parent: john at arbash-meinel.com-20080729165043-i7acukekx2luhcru
    parent: pqm at pqm.ubuntu.com-20080807005717-qxnuq9je71bt9tcs
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: simple_annotate
    timestamp: Thu 2008-08-07 21:10:19 -0500
    message:
      Merge bzr.dev 3613, resolve NEWS
    added:
      bzrlib/tests/test_pack_repository.py test_pack_repository-20080801043947-eaw0e6h2gu75kwmy-1
      bzrlib/tests/test_upgrade_stacked.py test_upgrade_stacked-20080804072225-jd13yami19nskns5-1
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzr                            bzr.py-20050313053754-5485f144c7006fa6
      bzrlib/__init__.py             __init__.py-20050309040759-33e65acf91bbcd5d
      bzrlib/branchbuilder.py        branchbuilder.py-20070427022007-zlxpqz2lannhk6y8-1
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/commit.py               commit.py-20050511101309-79ec1a0168e0e825
      bzrlib/dirstate.py             dirstate.py-20060728012006-d6mvoihjb3je9peu-1
      bzrlib/errors.py               errors.py-20050309040759-20512168c4e14fbd
      bzrlib/export/dir_exporter.py  dir_exporter.py-20051114235828-b51397f56bc7b117
      bzrlib/export/tar_exporter.py  tar_exporter.py-20051114235828-1f6349a2f090a5d0
      bzrlib/export/zip_exporter.py  zip_exporter.py-20051114235828-8f57f954fba6497e
      bzrlib/inventory.py            inventory.py-20050309040759-6648b84ca2005b37
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
      bzrlib/merge_directive.py      merge_directive.py-20070228184838-ja62280spt1g7f4x-1
      bzrlib/osutils.py              osutils.py-20050309040759-eeaff12fbf77ac86
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
      bzrlib/repofmt/weaverepo.py    presplitout.py-20070125045333-wfav3tsh73oxu3zk-1
      bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      bzrlib/tests/blackbox/test_commit.py test_commit.py-20060212094538-ae88fc861d969db0
      bzrlib/tests/blackbox/test_export.py test_export.py-20051229024010-e6c26658e460fb1c
      bzrlib/tests/blackbox/test_status.py teststatus.py-20050712014354-508855eb9f29f7dc
      bzrlib/tests/branch_implementations/test_stacking.py test_stacking.py-20080214020755-msjlkb7urobwly0f-1
      bzrlib/tests/test_branch.py    test_branch.py-20060116013032-97819aa07b8ab3b5
      bzrlib/tests/test_branchbuilder.py test_branchbuilder.p-20070427022007-zlxpqz2lannhk6y8-2
      bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
      bzrlib/tests/test_errors.py    test_errors.py-20060210110251-41aba2deddf936a8
      bzrlib/tests/test_memorytree.py test_memorytree.py-20060906023413-4wlkalbdpsxi2r4y-3
      bzrlib/tests/test_merge_directive.py test_merge_directive-20070228184838-ja62280spt1g7f4x-2
      bzrlib/tests/test_options.py   testoptions.py-20051014093702-96457cfc86319a8f
      bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
      bzrlib/tests/test_selftest.py  test_selftest.py-20051202044319-c110a115d8c0456a
      bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
      bzrlib/tests/test_tree.py      test_tree.py-20060724065232-khgrr0vvmt6ih0mi-1
      bzrlib/tests/workingtree_implementations/test_commit.py test_commit.py-20060421013633-1610ec2331c8190f
      bzrlib/tests/workingtree_implementations/test_remove.py test_remove.py-20070413183901-rvnp85rtc0q0sclp-1
      bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
      bzrlib/transport/remote.py     ssh.py-20060608202016-c25gvf1ob7ypbus6-1
      bzrlib/transport/sftp.py       sftp.py-20051019050329-ab48ce71b7e32dfe
      bzrlib/tree.py                 tree.py-20050309040759-9d5f2496be663e77
      bzrlib/upgrade.py              history2weaves.py-20050818063535-e7d319791c19a8b2
      bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
      bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
      doc/developers/HACKING.txt     HACKING-20050805200004-2a5dc975d870f78c
    ------------------------------------------------------------
    revno: 3588.3.1
    revision-id: john at arbash-meinel.com-20080729165043-i7acukekx2luhcru
    parent: pqm at pqm.ubuntu.com-20080729093250-b1g7zu2k1pj0mswe
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: simple_annotate
    timestamp: Tue 2008-07-29 11:50:43 -0500
    message:
      Simple patch to the annotate logic to handle bug #232188
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/annotate.py             annotate.py-20050922133147-7c60541d2614f022
      bzrlib/tests/test_annotate.py  test_annotate.py-20061213215015-sttc9agsxomls7q0-1
=== modified file 'NEWS'
--- a/NEWS	2008-08-07 00:28:43 +0000
+++ b/NEWS	2008-08-08 02:10:19 +0000
@@ -19,6 +19,13 @@
     * ``bzr upgrade`` on remote branches accessed via bzr:// and
       bzr+ssh:// now works.  (Andrew Bennetts)
 
+    * The default ``annotate`` logic will now always assign the
+      last-modified value of a line to one of the revisions that modified
+      it, rather than a merge revision. This would happen when both sides
+      claimed to have modified the line resulting in the same text. The
+      choice is arbitrary but stable, so merges in different directions
+      will get the same results.  (John Arbash Meinel, #232188)
+
   API CHANGES:
 
   INTERNALS:

=== modified file 'bzrlib/annotate.py'
--- a/bzrlib/annotate.py	2008-06-18 07:56:09 +0000
+++ b/bzrlib/annotate.py	2008-07-29 16:50:43 +0000
@@ -285,16 +285,9 @@
                     if len(heads) == 1:
                         output_append((iter(heads).next(), left[1]))
                     else:
-                        # Both claim different origins
-                        output_append((revision_id, left[1]))
-                        # We know that revision_id is the head for
-                        # left and right, so cache it
-                        heads_provider.cache(
-                            (revision_id, left[0]),
-                            (revision_id,))
-                        heads_provider.cache(
-                            (revision_id, right[0]),
-                            (revision_id,))
+                        # Both claim different origins, sort lexicographically
+                        # so that we always get a stable result.
+                        output_append(sorted([left, right])[0])
         last_child_idx = child_idx + match_len
 
 

=== modified file 'bzrlib/tests/test_annotate.py'
--- a/bzrlib/tests/test_annotate.py	2008-02-18 22:19:41 +0000
+++ b/bzrlib/tests/test_annotate.py	2008-07-29 16:50:43 +0000
@@ -116,7 +116,7 @@
 #  |\
 #  A B  # line should be annotated as new for A and B
 #  |\|
-#  C D  # line should 'converge' and say D
+#  C D  # line should 'converge' and say A
 #  |/
 #  E    # D should supersede A and stay as D (not become E because C references
 #         A)
@@ -150,14 +150,14 @@
 
 duplicate_D = annotation("""\
 rev-base first
-rev-D alt-second
+rev-A alt-second
 rev-base third
 rev-D fourth-D
 """)
 
 duplicate_E = annotation("""\
 rev-base first
-rev-D alt-second
+rev-A alt-second
 rev-base third
 rev-E fourth-E
 """)
@@ -184,7 +184,7 @@
                      committer="joe at foo.com",
                      timestamp=1166046000.00, timezone=0)
 
-        tree2 = tree1.bzrdir.clone('tree2').open_workingtree()
+        tree2 = tree1.bzrdir.sprout('tree2').open_workingtree()
 
         self.build_tree_contents([('tree1/a', 'first\nsecond\n')])
         tree1.commit('b', rev_id='rev-2',
@@ -235,7 +235,7 @@
         tree1, tree2 = self.create_merged_trees()
         tree1.unlock()
 
-        tree3 = tree2.bzrdir.clone('tree3').open_workingtree()
+        tree3 = tree2.bzrdir.sprout('tree3').open_workingtree()
 
         tree2.commit('noop', rev_id='rev-1_1_2')
         self.assertEqual(0, tree1.merge_from_branch(tree2.branch))
@@ -246,7 +246,7 @@
                      committer='jerry at foo.com',
                      timestamp=1166046003.00, timezone=0)
 
-        tree4 = tree3.bzrdir.clone('tree4').open_workingtree()
+        tree4 = tree3.bzrdir.sprout('tree4').open_workingtree()
 
         tree3.commit('noop', rev_id='rev-1_2_2',
                      committer='jerry at foo.com',
@@ -275,7 +275,7 @@
         self.build_tree_contents([('tree1/file', base_text)])
         tree1.add(['file'], ['file-id'])
         tree1.commit('base', rev_id='rev-base')
-        tree2 = tree1.bzrdir.clone('tree2').open_workingtree()
+        tree2 = tree1.bzrdir.sprout('tree2').open_workingtree()
 
         self.build_tree_contents([('tree1/file', a_text),
                                   ('tree2/file', b_text)])




More information about the bazaar-commits mailing list