tags:

views:

103

answers:

3

Is there a way for Bazaar to be able to automatically detect changes (adds, removes, renames, etc.) made to part of the working directory and automatically apply them?

I have a directory tree in my repository which is generated by another process so I can't do all the bzr add, bzr delete, and bzr rename commands as the files are changing. Instead, I would like a way to have bzr notice all the changes and apply them after this process is run.

The only way I can think of doing this right now is running bzr status and then manually (or by writing a script) run bzr add and bzr delete on all the files listed. This will work but I am hoping there is an automated method that could also determine if a file was renamed (an added file has the same contents of a delete file).

+1  A: 

Could you just call bzr add * at the end of the process? Your subsequent commit should take care of all additions and removals. This will not detect if a file was renamed/moved by some process other than bzr mv (and I am unaware of any way to do so).

ezod
+1  A: 

It looks like the automv plug-in will automatically detect renames and moves. This, along with bzr add * should do the trick.

Trent
+2  A: 

You don't need to explicitly mark files as deleted. And bzr can detect renames (either with automv plugin or with builtin functionality):

bzr mv --auto

Then you need to add all files which are not part of renames:

bzr add subdir/
bialix
Do you know what differences (if any) there are between `bzr mv --auto` and the automv plugin?
Trent
automv plugin allows you to specify the similarity level between files with --threshold. Both have --dry-run to check heuristics before record actual renames. mv --auto is builtin, so you don't need to bother to install additional plugins, vanilla bzr will be enough. Historically automv was born first. That's all.
bialix