##// END OF EJS Templates
record: remove superfluous space
timeless@mozdev.org -
r9461:cec9fb4e default
parent child Browse files
Show More
@@ -1,551 +1,551
1 # record.py
1 # record.py
2 #
2 #
3 # Copyright 2007 Bryan O'Sullivan <bos@serpentine.com>
3 # Copyright 2007 Bryan O'Sullivan <bos@serpentine.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2, incorporated herein by reference.
6 # GNU General Public License version 2, incorporated herein by reference.
7
7
8 '''commands to interactively select changes for commit/qrefresh'''
8 '''commands to interactively select changes for commit/qrefresh'''
9
9
10 from mercurial.i18n import gettext, _
10 from mercurial.i18n import gettext, _
11 from mercurial import cmdutil, commands, extensions, hg, mdiff, patch
11 from mercurial import cmdutil, commands, extensions, hg, mdiff, patch
12 from mercurial import util
12 from mercurial import util
13 import copy, cStringIO, errno, operator, os, re, tempfile
13 import copy, cStringIO, errno, operator, os, re, tempfile
14
14
15 lines_re = re.compile(r'@@ -(\d+),(\d+) \+(\d+),(\d+) @@\s*(.*)')
15 lines_re = re.compile(r'@@ -(\d+),(\d+) \+(\d+),(\d+) @@\s*(.*)')
16
16
17 def scanpatch(fp):
17 def scanpatch(fp):
18 """like patch.iterhunks, but yield different events
18 """like patch.iterhunks, but yield different events
19
19
20 - ('file', [header_lines + fromfile + tofile])
20 - ('file', [header_lines + fromfile + tofile])
21 - ('context', [context_lines])
21 - ('context', [context_lines])
22 - ('hunk', [hunk_lines])
22 - ('hunk', [hunk_lines])
23 - ('range', (-start,len, +start,len, diffp))
23 - ('range', (-start,len, +start,len, diffp))
24 """
24 """
25 lr = patch.linereader(fp)
25 lr = patch.linereader(fp)
26
26
27 def scanwhile(first, p):
27 def scanwhile(first, p):
28 """scan lr while predicate holds"""
28 """scan lr while predicate holds"""
29 lines = [first]
29 lines = [first]
30 while True:
30 while True:
31 line = lr.readline()
31 line = lr.readline()
32 if not line:
32 if not line:
33 break
33 break
34 if p(line):
34 if p(line):
35 lines.append(line)
35 lines.append(line)
36 else:
36 else:
37 lr.push(line)
37 lr.push(line)
38 break
38 break
39 return lines
39 return lines
40
40
41 while True:
41 while True:
42 line = lr.readline()
42 line = lr.readline()
43 if not line:
43 if not line:
44 break
44 break
45 if line.startswith('diff --git a/'):
45 if line.startswith('diff --git a/'):
46 def notheader(line):
46 def notheader(line):
47 s = line.split(None, 1)
47 s = line.split(None, 1)
48 return not s or s[0] not in ('---', 'diff')
48 return not s or s[0] not in ('---', 'diff')
49 header = scanwhile(line, notheader)
49 header = scanwhile(line, notheader)
50 fromfile = lr.readline()
50 fromfile = lr.readline()
51 if fromfile.startswith('---'):
51 if fromfile.startswith('---'):
52 tofile = lr.readline()
52 tofile = lr.readline()
53 header += [fromfile, tofile]
53 header += [fromfile, tofile]
54 else:
54 else:
55 lr.push(fromfile)
55 lr.push(fromfile)
56 yield 'file', header
56 yield 'file', header
57 elif line[0] == ' ':
57 elif line[0] == ' ':
58 yield 'context', scanwhile(line, lambda l: l[0] in ' \\')
58 yield 'context', scanwhile(line, lambda l: l[0] in ' \\')
59 elif line[0] in '-+':
59 elif line[0] in '-+':
60 yield 'hunk', scanwhile(line, lambda l: l[0] in '-+\\')
60 yield 'hunk', scanwhile(line, lambda l: l[0] in '-+\\')
61 else:
61 else:
62 m = lines_re.match(line)
62 m = lines_re.match(line)
63 if m:
63 if m:
64 yield 'range', m.groups()
64 yield 'range', m.groups()
65 else:
65 else:
66 raise patch.PatchError('unknown patch content: %r' % line)
66 raise patch.PatchError('unknown patch content: %r' % line)
67
67
68 class header(object):
68 class header(object):
69 """patch header
69 """patch header
70
70
71 XXX shoudn't we move this to mercurial/patch.py ?
71 XXX shoudn't we move this to mercurial/patch.py ?
72 """
72 """
73 diff_re = re.compile('diff --git a/(.*) b/(.*)$')
73 diff_re = re.compile('diff --git a/(.*) b/(.*)$')
74 allhunks_re = re.compile('(?:index|new file|deleted file) ')
74 allhunks_re = re.compile('(?:index|new file|deleted file) ')
75 pretty_re = re.compile('(?:new file|deleted file) ')
75 pretty_re = re.compile('(?:new file|deleted file) ')
76 special_re = re.compile('(?:index|new|deleted|copy|rename) ')
76 special_re = re.compile('(?:index|new|deleted|copy|rename) ')
77
77
78 def __init__(self, header):
78 def __init__(self, header):
79 self.header = header
79 self.header = header
80 self.hunks = []
80 self.hunks = []
81
81
82 def binary(self):
82 def binary(self):
83 for h in self.header:
83 for h in self.header:
84 if h.startswith('index '):
84 if h.startswith('index '):
85 return True
85 return True
86
86
87 def pretty(self, fp):
87 def pretty(self, fp):
88 for h in self.header:
88 for h in self.header:
89 if h.startswith('index '):
89 if h.startswith('index '):
90 fp.write(_('this modifies a binary file (all or nothing)\n'))
90 fp.write(_('this modifies a binary file (all or nothing)\n'))
91 break
91 break
92 if self.pretty_re.match(h):
92 if self.pretty_re.match(h):
93 fp.write(h)
93 fp.write(h)
94 if self.binary():
94 if self.binary():
95 fp.write(_('this is a binary file\n'))
95 fp.write(_('this is a binary file\n'))
96 break
96 break
97 if h.startswith('---'):
97 if h.startswith('---'):
98 fp.write(_('%d hunks, %d lines changed\n') %
98 fp.write(_('%d hunks, %d lines changed\n') %
99 (len(self.hunks),
99 (len(self.hunks),
100 sum([h.added + h.removed for h in self.hunks])))
100 sum([h.added + h.removed for h in self.hunks])))
101 break
101 break
102 fp.write(h)
102 fp.write(h)
103
103
104 def write(self, fp):
104 def write(self, fp):
105 fp.write(''.join(self.header))
105 fp.write(''.join(self.header))
106
106
107 def allhunks(self):
107 def allhunks(self):
108 for h in self.header:
108 for h in self.header:
109 if self.allhunks_re.match(h):
109 if self.allhunks_re.match(h):
110 return True
110 return True
111
111
112 def files(self):
112 def files(self):
113 fromfile, tofile = self.diff_re.match(self.header[0]).groups()
113 fromfile, tofile = self.diff_re.match(self.header[0]).groups()
114 if fromfile == tofile:
114 if fromfile == tofile:
115 return [fromfile]
115 return [fromfile]
116 return [fromfile, tofile]
116 return [fromfile, tofile]
117
117
118 def filename(self):
118 def filename(self):
119 return self.files()[-1]
119 return self.files()[-1]
120
120
121 def __repr__(self):
121 def __repr__(self):
122 return '<header %s>' % (' '.join(map(repr, self.files())))
122 return '<header %s>' % (' '.join(map(repr, self.files())))
123
123
124 def special(self):
124 def special(self):
125 for h in self.header:
125 for h in self.header:
126 if self.special_re.match(h):
126 if self.special_re.match(h):
127 return True
127 return True
128
128
129 def countchanges(hunk):
129 def countchanges(hunk):
130 """hunk -> (n+,n-)"""
130 """hunk -> (n+,n-)"""
131 add = len([h for h in hunk if h[0] == '+'])
131 add = len([h for h in hunk if h[0] == '+'])
132 rem = len([h for h in hunk if h[0] == '-'])
132 rem = len([h for h in hunk if h[0] == '-'])
133 return add, rem
133 return add, rem
134
134
135 class hunk(object):
135 class hunk(object):
136 """patch hunk
136 """patch hunk
137
137
138 XXX shouldn't we merge this with patch.hunk ?
138 XXX shouldn't we merge this with patch.hunk ?
139 """
139 """
140 maxcontext = 3
140 maxcontext = 3
141
141
142 def __init__(self, header, fromline, toline, proc, before, hunk, after):
142 def __init__(self, header, fromline, toline, proc, before, hunk, after):
143 def trimcontext(number, lines):
143 def trimcontext(number, lines):
144 delta = len(lines) - self.maxcontext
144 delta = len(lines) - self.maxcontext
145 if False and delta > 0:
145 if False and delta > 0:
146 return number + delta, lines[:self.maxcontext]
146 return number + delta, lines[:self.maxcontext]
147 return number, lines
147 return number, lines
148
148
149 self.header = header
149 self.header = header
150 self.fromline, self.before = trimcontext(fromline, before)
150 self.fromline, self.before = trimcontext(fromline, before)
151 self.toline, self.after = trimcontext(toline, after)
151 self.toline, self.after = trimcontext(toline, after)
152 self.proc = proc
152 self.proc = proc
153 self.hunk = hunk
153 self.hunk = hunk
154 self.added, self.removed = countchanges(self.hunk)
154 self.added, self.removed = countchanges(self.hunk)
155
155
156 def write(self, fp):
156 def write(self, fp):
157 delta = len(self.before) + len(self.after)
157 delta = len(self.before) + len(self.after)
158 if self.after and self.after[-1] == '\\ No newline at end of file\n':
158 if self.after and self.after[-1] == '\\ No newline at end of file\n':
159 delta -= 1
159 delta -= 1
160 fromlen = delta + self.removed
160 fromlen = delta + self.removed
161 tolen = delta + self.added
161 tolen = delta + self.added
162 fp.write('@@ -%d,%d +%d,%d @@%s\n' %
162 fp.write('@@ -%d,%d +%d,%d @@%s\n' %
163 (self.fromline, fromlen, self.toline, tolen,
163 (self.fromline, fromlen, self.toline, tolen,
164 self.proc and (' ' + self.proc)))
164 self.proc and (' ' + self.proc)))
165 fp.write(''.join(self.before + self.hunk + self.after))
165 fp.write(''.join(self.before + self.hunk + self.after))
166
166
167 pretty = write
167 pretty = write
168
168
169 def filename(self):
169 def filename(self):
170 return self.header.filename()
170 return self.header.filename()
171
171
172 def __repr__(self):
172 def __repr__(self):
173 return '<hunk %r@%d>' % (self.filename(), self.fromline)
173 return '<hunk %r@%d>' % (self.filename(), self.fromline)
174
174
175 def parsepatch(fp):
175 def parsepatch(fp):
176 """patch -> [] of hunks """
176 """patch -> [] of hunks """
177 class parser(object):
177 class parser(object):
178 """patch parsing state machine"""
178 """patch parsing state machine"""
179 def __init__(self):
179 def __init__(self):
180 self.fromline = 0
180 self.fromline = 0
181 self.toline = 0
181 self.toline = 0
182 self.proc = ''
182 self.proc = ''
183 self.header = None
183 self.header = None
184 self.context = []
184 self.context = []
185 self.before = []
185 self.before = []
186 self.hunk = []
186 self.hunk = []
187 self.stream = []
187 self.stream = []
188
188
189 def addrange(self, (fromstart, fromend, tostart, toend, proc)):
189 def addrange(self, (fromstart, fromend, tostart, toend, proc)):
190 self.fromline = int(fromstart)
190 self.fromline = int(fromstart)
191 self.toline = int(tostart)
191 self.toline = int(tostart)
192 self.proc = proc
192 self.proc = proc
193
193
194 def addcontext(self, context):
194 def addcontext(self, context):
195 if self.hunk:
195 if self.hunk:
196 h = hunk(self.header, self.fromline, self.toline, self.proc,
196 h = hunk(self.header, self.fromline, self.toline, self.proc,
197 self.before, self.hunk, context)
197 self.before, self.hunk, context)
198 self.header.hunks.append(h)
198 self.header.hunks.append(h)
199 self.stream.append(h)
199 self.stream.append(h)
200 self.fromline += len(self.before) + h.removed
200 self.fromline += len(self.before) + h.removed
201 self.toline += len(self.before) + h.added
201 self.toline += len(self.before) + h.added
202 self.before = []
202 self.before = []
203 self.hunk = []
203 self.hunk = []
204 self.proc = ''
204 self.proc = ''
205 self.context = context
205 self.context = context
206
206
207 def addhunk(self, hunk):
207 def addhunk(self, hunk):
208 if self.context:
208 if self.context:
209 self.before = self.context
209 self.before = self.context
210 self.context = []
210 self.context = []
211 self.hunk = hunk
211 self.hunk = hunk
212
212
213 def newfile(self, hdr):
213 def newfile(self, hdr):
214 self.addcontext([])
214 self.addcontext([])
215 h = header(hdr)
215 h = header(hdr)
216 self.stream.append(h)
216 self.stream.append(h)
217 self.header = h
217 self.header = h
218
218
219 def finished(self):
219 def finished(self):
220 self.addcontext([])
220 self.addcontext([])
221 return self.stream
221 return self.stream
222
222
223 transitions = {
223 transitions = {
224 'file': {'context': addcontext,
224 'file': {'context': addcontext,
225 'file': newfile,
225 'file': newfile,
226 'hunk': addhunk,
226 'hunk': addhunk,
227 'range': addrange},
227 'range': addrange},
228 'context': {'file': newfile,
228 'context': {'file': newfile,
229 'hunk': addhunk,
229 'hunk': addhunk,
230 'range': addrange},
230 'range': addrange},
231 'hunk': {'context': addcontext,
231 'hunk': {'context': addcontext,
232 'file': newfile,
232 'file': newfile,
233 'range': addrange},
233 'range': addrange},
234 'range': {'context': addcontext,
234 'range': {'context': addcontext,
235 'hunk': addhunk},
235 'hunk': addhunk},
236 }
236 }
237
237
238 p = parser()
238 p = parser()
239
239
240 state = 'context'
240 state = 'context'
241 for newstate, data in scanpatch(fp):
241 for newstate, data in scanpatch(fp):
242 try:
242 try:
243 p.transitions[state][newstate](p, data)
243 p.transitions[state][newstate](p, data)
244 except KeyError:
244 except KeyError:
245 raise patch.PatchError('unhandled transition: %s -> %s' %
245 raise patch.PatchError('unhandled transition: %s -> %s' %
246 (state, newstate))
246 (state, newstate))
247 state = newstate
247 state = newstate
248 return p.finished()
248 return p.finished()
249
249
250 def filterpatch(ui, chunks):
250 def filterpatch(ui, chunks):
251 """Interactively filter patch chunks into applied-only chunks"""
251 """Interactively filter patch chunks into applied-only chunks"""
252 chunks = list(chunks)
252 chunks = list(chunks)
253 chunks.reverse()
253 chunks.reverse()
254 seen = set()
254 seen = set()
255 def consumefile():
255 def consumefile():
256 """fetch next portion from chunks until a 'header' is seen
256 """fetch next portion from chunks until a 'header' is seen
257 NB: header == new-file mark
257 NB: header == new-file mark
258 """
258 """
259 consumed = []
259 consumed = []
260 while chunks:
260 while chunks:
261 if isinstance(chunks[-1], header):
261 if isinstance(chunks[-1], header):
262 break
262 break
263 else:
263 else:
264 consumed.append(chunks.pop())
264 consumed.append(chunks.pop())
265 return consumed
265 return consumed
266
266
267 resp_all = [None] # this two are changed from inside prompt,
267 resp_all = [None] # this two are changed from inside prompt,
268 resp_file = [None] # so can't be usual variables
268 resp_file = [None] # so can't be usual variables
269 applied = {} # 'filename' -> [] of chunks
269 applied = {} # 'filename' -> [] of chunks
270 def prompt(query):
270 def prompt(query):
271 """prompt query, and process base inputs
271 """prompt query, and process base inputs
272
272
273 - y/n for the rest of file
273 - y/n for the rest of file
274 - y/n for the rest
274 - y/n for the rest
275 - ? (help)
275 - ? (help)
276 - q (quit)
276 - q (quit)
277
277
278 else, input is returned to the caller.
278 else, input is returned to the caller.
279 """
279 """
280 if resp_all[0] is not None:
280 if resp_all[0] is not None:
281 return resp_all[0]
281 return resp_all[0]
282 if resp_file[0] is not None:
282 if resp_file[0] is not None:
283 return resp_file[0]
283 return resp_file[0]
284 while True:
284 while True:
285 resps = _('[Ynsfdaq?]')
285 resps = _('[Ynsfdaq?]')
286 choices = (_('&Yes, record this change'),
286 choices = (_('&Yes, record this change'),
287 _('&No, skip this change'),
287 _('&No, skip this change'),
288 _('&Skip remaining changes to this file'),
288 _('&Skip remaining changes to this file'),
289 _('Record remaining changes to this &file'),
289 _('Record remaining changes to this &file'),
290 _('&Done, skip remaining changes and files'),
290 _('&Done, skip remaining changes and files'),
291 _('Record &all changes to all remaining files'),
291 _('Record &all changes to all remaining files'),
292 _('&Quit, recording no changes'),
292 _('&Quit, recording no changes'),
293 _('&?'))
293 _('&?'))
294 r = ui.promptchoice("%s %s " % (query, resps), choices)
294 r = ui.promptchoice("%s %s" % (query, resps), choices)
295 if r == 7: # ?
295 if r == 7: # ?
296 doc = gettext(record.__doc__)
296 doc = gettext(record.__doc__)
297 c = doc.find(_('y - record this change'))
297 c = doc.find(_('y - record this change'))
298 for l in doc[c:].splitlines():
298 for l in doc[c:].splitlines():
299 if l: ui.write(l.strip(), '\n')
299 if l: ui.write(l.strip(), '\n')
300 continue
300 continue
301 elif r == 0: # yes
301 elif r == 0: # yes
302 ret = 'y'
302 ret = 'y'
303 elif r == 1: # no
303 elif r == 1: # no
304 ret = 'n'
304 ret = 'n'
305 elif r == 2: # Skip
305 elif r == 2: # Skip
306 ret = resp_file[0] = 'n'
306 ret = resp_file[0] = 'n'
307 elif r == 3: # file (Record remaining)
307 elif r == 3: # file (Record remaining)
308 ret = resp_file[0] = 'y'
308 ret = resp_file[0] = 'y'
309 elif r == 4: # done, skip remaining
309 elif r == 4: # done, skip remaining
310 ret = resp_all[0] = 'n'
310 ret = resp_all[0] = 'n'
311 elif r == 5: # all
311 elif r == 5: # all
312 ret = resp_all[0] = 'y'
312 ret = resp_all[0] = 'y'
313 elif r == 6: # quit
313 elif r == 6: # quit
314 raise util.Abort(_('user quit'))
314 raise util.Abort(_('user quit'))
315 return ret
315 return ret
316 pos, total = 0, len(chunks) - 1
316 pos, total = 0, len(chunks) - 1
317 while chunks:
317 while chunks:
318 chunk = chunks.pop()
318 chunk = chunks.pop()
319 if isinstance(chunk, header):
319 if isinstance(chunk, header):
320 # new-file mark
320 # new-file mark
321 resp_file = [None]
321 resp_file = [None]
322 fixoffset = 0
322 fixoffset = 0
323 hdr = ''.join(chunk.header)
323 hdr = ''.join(chunk.header)
324 if hdr in seen:
324 if hdr in seen:
325 consumefile()
325 consumefile()
326 continue
326 continue
327 seen.add(hdr)
327 seen.add(hdr)
328 if resp_all[0] is None:
328 if resp_all[0] is None:
329 chunk.pretty(ui)
329 chunk.pretty(ui)
330 r = prompt(_('examine changes to %s?') %
330 r = prompt(_('examine changes to %s?') %
331 _(' and ').join(map(repr, chunk.files())))
331 _(' and ').join(map(repr, chunk.files())))
332 if r == _('y'):
332 if r == _('y'):
333 applied[chunk.filename()] = [chunk]
333 applied[chunk.filename()] = [chunk]
334 if chunk.allhunks():
334 if chunk.allhunks():
335 applied[chunk.filename()] += consumefile()
335 applied[chunk.filename()] += consumefile()
336 else:
336 else:
337 consumefile()
337 consumefile()
338 else:
338 else:
339 # new hunk
339 # new hunk
340 if resp_file[0] is None and resp_all[0] is None:
340 if resp_file[0] is None and resp_all[0] is None:
341 chunk.pretty(ui)
341 chunk.pretty(ui)
342 r = total == 1 and prompt(_('record this change to %r?') %
342 r = total == 1 and prompt(_('record this change to %r?') %
343 chunk.filename()) \
343 chunk.filename()) \
344 or prompt(_('record change %d/%d to %r?') %
344 or prompt(_('record change %d/%d to %r?') %
345 (pos, total, chunk.filename()))
345 (pos, total, chunk.filename()))
346 if r == _('y'):
346 if r == _('y'):
347 if fixoffset:
347 if fixoffset:
348 chunk = copy.copy(chunk)
348 chunk = copy.copy(chunk)
349 chunk.toline += fixoffset
349 chunk.toline += fixoffset
350 applied[chunk.filename()].append(chunk)
350 applied[chunk.filename()].append(chunk)
351 else:
351 else:
352 fixoffset += chunk.removed - chunk.added
352 fixoffset += chunk.removed - chunk.added
353 pos = pos + 1
353 pos = pos + 1
354 return reduce(operator.add, [h for h in applied.itervalues()
354 return reduce(operator.add, [h for h in applied.itervalues()
355 if h[0].special() or len(h) > 1], [])
355 if h[0].special() or len(h) > 1], [])
356
356
357 def record(ui, repo, *pats, **opts):
357 def record(ui, repo, *pats, **opts):
358 '''interactively select changes to commit
358 '''interactively select changes to commit
359
359
360 If a list of files is omitted, all changes reported by "hg status"
360 If a list of files is omitted, all changes reported by "hg status"
361 will be candidates for recording.
361 will be candidates for recording.
362
362
363 See 'hg help dates' for a list of formats valid for -d/--date.
363 See 'hg help dates' for a list of formats valid for -d/--date.
364
364
365 You will be prompted for whether to record changes to each
365 You will be prompted for whether to record changes to each
366 modified file, and for files with multiple changes, for each
366 modified file, and for files with multiple changes, for each
367 change to use. For each query, the following responses are
367 change to use. For each query, the following responses are
368 possible::
368 possible::
369
369
370 y - record this change
370 y - record this change
371 n - skip this change
371 n - skip this change
372
372
373 s - skip remaining changes to this file
373 s - skip remaining changes to this file
374 f - record remaining changes to this file
374 f - record remaining changes to this file
375
375
376 d - done, skip remaining changes and files
376 d - done, skip remaining changes and files
377 a - record all changes to all remaining files
377 a - record all changes to all remaining files
378 q - quit, recording no changes
378 q - quit, recording no changes
379
379
380 ? - display help'''
380 ? - display help'''
381
381
382 def record_committer(ui, repo, pats, opts):
382 def record_committer(ui, repo, pats, opts):
383 commands.commit(ui, repo, *pats, **opts)
383 commands.commit(ui, repo, *pats, **opts)
384
384
385 dorecord(ui, repo, record_committer, *pats, **opts)
385 dorecord(ui, repo, record_committer, *pats, **opts)
386
386
387
387
388 def qrecord(ui, repo, patch, *pats, **opts):
388 def qrecord(ui, repo, patch, *pats, **opts):
389 '''interactively record a new patch
389 '''interactively record a new patch
390
390
391 See 'hg help qnew' & 'hg help record' for more information and
391 See 'hg help qnew' & 'hg help record' for more information and
392 usage.
392 usage.
393 '''
393 '''
394
394
395 try:
395 try:
396 mq = extensions.find('mq')
396 mq = extensions.find('mq')
397 except KeyError:
397 except KeyError:
398 raise util.Abort(_("'mq' extension not loaded"))
398 raise util.Abort(_("'mq' extension not loaded"))
399
399
400 def qrecord_committer(ui, repo, pats, opts):
400 def qrecord_committer(ui, repo, pats, opts):
401 mq.new(ui, repo, patch, *pats, **opts)
401 mq.new(ui, repo, patch, *pats, **opts)
402
402
403 opts = opts.copy()
403 opts = opts.copy()
404 opts['force'] = True # always 'qnew -f'
404 opts['force'] = True # always 'qnew -f'
405 dorecord(ui, repo, qrecord_committer, *pats, **opts)
405 dorecord(ui, repo, qrecord_committer, *pats, **opts)
406
406
407
407
408 def dorecord(ui, repo, committer, *pats, **opts):
408 def dorecord(ui, repo, committer, *pats, **opts):
409 if not ui.interactive():
409 if not ui.interactive():
410 raise util.Abort(_('running non-interactively, use commit instead'))
410 raise util.Abort(_('running non-interactively, use commit instead'))
411
411
412 def recordfunc(ui, repo, message, match, opts):
412 def recordfunc(ui, repo, message, match, opts):
413 """This is generic record driver.
413 """This is generic record driver.
414
414
415 Its job is to interactively filter local changes, and accordingly
415 Its job is to interactively filter local changes, and accordingly
416 prepare working dir into a state, where the job can be delegated to
416 prepare working dir into a state, where the job can be delegated to
417 non-interactive commit command such as 'commit' or 'qrefresh'.
417 non-interactive commit command such as 'commit' or 'qrefresh'.
418
418
419 After the actual job is done by non-interactive command, working dir
419 After the actual job is done by non-interactive command, working dir
420 state is restored to original.
420 state is restored to original.
421
421
422 In the end we'll record intresting changes, and everything else will be
422 In the end we'll record intresting changes, and everything else will be
423 left in place, so the user can continue his work.
423 left in place, so the user can continue his work.
424 """
424 """
425
425
426 changes = repo.status(match=match)[:3]
426 changes = repo.status(match=match)[:3]
427 diffopts = mdiff.diffopts(git=True, nodates=True)
427 diffopts = mdiff.diffopts(git=True, nodates=True)
428 chunks = patch.diff(repo, changes=changes, opts=diffopts)
428 chunks = patch.diff(repo, changes=changes, opts=diffopts)
429 fp = cStringIO.StringIO()
429 fp = cStringIO.StringIO()
430 fp.write(''.join(chunks))
430 fp.write(''.join(chunks))
431 fp.seek(0)
431 fp.seek(0)
432
432
433 # 1. filter patch, so we have intending-to apply subset of it
433 # 1. filter patch, so we have intending-to apply subset of it
434 chunks = filterpatch(ui, parsepatch(fp))
434 chunks = filterpatch(ui, parsepatch(fp))
435 del fp
435 del fp
436
436
437 contenders = set()
437 contenders = set()
438 for h in chunks:
438 for h in chunks:
439 try: contenders.update(set(h.files()))
439 try: contenders.update(set(h.files()))
440 except AttributeError: pass
440 except AttributeError: pass
441
441
442 changed = changes[0] + changes[1] + changes[2]
442 changed = changes[0] + changes[1] + changes[2]
443 newfiles = [f for f in changed if f in contenders]
443 newfiles = [f for f in changed if f in contenders]
444 if not newfiles:
444 if not newfiles:
445 ui.status(_('no changes to record\n'))
445 ui.status(_('no changes to record\n'))
446 return 0
446 return 0
447
447
448 modified = set(changes[0])
448 modified = set(changes[0])
449
449
450 # 2. backup changed files, so we can restore them in the end
450 # 2. backup changed files, so we can restore them in the end
451 backups = {}
451 backups = {}
452 backupdir = repo.join('record-backups')
452 backupdir = repo.join('record-backups')
453 try:
453 try:
454 os.mkdir(backupdir)
454 os.mkdir(backupdir)
455 except OSError, err:
455 except OSError, err:
456 if err.errno != errno.EEXIST:
456 if err.errno != errno.EEXIST:
457 raise
457 raise
458 try:
458 try:
459 # backup continues
459 # backup continues
460 for f in newfiles:
460 for f in newfiles:
461 if f not in modified:
461 if f not in modified:
462 continue
462 continue
463 fd, tmpname = tempfile.mkstemp(prefix=f.replace('/', '_')+'.',
463 fd, tmpname = tempfile.mkstemp(prefix=f.replace('/', '_')+'.',
464 dir=backupdir)
464 dir=backupdir)
465 os.close(fd)
465 os.close(fd)
466 ui.debug(_('backup %r as %r\n') % (f, tmpname))
466 ui.debug(_('backup %r as %r\n') % (f, tmpname))
467 util.copyfile(repo.wjoin(f), tmpname)
467 util.copyfile(repo.wjoin(f), tmpname)
468 backups[f] = tmpname
468 backups[f] = tmpname
469
469
470 fp = cStringIO.StringIO()
470 fp = cStringIO.StringIO()
471 for c in chunks:
471 for c in chunks:
472 if c.filename() in backups:
472 if c.filename() in backups:
473 c.write(fp)
473 c.write(fp)
474 dopatch = fp.tell()
474 dopatch = fp.tell()
475 fp.seek(0)
475 fp.seek(0)
476
476
477 # 3a. apply filtered patch to clean repo (clean)
477 # 3a. apply filtered patch to clean repo (clean)
478 if backups:
478 if backups:
479 hg.revert(repo, repo.dirstate.parents()[0], backups.has_key)
479 hg.revert(repo, repo.dirstate.parents()[0], backups.has_key)
480
480
481 # 3b. (apply)
481 # 3b. (apply)
482 if dopatch:
482 if dopatch:
483 try:
483 try:
484 ui.debug(_('applying patch\n'))
484 ui.debug(_('applying patch\n'))
485 ui.debug(fp.getvalue())
485 ui.debug(fp.getvalue())
486 pfiles = {}
486 pfiles = {}
487 patch.internalpatch(fp, ui, 1, repo.root, files=pfiles,
487 patch.internalpatch(fp, ui, 1, repo.root, files=pfiles,
488 eolmode=None)
488 eolmode=None)
489 patch.updatedir(ui, repo, pfiles)
489 patch.updatedir(ui, repo, pfiles)
490 except patch.PatchError, err:
490 except patch.PatchError, err:
491 s = str(err)
491 s = str(err)
492 if s:
492 if s:
493 raise util.Abort(s)
493 raise util.Abort(s)
494 else:
494 else:
495 raise util.Abort(_('patch failed to apply'))
495 raise util.Abort(_('patch failed to apply'))
496 del fp
496 del fp
497
497
498 # 4. We prepared working directory according to filtered patch.
498 # 4. We prepared working directory according to filtered patch.
499 # Now is the time to delegate the job to commit/qrefresh or the like!
499 # Now is the time to delegate the job to commit/qrefresh or the like!
500
500
501 # it is important to first chdir to repo root -- we'll call a
501 # it is important to first chdir to repo root -- we'll call a
502 # highlevel command with list of pathnames relative to repo root
502 # highlevel command with list of pathnames relative to repo root
503 cwd = os.getcwd()
503 cwd = os.getcwd()
504 os.chdir(repo.root)
504 os.chdir(repo.root)
505 try:
505 try:
506 committer(ui, repo, newfiles, opts)
506 committer(ui, repo, newfiles, opts)
507 finally:
507 finally:
508 os.chdir(cwd)
508 os.chdir(cwd)
509
509
510 return 0
510 return 0
511 finally:
511 finally:
512 # 5. finally restore backed-up files
512 # 5. finally restore backed-up files
513 try:
513 try:
514 for realname, tmpname in backups.iteritems():
514 for realname, tmpname in backups.iteritems():
515 ui.debug(_('restoring %r to %r\n') % (tmpname, realname))
515 ui.debug(_('restoring %r to %r\n') % (tmpname, realname))
516 util.copyfile(tmpname, repo.wjoin(realname))
516 util.copyfile(tmpname, repo.wjoin(realname))
517 os.unlink(tmpname)
517 os.unlink(tmpname)
518 os.rmdir(backupdir)
518 os.rmdir(backupdir)
519 except OSError:
519 except OSError:
520 pass
520 pass
521 return cmdutil.commit(ui, repo, recordfunc, pats, opts)
521 return cmdutil.commit(ui, repo, recordfunc, pats, opts)
522
522
523 cmdtable = {
523 cmdtable = {
524 "record":
524 "record":
525 (record,
525 (record,
526
526
527 # add commit options
527 # add commit options
528 commands.table['^commit|ci'][1],
528 commands.table['^commit|ci'][1],
529
529
530 _('hg record [OPTION]... [FILE]...')),
530 _('hg record [OPTION]... [FILE]...')),
531 }
531 }
532
532
533
533
534 def extsetup():
534 def extsetup():
535 try:
535 try:
536 mq = extensions.find('mq')
536 mq = extensions.find('mq')
537 except KeyError:
537 except KeyError:
538 return
538 return
539
539
540 qcmdtable = {
540 qcmdtable = {
541 "qrecord":
541 "qrecord":
542 (qrecord,
542 (qrecord,
543
543
544 # add qnew options, except '--force'
544 # add qnew options, except '--force'
545 [opt for opt in mq.cmdtable['qnew'][1] if opt[1] != 'force'],
545 [opt for opt in mq.cmdtable['qnew'][1] if opt[1] != 'force'],
546
546
547 _('hg qrecord [OPTION]... PATCH [FILE]...')),
547 _('hg qrecord [OPTION]... PATCH [FILE]...')),
548 }
548 }
549
549
550 cmdtable.update(qcmdtable)
550 cmdtable.update(qcmdtable)
551
551
@@ -1,208 +1,208
1 % help (no mq, so no qrecord)
1 % help (no mq, so no qrecord)
2 hg: unknown command 'qrecord'
2 hg: unknown command 'qrecord'
3 Mercurial Distributed SCM
3 Mercurial Distributed SCM
4
4
5 basic commands:
5 basic commands:
6
6
7 add add the specified files on the next commit
7 add add the specified files on the next commit
8 annotate show changeset information by line for each file
8 annotate show changeset information by line for each file
9 clone make a copy of an existing repository
9 clone make a copy of an existing repository
10 commit commit the specified files or all outstanding changes
10 commit commit the specified files or all outstanding changes
11 diff diff repository (or selected files)
11 diff diff repository (or selected files)
12 export dump the header and diffs for one or more changesets
12 export dump the header and diffs for one or more changesets
13 forget forget the specified files on the next commit
13 forget forget the specified files on the next commit
14 init create a new repository in the given directory
14 init create a new repository in the given directory
15 log show revision history of entire repository or files
15 log show revision history of entire repository or files
16 merge merge working directory with another revision
16 merge merge working directory with another revision
17 parents show the parents of the working directory or revision
17 parents show the parents of the working directory or revision
18 pull pull changes from the specified source
18 pull pull changes from the specified source
19 push push changes to the specified destination
19 push push changes to the specified destination
20 remove remove the specified files on the next commit
20 remove remove the specified files on the next commit
21 serve export the repository via HTTP
21 serve export the repository via HTTP
22 status show changed files in the working directory
22 status show changed files in the working directory
23 update update working directory
23 update update working directory
24
24
25 use "hg help" for the full list of commands or "hg -v" for details
25 use "hg help" for the full list of commands or "hg -v" for details
26 % help (mq present)
26 % help (mq present)
27 hg qrecord [OPTION]... PATCH [FILE]...
27 hg qrecord [OPTION]... PATCH [FILE]...
28
28
29 interactively record a new patch
29 interactively record a new patch
30
30
31 See 'hg help qnew' & 'hg help record' for more information and usage.
31 See 'hg help qnew' & 'hg help record' for more information and usage.
32
32
33 options:
33 options:
34
34
35 -e --edit edit commit message
35 -e --edit edit commit message
36 -g --git use git extended diff format
36 -g --git use git extended diff format
37 -U --currentuser add "From: <current user>" to patch
37 -U --currentuser add "From: <current user>" to patch
38 -u --user add "From: <given user>" to patch
38 -u --user add "From: <given user>" to patch
39 -D --currentdate add "Date: <current date>" to patch
39 -D --currentdate add "Date: <current date>" to patch
40 -d --date add "Date: <given date>" to patch
40 -d --date add "Date: <given date>" to patch
41 -I --include include names matching the given patterns
41 -I --include include names matching the given patterns
42 -X --exclude exclude names matching the given patterns
42 -X --exclude exclude names matching the given patterns
43 -m --message use <text> as commit message
43 -m --message use <text> as commit message
44 -l --logfile read commit message from <file>
44 -l --logfile read commit message from <file>
45
45
46 use "hg -v help qrecord" to show global options
46 use "hg -v help qrecord" to show global options
47 % base commit
47 % base commit
48 % changing files
48 % changing files
49 % whole diff
49 % whole diff
50 diff -r 1057167b20ef 1.txt
50 diff -r 1057167b20ef 1.txt
51 --- a/1.txt
51 --- a/1.txt
52 +++ b/1.txt
52 +++ b/1.txt
53 @@ -1,5 +1,5 @@
53 @@ -1,5 +1,5 @@
54 1
54 1
55 -2
55 -2
56 +2 2
56 +2 2
57 3
57 3
58 -4
58 -4
59 +4 4
59 +4 4
60 5
60 5
61 diff -r 1057167b20ef 2.txt
61 diff -r 1057167b20ef 2.txt
62 --- a/2.txt
62 --- a/2.txt
63 +++ b/2.txt
63 +++ b/2.txt
64 @@ -1,5 +1,5 @@
64 @@ -1,5 +1,5 @@
65 a
65 a
66 -b
66 -b
67 +b b
67 +b b
68 c
68 c
69 d
69 d
70 e
70 e
71 diff -r 1057167b20ef dir/a.txt
71 diff -r 1057167b20ef dir/a.txt
72 --- a/dir/a.txt
72 --- a/dir/a.txt
73 +++ b/dir/a.txt
73 +++ b/dir/a.txt
74 @@ -1,4 +1,4 @@
74 @@ -1,4 +1,4 @@
75 -hello world
75 -hello world
76 +hello world!
76 +hello world!
77
77
78 someone
78 someone
79 up
79 up
80 % qrecord a.patch
80 % qrecord a.patch
81 diff --git a/1.txt b/1.txt
81 diff --git a/1.txt b/1.txt
82 2 hunks, 4 lines changed
82 2 hunks, 4 lines changed
83 examine changes to '1.txt'? [Ynsfdaq?] @@ -1,3 +1,3 @@
83 examine changes to '1.txt'? [Ynsfdaq?] @@ -1,3 +1,3 @@
84 1
84 1
85 -2
85 -2
86 +2 2
86 +2 2
87 3
87 3
88 record change 1/6 to '1.txt'? [Ynsfdaq?] @@ -3,3 +3,3 @@
88 record change 1/6 to '1.txt'? [Ynsfdaq?] @@ -3,3 +3,3 @@
89 3
89 3
90 -4
90 -4
91 +4 4
91 +4 4
92 5
92 5
93 record change 2/6 to '1.txt'? [Ynsfdaq?] diff --git a/2.txt b/2.txt
93 record change 2/6 to '1.txt'? [Ynsfdaq?] diff --git a/2.txt b/2.txt
94 1 hunks, 2 lines changed
94 1 hunks, 2 lines changed
95 examine changes to '2.txt'? [Ynsfdaq?] @@ -1,5 +1,5 @@
95 examine changes to '2.txt'? [Ynsfdaq?] @@ -1,5 +1,5 @@
96 a
96 a
97 -b
97 -b
98 +b b
98 +b b
99 c
99 c
100 d
100 d
101 e
101 e
102 record change 4/6 to '2.txt'? [Ynsfdaq?] diff --git a/dir/a.txt b/dir/a.txt
102 record change 4/6 to '2.txt'? [Ynsfdaq?] diff --git a/dir/a.txt b/dir/a.txt
103 1 hunks, 2 lines changed
103 1 hunks, 2 lines changed
104 examine changes to 'dir/a.txt'? [Ynsfdaq?]
104 examine changes to 'dir/a.txt'? [Ynsfdaq?]
105 % after qrecord a.patch 'tip'
105 % after qrecord a.patch 'tip'
106 changeset: 1:5d1ca63427ee
106 changeset: 1:5d1ca63427ee
107 tag: qtip
107 tag: qtip
108 tag: tip
108 tag: tip
109 tag: a.patch
109 tag: a.patch
110 tag: qbase
110 tag: qbase
111 user: test
111 user: test
112 date: Thu Jan 01 00:00:00 1970 +0000
112 date: Thu Jan 01 00:00:00 1970 +0000
113 summary: aaa
113 summary: aaa
114
114
115 diff -r 1057167b20ef -r 5d1ca63427ee 1.txt
115 diff -r 1057167b20ef -r 5d1ca63427ee 1.txt
116 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
116 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
117 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
117 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
118 @@ -1,5 +1,5 @@
118 @@ -1,5 +1,5 @@
119 1
119 1
120 -2
120 -2
121 +2 2
121 +2 2
122 3
122 3
123 4
123 4
124 5
124 5
125 diff -r 1057167b20ef -r 5d1ca63427ee 2.txt
125 diff -r 1057167b20ef -r 5d1ca63427ee 2.txt
126 --- a/2.txt Thu Jan 01 00:00:00 1970 +0000
126 --- a/2.txt Thu Jan 01 00:00:00 1970 +0000
127 +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000
127 +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000
128 @@ -1,5 +1,5 @@
128 @@ -1,5 +1,5 @@
129 a
129 a
130 -b
130 -b
131 +b b
131 +b b
132 c
132 c
133 d
133 d
134 e
134 e
135
135
136
136
137 % after qrecord a.patch 'diff'
137 % after qrecord a.patch 'diff'
138 diff -r 5d1ca63427ee 1.txt
138 diff -r 5d1ca63427ee 1.txt
139 --- a/1.txt
139 --- a/1.txt
140 +++ b/1.txt
140 +++ b/1.txt
141 @@ -1,5 +1,5 @@
141 @@ -1,5 +1,5 @@
142 1
142 1
143 2 2
143 2 2
144 3
144 3
145 -4
145 -4
146 +4 4
146 +4 4
147 5
147 5
148 diff -r 5d1ca63427ee dir/a.txt
148 diff -r 5d1ca63427ee dir/a.txt
149 --- a/dir/a.txt
149 --- a/dir/a.txt
150 +++ b/dir/a.txt
150 +++ b/dir/a.txt
151 @@ -1,4 +1,4 @@
151 @@ -1,4 +1,4 @@
152 -hello world
152 -hello world
153 +hello world!
153 +hello world!
154
154
155 someone
155 someone
156 up
156 up
157 % qrecord b.patch
157 % qrecord b.patch
158 diff --git a/1.txt b/1.txt
158 diff --git a/1.txt b/1.txt
159 1 hunks, 2 lines changed
159 1 hunks, 2 lines changed
160 examine changes to '1.txt'? [Ynsfdaq?] @@ -1,5 +1,5 @@
160 examine changes to '1.txt'? [Ynsfdaq?] @@ -1,5 +1,5 @@
161 1
161 1
162 2 2
162 2 2
163 3
163 3
164 -4
164 -4
165 +4 4
165 +4 4
166 5
166 5
167 record change 1/3 to '1.txt'? [Ynsfdaq?] diff --git a/dir/a.txt b/dir/a.txt
167 record change 1/3 to '1.txt'? [Ynsfdaq?] diff --git a/dir/a.txt b/dir/a.txt
168 1 hunks, 2 lines changed
168 1 hunks, 2 lines changed
169 examine changes to 'dir/a.txt'? [Ynsfdaq?] @@ -1,4 +1,4 @@
169 examine changes to 'dir/a.txt'? [Ynsfdaq?] @@ -1,4 +1,4 @@
170 -hello world
170 -hello world
171 +hello world!
171 +hello world!
172
172
173 someone
173 someone
174 up
174 up
175 record change 3/3 to 'dir/a.txt'? [Ynsfdaq?]
175 record change 3/3 to 'dir/a.txt'? [Ynsfdaq?]
176 % after qrecord b.patch 'tip'
176 % after qrecord b.patch 'tip'
177 changeset: 2:b056198bf878
177 changeset: 2:b056198bf878
178 tag: qtip
178 tag: qtip
179 tag: tip
179 tag: tip
180 tag: b.patch
180 tag: b.patch
181 user: test
181 user: test
182 date: Thu Jan 01 00:00:00 1970 +0000
182 date: Thu Jan 01 00:00:00 1970 +0000
183 summary: bbb
183 summary: bbb
184
184
185 diff -r 5d1ca63427ee -r b056198bf878 1.txt
185 diff -r 5d1ca63427ee -r b056198bf878 1.txt
186 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
186 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
187 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
187 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
188 @@ -1,5 +1,5 @@
188 @@ -1,5 +1,5 @@
189 1
189 1
190 2 2
190 2 2
191 3
191 3
192 -4
192 -4
193 +4 4
193 +4 4
194 5
194 5
195 diff -r 5d1ca63427ee -r b056198bf878 dir/a.txt
195 diff -r 5d1ca63427ee -r b056198bf878 dir/a.txt
196 --- a/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
196 --- a/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
197 +++ b/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
197 +++ b/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
198 @@ -1,4 +1,4 @@
198 @@ -1,4 +1,4 @@
199 -hello world
199 -hello world
200 +hello world!
200 +hello world!
201
201
202 someone
202 someone
203 up
203 up
204
204
205
205
206 % after qrecord b.patch 'diff'
206 % after qrecord b.patch 'diff'
207
207
208 % --- end ---
208 % --- end ---
@@ -1,595 +1,595
1 % help
1 % help
2 hg record [OPTION]... [FILE]...
2 hg record [OPTION]... [FILE]...
3
3
4 interactively select changes to commit
4 interactively select changes to commit
5
5
6 If a list of files is omitted, all changes reported by "hg status" will be
6 If a list of files is omitted, all changes reported by "hg status" will be
7 candidates for recording.
7 candidates for recording.
8
8
9 See 'hg help dates' for a list of formats valid for -d/--date.
9 See 'hg help dates' for a list of formats valid for -d/--date.
10
10
11 You will be prompted for whether to record changes to each modified file,
11 You will be prompted for whether to record changes to each modified file,
12 and for files with multiple changes, for each change to use. For each
12 and for files with multiple changes, for each change to use. For each
13 query, the following responses are possible:
13 query, the following responses are possible:
14
14
15 y - record this change
15 y - record this change
16 n - skip this change
16 n - skip this change
17
17
18 s - skip remaining changes to this file
18 s - skip remaining changes to this file
19 f - record remaining changes to this file
19 f - record remaining changes to this file
20
20
21 d - done, skip remaining changes and files
21 d - done, skip remaining changes and files
22 a - record all changes to all remaining files
22 a - record all changes to all remaining files
23 q - quit, recording no changes
23 q - quit, recording no changes
24
24
25 ? - display help
25 ? - display help
26
26
27 options:
27 options:
28
28
29 -A --addremove mark new/missing files as added/removed before committing
29 -A --addremove mark new/missing files as added/removed before committing
30 --close-branch mark a branch as closed, hiding it from the branch list
30 --close-branch mark a branch as closed, hiding it from the branch list
31 -I --include include names matching the given patterns
31 -I --include include names matching the given patterns
32 -X --exclude exclude names matching the given patterns
32 -X --exclude exclude names matching the given patterns
33 -m --message use <text> as commit message
33 -m --message use <text> as commit message
34 -l --logfile read commit message from <file>
34 -l --logfile read commit message from <file>
35 -d --date record datecode as commit date
35 -d --date record datecode as commit date
36 -u --user record the specified user as committer
36 -u --user record the specified user as committer
37
37
38 use "hg -v help record" to show global options
38 use "hg -v help record" to show global options
39 % select no files
39 % select no files
40 diff --git a/empty-rw b/empty-rw
40 diff --git a/empty-rw b/empty-rw
41 new file mode 100644
41 new file mode 100644
42 examine changes to 'empty-rw'? [Ynsfdaq?] no changes to record
42 examine changes to 'empty-rw'? [Ynsfdaq?] no changes to record
43
43
44 changeset: -1:000000000000
44 changeset: -1:000000000000
45 tag: tip
45 tag: tip
46 user:
46 user:
47 date: Thu Jan 01 00:00:00 1970 +0000
47 date: Thu Jan 01 00:00:00 1970 +0000
48
48
49
49
50 % select files but no hunks
50 % select files but no hunks
51 diff --git a/empty-rw b/empty-rw
51 diff --git a/empty-rw b/empty-rw
52 new file mode 100644
52 new file mode 100644
53 examine changes to 'empty-rw'? [Ynsfdaq?] abort: empty commit message
53 examine changes to 'empty-rw'? [Ynsfdaq?] abort: empty commit message
54
54
55 changeset: -1:000000000000
55 changeset: -1:000000000000
56 tag: tip
56 tag: tip
57 user:
57 user:
58 date: Thu Jan 01 00:00:00 1970 +0000
58 date: Thu Jan 01 00:00:00 1970 +0000
59
59
60
60
61 % record empty file
61 % record empty file
62 diff --git a/empty-rw b/empty-rw
62 diff --git a/empty-rw b/empty-rw
63 new file mode 100644
63 new file mode 100644
64 examine changes to 'empty-rw'? [Ynsfdaq?]
64 examine changes to 'empty-rw'? [Ynsfdaq?]
65 changeset: 0:c0708cf4e46e
65 changeset: 0:c0708cf4e46e
66 tag: tip
66 tag: tip
67 user: test
67 user: test
68 date: Thu Jan 01 00:00:00 1970 +0000
68 date: Thu Jan 01 00:00:00 1970 +0000
69 summary: empty
69 summary: empty
70
70
71
71
72 % rename empty file
72 % rename empty file
73 diff --git a/empty-rw b/empty-rename
73 diff --git a/empty-rw b/empty-rename
74 rename from empty-rw
74 rename from empty-rw
75 rename to empty-rename
75 rename to empty-rename
76 examine changes to 'empty-rw' and 'empty-rename'? [Ynsfdaq?]
76 examine changes to 'empty-rw' and 'empty-rename'? [Ynsfdaq?]
77 changeset: 1:df251d174da3
77 changeset: 1:df251d174da3
78 tag: tip
78 tag: tip
79 user: test
79 user: test
80 date: Thu Jan 01 00:00:01 1970 +0000
80 date: Thu Jan 01 00:00:01 1970 +0000
81 summary: rename
81 summary: rename
82
82
83
83
84 % copy empty file
84 % copy empty file
85 diff --git a/empty-rename b/empty-copy
85 diff --git a/empty-rename b/empty-copy
86 copy from empty-rename
86 copy from empty-rename
87 copy to empty-copy
87 copy to empty-copy
88 examine changes to 'empty-rename' and 'empty-copy'? [Ynsfdaq?]
88 examine changes to 'empty-rename' and 'empty-copy'? [Ynsfdaq?]
89 changeset: 2:b63ea3939f8d
89 changeset: 2:b63ea3939f8d
90 tag: tip
90 tag: tip
91 user: test
91 user: test
92 date: Thu Jan 01 00:00:02 1970 +0000
92 date: Thu Jan 01 00:00:02 1970 +0000
93 summary: copy
93 summary: copy
94
94
95
95
96 % delete empty file
96 % delete empty file
97 diff --git a/empty-copy b/empty-copy
97 diff --git a/empty-copy b/empty-copy
98 deleted file mode 100644
98 deleted file mode 100644
99 examine changes to 'empty-copy'? [Ynsfdaq?]
99 examine changes to 'empty-copy'? [Ynsfdaq?]
100 changeset: 3:a2546574bce9
100 changeset: 3:a2546574bce9
101 tag: tip
101 tag: tip
102 user: test
102 user: test
103 date: Thu Jan 01 00:00:03 1970 +0000
103 date: Thu Jan 01 00:00:03 1970 +0000
104 summary: delete
104 summary: delete
105
105
106
106
107 % add binary file
107 % add binary file
108 1 changesets found
108 1 changesets found
109 diff --git a/tip.bundle b/tip.bundle
109 diff --git a/tip.bundle b/tip.bundle
110 new file mode 100644
110 new file mode 100644
111 this is a binary file
111 this is a binary file
112 examine changes to 'tip.bundle'? [Ynsfdaq?]
112 examine changes to 'tip.bundle'? [Ynsfdaq?]
113 changeset: 4:9e998a545a8b
113 changeset: 4:9e998a545a8b
114 tag: tip
114 tag: tip
115 user: test
115 user: test
116 date: Thu Jan 01 00:00:04 1970 +0000
116 date: Thu Jan 01 00:00:04 1970 +0000
117 summary: binary
117 summary: binary
118
118
119 diff -r a2546574bce9 -r 9e998a545a8b tip.bundle
119 diff -r a2546574bce9 -r 9e998a545a8b tip.bundle
120 Binary file tip.bundle has changed
120 Binary file tip.bundle has changed
121
121
122 % change binary file
122 % change binary file
123 1 changesets found
123 1 changesets found
124 diff --git a/tip.bundle b/tip.bundle
124 diff --git a/tip.bundle b/tip.bundle
125 this modifies a binary file (all or nothing)
125 this modifies a binary file (all or nothing)
126 examine changes to 'tip.bundle'? [Ynsfdaq?]
126 examine changes to 'tip.bundle'? [Ynsfdaq?]
127 changeset: 5:93d05561507d
127 changeset: 5:93d05561507d
128 tag: tip
128 tag: tip
129 user: test
129 user: test
130 date: Thu Jan 01 00:00:05 1970 +0000
130 date: Thu Jan 01 00:00:05 1970 +0000
131 summary: binary-change
131 summary: binary-change
132
132
133 diff -r 9e998a545a8b -r 93d05561507d tip.bundle
133 diff -r 9e998a545a8b -r 93d05561507d tip.bundle
134 Binary file tip.bundle has changed
134 Binary file tip.bundle has changed
135
135
136 % rename and change binary file
136 % rename and change binary file
137 1 changesets found
137 1 changesets found
138 diff --git a/tip.bundle b/top.bundle
138 diff --git a/tip.bundle b/top.bundle
139 rename from tip.bundle
139 rename from tip.bundle
140 rename to top.bundle
140 rename to top.bundle
141 this modifies a binary file (all or nothing)
141 this modifies a binary file (all or nothing)
142 examine changes to 'tip.bundle' and 'top.bundle'? [Ynsfdaq?]
142 examine changes to 'tip.bundle' and 'top.bundle'? [Ynsfdaq?]
143 changeset: 6:699cc1bea9aa
143 changeset: 6:699cc1bea9aa
144 tag: tip
144 tag: tip
145 user: test
145 user: test
146 date: Thu Jan 01 00:00:06 1970 +0000
146 date: Thu Jan 01 00:00:06 1970 +0000
147 summary: binary-change-rename
147 summary: binary-change-rename
148
148
149 diff -r 93d05561507d -r 699cc1bea9aa tip.bundle
149 diff -r 93d05561507d -r 699cc1bea9aa tip.bundle
150 Binary file tip.bundle has changed
150 Binary file tip.bundle has changed
151 diff -r 93d05561507d -r 699cc1bea9aa top.bundle
151 diff -r 93d05561507d -r 699cc1bea9aa top.bundle
152 Binary file top.bundle has changed
152 Binary file top.bundle has changed
153
153
154 % add plain file
154 % add plain file
155 diff --git a/plain b/plain
155 diff --git a/plain b/plain
156 new file mode 100644
156 new file mode 100644
157 examine changes to 'plain'? [Ynsfdaq?]
157 examine changes to 'plain'? [Ynsfdaq?]
158 changeset: 7:118ed744216b
158 changeset: 7:118ed744216b
159 tag: tip
159 tag: tip
160 user: test
160 user: test
161 date: Thu Jan 01 00:00:07 1970 +0000
161 date: Thu Jan 01 00:00:07 1970 +0000
162 summary: plain
162 summary: plain
163
163
164 diff -r 699cc1bea9aa -r 118ed744216b plain
164 diff -r 699cc1bea9aa -r 118ed744216b plain
165 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
165 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
166 +++ b/plain Thu Jan 01 00:00:07 1970 +0000
166 +++ b/plain Thu Jan 01 00:00:07 1970 +0000
167 @@ -0,0 +1,10 @@
167 @@ -0,0 +1,10 @@
168 +1
168 +1
169 +2
169 +2
170 +3
170 +3
171 +4
171 +4
172 +5
172 +5
173 +6
173 +6
174 +7
174 +7
175 +8
175 +8
176 +9
176 +9
177 +10
177 +10
178
178
179 % modify end of plain file
179 % modify end of plain file
180 diff --git a/plain b/plain
180 diff --git a/plain b/plain
181 1 hunks, 1 lines changed
181 1 hunks, 1 lines changed
182 examine changes to 'plain'? [Ynsfdaq?] @@ -8,3 +8,4 @@
182 examine changes to 'plain'? [Ynsfdaq?] @@ -8,3 +8,4 @@
183 8
183 8
184 9
184 9
185 10
185 10
186 +11
186 +11
187 record this change to 'plain'? [Ynsfdaq?] % modify end of plain file, no EOL
187 record this change to 'plain'? [Ynsfdaq?] % modify end of plain file, no EOL
188 diff --git a/plain b/plain
188 diff --git a/plain b/plain
189 1 hunks, 1 lines changed
189 1 hunks, 1 lines changed
190 examine changes to 'plain'? [Ynsfdaq?] @@ -9,3 +9,4 @@
190 examine changes to 'plain'? [Ynsfdaq?] @@ -9,3 +9,4 @@
191 9
191 9
192 10
192 10
193 11
193 11
194 +cf81a2760718a74d44c0c2eecb72f659e63a69c5
194 +cf81a2760718a74d44c0c2eecb72f659e63a69c5
195 \ No newline at end of file
195 \ No newline at end of file
196 record this change to 'plain'? [Ynsfdaq?] % modify end of plain file, add EOL
196 record this change to 'plain'? [Ynsfdaq?] % modify end of plain file, add EOL
197 diff --git a/plain b/plain
197 diff --git a/plain b/plain
198 1 hunks, 2 lines changed
198 1 hunks, 2 lines changed
199 examine changes to 'plain'? [Ynsfdaq?] @@ -9,4 +9,4 @@
199 examine changes to 'plain'? [Ynsfdaq?] @@ -9,4 +9,4 @@
200 9
200 9
201 10
201 10
202 11
202 11
203 -cf81a2760718a74d44c0c2eecb72f659e63a69c5
203 -cf81a2760718a74d44c0c2eecb72f659e63a69c5
204 \ No newline at end of file
204 \ No newline at end of file
205 +cf81a2760718a74d44c0c2eecb72f659e63a69c5
205 +cf81a2760718a74d44c0c2eecb72f659e63a69c5
206 record this change to 'plain'? [Ynsfdaq?] % modify beginning, trim end, record both
206 record this change to 'plain'? [Ynsfdaq?] % modify beginning, trim end, record both
207 diff --git a/plain b/plain
207 diff --git a/plain b/plain
208 2 hunks, 4 lines changed
208 2 hunks, 4 lines changed
209 examine changes to 'plain'? [Ynsfdaq?] @@ -1,4 +1,4 @@
209 examine changes to 'plain'? [Ynsfdaq?] @@ -1,4 +1,4 @@
210 -1
210 -1
211 +2
211 +2
212 2
212 2
213 3
213 3
214 4
214 4
215 record change 1/2 to 'plain'? [Ynsfdaq?] @@ -8,5 +8,3 @@
215 record change 1/2 to 'plain'? [Ynsfdaq?] @@ -8,5 +8,3 @@
216 8
216 8
217 9
217 9
218 10
218 10
219 -11
219 -11
220 -cf81a2760718a74d44c0c2eecb72f659e63a69c5
220 -cf81a2760718a74d44c0c2eecb72f659e63a69c5
221 record change 2/2 to 'plain'? [Ynsfdaq?]
221 record change 2/2 to 'plain'? [Ynsfdaq?]
222 changeset: 11:d09ab1967dab
222 changeset: 11:d09ab1967dab
223 tag: tip
223 tag: tip
224 user: test
224 user: test
225 date: Thu Jan 01 00:00:10 1970 +0000
225 date: Thu Jan 01 00:00:10 1970 +0000
226 summary: begin-and-end
226 summary: begin-and-end
227
227
228 diff -r e2ecd9b0b78d -r d09ab1967dab plain
228 diff -r e2ecd9b0b78d -r d09ab1967dab plain
229 --- a/plain Thu Jan 01 00:00:10 1970 +0000
229 --- a/plain Thu Jan 01 00:00:10 1970 +0000
230 +++ b/plain Thu Jan 01 00:00:10 1970 +0000
230 +++ b/plain Thu Jan 01 00:00:10 1970 +0000
231 @@ -1,4 +1,4 @@
231 @@ -1,4 +1,4 @@
232 -1
232 -1
233 +2
233 +2
234 2
234 2
235 3
235 3
236 4
236 4
237 @@ -8,5 +8,3 @@
237 @@ -8,5 +8,3 @@
238 8
238 8
239 9
239 9
240 10
240 10
241 -11
241 -11
242 -cf81a2760718a74d44c0c2eecb72f659e63a69c5
242 -cf81a2760718a74d44c0c2eecb72f659e63a69c5
243
243
244 % trim beginning, modify end
244 % trim beginning, modify end
245 % record end
245 % record end
246 diff --git a/plain b/plain
246 diff --git a/plain b/plain
247 2 hunks, 5 lines changed
247 2 hunks, 5 lines changed
248 examine changes to 'plain'? [Ynsfdaq?] @@ -1,9 +1,6 @@
248 examine changes to 'plain'? [Ynsfdaq?] @@ -1,9 +1,6 @@
249 -2
249 -2
250 -2
250 -2
251 -3
251 -3
252 4
252 4
253 5
253 5
254 6
254 6
255 7
255 7
256 8
256 8
257 9
257 9
258 record change 1/2 to 'plain'? [Ynsfdaq?] @@ -4,7 +1,7 @@
258 record change 1/2 to 'plain'? [Ynsfdaq?] @@ -4,7 +1,7 @@
259 4
259 4
260 5
260 5
261 6
261 6
262 7
262 7
263 8
263 8
264 9
264 9
265 -10
265 -10
266 +10.new
266 +10.new
267 record change 2/2 to 'plain'? [Ynsfdaq?]
267 record change 2/2 to 'plain'? [Ynsfdaq?]
268 changeset: 12:44516c9708ae
268 changeset: 12:44516c9708ae
269 tag: tip
269 tag: tip
270 user: test
270 user: test
271 date: Thu Jan 01 00:00:11 1970 +0000
271 date: Thu Jan 01 00:00:11 1970 +0000
272 summary: end-only
272 summary: end-only
273
273
274 diff -r d09ab1967dab -r 44516c9708ae plain
274 diff -r d09ab1967dab -r 44516c9708ae plain
275 --- a/plain Thu Jan 01 00:00:10 1970 +0000
275 --- a/plain Thu Jan 01 00:00:10 1970 +0000
276 +++ b/plain Thu Jan 01 00:00:11 1970 +0000
276 +++ b/plain Thu Jan 01 00:00:11 1970 +0000
277 @@ -7,4 +7,4 @@
277 @@ -7,4 +7,4 @@
278 7
278 7
279 8
279 8
280 9
280 9
281 -10
281 -10
282 +10.new
282 +10.new
283
283
284 % record beginning
284 % record beginning
285 diff --git a/plain b/plain
285 diff --git a/plain b/plain
286 1 hunks, 3 lines changed
286 1 hunks, 3 lines changed
287 examine changes to 'plain'? [Ynsfdaq?] @@ -1,6 +1,3 @@
287 examine changes to 'plain'? [Ynsfdaq?] @@ -1,6 +1,3 @@
288 -2
288 -2
289 -2
289 -2
290 -3
290 -3
291 4
291 4
292 5
292 5
293 6
293 6
294 record this change to 'plain'? [Ynsfdaq?]
294 record this change to 'plain'? [Ynsfdaq?]
295 changeset: 13:3ebbace64a8d
295 changeset: 13:3ebbace64a8d
296 tag: tip
296 tag: tip
297 user: test
297 user: test
298 date: Thu Jan 01 00:00:12 1970 +0000
298 date: Thu Jan 01 00:00:12 1970 +0000
299 summary: begin-only
299 summary: begin-only
300
300
301 diff -r 44516c9708ae -r 3ebbace64a8d plain
301 diff -r 44516c9708ae -r 3ebbace64a8d plain
302 --- a/plain Thu Jan 01 00:00:11 1970 +0000
302 --- a/plain Thu Jan 01 00:00:11 1970 +0000
303 +++ b/plain Thu Jan 01 00:00:12 1970 +0000
303 +++ b/plain Thu Jan 01 00:00:12 1970 +0000
304 @@ -1,6 +1,3 @@
304 @@ -1,6 +1,3 @@
305 -2
305 -2
306 -2
306 -2
307 -3
307 -3
308 4
308 4
309 5
309 5
310 6
310 6
311
311
312 % add to beginning, trim from end
312 % add to beginning, trim from end
313 % record end
313 % record end
314 diff --git a/plain b/plain
314 diff --git a/plain b/plain
315 2 hunks, 4 lines changed
315 2 hunks, 4 lines changed
316 examine changes to 'plain'? [Ynsfdaq?] @@ -1,6 +1,9 @@
316 examine changes to 'plain'? [Ynsfdaq?] @@ -1,6 +1,9 @@
317 +1
317 +1
318 +2
318 +2
319 +3
319 +3
320 4
320 4
321 5
321 5
322 6
322 6
323 7
323 7
324 8
324 8
325 9
325 9
326 record change 1/2 to 'plain'? [Ynsfdaq?] @@ -1,7 +4,6 @@
326 record change 1/2 to 'plain'? [Ynsfdaq?] @@ -1,7 +4,6 @@
327 4
327 4
328 5
328 5
329 6
329 6
330 7
330 7
331 8
331 8
332 9
332 9
333 -10.new
333 -10.new
334 record change 2/2 to 'plain'? [Ynsfdaq?] % add to beginning, middle, end
334 record change 2/2 to 'plain'? [Ynsfdaq?] % add to beginning, middle, end
335 % record beginning, middle
335 % record beginning, middle
336 diff --git a/plain b/plain
336 diff --git a/plain b/plain
337 3 hunks, 7 lines changed
337 3 hunks, 7 lines changed
338 examine changes to 'plain'? [Ynsfdaq?] @@ -1,2 +1,5 @@
338 examine changes to 'plain'? [Ynsfdaq?] @@ -1,2 +1,5 @@
339 +1
339 +1
340 +2
340 +2
341 +3
341 +3
342 4
342 4
343 5
343 5
344 record change 1/3 to 'plain'? [Ynsfdaq?] @@ -1,6 +4,8 @@
344 record change 1/3 to 'plain'? [Ynsfdaq?] @@ -1,6 +4,8 @@
345 4
345 4
346 5
346 5
347 +5.new
347 +5.new
348 +5.reallynew
348 +5.reallynew
349 6
349 6
350 7
350 7
351 8
351 8
352 9
352 9
353 record change 2/3 to 'plain'? [Ynsfdaq?] @@ -3,4 +8,6 @@
353 record change 2/3 to 'plain'? [Ynsfdaq?] @@ -3,4 +8,6 @@
354 6
354 6
355 7
355 7
356 8
356 8
357 9
357 9
358 +10
358 +10
359 +11
359 +11
360 record change 3/3 to 'plain'? [Ynsfdaq?]
360 record change 3/3 to 'plain'? [Ynsfdaq?]
361 changeset: 15:c1c639d8b268
361 changeset: 15:c1c639d8b268
362 tag: tip
362 tag: tip
363 user: test
363 user: test
364 date: Thu Jan 01 00:00:14 1970 +0000
364 date: Thu Jan 01 00:00:14 1970 +0000
365 summary: middle-only
365 summary: middle-only
366
366
367 diff -r efc0dad7bd9f -r c1c639d8b268 plain
367 diff -r efc0dad7bd9f -r c1c639d8b268 plain
368 --- a/plain Thu Jan 01 00:00:13 1970 +0000
368 --- a/plain Thu Jan 01 00:00:13 1970 +0000
369 +++ b/plain Thu Jan 01 00:00:14 1970 +0000
369 +++ b/plain Thu Jan 01 00:00:14 1970 +0000
370 @@ -1,5 +1,10 @@
370 @@ -1,5 +1,10 @@
371 +1
371 +1
372 +2
372 +2
373 +3
373 +3
374 4
374 4
375 5
375 5
376 +5.new
376 +5.new
377 +5.reallynew
377 +5.reallynew
378 6
378 6
379 7
379 7
380 8
380 8
381
381
382 % record end
382 % record end
383 diff --git a/plain b/plain
383 diff --git a/plain b/plain
384 1 hunks, 2 lines changed
384 1 hunks, 2 lines changed
385 examine changes to 'plain'? [Ynsfdaq?] @@ -9,3 +9,5 @@
385 examine changes to 'plain'? [Ynsfdaq?] @@ -9,3 +9,5 @@
386 7
386 7
387 8
387 8
388 9
388 9
389 +10
389 +10
390 +11
390 +11
391 record this change to 'plain'? [Ynsfdaq?]
391 record this change to 'plain'? [Ynsfdaq?]
392 changeset: 16:80b74bbc7808
392 changeset: 16:80b74bbc7808
393 tag: tip
393 tag: tip
394 user: test
394 user: test
395 date: Thu Jan 01 00:00:15 1970 +0000
395 date: Thu Jan 01 00:00:15 1970 +0000
396 summary: end-only
396 summary: end-only
397
397
398 diff -r c1c639d8b268 -r 80b74bbc7808 plain
398 diff -r c1c639d8b268 -r 80b74bbc7808 plain
399 --- a/plain Thu Jan 01 00:00:14 1970 +0000
399 --- a/plain Thu Jan 01 00:00:14 1970 +0000
400 +++ b/plain Thu Jan 01 00:00:15 1970 +0000
400 +++ b/plain Thu Jan 01 00:00:15 1970 +0000
401 @@ -9,3 +9,5 @@
401 @@ -9,3 +9,5 @@
402 7
402 7
403 8
403 8
404 9
404 9
405 +10
405 +10
406 +11
406 +11
407
407
408 adding subdir/a
408 adding subdir/a
409 diff --git a/subdir/a b/subdir/a
409 diff --git a/subdir/a b/subdir/a
410 1 hunks, 1 lines changed
410 1 hunks, 1 lines changed
411 examine changes to 'subdir/a'? [Ynsfdaq?] @@ -1,1 +1,2 @@
411 examine changes to 'subdir/a'? [Ynsfdaq?] @@ -1,1 +1,2 @@
412 a
412 a
413 +a
413 +a
414 record this change to 'subdir/a'? [Ynsfdaq?]
414 record this change to 'subdir/a'? [Ynsfdaq?]
415 changeset: 18:33ff5c4fb017
415 changeset: 18:33ff5c4fb017
416 tag: tip
416 tag: tip
417 user: test
417 user: test
418 date: Thu Jan 01 00:00:16 1970 +0000
418 date: Thu Jan 01 00:00:16 1970 +0000
419 summary: subdir-change
419 summary: subdir-change
420
420
421 diff -r aecf2b2ea83c -r 33ff5c4fb017 subdir/a
421 diff -r aecf2b2ea83c -r 33ff5c4fb017 subdir/a
422 --- a/subdir/a Thu Jan 01 00:00:16 1970 +0000
422 --- a/subdir/a Thu Jan 01 00:00:16 1970 +0000
423 +++ b/subdir/a Thu Jan 01 00:00:16 1970 +0000
423 +++ b/subdir/a Thu Jan 01 00:00:16 1970 +0000
424 @@ -1,1 +1,2 @@
424 @@ -1,1 +1,2 @@
425 a
425 a
426 +a
426 +a
427
427
428 % help, quit
428 % help, quit
429 diff --git a/subdir/f1 b/subdir/f1
429 diff --git a/subdir/f1 b/subdir/f1
430 1 hunks, 1 lines changed
430 1 hunks, 1 lines changed
431 examine changes to 'subdir/f1'? [Ynsfdaq?] y - record this change
431 examine changes to 'subdir/f1'? [Ynsfdaq?] y - record this change
432 n - skip this change
432 n - skip this change
433 s - skip remaining changes to this file
433 s - skip remaining changes to this file
434 f - record remaining changes to this file
434 f - record remaining changes to this file
435 d - done, skip remaining changes and files
435 d - done, skip remaining changes and files
436 a - record all changes to all remaining files
436 a - record all changes to all remaining files
437 q - quit, recording no changes
437 q - quit, recording no changes
438 ? - display help
438 ? - display help
439 examine changes to 'subdir/f1'? [Ynsfdaq?] abort: user quit
439 examine changes to 'subdir/f1'? [Ynsfdaq?] abort: user quit
440 % skip
440 % skip
441 diff --git a/subdir/f1 b/subdir/f1
441 diff --git a/subdir/f1 b/subdir/f1
442 1 hunks, 1 lines changed
442 1 hunks, 1 lines changed
443 examine changes to 'subdir/f1'? [Ynsfdaq?] diff --git a/subdir/f2 b/subdir/f2
443 examine changes to 'subdir/f1'? [Ynsfdaq?] diff --git a/subdir/f2 b/subdir/f2
444 1 hunks, 1 lines changed
444 1 hunks, 1 lines changed
445 examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected
445 examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected
446 % no
446 % no
447 diff --git a/subdir/f1 b/subdir/f1
447 diff --git a/subdir/f1 b/subdir/f1
448 1 hunks, 1 lines changed
448 1 hunks, 1 lines changed
449 examine changes to 'subdir/f1'? [Ynsfdaq?] diff --git a/subdir/f2 b/subdir/f2
449 examine changes to 'subdir/f1'? [Ynsfdaq?] diff --git a/subdir/f2 b/subdir/f2
450 1 hunks, 1 lines changed
450 1 hunks, 1 lines changed
451 examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected
451 examine changes to 'subdir/f2'? [Ynsfdaq?] abort: response expected
452 % f, quit
452 % f, quit
453 diff --git a/subdir/f1 b/subdir/f1
453 diff --git a/subdir/f1 b/subdir/f1
454 1 hunks, 1 lines changed
454 1 hunks, 1 lines changed
455 examine changes to 'subdir/f1'? [Ynsfdaq?] diff --git a/subdir/f2 b/subdir/f2
455 examine changes to 'subdir/f1'? [Ynsfdaq?] diff --git a/subdir/f2 b/subdir/f2
456 1 hunks, 1 lines changed
456 1 hunks, 1 lines changed
457 examine changes to 'subdir/f2'? [Ynsfdaq?] abort: user quit
457 examine changes to 'subdir/f2'? [Ynsfdaq?] abort: user quit
458 % s, all
458 % s, all
459 diff --git a/subdir/f1 b/subdir/f1
459 diff --git a/subdir/f1 b/subdir/f1
460 1 hunks, 1 lines changed
460 1 hunks, 1 lines changed
461 examine changes to 'subdir/f1'? [Ynsfdaq?] diff --git a/subdir/f2 b/subdir/f2
461 examine changes to 'subdir/f1'? [Ynsfdaq?] diff --git a/subdir/f2 b/subdir/f2
462 1 hunks, 1 lines changed
462 1 hunks, 1 lines changed
463 examine changes to 'subdir/f2'? [Ynsfdaq?]
463 examine changes to 'subdir/f2'? [Ynsfdaq?]
464 changeset: 20:094183e04b7c
464 changeset: 20:094183e04b7c
465 tag: tip
465 tag: tip
466 user: test
466 user: test
467 date: Thu Jan 01 00:00:18 1970 +0000
467 date: Thu Jan 01 00:00:18 1970 +0000
468 summary: x
468 summary: x
469
469
470 diff -r f9e855cd9374 -r 094183e04b7c subdir/f2
470 diff -r f9e855cd9374 -r 094183e04b7c subdir/f2
471 --- a/subdir/f2 Thu Jan 01 00:00:17 1970 +0000
471 --- a/subdir/f2 Thu Jan 01 00:00:17 1970 +0000
472 +++ b/subdir/f2 Thu Jan 01 00:00:18 1970 +0000
472 +++ b/subdir/f2 Thu Jan 01 00:00:18 1970 +0000
473 @@ -1,1 +1,2 @@
473 @@ -1,1 +1,2 @@
474 b
474 b
475 +b
475 +b
476
476
477 % f
477 % f
478 diff --git a/subdir/f1 b/subdir/f1
478 diff --git a/subdir/f1 b/subdir/f1
479 1 hunks, 1 lines changed
479 1 hunks, 1 lines changed
480 examine changes to 'subdir/f1'? [Ynsfdaq?]
480 examine changes to 'subdir/f1'? [Ynsfdaq?]
481 changeset: 21:38164785b0ef
481 changeset: 21:38164785b0ef
482 tag: tip
482 tag: tip
483 user: test
483 user: test
484 date: Thu Jan 01 00:00:19 1970 +0000
484 date: Thu Jan 01 00:00:19 1970 +0000
485 summary: y
485 summary: y
486
486
487 diff -r 094183e04b7c -r 38164785b0ef subdir/f1
487 diff -r 094183e04b7c -r 38164785b0ef subdir/f1
488 --- a/subdir/f1 Thu Jan 01 00:00:18 1970 +0000
488 --- a/subdir/f1 Thu Jan 01 00:00:18 1970 +0000
489 +++ b/subdir/f1 Thu Jan 01 00:00:19 1970 +0000
489 +++ b/subdir/f1 Thu Jan 01 00:00:19 1970 +0000
490 @@ -1,1 +1,2 @@
490 @@ -1,1 +1,2 @@
491 a
491 a
492 +a
492 +a
493
493
494 % preserve chmod +x
494 % preserve chmod +x
495 diff --git a/subdir/f1 b/subdir/f1
495 diff --git a/subdir/f1 b/subdir/f1
496 old mode 100644
496 old mode 100644
497 new mode 100755
497 new mode 100755
498 1 hunks, 1 lines changed
498 1 hunks, 1 lines changed
499 examine changes to 'subdir/f1'? [Ynsfdaq?] @@ -1,2 +1,3 @@
499 examine changes to 'subdir/f1'? [Ynsfdaq?] @@ -1,2 +1,3 @@
500 a
500 a
501 a
501 a
502 +a
502 +a
503 record this change to 'subdir/f1'? [Ynsfdaq?]
503 record this change to 'subdir/f1'? [Ynsfdaq?]
504 changeset: 22:a891589cb933
504 changeset: 22:a891589cb933
505 tag: tip
505 tag: tip
506 user: test
506 user: test
507 date: Thu Jan 01 00:00:20 1970 +0000
507 date: Thu Jan 01 00:00:20 1970 +0000
508 summary: z
508 summary: z
509
509
510 diff --git a/subdir/f1 b/subdir/f1
510 diff --git a/subdir/f1 b/subdir/f1
511 old mode 100644
511 old mode 100644
512 new mode 100755
512 new mode 100755
513 --- a/subdir/f1
513 --- a/subdir/f1
514 +++ b/subdir/f1
514 +++ b/subdir/f1
515 @@ -1,2 +1,3 @@
515 @@ -1,2 +1,3 @@
516 a
516 a
517 a
517 a
518 +a
518 +a
519
519
520 % preserve execute permission on original
520 % preserve execute permission on original
521 diff --git a/subdir/f1 b/subdir/f1
521 diff --git a/subdir/f1 b/subdir/f1
522 1 hunks, 1 lines changed
522 1 hunks, 1 lines changed
523 examine changes to 'subdir/f1'? [Ynsfdaq?] @@ -1,3 +1,4 @@
523 examine changes to 'subdir/f1'? [Ynsfdaq?] @@ -1,3 +1,4 @@
524 a
524 a
525 a
525 a
526 a
526 a
527 +b
527 +b
528 record this change to 'subdir/f1'? [Ynsfdaq?]
528 record this change to 'subdir/f1'? [Ynsfdaq?]
529 changeset: 23:befa0dae6201
529 changeset: 23:befa0dae6201
530 tag: tip
530 tag: tip
531 user: test
531 user: test
532 date: Thu Jan 01 00:00:21 1970 +0000
532 date: Thu Jan 01 00:00:21 1970 +0000
533 summary: aa
533 summary: aa
534
534
535 diff --git a/subdir/f1 b/subdir/f1
535 diff --git a/subdir/f1 b/subdir/f1
536 --- a/subdir/f1
536 --- a/subdir/f1
537 +++ b/subdir/f1
537 +++ b/subdir/f1
538 @@ -1,3 +1,4 @@
538 @@ -1,3 +1,4 @@
539 a
539 a
540 a
540 a
541 a
541 a
542 +b
542 +b
543
543
544 % preserve chmod -x
544 % preserve chmod -x
545 diff --git a/subdir/f1 b/subdir/f1
545 diff --git a/subdir/f1 b/subdir/f1
546 old mode 100755
546 old mode 100755
547 new mode 100644
547 new mode 100644
548 1 hunks, 1 lines changed
548 1 hunks, 1 lines changed
549 examine changes to 'subdir/f1'? [Ynsfdaq?] @@ -2,3 +2,4 @@
549 examine changes to 'subdir/f1'? [Ynsfdaq?] @@ -2,3 +2,4 @@
550 a
550 a
551 a
551 a
552 b
552 b
553 +c
553 +c
554 record this change to 'subdir/f1'? [Ynsfdaq?]
554 record this change to 'subdir/f1'? [Ynsfdaq?]
555 changeset: 24:8fd83ff53ce6
555 changeset: 24:8fd83ff53ce6
556 tag: tip
556 tag: tip
557 user: test
557 user: test
558 date: Thu Jan 01 00:00:22 1970 +0000
558 date: Thu Jan 01 00:00:22 1970 +0000
559 summary: ab
559 summary: ab
560
560
561 diff --git a/subdir/f1 b/subdir/f1
561 diff --git a/subdir/f1 b/subdir/f1
562 old mode 100755
562 old mode 100755
563 new mode 100644
563 new mode 100644
564 --- a/subdir/f1
564 --- a/subdir/f1
565 +++ b/subdir/f1
565 +++ b/subdir/f1
566 @@ -2,3 +2,4 @@
566 @@ -2,3 +2,4 @@
567 a
567 a
568 a
568 a
569 b
569 b
570 +c
570 +c
571
571
572 % with win32ext
572 % with win32ext
573 diff --git a/subdir/f1 b/subdir/f1
573 diff --git a/subdir/f1 b/subdir/f1
574 1 hunks, 1 lines changed
574 1 hunks, 1 lines changed
575 examine changes to 'subdir/f1'? [Ynsfdaq?] @@ -3,3 +3,4 @@
575 examine changes to 'subdir/f1'? [Ynsfdaq?] @@ -3,3 +3,4 @@
576 a
576 a
577 b
577 b
578 c
578 c
579 +d
579 +d
580 record this change to 'subdir/f1'? [Ynsfdaq?]
580 record this change to 'subdir/f1'? [Ynsfdaq?]
581 changeset: 25:49b3838dc9e7
581 changeset: 25:49b3838dc9e7
582 tag: tip
582 tag: tip
583 user: test
583 user: test
584 date: Thu Jan 01 00:00:23 1970 +0000
584 date: Thu Jan 01 00:00:23 1970 +0000
585 summary: w1
585 summary: w1
586
586
587 diff -r 8fd83ff53ce6 -r 49b3838dc9e7 subdir/f1
587 diff -r 8fd83ff53ce6 -r 49b3838dc9e7 subdir/f1
588 --- a/subdir/f1 Thu Jan 01 00:00:22 1970 +0000
588 --- a/subdir/f1 Thu Jan 01 00:00:22 1970 +0000
589 +++ b/subdir/f1 Thu Jan 01 00:00:23 1970 +0000
589 +++ b/subdir/f1 Thu Jan 01 00:00:23 1970 +0000
590 @@ -3,3 +3,4 @@
590 @@ -3,3 +3,4 @@
591 a
591 a
592 b
592 b
593 c
593 c
594 +d
594 +d
595
595
General Comments 0
You need to be logged in to leave comments. Login now