[patch] fix bug 50793 for 'bzr log'

Aaron Bentley aaron.bentley at utoronto.ca
Mon Oct 30 16:26:01 GMT 2006


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

This looks straightforward.  +1.

Aaron

Cheuksan Edward Wang wrote:
> 
> While working on bug 51980, I did a quick fix of 50793 for 'bzr log'.
> Running ``bzr log`` on nonexistent file now gives an error instead of
> the entire log history.
> 
> Cheuksan Edward Wang
> 
> 
> ------------------------------------------------------------------------
> 
> # Bazaar revision bundle v0.8
> #
> # message:
> #   Running ``bzr log`` on nonexistent file gives an error instead of the
> #   entire log history. (bug #50793)
> #   
> # committer: wang <wang at ubuntu>
> # date: Mon 2006-10-30 22:56:33.426000118 +0800
> 
> === modified file NEWS
> --- NEWS
> +++ NEWS
> @@ -14,6 +14,8 @@
>        machine now show that the working tree is out of date.
>        (Cheuksan Edward Wang #48136)
>  
> +    * Running ``bzr log`` on nonexistent file gives an error instead of the
> +      entire log history. (Cheuksan Edward Wang #50793)
>  
>  bzr 0.12rc1  2006-10-23
>  
> 
> === modified file bzrlib/builtins.py
> --- bzrlib/builtins.py
> +++ bzrlib/builtins.py
> @@ -1381,6 +1381,10 @@
>                      # either no tree, or is remote.
>                      inv = b.basis_tree().inventory
>                  file_id = inv.path2id(fp)
> +                if file_id is None:
> +                    raise errors.BzrCommandError(
> +                        "Path does not have any revision history: %s" %
> +                        location)
>          else:
>              # local dir only
>              # FIXME ? log the current subdir only RBC 20060203 
> 
> === modified file bzrlib/tests/blackbox/test_log.py
> --- bzrlib/tests/blackbox/test_log.py
> +++ bzrlib/tests/blackbox/test_log.py
> @@ -108,6 +108,13 @@
>          self.assertTrue('branch nick: branch2\n' in log)
>          self.assertTrue('branch nick: branch1\n' not in log)
>          
> +    def test_log_nonexistent_file(self):
> +        # files that don't exist in either the basis tree or working tree
> +        # should give an error
> +        wt = self.make_branch_and_tree('.')
> +        out, err = self.run_bzr('log', 'does-not-exist', retcode=3)
> +        self.assertContainsRe(
> +            err, 'Path does not have any revision history: does-not-exist')
>  
>  class TestLogMerges(ExternalBase):
>  
> 
> === modified directory  // last-changed:wang at ubuntu-20061030145633-28f9d624effb
> ... c451
> # revision id: wang at ubuntu-20061030145633-28f9d624effbc451
> # sha1: aefb7d8112fdde2f1730b7c64352bdb4e68d69e8
> # inventory sha1: efa3a2c110ee3c95354df15bab88eefdd726a396
> # parent ids:
> #   pqm at pqm.ubuntu.com-20061027225241-7339e4c92f55536c
> # base id: pqm at pqm.ubuntu.com-20061027225241-7339e4c92f55536c
> # properties:
> #   branch-nick: log-branch
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFFRieZ0F+nu1YWqI0RAukVAJ9DxrAOqHhGAJcsCqC3g/RKCdVIrwCeLPT1
GktMAYHxH2xO+Sn8m3YyDMs=
=om0k
-----END PGP SIGNATURE-----




More information about the bazaar mailing list