Rev 5811: (vila) Merge 2.3 into trunk resolving conflicts (Vincent Ladeuil) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Apr 28 13:13:52 UTC 2011


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

------------------------------------------------------------
revno: 5811 [merge]
revision-id: pqm at pqm.ubuntu.com-20110428131349-dt632s6r8p3qewxb
parent: pqm at pqm.ubuntu.com-20110428103012-4mp8o2h32tluszv7
parent: v.ladeuil+lp at free.fr-20110428122634-rzbnq9u3aircltdo
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2011-04-28 13:13:49 +0000
message:
  (vila) Merge 2.3 into trunk resolving conflicts (Vincent Ladeuil)
modified:
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/tests/blackbox/test_merge.py test_merge.py-20060323225809-9bc0459c19917f41
  doc/en/release-notes/bzr-2.3.txt NEWS-20050323055033-4e00b5db738777ff
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2011-04-19 12:54:46 +0000
+++ b/bzrlib/builtins.py	2011-04-28 12:26:34 +0000
@@ -3999,7 +3999,7 @@
             merger.other_rev_id is not None):
             note('Nothing to do.')
             return 0
-        if pull:
+        if pull and not preview:
             if merger.interesting_files is not None:
                 raise errors.BzrCommandError('Cannot pull individual files')
             if (merger.base_rev_id == tree.last_revision()):

=== modified file 'bzrlib/tests/blackbox/test_merge.py'
--- a/bzrlib/tests/blackbox/test_merge.py	2011-04-15 07:01:22 +0000
+++ b/bzrlib/tests/blackbox/test_merge.py	2011-04-28 12:26:34 +0000
@@ -19,8 +19,11 @@
 """Black-box tests for bzr merge.
 """
 
+import doctest
 import os
 
+from testtools import matchers
+
 from bzrlib import (
     branch,
     bzrdir,
@@ -351,13 +354,13 @@
 
     def pullable_branch(self):
         tree_a = self.make_branch_and_tree('a')
-        self.build_tree(['a/file'])
+        self.build_tree_contents([('a/file', 'bar\n')])
         tree_a.add(['file'])
         self.id1 = tree_a.commit('commit 1')
 
         tree_b = self.make_branch_and_tree('b')
         tree_b.pull(tree_a.branch)
-        file('b/file', 'wb').write('foo')
+        self.build_tree_contents([('b/file', 'foo\n')])
         self.id2 = tree_b.commit('commit 2')
 
     def test_merge_pull(self):
@@ -368,6 +371,21 @@
         tree_a = workingtree.WorkingTree.open('.')
         self.assertEqual([self.id2], tree_a.get_parent_ids())
 
+    def test_merge_pull_preview(self):
+        self.pullable_branch()
+        (out, err) = self.run_bzr('merge --pull --preview -d a b')
+        self.assertThat(out, matchers.DocTestMatches(
+"""=== modified file 'file'
+--- file\t...
++++ file\t...
+@@ -1,1 +1,1 @@
+-bar
++foo
+
+""", doctest.ELLIPSIS | doctest.REPORT_UDIFF))
+        tree_a = workingtree.WorkingTree.open('a')
+        self.assertEqual([self.id1], tree_a.get_parent_ids())
+
     def test_merge_kind_change(self):
         tree_a = self.make_branch_and_tree('tree_a')
         self.build_tree_contents([('tree_a/file', 'content_1')])

=== modified file 'doc/en/release-notes/bzr-2.3.txt'
--- a/doc/en/release-notes/bzr-2.3.txt	2011-04-11 09:38:59 +0000
+++ b/doc/en/release-notes/bzr-2.3.txt	2011-04-28 12:26:34 +0000
@@ -45,6 +45,10 @@
   normally not require running ``bzr whoami`` first.
   (Martin Pool, #616878)
 
+* ``bzr merge --preview --pull`` should respect the ``--preview`` option
+  first, and not actually change the branch tip revision.
+  (John Arbash Meinel, Dennis Duchier, #760152)
+
 * ``bzr push`` into a repository (that doesn't have a branch), will no
   longer copy all revisions in the repository. Only the ones in the
   ancestry of the source branch, like it does in all other cases.




More information about the bazaar-commits mailing list