Rev 5892: Simplify code and fix the test. in file:///home/vila/src/bzr/reviews/330063-merge-non-existing/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Wed May 25 20:43:16 UTC 2011
At file:///home/vila/src/bzr/reviews/330063-merge-non-existing/
------------------------------------------------------------
revno: 5892
revision-id: v.ladeuil+lp at free.fr-20110525204316-j9mjhu9usylbey06
parent: jriddell at canonical.com-20110520094505-afgqlk7cclkj5667
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 330063-merge-non-existing
timestamp: Wed 2011-05-25 22:43:16 +0200
message:
Simplify code and fix the test.
-------------- next part --------------
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2011-05-20 09:45:05 +0000
+++ b/bzrlib/builtins.py 2011-05-25 20:43:16 +0000
@@ -4003,14 +4003,11 @@
self.sanity_check_merger(merger)
if (merger.base_rev_id == merger.other_rev_id and
merger.other_rev_id is not None):
- # check if location is nonexistent file (and not a branch)
- if location is not None:
- source_tree, rest_of_path = WorkingTree.open_containing(location)
- if rest_of_path == "":
- location_is_branch = True
- else:
- location_is_branch = False
- if not location_is_branch and not source_tree.has_filename(location):
+ # check if location is a nonexistent file (and not a branch) to
+ # disambiguate the 'Nothing to do'
+ if merger.interesting_files:
+ if not merger.other_tree.has_filename(
+ merger.interesting_files[0]):
raise errors.PathsDoNotExist([location])
note('Nothing to do.')
return 0
=== modified file 'bzrlib/tests/blackbox/test_merge.py'
--- a/bzrlib/tests/blackbox/test_merge.py 2011-05-18 10:52:14 +0000
+++ b/bzrlib/tests/blackbox/test_merge.py 2011-05-25 20:43:16 +0000
@@ -356,7 +356,7 @@
"""It should not be possible to merge changes from a file which
does not exist."""
tree_a = self.make_branch_and_tree('tree_a')
- self.run_bzr_error(('Nonexistent file specified',),
+ self.run_bzr_error(('Path\(s\) do not exist: non/existing',),
['merge', 'non/existing'])
def pullable_branch(self):
More information about the bazaar-commits
mailing list