Rev 5537: (vila) More feedback about the conflicts just resolved and the remaining in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Nov 11 08:45:20 GMT 2010


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

------------------------------------------------------------
revno: 5537 [merge]
revision-id: pqm at pqm.ubuntu.com-20101111084519-bmk1zmblp7kex41a
parent: pqm at pqm.ubuntu.com-20101110024048-b19eazmjae5jtgk0
parent: v.ladeuil+lp at free.fr-20101110111550-hwo8h7gn8s3h6tdn
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2010-11-11 08:45:19 +0000
message:
  (vila) More feedback about the conflicts just resolved and the remaining
   ones. (Vincent Ladeuil)
added:
  bzrlib/tests/blackbox/test_resolve.py test_resolve.py-20101103145514-ygpa369r69hhxsmi-1
modified:
  bzrlib/conflicts.py            conflicts.py-20051001061850-78ef952ba63d2b42
  bzrlib/tests/blackbox/__init__.py __init__.py-20051128053524-eba30d8255e08dc3
  bzrlib/tests/blackbox/test_conflicts.py test_conflicts.py-20060228151432-9723ebb925b999cf
  bzrlib/tests/test_conflicts.py test_conflicts.py-20051006031059-e2dad9bbeaa5891f
  doc/en/release-notes/bzr-2.3.txt NEWS-20050323055033-4e00b5db738777ff
  doc/en/whats-new/whats-new-in-2.3.txt whatsnewin2.3.txt-20100818072501-x2h25r7jbnknvy30-1
=== modified file 'bzrlib/conflicts.py'
--- a/bzrlib/conflicts.py	2010-11-07 13:38:56 +0000
+++ b/bzrlib/conflicts.py	2010-11-07 16:09:43 +0000
@@ -159,7 +159,9 @@
                 # conflict.auto(tree) --vila 091242
                 pass
         else:
-            resolve(tree, file_list, action=action)
+            before, after = resolve(tree, file_list, action=action)
+            trace.note('%d conflict(s) resolved, %d remaining'
+                       % (before - after, after))
 
 
 def resolve(tree, paths=None, ignore_misses=False, recursive=False,
@@ -178,8 +180,10 @@
     :param action: How the conflict should be resolved,
     """
     tree.lock_tree_write()
+    nb_conflicts_after = None
     try:
         tree_conflicts = tree.conflicts()
+        nb_conflicts_before = len(tree_conflicts)
         if paths is None:
             new_conflicts = ConflictList()
             to_process = tree_conflicts
@@ -193,11 +197,15 @@
             except NotImplementedError:
                 new_conflicts.append(conflict)
         try:
+            nb_conflicts_after = len(new_conflicts)
             tree.set_conflicts(new_conflicts)
         except errors.UnsupportedOperation:
             pass
     finally:
         tree.unlock()
+    if nb_conflicts_after is None:
+        nb_conflicts_after = nb_conflicts_before
+    return nb_conflicts_before, nb_conflicts_after
 
 
 def restore(filename):

=== modified file 'bzrlib/tests/blackbox/__init__.py'
--- a/bzrlib/tests/blackbox/__init__.py	2010-10-15 11:30:54 +0000
+++ b/bzrlib/tests/blackbox/__init__.py	2010-11-07 16:09:43 +0000
@@ -99,6 +99,7 @@
                      'test_remove',
                      'test_re_sign',
                      'test_remove_tree',
+                     'test_resolve',
                      'test_revert',
                      'test_revno',
                      'test_revision_history',

=== modified file 'bzrlib/tests/blackbox/test_conflicts.py'
--- a/bzrlib/tests/blackbox/test_conflicts.py	2010-11-07 13:38:56 +0000
+++ b/bzrlib/tests/blackbox/test_conflicts.py	2010-11-07 16:32:51 +0000
@@ -21,158 +21,61 @@
     )
 from bzrlib.tests import script
 
-
-# FIXME: These don't really look at the output of the conflict commands, just
-# the number of lines - there should be more examination.
-
-class TestConflictsBase(tests.TestCaseWithTransport):
+def make_tree_with_conflicts(test, this_path='this', other_path='other'):
+    this_tree = test.make_branch_and_tree(this_path)
+    test.build_tree_contents([
+        ('%s/myfile' % (this_path,), 'this content\n'),
+        ('%s/my_other_file' % (this_path,), 'this content\n'),
+        ('%s/mydir/' % (this_path,),),
+        ])
+    this_tree.add('myfile')
+    this_tree.add('my_other_file')
+    this_tree.add('mydir')
+    this_tree.commit(message="new")
+    other_tree = this_tree.bzrdir.sprout(other_path).open_workingtree()
+    test.build_tree_contents([
+        ('%s/myfile' % (other_path,), 'contentsb\n'),
+        ('%s/my_other_file' % (other_path,), 'contentsb\n'),
+        ])
+    other_tree.rename_one('mydir', 'mydir2')
+    other_tree.commit(message="change")
+    test.build_tree_contents([
+        ('%s/myfile' % (this_path,), 'contentsa2\n'),
+        ('%s/my_other_file' % (this_path,), 'contentsa2\n'),
+        ])
+    this_tree.rename_one('mydir', 'mydir3')
+    this_tree.commit(message='change')
+    this_tree.merge_from_branch(other_tree.branch)
+    return this_tree, other_tree
+
+
+class TestConflicts(script.TestCaseWithTransportAndScript):
 
     def setUp(self):
-        super(TestConflictsBase, self).setUp()
-        self.make_tree_with_conflicts()
-
-    def make_tree_with_conflicts(self):
-        a_tree = self.make_branch_and_tree('a')
-        self.build_tree_contents([
-            ('a/myfile', 'contentsa\n'),
-            ('a/my_other_file', 'contentsa\n'),
-            ('a/mydir/',),
-            ])
-        a_tree.add('myfile')
-        a_tree.add('my_other_file')
-        a_tree.add('mydir')
-        a_tree.commit(message="new")
-        b_tree = a_tree.bzrdir.sprout('b').open_workingtree()
-        self.build_tree_contents([
-            ('b/myfile', 'contentsb\n'),
-            ('b/my_other_file', 'contentsb\n'),
-            ])
-        b_tree.rename_one('mydir', 'mydir2')
-        b_tree.commit(message="change")
-        self.build_tree_contents([
-            ('a/myfile', 'contentsa2\n'),
-            ('a/my_other_file', 'contentsa2\n'),
-            ])
-        a_tree.rename_one('mydir', 'mydir3')
-        a_tree.commit(message='change')
-        a_tree.merge_from_branch(b_tree.branch)
-
-    def run_bzr(self, cmd, working_dir='a', **kwargs):
-        return super(TestConflictsBase, self).run_bzr(
-            cmd, working_dir=working_dir, **kwargs)
-
-
-class TestConflicts(TestConflictsBase):
+        super(TestConflicts, self).setUp()
+        make_tree_with_conflicts(self, 'branch', 'other')
 
     def test_conflicts(self):
-        out, err = self.run_bzr('conflicts')
-        self.assertEqual(3, len(out.splitlines()))
+        self.run_script("""\
+$ cd branch
+$ bzr conflicts
+Text conflict in my_other_file
+Path conflict: mydir3 / mydir2
+Text conflict in myfile
+""")
 
     def test_conflicts_text(self):
-        out, err = self.run_bzr('conflicts --text')
-        self.assertEqual(['my_other_file', 'myfile'], out.splitlines())
+        self.run_script("""\
+$ cd branch
+$ bzr conflicts --text
+my_other_file
+myfile
+""")
 
     def test_conflicts_directory(self):
-        """Test --directory option"""
-        out, err = self.run_bzr('conflicts --directory a', working_dir='.')
-        self.assertEqual(3, len(out.splitlines()))
-        self.assertEqual('', err)
-
-
-class TestResolve(TestConflictsBase):
-
-    def test_resolve(self):
-        self.run_bzr('resolve myfile')
-        out, err = self.run_bzr('conflicts')
-        self.assertEqual(2, len(out.splitlines()))
-        self.run_bzr('resolve my_other_file')
-        self.run_bzr('resolve mydir2')
-        out, err = self.run_bzr('conflicts')
-        self.assertEqual(0, len(out.splitlines()))
-
-    def test_resolve_all(self):
-        self.run_bzr('resolve --all')
-        out, err = self.run_bzr('conflicts')
-        self.assertEqual(0, len(out.splitlines()))
-
-    def test_resolve_in_subdir(self):
-        """resolve when run from subdirectory should handle relative paths"""
-        self.build_tree(["a/subdir/"])
-        self.run_bzr("resolve ../myfile", working_dir='a/subdir')
-        self.run_bzr("resolve ../a/myfile", working_dir='b')
-        wt = workingtree.WorkingTree.open_containing('b')[0]
-        conflicts = wt.conflicts()
-        self.assertEqual(True, conflicts.is_empty(),
-                         "tree still contains conflicts: %r" % conflicts)
-
-    def test_resolve_via_directory(self):
-        """resolve when run from subdirectory should handle relative paths"""
-        self.build_tree(["a/subdir/"])
-        self.run_bzr("resolve -d a/subdir ../myfile")
-
-    def test_auto_resolve(self):
-        """Text conflicts can be resolved automatically"""
-        tree = self.make_branch_and_tree('tree')
-        self.build_tree_contents([('tree/file',
-            '<<<<<<<\na\n=======\n>>>>>>>\n')])
-        tree.add('file', 'file_id')
-        self.assertEqual(tree.kind('file_id'), 'file')
-        file_conflict = conflicts.TextConflict('file', file_id='file_id')
-        tree.set_conflicts(conflicts.ConflictList([file_conflict]))
-        note = self.run_bzr('resolve', retcode=1, working_dir='tree')[1]
-        self.assertContainsRe(note, '0 conflict\\(s\\) auto-resolved.')
-        self.assertContainsRe(note,
-            'Remaining conflicts:\nText conflict in file')
-        self.build_tree_contents([('tree/file', 'a\n')])
-        note = self.run_bzr('resolve', working_dir='tree')[1]
-        self.assertContainsRe(note, 'All conflicts resolved.')
-
-    def test_resolve_all_directory(self):
-        """Test --directory option"""
-        out, err = self.run_bzr('resolve --all -d a', working_dir='.')
-        self.assertEqual('', err)
-        out, err = self.run_bzr('conflicts')
-        self.assertEqual(0, len(out.splitlines()))
-
-class TestResolveSilentlyIgnore(script.TestCaseWithTransportAndScript):
-
-    def test_bug_646961(self):
         self.run_script("""\
-            $ bzr init base
-            Created a standalone tree (format: 2a)
-            $ cd base
-            $ echo >file1
-            $ bzr add
-            adding file1
-            $ bzr ci -m "stuff"
-            2>Committing to: .../base/
-            2>added file1
-            2>Committed revision 1.
-            $ cd ..
-            $ bzr branch base branch
-            2>Branched 1 revision(s).
-            $ cd base
-            $ echo "1" >> file1
-            $ bzr ci -m "branch 1"
-            2>Committing to: .../base/
-            2>modified file1
-            2>Committed revision 2.
-            $ cd ../branch
-            $ echo "2" >> file1
-            $ bzr ci -m "branch 2"
-            2>Committing to: .../branch/
-            2>modified file1
-            2>Committed revision 2.
-            $ cd ../base
-            $ bzr merge ../branch
-            2> M  file1
-            2>Text conflict in file1
-            2>1 conflicts encountered.
-            # The following succeeds silently without resolving the conflict
-            $ bzr resolve file1 --take-other
-            # The following wil fail when --take-other is implemented
-            # for text conflicts
-            $ bzr conflicts
-            Text conflict in file1
-            """)
-
+$ bzr conflicts  -d branch
+Text conflict in my_other_file
+Path conflict: mydir3 / mydir2
+Text conflict in myfile
+""")

=== added file 'bzrlib/tests/blackbox/test_resolve.py'
--- a/bzrlib/tests/blackbox/test_resolve.py	1970-01-01 00:00:00 +0000
+++ b/bzrlib/tests/blackbox/test_resolve.py	2010-11-07 16:09:43 +0000
@@ -0,0 +1,138 @@
+# Copyright (C) 2010 Canonical Ltd
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+from bzrlib import (
+    conflicts,
+    tests,
+    )
+from bzrlib.tests import script
+from bzrlib.tests.blackbox import test_conflicts
+
+
+class TestResolve(script.TestCaseWithTransportAndScript):
+
+    def setUp(self):
+        super(TestResolve, self).setUp()
+        test_conflicts.make_tree_with_conflicts(self, 'branch', 'other')
+
+    def test_resolve_one_by_one(self):
+        self.run_script("""\
+$ cd branch
+$ bzr conflicts
+Text conflict in my_other_file
+Path conflict: mydir3 / mydir2
+Text conflict in myfile
+$ bzr resolve myfile
+2>1 conflict(s) resolved, 2 remaining
+$ bzr resolve my_other_file
+2>1 conflict(s) resolved, 1 remaining
+$ bzr resolve mydir2
+2>1 conflict(s) resolved, 0 remaining
+""")
+
+    def test_resolve_all(self):
+        self.run_script("""\
+$ cd branch
+$ bzr resolve --all
+2>3 conflict(s) resolved, 0 remaining
+$ bzr conflicts
+""")
+
+    def test_resolve_from_subdir(self):
+        self.run_script("""\
+$ mkdir branch/subdir
+$ cd branch/subdir
+$ bzr resolve ../myfile
+2>1 conflict(s) resolved, 2 remaining
+""")
+
+    def test_resolve_via_directory_option(self):
+        self.run_script("""\
+$ bzr resolve -d branch myfile
+2>1 conflict(s) resolved, 2 remaining
+""")
+
+    def test_resolve_all_via_directory_option(self):
+        self.run_script("""\
+$ bzr resolve -d branch --all
+2>3 conflict(s) resolved, 0 remaining
+$ bzr conflicts -d branch
+""")
+
+
+class TestResolveAuto(tests.TestCaseWithTransport):
+
+    def test_auto_resolve(self):
+        """Text conflicts can be resolved automatically"""
+        tree = self.make_branch_and_tree('tree')
+        self.build_tree_contents([('tree/file',
+            '<<<<<<<\na\n=======\n>>>>>>>\n')])
+        tree.add('file', 'file_id')
+        self.assertEqual(tree.kind('file_id'), 'file')
+        file_conflict = conflicts.TextConflict('file', file_id='file_id')
+        tree.set_conflicts(conflicts.ConflictList([file_conflict]))
+        note = self.run_bzr('resolve', retcode=1, working_dir='tree')[1]
+        self.assertContainsRe(note, '0 conflict\\(s\\) auto-resolved.')
+        self.assertContainsRe(note,
+            'Remaining conflicts:\nText conflict in file')
+        self.build_tree_contents([('tree/file', 'a\n')])
+        note = self.run_bzr('resolve', working_dir='tree')[1]
+        self.assertContainsRe(note, 'All conflicts resolved.')
+
+
+class TestResolveSilentlyIgnore(script.TestCaseWithTransportAndScript):
+
+    def test_bug_646961(self):
+        self.run_script("""\
+            $ bzr init base
+            Created a standalone tree (format: 2a)
+            $ cd base
+            $ echo >file1
+            $ bzr add
+            adding file1
+            $ bzr ci -m "stuff"
+            2>Committing to: .../base/
+            2>added file1
+            2>Committed revision 1.
+            $ cd ..
+            $ bzr branch base branch
+            2>Branched 1 revision(s).
+            $ cd base
+            $ echo "1" >> file1
+            $ bzr ci -m "branch 1"
+            2>Committing to: .../base/
+            2>modified file1
+            2>Committed revision 2.
+            $ cd ../branch
+            $ echo "2" >> file1
+            $ bzr ci -m "branch 2"
+            2>Committing to: .../branch/
+            2>modified file1
+            2>Committed revision 2.
+            $ cd ../base
+            $ bzr merge ../branch
+            2> M  file1
+            2>Text conflict in file1
+            2>1 conflicts encountered.
+            # The following succeeds silently without resolving the conflict
+            $ bzr resolve file1 --take-other
+            2>0 conflict(s) resolved, 1 remaining
+            # The following wil fail when --take-other is implemented
+            # for text conflicts
+            $ bzr conflicts
+            Text conflict in file1
+            """)
+

=== modified file 'bzrlib/tests/test_conflicts.py'
--- a/bzrlib/tests/test_conflicts.py	2010-09-14 10:17:30 +0000
+++ b/bzrlib/tests/test_conflicts.py	2010-11-10 11:15:50 +0000
@@ -26,26 +26,13 @@
     tests,
     workingtree,
     )
-from bzrlib.tests import script
-
-
-def load_tests(standard_tests, module, loader):
-    result = loader.suiteClass()
-
-    sp_tests, remaining_tests = tests.split_suite_by_condition(
-        standard_tests, tests.condition_isinstance((
-                TestParametrizedResolveConflicts,
-                )))
-    # Each test class defines its own scenarios. This is needed for
-    # TestResolvePathConflictBefore531967 that verifies that the same tests as
-    # TestResolvePathConflict still pass.
-    for test in tests.iter_suite_tests(sp_tests):
-        tests.apply_scenarios(test, test.scenarios(), result)
-
-    # No parametrization for the remaining tests
-    result.addTests(remaining_tests)
-
-    return result
+from bzrlib.tests import (
+    script,
+    scenarios,
+    )
+
+
+load_tests = scenarios.load_tests_apply_scenarios
 
 
 # TODO: Test commit with some added, and added-but-missing files
@@ -293,34 +280,31 @@
     _this = None
     _other = None
 
-    @staticmethod
-    def scenarios():
-        """Return the scenario list for the conflict type defined by the class.
-
-        Each scenario is of the form:
-        (common, (left_name, left_dict), (right_name, right_dict))
-
-        * common is a dict
-
-        * left_name and right_name are the scenario names that will be combined
-
-        * left_dict and right_dict are the attributes specific to each half of
-          the scenario. They should include at least 'actions' and 'check' and
-          will be available as '_this' and '_other' test instance attributes.
-
-        Daughters classes are free to add their specific attributes as they see
-        fit in any of the three dicts.
-
-        This is a class method so that load_tests can find it.
-
-        '_base_actions' in the common dict, 'actions' and 'check' in the left
-        and right dicts use names that map to methods in the test classes. Some
-        prefixes are added to these names to get the correspong methods (see
-        _get_actions() and _get_check()). The motivation here is to avoid
-        collisions in the class namespace.
-        """
-        # Only concrete classes return actual scenarios
-        return []
+    scenarios = []
+    """The scenario list for the conflict type defined by the class.
+
+    Each scenario is of the form:
+    (common, (left_name, left_dict), (right_name, right_dict))
+
+    * common is a dict
+
+    * left_name and right_name are the scenario names that will be combined
+
+    * left_dict and right_dict are the attributes specific to each half of
+      the scenario. They should include at least 'actions' and 'check' and
+      will be available as '_this' and '_other' test instance attributes.
+
+    Daughters classes are free to add their specific attributes as they see
+    fit in any of the three dicts.
+
+    This is a class method so that load_tests can find it.
+
+    '_base_actions' in the common dict, 'actions' and 'check' in the left
+    and right dicts use names that map to methods in the test classes. Some
+    prefixes are added to these names to get the correspong methods (see
+    _get_actions() and _get_check()). The motivation here is to avoid
+    collisions in the class namespace.
+    """
 
     def setUp(self):
         super(TestParametrizedResolveConflicts, self).setUp()
@@ -390,16 +374,15 @@
 
 class TestResolveContentsConflict(TestParametrizedResolveConflicts):
 
-    _conflict_type = conflicts.ContentsConflict,
+    _conflict_type = conflicts.ContentsConflict
 
-    # Set by load_tests from scenarios()
+    # Set by the scenarios
     # path and file-id for the file involved in the conflict
     _path = None
     _file_id = None
 
-    @staticmethod
-    def scenarios():
-        base_scenarios = [
+    scenarios = mirror_scenarios(
+        [
             # File modified/deleted
             (dict(_base_actions='create_file',
                   _path='file', _file_id='file-id'),
@@ -407,8 +390,7 @@
               dict(actions='modify_file', check='file_has_more_content')),
              ('file_deleted',
               dict(actions='delete_file', check='file_doesnt_exist')),),
-            ]
-        return mirror_scenarios(base_scenarios)
+            ])
 
     def do_create_file(self):
         return [('add', ('file', 'file-id', 'file', 'trunk content\n'))]
@@ -436,17 +418,16 @@
 
 class TestResolvePathConflict(TestParametrizedResolveConflicts):
 
-    _conflict_type = conflicts.PathConflict,
+    _conflict_type = conflicts.PathConflict
 
     def do_nothing(self):
         return []
 
-    @staticmethod
-    def scenarios():
-        # Each side dict additionally defines:
-        # - path path involved (can be '<deleted>')
-        # - file-id involved
-        base_scenarios = [
+    # Each side dict additionally defines:
+    # - path path involved (can be '<deleted>')
+    # - file-id involved
+    scenarios = mirror_scenarios(
+        [
             # File renamed/deleted
             (dict(_base_actions='create_file'),
              ('file_renamed',
@@ -483,8 +464,7 @@
              ('dir_renamed2',
               dict(actions='rename_dir2', check='dir_renamed2',
                    path='new-dir2', file_id='dir-id')),),
-        ]
-        return mirror_scenarios(base_scenarios)
+            ])
 
     def do_create_file(self):
         return [('add', ('file', 'file-id', 'file', 'trunk content\n'))]
@@ -568,14 +548,10 @@
 
 class TestResolveDuplicateEntry(TestParametrizedResolveConflicts):
 
-    _conflict_type = conflicts.DuplicateEntry,
+    _conflict_type = conflicts.DuplicateEntry
 
-    @staticmethod
-    def scenarios():
-        # Each side dict additionally defines:
-        # - path involved
-        # - file-id involved
-        base_scenarios = [
+    scenarios = mirror_scenarios(
+        [
             # File created with different file-ids
             (dict(_base_actions='nothing'),
              ('filea_created',
@@ -584,8 +560,7 @@
              ('fileb_created',
               dict(actions='create_file_b', check='file_content_b',
                    path='file', file_id='file-b-id')),),
-            ]
-        return mirror_scenarios(base_scenarios)
+            ])
 
     def do_nothing(self):
         return []
@@ -649,12 +624,14 @@
         self.run_script("""
 $ bzr rm -q dir  --force
 $ bzr resolve dir
+2>2 conflict(s) resolved, 0 remaining
 $ bzr commit -q --strict -m 'No more conflicts nor unknown files'
 """)
 
     def test_take_other(self):
         self.run_script("""
 $ bzr resolve dir
+2>2 conflict(s) resolved, 0 remaining
 $ bzr commit -q --strict -m 'No more conflicts nor unknown files'
 """)
 
@@ -688,6 +665,7 @@
     def test_keep_them_all(self):
         self.run_script("""
 $ bzr resolve dir
+2>2 conflict(s) resolved, 0 remaining
 $ bzr commit -q --strict -m 'No more conflicts nor unknown files'
 """)
 
@@ -696,6 +674,7 @@
 $ bzr mv -q dir/file2 file2
 $ bzr rm -q dir --force
 $ bzr resolve dir
+2>2 conflict(s) resolved, 0 remaining
 $ bzr commit -q --strict -m 'No more conflicts nor unknown files'
 """)
 
@@ -703,6 +682,7 @@
         self.run_script("""
 $ bzr rm -q dir --force
 $ bzr resolve dir
+2>2 conflict(s) resolved, 0 remaining
 $ bzr commit -q --strict -m 'No more conflicts nor unknown files'
 """)
 
@@ -749,6 +729,7 @@
     def test_keep_them_all(self):
         self.run_script("""
 $ bzr resolve dir
+2>2 conflict(s) resolved, 0 remaining
 $ bzr commit -q --strict -m 'No more conflicts nor unknown files'
 """)
 
@@ -757,6 +738,7 @@
 $ bzr mv -q dir/file2 file2
 $ bzr rm -q dir --force
 $ bzr resolve dir
+2>2 conflict(s) resolved, 0 remaining
 $ bzr commit -q --strict -m 'No more conflicts nor unknown files'
 """)
 
@@ -764,12 +746,14 @@
         self.run_script("""
 $ bzr rm -q dir --force
 $ bzr resolve dir
+2>2 conflict(s) resolved, 0 remaining
 $ bzr commit -q --strict -m 'No more conflicts nor unknown files'
 """)
 
     def test_resolve_taking_this(self):
         self.run_script("""
 $ bzr resolve --take-this dir
+2>2 conflict(s) resolved, 0 remaining
 $ bzr commit -q --strict -m 'No more conflicts nor unknown files'
 """)
 
@@ -778,25 +762,25 @@
 $ bzr resolve --take-other dir
 2>deleted dir/file2
 2>deleted dir
+2>2 conflict(s) resolved, 0 remaining
 $ bzr commit -q --strict -m 'No more conflicts nor unknown files'
 """)
 
 
 class TestResolveParentLoop(TestParametrizedResolveConflicts):
 
-    _conflict_type = conflicts.ParentLoop,
+    _conflict_type = conflicts.ParentLoop
 
     _this_args = None
     _other_args = None
 
-    @staticmethod
-    def scenarios():
-        # Each side dict additionally defines:
-        # - dir_id: the directory being moved
-        # - target_id: The target directory
-        # - xfail: whether the test is expected to fail if the action is
-        #     involved as 'other'
-        base_scenarios = [
+    # Each side dict additionally defines:
+    # - dir_id: the directory being moved
+    # - target_id: The target directory
+    # - xfail: whether the test is expected to fail if the action is
+    #   involved as 'other'
+    scenarios = mirror_scenarios(
+        [
             # Dirs moved into each other
             (dict(_base_actions='create_dir1_dir2'),
              ('dir1_into_dir2',
@@ -813,8 +797,7 @@
              ('dir3_into_dir2',
               dict(actions='move_dir3_into_dir2', check='dir3_4_moved',
                    dir_id='dir3-id', target_id='dir2-id', xfail=True))),
-            ]
-        return mirror_scenarios(base_scenarios)
+            ])
 
     def do_create_dir1_dir2(self):
         return [('add', ('dir1', 'dir1-id', 'directory', '')),
@@ -909,6 +892,7 @@
 # aside ? -- vila 090916
 $ bzr add -q foo
 $ bzr resolve foo.new
+2>1 conflict(s) resolved, 0 remaining
 $ bzr commit -q --strict -m 'No more conflicts nor unknown files'
 """)
 
@@ -917,6 +901,7 @@
 $ bzr rm -q foo --force
 $ bzr mv -q foo.new foo
 $ bzr resolve foo
+2>1 conflict(s) resolved, 0 remaining
 $ bzr commit -q --strict -m 'No more conflicts nor unknown files'
 """)
 

=== modified file 'doc/en/release-notes/bzr-2.3.txt'
--- a/doc/en/release-notes/bzr-2.3.txt	2010-11-10 02:01:33 +0000
+++ b/doc/en/release-notes/bzr-2.3.txt	2010-11-10 11:15:50 +0000
@@ -31,6 +31,10 @@
   options matching a given regular expression is now controlled via the
   ``--all`` option.  (Vincent Ladeuil, bug #670251)
 
+* ``bzr resolve`` now reports the number of conflicts resolved and the
+  number of remaining conflicts. This provides a better feedback about the
+  whole resolution process. (Vincent Ladeuil)
+
 Bug Fixes
 *********
 

=== modified file 'doc/en/whats-new/whats-new-in-2.3.txt'
--- a/doc/en/whats-new/whats-new-in-2.3.txt	2010-11-06 15:37:17 +0000
+++ b/doc/en/whats-new/whats-new-in-2.3.txt	2010-11-07 16:09:43 +0000
@@ -111,6 +111,9 @@
   default behaviour is specified (if needed) by setting the variable to
   ``conflict``.  (Vincent Ladeuil, #323111)
 
+* ``bzr resolve`` now provides more feedback about the conflicts just
+  resolved and the remaining ones. (Vincent Ladeuil)
+
 Documentation
 *************
 




More information about the bazaar-commits mailing list