Rev 4665: Settle with --take-this and --take-other as action names. in file:///home/vila/src/bzr/experimental/conflict-manager/

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue Feb 2 12:52:14 GMT 2010


At file:///home/vila/src/bzr/experimental/conflict-manager/

------------------------------------------------------------
revno: 4665
revision-id: v.ladeuil+lp at free.fr-20100202125213-h08auwpb9zbtvjmb
parent: v.ladeuil+lp at free.fr-20100116101012-1voidp4u4o0g2psn
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: dont-add-conflict-helpers
timestamp: Tue 2010-02-02 13:52:13 +0100
message:
  Settle with --take-this and --take-other as action names.
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2010-01-16 10:06:21 +0000
+++ b/NEWS	2010-02-02 12:52:13 +0000
@@ -45,8 +45,8 @@
   ``locations.conf`` or ``branch.conf``.
   (Ted Gould, Matthew Fuller, Vincent Ladeuil)
 
-* Tree-shape conflicts can be resolved by providing ``--keep-mine`` and
-  ``--take-theirs`` to the ``bzr resolve`` command. Just marking the conflict
+* Tree-shape conflicts can be resolved by providing ``--take-this`` and
+  ``--take-other`` to the ``bzr resolve`` command. Just marking the conflict
   as resolved is still accessible via the ``--done`` default action.
   (Vincent Ladeuil)
 

=== modified file 'bzrlib/conflicts.py'
--- a/bzrlib/conflicts.py	2010-01-16 10:06:21 +0000
+++ b/bzrlib/conflicts.py	2010-02-02 12:52:13 +0000
@@ -81,10 +81,10 @@
 resolve_action_registry.register(
     'done', 'done', 'Marks the conflict as resolved' )
 resolve_action_registry.register(
-    'keep-mine', 'keep_mine',
+    'take-this', 'take_this',
     'Resolve the conflict preserving the version in the working tree' )
 resolve_action_registry.register(
-    'take-theirs', 'take_theirs',
+    'take-other', 'take_other',
     'Resolve the conflict taking the merged version into account' )
 resolve_action_registry.default_key = 'done'
 
@@ -420,11 +420,11 @@
         # This method does nothing but simplifies the design of upper levels.
         pass
 
-    def keep_mine(self, tree):
-        raise NotImplementedError(self.keep_mine)
+    def take_this(self, tree):
+        raise NotImplementedError(self.take_this)
 
-    def take_theirs(self, tree):
-        raise NotImplementedError(self.take_theirs)
+    def take_other(self, tree):
+        raise NotImplementedError(self.take_other)
 
 
 class PathConflict(Conflict):
@@ -450,10 +450,10 @@
         # No additional files have been generated here
         pass
 
-    def keep_mine(self, tree):
+    def take_this(self, tree):
         tree.rename_one(self.conflict_path, self.path)
 
-    def take_theirs(self, tree):
+    def take_other(self, tree):
         # just acccept bzr proposal
         pass
 
@@ -477,11 +477,11 @@
 
     # FIXME: I smell something weird here and it seems we should be able to be
     # more coherent with some other conflict ? bzr *did* a choice there but
-    # neither keep_mine nor take_theirs reflect that... -- vila 091224
-    def keep_mine(self, tree):
+    # neither take_this nor take_other reflect that... -- vila 091224
+    def take_this(self, tree):
         tree.remove([self.path + '.OTHER'], force=True, keep_files=False)
 
-    def take_theirs(self, tree):
+    def take_other(self, tree):
         tree.remove([self.path], force=True, keep_files=False)
 
 
@@ -578,11 +578,11 @@
 
     format = 'Conflict adding file %(conflict_path)s.  %(action)s %(path)s.'
 
-    def keep_mine(self, tree):
+    def take_this(self, tree):
         tree.remove([self.conflict_path], force=True, keep_files=False)
         tree.rename_one(self.path, self.conflict_path)
 
-    def take_theirs(self, tree):
+    def take_other(self, tree):
         tree.remove([self.path], force=True, keep_files=False)
 
 
@@ -601,11 +601,11 @@
 
     format = 'Conflict moving %(conflict_path)s into %(path)s.  %(action)s.'
 
-    def keep_mine(self, tree):
+    def take_this(self, tree):
         # just acccept bzr proposal
         pass
 
-    def take_theirs(self, tree):
+    def take_other(self, tree):
         # FIXME: We shouldn't have to manipulate so many paths here (and there
         # is probably a bug or two...)
         base_path = osutils.basename(self.path)
@@ -637,10 +637,10 @@
     # FIXME: We silently do nothing to make tests pass, but most probably the
     # conflict shouldn't exist (the long story is that the conflict is
     # generated with another one that can be resolved properly) -- vila 091224
-    def keep_mine(self, tree):
+    def take_this(self, tree):
         pass
 
-    def take_theirs(self, tree):
+    def take_other(self, tree):
         pass
 
 
@@ -655,10 +655,10 @@
 
     format = 'Conflict adding files to %(path)s.  %(action)s.'
 
-    def keep_mine(self, tree):
+    def take_this(self, tree):
         tree.remove([self.path], force=True, keep_files=False)
 
-    def take_theirs(self, tree):
+    def take_other(self, tree):
         # just acccept bzr proposal
         pass
 
@@ -677,11 +677,11 @@
     # FIXME: It's a bit strange that the default action is not coherent with
     # MissingParent from the *user* pov.
 
-    def keep_mine(self, tree):
+    def take_this(self, tree):
         # just acccept bzr proposal
         pass
 
-    def take_theirs(self, tree):
+    def take_other(self, tree):
         tree.remove([self.path], force=True, keep_files=False)
 
 
@@ -695,23 +695,23 @@
     format = "Conflict: %(path)s is not a directory, but has files in it."\
              "  %(action)s."
 
-    def keep_mine(self, tree):
+    def take_this(self, tree):
         # FIXME: we should preserve that path when the conflict is generated !
         if self.path.endswith('.new'):
             conflict_path = self.path[:-(len('.new'))]
             tree.remove([self.path], force=True, keep_files=False)
             tree.add(conflict_path)
         else:
-            raise NotImplementedError(self.keep_mine)
+            raise NotImplementedError(self.take_this)
 
-    def take_theirs(self, tree):
+    def take_other(self, tree):
         # FIXME: we should preserve that path when the conflict is generated !
         if self.path.endswith('.new'):
             conflict_path = self.path[:-(len('.new'))]
             tree.remove([conflict_path], force=True, keep_files=False)
             tree.rename_one(self.path, conflict_path)
         else:
-            raise NotImplementedError(self.take_theirs)
+            raise NotImplementedError(self.take_other)
 
 
 ctype = {}

=== modified file 'bzrlib/help_topics/en/conflict-types.txt'
--- a/bzrlib/help_topics/en/conflict-types.txt	2010-01-16 10:06:21 +0000
+++ b/bzrlib/help_topics/en/conflict-types.txt	2010-02-02 12:52:13 +0000
@@ -106,11 +106,11 @@
 
 .. TODO: There are 6 ways to resolve text conflicts:
    1. Manually
-   1. prefer-mine choose THIS in conflicted regions
-   1. prefer-theirs choose OTHER in conflicted regions
-   1. keep-both take THIS and OTHER in conflicted regions
-   1. keep-mine take THIS overriding all cleanly merged modifications
-   1. take-theirs take OTHER overriding all cleanly merged modifications
+   1. prefer-this choose THIS in conflicted regions
+   1. prefer-other choose OTHER in conflicted regions
+   1. take-both take THIS and OTHER in conflicted regions
+   1. take-this take THIS overriding all cleanly merged modifications
+   1. take-other take OTHER overriding all cleanly merged modifications
 
 Content conflicts
 -----------------
@@ -134,8 +134,8 @@
 
 ``bzr resolve`` recognizes the following actions:
 
-- ``--action=keep-mine`` will issue ``bzr mv FILE.THIS FILE``,
-- ``--action=take-theirs`` will issue ``bzr mv FILE.OTHER FILE``,
+- ``--action=take-this`` will issue ``bzr mv FILE.THIS FILE``,
+- ``--action=take-other`` will issue ``bzr mv FILE.OTHER FILE``,
 - ``--action=done`` will just mark the conflict as resolved.
 
 Any action will also delete the previously generated ``.BASE``, ``.THIS`` and
@@ -184,8 +184,8 @@
 
 ``bzr resolve`` recognizes the following actions:
 
-- ``--action=keep-mine`` will issue ``bzr mv FILE.moved FILE``,
-- ``--action=take-theirs`` will issue ``bzr rm FILE.moved``,
+- ``--action=take-this`` will issue ``bzr rm FILE ; bzr mv FILE.moved FILE``,
+- ``--action=take-other`` will issue ``bzr rm FILE.moved``,
 - ``--action=done`` will just mark the conflict as resolved.
 
 Note that you must get rid of FILE.moved before using ``--action=done``.
@@ -228,8 +228,8 @@
 
 ``bzr resolve`` recognizes the following actions:
 
-- ``--action=keep-mine`` will issue ``bzr rm directory`` including the children,
-- ``--action=take-theirs`` will acknowledge Bazaar choice to keep the children
+- ``--action=take-this`` will issue ``bzr rm directory`` including the children,
+- ``--action=take-other`` will acknowledge Bazaar choice to keep the children
   and restoring the directory,
 - ``--action=done`` will just mark the conflict as resolved.
 
@@ -253,8 +253,8 @@
 
 ``bzr resolve`` recognizes the following actions:
 
-- ``--action=keep-mine`` will acknowledge Bazaar choice to keep the directory,
-- ``--action=take-theirs`` will issue ``bzr rm directory`` including the 
+- ``--action=take-this`` will acknowledge Bazaar choice to keep the directory,
+- ``--action=take-other`` will issue ``bzr rm directory`` including the 
   children,
 - ``--action=done`` will just mark the conflict as resolved.
 
@@ -278,9 +278,9 @@
 
 ``bzr resolve`` recognizes the following actions:
 
-- ``--action=keep-mine`` will revert Bazaar choice and keep ``PATH1`` by
+- ``--action=take-this`` will revert Bazaar choice and keep ``PATH1`` by
   issuing ``bzr mv PATH2 PATH1``,
-- ``--action=take-theirs`` will acknowledge Bazaar choice of keeping ``PATH2``,
+- ``--action=take-other`` will acknowledge Bazaar choice of keeping ``PATH2``,
 - ``--action=done`` will just mark the conflict as resolved.
 
 Bazaar cannot auto-detect when conflicts of this kind have been resolved.
@@ -315,9 +315,9 @@
 
 ``bzr resolve`` recognizes the following actions:
 
-- ``--action=keep-mine`` will acknowledge Bazaar choice of leaving ``white`` 
+- ``--action=take-this`` will acknowledge Bazaar choice of leaving ``white`` 
   in ``black``,
-- ``--action=take-theirs`` will revert Bazaar choice and move ``black`` in
+- ``--action=take-other`` will revert Bazaar choice and move ``black`` in
   ``white`` by issuing ``bzr mv black/white white ; bzr mv black white``,
 - ``--action=done`` will just mark the conflict as resolved.
 
@@ -352,9 +352,9 @@
 
 ``bzr resolve`` recognizes the following actions:
 
-- ``--action=keep-mine`` will issue ``bzr rm --force foo.new`` and 
+- ``--action=take-this`` will issue ``bzr rm --force foo.new`` and 
   ``bzr add foo``,
-- ``--action=take-theirs`` will issue ``bzr rm --force foo`` and 
+- ``--action=take-other`` will issue ``bzr rm --force foo`` and 
   ``bzr mv foo.new foo``,
 - ``--action=done`` will just mark the conflict as resolved.
 

=== modified file 'bzrlib/tests/test_conflicts.py'
--- a/bzrlib/tests/test_conflicts.py	2010-01-06 11:18:45 +0000
+++ b/bzrlib/tests/test_conflicts.py	2010-02-02 12:52:13 +0000
@@ -217,29 +217,29 @@
 2>1 conflicts encountered.
 """
 
-    def test_keep_mine(self):
+    def test_take_this(self):
         self.run_script("""
 $ bzr rm file.OTHER --force # a simple rm file.OTHER is valid too
 $ bzr resolve file
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
-    def test_take_theirs(self):
+    def test_take_other(self):
         self.run_script("""
 $ bzr mv file.OTHER file
 $ bzr resolve file
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
-    def test_resolve_keeping_mine(self):
+    def test_resolve_taking_this(self):
         self.run_script("""
-$ bzr resolve --keep-mine file
+$ bzr resolve --take-this file
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
-    def test_resolve_taking_theirs(self):
+    def test_resolve_taking_other(self):
         self.run_script("""
-$ bzr resolve --take-theirs file
+$ bzr resolve --take-other file
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
@@ -286,15 +286,15 @@
 """)
         self.failIfExists('branch/file2.moved')
 
-    def test_resolve_keeping_mine(self):
+    def test_resolve_taking_this(self):
         self.run_script("""
-$ bzr resolve --keep-mine file2
+$ bzr resolve --take-this file2
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
-    def test_resolve_taking_theirs(self):
+    def test_resolve_taking_other(self):
         self.run_script("""
-$ bzr resolve --take-theirs file2
+$ bzr resolve --take-other file2
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
@@ -328,14 +328,14 @@
 2>2 conflicts encountered.
 """
 
-    def test_keep_mine(self):
+    def test_take_this(self):
         self.run_script("""
 $ bzr rm dir  --force
 $ bzr resolve dir
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
-    def test_take_theirs(self):
+    def test_take_other(self):
         self.run_script("""
 $ bzr resolve dir
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
@@ -390,15 +390,15 @@
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
-    def test_resolve_keeping_mine(self):
+    def test_resolve_taking_this(self):
         self.run_script("""
-$ bzr resolve --keep-mine dir
+$ bzr resolve --take-this dir
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
-    def test_resolve_taking_theirs(self):
+    def test_resolve_taking_other(self):
         self.run_script("""
-$ bzr resolve --take-theirs dir
+$ bzr resolve --take-other dir
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
@@ -450,15 +450,15 @@
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
-    def test_resolve_keeping_mine(self):
+    def test_resolve_taking_this(self):
         self.run_script("""
-$ bzr resolve --keep-mine dir
+$ bzr resolve --take-this dir
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
-    def test_resolve_taking_theirs(self):
+    def test_resolve_taking_other(self):
         self.run_script("""
-$ bzr resolve --take-theirs dir
+$ bzr resolve --take-other dir
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
@@ -498,15 +498,15 @@
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
-    def test_resolve_keeping_mine(self):
+    def test_resolve_taking_this(self):
         self.run_script("""
-$ bzr resolve --keep-mine file-in-branch
+$ bzr resolve --take-this file-in-branch
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
-    def test_resolve_taking_theirs(self):
+    def test_resolve_taking_other(self):
         self.run_script("""
-$ bzr resolve --take-theirs file-in-branch
+$ bzr resolve --take-other file-in-branch
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
@@ -532,13 +532,13 @@
 2>1 conflicts encountered.
 """
 
-    def test_keep_mine(self):
+    def test_take_this(self):
         self.run_script("""
 $ bzr resolve dir2
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
-    def test_take_theirs(self):
+    def test_take_other(self):
         self.run_script("""
 $ bzr mv dir2/dir1 dir1
 $ bzr mv dir2 dir1
@@ -546,16 +546,16 @@
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
-    def test_resolve_keeping_mine(self):
+    def test_resolve_taking_this(self):
         self.run_script("""
-$ bzr resolve --keep-mine dir2
+$ bzr resolve --take-this dir2
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
         self.failUnlessExists('dir2')
 
-    def test_resolve_taking_theirs(self):
+    def test_resolve_taking_other(self):
         self.run_script("""
-$ bzr resolve --take-theirs dir2
+$ bzr resolve --take-other dir2
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
         self.failUnlessExists('dir1')
@@ -587,7 +587,7 @@
 2>1 conflicts encountered.
 """
 
-    def test_keep_mine(self):
+    def test_take_this(self):
         self.run_script("""
 $ bzr rm foo.new --force
 # FIXME: Isn't it weird that foo is now unkown even if foo.new has been put
@@ -597,7 +597,7 @@
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
-    def test_take_theirs(self):
+    def test_take_other(self):
         self.run_script("""
 $ bzr rm foo --force
 $ bzr mv foo.new foo
@@ -605,15 +605,15 @@
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
-    def test_resolve_keeping_mine(self):
+    def test_resolve_taking_this(self):
         self.run_script("""
-$ bzr resolve --keep-mine foo.new
+$ bzr resolve --take-this foo.new
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
-    def test_resolve_taking_theirs(self):
+    def test_resolve_taking_other(self):
         self.run_script("""
-$ bzr resolve --take-theirs foo.new
+$ bzr resolve --take-other foo.new
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
@@ -663,14 +663,14 @@
         opts, args = self.parse(['--action', 'done'])
         self.assertEqual({'action':'done'}, opts)
 
-    def test_keep_mine(self):
-        opts, args = self.parse(['--action', 'keep-mine'])
-        self.assertEqual({'action': 'keep_mine'}, opts)
-        opts, args = self.parse(['--keep-mine'])
-        self.assertEqual({'action': 'keep_mine'}, opts)
+    def test_take_this(self):
+        opts, args = self.parse(['--action', 'take-this'])
+        self.assertEqual({'action': 'take_this'}, opts)
+        opts, args = self.parse(['--take-this'])
+        self.assertEqual({'action': 'take_this'}, opts)
 
-    def test_take_theirs(self):
-        opts, args = self.parse(['--action', 'take-theirs'])
-        self.assertEqual({'action': 'take_theirs'}, opts)
-        opts, args = self.parse(['--take-theirs'])
-        self.assertEqual({'action': 'take_theirs'}, opts)
+    def test_take_other(self):
+        opts, args = self.parse(['--action', 'take-other'])
+        self.assertEqual({'action': 'take_other'}, opts)
+        opts, args = self.parse(['--take-other'])
+        self.assertEqual({'action': 'take_other'}, opts)



More information about the bazaar-commits mailing list