File: patch-logs.texi

package info (click to toggle)
arch 1.0pre15-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 20,180 kB
  • ctags: 4,560
  • sloc: ansic: 64,410; sh: 29,168; lisp: 1,896; awk: 1,044; makefile: 484; sed: 26
file content (385 lines) | stat: -rw-r--r-- 7,398 bytes parent folder | download
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
@need 3200

@node Patch Logs and ChangeLogs
@chapter Patch Logs and ChangeLogs

@geindex patch log

@geindex add-log

@geindex log-ls

@geindex cat-log



Every project tree has an associated patch log: a collection of log
entries for each @code{commit} or @code{import} in the history of that patch
tree.  When you commit a new revision, the log entry you write is
saved in two places: it is saved in the archive as a plain text file
(for browsing and as a record of complex ancestory relationships), and
in the project tree itself (for browsing and to control history
sensative merging).


Logs are organized by version.  The command:

@example
@group
        % cd ~/wd/project
        % larch add-log [[ARCHVIE/]VERSION-NAME]
@end group
@group
@end group
@end example

@noindent
creates a new (empty) log for the indicated version.  (Version names
were introduced in @ref{The arch Global Name-space of Projects} and
their relationship to archived revisions explained in
@ref{Development Paths}.)


The command:

@example
@group
        % larch logs
@end group
@group
@end group
@end example

@noindent
lists all of the version names for which a project tree has a patch
log.


The command:

@example
@group
        % larch log-ls [[ARCHIVE/]VERSION-NAME]
@end group
@group
@end group
@end example

@noindent
lists all of the patch levels for which a tree has log entries (for
revisions in the indicated version).  With the @code{summary} flag:

@example
@group
        % larch log-ls --summary [[ARCHIVE/]VERSION-NAME]
@end group
@group
@end group
@end example

@noindent
the @code{Summary:} header of each log entry is printed.


To see the complete text of an entry, use:

@example
@group
        % larch cat-log [ARCHIVE/]VERSION--PATCH-LEVEL
@end group
@group
@end group
@end example
@need 3200

@section Branches and Patch Logs

When you form a branch, project trees on the branch have (at least)
two patch logs: one for the original development path, and one for
the branch itself.  When you merge changes from one branch to another,
so long as both branches have the same project category, the merged
tree has patch logs for both branches.  ("Project categories" were
introduced in @ref{The arch Global Name-space of Projects}).)




@need 3200

@section Comparing Patch Logs to Archives

@geindex whats-missing



You can find out if an archive contains patches that haven't yet been
applied to your project tree with this command:

@example
@group
        % larch whats-missing [[ARCHIVE/]VERSION ...]
        <list of missing patches>
@end group
@group
@end group
@end example

That command compares the patch log stored in the archived with the
patch log found in the project tree and prints the list of missing
patches.  There may be missing patches if your tree is not up-to-date
with respect to the archive, or if when your tree was created, some
patches were skipped.


You can see the @code{Summary:} line of each missing patch with:

@example
@group
        % larch whats-missing --summary [[ARCHIVE/]VERSION ...]
@end group
@group
@end group
@end example

If you want the list to contain fully-qualified patch level names, 
use the @code{--full} option.


If you want to know where branch A stands in relation to branch B, one
way to find out is with:

@example
@group
        % larch get A dir
@end group
@group
@end group
@end example
@example
@group
        % cd dir
@end group
@group
@end group
@end example
@example
@group
        % larch whats-missing B
@end group
@group
@end group
@end example

(It is possible to obtain the same information without having to @code{get}
a revision from branch A, using commands already introduced, plus some
other shell commands.  The details are left as an exercise for the
interested reader.)




@need 3200

@section ChangeLogs

@geindex changelog



The command @code{larch changelog} generates a GNU-style @code{ChangeLog} file from
a patch log:

@example
@group
        % larch changelog
@end group
@group
@end group
@end example

@noindent
or 

@example
@group
        % larch changelog [ARCHIVE/]VERSION
@end group
@group
@end group
@end example

The @code{ChangeLog} file generated for @code{arch}, for example, might begin:

@example
@group
   # do not edit -- automatically generated by arch changelog
   #
   # tag: automatic-ChangeLog--lord@@regexps.com--arch-1/arch--devo--0.5
   #
@end group
@group
@end group
@end example
@example
@group
   2001-12-17  Tom Lord <lord@@regexps.com>
@end group
@group
@end group
@end example
@example
@group
       Summary:
         `update' and `replay' output format and bug fixes
@end group
@group
@end group
@end example
@example
@group
       `udpate' and `replay' -- structured output and updated argument
       processing for reasonable defaults.
@end group
@group
@end group
@end example
@example
@group
       `replay': copy precious files before (not after) appling patches
       so they are carried along with directory renames in patch sets.
@end group
@group
@end group
@end example
@example
@group
       `dopatch': don't pipe `larch heading' into `larch body-indent'.
@end group
@group
@end group
@end example
@example
@group
       modified files:
        ChangeLog src/arch/=TODO
        src/arch/branching-and-merging/replay.sh
        src/arch/branching-and-merging/update.sh
        src/arch/patch-sets/dopatch.sh
@end group
@group
@end group
@end example
@example
@group
   2001-12-17  Tom Lord <lord@@regexps.com>
@end group
@group
@end group
@end example
@example
@group
       Summary:
@end group
@group
@end group
@end example
@example
@group
   [...]
@end group
@group
@end group
@end example

Notice the first line which says @code{do not edit ...}.  If a project tree
contains files matching either of the patterns:

@example
@group
        ChangeLog
        ChangeLog.*
@end group
@group
@end group
@end example

@noindent
whose first lines contain the string @code{larch changelog}, the command
@code{larch commit} will automatically update that file before checking-in
the new revision;  the commands @code{update} and @code{replay} will update the
change logs after patches have been applied.


When updating a @code{ChangeLog}, @code{larch commit} looks for a line that says
@code{patch log:} and uses the corresponding patch log to update
the ChangeLog.


This is especially useful when development takes place on branches
that are later to be merged with a primary branch.  The top-level
@code{ChangeLog} file always remains on the primary development path.  Each
branch can add its own file:

@example
@group
        ChangeLog.BRANCH--VERSION
@end group
@group
@end group
@end example

When it comes time to merge, a log entry for the merge @code{commit} can be
written by editting the @code{ChangeLog.BRANCH--VERSION} file.  A useful
idiom is:

@example
@group
        % larch tag BRANCH-FROM BRANCH-TO
        [....]
@end group
@group
@end group
@end example
@example
@group
        % larch get BRANCH-TO DIR
        [....]
@end group
@group
@end group
@end example
@example
@group
        % cd DIR
@end group
@group
@end group
@end example
@example
@group
        % larch changelog > ChangeLog.BRANCH-TO
@end group
@group
@end group
@end example
@example
@group
        % larch make-log
        [...edit log file...]
@end group
@group
@end group
@end example
@example
@group
        % larch commit
@end group
@group
@end group
@end example