Writing a new RevisionSpec

Stefan Monnier monnier at iro.umontreal.ca
Thu Apr 3 03:01:00 BST 2008


>> >> 1) If I call "bzr log -r my_spec foo/bar", how can i get "foo/bar" from
>> >> _merge_on()?
>> > 
>> > I believe that you have to make it
>> > 
>> >   bzr log -r my_spec:foo/bar
>> Isn't it possible to modify bzr to pass additional information to
>> RevisionSpec in future versions?
>> 
>> I hacked up a simple last_change:n RevisionSpec that returns the (nth)
>> revision where foo/bar has been changed. So you can do
>> 
>> bzr diff -r last_change:..last_change:2 foo/bar
>> (diff between last and previous change)
>> 
>> or
>> 
>> bzr log -r last_change: foo/bar (= log -l 1)
>> bzr log -r last_change:2 foo/bar (log of the second to last change to
>> foo/bar)
>> 
>> I think that the same information I need is going to be needed by other
>> RevisionSpec in the future.
>> 
>> Anyway, revid: is a bit different, it takes a string parameter that is
>> unrelated to the file it is going to operate on.
>> 

> Yeah, I think it would need an extension to the revision specs
> to allow this.

> I was just trying to suggest something that may work for you now.
> Sorry that I misunderstood.

Actually your suggestion sounds good to me: it allows you to show the
whole commit where foo/bar was last changed.  It's often useful to see
the whole commit rather than only the part that affect foo/bar.


        Stefan




More information about the bazaar mailing list