[MERGE][#175520] use historical context for file logging

Ian Clatworthy ian.clatworthy at internode.on.net
Tue Jan 20 21:04:59 GMT 2009


Vincent Ladeuil wrote:

> Imagine the following scenario:
> 
> 1. add file 'foo' (got file-id 'toto')
> 
> 2. renamed it 'bar'
> 
> 3. rename it 'baz'
> 
> 4. delete it
> 
> I argue that for such scenarios you really want the ability to
> use file ids.
> 
> bzr log  baz => doesn't work
> bzr log -r1.. foo => doesn't work (though I think you make it work in a later patch)
> bzr log -r2..3 baz (err, wait, is it bar ?)
> 
> bzr log bar => doesn't work (too bad, that's the only name I'm sure about)

So I think matching against the last revision is the most
natural think to do but deletes mean that looking in the
last revision alone is not enough. It will never exist there
and therefore the log will never so an important bit of
information: when the file was deleted. For that reason,
you want to be able to specify something like

  bzr log -rX.. file

The challenge then becomes picking X. file needs to be created
in X or later and called that name at that point in time.

> Or you will keep trying various ranges until you find the right
> path to use for the 'bzr log' command and even then you may not
> be able to display all the revisions you're interested in.

So the UI question becomes "What was that file called and
when did it get created/renamed/deleted?" My proposed answer
is that is adding an option to log that let's you filter on
status flags something like ...

  bzr log --status-flags NRD

The N might be too noisy but just R or RD would not be. FWIW,
git log has that now. I think it would be really useful for
scenarios like this. Imagine using it in combination with
directory filtering in particular.

> I agree that we should *avoid* *requiring* using internal ids,
> but that doesn't mean we have to make user's life miserable just
> because we don't *allow* it.
> 
> I use revids daily. I don't like them much, but it's often the
> most effective way.
> 
> bzr log --file-id toto => Works !
> bzr log -r2..4 --file-id toto => Works !

If we start supporting file-ids in the UI, I'd like to do so
across every command and allow you to specify "fileid:..."
anywhere you can currently specify a file.

Ian C.



More information about the bazaar mailing list