1
Syntax for identifying revisions
2
********************************
4
There seem to be two main options: use a separate ``-r`` option, or
5
put a revision identifier within the filename.
7
``-r`` options are familiar from CVS and Subversion, and easy to
8
specify, and cover almost all situations.
10
Special identifiers in the filename are sometimes more concise, and
11
allow for more complete specification of filenames in the presence of
12
renames. They may be more complex to implement, and will cause some
13
filenames to be either forbidden or to require escaping.
18
How to interpret revisions in the presence of renamed files? Suppose
19
hello.c was renamed in r3; when we do ``bzr diff -r2 hello.c`` should
22
* the file currently called ``hello.c``, as it was in revision 2, even
23
if it then had a different name
27
* the file that was called ``hello.c`` in revision 2, even if that is
30
Often only one will work, but it is possible to have situations where
31
in revision 2 there was a file called ``hello.c`` but it is not the
32
same one that now has that name.
34
If we can have a simple syntax that accomodates either that would be
35
good. One might be to mix revision numbers into the path, rather than
36
a separate ``-r`` option. For example::
43
The simplest case is to just append the number, but you can vary
44
them. It might even be possible to chain them, getting the file id
45
from one revision and its state from another:
49
This means "the file that was called ``hello.c`` in revision 70, give
50
me its state in revision 31." (If you wanted to do this across
51
branches, I think you might need to get the file id and then look it
54
Some more syntax: you can refer to a revision by its hash just by
55
specifying that; we can distinguish them from anything else by their
58
hello.c@09fac8dbfd27bd9b4d23a00eb648aa751789536d
60
(Is that really safe? Perhaps some punctuation is needed to
61
distinguish it from a label. But then I think people should rarely or
62
never use them; perhaps it need not be allowed at all.)
64
You can also give a date, which is used to find the most recent
65
revision no later than that date::
71
(Braces can be a bit scary for shell, but if there are no commas they
74
Or, once we have labels, you can use a label::