[Bug] 'bzr add --dry-run' actually added files
Martin Pool
mbp at canonical.com
Wed Aug 16 08:48:28 BST 2006
On 15 Aug 2006, Alexander Belchenko <bialix at ukr.net> wrote:
> Alexander Belchenko пишет:
> >I was very surprised when I saw that 'bzr add --dry-run' actually added
> > files! This reproducible on win32 and Slackware Linux too.
>
> Error actually in module bzrlib.add function smart_add():
>
> def smart_add(file_list, recurse=True, action=None, save=True):
> """Add files to version, optionally recursing into directories.
>
> This is designed more towards DWIM for humans than API simplicity.
> For the specific behaviour see the help for cmd_add().
>
> Returns the number of files added.
> Please see smart_add_tree for more detail.
> """
> file_list = _prepare_file_list(file_list)
> tree = WorkingTree.open_containing(file_list[0])[0]
> return smart_add_tree(tree, file_list, recurse, action=action)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--here
>
> When smart_add_tree invoked argument save is omitted therefore
> '--dry-run' never works. Attached obvious fix for this problem.
Thanks, merged to my integration branch.
> I don't
> wrote test because on win32 this kind of tests fails because of problem
> with .bazaar/ vs. bazaar/2.0/ in testing directory. I simply cannot
> clearly test this on my win32.
It seemed to me like the best way to fix that would be to set $HOME and
$APPDATA to somewhere other than the test directory. Would that do it?
--
Martin
More information about the bazaar
mailing list