hi, <br><br>here goes try number 4<br>see attached zipped bundle, and the total diff for easy reviewing.<br><br><br><div><span class="gmail_quote">On 1/3/07, <b class="gmail_sendername">Aaron Bentley</b> &lt;<a href="mailto:aaron.bentley@utoronto.ca" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
aaron.bentley@utoronto.ca
</a>&gt; wrote:</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>=== modified file &#39;bzrlib/builtins.py&#39; (properties changed)<br><br>^^^ I don&#39;t think it makes sense to set builtins.py executable.</blockquote><div><br>I don&#39;t know how this happened, I obviously wasn&#39;t on the lookout for this sort of thing when committing, but&nbsp; I&#39;ve undid all the files that became executable (hope I didn&#39;t stuff up again!) :
<br>bzrlib/builtins.py <br>bzrlib/tests/blackbox/test_mv.py <br>bzrlib/tests/workingtree_implementations/test_workingtree.py <br>bzrlib/workingtree.py<br><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">





=== modified file &#39;bzrlib/errors.py&#39;<br>+class FilesExist(PathError):<br>+&nbsp;&nbsp;&nbsp;&nbsp;&quot;&quot;&quot;Used when reporting that files do exist&quot;&quot;&quot;<br>+<br>+&nbsp;&nbsp;&nbsp;&nbsp;_fmt = &quot;File%(plural)s exist: %(paths_as_string)s%(extra)s&quot;
<br>+<br>+&nbsp;&nbsp;&nbsp;&nbsp;def __init__(self, paths, extra=None):<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# circular import<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from bzrlib.osutils import quotefn<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BzrError.__init__(self)<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.paths = paths<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.paths_as_string





 = &#39; &#39;.join(paths)<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if extra:<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.extra = &#39;: &#39; + str(extra)<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else:<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.extra = &#39;&#39;<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if len(paths) &gt; 1:<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.plural





 = &#39;s&#39;<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else:<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.plural = &#39;&#39;<br><br>^^^ I&#39;m dubious about trying to generate correct English plurals for<br>error strings -- we&#39;ve always just done &quot;File(s) exist&quot;.&nbsp;&nbsp;You don&#39;t have
<br>to change this, it&#39;s just my reaction.</blockquote><div><br>I was also ok with file(s), but in the end it is more user friendly to handle plurals properly. <br>John sort of complained about this, and since I think this exception is suited to one or more
<br>files, I thought this is the best way to address this.<br>John&#39;s complaint:<br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><span>





&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;self.run_bzr_error(</span><br><span>&gt; - &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[&quot;^bzr: ERROR: can&#39;t rename: both, old name .* and new name .*&quot;</span><br><span>&gt; - &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot; exist. Use option &#39;--after&#39; to force rename.&quot;],
</span><br><span></span><div style="direction: ltr;">&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[&quot;^bzr: ERROR: File\(s\) exist: .+ .+: can&#39;t rename.&quot;<br></div><div style="direction: ltr;"><span>&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot; Use option &#39;--after&#39; to force rename.&quot;],
<br><br></span></div><div style="direction: ltr;">^- You shouldn&#39;t need &quot;File(s)&quot; it should just be Files, since you know<br>there are 2 files. Though it makes me wonder if the right exception is<br>being used.
</div></blockquote><br><br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">@@ -147,3 +152,151 @@<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.run_bzr(&#39;mv&#39;, &#39;c/b&#39;, &#39;b&#39;)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tree = workingtree.WorkingTree.open(&#39;.&#39;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.assertEqual(&#39;b-id&#39;, tree.path2id(&#39;b&#39;))<br>+<br>+&nbsp;&nbsp;&nbsp;&nbsp;def test_mv_already_moved_file(self):<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;&quot;&quot;a is in repository, b does not exist. User does
<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mv a b; bzr mv a b&quot;&quot;&quot;<br>....<br>
Finally, I&#39;m not sure what the point of committing the files is.&nbsp;&nbsp;&#39;bzr<br>mv&#39; doesn&#39;t and shouldn&#39;t care whether or not the files have been committed.</blockquote><div>ok I&#39;ve removed them, I think it was thought that they might be handled differently.
<br>the tests pass without them and if you assume they should be handled the <br>the same, the commits are not really needed.<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
- --- bzrlib/tests/workingtree_implementations/test_workingtree.py<br>2006-09-10 19:04:48 +0000<br>+++ bzrlib/tests/workingtree_implementations/test_workingtree.py<br>2007-01-03 02:46:14 +0000<br>@@ -681,3 +681,50 @@
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tree.add, [u&#39;a\u030a&#39;])<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; finally:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osutils.normalized_filename = orig<br>+&nbsp;&nbsp;&nbsp;&nbsp;def test_move_deprecated_wrong_call(self):<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;&quot;&quot;tree.move has the deprecated parameter &#39;to_name&#39;.
<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;It has been replaced by &#39;to_dir&#39; for consistency.<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Test the new API using wrong parameter&quot;&quot;&quot;<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.build_tree([&#39;a1&#39;, &#39;sub1/&#39;])<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tree = 
self.make_branch_and_tree
(&#39;.&#39;)<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tree.add([&#39;a1&#39;, &#39;sub1&#39;])<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tree.commit(&#39;initial commit&#39;)<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.assertRaises(TypeError, tree.move, [&#39;a1&#39;],<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to_this_parameter_does_not_exist=&#39;sub1&#39;,
<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;after=False)<br><br>^^^ This is probably superfluous with the following test.&nbsp;&nbsp;I must admit<br>I thought you were obsoleting (not just deprecating) the parameter, at<br>first.<br><br>+&nbsp;&nbsp;&nbsp;&nbsp;def test_move_deprecated_deprecated_call(self):
</blockquote><div>(This was done by Steffen Eichenberg, not me. <br>I&#39;m just trying to fix it up to a commitable state remember,<br>I suppose thats makes me responsible.)<br>Is it ok if I leave this, it seems to be there for a good cause:
<br>test that we can now and in the future use the named and<br>unnamed api of .move<br><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is the new mode introduced<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in version 0.13.<br><br>More like version 0.14.&nbsp;&nbsp;I think.&nbsp;&nbsp;Hey, who&#39;s flying this plane, anyway?<br></blockquote><div>More like version 0.15&nbsp; :(<br>what plane? <br>
btw is it good to have references this in the code?<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This returns a list of (from_path, to_path) pairs for each
<br>- -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id="__firefox-findbar-search-id" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">entry</span> that is moved.<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id="__firefox-findbar-search-id" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">
entry</span>, that is moved.<br><br>^^^ The original phrasing is correct.<br>As code: [pairs(<span id="__firefox-findbar-search-id" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">
entry</span>) for <span id="__firefox-findbar-search-id" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">entry</span> in moved_entries()]
</blockquote><div>I could have sworn one of the previous reviewers requested this,<br>but i could not find it so I must be delusional.<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# determine which move mode to use. checks also for movability<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rename_entries = self._determine_mv_mode(rename_entries, after)<br>+<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# move pairs.</blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
^^^ What does &quot;move pairs&quot; mean?<br></blockquote><div>
You&#39;re asking me?<br>
&nbsp;I don&#39;t know, so I just removed it.&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; original_modified = self._inventory_is_modified
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try:<br>- -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if len(from_paths):<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if len(from_paths):<br><br>^^^ All this does is insert a trailing space.&nbsp;&nbsp;Not an improvement :-)
</blockquote><div><br>very funny.<br>I just can&#39;t win:&nbsp; If I set my editor to remove those pesky trailing whitespace<br>automatically you complain that I remove them. if I don&#39;t, you complain <br>that I add them.
<br>I think after this thing is merged I should start looking at doing a patch which:<br>1) removes all the trailing white space once and for all and<br>2) introduce a test which checks that nobody violates this ever again.
<br><br>And I might also write a plugin which warns you that you are<br>adding trailing white space when you commit (even failing the commit if you choose). <br>So that this sort of thing is caught earlier.<br>It can maybe also add a command similar to shelve which traverses the 
<br>changes which have not been committed yet and asks you for every bunch of<br>trailing ws it finds, if you want to remove it and does it for you.<br><br>This plugin would be usefull for other projects too, like the projects at my dayjob.
<br>(where we also have differences of oppinion about trailing whitespace)<br><br>I also removed all the trailing white space this bundle would have introduced.<br>I see that some of the latest commits still introduce new trailing white space, 
<br>when is it going to stop?<br><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for <span id="__firefox-findbar-search-id" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">
entry</span> in rename_entries:<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try:<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self._move_<span id="__firefox-findbar-search-id" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">
entry</span>(<span id="__firefox-findbar-search-id" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">entry</span>)<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;except OSError, e:<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self._rollback_move(moved)
<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raise 
errors.BzrRenameFailedError(<span id="__firefox-findbar-search-id" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">entry</span>.from_rel,<br><span id="__firefox-findbar-search-id" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">
entry</span>.to_rel,<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e[1])<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;except errors.BzrError, e:<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self._rollback_move(moved)<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raise<br><br>^^^ Is it possible to catch more specific errors here?&nbsp;&nbsp;BzrError and
<br>OSError are very broad.</blockquote><div>(Again I didn&#39;t write this, so don&#39;t be too hard on me)<br>I think its ok, as we just want to rollback and raise it again.<br>It is done like that elsewere in the file too.
<br></div></div><br><br>regards<br>marius.<br><br>-- <br><br><br><br>white space is overrated