Martin Pool's blog

file renames in bazaar-ng

Renames are completely(?) working in bzr now, after the last couple of days work. There are two commands: move moves one or more files into a different directory, and rename renames a file (and optionally also moves it.)

(I think this is one case where the unix unification of both these things into mv really causes much more trouble than it's worth.)

There is also a renames command that shows which files have moved relative to the last revision.

Demo:

demo% ls -a
./  ../
demo% bzr init
demo% echo hello > one
demo% bzr rename one two
bzr: error: can't rename: old name 'one' is not versioned
demo% bzr add one
demo% bzr rename oen two
bzr: error: can't rename: old working file 'oen' does not exist
demo% bzr rename one two
one => two
demo% bzr status
A       two
demo% bzr commit -m 'add file'
demo% bzr rename two three
two => three
demo% bzr status
R       two => three
demo% bzr renames
two => three
demo% bzr commit -m 'renamed'
demo% mkdir subdir subdir/d2
demo% bzr add subdir subdir/d2
demo% bzr status
A       subdir/
A       subdir/d2/
demo% bzr move three subdir/d2/
three => subdir/d2/three
demo% cd subdir/d2
d2% bzr rename three ../four
subdir/d2/three => subdir/four
d2% bzr renames
three => subdir/four
d2% bzr status
A       subdir/
A       subdir/d2/
R       three => subdir/four
d2% cd ../../
demo% bzr status
A       subdir/
A       subdir/d2/
R       three => subdir/four

The code is not published yet; it'll be up later this week.

Archives 2008: Apr Feb 2007: Jul May Feb Jan 2006: Dec Nov Oct Sep Aug Jul Jun Jan 2005: Sep Aug Jul Jun May Apr Mar Feb Jan 2004: Dec Nov Oct Sep Aug Jul Jun May Apr Mar Feb Jan 2003: Dec Nov Oct Sep Aug Jul Jun May