[MERGE] bzr rm improvements

John Arbash Meinel john at arbash-meinel.com
Wed Aug 13 15:24:11 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins wrote:
> This makes some some improvements to bzr rm:
>  - its aliased to del for svn users
>  - just running 'bzr rm' will remove all missing files.
> 
> It depends on the InterTree fix I just posted, because, well, it just
> does ok?
> 
> -Rob
> 

+            elif file_list is None:
+                # missing files show up in iter_changes(basis) as
+                # versioned-with-no-kind.
+                missing = []
+                for change in tree.iter_changes(tree.basis_tree()):
+                    if change[6][1] is None:
+                        missing.append(change[1][1])
+                file_list = sorted(missing, reverse=True)
+                file_deletion_strategy = 'keep'

^- Wouldn't already removed files also show up as change[6][1] is None ?

At least when I test it without your patch:

$ bzr rm man1
deleted man1/bzr.1
deleted man1

$ bzr rm man1
man1 does not exist.


With your patch doing

$ bzr rm man1
$ bzr rm
I get a traceback on:
bzr: ERROR: exceptions.TypeError: 'NoneType' object is unsubscriptable

But I wonder if that is just a problem on Win32.


Anyway, we need to add a test that having files already removed in the
tree doesn't abort.

BB:tweak

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkii7osACgkQJdeBCYSNAAN42gCgtJ9X4ht3SUZjTMHZYC1OwoYd
llsAoMmLgczlOaYWqimwM/B1CCNNF3ce
=YMtV
-----END PGP SIGNATURE-----



More information about the bazaar mailing list