Rev 4624: Address some Andrew's review points. in file:///home/vila/src/bzr/bugs/529968-content-conflict-rename-on-resolve/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Tue Mar 2 07:30:28 GMT 2010
At file:///home/vila/src/bzr/bugs/529968-content-conflict-rename-on-resolve/
------------------------------------------------------------
revno: 4624
revision-id: v.ladeuil+lp at free.fr-20100302073027-96nrfbr9dw6vk13n
parent: v.ladeuil+lp at free.fr-20100301145106-v79eogiexrbv08ko
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 529968-content-conflict-rename-on-resolve
timestamp: Tue 2010-03-02 08:30:27 +0100
message:
Address some Andrew's review points.
* bzrlib/conflicts.py:
(ContentsConflict._take_it): Use a better parameter name to avoid
confusion.
* NEWS:
Fix typos.
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS 2010-03-01 14:51:06 +0000
+++ b/NEWS 2010-03-02 07:30:27 +0000
@@ -79,8 +79,8 @@
* ``bzr remove-tree`` can now remove multiple working trees.
(Jared Hance, Andrew Bennetts, #253137)
-* ``bzr resolve --take-{this|other}`` now correctly rename the kept file
- on content conflicts where one side deleted the file.
+* ``bzr resolve --take-this`` and ``--take-other`` now correctly renames
+ the kept file on content conflicts where one side deleted the file.
(Vincent Ladeuil, #529968)
* ``bzr upgrade`` now names backup directory as ``backup.bzr.~N~`` instead
=== modified file 'bzrlib/conflicts.py'
--- a/bzrlib/conflicts.py 2010-03-01 14:51:06 +0000
+++ b/bzrlib/conflicts.py 2010-03-02 07:30:27 +0000
@@ -479,30 +479,29 @@
def associated_filenames(self):
return [self.path + suffix for suffix in ('.BASE', '.OTHER')]
- def _take_it(self, tree, suffix):
+ def _take_it(self, tree, suffix_to_remove):
"""Resolve the conflict.
- :param tree: The working tree where the confict is resolved.
- :param suffix: Either 'THIS' or 'OTHER'
+ :param tree: The working tree where the conflict is resolved.
+ :param suffix_to_remove: Either 'THIS' or 'OTHER'
The resolution is symmetric, when taking THIS, OTHER is deleted and
item.THIS is renamed into item and vice-versa.
-
- Note that suffix='OTHER' really means takes 'THIS' and vice-versa.
"""
tt = transform.TreeTransform(tree)
try:
try:
- # Delete 'item.THIS' or 'item.OTHER' depending on suffix
+ # Delete 'item.THIS' or 'item.OTHER' depending on
+ # suffix_to_remove
tt.delete_contents(
- tt.trans_id_tree_path(self.path + '.' + suffix))
+ tt.trans_id_tree_path(self.path + '.' + suffix_to_remove))
except errors.NoSuchFile:
- # There are valid cases where 'item.suffix' either never
- # existed or was already deleted (including the case where the
- # user deleted it)
+ # There are valid cases where 'item.suffix_to_remove' either
+ # never existed or was already deleted (including the case
+ # where the user deleted it)
pass
- # Rename 'item.suffix' (note that if 'item.suffix' has been
- # deleted, this is a no-op)
+ # Rename 'item.suffix_to_remove' (note that if
+ # 'item.suffix_to_remove' has been deleted, this is a no-op)
this_tid = tt.trans_id_file_id(self.file_id)
parent_tid = tt.get_tree_parent(this_tid)
tt.adjust_path(self.path, parent_tid, this_tid)
More information about the bazaar-commits
mailing list