Peripherally related to this, one thing I've noticed is that file and
directory renames are handled slightly differently vis-a-vis mtn mv.

If you start with the following file:

dir1/a.txt

And move a.txt to b.txt on the filesystem, and then issue "mtn mv a.txt
b.txt" (with or without --bookkeep-only), monotone does what you would
expect.  (I suspect that the excess verbiage of what it is doing may confuse
new users, but that's neither here nor there.)

The discrepancy of usage crops up when you "mtn mv" the directory.  If dir1
has already been renamed dir2 on the filesystem, neither "mtn mv dir1 dir2"
nor "mtn mv --bookkeep-only dir1 dir2" will cause monotone to record the
rename.  To complete the action, it seems that you have to do something like
the following:

mv dir2 temp
mtn mv dir1 dir2
mv temp dir2

If you're not doing Java (or .NET, I suppose) development, you'd probably
never encounter this use-case.  But you tend to encounter it quite a bit in
Java when doing a package name refactoring where the IDE takes care of
moving the files and changing their contents in one fell swoop.

It's a relatively minor issue.  I mention it only because the behavior seems
inconsistent between files and directories.

Of course, there may be a perfectly good reason for the current behavior.

RS

On 7/16/07, Thomas Keller <[EMAIL PROTECTED]> wrote:

Hi Sebastian!

Sebastian schrieb:
> $ mtn --execute mv a/a.c b
> mtn: renaming a/a.c to b in workspace manifest
> mtn: warning: destination b already exists in workspace, skipping

I don't know when this was fixed exactly (imho it was related to the
"editable working tree" implementation), but in 0.34 and above the
aforementioned rename command issues

mtn: misuse: destination name b already exists as an unversioned directory

so your bug should already be fixed. Note also that if you try out 0.34
or later, --execute is already the default for add, drop and rename, if
you want to have these changes only in the bookkeeping directory, there
is a new switch instead: --bookkeep-only.


Thanks for your time and interest in monotone!

Thomas.


--
only dead fish swim with the stream: http://thomaskeller.biz/blog
Am Anfang war das Wort: http://www.schäuble-muss-weg.de


_______________________________________________
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel



_______________________________________________
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel

Reply via email to