Incorrect "mv --after" of directory produces wrong error message
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Low
|
Unassigned |
Bug Description
The new "mv --after" support for directories rocks! But here's a buglet.
Rename a directory, then (try to) tell bzr about it using "bzr mv --after"; but mistype the directory's source pathname.
Actual result: bzr prints an error message reporting that the *destination* pathname is not versioned. This might be factually correct -- after all, the command failed, so of course the destination isn't yet versioned -- but it's not very helpful.
Expected result: The error message should complain about the error the user actually made, i.e. about the source pathname.
The corresponding error message for files gets this right. So does the case (for both files and directories) where it's the destination pathname that's mistyped.
To reproduce:
#
# Set up
#
$ mkdir test
$ cd test
$ bzr init
$ echo >f-src
$ mkdir -p d-src d-src/sub
$ bzr add
$ bzr ci '-mCommit fixture'
#
# Move a directory; mistype the "bzr mv" command.
# Notice that the message complains about "d-dst" not being
# versioned, even though the actual problem is with
# "d-bogus".
#
$ mv d-src d-dst
$ bzr mv --after d-bogus d-dst
bzr: ERROR: Could not move to d-dst: d-dst is not versioned.
#
# Control: try the same thing with a file instead.
# The error message correctly complains about "f-bogus".
#
$ mv f-src f-dst
$ bzr mv --after f-bogus f-dst
bzr: ERROR: Could not rename f-bogus => f-dst: f-bogus is not versioned.
Note also that the statement of what bzr "could not" do is also clearer in the file case, since it gives both pathnames.
bzr: ERROR: Could not rename f-bogus => f-dst: ...
bzr: ERROR: Could not move to d-dst: ...
Tested using bzr 1.4 (from tarball), python 2.5.1, on both Solaris and Cygwin.
Thanks,
- Eric
tags: | added: check-for-breezy |
Hi,
Thanks for the bug report.
So, the fix should be to show both paths as in the file case?
Thanks,
James