Writing a new RevisionSpec

Harald Meland harald.meland at usit.uio.no
Thu Apr 3 17:15:34 BST 2008


[Gioele Barabucci]

> Stefan Monnier wrote:
>> 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.
>
> OK. I (kind of) implemented "-r last_change:file_name".
>
> Now the problem is, how can I add an additional parameter to specify the
> n-th change and not the last one? "last_change:file_name,n"? Actually I
> have versioned files that have a comma in their file name. What
> about "last_change:file_name/n"?

That could be a possibility if you want this revision specifier to
only be usable on files -- but Bazaar does versioning of directories,
too, and if you at some point would like to extend the specifier to be
valid on those, the ".../n" syntax could get problematic.

Why don't you just put the part that has a rather narrow syntax before
the filename, i.g. "last_change:n:filename"?

> Thinking about a correct name. What is better: last_change: or
> changed:?

Somewhat contrary to the argument I presented above, I think it would
be nice to have "file" be part of the specifier's name, to make it
obvious that this isn't talking about the branch's full-tree history.
Maybe "file-change:n:file/name"?  As to the contrariness in my
arguments :-), I would note that e.g. "bzr help add" also says
[FILE...] when it really accepts both files and directories.
-- 
Harald



More information about the bazaar mailing list