[MERGE] WorkingTree.unversion

Martin Pool mbp at canonical.com
Thu Sep 7 09:42:46 BST 2006


On  7 Sep 2006, Robert Collins <robertc at robertcollins.net> wrote:
> On Thu, 2006-09-07 at 17:46 +1000, Robert Collins wrote:
> > On Thu, 2006-09-07 at 17:33 +1000, Robert Collins wrote:
> > > This adds an unversion API to working tree which unversions entries by
> > > id.
> > > 
> > > When given an id, all the children of the id are unversioned too.
> > 
> > I forgot to bzr add the test script - oops. Heres a new patch.
> 
> And!! My initial test was not rigourous enough - I've made it more
> rigourous and corrected the code. Attached a final version I'm sure :).

Having such an API to replace 'del inv[id]' sounds good.

This is consistent with comparable apis on Tree in taking a file id.
However I wonder if it would be clearer to call it unversion_by_id()?
Perhaps not.

+1 anyhow.

> === modified file 'bzrlib/tests/test_errors.py'
> --- bzrlib/tests/test_errors.py	2006-08-21 19:05:37 +0000
> +++ bzrlib/tests/test_errors.py	2006-09-07 08:10:40 +0000
> @@ -31,6 +31,12 @@
>          error = errors.NoRepositoryPresent(dir)
>          self.assertNotEqual(-1, str(error).find((dir.transport.clone('..').base)))
>          self.assertEqual(-1, str(error).find((dir.transport.base)))
> +        
> +    def test_no_such_id(self):
> +        error = errors.NoSuchId("atree", "anid")
> +        self.assertEqualDiff("The file id anid is not present in the tree "
> +            "atree.",
> +            str(error))

Good to see this too - we have had bugs in the format strings before.

-- 
Martin




More information about the bazaar mailing list