Rev 4630: Implement --interactive for DeletingParent noting the inconsistency. in file:///home/vila/src/bzr/experimental/conflict-manager/

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Oct 19 16:06:25 BST 2009


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

------------------------------------------------------------
revno: 4630
revision-id: v.ladeuil+lp at free.fr-20091019150625-g63lnhrvph8zzax1
parent: v.ladeuil+lp at free.fr-20091019150227-nyq6wfn3ac9o9b14
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: description
timestamp: Mon 2009-10-19 17:06:25 +0200
message:
  Implement --interactive for DeletingParent noting the inconsistency.
  
  * bzrlib/tests/test_conflicts.py:
  (TestResolveDeletingParent): Tests for --interactive.
  
  * bzrlib/conflicts.py:
  (DeletingParent): Add actions for --interactive.
-------------- next part --------------
=== modified file 'bzrlib/conflicts.py'
--- a/bzrlib/conflicts.py	2009-10-19 15:02:27 +0000
+++ b/bzrlib/conflicts.py	2009-10-19 15:06:25 +0000
@@ -574,6 +574,16 @@
     format = "Conflict: can't delete %(path)s because it is not empty.  "\
              "%(action)s."
 
+    # FIXME: It's a bit strange that the default action is not coherent with
+    # MissingParent from the *user* pov.
+
+    def keep_mine(self, tree):
+        # just acccept bzr proposal
+        pass
+
+    def take_theirs(self, tree):
+        tree.remove([self.path], force=True, keep_files=False)
+
 
 class NonDirectoryParent(HandledConflict):
     """An attempt to add files to a directory that is not a director or

=== modified file 'bzrlib/tests/test_conflicts.py'
--- a/bzrlib/tests/test_conflicts.py	2009-10-19 15:02:27 +0000
+++ b/bzrlib/tests/test_conflicts.py	2009-10-19 15:06:25 +0000
@@ -456,6 +456,20 @@
 $ bzr commit --strict -m 'No more conflicts nor unknown files'
 """)
 
+    def test_resolve_keeping_mine(self):
+        self.run_script("""
+$ bzr resolve --interactive dir
+<keep_mine
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
+""")
+
+    def test_resolve_taking_theirs(self):
+        self.run_script("""
+$ bzr resolve --interactive dir
+<take_theirs
+$ bzr commit --strict -m 'No more conflicts nor unknown files'
+""")
+
 
 class TestResolvePathConflict(TestResolveConflicts):
 



More information about the bazaar-commits mailing list