1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
Killing versions
****************
Sometimes people really need to rewrite history. The canonical
example is that they have accidentally checked confidential
information into the wrong tree.
There is a tension between two imperatives:
* Accurately record all history.
* Remove critical information.
Of course we cannot control who may have made use of the information
in the time it was public, but often these things are caught early enough.
After history has been rewritten, anything that depends on that
history may be inconsistent. We cannot consistently continue on a
version that has had some revisions knocked out; therefore it seems
simplest to kill the version over all.
You can make a tag onto a new version from a previous consistent
revision.
Downstream users will need to switch on to the new version.
We can mark the version as killed so that mirroring will delete the
revisions and clients looking at the version can suggest switching.
This should be an extremely infrequent operation so it is OK that it
is simple as long as it fulfils the basic requirement.
A related problem is that people sometimes commit the wrong log
message, or (more seriously) the wrong files. It is common to notice
immediately afterwards.
Uncommit
--------
I think this is the best and most useful option at the moment: the
`uncommit command`_ undoes the last commit, and nothing else. It can
be repeated to successively remove more and more history.
.. _`uncommit command`: cmdref.html#uncommit
Example::
% cd my-project
% bzr add launch-codes.txt
% bzr commit -m 'add launch codes'
A launch-codes.txt
recorded r23
[oops!]
% bzr uncommit
[now back to just before the commit command]
% bzr status
A launch-codes.txt
% bzr revert launch-codes.txt
% bzr status
? launch-codes.txt
If anyone else has depended on the option then the branches will have
diverged and that needs to be resolved somehow, probably by the other
people starting a new branch with the correct commit. In particular
uncommitting from a shared branch will break anyone who has seen that
revision; possibly there needs to be a policy option on such branches
to deny uncommit.
If someone else on that shared branch did a the equivalent of a
switch_ command then they would bring their changes onto the correct
basis. Would it be reasonable to do that automatically?
.. _switch: cmdref.html#switch
UI proposals
------------
Aaron's proposal::
% cd my-project
% baz add launch-codes.txt
% baz commit -s 'add launch codes'
recorded patch-4
% baz add good-code.c
% baz commit -s 'add good code'
recorded patch-5
[oops!]
% baz undo patch-3
% baz pull patch-5
% baz commit --as-latest
renamed old branch to my-project-old-1
% baz eradicate my-project-old-1
Long form::
% cd my-project
% baz add launch-codes.txt
% baz commit -s 'add launch codes'
recorded patch-4
% baz add good-code.c
% baz commit -s 'add good code'
recorded patch-5
[oops!]
% cd ../
% baz fork my-project--patch3 my-project-fixed
% cd my-project-fixed
% baz pull ../my-project patch5
% cd ../
% rm -rf my-project
% mv my-project-fixed my-project
Robert's proposal::
% cd my-project
% baz add launch-codes.txt
% baz commit -s 'add launch codes'
recorded patch-4
% baz add good-code.c
% baz commit -s 'add good code'
recorded patch-5
[oops!]
% baz branch patch-3 $(baz tree-version)
% baz pull . patch-5
% baz eliminate patch-4
|