[Bug] 'bzr add --dry-run' actually added files

Alexander Belchenko bialix at ukr.net
Tue Aug 15 16:19:48 BST 2006


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. 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.

--
Alexander


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: add-dry-run.diff
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20060815/3bff446a/attachment.diff 


More information about the bazaar mailing list