Feature request: bzr inventory --verbose to list deleted files

Jari Aalto jari.aalto at cante.net
Mon Aug 20 06:59:49 BST 2007


* Fri 2007-08-17 Aaron Bentley <aaron.bentley AT utoronto.ca>
* Message-Id: 46C588BF.7040405 AT utoronto.ca
>> where can I see list of deleted files?
>
> bzr status

Almost. If I did a commit, I can't see that file as "deleted".

>> 
>>     bzr add test
>>     bzr ci -m new
>>     bzr rm test
>>     bzr ci -m gone
>>     bzr inventory
>>     <empty>
>
> If you want to see files deleted before the last commit, you'll have to
> specify the appropriate -r flag, e.g.
>
> bzr status -r -2

The chain to get one particular file back is a little bit difficult.

bzr init

1) add:
    touch test
    bzr add test
    bzr ci -m add 

    Committed revision 1.

2) delete:

    bzr rm test
    bzr ci -m rm

    Committed revision 2.

3) Add new file:
    touch two
    bzr add two
    bzr ci -m new

    Committed revision 3.

What files have been deleted since day one?

    bzr status -r1

    removed:
      test
    added:
      two

Okay, I need to get it back:

    bzr cat test

    bzr: ERROR: u'test' is not present in revision jari.aalto AT cante.net-20070820052414-fmteek809sg8xdxl

Umph, so I really need:

    bzr log --verbose --long | grep -B 6 -A 2 'removed:'

=======================================================================
SUGGESTION
=======================================================================

The output of the 'log' listing is not necessarily shell-friendly. Take 
a look at this:

    revno: 2
    committer: jari.aalto AT cante.net
    branch nick: x
    timestamp: Mon 2007-08-20 08:23:38 +0300
    message:
      rm
    removed:
      test

I would need some serious shell scripting to parse the information
from the log listing to "get revision number in which file was deleted".

That information should be easier to extract. If the status command
would be extended with option "--verbose" to also show also revision
numbers, that would be easy:

    $ bzr status -v --long -r1

    removed:
      test 2
    added:
      two 3

Similarly for the "--short" listing:

    $ bzr status -v --short -r1

        Format with "%-4" or soemething
        |
    +N  2   two
    -D  3   test

Jari





More information about the bazaar mailing list