~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/revision-syntax.txt

  • Committer: Martin Pool
  • Date: 2005-06-28 03:02:31 UTC
  • Revision ID: mbp@sourcefrog.net-20050628030231-d311e4ebcd467ef4
Merge John's import-speedup branch:

                                                                                         
  777 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 22:20:32 -0500
      revision-id: john@arbash-meinel.com-20050627032031-e82a50db3863b18e
      bzr selftest was not using the correct bzr

  776 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 22:20:22 -0500
      revision-id: john@arbash-meinel.com-20050627032021-c9f21fde989ddaee
      Add was using an old mutter

  775 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 22:02:33 -0500
      revision-id: john@arbash-meinel.com-20050627030233-9165cfe98fc63298
      Cleaned up to be less different

  774 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 21:54:53 -0500
      revision-id: john@arbash-meinel.com-20050627025452-4260d0e744edef43
      Allow BZR_PLUGIN_PATH='' to negate plugin loading.

  773 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 21:49:34 -0500
      revision-id: john@arbash-meinel.com-20050627024933-b7158f67b7b9eae5
      Finished the previous cleanup (allowing load_plugins to be called twice)

  772 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 21:45:08 -0500
      revision-id: john@arbash-meinel.com-20050627024508-723b1df510d196fc
      Work on making the tests pass. versioning.py is calling run_cmd directly, but plugins have been loaded.

  771 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 21:32:29 -0500
      revision-id: john@arbash-meinel.com-20050627023228-79972744d7c53e15
      Got it down a little bit more by removing import of tree and inventory.

  770 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 21:26:05 -0500
      revision-id: john@arbash-meinel.com-20050627022604-350b9773ef622f95
      Reducing the number of import from bzrlib/__init__.py and bzrlib/branch.py

  769 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 20:32:25 -0500
      revision-id: john@arbash-meinel.com-20050627013225-32dd044f10d23948
      Updated revision.py and xml.py to include SubElement.

  768 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 20:03:56 -0500
      revision-id: john@arbash-meinel.com-20050627010356-ee66919e1c377faf
      Minor typo

  767 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 20:03:13 -0500
      revision-id: john@arbash-meinel.com-20050627010312-40d024007eb85051
      Caching the import

  766 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 19:51:47 -0500
      revision-id: john@arbash-meinel.com-20050627005147-5281c99e48ed1834
      Created wrapper functions for lazy import of ElementTree

  765 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 19:46:37 -0500
      revision-id: john@arbash-meinel.com-20050627004636-bf432902004a94c5
      Removed all of the test imports of cElementTree

  764 John Arbash Meinel <john@arbash-meinel.com>       Sun 2005-06-26 19:43:59 -0500
      revision-id: john@arbash-meinel.com-20050627004358-d137fbe9570dd71b
      Trying to make bzr startup faster.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Syntax for identifying revisions
 
2
********************************
 
3
 
 
4
There seem to be two main options: use a separate ``-r`` option, or
 
5
put a revision identifier within the filename.
 
6
 
 
7
``-r`` options are familiar from CVS and Subversion, and easy to
 
8
specify, and cover almost all situations.
 
9
 
 
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.
 
14
 
 
15
----
 
16
 
 
17
 
 
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
 
20
we compare to 
 
21
 
 
22
* the file currently called ``hello.c``, as it was in revision 2, even
 
23
  if it then had a different name
 
24
 
 
25
or
 
26
 
 
27
* the file that was called ``hello.c`` in revision 2, even if that is
 
28
  a different file-id?
 
29
 
 
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.
 
33
 
 
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::
 
37
 
 
38
   hello.c@2
 
39
   @2/hello.c
 
40
 
 
41
   src/@2/hello.c
 
42
 
 
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:
 
46
 
 
47
  @70/hello.c@31
 
48
 
 
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
 
52
up, etc.)
 
53
 
 
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
 
56
length::
 
57
 
 
58
  hello.c@09fac8dbfd27bd9b4d23a00eb648aa751789536d 
 
59
 
 
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.)
 
63
 
 
64
You can also give a date, which is used to find the most recent
 
65
revision no later than that date::
 
66
 
 
67
  hello.c@{2004-12-01}
 
68
  hello.c@{yesterday}
 
69
  ./@{10:30}/
 
70
 
 
71
(Braces can be a bit scary for shell, but if there are no commas they
 
72
are somewhat safe.)
 
73
 
 
74
Or, once we have labels, you can use a label::
 
75
 
 
76
  hello.c@release-2.2
 
77