##// END OF EJS Templates
export: show 'Date' header in a format that also is readable for humans...
Mads Kiilerich -
r18648:76b69ccc default
parent child Browse files
Show More
@@ -1,2017 +1,2018 b''
1 # cmdutil.py - help for command processing in mercurial
1 # cmdutil.py - help for command processing in mercurial
2 #
2 #
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.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 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from node import hex, nullid, nullrev, short
8 from node import hex, nullid, nullrev, short
9 from i18n import _
9 from i18n import _
10 import os, sys, errno, re, tempfile
10 import os, sys, errno, re, tempfile
11 import util, scmutil, templater, patch, error, templatekw, revlog, copies
11 import util, scmutil, templater, patch, error, templatekw, revlog, copies
12 import match as matchmod
12 import match as matchmod
13 import subrepo, context, repair, graphmod, revset, phases, obsolete
13 import subrepo, context, repair, graphmod, revset, phases, obsolete
14 import changelog
14 import changelog
15 import bookmarks
15 import bookmarks
16 import lock as lockmod
16 import lock as lockmod
17
17
18 def parsealiases(cmd):
18 def parsealiases(cmd):
19 return cmd.lstrip("^").split("|")
19 return cmd.lstrip("^").split("|")
20
20
21 def findpossible(cmd, table, strict=False):
21 def findpossible(cmd, table, strict=False):
22 """
22 """
23 Return cmd -> (aliases, command table entry)
23 Return cmd -> (aliases, command table entry)
24 for each matching command.
24 for each matching command.
25 Return debug commands (or their aliases) only if no normal command matches.
25 Return debug commands (or their aliases) only if no normal command matches.
26 """
26 """
27 choice = {}
27 choice = {}
28 debugchoice = {}
28 debugchoice = {}
29
29
30 if cmd in table:
30 if cmd in table:
31 # short-circuit exact matches, "log" alias beats "^log|history"
31 # short-circuit exact matches, "log" alias beats "^log|history"
32 keys = [cmd]
32 keys = [cmd]
33 else:
33 else:
34 keys = table.keys()
34 keys = table.keys()
35
35
36 for e in keys:
36 for e in keys:
37 aliases = parsealiases(e)
37 aliases = parsealiases(e)
38 found = None
38 found = None
39 if cmd in aliases:
39 if cmd in aliases:
40 found = cmd
40 found = cmd
41 elif not strict:
41 elif not strict:
42 for a in aliases:
42 for a in aliases:
43 if a.startswith(cmd):
43 if a.startswith(cmd):
44 found = a
44 found = a
45 break
45 break
46 if found is not None:
46 if found is not None:
47 if aliases[0].startswith("debug") or found.startswith("debug"):
47 if aliases[0].startswith("debug") or found.startswith("debug"):
48 debugchoice[found] = (aliases, table[e])
48 debugchoice[found] = (aliases, table[e])
49 else:
49 else:
50 choice[found] = (aliases, table[e])
50 choice[found] = (aliases, table[e])
51
51
52 if not choice and debugchoice:
52 if not choice and debugchoice:
53 choice = debugchoice
53 choice = debugchoice
54
54
55 return choice
55 return choice
56
56
57 def findcmd(cmd, table, strict=True):
57 def findcmd(cmd, table, strict=True):
58 """Return (aliases, command table entry) for command string."""
58 """Return (aliases, command table entry) for command string."""
59 choice = findpossible(cmd, table, strict)
59 choice = findpossible(cmd, table, strict)
60
60
61 if cmd in choice:
61 if cmd in choice:
62 return choice[cmd]
62 return choice[cmd]
63
63
64 if len(choice) > 1:
64 if len(choice) > 1:
65 clist = choice.keys()
65 clist = choice.keys()
66 clist.sort()
66 clist.sort()
67 raise error.AmbiguousCommand(cmd, clist)
67 raise error.AmbiguousCommand(cmd, clist)
68
68
69 if choice:
69 if choice:
70 return choice.values()[0]
70 return choice.values()[0]
71
71
72 raise error.UnknownCommand(cmd)
72 raise error.UnknownCommand(cmd)
73
73
74 def findrepo(p):
74 def findrepo(p):
75 while not os.path.isdir(os.path.join(p, ".hg")):
75 while not os.path.isdir(os.path.join(p, ".hg")):
76 oldp, p = p, os.path.dirname(p)
76 oldp, p = p, os.path.dirname(p)
77 if p == oldp:
77 if p == oldp:
78 return None
78 return None
79
79
80 return p
80 return p
81
81
82 def bailifchanged(repo):
82 def bailifchanged(repo):
83 if repo.dirstate.p2() != nullid:
83 if repo.dirstate.p2() != nullid:
84 raise util.Abort(_('outstanding uncommitted merge'))
84 raise util.Abort(_('outstanding uncommitted merge'))
85 modified, added, removed, deleted = repo.status()[:4]
85 modified, added, removed, deleted = repo.status()[:4]
86 if modified or added or removed or deleted:
86 if modified or added or removed or deleted:
87 raise util.Abort(_("outstanding uncommitted changes"))
87 raise util.Abort(_("outstanding uncommitted changes"))
88 ctx = repo[None]
88 ctx = repo[None]
89 for s in sorted(ctx.substate):
89 for s in sorted(ctx.substate):
90 if ctx.sub(s).dirty():
90 if ctx.sub(s).dirty():
91 raise util.Abort(_("uncommitted changes in subrepo %s") % s)
91 raise util.Abort(_("uncommitted changes in subrepo %s") % s)
92
92
93 def logmessage(ui, opts):
93 def logmessage(ui, opts):
94 """ get the log message according to -m and -l option """
94 """ get the log message according to -m and -l option """
95 message = opts.get('message')
95 message = opts.get('message')
96 logfile = opts.get('logfile')
96 logfile = opts.get('logfile')
97
97
98 if message and logfile:
98 if message and logfile:
99 raise util.Abort(_('options --message and --logfile are mutually '
99 raise util.Abort(_('options --message and --logfile are mutually '
100 'exclusive'))
100 'exclusive'))
101 if not message and logfile:
101 if not message and logfile:
102 try:
102 try:
103 if logfile == '-':
103 if logfile == '-':
104 message = ui.fin.read()
104 message = ui.fin.read()
105 else:
105 else:
106 message = '\n'.join(util.readfile(logfile).splitlines())
106 message = '\n'.join(util.readfile(logfile).splitlines())
107 except IOError, inst:
107 except IOError, inst:
108 raise util.Abort(_("can't read commit message '%s': %s") %
108 raise util.Abort(_("can't read commit message '%s': %s") %
109 (logfile, inst.strerror))
109 (logfile, inst.strerror))
110 return message
110 return message
111
111
112 def loglimit(opts):
112 def loglimit(opts):
113 """get the log limit according to option -l/--limit"""
113 """get the log limit according to option -l/--limit"""
114 limit = opts.get('limit')
114 limit = opts.get('limit')
115 if limit:
115 if limit:
116 try:
116 try:
117 limit = int(limit)
117 limit = int(limit)
118 except ValueError:
118 except ValueError:
119 raise util.Abort(_('limit must be a positive integer'))
119 raise util.Abort(_('limit must be a positive integer'))
120 if limit <= 0:
120 if limit <= 0:
121 raise util.Abort(_('limit must be positive'))
121 raise util.Abort(_('limit must be positive'))
122 else:
122 else:
123 limit = None
123 limit = None
124 return limit
124 return limit
125
125
126 def makefilename(repo, pat, node, desc=None,
126 def makefilename(repo, pat, node, desc=None,
127 total=None, seqno=None, revwidth=None, pathname=None):
127 total=None, seqno=None, revwidth=None, pathname=None):
128 node_expander = {
128 node_expander = {
129 'H': lambda: hex(node),
129 'H': lambda: hex(node),
130 'R': lambda: str(repo.changelog.rev(node)),
130 'R': lambda: str(repo.changelog.rev(node)),
131 'h': lambda: short(node),
131 'h': lambda: short(node),
132 'm': lambda: re.sub('[^\w]', '_', str(desc))
132 'm': lambda: re.sub('[^\w]', '_', str(desc))
133 }
133 }
134 expander = {
134 expander = {
135 '%': lambda: '%',
135 '%': lambda: '%',
136 'b': lambda: os.path.basename(repo.root),
136 'b': lambda: os.path.basename(repo.root),
137 }
137 }
138
138
139 try:
139 try:
140 if node:
140 if node:
141 expander.update(node_expander)
141 expander.update(node_expander)
142 if node:
142 if node:
143 expander['r'] = (lambda:
143 expander['r'] = (lambda:
144 str(repo.changelog.rev(node)).zfill(revwidth or 0))
144 str(repo.changelog.rev(node)).zfill(revwidth or 0))
145 if total is not None:
145 if total is not None:
146 expander['N'] = lambda: str(total)
146 expander['N'] = lambda: str(total)
147 if seqno is not None:
147 if seqno is not None:
148 expander['n'] = lambda: str(seqno)
148 expander['n'] = lambda: str(seqno)
149 if total is not None and seqno is not None:
149 if total is not None and seqno is not None:
150 expander['n'] = lambda: str(seqno).zfill(len(str(total)))
150 expander['n'] = lambda: str(seqno).zfill(len(str(total)))
151 if pathname is not None:
151 if pathname is not None:
152 expander['s'] = lambda: os.path.basename(pathname)
152 expander['s'] = lambda: os.path.basename(pathname)
153 expander['d'] = lambda: os.path.dirname(pathname) or '.'
153 expander['d'] = lambda: os.path.dirname(pathname) or '.'
154 expander['p'] = lambda: pathname
154 expander['p'] = lambda: pathname
155
155
156 newname = []
156 newname = []
157 patlen = len(pat)
157 patlen = len(pat)
158 i = 0
158 i = 0
159 while i < patlen:
159 while i < patlen:
160 c = pat[i]
160 c = pat[i]
161 if c == '%':
161 if c == '%':
162 i += 1
162 i += 1
163 c = pat[i]
163 c = pat[i]
164 c = expander[c]()
164 c = expander[c]()
165 newname.append(c)
165 newname.append(c)
166 i += 1
166 i += 1
167 return ''.join(newname)
167 return ''.join(newname)
168 except KeyError, inst:
168 except KeyError, inst:
169 raise util.Abort(_("invalid format spec '%%%s' in output filename") %
169 raise util.Abort(_("invalid format spec '%%%s' in output filename") %
170 inst.args[0])
170 inst.args[0])
171
171
172 def makefileobj(repo, pat, node=None, desc=None, total=None,
172 def makefileobj(repo, pat, node=None, desc=None, total=None,
173 seqno=None, revwidth=None, mode='wb', modemap={},
173 seqno=None, revwidth=None, mode='wb', modemap={},
174 pathname=None):
174 pathname=None):
175
175
176 writable = mode not in ('r', 'rb')
176 writable = mode not in ('r', 'rb')
177
177
178 if not pat or pat == '-':
178 if not pat or pat == '-':
179 fp = writable and repo.ui.fout or repo.ui.fin
179 fp = writable and repo.ui.fout or repo.ui.fin
180 if util.safehasattr(fp, 'fileno'):
180 if util.safehasattr(fp, 'fileno'):
181 return os.fdopen(os.dup(fp.fileno()), mode)
181 return os.fdopen(os.dup(fp.fileno()), mode)
182 else:
182 else:
183 # if this fp can't be duped properly, return
183 # if this fp can't be duped properly, return
184 # a dummy object that can be closed
184 # a dummy object that can be closed
185 class wrappedfileobj(object):
185 class wrappedfileobj(object):
186 noop = lambda x: None
186 noop = lambda x: None
187 def __init__(self, f):
187 def __init__(self, f):
188 self.f = f
188 self.f = f
189 def __getattr__(self, attr):
189 def __getattr__(self, attr):
190 if attr == 'close':
190 if attr == 'close':
191 return self.noop
191 return self.noop
192 else:
192 else:
193 return getattr(self.f, attr)
193 return getattr(self.f, attr)
194
194
195 return wrappedfileobj(fp)
195 return wrappedfileobj(fp)
196 if util.safehasattr(pat, 'write') and writable:
196 if util.safehasattr(pat, 'write') and writable:
197 return pat
197 return pat
198 if util.safehasattr(pat, 'read') and 'r' in mode:
198 if util.safehasattr(pat, 'read') and 'r' in mode:
199 return pat
199 return pat
200 fn = makefilename(repo, pat, node, desc, total, seqno, revwidth, pathname)
200 fn = makefilename(repo, pat, node, desc, total, seqno, revwidth, pathname)
201 mode = modemap.get(fn, mode)
201 mode = modemap.get(fn, mode)
202 if mode == 'wb':
202 if mode == 'wb':
203 modemap[fn] = 'ab'
203 modemap[fn] = 'ab'
204 return open(fn, mode)
204 return open(fn, mode)
205
205
206 def openrevlog(repo, cmd, file_, opts):
206 def openrevlog(repo, cmd, file_, opts):
207 """opens the changelog, manifest, a filelog or a given revlog"""
207 """opens the changelog, manifest, a filelog or a given revlog"""
208 cl = opts['changelog']
208 cl = opts['changelog']
209 mf = opts['manifest']
209 mf = opts['manifest']
210 msg = None
210 msg = None
211 if cl and mf:
211 if cl and mf:
212 msg = _('cannot specify --changelog and --manifest at the same time')
212 msg = _('cannot specify --changelog and --manifest at the same time')
213 elif cl or mf:
213 elif cl or mf:
214 if file_:
214 if file_:
215 msg = _('cannot specify filename with --changelog or --manifest')
215 msg = _('cannot specify filename with --changelog or --manifest')
216 elif not repo:
216 elif not repo:
217 msg = _('cannot specify --changelog or --manifest '
217 msg = _('cannot specify --changelog or --manifest '
218 'without a repository')
218 'without a repository')
219 if msg:
219 if msg:
220 raise util.Abort(msg)
220 raise util.Abort(msg)
221
221
222 r = None
222 r = None
223 if repo:
223 if repo:
224 if cl:
224 if cl:
225 r = repo.changelog
225 r = repo.changelog
226 elif mf:
226 elif mf:
227 r = repo.manifest
227 r = repo.manifest
228 elif file_:
228 elif file_:
229 filelog = repo.file(file_)
229 filelog = repo.file(file_)
230 if len(filelog):
230 if len(filelog):
231 r = filelog
231 r = filelog
232 if not r:
232 if not r:
233 if not file_:
233 if not file_:
234 raise error.CommandError(cmd, _('invalid arguments'))
234 raise error.CommandError(cmd, _('invalid arguments'))
235 if not os.path.isfile(file_):
235 if not os.path.isfile(file_):
236 raise util.Abort(_("revlog '%s' not found") % file_)
236 raise util.Abort(_("revlog '%s' not found") % file_)
237 r = revlog.revlog(scmutil.opener(os.getcwd(), audit=False),
237 r = revlog.revlog(scmutil.opener(os.getcwd(), audit=False),
238 file_[:-2] + ".i")
238 file_[:-2] + ".i")
239 return r
239 return r
240
240
241 def copy(ui, repo, pats, opts, rename=False):
241 def copy(ui, repo, pats, opts, rename=False):
242 # called with the repo lock held
242 # called with the repo lock held
243 #
243 #
244 # hgsep => pathname that uses "/" to separate directories
244 # hgsep => pathname that uses "/" to separate directories
245 # ossep => pathname that uses os.sep to separate directories
245 # ossep => pathname that uses os.sep to separate directories
246 cwd = repo.getcwd()
246 cwd = repo.getcwd()
247 targets = {}
247 targets = {}
248 after = opts.get("after")
248 after = opts.get("after")
249 dryrun = opts.get("dry_run")
249 dryrun = opts.get("dry_run")
250 wctx = repo[None]
250 wctx = repo[None]
251
251
252 def walkpat(pat):
252 def walkpat(pat):
253 srcs = []
253 srcs = []
254 badstates = after and '?' or '?r'
254 badstates = after and '?' or '?r'
255 m = scmutil.match(repo[None], [pat], opts, globbed=True)
255 m = scmutil.match(repo[None], [pat], opts, globbed=True)
256 for abs in repo.walk(m):
256 for abs in repo.walk(m):
257 state = repo.dirstate[abs]
257 state = repo.dirstate[abs]
258 rel = m.rel(abs)
258 rel = m.rel(abs)
259 exact = m.exact(abs)
259 exact = m.exact(abs)
260 if state in badstates:
260 if state in badstates:
261 if exact and state == '?':
261 if exact and state == '?':
262 ui.warn(_('%s: not copying - file is not managed\n') % rel)
262 ui.warn(_('%s: not copying - file is not managed\n') % rel)
263 if exact and state == 'r':
263 if exact and state == 'r':
264 ui.warn(_('%s: not copying - file has been marked for'
264 ui.warn(_('%s: not copying - file has been marked for'
265 ' remove\n') % rel)
265 ' remove\n') % rel)
266 continue
266 continue
267 # abs: hgsep
267 # abs: hgsep
268 # rel: ossep
268 # rel: ossep
269 srcs.append((abs, rel, exact))
269 srcs.append((abs, rel, exact))
270 return srcs
270 return srcs
271
271
272 # abssrc: hgsep
272 # abssrc: hgsep
273 # relsrc: ossep
273 # relsrc: ossep
274 # otarget: ossep
274 # otarget: ossep
275 def copyfile(abssrc, relsrc, otarget, exact):
275 def copyfile(abssrc, relsrc, otarget, exact):
276 abstarget = scmutil.canonpath(repo.root, cwd, otarget)
276 abstarget = scmutil.canonpath(repo.root, cwd, otarget)
277 if '/' in abstarget:
277 if '/' in abstarget:
278 # We cannot normalize abstarget itself, this would prevent
278 # We cannot normalize abstarget itself, this would prevent
279 # case only renames, like a => A.
279 # case only renames, like a => A.
280 abspath, absname = abstarget.rsplit('/', 1)
280 abspath, absname = abstarget.rsplit('/', 1)
281 abstarget = repo.dirstate.normalize(abspath) + '/' + absname
281 abstarget = repo.dirstate.normalize(abspath) + '/' + absname
282 reltarget = repo.pathto(abstarget, cwd)
282 reltarget = repo.pathto(abstarget, cwd)
283 target = repo.wjoin(abstarget)
283 target = repo.wjoin(abstarget)
284 src = repo.wjoin(abssrc)
284 src = repo.wjoin(abssrc)
285 state = repo.dirstate[abstarget]
285 state = repo.dirstate[abstarget]
286
286
287 scmutil.checkportable(ui, abstarget)
287 scmutil.checkportable(ui, abstarget)
288
288
289 # check for collisions
289 # check for collisions
290 prevsrc = targets.get(abstarget)
290 prevsrc = targets.get(abstarget)
291 if prevsrc is not None:
291 if prevsrc is not None:
292 ui.warn(_('%s: not overwriting - %s collides with %s\n') %
292 ui.warn(_('%s: not overwriting - %s collides with %s\n') %
293 (reltarget, repo.pathto(abssrc, cwd),
293 (reltarget, repo.pathto(abssrc, cwd),
294 repo.pathto(prevsrc, cwd)))
294 repo.pathto(prevsrc, cwd)))
295 return
295 return
296
296
297 # check for overwrites
297 # check for overwrites
298 exists = os.path.lexists(target)
298 exists = os.path.lexists(target)
299 samefile = False
299 samefile = False
300 if exists and abssrc != abstarget:
300 if exists and abssrc != abstarget:
301 if (repo.dirstate.normalize(abssrc) ==
301 if (repo.dirstate.normalize(abssrc) ==
302 repo.dirstate.normalize(abstarget)):
302 repo.dirstate.normalize(abstarget)):
303 if not rename:
303 if not rename:
304 ui.warn(_("%s: can't copy - same file\n") % reltarget)
304 ui.warn(_("%s: can't copy - same file\n") % reltarget)
305 return
305 return
306 exists = False
306 exists = False
307 samefile = True
307 samefile = True
308
308
309 if not after and exists or after and state in 'mn':
309 if not after and exists or after and state in 'mn':
310 if not opts['force']:
310 if not opts['force']:
311 ui.warn(_('%s: not overwriting - file exists\n') %
311 ui.warn(_('%s: not overwriting - file exists\n') %
312 reltarget)
312 reltarget)
313 return
313 return
314
314
315 if after:
315 if after:
316 if not exists:
316 if not exists:
317 if rename:
317 if rename:
318 ui.warn(_('%s: not recording move - %s does not exist\n') %
318 ui.warn(_('%s: not recording move - %s does not exist\n') %
319 (relsrc, reltarget))
319 (relsrc, reltarget))
320 else:
320 else:
321 ui.warn(_('%s: not recording copy - %s does not exist\n') %
321 ui.warn(_('%s: not recording copy - %s does not exist\n') %
322 (relsrc, reltarget))
322 (relsrc, reltarget))
323 return
323 return
324 elif not dryrun:
324 elif not dryrun:
325 try:
325 try:
326 if exists:
326 if exists:
327 os.unlink(target)
327 os.unlink(target)
328 targetdir = os.path.dirname(target) or '.'
328 targetdir = os.path.dirname(target) or '.'
329 if not os.path.isdir(targetdir):
329 if not os.path.isdir(targetdir):
330 os.makedirs(targetdir)
330 os.makedirs(targetdir)
331 if samefile:
331 if samefile:
332 tmp = target + "~hgrename"
332 tmp = target + "~hgrename"
333 os.rename(src, tmp)
333 os.rename(src, tmp)
334 os.rename(tmp, target)
334 os.rename(tmp, target)
335 else:
335 else:
336 util.copyfile(src, target)
336 util.copyfile(src, target)
337 srcexists = True
337 srcexists = True
338 except IOError, inst:
338 except IOError, inst:
339 if inst.errno == errno.ENOENT:
339 if inst.errno == errno.ENOENT:
340 ui.warn(_('%s: deleted in working copy\n') % relsrc)
340 ui.warn(_('%s: deleted in working copy\n') % relsrc)
341 srcexists = False
341 srcexists = False
342 else:
342 else:
343 ui.warn(_('%s: cannot copy - %s\n') %
343 ui.warn(_('%s: cannot copy - %s\n') %
344 (relsrc, inst.strerror))
344 (relsrc, inst.strerror))
345 return True # report a failure
345 return True # report a failure
346
346
347 if ui.verbose or not exact:
347 if ui.verbose or not exact:
348 if rename:
348 if rename:
349 ui.status(_('moving %s to %s\n') % (relsrc, reltarget))
349 ui.status(_('moving %s to %s\n') % (relsrc, reltarget))
350 else:
350 else:
351 ui.status(_('copying %s to %s\n') % (relsrc, reltarget))
351 ui.status(_('copying %s to %s\n') % (relsrc, reltarget))
352
352
353 targets[abstarget] = abssrc
353 targets[abstarget] = abssrc
354
354
355 # fix up dirstate
355 # fix up dirstate
356 scmutil.dirstatecopy(ui, repo, wctx, abssrc, abstarget,
356 scmutil.dirstatecopy(ui, repo, wctx, abssrc, abstarget,
357 dryrun=dryrun, cwd=cwd)
357 dryrun=dryrun, cwd=cwd)
358 if rename and not dryrun:
358 if rename and not dryrun:
359 if not after and srcexists and not samefile:
359 if not after and srcexists and not samefile:
360 util.unlinkpath(repo.wjoin(abssrc))
360 util.unlinkpath(repo.wjoin(abssrc))
361 wctx.forget([abssrc])
361 wctx.forget([abssrc])
362
362
363 # pat: ossep
363 # pat: ossep
364 # dest ossep
364 # dest ossep
365 # srcs: list of (hgsep, hgsep, ossep, bool)
365 # srcs: list of (hgsep, hgsep, ossep, bool)
366 # return: function that takes hgsep and returns ossep
366 # return: function that takes hgsep and returns ossep
367 def targetpathfn(pat, dest, srcs):
367 def targetpathfn(pat, dest, srcs):
368 if os.path.isdir(pat):
368 if os.path.isdir(pat):
369 abspfx = scmutil.canonpath(repo.root, cwd, pat)
369 abspfx = scmutil.canonpath(repo.root, cwd, pat)
370 abspfx = util.localpath(abspfx)
370 abspfx = util.localpath(abspfx)
371 if destdirexists:
371 if destdirexists:
372 striplen = len(os.path.split(abspfx)[0])
372 striplen = len(os.path.split(abspfx)[0])
373 else:
373 else:
374 striplen = len(abspfx)
374 striplen = len(abspfx)
375 if striplen:
375 if striplen:
376 striplen += len(os.sep)
376 striplen += len(os.sep)
377 res = lambda p: os.path.join(dest, util.localpath(p)[striplen:])
377 res = lambda p: os.path.join(dest, util.localpath(p)[striplen:])
378 elif destdirexists:
378 elif destdirexists:
379 res = lambda p: os.path.join(dest,
379 res = lambda p: os.path.join(dest,
380 os.path.basename(util.localpath(p)))
380 os.path.basename(util.localpath(p)))
381 else:
381 else:
382 res = lambda p: dest
382 res = lambda p: dest
383 return res
383 return res
384
384
385 # pat: ossep
385 # pat: ossep
386 # dest ossep
386 # dest ossep
387 # srcs: list of (hgsep, hgsep, ossep, bool)
387 # srcs: list of (hgsep, hgsep, ossep, bool)
388 # return: function that takes hgsep and returns ossep
388 # return: function that takes hgsep and returns ossep
389 def targetpathafterfn(pat, dest, srcs):
389 def targetpathafterfn(pat, dest, srcs):
390 if matchmod.patkind(pat):
390 if matchmod.patkind(pat):
391 # a mercurial pattern
391 # a mercurial pattern
392 res = lambda p: os.path.join(dest,
392 res = lambda p: os.path.join(dest,
393 os.path.basename(util.localpath(p)))
393 os.path.basename(util.localpath(p)))
394 else:
394 else:
395 abspfx = scmutil.canonpath(repo.root, cwd, pat)
395 abspfx = scmutil.canonpath(repo.root, cwd, pat)
396 if len(abspfx) < len(srcs[0][0]):
396 if len(abspfx) < len(srcs[0][0]):
397 # A directory. Either the target path contains the last
397 # A directory. Either the target path contains the last
398 # component of the source path or it does not.
398 # component of the source path or it does not.
399 def evalpath(striplen):
399 def evalpath(striplen):
400 score = 0
400 score = 0
401 for s in srcs:
401 for s in srcs:
402 t = os.path.join(dest, util.localpath(s[0])[striplen:])
402 t = os.path.join(dest, util.localpath(s[0])[striplen:])
403 if os.path.lexists(t):
403 if os.path.lexists(t):
404 score += 1
404 score += 1
405 return score
405 return score
406
406
407 abspfx = util.localpath(abspfx)
407 abspfx = util.localpath(abspfx)
408 striplen = len(abspfx)
408 striplen = len(abspfx)
409 if striplen:
409 if striplen:
410 striplen += len(os.sep)
410 striplen += len(os.sep)
411 if os.path.isdir(os.path.join(dest, os.path.split(abspfx)[1])):
411 if os.path.isdir(os.path.join(dest, os.path.split(abspfx)[1])):
412 score = evalpath(striplen)
412 score = evalpath(striplen)
413 striplen1 = len(os.path.split(abspfx)[0])
413 striplen1 = len(os.path.split(abspfx)[0])
414 if striplen1:
414 if striplen1:
415 striplen1 += len(os.sep)
415 striplen1 += len(os.sep)
416 if evalpath(striplen1) > score:
416 if evalpath(striplen1) > score:
417 striplen = striplen1
417 striplen = striplen1
418 res = lambda p: os.path.join(dest,
418 res = lambda p: os.path.join(dest,
419 util.localpath(p)[striplen:])
419 util.localpath(p)[striplen:])
420 else:
420 else:
421 # a file
421 # a file
422 if destdirexists:
422 if destdirexists:
423 res = lambda p: os.path.join(dest,
423 res = lambda p: os.path.join(dest,
424 os.path.basename(util.localpath(p)))
424 os.path.basename(util.localpath(p)))
425 else:
425 else:
426 res = lambda p: dest
426 res = lambda p: dest
427 return res
427 return res
428
428
429
429
430 pats = scmutil.expandpats(pats)
430 pats = scmutil.expandpats(pats)
431 if not pats:
431 if not pats:
432 raise util.Abort(_('no source or destination specified'))
432 raise util.Abort(_('no source or destination specified'))
433 if len(pats) == 1:
433 if len(pats) == 1:
434 raise util.Abort(_('no destination specified'))
434 raise util.Abort(_('no destination specified'))
435 dest = pats.pop()
435 dest = pats.pop()
436 destdirexists = os.path.isdir(dest) and not os.path.islink(dest)
436 destdirexists = os.path.isdir(dest) and not os.path.islink(dest)
437 if not destdirexists:
437 if not destdirexists:
438 if len(pats) > 1 or matchmod.patkind(pats[0]):
438 if len(pats) > 1 or matchmod.patkind(pats[0]):
439 raise util.Abort(_('with multiple sources, destination must be an '
439 raise util.Abort(_('with multiple sources, destination must be an '
440 'existing directory'))
440 'existing directory'))
441 if util.endswithsep(dest):
441 if util.endswithsep(dest):
442 raise util.Abort(_('destination %s is not a directory') % dest)
442 raise util.Abort(_('destination %s is not a directory') % dest)
443
443
444 tfn = targetpathfn
444 tfn = targetpathfn
445 if after:
445 if after:
446 tfn = targetpathafterfn
446 tfn = targetpathafterfn
447 copylist = []
447 copylist = []
448 for pat in pats:
448 for pat in pats:
449 srcs = walkpat(pat)
449 srcs = walkpat(pat)
450 if not srcs:
450 if not srcs:
451 continue
451 continue
452 copylist.append((tfn(pat, dest, srcs), srcs))
452 copylist.append((tfn(pat, dest, srcs), srcs))
453 if not copylist:
453 if not copylist:
454 raise util.Abort(_('no files to copy'))
454 raise util.Abort(_('no files to copy'))
455
455
456 errors = 0
456 errors = 0
457 for targetpath, srcs in copylist:
457 for targetpath, srcs in copylist:
458 for abssrc, relsrc, exact in srcs:
458 for abssrc, relsrc, exact in srcs:
459 if copyfile(abssrc, relsrc, targetpath(abssrc), exact):
459 if copyfile(abssrc, relsrc, targetpath(abssrc), exact):
460 errors += 1
460 errors += 1
461
461
462 if errors:
462 if errors:
463 ui.warn(_('(consider using --after)\n'))
463 ui.warn(_('(consider using --after)\n'))
464
464
465 return errors != 0
465 return errors != 0
466
466
467 def service(opts, parentfn=None, initfn=None, runfn=None, logfile=None,
467 def service(opts, parentfn=None, initfn=None, runfn=None, logfile=None,
468 runargs=None, appendpid=False):
468 runargs=None, appendpid=False):
469 '''Run a command as a service.'''
469 '''Run a command as a service.'''
470
470
471 if opts['daemon'] and not opts['daemon_pipefds']:
471 if opts['daemon'] and not opts['daemon_pipefds']:
472 # Signal child process startup with file removal
472 # Signal child process startup with file removal
473 lockfd, lockpath = tempfile.mkstemp(prefix='hg-service-')
473 lockfd, lockpath = tempfile.mkstemp(prefix='hg-service-')
474 os.close(lockfd)
474 os.close(lockfd)
475 try:
475 try:
476 if not runargs:
476 if not runargs:
477 runargs = util.hgcmd() + sys.argv[1:]
477 runargs = util.hgcmd() + sys.argv[1:]
478 runargs.append('--daemon-pipefds=%s' % lockpath)
478 runargs.append('--daemon-pipefds=%s' % lockpath)
479 # Don't pass --cwd to the child process, because we've already
479 # Don't pass --cwd to the child process, because we've already
480 # changed directory.
480 # changed directory.
481 for i in xrange(1, len(runargs)):
481 for i in xrange(1, len(runargs)):
482 if runargs[i].startswith('--cwd='):
482 if runargs[i].startswith('--cwd='):
483 del runargs[i]
483 del runargs[i]
484 break
484 break
485 elif runargs[i].startswith('--cwd'):
485 elif runargs[i].startswith('--cwd'):
486 del runargs[i:i + 2]
486 del runargs[i:i + 2]
487 break
487 break
488 def condfn():
488 def condfn():
489 return not os.path.exists(lockpath)
489 return not os.path.exists(lockpath)
490 pid = util.rundetached(runargs, condfn)
490 pid = util.rundetached(runargs, condfn)
491 if pid < 0:
491 if pid < 0:
492 raise util.Abort(_('child process failed to start'))
492 raise util.Abort(_('child process failed to start'))
493 finally:
493 finally:
494 try:
494 try:
495 os.unlink(lockpath)
495 os.unlink(lockpath)
496 except OSError, e:
496 except OSError, e:
497 if e.errno != errno.ENOENT:
497 if e.errno != errno.ENOENT:
498 raise
498 raise
499 if parentfn:
499 if parentfn:
500 return parentfn(pid)
500 return parentfn(pid)
501 else:
501 else:
502 return
502 return
503
503
504 if initfn:
504 if initfn:
505 initfn()
505 initfn()
506
506
507 if opts['pid_file']:
507 if opts['pid_file']:
508 mode = appendpid and 'a' or 'w'
508 mode = appendpid and 'a' or 'w'
509 fp = open(opts['pid_file'], mode)
509 fp = open(opts['pid_file'], mode)
510 fp.write(str(os.getpid()) + '\n')
510 fp.write(str(os.getpid()) + '\n')
511 fp.close()
511 fp.close()
512
512
513 if opts['daemon_pipefds']:
513 if opts['daemon_pipefds']:
514 lockpath = opts['daemon_pipefds']
514 lockpath = opts['daemon_pipefds']
515 try:
515 try:
516 os.setsid()
516 os.setsid()
517 except AttributeError:
517 except AttributeError:
518 pass
518 pass
519 os.unlink(lockpath)
519 os.unlink(lockpath)
520 util.hidewindow()
520 util.hidewindow()
521 sys.stdout.flush()
521 sys.stdout.flush()
522 sys.stderr.flush()
522 sys.stderr.flush()
523
523
524 nullfd = os.open(os.devnull, os.O_RDWR)
524 nullfd = os.open(os.devnull, os.O_RDWR)
525 logfilefd = nullfd
525 logfilefd = nullfd
526 if logfile:
526 if logfile:
527 logfilefd = os.open(logfile, os.O_RDWR | os.O_CREAT | os.O_APPEND)
527 logfilefd = os.open(logfile, os.O_RDWR | os.O_CREAT | os.O_APPEND)
528 os.dup2(nullfd, 0)
528 os.dup2(nullfd, 0)
529 os.dup2(logfilefd, 1)
529 os.dup2(logfilefd, 1)
530 os.dup2(logfilefd, 2)
530 os.dup2(logfilefd, 2)
531 if nullfd not in (0, 1, 2):
531 if nullfd not in (0, 1, 2):
532 os.close(nullfd)
532 os.close(nullfd)
533 if logfile and logfilefd not in (0, 1, 2):
533 if logfile and logfilefd not in (0, 1, 2):
534 os.close(logfilefd)
534 os.close(logfilefd)
535
535
536 if runfn:
536 if runfn:
537 return runfn()
537 return runfn()
538
538
539 def export(repo, revs, template='hg-%h.patch', fp=None, switch_parent=False,
539 def export(repo, revs, template='hg-%h.patch', fp=None, switch_parent=False,
540 opts=None):
540 opts=None):
541 '''export changesets as hg patches.'''
541 '''export changesets as hg patches.'''
542
542
543 total = len(revs)
543 total = len(revs)
544 revwidth = max([len(str(rev)) for rev in revs])
544 revwidth = max([len(str(rev)) for rev in revs])
545 filemode = {}
545 filemode = {}
546
546
547 def single(rev, seqno, fp):
547 def single(rev, seqno, fp):
548 ctx = repo[rev]
548 ctx = repo[rev]
549 node = ctx.node()
549 node = ctx.node()
550 parents = [p.node() for p in ctx.parents() if p]
550 parents = [p.node() for p in ctx.parents() if p]
551 branch = ctx.branch()
551 branch = ctx.branch()
552 if switch_parent:
552 if switch_parent:
553 parents.reverse()
553 parents.reverse()
554 prev = (parents and parents[0]) or nullid
554 prev = (parents and parents[0]) or nullid
555
555
556 shouldclose = False
556 shouldclose = False
557 if not fp and len(template) > 0:
557 if not fp and len(template) > 0:
558 desc_lines = ctx.description().rstrip().split('\n')
558 desc_lines = ctx.description().rstrip().split('\n')
559 desc = desc_lines[0] #Commit always has a first line.
559 desc = desc_lines[0] #Commit always has a first line.
560 fp = makefileobj(repo, template, node, desc=desc, total=total,
560 fp = makefileobj(repo, template, node, desc=desc, total=total,
561 seqno=seqno, revwidth=revwidth, mode='wb',
561 seqno=seqno, revwidth=revwidth, mode='wb',
562 modemap=filemode)
562 modemap=filemode)
563 if fp != template:
563 if fp != template:
564 shouldclose = True
564 shouldclose = True
565 if fp and fp != sys.stdout and util.safehasattr(fp, 'name'):
565 if fp and fp != sys.stdout and util.safehasattr(fp, 'name'):
566 repo.ui.note("%s\n" % fp.name)
566 repo.ui.note("%s\n" % fp.name)
567
567
568 if not fp:
568 if not fp:
569 write = repo.ui.write
569 write = repo.ui.write
570 else:
570 else:
571 def write(s, **kw):
571 def write(s, **kw):
572 fp.write(s)
572 fp.write(s)
573
573
574
574
575 write("# HG changeset patch\n")
575 write("# HG changeset patch\n")
576 write("# User %s\n" % ctx.user())
576 write("# User %s\n" % ctx.user())
577 write("# Date %d %d\n" % ctx.date())
577 write("# Date %d %d\n" % ctx.date())
578 write("# %s\n" % util.datestr(ctx.date()))
578 if branch and branch != 'default':
579 if branch and branch != 'default':
579 write("# Branch %s\n" % branch)
580 write("# Branch %s\n" % branch)
580 write("# Node ID %s\n" % hex(node))
581 write("# Node ID %s\n" % hex(node))
581 write("# Parent %s\n" % hex(prev))
582 write("# Parent %s\n" % hex(prev))
582 if len(parents) > 1:
583 if len(parents) > 1:
583 write("# Parent %s\n" % hex(parents[1]))
584 write("# Parent %s\n" % hex(parents[1]))
584 write(ctx.description().rstrip())
585 write(ctx.description().rstrip())
585 write("\n\n")
586 write("\n\n")
586
587
587 for chunk, label in patch.diffui(repo, prev, node, opts=opts):
588 for chunk, label in patch.diffui(repo, prev, node, opts=opts):
588 write(chunk, label=label)
589 write(chunk, label=label)
589
590
590 if shouldclose:
591 if shouldclose:
591 fp.close()
592 fp.close()
592
593
593 for seqno, rev in enumerate(revs):
594 for seqno, rev in enumerate(revs):
594 single(rev, seqno + 1, fp)
595 single(rev, seqno + 1, fp)
595
596
596 def diffordiffstat(ui, repo, diffopts, node1, node2, match,
597 def diffordiffstat(ui, repo, diffopts, node1, node2, match,
597 changes=None, stat=False, fp=None, prefix='',
598 changes=None, stat=False, fp=None, prefix='',
598 listsubrepos=False):
599 listsubrepos=False):
599 '''show diff or diffstat.'''
600 '''show diff or diffstat.'''
600 if fp is None:
601 if fp is None:
601 write = ui.write
602 write = ui.write
602 else:
603 else:
603 def write(s, **kw):
604 def write(s, **kw):
604 fp.write(s)
605 fp.write(s)
605
606
606 if stat:
607 if stat:
607 diffopts = diffopts.copy(context=0)
608 diffopts = diffopts.copy(context=0)
608 width = 80
609 width = 80
609 if not ui.plain():
610 if not ui.plain():
610 width = ui.termwidth()
611 width = ui.termwidth()
611 chunks = patch.diff(repo, node1, node2, match, changes, diffopts,
612 chunks = patch.diff(repo, node1, node2, match, changes, diffopts,
612 prefix=prefix)
613 prefix=prefix)
613 for chunk, label in patch.diffstatui(util.iterlines(chunks),
614 for chunk, label in patch.diffstatui(util.iterlines(chunks),
614 width=width,
615 width=width,
615 git=diffopts.git):
616 git=diffopts.git):
616 write(chunk, label=label)
617 write(chunk, label=label)
617 else:
618 else:
618 for chunk, label in patch.diffui(repo, node1, node2, match,
619 for chunk, label in patch.diffui(repo, node1, node2, match,
619 changes, diffopts, prefix=prefix):
620 changes, diffopts, prefix=prefix):
620 write(chunk, label=label)
621 write(chunk, label=label)
621
622
622 if listsubrepos:
623 if listsubrepos:
623 ctx1 = repo[node1]
624 ctx1 = repo[node1]
624 ctx2 = repo[node2]
625 ctx2 = repo[node2]
625 for subpath, sub in subrepo.itersubrepos(ctx1, ctx2):
626 for subpath, sub in subrepo.itersubrepos(ctx1, ctx2):
626 tempnode2 = node2
627 tempnode2 = node2
627 try:
628 try:
628 if node2 is not None:
629 if node2 is not None:
629 tempnode2 = ctx2.substate[subpath][1]
630 tempnode2 = ctx2.substate[subpath][1]
630 except KeyError:
631 except KeyError:
631 # A subrepo that existed in node1 was deleted between node1 and
632 # A subrepo that existed in node1 was deleted between node1 and
632 # node2 (inclusive). Thus, ctx2's substate won't contain that
633 # node2 (inclusive). Thus, ctx2's substate won't contain that
633 # subpath. The best we can do is to ignore it.
634 # subpath. The best we can do is to ignore it.
634 tempnode2 = None
635 tempnode2 = None
635 submatch = matchmod.narrowmatcher(subpath, match)
636 submatch = matchmod.narrowmatcher(subpath, match)
636 sub.diff(ui, diffopts, tempnode2, submatch, changes=changes,
637 sub.diff(ui, diffopts, tempnode2, submatch, changes=changes,
637 stat=stat, fp=fp, prefix=prefix)
638 stat=stat, fp=fp, prefix=prefix)
638
639
639 class changeset_printer(object):
640 class changeset_printer(object):
640 '''show changeset information when templating not requested.'''
641 '''show changeset information when templating not requested.'''
641
642
642 def __init__(self, ui, repo, patch, diffopts, buffered):
643 def __init__(self, ui, repo, patch, diffopts, buffered):
643 self.ui = ui
644 self.ui = ui
644 self.repo = repo
645 self.repo = repo
645 self.buffered = buffered
646 self.buffered = buffered
646 self.patch = patch
647 self.patch = patch
647 self.diffopts = diffopts
648 self.diffopts = diffopts
648 self.header = {}
649 self.header = {}
649 self.hunk = {}
650 self.hunk = {}
650 self.lastheader = None
651 self.lastheader = None
651 self.footer = None
652 self.footer = None
652
653
653 def flush(self, rev):
654 def flush(self, rev):
654 if rev in self.header:
655 if rev in self.header:
655 h = self.header[rev]
656 h = self.header[rev]
656 if h != self.lastheader:
657 if h != self.lastheader:
657 self.lastheader = h
658 self.lastheader = h
658 self.ui.write(h)
659 self.ui.write(h)
659 del self.header[rev]
660 del self.header[rev]
660 if rev in self.hunk:
661 if rev in self.hunk:
661 self.ui.write(self.hunk[rev])
662 self.ui.write(self.hunk[rev])
662 del self.hunk[rev]
663 del self.hunk[rev]
663 return 1
664 return 1
664 return 0
665 return 0
665
666
666 def close(self):
667 def close(self):
667 if self.footer:
668 if self.footer:
668 self.ui.write(self.footer)
669 self.ui.write(self.footer)
669
670
670 def show(self, ctx, copies=None, matchfn=None, **props):
671 def show(self, ctx, copies=None, matchfn=None, **props):
671 if self.buffered:
672 if self.buffered:
672 self.ui.pushbuffer()
673 self.ui.pushbuffer()
673 self._show(ctx, copies, matchfn, props)
674 self._show(ctx, copies, matchfn, props)
674 self.hunk[ctx.rev()] = self.ui.popbuffer(labeled=True)
675 self.hunk[ctx.rev()] = self.ui.popbuffer(labeled=True)
675 else:
676 else:
676 self._show(ctx, copies, matchfn, props)
677 self._show(ctx, copies, matchfn, props)
677
678
678 def _show(self, ctx, copies, matchfn, props):
679 def _show(self, ctx, copies, matchfn, props):
679 '''show a single changeset or file revision'''
680 '''show a single changeset or file revision'''
680 changenode = ctx.node()
681 changenode = ctx.node()
681 rev = ctx.rev()
682 rev = ctx.rev()
682
683
683 if self.ui.quiet:
684 if self.ui.quiet:
684 self.ui.write("%d:%s\n" % (rev, short(changenode)),
685 self.ui.write("%d:%s\n" % (rev, short(changenode)),
685 label='log.node')
686 label='log.node')
686 return
687 return
687
688
688 log = self.repo.changelog
689 log = self.repo.changelog
689 date = util.datestr(ctx.date())
690 date = util.datestr(ctx.date())
690
691
691 hexfunc = self.ui.debugflag and hex or short
692 hexfunc = self.ui.debugflag and hex or short
692
693
693 parents = [(p, hexfunc(log.node(p)))
694 parents = [(p, hexfunc(log.node(p)))
694 for p in self._meaningful_parentrevs(log, rev)]
695 for p in self._meaningful_parentrevs(log, rev)]
695
696
696 # i18n: column positioning for "hg log"
697 # i18n: column positioning for "hg log"
697 self.ui.write(_("changeset: %d:%s\n") % (rev, hexfunc(changenode)),
698 self.ui.write(_("changeset: %d:%s\n") % (rev, hexfunc(changenode)),
698 label='log.changeset changeset.%s' % ctx.phasestr())
699 label='log.changeset changeset.%s' % ctx.phasestr())
699
700
700 branch = ctx.branch()
701 branch = ctx.branch()
701 # don't show the default branch name
702 # don't show the default branch name
702 if branch != 'default':
703 if branch != 'default':
703 # i18n: column positioning for "hg log"
704 # i18n: column positioning for "hg log"
704 self.ui.write(_("branch: %s\n") % branch,
705 self.ui.write(_("branch: %s\n") % branch,
705 label='log.branch')
706 label='log.branch')
706 for bookmark in self.repo.nodebookmarks(changenode):
707 for bookmark in self.repo.nodebookmarks(changenode):
707 # i18n: column positioning for "hg log"
708 # i18n: column positioning for "hg log"
708 self.ui.write(_("bookmark: %s\n") % bookmark,
709 self.ui.write(_("bookmark: %s\n") % bookmark,
709 label='log.bookmark')
710 label='log.bookmark')
710 for tag in self.repo.nodetags(changenode):
711 for tag in self.repo.nodetags(changenode):
711 # i18n: column positioning for "hg log"
712 # i18n: column positioning for "hg log"
712 self.ui.write(_("tag: %s\n") % tag,
713 self.ui.write(_("tag: %s\n") % tag,
713 label='log.tag')
714 label='log.tag')
714 if self.ui.debugflag and ctx.phase():
715 if self.ui.debugflag and ctx.phase():
715 # i18n: column positioning for "hg log"
716 # i18n: column positioning for "hg log"
716 self.ui.write(_("phase: %s\n") % _(ctx.phasestr()),
717 self.ui.write(_("phase: %s\n") % _(ctx.phasestr()),
717 label='log.phase')
718 label='log.phase')
718 for parent in parents:
719 for parent in parents:
719 # i18n: column positioning for "hg log"
720 # i18n: column positioning for "hg log"
720 self.ui.write(_("parent: %d:%s\n") % parent,
721 self.ui.write(_("parent: %d:%s\n") % parent,
721 label='log.parent changeset.%s' % ctx.phasestr())
722 label='log.parent changeset.%s' % ctx.phasestr())
722
723
723 if self.ui.debugflag:
724 if self.ui.debugflag:
724 mnode = ctx.manifestnode()
725 mnode = ctx.manifestnode()
725 # i18n: column positioning for "hg log"
726 # i18n: column positioning for "hg log"
726 self.ui.write(_("manifest: %d:%s\n") %
727 self.ui.write(_("manifest: %d:%s\n") %
727 (self.repo.manifest.rev(mnode), hex(mnode)),
728 (self.repo.manifest.rev(mnode), hex(mnode)),
728 label='ui.debug log.manifest')
729 label='ui.debug log.manifest')
729 # i18n: column positioning for "hg log"
730 # i18n: column positioning for "hg log"
730 self.ui.write(_("user: %s\n") % ctx.user(),
731 self.ui.write(_("user: %s\n") % ctx.user(),
731 label='log.user')
732 label='log.user')
732 # i18n: column positioning for "hg log"
733 # i18n: column positioning for "hg log"
733 self.ui.write(_("date: %s\n") % date,
734 self.ui.write(_("date: %s\n") % date,
734 label='log.date')
735 label='log.date')
735
736
736 if self.ui.debugflag:
737 if self.ui.debugflag:
737 files = self.repo.status(log.parents(changenode)[0], changenode)[:3]
738 files = self.repo.status(log.parents(changenode)[0], changenode)[:3]
738 for key, value in zip([# i18n: column positioning for "hg log"
739 for key, value in zip([# i18n: column positioning for "hg log"
739 _("files:"),
740 _("files:"),
740 # i18n: column positioning for "hg log"
741 # i18n: column positioning for "hg log"
741 _("files+:"),
742 _("files+:"),
742 # i18n: column positioning for "hg log"
743 # i18n: column positioning for "hg log"
743 _("files-:")], files):
744 _("files-:")], files):
744 if value:
745 if value:
745 self.ui.write("%-12s %s\n" % (key, " ".join(value)),
746 self.ui.write("%-12s %s\n" % (key, " ".join(value)),
746 label='ui.debug log.files')
747 label='ui.debug log.files')
747 elif ctx.files() and self.ui.verbose:
748 elif ctx.files() and self.ui.verbose:
748 # i18n: column positioning for "hg log"
749 # i18n: column positioning for "hg log"
749 self.ui.write(_("files: %s\n") % " ".join(ctx.files()),
750 self.ui.write(_("files: %s\n") % " ".join(ctx.files()),
750 label='ui.note log.files')
751 label='ui.note log.files')
751 if copies and self.ui.verbose:
752 if copies and self.ui.verbose:
752 copies = ['%s (%s)' % c for c in copies]
753 copies = ['%s (%s)' % c for c in copies]
753 # i18n: column positioning for "hg log"
754 # i18n: column positioning for "hg log"
754 self.ui.write(_("copies: %s\n") % ' '.join(copies),
755 self.ui.write(_("copies: %s\n") % ' '.join(copies),
755 label='ui.note log.copies')
756 label='ui.note log.copies')
756
757
757 extra = ctx.extra()
758 extra = ctx.extra()
758 if extra and self.ui.debugflag:
759 if extra and self.ui.debugflag:
759 for key, value in sorted(extra.items()):
760 for key, value in sorted(extra.items()):
760 # i18n: column positioning for "hg log"
761 # i18n: column positioning for "hg log"
761 self.ui.write(_("extra: %s=%s\n")
762 self.ui.write(_("extra: %s=%s\n")
762 % (key, value.encode('string_escape')),
763 % (key, value.encode('string_escape')),
763 label='ui.debug log.extra')
764 label='ui.debug log.extra')
764
765
765 description = ctx.description().strip()
766 description = ctx.description().strip()
766 if description:
767 if description:
767 if self.ui.verbose:
768 if self.ui.verbose:
768 self.ui.write(_("description:\n"),
769 self.ui.write(_("description:\n"),
769 label='ui.note log.description')
770 label='ui.note log.description')
770 self.ui.write(description,
771 self.ui.write(description,
771 label='ui.note log.description')
772 label='ui.note log.description')
772 self.ui.write("\n\n")
773 self.ui.write("\n\n")
773 else:
774 else:
774 # i18n: column positioning for "hg log"
775 # i18n: column positioning for "hg log"
775 self.ui.write(_("summary: %s\n") %
776 self.ui.write(_("summary: %s\n") %
776 description.splitlines()[0],
777 description.splitlines()[0],
777 label='log.summary')
778 label='log.summary')
778 self.ui.write("\n")
779 self.ui.write("\n")
779
780
780 self.showpatch(changenode, matchfn)
781 self.showpatch(changenode, matchfn)
781
782
782 def showpatch(self, node, matchfn):
783 def showpatch(self, node, matchfn):
783 if not matchfn:
784 if not matchfn:
784 matchfn = self.patch
785 matchfn = self.patch
785 if matchfn:
786 if matchfn:
786 stat = self.diffopts.get('stat')
787 stat = self.diffopts.get('stat')
787 diff = self.diffopts.get('patch')
788 diff = self.diffopts.get('patch')
788 diffopts = patch.diffopts(self.ui, self.diffopts)
789 diffopts = patch.diffopts(self.ui, self.diffopts)
789 prev = self.repo.changelog.parents(node)[0]
790 prev = self.repo.changelog.parents(node)[0]
790 if stat:
791 if stat:
791 diffordiffstat(self.ui, self.repo, diffopts, prev, node,
792 diffordiffstat(self.ui, self.repo, diffopts, prev, node,
792 match=matchfn, stat=True)
793 match=matchfn, stat=True)
793 if diff:
794 if diff:
794 if stat:
795 if stat:
795 self.ui.write("\n")
796 self.ui.write("\n")
796 diffordiffstat(self.ui, self.repo, diffopts, prev, node,
797 diffordiffstat(self.ui, self.repo, diffopts, prev, node,
797 match=matchfn, stat=False)
798 match=matchfn, stat=False)
798 self.ui.write("\n")
799 self.ui.write("\n")
799
800
800 def _meaningful_parentrevs(self, log, rev):
801 def _meaningful_parentrevs(self, log, rev):
801 """Return list of meaningful (or all if debug) parentrevs for rev.
802 """Return list of meaningful (or all if debug) parentrevs for rev.
802
803
803 For merges (two non-nullrev revisions) both parents are meaningful.
804 For merges (two non-nullrev revisions) both parents are meaningful.
804 Otherwise the first parent revision is considered meaningful if it
805 Otherwise the first parent revision is considered meaningful if it
805 is not the preceding revision.
806 is not the preceding revision.
806 """
807 """
807 parents = log.parentrevs(rev)
808 parents = log.parentrevs(rev)
808 if not self.ui.debugflag and parents[1] == nullrev:
809 if not self.ui.debugflag and parents[1] == nullrev:
809 if parents[0] >= rev - 1:
810 if parents[0] >= rev - 1:
810 parents = []
811 parents = []
811 else:
812 else:
812 parents = [parents[0]]
813 parents = [parents[0]]
813 return parents
814 return parents
814
815
815
816
816 class changeset_templater(changeset_printer):
817 class changeset_templater(changeset_printer):
817 '''format changeset information.'''
818 '''format changeset information.'''
818
819
819 def __init__(self, ui, repo, patch, diffopts, mapfile, buffered):
820 def __init__(self, ui, repo, patch, diffopts, mapfile, buffered):
820 changeset_printer.__init__(self, ui, repo, patch, diffopts, buffered)
821 changeset_printer.__init__(self, ui, repo, patch, diffopts, buffered)
821 formatnode = ui.debugflag and (lambda x: x) or (lambda x: x[:12])
822 formatnode = ui.debugflag and (lambda x: x) or (lambda x: x[:12])
822 defaulttempl = {
823 defaulttempl = {
823 'parent': '{rev}:{node|formatnode} ',
824 'parent': '{rev}:{node|formatnode} ',
824 'manifest': '{rev}:{node|formatnode}',
825 'manifest': '{rev}:{node|formatnode}',
825 'file_copy': '{name} ({source})',
826 'file_copy': '{name} ({source})',
826 'extra': '{key}={value|stringescape}'
827 'extra': '{key}={value|stringescape}'
827 }
828 }
828 # filecopy is preserved for compatibility reasons
829 # filecopy is preserved for compatibility reasons
829 defaulttempl['filecopy'] = defaulttempl['file_copy']
830 defaulttempl['filecopy'] = defaulttempl['file_copy']
830 self.t = templater.templater(mapfile, {'formatnode': formatnode},
831 self.t = templater.templater(mapfile, {'formatnode': formatnode},
831 cache=defaulttempl)
832 cache=defaulttempl)
832 self.cache = {}
833 self.cache = {}
833
834
834 def use_template(self, t):
835 def use_template(self, t):
835 '''set template string to use'''
836 '''set template string to use'''
836 self.t.cache['changeset'] = t
837 self.t.cache['changeset'] = t
837
838
838 def _meaningful_parentrevs(self, ctx):
839 def _meaningful_parentrevs(self, ctx):
839 """Return list of meaningful (or all if debug) parentrevs for rev.
840 """Return list of meaningful (or all if debug) parentrevs for rev.
840 """
841 """
841 parents = ctx.parents()
842 parents = ctx.parents()
842 if len(parents) > 1:
843 if len(parents) > 1:
843 return parents
844 return parents
844 if self.ui.debugflag:
845 if self.ui.debugflag:
845 return [parents[0], self.repo['null']]
846 return [parents[0], self.repo['null']]
846 if parents[0].rev() >= ctx.rev() - 1:
847 if parents[0].rev() >= ctx.rev() - 1:
847 return []
848 return []
848 return parents
849 return parents
849
850
850 def _show(self, ctx, copies, matchfn, props):
851 def _show(self, ctx, copies, matchfn, props):
851 '''show a single changeset or file revision'''
852 '''show a single changeset or file revision'''
852
853
853 showlist = templatekw.showlist
854 showlist = templatekw.showlist
854
855
855 # showparents() behaviour depends on ui trace level which
856 # showparents() behaviour depends on ui trace level which
856 # causes unexpected behaviours at templating level and makes
857 # causes unexpected behaviours at templating level and makes
857 # it harder to extract it in a standalone function. Its
858 # it harder to extract it in a standalone function. Its
858 # behaviour cannot be changed so leave it here for now.
859 # behaviour cannot be changed so leave it here for now.
859 def showparents(**args):
860 def showparents(**args):
860 ctx = args['ctx']
861 ctx = args['ctx']
861 parents = [[('rev', p.rev()), ('node', p.hex())]
862 parents = [[('rev', p.rev()), ('node', p.hex())]
862 for p in self._meaningful_parentrevs(ctx)]
863 for p in self._meaningful_parentrevs(ctx)]
863 return showlist('parent', parents, **args)
864 return showlist('parent', parents, **args)
864
865
865 props = props.copy()
866 props = props.copy()
866 props.update(templatekw.keywords)
867 props.update(templatekw.keywords)
867 props['parents'] = showparents
868 props['parents'] = showparents
868 props['templ'] = self.t
869 props['templ'] = self.t
869 props['ctx'] = ctx
870 props['ctx'] = ctx
870 props['repo'] = self.repo
871 props['repo'] = self.repo
871 props['revcache'] = {'copies': copies}
872 props['revcache'] = {'copies': copies}
872 props['cache'] = self.cache
873 props['cache'] = self.cache
873
874
874 # find correct templates for current mode
875 # find correct templates for current mode
875
876
876 tmplmodes = [
877 tmplmodes = [
877 (True, None),
878 (True, None),
878 (self.ui.verbose, 'verbose'),
879 (self.ui.verbose, 'verbose'),
879 (self.ui.quiet, 'quiet'),
880 (self.ui.quiet, 'quiet'),
880 (self.ui.debugflag, 'debug'),
881 (self.ui.debugflag, 'debug'),
881 ]
882 ]
882
883
883 types = {'header': '', 'footer':'', 'changeset': 'changeset'}
884 types = {'header': '', 'footer':'', 'changeset': 'changeset'}
884 for mode, postfix in tmplmodes:
885 for mode, postfix in tmplmodes:
885 for type in types:
886 for type in types:
886 cur = postfix and ('%s_%s' % (type, postfix)) or type
887 cur = postfix and ('%s_%s' % (type, postfix)) or type
887 if mode and cur in self.t:
888 if mode and cur in self.t:
888 types[type] = cur
889 types[type] = cur
889
890
890 try:
891 try:
891
892
892 # write header
893 # write header
893 if types['header']:
894 if types['header']:
894 h = templater.stringify(self.t(types['header'], **props))
895 h = templater.stringify(self.t(types['header'], **props))
895 if self.buffered:
896 if self.buffered:
896 self.header[ctx.rev()] = h
897 self.header[ctx.rev()] = h
897 else:
898 else:
898 if self.lastheader != h:
899 if self.lastheader != h:
899 self.lastheader = h
900 self.lastheader = h
900 self.ui.write(h)
901 self.ui.write(h)
901
902
902 # write changeset metadata, then patch if requested
903 # write changeset metadata, then patch if requested
903 key = types['changeset']
904 key = types['changeset']
904 self.ui.write(templater.stringify(self.t(key, **props)))
905 self.ui.write(templater.stringify(self.t(key, **props)))
905 self.showpatch(ctx.node(), matchfn)
906 self.showpatch(ctx.node(), matchfn)
906
907
907 if types['footer']:
908 if types['footer']:
908 if not self.footer:
909 if not self.footer:
909 self.footer = templater.stringify(self.t(types['footer'],
910 self.footer = templater.stringify(self.t(types['footer'],
910 **props))
911 **props))
911
912
912 except KeyError, inst:
913 except KeyError, inst:
913 msg = _("%s: no key named '%s'")
914 msg = _("%s: no key named '%s'")
914 raise util.Abort(msg % (self.t.mapfile, inst.args[0]))
915 raise util.Abort(msg % (self.t.mapfile, inst.args[0]))
915 except SyntaxError, inst:
916 except SyntaxError, inst:
916 raise util.Abort('%s: %s' % (self.t.mapfile, inst.args[0]))
917 raise util.Abort('%s: %s' % (self.t.mapfile, inst.args[0]))
917
918
918 def show_changeset(ui, repo, opts, buffered=False):
919 def show_changeset(ui, repo, opts, buffered=False):
919 """show one changeset using template or regular display.
920 """show one changeset using template or regular display.
920
921
921 Display format will be the first non-empty hit of:
922 Display format will be the first non-empty hit of:
922 1. option 'template'
923 1. option 'template'
923 2. option 'style'
924 2. option 'style'
924 3. [ui] setting 'logtemplate'
925 3. [ui] setting 'logtemplate'
925 4. [ui] setting 'style'
926 4. [ui] setting 'style'
926 If all of these values are either the unset or the empty string,
927 If all of these values are either the unset or the empty string,
927 regular display via changeset_printer() is done.
928 regular display via changeset_printer() is done.
928 """
929 """
929 # options
930 # options
930 patch = False
931 patch = False
931 if opts.get('patch') or opts.get('stat'):
932 if opts.get('patch') or opts.get('stat'):
932 patch = scmutil.matchall(repo)
933 patch = scmutil.matchall(repo)
933
934
934 tmpl = opts.get('template')
935 tmpl = opts.get('template')
935 style = None
936 style = None
936 if tmpl:
937 if tmpl:
937 tmpl = templater.parsestring(tmpl, quoted=False)
938 tmpl = templater.parsestring(tmpl, quoted=False)
938 else:
939 else:
939 style = opts.get('style')
940 style = opts.get('style')
940
941
941 # ui settings
942 # ui settings
942 if not (tmpl or style):
943 if not (tmpl or style):
943 tmpl = ui.config('ui', 'logtemplate')
944 tmpl = ui.config('ui', 'logtemplate')
944 if tmpl:
945 if tmpl:
945 try:
946 try:
946 tmpl = templater.parsestring(tmpl)
947 tmpl = templater.parsestring(tmpl)
947 except SyntaxError:
948 except SyntaxError:
948 tmpl = templater.parsestring(tmpl, quoted=False)
949 tmpl = templater.parsestring(tmpl, quoted=False)
949 else:
950 else:
950 style = util.expandpath(ui.config('ui', 'style', ''))
951 style = util.expandpath(ui.config('ui', 'style', ''))
951
952
952 if not (tmpl or style):
953 if not (tmpl or style):
953 return changeset_printer(ui, repo, patch, opts, buffered)
954 return changeset_printer(ui, repo, patch, opts, buffered)
954
955
955 mapfile = None
956 mapfile = None
956 if style and not tmpl:
957 if style and not tmpl:
957 mapfile = style
958 mapfile = style
958 if not os.path.split(mapfile)[0]:
959 if not os.path.split(mapfile)[0]:
959 mapname = (templater.templatepath('map-cmdline.' + mapfile)
960 mapname = (templater.templatepath('map-cmdline.' + mapfile)
960 or templater.templatepath(mapfile))
961 or templater.templatepath(mapfile))
961 if mapname:
962 if mapname:
962 mapfile = mapname
963 mapfile = mapname
963
964
964 try:
965 try:
965 t = changeset_templater(ui, repo, patch, opts, mapfile, buffered)
966 t = changeset_templater(ui, repo, patch, opts, mapfile, buffered)
966 except SyntaxError, inst:
967 except SyntaxError, inst:
967 raise util.Abort(inst.args[0])
968 raise util.Abort(inst.args[0])
968 if tmpl:
969 if tmpl:
969 t.use_template(tmpl)
970 t.use_template(tmpl)
970 return t
971 return t
971
972
972 def finddate(ui, repo, date):
973 def finddate(ui, repo, date):
973 """Find the tipmost changeset that matches the given date spec"""
974 """Find the tipmost changeset that matches the given date spec"""
974
975
975 df = util.matchdate(date)
976 df = util.matchdate(date)
976 m = scmutil.matchall(repo)
977 m = scmutil.matchall(repo)
977 results = {}
978 results = {}
978
979
979 def prep(ctx, fns):
980 def prep(ctx, fns):
980 d = ctx.date()
981 d = ctx.date()
981 if df(d[0]):
982 if df(d[0]):
982 results[ctx.rev()] = d
983 results[ctx.rev()] = d
983
984
984 for ctx in walkchangerevs(repo, m, {'rev': None}, prep):
985 for ctx in walkchangerevs(repo, m, {'rev': None}, prep):
985 rev = ctx.rev()
986 rev = ctx.rev()
986 if rev in results:
987 if rev in results:
987 ui.status(_("found revision %s from %s\n") %
988 ui.status(_("found revision %s from %s\n") %
988 (rev, util.datestr(results[rev])))
989 (rev, util.datestr(results[rev])))
989 return str(rev)
990 return str(rev)
990
991
991 raise util.Abort(_("revision matching date not found"))
992 raise util.Abort(_("revision matching date not found"))
992
993
993 def increasingwindows(start, end, windowsize=8, sizelimit=512):
994 def increasingwindows(start, end, windowsize=8, sizelimit=512):
994 if start < end:
995 if start < end:
995 while start < end:
996 while start < end:
996 yield start, min(windowsize, end - start)
997 yield start, min(windowsize, end - start)
997 start += windowsize
998 start += windowsize
998 if windowsize < sizelimit:
999 if windowsize < sizelimit:
999 windowsize *= 2
1000 windowsize *= 2
1000 else:
1001 else:
1001 while start > end:
1002 while start > end:
1002 yield start, min(windowsize, start - end - 1)
1003 yield start, min(windowsize, start - end - 1)
1003 start -= windowsize
1004 start -= windowsize
1004 if windowsize < sizelimit:
1005 if windowsize < sizelimit:
1005 windowsize *= 2
1006 windowsize *= 2
1006
1007
1007 def walkchangerevs(repo, match, opts, prepare):
1008 def walkchangerevs(repo, match, opts, prepare):
1008 '''Iterate over files and the revs in which they changed.
1009 '''Iterate over files and the revs in which they changed.
1009
1010
1010 Callers most commonly need to iterate backwards over the history
1011 Callers most commonly need to iterate backwards over the history
1011 in which they are interested. Doing so has awful (quadratic-looking)
1012 in which they are interested. Doing so has awful (quadratic-looking)
1012 performance, so we use iterators in a "windowed" way.
1013 performance, so we use iterators in a "windowed" way.
1013
1014
1014 We walk a window of revisions in the desired order. Within the
1015 We walk a window of revisions in the desired order. Within the
1015 window, we first walk forwards to gather data, then in the desired
1016 window, we first walk forwards to gather data, then in the desired
1016 order (usually backwards) to display it.
1017 order (usually backwards) to display it.
1017
1018
1018 This function returns an iterator yielding contexts. Before
1019 This function returns an iterator yielding contexts. Before
1019 yielding each context, the iterator will first call the prepare
1020 yielding each context, the iterator will first call the prepare
1020 function on each context in the window in forward order.'''
1021 function on each context in the window in forward order.'''
1021
1022
1022 follow = opts.get('follow') or opts.get('follow_first')
1023 follow = opts.get('follow') or opts.get('follow_first')
1023
1024
1024 if not len(repo):
1025 if not len(repo):
1025 return []
1026 return []
1026 if opts.get('rev'):
1027 if opts.get('rev'):
1027 revs = scmutil.revrange(repo, opts.get('rev'))
1028 revs = scmutil.revrange(repo, opts.get('rev'))
1028 elif follow:
1029 elif follow:
1029 revs = repo.revs('reverse(:.)')
1030 revs = repo.revs('reverse(:.)')
1030 else:
1031 else:
1031 revs = list(repo)
1032 revs = list(repo)
1032 revs.reverse()
1033 revs.reverse()
1033 if not revs:
1034 if not revs:
1034 return []
1035 return []
1035 wanted = set()
1036 wanted = set()
1036 slowpath = match.anypats() or (match.files() and opts.get('removed'))
1037 slowpath = match.anypats() or (match.files() and opts.get('removed'))
1037 fncache = {}
1038 fncache = {}
1038 change = repo.changectx
1039 change = repo.changectx
1039
1040
1040 # First step is to fill wanted, the set of revisions that we want to yield.
1041 # First step is to fill wanted, the set of revisions that we want to yield.
1041 # When it does not induce extra cost, we also fill fncache for revisions in
1042 # When it does not induce extra cost, we also fill fncache for revisions in
1042 # wanted: a cache of filenames that were changed (ctx.files()) and that
1043 # wanted: a cache of filenames that were changed (ctx.files()) and that
1043 # match the file filtering conditions.
1044 # match the file filtering conditions.
1044
1045
1045 if not slowpath and not match.files():
1046 if not slowpath and not match.files():
1046 # No files, no patterns. Display all revs.
1047 # No files, no patterns. Display all revs.
1047 wanted = set(revs)
1048 wanted = set(revs)
1048 copies = []
1049 copies = []
1049
1050
1050 if not slowpath and match.files():
1051 if not slowpath and match.files():
1051 # We only have to read through the filelog to find wanted revisions
1052 # We only have to read through the filelog to find wanted revisions
1052
1053
1053 minrev, maxrev = min(revs), max(revs)
1054 minrev, maxrev = min(revs), max(revs)
1054 def filerevgen(filelog, last):
1055 def filerevgen(filelog, last):
1055 """
1056 """
1056 Only files, no patterns. Check the history of each file.
1057 Only files, no patterns. Check the history of each file.
1057
1058
1058 Examines filelog entries within minrev, maxrev linkrev range
1059 Examines filelog entries within minrev, maxrev linkrev range
1059 Returns an iterator yielding (linkrev, parentlinkrevs, copied)
1060 Returns an iterator yielding (linkrev, parentlinkrevs, copied)
1060 tuples in backwards order
1061 tuples in backwards order
1061 """
1062 """
1062 cl_count = len(repo)
1063 cl_count = len(repo)
1063 revs = []
1064 revs = []
1064 for j in xrange(0, last + 1):
1065 for j in xrange(0, last + 1):
1065 linkrev = filelog.linkrev(j)
1066 linkrev = filelog.linkrev(j)
1066 if linkrev < minrev:
1067 if linkrev < minrev:
1067 continue
1068 continue
1068 # only yield rev for which we have the changelog, it can
1069 # only yield rev for which we have the changelog, it can
1069 # happen while doing "hg log" during a pull or commit
1070 # happen while doing "hg log" during a pull or commit
1070 if linkrev >= cl_count:
1071 if linkrev >= cl_count:
1071 break
1072 break
1072
1073
1073 parentlinkrevs = []
1074 parentlinkrevs = []
1074 for p in filelog.parentrevs(j):
1075 for p in filelog.parentrevs(j):
1075 if p != nullrev:
1076 if p != nullrev:
1076 parentlinkrevs.append(filelog.linkrev(p))
1077 parentlinkrevs.append(filelog.linkrev(p))
1077 n = filelog.node(j)
1078 n = filelog.node(j)
1078 revs.append((linkrev, parentlinkrevs,
1079 revs.append((linkrev, parentlinkrevs,
1079 follow and filelog.renamed(n)))
1080 follow and filelog.renamed(n)))
1080
1081
1081 return reversed(revs)
1082 return reversed(revs)
1082 def iterfiles():
1083 def iterfiles():
1083 pctx = repo['.']
1084 pctx = repo['.']
1084 for filename in match.files():
1085 for filename in match.files():
1085 if follow:
1086 if follow:
1086 if filename not in pctx:
1087 if filename not in pctx:
1087 raise util.Abort(_('cannot follow file not in parent '
1088 raise util.Abort(_('cannot follow file not in parent '
1088 'revision: "%s"') % filename)
1089 'revision: "%s"') % filename)
1089 yield filename, pctx[filename].filenode()
1090 yield filename, pctx[filename].filenode()
1090 else:
1091 else:
1091 yield filename, None
1092 yield filename, None
1092 for filename_node in copies:
1093 for filename_node in copies:
1093 yield filename_node
1094 yield filename_node
1094 for file_, node in iterfiles():
1095 for file_, node in iterfiles():
1095 filelog = repo.file(file_)
1096 filelog = repo.file(file_)
1096 if not len(filelog):
1097 if not len(filelog):
1097 if node is None:
1098 if node is None:
1098 # A zero count may be a directory or deleted file, so
1099 # A zero count may be a directory or deleted file, so
1099 # try to find matching entries on the slow path.
1100 # try to find matching entries on the slow path.
1100 if follow:
1101 if follow:
1101 raise util.Abort(
1102 raise util.Abort(
1102 _('cannot follow nonexistent file: "%s"') % file_)
1103 _('cannot follow nonexistent file: "%s"') % file_)
1103 slowpath = True
1104 slowpath = True
1104 break
1105 break
1105 else:
1106 else:
1106 continue
1107 continue
1107
1108
1108 if node is None:
1109 if node is None:
1109 last = len(filelog) - 1
1110 last = len(filelog) - 1
1110 else:
1111 else:
1111 last = filelog.rev(node)
1112 last = filelog.rev(node)
1112
1113
1113
1114
1114 # keep track of all ancestors of the file
1115 # keep track of all ancestors of the file
1115 ancestors = set([filelog.linkrev(last)])
1116 ancestors = set([filelog.linkrev(last)])
1116
1117
1117 # iterate from latest to oldest revision
1118 # iterate from latest to oldest revision
1118 for rev, flparentlinkrevs, copied in filerevgen(filelog, last):
1119 for rev, flparentlinkrevs, copied in filerevgen(filelog, last):
1119 if not follow:
1120 if not follow:
1120 if rev > maxrev:
1121 if rev > maxrev:
1121 continue
1122 continue
1122 else:
1123 else:
1123 # Note that last might not be the first interesting
1124 # Note that last might not be the first interesting
1124 # rev to us:
1125 # rev to us:
1125 # if the file has been changed after maxrev, we'll
1126 # if the file has been changed after maxrev, we'll
1126 # have linkrev(last) > maxrev, and we still need
1127 # have linkrev(last) > maxrev, and we still need
1127 # to explore the file graph
1128 # to explore the file graph
1128 if rev not in ancestors:
1129 if rev not in ancestors:
1129 continue
1130 continue
1130 # XXX insert 1327 fix here
1131 # XXX insert 1327 fix here
1131 if flparentlinkrevs:
1132 if flparentlinkrevs:
1132 ancestors.update(flparentlinkrevs)
1133 ancestors.update(flparentlinkrevs)
1133
1134
1134 fncache.setdefault(rev, []).append(file_)
1135 fncache.setdefault(rev, []).append(file_)
1135 wanted.add(rev)
1136 wanted.add(rev)
1136 if copied:
1137 if copied:
1137 copies.append(copied)
1138 copies.append(copied)
1138
1139
1139 # We decided to fall back to the slowpath because at least one
1140 # We decided to fall back to the slowpath because at least one
1140 # of the paths was not a file. Check to see if at least one of them
1141 # of the paths was not a file. Check to see if at least one of them
1141 # existed in history, otherwise simply return
1142 # existed in history, otherwise simply return
1142 if slowpath:
1143 if slowpath:
1143 for path in match.files():
1144 for path in match.files():
1144 if path == '.' or path in repo.store:
1145 if path == '.' or path in repo.store:
1145 break
1146 break
1146 else:
1147 else:
1147 return []
1148 return []
1148
1149
1149 if slowpath:
1150 if slowpath:
1150 # We have to read the changelog to match filenames against
1151 # We have to read the changelog to match filenames against
1151 # changed files
1152 # changed files
1152
1153
1153 if follow:
1154 if follow:
1154 raise util.Abort(_('can only follow copies/renames for explicit '
1155 raise util.Abort(_('can only follow copies/renames for explicit '
1155 'filenames'))
1156 'filenames'))
1156
1157
1157 # The slow path checks files modified in every changeset.
1158 # The slow path checks files modified in every changeset.
1158 for i in sorted(revs):
1159 for i in sorted(revs):
1159 ctx = change(i)
1160 ctx = change(i)
1160 matches = filter(match, ctx.files())
1161 matches = filter(match, ctx.files())
1161 if matches:
1162 if matches:
1162 fncache[i] = matches
1163 fncache[i] = matches
1163 wanted.add(i)
1164 wanted.add(i)
1164
1165
1165 class followfilter(object):
1166 class followfilter(object):
1166 def __init__(self, onlyfirst=False):
1167 def __init__(self, onlyfirst=False):
1167 self.startrev = nullrev
1168 self.startrev = nullrev
1168 self.roots = set()
1169 self.roots = set()
1169 self.onlyfirst = onlyfirst
1170 self.onlyfirst = onlyfirst
1170
1171
1171 def match(self, rev):
1172 def match(self, rev):
1172 def realparents(rev):
1173 def realparents(rev):
1173 if self.onlyfirst:
1174 if self.onlyfirst:
1174 return repo.changelog.parentrevs(rev)[0:1]
1175 return repo.changelog.parentrevs(rev)[0:1]
1175 else:
1176 else:
1176 return filter(lambda x: x != nullrev,
1177 return filter(lambda x: x != nullrev,
1177 repo.changelog.parentrevs(rev))
1178 repo.changelog.parentrevs(rev))
1178
1179
1179 if self.startrev == nullrev:
1180 if self.startrev == nullrev:
1180 self.startrev = rev
1181 self.startrev = rev
1181 return True
1182 return True
1182
1183
1183 if rev > self.startrev:
1184 if rev > self.startrev:
1184 # forward: all descendants
1185 # forward: all descendants
1185 if not self.roots:
1186 if not self.roots:
1186 self.roots.add(self.startrev)
1187 self.roots.add(self.startrev)
1187 for parent in realparents(rev):
1188 for parent in realparents(rev):
1188 if parent in self.roots:
1189 if parent in self.roots:
1189 self.roots.add(rev)
1190 self.roots.add(rev)
1190 return True
1191 return True
1191 else:
1192 else:
1192 # backwards: all parents
1193 # backwards: all parents
1193 if not self.roots:
1194 if not self.roots:
1194 self.roots.update(realparents(self.startrev))
1195 self.roots.update(realparents(self.startrev))
1195 if rev in self.roots:
1196 if rev in self.roots:
1196 self.roots.remove(rev)
1197 self.roots.remove(rev)
1197 self.roots.update(realparents(rev))
1198 self.roots.update(realparents(rev))
1198 return True
1199 return True
1199
1200
1200 return False
1201 return False
1201
1202
1202 # it might be worthwhile to do this in the iterator if the rev range
1203 # it might be worthwhile to do this in the iterator if the rev range
1203 # is descending and the prune args are all within that range
1204 # is descending and the prune args are all within that range
1204 for rev in opts.get('prune', ()):
1205 for rev in opts.get('prune', ()):
1205 rev = repo[rev].rev()
1206 rev = repo[rev].rev()
1206 ff = followfilter()
1207 ff = followfilter()
1207 stop = min(revs[0], revs[-1])
1208 stop = min(revs[0], revs[-1])
1208 for x in xrange(rev, stop - 1, -1):
1209 for x in xrange(rev, stop - 1, -1):
1209 if ff.match(x):
1210 if ff.match(x):
1210 wanted.discard(x)
1211 wanted.discard(x)
1211
1212
1212 # Now that wanted is correctly initialized, we can iterate over the
1213 # Now that wanted is correctly initialized, we can iterate over the
1213 # revision range, yielding only revisions in wanted.
1214 # revision range, yielding only revisions in wanted.
1214 def iterate():
1215 def iterate():
1215 if follow and not match.files():
1216 if follow and not match.files():
1216 ff = followfilter(onlyfirst=opts.get('follow_first'))
1217 ff = followfilter(onlyfirst=opts.get('follow_first'))
1217 def want(rev):
1218 def want(rev):
1218 return ff.match(rev) and rev in wanted
1219 return ff.match(rev) and rev in wanted
1219 else:
1220 else:
1220 def want(rev):
1221 def want(rev):
1221 return rev in wanted
1222 return rev in wanted
1222
1223
1223 for i, window in increasingwindows(0, len(revs)):
1224 for i, window in increasingwindows(0, len(revs)):
1224 nrevs = [rev for rev in revs[i:i + window] if want(rev)]
1225 nrevs = [rev for rev in revs[i:i + window] if want(rev)]
1225 for rev in sorted(nrevs):
1226 for rev in sorted(nrevs):
1226 fns = fncache.get(rev)
1227 fns = fncache.get(rev)
1227 ctx = change(rev)
1228 ctx = change(rev)
1228 if not fns:
1229 if not fns:
1229 def fns_generator():
1230 def fns_generator():
1230 for f in ctx.files():
1231 for f in ctx.files():
1231 if match(f):
1232 if match(f):
1232 yield f
1233 yield f
1233 fns = fns_generator()
1234 fns = fns_generator()
1234 prepare(ctx, fns)
1235 prepare(ctx, fns)
1235 for rev in nrevs:
1236 for rev in nrevs:
1236 yield change(rev)
1237 yield change(rev)
1237 return iterate()
1238 return iterate()
1238
1239
1239 def _makegraphfilematcher(repo, pats, followfirst):
1240 def _makegraphfilematcher(repo, pats, followfirst):
1240 # When displaying a revision with --patch --follow FILE, we have
1241 # When displaying a revision with --patch --follow FILE, we have
1241 # to know which file of the revision must be diffed. With
1242 # to know which file of the revision must be diffed. With
1242 # --follow, we want the names of the ancestors of FILE in the
1243 # --follow, we want the names of the ancestors of FILE in the
1243 # revision, stored in "fcache". "fcache" is populated by
1244 # revision, stored in "fcache". "fcache" is populated by
1244 # reproducing the graph traversal already done by --follow revset
1245 # reproducing the graph traversal already done by --follow revset
1245 # and relating linkrevs to file names (which is not "correct" but
1246 # and relating linkrevs to file names (which is not "correct" but
1246 # good enough).
1247 # good enough).
1247 fcache = {}
1248 fcache = {}
1248 fcacheready = [False]
1249 fcacheready = [False]
1249 pctx = repo['.']
1250 pctx = repo['.']
1250 wctx = repo[None]
1251 wctx = repo[None]
1251
1252
1252 def populate():
1253 def populate():
1253 for fn in pats:
1254 for fn in pats:
1254 for i in ((pctx[fn],), pctx[fn].ancestors(followfirst=followfirst)):
1255 for i in ((pctx[fn],), pctx[fn].ancestors(followfirst=followfirst)):
1255 for c in i:
1256 for c in i:
1256 fcache.setdefault(c.linkrev(), set()).add(c.path())
1257 fcache.setdefault(c.linkrev(), set()).add(c.path())
1257
1258
1258 def filematcher(rev):
1259 def filematcher(rev):
1259 if not fcacheready[0]:
1260 if not fcacheready[0]:
1260 # Lazy initialization
1261 # Lazy initialization
1261 fcacheready[0] = True
1262 fcacheready[0] = True
1262 populate()
1263 populate()
1263 return scmutil.match(wctx, fcache.get(rev, []), default='path')
1264 return scmutil.match(wctx, fcache.get(rev, []), default='path')
1264
1265
1265 return filematcher
1266 return filematcher
1266
1267
1267 def _makegraphlogrevset(repo, pats, opts, revs):
1268 def _makegraphlogrevset(repo, pats, opts, revs):
1268 """Return (expr, filematcher) where expr is a revset string built
1269 """Return (expr, filematcher) where expr is a revset string built
1269 from log options and file patterns or None. If --stat or --patch
1270 from log options and file patterns or None. If --stat or --patch
1270 are not passed filematcher is None. Otherwise it is a callable
1271 are not passed filematcher is None. Otherwise it is a callable
1271 taking a revision number and returning a match objects filtering
1272 taking a revision number and returning a match objects filtering
1272 the files to be detailed when displaying the revision.
1273 the files to be detailed when displaying the revision.
1273 """
1274 """
1274 opt2revset = {
1275 opt2revset = {
1275 'no_merges': ('not merge()', None),
1276 'no_merges': ('not merge()', None),
1276 'only_merges': ('merge()', None),
1277 'only_merges': ('merge()', None),
1277 '_ancestors': ('ancestors(%(val)s)', None),
1278 '_ancestors': ('ancestors(%(val)s)', None),
1278 '_fancestors': ('_firstancestors(%(val)s)', None),
1279 '_fancestors': ('_firstancestors(%(val)s)', None),
1279 '_descendants': ('descendants(%(val)s)', None),
1280 '_descendants': ('descendants(%(val)s)', None),
1280 '_fdescendants': ('_firstdescendants(%(val)s)', None),
1281 '_fdescendants': ('_firstdescendants(%(val)s)', None),
1281 '_matchfiles': ('_matchfiles(%(val)s)', None),
1282 '_matchfiles': ('_matchfiles(%(val)s)', None),
1282 'date': ('date(%(val)r)', None),
1283 'date': ('date(%(val)r)', None),
1283 'branch': ('branch(%(val)r)', ' or '),
1284 'branch': ('branch(%(val)r)', ' or '),
1284 '_patslog': ('filelog(%(val)r)', ' or '),
1285 '_patslog': ('filelog(%(val)r)', ' or '),
1285 '_patsfollow': ('follow(%(val)r)', ' or '),
1286 '_patsfollow': ('follow(%(val)r)', ' or '),
1286 '_patsfollowfirst': ('_followfirst(%(val)r)', ' or '),
1287 '_patsfollowfirst': ('_followfirst(%(val)r)', ' or '),
1287 'keyword': ('keyword(%(val)r)', ' or '),
1288 'keyword': ('keyword(%(val)r)', ' or '),
1288 'prune': ('not (%(val)r or ancestors(%(val)r))', ' and '),
1289 'prune': ('not (%(val)r or ancestors(%(val)r))', ' and '),
1289 'user': ('user(%(val)r)', ' or '),
1290 'user': ('user(%(val)r)', ' or '),
1290 }
1291 }
1291
1292
1292 opts = dict(opts)
1293 opts = dict(opts)
1293 # follow or not follow?
1294 # follow or not follow?
1294 follow = opts.get('follow') or opts.get('follow_first')
1295 follow = opts.get('follow') or opts.get('follow_first')
1295 followfirst = opts.get('follow_first') and 1 or 0
1296 followfirst = opts.get('follow_first') and 1 or 0
1296 # --follow with FILE behaviour depends on revs...
1297 # --follow with FILE behaviour depends on revs...
1297 startrev = revs[0]
1298 startrev = revs[0]
1298 followdescendants = (len(revs) > 1 and revs[0] < revs[1]) and 1 or 0
1299 followdescendants = (len(revs) > 1 and revs[0] < revs[1]) and 1 or 0
1299
1300
1300 # branch and only_branch are really aliases and must be handled at
1301 # branch and only_branch are really aliases and must be handled at
1301 # the same time
1302 # the same time
1302 opts['branch'] = opts.get('branch', []) + opts.get('only_branch', [])
1303 opts['branch'] = opts.get('branch', []) + opts.get('only_branch', [])
1303 opts['branch'] = [repo.lookupbranch(b) for b in opts['branch']]
1304 opts['branch'] = [repo.lookupbranch(b) for b in opts['branch']]
1304 # pats/include/exclude are passed to match.match() directly in
1305 # pats/include/exclude are passed to match.match() directly in
1305 # _matchfiles() revset but walkchangerevs() builds its matcher with
1306 # _matchfiles() revset but walkchangerevs() builds its matcher with
1306 # scmutil.match(). The difference is input pats are globbed on
1307 # scmutil.match(). The difference is input pats are globbed on
1307 # platforms without shell expansion (windows).
1308 # platforms without shell expansion (windows).
1308 pctx = repo[None]
1309 pctx = repo[None]
1309 match, pats = scmutil.matchandpats(pctx, pats, opts)
1310 match, pats = scmutil.matchandpats(pctx, pats, opts)
1310 slowpath = match.anypats() or (match.files() and opts.get('removed'))
1311 slowpath = match.anypats() or (match.files() and opts.get('removed'))
1311 if not slowpath:
1312 if not slowpath:
1312 for f in match.files():
1313 for f in match.files():
1313 if follow and f not in pctx:
1314 if follow and f not in pctx:
1314 raise util.Abort(_('cannot follow file not in parent '
1315 raise util.Abort(_('cannot follow file not in parent '
1315 'revision: "%s"') % f)
1316 'revision: "%s"') % f)
1316 filelog = repo.file(f)
1317 filelog = repo.file(f)
1317 if not len(filelog):
1318 if not len(filelog):
1318 # A zero count may be a directory or deleted file, so
1319 # A zero count may be a directory or deleted file, so
1319 # try to find matching entries on the slow path.
1320 # try to find matching entries on the slow path.
1320 if follow:
1321 if follow:
1321 raise util.Abort(
1322 raise util.Abort(
1322 _('cannot follow nonexistent file: "%s"') % f)
1323 _('cannot follow nonexistent file: "%s"') % f)
1323 slowpath = True
1324 slowpath = True
1324
1325
1325 # We decided to fall back to the slowpath because at least one
1326 # We decided to fall back to the slowpath because at least one
1326 # of the paths was not a file. Check to see if at least one of them
1327 # of the paths was not a file. Check to see if at least one of them
1327 # existed in history - in that case, we'll continue down the
1328 # existed in history - in that case, we'll continue down the
1328 # slowpath; otherwise, we can turn off the slowpath
1329 # slowpath; otherwise, we can turn off the slowpath
1329 if slowpath:
1330 if slowpath:
1330 for path in match.files():
1331 for path in match.files():
1331 if path == '.' or path in repo.store:
1332 if path == '.' or path in repo.store:
1332 break
1333 break
1333 else:
1334 else:
1334 slowpath = False
1335 slowpath = False
1335
1336
1336 if slowpath:
1337 if slowpath:
1337 # See walkchangerevs() slow path.
1338 # See walkchangerevs() slow path.
1338 #
1339 #
1339 if follow:
1340 if follow:
1340 raise util.Abort(_('can only follow copies/renames for explicit '
1341 raise util.Abort(_('can only follow copies/renames for explicit '
1341 'filenames'))
1342 'filenames'))
1342 # pats/include/exclude cannot be represented as separate
1343 # pats/include/exclude cannot be represented as separate
1343 # revset expressions as their filtering logic applies at file
1344 # revset expressions as their filtering logic applies at file
1344 # level. For instance "-I a -X a" matches a revision touching
1345 # level. For instance "-I a -X a" matches a revision touching
1345 # "a" and "b" while "file(a) and not file(b)" does
1346 # "a" and "b" while "file(a) and not file(b)" does
1346 # not. Besides, filesets are evaluated against the working
1347 # not. Besides, filesets are evaluated against the working
1347 # directory.
1348 # directory.
1348 matchargs = ['r:', 'd:relpath']
1349 matchargs = ['r:', 'd:relpath']
1349 for p in pats:
1350 for p in pats:
1350 matchargs.append('p:' + p)
1351 matchargs.append('p:' + p)
1351 for p in opts.get('include', []):
1352 for p in opts.get('include', []):
1352 matchargs.append('i:' + p)
1353 matchargs.append('i:' + p)
1353 for p in opts.get('exclude', []):
1354 for p in opts.get('exclude', []):
1354 matchargs.append('x:' + p)
1355 matchargs.append('x:' + p)
1355 matchargs = ','.join(('%r' % p) for p in matchargs)
1356 matchargs = ','.join(('%r' % p) for p in matchargs)
1356 opts['_matchfiles'] = matchargs
1357 opts['_matchfiles'] = matchargs
1357 else:
1358 else:
1358 if follow:
1359 if follow:
1359 fpats = ('_patsfollow', '_patsfollowfirst')
1360 fpats = ('_patsfollow', '_patsfollowfirst')
1360 fnopats = (('_ancestors', '_fancestors'),
1361 fnopats = (('_ancestors', '_fancestors'),
1361 ('_descendants', '_fdescendants'))
1362 ('_descendants', '_fdescendants'))
1362 if pats:
1363 if pats:
1363 # follow() revset interprets its file argument as a
1364 # follow() revset interprets its file argument as a
1364 # manifest entry, so use match.files(), not pats.
1365 # manifest entry, so use match.files(), not pats.
1365 opts[fpats[followfirst]] = list(match.files())
1366 opts[fpats[followfirst]] = list(match.files())
1366 else:
1367 else:
1367 opts[fnopats[followdescendants][followfirst]] = str(startrev)
1368 opts[fnopats[followdescendants][followfirst]] = str(startrev)
1368 else:
1369 else:
1369 opts['_patslog'] = list(pats)
1370 opts['_patslog'] = list(pats)
1370
1371
1371 filematcher = None
1372 filematcher = None
1372 if opts.get('patch') or opts.get('stat'):
1373 if opts.get('patch') or opts.get('stat'):
1373 if follow:
1374 if follow:
1374 filematcher = _makegraphfilematcher(repo, pats, followfirst)
1375 filematcher = _makegraphfilematcher(repo, pats, followfirst)
1375 else:
1376 else:
1376 filematcher = lambda rev: match
1377 filematcher = lambda rev: match
1377
1378
1378 expr = []
1379 expr = []
1379 for op, val in opts.iteritems():
1380 for op, val in opts.iteritems():
1380 if not val:
1381 if not val:
1381 continue
1382 continue
1382 if op not in opt2revset:
1383 if op not in opt2revset:
1383 continue
1384 continue
1384 revop, andor = opt2revset[op]
1385 revop, andor = opt2revset[op]
1385 if '%(val)' not in revop:
1386 if '%(val)' not in revop:
1386 expr.append(revop)
1387 expr.append(revop)
1387 else:
1388 else:
1388 if not isinstance(val, list):
1389 if not isinstance(val, list):
1389 e = revop % {'val': val}
1390 e = revop % {'val': val}
1390 else:
1391 else:
1391 e = '(' + andor.join((revop % {'val': v}) for v in val) + ')'
1392 e = '(' + andor.join((revop % {'val': v}) for v in val) + ')'
1392 expr.append(e)
1393 expr.append(e)
1393
1394
1394 if expr:
1395 if expr:
1395 expr = '(' + ' and '.join(expr) + ')'
1396 expr = '(' + ' and '.join(expr) + ')'
1396 else:
1397 else:
1397 expr = None
1398 expr = None
1398 return expr, filematcher
1399 return expr, filematcher
1399
1400
1400 def getgraphlogrevs(repo, pats, opts):
1401 def getgraphlogrevs(repo, pats, opts):
1401 """Return (revs, expr, filematcher) where revs is an iterable of
1402 """Return (revs, expr, filematcher) where revs is an iterable of
1402 revision numbers, expr is a revset string built from log options
1403 revision numbers, expr is a revset string built from log options
1403 and file patterns or None, and used to filter 'revs'. If --stat or
1404 and file patterns or None, and used to filter 'revs'. If --stat or
1404 --patch are not passed filematcher is None. Otherwise it is a
1405 --patch are not passed filematcher is None. Otherwise it is a
1405 callable taking a revision number and returning a match objects
1406 callable taking a revision number and returning a match objects
1406 filtering the files to be detailed when displaying the revision.
1407 filtering the files to be detailed when displaying the revision.
1407 """
1408 """
1408 if not len(repo):
1409 if not len(repo):
1409 return [], None, None
1410 return [], None, None
1410 limit = loglimit(opts)
1411 limit = loglimit(opts)
1411 # Default --rev value depends on --follow but --follow behaviour
1412 # Default --rev value depends on --follow but --follow behaviour
1412 # depends on revisions resolved from --rev...
1413 # depends on revisions resolved from --rev...
1413 follow = opts.get('follow') or opts.get('follow_first')
1414 follow = opts.get('follow') or opts.get('follow_first')
1414 possiblyunsorted = False # whether revs might need sorting
1415 possiblyunsorted = False # whether revs might need sorting
1415 if opts.get('rev'):
1416 if opts.get('rev'):
1416 revs = scmutil.revrange(repo, opts['rev'])
1417 revs = scmutil.revrange(repo, opts['rev'])
1417 # Don't sort here because _makegraphlogrevset might depend on the
1418 # Don't sort here because _makegraphlogrevset might depend on the
1418 # order of revs
1419 # order of revs
1419 possiblyunsorted = True
1420 possiblyunsorted = True
1420 else:
1421 else:
1421 if follow and len(repo) > 0:
1422 if follow and len(repo) > 0:
1422 revs = repo.revs('reverse(:.)')
1423 revs = repo.revs('reverse(:.)')
1423 else:
1424 else:
1424 revs = list(repo.changelog)
1425 revs = list(repo.changelog)
1425 revs.reverse()
1426 revs.reverse()
1426 if not revs:
1427 if not revs:
1427 return [], None, None
1428 return [], None, None
1428 expr, filematcher = _makegraphlogrevset(repo, pats, opts, revs)
1429 expr, filematcher = _makegraphlogrevset(repo, pats, opts, revs)
1429 if possiblyunsorted:
1430 if possiblyunsorted:
1430 revs.sort(reverse=True)
1431 revs.sort(reverse=True)
1431 if expr:
1432 if expr:
1432 # Revset matchers often operate faster on revisions in changelog
1433 # Revset matchers often operate faster on revisions in changelog
1433 # order, because most filters deal with the changelog.
1434 # order, because most filters deal with the changelog.
1434 revs.reverse()
1435 revs.reverse()
1435 matcher = revset.match(repo.ui, expr)
1436 matcher = revset.match(repo.ui, expr)
1436 # Revset matches can reorder revisions. "A or B" typically returns
1437 # Revset matches can reorder revisions. "A or B" typically returns
1437 # returns the revision matching A then the revision matching B. Sort
1438 # returns the revision matching A then the revision matching B. Sort
1438 # again to fix that.
1439 # again to fix that.
1439 revs = matcher(repo, revs)
1440 revs = matcher(repo, revs)
1440 revs.sort(reverse=True)
1441 revs.sort(reverse=True)
1441 if limit is not None:
1442 if limit is not None:
1442 revs = revs[:limit]
1443 revs = revs[:limit]
1443
1444
1444 return revs, expr, filematcher
1445 return revs, expr, filematcher
1445
1446
1446 def displaygraph(ui, dag, displayer, showparents, edgefn, getrenamed=None,
1447 def displaygraph(ui, dag, displayer, showparents, edgefn, getrenamed=None,
1447 filematcher=None):
1448 filematcher=None):
1448 seen, state = [], graphmod.asciistate()
1449 seen, state = [], graphmod.asciistate()
1449 for rev, type, ctx, parents in dag:
1450 for rev, type, ctx, parents in dag:
1450 char = 'o'
1451 char = 'o'
1451 if ctx.node() in showparents:
1452 if ctx.node() in showparents:
1452 char = '@'
1453 char = '@'
1453 elif ctx.obsolete():
1454 elif ctx.obsolete():
1454 char = 'x'
1455 char = 'x'
1455 copies = None
1456 copies = None
1456 if getrenamed and ctx.rev():
1457 if getrenamed and ctx.rev():
1457 copies = []
1458 copies = []
1458 for fn in ctx.files():
1459 for fn in ctx.files():
1459 rename = getrenamed(fn, ctx.rev())
1460 rename = getrenamed(fn, ctx.rev())
1460 if rename:
1461 if rename:
1461 copies.append((fn, rename[0]))
1462 copies.append((fn, rename[0]))
1462 revmatchfn = None
1463 revmatchfn = None
1463 if filematcher is not None:
1464 if filematcher is not None:
1464 revmatchfn = filematcher(ctx.rev())
1465 revmatchfn = filematcher(ctx.rev())
1465 displayer.show(ctx, copies=copies, matchfn=revmatchfn)
1466 displayer.show(ctx, copies=copies, matchfn=revmatchfn)
1466 lines = displayer.hunk.pop(rev).split('\n')
1467 lines = displayer.hunk.pop(rev).split('\n')
1467 if not lines[-1]:
1468 if not lines[-1]:
1468 del lines[-1]
1469 del lines[-1]
1469 displayer.flush(rev)
1470 displayer.flush(rev)
1470 edges = edgefn(type, char, lines, seen, rev, parents)
1471 edges = edgefn(type, char, lines, seen, rev, parents)
1471 for type, char, lines, coldata in edges:
1472 for type, char, lines, coldata in edges:
1472 graphmod.ascii(ui, state, type, char, lines, coldata)
1473 graphmod.ascii(ui, state, type, char, lines, coldata)
1473 displayer.close()
1474 displayer.close()
1474
1475
1475 def graphlog(ui, repo, *pats, **opts):
1476 def graphlog(ui, repo, *pats, **opts):
1476 # Parameters are identical to log command ones
1477 # Parameters are identical to log command ones
1477 revs, expr, filematcher = getgraphlogrevs(repo, pats, opts)
1478 revs, expr, filematcher = getgraphlogrevs(repo, pats, opts)
1478 revdag = graphmod.dagwalker(repo, revs)
1479 revdag = graphmod.dagwalker(repo, revs)
1479
1480
1480 getrenamed = None
1481 getrenamed = None
1481 if opts.get('copies'):
1482 if opts.get('copies'):
1482 endrev = None
1483 endrev = None
1483 if opts.get('rev'):
1484 if opts.get('rev'):
1484 endrev = max(scmutil.revrange(repo, opts.get('rev'))) + 1
1485 endrev = max(scmutil.revrange(repo, opts.get('rev'))) + 1
1485 getrenamed = templatekw.getrenamedfn(repo, endrev=endrev)
1486 getrenamed = templatekw.getrenamedfn(repo, endrev=endrev)
1486 displayer = show_changeset(ui, repo, opts, buffered=True)
1487 displayer = show_changeset(ui, repo, opts, buffered=True)
1487 showparents = [ctx.node() for ctx in repo[None].parents()]
1488 showparents = [ctx.node() for ctx in repo[None].parents()]
1488 displaygraph(ui, revdag, displayer, showparents,
1489 displaygraph(ui, revdag, displayer, showparents,
1489 graphmod.asciiedges, getrenamed, filematcher)
1490 graphmod.asciiedges, getrenamed, filematcher)
1490
1491
1491 def checkunsupportedgraphflags(pats, opts):
1492 def checkunsupportedgraphflags(pats, opts):
1492 for op in ["newest_first"]:
1493 for op in ["newest_first"]:
1493 if op in opts and opts[op]:
1494 if op in opts and opts[op]:
1494 raise util.Abort(_("-G/--graph option is incompatible with --%s")
1495 raise util.Abort(_("-G/--graph option is incompatible with --%s")
1495 % op.replace("_", "-"))
1496 % op.replace("_", "-"))
1496
1497
1497 def graphrevs(repo, nodes, opts):
1498 def graphrevs(repo, nodes, opts):
1498 limit = loglimit(opts)
1499 limit = loglimit(opts)
1499 nodes.reverse()
1500 nodes.reverse()
1500 if limit is not None:
1501 if limit is not None:
1501 nodes = nodes[:limit]
1502 nodes = nodes[:limit]
1502 return graphmod.nodes(repo, nodes)
1503 return graphmod.nodes(repo, nodes)
1503
1504
1504 def add(ui, repo, match, dryrun, listsubrepos, prefix, explicitonly):
1505 def add(ui, repo, match, dryrun, listsubrepos, prefix, explicitonly):
1505 join = lambda f: os.path.join(prefix, f)
1506 join = lambda f: os.path.join(prefix, f)
1506 bad = []
1507 bad = []
1507 oldbad = match.bad
1508 oldbad = match.bad
1508 match.bad = lambda x, y: bad.append(x) or oldbad(x, y)
1509 match.bad = lambda x, y: bad.append(x) or oldbad(x, y)
1509 names = []
1510 names = []
1510 wctx = repo[None]
1511 wctx = repo[None]
1511 cca = None
1512 cca = None
1512 abort, warn = scmutil.checkportabilityalert(ui)
1513 abort, warn = scmutil.checkportabilityalert(ui)
1513 if abort or warn:
1514 if abort or warn:
1514 cca = scmutil.casecollisionauditor(ui, abort, repo.dirstate)
1515 cca = scmutil.casecollisionauditor(ui, abort, repo.dirstate)
1515 for f in repo.walk(match):
1516 for f in repo.walk(match):
1516 exact = match.exact(f)
1517 exact = match.exact(f)
1517 if exact or not explicitonly and f not in repo.dirstate:
1518 if exact or not explicitonly and f not in repo.dirstate:
1518 if cca:
1519 if cca:
1519 cca(f)
1520 cca(f)
1520 names.append(f)
1521 names.append(f)
1521 if ui.verbose or not exact:
1522 if ui.verbose or not exact:
1522 ui.status(_('adding %s\n') % match.rel(join(f)))
1523 ui.status(_('adding %s\n') % match.rel(join(f)))
1523
1524
1524 for subpath in sorted(wctx.substate):
1525 for subpath in sorted(wctx.substate):
1525 sub = wctx.sub(subpath)
1526 sub = wctx.sub(subpath)
1526 try:
1527 try:
1527 submatch = matchmod.narrowmatcher(subpath, match)
1528 submatch = matchmod.narrowmatcher(subpath, match)
1528 if listsubrepos:
1529 if listsubrepos:
1529 bad.extend(sub.add(ui, submatch, dryrun, listsubrepos, prefix,
1530 bad.extend(sub.add(ui, submatch, dryrun, listsubrepos, prefix,
1530 False))
1531 False))
1531 else:
1532 else:
1532 bad.extend(sub.add(ui, submatch, dryrun, listsubrepos, prefix,
1533 bad.extend(sub.add(ui, submatch, dryrun, listsubrepos, prefix,
1533 True))
1534 True))
1534 except error.LookupError:
1535 except error.LookupError:
1535 ui.status(_("skipping missing subrepository: %s\n")
1536 ui.status(_("skipping missing subrepository: %s\n")
1536 % join(subpath))
1537 % join(subpath))
1537
1538
1538 if not dryrun:
1539 if not dryrun:
1539 rejected = wctx.add(names, prefix)
1540 rejected = wctx.add(names, prefix)
1540 bad.extend(f for f in rejected if f in match.files())
1541 bad.extend(f for f in rejected if f in match.files())
1541 return bad
1542 return bad
1542
1543
1543 def forget(ui, repo, match, prefix, explicitonly):
1544 def forget(ui, repo, match, prefix, explicitonly):
1544 join = lambda f: os.path.join(prefix, f)
1545 join = lambda f: os.path.join(prefix, f)
1545 bad = []
1546 bad = []
1546 oldbad = match.bad
1547 oldbad = match.bad
1547 match.bad = lambda x, y: bad.append(x) or oldbad(x, y)
1548 match.bad = lambda x, y: bad.append(x) or oldbad(x, y)
1548 wctx = repo[None]
1549 wctx = repo[None]
1549 forgot = []
1550 forgot = []
1550 s = repo.status(match=match, clean=True)
1551 s = repo.status(match=match, clean=True)
1551 forget = sorted(s[0] + s[1] + s[3] + s[6])
1552 forget = sorted(s[0] + s[1] + s[3] + s[6])
1552 if explicitonly:
1553 if explicitonly:
1553 forget = [f for f in forget if match.exact(f)]
1554 forget = [f for f in forget if match.exact(f)]
1554
1555
1555 for subpath in sorted(wctx.substate):
1556 for subpath in sorted(wctx.substate):
1556 sub = wctx.sub(subpath)
1557 sub = wctx.sub(subpath)
1557 try:
1558 try:
1558 submatch = matchmod.narrowmatcher(subpath, match)
1559 submatch = matchmod.narrowmatcher(subpath, match)
1559 subbad, subforgot = sub.forget(ui, submatch, prefix)
1560 subbad, subforgot = sub.forget(ui, submatch, prefix)
1560 bad.extend([subpath + '/' + f for f in subbad])
1561 bad.extend([subpath + '/' + f for f in subbad])
1561 forgot.extend([subpath + '/' + f for f in subforgot])
1562 forgot.extend([subpath + '/' + f for f in subforgot])
1562 except error.LookupError:
1563 except error.LookupError:
1563 ui.status(_("skipping missing subrepository: %s\n")
1564 ui.status(_("skipping missing subrepository: %s\n")
1564 % join(subpath))
1565 % join(subpath))
1565
1566
1566 if not explicitonly:
1567 if not explicitonly:
1567 for f in match.files():
1568 for f in match.files():
1568 if f not in repo.dirstate and not os.path.isdir(match.rel(join(f))):
1569 if f not in repo.dirstate and not os.path.isdir(match.rel(join(f))):
1569 if f not in forgot:
1570 if f not in forgot:
1570 if os.path.exists(match.rel(join(f))):
1571 if os.path.exists(match.rel(join(f))):
1571 ui.warn(_('not removing %s: '
1572 ui.warn(_('not removing %s: '
1572 'file is already untracked\n')
1573 'file is already untracked\n')
1573 % match.rel(join(f)))
1574 % match.rel(join(f)))
1574 bad.append(f)
1575 bad.append(f)
1575
1576
1576 for f in forget:
1577 for f in forget:
1577 if ui.verbose or not match.exact(f):
1578 if ui.verbose or not match.exact(f):
1578 ui.status(_('removing %s\n') % match.rel(join(f)))
1579 ui.status(_('removing %s\n') % match.rel(join(f)))
1579
1580
1580 rejected = wctx.forget(forget, prefix)
1581 rejected = wctx.forget(forget, prefix)
1581 bad.extend(f for f in rejected if f in match.files())
1582 bad.extend(f for f in rejected if f in match.files())
1582 forgot.extend(forget)
1583 forgot.extend(forget)
1583 return bad, forgot
1584 return bad, forgot
1584
1585
1585 def duplicatecopies(repo, rev, p1):
1586 def duplicatecopies(repo, rev, p1):
1586 "Reproduce copies found in the source revision in the dirstate for grafts"
1587 "Reproduce copies found in the source revision in the dirstate for grafts"
1587 for dst, src in copies.pathcopies(repo[p1], repo[rev]).iteritems():
1588 for dst, src in copies.pathcopies(repo[p1], repo[rev]).iteritems():
1588 repo.dirstate.copy(src, dst)
1589 repo.dirstate.copy(src, dst)
1589
1590
1590 def commit(ui, repo, commitfunc, pats, opts):
1591 def commit(ui, repo, commitfunc, pats, opts):
1591 '''commit the specified files or all outstanding changes'''
1592 '''commit the specified files or all outstanding changes'''
1592 date = opts.get('date')
1593 date = opts.get('date')
1593 if date:
1594 if date:
1594 opts['date'] = util.parsedate(date)
1595 opts['date'] = util.parsedate(date)
1595 message = logmessage(ui, opts)
1596 message = logmessage(ui, opts)
1596
1597
1597 # extract addremove carefully -- this function can be called from a command
1598 # extract addremove carefully -- this function can be called from a command
1598 # that doesn't support addremove
1599 # that doesn't support addremove
1599 if opts.get('addremove'):
1600 if opts.get('addremove'):
1600 scmutil.addremove(repo, pats, opts)
1601 scmutil.addremove(repo, pats, opts)
1601
1602
1602 return commitfunc(ui, repo, message,
1603 return commitfunc(ui, repo, message,
1603 scmutil.match(repo[None], pats, opts), opts)
1604 scmutil.match(repo[None], pats, opts), opts)
1604
1605
1605 def amend(ui, repo, commitfunc, old, extra, pats, opts):
1606 def amend(ui, repo, commitfunc, old, extra, pats, opts):
1606 ui.note(_('amending changeset %s\n') % old)
1607 ui.note(_('amending changeset %s\n') % old)
1607 base = old.p1()
1608 base = old.p1()
1608
1609
1609 wlock = lock = newid = None
1610 wlock = lock = newid = None
1610 try:
1611 try:
1611 wlock = repo.wlock()
1612 wlock = repo.wlock()
1612 lock = repo.lock()
1613 lock = repo.lock()
1613 tr = repo.transaction('amend')
1614 tr = repo.transaction('amend')
1614 try:
1615 try:
1615 # See if we got a message from -m or -l, if not, open the editor
1616 # See if we got a message from -m or -l, if not, open the editor
1616 # with the message of the changeset to amend
1617 # with the message of the changeset to amend
1617 message = logmessage(ui, opts)
1618 message = logmessage(ui, opts)
1618 # ensure logfile does not conflict with later enforcement of the
1619 # ensure logfile does not conflict with later enforcement of the
1619 # message. potential logfile content has been processed by
1620 # message. potential logfile content has been processed by
1620 # `logmessage` anyway.
1621 # `logmessage` anyway.
1621 opts.pop('logfile')
1622 opts.pop('logfile')
1622 # First, do a regular commit to record all changes in the working
1623 # First, do a regular commit to record all changes in the working
1623 # directory (if there are any)
1624 # directory (if there are any)
1624 ui.callhooks = False
1625 ui.callhooks = False
1625 currentbookmark = repo._bookmarkcurrent
1626 currentbookmark = repo._bookmarkcurrent
1626 try:
1627 try:
1627 repo._bookmarkcurrent = None
1628 repo._bookmarkcurrent = None
1628 opts['message'] = 'temporary amend commit for %s' % old
1629 opts['message'] = 'temporary amend commit for %s' % old
1629 node = commit(ui, repo, commitfunc, pats, opts)
1630 node = commit(ui, repo, commitfunc, pats, opts)
1630 finally:
1631 finally:
1631 repo._bookmarkcurrent = currentbookmark
1632 repo._bookmarkcurrent = currentbookmark
1632 ui.callhooks = True
1633 ui.callhooks = True
1633 ctx = repo[node]
1634 ctx = repo[node]
1634
1635
1635 # Participating changesets:
1636 # Participating changesets:
1636 #
1637 #
1637 # node/ctx o - new (intermediate) commit that contains changes
1638 # node/ctx o - new (intermediate) commit that contains changes
1638 # | from working dir to go into amending commit
1639 # | from working dir to go into amending commit
1639 # | (or a workingctx if there were no changes)
1640 # | (or a workingctx if there were no changes)
1640 # |
1641 # |
1641 # old o - changeset to amend
1642 # old o - changeset to amend
1642 # |
1643 # |
1643 # base o - parent of amending changeset
1644 # base o - parent of amending changeset
1644
1645
1645 # Update extra dict from amended commit (e.g. to preserve graft
1646 # Update extra dict from amended commit (e.g. to preserve graft
1646 # source)
1647 # source)
1647 extra.update(old.extra())
1648 extra.update(old.extra())
1648
1649
1649 # Also update it from the intermediate commit or from the wctx
1650 # Also update it from the intermediate commit or from the wctx
1650 extra.update(ctx.extra())
1651 extra.update(ctx.extra())
1651
1652
1652 files = set(old.files())
1653 files = set(old.files())
1653
1654
1654 # Second, we use either the commit we just did, or if there were no
1655 # Second, we use either the commit we just did, or if there were no
1655 # changes the parent of the working directory as the version of the
1656 # changes the parent of the working directory as the version of the
1656 # files in the final amend commit
1657 # files in the final amend commit
1657 if node:
1658 if node:
1658 ui.note(_('copying changeset %s to %s\n') % (ctx, base))
1659 ui.note(_('copying changeset %s to %s\n') % (ctx, base))
1659
1660
1660 user = ctx.user()
1661 user = ctx.user()
1661 date = ctx.date()
1662 date = ctx.date()
1662 # Recompute copies (avoid recording a -> b -> a)
1663 # Recompute copies (avoid recording a -> b -> a)
1663 copied = copies.pathcopies(base, ctx)
1664 copied = copies.pathcopies(base, ctx)
1664
1665
1665 # Prune files which were reverted by the updates: if old
1666 # Prune files which were reverted by the updates: if old
1666 # introduced file X and our intermediate commit, node,
1667 # introduced file X and our intermediate commit, node,
1667 # renamed that file, then those two files are the same and
1668 # renamed that file, then those two files are the same and
1668 # we can discard X from our list of files. Likewise if X
1669 # we can discard X from our list of files. Likewise if X
1669 # was deleted, it's no longer relevant
1670 # was deleted, it's no longer relevant
1670 files.update(ctx.files())
1671 files.update(ctx.files())
1671
1672
1672 def samefile(f):
1673 def samefile(f):
1673 if f in ctx.manifest():
1674 if f in ctx.manifest():
1674 a = ctx.filectx(f)
1675 a = ctx.filectx(f)
1675 if f in base.manifest():
1676 if f in base.manifest():
1676 b = base.filectx(f)
1677 b = base.filectx(f)
1677 return (not a.cmp(b)
1678 return (not a.cmp(b)
1678 and a.flags() == b.flags())
1679 and a.flags() == b.flags())
1679 else:
1680 else:
1680 return False
1681 return False
1681 else:
1682 else:
1682 return f not in base.manifest()
1683 return f not in base.manifest()
1683 files = [f for f in files if not samefile(f)]
1684 files = [f for f in files if not samefile(f)]
1684
1685
1685 def filectxfn(repo, ctx_, path):
1686 def filectxfn(repo, ctx_, path):
1686 try:
1687 try:
1687 fctx = ctx[path]
1688 fctx = ctx[path]
1688 flags = fctx.flags()
1689 flags = fctx.flags()
1689 mctx = context.memfilectx(fctx.path(), fctx.data(),
1690 mctx = context.memfilectx(fctx.path(), fctx.data(),
1690 islink='l' in flags,
1691 islink='l' in flags,
1691 isexec='x' in flags,
1692 isexec='x' in flags,
1692 copied=copied.get(path))
1693 copied=copied.get(path))
1693 return mctx
1694 return mctx
1694 except KeyError:
1695 except KeyError:
1695 raise IOError
1696 raise IOError
1696 else:
1697 else:
1697 ui.note(_('copying changeset %s to %s\n') % (old, base))
1698 ui.note(_('copying changeset %s to %s\n') % (old, base))
1698
1699
1699 # Use version of files as in the old cset
1700 # Use version of files as in the old cset
1700 def filectxfn(repo, ctx_, path):
1701 def filectxfn(repo, ctx_, path):
1701 try:
1702 try:
1702 return old.filectx(path)
1703 return old.filectx(path)
1703 except KeyError:
1704 except KeyError:
1704 raise IOError
1705 raise IOError
1705
1706
1706 user = opts.get('user') or old.user()
1707 user = opts.get('user') or old.user()
1707 date = opts.get('date') or old.date()
1708 date = opts.get('date') or old.date()
1708 editmsg = False
1709 editmsg = False
1709 if not message:
1710 if not message:
1710 editmsg = True
1711 editmsg = True
1711 message = old.description()
1712 message = old.description()
1712
1713
1713 pureextra = extra.copy()
1714 pureextra = extra.copy()
1714 extra['amend_source'] = old.hex()
1715 extra['amend_source'] = old.hex()
1715
1716
1716 new = context.memctx(repo,
1717 new = context.memctx(repo,
1717 parents=[base.node(), nullid],
1718 parents=[base.node(), nullid],
1718 text=message,
1719 text=message,
1719 files=files,
1720 files=files,
1720 filectxfn=filectxfn,
1721 filectxfn=filectxfn,
1721 user=user,
1722 user=user,
1722 date=date,
1723 date=date,
1723 extra=extra)
1724 extra=extra)
1724 if editmsg:
1725 if editmsg:
1725 new._text = commitforceeditor(repo, new, [])
1726 new._text = commitforceeditor(repo, new, [])
1726
1727
1727 newdesc = changelog.stripdesc(new.description())
1728 newdesc = changelog.stripdesc(new.description())
1728 if ((not node)
1729 if ((not node)
1729 and newdesc == old.description()
1730 and newdesc == old.description()
1730 and user == old.user()
1731 and user == old.user()
1731 and date == old.date()
1732 and date == old.date()
1732 and pureextra == old.extra()):
1733 and pureextra == old.extra()):
1733 # nothing changed. continuing here would create a new node
1734 # nothing changed. continuing here would create a new node
1734 # anyway because of the amend_source noise.
1735 # anyway because of the amend_source noise.
1735 #
1736 #
1736 # This not what we expect from amend.
1737 # This not what we expect from amend.
1737 return old.node()
1738 return old.node()
1738
1739
1739 ph = repo.ui.config('phases', 'new-commit', phases.draft)
1740 ph = repo.ui.config('phases', 'new-commit', phases.draft)
1740 try:
1741 try:
1741 repo.ui.setconfig('phases', 'new-commit', old.phase())
1742 repo.ui.setconfig('phases', 'new-commit', old.phase())
1742 newid = repo.commitctx(new)
1743 newid = repo.commitctx(new)
1743 finally:
1744 finally:
1744 repo.ui.setconfig('phases', 'new-commit', ph)
1745 repo.ui.setconfig('phases', 'new-commit', ph)
1745 if newid != old.node():
1746 if newid != old.node():
1746 # Reroute the working copy parent to the new changeset
1747 # Reroute the working copy parent to the new changeset
1747 repo.setparents(newid, nullid)
1748 repo.setparents(newid, nullid)
1748
1749
1749 # Move bookmarks from old parent to amend commit
1750 # Move bookmarks from old parent to amend commit
1750 bms = repo.nodebookmarks(old.node())
1751 bms = repo.nodebookmarks(old.node())
1751 if bms:
1752 if bms:
1752 marks = repo._bookmarks
1753 marks = repo._bookmarks
1753 for bm in bms:
1754 for bm in bms:
1754 marks[bm] = newid
1755 marks[bm] = newid
1755 marks.write()
1756 marks.write()
1756 #commit the whole amend process
1757 #commit the whole amend process
1757 if obsolete._enabled and newid != old.node():
1758 if obsolete._enabled and newid != old.node():
1758 # mark the new changeset as successor of the rewritten one
1759 # mark the new changeset as successor of the rewritten one
1759 new = repo[newid]
1760 new = repo[newid]
1760 obs = [(old, (new,))]
1761 obs = [(old, (new,))]
1761 if node:
1762 if node:
1762 obs.append((ctx, ()))
1763 obs.append((ctx, ()))
1763
1764
1764 obsolete.createmarkers(repo, obs)
1765 obsolete.createmarkers(repo, obs)
1765 tr.close()
1766 tr.close()
1766 finally:
1767 finally:
1767 tr.release()
1768 tr.release()
1768 if (not obsolete._enabled) and newid != old.node():
1769 if (not obsolete._enabled) and newid != old.node():
1769 # Strip the intermediate commit (if there was one) and the amended
1770 # Strip the intermediate commit (if there was one) and the amended
1770 # commit
1771 # commit
1771 if node:
1772 if node:
1772 ui.note(_('stripping intermediate changeset %s\n') % ctx)
1773 ui.note(_('stripping intermediate changeset %s\n') % ctx)
1773 ui.note(_('stripping amended changeset %s\n') % old)
1774 ui.note(_('stripping amended changeset %s\n') % old)
1774 repair.strip(ui, repo, old.node(), topic='amend-backup')
1775 repair.strip(ui, repo, old.node(), topic='amend-backup')
1775 finally:
1776 finally:
1776 if newid is None:
1777 if newid is None:
1777 repo.dirstate.invalidate()
1778 repo.dirstate.invalidate()
1778 lockmod.release(wlock, lock)
1779 lockmod.release(wlock, lock)
1779 return newid
1780 return newid
1780
1781
1781 def commiteditor(repo, ctx, subs):
1782 def commiteditor(repo, ctx, subs):
1782 if ctx.description():
1783 if ctx.description():
1783 return ctx.description()
1784 return ctx.description()
1784 return commitforceeditor(repo, ctx, subs)
1785 return commitforceeditor(repo, ctx, subs)
1785
1786
1786 def commitforceeditor(repo, ctx, subs):
1787 def commitforceeditor(repo, ctx, subs):
1787 edittext = []
1788 edittext = []
1788 modified, added, removed = ctx.modified(), ctx.added(), ctx.removed()
1789 modified, added, removed = ctx.modified(), ctx.added(), ctx.removed()
1789 if ctx.description():
1790 if ctx.description():
1790 edittext.append(ctx.description())
1791 edittext.append(ctx.description())
1791 edittext.append("")
1792 edittext.append("")
1792 edittext.append("") # Empty line between message and comments.
1793 edittext.append("") # Empty line between message and comments.
1793 edittext.append(_("HG: Enter commit message."
1794 edittext.append(_("HG: Enter commit message."
1794 " Lines beginning with 'HG:' are removed."))
1795 " Lines beginning with 'HG:' are removed."))
1795 edittext.append(_("HG: Leave message empty to abort commit."))
1796 edittext.append(_("HG: Leave message empty to abort commit."))
1796 edittext.append("HG: --")
1797 edittext.append("HG: --")
1797 edittext.append(_("HG: user: %s") % ctx.user())
1798 edittext.append(_("HG: user: %s") % ctx.user())
1798 if ctx.p2():
1799 if ctx.p2():
1799 edittext.append(_("HG: branch merge"))
1800 edittext.append(_("HG: branch merge"))
1800 if ctx.branch():
1801 if ctx.branch():
1801 edittext.append(_("HG: branch '%s'") % ctx.branch())
1802 edittext.append(_("HG: branch '%s'") % ctx.branch())
1802 if bookmarks.iscurrent(repo):
1803 if bookmarks.iscurrent(repo):
1803 edittext.append(_("HG: bookmark '%s'") % repo._bookmarkcurrent)
1804 edittext.append(_("HG: bookmark '%s'") % repo._bookmarkcurrent)
1804 edittext.extend([_("HG: subrepo %s") % s for s in subs])
1805 edittext.extend([_("HG: subrepo %s") % s for s in subs])
1805 edittext.extend([_("HG: added %s") % f for f in added])
1806 edittext.extend([_("HG: added %s") % f for f in added])
1806 edittext.extend([_("HG: changed %s") % f for f in modified])
1807 edittext.extend([_("HG: changed %s") % f for f in modified])
1807 edittext.extend([_("HG: removed %s") % f for f in removed])
1808 edittext.extend([_("HG: removed %s") % f for f in removed])
1808 if not added and not modified and not removed:
1809 if not added and not modified and not removed:
1809 edittext.append(_("HG: no files changed"))
1810 edittext.append(_("HG: no files changed"))
1810 edittext.append("")
1811 edittext.append("")
1811 # run editor in the repository root
1812 # run editor in the repository root
1812 olddir = os.getcwd()
1813 olddir = os.getcwd()
1813 os.chdir(repo.root)
1814 os.chdir(repo.root)
1814 text = repo.ui.edit("\n".join(edittext), ctx.user())
1815 text = repo.ui.edit("\n".join(edittext), ctx.user())
1815 text = re.sub("(?m)^HG:.*(\n|$)", "", text)
1816 text = re.sub("(?m)^HG:.*(\n|$)", "", text)
1816 os.chdir(olddir)
1817 os.chdir(olddir)
1817
1818
1818 if not text.strip():
1819 if not text.strip():
1819 raise util.Abort(_("empty commit message"))
1820 raise util.Abort(_("empty commit message"))
1820
1821
1821 return text
1822 return text
1822
1823
1823 def revert(ui, repo, ctx, parents, *pats, **opts):
1824 def revert(ui, repo, ctx, parents, *pats, **opts):
1824 parent, p2 = parents
1825 parent, p2 = parents
1825 node = ctx.node()
1826 node = ctx.node()
1826
1827
1827 mf = ctx.manifest()
1828 mf = ctx.manifest()
1828 if node == parent:
1829 if node == parent:
1829 pmf = mf
1830 pmf = mf
1830 else:
1831 else:
1831 pmf = None
1832 pmf = None
1832
1833
1833 # need all matching names in dirstate and manifest of target rev,
1834 # need all matching names in dirstate and manifest of target rev,
1834 # so have to walk both. do not print errors if files exist in one
1835 # so have to walk both. do not print errors if files exist in one
1835 # but not other.
1836 # but not other.
1836
1837
1837 names = {}
1838 names = {}
1838
1839
1839 wlock = repo.wlock()
1840 wlock = repo.wlock()
1840 try:
1841 try:
1841 # walk dirstate.
1842 # walk dirstate.
1842
1843
1843 m = scmutil.match(repo[None], pats, opts)
1844 m = scmutil.match(repo[None], pats, opts)
1844 m.bad = lambda x, y: False
1845 m.bad = lambda x, y: False
1845 for abs in repo.walk(m):
1846 for abs in repo.walk(m):
1846 names[abs] = m.rel(abs), m.exact(abs)
1847 names[abs] = m.rel(abs), m.exact(abs)
1847
1848
1848 # walk target manifest.
1849 # walk target manifest.
1849
1850
1850 def badfn(path, msg):
1851 def badfn(path, msg):
1851 if path in names:
1852 if path in names:
1852 return
1853 return
1853 if path in ctx.substate:
1854 if path in ctx.substate:
1854 return
1855 return
1855 path_ = path + '/'
1856 path_ = path + '/'
1856 for f in names:
1857 for f in names:
1857 if f.startswith(path_):
1858 if f.startswith(path_):
1858 return
1859 return
1859 ui.warn("%s: %s\n" % (m.rel(path), msg))
1860 ui.warn("%s: %s\n" % (m.rel(path), msg))
1860
1861
1861 m = scmutil.match(ctx, pats, opts)
1862 m = scmutil.match(ctx, pats, opts)
1862 m.bad = badfn
1863 m.bad = badfn
1863 for abs in ctx.walk(m):
1864 for abs in ctx.walk(m):
1864 if abs not in names:
1865 if abs not in names:
1865 names[abs] = m.rel(abs), m.exact(abs)
1866 names[abs] = m.rel(abs), m.exact(abs)
1866
1867
1867 # get the list of subrepos that must be reverted
1868 # get the list of subrepos that must be reverted
1868 targetsubs = sorted(s for s in ctx.substate if m(s))
1869 targetsubs = sorted(s for s in ctx.substate if m(s))
1869 m = scmutil.matchfiles(repo, names)
1870 m = scmutil.matchfiles(repo, names)
1870 changes = repo.status(match=m)[:4]
1871 changes = repo.status(match=m)[:4]
1871 modified, added, removed, deleted = map(set, changes)
1872 modified, added, removed, deleted = map(set, changes)
1872
1873
1873 # if f is a rename, also revert the source
1874 # if f is a rename, also revert the source
1874 cwd = repo.getcwd()
1875 cwd = repo.getcwd()
1875 for f in added:
1876 for f in added:
1876 src = repo.dirstate.copied(f)
1877 src = repo.dirstate.copied(f)
1877 if src and src not in names and repo.dirstate[src] == 'r':
1878 if src and src not in names and repo.dirstate[src] == 'r':
1878 removed.add(src)
1879 removed.add(src)
1879 names[src] = (repo.pathto(src, cwd), True)
1880 names[src] = (repo.pathto(src, cwd), True)
1880
1881
1881 def removeforget(abs):
1882 def removeforget(abs):
1882 if repo.dirstate[abs] == 'a':
1883 if repo.dirstate[abs] == 'a':
1883 return _('forgetting %s\n')
1884 return _('forgetting %s\n')
1884 return _('removing %s\n')
1885 return _('removing %s\n')
1885
1886
1886 revert = ([], _('reverting %s\n'))
1887 revert = ([], _('reverting %s\n'))
1887 add = ([], _('adding %s\n'))
1888 add = ([], _('adding %s\n'))
1888 remove = ([], removeforget)
1889 remove = ([], removeforget)
1889 undelete = ([], _('undeleting %s\n'))
1890 undelete = ([], _('undeleting %s\n'))
1890
1891
1891 disptable = (
1892 disptable = (
1892 # dispatch table:
1893 # dispatch table:
1893 # file state
1894 # file state
1894 # action if in target manifest
1895 # action if in target manifest
1895 # action if not in target manifest
1896 # action if not in target manifest
1896 # make backup if in target manifest
1897 # make backup if in target manifest
1897 # make backup if not in target manifest
1898 # make backup if not in target manifest
1898 (modified, revert, remove, True, True),
1899 (modified, revert, remove, True, True),
1899 (added, revert, remove, True, False),
1900 (added, revert, remove, True, False),
1900 (removed, undelete, None, False, False),
1901 (removed, undelete, None, False, False),
1901 (deleted, revert, remove, False, False),
1902 (deleted, revert, remove, False, False),
1902 )
1903 )
1903
1904
1904 for abs, (rel, exact) in sorted(names.items()):
1905 for abs, (rel, exact) in sorted(names.items()):
1905 mfentry = mf.get(abs)
1906 mfentry = mf.get(abs)
1906 target = repo.wjoin(abs)
1907 target = repo.wjoin(abs)
1907 def handle(xlist, dobackup):
1908 def handle(xlist, dobackup):
1908 xlist[0].append(abs)
1909 xlist[0].append(abs)
1909 if (dobackup and not opts.get('no_backup') and
1910 if (dobackup and not opts.get('no_backup') and
1910 os.path.lexists(target)):
1911 os.path.lexists(target)):
1911 bakname = "%s.orig" % rel
1912 bakname = "%s.orig" % rel
1912 ui.note(_('saving current version of %s as %s\n') %
1913 ui.note(_('saving current version of %s as %s\n') %
1913 (rel, bakname))
1914 (rel, bakname))
1914 if not opts.get('dry_run'):
1915 if not opts.get('dry_run'):
1915 util.rename(target, bakname)
1916 util.rename(target, bakname)
1916 if ui.verbose or not exact:
1917 if ui.verbose or not exact:
1917 msg = xlist[1]
1918 msg = xlist[1]
1918 if not isinstance(msg, basestring):
1919 if not isinstance(msg, basestring):
1919 msg = msg(abs)
1920 msg = msg(abs)
1920 ui.status(msg % rel)
1921 ui.status(msg % rel)
1921 for table, hitlist, misslist, backuphit, backupmiss in disptable:
1922 for table, hitlist, misslist, backuphit, backupmiss in disptable:
1922 if abs not in table:
1923 if abs not in table:
1923 continue
1924 continue
1924 # file has changed in dirstate
1925 # file has changed in dirstate
1925 if mfentry:
1926 if mfentry:
1926 handle(hitlist, backuphit)
1927 handle(hitlist, backuphit)
1927 elif misslist is not None:
1928 elif misslist is not None:
1928 handle(misslist, backupmiss)
1929 handle(misslist, backupmiss)
1929 break
1930 break
1930 else:
1931 else:
1931 if abs not in repo.dirstate:
1932 if abs not in repo.dirstate:
1932 if mfentry:
1933 if mfentry:
1933 handle(add, True)
1934 handle(add, True)
1934 elif exact:
1935 elif exact:
1935 ui.warn(_('file not managed: %s\n') % rel)
1936 ui.warn(_('file not managed: %s\n') % rel)
1936 continue
1937 continue
1937 # file has not changed in dirstate
1938 # file has not changed in dirstate
1938 if node == parent:
1939 if node == parent:
1939 if exact:
1940 if exact:
1940 ui.warn(_('no changes needed to %s\n') % rel)
1941 ui.warn(_('no changes needed to %s\n') % rel)
1941 continue
1942 continue
1942 if pmf is None:
1943 if pmf is None:
1943 # only need parent manifest in this unlikely case,
1944 # only need parent manifest in this unlikely case,
1944 # so do not read by default
1945 # so do not read by default
1945 pmf = repo[parent].manifest()
1946 pmf = repo[parent].manifest()
1946 if abs in pmf and mfentry:
1947 if abs in pmf and mfentry:
1947 # if version of file is same in parent and target
1948 # if version of file is same in parent and target
1948 # manifests, do nothing
1949 # manifests, do nothing
1949 if (pmf[abs] != mfentry or
1950 if (pmf[abs] != mfentry or
1950 pmf.flags(abs) != mf.flags(abs)):
1951 pmf.flags(abs) != mf.flags(abs)):
1951 handle(revert, False)
1952 handle(revert, False)
1952 else:
1953 else:
1953 handle(remove, False)
1954 handle(remove, False)
1954
1955
1955 if not opts.get('dry_run'):
1956 if not opts.get('dry_run'):
1956 def checkout(f):
1957 def checkout(f):
1957 fc = ctx[f]
1958 fc = ctx[f]
1958 repo.wwrite(f, fc.data(), fc.flags())
1959 repo.wwrite(f, fc.data(), fc.flags())
1959
1960
1960 audit_path = scmutil.pathauditor(repo.root)
1961 audit_path = scmutil.pathauditor(repo.root)
1961 for f in remove[0]:
1962 for f in remove[0]:
1962 if repo.dirstate[f] == 'a':
1963 if repo.dirstate[f] == 'a':
1963 repo.dirstate.drop(f)
1964 repo.dirstate.drop(f)
1964 continue
1965 continue
1965 audit_path(f)
1966 audit_path(f)
1966 try:
1967 try:
1967 util.unlinkpath(repo.wjoin(f))
1968 util.unlinkpath(repo.wjoin(f))
1968 except OSError:
1969 except OSError:
1969 pass
1970 pass
1970 repo.dirstate.remove(f)
1971 repo.dirstate.remove(f)
1971
1972
1972 normal = None
1973 normal = None
1973 if node == parent:
1974 if node == parent:
1974 # We're reverting to our parent. If possible, we'd like status
1975 # We're reverting to our parent. If possible, we'd like status
1975 # to report the file as clean. We have to use normallookup for
1976 # to report the file as clean. We have to use normallookup for
1976 # merges to avoid losing information about merged/dirty files.
1977 # merges to avoid losing information about merged/dirty files.
1977 if p2 != nullid:
1978 if p2 != nullid:
1978 normal = repo.dirstate.normallookup
1979 normal = repo.dirstate.normallookup
1979 else:
1980 else:
1980 normal = repo.dirstate.normal
1981 normal = repo.dirstate.normal
1981 for f in revert[0]:
1982 for f in revert[0]:
1982 checkout(f)
1983 checkout(f)
1983 if normal:
1984 if normal:
1984 normal(f)
1985 normal(f)
1985
1986
1986 for f in add[0]:
1987 for f in add[0]:
1987 checkout(f)
1988 checkout(f)
1988 repo.dirstate.add(f)
1989 repo.dirstate.add(f)
1989
1990
1990 normal = repo.dirstate.normallookup
1991 normal = repo.dirstate.normallookup
1991 if node == parent and p2 == nullid:
1992 if node == parent and p2 == nullid:
1992 normal = repo.dirstate.normal
1993 normal = repo.dirstate.normal
1993 for f in undelete[0]:
1994 for f in undelete[0]:
1994 checkout(f)
1995 checkout(f)
1995 normal(f)
1996 normal(f)
1996
1997
1997 if targetsubs:
1998 if targetsubs:
1998 # Revert the subrepos on the revert list
1999 # Revert the subrepos on the revert list
1999 for sub in targetsubs:
2000 for sub in targetsubs:
2000 ctx.sub(sub).revert(ui, ctx.substate[sub], *pats, **opts)
2001 ctx.sub(sub).revert(ui, ctx.substate[sub], *pats, **opts)
2001 finally:
2002 finally:
2002 wlock.release()
2003 wlock.release()
2003
2004
2004 def command(table):
2005 def command(table):
2005 '''returns a function object bound to table which can be used as
2006 '''returns a function object bound to table which can be used as
2006 a decorator for populating table as a command table'''
2007 a decorator for populating table as a command table'''
2007
2008
2008 def cmd(name, options=(), synopsis=None):
2009 def cmd(name, options=(), synopsis=None):
2009 def decorator(func):
2010 def decorator(func):
2010 if synopsis:
2011 if synopsis:
2011 table[name] = func, list(options), synopsis
2012 table[name] = func, list(options), synopsis
2012 else:
2013 else:
2013 table[name] = func, list(options)
2014 table[name] = func, list(options)
2014 return func
2015 return func
2015 return decorator
2016 return decorator
2016
2017
2017 return cmd
2018 return cmd
@@ -1,425 +1,426 b''
1 $ HGFOO=BAR; export HGFOO
1 $ HGFOO=BAR; export HGFOO
2 $ cat >> $HGRCPATH <<EOF
2 $ cat >> $HGRCPATH <<EOF
3 > [extensions]
3 > [extensions]
4 > graphlog=
4 > graphlog=
5 >
5 >
6 > [alias]
6 > [alias]
7 > # should clobber ci but not commit (issue2993)
7 > # should clobber ci but not commit (issue2993)
8 > ci = version
8 > ci = version
9 > myinit = init
9 > myinit = init
10 > optionalrepo = showconfig alias.myinit
10 > optionalrepo = showconfig alias.myinit
11 > cleanstatus = status -c
11 > cleanstatus = status -c
12 > unknown = bargle
12 > unknown = bargle
13 > ambiguous = s
13 > ambiguous = s
14 > recursive = recursive
14 > recursive = recursive
15 > nodefinition =
15 > nodefinition =
16 > no--cwd = status --cwd elsewhere
16 > no--cwd = status --cwd elsewhere
17 > no-R = status -R elsewhere
17 > no-R = status -R elsewhere
18 > no--repo = status --repo elsewhere
18 > no--repo = status --repo elsewhere
19 > no--repository = status --repository elsewhere
19 > no--repository = status --repository elsewhere
20 > mylog = log
20 > mylog = log
21 > lognull = log -r null
21 > lognull = log -r null
22 > shortlog = log --template '{rev} {node|short} | {date|isodate}\n'
22 > shortlog = log --template '{rev} {node|short} | {date|isodate}\n'
23 > positional = log --template '{\$2} {\$1} | {date|isodate}\n'
23 > positional = log --template '{\$2} {\$1} | {date|isodate}\n'
24 > dln = lognull --debug
24 > dln = lognull --debug
25 > nousage = rollback
25 > nousage = rollback
26 > put = export -r 0 -o "\$FOO/%R.diff"
26 > put = export -r 0 -o "\$FOO/%R.diff"
27 > blank = !printf '\n'
27 > blank = !printf '\n'
28 > self = !printf '\$0\n'
28 > self = !printf '\$0\n'
29 > echoall = !printf '\$@\n'
29 > echoall = !printf '\$@\n'
30 > echo1 = !printf '\$1\n'
30 > echo1 = !printf '\$1\n'
31 > echo2 = !printf '\$2\n'
31 > echo2 = !printf '\$2\n'
32 > echo13 = !printf '\$1 \$3\n'
32 > echo13 = !printf '\$1 \$3\n'
33 > count = !hg log -r "\$@" --template=. | wc -c | sed -e 's/ //g'
33 > count = !hg log -r "\$@" --template=. | wc -c | sed -e 's/ //g'
34 > mcount = !hg log \$@ --template=. | wc -c | sed -e 's/ //g'
34 > mcount = !hg log \$@ --template=. | wc -c | sed -e 's/ //g'
35 > rt = root
35 > rt = root
36 > tglog = glog --template "{rev}:{node|short}: '{desc}' {branches}\n"
36 > tglog = glog --template "{rev}:{node|short}: '{desc}' {branches}\n"
37 > idalias = id
37 > idalias = id
38 > idaliaslong = id
38 > idaliaslong = id
39 > idaliasshell = !echo test
39 > idaliasshell = !echo test
40 > parentsshell1 = !echo one
40 > parentsshell1 = !echo one
41 > parentsshell2 = !echo two
41 > parentsshell2 = !echo two
42 > escaped1 = !printf 'test\$\$test\n'
42 > escaped1 = !printf 'test\$\$test\n'
43 > escaped2 = !sh -c 'echo "HGFOO is \$\$HGFOO"'
43 > escaped2 = !sh -c 'echo "HGFOO is \$\$HGFOO"'
44 > escaped3 = !sh -c 'echo "\$1 is \$\$\$1"'
44 > escaped3 = !sh -c 'echo "\$1 is \$\$\$1"'
45 > escaped4 = !printf '\$\$0 \$\$@\n'
45 > escaped4 = !printf '\$\$0 \$\$@\n'
46 >
46 >
47 > [defaults]
47 > [defaults]
48 > mylog = -q
48 > mylog = -q
49 > lognull = -q
49 > lognull = -q
50 > log = -v
50 > log = -v
51 > EOF
51 > EOF
52
52
53
53
54 basic
54 basic
55
55
56 $ hg myinit alias
56 $ hg myinit alias
57
57
58
58
59 unknown
59 unknown
60
60
61 $ hg unknown
61 $ hg unknown
62 alias 'unknown' resolves to unknown command 'bargle'
62 alias 'unknown' resolves to unknown command 'bargle'
63 $ hg help unknown
63 $ hg help unknown
64 alias 'unknown' resolves to unknown command 'bargle'
64 alias 'unknown' resolves to unknown command 'bargle'
65
65
66
66
67 ambiguous
67 ambiguous
68
68
69 $ hg ambiguous
69 $ hg ambiguous
70 alias 'ambiguous' resolves to ambiguous command 's'
70 alias 'ambiguous' resolves to ambiguous command 's'
71 $ hg help ambiguous
71 $ hg help ambiguous
72 alias 'ambiguous' resolves to ambiguous command 's'
72 alias 'ambiguous' resolves to ambiguous command 's'
73
73
74
74
75 recursive
75 recursive
76
76
77 $ hg recursive
77 $ hg recursive
78 alias 'recursive' resolves to unknown command 'recursive'
78 alias 'recursive' resolves to unknown command 'recursive'
79 $ hg help recursive
79 $ hg help recursive
80 alias 'recursive' resolves to unknown command 'recursive'
80 alias 'recursive' resolves to unknown command 'recursive'
81
81
82
82
83 no definition
83 no definition
84
84
85 $ hg nodef
85 $ hg nodef
86 no definition for alias 'nodefinition'
86 no definition for alias 'nodefinition'
87 $ hg help nodef
87 $ hg help nodef
88 no definition for alias 'nodefinition'
88 no definition for alias 'nodefinition'
89
89
90
90
91 invalid options
91 invalid options
92
92
93 $ hg no--cwd
93 $ hg no--cwd
94 error in definition for alias 'no--cwd': --cwd may only be given on the command line
94 error in definition for alias 'no--cwd': --cwd may only be given on the command line
95 $ hg help no--cwd
95 $ hg help no--cwd
96 error in definition for alias 'no--cwd': --cwd may only be given on the command line
96 error in definition for alias 'no--cwd': --cwd may only be given on the command line
97 $ hg no-R
97 $ hg no-R
98 error in definition for alias 'no-R': -R may only be given on the command line
98 error in definition for alias 'no-R': -R may only be given on the command line
99 $ hg help no-R
99 $ hg help no-R
100 error in definition for alias 'no-R': -R may only be given on the command line
100 error in definition for alias 'no-R': -R may only be given on the command line
101 $ hg no--repo
101 $ hg no--repo
102 error in definition for alias 'no--repo': --repo may only be given on the command line
102 error in definition for alias 'no--repo': --repo may only be given on the command line
103 $ hg help no--repo
103 $ hg help no--repo
104 error in definition for alias 'no--repo': --repo may only be given on the command line
104 error in definition for alias 'no--repo': --repo may only be given on the command line
105 $ hg no--repository
105 $ hg no--repository
106 error in definition for alias 'no--repository': --repository may only be given on the command line
106 error in definition for alias 'no--repository': --repository may only be given on the command line
107 $ hg help no--repository
107 $ hg help no--repository
108 error in definition for alias 'no--repository': --repository may only be given on the command line
108 error in definition for alias 'no--repository': --repository may only be given on the command line
109
109
110 optional repository
110 optional repository
111
111
112 #if no-outer-repo
112 #if no-outer-repo
113 $ hg optionalrepo
113 $ hg optionalrepo
114 init
114 init
115 #endif
115 #endif
116 $ cd alias
116 $ cd alias
117 $ cat > .hg/hgrc <<EOF
117 $ cat > .hg/hgrc <<EOF
118 > [alias]
118 > [alias]
119 > myinit = init -q
119 > myinit = init -q
120 > EOF
120 > EOF
121 $ hg optionalrepo
121 $ hg optionalrepo
122 init -q
122 init -q
123
123
124 no usage
124 no usage
125
125
126 $ hg nousage
126 $ hg nousage
127 no rollback information available
127 no rollback information available
128
128
129 $ echo foo > foo
129 $ echo foo > foo
130 $ hg commit -Amfoo
130 $ hg commit -Amfoo
131 adding foo
131 adding foo
132
132
133
133
134 with opts
134 with opts
135
135
136 $ hg cleanst
136 $ hg cleanst
137 C foo
137 C foo
138
138
139
139
140 with opts and whitespace
140 with opts and whitespace
141
141
142 $ hg shortlog
142 $ hg shortlog
143 0 e63c23eaa88a | 1970-01-01 00:00 +0000
143 0 e63c23eaa88a | 1970-01-01 00:00 +0000
144
144
145 positional arguments
145 positional arguments
146
146
147 $ hg positional
147 $ hg positional
148 abort: too few arguments for command alias
148 abort: too few arguments for command alias
149 [255]
149 [255]
150 $ hg positional a
150 $ hg positional a
151 abort: too few arguments for command alias
151 abort: too few arguments for command alias
152 [255]
152 [255]
153 $ hg positional 'node|short' rev
153 $ hg positional 'node|short' rev
154 0 e63c23eaa88a | 1970-01-01 00:00 +0000
154 0 e63c23eaa88a | 1970-01-01 00:00 +0000
155
155
156 interaction with defaults
156 interaction with defaults
157
157
158 $ hg mylog
158 $ hg mylog
159 0:e63c23eaa88a
159 0:e63c23eaa88a
160 $ hg lognull
160 $ hg lognull
161 -1:000000000000
161 -1:000000000000
162
162
163
163
164 properly recursive
164 properly recursive
165
165
166 $ hg dln
166 $ hg dln
167 changeset: -1:0000000000000000000000000000000000000000
167 changeset: -1:0000000000000000000000000000000000000000
168 parent: -1:0000000000000000000000000000000000000000
168 parent: -1:0000000000000000000000000000000000000000
169 parent: -1:0000000000000000000000000000000000000000
169 parent: -1:0000000000000000000000000000000000000000
170 manifest: -1:0000000000000000000000000000000000000000
170 manifest: -1:0000000000000000000000000000000000000000
171 user:
171 user:
172 date: Thu Jan 01 00:00:00 1970 +0000
172 date: Thu Jan 01 00:00:00 1970 +0000
173 extra: branch=default
173 extra: branch=default
174
174
175
175
176
176
177 path expanding
177 path expanding
178
178
179 $ FOO=`pwd` hg put
179 $ FOO=`pwd` hg put
180 $ cat 0.diff
180 $ cat 0.diff
181 # HG changeset patch
181 # HG changeset patch
182 # User test
182 # User test
183 # Date 0 0
183 # Date 0 0
184 # Thu Jan 01 00:00:00 1970 +0000
184 # Node ID e63c23eaa88ae77967edcf4ea194d31167c478b0
185 # Node ID e63c23eaa88ae77967edcf4ea194d31167c478b0
185 # Parent 0000000000000000000000000000000000000000
186 # Parent 0000000000000000000000000000000000000000
186 foo
187 foo
187
188
188 diff -r 000000000000 -r e63c23eaa88a foo
189 diff -r 000000000000 -r e63c23eaa88a foo
189 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
190 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
190 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
191 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
191 @@ -0,0 +1,1 @@
192 @@ -0,0 +1,1 @@
192 +foo
193 +foo
193
194
194
195
195 simple shell aliases
196 simple shell aliases
196
197
197 $ hg blank
198 $ hg blank
198
199
199 $ hg blank foo
200 $ hg blank foo
200
201
201 $ hg self
202 $ hg self
202 self
203 self
203 $ hg echoall
204 $ hg echoall
204
205
205 $ hg echoall foo
206 $ hg echoall foo
206 foo
207 foo
207 $ hg echoall 'test $2' foo
208 $ hg echoall 'test $2' foo
208 test $2 foo
209 test $2 foo
209 $ hg echo1 foo bar baz
210 $ hg echo1 foo bar baz
210 foo
211 foo
211 $ hg echo2 foo bar baz
212 $ hg echo2 foo bar baz
212 bar
213 bar
213 $ hg echo13 foo bar baz test
214 $ hg echo13 foo bar baz test
214 foo baz
215 foo baz
215 $ hg echo2 foo
216 $ hg echo2 foo
216
217
217 $ echo bar > bar
218 $ echo bar > bar
218 $ hg commit -qA -m bar
219 $ hg commit -qA -m bar
219 $ hg count .
220 $ hg count .
220 1
221 1
221 $ hg count 'branch(default)'
222 $ hg count 'branch(default)'
222 2
223 2
223 $ hg mcount -r '"branch(default)"'
224 $ hg mcount -r '"branch(default)"'
224 2
225 2
225
226
226 $ hg tglog
227 $ hg tglog
227 @ 1:7e7f92de180e: 'bar'
228 @ 1:042423737847: 'bar'
228 |
229 |
229 o 0:e63c23eaa88a: 'foo'
230 o 0:e63c23eaa88a: 'foo'
230
231
231
232
232
233
233 shadowing
234 shadowing
234
235
235 $ hg i
236 $ hg i
236 hg: command 'i' is ambiguous:
237 hg: command 'i' is ambiguous:
237 idalias idaliaslong idaliasshell identify import incoming init
238 idalias idaliaslong idaliasshell identify import incoming init
238 [255]
239 [255]
239 $ hg id
240 $ hg id
240 7e7f92de180e tip
241 042423737847 tip
241 $ hg ida
242 $ hg ida
242 hg: command 'ida' is ambiguous:
243 hg: command 'ida' is ambiguous:
243 idalias idaliaslong idaliasshell
244 idalias idaliaslong idaliasshell
244 [255]
245 [255]
245 $ hg idalias
246 $ hg idalias
246 7e7f92de180e tip
247 042423737847 tip
247 $ hg idaliasl
248 $ hg idaliasl
248 7e7f92de180e tip
249 042423737847 tip
249 $ hg idaliass
250 $ hg idaliass
250 test
251 test
251 $ hg parentsshell
252 $ hg parentsshell
252 hg: command 'parentsshell' is ambiguous:
253 hg: command 'parentsshell' is ambiguous:
253 parentsshell1 parentsshell2
254 parentsshell1 parentsshell2
254 [255]
255 [255]
255 $ hg parentsshell1
256 $ hg parentsshell1
256 one
257 one
257 $ hg parentsshell2
258 $ hg parentsshell2
258 two
259 two
259
260
260
261
261 shell aliases with global options
262 shell aliases with global options
262
263
263 $ hg init sub
264 $ hg init sub
264 $ cd sub
265 $ cd sub
265 $ hg count 'branch(default)'
266 $ hg count 'branch(default)'
266 0
267 0
267 $ hg -v count 'branch(default)'
268 $ hg -v count 'branch(default)'
268 0
269 0
269 $ hg -R .. count 'branch(default)'
270 $ hg -R .. count 'branch(default)'
270 0
271 0
271 $ hg --cwd .. count 'branch(default)'
272 $ hg --cwd .. count 'branch(default)'
272 2
273 2
273 $ hg echoall --cwd ..
274 $ hg echoall --cwd ..
274
275
275
276
276
277
277 repo specific shell aliases
278 repo specific shell aliases
278
279
279 $ cat >> .hg/hgrc <<EOF
280 $ cat >> .hg/hgrc <<EOF
280 > [alias]
281 > [alias]
281 > subalias = !echo sub
282 > subalias = !echo sub
282 > EOF
283 > EOF
283 $ cat >> ../.hg/hgrc <<EOF
284 $ cat >> ../.hg/hgrc <<EOF
284 > [alias]
285 > [alias]
285 > mainalias = !echo main
286 > mainalias = !echo main
286 > EOF
287 > EOF
287
288
288
289
289 shell alias defined in current repo
290 shell alias defined in current repo
290
291
291 $ hg subalias
292 $ hg subalias
292 sub
293 sub
293 $ hg --cwd .. subalias > /dev/null
294 $ hg --cwd .. subalias > /dev/null
294 hg: unknown command 'subalias'
295 hg: unknown command 'subalias'
295 [255]
296 [255]
296 $ hg -R .. subalias > /dev/null
297 $ hg -R .. subalias > /dev/null
297 hg: unknown command 'subalias'
298 hg: unknown command 'subalias'
298 [255]
299 [255]
299
300
300
301
301 shell alias defined in other repo
302 shell alias defined in other repo
302
303
303 $ hg mainalias > /dev/null
304 $ hg mainalias > /dev/null
304 hg: unknown command 'mainalias'
305 hg: unknown command 'mainalias'
305 [255]
306 [255]
306 $ hg -R .. mainalias
307 $ hg -R .. mainalias
307 main
308 main
308 $ hg --cwd .. mainalias
309 $ hg --cwd .. mainalias
309 main
310 main
310
311
311
312
312 shell aliases with escaped $ chars
313 shell aliases with escaped $ chars
313
314
314 $ hg escaped1
315 $ hg escaped1
315 test$test
316 test$test
316 $ hg escaped2
317 $ hg escaped2
317 HGFOO is BAR
318 HGFOO is BAR
318 $ hg escaped3 HGFOO
319 $ hg escaped3 HGFOO
319 HGFOO is BAR
320 HGFOO is BAR
320 $ hg escaped4 test
321 $ hg escaped4 test
321 $0 $@
322 $0 $@
322
323
323
324
324 invalid arguments
325 invalid arguments
325
326
326 $ hg rt foo
327 $ hg rt foo
327 hg rt: invalid arguments
328 hg rt: invalid arguments
328 hg rt
329 hg rt
329
330
330 alias for: hg root
331 alias for: hg root
331
332
332 use "hg help rt" to show the full help text
333 use "hg help rt" to show the full help text
333 [255]
334 [255]
334
335
335 invalid global arguments for normal commands, aliases, and shell aliases
336 invalid global arguments for normal commands, aliases, and shell aliases
336
337
337 $ hg --invalid root
338 $ hg --invalid root
338 hg: option --invalid not recognized
339 hg: option --invalid not recognized
339 Mercurial Distributed SCM
340 Mercurial Distributed SCM
340
341
341 basic commands:
342 basic commands:
342
343
343 add add the specified files on the next commit
344 add add the specified files on the next commit
344 annotate show changeset information by line for each file
345 annotate show changeset information by line for each file
345 clone make a copy of an existing repository
346 clone make a copy of an existing repository
346 commit commit the specified files or all outstanding changes
347 commit commit the specified files or all outstanding changes
347 diff diff repository (or selected files)
348 diff diff repository (or selected files)
348 export dump the header and diffs for one or more changesets
349 export dump the header and diffs for one or more changesets
349 forget forget the specified files on the next commit
350 forget forget the specified files on the next commit
350 init create a new repository in the given directory
351 init create a new repository in the given directory
351 log show revision history of entire repository or files
352 log show revision history of entire repository or files
352 merge merge working directory with another revision
353 merge merge working directory with another revision
353 pull pull changes from the specified source
354 pull pull changes from the specified source
354 push push changes to the specified destination
355 push push changes to the specified destination
355 remove remove the specified files on the next commit
356 remove remove the specified files on the next commit
356 serve start stand-alone webserver
357 serve start stand-alone webserver
357 status show changed files in the working directory
358 status show changed files in the working directory
358 summary summarize working directory state
359 summary summarize working directory state
359 update update working directory (or switch revisions)
360 update update working directory (or switch revisions)
360
361
361 use "hg help" for the full list of commands or "hg -v" for details
362 use "hg help" for the full list of commands or "hg -v" for details
362 [255]
363 [255]
363 $ hg --invalid mylog
364 $ hg --invalid mylog
364 hg: option --invalid not recognized
365 hg: option --invalid not recognized
365 Mercurial Distributed SCM
366 Mercurial Distributed SCM
366
367
367 basic commands:
368 basic commands:
368
369
369 add add the specified files on the next commit
370 add add the specified files on the next commit
370 annotate show changeset information by line for each file
371 annotate show changeset information by line for each file
371 clone make a copy of an existing repository
372 clone make a copy of an existing repository
372 commit commit the specified files or all outstanding changes
373 commit commit the specified files or all outstanding changes
373 diff diff repository (or selected files)
374 diff diff repository (or selected files)
374 export dump the header and diffs for one or more changesets
375 export dump the header and diffs for one or more changesets
375 forget forget the specified files on the next commit
376 forget forget the specified files on the next commit
376 init create a new repository in the given directory
377 init create a new repository in the given directory
377 log show revision history of entire repository or files
378 log show revision history of entire repository or files
378 merge merge working directory with another revision
379 merge merge working directory with another revision
379 pull pull changes from the specified source
380 pull pull changes from the specified source
380 push push changes to the specified destination
381 push push changes to the specified destination
381 remove remove the specified files on the next commit
382 remove remove the specified files on the next commit
382 serve start stand-alone webserver
383 serve start stand-alone webserver
383 status show changed files in the working directory
384 status show changed files in the working directory
384 summary summarize working directory state
385 summary summarize working directory state
385 update update working directory (or switch revisions)
386 update update working directory (or switch revisions)
386
387
387 use "hg help" for the full list of commands or "hg -v" for details
388 use "hg help" for the full list of commands or "hg -v" for details
388 [255]
389 [255]
389 $ hg --invalid blank
390 $ hg --invalid blank
390 hg: option --invalid not recognized
391 hg: option --invalid not recognized
391 Mercurial Distributed SCM
392 Mercurial Distributed SCM
392
393
393 basic commands:
394 basic commands:
394
395
395 add add the specified files on the next commit
396 add add the specified files on the next commit
396 annotate show changeset information by line for each file
397 annotate show changeset information by line for each file
397 clone make a copy of an existing repository
398 clone make a copy of an existing repository
398 commit commit the specified files or all outstanding changes
399 commit commit the specified files or all outstanding changes
399 diff diff repository (or selected files)
400 diff diff repository (or selected files)
400 export dump the header and diffs for one or more changesets
401 export dump the header and diffs for one or more changesets
401 forget forget the specified files on the next commit
402 forget forget the specified files on the next commit
402 init create a new repository in the given directory
403 init create a new repository in the given directory
403 log show revision history of entire repository or files
404 log show revision history of entire repository or files
404 merge merge working directory with another revision
405 merge merge working directory with another revision
405 pull pull changes from the specified source
406 pull pull changes from the specified source
406 push push changes to the specified destination
407 push push changes to the specified destination
407 remove remove the specified files on the next commit
408 remove remove the specified files on the next commit
408 serve start stand-alone webserver
409 serve start stand-alone webserver
409 status show changed files in the working directory
410 status show changed files in the working directory
410 summary summarize working directory state
411 summary summarize working directory state
411 update update working directory (or switch revisions)
412 update update working directory (or switch revisions)
412
413
413 use "hg help" for the full list of commands or "hg -v" for details
414 use "hg help" for the full list of commands or "hg -v" for details
414 [255]
415 [255]
415
416
416 This should show id:
417 This should show id:
417
418
418 $ hg --config alias.log='id' log
419 $ hg --config alias.log='id' log
419 000000000000 tip
420 000000000000 tip
420
421
421 This shouldn't:
422 This shouldn't:
422
423
423 $ hg --config alias.log='id' history
424 $ hg --config alias.log='id' history
424
425
425 $ cd ../..
426 $ cd ../..
@@ -1,186 +1,188 b''
1 $ hg init repo
1 $ hg init repo
2 $ cd repo
2 $ cd repo
3 $ touch foo
3 $ touch foo
4 $ hg add foo
4 $ hg add foo
5 $ for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
5 $ for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
6 > echo "foo-$i" >> foo
6 > echo "foo-$i" >> foo
7 > hg ci -m "foo-$i"
7 > hg ci -m "foo-$i"
8 > done
8 > done
9
9
10 $ for out in "%nof%N" "%%%H" "%b-%R" "%h" "%r" "%m"; do
10 $ for out in "%nof%N" "%%%H" "%b-%R" "%h" "%r" "%m"; do
11 > echo
11 > echo
12 > echo "# foo-$out.patch"
12 > echo "# foo-$out.patch"
13 > hg export -v -o "foo-$out.patch" 2:tip
13 > hg export -v -o "foo-$out.patch" 2:tip
14 > done
14 > done
15
15
16 # foo-%nof%N.patch
16 # foo-%nof%N.patch
17 exporting patches:
17 exporting patches:
18 foo-01of10.patch
18 foo-01of10.patch
19 foo-02of10.patch
19 foo-02of10.patch
20 foo-03of10.patch
20 foo-03of10.patch
21 foo-04of10.patch
21 foo-04of10.patch
22 foo-05of10.patch
22 foo-05of10.patch
23 foo-06of10.patch
23 foo-06of10.patch
24 foo-07of10.patch
24 foo-07of10.patch
25 foo-08of10.patch
25 foo-08of10.patch
26 foo-09of10.patch
26 foo-09of10.patch
27 foo-10of10.patch
27 foo-10of10.patch
28
28
29 # foo-%%%H.patch
29 # foo-%%%H.patch
30 exporting patches:
30 exporting patches:
31 foo-%617188a1c80f869a7b66c85134da88a6fb145f67.patch
31 foo-%617188a1c80f869a7b66c85134da88a6fb145f67.patch
32 foo-%dd41a5ff707a5225204105611ba49cc5c229d55f.patch
32 foo-%dd41a5ff707a5225204105611ba49cc5c229d55f.patch
33 foo-%f95a5410f8664b6e1490a4af654e4b7d41a7b321.patch
33 foo-%f95a5410f8664b6e1490a4af654e4b7d41a7b321.patch
34 foo-%4346bcfde53b4d9042489078bcfa9c3e28201db2.patch
34 foo-%4346bcfde53b4d9042489078bcfa9c3e28201db2.patch
35 foo-%afda8c3a009cc99449a05ad8aa4655648c4ecd34.patch
35 foo-%afda8c3a009cc99449a05ad8aa4655648c4ecd34.patch
36 foo-%35284ce2b6b99c9d2ac66268fe99e68e1974e1aa.patch
36 foo-%35284ce2b6b99c9d2ac66268fe99e68e1974e1aa.patch
37 foo-%9688c41894e6931305fa7165a37f6568050b4e9b.patch
37 foo-%9688c41894e6931305fa7165a37f6568050b4e9b.patch
38 foo-%747d3c68f8ec44bb35816bfcd59aeb50b9654c2f.patch
38 foo-%747d3c68f8ec44bb35816bfcd59aeb50b9654c2f.patch
39 foo-%5f17a83f5fbd9414006a5e563eab4c8a00729efd.patch
39 foo-%5f17a83f5fbd9414006a5e563eab4c8a00729efd.patch
40 foo-%f3acbafac161ec68f1598af38f794f28847ca5d3.patch
40 foo-%f3acbafac161ec68f1598af38f794f28847ca5d3.patch
41
41
42 # foo-%b-%R.patch
42 # foo-%b-%R.patch
43 exporting patches:
43 exporting patches:
44 foo-repo-2.patch
44 foo-repo-2.patch
45 foo-repo-3.patch
45 foo-repo-3.patch
46 foo-repo-4.patch
46 foo-repo-4.patch
47 foo-repo-5.patch
47 foo-repo-5.patch
48 foo-repo-6.patch
48 foo-repo-6.patch
49 foo-repo-7.patch
49 foo-repo-7.patch
50 foo-repo-8.patch
50 foo-repo-8.patch
51 foo-repo-9.patch
51 foo-repo-9.patch
52 foo-repo-10.patch
52 foo-repo-10.patch
53 foo-repo-11.patch
53 foo-repo-11.patch
54
54
55 # foo-%h.patch
55 # foo-%h.patch
56 exporting patches:
56 exporting patches:
57 foo-617188a1c80f.patch
57 foo-617188a1c80f.patch
58 foo-dd41a5ff707a.patch
58 foo-dd41a5ff707a.patch
59 foo-f95a5410f866.patch
59 foo-f95a5410f866.patch
60 foo-4346bcfde53b.patch
60 foo-4346bcfde53b.patch
61 foo-afda8c3a009c.patch
61 foo-afda8c3a009c.patch
62 foo-35284ce2b6b9.patch
62 foo-35284ce2b6b9.patch
63 foo-9688c41894e6.patch
63 foo-9688c41894e6.patch
64 foo-747d3c68f8ec.patch
64 foo-747d3c68f8ec.patch
65 foo-5f17a83f5fbd.patch
65 foo-5f17a83f5fbd.patch
66 foo-f3acbafac161.patch
66 foo-f3acbafac161.patch
67
67
68 # foo-%r.patch
68 # foo-%r.patch
69 exporting patches:
69 exporting patches:
70 foo-02.patch
70 foo-02.patch
71 foo-03.patch
71 foo-03.patch
72 foo-04.patch
72 foo-04.patch
73 foo-05.patch
73 foo-05.patch
74 foo-06.patch
74 foo-06.patch
75 foo-07.patch
75 foo-07.patch
76 foo-08.patch
76 foo-08.patch
77 foo-09.patch
77 foo-09.patch
78 foo-10.patch
78 foo-10.patch
79 foo-11.patch
79 foo-11.patch
80
80
81 # foo-%m.patch
81 # foo-%m.patch
82 exporting patches:
82 exporting patches:
83 foo-foo_2.patch
83 foo-foo_2.patch
84 foo-foo_3.patch
84 foo-foo_3.patch
85 foo-foo_4.patch
85 foo-foo_4.patch
86 foo-foo_5.patch
86 foo-foo_5.patch
87 foo-foo_6.patch
87 foo-foo_6.patch
88 foo-foo_7.patch
88 foo-foo_7.patch
89 foo-foo_8.patch
89 foo-foo_8.patch
90 foo-foo_9.patch
90 foo-foo_9.patch
91 foo-foo_10.patch
91 foo-foo_10.patch
92 foo-foo_11.patch
92 foo-foo_11.patch
93
93
94 Doing it again clobbers the files rather than appending:
94 Doing it again clobbers the files rather than appending:
95 $ hg export -v -o "foo-%m.patch" 2:3
95 $ hg export -v -o "foo-%m.patch" 2:3
96 exporting patches:
96 exporting patches:
97 foo-foo_2.patch
97 foo-foo_2.patch
98 foo-foo_3.patch
98 foo-foo_3.patch
99 $ grep HG foo-foo_2.patch | wc -l
99 $ grep HG foo-foo_2.patch | wc -l
100 \s*1 (re)
100 \s*1 (re)
101 $ grep HG foo-foo_3.patch | wc -l
101 $ grep HG foo-foo_3.patch | wc -l
102 \s*1 (re)
102 \s*1 (re)
103
103
104 Exporting 4 changesets to a file:
104 Exporting 4 changesets to a file:
105
105
106 $ hg export -o export_internal 1 2 3 4
106 $ hg export -o export_internal 1 2 3 4
107 $ grep HG export_internal | wc -l
107 $ grep HG export_internal | wc -l
108 \s*4 (re)
108 \s*4 (re)
109
109
110 Doing it again clobbers the file rather than appending:
110 Doing it again clobbers the file rather than appending:
111 $ hg export -o export_internal 1 2 3 4
111 $ hg export -o export_internal 1 2 3 4
112 $ grep HG export_internal | wc -l
112 $ grep HG export_internal | wc -l
113 \s*4 (re)
113 \s*4 (re)
114
114
115 Exporting 4 changesets to stdout:
115 Exporting 4 changesets to stdout:
116
116
117 $ hg export 1 2 3 4 | grep HG | wc -l
117 $ hg export 1 2 3 4 | grep HG | wc -l
118 \s*4 (re)
118 \s*4 (re)
119
119
120 Exporting revision -2 to a file:
120 Exporting revision -2 to a file:
121
121
122 $ hg export -- -2
122 $ hg export -- -2
123 # HG changeset patch
123 # HG changeset patch
124 # User test
124 # User test
125 # Date 0 0
125 # Date 0 0
126 # Thu Jan 01 00:00:00 1970 +0000
126 # Node ID 5f17a83f5fbd9414006a5e563eab4c8a00729efd
127 # Node ID 5f17a83f5fbd9414006a5e563eab4c8a00729efd
127 # Parent 747d3c68f8ec44bb35816bfcd59aeb50b9654c2f
128 # Parent 747d3c68f8ec44bb35816bfcd59aeb50b9654c2f
128 foo-10
129 foo-10
129
130
130 diff -r 747d3c68f8ec -r 5f17a83f5fbd foo
131 diff -r 747d3c68f8ec -r 5f17a83f5fbd foo
131 --- a/foo Thu Jan 01 00:00:00 1970 +0000
132 --- a/foo Thu Jan 01 00:00:00 1970 +0000
132 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
133 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
133 @@ -8,3 +8,4 @@
134 @@ -8,3 +8,4 @@
134 foo-7
135 foo-7
135 foo-8
136 foo-8
136 foo-9
137 foo-9
137 +foo-10
138 +foo-10
138
139
139 Checking if only alphanumeric characters are used in the file name (%m option):
140 Checking if only alphanumeric characters are used in the file name (%m option):
140
141
141 $ echo "line" >> foo
142 $ echo "line" >> foo
142 $ hg commit -m " !\"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~"
143 $ hg commit -m " !\"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~"
143 $ hg export -v -o %m.patch tip
144 $ hg export -v -o %m.patch tip
144 exporting patch:
145 exporting patch:
145 ____________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz____.patch
146 ____________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz____.patch
146
147
147 Catch exporting unknown revisions (especially empty revsets, see issue3353)
148 Catch exporting unknown revisions (especially empty revsets, see issue3353)
148
149
149 $ hg export
150 $ hg export
150 abort: export requires at least one changeset
151 abort: export requires at least one changeset
151 [255]
152 [255]
152 $ hg export ""
153 $ hg export ""
153 hg: parse error: empty query
154 hg: parse error: empty query
154 [255]
155 [255]
155 $ hg export 999
156 $ hg export 999
156 abort: unknown revision '999'!
157 abort: unknown revision '999'!
157 [255]
158 [255]
158 $ hg export "not all()"
159 $ hg export "not all()"
159 abort: export requires at least one changeset
160 abort: export requires at least one changeset
160 [255]
161 [255]
161
162
162 Check for color output
163 Check for color output
163 $ echo "[color]" >> $HGRCPATH
164 $ echo "[color]" >> $HGRCPATH
164 $ echo "mode = ansi" >> $HGRCPATH
165 $ echo "mode = ansi" >> $HGRCPATH
165 $ echo "[extensions]" >> $HGRCPATH
166 $ echo "[extensions]" >> $HGRCPATH
166 $ echo "color=" >> $HGRCPATH
167 $ echo "color=" >> $HGRCPATH
167
168
168 $ hg export --color always --nodates tip
169 $ hg export --color always --nodates tip
169 # HG changeset patch
170 # HG changeset patch
170 # User test
171 # User test
171 # Date 0 0
172 # Date 0 0
173 # Thu Jan 01 00:00:00 1970 +0000
172 # Node ID * (glob)
174 # Node ID * (glob)
173 # Parent * (glob)
175 # Parent * (glob)
174 !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
176 !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
175
177
176 \x1b[0;1mdiff -r f3acbafac161 -r 197ecd81a57f foo\x1b[0m (esc)
178 \x1b[0;1mdiff -r f3acbafac161 -r 197ecd81a57f foo\x1b[0m (esc)
177 \x1b[0;31;1m--- a/foo\x1b[0m (esc)
179 \x1b[0;31;1m--- a/foo\x1b[0m (esc)
178 \x1b[0;32;1m+++ b/foo\x1b[0m (esc)
180 \x1b[0;32;1m+++ b/foo\x1b[0m (esc)
179 \x1b[0;35m@@ -10,3 +10,4 @@\x1b[0m (esc)
181 \x1b[0;35m@@ -10,3 +10,4 @@\x1b[0m (esc)
180 foo-9
182 foo-9
181 foo-10
183 foo-10
182 foo-11
184 foo-11
183 \x1b[0;32m+line\x1b[0m (esc)
185 \x1b[0;32m+line\x1b[0m (esc)
184
186
185
187
186 $ cd ..
188 $ cd ..
@@ -1,535 +1,538 b''
1 Create a repo with some stuff in it:
1 Create a repo with some stuff in it:
2
2
3 $ hg init a
3 $ hg init a
4 $ cd a
4 $ cd a
5 $ echo a > a
5 $ echo a > a
6 $ echo a > d
6 $ echo a > d
7 $ echo a > e
7 $ echo a > e
8 $ hg ci -qAm0
8 $ hg ci -qAm0
9 $ echo b > a
9 $ echo b > a
10 $ hg ci -m1 -u bar
10 $ hg ci -m1 -u bar
11 $ hg mv a b
11 $ hg mv a b
12 $ hg ci -m2
12 $ hg ci -m2
13 $ hg cp b c
13 $ hg cp b c
14 $ hg ci -m3 -u baz
14 $ hg ci -m3 -u baz
15 $ echo b > d
15 $ echo b > d
16 $ echo f > e
16 $ echo f > e
17 $ hg ci -m4
17 $ hg ci -m4
18 $ hg up -q 3
18 $ hg up -q 3
19 $ echo b > e
19 $ echo b > e
20 $ hg branch -q stable
20 $ hg branch -q stable
21 $ hg ci -m5
21 $ hg ci -m5
22 $ hg merge -q default --tool internal:local
22 $ hg merge -q default --tool internal:local
23 $ hg branch -q default
23 $ hg branch -q default
24 $ hg ci -m6
24 $ hg ci -m6
25 $ hg phase --public 3
25 $ hg phase --public 3
26 $ hg phase --force --secret 6
26 $ hg phase --force --secret 6
27
27
28 $ hg --config extensions.graphlog= log -G --template '{author}@{rev}.{phase}: {desc}\n'
28 $ hg --config extensions.graphlog= log -G --template '{author}@{rev}.{phase}: {desc}\n'
29 @ test@6.secret: 6
29 @ test@6.secret: 6
30 |\
30 |\
31 | o test@5.draft: 5
31 | o test@5.draft: 5
32 | |
32 | |
33 o | test@4.draft: 4
33 o | test@4.draft: 4
34 |/
34 |/
35 o baz@3.public: 3
35 o baz@3.public: 3
36 |
36 |
37 o test@2.public: 2
37 o test@2.public: 2
38 |
38 |
39 o bar@1.public: 1
39 o bar@1.public: 1
40 |
40 |
41 o test@0.public: 0
41 o test@0.public: 0
42
42
43
43
44 Need to specify a rev:
44 Need to specify a rev:
45
45
46 $ hg graft
46 $ hg graft
47 abort: no revisions specified
47 abort: no revisions specified
48 [255]
48 [255]
49
49
50 Can't graft ancestor:
50 Can't graft ancestor:
51
51
52 $ hg graft 1 2
52 $ hg graft 1 2
53 skipping ancestor revision 1
53 skipping ancestor revision 1
54 skipping ancestor revision 2
54 skipping ancestor revision 2
55 [255]
55 [255]
56
56
57 Specify revisions with -r:
57 Specify revisions with -r:
58
58
59 $ hg graft -r 1 -r 2
59 $ hg graft -r 1 -r 2
60 skipping ancestor revision 1
60 skipping ancestor revision 1
61 skipping ancestor revision 2
61 skipping ancestor revision 2
62 [255]
62 [255]
63
63
64 $ hg graft -r 1 2
64 $ hg graft -r 1 2
65 skipping ancestor revision 2
65 skipping ancestor revision 2
66 skipping ancestor revision 1
66 skipping ancestor revision 1
67 [255]
67 [255]
68
68
69 Can't graft with dirty wd:
69 Can't graft with dirty wd:
70
70
71 $ hg up -q 0
71 $ hg up -q 0
72 $ echo foo > a
72 $ echo foo > a
73 $ hg graft 1
73 $ hg graft 1
74 abort: outstanding uncommitted changes
74 abort: outstanding uncommitted changes
75 [255]
75 [255]
76 $ hg revert a
76 $ hg revert a
77
77
78 Graft a rename:
78 Graft a rename:
79
79
80 $ hg graft 2 -u foo
80 $ hg graft 2 -u foo
81 grafting revision 2
81 grafting revision 2
82 merging a and b to b
82 merging a and b to b
83 $ hg export tip --git
83 $ hg export tip --git
84 # HG changeset patch
84 # HG changeset patch
85 # User foo
85 # User foo
86 # Date 0 0
86 # Date 0 0
87 # Thu Jan 01 00:00:00 1970 +0000
87 # Node ID ef0ef43d49e79e81ddafdc7997401ba0041efc82
88 # Node ID ef0ef43d49e79e81ddafdc7997401ba0041efc82
88 # Parent 68795b066622ca79a25816a662041d8f78f3cd9e
89 # Parent 68795b066622ca79a25816a662041d8f78f3cd9e
89 2
90 2
90
91
91 diff --git a/a b/b
92 diff --git a/a b/b
92 rename from a
93 rename from a
93 rename to b
94 rename to b
94
95
95 Look for extra:source
96 Look for extra:source
96
97
97 $ hg log --debug -r tip
98 $ hg log --debug -r tip
98 changeset: 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
99 changeset: 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
99 tag: tip
100 tag: tip
100 phase: draft
101 phase: draft
101 parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e
102 parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e
102 parent: -1:0000000000000000000000000000000000000000
103 parent: -1:0000000000000000000000000000000000000000
103 manifest: 7:e59b6b228f9cbf9903d5e9abf996e083a1f533eb
104 manifest: 7:e59b6b228f9cbf9903d5e9abf996e083a1f533eb
104 user: foo
105 user: foo
105 date: Thu Jan 01 00:00:00 1970 +0000
106 date: Thu Jan 01 00:00:00 1970 +0000
106 files+: b
107 files+: b
107 files-: a
108 files-: a
108 extra: branch=default
109 extra: branch=default
109 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
110 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
110 description:
111 description:
111 2
112 2
112
113
113
114
114
115
115 Graft out of order, skipping a merge and a duplicate
116 Graft out of order, skipping a merge and a duplicate
116
117
117 $ hg graft 1 5 4 3 'merge()' 2 -n
118 $ hg graft 1 5 4 3 'merge()' 2 -n
118 skipping ungraftable merge revision 6
119 skipping ungraftable merge revision 6
119 skipping already grafted revision 2
120 skipping already grafted revision 2
120 grafting revision 1
121 grafting revision 1
121 grafting revision 5
122 grafting revision 5
122 grafting revision 4
123 grafting revision 4
123 grafting revision 3
124 grafting revision 3
124
125
125 $ hg graft 1 5 4 3 'merge()' 2 --debug
126 $ hg graft 1 5 4 3 'merge()' 2 --debug
126 skipping ungraftable merge revision 6
127 skipping ungraftable merge revision 6
127 scanning for duplicate grafts
128 scanning for duplicate grafts
128 skipping already grafted revision 2
129 skipping already grafted revision 2
129 grafting revision 1
130 grafting revision 1
130 searching for copies back to rev 1
131 searching for copies back to rev 1
131 unmatched files in local:
132 unmatched files in local:
132 b
133 b
133 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
134 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
134 src: 'a' -> dst: 'b' *
135 src: 'a' -> dst: 'b' *
135 checking for directory renames
136 checking for directory renames
136 resolving manifests
137 resolving manifests
137 branchmerge: True, force: True, partial: False
138 branchmerge: True, force: True, partial: False
138 ancestor: 68795b066622, local: ef0ef43d49e7+, remote: 5d205f8b35b6
139 ancestor: 68795b066622, local: ef0ef43d49e7+, remote: 5d205f8b35b6
139 b: local copied/moved to a -> m
140 b: local copied/moved to a -> m
140 preserving b for resolve of b
141 preserving b for resolve of b
141 updating: b 1/1 files (100.00%)
142 updating: b 1/1 files (100.00%)
142 picked tool 'internal:merge' for b (binary False symlink False)
143 picked tool 'internal:merge' for b (binary False symlink False)
143 merging b and a to b
144 merging b and a to b
144 my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622
145 my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622
145 premerge successful
146 premerge successful
146 b
147 b
147 grafting revision 5
148 grafting revision 5
148 searching for copies back to rev 1
149 searching for copies back to rev 1
149 resolving manifests
150 resolving manifests
150 branchmerge: True, force: True, partial: False
151 branchmerge: True, force: True, partial: False
151 ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
152 ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
152 e: remote is newer -> g
153 e: remote is newer -> g
153 getting e
154 getting e
154 updating: e 1/1 files (100.00%)
155 updating: e 1/1 files (100.00%)
155 e
156 e
156 grafting revision 4
157 grafting revision 4
157 searching for copies back to rev 1
158 searching for copies back to rev 1
158 resolving manifests
159 resolving manifests
159 branchmerge: True, force: True, partial: False
160 branchmerge: True, force: True, partial: False
160 ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
161 ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
161 d: remote is newer -> g
162 d: remote is newer -> g
162 e: versions differ -> m
163 e: versions differ -> m
163 preserving e for resolve of e
164 preserving e for resolve of e
164 getting d
165 getting d
165 updating: d 1/2 files (50.00%)
166 updating: d 1/2 files (50.00%)
166 updating: e 2/2 files (100.00%)
167 updating: e 2/2 files (100.00%)
167 picked tool 'internal:merge' for e (binary False symlink False)
168 picked tool 'internal:merge' for e (binary False symlink False)
168 merging e
169 merging e
169 my e@1905859650ec+ other e@9c233e8e184d ancestor e@68795b066622
170 my e@1905859650ec+ other e@9c233e8e184d ancestor e@68795b066622
170 warning: conflicts during merge.
171 warning: conflicts during merge.
171 merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
172 merging e incomplete! (edit conflicts, then use 'hg resolve --mark')
172 abort: unresolved conflicts, can't continue
173 abort: unresolved conflicts, can't continue
173 (use hg resolve and hg graft --continue)
174 (use hg resolve and hg graft --continue)
174 [255]
175 [255]
175
176
176 Continue without resolve should fail:
177 Continue without resolve should fail:
177
178
178 $ hg graft -c
179 $ hg graft -c
179 grafting revision 4
180 grafting revision 4
180 abort: unresolved merge conflicts (see hg help resolve)
181 abort: unresolved merge conflicts (see hg help resolve)
181 [255]
182 [255]
182
183
183 Fix up:
184 Fix up:
184
185
185 $ echo b > e
186 $ echo b > e
186 $ hg resolve -m e
187 $ hg resolve -m e
187
188
188 Continue with a revision should fail:
189 Continue with a revision should fail:
189
190
190 $ hg graft -c 6
191 $ hg graft -c 6
191 abort: can't specify --continue and revisions
192 abort: can't specify --continue and revisions
192 [255]
193 [255]
193
194
194 $ hg graft -c -r 6
195 $ hg graft -c -r 6
195 abort: can't specify --continue and revisions
196 abort: can't specify --continue and revisions
196 [255]
197 [255]
197
198
198 Continue for real, clobber usernames
199 Continue for real, clobber usernames
199
200
200 $ hg graft -c -U
201 $ hg graft -c -U
201 grafting revision 4
202 grafting revision 4
202 grafting revision 3
203 grafting revision 3
203
204
204 Compare with original:
205 Compare with original:
205
206
206 $ hg diff -r 6
207 $ hg diff -r 6
207 $ hg status --rev 0:. -C
208 $ hg status --rev 0:. -C
208 M d
209 M d
209 M e
210 M e
210 A b
211 A b
211 a
212 a
212 A c
213 A c
213 a
214 a
214 R a
215 R a
215
216
216 View graph:
217 View graph:
217
218
218 $ hg --config extensions.graphlog= log -G --template '{author}@{rev}.{phase}: {desc}\n'
219 $ hg --config extensions.graphlog= log -G --template '{author}@{rev}.{phase}: {desc}\n'
219 @ test@11.draft: 3
220 @ test@11.draft: 3
220 |
221 |
221 o test@10.draft: 4
222 o test@10.draft: 4
222 |
223 |
223 o test@9.draft: 5
224 o test@9.draft: 5
224 |
225 |
225 o bar@8.draft: 1
226 o bar@8.draft: 1
226 |
227 |
227 o foo@7.draft: 2
228 o foo@7.draft: 2
228 |
229 |
229 | o test@6.secret: 6
230 | o test@6.secret: 6
230 | |\
231 | |\
231 | | o test@5.draft: 5
232 | | o test@5.draft: 5
232 | | |
233 | | |
233 | o | test@4.draft: 4
234 | o | test@4.draft: 4
234 | |/
235 | |/
235 | o baz@3.public: 3
236 | o baz@3.public: 3
236 | |
237 | |
237 | o test@2.public: 2
238 | o test@2.public: 2
238 | |
239 | |
239 | o bar@1.public: 1
240 | o bar@1.public: 1
240 |/
241 |/
241 o test@0.public: 0
242 o test@0.public: 0
242
243
243 Graft again onto another branch should preserve the original source
244 Graft again onto another branch should preserve the original source
244 $ hg up -q 0
245 $ hg up -q 0
245 $ echo 'g'>g
246 $ echo 'g'>g
246 $ hg add g
247 $ hg add g
247 $ hg ci -m 7
248 $ hg ci -m 7
248 created new head
249 created new head
249 $ hg graft 7
250 $ hg graft 7
250 grafting revision 7
251 grafting revision 7
251
252
252 $ hg log -r 7 --template '{rev}:{node}\n'
253 $ hg log -r 7 --template '{rev}:{node}\n'
253 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
254 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
254 $ hg log -r 2 --template '{rev}:{node}\n'
255 $ hg log -r 2 --template '{rev}:{node}\n'
255 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
256 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
256
257
257 $ hg log --debug -r tip
258 $ hg log --debug -r tip
258 changeset: 13:9db0f28fd3747e92c57d015f53b5593aeec53c2d
259 changeset: 13:9db0f28fd3747e92c57d015f53b5593aeec53c2d
259 tag: tip
260 tag: tip
260 phase: draft
261 phase: draft
261 parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
262 parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
262 parent: -1:0000000000000000000000000000000000000000
263 parent: -1:0000000000000000000000000000000000000000
263 manifest: 13:dc313617b8c32457c0d589e0dbbedfe71f3cd637
264 manifest: 13:dc313617b8c32457c0d589e0dbbedfe71f3cd637
264 user: foo
265 user: foo
265 date: Thu Jan 01 00:00:00 1970 +0000
266 date: Thu Jan 01 00:00:00 1970 +0000
266 files+: b
267 files+: b
267 files-: a
268 files-: a
268 extra: branch=default
269 extra: branch=default
269 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
270 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
270 description:
271 description:
271 2
272 2
272
273
273
274
274 Disallow grafting an already grafted cset onto its original branch
275 Disallow grafting an already grafted cset onto its original branch
275 $ hg up -q 6
276 $ hg up -q 6
276 $ hg graft 7
277 $ hg graft 7
277 skipping already grafted revision 7 (was grafted from 2)
278 skipping already grafted revision 7 (was grafted from 2)
278 [255]
279 [255]
279
280
280 Disallow grafting already grafted csets with the same origin onto each other
281 Disallow grafting already grafted csets with the same origin onto each other
281 $ hg up -q 13
282 $ hg up -q 13
282 $ hg graft 2
283 $ hg graft 2
283 skipping already grafted revision 2
284 skipping already grafted revision 2
284 [255]
285 [255]
285 $ hg graft 7
286 $ hg graft 7
286 skipping already grafted revision 7 (same origin 2)
287 skipping already grafted revision 7 (same origin 2)
287 [255]
288 [255]
288
289
289 $ hg up -q 7
290 $ hg up -q 7
290 $ hg graft 2
291 $ hg graft 2
291 skipping already grafted revision 2
292 skipping already grafted revision 2
292 [255]
293 [255]
293 $ hg graft tip
294 $ hg graft tip
294 skipping already grafted revision 13 (same origin 2)
295 skipping already grafted revision 13 (same origin 2)
295 [255]
296 [255]
296
297
297 Graft with --log
298 Graft with --log
298
299
299 $ hg up -Cq 1
300 $ hg up -Cq 1
300 $ hg graft 3 --log -u foo
301 $ hg graft 3 --log -u foo
301 grafting revision 3
302 grafting revision 3
302 warning: can't find ancestor for 'c' copied from 'b'!
303 warning: can't find ancestor for 'c' copied from 'b'!
303 $ hg log --template '{rev} {parents} {desc}\n' -r tip
304 $ hg log --template '{rev} {parents} {desc}\n' -r tip
304 14 1:5d205f8b35b6 3
305 14 1:5d205f8b35b6 3
305 (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
306 (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
306
307
307 Resolve conflicted graft
308 Resolve conflicted graft
308 $ hg up -q 0
309 $ hg up -q 0
309 $ echo b > a
310 $ echo b > a
310 $ hg ci -m 8
311 $ hg ci -m 8
311 created new head
312 created new head
312 $ echo a > a
313 $ echo a > a
313 $ hg ci -m 9
314 $ hg ci -m 9
314 $ hg graft 1 --tool internal:fail
315 $ hg graft 1 --tool internal:fail
315 grafting revision 1
316 grafting revision 1
316 abort: unresolved conflicts, can't continue
317 abort: unresolved conflicts, can't continue
317 (use hg resolve and hg graft --continue)
318 (use hg resolve and hg graft --continue)
318 [255]
319 [255]
319 $ hg resolve --all
320 $ hg resolve --all
320 merging a
321 merging a
321 $ hg graft -c
322 $ hg graft -c
322 grafting revision 1
323 grafting revision 1
323 $ hg export tip --git
324 $ hg export tip --git
324 # HG changeset patch
325 # HG changeset patch
325 # User bar
326 # User bar
326 # Date 0 0
327 # Date 0 0
328 # Thu Jan 01 00:00:00 1970 +0000
327 # Node ID 64ecd9071ce83c6e62f538d8ce7709d53f32ebf7
329 # Node ID 64ecd9071ce83c6e62f538d8ce7709d53f32ebf7
328 # Parent 4bdb9a9d0b84ffee1d30f0dfc7744cade17aa19c
330 # Parent 4bdb9a9d0b84ffee1d30f0dfc7744cade17aa19c
329 1
331 1
330
332
331 diff --git a/a b/a
333 diff --git a/a b/a
332 --- a/a
334 --- a/a
333 +++ b/a
335 +++ b/a
334 @@ -1,1 +1,1 @@
336 @@ -1,1 +1,1 @@
335 -a
337 -a
336 +b
338 +b
337
339
338 Resolve conflicted graft with rename
340 Resolve conflicted graft with rename
339 $ echo c > a
341 $ echo c > a
340 $ hg ci -m 10
342 $ hg ci -m 10
341 $ hg graft 2 --tool internal:fail
343 $ hg graft 2 --tool internal:fail
342 grafting revision 2
344 grafting revision 2
343 abort: unresolved conflicts, can't continue
345 abort: unresolved conflicts, can't continue
344 (use hg resolve and hg graft --continue)
346 (use hg resolve and hg graft --continue)
345 [255]
347 [255]
346 $ hg resolve --all
348 $ hg resolve --all
347 merging a and b to b
349 merging a and b to b
348 $ hg graft -c
350 $ hg graft -c
349 grafting revision 2
351 grafting revision 2
350 $ hg export tip --git
352 $ hg export tip --git
351 # HG changeset patch
353 # HG changeset patch
352 # User test
354 # User test
353 # Date 0 0
355 # Date 0 0
356 # Thu Jan 01 00:00:00 1970 +0000
354 # Node ID 2e80e1351d6ed50302fe1e05f8bd1d4d412b6e11
357 # Node ID 2e80e1351d6ed50302fe1e05f8bd1d4d412b6e11
355 # Parent e5a51ae854a8bbaaf25cc5c6a57ff46042dadbb4
358 # Parent e5a51ae854a8bbaaf25cc5c6a57ff46042dadbb4
356 2
359 2
357
360
358 diff --git a/a b/b
361 diff --git a/a b/b
359 rename from a
362 rename from a
360 rename to b
363 rename to b
361
364
362 Test simple origin(), with and without args
365 Test simple origin(), with and without args
363 $ hg log -r 'origin()'
366 $ hg log -r 'origin()'
364 changeset: 1:5d205f8b35b6
367 changeset: 1:5d205f8b35b6
365 user: bar
368 user: bar
366 date: Thu Jan 01 00:00:00 1970 +0000
369 date: Thu Jan 01 00:00:00 1970 +0000
367 summary: 1
370 summary: 1
368
371
369 changeset: 2:5c095ad7e90f
372 changeset: 2:5c095ad7e90f
370 user: test
373 user: test
371 date: Thu Jan 01 00:00:00 1970 +0000
374 date: Thu Jan 01 00:00:00 1970 +0000
372 summary: 2
375 summary: 2
373
376
374 changeset: 3:4c60f11aa304
377 changeset: 3:4c60f11aa304
375 user: baz
378 user: baz
376 date: Thu Jan 01 00:00:00 1970 +0000
379 date: Thu Jan 01 00:00:00 1970 +0000
377 summary: 3
380 summary: 3
378
381
379 changeset: 4:9c233e8e184d
382 changeset: 4:9c233e8e184d
380 user: test
383 user: test
381 date: Thu Jan 01 00:00:00 1970 +0000
384 date: Thu Jan 01 00:00:00 1970 +0000
382 summary: 4
385 summary: 4
383
386
384 changeset: 5:97f8bfe72746
387 changeset: 5:97f8bfe72746
385 branch: stable
388 branch: stable
386 parent: 3:4c60f11aa304
389 parent: 3:4c60f11aa304
387 user: test
390 user: test
388 date: Thu Jan 01 00:00:00 1970 +0000
391 date: Thu Jan 01 00:00:00 1970 +0000
389 summary: 5
392 summary: 5
390
393
391 $ hg log -r 'origin(7)'
394 $ hg log -r 'origin(7)'
392 changeset: 2:5c095ad7e90f
395 changeset: 2:5c095ad7e90f
393 user: test
396 user: test
394 date: Thu Jan 01 00:00:00 1970 +0000
397 date: Thu Jan 01 00:00:00 1970 +0000
395 summary: 2
398 summary: 2
396
399
397 Now transplant a graft to test following through copies
400 Now transplant a graft to test following through copies
398 $ hg up -q 0
401 $ hg up -q 0
399 $ hg branch -q dev
402 $ hg branch -q dev
400 $ hg ci -qm "dev branch"
403 $ hg ci -qm "dev branch"
401 $ hg --config extensions.transplant= transplant -q 7
404 $ hg --config extensions.transplant= transplant -q 7
402 $ hg log -r 'origin(.)'
405 $ hg log -r 'origin(.)'
403 changeset: 2:5c095ad7e90f
406 changeset: 2:5c095ad7e90f
404 user: test
407 user: test
405 date: Thu Jan 01 00:00:00 1970 +0000
408 date: Thu Jan 01 00:00:00 1970 +0000
406 summary: 2
409 summary: 2
407
410
408 Test simple destination
411 Test simple destination
409 $ hg log -r 'destination()'
412 $ hg log -r 'destination()'
410 changeset: 7:ef0ef43d49e7
413 changeset: 7:ef0ef43d49e7
411 parent: 0:68795b066622
414 parent: 0:68795b066622
412 user: foo
415 user: foo
413 date: Thu Jan 01 00:00:00 1970 +0000
416 date: Thu Jan 01 00:00:00 1970 +0000
414 summary: 2
417 summary: 2
415
418
416 changeset: 8:6b9e5368ca4e
419 changeset: 8:6b9e5368ca4e
417 user: bar
420 user: bar
418 date: Thu Jan 01 00:00:00 1970 +0000
421 date: Thu Jan 01 00:00:00 1970 +0000
419 summary: 1
422 summary: 1
420
423
421 changeset: 9:1905859650ec
424 changeset: 9:1905859650ec
422 user: test
425 user: test
423 date: Thu Jan 01 00:00:00 1970 +0000
426 date: Thu Jan 01 00:00:00 1970 +0000
424 summary: 5
427 summary: 5
425
428
426 changeset: 10:52dc0b4c6907
429 changeset: 10:52dc0b4c6907
427 user: test
430 user: test
428 date: Thu Jan 01 00:00:00 1970 +0000
431 date: Thu Jan 01 00:00:00 1970 +0000
429 summary: 4
432 summary: 4
430
433
431 changeset: 11:882b35362a6b
434 changeset: 11:882b35362a6b
432 user: test
435 user: test
433 date: Thu Jan 01 00:00:00 1970 +0000
436 date: Thu Jan 01 00:00:00 1970 +0000
434 summary: 3
437 summary: 3
435
438
436 changeset: 13:9db0f28fd374
439 changeset: 13:9db0f28fd374
437 user: foo
440 user: foo
438 date: Thu Jan 01 00:00:00 1970 +0000
441 date: Thu Jan 01 00:00:00 1970 +0000
439 summary: 2
442 summary: 2
440
443
441 changeset: 14:f64defefacee
444 changeset: 14:f64defefacee
442 parent: 1:5d205f8b35b6
445 parent: 1:5d205f8b35b6
443 user: foo
446 user: foo
444 date: Thu Jan 01 00:00:00 1970 +0000
447 date: Thu Jan 01 00:00:00 1970 +0000
445 summary: 3
448 summary: 3
446
449
447 changeset: 17:64ecd9071ce8
450 changeset: 17:64ecd9071ce8
448 user: bar
451 user: bar
449 date: Thu Jan 01 00:00:00 1970 +0000
452 date: Thu Jan 01 00:00:00 1970 +0000
450 summary: 1
453 summary: 1
451
454
452 changeset: 19:2e80e1351d6e
455 changeset: 19:2e80e1351d6e
453 user: test
456 user: test
454 date: Thu Jan 01 00:00:00 1970 +0000
457 date: Thu Jan 01 00:00:00 1970 +0000
455 summary: 2
458 summary: 2
456
459
457 changeset: 21:7e61b508e709
460 changeset: 21:7e61b508e709
458 branch: dev
461 branch: dev
459 tag: tip
462 tag: tip
460 user: foo
463 user: foo
461 date: Thu Jan 01 00:00:00 1970 +0000
464 date: Thu Jan 01 00:00:00 1970 +0000
462 summary: 2
465 summary: 2
463
466
464 $ hg log -r 'destination(2)'
467 $ hg log -r 'destination(2)'
465 changeset: 7:ef0ef43d49e7
468 changeset: 7:ef0ef43d49e7
466 parent: 0:68795b066622
469 parent: 0:68795b066622
467 user: foo
470 user: foo
468 date: Thu Jan 01 00:00:00 1970 +0000
471 date: Thu Jan 01 00:00:00 1970 +0000
469 summary: 2
472 summary: 2
470
473
471 changeset: 13:9db0f28fd374
474 changeset: 13:9db0f28fd374
472 user: foo
475 user: foo
473 date: Thu Jan 01 00:00:00 1970 +0000
476 date: Thu Jan 01 00:00:00 1970 +0000
474 summary: 2
477 summary: 2
475
478
476 changeset: 19:2e80e1351d6e
479 changeset: 19:2e80e1351d6e
477 user: test
480 user: test
478 date: Thu Jan 01 00:00:00 1970 +0000
481 date: Thu Jan 01 00:00:00 1970 +0000
479 summary: 2
482 summary: 2
480
483
481 changeset: 21:7e61b508e709
484 changeset: 21:7e61b508e709
482 branch: dev
485 branch: dev
483 tag: tip
486 tag: tip
484 user: foo
487 user: foo
485 date: Thu Jan 01 00:00:00 1970 +0000
488 date: Thu Jan 01 00:00:00 1970 +0000
486 summary: 2
489 summary: 2
487
490
488 Transplants of grafts can find a destination...
491 Transplants of grafts can find a destination...
489 $ hg log -r 'destination(7)'
492 $ hg log -r 'destination(7)'
490 changeset: 21:7e61b508e709
493 changeset: 21:7e61b508e709
491 branch: dev
494 branch: dev
492 tag: tip
495 tag: tip
493 user: foo
496 user: foo
494 date: Thu Jan 01 00:00:00 1970 +0000
497 date: Thu Jan 01 00:00:00 1970 +0000
495 summary: 2
498 summary: 2
496
499
497 ... grafts of grafts unfortunately can't
500 ... grafts of grafts unfortunately can't
498 $ hg graft -q 13
501 $ hg graft -q 13
499 $ hg log -r 'destination(13)'
502 $ hg log -r 'destination(13)'
500 All copies of a cset
503 All copies of a cset
501 $ hg log -r 'origin(13) or destination(origin(13))'
504 $ hg log -r 'origin(13) or destination(origin(13))'
502 changeset: 2:5c095ad7e90f
505 changeset: 2:5c095ad7e90f
503 user: test
506 user: test
504 date: Thu Jan 01 00:00:00 1970 +0000
507 date: Thu Jan 01 00:00:00 1970 +0000
505 summary: 2
508 summary: 2
506
509
507 changeset: 7:ef0ef43d49e7
510 changeset: 7:ef0ef43d49e7
508 parent: 0:68795b066622
511 parent: 0:68795b066622
509 user: foo
512 user: foo
510 date: Thu Jan 01 00:00:00 1970 +0000
513 date: Thu Jan 01 00:00:00 1970 +0000
511 summary: 2
514 summary: 2
512
515
513 changeset: 13:9db0f28fd374
516 changeset: 13:9db0f28fd374
514 user: foo
517 user: foo
515 date: Thu Jan 01 00:00:00 1970 +0000
518 date: Thu Jan 01 00:00:00 1970 +0000
516 summary: 2
519 summary: 2
517
520
518 changeset: 19:2e80e1351d6e
521 changeset: 19:2e80e1351d6e
519 user: test
522 user: test
520 date: Thu Jan 01 00:00:00 1970 +0000
523 date: Thu Jan 01 00:00:00 1970 +0000
521 summary: 2
524 summary: 2
522
525
523 changeset: 21:7e61b508e709
526 changeset: 21:7e61b508e709
524 branch: dev
527 branch: dev
525 user: foo
528 user: foo
526 date: Thu Jan 01 00:00:00 1970 +0000
529 date: Thu Jan 01 00:00:00 1970 +0000
527 summary: 2
530 summary: 2
528
531
529 changeset: 22:1313d0a825e2
532 changeset: 22:1313d0a825e2
530 branch: dev
533 branch: dev
531 tag: tip
534 tag: tip
532 user: foo
535 user: foo
533 date: Thu Jan 01 00:00:00 1970 +0000
536 date: Thu Jan 01 00:00:00 1970 +0000
534 summary: 2
537 summary: 2
535
538
@@ -1,317 +1,318 b''
1 $ . "$TESTDIR/histedit-helpers.sh"
1 $ . "$TESTDIR/histedit-helpers.sh"
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > graphlog=
5 > graphlog=
6 > histedit=
6 > histedit=
7 > EOF
7 > EOF
8
8
9 $ EDITED="$TESTTMP/editedhistory"
9 $ EDITED="$TESTTMP/editedhistory"
10 $ cat > $EDITED <<EOF
10 $ cat > $EDITED <<EOF
11 > pick e860deea161a e
11 > pick e860deea161a e
12 > pick 652413bf663e f
12 > pick 652413bf663e f
13 > fold 177f92b77385 c
13 > fold 177f92b77385 c
14 > pick 055a42cdd887 d
14 > pick 055a42cdd887 d
15 > EOF
15 > EOF
16 $ initrepo ()
16 $ initrepo ()
17 > {
17 > {
18 > hg init r
18 > hg init r
19 > cd r
19 > cd r
20 > for x in a b c d e f ; do
20 > for x in a b c d e f ; do
21 > echo $x > $x
21 > echo $x > $x
22 > hg add $x
22 > hg add $x
23 > hg ci -m $x
23 > hg ci -m $x
24 > done
24 > done
25 > }
25 > }
26
26
27 $ initrepo
27 $ initrepo
28
28
29 log before edit
29 log before edit
30 $ hg log --graph
30 $ hg log --graph
31 @ changeset: 5:652413bf663e
31 @ changeset: 5:652413bf663e
32 | tag: tip
32 | tag: tip
33 | user: test
33 | user: test
34 | date: Thu Jan 01 00:00:00 1970 +0000
34 | date: Thu Jan 01 00:00:00 1970 +0000
35 | summary: f
35 | summary: f
36 |
36 |
37 o changeset: 4:e860deea161a
37 o changeset: 4:e860deea161a
38 | user: test
38 | user: test
39 | date: Thu Jan 01 00:00:00 1970 +0000
39 | date: Thu Jan 01 00:00:00 1970 +0000
40 | summary: e
40 | summary: e
41 |
41 |
42 o changeset: 3:055a42cdd887
42 o changeset: 3:055a42cdd887
43 | user: test
43 | user: test
44 | date: Thu Jan 01 00:00:00 1970 +0000
44 | date: Thu Jan 01 00:00:00 1970 +0000
45 | summary: d
45 | summary: d
46 |
46 |
47 o changeset: 2:177f92b77385
47 o changeset: 2:177f92b77385
48 | user: test
48 | user: test
49 | date: Thu Jan 01 00:00:00 1970 +0000
49 | date: Thu Jan 01 00:00:00 1970 +0000
50 | summary: c
50 | summary: c
51 |
51 |
52 o changeset: 1:d2ae7f538514
52 o changeset: 1:d2ae7f538514
53 | user: test
53 | user: test
54 | date: Thu Jan 01 00:00:00 1970 +0000
54 | date: Thu Jan 01 00:00:00 1970 +0000
55 | summary: b
55 | summary: b
56 |
56 |
57 o changeset: 0:cb9a9f314b8b
57 o changeset: 0:cb9a9f314b8b
58 user: test
58 user: test
59 date: Thu Jan 01 00:00:00 1970 +0000
59 date: Thu Jan 01 00:00:00 1970 +0000
60 summary: a
60 summary: a
61
61
62
62
63 edit the history
63 edit the history
64 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
64 $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle
65 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
65 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
66 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
66 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
67 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
67 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
68 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
69 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
71 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
71 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
72
72
73 log after edit
73 log after edit
74 $ hg log --graph
74 $ hg log --graph
75 @ changeset: 4:7e0a290363ed
75 @ changeset: 4:7e0a290363ed
76 | tag: tip
76 | tag: tip
77 | user: test
77 | user: test
78 | date: Thu Jan 01 00:00:00 1970 +0000
78 | date: Thu Jan 01 00:00:00 1970 +0000
79 | summary: d
79 | summary: d
80 |
80 |
81 o changeset: 3:5e24935bad3d
81 o changeset: 3:5e24935bad3d
82 | user: test
82 | user: test
83 | date: Thu Jan 01 00:00:00 1970 +0000
83 | date: Thu Jan 01 00:00:00 1970 +0000
84 | summary: pick e860deea161a e
84 | summary: pick e860deea161a e
85 |
85 |
86 o changeset: 2:ee283cb5f2d5
86 o changeset: 2:ee283cb5f2d5
87 | user: test
87 | user: test
88 | date: Thu Jan 01 00:00:00 1970 +0000
88 | date: Thu Jan 01 00:00:00 1970 +0000
89 | summary: e
89 | summary: e
90 |
90 |
91 o changeset: 1:d2ae7f538514
91 o changeset: 1:d2ae7f538514
92 | user: test
92 | user: test
93 | date: Thu Jan 01 00:00:00 1970 +0000
93 | date: Thu Jan 01 00:00:00 1970 +0000
94 | summary: b
94 | summary: b
95 |
95 |
96 o changeset: 0:cb9a9f314b8b
96 o changeset: 0:cb9a9f314b8b
97 user: test
97 user: test
98 date: Thu Jan 01 00:00:00 1970 +0000
98 date: Thu Jan 01 00:00:00 1970 +0000
99 summary: a
99 summary: a
100
100
101
101
102 post-fold manifest
102 post-fold manifest
103 $ hg manifest
103 $ hg manifest
104 a
104 a
105 b
105 b
106 c
106 c
107 d
107 d
108 e
108 e
109 f
109 f
110
110
111
111
112 check histedit_source
112 check histedit_source
113
113
114 $ hg log --debug --rev 3
114 $ hg log --debug --rev 3
115 changeset: 3:5e24935bad3d5a4486de3b90f233e991465ced72
115 changeset: 3:5e24935bad3d5a4486de3b90f233e991465ced72
116 phase: draft
116 phase: draft
117 parent: 2:ee283cb5f2d5955443f23a27b697a04339e9a39a
117 parent: 2:ee283cb5f2d5955443f23a27b697a04339e9a39a
118 parent: -1:0000000000000000000000000000000000000000
118 parent: -1:0000000000000000000000000000000000000000
119 manifest: 3:81eede616954057198ead0b2c73b41d1f392829a
119 manifest: 3:81eede616954057198ead0b2c73b41d1f392829a
120 user: test
120 user: test
121 date: Thu Jan 01 00:00:00 1970 +0000
121 date: Thu Jan 01 00:00:00 1970 +0000
122 files+: c f
122 files+: c f
123 extra: branch=default
123 extra: branch=default
124 extra: histedit_source=a4f7421b80f79fcc59fff01bcbf4a53d127dd6d3,177f92b773850b59254aa5e923436f921b55483b
124 extra: histedit_source=a4f7421b80f79fcc59fff01bcbf4a53d127dd6d3,177f92b773850b59254aa5e923436f921b55483b
125 description:
125 description:
126 pick e860deea161a e
126 pick e860deea161a e
127 pick 652413bf663e f
127 pick 652413bf663e f
128 fold 177f92b77385 c
128 fold 177f92b77385 c
129 pick 055a42cdd887 d
129 pick 055a42cdd887 d
130
130
131
131
132
132
133 $ cd ..
133 $ cd ..
134
134
135 folding and creating no new change doesn't break:
135 folding and creating no new change doesn't break:
136 $ mkdir fold-to-empty-test
136 $ mkdir fold-to-empty-test
137 $ cd fold-to-empty-test
137 $ cd fold-to-empty-test
138 $ hg init
138 $ hg init
139 $ printf "1\n2\n3\n" > file
139 $ printf "1\n2\n3\n" > file
140 $ hg add file
140 $ hg add file
141 $ hg commit -m '1+2+3'
141 $ hg commit -m '1+2+3'
142 $ echo 4 >> file
142 $ echo 4 >> file
143 $ hg commit -m '+4'
143 $ hg commit -m '+4'
144 $ echo 5 >> file
144 $ echo 5 >> file
145 $ hg commit -m '+5'
145 $ hg commit -m '+5'
146 $ echo 6 >> file
146 $ echo 6 >> file
147 $ hg commit -m '+6'
147 $ hg commit -m '+6'
148 $ hg log --graph
148 $ hg log --graph
149 @ changeset: 3:251d831eeec5
149 @ changeset: 3:251d831eeec5
150 | tag: tip
150 | tag: tip
151 | user: test
151 | user: test
152 | date: Thu Jan 01 00:00:00 1970 +0000
152 | date: Thu Jan 01 00:00:00 1970 +0000
153 | summary: +6
153 | summary: +6
154 |
154 |
155 o changeset: 2:888f9082bf99
155 o changeset: 2:888f9082bf99
156 | user: test
156 | user: test
157 | date: Thu Jan 01 00:00:00 1970 +0000
157 | date: Thu Jan 01 00:00:00 1970 +0000
158 | summary: +5
158 | summary: +5
159 |
159 |
160 o changeset: 1:617f94f13c0f
160 o changeset: 1:617f94f13c0f
161 | user: test
161 | user: test
162 | date: Thu Jan 01 00:00:00 1970 +0000
162 | date: Thu Jan 01 00:00:00 1970 +0000
163 | summary: +4
163 | summary: +4
164 |
164 |
165 o changeset: 0:0189ba417d34
165 o changeset: 0:0189ba417d34
166 user: test
166 user: test
167 date: Thu Jan 01 00:00:00 1970 +0000
167 date: Thu Jan 01 00:00:00 1970 +0000
168 summary: 1+2+3
168 summary: 1+2+3
169
169
170
170
171 $ cat > editor.py <<EOF
171 $ cat > editor.py <<EOF
172 > import re, sys
172 > import re, sys
173 > rules = sys.argv[1]
173 > rules = sys.argv[1]
174 > data = open(rules).read()
174 > data = open(rules).read()
175 > data = re.sub(r'pick ([0-9a-f]{12} 2 \+5)', r'drop \1', data)
175 > data = re.sub(r'pick ([0-9a-f]{12} 2 \+5)', r'drop \1', data)
176 > data = re.sub(r'pick ([0-9a-f]{12} 2 \+6)', r'fold \1', data)
176 > data = re.sub(r'pick ([0-9a-f]{12} 2 \+6)', r'fold \1', data)
177 > open(rules, 'w').write(data)
177 > open(rules, 'w').write(data)
178 > EOF
178 > EOF
179
179
180 $ HGEDITOR='python editor.py' hg histedit 1
180 $ HGEDITOR='python editor.py' hg histedit 1
181 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
181 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
182 merging file
182 merging file
183 warning: conflicts during merge.
183 warning: conflicts during merge.
184 merging file incomplete! (edit conflicts, then use 'hg resolve --mark')
184 merging file incomplete! (edit conflicts, then use 'hg resolve --mark')
185 abort: Fix up the change and run hg histedit --continue
185 abort: Fix up the change and run hg histedit --continue
186 [255]
186 [255]
187 There were conflicts, we keep P1 content. This
187 There were conflicts, we keep P1 content. This
188 should effectively drop the changes from +6.
188 should effectively drop the changes from +6.
189 $ hg status
189 $ hg status
190 M file
190 M file
191 ? editor.py
191 ? editor.py
192 ? file.orig
192 ? file.orig
193 $ hg resolve -l
193 $ hg resolve -l
194 U file
194 U file
195 $ hg revert -r 'p1()' file
195 $ hg revert -r 'p1()' file
196 $ hg resolve --mark file
196 $ hg resolve --mark file
197 $ hg histedit --continue
197 $ hg histedit --continue
198 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
198 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
199 saved backup bundle to $TESTTMP/*-backup.hg (glob)
199 saved backup bundle to $TESTTMP/*-backup.hg (glob)
200 $ hg log --graph
200 $ hg log --graph
201 @ changeset: 1:617f94f13c0f
201 @ changeset: 1:617f94f13c0f
202 | tag: tip
202 | tag: tip
203 | user: test
203 | user: test
204 | date: Thu Jan 01 00:00:00 1970 +0000
204 | date: Thu Jan 01 00:00:00 1970 +0000
205 | summary: +4
205 | summary: +4
206 |
206 |
207 o changeset: 0:0189ba417d34
207 o changeset: 0:0189ba417d34
208 user: test
208 user: test
209 date: Thu Jan 01 00:00:00 1970 +0000
209 date: Thu Jan 01 00:00:00 1970 +0000
210 summary: 1+2+3
210 summary: 1+2+3
211
211
212
212
213 $ cd ..
213 $ cd ..
214
214
215 Test corner case where folded revision is separated from its parent by a
215 Test corner case where folded revision is separated from its parent by a
216 dropped revision.
216 dropped revision.
217
217
218
218
219 $ hg init fold-with-dropped
219 $ hg init fold-with-dropped
220 $ cd fold-with-dropped
220 $ cd fold-with-dropped
221 $ printf "1\n2\n3\n" > file
221 $ printf "1\n2\n3\n" > file
222 $ hg commit -Am '1+2+3'
222 $ hg commit -Am '1+2+3'
223 adding file
223 adding file
224 $ echo 4 >> file
224 $ echo 4 >> file
225 $ hg commit -m '+4'
225 $ hg commit -m '+4'
226 $ echo 5 >> file
226 $ echo 5 >> file
227 $ hg commit -m '+5'
227 $ hg commit -m '+5'
228 $ echo 6 >> file
228 $ echo 6 >> file
229 $ hg commit -m '+6'
229 $ hg commit -m '+6'
230 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
230 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
231 @ 3:251d831eeec5 +6
231 @ 3:251d831eeec5 +6
232 |
232 |
233 o 2:888f9082bf99 +5
233 o 2:888f9082bf99 +5
234 |
234 |
235 o 1:617f94f13c0f +4
235 o 1:617f94f13c0f +4
236 |
236 |
237 o 0:0189ba417d34 1+2+3
237 o 0:0189ba417d34 1+2+3
238
238
239 $ EDITED="$TESTTMP/editcommands"
239 $ EDITED="$TESTTMP/editcommands"
240 $ cat > $EDITED <<EOF
240 $ cat > $EDITED <<EOF
241 > pick 617f94f13c0f 1 +4
241 > pick 617f94f13c0f 1 +4
242 > drop 888f9082bf99 2 +5
242 > drop 888f9082bf99 2 +5
243 > fold 251d831eeec5 3 +6
243 > fold 251d831eeec5 3 +6
244 > EOF
244 > EOF
245 $ HGEDITOR="cat $EDITED >" hg histedit 1
245 $ HGEDITOR="cat $EDITED >" hg histedit 1
246 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
246 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
247 merging file
247 merging file
248 warning: conflicts during merge.
248 warning: conflicts during merge.
249 merging file incomplete! (edit conflicts, then use 'hg resolve --mark')
249 merging file incomplete! (edit conflicts, then use 'hg resolve --mark')
250 abort: Fix up the change and run hg histedit --continue
250 abort: Fix up the change and run hg histedit --continue
251 [255]
251 [255]
252 $ cat > file << EOF
252 $ cat > file << EOF
253 > 1
253 > 1
254 > 2
254 > 2
255 > 3
255 > 3
256 > 4
256 > 4
257 > 5
257 > 5
258 > EOF
258 > EOF
259 $ hg resolve --mark file
259 $ hg resolve --mark file
260 $ hg commit -m '+5.2'
260 $ hg commit -m '+5.2'
261 created new head
261 created new head
262 $ echo 6 >> file
262 $ echo 6 >> file
263 $ HGEDITOR=cat hg histedit --continue
263 $ HGEDITOR=cat hg histedit --continue
264 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
264 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
265 +4
265 +4
266 ***
266 ***
267 +5.2
267 +5.2
268 ***
268 ***
269 +6
269 +6
270
270
271
271
272
272
273 HG: Enter commit message. Lines beginning with 'HG:' are removed.
273 HG: Enter commit message. Lines beginning with 'HG:' are removed.
274 HG: Leave message empty to abort commit.
274 HG: Leave message empty to abort commit.
275 HG: --
275 HG: --
276 HG: user: test
276 HG: user: test
277 HG: branch 'default'
277 HG: branch 'default'
278 HG: changed file
278 HG: changed file
279 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
279 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
280 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
280 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
281 saved backup bundle to $TESTTMP/fold-with-dropped/.hg/strip-backup/617f94f13c0f-backup.hg (glob)
281 saved backup bundle to $TESTTMP/fold-with-dropped/.hg/strip-backup/617f94f13c0f-backup.hg (glob)
282 $ hg log -G
282 $ hg log -G
283 @ changeset: 1:10c647b2cdd5
283 @ changeset: 1:10c647b2cdd5
284 | tag: tip
284 | tag: tip
285 | user: test
285 | user: test
286 | date: Thu Jan 01 00:00:00 1970 +0000
286 | date: Thu Jan 01 00:00:00 1970 +0000
287 | summary: +4
287 | summary: +4
288 |
288 |
289 o changeset: 0:0189ba417d34
289 o changeset: 0:0189ba417d34
290 user: test
290 user: test
291 date: Thu Jan 01 00:00:00 1970 +0000
291 date: Thu Jan 01 00:00:00 1970 +0000
292 summary: 1+2+3
292 summary: 1+2+3
293
293
294 $ hg export tip
294 $ hg export tip
295 # HG changeset patch
295 # HG changeset patch
296 # User test
296 # User test
297 # Date 0 0
297 # Date 0 0
298 # Thu Jan 01 00:00:00 1970 +0000
298 # Node ID 10c647b2cdd54db0603ecb99b2ff5ce66d5a5323
299 # Node ID 10c647b2cdd54db0603ecb99b2ff5ce66d5a5323
299 # Parent 0189ba417d34df9dda55f88b637dcae9917b5964
300 # Parent 0189ba417d34df9dda55f88b637dcae9917b5964
300 +4
301 +4
301 ***
302 ***
302 +5.2
303 +5.2
303 ***
304 ***
304 +6
305 +6
305
306
306 diff -r 0189ba417d34 -r 10c647b2cdd5 file
307 diff -r 0189ba417d34 -r 10c647b2cdd5 file
307 --- a/file Thu Jan 01 00:00:00 1970 +0000
308 --- a/file Thu Jan 01 00:00:00 1970 +0000
308 +++ b/file Thu Jan 01 00:00:00 1970 +0000
309 +++ b/file Thu Jan 01 00:00:00 1970 +0000
309 @@ -1,3 +1,6 @@
310 @@ -1,3 +1,6 @@
310 1
311 1
311 2
312 2
312 3
313 3
313 +4
314 +4
314 +5
315 +5
315 +6
316 +6
316 $ cd ..
317 $ cd ..
317
318
@@ -1,1158 +1,1159 b''
1 $ hg init a
1 $ hg init a
2 $ mkdir a/d1
2 $ mkdir a/d1
3 $ mkdir a/d1/d2
3 $ mkdir a/d1/d2
4 $ echo line 1 > a/a
4 $ echo line 1 > a/a
5 $ echo line 1 > a/d1/d2/a
5 $ echo line 1 > a/d1/d2/a
6 $ hg --cwd a ci -Ama
6 $ hg --cwd a ci -Ama
7 adding a
7 adding a
8 adding d1/d2/a
8 adding d1/d2/a
9
9
10 $ echo line 2 >> a/a
10 $ echo line 2 >> a/a
11 $ hg --cwd a ci -u someone -d '1 0' -m'second change'
11 $ hg --cwd a ci -u someone -d '1 0' -m'second change'
12
12
13 import with no args:
13 import with no args:
14
14
15 $ hg --cwd a import
15 $ hg --cwd a import
16 abort: need at least one patch to import
16 abort: need at least one patch to import
17 [255]
17 [255]
18
18
19 generate patches for the test
19 generate patches for the test
20
20
21 $ hg --cwd a export tip > exported-tip.patch
21 $ hg --cwd a export tip > exported-tip.patch
22 $ hg --cwd a diff -r0:1 > diffed-tip.patch
22 $ hg --cwd a diff -r0:1 > diffed-tip.patch
23
23
24
24
25 import exported patch
25 import exported patch
26
26
27 $ hg clone -r0 a b
27 $ hg clone -r0 a b
28 adding changesets
28 adding changesets
29 adding manifests
29 adding manifests
30 adding file changes
30 adding file changes
31 added 1 changesets with 2 changes to 2 files
31 added 1 changesets with 2 changes to 2 files
32 updating to branch default
32 updating to branch default
33 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 $ hg --cwd b import ../exported-tip.patch
34 $ hg --cwd b import ../exported-tip.patch
35 applying ../exported-tip.patch
35 applying ../exported-tip.patch
36
36
37 message and committer should be same
37 message and committer and date should be same
38
38
39 $ hg --cwd b tip
39 $ hg --cwd b tip
40 changeset: 1:1d4bd90af0e4
40 changeset: 1:1d4bd90af0e4
41 tag: tip
41 tag: tip
42 user: someone
42 user: someone
43 date: Thu Jan 01 00:00:01 1970 +0000
43 date: Thu Jan 01 00:00:01 1970 +0000
44 summary: second change
44 summary: second change
45
45
46 $ rm -r b
46 $ rm -r b
47
47
48
48
49 import exported patch with external patcher
49 import exported patch with external patcher
50
50
51 $ cat > dummypatch.py <<EOF
51 $ cat > dummypatch.py <<EOF
52 > print 'patching file a'
52 > print 'patching file a'
53 > file('a', 'wb').write('line2\n')
53 > file('a', 'wb').write('line2\n')
54 > EOF
54 > EOF
55 $ hg clone -r0 a b
55 $ hg clone -r0 a b
56 adding changesets
56 adding changesets
57 adding manifests
57 adding manifests
58 adding file changes
58 adding file changes
59 added 1 changesets with 2 changes to 2 files
59 added 1 changesets with 2 changes to 2 files
60 updating to branch default
60 updating to branch default
61 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 $ hg --config ui.patch='python ../dummypatch.py' --cwd b import ../exported-tip.patch
62 $ hg --config ui.patch='python ../dummypatch.py' --cwd b import ../exported-tip.patch
63 applying ../exported-tip.patch
63 applying ../exported-tip.patch
64 $ cat b/a
64 $ cat b/a
65 line2
65 line2
66 $ rm -r b
66 $ rm -r b
67
67
68
68
69 import of plain diff should fail without message
69 import of plain diff should fail without message
70
70
71 $ hg clone -r0 a b
71 $ hg clone -r0 a b
72 adding changesets
72 adding changesets
73 adding manifests
73 adding manifests
74 adding file changes
74 adding file changes
75 added 1 changesets with 2 changes to 2 files
75 added 1 changesets with 2 changes to 2 files
76 updating to branch default
76 updating to branch default
77 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 $ hg --cwd b import ../diffed-tip.patch
78 $ hg --cwd b import ../diffed-tip.patch
79 applying ../diffed-tip.patch
79 applying ../diffed-tip.patch
80 abort: empty commit message
80 abort: empty commit message
81 [255]
81 [255]
82 $ rm -r b
82 $ rm -r b
83
83
84
84
85 import of plain diff should be ok with message
85 import of plain diff should be ok with message
86
86
87 $ hg clone -r0 a b
87 $ hg clone -r0 a b
88 adding changesets
88 adding changesets
89 adding manifests
89 adding manifests
90 adding file changes
90 adding file changes
91 added 1 changesets with 2 changes to 2 files
91 added 1 changesets with 2 changes to 2 files
92 updating to branch default
92 updating to branch default
93 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
93 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
94 $ hg --cwd b import -mpatch ../diffed-tip.patch
94 $ hg --cwd b import -mpatch ../diffed-tip.patch
95 applying ../diffed-tip.patch
95 applying ../diffed-tip.patch
96 $ rm -r b
96 $ rm -r b
97
97
98
98
99 import of plain diff with specific date and user
99 import of plain diff with specific date and user
100
100
101 $ hg clone -r0 a b
101 $ hg clone -r0 a b
102 adding changesets
102 adding changesets
103 adding manifests
103 adding manifests
104 adding file changes
104 adding file changes
105 added 1 changesets with 2 changes to 2 files
105 added 1 changesets with 2 changes to 2 files
106 updating to branch default
106 updating to branch default
107 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
107 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
108 $ hg --cwd b import -mpatch -d '1 0' -u 'user@nowhere.net' ../diffed-tip.patch
108 $ hg --cwd b import -mpatch -d '1 0' -u 'user@nowhere.net' ../diffed-tip.patch
109 applying ../diffed-tip.patch
109 applying ../diffed-tip.patch
110 $ hg -R b tip -pv
110 $ hg -R b tip -pv
111 changeset: 1:ca68f19f3a40
111 changeset: 1:ca68f19f3a40
112 tag: tip
112 tag: tip
113 user: user@nowhere.net
113 user: user@nowhere.net
114 date: Thu Jan 01 00:00:01 1970 +0000
114 date: Thu Jan 01 00:00:01 1970 +0000
115 files: a
115 files: a
116 description:
116 description:
117 patch
117 patch
118
118
119
119
120 diff -r 80971e65b431 -r ca68f19f3a40 a
120 diff -r 80971e65b431 -r ca68f19f3a40 a
121 --- a/a Thu Jan 01 00:00:00 1970 +0000
121 --- a/a Thu Jan 01 00:00:00 1970 +0000
122 +++ b/a Thu Jan 01 00:00:01 1970 +0000
122 +++ b/a Thu Jan 01 00:00:01 1970 +0000
123 @@ -1,1 +1,2 @@
123 @@ -1,1 +1,2 @@
124 line 1
124 line 1
125 +line 2
125 +line 2
126
126
127 $ rm -r b
127 $ rm -r b
128
128
129
129
130 import of plain diff should be ok with --no-commit
130 import of plain diff should be ok with --no-commit
131
131
132 $ hg clone -r0 a b
132 $ hg clone -r0 a b
133 adding changesets
133 adding changesets
134 adding manifests
134 adding manifests
135 adding file changes
135 adding file changes
136 added 1 changesets with 2 changes to 2 files
136 added 1 changesets with 2 changes to 2 files
137 updating to branch default
137 updating to branch default
138 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
138 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
139 $ hg --cwd b import --no-commit ../diffed-tip.patch
139 $ hg --cwd b import --no-commit ../diffed-tip.patch
140 applying ../diffed-tip.patch
140 applying ../diffed-tip.patch
141 $ hg --cwd b diff --nodates
141 $ hg --cwd b diff --nodates
142 diff -r 80971e65b431 a
142 diff -r 80971e65b431 a
143 --- a/a
143 --- a/a
144 +++ b/a
144 +++ b/a
145 @@ -1,1 +1,2 @@
145 @@ -1,1 +1,2 @@
146 line 1
146 line 1
147 +line 2
147 +line 2
148 $ rm -r b
148 $ rm -r b
149
149
150
150
151 import of malformed plain diff should fail
151 import of malformed plain diff should fail
152
152
153 $ hg clone -r0 a b
153 $ hg clone -r0 a b
154 adding changesets
154 adding changesets
155 adding manifests
155 adding manifests
156 adding file changes
156 adding file changes
157 added 1 changesets with 2 changes to 2 files
157 added 1 changesets with 2 changes to 2 files
158 updating to branch default
158 updating to branch default
159 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
160 $ sed 's/1,1/foo/' < diffed-tip.patch > broken.patch
160 $ sed 's/1,1/foo/' < diffed-tip.patch > broken.patch
161 $ hg --cwd b import -mpatch ../broken.patch
161 $ hg --cwd b import -mpatch ../broken.patch
162 applying ../broken.patch
162 applying ../broken.patch
163 abort: bad hunk #1
163 abort: bad hunk #1
164 [255]
164 [255]
165 $ rm -r b
165 $ rm -r b
166
166
167
167
168 hg -R repo import
168 hg -R repo import
169 put the clone in a subdir - having a directory named "a"
169 put the clone in a subdir - having a directory named "a"
170 used to hide a bug.
170 used to hide a bug.
171
171
172 $ mkdir dir
172 $ mkdir dir
173 $ hg clone -r0 a dir/b
173 $ hg clone -r0 a dir/b
174 adding changesets
174 adding changesets
175 adding manifests
175 adding manifests
176 adding file changes
176 adding file changes
177 added 1 changesets with 2 changes to 2 files
177 added 1 changesets with 2 changes to 2 files
178 updating to branch default
178 updating to branch default
179 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
179 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
180 $ cd dir
180 $ cd dir
181 $ hg -R b import ../exported-tip.patch
181 $ hg -R b import ../exported-tip.patch
182 applying ../exported-tip.patch
182 applying ../exported-tip.patch
183 $ cd ..
183 $ cd ..
184 $ rm -r dir
184 $ rm -r dir
185
185
186
186
187 import from stdin
187 import from stdin
188
188
189 $ hg clone -r0 a b
189 $ hg clone -r0 a b
190 adding changesets
190 adding changesets
191 adding manifests
191 adding manifests
192 adding file changes
192 adding file changes
193 added 1 changesets with 2 changes to 2 files
193 added 1 changesets with 2 changes to 2 files
194 updating to branch default
194 updating to branch default
195 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
195 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
196 $ hg --cwd b import - < exported-tip.patch
196 $ hg --cwd b import - < exported-tip.patch
197 applying patch from stdin
197 applying patch from stdin
198 $ rm -r b
198 $ rm -r b
199
199
200
200
201 import two patches in one stream
201 import two patches in one stream
202
202
203 $ hg init b
203 $ hg init b
204 $ hg --cwd a export 0:tip | hg --cwd b import -
204 $ hg --cwd a export 0:tip | hg --cwd b import -
205 applying patch from stdin
205 applying patch from stdin
206 $ hg --cwd a id
206 $ hg --cwd a id
207 1d4bd90af0e4 tip
207 1d4bd90af0e4 tip
208 $ hg --cwd b id
208 $ hg --cwd b id
209 1d4bd90af0e4 tip
209 1d4bd90af0e4 tip
210 $ rm -r b
210 $ rm -r b
211
211
212
212
213 override commit message
213 override commit message
214
214
215 $ hg clone -r0 a b
215 $ hg clone -r0 a b
216 adding changesets
216 adding changesets
217 adding manifests
217 adding manifests
218 adding file changes
218 adding file changes
219 added 1 changesets with 2 changes to 2 files
219 added 1 changesets with 2 changes to 2 files
220 updating to branch default
220 updating to branch default
221 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
221 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
222 $ hg --cwd b import -m 'override' - < exported-tip.patch
222 $ hg --cwd b import -m 'override' - < exported-tip.patch
223 applying patch from stdin
223 applying patch from stdin
224 $ hg --cwd b tip | grep override
224 $ hg --cwd b tip | grep override
225 summary: override
225 summary: override
226 $ rm -r b
226 $ rm -r b
227
227
228 $ cat > mkmsg.py <<EOF
228 $ cat > mkmsg.py <<EOF
229 > import email.Message, sys
229 > import email.Message, sys
230 > msg = email.Message.Message()
230 > msg = email.Message.Message()
231 > patch = open(sys.argv[1], 'rb').read()
231 > patch = open(sys.argv[1], 'rb').read()
232 > msg.set_payload('email commit message\n' + patch)
232 > msg.set_payload('email commit message\n' + patch)
233 > msg['Subject'] = 'email patch'
233 > msg['Subject'] = 'email patch'
234 > msg['From'] = 'email patcher'
234 > msg['From'] = 'email patcher'
235 > file(sys.argv[2], 'wb').write(msg.as_string())
235 > file(sys.argv[2], 'wb').write(msg.as_string())
236 > EOF
236 > EOF
237
237
238
238
239 plain diff in email, subject, message body
239 plain diff in email, subject, message body
240
240
241 $ hg clone -r0 a b
241 $ hg clone -r0 a b
242 adding changesets
242 adding changesets
243 adding manifests
243 adding manifests
244 adding file changes
244 adding file changes
245 added 1 changesets with 2 changes to 2 files
245 added 1 changesets with 2 changes to 2 files
246 updating to branch default
246 updating to branch default
247 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
247 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
248 $ python mkmsg.py diffed-tip.patch msg.patch
248 $ python mkmsg.py diffed-tip.patch msg.patch
249 $ hg --cwd b import ../msg.patch
249 $ hg --cwd b import ../msg.patch
250 applying ../msg.patch
250 applying ../msg.patch
251 $ hg --cwd b tip | grep email
251 $ hg --cwd b tip | grep email
252 user: email patcher
252 user: email patcher
253 summary: email patch
253 summary: email patch
254 $ rm -r b
254 $ rm -r b
255
255
256
256
257 plain diff in email, no subject, message body
257 plain diff in email, no subject, message body
258
258
259 $ hg clone -r0 a b
259 $ hg clone -r0 a b
260 adding changesets
260 adding changesets
261 adding manifests
261 adding manifests
262 adding file changes
262 adding file changes
263 added 1 changesets with 2 changes to 2 files
263 added 1 changesets with 2 changes to 2 files
264 updating to branch default
264 updating to branch default
265 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
265 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
266 $ grep -v '^Subject:' msg.patch | hg --cwd b import -
266 $ grep -v '^Subject:' msg.patch | hg --cwd b import -
267 applying patch from stdin
267 applying patch from stdin
268 $ rm -r b
268 $ rm -r b
269
269
270
270
271 plain diff in email, subject, no message body
271 plain diff in email, subject, no message body
272
272
273 $ hg clone -r0 a b
273 $ hg clone -r0 a b
274 adding changesets
274 adding changesets
275 adding manifests
275 adding manifests
276 adding file changes
276 adding file changes
277 added 1 changesets with 2 changes to 2 files
277 added 1 changesets with 2 changes to 2 files
278 updating to branch default
278 updating to branch default
279 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
279 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
280 $ grep -v '^email ' msg.patch | hg --cwd b import -
280 $ grep -v '^email ' msg.patch | hg --cwd b import -
281 applying patch from stdin
281 applying patch from stdin
282 $ rm -r b
282 $ rm -r b
283
283
284
284
285 plain diff in email, no subject, no message body, should fail
285 plain diff in email, no subject, no message body, should fail
286
286
287 $ hg clone -r0 a b
287 $ hg clone -r0 a b
288 adding changesets
288 adding changesets
289 adding manifests
289 adding manifests
290 adding file changes
290 adding file changes
291 added 1 changesets with 2 changes to 2 files
291 added 1 changesets with 2 changes to 2 files
292 updating to branch default
292 updating to branch default
293 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
293 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
294 $ egrep -v '^(Subject|email)' msg.patch | hg --cwd b import -
294 $ egrep -v '^(Subject|email)' msg.patch | hg --cwd b import -
295 applying patch from stdin
295 applying patch from stdin
296 abort: empty commit message
296 abort: empty commit message
297 [255]
297 [255]
298 $ rm -r b
298 $ rm -r b
299
299
300
300
301 hg export in email, should use patch header
301 hg export in email, should use patch header
302
302
303 $ hg clone -r0 a b
303 $ hg clone -r0 a b
304 adding changesets
304 adding changesets
305 adding manifests
305 adding manifests
306 adding file changes
306 adding file changes
307 added 1 changesets with 2 changes to 2 files
307 added 1 changesets with 2 changes to 2 files
308 updating to branch default
308 updating to branch default
309 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
309 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
310 $ python mkmsg.py exported-tip.patch msg.patch
310 $ python mkmsg.py exported-tip.patch msg.patch
311 $ cat msg.patch | hg --cwd b import -
311 $ cat msg.patch | hg --cwd b import -
312 applying patch from stdin
312 applying patch from stdin
313 $ hg --cwd b tip | grep second
313 $ hg --cwd b tip | grep second
314 summary: second change
314 summary: second change
315 $ rm -r b
315 $ rm -r b
316
316
317
317
318 subject: duplicate detection, removal of [PATCH]
318 subject: duplicate detection, removal of [PATCH]
319 The '---' tests the gitsendmail handling without proper mail headers
319 The '---' tests the gitsendmail handling without proper mail headers
320
320
321 $ cat > mkmsg2.py <<EOF
321 $ cat > mkmsg2.py <<EOF
322 > import email.Message, sys
322 > import email.Message, sys
323 > msg = email.Message.Message()
323 > msg = email.Message.Message()
324 > patch = open(sys.argv[1], 'rb').read()
324 > patch = open(sys.argv[1], 'rb').read()
325 > msg.set_payload('email patch\n\nnext line\n---\n' + patch)
325 > msg.set_payload('email patch\n\nnext line\n---\n' + patch)
326 > msg['Subject'] = '[PATCH] email patch'
326 > msg['Subject'] = '[PATCH] email patch'
327 > msg['From'] = 'email patcher'
327 > msg['From'] = 'email patcher'
328 > file(sys.argv[2], 'wb').write(msg.as_string())
328 > file(sys.argv[2], 'wb').write(msg.as_string())
329 > EOF
329 > EOF
330
330
331
331
332 plain diff in email, [PATCH] subject, message body with subject
332 plain diff in email, [PATCH] subject, message body with subject
333
333
334 $ hg clone -r0 a b
334 $ hg clone -r0 a b
335 adding changesets
335 adding changesets
336 adding manifests
336 adding manifests
337 adding file changes
337 adding file changes
338 added 1 changesets with 2 changes to 2 files
338 added 1 changesets with 2 changes to 2 files
339 updating to branch default
339 updating to branch default
340 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
340 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
341 $ python mkmsg2.py diffed-tip.patch msg.patch
341 $ python mkmsg2.py diffed-tip.patch msg.patch
342 $ cat msg.patch | hg --cwd b import -
342 $ cat msg.patch | hg --cwd b import -
343 applying patch from stdin
343 applying patch from stdin
344 $ hg --cwd b tip --template '{desc}\n'
344 $ hg --cwd b tip --template '{desc}\n'
345 email patch
345 email patch
346
346
347 next line
347 next line
348 ---
348 ---
349 $ rm -r b
349 $ rm -r b
350
350
351
351
352 Issue963: Parent of working dir incorrect after import of multiple
352 Issue963: Parent of working dir incorrect after import of multiple
353 patches and rollback
353 patches and rollback
354
354
355 We weren't backing up the correct dirstate file when importing many
355 We weren't backing up the correct dirstate file when importing many
356 patches: import patch1 patch2; rollback
356 patches: import patch1 patch2; rollback
357
357
358 $ echo line 3 >> a/a
358 $ echo line 3 >> a/a
359 $ hg --cwd a ci -m'third change'
359 $ hg --cwd a ci -m'third change'
360 $ hg --cwd a export -o '../patch%R' 1 2
360 $ hg --cwd a export -o '../patch%R' 1 2
361 $ hg clone -qr0 a b
361 $ hg clone -qr0 a b
362 $ hg --cwd b parents --template 'parent: {rev}\n'
362 $ hg --cwd b parents --template 'parent: {rev}\n'
363 parent: 0
363 parent: 0
364 $ hg --cwd b import -v ../patch1 ../patch2
364 $ hg --cwd b import -v ../patch1 ../patch2
365 applying ../patch1
365 applying ../patch1
366 patching file a
366 patching file a
367 a
367 a
368 created 1d4bd90af0e4
368 created 1d4bd90af0e4
369 applying ../patch2
369 applying ../patch2
370 patching file a
370 patching file a
371 a
371 a
372 created 6d019af21222
372 created 6d019af21222
373 $ hg --cwd b rollback
373 $ hg --cwd b rollback
374 repository tip rolled back to revision 0 (undo import)
374 repository tip rolled back to revision 0 (undo import)
375 working directory now based on revision 0
375 working directory now based on revision 0
376 $ hg --cwd b parents --template 'parent: {rev}\n'
376 $ hg --cwd b parents --template 'parent: {rev}\n'
377 parent: 0
377 parent: 0
378 $ rm -r b
378 $ rm -r b
379
379
380
380
381 importing a patch in a subdirectory failed at the commit stage
381 importing a patch in a subdirectory failed at the commit stage
382
382
383 $ echo line 2 >> a/d1/d2/a
383 $ echo line 2 >> a/d1/d2/a
384 $ hg --cwd a ci -u someoneelse -d '1 0' -m'subdir change'
384 $ hg --cwd a ci -u someoneelse -d '1 0' -m'subdir change'
385
385
386 hg import in a subdirectory
386 hg import in a subdirectory
387
387
388 $ hg clone -r0 a b
388 $ hg clone -r0 a b
389 adding changesets
389 adding changesets
390 adding manifests
390 adding manifests
391 adding file changes
391 adding file changes
392 added 1 changesets with 2 changes to 2 files
392 added 1 changesets with 2 changes to 2 files
393 updating to branch default
393 updating to branch default
394 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
394 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
395 $ hg --cwd a export tip > tmp
395 $ hg --cwd a export tip > tmp
396 $ sed -e 's/d1\/d2\///' < tmp > subdir-tip.patch
396 $ sed -e 's/d1\/d2\///' < tmp > subdir-tip.patch
397 $ dir=`pwd`
397 $ dir=`pwd`
398 $ cd b/d1/d2 2>&1 > /dev/null
398 $ cd b/d1/d2 2>&1 > /dev/null
399 $ hg import ../../../subdir-tip.patch
399 $ hg import ../../../subdir-tip.patch
400 applying ../../../subdir-tip.patch
400 applying ../../../subdir-tip.patch
401 $ cd "$dir"
401 $ cd "$dir"
402
402
403 message should be 'subdir change'
403 message should be 'subdir change'
404 committer should be 'someoneelse'
404 committer should be 'someoneelse'
405
405
406 $ hg --cwd b tip
406 $ hg --cwd b tip
407 changeset: 1:3577f5aea227
407 changeset: 1:3577f5aea227
408 tag: tip
408 tag: tip
409 user: someoneelse
409 user: someoneelse
410 date: Thu Jan 01 00:00:01 1970 +0000
410 date: Thu Jan 01 00:00:01 1970 +0000
411 summary: subdir change
411 summary: subdir change
412
412
413
413
414 should be empty
414 should be empty
415
415
416 $ hg --cwd b status
416 $ hg --cwd b status
417
417
418
418
419 Test fuzziness (ambiguous patch location, fuzz=2)
419 Test fuzziness (ambiguous patch location, fuzz=2)
420
420
421 $ hg init fuzzy
421 $ hg init fuzzy
422 $ cd fuzzy
422 $ cd fuzzy
423 $ echo line1 > a
423 $ echo line1 > a
424 $ echo line0 >> a
424 $ echo line0 >> a
425 $ echo line3 >> a
425 $ echo line3 >> a
426 $ hg ci -Am adda
426 $ hg ci -Am adda
427 adding a
427 adding a
428 $ echo line1 > a
428 $ echo line1 > a
429 $ echo line2 >> a
429 $ echo line2 >> a
430 $ echo line0 >> a
430 $ echo line0 >> a
431 $ echo line3 >> a
431 $ echo line3 >> a
432 $ hg ci -m change a
432 $ hg ci -m change a
433 $ hg export tip > fuzzy-tip.patch
433 $ hg export tip > fuzzy-tip.patch
434 $ hg up -C 0
434 $ hg up -C 0
435 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
435 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
436 $ echo line1 > a
436 $ echo line1 > a
437 $ echo line0 >> a
437 $ echo line0 >> a
438 $ echo line1 >> a
438 $ echo line1 >> a
439 $ echo line0 >> a
439 $ echo line0 >> a
440 $ hg ci -m brancha
440 $ hg ci -m brancha
441 created new head
441 created new head
442 $ hg import --no-commit -v fuzzy-tip.patch
442 $ hg import --no-commit -v fuzzy-tip.patch
443 applying fuzzy-tip.patch
443 applying fuzzy-tip.patch
444 patching file a
444 patching file a
445 Hunk #1 succeeded at 2 with fuzz 1 (offset 0 lines).
445 Hunk #1 succeeded at 2 with fuzz 1 (offset 0 lines).
446 applied to working directory
446 applied to working directory
447 $ hg revert -a
447 $ hg revert -a
448 reverting a
448 reverting a
449
449
450
450
451 import with --no-commit should have written .hg/last-message.txt
451 import with --no-commit should have written .hg/last-message.txt
452
452
453 $ cat .hg/last-message.txt
453 $ cat .hg/last-message.txt
454 change (no-eol)
454 change (no-eol)
455
455
456
456
457 test fuzziness with eol=auto
457 test fuzziness with eol=auto
458
458
459 $ hg --config patch.eol=auto import --no-commit -v fuzzy-tip.patch
459 $ hg --config patch.eol=auto import --no-commit -v fuzzy-tip.patch
460 applying fuzzy-tip.patch
460 applying fuzzy-tip.patch
461 patching file a
461 patching file a
462 Hunk #1 succeeded at 2 with fuzz 1 (offset 0 lines).
462 Hunk #1 succeeded at 2 with fuzz 1 (offset 0 lines).
463 applied to working directory
463 applied to working directory
464 $ cd ..
464 $ cd ..
465
465
466
466
467 Test hunk touching empty files (issue906)
467 Test hunk touching empty files (issue906)
468
468
469 $ hg init empty
469 $ hg init empty
470 $ cd empty
470 $ cd empty
471 $ touch a
471 $ touch a
472 $ touch b1
472 $ touch b1
473 $ touch c1
473 $ touch c1
474 $ echo d > d
474 $ echo d > d
475 $ hg ci -Am init
475 $ hg ci -Am init
476 adding a
476 adding a
477 adding b1
477 adding b1
478 adding c1
478 adding c1
479 adding d
479 adding d
480 $ echo a > a
480 $ echo a > a
481 $ echo b > b1
481 $ echo b > b1
482 $ hg mv b1 b2
482 $ hg mv b1 b2
483 $ echo c > c1
483 $ echo c > c1
484 $ hg copy c1 c2
484 $ hg copy c1 c2
485 $ rm d
485 $ rm d
486 $ touch d
486 $ touch d
487 $ hg diff --git
487 $ hg diff --git
488 diff --git a/a b/a
488 diff --git a/a b/a
489 --- a/a
489 --- a/a
490 +++ b/a
490 +++ b/a
491 @@ -0,0 +1,1 @@
491 @@ -0,0 +1,1 @@
492 +a
492 +a
493 diff --git a/b1 b/b2
493 diff --git a/b1 b/b2
494 rename from b1
494 rename from b1
495 rename to b2
495 rename to b2
496 --- a/b1
496 --- a/b1
497 +++ b/b2
497 +++ b/b2
498 @@ -0,0 +1,1 @@
498 @@ -0,0 +1,1 @@
499 +b
499 +b
500 diff --git a/c1 b/c1
500 diff --git a/c1 b/c1
501 --- a/c1
501 --- a/c1
502 +++ b/c1
502 +++ b/c1
503 @@ -0,0 +1,1 @@
503 @@ -0,0 +1,1 @@
504 +c
504 +c
505 diff --git a/c1 b/c2
505 diff --git a/c1 b/c2
506 copy from c1
506 copy from c1
507 copy to c2
507 copy to c2
508 --- a/c1
508 --- a/c1
509 +++ b/c2
509 +++ b/c2
510 @@ -0,0 +1,1 @@
510 @@ -0,0 +1,1 @@
511 +c
511 +c
512 diff --git a/d b/d
512 diff --git a/d b/d
513 --- a/d
513 --- a/d
514 +++ b/d
514 +++ b/d
515 @@ -1,1 +0,0 @@
515 @@ -1,1 +0,0 @@
516 -d
516 -d
517 $ hg ci -m empty
517 $ hg ci -m empty
518 $ hg export --git tip > empty.diff
518 $ hg export --git tip > empty.diff
519 $ hg up -C 0
519 $ hg up -C 0
520 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
520 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
521 $ hg import empty.diff
521 $ hg import empty.diff
522 applying empty.diff
522 applying empty.diff
523 $ for name in a b1 b2 c1 c2 d; do
523 $ for name in a b1 b2 c1 c2 d; do
524 > echo % $name file
524 > echo % $name file
525 > test -f $name && cat $name
525 > test -f $name && cat $name
526 > done
526 > done
527 % a file
527 % a file
528 a
528 a
529 % b1 file
529 % b1 file
530 % b2 file
530 % b2 file
531 b
531 b
532 % c1 file
532 % c1 file
533 c
533 c
534 % c2 file
534 % c2 file
535 c
535 c
536 % d file
536 % d file
537 $ cd ..
537 $ cd ..
538
538
539
539
540 Test importing a patch ending with a binary file removal
540 Test importing a patch ending with a binary file removal
541
541
542 $ hg init binaryremoval
542 $ hg init binaryremoval
543 $ cd binaryremoval
543 $ cd binaryremoval
544 $ echo a > a
544 $ echo a > a
545 $ python -c "file('b', 'wb').write('a\x00b')"
545 $ python -c "file('b', 'wb').write('a\x00b')"
546 $ hg ci -Am addall
546 $ hg ci -Am addall
547 adding a
547 adding a
548 adding b
548 adding b
549 $ hg rm a
549 $ hg rm a
550 $ hg rm b
550 $ hg rm b
551 $ hg st
551 $ hg st
552 R a
552 R a
553 R b
553 R b
554 $ hg ci -m remove
554 $ hg ci -m remove
555 $ hg export --git . > remove.diff
555 $ hg export --git . > remove.diff
556 $ cat remove.diff | grep git
556 $ cat remove.diff | grep git
557 diff --git a/a b/a
557 diff --git a/a b/a
558 diff --git a/b b/b
558 diff --git a/b b/b
559 $ hg up -C 0
559 $ hg up -C 0
560 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
560 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
561 $ hg import remove.diff
561 $ hg import remove.diff
562 applying remove.diff
562 applying remove.diff
563 $ hg manifest
563 $ hg manifest
564 $ cd ..
564 $ cd ..
565
565
566
566
567 Issue927: test update+rename with common name
567 Issue927: test update+rename with common name
568
568
569 $ hg init t
569 $ hg init t
570 $ cd t
570 $ cd t
571 $ touch a
571 $ touch a
572 $ hg ci -Am t
572 $ hg ci -Am t
573 adding a
573 adding a
574 $ echo a > a
574 $ echo a > a
575
575
576 Here, bfile.startswith(afile)
576 Here, bfile.startswith(afile)
577
577
578 $ hg copy a a2
578 $ hg copy a a2
579 $ hg ci -m copya
579 $ hg ci -m copya
580 $ hg export --git tip > copy.diff
580 $ hg export --git tip > copy.diff
581 $ hg up -C 0
581 $ hg up -C 0
582 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
582 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
583 $ hg import copy.diff
583 $ hg import copy.diff
584 applying copy.diff
584 applying copy.diff
585
585
586 a should contain an 'a'
586 a should contain an 'a'
587
587
588 $ cat a
588 $ cat a
589 a
589 a
590
590
591 and a2 should have duplicated it
591 and a2 should have duplicated it
592
592
593 $ cat a2
593 $ cat a2
594 a
594 a
595 $ cd ..
595 $ cd ..
596
596
597
597
598 test -p0
598 test -p0
599
599
600 $ hg init p0
600 $ hg init p0
601 $ cd p0
601 $ cd p0
602 $ echo a > a
602 $ echo a > a
603 $ hg ci -Am t
603 $ hg ci -Am t
604 adding a
604 adding a
605 $ hg import -p foo
605 $ hg import -p foo
606 abort: invalid value 'foo' for option -p, expected int
606 abort: invalid value 'foo' for option -p, expected int
607 [255]
607 [255]
608 $ hg import -p0 - << EOF
608 $ hg import -p0 - << EOF
609 > foobar
609 > foobar
610 > --- a Sat Apr 12 22:43:58 2008 -0400
610 > --- a Sat Apr 12 22:43:58 2008 -0400
611 > +++ a Sat Apr 12 22:44:05 2008 -0400
611 > +++ a Sat Apr 12 22:44:05 2008 -0400
612 > @@ -1,1 +1,1 @@
612 > @@ -1,1 +1,1 @@
613 > -a
613 > -a
614 > +bb
614 > +bb
615 > EOF
615 > EOF
616 applying patch from stdin
616 applying patch from stdin
617 $ hg status
617 $ hg status
618 $ cat a
618 $ cat a
619 bb
619 bb
620 $ cd ..
620 $ cd ..
621
621
622
622
623 test paths outside repo root
623 test paths outside repo root
624
624
625 $ mkdir outside
625 $ mkdir outside
626 $ touch outside/foo
626 $ touch outside/foo
627 $ hg init inside
627 $ hg init inside
628 $ cd inside
628 $ cd inside
629 $ hg import - <<EOF
629 $ hg import - <<EOF
630 > diff --git a/a b/b
630 > diff --git a/a b/b
631 > rename from ../outside/foo
631 > rename from ../outside/foo
632 > rename to bar
632 > rename to bar
633 > EOF
633 > EOF
634 applying patch from stdin
634 applying patch from stdin
635 abort: path contains illegal component: ../outside/foo (glob)
635 abort: path contains illegal component: ../outside/foo (glob)
636 [255]
636 [255]
637 $ cd ..
637 $ cd ..
638
638
639
639
640 test import with similarity and git and strip (issue295 et al.)
640 test import with similarity and git and strip (issue295 et al.)
641
641
642 $ hg init sim
642 $ hg init sim
643 $ cd sim
643 $ cd sim
644 $ echo 'this is a test' > a
644 $ echo 'this is a test' > a
645 $ hg ci -Ama
645 $ hg ci -Ama
646 adding a
646 adding a
647 $ cat > ../rename.diff <<EOF
647 $ cat > ../rename.diff <<EOF
648 > diff --git a/foo/a b/foo/a
648 > diff --git a/foo/a b/foo/a
649 > deleted file mode 100644
649 > deleted file mode 100644
650 > --- a/foo/a
650 > --- a/foo/a
651 > +++ /dev/null
651 > +++ /dev/null
652 > @@ -1,1 +0,0 @@
652 > @@ -1,1 +0,0 @@
653 > -this is a test
653 > -this is a test
654 > diff --git a/foo/b b/foo/b
654 > diff --git a/foo/b b/foo/b
655 > new file mode 100644
655 > new file mode 100644
656 > --- /dev/null
656 > --- /dev/null
657 > +++ b/foo/b
657 > +++ b/foo/b
658 > @@ -0,0 +1,2 @@
658 > @@ -0,0 +1,2 @@
659 > +this is a test
659 > +this is a test
660 > +foo
660 > +foo
661 > EOF
661 > EOF
662 $ hg import --no-commit -v -s 1 ../rename.diff -p2
662 $ hg import --no-commit -v -s 1 ../rename.diff -p2
663 applying ../rename.diff
663 applying ../rename.diff
664 patching file a
664 patching file a
665 patching file b
665 patching file b
666 adding b
666 adding b
667 recording removal of a as rename to b (88% similar)
667 recording removal of a as rename to b (88% similar)
668 applied to working directory
668 applied to working directory
669 $ hg st -C
669 $ hg st -C
670 A b
670 A b
671 a
671 a
672 R a
672 R a
673 $ hg revert -a
673 $ hg revert -a
674 undeleting a
674 undeleting a
675 forgetting b
675 forgetting b
676 $ rm b
676 $ rm b
677 $ hg import --no-commit -v -s 100 ../rename.diff -p2
677 $ hg import --no-commit -v -s 100 ../rename.diff -p2
678 applying ../rename.diff
678 applying ../rename.diff
679 patching file a
679 patching file a
680 patching file b
680 patching file b
681 adding b
681 adding b
682 applied to working directory
682 applied to working directory
683 $ hg st -C
683 $ hg st -C
684 A b
684 A b
685 R a
685 R a
686 $ cd ..
686 $ cd ..
687
687
688
688
689 Issue1495: add empty file from the end of patch
689 Issue1495: add empty file from the end of patch
690
690
691 $ hg init addemptyend
691 $ hg init addemptyend
692 $ cd addemptyend
692 $ cd addemptyend
693 $ touch a
693 $ touch a
694 $ hg addremove
694 $ hg addremove
695 adding a
695 adding a
696 $ hg ci -m "commit"
696 $ hg ci -m "commit"
697 $ cat > a.patch <<EOF
697 $ cat > a.patch <<EOF
698 > add a, b
698 > add a, b
699 > diff --git a/a b/a
699 > diff --git a/a b/a
700 > --- a/a
700 > --- a/a
701 > +++ b/a
701 > +++ b/a
702 > @@ -0,0 +1,1 @@
702 > @@ -0,0 +1,1 @@
703 > +a
703 > +a
704 > diff --git a/b b/b
704 > diff --git a/b b/b
705 > new file mode 100644
705 > new file mode 100644
706 > EOF
706 > EOF
707 $ hg import --no-commit a.patch
707 $ hg import --no-commit a.patch
708 applying a.patch
708 applying a.patch
709
709
710 apply a good patch followed by an empty patch (mainly to ensure
710 apply a good patch followed by an empty patch (mainly to ensure
711 that dirstate is *not* updated when import crashes)
711 that dirstate is *not* updated when import crashes)
712 $ hg update -q -C .
712 $ hg update -q -C .
713 $ rm b
713 $ rm b
714 $ touch empty.patch
714 $ touch empty.patch
715 $ hg import a.patch empty.patch
715 $ hg import a.patch empty.patch
716 applying a.patch
716 applying a.patch
717 applying empty.patch
717 applying empty.patch
718 transaction abort!
718 transaction abort!
719 rollback completed
719 rollback completed
720 abort: empty.patch: no diffs found
720 abort: empty.patch: no diffs found
721 [255]
721 [255]
722 $ hg tip --template '{rev} {desc|firstline}\n'
722 $ hg tip --template '{rev} {desc|firstline}\n'
723 0 commit
723 0 commit
724 $ hg -q status
724 $ hg -q status
725 M a
725 M a
726 $ cd ..
726 $ cd ..
727
727
728 create file when source is not /dev/null
728 create file when source is not /dev/null
729
729
730 $ cat > create.patch <<EOF
730 $ cat > create.patch <<EOF
731 > diff -Naur proj-orig/foo proj-new/foo
731 > diff -Naur proj-orig/foo proj-new/foo
732 > --- proj-orig/foo 1969-12-31 16:00:00.000000000 -0800
732 > --- proj-orig/foo 1969-12-31 16:00:00.000000000 -0800
733 > +++ proj-new/foo 2009-07-17 16:50:45.801368000 -0700
733 > +++ proj-new/foo 2009-07-17 16:50:45.801368000 -0700
734 > @@ -0,0 +1,1 @@
734 > @@ -0,0 +1,1 @@
735 > +a
735 > +a
736 > EOF
736 > EOF
737
737
738 some people have patches like the following too
738 some people have patches like the following too
739
739
740 $ cat > create2.patch <<EOF
740 $ cat > create2.patch <<EOF
741 > diff -Naur proj-orig/foo proj-new/foo
741 > diff -Naur proj-orig/foo proj-new/foo
742 > --- proj-orig/foo.orig 1969-12-31 16:00:00.000000000 -0800
742 > --- proj-orig/foo.orig 1969-12-31 16:00:00.000000000 -0800
743 > +++ proj-new/foo 2009-07-17 16:50:45.801368000 -0700
743 > +++ proj-new/foo 2009-07-17 16:50:45.801368000 -0700
744 > @@ -0,0 +1,1 @@
744 > @@ -0,0 +1,1 @@
745 > +a
745 > +a
746 > EOF
746 > EOF
747 $ hg init oddcreate
747 $ hg init oddcreate
748 $ cd oddcreate
748 $ cd oddcreate
749 $ hg import --no-commit ../create.patch
749 $ hg import --no-commit ../create.patch
750 applying ../create.patch
750 applying ../create.patch
751 $ cat foo
751 $ cat foo
752 a
752 a
753 $ rm foo
753 $ rm foo
754 $ hg revert foo
754 $ hg revert foo
755 $ hg import --no-commit ../create2.patch
755 $ hg import --no-commit ../create2.patch
756 applying ../create2.patch
756 applying ../create2.patch
757 $ cat foo
757 $ cat foo
758 a
758 a
759
759
760 $ cd ..
760 $ cd ..
761
761
762 Issue1859: first line mistaken for email headers
762 Issue1859: first line mistaken for email headers
763
763
764 $ hg init emailconfusion
764 $ hg init emailconfusion
765 $ cd emailconfusion
765 $ cd emailconfusion
766 $ cat > a.patch <<EOF
766 $ cat > a.patch <<EOF
767 > module: summary
767 > module: summary
768 >
768 >
769 > description
769 > description
770 >
770 >
771 >
771 >
772 > diff -r 000000000000 -r 9b4c1e343b55 test.txt
772 > diff -r 000000000000 -r 9b4c1e343b55 test.txt
773 > --- /dev/null
773 > --- /dev/null
774 > +++ b/a
774 > +++ b/a
775 > @@ -0,0 +1,1 @@
775 > @@ -0,0 +1,1 @@
776 > +a
776 > +a
777 > EOF
777 > EOF
778 $ hg import -d '0 0' a.patch
778 $ hg import -d '0 0' a.patch
779 applying a.patch
779 applying a.patch
780 $ hg parents -v
780 $ hg parents -v
781 changeset: 0:5a681217c0ad
781 changeset: 0:5a681217c0ad
782 tag: tip
782 tag: tip
783 user: test
783 user: test
784 date: Thu Jan 01 00:00:00 1970 +0000
784 date: Thu Jan 01 00:00:00 1970 +0000
785 files: a
785 files: a
786 description:
786 description:
787 module: summary
787 module: summary
788
788
789 description
789 description
790
790
791
791
792 $ cd ..
792 $ cd ..
793
793
794
794
795 in commit message
795 in commit message
796
796
797 $ hg init commitconfusion
797 $ hg init commitconfusion
798 $ cd commitconfusion
798 $ cd commitconfusion
799 $ cat > a.patch <<EOF
799 $ cat > a.patch <<EOF
800 > module: summary
800 > module: summary
801 >
801 >
802 > --- description
802 > --- description
803 >
803 >
804 > diff --git a/a b/a
804 > diff --git a/a b/a
805 > new file mode 100644
805 > new file mode 100644
806 > --- /dev/null
806 > --- /dev/null
807 > +++ b/a
807 > +++ b/a
808 > @@ -0,0 +1,1 @@
808 > @@ -0,0 +1,1 @@
809 > +a
809 > +a
810 > EOF
810 > EOF
811 > hg import -d '0 0' a.patch
811 > hg import -d '0 0' a.patch
812 > hg parents -v
812 > hg parents -v
813 > cd ..
813 > cd ..
814 >
814 >
815 > echo '% tricky header splitting'
815 > echo '% tricky header splitting'
816 > cat > trickyheaders.patch <<EOF
816 > cat > trickyheaders.patch <<EOF
817 > From: User A <user@a>
817 > From: User A <user@a>
818 > Subject: [PATCH] from: tricky!
818 > Subject: [PATCH] from: tricky!
819 >
819 >
820 > # HG changeset patch
820 > # HG changeset patch
821 > # User User B
821 > # User User B
822 > # Date 1266264441 18000
822 > # Date 1266264441 18000
823 > # Branch stable
823 > # Branch stable
824 > # Node ID f2be6a1170ac83bf31cb4ae0bad00d7678115bc0
824 > # Node ID f2be6a1170ac83bf31cb4ae0bad00d7678115bc0
825 > # Parent 0000000000000000000000000000000000000000
825 > # Parent 0000000000000000000000000000000000000000
826 > from: tricky!
826 > from: tricky!
827 >
827 >
828 > That is not a header.
828 > That is not a header.
829 >
829 >
830 > diff -r 000000000000 -r f2be6a1170ac foo
830 > diff -r 000000000000 -r f2be6a1170ac foo
831 > --- /dev/null
831 > --- /dev/null
832 > +++ b/foo
832 > +++ b/foo
833 > @@ -0,0 +1,1 @@
833 > @@ -0,0 +1,1 @@
834 > +foo
834 > +foo
835 > EOF
835 > EOF
836 applying a.patch
836 applying a.patch
837 changeset: 0:f34d9187897d
837 changeset: 0:f34d9187897d
838 tag: tip
838 tag: tip
839 user: test
839 user: test
840 date: Thu Jan 01 00:00:00 1970 +0000
840 date: Thu Jan 01 00:00:00 1970 +0000
841 files: a
841 files: a
842 description:
842 description:
843 module: summary
843 module: summary
844
844
845
845
846 % tricky header splitting
846 % tricky header splitting
847
847
848 $ hg init trickyheaders
848 $ hg init trickyheaders
849 $ cd trickyheaders
849 $ cd trickyheaders
850 $ hg import -d '0 0' ../trickyheaders.patch
850 $ hg import -d '0 0' ../trickyheaders.patch
851 applying ../trickyheaders.patch
851 applying ../trickyheaders.patch
852 $ hg export --git tip
852 $ hg export --git tip
853 # HG changeset patch
853 # HG changeset patch
854 # User User B
854 # User User B
855 # Date 0 0
855 # Date 0 0
856 # Thu Jan 01 00:00:00 1970 +0000
856 # Node ID eb56ab91903632294ac504838508cb370c0901d2
857 # Node ID eb56ab91903632294ac504838508cb370c0901d2
857 # Parent 0000000000000000000000000000000000000000
858 # Parent 0000000000000000000000000000000000000000
858 from: tricky!
859 from: tricky!
859
860
860 That is not a header.
861 That is not a header.
861
862
862 diff --git a/foo b/foo
863 diff --git a/foo b/foo
863 new file mode 100644
864 new file mode 100644
864 --- /dev/null
865 --- /dev/null
865 +++ b/foo
866 +++ b/foo
866 @@ -0,0 +1,1 @@
867 @@ -0,0 +1,1 @@
867 +foo
868 +foo
868 $ cd ..
869 $ cd ..
869
870
870
871
871 Issue2102: hg export and hg import speak different languages
872 Issue2102: hg export and hg import speak different languages
872
873
873 $ hg init issue2102
874 $ hg init issue2102
874 $ cd issue2102
875 $ cd issue2102
875 $ mkdir -p src/cmd/gc
876 $ mkdir -p src/cmd/gc
876 $ touch src/cmd/gc/mksys.bash
877 $ touch src/cmd/gc/mksys.bash
877 $ hg ci -Am init
878 $ hg ci -Am init
878 adding src/cmd/gc/mksys.bash
879 adding src/cmd/gc/mksys.bash
879 $ hg import - <<EOF
880 $ hg import - <<EOF
880 > # HG changeset patch
881 > # HG changeset patch
881 > # User Rob Pike
882 > # User Rob Pike
882 > # Date 1216685449 25200
883 > # Date 1216685449 25200
883 > # Node ID 03aa2b206f499ad6eb50e6e207b9e710d6409c98
884 > # Node ID 03aa2b206f499ad6eb50e6e207b9e710d6409c98
884 > # Parent 93d10138ad8df586827ca90b4ddb5033e21a3a84
885 > # Parent 93d10138ad8df586827ca90b4ddb5033e21a3a84
885 > help management of empty pkg and lib directories in perforce
886 > help management of empty pkg and lib directories in perforce
886 >
887 >
887 > R=gri
888 > R=gri
888 > DELTA=4 (4 added, 0 deleted, 0 changed)
889 > DELTA=4 (4 added, 0 deleted, 0 changed)
889 > OCL=13328
890 > OCL=13328
890 > CL=13328
891 > CL=13328
891 >
892 >
892 > diff --git a/lib/place-holder b/lib/place-holder
893 > diff --git a/lib/place-holder b/lib/place-holder
893 > new file mode 100644
894 > new file mode 100644
894 > --- /dev/null
895 > --- /dev/null
895 > +++ b/lib/place-holder
896 > +++ b/lib/place-holder
896 > @@ -0,0 +1,2 @@
897 > @@ -0,0 +1,2 @@
897 > +perforce does not maintain empty directories.
898 > +perforce does not maintain empty directories.
898 > +this file helps.
899 > +this file helps.
899 > diff --git a/pkg/place-holder b/pkg/place-holder
900 > diff --git a/pkg/place-holder b/pkg/place-holder
900 > new file mode 100644
901 > new file mode 100644
901 > --- /dev/null
902 > --- /dev/null
902 > +++ b/pkg/place-holder
903 > +++ b/pkg/place-holder
903 > @@ -0,0 +1,2 @@
904 > @@ -0,0 +1,2 @@
904 > +perforce does not maintain empty directories.
905 > +perforce does not maintain empty directories.
905 > +this file helps.
906 > +this file helps.
906 > diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash
907 > diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash
907 > old mode 100644
908 > old mode 100644
908 > new mode 100755
909 > new mode 100755
909 > EOF
910 > EOF
910 applying patch from stdin
911 applying patch from stdin
911
912
912 #if execbit
913 #if execbit
913
914
914 $ hg sum
915 $ hg sum
915 parent: 1:d59915696727 tip
916 parent: 1:d59915696727 tip
916 help management of empty pkg and lib directories in perforce
917 help management of empty pkg and lib directories in perforce
917 branch: default
918 branch: default
918 commit: (clean)
919 commit: (clean)
919 update: (current)
920 update: (current)
920
921
921 $ hg diff --git -c tip
922 $ hg diff --git -c tip
922 diff --git a/lib/place-holder b/lib/place-holder
923 diff --git a/lib/place-holder b/lib/place-holder
923 new file mode 100644
924 new file mode 100644
924 --- /dev/null
925 --- /dev/null
925 +++ b/lib/place-holder
926 +++ b/lib/place-holder
926 @@ -0,0 +1,2 @@
927 @@ -0,0 +1,2 @@
927 +perforce does not maintain empty directories.
928 +perforce does not maintain empty directories.
928 +this file helps.
929 +this file helps.
929 diff --git a/pkg/place-holder b/pkg/place-holder
930 diff --git a/pkg/place-holder b/pkg/place-holder
930 new file mode 100644
931 new file mode 100644
931 --- /dev/null
932 --- /dev/null
932 +++ b/pkg/place-holder
933 +++ b/pkg/place-holder
933 @@ -0,0 +1,2 @@
934 @@ -0,0 +1,2 @@
934 +perforce does not maintain empty directories.
935 +perforce does not maintain empty directories.
935 +this file helps.
936 +this file helps.
936 diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash
937 diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash
937 old mode 100644
938 old mode 100644
938 new mode 100755
939 new mode 100755
939
940
940 #else
941 #else
941
942
942 $ hg sum
943 $ hg sum
943 parent: 1:28f089cc9ccc tip
944 parent: 1:28f089cc9ccc tip
944 help management of empty pkg and lib directories in perforce
945 help management of empty pkg and lib directories in perforce
945 branch: default
946 branch: default
946 commit: (clean)
947 commit: (clean)
947 update: (current)
948 update: (current)
948
949
949 $ hg diff --git -c tip
950 $ hg diff --git -c tip
950 diff --git a/lib/place-holder b/lib/place-holder
951 diff --git a/lib/place-holder b/lib/place-holder
951 new file mode 100644
952 new file mode 100644
952 --- /dev/null
953 --- /dev/null
953 +++ b/lib/place-holder
954 +++ b/lib/place-holder
954 @@ -0,0 +1,2 @@
955 @@ -0,0 +1,2 @@
955 +perforce does not maintain empty directories.
956 +perforce does not maintain empty directories.
956 +this file helps.
957 +this file helps.
957 diff --git a/pkg/place-holder b/pkg/place-holder
958 diff --git a/pkg/place-holder b/pkg/place-holder
958 new file mode 100644
959 new file mode 100644
959 --- /dev/null
960 --- /dev/null
960 +++ b/pkg/place-holder
961 +++ b/pkg/place-holder
961 @@ -0,0 +1,2 @@
962 @@ -0,0 +1,2 @@
962 +perforce does not maintain empty directories.
963 +perforce does not maintain empty directories.
963 +this file helps.
964 +this file helps.
964
965
965 /* The mode change for mksys.bash is missing here, because on platforms */
966 /* The mode change for mksys.bash is missing here, because on platforms */
966 /* that don't support execbits, mode changes in patches are ignored when */
967 /* that don't support execbits, mode changes in patches are ignored when */
967 /* they are imported. This is obviously also the reason for why the hash */
968 /* they are imported. This is obviously also the reason for why the hash */
968 /* in the created changeset is different to the one you see above the */
969 /* in the created changeset is different to the one you see above the */
969 /* #else clause */
970 /* #else clause */
970
971
971 #endif
972 #endif
972 $ cd ..
973 $ cd ..
973
974
974
975
975 diff lines looking like headers
976 diff lines looking like headers
976
977
977 $ hg init difflineslikeheaders
978 $ hg init difflineslikeheaders
978 $ cd difflineslikeheaders
979 $ cd difflineslikeheaders
979 $ echo a >a
980 $ echo a >a
980 $ echo b >b
981 $ echo b >b
981 $ echo c >c
982 $ echo c >c
982 $ hg ci -Am1
983 $ hg ci -Am1
983 adding a
984 adding a
984 adding b
985 adding b
985 adding c
986 adding c
986
987
987 $ echo "key: value" >>a
988 $ echo "key: value" >>a
988 $ echo "key: value" >>b
989 $ echo "key: value" >>b
989 $ echo "foo" >>c
990 $ echo "foo" >>c
990 $ hg ci -m2
991 $ hg ci -m2
991
992
992 $ hg up -C 0
993 $ hg up -C 0
993 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
994 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
994 $ hg diff --git -c1 >want
995 $ hg diff --git -c1 >want
995 $ hg diff -c1 | hg import --no-commit -
996 $ hg diff -c1 | hg import --no-commit -
996 applying patch from stdin
997 applying patch from stdin
997 $ hg diff --git >have
998 $ hg diff --git >have
998 $ diff want have
999 $ diff want have
999 $ cd ..
1000 $ cd ..
1000
1001
1001 import a unified diff with no lines of context (diff -U0)
1002 import a unified diff with no lines of context (diff -U0)
1002
1003
1003 $ hg init diffzero
1004 $ hg init diffzero
1004 $ cd diffzero
1005 $ cd diffzero
1005 $ cat > f << EOF
1006 $ cat > f << EOF
1006 > c2
1007 > c2
1007 > c4
1008 > c4
1008 > c5
1009 > c5
1009 > EOF
1010 > EOF
1010 $ hg commit -Am0
1011 $ hg commit -Am0
1011 adding f
1012 adding f
1012
1013
1013 $ hg import --no-commit - << EOF
1014 $ hg import --no-commit - << EOF
1014 > # HG changeset patch
1015 > # HG changeset patch
1015 > # User test
1016 > # User test
1016 > # Date 0 0
1017 > # Date 0 0
1017 > # Node ID f4974ab632f3dee767567b0576c0ec9a4508575c
1018 > # Node ID f4974ab632f3dee767567b0576c0ec9a4508575c
1018 > # Parent 8679a12a975b819fae5f7ad3853a2886d143d794
1019 > # Parent 8679a12a975b819fae5f7ad3853a2886d143d794
1019 > 1
1020 > 1
1020 > diff -r 8679a12a975b -r f4974ab632f3 f
1021 > diff -r 8679a12a975b -r f4974ab632f3 f
1021 > --- a/f Thu Jan 01 00:00:00 1970 +0000
1022 > --- a/f Thu Jan 01 00:00:00 1970 +0000
1022 > +++ b/f Thu Jan 01 00:00:00 1970 +0000
1023 > +++ b/f Thu Jan 01 00:00:00 1970 +0000
1023 > @@ -0,0 +1,1 @@
1024 > @@ -0,0 +1,1 @@
1024 > +c1
1025 > +c1
1025 > @@ -1,0 +3,1 @@
1026 > @@ -1,0 +3,1 @@
1026 > +c3
1027 > +c3
1027 > @@ -3,1 +4,0 @@
1028 > @@ -3,1 +4,0 @@
1028 > -c5
1029 > -c5
1029 > EOF
1030 > EOF
1030 applying patch from stdin
1031 applying patch from stdin
1031
1032
1032 $ cat f
1033 $ cat f
1033 c1
1034 c1
1034 c2
1035 c2
1035 c3
1036 c3
1036 c4
1037 c4
1037
1038
1038 $ cd ..
1039 $ cd ..
1039
1040
1040 no segfault while importing a unified diff which start line is zero but chunk
1041 no segfault while importing a unified diff which start line is zero but chunk
1041 size is non-zero
1042 size is non-zero
1042
1043
1043 $ hg init startlinezero
1044 $ hg init startlinezero
1044 $ cd startlinezero
1045 $ cd startlinezero
1045 $ echo foo > foo
1046 $ echo foo > foo
1046 $ hg commit -Amfoo
1047 $ hg commit -Amfoo
1047 adding foo
1048 adding foo
1048
1049
1049 $ hg import --no-commit - << EOF
1050 $ hg import --no-commit - << EOF
1050 > diff a/foo b/foo
1051 > diff a/foo b/foo
1051 > --- a/foo
1052 > --- a/foo
1052 > +++ b/foo
1053 > +++ b/foo
1053 > @@ -0,1 +0,1 @@
1054 > @@ -0,1 +0,1 @@
1054 > foo
1055 > foo
1055 > EOF
1056 > EOF
1056 applying patch from stdin
1057 applying patch from stdin
1057
1058
1058 $ cd ..
1059 $ cd ..
1059
1060
1060 Test corner case involving fuzz and skew
1061 Test corner case involving fuzz and skew
1061
1062
1062 $ hg init morecornercases
1063 $ hg init morecornercases
1063 $ cd morecornercases
1064 $ cd morecornercases
1064
1065
1065 $ cat > 01-no-context-beginning-of-file.diff <<EOF
1066 $ cat > 01-no-context-beginning-of-file.diff <<EOF
1066 > diff --git a/a b/a
1067 > diff --git a/a b/a
1067 > --- a/a
1068 > --- a/a
1068 > +++ b/a
1069 > +++ b/a
1069 > @@ -1,0 +1,1 @@
1070 > @@ -1,0 +1,1 @@
1070 > +line
1071 > +line
1071 > EOF
1072 > EOF
1072
1073
1073 $ cat > 02-no-context-middle-of-file.diff <<EOF
1074 $ cat > 02-no-context-middle-of-file.diff <<EOF
1074 > diff --git a/a b/a
1075 > diff --git a/a b/a
1075 > --- a/a
1076 > --- a/a
1076 > +++ b/a
1077 > +++ b/a
1077 > @@ -1,1 +1,1 @@
1078 > @@ -1,1 +1,1 @@
1078 > -2
1079 > -2
1079 > +add some skew
1080 > +add some skew
1080 > @@ -2,0 +2,1 @@
1081 > @@ -2,0 +2,1 @@
1081 > +line
1082 > +line
1082 > EOF
1083 > EOF
1083
1084
1084 $ cat > 03-no-context-end-of-file.diff <<EOF
1085 $ cat > 03-no-context-end-of-file.diff <<EOF
1085 > diff --git a/a b/a
1086 > diff --git a/a b/a
1086 > --- a/a
1087 > --- a/a
1087 > +++ b/a
1088 > +++ b/a
1088 > @@ -10,0 +10,1 @@
1089 > @@ -10,0 +10,1 @@
1089 > +line
1090 > +line
1090 > EOF
1091 > EOF
1091
1092
1092 $ cat > 04-middle-of-file-completely-fuzzed.diff <<EOF
1093 $ cat > 04-middle-of-file-completely-fuzzed.diff <<EOF
1093 > diff --git a/a b/a
1094 > diff --git a/a b/a
1094 > --- a/a
1095 > --- a/a
1095 > +++ b/a
1096 > +++ b/a
1096 > @@ -1,1 +1,1 @@
1097 > @@ -1,1 +1,1 @@
1097 > -2
1098 > -2
1098 > +add some skew
1099 > +add some skew
1099 > @@ -2,2 +2,3 @@
1100 > @@ -2,2 +2,3 @@
1100 > not matching, should fuzz
1101 > not matching, should fuzz
1101 > ... a bit
1102 > ... a bit
1102 > +line
1103 > +line
1103 > EOF
1104 > EOF
1104
1105
1105 $ cat > a <<EOF
1106 $ cat > a <<EOF
1106 > 1
1107 > 1
1107 > 2
1108 > 2
1108 > 3
1109 > 3
1109 > 4
1110 > 4
1110 > EOF
1111 > EOF
1111 $ hg ci -Am adda a
1112 $ hg ci -Am adda a
1112 $ for p in *.diff; do
1113 $ for p in *.diff; do
1113 > hg import -v --no-commit $p
1114 > hg import -v --no-commit $p
1114 > cat a
1115 > cat a
1115 > hg revert -aqC a
1116 > hg revert -aqC a
1116 > # patch -p1 < $p
1117 > # patch -p1 < $p
1117 > # cat a
1118 > # cat a
1118 > # hg revert -aC a
1119 > # hg revert -aC a
1119 > done
1120 > done
1120 applying 01-no-context-beginning-of-file.diff
1121 applying 01-no-context-beginning-of-file.diff
1121 patching file a
1122 patching file a
1122 applied to working directory
1123 applied to working directory
1123 1
1124 1
1124 line
1125 line
1125 2
1126 2
1126 3
1127 3
1127 4
1128 4
1128 applying 02-no-context-middle-of-file.diff
1129 applying 02-no-context-middle-of-file.diff
1129 patching file a
1130 patching file a
1130 Hunk #1 succeeded at 2 (offset 1 lines).
1131 Hunk #1 succeeded at 2 (offset 1 lines).
1131 Hunk #2 succeeded at 4 (offset 1 lines).
1132 Hunk #2 succeeded at 4 (offset 1 lines).
1132 applied to working directory
1133 applied to working directory
1133 1
1134 1
1134 add some skew
1135 add some skew
1135 3
1136 3
1136 line
1137 line
1137 4
1138 4
1138 applying 03-no-context-end-of-file.diff
1139 applying 03-no-context-end-of-file.diff
1139 patching file a
1140 patching file a
1140 Hunk #1 succeeded at 5 (offset -6 lines).
1141 Hunk #1 succeeded at 5 (offset -6 lines).
1141 applied to working directory
1142 applied to working directory
1142 1
1143 1
1143 2
1144 2
1144 3
1145 3
1145 4
1146 4
1146 line
1147 line
1147 applying 04-middle-of-file-completely-fuzzed.diff
1148 applying 04-middle-of-file-completely-fuzzed.diff
1148 patching file a
1149 patching file a
1149 Hunk #1 succeeded at 2 (offset 1 lines).
1150 Hunk #1 succeeded at 2 (offset 1 lines).
1150 Hunk #2 succeeded at 5 with fuzz 2 (offset 1 lines).
1151 Hunk #2 succeeded at 5 with fuzz 2 (offset 1 lines).
1151 applied to working directory
1152 applied to working directory
1152 1
1153 1
1153 add some skew
1154 add some skew
1154 3
1155 3
1155 4
1156 4
1156 line
1157 line
1157
1158
1158 $ cd ..
1159 $ cd ..
@@ -1,53 +1,54 b''
1 http://mercurial.selenic.com/bts/issue1175
1 http://mercurial.selenic.com/bts/issue1175
2
2
3 $ hg init
3 $ hg init
4 $ touch a
4 $ touch a
5 $ hg ci -Am0
5 $ hg ci -Am0
6 adding a
6 adding a
7
7
8 $ hg mv a a1
8 $ hg mv a a1
9 $ hg ci -m1
9 $ hg ci -m1
10
10
11 $ hg co 0
11 $ hg co 0
12 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
12 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
13
13
14 $ hg mv a a2
14 $ hg mv a a2
15 $ hg up
15 $ hg up
16 note: possible conflict - a was renamed multiple times to:
16 note: possible conflict - a was renamed multiple times to:
17 a2
17 a2
18 a1
18 a1
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
20
20
21 $ hg ci -m2
21 $ hg ci -m2
22
22
23 $ touch a
23 $ touch a
24 $ hg ci -Am3
24 $ hg ci -Am3
25 adding a
25 adding a
26
26
27 $ hg mv a b
27 $ hg mv a b
28 $ hg ci -Am4 a
28 $ hg ci -Am4 a
29
29
30 $ hg ci --debug --traceback -Am5 b
30 $ hg ci --debug --traceback -Am5 b
31 b
31 b
32 b: searching for copy revision for a
32 b: searching for copy revision for a
33 b: copy a:b80de5d138758541c5f05265ad144ab9fa86d1db
33 b: copy a:b80de5d138758541c5f05265ad144ab9fa86d1db
34 committed changeset 5:89e8e4be0de296fa3d6dd7825ccc44d7dc0f1f3b
34 committed changeset 5:89e8e4be0de296fa3d6dd7825ccc44d7dc0f1f3b
35
35
36 $ hg verify
36 $ hg verify
37 checking changesets
37 checking changesets
38 checking manifests
38 checking manifests
39 crosschecking files in changesets and manifests
39 crosschecking files in changesets and manifests
40 checking files
40 checking files
41 4 files, 6 changesets, 4 total revisions
41 4 files, 6 changesets, 4 total revisions
42
42
43 $ hg export --git tip
43 $ hg export --git tip
44 # HG changeset patch
44 # HG changeset patch
45 # User test
45 # User test
46 # Date 0 0
46 # Date 0 0
47 # Thu Jan 01 00:00:00 1970 +0000
47 # Node ID 89e8e4be0de296fa3d6dd7825ccc44d7dc0f1f3b
48 # Node ID 89e8e4be0de296fa3d6dd7825ccc44d7dc0f1f3b
48 # Parent 7fc86ba705e717a721dbc361bf8c9bc05a18ca2f
49 # Parent 7fc86ba705e717a721dbc361bf8c9bc05a18ca2f
49 5
50 5
50
51
51 diff --git a/b b/b
52 diff --git a/b b/b
52 new file mode 100644
53 new file mode 100644
53
54
@@ -1,1154 +1,1155 b''
1 $ cat <<EOF >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [extensions]
2 > [extensions]
3 > keyword =
3 > keyword =
4 > mq =
4 > mq =
5 > notify =
5 > notify =
6 > record =
6 > record =
7 > transplant =
7 > transplant =
8 > [ui]
8 > [ui]
9 > interactive = true
9 > interactive = true
10 > EOF
10 > EOF
11
11
12 hide outer repo
12 hide outer repo
13 $ hg init
13 $ hg init
14
14
15 Run kwdemo before [keyword] files are set up
15 Run kwdemo before [keyword] files are set up
16 as it would succeed without uisetup otherwise
16 as it would succeed without uisetup otherwise
17
17
18 $ hg --quiet kwdemo
18 $ hg --quiet kwdemo
19 [extensions]
19 [extensions]
20 keyword =
20 keyword =
21 [keyword]
21 [keyword]
22 demo.txt =
22 demo.txt =
23 [keywordset]
23 [keywordset]
24 svn = False
24 svn = False
25 [keywordmaps]
25 [keywordmaps]
26 Author = {author|user}
26 Author = {author|user}
27 Date = {date|utcdate}
27 Date = {date|utcdate}
28 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
28 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
29 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
29 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
30 RCSFile = {file|basename},v
30 RCSFile = {file|basename},v
31 RCSfile = {file|basename},v
31 RCSfile = {file|basename},v
32 Revision = {node|short}
32 Revision = {node|short}
33 Source = {root}/{file},v
33 Source = {root}/{file},v
34 $Author: test $
34 $Author: test $
35 $Date: ????/??/?? ??:??:?? $ (glob)
35 $Date: ????/??/?? ??:??:?? $ (glob)
36 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
36 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
37 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
37 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
38 $RCSFile: demo.txt,v $
38 $RCSFile: demo.txt,v $
39 $RCSfile: demo.txt,v $
39 $RCSfile: demo.txt,v $
40 $Revision: ???????????? $ (glob)
40 $Revision: ???????????? $ (glob)
41 $Source: */demo.txt,v $ (glob)
41 $Source: */demo.txt,v $ (glob)
42
42
43 $ hg --quiet kwdemo "Branch = {branches}"
43 $ hg --quiet kwdemo "Branch = {branches}"
44 [extensions]
44 [extensions]
45 keyword =
45 keyword =
46 [keyword]
46 [keyword]
47 demo.txt =
47 demo.txt =
48 [keywordset]
48 [keywordset]
49 svn = False
49 svn = False
50 [keywordmaps]
50 [keywordmaps]
51 Branch = {branches}
51 Branch = {branches}
52 $Branch: demobranch $
52 $Branch: demobranch $
53
53
54 $ cat <<EOF >> $HGRCPATH
54 $ cat <<EOF >> $HGRCPATH
55 > [keyword]
55 > [keyword]
56 > ** =
56 > ** =
57 > b = ignore
57 > b = ignore
58 > i = ignore
58 > i = ignore
59 > [hooks]
59 > [hooks]
60 > EOF
60 > EOF
61 $ cp $HGRCPATH $HGRCPATH.nohooks
61 $ cp $HGRCPATH $HGRCPATH.nohooks
62 > cat <<EOF >> $HGRCPATH
62 > cat <<EOF >> $HGRCPATH
63 > commit=
63 > commit=
64 > commit.test=cp a hooktest
64 > commit.test=cp a hooktest
65 > EOF
65 > EOF
66
66
67 $ hg init Test-bndl
67 $ hg init Test-bndl
68 $ cd Test-bndl
68 $ cd Test-bndl
69
69
70 kwshrink should exit silently in empty/invalid repo
70 kwshrink should exit silently in empty/invalid repo
71
71
72 $ hg kwshrink
72 $ hg kwshrink
73
73
74 Symlinks cannot be created on Windows.
74 Symlinks cannot be created on Windows.
75 A bundle to test this was made with:
75 A bundle to test this was made with:
76 hg init t
76 hg init t
77 cd t
77 cd t
78 echo a > a
78 echo a > a
79 ln -s a sym
79 ln -s a sym
80 hg add sym
80 hg add sym
81 hg ci -m addsym -u mercurial
81 hg ci -m addsym -u mercurial
82 hg bundle --base null ../test-keyword.hg
82 hg bundle --base null ../test-keyword.hg
83
83
84 $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg
84 $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg
85 pulling from *test-keyword.hg (glob)
85 pulling from *test-keyword.hg (glob)
86 requesting all changes
86 requesting all changes
87 adding changesets
87 adding changesets
88 adding manifests
88 adding manifests
89 adding file changes
89 adding file changes
90 added 1 changesets with 1 changes to 1 files
90 added 1 changesets with 1 changes to 1 files
91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
92
92
93 $ echo 'expand $Id$' > a
93 $ echo 'expand $Id$' > a
94 $ echo 'do not process $Id:' >> a
94 $ echo 'do not process $Id:' >> a
95 $ echo 'xxx $' >> a
95 $ echo 'xxx $' >> a
96 $ echo 'ignore $Id$' > b
96 $ echo 'ignore $Id$' > b
97
97
98 Output files as they were created
98 Output files as they were created
99
99
100 $ cat a b
100 $ cat a b
101 expand $Id$
101 expand $Id$
102 do not process $Id:
102 do not process $Id:
103 xxx $
103 xxx $
104 ignore $Id$
104 ignore $Id$
105
105
106 no kwfiles
106 no kwfiles
107
107
108 $ hg kwfiles
108 $ hg kwfiles
109
109
110 untracked candidates
110 untracked candidates
111
111
112 $ hg -v kwfiles --unknown
112 $ hg -v kwfiles --unknown
113 k a
113 k a
114
114
115 Add files and check status
115 Add files and check status
116
116
117 $ hg addremove
117 $ hg addremove
118 adding a
118 adding a
119 adding b
119 adding b
120 $ hg status
120 $ hg status
121 A a
121 A a
122 A b
122 A b
123
123
124
124
125 Default keyword expansion including commit hook
125 Default keyword expansion including commit hook
126 Interrupted commit should not change state or run commit hook
126 Interrupted commit should not change state or run commit hook
127
127
128 $ hg --debug commit
128 $ hg --debug commit
129 abort: empty commit message
129 abort: empty commit message
130 [255]
130 [255]
131 $ hg status
131 $ hg status
132 A a
132 A a
133 A b
133 A b
134
134
135 Commit with several checks
135 Commit with several checks
136
136
137 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
137 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
138 a
138 a
139 b
139 b
140 overwriting a expanding keywords
140 overwriting a expanding keywords
141 running hook commit.test: cp a hooktest
141 running hook commit.test: cp a hooktest
142 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
142 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
143 $ hg status
143 $ hg status
144 ? hooktest
144 ? hooktest
145 $ hg debugrebuildstate
145 $ hg debugrebuildstate
146 $ hg --quiet identify
146 $ hg --quiet identify
147 ef63ca68695b
147 ef63ca68695b
148
148
149 cat files in working directory with keywords expanded
149 cat files in working directory with keywords expanded
150
150
151 $ cat a b
151 $ cat a b
152 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
152 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
153 do not process $Id:
153 do not process $Id:
154 xxx $
154 xxx $
155 ignore $Id$
155 ignore $Id$
156
156
157 hg cat files and symlink, no expansion
157 hg cat files and symlink, no expansion
158
158
159 $ hg cat sym a b && echo
159 $ hg cat sym a b && echo
160 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
160 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
161 do not process $Id:
161 do not process $Id:
162 xxx $
162 xxx $
163 ignore $Id$
163 ignore $Id$
164 a
164 a
165
165
166 $ diff a hooktest
166 $ diff a hooktest
167
167
168 $ cp $HGRCPATH.nohooks $HGRCPATH
168 $ cp $HGRCPATH.nohooks $HGRCPATH
169 $ rm hooktest
169 $ rm hooktest
170
170
171 hg status of kw-ignored binary file starting with '\1\n'
171 hg status of kw-ignored binary file starting with '\1\n'
172
172
173 >>> open("i", "wb").write("\1\nfoo")
173 >>> open("i", "wb").write("\1\nfoo")
174 $ hg -q commit -Am metasep i
174 $ hg -q commit -Am metasep i
175 $ hg status
175 $ hg status
176 >>> open("i", "wb").write("\1\nbar")
176 >>> open("i", "wb").write("\1\nbar")
177 $ hg status
177 $ hg status
178 M i
178 M i
179 $ hg -q commit -m "modify metasep" i
179 $ hg -q commit -m "modify metasep" i
180 $ hg status --rev 2:3
180 $ hg status --rev 2:3
181 M i
181 M i
182 $ touch empty
182 $ touch empty
183 $ hg -q commit -A -m "another file"
183 $ hg -q commit -A -m "another file"
184 $ hg status -A --rev 3:4 i
184 $ hg status -A --rev 3:4 i
185 C i
185 C i
186
186
187 $ hg -q strip -n 2
187 $ hg -q strip -n 2
188
188
189 Test hook execution
189 Test hook execution
190
190
191 bundle
191 bundle
192
192
193 $ hg bundle --base null ../kw.hg
193 $ hg bundle --base null ../kw.hg
194 2 changesets found
194 2 changesets found
195 $ cd ..
195 $ cd ..
196 $ hg init Test
196 $ hg init Test
197 $ cd Test
197 $ cd Test
198
198
199 Notify on pull to check whether keywords stay as is in email
199 Notify on pull to check whether keywords stay as is in email
200 ie. if patch.diff wrapper acts as it should
200 ie. if patch.diff wrapper acts as it should
201
201
202 $ cat <<EOF >> $HGRCPATH
202 $ cat <<EOF >> $HGRCPATH
203 > [hooks]
203 > [hooks]
204 > incoming.notify = python:hgext.notify.hook
204 > incoming.notify = python:hgext.notify.hook
205 > [notify]
205 > [notify]
206 > sources = pull
206 > sources = pull
207 > diffstat = False
207 > diffstat = False
208 > maxsubject = 15
208 > maxsubject = 15
209 > [reposubs]
209 > [reposubs]
210 > * = Test
210 > * = Test
211 > EOF
211 > EOF
212
212
213 Pull from bundle and trigger notify
213 Pull from bundle and trigger notify
214
214
215 $ hg pull -u ../kw.hg
215 $ hg pull -u ../kw.hg
216 pulling from ../kw.hg
216 pulling from ../kw.hg
217 requesting all changes
217 requesting all changes
218 adding changesets
218 adding changesets
219 adding manifests
219 adding manifests
220 adding file changes
220 adding file changes
221 added 2 changesets with 3 changes to 3 files
221 added 2 changesets with 3 changes to 3 files
222 Content-Type: text/plain; charset="us-ascii"
222 Content-Type: text/plain; charset="us-ascii"
223 MIME-Version: 1.0
223 MIME-Version: 1.0
224 Content-Transfer-Encoding: 7bit
224 Content-Transfer-Encoding: 7bit
225 Date: * (glob)
225 Date: * (glob)
226 Subject: changeset in...
226 Subject: changeset in...
227 From: mercurial
227 From: mercurial
228 X-Hg-Notification: changeset a2392c293916
228 X-Hg-Notification: changeset a2392c293916
229 Message-Id: <hg.a2392c293916*> (glob)
229 Message-Id: <hg.a2392c293916*> (glob)
230 To: Test
230 To: Test
231
231
232 changeset a2392c293916 in $TESTTMP/Test (glob)
232 changeset a2392c293916 in $TESTTMP/Test (glob)
233 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
233 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
234 description:
234 description:
235 addsym
235 addsym
236
236
237 diffs (6 lines):
237 diffs (6 lines):
238
238
239 diff -r 000000000000 -r a2392c293916 sym
239 diff -r 000000000000 -r a2392c293916 sym
240 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
240 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
241 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
241 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
242 @@ -0,0 +1,1 @@
242 @@ -0,0 +1,1 @@
243 +a
243 +a
244 \ No newline at end of file
244 \ No newline at end of file
245 Content-Type: text/plain; charset="us-ascii"
245 Content-Type: text/plain; charset="us-ascii"
246 MIME-Version: 1.0
246 MIME-Version: 1.0
247 Content-Transfer-Encoding: 7bit
247 Content-Transfer-Encoding: 7bit
248 Date:* (glob)
248 Date:* (glob)
249 Subject: changeset in...
249 Subject: changeset in...
250 From: User Name <user@example.com>
250 From: User Name <user@example.com>
251 X-Hg-Notification: changeset ef63ca68695b
251 X-Hg-Notification: changeset ef63ca68695b
252 Message-Id: <hg.ef63ca68695b*> (glob)
252 Message-Id: <hg.ef63ca68695b*> (glob)
253 To: Test
253 To: Test
254
254
255 changeset ef63ca68695b in $TESTTMP/Test (glob)
255 changeset ef63ca68695b in $TESTTMP/Test (glob)
256 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
256 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
257 description:
257 description:
258 absym
258 absym
259
259
260 diffs (12 lines):
260 diffs (12 lines):
261
261
262 diff -r a2392c293916 -r ef63ca68695b a
262 diff -r a2392c293916 -r ef63ca68695b a
263 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
263 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
264 +++ b/a Thu Jan 01 00:00:00 1970 +0000
264 +++ b/a Thu Jan 01 00:00:00 1970 +0000
265 @@ -0,0 +1,3 @@
265 @@ -0,0 +1,3 @@
266 +expand $Id$
266 +expand $Id$
267 +do not process $Id:
267 +do not process $Id:
268 +xxx $
268 +xxx $
269 diff -r a2392c293916 -r ef63ca68695b b
269 diff -r a2392c293916 -r ef63ca68695b b
270 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
270 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
271 +++ b/b Thu Jan 01 00:00:00 1970 +0000
271 +++ b/b Thu Jan 01 00:00:00 1970 +0000
272 @@ -0,0 +1,1 @@
272 @@ -0,0 +1,1 @@
273 +ignore $Id$
273 +ignore $Id$
274 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
274 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
275
275
276 $ cp $HGRCPATH.nohooks $HGRCPATH
276 $ cp $HGRCPATH.nohooks $HGRCPATH
277
277
278 Touch files and check with status
278 Touch files and check with status
279
279
280 $ touch a b
280 $ touch a b
281 $ hg status
281 $ hg status
282
282
283 Update and expand
283 Update and expand
284
284
285 $ rm sym a b
285 $ rm sym a b
286 $ hg update -C
286 $ hg update -C
287 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
287 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
288 $ cat a b
288 $ cat a b
289 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
289 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
290 do not process $Id:
290 do not process $Id:
291 xxx $
291 xxx $
292 ignore $Id$
292 ignore $Id$
293
293
294 Check whether expansion is filewise and file mode is preserved
294 Check whether expansion is filewise and file mode is preserved
295
295
296 $ echo '$Id$' > c
296 $ echo '$Id$' > c
297 $ echo 'tests for different changenodes' >> c
297 $ echo 'tests for different changenodes' >> c
298 #if unix-permissions
298 #if unix-permissions
299 $ chmod 600 c
299 $ chmod 600 c
300 $ ls -l c | cut -b 1-10
300 $ ls -l c | cut -b 1-10
301 -rw-------
301 -rw-------
302 #endif
302 #endif
303
303
304 commit file c
304 commit file c
305
305
306 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
306 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
307 adding c
307 adding c
308 #if unix-permissions
308 #if unix-permissions
309 $ ls -l c | cut -b 1-10
309 $ ls -l c | cut -b 1-10
310 -rw-------
310 -rw-------
311 #endif
311 #endif
312
312
313 force expansion
313 force expansion
314
314
315 $ hg -v kwexpand
315 $ hg -v kwexpand
316 overwriting a expanding keywords
316 overwriting a expanding keywords
317 overwriting c expanding keywords
317 overwriting c expanding keywords
318
318
319 compare changenodes in a and c
319 compare changenodes in a and c
320
320
321 $ cat a c
321 $ cat a c
322 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
322 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
323 do not process $Id:
323 do not process $Id:
324 xxx $
324 xxx $
325 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
325 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
326 tests for different changenodes
326 tests for different changenodes
327
327
328 record
328 record
329
329
330 $ echo '$Id$' > r
330 $ echo '$Id$' > r
331 $ hg add r
331 $ hg add r
332
332
333 record chunk
333 record chunk
334
334
335 >>> lines = open('a', 'rb').readlines()
335 >>> lines = open('a', 'rb').readlines()
336 >>> lines.insert(1, 'foo\n')
336 >>> lines.insert(1, 'foo\n')
337 >>> lines.append('bar\n')
337 >>> lines.append('bar\n')
338 >>> open('a', 'wb').writelines(lines)
338 >>> open('a', 'wb').writelines(lines)
339 $ hg record -d '10 1' -m rectest a<<EOF
339 $ hg record -d '10 1' -m rectest a<<EOF
340 > y
340 > y
341 > y
341 > y
342 > n
342 > n
343 > EOF
343 > EOF
344 diff --git a/a b/a
344 diff --git a/a b/a
345 2 hunks, 2 lines changed
345 2 hunks, 2 lines changed
346 examine changes to 'a'? [Ynesfdaq?]
346 examine changes to 'a'? [Ynesfdaq?]
347 @@ -1,3 +1,4 @@
347 @@ -1,3 +1,4 @@
348 expand $Id$
348 expand $Id$
349 +foo
349 +foo
350 do not process $Id:
350 do not process $Id:
351 xxx $
351 xxx $
352 record change 1/2 to 'a'? [Ynesfdaq?]
352 record change 1/2 to 'a'? [Ynesfdaq?]
353 @@ -2,2 +3,3 @@
353 @@ -2,2 +3,3 @@
354 do not process $Id:
354 do not process $Id:
355 xxx $
355 xxx $
356 +bar
356 +bar
357 record change 2/2 to 'a'? [Ynesfdaq?]
357 record change 2/2 to 'a'? [Ynesfdaq?]
358
358
359 $ hg identify
359 $ hg identify
360 5f5eb23505c3+ tip
360 5f5eb23505c3+ tip
361 $ hg status
361 $ hg status
362 M a
362 M a
363 A r
363 A r
364
364
365 Cat modified file a
365 Cat modified file a
366
366
367 $ cat a
367 $ cat a
368 expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
368 expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
369 foo
369 foo
370 do not process $Id:
370 do not process $Id:
371 xxx $
371 xxx $
372 bar
372 bar
373
373
374 Diff remaining chunk
374 Diff remaining chunk
375
375
376 $ hg diff a
376 $ hg diff a
377 diff -r 5f5eb23505c3 a
377 diff -r 5f5eb23505c3 a
378 --- a/a Thu Jan 01 00:00:09 1970 -0000
378 --- a/a Thu Jan 01 00:00:09 1970 -0000
379 +++ b/a * (glob)
379 +++ b/a * (glob)
380 @@ -2,3 +2,4 @@
380 @@ -2,3 +2,4 @@
381 foo
381 foo
382 do not process $Id:
382 do not process $Id:
383 xxx $
383 xxx $
384 +bar
384 +bar
385
385
386 $ hg rollback
386 $ hg rollback
387 repository tip rolled back to revision 2 (undo commit)
387 repository tip rolled back to revision 2 (undo commit)
388 working directory now based on revision 2
388 working directory now based on revision 2
389
389
390 Record all chunks in file a
390 Record all chunks in file a
391
391
392 $ echo foo > msg
392 $ echo foo > msg
393
393
394 - do not use "hg record -m" here!
394 - do not use "hg record -m" here!
395
395
396 $ hg record -l msg -d '11 1' a<<EOF
396 $ hg record -l msg -d '11 1' a<<EOF
397 > y
397 > y
398 > y
398 > y
399 > y
399 > y
400 > EOF
400 > EOF
401 diff --git a/a b/a
401 diff --git a/a b/a
402 2 hunks, 2 lines changed
402 2 hunks, 2 lines changed
403 examine changes to 'a'? [Ynesfdaq?]
403 examine changes to 'a'? [Ynesfdaq?]
404 @@ -1,3 +1,4 @@
404 @@ -1,3 +1,4 @@
405 expand $Id$
405 expand $Id$
406 +foo
406 +foo
407 do not process $Id:
407 do not process $Id:
408 xxx $
408 xxx $
409 record change 1/2 to 'a'? [Ynesfdaq?]
409 record change 1/2 to 'a'? [Ynesfdaq?]
410 @@ -2,2 +3,3 @@
410 @@ -2,2 +3,3 @@
411 do not process $Id:
411 do not process $Id:
412 xxx $
412 xxx $
413 +bar
413 +bar
414 record change 2/2 to 'a'? [Ynesfdaq?]
414 record change 2/2 to 'a'? [Ynesfdaq?]
415
415
416 File a should be clean
416 File a should be clean
417
417
418 $ hg status -A a
418 $ hg status -A a
419 C a
419 C a
420
420
421 rollback and revert expansion
421 rollback and revert expansion
422
422
423 $ cat a
423 $ cat a
424 expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
424 expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
425 foo
425 foo
426 do not process $Id:
426 do not process $Id:
427 xxx $
427 xxx $
428 bar
428 bar
429 $ hg --verbose rollback
429 $ hg --verbose rollback
430 repository tip rolled back to revision 2 (undo commit)
430 repository tip rolled back to revision 2 (undo commit)
431 working directory now based on revision 2
431 working directory now based on revision 2
432 overwriting a expanding keywords
432 overwriting a expanding keywords
433 $ hg status a
433 $ hg status a
434 M a
434 M a
435 $ cat a
435 $ cat a
436 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
436 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
437 foo
437 foo
438 do not process $Id:
438 do not process $Id:
439 xxx $
439 xxx $
440 bar
440 bar
441 $ echo '$Id$' > y
441 $ echo '$Id$' > y
442 $ echo '$Id$' > z
442 $ echo '$Id$' > z
443 $ hg add y
443 $ hg add y
444 $ hg commit -Am "rollback only" z
444 $ hg commit -Am "rollback only" z
445 $ cat z
445 $ cat z
446 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
446 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
447 $ hg --verbose rollback
447 $ hg --verbose rollback
448 repository tip rolled back to revision 2 (undo commit)
448 repository tip rolled back to revision 2 (undo commit)
449 working directory now based on revision 2
449 working directory now based on revision 2
450 overwriting z shrinking keywords
450 overwriting z shrinking keywords
451
451
452 Only z should be overwritten
452 Only z should be overwritten
453
453
454 $ hg status a y z
454 $ hg status a y z
455 M a
455 M a
456 A y
456 A y
457 A z
457 A z
458 $ cat z
458 $ cat z
459 $Id$
459 $Id$
460 $ hg forget y z
460 $ hg forget y z
461 $ rm y z
461 $ rm y z
462
462
463 record added file alone
463 record added file alone
464
464
465 $ hg -v record -l msg -d '12 2' r<<EOF
465 $ hg -v record -l msg -d '12 2' r<<EOF
466 > y
466 > y
467 > EOF
467 > EOF
468 diff --git a/r b/r
468 diff --git a/r b/r
469 new file mode 100644
469 new file mode 100644
470 examine changes to 'r'? [Ynesfdaq?]
470 examine changes to 'r'? [Ynesfdaq?]
471 r
471 r
472 committed changeset 3:82a2f715724d
472 committed changeset 3:82a2f715724d
473 overwriting r expanding keywords
473 overwriting r expanding keywords
474 - status call required for dirstate.normallookup() check
474 - status call required for dirstate.normallookup() check
475 $ hg status r
475 $ hg status r
476 $ hg --verbose rollback
476 $ hg --verbose rollback
477 repository tip rolled back to revision 2 (undo commit)
477 repository tip rolled back to revision 2 (undo commit)
478 working directory now based on revision 2
478 working directory now based on revision 2
479 overwriting r shrinking keywords
479 overwriting r shrinking keywords
480 $ hg forget r
480 $ hg forget r
481 $ rm msg r
481 $ rm msg r
482 $ hg update -C
482 $ hg update -C
483 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
483 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
484
484
485 record added keyword ignored file
485 record added keyword ignored file
486
486
487 $ echo '$Id$' > i
487 $ echo '$Id$' > i
488 $ hg add i
488 $ hg add i
489 $ hg --verbose record -d '13 1' -m recignored<<EOF
489 $ hg --verbose record -d '13 1' -m recignored<<EOF
490 > y
490 > y
491 > EOF
491 > EOF
492 diff --git a/i b/i
492 diff --git a/i b/i
493 new file mode 100644
493 new file mode 100644
494 examine changes to 'i'? [Ynesfdaq?]
494 examine changes to 'i'? [Ynesfdaq?]
495 i
495 i
496 committed changeset 3:9f40ceb5a072
496 committed changeset 3:9f40ceb5a072
497 $ cat i
497 $ cat i
498 $Id$
498 $Id$
499 $ hg -q rollback
499 $ hg -q rollback
500 $ hg forget i
500 $ hg forget i
501 $ rm i
501 $ rm i
502
502
503 amend
503 amend
504
504
505 $ echo amend >> a
505 $ echo amend >> a
506 $ echo amend >> b
506 $ echo amend >> b
507 $ hg -q commit -d '14 1' -m 'prepare amend'
507 $ hg -q commit -d '14 1' -m 'prepare amend'
508
508
509 $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
509 $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
510 invalid branchheads cache (served): tip differs
510 invalid branchheads cache (served): tip differs
511 overwriting a expanding keywords
511 overwriting a expanding keywords
512 $ hg -q id
512 $ hg -q id
513 67d8c481a6be
513 67d8c481a6be
514 $ head -1 a
514 $ head -1 a
515 expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $
515 expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $
516
516
517 $ hg -q strip -n tip
517 $ hg -q strip -n tip
518
518
519 Test patch queue repo
519 Test patch queue repo
520
520
521 $ hg init --mq
521 $ hg init --mq
522 $ hg qimport -r tip -n mqtest.diff
522 $ hg qimport -r tip -n mqtest.diff
523 $ hg commit --mq -m mqtest
523 $ hg commit --mq -m mqtest
524
524
525 Keywords should not be expanded in patch
525 Keywords should not be expanded in patch
526
526
527 $ cat .hg/patches/mqtest.diff
527 $ cat .hg/patches/mqtest.diff
528 # HG changeset patch
528 # HG changeset patch
529 # User User Name <user@example.com>
529 # User User Name <user@example.com>
530 # Date 1 0
530 # Date 1 0
531 # Thu Jan 01 00:00:01 1970 +0000
531 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
532 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
532 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
533 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
533 cndiff
534 cndiff
534
535
535 diff -r ef63ca68695b -r 40a904bbbe4c c
536 diff -r ef63ca68695b -r 40a904bbbe4c c
536 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
537 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
537 +++ b/c Thu Jan 01 00:00:01 1970 +0000
538 +++ b/c Thu Jan 01 00:00:01 1970 +0000
538 @@ -0,0 +1,2 @@
539 @@ -0,0 +1,2 @@
539 +$Id$
540 +$Id$
540 +tests for different changenodes
541 +tests for different changenodes
541
542
542 $ hg qpop
543 $ hg qpop
543 popping mqtest.diff
544 popping mqtest.diff
544 patch queue now empty
545 patch queue now empty
545
546
546 qgoto, implying qpush, should expand
547 qgoto, implying qpush, should expand
547
548
548 $ hg qgoto mqtest.diff
549 $ hg qgoto mqtest.diff
549 applying mqtest.diff
550 applying mqtest.diff
550 now at: mqtest.diff
551 now at: mqtest.diff
551 $ cat c
552 $ cat c
552 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
553 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
553 tests for different changenodes
554 tests for different changenodes
554 $ hg cat c
555 $ hg cat c
555 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
556 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
556 tests for different changenodes
557 tests for different changenodes
557
558
558 Keywords should not be expanded in filelog
559 Keywords should not be expanded in filelog
559
560
560 $ hg --config 'extensions.keyword=!' cat c
561 $ hg --config 'extensions.keyword=!' cat c
561 $Id$
562 $Id$
562 tests for different changenodes
563 tests for different changenodes
563
564
564 qpop and move on
565 qpop and move on
565
566
566 $ hg qpop
567 $ hg qpop
567 popping mqtest.diff
568 popping mqtest.diff
568 patch queue now empty
569 patch queue now empty
569
570
570 Copy and show added kwfiles
571 Copy and show added kwfiles
571
572
572 $ hg cp a c
573 $ hg cp a c
573 $ hg kwfiles
574 $ hg kwfiles
574 a
575 a
575 c
576 c
576
577
577 Commit and show expansion in original and copy
578 Commit and show expansion in original and copy
578
579
579 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
580 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
580 invalid branchheads cache (served): tip differs
581 invalid branchheads cache (served): tip differs
581 c
582 c
582 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
583 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
583 invalid branchheads cache (served): tip differs
584 invalid branchheads cache (served): tip differs
584 overwriting c expanding keywords
585 overwriting c expanding keywords
585 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
586 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
586 $ cat a c
587 $ cat a c
587 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
588 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
588 do not process $Id:
589 do not process $Id:
589 xxx $
590 xxx $
590 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
591 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
591 do not process $Id:
592 do not process $Id:
592 xxx $
593 xxx $
593
594
594 Touch copied c and check its status
595 Touch copied c and check its status
595
596
596 $ touch c
597 $ touch c
597 $ hg status
598 $ hg status
598
599
599 Copy kwfile to keyword ignored file unexpanding keywords
600 Copy kwfile to keyword ignored file unexpanding keywords
600
601
601 $ hg --verbose copy a i
602 $ hg --verbose copy a i
602 copying a to i
603 copying a to i
603 overwriting i shrinking keywords
604 overwriting i shrinking keywords
604 $ head -n 1 i
605 $ head -n 1 i
605 expand $Id$
606 expand $Id$
606 $ hg forget i
607 $ hg forget i
607 $ rm i
608 $ rm i
608
609
609 Copy ignored file to ignored file: no overwriting
610 Copy ignored file to ignored file: no overwriting
610
611
611 $ hg --verbose copy b i
612 $ hg --verbose copy b i
612 copying b to i
613 copying b to i
613 $ hg forget i
614 $ hg forget i
614 $ rm i
615 $ rm i
615
616
616 cp symlink file; hg cp -A symlink file (part1)
617 cp symlink file; hg cp -A symlink file (part1)
617 - copied symlink points to kwfile: overwrite
618 - copied symlink points to kwfile: overwrite
618
619
619 #if symlink
620 #if symlink
620 $ cp sym i
621 $ cp sym i
621 $ ls -l i
622 $ ls -l i
622 -rw-r--r--* (glob)
623 -rw-r--r--* (glob)
623 $ head -1 i
624 $ head -1 i
624 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
625 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
625 $ hg copy --after --verbose sym i
626 $ hg copy --after --verbose sym i
626 copying sym to i
627 copying sym to i
627 overwriting i shrinking keywords
628 overwriting i shrinking keywords
628 $ head -1 i
629 $ head -1 i
629 expand $Id$
630 expand $Id$
630 $ hg forget i
631 $ hg forget i
631 $ rm i
632 $ rm i
632 #endif
633 #endif
633
634
634 Test different options of hg kwfiles
635 Test different options of hg kwfiles
635
636
636 $ hg kwfiles
637 $ hg kwfiles
637 a
638 a
638 c
639 c
639 $ hg -v kwfiles --ignore
640 $ hg -v kwfiles --ignore
640 I b
641 I b
641 I sym
642 I sym
642 $ hg kwfiles --all
643 $ hg kwfiles --all
643 K a
644 K a
644 K c
645 K c
645 I b
646 I b
646 I sym
647 I sym
647
648
648 Diff specific revision
649 Diff specific revision
649
650
650 $ hg diff --rev 1
651 $ hg diff --rev 1
651 diff -r ef63ca68695b c
652 diff -r ef63ca68695b c
652 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
653 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
653 +++ b/c * (glob)
654 +++ b/c * (glob)
654 @@ -0,0 +1,3 @@
655 @@ -0,0 +1,3 @@
655 +expand $Id$
656 +expand $Id$
656 +do not process $Id:
657 +do not process $Id:
657 +xxx $
658 +xxx $
658
659
659 Status after rollback:
660 Status after rollback:
660
661
661 $ hg rollback
662 $ hg rollback
662 repository tip rolled back to revision 1 (undo commit)
663 repository tip rolled back to revision 1 (undo commit)
663 working directory now based on revision 1
664 working directory now based on revision 1
664 $ hg status
665 $ hg status
665 A c
666 A c
666 $ hg update --clean
667 $ hg update --clean
667 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
668 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
668
669
669 #if symlink
670 #if symlink
670
671
671 cp symlink file; hg cp -A symlink file (part2)
672 cp symlink file; hg cp -A symlink file (part2)
672 - copied symlink points to kw ignored file: do not overwrite
673 - copied symlink points to kw ignored file: do not overwrite
673
674
674 $ cat a > i
675 $ cat a > i
675 $ ln -s i symignored
676 $ ln -s i symignored
676 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
677 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
677 $ cp symignored x
678 $ cp symignored x
678 $ hg copy --after --verbose symignored x
679 $ hg copy --after --verbose symignored x
679 copying symignored to x
680 copying symignored to x
680 $ head -n 1 x
681 $ head -n 1 x
681 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
682 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
682 $ hg forget x
683 $ hg forget x
683 $ rm x
684 $ rm x
684
685
685 $ hg rollback
686 $ hg rollback
686 repository tip rolled back to revision 1 (undo commit)
687 repository tip rolled back to revision 1 (undo commit)
687 working directory now based on revision 1
688 working directory now based on revision 1
688 $ hg update --clean
689 $ hg update --clean
689 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
690 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
690 $ rm i symignored
691 $ rm i symignored
691
692
692 #endif
693 #endif
693
694
694 Custom keywordmaps as argument to kwdemo
695 Custom keywordmaps as argument to kwdemo
695
696
696 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
697 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
697 [extensions]
698 [extensions]
698 keyword =
699 keyword =
699 [keyword]
700 [keyword]
700 ** =
701 ** =
701 b = ignore
702 b = ignore
702 demo.txt =
703 demo.txt =
703 i = ignore
704 i = ignore
704 [keywordset]
705 [keywordset]
705 svn = False
706 svn = False
706 [keywordmaps]
707 [keywordmaps]
707 Xinfo = {author}: {desc}
708 Xinfo = {author}: {desc}
708 $Xinfo: test: hg keyword configuration and expansion example $
709 $Xinfo: test: hg keyword configuration and expansion example $
709
710
710 Configure custom keywordmaps
711 Configure custom keywordmaps
711
712
712 $ cat <<EOF >>$HGRCPATH
713 $ cat <<EOF >>$HGRCPATH
713 > [keywordmaps]
714 > [keywordmaps]
714 > Id = {file} {node|short} {date|rfc822date} {author|user}
715 > Id = {file} {node|short} {date|rfc822date} {author|user}
715 > Xinfo = {author}: {desc}
716 > Xinfo = {author}: {desc}
716 > EOF
717 > EOF
717
718
718 Cat and hg cat files before custom expansion
719 Cat and hg cat files before custom expansion
719
720
720 $ cat a b
721 $ cat a b
721 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
722 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
722 do not process $Id:
723 do not process $Id:
723 xxx $
724 xxx $
724 ignore $Id$
725 ignore $Id$
725 $ hg cat sym a b && echo
726 $ hg cat sym a b && echo
726 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
727 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
727 do not process $Id:
728 do not process $Id:
728 xxx $
729 xxx $
729 ignore $Id$
730 ignore $Id$
730 a
731 a
731
732
732 Write custom keyword and prepare multi-line commit message
733 Write custom keyword and prepare multi-line commit message
733
734
734 $ echo '$Xinfo$' >> a
735 $ echo '$Xinfo$' >> a
735 $ cat <<EOF >> log
736 $ cat <<EOF >> log
736 > firstline
737 > firstline
737 > secondline
738 > secondline
738 > EOF
739 > EOF
739
740
740 Interrupted commit should not change state
741 Interrupted commit should not change state
741
742
742 $ hg commit
743 $ hg commit
743 abort: empty commit message
744 abort: empty commit message
744 [255]
745 [255]
745 $ hg status
746 $ hg status
746 M a
747 M a
747 ? c
748 ? c
748 ? log
749 ? log
749
750
750 Commit with multi-line message and custom expansion
751 Commit with multi-line message and custom expansion
751
752
752 |Note:
753 |Note:
753 |
754 |
754 | After the last rollback, the "served" branchheads cache became invalid, but
755 | After the last rollback, the "served" branchheads cache became invalid, but
755 | all changesets in the repo were public. For filtering this means:
756 | all changesets in the repo were public. For filtering this means:
756 | "immutable" == "served" == ΓΈ.
757 | "immutable" == "served" == ΓΈ.
757 |
758 |
758 | As the "served" cache is invalid, we fall back to the "immutable" cache. But
759 | As the "served" cache is invalid, we fall back to the "immutable" cache. But
759 | no update is needed between "immutable" and "served" and the "served" cache
760 | no update is needed between "immutable" and "served" and the "served" cache
760 | is not updated on disk. The on-disk version therefore stays invalid for some
761 | is not updated on disk. The on-disk version therefore stays invalid for some
761 | time. This explains why the "served" branchheads cache is detected as
762 | time. This explains why the "served" branchheads cache is detected as
762 | invalid here.
763 | invalid here.
763
764
764 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
765 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
765 invalid branchheads cache (served): tip differs
766 invalid branchheads cache (served): tip differs
766 a
767 a
767 invalid branchheads cache (served): tip differs
768 invalid branchheads cache (served): tip differs
768 overwriting a expanding keywords
769 overwriting a expanding keywords
769 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
770 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
770 $ rm log
771 $ rm log
771
772
772 Stat, verify and show custom expansion (firstline)
773 Stat, verify and show custom expansion (firstline)
773
774
774 $ hg status
775 $ hg status
775 ? c
776 ? c
776 $ hg verify
777 $ hg verify
777 checking changesets
778 checking changesets
778 checking manifests
779 checking manifests
779 crosschecking files in changesets and manifests
780 crosschecking files in changesets and manifests
780 checking files
781 checking files
781 3 files, 3 changesets, 4 total revisions
782 3 files, 3 changesets, 4 total revisions
782 $ cat a b
783 $ cat a b
783 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
784 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
784 do not process $Id:
785 do not process $Id:
785 xxx $
786 xxx $
786 $Xinfo: User Name <user@example.com>: firstline $
787 $Xinfo: User Name <user@example.com>: firstline $
787 ignore $Id$
788 ignore $Id$
788 $ hg cat sym a b && echo
789 $ hg cat sym a b && echo
789 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
790 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
790 do not process $Id:
791 do not process $Id:
791 xxx $
792 xxx $
792 $Xinfo: User Name <user@example.com>: firstline $
793 $Xinfo: User Name <user@example.com>: firstline $
793 ignore $Id$
794 ignore $Id$
794 a
795 a
795
796
796 annotate
797 annotate
797
798
798 $ hg annotate a
799 $ hg annotate a
799 1: expand $Id$
800 1: expand $Id$
800 1: do not process $Id:
801 1: do not process $Id:
801 1: xxx $
802 1: xxx $
802 2: $Xinfo$
803 2: $Xinfo$
803
804
804 remove with status checks
805 remove with status checks
805
806
806 $ hg debugrebuildstate
807 $ hg debugrebuildstate
807 $ hg remove a
808 $ hg remove a
808 $ hg --debug commit -m rma
809 $ hg --debug commit -m rma
809 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
810 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
810 $ hg status
811 $ hg status
811 ? c
812 ? c
812
813
813 Rollback, revert, and check expansion
814 Rollback, revert, and check expansion
814
815
815 $ hg rollback
816 $ hg rollback
816 repository tip rolled back to revision 2 (undo commit)
817 repository tip rolled back to revision 2 (undo commit)
817 working directory now based on revision 2
818 working directory now based on revision 2
818 $ hg status
819 $ hg status
819 R a
820 R a
820 ? c
821 ? c
821 $ hg revert --no-backup --rev tip a
822 $ hg revert --no-backup --rev tip a
822 $ cat a
823 $ cat a
823 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
824 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
824 do not process $Id:
825 do not process $Id:
825 xxx $
826 xxx $
826 $Xinfo: User Name <user@example.com>: firstline $
827 $Xinfo: User Name <user@example.com>: firstline $
827
828
828 Clone to test global and local configurations
829 Clone to test global and local configurations
829
830
830 $ cd ..
831 $ cd ..
831
832
832 Expansion in destination with global configuration
833 Expansion in destination with global configuration
833
834
834 $ hg --quiet clone Test globalconf
835 $ hg --quiet clone Test globalconf
835 $ cat globalconf/a
836 $ cat globalconf/a
836 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
837 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
837 do not process $Id:
838 do not process $Id:
838 xxx $
839 xxx $
839 $Xinfo: User Name <user@example.com>: firstline $
840 $Xinfo: User Name <user@example.com>: firstline $
840
841
841 No expansion in destination with local configuration in origin only
842 No expansion in destination with local configuration in origin only
842
843
843 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
844 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
844 $ cat localconf/a
845 $ cat localconf/a
845 expand $Id$
846 expand $Id$
846 do not process $Id:
847 do not process $Id:
847 xxx $
848 xxx $
848 $Xinfo$
849 $Xinfo$
849
850
850 Clone to test incoming
851 Clone to test incoming
851
852
852 $ hg clone -r1 Test Test-a
853 $ hg clone -r1 Test Test-a
853 adding changesets
854 adding changesets
854 adding manifests
855 adding manifests
855 adding file changes
856 adding file changes
856 added 2 changesets with 3 changes to 3 files
857 added 2 changesets with 3 changes to 3 files
857 updating to branch default
858 updating to branch default
858 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
859 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
859 $ cd Test-a
860 $ cd Test-a
860 $ cat <<EOF >> .hg/hgrc
861 $ cat <<EOF >> .hg/hgrc
861 > [paths]
862 > [paths]
862 > default = ../Test
863 > default = ../Test
863 > EOF
864 > EOF
864 $ hg incoming
865 $ hg incoming
865 comparing with $TESTTMP/Test (glob)
866 comparing with $TESTTMP/Test (glob)
866 searching for changes
867 searching for changes
867 changeset: 2:bb948857c743
868 changeset: 2:bb948857c743
868 tag: tip
869 tag: tip
869 user: User Name <user@example.com>
870 user: User Name <user@example.com>
870 date: Thu Jan 01 00:00:02 1970 +0000
871 date: Thu Jan 01 00:00:02 1970 +0000
871 summary: firstline
872 summary: firstline
872
873
873 Imported patch should not be rejected
874 Imported patch should not be rejected
874
875
875 >>> import re
876 >>> import re
876 >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
877 >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
877 >>> open('a', 'wb').write(text)
878 >>> open('a', 'wb').write(text)
878 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
879 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
879 a
880 a
880 overwriting a expanding keywords
881 overwriting a expanding keywords
881 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
882 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
882 $ hg export -o ../rejecttest.diff tip
883 $ hg export -o ../rejecttest.diff tip
883 $ cd ../Test
884 $ cd ../Test
884 $ hg import ../rejecttest.diff
885 $ hg import ../rejecttest.diff
885 applying ../rejecttest.diff
886 applying ../rejecttest.diff
886 $ cat a b
887 $ cat a b
887 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
888 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
888 do not process $Id: rejecttest
889 do not process $Id: rejecttest
889 xxx $
890 xxx $
890 $Xinfo: User Name <user@example.com>: rejects? $
891 $Xinfo: User Name <user@example.com>: rejects? $
891 ignore $Id$
892 ignore $Id$
892
893
893 $ hg rollback
894 $ hg rollback
894 repository tip rolled back to revision 2 (undo import)
895 repository tip rolled back to revision 2 (undo import)
895 working directory now based on revision 2
896 working directory now based on revision 2
896 $ hg update --clean
897 $ hg update --clean
897 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
898 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
898
899
899 kwexpand/kwshrink on selected files
900 kwexpand/kwshrink on selected files
900
901
901 $ mkdir x
902 $ mkdir x
902 $ hg copy a x/a
903 $ hg copy a x/a
903 $ hg --verbose kwshrink a
904 $ hg --verbose kwshrink a
904 overwriting a shrinking keywords
905 overwriting a shrinking keywords
905 - sleep required for dirstate.normal() check
906 - sleep required for dirstate.normal() check
906 $ sleep 1
907 $ sleep 1
907 $ hg status a
908 $ hg status a
908 $ hg --verbose kwexpand a
909 $ hg --verbose kwexpand a
909 overwriting a expanding keywords
910 overwriting a expanding keywords
910 $ hg status a
911 $ hg status a
911
912
912 kwexpand x/a should abort
913 kwexpand x/a should abort
913
914
914 $ hg --verbose kwexpand x/a
915 $ hg --verbose kwexpand x/a
915 abort: outstanding uncommitted changes
916 abort: outstanding uncommitted changes
916 [255]
917 [255]
917 $ cd x
918 $ cd x
918 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
919 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
919 x/a
920 x/a
920 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
921 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
921 overwriting x/a expanding keywords
922 overwriting x/a expanding keywords
922 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
923 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
923 $ cat a
924 $ cat a
924 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
925 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
925 do not process $Id:
926 do not process $Id:
926 xxx $
927 xxx $
927 $Xinfo: User Name <user@example.com>: xa $
928 $Xinfo: User Name <user@example.com>: xa $
928
929
929 kwshrink a inside directory x
930 kwshrink a inside directory x
930
931
931 $ hg --verbose kwshrink a
932 $ hg --verbose kwshrink a
932 overwriting x/a shrinking keywords
933 overwriting x/a shrinking keywords
933 $ cat a
934 $ cat a
934 expand $Id$
935 expand $Id$
935 do not process $Id:
936 do not process $Id:
936 xxx $
937 xxx $
937 $Xinfo$
938 $Xinfo$
938 $ cd ..
939 $ cd ..
939
940
940 kwexpand nonexistent
941 kwexpand nonexistent
941
942
942 $ hg kwexpand nonexistent
943 $ hg kwexpand nonexistent
943 nonexistent:* (glob)
944 nonexistent:* (glob)
944
945
945
946
946 #if serve
947 #if serve
947 hg serve
948 hg serve
948 - expand with hgweb file
949 - expand with hgweb file
949 - no expansion with hgweb annotate/changeset/filediff
950 - no expansion with hgweb annotate/changeset/filediff
950 - check errors
951 - check errors
951
952
952 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
953 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
953 $ cat hg.pid >> $DAEMON_PIDS
954 $ cat hg.pid >> $DAEMON_PIDS
954 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/a/?style=raw'
955 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/a/?style=raw'
955 200 Script output follows
956 200 Script output follows
956
957
957 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
958 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
958 do not process $Id:
959 do not process $Id:
959 xxx $
960 xxx $
960 $Xinfo: User Name <user@example.com>: firstline $
961 $Xinfo: User Name <user@example.com>: firstline $
961 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/a/?style=raw'
962 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/a/?style=raw'
962 200 Script output follows
963 200 Script output follows
963
964
964
965
965 user@1: expand $Id$
966 user@1: expand $Id$
966 user@1: do not process $Id:
967 user@1: do not process $Id:
967 user@1: xxx $
968 user@1: xxx $
968 user@2: $Xinfo$
969 user@2: $Xinfo$
969
970
970
971
971
972
972
973
973 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'rev/tip/?style=raw'
974 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'rev/tip/?style=raw'
974 200 Script output follows
975 200 Script output follows
975
976
976
977
977 # HG changeset patch
978 # HG changeset patch
978 # User User Name <user@example.com>
979 # User User Name <user@example.com>
979 # Date 3 0
980 # Date 3 0
980 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
981 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
981 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
982 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
982 xa
983 xa
983
984
984 diff -r bb948857c743 -r b4560182a3f9 x/a
985 diff -r bb948857c743 -r b4560182a3f9 x/a
985 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
986 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
986 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
987 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
987 @@ -0,0 +1,4 @@
988 @@ -0,0 +1,4 @@
988 +expand $Id$
989 +expand $Id$
989 +do not process $Id:
990 +do not process $Id:
990 +xxx $
991 +xxx $
991 +$Xinfo$
992 +$Xinfo$
992
993
993 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'diff/bb948857c743/a?style=raw'
994 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'diff/bb948857c743/a?style=raw'
994 200 Script output follows
995 200 Script output follows
995
996
996
997
997 diff -r ef63ca68695b -r bb948857c743 a
998 diff -r ef63ca68695b -r bb948857c743 a
998 --- a/a Thu Jan 01 00:00:00 1970 +0000
999 --- a/a Thu Jan 01 00:00:00 1970 +0000
999 +++ b/a Thu Jan 01 00:00:02 1970 +0000
1000 +++ b/a Thu Jan 01 00:00:02 1970 +0000
1000 @@ -1,3 +1,4 @@
1001 @@ -1,3 +1,4 @@
1001 expand $Id$
1002 expand $Id$
1002 do not process $Id:
1003 do not process $Id:
1003 xxx $
1004 xxx $
1004 +$Xinfo$
1005 +$Xinfo$
1005
1006
1006
1007
1007
1008
1008
1009
1009 $ cat errors.log
1010 $ cat errors.log
1010 #endif
1011 #endif
1011
1012
1012 Prepare merge and resolve tests
1013 Prepare merge and resolve tests
1013
1014
1014 $ echo '$Id$' > m
1015 $ echo '$Id$' > m
1015 $ hg add m
1016 $ hg add m
1016 $ hg commit -m 4kw
1017 $ hg commit -m 4kw
1017 $ echo foo >> m
1018 $ echo foo >> m
1018 $ hg commit -m 5foo
1019 $ hg commit -m 5foo
1019
1020
1020 simplemerge
1021 simplemerge
1021
1022
1022 $ hg update 4
1023 $ hg update 4
1023 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1024 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1024 $ echo foo >> m
1025 $ echo foo >> m
1025 $ hg commit -m 6foo
1026 $ hg commit -m 6foo
1026 created new head
1027 created new head
1027 $ hg merge
1028 $ hg merge
1028 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1029 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1029 (branch merge, don't forget to commit)
1030 (branch merge, don't forget to commit)
1030 $ hg commit -m simplemerge
1031 $ hg commit -m simplemerge
1031 $ cat m
1032 $ cat m
1032 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
1033 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
1033 foo
1034 foo
1034
1035
1035 conflict: keyword should stay outside conflict zone
1036 conflict: keyword should stay outside conflict zone
1036
1037
1037 $ hg update 4
1038 $ hg update 4
1038 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1039 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1039 $ echo bar >> m
1040 $ echo bar >> m
1040 $ hg commit -m 8bar
1041 $ hg commit -m 8bar
1041 created new head
1042 created new head
1042 $ hg merge
1043 $ hg merge
1043 merging m
1044 merging m
1044 warning: conflicts during merge.
1045 warning: conflicts during merge.
1045 merging m incomplete! (edit conflicts, then use 'hg resolve --mark')
1046 merging m incomplete! (edit conflicts, then use 'hg resolve --mark')
1046 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1047 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1047 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1048 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1048 [1]
1049 [1]
1049 $ cat m
1050 $ cat m
1050 $Id$
1051 $Id$
1051 <<<<<<< local
1052 <<<<<<< local
1052 bar
1053 bar
1053 =======
1054 =======
1054 foo
1055 foo
1055 >>>>>>> other
1056 >>>>>>> other
1056
1057
1057 resolve to local
1058 resolve to local
1058
1059
1059 $ HGMERGE=internal:local hg resolve -a
1060 $ HGMERGE=internal:local hg resolve -a
1060 $ hg commit -m localresolve
1061 $ hg commit -m localresolve
1061 $ cat m
1062 $ cat m
1062 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1063 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1063 bar
1064 bar
1064
1065
1065 Test restricted mode with transplant -b
1066 Test restricted mode with transplant -b
1066
1067
1067 $ hg update 6
1068 $ hg update 6
1068 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1069 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1069 $ hg branch foo
1070 $ hg branch foo
1070 marked working directory as branch foo
1071 marked working directory as branch foo
1071 (branches are permanent and global, did you want a bookmark?)
1072 (branches are permanent and global, did you want a bookmark?)
1072 $ mv a a.bak
1073 $ mv a a.bak
1073 $ echo foobranch > a
1074 $ echo foobranch > a
1074 $ cat a.bak >> a
1075 $ cat a.bak >> a
1075 $ rm a.bak
1076 $ rm a.bak
1076 $ hg commit -m 9foobranch
1077 $ hg commit -m 9foobranch
1077 $ hg update default
1078 $ hg update default
1078 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1079 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1079 $ hg -y transplant -b foo tip
1080 $ hg -y transplant -b foo tip
1080 applying 4aa30d025d50
1081 applying 4aa30d025d50
1081 4aa30d025d50 transplanted to e00abbf63521
1082 4aa30d025d50 transplanted to e00abbf63521
1082
1083
1083 Expansion in changeset but not in file
1084 Expansion in changeset but not in file
1084
1085
1085 $ hg tip -p
1086 $ hg tip -p
1086 changeset: 11:e00abbf63521
1087 changeset: 11:e00abbf63521
1087 tag: tip
1088 tag: tip
1088 parent: 9:800511b3a22d
1089 parent: 9:800511b3a22d
1089 user: test
1090 user: test
1090 date: Thu Jan 01 00:00:00 1970 +0000
1091 date: Thu Jan 01 00:00:00 1970 +0000
1091 summary: 9foobranch
1092 summary: 9foobranch
1092
1093
1093 diff -r 800511b3a22d -r e00abbf63521 a
1094 diff -r 800511b3a22d -r e00abbf63521 a
1094 --- a/a Thu Jan 01 00:00:00 1970 +0000
1095 --- a/a Thu Jan 01 00:00:00 1970 +0000
1095 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1096 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1096 @@ -1,3 +1,4 @@
1097 @@ -1,3 +1,4 @@
1097 +foobranch
1098 +foobranch
1098 expand $Id$
1099 expand $Id$
1099 do not process $Id:
1100 do not process $Id:
1100 xxx $
1101 xxx $
1101
1102
1102 $ head -n 2 a
1103 $ head -n 2 a
1103 foobranch
1104 foobranch
1104 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1105 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1105
1106
1106 Turn off expansion
1107 Turn off expansion
1107
1108
1108 $ hg -q rollback
1109 $ hg -q rollback
1109 $ hg -q update -C
1110 $ hg -q update -C
1110
1111
1111 kwshrink with unknown file u
1112 kwshrink with unknown file u
1112
1113
1113 $ cp a u
1114 $ cp a u
1114 $ hg --verbose kwshrink
1115 $ hg --verbose kwshrink
1115 overwriting a shrinking keywords
1116 overwriting a shrinking keywords
1116 overwriting m shrinking keywords
1117 overwriting m shrinking keywords
1117 overwriting x/a shrinking keywords
1118 overwriting x/a shrinking keywords
1118
1119
1119 Keywords shrunk in working directory, but not yet disabled
1120 Keywords shrunk in working directory, but not yet disabled
1120 - cat shows unexpanded keywords
1121 - cat shows unexpanded keywords
1121 - hg cat shows expanded keywords
1122 - hg cat shows expanded keywords
1122
1123
1123 $ cat a b
1124 $ cat a b
1124 expand $Id$
1125 expand $Id$
1125 do not process $Id:
1126 do not process $Id:
1126 xxx $
1127 xxx $
1127 $Xinfo$
1128 $Xinfo$
1128 ignore $Id$
1129 ignore $Id$
1129 $ hg cat sym a b && echo
1130 $ hg cat sym a b && echo
1130 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1131 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1131 do not process $Id:
1132 do not process $Id:
1132 xxx $
1133 xxx $
1133 $Xinfo: User Name <user@example.com>: firstline $
1134 $Xinfo: User Name <user@example.com>: firstline $
1134 ignore $Id$
1135 ignore $Id$
1135 a
1136 a
1136
1137
1137 Now disable keyword expansion
1138 Now disable keyword expansion
1138
1139
1139 $ rm "$HGRCPATH"
1140 $ rm "$HGRCPATH"
1140 $ cat a b
1141 $ cat a b
1141 expand $Id$
1142 expand $Id$
1142 do not process $Id:
1143 do not process $Id:
1143 xxx $
1144 xxx $
1144 $Xinfo$
1145 $Xinfo$
1145 ignore $Id$
1146 ignore $Id$
1146 $ hg cat sym a b && echo
1147 $ hg cat sym a b && echo
1147 expand $Id$
1148 expand $Id$
1148 do not process $Id:
1149 do not process $Id:
1149 xxx $
1150 xxx $
1150 $Xinfo$
1151 $Xinfo$
1151 ignore $Id$
1152 ignore $Id$
1152 a
1153 a
1153
1154
1154 $ cd ..
1155 $ cd ..
@@ -1,2353 +1,2406 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "patchbomb=" >> $HGRCPATH
2 $ echo "patchbomb=" >> $HGRCPATH
3
3
4 $ hg init t
4 $ hg init t
5 $ cd t
5 $ cd t
6 $ echo a > a
6 $ echo a > a
7 $ hg commit -Ama -d '1 0'
7 $ hg commit -Ama -d '1 0'
8 adding a
8 adding a
9
9
10 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -r tip
10 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -r tip
11 this patch series consists of 1 patches.
11 this patch series consists of 1 patches.
12
12
13
13
14 displaying [PATCH] a ...
14 displaying [PATCH] a ...
15 Content-Type: text/plain; charset="us-ascii"
15 Content-Type: text/plain; charset="us-ascii"
16 MIME-Version: 1.0
16 MIME-Version: 1.0
17 Content-Transfer-Encoding: 7bit
17 Content-Transfer-Encoding: 7bit
18 Subject: [PATCH] a
18 Subject: [PATCH] a
19 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
19 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
20 Message-Id: <8580ff50825a50c8f716.60@*> (glob)
20 Message-Id: <8580ff50825a50c8f716.60@*> (glob)
21 User-Agent: Mercurial-patchbomb/* (glob)
21 User-Agent: Mercurial-patchbomb/* (glob)
22 Date: Thu, 01 Jan 1970 00:01:00 +0000
22 Date: Thu, 01 Jan 1970 00:01:00 +0000
23 From: quux
23 From: quux
24 To: foo
24 To: foo
25 Cc: bar
25 Cc: bar
26
26
27 # HG changeset patch
27 # HG changeset patch
28 # User test
28 # User test
29 # Date 1 0
29 # Date 1 0
30 # Thu Jan 01 00:00:01 1970 +0000
30 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
31 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
31 # Parent 0000000000000000000000000000000000000000
32 # Parent 0000000000000000000000000000000000000000
32 a
33 a
33
34
34 diff -r 000000000000 -r 8580ff50825a a
35 diff -r 000000000000 -r 8580ff50825a a
35 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
36 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
36 +++ b/a Thu Jan 01 00:00:01 1970 +0000
37 +++ b/a Thu Jan 01 00:00:01 1970 +0000
37 @@ -0,0 +1,1 @@
38 @@ -0,0 +1,1 @@
38 +a
39 +a
39
40
40
41
41 $ hg --config ui.interactive=1 email --confirm -n -f quux -t foo -c bar -r tip<<EOF
42 $ hg --config ui.interactive=1 email --confirm -n -f quux -t foo -c bar -r tip<<EOF
42 > n
43 > n
43 > EOF
44 > EOF
44 this patch series consists of 1 patches.
45 this patch series consists of 1 patches.
45
46
46
47
47 Final summary:
48 Final summary:
48
49
49 From: quux
50 From: quux
50 To: foo
51 To: foo
51 Cc: bar
52 Cc: bar
52 Subject: [PATCH] a
53 Subject: [PATCH] a
53 a | 1 +
54 a | 1 +
54 1 files changed, 1 insertions(+), 0 deletions(-)
55 1 files changed, 1 insertions(+), 0 deletions(-)
55
56
56 are you sure you want to send (yn)? abort: patchbomb canceled
57 are you sure you want to send (yn)? abort: patchbomb canceled
57 [255]
58 [255]
58
59
59 $ echo b > b
60 $ echo b > b
60 $ hg commit -Amb -d '2 0'
61 $ hg commit -Amb -d '2 0'
61 adding b
62 adding b
62
63
63 $ hg email --date '1970-1-1 0:2' -n -f quux -t foo -c bar -s test -r 0:tip
64 $ hg email --date '1970-1-1 0:2' -n -f quux -t foo -c bar -s test -r 0:tip
64 this patch series consists of 2 patches.
65 this patch series consists of 2 patches.
65
66
66
67
67 Write the introductory message for the patch series.
68 Write the introductory message for the patch series.
68
69
69
70
70 displaying [PATCH 0 of 2] test ...
71 displaying [PATCH 0 of 2] test ...
71 Content-Type: text/plain; charset="us-ascii"
72 Content-Type: text/plain; charset="us-ascii"
72 MIME-Version: 1.0
73 MIME-Version: 1.0
73 Content-Transfer-Encoding: 7bit
74 Content-Transfer-Encoding: 7bit
74 Subject: [PATCH 0 of 2] test
75 Subject: [PATCH 0 of 2] test
75 Message-Id: <patchbomb.120@*> (glob)
76 Message-Id: <patchbomb.120@*> (glob)
76 User-Agent: Mercurial-patchbomb/* (glob)
77 User-Agent: Mercurial-patchbomb/* (glob)
77 Date: Thu, 01 Jan 1970 00:02:00 +0000
78 Date: Thu, 01 Jan 1970 00:02:00 +0000
78 From: quux
79 From: quux
79 To: foo
80 To: foo
80 Cc: bar
81 Cc: bar
81
82
82
83
83 displaying [PATCH 1 of 2] a ...
84 displaying [PATCH 1 of 2] a ...
84 Content-Type: text/plain; charset="us-ascii"
85 Content-Type: text/plain; charset="us-ascii"
85 MIME-Version: 1.0
86 MIME-Version: 1.0
86 Content-Transfer-Encoding: 7bit
87 Content-Transfer-Encoding: 7bit
87 Subject: [PATCH 1 of 2] a
88 Subject: [PATCH 1 of 2] a
88 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
89 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
89 Message-Id: <8580ff50825a50c8f716.121@*> (glob)
90 Message-Id: <8580ff50825a50c8f716.121@*> (glob)
90 In-Reply-To: <patchbomb.120@*> (glob)
91 In-Reply-To: <patchbomb.120@*> (glob)
91 References: <patchbomb.120@*> (glob)
92 References: <patchbomb.120@*> (glob)
92 User-Agent: Mercurial-patchbomb/* (glob)
93 User-Agent: Mercurial-patchbomb/* (glob)
93 Date: Thu, 01 Jan 1970 00:02:01 +0000
94 Date: Thu, 01 Jan 1970 00:02:01 +0000
94 From: quux
95 From: quux
95 To: foo
96 To: foo
96 Cc: bar
97 Cc: bar
97
98
98 # HG changeset patch
99 # HG changeset patch
99 # User test
100 # User test
100 # Date 1 0
101 # Date 1 0
102 # Thu Jan 01 00:00:01 1970 +0000
101 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
103 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
102 # Parent 0000000000000000000000000000000000000000
104 # Parent 0000000000000000000000000000000000000000
103 a
105 a
104
106
105 diff -r 000000000000 -r 8580ff50825a a
107 diff -r 000000000000 -r 8580ff50825a a
106 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
108 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
107 +++ b/a Thu Jan 01 00:00:01 1970 +0000
109 +++ b/a Thu Jan 01 00:00:01 1970 +0000
108 @@ -0,0 +1,1 @@
110 @@ -0,0 +1,1 @@
109 +a
111 +a
110
112
111 displaying [PATCH 2 of 2] b ...
113 displaying [PATCH 2 of 2] b ...
112 Content-Type: text/plain; charset="us-ascii"
114 Content-Type: text/plain; charset="us-ascii"
113 MIME-Version: 1.0
115 MIME-Version: 1.0
114 Content-Transfer-Encoding: 7bit
116 Content-Transfer-Encoding: 7bit
115 Subject: [PATCH 2 of 2] b
117 Subject: [PATCH 2 of 2] b
116 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
118 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
117 Message-Id: <97d72e5f12c7e84f8506.122@*> (glob)
119 Message-Id: <97d72e5f12c7e84f8506.122@*> (glob)
118 In-Reply-To: <patchbomb.120@*> (glob)
120 In-Reply-To: <patchbomb.120@*> (glob)
119 References: <patchbomb.120@*> (glob)
121 References: <patchbomb.120@*> (glob)
120 User-Agent: Mercurial-patchbomb/* (glob)
122 User-Agent: Mercurial-patchbomb/* (glob)
121 Date: Thu, 01 Jan 1970 00:02:02 +0000
123 Date: Thu, 01 Jan 1970 00:02:02 +0000
122 From: quux
124 From: quux
123 To: foo
125 To: foo
124 Cc: bar
126 Cc: bar
125
127
126 # HG changeset patch
128 # HG changeset patch
127 # User test
129 # User test
128 # Date 2 0
130 # Date 2 0
131 # Thu Jan 01 00:00:02 1970 +0000
129 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
132 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
130 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
133 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
131 b
134 b
132
135
133 diff -r 8580ff50825a -r 97d72e5f12c7 b
136 diff -r 8580ff50825a -r 97d72e5f12c7 b
134 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
137 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
135 +++ b/b Thu Jan 01 00:00:02 1970 +0000
138 +++ b/b Thu Jan 01 00:00:02 1970 +0000
136 @@ -0,0 +1,1 @@
139 @@ -0,0 +1,1 @@
137 +b
140 +b
138
141
139
142
140 .hg/last-email.txt
143 .hg/last-email.txt
141
144
142 $ cat > editor.sh << '__EOF__'
145 $ cat > editor.sh << '__EOF__'
143 > echo "a precious introductory message" > "$1"
146 > echo "a precious introductory message" > "$1"
144 > __EOF__
147 > __EOF__
145 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg email -n -t foo -s test -r 0:tip > /dev/null
148 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg email -n -t foo -s test -r 0:tip > /dev/null
146 $ cat .hg/last-email.txt
149 $ cat .hg/last-email.txt
147 a precious introductory message
150 a precious introductory message
148
151
149 $ hg email -m test.mbox -f quux -t foo -c bar -s test 0:tip \
152 $ hg email -m test.mbox -f quux -t foo -c bar -s test 0:tip \
150 > --config extensions.progress= --config progress.assume-tty=1 \
153 > --config extensions.progress= --config progress.assume-tty=1 \
151 > --config progress.delay=0 --config progress.refresh=0 \
154 > --config progress.delay=0 --config progress.refresh=0 \
152 > --config progress.width=60
155 > --config progress.width=60
153 this patch series consists of 2 patches.
156 this patch series consists of 2 patches.
154
157
155
158
156 Write the introductory message for the patch series.
159 Write the introductory message for the patch series.
157
160
158 \r (no-eol) (esc)
161 \r (no-eol) (esc)
159 sending [ ] 0/3\r (no-eol) (esc)
162 sending [ ] 0/3\r (no-eol) (esc)
160 sending [ ] 0/3\r (no-eol) (esc)
163 sending [ ] 0/3\r (no-eol) (esc)
161 \r (no-eol) (esc)
164 \r (no-eol) (esc)
162 \r (no-eol) (esc)
165 \r (no-eol) (esc)
163 \r (no-eol) (esc)
166 \r (no-eol) (esc)
164 \r (no-eol) (esc)
167 \r (no-eol) (esc)
165 sending [==============> ] 1/3\r (no-eol) (esc)
168 sending [==============> ] 1/3\r (no-eol) (esc)
166 sending [==============> ] 1/3\r (no-eol) (esc)
169 sending [==============> ] 1/3\r (no-eol) (esc)
167 \r (no-eol) (esc)
170 \r (no-eol) (esc)
168 \r (no-eol) (esc)
171 \r (no-eol) (esc)
169 \r (no-eol) (esc)
172 \r (no-eol) (esc)
170 \r (no-eol) (esc)
173 \r (no-eol) (esc)
171 sending [=============================> ] 2/3\r (no-eol) (esc)
174 sending [=============================> ] 2/3\r (no-eol) (esc)
172 sending [=============================> ] 2/3\r (no-eol) (esc)
175 sending [=============================> ] 2/3\r (no-eol) (esc)
173 \r (esc)
176 \r (esc)
174 sending [PATCH 0 of 2] test ...
177 sending [PATCH 0 of 2] test ...
175 sending [PATCH 1 of 2] a ...
178 sending [PATCH 1 of 2] a ...
176 sending [PATCH 2 of 2] b ...
179 sending [PATCH 2 of 2] b ...
177
180
178 $ cd ..
181 $ cd ..
179
182
180 $ hg clone -q t t2
183 $ hg clone -q t t2
181 $ cd t2
184 $ cd t2
182 $ echo c > c
185 $ echo c > c
183 $ hg commit -Amc -d '3 0'
186 $ hg commit -Amc -d '3 0'
184 adding c
187 adding c
185
188
186 $ cat > description <<EOF
189 $ cat > description <<EOF
187 > a multiline
190 > a multiline
188 >
191 >
189 > description
192 > description
190 > EOF
193 > EOF
191
194
192
195
193 test bundle and description:
196 test bundle and description:
194 $ hg email --date '1970-1-1 0:3' -n -f quux -t foo \
197 $ hg email --date '1970-1-1 0:3' -n -f quux -t foo \
195 > -c bar -s test -r tip -b --desc description
198 > -c bar -s test -r tip -b --desc description
196 searching for changes
199 searching for changes
197 1 changesets found
200 1 changesets found
198
201
199 displaying test ...
202 displaying test ...
200 Content-Type: multipart/mixed; boundary="===*" (glob)
203 Content-Type: multipart/mixed; boundary="===*" (glob)
201 MIME-Version: 1.0
204 MIME-Version: 1.0
202 Subject: test
205 Subject: test
203 Message-Id: <patchbomb.180@*> (glob)
206 Message-Id: <patchbomb.180@*> (glob)
204 User-Agent: Mercurial-patchbomb/* (glob)
207 User-Agent: Mercurial-patchbomb/* (glob)
205 Date: Thu, 01 Jan 1970 00:03:00 +0000
208 Date: Thu, 01 Jan 1970 00:03:00 +0000
206 From: quux
209 From: quux
207 To: foo
210 To: foo
208 Cc: bar
211 Cc: bar
209
212
210 --===* (glob)
213 --===* (glob)
211 Content-Type: text/plain; charset="us-ascii"
214 Content-Type: text/plain; charset="us-ascii"
212 MIME-Version: 1.0
215 MIME-Version: 1.0
213 Content-Transfer-Encoding: 7bit
216 Content-Transfer-Encoding: 7bit
214
217
215 a multiline
218 a multiline
216
219
217 description
220 description
218
221
219 --===* (glob)
222 --===* (glob)
220 Content-Type: application/x-mercurial-bundle
223 Content-Type: application/x-mercurial-bundle
221 MIME-Version: 1.0
224 MIME-Version: 1.0
222 Content-Disposition: attachment; filename="bundle.hg"
225 Content-Disposition: attachment; filename="bundle.hg"
223 Content-Transfer-Encoding: base64
226 Content-Transfer-Encoding: base64
224
227
225 SEcxMEJaaDkxQVkmU1nvR7I3AAAN////lFYQWj1/4HwRkdC/AywIAk0E4pfoSIIIgQCgGEQOcLAA
228 SEcxMEJaaDkxQVkmU1nvR7I3AAAN////lFYQWj1/4HwRkdC/AywIAk0E4pfoSIIIgQCgGEQOcLAA
226 2tA1VPyp4mkeoG0EaaPU0GTT1GjRiNPIg9CZGBqZ6UbU9J+KFU09DNUaGgAAAAAANAGgAAAAA1U8
229 2tA1VPyp4mkeoG0EaaPU0GTT1GjRiNPIg9CZGBqZ6UbU9J+KFU09DNUaGgAAAAAANAGgAAAAA1U8
227 oGgAADQGgAANNANAAAAAAZipFLz3XoakCEQB3PVPyHJVi1iYkAAKQAZQGpQGZESInRnCFMqLDla2
230 oGgAADQGgAANNANAAAAAAZipFLz3XoakCEQB3PVPyHJVi1iYkAAKQAZQGpQGZESInRnCFMqLDla2
228 Bx3qfRQeA2N4lnzKkAmP8kR2asievLLXXebVU8Vg4iEBqcJNJAxIapSU6SM4888ZAciRG6MYAIEE
231 Bx3qfRQeA2N4lnzKkAmP8kR2asievLLXXebVU8Vg4iEBqcJNJAxIapSU6SM4888ZAciRG6MYAIEE
229 SlIBpFisgGkyRjX//TMtfcUAEsGu56+YnE1OlTZmzKm8BSu2rvo4rHAYYaadIFFuTy0LYgIkgLVD
232 SlIBpFisgGkyRjX//TMtfcUAEsGu56+YnE1OlTZmzKm8BSu2rvo4rHAYYaadIFFuTy0LYgIkgLVD
230 sgVa2F19D1tx9+hgbAygLgQwaIqcDdgA4BjQgIiz/AEP72++llgDKhKducqodGE4B0ETqF3JFOFC
233 sgVa2F19D1tx9+hgbAygLgQwaIqcDdgA4BjQgIiz/AEP72++llgDKhKducqodGE4B0ETqF3JFOFC
231 Q70eyNw=
234 Q70eyNw=
232 --===*-- (glob)
235 --===*-- (glob)
233
236
234 utf-8 patch:
237 utf-8 patch:
235 $ python -c 'fp = open("utf", "wb"); fp.write("h\xC3\xB6mma!\n"); fp.close();'
238 $ python -c 'fp = open("utf", "wb"); fp.write("h\xC3\xB6mma!\n"); fp.close();'
236 $ hg commit -A -d '4 0' -m 'utf-8 content'
239 $ hg commit -A -d '4 0' -m 'utf-8 content'
237 adding description
240 adding description
238 adding utf
241 adding utf
239
242
240 no mime encoding for email --test:
243 no mime encoding for email --test:
241 $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n
244 $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n
242 this patch series consists of 1 patches.
245 this patch series consists of 1 patches.
243
246
244
247
245 displaying [PATCH] utf-8 content ...
248 displaying [PATCH] utf-8 content ...
246 Content-Type: text/plain; charset="us-ascii"
249 Content-Type: text/plain; charset="us-ascii"
247 MIME-Version: 1.0
250 MIME-Version: 1.0
248 Content-Transfer-Encoding: 8bit
251 Content-Transfer-Encoding: 8bit
249 Subject: [PATCH] utf-8 content
252 Subject: [PATCH] utf-8 content
250 X-Mercurial-Node: 909a00e13e9d78b575aeee23dddbada46d5a143f
253 X-Mercurial-Node: 909a00e13e9d78b575aeee23dddbada46d5a143f
251 Message-Id: <909a00e13e9d78b575ae.240@*> (glob)
254 Message-Id: <909a00e13e9d78b575ae.240@*> (glob)
252 User-Agent: Mercurial-patchbomb/* (glob)
255 User-Agent: Mercurial-patchbomb/* (glob)
253 Date: Thu, 01 Jan 1970 00:04:00 +0000
256 Date: Thu, 01 Jan 1970 00:04:00 +0000
254 From: quux
257 From: quux
255 To: foo
258 To: foo
256 Cc: bar
259 Cc: bar
257
260
258 # HG changeset patch
261 # HG changeset patch
259 # User test
262 # User test
260 # Date 4 0
263 # Date 4 0
264 # Thu Jan 01 00:00:04 1970 +0000
261 # Node ID 909a00e13e9d78b575aeee23dddbada46d5a143f
265 # Node ID 909a00e13e9d78b575aeee23dddbada46d5a143f
262 # Parent ff2c9fa2018b15fa74b33363bda9527323e2a99f
266 # Parent ff2c9fa2018b15fa74b33363bda9527323e2a99f
263 utf-8 content
267 utf-8 content
264
268
265 diff -r ff2c9fa2018b -r 909a00e13e9d description
269 diff -r ff2c9fa2018b -r 909a00e13e9d description
266 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
270 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
267 +++ b/description Thu Jan 01 00:00:04 1970 +0000
271 +++ b/description Thu Jan 01 00:00:04 1970 +0000
268 @@ -0,0 +1,3 @@
272 @@ -0,0 +1,3 @@
269 +a multiline
273 +a multiline
270 +
274 +
271 +description
275 +description
272 diff -r ff2c9fa2018b -r 909a00e13e9d utf
276 diff -r ff2c9fa2018b -r 909a00e13e9d utf
273 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
277 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
274 +++ b/utf Thu Jan 01 00:00:04 1970 +0000
278 +++ b/utf Thu Jan 01 00:00:04 1970 +0000
275 @@ -0,0 +1,1 @@
279 @@ -0,0 +1,1 @@
276 +h\xc3\xb6mma! (esc)
280 +h\xc3\xb6mma! (esc)
277
281
278
282
279 mime encoded mbox (base64):
283 mime encoded mbox (base64):
280 $ hg email --date '1970-1-1 0:4' -f 'Q <quux>' -t foo -c bar -r tip -m mbox
284 $ hg email --date '1970-1-1 0:4' -f 'Q <quux>' -t foo -c bar -r tip -m mbox
281 this patch series consists of 1 patches.
285 this patch series consists of 1 patches.
282
286
283
287
284 sending [PATCH] utf-8 content ...
288 sending [PATCH] utf-8 content ...
285
289
286 $ cat mbox
290 $ cat mbox
287 From quux ... ... .. ..:..:.. .... (re)
291 From quux ... ... .. ..:..:.. .... (re)
288 Content-Type: text/plain; charset="utf-8"
292 Content-Type: text/plain; charset="utf-8"
289 MIME-Version: 1.0
293 MIME-Version: 1.0
290 Content-Transfer-Encoding: base64
294 Content-Transfer-Encoding: base64
291 Subject: [PATCH] utf-8 content
295 Subject: [PATCH] utf-8 content
292 X-Mercurial-Node: 909a00e13e9d78b575aeee23dddbada46d5a143f
296 X-Mercurial-Node: 909a00e13e9d78b575aeee23dddbada46d5a143f
293 Message-Id: <909a00e13e9d78b575ae.240@*> (glob)
297 Message-Id: <909a00e13e9d78b575ae.240@*> (glob)
294 User-Agent: Mercurial-patchbomb/* (glob)
298 User-Agent: Mercurial-patchbomb/* (glob)
295 Date: Thu, 01 Jan 1970 00:04:00 +0000
299 Date: Thu, 01 Jan 1970 00:04:00 +0000
296 From: Q <quux>
300 From: Q <quux>
297 To: foo
301 To: foo
298 Cc: bar
302 Cc: bar
299
303
300 IyBIRyBjaGFuZ2VzZXQgcGF0Y2gKIyBVc2VyIHRlc3QKIyBEYXRlIDQgMAojIE5vZGUgSUQgOTA5
304 IyBIRyBjaGFuZ2VzZXQgcGF0Y2gKIyBVc2VyIHRlc3QKIyBEYXRlIDQgMAojICAgICAgVGh1IEph
301 YTAwZTEzZTlkNzhiNTc1YWVlZTIzZGRkYmFkYTQ2ZDVhMTQzZgojIFBhcmVudCAgZmYyYzlmYTIw
305 biAwMSAwMDowMDowNCAxOTcwICswMDAwCiMgTm9kZSBJRCA5MDlhMDBlMTNlOWQ3OGI1NzVhZWVl
302 MThiMTVmYTc0YjMzMzYzYmRhOTUyNzMyM2UyYTk5Zgp1dGYtOCBjb250ZW50CgpkaWZmIC1yIGZm
306 MjNkZGRiYWRhNDZkNWExNDNmCiMgUGFyZW50ICBmZjJjOWZhMjAxOGIxNWZhNzRiMzMzNjNiZGE5
303 MmM5ZmEyMDE4YiAtciA5MDlhMDBlMTNlOWQgZGVzY3JpcHRpb24KLS0tIC9kZXYvbnVsbAlUaHUg
307 NTI3MzIzZTJhOTlmCnV0Zi04IGNvbnRlbnQKCmRpZmYgLXIgZmYyYzlmYTIwMThiIC1yIDkwOWEw
304 SmFuIDAxIDAwOjAwOjAwIDE5NzAgKzAwMDAKKysrIGIvZGVzY3JpcHRpb24JVGh1IEphbiAwMSAw
308 MGUxM2U5ZCBkZXNjcmlwdGlvbgotLS0gL2Rldi9udWxsCVRodSBKYW4gMDEgMDA6MDA6MDAgMTk3
305 MDowMDowNCAxOTcwICswMDAwCkBAIC0wLDAgKzEsMyBAQAorYSBtdWx0aWxpbmUKKworZGVzY3Jp
309 MCArMDAwMAorKysgYi9kZXNjcmlwdGlvbglUaHUgSmFuIDAxIDAwOjAwOjA0IDE5NzAgKzAwMDAK
306 cHRpb24KZGlmZiAtciBmZjJjOWZhMjAxOGIgLXIgOTA5YTAwZTEzZTlkIHV0ZgotLS0gL2Rldi9u
310 QEAgLTAsMCArMSwzIEBACithIG11bHRpbGluZQorCitkZXNjcmlwdGlvbgpkaWZmIC1yIGZmMmM5
307 dWxsCVRodSBKYW4gMDEgMDA6MDA6MDAgMTk3MCArMDAwMAorKysgYi91dGYJVGh1IEphbiAwMSAw
311 ZmEyMDE4YiAtciA5MDlhMDBlMTNlOWQgdXRmCi0tLSAvZGV2L251bGwJVGh1IEphbiAwMSAwMDow
308 MDowMDowNCAxOTcwICswMDAwCkBAIC0wLDAgKzEsMSBAQAoraMO2bW1hIQo=
312 MDowMCAxOTcwICswMDAwCisrKyBiL3V0ZglUaHUgSmFuIDAxIDAwOjAwOjA0IDE5NzAgKzAwMDAK
313 QEAgLTAsMCArMSwxIEBACitow7ZtbWEhCg==
309
314
310
315
311 $ python -c 'print open("mbox").read().split("\n\n")[1].decode("base64")'
316 $ python -c 'print open("mbox").read().split("\n\n")[1].decode("base64")'
312 # HG changeset patch
317 # HG changeset patch
313 # User test
318 # User test
314 # Date 4 0
319 # Date 4 0
320 # Thu Jan 01 00:00:04 1970 +0000
315 # Node ID 909a00e13e9d78b575aeee23dddbada46d5a143f
321 # Node ID 909a00e13e9d78b575aeee23dddbada46d5a143f
316 # Parent ff2c9fa2018b15fa74b33363bda9527323e2a99f
322 # Parent ff2c9fa2018b15fa74b33363bda9527323e2a99f
317 utf-8 content
323 utf-8 content
318
324
319 diff -r ff2c9fa2018b -r 909a00e13e9d description
325 diff -r ff2c9fa2018b -r 909a00e13e9d description
320 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
326 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
321 +++ b/description Thu Jan 01 00:00:04 1970 +0000
327 +++ b/description Thu Jan 01 00:00:04 1970 +0000
322 @@ -0,0 +1,3 @@
328 @@ -0,0 +1,3 @@
323 +a multiline
329 +a multiline
324 +
330 +
325 +description
331 +description
326 diff -r ff2c9fa2018b -r 909a00e13e9d utf
332 diff -r ff2c9fa2018b -r 909a00e13e9d utf
327 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
333 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
328 +++ b/utf Thu Jan 01 00:00:04 1970 +0000
334 +++ b/utf Thu Jan 01 00:00:04 1970 +0000
329 @@ -0,0 +1,1 @@
335 @@ -0,0 +1,1 @@
330 +h\xc3\xb6mma! (esc)
336 +h\xc3\xb6mma! (esc)
331
337
332 $ rm mbox
338 $ rm mbox
333
339
334 mime encoded mbox (quoted-printable):
340 mime encoded mbox (quoted-printable):
335 $ python -c 'fp = open("long", "wb"); fp.write("%s\nfoo\n\nbar\n" % ("x" * 1024)); fp.close();'
341 $ python -c 'fp = open("long", "wb"); fp.write("%s\nfoo\n\nbar\n" % ("x" * 1024)); fp.close();'
336 $ hg commit -A -d '4 0' -m 'long line'
342 $ hg commit -A -d '4 0' -m 'long line'
337 adding long
343 adding long
338
344
339 no mime encoding for email --test:
345 no mime encoding for email --test:
340 $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n
346 $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n
341 this patch series consists of 1 patches.
347 this patch series consists of 1 patches.
342
348
343
349
344 displaying [PATCH] long line ...
350 displaying [PATCH] long line ...
345 Content-Type: text/plain; charset="us-ascii"
351 Content-Type: text/plain; charset="us-ascii"
346 MIME-Version: 1.0
352 MIME-Version: 1.0
347 Content-Transfer-Encoding: quoted-printable
353 Content-Transfer-Encoding: quoted-printable
348 Subject: [PATCH] long line
354 Subject: [PATCH] long line
349 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
355 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
350 Message-Id: <a2ea8fc83dd8b93cfd86.240@*> (glob)
356 Message-Id: <a2ea8fc83dd8b93cfd86.240@*> (glob)
351 User-Agent: Mercurial-patchbomb/* (glob)
357 User-Agent: Mercurial-patchbomb/* (glob)
352 Date: Thu, 01 Jan 1970 00:04:00 +0000
358 Date: Thu, 01 Jan 1970 00:04:00 +0000
353 From: quux
359 From: quux
354 To: foo
360 To: foo
355 Cc: bar
361 Cc: bar
356
362
357 # HG changeset patch
363 # HG changeset patch
358 # User test
364 # User test
359 # Date 4 0
365 # Date 4 0
366 # Thu Jan 01 00:00:04 1970 +0000
360 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
367 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
361 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
368 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
362 long line
369 long line
363
370
364 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
371 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
365 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
372 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
366 +++ b/long Thu Jan 01 00:00:04 1970 +0000
373 +++ b/long Thu Jan 01 00:00:04 1970 +0000
367 @@ -0,0 +1,4 @@
374 @@ -0,0 +1,4 @@
368 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
375 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
369 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
376 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
370 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
377 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
371 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
378 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
372 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
379 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
373 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
380 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
374 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
381 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
375 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
382 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
376 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
383 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
377 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
384 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
378 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
385 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
379 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
386 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
380 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
387 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
381 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
388 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
382 +foo
389 +foo
383 +
390 +
384 +bar
391 +bar
385
392
386
393
387 mime encoded mbox (quoted-printable):
394 mime encoded mbox (quoted-printable):
388 $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -m mbox
395 $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -m mbox
389 this patch series consists of 1 patches.
396 this patch series consists of 1 patches.
390
397
391
398
392 sending [PATCH] long line ...
399 sending [PATCH] long line ...
393 $ cat mbox
400 $ cat mbox
394 From quux ... ... .. ..:..:.. .... (re)
401 From quux ... ... .. ..:..:.. .... (re)
395 Content-Type: text/plain; charset="us-ascii"
402 Content-Type: text/plain; charset="us-ascii"
396 MIME-Version: 1.0
403 MIME-Version: 1.0
397 Content-Transfer-Encoding: quoted-printable
404 Content-Transfer-Encoding: quoted-printable
398 Subject: [PATCH] long line
405 Subject: [PATCH] long line
399 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
406 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
400 Message-Id: <a2ea8fc83dd8b93cfd86.240@*> (glob)
407 Message-Id: <a2ea8fc83dd8b93cfd86.240@*> (glob)
401 User-Agent: Mercurial-patchbomb/* (glob)
408 User-Agent: Mercurial-patchbomb/* (glob)
402 Date: Thu, 01 Jan 1970 00:04:00 +0000
409 Date: Thu, 01 Jan 1970 00:04:00 +0000
403 From: quux
410 From: quux
404 To: foo
411 To: foo
405 Cc: bar
412 Cc: bar
406
413
407 # HG changeset patch
414 # HG changeset patch
408 # User test
415 # User test
409 # Date 4 0
416 # Date 4 0
417 # Thu Jan 01 00:00:04 1970 +0000
410 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
418 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
411 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
419 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
412 long line
420 long line
413
421
414 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
422 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
415 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
423 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
416 +++ b/long Thu Jan 01 00:00:04 1970 +0000
424 +++ b/long Thu Jan 01 00:00:04 1970 +0000
417 @@ -0,0 +1,4 @@
425 @@ -0,0 +1,4 @@
418 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
426 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
419 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
427 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
420 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
428 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
421 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
429 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
422 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
430 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
423 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
431 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
424 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
432 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
425 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
433 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
426 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
434 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
427 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
435 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
428 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
436 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
429 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
437 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
430 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
438 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
431 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
439 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
432 +foo
440 +foo
433 +
441 +
434 +bar
442 +bar
435
443
436
444
437
445
438 $ rm mbox
446 $ rm mbox
439
447
440 iso-8859-1 patch:
448 iso-8859-1 patch:
441 $ python -c 'fp = open("isolatin", "wb"); fp.write("h\xF6mma!\n"); fp.close();'
449 $ python -c 'fp = open("isolatin", "wb"); fp.write("h\xF6mma!\n"); fp.close();'
442 $ hg commit -A -d '5 0' -m 'isolatin 8-bit encoding'
450 $ hg commit -A -d '5 0' -m 'isolatin 8-bit encoding'
443 adding isolatin
451 adding isolatin
444
452
445 fake ascii mbox:
453 fake ascii mbox:
446 $ hg email --date '1970-1-1 0:5' -f quux -t foo -c bar -r tip -m mbox
454 $ hg email --date '1970-1-1 0:5' -f quux -t foo -c bar -r tip -m mbox
447 this patch series consists of 1 patches.
455 this patch series consists of 1 patches.
448
456
449
457
450 sending [PATCH] isolatin 8-bit encoding ...
458 sending [PATCH] isolatin 8-bit encoding ...
451 $ cat mbox
459 $ cat mbox
452 From quux ... ... .. ..:..:.. .... (re)
460 From quux ... ... .. ..:..:.. .... (re)
453 Content-Type: text/plain; charset="us-ascii"
461 Content-Type: text/plain; charset="us-ascii"
454 MIME-Version: 1.0
462 MIME-Version: 1.0
455 Content-Transfer-Encoding: 8bit
463 Content-Transfer-Encoding: 8bit
456 Subject: [PATCH] isolatin 8-bit encoding
464 Subject: [PATCH] isolatin 8-bit encoding
457 X-Mercurial-Node: 240fb913fc1b7ff15ddb9f33e73d82bf5277c720
465 X-Mercurial-Node: 240fb913fc1b7ff15ddb9f33e73d82bf5277c720
458 Message-Id: <240fb913fc1b7ff15ddb.300@*> (glob)
466 Message-Id: <240fb913fc1b7ff15ddb.300@*> (glob)
459 User-Agent: Mercurial-patchbomb/* (glob)
467 User-Agent: Mercurial-patchbomb/* (glob)
460 Date: Thu, 01 Jan 1970 00:05:00 +0000
468 Date: Thu, 01 Jan 1970 00:05:00 +0000
461 From: quux
469 From: quux
462 To: foo
470 To: foo
463 Cc: bar
471 Cc: bar
464
472
465 # HG changeset patch
473 # HG changeset patch
466 # User test
474 # User test
467 # Date 5 0
475 # Date 5 0
476 # Thu Jan 01 00:00:05 1970 +0000
468 # Node ID 240fb913fc1b7ff15ddb9f33e73d82bf5277c720
477 # Node ID 240fb913fc1b7ff15ddb9f33e73d82bf5277c720
469 # Parent a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
478 # Parent a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
470 isolatin 8-bit encoding
479 isolatin 8-bit encoding
471
480
472 diff -r a2ea8fc83dd8 -r 240fb913fc1b isolatin
481 diff -r a2ea8fc83dd8 -r 240fb913fc1b isolatin
473 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
482 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
474 +++ b/isolatin Thu Jan 01 00:00:05 1970 +0000
483 +++ b/isolatin Thu Jan 01 00:00:05 1970 +0000
475 @@ -0,0 +1,1 @@
484 @@ -0,0 +1,1 @@
476 +h\xf6mma! (esc)
485 +h\xf6mma! (esc)
477
486
478
487
479
488
480 test diffstat for single patch:
489 test diffstat for single patch:
481 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y -r 2
490 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y -r 2
482 this patch series consists of 1 patches.
491 this patch series consists of 1 patches.
483
492
484
493
485 Final summary:
494 Final summary:
486
495
487 From: quux
496 From: quux
488 To: foo
497 To: foo
489 Cc: bar
498 Cc: bar
490 Subject: [PATCH] test
499 Subject: [PATCH] test
491 c | 1 +
500 c | 1 +
492 1 files changed, 1 insertions(+), 0 deletions(-)
501 1 files changed, 1 insertions(+), 0 deletions(-)
493
502
494 are you sure you want to send (yn)? y
503 are you sure you want to send (yn)? y
495
504
496 displaying [PATCH] test ...
505 displaying [PATCH] test ...
497 Content-Type: text/plain; charset="us-ascii"
506 Content-Type: text/plain; charset="us-ascii"
498 MIME-Version: 1.0
507 MIME-Version: 1.0
499 Content-Transfer-Encoding: 7bit
508 Content-Transfer-Encoding: 7bit
500 Subject: [PATCH] test
509 Subject: [PATCH] test
501 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
510 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
502 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
511 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
503 User-Agent: Mercurial-patchbomb/* (glob)
512 User-Agent: Mercurial-patchbomb/* (glob)
504 Date: Thu, 01 Jan 1970 00:01:00 +0000
513 Date: Thu, 01 Jan 1970 00:01:00 +0000
505 From: quux
514 From: quux
506 To: foo
515 To: foo
507 Cc: bar
516 Cc: bar
508
517
509 c | 1 +
518 c | 1 +
510 1 files changed, 1 insertions(+), 0 deletions(-)
519 1 files changed, 1 insertions(+), 0 deletions(-)
511
520
512
521
513 # HG changeset patch
522 # HG changeset patch
514 # User test
523 # User test
515 # Date 3 0
524 # Date 3 0
525 # Thu Jan 01 00:00:03 1970 +0000
516 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
526 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
517 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
527 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
518 c
528 c
519
529
520 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
530 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
521 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
531 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
522 +++ b/c Thu Jan 01 00:00:03 1970 +0000
532 +++ b/c Thu Jan 01 00:00:03 1970 +0000
523 @@ -0,0 +1,1 @@
533 @@ -0,0 +1,1 @@
524 +c
534 +c
525
535
526
536
527 test diffstat for multiple patches:
537 test diffstat for multiple patches:
528 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y \
538 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y \
529 > -r 0:1
539 > -r 0:1
530 this patch series consists of 2 patches.
540 this patch series consists of 2 patches.
531
541
532
542
533 Write the introductory message for the patch series.
543 Write the introductory message for the patch series.
534
544
535
545
536 Final summary:
546 Final summary:
537
547
538 From: quux
548 From: quux
539 To: foo
549 To: foo
540 Cc: bar
550 Cc: bar
541 Subject: [PATCH 0 of 2] test
551 Subject: [PATCH 0 of 2] test
542 a | 1 +
552 a | 1 +
543 b | 1 +
553 b | 1 +
544 2 files changed, 2 insertions(+), 0 deletions(-)
554 2 files changed, 2 insertions(+), 0 deletions(-)
545 Subject: [PATCH 1 of 2] a
555 Subject: [PATCH 1 of 2] a
546 a | 1 +
556 a | 1 +
547 1 files changed, 1 insertions(+), 0 deletions(-)
557 1 files changed, 1 insertions(+), 0 deletions(-)
548 Subject: [PATCH 2 of 2] b
558 Subject: [PATCH 2 of 2] b
549 b | 1 +
559 b | 1 +
550 1 files changed, 1 insertions(+), 0 deletions(-)
560 1 files changed, 1 insertions(+), 0 deletions(-)
551
561
552 are you sure you want to send (yn)? y
562 are you sure you want to send (yn)? y
553
563
554 displaying [PATCH 0 of 2] test ...
564 displaying [PATCH 0 of 2] test ...
555 Content-Type: text/plain; charset="us-ascii"
565 Content-Type: text/plain; charset="us-ascii"
556 MIME-Version: 1.0
566 MIME-Version: 1.0
557 Content-Transfer-Encoding: 7bit
567 Content-Transfer-Encoding: 7bit
558 Subject: [PATCH 0 of 2] test
568 Subject: [PATCH 0 of 2] test
559 Message-Id: <patchbomb.60@*> (glob)
569 Message-Id: <patchbomb.60@*> (glob)
560 User-Agent: Mercurial-patchbomb/* (glob)
570 User-Agent: Mercurial-patchbomb/* (glob)
561 Date: Thu, 01 Jan 1970 00:01:00 +0000
571 Date: Thu, 01 Jan 1970 00:01:00 +0000
562 From: quux
572 From: quux
563 To: foo
573 To: foo
564 Cc: bar
574 Cc: bar
565
575
566
576
567 a | 1 +
577 a | 1 +
568 b | 1 +
578 b | 1 +
569 2 files changed, 2 insertions(+), 0 deletions(-)
579 2 files changed, 2 insertions(+), 0 deletions(-)
570
580
571 displaying [PATCH 1 of 2] a ...
581 displaying [PATCH 1 of 2] a ...
572 Content-Type: text/plain; charset="us-ascii"
582 Content-Type: text/plain; charset="us-ascii"
573 MIME-Version: 1.0
583 MIME-Version: 1.0
574 Content-Transfer-Encoding: 7bit
584 Content-Transfer-Encoding: 7bit
575 Subject: [PATCH 1 of 2] a
585 Subject: [PATCH 1 of 2] a
576 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
586 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
577 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
587 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
578 In-Reply-To: <patchbomb.60@*> (glob)
588 In-Reply-To: <patchbomb.60@*> (glob)
579 References: <patchbomb.60@*> (glob)
589 References: <patchbomb.60@*> (glob)
580 User-Agent: Mercurial-patchbomb/* (glob)
590 User-Agent: Mercurial-patchbomb/* (glob)
581 Date: Thu, 01 Jan 1970 00:01:01 +0000
591 Date: Thu, 01 Jan 1970 00:01:01 +0000
582 From: quux
592 From: quux
583 To: foo
593 To: foo
584 Cc: bar
594 Cc: bar
585
595
586 a | 1 +
596 a | 1 +
587 1 files changed, 1 insertions(+), 0 deletions(-)
597 1 files changed, 1 insertions(+), 0 deletions(-)
588
598
589
599
590 # HG changeset patch
600 # HG changeset patch
591 # User test
601 # User test
592 # Date 1 0
602 # Date 1 0
603 # Thu Jan 01 00:00:01 1970 +0000
593 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
604 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
594 # Parent 0000000000000000000000000000000000000000
605 # Parent 0000000000000000000000000000000000000000
595 a
606 a
596
607
597 diff -r 000000000000 -r 8580ff50825a a
608 diff -r 000000000000 -r 8580ff50825a a
598 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
609 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
599 +++ b/a Thu Jan 01 00:00:01 1970 +0000
610 +++ b/a Thu Jan 01 00:00:01 1970 +0000
600 @@ -0,0 +1,1 @@
611 @@ -0,0 +1,1 @@
601 +a
612 +a
602
613
603 displaying [PATCH 2 of 2] b ...
614 displaying [PATCH 2 of 2] b ...
604 Content-Type: text/plain; charset="us-ascii"
615 Content-Type: text/plain; charset="us-ascii"
605 MIME-Version: 1.0
616 MIME-Version: 1.0
606 Content-Transfer-Encoding: 7bit
617 Content-Transfer-Encoding: 7bit
607 Subject: [PATCH 2 of 2] b
618 Subject: [PATCH 2 of 2] b
608 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
619 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
609 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
620 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
610 In-Reply-To: <patchbomb.60@*> (glob)
621 In-Reply-To: <patchbomb.60@*> (glob)
611 References: <patchbomb.60@*> (glob)
622 References: <patchbomb.60@*> (glob)
612 User-Agent: Mercurial-patchbomb/* (glob)
623 User-Agent: Mercurial-patchbomb/* (glob)
613 Date: Thu, 01 Jan 1970 00:01:02 +0000
624 Date: Thu, 01 Jan 1970 00:01:02 +0000
614 From: quux
625 From: quux
615 To: foo
626 To: foo
616 Cc: bar
627 Cc: bar
617
628
618 b | 1 +
629 b | 1 +
619 1 files changed, 1 insertions(+), 0 deletions(-)
630 1 files changed, 1 insertions(+), 0 deletions(-)
620
631
621
632
622 # HG changeset patch
633 # HG changeset patch
623 # User test
634 # User test
624 # Date 2 0
635 # Date 2 0
636 # Thu Jan 01 00:00:02 1970 +0000
625 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
637 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
626 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
638 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
627 b
639 b
628
640
629 diff -r 8580ff50825a -r 97d72e5f12c7 b
641 diff -r 8580ff50825a -r 97d72e5f12c7 b
630 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
642 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
631 +++ b/b Thu Jan 01 00:00:02 1970 +0000
643 +++ b/b Thu Jan 01 00:00:02 1970 +0000
632 @@ -0,0 +1,1 @@
644 @@ -0,0 +1,1 @@
633 +b
645 +b
634
646
635
647
636 test inline for single patch:
648 test inline for single patch:
637 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2
649 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2
638 this patch series consists of 1 patches.
650 this patch series consists of 1 patches.
639
651
640
652
641 displaying [PATCH] test ...
653 displaying [PATCH] test ...
642 Content-Type: multipart/mixed; boundary="===*" (glob)
654 Content-Type: multipart/mixed; boundary="===*" (glob)
643 MIME-Version: 1.0
655 MIME-Version: 1.0
644 Subject: [PATCH] test
656 Subject: [PATCH] test
645 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
657 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
646 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
658 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
647 User-Agent: Mercurial-patchbomb/* (glob)
659 User-Agent: Mercurial-patchbomb/* (glob)
648 Date: Thu, 01 Jan 1970 00:01:00 +0000
660 Date: Thu, 01 Jan 1970 00:01:00 +0000
649 From: quux
661 From: quux
650 To: foo
662 To: foo
651 Cc: bar
663 Cc: bar
652
664
653 --===* (glob)
665 --===* (glob)
654 Content-Type: text/x-patch; charset="us-ascii"
666 Content-Type: text/x-patch; charset="us-ascii"
655 MIME-Version: 1.0
667 MIME-Version: 1.0
656 Content-Transfer-Encoding: 7bit
668 Content-Transfer-Encoding: 7bit
657 Content-Disposition: inline; filename=t2.patch
669 Content-Disposition: inline; filename=t2.patch
658
670
659 # HG changeset patch
671 # HG changeset patch
660 # User test
672 # User test
661 # Date 3 0
673 # Date 3 0
674 # Thu Jan 01 00:00:03 1970 +0000
662 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
675 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
663 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
676 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
664 c
677 c
665
678
666 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
679 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
667 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
680 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
668 +++ b/c Thu Jan 01 00:00:03 1970 +0000
681 +++ b/c Thu Jan 01 00:00:03 1970 +0000
669 @@ -0,0 +1,1 @@
682 @@ -0,0 +1,1 @@
670 +c
683 +c
671
684
672 --===*-- (glob)
685 --===*-- (glob)
673
686
674
687
675 test inline for single patch (quoted-printable):
688 test inline for single patch (quoted-printable):
676 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 4
689 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 4
677 this patch series consists of 1 patches.
690 this patch series consists of 1 patches.
678
691
679
692
680 displaying [PATCH] test ...
693 displaying [PATCH] test ...
681 Content-Type: multipart/mixed; boundary="===*" (glob)
694 Content-Type: multipart/mixed; boundary="===*" (glob)
682 MIME-Version: 1.0
695 MIME-Version: 1.0
683 Subject: [PATCH] test
696 Subject: [PATCH] test
684 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
697 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
685 Message-Id: <a2ea8fc83dd8b93cfd86.60@*> (glob)
698 Message-Id: <a2ea8fc83dd8b93cfd86.60@*> (glob)
686 User-Agent: Mercurial-patchbomb/* (glob)
699 User-Agent: Mercurial-patchbomb/* (glob)
687 Date: Thu, 01 Jan 1970 00:01:00 +0000
700 Date: Thu, 01 Jan 1970 00:01:00 +0000
688 From: quux
701 From: quux
689 To: foo
702 To: foo
690 Cc: bar
703 Cc: bar
691
704
692 --===* (glob)
705 --===* (glob)
693 Content-Type: text/x-patch; charset="us-ascii"
706 Content-Type: text/x-patch; charset="us-ascii"
694 MIME-Version: 1.0
707 MIME-Version: 1.0
695 Content-Transfer-Encoding: quoted-printable
708 Content-Transfer-Encoding: quoted-printable
696 Content-Disposition: inline; filename=t2.patch
709 Content-Disposition: inline; filename=t2.patch
697
710
698 # HG changeset patch
711 # HG changeset patch
699 # User test
712 # User test
700 # Date 4 0
713 # Date 4 0
714 # Thu Jan 01 00:00:04 1970 +0000
701 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
715 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
702 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
716 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
703 long line
717 long line
704
718
705 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
719 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
706 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
720 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
707 +++ b/long Thu Jan 01 00:00:04 1970 +0000
721 +++ b/long Thu Jan 01 00:00:04 1970 +0000
708 @@ -0,0 +1,4 @@
722 @@ -0,0 +1,4 @@
709 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
723 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
710 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
724 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
711 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
725 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
712 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
726 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
713 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
727 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
714 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
728 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
715 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
729 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
716 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
730 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
717 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
731 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
718 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
732 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
719 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
733 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
720 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
734 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
721 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
735 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
722 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
736 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
723 +foo
737 +foo
724 +
738 +
725 +bar
739 +bar
726
740
727 --===*-- (glob)
741 --===*-- (glob)
728
742
729 test inline for multiple patches:
743 test inline for multiple patches:
730 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i \
744 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i \
731 > -r 0:1 -r 4
745 > -r 0:1 -r 4
732 this patch series consists of 3 patches.
746 this patch series consists of 3 patches.
733
747
734
748
735 Write the introductory message for the patch series.
749 Write the introductory message for the patch series.
736
750
737
751
738 displaying [PATCH 0 of 3] test ...
752 displaying [PATCH 0 of 3] test ...
739 Content-Type: text/plain; charset="us-ascii"
753 Content-Type: text/plain; charset="us-ascii"
740 MIME-Version: 1.0
754 MIME-Version: 1.0
741 Content-Transfer-Encoding: 7bit
755 Content-Transfer-Encoding: 7bit
742 Subject: [PATCH 0 of 3] test
756 Subject: [PATCH 0 of 3] test
743 Message-Id: <patchbomb.60@*> (glob)
757 Message-Id: <patchbomb.60@*> (glob)
744 User-Agent: Mercurial-patchbomb/* (glob)
758 User-Agent: Mercurial-patchbomb/* (glob)
745 Date: Thu, 01 Jan 1970 00:01:00 +0000
759 Date: Thu, 01 Jan 1970 00:01:00 +0000
746 From: quux
760 From: quux
747 To: foo
761 To: foo
748 Cc: bar
762 Cc: bar
749
763
750
764
751 displaying [PATCH 1 of 3] a ...
765 displaying [PATCH 1 of 3] a ...
752 Content-Type: multipart/mixed; boundary="===*" (glob)
766 Content-Type: multipart/mixed; boundary="===*" (glob)
753 MIME-Version: 1.0
767 MIME-Version: 1.0
754 Subject: [PATCH 1 of 3] a
768 Subject: [PATCH 1 of 3] a
755 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
769 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
756 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
770 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
757 In-Reply-To: <patchbomb.60@*> (glob)
771 In-Reply-To: <patchbomb.60@*> (glob)
758 References: <patchbomb.60@*> (glob)
772 References: <patchbomb.60@*> (glob)
759 User-Agent: Mercurial-patchbomb/* (glob)
773 User-Agent: Mercurial-patchbomb/* (glob)
760 Date: Thu, 01 Jan 1970 00:01:01 +0000
774 Date: Thu, 01 Jan 1970 00:01:01 +0000
761 From: quux
775 From: quux
762 To: foo
776 To: foo
763 Cc: bar
777 Cc: bar
764
778
765 --===* (glob)
779 --===* (glob)
766 Content-Type: text/x-patch; charset="us-ascii"
780 Content-Type: text/x-patch; charset="us-ascii"
767 MIME-Version: 1.0
781 MIME-Version: 1.0
768 Content-Transfer-Encoding: 7bit
782 Content-Transfer-Encoding: 7bit
769 Content-Disposition: inline; filename=t2-1.patch
783 Content-Disposition: inline; filename=t2-1.patch
770
784
771 # HG changeset patch
785 # HG changeset patch
772 # User test
786 # User test
773 # Date 1 0
787 # Date 1 0
788 # Thu Jan 01 00:00:01 1970 +0000
774 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
789 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
775 # Parent 0000000000000000000000000000000000000000
790 # Parent 0000000000000000000000000000000000000000
776 a
791 a
777
792
778 diff -r 000000000000 -r 8580ff50825a a
793 diff -r 000000000000 -r 8580ff50825a a
779 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
794 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
780 +++ b/a Thu Jan 01 00:00:01 1970 +0000
795 +++ b/a Thu Jan 01 00:00:01 1970 +0000
781 @@ -0,0 +1,1 @@
796 @@ -0,0 +1,1 @@
782 +a
797 +a
783
798
784 --===*-- (glob)
799 --===*-- (glob)
785 displaying [PATCH 2 of 3] b ...
800 displaying [PATCH 2 of 3] b ...
786 Content-Type: multipart/mixed; boundary="===*" (glob)
801 Content-Type: multipart/mixed; boundary="===*" (glob)
787 MIME-Version: 1.0
802 MIME-Version: 1.0
788 Subject: [PATCH 2 of 3] b
803 Subject: [PATCH 2 of 3] b
789 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
804 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
790 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
805 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
791 In-Reply-To: <patchbomb.60@*> (glob)
806 In-Reply-To: <patchbomb.60@*> (glob)
792 References: <patchbomb.60@*> (glob)
807 References: <patchbomb.60@*> (glob)
793 User-Agent: Mercurial-patchbomb/* (glob)
808 User-Agent: Mercurial-patchbomb/* (glob)
794 Date: Thu, 01 Jan 1970 00:01:02 +0000
809 Date: Thu, 01 Jan 1970 00:01:02 +0000
795 From: quux
810 From: quux
796 To: foo
811 To: foo
797 Cc: bar
812 Cc: bar
798
813
799 --===* (glob)
814 --===* (glob)
800 Content-Type: text/x-patch; charset="us-ascii"
815 Content-Type: text/x-patch; charset="us-ascii"
801 MIME-Version: 1.0
816 MIME-Version: 1.0
802 Content-Transfer-Encoding: 7bit
817 Content-Transfer-Encoding: 7bit
803 Content-Disposition: inline; filename=t2-2.patch
818 Content-Disposition: inline; filename=t2-2.patch
804
819
805 # HG changeset patch
820 # HG changeset patch
806 # User test
821 # User test
807 # Date 2 0
822 # Date 2 0
823 # Thu Jan 01 00:00:02 1970 +0000
808 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
824 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
809 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
825 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
810 b
826 b
811
827
812 diff -r 8580ff50825a -r 97d72e5f12c7 b
828 diff -r 8580ff50825a -r 97d72e5f12c7 b
813 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
829 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
814 +++ b/b Thu Jan 01 00:00:02 1970 +0000
830 +++ b/b Thu Jan 01 00:00:02 1970 +0000
815 @@ -0,0 +1,1 @@
831 @@ -0,0 +1,1 @@
816 +b
832 +b
817
833
818 --===*-- (glob)
834 --===*-- (glob)
819 displaying [PATCH 3 of 3] long line ...
835 displaying [PATCH 3 of 3] long line ...
820 Content-Type: multipart/mixed; boundary="===*" (glob)
836 Content-Type: multipart/mixed; boundary="===*" (glob)
821 MIME-Version: 1.0
837 MIME-Version: 1.0
822 Subject: [PATCH 3 of 3] long line
838 Subject: [PATCH 3 of 3] long line
823 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
839 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
824 Message-Id: <a2ea8fc83dd8b93cfd86.63@*> (glob)
840 Message-Id: <a2ea8fc83dd8b93cfd86.63@*> (glob)
825 In-Reply-To: <patchbomb.60@*> (glob)
841 In-Reply-To: <patchbomb.60@*> (glob)
826 References: <patchbomb.60@*> (glob)
842 References: <patchbomb.60@*> (glob)
827 User-Agent: Mercurial-patchbomb/* (glob)
843 User-Agent: Mercurial-patchbomb/* (glob)
828 Date: Thu, 01 Jan 1970 00:01:03 +0000
844 Date: Thu, 01 Jan 1970 00:01:03 +0000
829 From: quux
845 From: quux
830 To: foo
846 To: foo
831 Cc: bar
847 Cc: bar
832
848
833 --===* (glob)
849 --===* (glob)
834 Content-Type: text/x-patch; charset="us-ascii"
850 Content-Type: text/x-patch; charset="us-ascii"
835 MIME-Version: 1.0
851 MIME-Version: 1.0
836 Content-Transfer-Encoding: quoted-printable
852 Content-Transfer-Encoding: quoted-printable
837 Content-Disposition: inline; filename=t2-3.patch
853 Content-Disposition: inline; filename=t2-3.patch
838
854
839 # HG changeset patch
855 # HG changeset patch
840 # User test
856 # User test
841 # Date 4 0
857 # Date 4 0
858 # Thu Jan 01 00:00:04 1970 +0000
842 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
859 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
843 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
860 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
844 long line
861 long line
845
862
846 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
863 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
847 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
864 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
848 +++ b/long Thu Jan 01 00:00:04 1970 +0000
865 +++ b/long Thu Jan 01 00:00:04 1970 +0000
849 @@ -0,0 +1,4 @@
866 @@ -0,0 +1,4 @@
850 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
867 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
851 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
868 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
852 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
869 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
853 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
870 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
854 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
871 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
855 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
872 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
856 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
873 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
857 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
874 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
858 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
875 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
859 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
876 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
860 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
877 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
861 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
878 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
862 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
879 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
863 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
880 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
864 +foo
881 +foo
865 +
882 +
866 +bar
883 +bar
867
884
868 --===*-- (glob)
885 --===*-- (glob)
869
886
870 test attach for single patch:
887 test attach for single patch:
871 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 2
888 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 2
872 this patch series consists of 1 patches.
889 this patch series consists of 1 patches.
873
890
874
891
875 displaying [PATCH] test ...
892 displaying [PATCH] test ...
876 Content-Type: multipart/mixed; boundary="===*" (glob)
893 Content-Type: multipart/mixed; boundary="===*" (glob)
877 MIME-Version: 1.0
894 MIME-Version: 1.0
878 Subject: [PATCH] test
895 Subject: [PATCH] test
879 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
896 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
880 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
897 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
881 User-Agent: Mercurial-patchbomb/* (glob)
898 User-Agent: Mercurial-patchbomb/* (glob)
882 Date: Thu, 01 Jan 1970 00:01:00 +0000
899 Date: Thu, 01 Jan 1970 00:01:00 +0000
883 From: quux
900 From: quux
884 To: foo
901 To: foo
885 Cc: bar
902 Cc: bar
886
903
887 --===* (glob)
904 --===* (glob)
888 Content-Type: text/plain; charset="us-ascii"
905 Content-Type: text/plain; charset="us-ascii"
889 MIME-Version: 1.0
906 MIME-Version: 1.0
890 Content-Transfer-Encoding: 7bit
907 Content-Transfer-Encoding: 7bit
891
908
892 Patch subject is complete summary.
909 Patch subject is complete summary.
893
910
894
911
895
912
896 --===* (glob)
913 --===* (glob)
897 Content-Type: text/x-patch; charset="us-ascii"
914 Content-Type: text/x-patch; charset="us-ascii"
898 MIME-Version: 1.0
915 MIME-Version: 1.0
899 Content-Transfer-Encoding: 7bit
916 Content-Transfer-Encoding: 7bit
900 Content-Disposition: attachment; filename=t2.patch
917 Content-Disposition: attachment; filename=t2.patch
901
918
902 # HG changeset patch
919 # HG changeset patch
903 # User test
920 # User test
904 # Date 3 0
921 # Date 3 0
922 # Thu Jan 01 00:00:03 1970 +0000
905 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
923 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
906 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
924 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
907 c
925 c
908
926
909 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
927 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
910 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
928 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
911 +++ b/c Thu Jan 01 00:00:03 1970 +0000
929 +++ b/c Thu Jan 01 00:00:03 1970 +0000
912 @@ -0,0 +1,1 @@
930 @@ -0,0 +1,1 @@
913 +c
931 +c
914
932
915 --===*-- (glob)
933 --===*-- (glob)
916
934
917 test attach for single patch (quoted-printable):
935 test attach for single patch (quoted-printable):
918 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 4
936 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 4
919 this patch series consists of 1 patches.
937 this patch series consists of 1 patches.
920
938
921
939
922 displaying [PATCH] test ...
940 displaying [PATCH] test ...
923 Content-Type: multipart/mixed; boundary="===*" (glob)
941 Content-Type: multipart/mixed; boundary="===*" (glob)
924 MIME-Version: 1.0
942 MIME-Version: 1.0
925 Subject: [PATCH] test
943 Subject: [PATCH] test
926 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
944 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
927 Message-Id: <a2ea8fc83dd8b93cfd86.60@*> (glob)
945 Message-Id: <a2ea8fc83dd8b93cfd86.60@*> (glob)
928 User-Agent: Mercurial-patchbomb/* (glob)
946 User-Agent: Mercurial-patchbomb/* (glob)
929 Date: Thu, 01 Jan 1970 00:01:00 +0000
947 Date: Thu, 01 Jan 1970 00:01:00 +0000
930 From: quux
948 From: quux
931 To: foo
949 To: foo
932 Cc: bar
950 Cc: bar
933
951
934 --===* (glob)
952 --===* (glob)
935 Content-Type: text/plain; charset="us-ascii"
953 Content-Type: text/plain; charset="us-ascii"
936 MIME-Version: 1.0
954 MIME-Version: 1.0
937 Content-Transfer-Encoding: 7bit
955 Content-Transfer-Encoding: 7bit
938
956
939 Patch subject is complete summary.
957 Patch subject is complete summary.
940
958
941
959
942
960
943 --===* (glob)
961 --===* (glob)
944 Content-Type: text/x-patch; charset="us-ascii"
962 Content-Type: text/x-patch; charset="us-ascii"
945 MIME-Version: 1.0
963 MIME-Version: 1.0
946 Content-Transfer-Encoding: quoted-printable
964 Content-Transfer-Encoding: quoted-printable
947 Content-Disposition: attachment; filename=t2.patch
965 Content-Disposition: attachment; filename=t2.patch
948
966
949 # HG changeset patch
967 # HG changeset patch
950 # User test
968 # User test
951 # Date 4 0
969 # Date 4 0
970 # Thu Jan 01 00:00:04 1970 +0000
952 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
971 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
953 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
972 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
954 long line
973 long line
955
974
956 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
975 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
957 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
976 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
958 +++ b/long Thu Jan 01 00:00:04 1970 +0000
977 +++ b/long Thu Jan 01 00:00:04 1970 +0000
959 @@ -0,0 +1,4 @@
978 @@ -0,0 +1,4 @@
960 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
979 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
961 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
980 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
962 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
981 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
963 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
982 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
964 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
983 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
965 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
984 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
966 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
985 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
967 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
986 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
968 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
987 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
969 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
988 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
970 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
989 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
971 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
990 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
972 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
991 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
973 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
992 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
974 +foo
993 +foo
975 +
994 +
976 +bar
995 +bar
977
996
978 --===*-- (glob)
997 --===*-- (glob)
979
998
980 test attach and body for single patch:
999 test attach and body for single patch:
981 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a --body -r 2
1000 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a --body -r 2
982 this patch series consists of 1 patches.
1001 this patch series consists of 1 patches.
983
1002
984
1003
985 displaying [PATCH] test ...
1004 displaying [PATCH] test ...
986 Content-Type: multipart/mixed; boundary="===*" (glob)
1005 Content-Type: multipart/mixed; boundary="===*" (glob)
987 MIME-Version: 1.0
1006 MIME-Version: 1.0
988 Subject: [PATCH] test
1007 Subject: [PATCH] test
989 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1008 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
990 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1009 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
991 User-Agent: Mercurial-patchbomb/* (glob)
1010 User-Agent: Mercurial-patchbomb/* (glob)
992 Date: Thu, 01 Jan 1970 00:01:00 +0000
1011 Date: Thu, 01 Jan 1970 00:01:00 +0000
993 From: quux
1012 From: quux
994 To: foo
1013 To: foo
995 Cc: bar
1014 Cc: bar
996
1015
997 --===* (glob)
1016 --===* (glob)
998 Content-Type: text/plain; charset="us-ascii"
1017 Content-Type: text/plain; charset="us-ascii"
999 MIME-Version: 1.0
1018 MIME-Version: 1.0
1000 Content-Transfer-Encoding: 7bit
1019 Content-Transfer-Encoding: 7bit
1001
1020
1002 # HG changeset patch
1021 # HG changeset patch
1003 # User test
1022 # User test
1004 # Date 3 0
1023 # Date 3 0
1024 # Thu Jan 01 00:00:03 1970 +0000
1005 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1025 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1006 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1026 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1007 c
1027 c
1008
1028
1009 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1029 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1010 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1030 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1011 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1031 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1012 @@ -0,0 +1,1 @@
1032 @@ -0,0 +1,1 @@
1013 +c
1033 +c
1014
1034
1015 --===* (glob)
1035 --===* (glob)
1016 Content-Type: text/x-patch; charset="us-ascii"
1036 Content-Type: text/x-patch; charset="us-ascii"
1017 MIME-Version: 1.0
1037 MIME-Version: 1.0
1018 Content-Transfer-Encoding: 7bit
1038 Content-Transfer-Encoding: 7bit
1019 Content-Disposition: attachment; filename=t2.patch
1039 Content-Disposition: attachment; filename=t2.patch
1020
1040
1021 # HG changeset patch
1041 # HG changeset patch
1022 # User test
1042 # User test
1023 # Date 3 0
1043 # Date 3 0
1044 # Thu Jan 01 00:00:03 1970 +0000
1024 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1045 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1025 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1046 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1026 c
1047 c
1027
1048
1028 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1049 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1029 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1050 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1030 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1051 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1031 @@ -0,0 +1,1 @@
1052 @@ -0,0 +1,1 @@
1032 +c
1053 +c
1033
1054
1034 --===*-- (glob)
1055 --===*-- (glob)
1035
1056
1036 test attach for multiple patches:
1057 test attach for multiple patches:
1037 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a \
1058 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a \
1038 > -r 0:1 -r 4
1059 > -r 0:1 -r 4
1039 this patch series consists of 3 patches.
1060 this patch series consists of 3 patches.
1040
1061
1041
1062
1042 Write the introductory message for the patch series.
1063 Write the introductory message for the patch series.
1043
1064
1044
1065
1045 displaying [PATCH 0 of 3] test ...
1066 displaying [PATCH 0 of 3] test ...
1046 Content-Type: text/plain; charset="us-ascii"
1067 Content-Type: text/plain; charset="us-ascii"
1047 MIME-Version: 1.0
1068 MIME-Version: 1.0
1048 Content-Transfer-Encoding: 7bit
1069 Content-Transfer-Encoding: 7bit
1049 Subject: [PATCH 0 of 3] test
1070 Subject: [PATCH 0 of 3] test
1050 Message-Id: <patchbomb.60@*> (glob)
1071 Message-Id: <patchbomb.60@*> (glob)
1051 User-Agent: Mercurial-patchbomb/* (glob)
1072 User-Agent: Mercurial-patchbomb/* (glob)
1052 Date: Thu, 01 Jan 1970 00:01:00 +0000
1073 Date: Thu, 01 Jan 1970 00:01:00 +0000
1053 From: quux
1074 From: quux
1054 To: foo
1075 To: foo
1055 Cc: bar
1076 Cc: bar
1056
1077
1057
1078
1058 displaying [PATCH 1 of 3] a ...
1079 displaying [PATCH 1 of 3] a ...
1059 Content-Type: multipart/mixed; boundary="===*" (glob)
1080 Content-Type: multipart/mixed; boundary="===*" (glob)
1060 MIME-Version: 1.0
1081 MIME-Version: 1.0
1061 Subject: [PATCH 1 of 3] a
1082 Subject: [PATCH 1 of 3] a
1062 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1083 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1063 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
1084 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
1064 In-Reply-To: <patchbomb.60@*> (glob)
1085 In-Reply-To: <patchbomb.60@*> (glob)
1065 References: <patchbomb.60@*> (glob)
1086 References: <patchbomb.60@*> (glob)
1066 User-Agent: Mercurial-patchbomb/* (glob)
1087 User-Agent: Mercurial-patchbomb/* (glob)
1067 Date: Thu, 01 Jan 1970 00:01:01 +0000
1088 Date: Thu, 01 Jan 1970 00:01:01 +0000
1068 From: quux
1089 From: quux
1069 To: foo
1090 To: foo
1070 Cc: bar
1091 Cc: bar
1071
1092
1072 --===* (glob)
1093 --===* (glob)
1073 Content-Type: text/plain; charset="us-ascii"
1094 Content-Type: text/plain; charset="us-ascii"
1074 MIME-Version: 1.0
1095 MIME-Version: 1.0
1075 Content-Transfer-Encoding: 7bit
1096 Content-Transfer-Encoding: 7bit
1076
1097
1077 Patch subject is complete summary.
1098 Patch subject is complete summary.
1078
1099
1079
1100
1080
1101
1081 --===* (glob)
1102 --===* (glob)
1082 Content-Type: text/x-patch; charset="us-ascii"
1103 Content-Type: text/x-patch; charset="us-ascii"
1083 MIME-Version: 1.0
1104 MIME-Version: 1.0
1084 Content-Transfer-Encoding: 7bit
1105 Content-Transfer-Encoding: 7bit
1085 Content-Disposition: attachment; filename=t2-1.patch
1106 Content-Disposition: attachment; filename=t2-1.patch
1086
1107
1087 # HG changeset patch
1108 # HG changeset patch
1088 # User test
1109 # User test
1089 # Date 1 0
1110 # Date 1 0
1111 # Thu Jan 01 00:00:01 1970 +0000
1090 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1112 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1091 # Parent 0000000000000000000000000000000000000000
1113 # Parent 0000000000000000000000000000000000000000
1092 a
1114 a
1093
1115
1094 diff -r 000000000000 -r 8580ff50825a a
1116 diff -r 000000000000 -r 8580ff50825a a
1095 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1117 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1096 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1118 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1097 @@ -0,0 +1,1 @@
1119 @@ -0,0 +1,1 @@
1098 +a
1120 +a
1099
1121
1100 --===*-- (glob)
1122 --===*-- (glob)
1101 displaying [PATCH 2 of 3] b ...
1123 displaying [PATCH 2 of 3] b ...
1102 Content-Type: multipart/mixed; boundary="===*" (glob)
1124 Content-Type: multipart/mixed; boundary="===*" (glob)
1103 MIME-Version: 1.0
1125 MIME-Version: 1.0
1104 Subject: [PATCH 2 of 3] b
1126 Subject: [PATCH 2 of 3] b
1105 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1127 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1106 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
1128 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
1107 In-Reply-To: <patchbomb.60@*> (glob)
1129 In-Reply-To: <patchbomb.60@*> (glob)
1108 References: <patchbomb.60@*> (glob)
1130 References: <patchbomb.60@*> (glob)
1109 User-Agent: Mercurial-patchbomb/* (glob)
1131 User-Agent: Mercurial-patchbomb/* (glob)
1110 Date: Thu, 01 Jan 1970 00:01:02 +0000
1132 Date: Thu, 01 Jan 1970 00:01:02 +0000
1111 From: quux
1133 From: quux
1112 To: foo
1134 To: foo
1113 Cc: bar
1135 Cc: bar
1114
1136
1115 --===* (glob)
1137 --===* (glob)
1116 Content-Type: text/plain; charset="us-ascii"
1138 Content-Type: text/plain; charset="us-ascii"
1117 MIME-Version: 1.0
1139 MIME-Version: 1.0
1118 Content-Transfer-Encoding: 7bit
1140 Content-Transfer-Encoding: 7bit
1119
1141
1120 Patch subject is complete summary.
1142 Patch subject is complete summary.
1121
1143
1122
1144
1123
1145
1124 --===* (glob)
1146 --===* (glob)
1125 Content-Type: text/x-patch; charset="us-ascii"
1147 Content-Type: text/x-patch; charset="us-ascii"
1126 MIME-Version: 1.0
1148 MIME-Version: 1.0
1127 Content-Transfer-Encoding: 7bit
1149 Content-Transfer-Encoding: 7bit
1128 Content-Disposition: attachment; filename=t2-2.patch
1150 Content-Disposition: attachment; filename=t2-2.patch
1129
1151
1130 # HG changeset patch
1152 # HG changeset patch
1131 # User test
1153 # User test
1132 # Date 2 0
1154 # Date 2 0
1155 # Thu Jan 01 00:00:02 1970 +0000
1133 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1156 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1134 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1157 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1135 b
1158 b
1136
1159
1137 diff -r 8580ff50825a -r 97d72e5f12c7 b
1160 diff -r 8580ff50825a -r 97d72e5f12c7 b
1138 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1161 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1139 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1162 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1140 @@ -0,0 +1,1 @@
1163 @@ -0,0 +1,1 @@
1141 +b
1164 +b
1142
1165
1143 --===*-- (glob)
1166 --===*-- (glob)
1144 displaying [PATCH 3 of 3] long line ...
1167 displaying [PATCH 3 of 3] long line ...
1145 Content-Type: multipart/mixed; boundary="===*" (glob)
1168 Content-Type: multipart/mixed; boundary="===*" (glob)
1146 MIME-Version: 1.0
1169 MIME-Version: 1.0
1147 Subject: [PATCH 3 of 3] long line
1170 Subject: [PATCH 3 of 3] long line
1148 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
1171 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
1149 Message-Id: <a2ea8fc83dd8b93cfd86.63@*> (glob)
1172 Message-Id: <a2ea8fc83dd8b93cfd86.63@*> (glob)
1150 In-Reply-To: <patchbomb.60@*> (glob)
1173 In-Reply-To: <patchbomb.60@*> (glob)
1151 References: <patchbomb.60@*> (glob)
1174 References: <patchbomb.60@*> (glob)
1152 User-Agent: Mercurial-patchbomb/* (glob)
1175 User-Agent: Mercurial-patchbomb/* (glob)
1153 Date: Thu, 01 Jan 1970 00:01:03 +0000
1176 Date: Thu, 01 Jan 1970 00:01:03 +0000
1154 From: quux
1177 From: quux
1155 To: foo
1178 To: foo
1156 Cc: bar
1179 Cc: bar
1157
1180
1158 --===* (glob)
1181 --===* (glob)
1159 Content-Type: text/plain; charset="us-ascii"
1182 Content-Type: text/plain; charset="us-ascii"
1160 MIME-Version: 1.0
1183 MIME-Version: 1.0
1161 Content-Transfer-Encoding: 7bit
1184 Content-Transfer-Encoding: 7bit
1162
1185
1163 Patch subject is complete summary.
1186 Patch subject is complete summary.
1164
1187
1165
1188
1166
1189
1167 --===* (glob)
1190 --===* (glob)
1168 Content-Type: text/x-patch; charset="us-ascii"
1191 Content-Type: text/x-patch; charset="us-ascii"
1169 MIME-Version: 1.0
1192 MIME-Version: 1.0
1170 Content-Transfer-Encoding: quoted-printable
1193 Content-Transfer-Encoding: quoted-printable
1171 Content-Disposition: attachment; filename=t2-3.patch
1194 Content-Disposition: attachment; filename=t2-3.patch
1172
1195
1173 # HG changeset patch
1196 # HG changeset patch
1174 # User test
1197 # User test
1175 # Date 4 0
1198 # Date 4 0
1199 # Thu Jan 01 00:00:04 1970 +0000
1176 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
1200 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
1177 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
1201 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
1178 long line
1202 long line
1179
1203
1180 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
1204 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
1181 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1205 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1182 +++ b/long Thu Jan 01 00:00:04 1970 +0000
1206 +++ b/long Thu Jan 01 00:00:04 1970 +0000
1183 @@ -0,0 +1,4 @@
1207 @@ -0,0 +1,4 @@
1184 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1208 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1185 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1209 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1186 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1210 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1187 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1211 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1188 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1212 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1189 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1213 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1190 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1214 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1191 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1215 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1192 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1216 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1193 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1217 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1194 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1218 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1195 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1219 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1196 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1220 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1197 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1221 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1198 +foo
1222 +foo
1199 +
1223 +
1200 +bar
1224 +bar
1201
1225
1202 --===*-- (glob)
1226 --===*-- (glob)
1203
1227
1204 test intro for single patch:
1228 test intro for single patch:
1205 $ hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
1229 $ hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
1206 > -r 2
1230 > -r 2
1207 this patch series consists of 1 patches.
1231 this patch series consists of 1 patches.
1208
1232
1209
1233
1210 Write the introductory message for the patch series.
1234 Write the introductory message for the patch series.
1211
1235
1212
1236
1213 displaying [PATCH 0 of 1] test ...
1237 displaying [PATCH 0 of 1] test ...
1214 Content-Type: text/plain; charset="us-ascii"
1238 Content-Type: text/plain; charset="us-ascii"
1215 MIME-Version: 1.0
1239 MIME-Version: 1.0
1216 Content-Transfer-Encoding: 7bit
1240 Content-Transfer-Encoding: 7bit
1217 Subject: [PATCH 0 of 1] test
1241 Subject: [PATCH 0 of 1] test
1218 Message-Id: <patchbomb.60@*> (glob)
1242 Message-Id: <patchbomb.60@*> (glob)
1219 User-Agent: Mercurial-patchbomb/* (glob)
1243 User-Agent: Mercurial-patchbomb/* (glob)
1220 Date: Thu, 01 Jan 1970 00:01:00 +0000
1244 Date: Thu, 01 Jan 1970 00:01:00 +0000
1221 From: quux
1245 From: quux
1222 To: foo
1246 To: foo
1223 Cc: bar
1247 Cc: bar
1224
1248
1225
1249
1226 displaying [PATCH 1 of 1] c ...
1250 displaying [PATCH 1 of 1] c ...
1227 Content-Type: text/plain; charset="us-ascii"
1251 Content-Type: text/plain; charset="us-ascii"
1228 MIME-Version: 1.0
1252 MIME-Version: 1.0
1229 Content-Transfer-Encoding: 7bit
1253 Content-Transfer-Encoding: 7bit
1230 Subject: [PATCH 1 of 1] c
1254 Subject: [PATCH 1 of 1] c
1231 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1255 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1232 Message-Id: <ff2c9fa2018b15fa74b3.61@*> (glob)
1256 Message-Id: <ff2c9fa2018b15fa74b3.61@*> (glob)
1233 In-Reply-To: <patchbomb.60@*> (glob)
1257 In-Reply-To: <patchbomb.60@*> (glob)
1234 References: <patchbomb.60@*> (glob)
1258 References: <patchbomb.60@*> (glob)
1235 User-Agent: Mercurial-patchbomb/* (glob)
1259 User-Agent: Mercurial-patchbomb/* (glob)
1236 Date: Thu, 01 Jan 1970 00:01:01 +0000
1260 Date: Thu, 01 Jan 1970 00:01:01 +0000
1237 From: quux
1261 From: quux
1238 To: foo
1262 To: foo
1239 Cc: bar
1263 Cc: bar
1240
1264
1241 # HG changeset patch
1265 # HG changeset patch
1242 # User test
1266 # User test
1243 # Date 3 0
1267 # Date 3 0
1268 # Thu Jan 01 00:00:03 1970 +0000
1244 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1269 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1245 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1270 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1246 c
1271 c
1247
1272
1248 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1273 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1249 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1274 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1250 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1275 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1251 @@ -0,0 +1,1 @@
1276 @@ -0,0 +1,1 @@
1252 +c
1277 +c
1253
1278
1254
1279
1255 test --desc without --intro for a single patch:
1280 test --desc without --intro for a single patch:
1256 $ echo foo > intro.text
1281 $ echo foo > intro.text
1257 $ hg email --date '1970-1-1 0:1' -n --desc intro.text -f quux -t foo -c bar \
1282 $ hg email --date '1970-1-1 0:1' -n --desc intro.text -f quux -t foo -c bar \
1258 > -s test -r 2
1283 > -s test -r 2
1259 this patch series consists of 1 patches.
1284 this patch series consists of 1 patches.
1260
1285
1261
1286
1262 displaying [PATCH 0 of 1] test ...
1287 displaying [PATCH 0 of 1] test ...
1263 Content-Type: text/plain; charset="us-ascii"
1288 Content-Type: text/plain; charset="us-ascii"
1264 MIME-Version: 1.0
1289 MIME-Version: 1.0
1265 Content-Transfer-Encoding: 7bit
1290 Content-Transfer-Encoding: 7bit
1266 Subject: [PATCH 0 of 1] test
1291 Subject: [PATCH 0 of 1] test
1267 Message-Id: <patchbomb.60@*> (glob)
1292 Message-Id: <patchbomb.60@*> (glob)
1268 User-Agent: Mercurial-patchbomb/* (glob)
1293 User-Agent: Mercurial-patchbomb/* (glob)
1269 Date: Thu, 01 Jan 1970 00:01:00 +0000
1294 Date: Thu, 01 Jan 1970 00:01:00 +0000
1270 From: quux
1295 From: quux
1271 To: foo
1296 To: foo
1272 Cc: bar
1297 Cc: bar
1273
1298
1274 foo
1299 foo
1275
1300
1276 displaying [PATCH 1 of 1] c ...
1301 displaying [PATCH 1 of 1] c ...
1277 Content-Type: text/plain; charset="us-ascii"
1302 Content-Type: text/plain; charset="us-ascii"
1278 MIME-Version: 1.0
1303 MIME-Version: 1.0
1279 Content-Transfer-Encoding: 7bit
1304 Content-Transfer-Encoding: 7bit
1280 Subject: [PATCH 1 of 1] c
1305 Subject: [PATCH 1 of 1] c
1281 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1306 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1282 Message-Id: <ff2c9fa2018b15fa74b3.61@*> (glob)
1307 Message-Id: <ff2c9fa2018b15fa74b3.61@*> (glob)
1283 In-Reply-To: <patchbomb.60@*> (glob)
1308 In-Reply-To: <patchbomb.60@*> (glob)
1284 References: <patchbomb.60@*> (glob)
1309 References: <patchbomb.60@*> (glob)
1285 User-Agent: Mercurial-patchbomb/* (glob)
1310 User-Agent: Mercurial-patchbomb/* (glob)
1286 Date: Thu, 01 Jan 1970 00:01:01 +0000
1311 Date: Thu, 01 Jan 1970 00:01:01 +0000
1287 From: quux
1312 From: quux
1288 To: foo
1313 To: foo
1289 Cc: bar
1314 Cc: bar
1290
1315
1291 # HG changeset patch
1316 # HG changeset patch
1292 # User test
1317 # User test
1293 # Date 3 0
1318 # Date 3 0
1319 # Thu Jan 01 00:00:03 1970 +0000
1294 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1320 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1295 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1321 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1296 c
1322 c
1297
1323
1298 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1324 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1299 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1325 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1300 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1326 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1301 @@ -0,0 +1,1 @@
1327 @@ -0,0 +1,1 @@
1302 +c
1328 +c
1303
1329
1304
1330
1305 test intro for multiple patches:
1331 test intro for multiple patches:
1306 $ hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
1332 $ hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
1307 > -r 0:1
1333 > -r 0:1
1308 this patch series consists of 2 patches.
1334 this patch series consists of 2 patches.
1309
1335
1310
1336
1311 Write the introductory message for the patch series.
1337 Write the introductory message for the patch series.
1312
1338
1313
1339
1314 displaying [PATCH 0 of 2] test ...
1340 displaying [PATCH 0 of 2] test ...
1315 Content-Type: text/plain; charset="us-ascii"
1341 Content-Type: text/plain; charset="us-ascii"
1316 MIME-Version: 1.0
1342 MIME-Version: 1.0
1317 Content-Transfer-Encoding: 7bit
1343 Content-Transfer-Encoding: 7bit
1318 Subject: [PATCH 0 of 2] test
1344 Subject: [PATCH 0 of 2] test
1319 Message-Id: <patchbomb.60@*> (glob)
1345 Message-Id: <patchbomb.60@*> (glob)
1320 User-Agent: Mercurial-patchbomb/* (glob)
1346 User-Agent: Mercurial-patchbomb/* (glob)
1321 Date: Thu, 01 Jan 1970 00:01:00 +0000
1347 Date: Thu, 01 Jan 1970 00:01:00 +0000
1322 From: quux
1348 From: quux
1323 To: foo
1349 To: foo
1324 Cc: bar
1350 Cc: bar
1325
1351
1326
1352
1327 displaying [PATCH 1 of 2] a ...
1353 displaying [PATCH 1 of 2] a ...
1328 Content-Type: text/plain; charset="us-ascii"
1354 Content-Type: text/plain; charset="us-ascii"
1329 MIME-Version: 1.0
1355 MIME-Version: 1.0
1330 Content-Transfer-Encoding: 7bit
1356 Content-Transfer-Encoding: 7bit
1331 Subject: [PATCH 1 of 2] a
1357 Subject: [PATCH 1 of 2] a
1332 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1358 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1333 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
1359 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
1334 In-Reply-To: <patchbomb.60@*> (glob)
1360 In-Reply-To: <patchbomb.60@*> (glob)
1335 References: <patchbomb.60@*> (glob)
1361 References: <patchbomb.60@*> (glob)
1336 User-Agent: Mercurial-patchbomb/* (glob)
1362 User-Agent: Mercurial-patchbomb/* (glob)
1337 Date: Thu, 01 Jan 1970 00:01:01 +0000
1363 Date: Thu, 01 Jan 1970 00:01:01 +0000
1338 From: quux
1364 From: quux
1339 To: foo
1365 To: foo
1340 Cc: bar
1366 Cc: bar
1341
1367
1342 # HG changeset patch
1368 # HG changeset patch
1343 # User test
1369 # User test
1344 # Date 1 0
1370 # Date 1 0
1371 # Thu Jan 01 00:00:01 1970 +0000
1345 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1372 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1346 # Parent 0000000000000000000000000000000000000000
1373 # Parent 0000000000000000000000000000000000000000
1347 a
1374 a
1348
1375
1349 diff -r 000000000000 -r 8580ff50825a a
1376 diff -r 000000000000 -r 8580ff50825a a
1350 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1377 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1351 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1378 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1352 @@ -0,0 +1,1 @@
1379 @@ -0,0 +1,1 @@
1353 +a
1380 +a
1354
1381
1355 displaying [PATCH 2 of 2] b ...
1382 displaying [PATCH 2 of 2] b ...
1356 Content-Type: text/plain; charset="us-ascii"
1383 Content-Type: text/plain; charset="us-ascii"
1357 MIME-Version: 1.0
1384 MIME-Version: 1.0
1358 Content-Transfer-Encoding: 7bit
1385 Content-Transfer-Encoding: 7bit
1359 Subject: [PATCH 2 of 2] b
1386 Subject: [PATCH 2 of 2] b
1360 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1387 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1361 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
1388 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
1362 In-Reply-To: <patchbomb.60@*> (glob)
1389 In-Reply-To: <patchbomb.60@*> (glob)
1363 References: <patchbomb.60@*> (glob)
1390 References: <patchbomb.60@*> (glob)
1364 User-Agent: Mercurial-patchbomb/* (glob)
1391 User-Agent: Mercurial-patchbomb/* (glob)
1365 Date: Thu, 01 Jan 1970 00:01:02 +0000
1392 Date: Thu, 01 Jan 1970 00:01:02 +0000
1366 From: quux
1393 From: quux
1367 To: foo
1394 To: foo
1368 Cc: bar
1395 Cc: bar
1369
1396
1370 # HG changeset patch
1397 # HG changeset patch
1371 # User test
1398 # User test
1372 # Date 2 0
1399 # Date 2 0
1400 # Thu Jan 01 00:00:02 1970 +0000
1373 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1401 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1374 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1402 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1375 b
1403 b
1376
1404
1377 diff -r 8580ff50825a -r 97d72e5f12c7 b
1405 diff -r 8580ff50825a -r 97d72e5f12c7 b
1378 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1406 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1379 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1407 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1380 @@ -0,0 +1,1 @@
1408 @@ -0,0 +1,1 @@
1381 +b
1409 +b
1382
1410
1383
1411
1384 test reply-to via config:
1412 test reply-to via config:
1385 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -r 2 \
1413 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -r 2 \
1386 > --config patchbomb.reply-to='baz@example.com'
1414 > --config patchbomb.reply-to='baz@example.com'
1387 this patch series consists of 1 patches.
1415 this patch series consists of 1 patches.
1388
1416
1389
1417
1390 displaying [PATCH] test ...
1418 displaying [PATCH] test ...
1391 Content-Type: text/plain; charset="us-ascii"
1419 Content-Type: text/plain; charset="us-ascii"
1392 MIME-Version: 1.0
1420 MIME-Version: 1.0
1393 Content-Transfer-Encoding: 7bit
1421 Content-Transfer-Encoding: 7bit
1394 Subject: [PATCH] test
1422 Subject: [PATCH] test
1395 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1423 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1396 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1424 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1397 User-Agent: Mercurial-patchbomb/* (glob)
1425 User-Agent: Mercurial-patchbomb/* (glob)
1398 Date: Thu, 01 Jan 1970 00:01:00 +0000
1426 Date: Thu, 01 Jan 1970 00:01:00 +0000
1399 From: quux
1427 From: quux
1400 To: foo
1428 To: foo
1401 Cc: bar
1429 Cc: bar
1402 Reply-To: baz@example.com
1430 Reply-To: baz@example.com
1403
1431
1404 # HG changeset patch
1432 # HG changeset patch
1405 # User test
1433 # User test
1406 # Date 3 0
1434 # Date 3 0
1435 # Thu Jan 01 00:00:03 1970 +0000
1407 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1436 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1408 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1437 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1409 c
1438 c
1410
1439
1411 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1440 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1412 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1441 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1413 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1442 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1414 @@ -0,0 +1,1 @@
1443 @@ -0,0 +1,1 @@
1415 +c
1444 +c
1416
1445
1417
1446
1418 test reply-to via command line:
1447 test reply-to via command line:
1419 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -r 2 \
1448 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -r 2 \
1420 > --reply-to baz --reply-to fred
1449 > --reply-to baz --reply-to fred
1421 this patch series consists of 1 patches.
1450 this patch series consists of 1 patches.
1422
1451
1423
1452
1424 displaying [PATCH] test ...
1453 displaying [PATCH] test ...
1425 Content-Type: text/plain; charset="us-ascii"
1454 Content-Type: text/plain; charset="us-ascii"
1426 MIME-Version: 1.0
1455 MIME-Version: 1.0
1427 Content-Transfer-Encoding: 7bit
1456 Content-Transfer-Encoding: 7bit
1428 Subject: [PATCH] test
1457 Subject: [PATCH] test
1429 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1458 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1430 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1459 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1431 User-Agent: Mercurial-patchbomb/* (glob)
1460 User-Agent: Mercurial-patchbomb/* (glob)
1432 Date: Thu, 01 Jan 1970 00:01:00 +0000
1461 Date: Thu, 01 Jan 1970 00:01:00 +0000
1433 From: quux
1462 From: quux
1434 To: foo
1463 To: foo
1435 Cc: bar
1464 Cc: bar
1436 Reply-To: baz, fred
1465 Reply-To: baz, fred
1437
1466
1438 # HG changeset patch
1467 # HG changeset patch
1439 # User test
1468 # User test
1440 # Date 3 0
1469 # Date 3 0
1470 # Thu Jan 01 00:00:03 1970 +0000
1441 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1471 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1442 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1472 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1443 c
1473 c
1444
1474
1445 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1475 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1446 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1476 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1447 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1477 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1448 @@ -0,0 +1,1 @@
1478 @@ -0,0 +1,1 @@
1449 +c
1479 +c
1450
1480
1451
1481
1452 tagging csets:
1482 tagging csets:
1453 $ hg tag -r0 zero zero.foo
1483 $ hg tag -r0 zero zero.foo
1454 $ hg tag -r1 one one.patch
1484 $ hg tag -r1 one one.patch
1455 $ hg tag -r2 two two.diff
1485 $ hg tag -r2 two two.diff
1456
1486
1457 test inline for single named patch:
1487 test inline for single named patch:
1458 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2
1488 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2
1459 this patch series consists of 1 patches.
1489 this patch series consists of 1 patches.
1460
1490
1461
1491
1462 displaying [PATCH] test ...
1492 displaying [PATCH] test ...
1463 Content-Type: multipart/mixed; boundary="===*" (glob)
1493 Content-Type: multipart/mixed; boundary="===*" (glob)
1464 MIME-Version: 1.0
1494 MIME-Version: 1.0
1465 Subject: [PATCH] test
1495 Subject: [PATCH] test
1466 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1496 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1467 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1497 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1468 User-Agent: Mercurial-patchbomb/* (glob)
1498 User-Agent: Mercurial-patchbomb/* (glob)
1469 Date: Thu, 01 Jan 1970 00:01:00 +0000
1499 Date: Thu, 01 Jan 1970 00:01:00 +0000
1470 From: quux
1500 From: quux
1471 To: foo
1501 To: foo
1472 Cc: bar
1502 Cc: bar
1473
1503
1474 --===* (glob)
1504 --===* (glob)
1475 Content-Type: text/x-patch; charset="us-ascii"
1505 Content-Type: text/x-patch; charset="us-ascii"
1476 MIME-Version: 1.0
1506 MIME-Version: 1.0
1477 Content-Transfer-Encoding: 7bit
1507 Content-Transfer-Encoding: 7bit
1478 Content-Disposition: inline; filename=two.diff
1508 Content-Disposition: inline; filename=two.diff
1479
1509
1480 # HG changeset patch
1510 # HG changeset patch
1481 # User test
1511 # User test
1482 # Date 3 0
1512 # Date 3 0
1513 # Thu Jan 01 00:00:03 1970 +0000
1483 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1514 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1484 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1515 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1485 c
1516 c
1486
1517
1487 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1518 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1488 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1519 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1489 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1520 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1490 @@ -0,0 +1,1 @@
1521 @@ -0,0 +1,1 @@
1491 +c
1522 +c
1492
1523
1493 --===*-- (glob)
1524 --===*-- (glob)
1494
1525
1495 test inline for multiple named/unnamed patches:
1526 test inline for multiple named/unnamed patches:
1496 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 0:1
1527 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 0:1
1497 this patch series consists of 2 patches.
1528 this patch series consists of 2 patches.
1498
1529
1499
1530
1500 Write the introductory message for the patch series.
1531 Write the introductory message for the patch series.
1501
1532
1502
1533
1503 displaying [PATCH 0 of 2] test ...
1534 displaying [PATCH 0 of 2] test ...
1504 Content-Type: text/plain; charset="us-ascii"
1535 Content-Type: text/plain; charset="us-ascii"
1505 MIME-Version: 1.0
1536 MIME-Version: 1.0
1506 Content-Transfer-Encoding: 7bit
1537 Content-Transfer-Encoding: 7bit
1507 Subject: [PATCH 0 of 2] test
1538 Subject: [PATCH 0 of 2] test
1508 Message-Id: <patchbomb.60@*> (glob)
1539 Message-Id: <patchbomb.60@*> (glob)
1509 User-Agent: Mercurial-patchbomb/* (glob)
1540 User-Agent: Mercurial-patchbomb/* (glob)
1510 Date: Thu, 01 Jan 1970 00:01:00 +0000
1541 Date: Thu, 01 Jan 1970 00:01:00 +0000
1511 From: quux
1542 From: quux
1512 To: foo
1543 To: foo
1513 Cc: bar
1544 Cc: bar
1514
1545
1515
1546
1516 displaying [PATCH 1 of 2] a ...
1547 displaying [PATCH 1 of 2] a ...
1517 Content-Type: multipart/mixed; boundary="===*" (glob)
1548 Content-Type: multipart/mixed; boundary="===*" (glob)
1518 MIME-Version: 1.0
1549 MIME-Version: 1.0
1519 Subject: [PATCH 1 of 2] a
1550 Subject: [PATCH 1 of 2] a
1520 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1551 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1521 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
1552 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
1522 In-Reply-To: <patchbomb.60@*> (glob)
1553 In-Reply-To: <patchbomb.60@*> (glob)
1523 References: <patchbomb.60@*> (glob)
1554 References: <patchbomb.60@*> (glob)
1524 User-Agent: Mercurial-patchbomb/* (glob)
1555 User-Agent: Mercurial-patchbomb/* (glob)
1525 Date: Thu, 01 Jan 1970 00:01:01 +0000
1556 Date: Thu, 01 Jan 1970 00:01:01 +0000
1526 From: quux
1557 From: quux
1527 To: foo
1558 To: foo
1528 Cc: bar
1559 Cc: bar
1529
1560
1530 --===* (glob)
1561 --===* (glob)
1531 Content-Type: text/x-patch; charset="us-ascii"
1562 Content-Type: text/x-patch; charset="us-ascii"
1532 MIME-Version: 1.0
1563 MIME-Version: 1.0
1533 Content-Transfer-Encoding: 7bit
1564 Content-Transfer-Encoding: 7bit
1534 Content-Disposition: inline; filename=t2-1.patch
1565 Content-Disposition: inline; filename=t2-1.patch
1535
1566
1536 # HG changeset patch
1567 # HG changeset patch
1537 # User test
1568 # User test
1538 # Date 1 0
1569 # Date 1 0
1570 # Thu Jan 01 00:00:01 1970 +0000
1539 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1571 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1540 # Parent 0000000000000000000000000000000000000000
1572 # Parent 0000000000000000000000000000000000000000
1541 a
1573 a
1542
1574
1543 diff -r 000000000000 -r 8580ff50825a a
1575 diff -r 000000000000 -r 8580ff50825a a
1544 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1576 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1545 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1577 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1546 @@ -0,0 +1,1 @@
1578 @@ -0,0 +1,1 @@
1547 +a
1579 +a
1548
1580
1549 --===*-- (glob)
1581 --===*-- (glob)
1550 displaying [PATCH 2 of 2] b ...
1582 displaying [PATCH 2 of 2] b ...
1551 Content-Type: multipart/mixed; boundary="===*" (glob)
1583 Content-Type: multipart/mixed; boundary="===*" (glob)
1552 MIME-Version: 1.0
1584 MIME-Version: 1.0
1553 Subject: [PATCH 2 of 2] b
1585 Subject: [PATCH 2 of 2] b
1554 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1586 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1555 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
1587 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
1556 In-Reply-To: <patchbomb.60@*> (glob)
1588 In-Reply-To: <patchbomb.60@*> (glob)
1557 References: <patchbomb.60@*> (glob)
1589 References: <patchbomb.60@*> (glob)
1558 User-Agent: Mercurial-patchbomb/* (glob)
1590 User-Agent: Mercurial-patchbomb/* (glob)
1559 Date: Thu, 01 Jan 1970 00:01:02 +0000
1591 Date: Thu, 01 Jan 1970 00:01:02 +0000
1560 From: quux
1592 From: quux
1561 To: foo
1593 To: foo
1562 Cc: bar
1594 Cc: bar
1563
1595
1564 --===* (glob)
1596 --===* (glob)
1565 Content-Type: text/x-patch; charset="us-ascii"
1597 Content-Type: text/x-patch; charset="us-ascii"
1566 MIME-Version: 1.0
1598 MIME-Version: 1.0
1567 Content-Transfer-Encoding: 7bit
1599 Content-Transfer-Encoding: 7bit
1568 Content-Disposition: inline; filename=one.patch
1600 Content-Disposition: inline; filename=one.patch
1569
1601
1570 # HG changeset patch
1602 # HG changeset patch
1571 # User test
1603 # User test
1572 # Date 2 0
1604 # Date 2 0
1605 # Thu Jan 01 00:00:02 1970 +0000
1573 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1606 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1574 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1607 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1575 b
1608 b
1576
1609
1577 diff -r 8580ff50825a -r 97d72e5f12c7 b
1610 diff -r 8580ff50825a -r 97d72e5f12c7 b
1578 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1611 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1579 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1612 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1580 @@ -0,0 +1,1 @@
1613 @@ -0,0 +1,1 @@
1581 +b
1614 +b
1582
1615
1583 --===*-- (glob)
1616 --===*-- (glob)
1584
1617
1585
1618
1586 test inreplyto:
1619 test inreplyto:
1587 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
1620 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
1588 > -r tip
1621 > -r tip
1589 this patch series consists of 1 patches.
1622 this patch series consists of 1 patches.
1590
1623
1591
1624
1592 displaying [PATCH] Added tag two, two.diff for changeset ff2c9fa2018b ...
1625 displaying [PATCH] Added tag two, two.diff for changeset ff2c9fa2018b ...
1593 Content-Type: text/plain; charset="us-ascii"
1626 Content-Type: text/plain; charset="us-ascii"
1594 MIME-Version: 1.0
1627 MIME-Version: 1.0
1595 Content-Transfer-Encoding: 7bit
1628 Content-Transfer-Encoding: 7bit
1596 Subject: [PATCH] Added tag two, two.diff for changeset ff2c9fa2018b
1629 Subject: [PATCH] Added tag two, two.diff for changeset ff2c9fa2018b
1597 X-Mercurial-Node: 7aead2484924c445ad8ce2613df91f52f9e502ed
1630 X-Mercurial-Node: 7aead2484924c445ad8ce2613df91f52f9e502ed
1598 Message-Id: <7aead2484924c445ad8c.60@*> (glob)
1631 Message-Id: <7aead2484924c445ad8c.60@*> (glob)
1599 In-Reply-To: <baz>
1632 In-Reply-To: <baz>
1600 References: <baz>
1633 References: <baz>
1601 User-Agent: Mercurial-patchbomb/* (glob)
1634 User-Agent: Mercurial-patchbomb/* (glob)
1602 Date: Thu, 01 Jan 1970 00:01:00 +0000
1635 Date: Thu, 01 Jan 1970 00:01:00 +0000
1603 From: quux
1636 From: quux
1604 To: foo
1637 To: foo
1605 Cc: bar
1638 Cc: bar
1606
1639
1607 # HG changeset patch
1640 # HG changeset patch
1608 # User test
1641 # User test
1609 # Date 0 0
1642 # Date 0 0
1643 # Thu Jan 01 00:00:00 1970 +0000
1610 # Node ID 7aead2484924c445ad8ce2613df91f52f9e502ed
1644 # Node ID 7aead2484924c445ad8ce2613df91f52f9e502ed
1611 # Parent 045ca29b1ea20e4940411e695e20e521f2f0f98e
1645 # Parent 045ca29b1ea20e4940411e695e20e521f2f0f98e
1612 Added tag two, two.diff for changeset ff2c9fa2018b
1646 Added tag two, two.diff for changeset ff2c9fa2018b
1613
1647
1614 diff -r 045ca29b1ea2 -r 7aead2484924 .hgtags
1648 diff -r 045ca29b1ea2 -r 7aead2484924 .hgtags
1615 --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000
1649 --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000
1616 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
1650 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
1617 @@ -2,3 +2,5 @@
1651 @@ -2,3 +2,5 @@
1618 8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
1652 8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
1619 97d72e5f12c7e84f85064aa72e5a297142c36ed9 one
1653 97d72e5f12c7e84f85064aa72e5a297142c36ed9 one
1620 97d72e5f12c7e84f85064aa72e5a297142c36ed9 one.patch
1654 97d72e5f12c7e84f85064aa72e5a297142c36ed9 one.patch
1621 +ff2c9fa2018b15fa74b33363bda9527323e2a99f two
1655 +ff2c9fa2018b15fa74b33363bda9527323e2a99f two
1622 +ff2c9fa2018b15fa74b33363bda9527323e2a99f two.diff
1656 +ff2c9fa2018b15fa74b33363bda9527323e2a99f two.diff
1623
1657
1624 no intro message in non-interactive mode
1658 no intro message in non-interactive mode
1625 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
1659 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
1626 > -r 0:1
1660 > -r 0:1
1627 this patch series consists of 2 patches.
1661 this patch series consists of 2 patches.
1628
1662
1629 (optional) Subject: [PATCH 0 of 2]
1663 (optional) Subject: [PATCH 0 of 2]
1630
1664
1631 displaying [PATCH 1 of 2] a ...
1665 displaying [PATCH 1 of 2] a ...
1632 Content-Type: text/plain; charset="us-ascii"
1666 Content-Type: text/plain; charset="us-ascii"
1633 MIME-Version: 1.0
1667 MIME-Version: 1.0
1634 Content-Transfer-Encoding: 7bit
1668 Content-Transfer-Encoding: 7bit
1635 Subject: [PATCH 1 of 2] a
1669 Subject: [PATCH 1 of 2] a
1636 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1670 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1637 Message-Id: <8580ff50825a50c8f716.60@*> (glob)
1671 Message-Id: <8580ff50825a50c8f716.60@*> (glob)
1638 In-Reply-To: <baz>
1672 In-Reply-To: <baz>
1639 References: <baz>
1673 References: <baz>
1640 User-Agent: Mercurial-patchbomb/* (glob)
1674 User-Agent: Mercurial-patchbomb/* (glob)
1641 Date: Thu, 01 Jan 1970 00:01:00 +0000
1675 Date: Thu, 01 Jan 1970 00:01:00 +0000
1642 From: quux
1676 From: quux
1643 To: foo
1677 To: foo
1644 Cc: bar
1678 Cc: bar
1645
1679
1646 # HG changeset patch
1680 # HG changeset patch
1647 # User test
1681 # User test
1648 # Date 1 0
1682 # Date 1 0
1683 # Thu Jan 01 00:00:01 1970 +0000
1649 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1684 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1650 # Parent 0000000000000000000000000000000000000000
1685 # Parent 0000000000000000000000000000000000000000
1651 a
1686 a
1652
1687
1653 diff -r 000000000000 -r 8580ff50825a a
1688 diff -r 000000000000 -r 8580ff50825a a
1654 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1689 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1655 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1690 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1656 @@ -0,0 +1,1 @@
1691 @@ -0,0 +1,1 @@
1657 +a
1692 +a
1658
1693
1659 displaying [PATCH 2 of 2] b ...
1694 displaying [PATCH 2 of 2] b ...
1660 Content-Type: text/plain; charset="us-ascii"
1695 Content-Type: text/plain; charset="us-ascii"
1661 MIME-Version: 1.0
1696 MIME-Version: 1.0
1662 Content-Transfer-Encoding: 7bit
1697 Content-Transfer-Encoding: 7bit
1663 Subject: [PATCH 2 of 2] b
1698 Subject: [PATCH 2 of 2] b
1664 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1699 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1665 Message-Id: <97d72e5f12c7e84f8506.61@*> (glob)
1700 Message-Id: <97d72e5f12c7e84f8506.61@*> (glob)
1666 In-Reply-To: <baz>
1701 In-Reply-To: <baz>
1667 References: <baz>
1702 References: <baz>
1668 User-Agent: Mercurial-patchbomb/* (glob)
1703 User-Agent: Mercurial-patchbomb/* (glob)
1669 Date: Thu, 01 Jan 1970 00:01:01 +0000
1704 Date: Thu, 01 Jan 1970 00:01:01 +0000
1670 From: quux
1705 From: quux
1671 To: foo
1706 To: foo
1672 Cc: bar
1707 Cc: bar
1673
1708
1674 # HG changeset patch
1709 # HG changeset patch
1675 # User test
1710 # User test
1676 # Date 2 0
1711 # Date 2 0
1712 # Thu Jan 01 00:00:02 1970 +0000
1677 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1713 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1678 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1714 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1679 b
1715 b
1680
1716
1681 diff -r 8580ff50825a -r 97d72e5f12c7 b
1717 diff -r 8580ff50825a -r 97d72e5f12c7 b
1682 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1718 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1683 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1719 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1684 @@ -0,0 +1,1 @@
1720 @@ -0,0 +1,1 @@
1685 +b
1721 +b
1686
1722
1687
1723
1688
1724
1689
1725
1690 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
1726 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
1691 > -s test -r 0:1
1727 > -s test -r 0:1
1692 this patch series consists of 2 patches.
1728 this patch series consists of 2 patches.
1693
1729
1694
1730
1695 Write the introductory message for the patch series.
1731 Write the introductory message for the patch series.
1696
1732
1697
1733
1698 displaying [PATCH 0 of 2] test ...
1734 displaying [PATCH 0 of 2] test ...
1699 Content-Type: text/plain; charset="us-ascii"
1735 Content-Type: text/plain; charset="us-ascii"
1700 MIME-Version: 1.0
1736 MIME-Version: 1.0
1701 Content-Transfer-Encoding: 7bit
1737 Content-Transfer-Encoding: 7bit
1702 Subject: [PATCH 0 of 2] test
1738 Subject: [PATCH 0 of 2] test
1703 Message-Id: <patchbomb.60@*> (glob)
1739 Message-Id: <patchbomb.60@*> (glob)
1704 In-Reply-To: <baz>
1740 In-Reply-To: <baz>
1705 References: <baz>
1741 References: <baz>
1706 User-Agent: Mercurial-patchbomb/* (glob)
1742 User-Agent: Mercurial-patchbomb/* (glob)
1707 Date: Thu, 01 Jan 1970 00:01:00 +0000
1743 Date: Thu, 01 Jan 1970 00:01:00 +0000
1708 From: quux
1744 From: quux
1709 To: foo
1745 To: foo
1710 Cc: bar
1746 Cc: bar
1711
1747
1712
1748
1713 displaying [PATCH 1 of 2] a ...
1749 displaying [PATCH 1 of 2] a ...
1714 Content-Type: text/plain; charset="us-ascii"
1750 Content-Type: text/plain; charset="us-ascii"
1715 MIME-Version: 1.0
1751 MIME-Version: 1.0
1716 Content-Transfer-Encoding: 7bit
1752 Content-Transfer-Encoding: 7bit
1717 Subject: [PATCH 1 of 2] a
1753 Subject: [PATCH 1 of 2] a
1718 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1754 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1719 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
1755 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
1720 In-Reply-To: <patchbomb.60@*> (glob)
1756 In-Reply-To: <patchbomb.60@*> (glob)
1721 References: <patchbomb.60@*> (glob)
1757 References: <patchbomb.60@*> (glob)
1722 User-Agent: Mercurial-patchbomb/* (glob)
1758 User-Agent: Mercurial-patchbomb/* (glob)
1723 Date: Thu, 01 Jan 1970 00:01:01 +0000
1759 Date: Thu, 01 Jan 1970 00:01:01 +0000
1724 From: quux
1760 From: quux
1725 To: foo
1761 To: foo
1726 Cc: bar
1762 Cc: bar
1727
1763
1728 # HG changeset patch
1764 # HG changeset patch
1729 # User test
1765 # User test
1730 # Date 1 0
1766 # Date 1 0
1767 # Thu Jan 01 00:00:01 1970 +0000
1731 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1768 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1732 # Parent 0000000000000000000000000000000000000000
1769 # Parent 0000000000000000000000000000000000000000
1733 a
1770 a
1734
1771
1735 diff -r 000000000000 -r 8580ff50825a a
1772 diff -r 000000000000 -r 8580ff50825a a
1736 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1773 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1737 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1774 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1738 @@ -0,0 +1,1 @@
1775 @@ -0,0 +1,1 @@
1739 +a
1776 +a
1740
1777
1741 displaying [PATCH 2 of 2] b ...
1778 displaying [PATCH 2 of 2] b ...
1742 Content-Type: text/plain; charset="us-ascii"
1779 Content-Type: text/plain; charset="us-ascii"
1743 MIME-Version: 1.0
1780 MIME-Version: 1.0
1744 Content-Transfer-Encoding: 7bit
1781 Content-Transfer-Encoding: 7bit
1745 Subject: [PATCH 2 of 2] b
1782 Subject: [PATCH 2 of 2] b
1746 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1783 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1747 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
1784 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
1748 In-Reply-To: <patchbomb.60@*> (glob)
1785 In-Reply-To: <patchbomb.60@*> (glob)
1749 References: <patchbomb.60@*> (glob)
1786 References: <patchbomb.60@*> (glob)
1750 User-Agent: Mercurial-patchbomb/* (glob)
1787 User-Agent: Mercurial-patchbomb/* (glob)
1751 Date: Thu, 01 Jan 1970 00:01:02 +0000
1788 Date: Thu, 01 Jan 1970 00:01:02 +0000
1752 From: quux
1789 From: quux
1753 To: foo
1790 To: foo
1754 Cc: bar
1791 Cc: bar
1755
1792
1756 # HG changeset patch
1793 # HG changeset patch
1757 # User test
1794 # User test
1758 # Date 2 0
1795 # Date 2 0
1796 # Thu Jan 01 00:00:02 1970 +0000
1759 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1797 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1760 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1798 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1761 b
1799 b
1762
1800
1763 diff -r 8580ff50825a -r 97d72e5f12c7 b
1801 diff -r 8580ff50825a -r 97d72e5f12c7 b
1764 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1802 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1765 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1803 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1766 @@ -0,0 +1,1 @@
1804 @@ -0,0 +1,1 @@
1767 +b
1805 +b
1768
1806
1769
1807
1770 test single flag for single patch:
1808 test single flag for single patch:
1771 $ hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
1809 $ hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
1772 > -r 2
1810 > -r 2
1773 this patch series consists of 1 patches.
1811 this patch series consists of 1 patches.
1774
1812
1775
1813
1776 displaying [PATCH fooFlag] test ...
1814 displaying [PATCH fooFlag] test ...
1777 Content-Type: text/plain; charset="us-ascii"
1815 Content-Type: text/plain; charset="us-ascii"
1778 MIME-Version: 1.0
1816 MIME-Version: 1.0
1779 Content-Transfer-Encoding: 7bit
1817 Content-Transfer-Encoding: 7bit
1780 Subject: [PATCH fooFlag] test
1818 Subject: [PATCH fooFlag] test
1781 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1819 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1782 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1820 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1783 User-Agent: Mercurial-patchbomb/* (glob)
1821 User-Agent: Mercurial-patchbomb/* (glob)
1784 Date: Thu, 01 Jan 1970 00:01:00 +0000
1822 Date: Thu, 01 Jan 1970 00:01:00 +0000
1785 From: quux
1823 From: quux
1786 To: foo
1824 To: foo
1787 Cc: bar
1825 Cc: bar
1788
1826
1789 # HG changeset patch
1827 # HG changeset patch
1790 # User test
1828 # User test
1791 # Date 3 0
1829 # Date 3 0
1830 # Thu Jan 01 00:00:03 1970 +0000
1792 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1831 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1793 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1832 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1794 c
1833 c
1795
1834
1796 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1835 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1797 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1836 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1798 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1837 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1799 @@ -0,0 +1,1 @@
1838 @@ -0,0 +1,1 @@
1800 +c
1839 +c
1801
1840
1802
1841
1803 test single flag for multiple patches:
1842 test single flag for multiple patches:
1804 $ hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
1843 $ hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
1805 > -r 0:1
1844 > -r 0:1
1806 this patch series consists of 2 patches.
1845 this patch series consists of 2 patches.
1807
1846
1808
1847
1809 Write the introductory message for the patch series.
1848 Write the introductory message for the patch series.
1810
1849
1811
1850
1812 displaying [PATCH 0 of 2 fooFlag] test ...
1851 displaying [PATCH 0 of 2 fooFlag] test ...
1813 Content-Type: text/plain; charset="us-ascii"
1852 Content-Type: text/plain; charset="us-ascii"
1814 MIME-Version: 1.0
1853 MIME-Version: 1.0
1815 Content-Transfer-Encoding: 7bit
1854 Content-Transfer-Encoding: 7bit
1816 Subject: [PATCH 0 of 2 fooFlag] test
1855 Subject: [PATCH 0 of 2 fooFlag] test
1817 Message-Id: <patchbomb.60@*> (glob)
1856 Message-Id: <patchbomb.60@*> (glob)
1818 User-Agent: Mercurial-patchbomb/* (glob)
1857 User-Agent: Mercurial-patchbomb/* (glob)
1819 Date: Thu, 01 Jan 1970 00:01:00 +0000
1858 Date: Thu, 01 Jan 1970 00:01:00 +0000
1820 From: quux
1859 From: quux
1821 To: foo
1860 To: foo
1822 Cc: bar
1861 Cc: bar
1823
1862
1824
1863
1825 displaying [PATCH 1 of 2 fooFlag] a ...
1864 displaying [PATCH 1 of 2 fooFlag] a ...
1826 Content-Type: text/plain; charset="us-ascii"
1865 Content-Type: text/plain; charset="us-ascii"
1827 MIME-Version: 1.0
1866 MIME-Version: 1.0
1828 Content-Transfer-Encoding: 7bit
1867 Content-Transfer-Encoding: 7bit
1829 Subject: [PATCH 1 of 2 fooFlag] a
1868 Subject: [PATCH 1 of 2 fooFlag] a
1830 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1869 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1831 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
1870 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
1832 In-Reply-To: <patchbomb.60@*> (glob)
1871 In-Reply-To: <patchbomb.60@*> (glob)
1833 References: <patchbomb.60@*> (glob)
1872 References: <patchbomb.60@*> (glob)
1834 User-Agent: Mercurial-patchbomb/* (glob)
1873 User-Agent: Mercurial-patchbomb/* (glob)
1835 Date: Thu, 01 Jan 1970 00:01:01 +0000
1874 Date: Thu, 01 Jan 1970 00:01:01 +0000
1836 From: quux
1875 From: quux
1837 To: foo
1876 To: foo
1838 Cc: bar
1877 Cc: bar
1839
1878
1840 # HG changeset patch
1879 # HG changeset patch
1841 # User test
1880 # User test
1842 # Date 1 0
1881 # Date 1 0
1882 # Thu Jan 01 00:00:01 1970 +0000
1843 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1883 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1844 # Parent 0000000000000000000000000000000000000000
1884 # Parent 0000000000000000000000000000000000000000
1845 a
1885 a
1846
1886
1847 diff -r 000000000000 -r 8580ff50825a a
1887 diff -r 000000000000 -r 8580ff50825a a
1848 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1888 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1849 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1889 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1850 @@ -0,0 +1,1 @@
1890 @@ -0,0 +1,1 @@
1851 +a
1891 +a
1852
1892
1853 displaying [PATCH 2 of 2 fooFlag] b ...
1893 displaying [PATCH 2 of 2 fooFlag] b ...
1854 Content-Type: text/plain; charset="us-ascii"
1894 Content-Type: text/plain; charset="us-ascii"
1855 MIME-Version: 1.0
1895 MIME-Version: 1.0
1856 Content-Transfer-Encoding: 7bit
1896 Content-Transfer-Encoding: 7bit
1857 Subject: [PATCH 2 of 2 fooFlag] b
1897 Subject: [PATCH 2 of 2 fooFlag] b
1858 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1898 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1859 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
1899 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
1860 In-Reply-To: <patchbomb.60@*> (glob)
1900 In-Reply-To: <patchbomb.60@*> (glob)
1861 References: <patchbomb.60@*> (glob)
1901 References: <patchbomb.60@*> (glob)
1862 User-Agent: Mercurial-patchbomb/* (glob)
1902 User-Agent: Mercurial-patchbomb/* (glob)
1863 Date: Thu, 01 Jan 1970 00:01:02 +0000
1903 Date: Thu, 01 Jan 1970 00:01:02 +0000
1864 From: quux
1904 From: quux
1865 To: foo
1905 To: foo
1866 Cc: bar
1906 Cc: bar
1867
1907
1868 # HG changeset patch
1908 # HG changeset patch
1869 # User test
1909 # User test
1870 # Date 2 0
1910 # Date 2 0
1911 # Thu Jan 01 00:00:02 1970 +0000
1871 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1912 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1872 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1913 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1873 b
1914 b
1874
1915
1875 diff -r 8580ff50825a -r 97d72e5f12c7 b
1916 diff -r 8580ff50825a -r 97d72e5f12c7 b
1876 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1917 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1877 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1918 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1878 @@ -0,0 +1,1 @@
1919 @@ -0,0 +1,1 @@
1879 +b
1920 +b
1880
1921
1881
1922
1882 test multiple flags for single patch:
1923 test multiple flags for single patch:
1883 $ hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
1924 $ hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
1884 > -c bar -s test -r 2
1925 > -c bar -s test -r 2
1885 this patch series consists of 1 patches.
1926 this patch series consists of 1 patches.
1886
1927
1887
1928
1888 displaying [PATCH fooFlag barFlag] test ...
1929 displaying [PATCH fooFlag barFlag] test ...
1889 Content-Type: text/plain; charset="us-ascii"
1930 Content-Type: text/plain; charset="us-ascii"
1890 MIME-Version: 1.0
1931 MIME-Version: 1.0
1891 Content-Transfer-Encoding: 7bit
1932 Content-Transfer-Encoding: 7bit
1892 Subject: [PATCH fooFlag barFlag] test
1933 Subject: [PATCH fooFlag barFlag] test
1893 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1934 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1894 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1935 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1895 User-Agent: Mercurial-patchbomb/* (glob)
1936 User-Agent: Mercurial-patchbomb/* (glob)
1896 Date: Thu, 01 Jan 1970 00:01:00 +0000
1937 Date: Thu, 01 Jan 1970 00:01:00 +0000
1897 From: quux
1938 From: quux
1898 To: foo
1939 To: foo
1899 Cc: bar
1940 Cc: bar
1900
1941
1901 # HG changeset patch
1942 # HG changeset patch
1902 # User test
1943 # User test
1903 # Date 3 0
1944 # Date 3 0
1945 # Thu Jan 01 00:00:03 1970 +0000
1904 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1946 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1905 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1947 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1906 c
1948 c
1907
1949
1908 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1950 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1909 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1951 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1910 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1952 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1911 @@ -0,0 +1,1 @@
1953 @@ -0,0 +1,1 @@
1912 +c
1954 +c
1913
1955
1914
1956
1915 test multiple flags for multiple patches:
1957 test multiple flags for multiple patches:
1916 $ hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
1958 $ hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
1917 > -c bar -s test -r 0:1
1959 > -c bar -s test -r 0:1
1918 this patch series consists of 2 patches.
1960 this patch series consists of 2 patches.
1919
1961
1920
1962
1921 Write the introductory message for the patch series.
1963 Write the introductory message for the patch series.
1922
1964
1923
1965
1924 displaying [PATCH 0 of 2 fooFlag barFlag] test ...
1966 displaying [PATCH 0 of 2 fooFlag barFlag] test ...
1925 Content-Type: text/plain; charset="us-ascii"
1967 Content-Type: text/plain; charset="us-ascii"
1926 MIME-Version: 1.0
1968 MIME-Version: 1.0
1927 Content-Transfer-Encoding: 7bit
1969 Content-Transfer-Encoding: 7bit
1928 Subject: [PATCH 0 of 2 fooFlag barFlag] test
1970 Subject: [PATCH 0 of 2 fooFlag barFlag] test
1929 Message-Id: <patchbomb.60@*> (glob)
1971 Message-Id: <patchbomb.60@*> (glob)
1930 User-Agent: Mercurial-patchbomb/* (glob)
1972 User-Agent: Mercurial-patchbomb/* (glob)
1931 Date: Thu, 01 Jan 1970 00:01:00 +0000
1973 Date: Thu, 01 Jan 1970 00:01:00 +0000
1932 From: quux
1974 From: quux
1933 To: foo
1975 To: foo
1934 Cc: bar
1976 Cc: bar
1935
1977
1936
1978
1937 displaying [PATCH 1 of 2 fooFlag barFlag] a ...
1979 displaying [PATCH 1 of 2 fooFlag barFlag] a ...
1938 Content-Type: text/plain; charset="us-ascii"
1980 Content-Type: text/plain; charset="us-ascii"
1939 MIME-Version: 1.0
1981 MIME-Version: 1.0
1940 Content-Transfer-Encoding: 7bit
1982 Content-Transfer-Encoding: 7bit
1941 Subject: [PATCH 1 of 2 fooFlag barFlag] a
1983 Subject: [PATCH 1 of 2 fooFlag barFlag] a
1942 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1984 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1943 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
1985 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
1944 In-Reply-To: <patchbomb.60@*> (glob)
1986 In-Reply-To: <patchbomb.60@*> (glob)
1945 References: <patchbomb.60@*> (glob)
1987 References: <patchbomb.60@*> (glob)
1946 User-Agent: Mercurial-patchbomb/* (glob)
1988 User-Agent: Mercurial-patchbomb/* (glob)
1947 Date: Thu, 01 Jan 1970 00:01:01 +0000
1989 Date: Thu, 01 Jan 1970 00:01:01 +0000
1948 From: quux
1990 From: quux
1949 To: foo
1991 To: foo
1950 Cc: bar
1992 Cc: bar
1951
1993
1952 # HG changeset patch
1994 # HG changeset patch
1953 # User test
1995 # User test
1954 # Date 1 0
1996 # Date 1 0
1997 # Thu Jan 01 00:00:01 1970 +0000
1955 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1998 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1956 # Parent 0000000000000000000000000000000000000000
1999 # Parent 0000000000000000000000000000000000000000
1957 a
2000 a
1958
2001
1959 diff -r 000000000000 -r 8580ff50825a a
2002 diff -r 000000000000 -r 8580ff50825a a
1960 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2003 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1961 +++ b/a Thu Jan 01 00:00:01 1970 +0000
2004 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1962 @@ -0,0 +1,1 @@
2005 @@ -0,0 +1,1 @@
1963 +a
2006 +a
1964
2007
1965 displaying [PATCH 2 of 2 fooFlag barFlag] b ...
2008 displaying [PATCH 2 of 2 fooFlag barFlag] b ...
1966 Content-Type: text/plain; charset="us-ascii"
2009 Content-Type: text/plain; charset="us-ascii"
1967 MIME-Version: 1.0
2010 MIME-Version: 1.0
1968 Content-Transfer-Encoding: 7bit
2011 Content-Transfer-Encoding: 7bit
1969 Subject: [PATCH 2 of 2 fooFlag barFlag] b
2012 Subject: [PATCH 2 of 2 fooFlag barFlag] b
1970 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2013 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1971 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
2014 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
1972 In-Reply-To: <patchbomb.60@*> (glob)
2015 In-Reply-To: <patchbomb.60@*> (glob)
1973 References: <patchbomb.60@*> (glob)
2016 References: <patchbomb.60@*> (glob)
1974 User-Agent: Mercurial-patchbomb/* (glob)
2017 User-Agent: Mercurial-patchbomb/* (glob)
1975 Date: Thu, 01 Jan 1970 00:01:02 +0000
2018 Date: Thu, 01 Jan 1970 00:01:02 +0000
1976 From: quux
2019 From: quux
1977 To: foo
2020 To: foo
1978 Cc: bar
2021 Cc: bar
1979
2022
1980 # HG changeset patch
2023 # HG changeset patch
1981 # User test
2024 # User test
1982 # Date 2 0
2025 # Date 2 0
2026 # Thu Jan 01 00:00:02 1970 +0000
1983 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2027 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1984 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
2028 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1985 b
2029 b
1986
2030
1987 diff -r 8580ff50825a -r 97d72e5f12c7 b
2031 diff -r 8580ff50825a -r 97d72e5f12c7 b
1988 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2032 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1989 +++ b/b Thu Jan 01 00:00:02 1970 +0000
2033 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1990 @@ -0,0 +1,1 @@
2034 @@ -0,0 +1,1 @@
1991 +b
2035 +b
1992
2036
1993
2037
1994 test multi-address parsing:
2038 test multi-address parsing:
1995 $ hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t 'spam<spam><eggs>' \
2039 $ hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t 'spam<spam><eggs>' \
1996 > -t toast -c 'foo,bar@example.com' -c '"A, B <>" <a@example.com>' -s test -r 0 \
2040 > -t toast -c 'foo,bar@example.com' -c '"A, B <>" <a@example.com>' -s test -r 0 \
1997 > --config email.bcc='"Quux, A." <quux>'
2041 > --config email.bcc='"Quux, A." <quux>'
1998 this patch series consists of 1 patches.
2042 this patch series consists of 1 patches.
1999
2043
2000
2044
2001 sending [PATCH] test ...
2045 sending [PATCH] test ...
2002 $ cat < tmp.mbox
2046 $ cat < tmp.mbox
2003 From quux ... ... .. ..:..:.. .... (re)
2047 From quux ... ... .. ..:..:.. .... (re)
2004 Content-Type: text/plain; charset="us-ascii"
2048 Content-Type: text/plain; charset="us-ascii"
2005 MIME-Version: 1.0
2049 MIME-Version: 1.0
2006 Content-Transfer-Encoding: 7bit
2050 Content-Transfer-Encoding: 7bit
2007 Subject: [PATCH] test
2051 Subject: [PATCH] test
2008 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
2052 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
2009 Message-Id: <8580ff50825a50c8f716.315532860@*> (glob)
2053 Message-Id: <8580ff50825a50c8f716.315532860@*> (glob)
2010 User-Agent: Mercurial-patchbomb/* (glob)
2054 User-Agent: Mercurial-patchbomb/* (glob)
2011 Date: Tue, 01 Jan 1980 00:01:00 +0000
2055 Date: Tue, 01 Jan 1980 00:01:00 +0000
2012 From: quux
2056 From: quux
2013 To: spam <spam>, eggs, toast
2057 To: spam <spam>, eggs, toast
2014 Cc: foo, bar@example.com, "A, B <>" <a@example.com>
2058 Cc: foo, bar@example.com, "A, B <>" <a@example.com>
2015 Bcc: "Quux, A." <quux>
2059 Bcc: "Quux, A." <quux>
2016
2060
2017 # HG changeset patch
2061 # HG changeset patch
2018 # User test
2062 # User test
2019 # Date 1 0
2063 # Date 1 0
2064 # Thu Jan 01 00:00:01 1970 +0000
2020 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
2065 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
2021 # Parent 0000000000000000000000000000000000000000
2066 # Parent 0000000000000000000000000000000000000000
2022 a
2067 a
2023
2068
2024 diff -r 000000000000 -r 8580ff50825a a
2069 diff -r 000000000000 -r 8580ff50825a a
2025 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2070 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2026 +++ b/a Thu Jan 01 00:00:01 1970 +0000
2071 +++ b/a Thu Jan 01 00:00:01 1970 +0000
2027 @@ -0,0 +1,1 @@
2072 @@ -0,0 +1,1 @@
2028 +a
2073 +a
2029
2074
2030
2075
2031
2076
2032 test multi-byte domain parsing:
2077 test multi-byte domain parsing:
2033 $ UUML=`python -c 'import sys; sys.stdout.write("\374")'`
2078 $ UUML=`python -c 'import sys; sys.stdout.write("\374")'`
2034 $ HGENCODING=iso-8859-1
2079 $ HGENCODING=iso-8859-1
2035 $ export HGENCODING
2080 $ export HGENCODING
2036 $ hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t "bar@${UUML}nicode.com" -s test -r 0
2081 $ hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t "bar@${UUML}nicode.com" -s test -r 0
2037 this patch series consists of 1 patches.
2082 this patch series consists of 1 patches.
2038
2083
2039 Cc:
2084 Cc:
2040
2085
2041 sending [PATCH] test ...
2086 sending [PATCH] test ...
2042
2087
2043 $ cat tmp.mbox
2088 $ cat tmp.mbox
2044 From quux ... ... .. ..:..:.. .... (re)
2089 From quux ... ... .. ..:..:.. .... (re)
2045 Content-Type: text/plain; charset="us-ascii"
2090 Content-Type: text/plain; charset="us-ascii"
2046 MIME-Version: 1.0
2091 MIME-Version: 1.0
2047 Content-Transfer-Encoding: 7bit
2092 Content-Transfer-Encoding: 7bit
2048 Subject: [PATCH] test
2093 Subject: [PATCH] test
2049 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
2094 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
2050 Message-Id: <8580ff50825a50c8f716.315532860@*> (glob)
2095 Message-Id: <8580ff50825a50c8f716.315532860@*> (glob)
2051 User-Agent: Mercurial-patchbomb/* (glob)
2096 User-Agent: Mercurial-patchbomb/* (glob)
2052 Date: Tue, 01 Jan 1980 00:01:00 +0000
2097 Date: Tue, 01 Jan 1980 00:01:00 +0000
2053 From: quux
2098 From: quux
2054 To: bar@xn--nicode-2ya.com
2099 To: bar@xn--nicode-2ya.com
2055
2100
2056 # HG changeset patch
2101 # HG changeset patch
2057 # User test
2102 # User test
2058 # Date 1 0
2103 # Date 1 0
2104 # Thu Jan 01 00:00:01 1970 +0000
2059 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
2105 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
2060 # Parent 0000000000000000000000000000000000000000
2106 # Parent 0000000000000000000000000000000000000000
2061 a
2107 a
2062
2108
2063 diff -r 000000000000 -r 8580ff50825a a
2109 diff -r 000000000000 -r 8580ff50825a a
2064 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2110 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2065 +++ b/a Thu Jan 01 00:00:01 1970 +0000
2111 +++ b/a Thu Jan 01 00:00:01 1970 +0000
2066 @@ -0,0 +1,1 @@
2112 @@ -0,0 +1,1 @@
2067 +a
2113 +a
2068
2114
2069
2115
2070
2116
2071 test outgoing:
2117 test outgoing:
2072 $ hg up 1
2118 $ hg up 1
2073 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
2119 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
2074
2120
2075 $ hg branch test
2121 $ hg branch test
2076 marked working directory as branch test
2122 marked working directory as branch test
2077 (branches are permanent and global, did you want a bookmark?)
2123 (branches are permanent and global, did you want a bookmark?)
2078
2124
2079 $ echo d > d
2125 $ echo d > d
2080 $ hg add d
2126 $ hg add d
2081 $ hg ci -md -d '4 0'
2127 $ hg ci -md -d '4 0'
2082 $ echo d >> d
2128 $ echo d >> d
2083 $ hg ci -mdd -d '5 0'
2129 $ hg ci -mdd -d '5 0'
2084 $ hg --config extensions.graphlog= glog --template "{rev}:{node|short} {desc|firstline}\n"
2130 $ hg --config extensions.graphlog= glog --template "{rev}:{node|short} {desc|firstline}\n"
2085 @ 10:3b6f1ec9dde9 dd
2131 @ 10:3b6f1ec9dde9 dd
2086 |
2132 |
2087 o 9:2f9fa9b998c5 d
2133 o 9:2f9fa9b998c5 d
2088 |
2134 |
2089 | o 8:7aead2484924 Added tag two, two.diff for changeset ff2c9fa2018b
2135 | o 8:7aead2484924 Added tag two, two.diff for changeset ff2c9fa2018b
2090 | |
2136 | |
2091 | o 7:045ca29b1ea2 Added tag one, one.patch for changeset 97d72e5f12c7
2137 | o 7:045ca29b1ea2 Added tag one, one.patch for changeset 97d72e5f12c7
2092 | |
2138 | |
2093 | o 6:5d5ef15dfe5e Added tag zero, zero.foo for changeset 8580ff50825a
2139 | o 6:5d5ef15dfe5e Added tag zero, zero.foo for changeset 8580ff50825a
2094 | |
2140 | |
2095 | o 5:240fb913fc1b isolatin 8-bit encoding
2141 | o 5:240fb913fc1b isolatin 8-bit encoding
2096 | |
2142 | |
2097 | o 4:a2ea8fc83dd8 long line
2143 | o 4:a2ea8fc83dd8 long line
2098 | |
2144 | |
2099 | o 3:909a00e13e9d utf-8 content
2145 | o 3:909a00e13e9d utf-8 content
2100 | |
2146 | |
2101 | o 2:ff2c9fa2018b c
2147 | o 2:ff2c9fa2018b c
2102 |/
2148 |/
2103 o 1:97d72e5f12c7 b
2149 o 1:97d72e5f12c7 b
2104 |
2150 |
2105 o 0:8580ff50825a a
2151 o 0:8580ff50825a a
2106
2152
2107 $ hg phase --force --secret -r 10
2153 $ hg phase --force --secret -r 10
2108 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t -r 'rev(10) or rev(6)'
2154 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t -r 'rev(10) or rev(6)'
2109 comparing with ../t
2155 comparing with ../t
2110 From [test]: test
2156 From [test]: test
2111 this patch series consists of 6 patches.
2157 this patch series consists of 6 patches.
2112
2158
2113
2159
2114 Write the introductory message for the patch series.
2160 Write the introductory message for the patch series.
2115
2161
2116 Cc:
2162 Cc:
2117
2163
2118 displaying [PATCH 0 of 6] test ...
2164 displaying [PATCH 0 of 6] test ...
2119 Content-Type: text/plain; charset="us-ascii"
2165 Content-Type: text/plain; charset="us-ascii"
2120 MIME-Version: 1.0
2166 MIME-Version: 1.0
2121 Content-Transfer-Encoding: 7bit
2167 Content-Transfer-Encoding: 7bit
2122 Subject: [PATCH 0 of 6] test
2168 Subject: [PATCH 0 of 6] test
2123 Message-Id: <patchbomb.315532860@*> (glob)
2169 Message-Id: <patchbomb.315532860@*> (glob)
2124 User-Agent: Mercurial-patchbomb/* (glob)
2170 User-Agent: Mercurial-patchbomb/* (glob)
2125 Date: Tue, 01 Jan 1980 00:01:00 +0000
2171 Date: Tue, 01 Jan 1980 00:01:00 +0000
2126 From: test
2172 From: test
2127 To: foo
2173 To: foo
2128
2174
2129
2175
2130 displaying [PATCH 1 of 6] c ...
2176 displaying [PATCH 1 of 6] c ...
2131 Content-Type: text/plain; charset="us-ascii"
2177 Content-Type: text/plain; charset="us-ascii"
2132 MIME-Version: 1.0
2178 MIME-Version: 1.0
2133 Content-Transfer-Encoding: 7bit
2179 Content-Transfer-Encoding: 7bit
2134 Subject: [PATCH 1 of 6] c
2180 Subject: [PATCH 1 of 6] c
2135 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
2181 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
2136 Message-Id: <ff2c9fa2018b15fa74b3.315532861@*> (glob)
2182 Message-Id: <ff2c9fa2018b15fa74b3.315532861@*> (glob)
2137 In-Reply-To: <patchbomb.315532860@*> (glob)
2183 In-Reply-To: <patchbomb.315532860@*> (glob)
2138 References: <patchbomb.315532860@*> (glob)
2184 References: <patchbomb.315532860@*> (glob)
2139 User-Agent: Mercurial-patchbomb/* (glob)
2185 User-Agent: Mercurial-patchbomb/* (glob)
2140 Date: Tue, 01 Jan 1980 00:01:01 +0000
2186 Date: Tue, 01 Jan 1980 00:01:01 +0000
2141 From: test
2187 From: test
2142 To: foo
2188 To: foo
2143
2189
2144 # HG changeset patch
2190 # HG changeset patch
2145 # User test
2191 # User test
2146 # Date 3 0
2192 # Date 3 0
2193 # Thu Jan 01 00:00:03 1970 +0000
2147 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
2194 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
2148 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2195 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2149 c
2196 c
2150
2197
2151 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
2198 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
2152 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2199 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2153 +++ b/c Thu Jan 01 00:00:03 1970 +0000
2200 +++ b/c Thu Jan 01 00:00:03 1970 +0000
2154 @@ -0,0 +1,1 @@
2201 @@ -0,0 +1,1 @@
2155 +c
2202 +c
2156
2203
2157 displaying [PATCH 2 of 6] utf-8 content ...
2204 displaying [PATCH 2 of 6] utf-8 content ...
2158 Content-Type: text/plain; charset="us-ascii"
2205 Content-Type: text/plain; charset="us-ascii"
2159 MIME-Version: 1.0
2206 MIME-Version: 1.0
2160 Content-Transfer-Encoding: 8bit
2207 Content-Transfer-Encoding: 8bit
2161 Subject: [PATCH 2 of 6] utf-8 content
2208 Subject: [PATCH 2 of 6] utf-8 content
2162 X-Mercurial-Node: 909a00e13e9d78b575aeee23dddbada46d5a143f
2209 X-Mercurial-Node: 909a00e13e9d78b575aeee23dddbada46d5a143f
2163 Message-Id: <909a00e13e9d78b575ae.315532862@*> (glob)
2210 Message-Id: <909a00e13e9d78b575ae.315532862@*> (glob)
2164 In-Reply-To: <patchbomb.315532860@*> (glob)
2211 In-Reply-To: <patchbomb.315532860@*> (glob)
2165 References: <patchbomb.315532860@*> (glob)
2212 References: <patchbomb.315532860@*> (glob)
2166 User-Agent: Mercurial-patchbomb/* (glob)
2213 User-Agent: Mercurial-patchbomb/* (glob)
2167 Date: Tue, 01 Jan 1980 00:01:02 +0000
2214 Date: Tue, 01 Jan 1980 00:01:02 +0000
2168 From: test
2215 From: test
2169 To: foo
2216 To: foo
2170
2217
2171 # HG changeset patch
2218 # HG changeset patch
2172 # User test
2219 # User test
2173 # Date 4 0
2220 # Date 4 0
2221 # Thu Jan 01 00:00:04 1970 +0000
2174 # Node ID 909a00e13e9d78b575aeee23dddbada46d5a143f
2222 # Node ID 909a00e13e9d78b575aeee23dddbada46d5a143f
2175 # Parent ff2c9fa2018b15fa74b33363bda9527323e2a99f
2223 # Parent ff2c9fa2018b15fa74b33363bda9527323e2a99f
2176 utf-8 content
2224 utf-8 content
2177
2225
2178 diff -r ff2c9fa2018b -r 909a00e13e9d description
2226 diff -r ff2c9fa2018b -r 909a00e13e9d description
2179 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2227 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2180 +++ b/description Thu Jan 01 00:00:04 1970 +0000
2228 +++ b/description Thu Jan 01 00:00:04 1970 +0000
2181 @@ -0,0 +1,3 @@
2229 @@ -0,0 +1,3 @@
2182 +a multiline
2230 +a multiline
2183 +
2231 +
2184 +description
2232 +description
2185 diff -r ff2c9fa2018b -r 909a00e13e9d utf
2233 diff -r ff2c9fa2018b -r 909a00e13e9d utf
2186 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2234 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2187 +++ b/utf Thu Jan 01 00:00:04 1970 +0000
2235 +++ b/utf Thu Jan 01 00:00:04 1970 +0000
2188 @@ -0,0 +1,1 @@
2236 @@ -0,0 +1,1 @@
2189 +h\xc3\xb6mma! (esc)
2237 +h\xc3\xb6mma! (esc)
2190
2238
2191 displaying [PATCH 3 of 6] long line ...
2239 displaying [PATCH 3 of 6] long line ...
2192 Content-Type: text/plain; charset="us-ascii"
2240 Content-Type: text/plain; charset="us-ascii"
2193 MIME-Version: 1.0
2241 MIME-Version: 1.0
2194 Content-Transfer-Encoding: quoted-printable
2242 Content-Transfer-Encoding: quoted-printable
2195 Subject: [PATCH 3 of 6] long line
2243 Subject: [PATCH 3 of 6] long line
2196 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
2244 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
2197 Message-Id: <a2ea8fc83dd8b93cfd86.315532863@*> (glob)
2245 Message-Id: <a2ea8fc83dd8b93cfd86.315532863@*> (glob)
2198 In-Reply-To: <patchbomb.315532860@*> (glob)
2246 In-Reply-To: <patchbomb.315532860@*> (glob)
2199 References: <patchbomb.315532860@*> (glob)
2247 References: <patchbomb.315532860@*> (glob)
2200 User-Agent: Mercurial-patchbomb/* (glob)
2248 User-Agent: Mercurial-patchbomb/* (glob)
2201 Date: Tue, 01 Jan 1980 00:01:03 +0000
2249 Date: Tue, 01 Jan 1980 00:01:03 +0000
2202 From: test
2250 From: test
2203 To: foo
2251 To: foo
2204
2252
2205 # HG changeset patch
2253 # HG changeset patch
2206 # User test
2254 # User test
2207 # Date 4 0
2255 # Date 4 0
2256 # Thu Jan 01 00:00:04 1970 +0000
2208 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
2257 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
2209 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
2258 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
2210 long line
2259 long line
2211
2260
2212 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
2261 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
2213 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2262 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2214 +++ b/long Thu Jan 01 00:00:04 1970 +0000
2263 +++ b/long Thu Jan 01 00:00:04 1970 +0000
2215 @@ -0,0 +1,4 @@
2264 @@ -0,0 +1,4 @@
2216 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2265 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2217 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2266 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2218 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2267 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2219 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2268 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2220 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2269 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2221 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2270 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2222 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2271 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2223 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2272 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2224 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2273 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2225 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2274 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2226 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2275 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2227 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2276 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2228 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2277 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2229 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2278 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2230 +foo
2279 +foo
2231 +
2280 +
2232 +bar
2281 +bar
2233
2282
2234 displaying [PATCH 4 of 6] isolatin 8-bit encoding ...
2283 displaying [PATCH 4 of 6] isolatin 8-bit encoding ...
2235 Content-Type: text/plain; charset="us-ascii"
2284 Content-Type: text/plain; charset="us-ascii"
2236 MIME-Version: 1.0
2285 MIME-Version: 1.0
2237 Content-Transfer-Encoding: 8bit
2286 Content-Transfer-Encoding: 8bit
2238 Subject: [PATCH 4 of 6] isolatin 8-bit encoding
2287 Subject: [PATCH 4 of 6] isolatin 8-bit encoding
2239 X-Mercurial-Node: 240fb913fc1b7ff15ddb9f33e73d82bf5277c720
2288 X-Mercurial-Node: 240fb913fc1b7ff15ddb9f33e73d82bf5277c720
2240 Message-Id: <240fb913fc1b7ff15ddb.315532864@*> (glob)
2289 Message-Id: <240fb913fc1b7ff15ddb.315532864@*> (glob)
2241 In-Reply-To: <patchbomb.315532860@*> (glob)
2290 In-Reply-To: <patchbomb.315532860@*> (glob)
2242 References: <patchbomb.315532860@*> (glob)
2291 References: <patchbomb.315532860@*> (glob)
2243 User-Agent: Mercurial-patchbomb/* (glob)
2292 User-Agent: Mercurial-patchbomb/* (glob)
2244 Date: Tue, 01 Jan 1980 00:01:04 +0000
2293 Date: Tue, 01 Jan 1980 00:01:04 +0000
2245 From: test
2294 From: test
2246 To: foo
2295 To: foo
2247
2296
2248 # HG changeset patch
2297 # HG changeset patch
2249 # User test
2298 # User test
2250 # Date 5 0
2299 # Date 5 0
2300 # Thu Jan 01 00:00:05 1970 +0000
2251 # Node ID 240fb913fc1b7ff15ddb9f33e73d82bf5277c720
2301 # Node ID 240fb913fc1b7ff15ddb9f33e73d82bf5277c720
2252 # Parent a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
2302 # Parent a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
2253 isolatin 8-bit encoding
2303 isolatin 8-bit encoding
2254
2304
2255 diff -r a2ea8fc83dd8 -r 240fb913fc1b isolatin
2305 diff -r a2ea8fc83dd8 -r 240fb913fc1b isolatin
2256 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2306 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2257 +++ b/isolatin Thu Jan 01 00:00:05 1970 +0000
2307 +++ b/isolatin Thu Jan 01 00:00:05 1970 +0000
2258 @@ -0,0 +1,1 @@
2308 @@ -0,0 +1,1 @@
2259 +h\xf6mma! (esc)
2309 +h\xf6mma! (esc)
2260
2310
2261 displaying [PATCH 5 of 6] Added tag zero, zero.foo for changeset 8580ff50825a ...
2311 displaying [PATCH 5 of 6] Added tag zero, zero.foo for changeset 8580ff50825a ...
2262 Content-Type: text/plain; charset="us-ascii"
2312 Content-Type: text/plain; charset="us-ascii"
2263 MIME-Version: 1.0
2313 MIME-Version: 1.0
2264 Content-Transfer-Encoding: 7bit
2314 Content-Transfer-Encoding: 7bit
2265 Subject: [PATCH 5 of 6] Added tag zero, zero.foo for changeset 8580ff50825a
2315 Subject: [PATCH 5 of 6] Added tag zero, zero.foo for changeset 8580ff50825a
2266 X-Mercurial-Node: 5d5ef15dfe5e7bd3a4ee154b5fff76c7945ec433
2316 X-Mercurial-Node: 5d5ef15dfe5e7bd3a4ee154b5fff76c7945ec433
2267 Message-Id: <5d5ef15dfe5e7bd3a4ee.315532865@*> (glob)
2317 Message-Id: <5d5ef15dfe5e7bd3a4ee.315532865@*> (glob)
2268 In-Reply-To: <patchbomb.315532860@*> (glob)
2318 In-Reply-To: <patchbomb.315532860@*> (glob)
2269 References: <patchbomb.315532860@*> (glob)
2319 References: <patchbomb.315532860@*> (glob)
2270 User-Agent: Mercurial-patchbomb/* (glob)
2320 User-Agent: Mercurial-patchbomb/* (glob)
2271 Date: Tue, 01 Jan 1980 00:01:05 +0000
2321 Date: Tue, 01 Jan 1980 00:01:05 +0000
2272 From: test
2322 From: test
2273 To: foo
2323 To: foo
2274
2324
2275 # HG changeset patch
2325 # HG changeset patch
2276 # User test
2326 # User test
2277 # Date 0 0
2327 # Date 0 0
2328 # Thu Jan 01 00:00:00 1970 +0000
2278 # Node ID 5d5ef15dfe5e7bd3a4ee154b5fff76c7945ec433
2329 # Node ID 5d5ef15dfe5e7bd3a4ee154b5fff76c7945ec433
2279 # Parent 240fb913fc1b7ff15ddb9f33e73d82bf5277c720
2330 # Parent 240fb913fc1b7ff15ddb9f33e73d82bf5277c720
2280 Added tag zero, zero.foo for changeset 8580ff50825a
2331 Added tag zero, zero.foo for changeset 8580ff50825a
2281
2332
2282 diff -r 240fb913fc1b -r 5d5ef15dfe5e .hgtags
2333 diff -r 240fb913fc1b -r 5d5ef15dfe5e .hgtags
2283 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2334 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2284 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
2335 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
2285 @@ -0,0 +1,2 @@
2336 @@ -0,0 +1,2 @@
2286 +8580ff50825a50c8f716709acdf8de0deddcd6ab zero
2337 +8580ff50825a50c8f716709acdf8de0deddcd6ab zero
2287 +8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
2338 +8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
2288
2339
2289 displaying [PATCH 6 of 6] d ...
2340 displaying [PATCH 6 of 6] d ...
2290 Content-Type: text/plain; charset="us-ascii"
2341 Content-Type: text/plain; charset="us-ascii"
2291 MIME-Version: 1.0
2342 MIME-Version: 1.0
2292 Content-Transfer-Encoding: 7bit
2343 Content-Transfer-Encoding: 7bit
2293 Subject: [PATCH 6 of 6] d
2344 Subject: [PATCH 6 of 6] d
2294 X-Mercurial-Node: 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
2345 X-Mercurial-Node: 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
2295 Message-Id: <2f9fa9b998c5fe3ac2bd.315532866@*> (glob)
2346 Message-Id: <2f9fa9b998c5fe3ac2bd.315532866@*> (glob)
2296 In-Reply-To: <patchbomb.315532860@*> (glob)
2347 In-Reply-To: <patchbomb.315532860@*> (glob)
2297 References: <patchbomb.315532860@*> (glob)
2348 References: <patchbomb.315532860@*> (glob)
2298 User-Agent: Mercurial-patchbomb/* (glob)
2349 User-Agent: Mercurial-patchbomb/* (glob)
2299 Date: Tue, 01 Jan 1980 00:01:06 +0000
2350 Date: Tue, 01 Jan 1980 00:01:06 +0000
2300 From: test
2351 From: test
2301 To: foo
2352 To: foo
2302
2353
2303 # HG changeset patch
2354 # HG changeset patch
2304 # User test
2355 # User test
2305 # Date 4 0
2356 # Date 4 0
2357 # Thu Jan 01 00:00:04 1970 +0000
2306 # Branch test
2358 # Branch test
2307 # Node ID 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
2359 # Node ID 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
2308 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2360 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2309 d
2361 d
2310
2362
2311 diff -r 97d72e5f12c7 -r 2f9fa9b998c5 d
2363 diff -r 97d72e5f12c7 -r 2f9fa9b998c5 d
2312 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2364 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2313 +++ b/d Thu Jan 01 00:00:04 1970 +0000
2365 +++ b/d Thu Jan 01 00:00:04 1970 +0000
2314 @@ -0,0 +1,1 @@
2366 @@ -0,0 +1,1 @@
2315 +d
2367 +d
2316
2368
2317
2369
2318 dest#branch URIs:
2370 dest#branch URIs:
2319 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t#test
2371 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t#test
2320 comparing with ../t
2372 comparing with ../t
2321 From [test]: test
2373 From [test]: test
2322 this patch series consists of 1 patches.
2374 this patch series consists of 1 patches.
2323
2375
2324 Cc:
2376 Cc:
2325
2377
2326 displaying [PATCH] test ...
2378 displaying [PATCH] test ...
2327 Content-Type: text/plain; charset="us-ascii"
2379 Content-Type: text/plain; charset="us-ascii"
2328 MIME-Version: 1.0
2380 MIME-Version: 1.0
2329 Content-Transfer-Encoding: 7bit
2381 Content-Transfer-Encoding: 7bit
2330 Subject: [PATCH] test
2382 Subject: [PATCH] test
2331 X-Mercurial-Node: 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
2383 X-Mercurial-Node: 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
2332 Message-Id: <2f9fa9b998c5fe3ac2bd.315532860@*> (glob)
2384 Message-Id: <2f9fa9b998c5fe3ac2bd.315532860@*> (glob)
2333 User-Agent: Mercurial-patchbomb/* (glob)
2385 User-Agent: Mercurial-patchbomb/* (glob)
2334 Date: Tue, 01 Jan 1980 00:01:00 +0000
2386 Date: Tue, 01 Jan 1980 00:01:00 +0000
2335 From: test
2387 From: test
2336 To: foo
2388 To: foo
2337
2389
2338 # HG changeset patch
2390 # HG changeset patch
2339 # User test
2391 # User test
2340 # Date 4 0
2392 # Date 4 0
2393 # Thu Jan 01 00:00:04 1970 +0000
2341 # Branch test
2394 # Branch test
2342 # Node ID 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
2395 # Node ID 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
2343 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2396 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2344 d
2397 d
2345
2398
2346 diff -r 97d72e5f12c7 -r 2f9fa9b998c5 d
2399 diff -r 97d72e5f12c7 -r 2f9fa9b998c5 d
2347 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2400 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2348 +++ b/d Thu Jan 01 00:00:04 1970 +0000
2401 +++ b/d Thu Jan 01 00:00:04 1970 +0000
2349 @@ -0,0 +1,1 @@
2402 @@ -0,0 +1,1 @@
2350 +d
2403 +d
2351
2404
2352
2405
2353 $ cd ..
2406 $ cd ..
@@ -1,723 +1,724 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > graphlog=
3 > graphlog=
4 > rebase=
4 > rebase=
5 > mq=
5 > mq=
6 >
6 >
7 > [phases]
7 > [phases]
8 > publish=False
8 > publish=False
9 >
9 >
10 > [alias]
10 > [alias]
11 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
11 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
12 > tglogp = log -G --template "{rev}:{phase} '{desc}' {branches}\n"
12 > tglogp = log -G --template "{rev}:{phase} '{desc}' {branches}\n"
13 > EOF
13 > EOF
14
14
15 Create repo a:
15 Create repo a:
16
16
17 $ hg init a
17 $ hg init a
18 $ cd a
18 $ cd a
19 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
19 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
20 adding changesets
20 adding changesets
21 adding manifests
21 adding manifests
22 adding file changes
22 adding file changes
23 added 8 changesets with 7 changes to 7 files (+2 heads)
23 added 8 changesets with 7 changes to 7 files (+2 heads)
24 (run 'hg heads' to see heads, 'hg merge' to merge)
24 (run 'hg heads' to see heads, 'hg merge' to merge)
25 $ hg up tip
25 $ hg up tip
26 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
27
27
28 $ hg tglog
28 $ hg tglog
29 @ 7: 'H'
29 @ 7: 'H'
30 |
30 |
31 | o 6: 'G'
31 | o 6: 'G'
32 |/|
32 |/|
33 o | 5: 'F'
33 o | 5: 'F'
34 | |
34 | |
35 | o 4: 'E'
35 | o 4: 'E'
36 |/
36 |/
37 | o 3: 'D'
37 | o 3: 'D'
38 | |
38 | |
39 | o 2: 'C'
39 | o 2: 'C'
40 | |
40 | |
41 | o 1: 'B'
41 | o 1: 'B'
42 |/
42 |/
43 o 0: 'A'
43 o 0: 'A'
44
44
45 $ cd ..
45 $ cd ..
46
46
47
47
48 Rebasing B onto H and collapsing changesets with different phases:
48 Rebasing B onto H and collapsing changesets with different phases:
49
49
50
50
51 $ hg clone -q -u 3 a a1
51 $ hg clone -q -u 3 a a1
52 $ cd a1
52 $ cd a1
53
53
54 $ hg phase --force --secret 3
54 $ hg phase --force --secret 3
55
55
56 $ hg rebase --collapse --keepbranches
56 $ hg rebase --collapse --keepbranches
57 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
57 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
58
58
59 $ hg tglogp
59 $ hg tglogp
60 @ 5:secret 'Collapsed revision
60 @ 5:secret 'Collapsed revision
61 | * B
61 | * B
62 | * C
62 | * C
63 | * D'
63 | * D'
64 o 4:draft 'H'
64 o 4:draft 'H'
65 |
65 |
66 | o 3:draft 'G'
66 | o 3:draft 'G'
67 |/|
67 |/|
68 o | 2:draft 'F'
68 o | 2:draft 'F'
69 | |
69 | |
70 | o 1:draft 'E'
70 | o 1:draft 'E'
71 |/
71 |/
72 o 0:draft 'A'
72 o 0:draft 'A'
73
73
74 $ hg manifest
74 $ hg manifest
75 A
75 A
76 B
76 B
77 C
77 C
78 D
78 D
79 F
79 F
80 H
80 H
81
81
82 $ cd ..
82 $ cd ..
83
83
84
84
85 Rebasing E onto H:
85 Rebasing E onto H:
86
86
87 $ hg clone -q -u . a a2
87 $ hg clone -q -u . a a2
88 $ cd a2
88 $ cd a2
89
89
90 $ hg phase --force --secret 6
90 $ hg phase --force --secret 6
91 $ hg rebase --source 4 --collapse
91 $ hg rebase --source 4 --collapse
92 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
92 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
93
93
94 $ hg tglog
94 $ hg tglog
95 @ 6: 'Collapsed revision
95 @ 6: 'Collapsed revision
96 | * E
96 | * E
97 | * G'
97 | * G'
98 o 5: 'H'
98 o 5: 'H'
99 |
99 |
100 o 4: 'F'
100 o 4: 'F'
101 |
101 |
102 | o 3: 'D'
102 | o 3: 'D'
103 | |
103 | |
104 | o 2: 'C'
104 | o 2: 'C'
105 | |
105 | |
106 | o 1: 'B'
106 | o 1: 'B'
107 |/
107 |/
108 o 0: 'A'
108 o 0: 'A'
109
109
110 $ hg manifest
110 $ hg manifest
111 A
111 A
112 E
112 E
113 F
113 F
114 H
114 H
115
115
116 $ cd ..
116 $ cd ..
117
117
118 Rebasing G onto H with custom message:
118 Rebasing G onto H with custom message:
119
119
120 $ hg clone -q -u . a a3
120 $ hg clone -q -u . a a3
121 $ cd a3
121 $ cd a3
122
122
123 $ hg rebase --base 6 -m 'custom message'
123 $ hg rebase --base 6 -m 'custom message'
124 abort: message can only be specified with collapse
124 abort: message can only be specified with collapse
125 [255]
125 [255]
126
126
127 $ hg rebase --source 4 --collapse -m 'custom message'
127 $ hg rebase --source 4 --collapse -m 'custom message'
128 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
128 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
129
129
130 $ hg tglog
130 $ hg tglog
131 @ 6: 'custom message'
131 @ 6: 'custom message'
132 |
132 |
133 o 5: 'H'
133 o 5: 'H'
134 |
134 |
135 o 4: 'F'
135 o 4: 'F'
136 |
136 |
137 | o 3: 'D'
137 | o 3: 'D'
138 | |
138 | |
139 | o 2: 'C'
139 | o 2: 'C'
140 | |
140 | |
141 | o 1: 'B'
141 | o 1: 'B'
142 |/
142 |/
143 o 0: 'A'
143 o 0: 'A'
144
144
145 $ hg manifest
145 $ hg manifest
146 A
146 A
147 E
147 E
148 F
148 F
149 H
149 H
150
150
151 $ cd ..
151 $ cd ..
152
152
153 Create repo b:
153 Create repo b:
154
154
155 $ hg init b
155 $ hg init b
156 $ cd b
156 $ cd b
157
157
158 $ echo A > A
158 $ echo A > A
159 $ hg ci -Am A
159 $ hg ci -Am A
160 adding A
160 adding A
161 $ echo B > B
161 $ echo B > B
162 $ hg ci -Am B
162 $ hg ci -Am B
163 adding B
163 adding B
164
164
165 $ hg up -q 0
165 $ hg up -q 0
166
166
167 $ echo C > C
167 $ echo C > C
168 $ hg ci -Am C
168 $ hg ci -Am C
169 adding C
169 adding C
170 created new head
170 created new head
171
171
172 $ hg merge
172 $ hg merge
173 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
173 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
174 (branch merge, don't forget to commit)
174 (branch merge, don't forget to commit)
175
175
176 $ echo D > D
176 $ echo D > D
177 $ hg ci -Am D
177 $ hg ci -Am D
178 adding D
178 adding D
179
179
180 $ hg up -q 1
180 $ hg up -q 1
181
181
182 $ echo E > E
182 $ echo E > E
183 $ hg ci -Am E
183 $ hg ci -Am E
184 adding E
184 adding E
185 created new head
185 created new head
186
186
187 $ echo F > F
187 $ echo F > F
188 $ hg ci -Am F
188 $ hg ci -Am F
189 adding F
189 adding F
190
190
191 $ hg merge
191 $ hg merge
192 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
192 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 (branch merge, don't forget to commit)
193 (branch merge, don't forget to commit)
194 $ hg ci -m G
194 $ hg ci -m G
195
195
196 $ hg up -q 0
196 $ hg up -q 0
197
197
198 $ echo H > H
198 $ echo H > H
199 $ hg ci -Am H
199 $ hg ci -Am H
200 adding H
200 adding H
201 created new head
201 created new head
202
202
203 $ hg tglog
203 $ hg tglog
204 @ 7: 'H'
204 @ 7: 'H'
205 |
205 |
206 | o 6: 'G'
206 | o 6: 'G'
207 | |\
207 | |\
208 | | o 5: 'F'
208 | | o 5: 'F'
209 | | |
209 | | |
210 | | o 4: 'E'
210 | | o 4: 'E'
211 | | |
211 | | |
212 | o | 3: 'D'
212 | o | 3: 'D'
213 | |\|
213 | |\|
214 | o | 2: 'C'
214 | o | 2: 'C'
215 |/ /
215 |/ /
216 | o 1: 'B'
216 | o 1: 'B'
217 |/
217 |/
218 o 0: 'A'
218 o 0: 'A'
219
219
220 $ cd ..
220 $ cd ..
221
221
222
222
223 Rebase and collapse - more than one external (fail):
223 Rebase and collapse - more than one external (fail):
224
224
225 $ hg clone -q -u . b b1
225 $ hg clone -q -u . b b1
226 $ cd b1
226 $ cd b1
227
227
228 $ hg rebase -s 2 --collapse
228 $ hg rebase -s 2 --collapse
229 abort: unable to collapse, there is more than one external parent
229 abort: unable to collapse, there is more than one external parent
230 [255]
230 [255]
231
231
232 Rebase and collapse - E onto H:
232 Rebase and collapse - E onto H:
233
233
234 $ hg rebase -s 4 --collapse # root (4) is not a merge
234 $ hg rebase -s 4 --collapse # root (4) is not a merge
235 saved backup bundle to $TESTTMP/b1/.hg/strip-backup/*-backup.hg (glob)
235 saved backup bundle to $TESTTMP/b1/.hg/strip-backup/*-backup.hg (glob)
236
236
237 $ hg tglog
237 $ hg tglog
238 @ 5: 'Collapsed revision
238 @ 5: 'Collapsed revision
239 |\ * E
239 |\ * E
240 | | * F
240 | | * F
241 | | * G'
241 | | * G'
242 | o 4: 'H'
242 | o 4: 'H'
243 | |
243 | |
244 o | 3: 'D'
244 o | 3: 'D'
245 |\ \
245 |\ \
246 | o | 2: 'C'
246 | o | 2: 'C'
247 | |/
247 | |/
248 o / 1: 'B'
248 o / 1: 'B'
249 |/
249 |/
250 o 0: 'A'
250 o 0: 'A'
251
251
252 $ hg manifest
252 $ hg manifest
253 A
253 A
254 C
254 C
255 D
255 D
256 E
256 E
257 F
257 F
258 H
258 H
259
259
260 $ cd ..
260 $ cd ..
261
261
262
262
263
263
264
264
265 Test that branchheads cache is updated correctly when doing a strip in which
265 Test that branchheads cache is updated correctly when doing a strip in which
266 the parent of the ancestor node to be stripped does not become a head and also,
266 the parent of the ancestor node to be stripped does not become a head and also,
267 the parent of a node that is a child of the node stripped becomes a head (node
267 the parent of a node that is a child of the node stripped becomes a head (node
268 3). The code is now much simpler and we could just test a simpler scenario
268 3). The code is now much simpler and we could just test a simpler scenario
269 We keep it the test this way in case new complexity is injected.
269 We keep it the test this way in case new complexity is injected.
270
270
271 $ hg clone -q -u . b b2
271 $ hg clone -q -u . b b2
272 $ cd b2
272 $ cd b2
273
273
274 $ hg heads --template="{rev}:{node} {branch}\n"
274 $ hg heads --template="{rev}:{node} {branch}\n"
275 7:c65502d4178782309ce0574c5ae6ee9485a9bafa default
275 7:c65502d4178782309ce0574c5ae6ee9485a9bafa default
276 6:c772a8b2dc17629cec88a19d09c926c4814b12c7 default
276 6:c772a8b2dc17629cec88a19d09c926c4814b12c7 default
277
277
278 $ cat $TESTTMP/b2/.hg/cache/branchheads-served
278 $ cat $TESTTMP/b2/.hg/cache/branchheads-served
279 c65502d4178782309ce0574c5ae6ee9485a9bafa 7
279 c65502d4178782309ce0574c5ae6ee9485a9bafa 7
280 c772a8b2dc17629cec88a19d09c926c4814b12c7 default
280 c772a8b2dc17629cec88a19d09c926c4814b12c7 default
281 c65502d4178782309ce0574c5ae6ee9485a9bafa default
281 c65502d4178782309ce0574c5ae6ee9485a9bafa default
282
282
283 $ hg strip 4
283 $ hg strip 4
284 saved backup bundle to $TESTTMP/b2/.hg/strip-backup/8a5212ebc852-backup.hg (glob)
284 saved backup bundle to $TESTTMP/b2/.hg/strip-backup/8a5212ebc852-backup.hg (glob)
285
285
286 $ cat $TESTTMP/b2/.hg/cache/branchheads-served
286 $ cat $TESTTMP/b2/.hg/cache/branchheads-served
287 c65502d4178782309ce0574c5ae6ee9485a9bafa 4
287 c65502d4178782309ce0574c5ae6ee9485a9bafa 4
288 2870ad076e541e714f3c2bc32826b5c6a6e5b040 default
288 2870ad076e541e714f3c2bc32826b5c6a6e5b040 default
289 c65502d4178782309ce0574c5ae6ee9485a9bafa default
289 c65502d4178782309ce0574c5ae6ee9485a9bafa default
290
290
291 $ hg heads --template="{rev}:{node} {branch}\n"
291 $ hg heads --template="{rev}:{node} {branch}\n"
292 4:c65502d4178782309ce0574c5ae6ee9485a9bafa default
292 4:c65502d4178782309ce0574c5ae6ee9485a9bafa default
293 3:2870ad076e541e714f3c2bc32826b5c6a6e5b040 default
293 3:2870ad076e541e714f3c2bc32826b5c6a6e5b040 default
294
294
295 $ cd ..
295 $ cd ..
296
296
297
297
298
298
299
299
300
300
301
301
302 Create repo c:
302 Create repo c:
303
303
304 $ hg init c
304 $ hg init c
305 $ cd c
305 $ cd c
306
306
307 $ echo A > A
307 $ echo A > A
308 $ hg ci -Am A
308 $ hg ci -Am A
309 adding A
309 adding A
310 $ echo B > B
310 $ echo B > B
311 $ hg ci -Am B
311 $ hg ci -Am B
312 adding B
312 adding B
313
313
314 $ hg up -q 0
314 $ hg up -q 0
315
315
316 $ echo C > C
316 $ echo C > C
317 $ hg ci -Am C
317 $ hg ci -Am C
318 adding C
318 adding C
319 created new head
319 created new head
320
320
321 $ hg merge
321 $ hg merge
322 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
322 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
323 (branch merge, don't forget to commit)
323 (branch merge, don't forget to commit)
324
324
325 $ echo D > D
325 $ echo D > D
326 $ hg ci -Am D
326 $ hg ci -Am D
327 adding D
327 adding D
328
328
329 $ hg up -q 1
329 $ hg up -q 1
330
330
331 $ echo E > E
331 $ echo E > E
332 $ hg ci -Am E
332 $ hg ci -Am E
333 adding E
333 adding E
334 created new head
334 created new head
335 $ echo F > E
335 $ echo F > E
336 $ hg ci -m 'F'
336 $ hg ci -m 'F'
337
337
338 $ echo G > G
338 $ echo G > G
339 $ hg ci -Am G
339 $ hg ci -Am G
340 adding G
340 adding G
341
341
342 $ hg merge
342 $ hg merge
343 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
343 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
344 (branch merge, don't forget to commit)
344 (branch merge, don't forget to commit)
345
345
346 $ hg ci -m H
346 $ hg ci -m H
347
347
348 $ hg up -q 0
348 $ hg up -q 0
349
349
350 $ echo I > I
350 $ echo I > I
351 $ hg ci -Am I
351 $ hg ci -Am I
352 adding I
352 adding I
353 created new head
353 created new head
354
354
355 $ hg tglog
355 $ hg tglog
356 @ 8: 'I'
356 @ 8: 'I'
357 |
357 |
358 | o 7: 'H'
358 | o 7: 'H'
359 | |\
359 | |\
360 | | o 6: 'G'
360 | | o 6: 'G'
361 | | |
361 | | |
362 | | o 5: 'F'
362 | | o 5: 'F'
363 | | |
363 | | |
364 | | o 4: 'E'
364 | | o 4: 'E'
365 | | |
365 | | |
366 | o | 3: 'D'
366 | o | 3: 'D'
367 | |\|
367 | |\|
368 | o | 2: 'C'
368 | o | 2: 'C'
369 |/ /
369 |/ /
370 | o 1: 'B'
370 | o 1: 'B'
371 |/
371 |/
372 o 0: 'A'
372 o 0: 'A'
373
373
374 $ cd ..
374 $ cd ..
375
375
376
376
377 Rebase and collapse - E onto I:
377 Rebase and collapse - E onto I:
378
378
379 $ hg clone -q -u . c c1
379 $ hg clone -q -u . c c1
380 $ cd c1
380 $ cd c1
381
381
382 $ hg rebase -s 4 --collapse # root (4) is not a merge
382 $ hg rebase -s 4 --collapse # root (4) is not a merge
383 merging E
383 merging E
384 saved backup bundle to $TESTTMP/c1/.hg/strip-backup/*-backup.hg (glob)
384 saved backup bundle to $TESTTMP/c1/.hg/strip-backup/*-backup.hg (glob)
385
385
386 $ hg tglog
386 $ hg tglog
387 @ 5: 'Collapsed revision
387 @ 5: 'Collapsed revision
388 |\ * E
388 |\ * E
389 | | * F
389 | | * F
390 | | * G
390 | | * G
391 | | * H'
391 | | * H'
392 | o 4: 'I'
392 | o 4: 'I'
393 | |
393 | |
394 o | 3: 'D'
394 o | 3: 'D'
395 |\ \
395 |\ \
396 | o | 2: 'C'
396 | o | 2: 'C'
397 | |/
397 | |/
398 o / 1: 'B'
398 o / 1: 'B'
399 |/
399 |/
400 o 0: 'A'
400 o 0: 'A'
401
401
402 $ hg manifest
402 $ hg manifest
403 A
403 A
404 C
404 C
405 D
405 D
406 E
406 E
407 G
407 G
408 I
408 I
409
409
410 $ cat E
410 $ cat E
411 F
411 F
412
412
413 $ cd ..
413 $ cd ..
414
414
415
415
416 Create repo d:
416 Create repo d:
417
417
418 $ hg init d
418 $ hg init d
419 $ cd d
419 $ cd d
420
420
421 $ echo A > A
421 $ echo A > A
422 $ hg ci -Am A
422 $ hg ci -Am A
423 adding A
423 adding A
424 $ echo B > B
424 $ echo B > B
425 $ hg ci -Am B
425 $ hg ci -Am B
426 adding B
426 adding B
427 $ echo C > C
427 $ echo C > C
428 $ hg ci -Am C
428 $ hg ci -Am C
429 adding C
429 adding C
430
430
431 $ hg up -q 1
431 $ hg up -q 1
432
432
433 $ echo D > D
433 $ echo D > D
434 $ hg ci -Am D
434 $ hg ci -Am D
435 adding D
435 adding D
436 created new head
436 created new head
437 $ hg merge
437 $ hg merge
438 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
438 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
439 (branch merge, don't forget to commit)
439 (branch merge, don't forget to commit)
440
440
441 $ hg ci -m E
441 $ hg ci -m E
442
442
443 $ hg up -q 0
443 $ hg up -q 0
444
444
445 $ echo F > F
445 $ echo F > F
446 $ hg ci -Am F
446 $ hg ci -Am F
447 adding F
447 adding F
448 created new head
448 created new head
449
449
450 $ hg tglog
450 $ hg tglog
451 @ 5: 'F'
451 @ 5: 'F'
452 |
452 |
453 | o 4: 'E'
453 | o 4: 'E'
454 | |\
454 | |\
455 | | o 3: 'D'
455 | | o 3: 'D'
456 | | |
456 | | |
457 | o | 2: 'C'
457 | o | 2: 'C'
458 | |/
458 | |/
459 | o 1: 'B'
459 | o 1: 'B'
460 |/
460 |/
461 o 0: 'A'
461 o 0: 'A'
462
462
463 $ cd ..
463 $ cd ..
464
464
465
465
466 Rebase and collapse - B onto F:
466 Rebase and collapse - B onto F:
467
467
468 $ hg clone -q -u . d d1
468 $ hg clone -q -u . d d1
469 $ cd d1
469 $ cd d1
470
470
471 $ hg rebase -s 1 --collapse
471 $ hg rebase -s 1 --collapse
472 saved backup bundle to $TESTTMP/d1/.hg/strip-backup/*-backup.hg (glob)
472 saved backup bundle to $TESTTMP/d1/.hg/strip-backup/*-backup.hg (glob)
473
473
474 $ hg tglog
474 $ hg tglog
475 @ 2: 'Collapsed revision
475 @ 2: 'Collapsed revision
476 | * B
476 | * B
477 | * C
477 | * C
478 | * D
478 | * D
479 | * E'
479 | * E'
480 o 1: 'F'
480 o 1: 'F'
481 |
481 |
482 o 0: 'A'
482 o 0: 'A'
483
483
484 $ hg manifest
484 $ hg manifest
485 A
485 A
486 B
486 B
487 C
487 C
488 D
488 D
489 F
489 F
490
490
491 Interactions between collapse and keepbranches
491 Interactions between collapse and keepbranches
492 $ cd ..
492 $ cd ..
493 $ hg init e
493 $ hg init e
494 $ cd e
494 $ cd e
495 $ echo 'a' > a
495 $ echo 'a' > a
496 $ hg ci -Am 'A'
496 $ hg ci -Am 'A'
497 adding a
497 adding a
498
498
499 $ hg branch 'one'
499 $ hg branch 'one'
500 marked working directory as branch one
500 marked working directory as branch one
501 (branches are permanent and global, did you want a bookmark?)
501 (branches are permanent and global, did you want a bookmark?)
502 $ echo 'b' > b
502 $ echo 'b' > b
503 $ hg ci -Am 'B'
503 $ hg ci -Am 'B'
504 adding b
504 adding b
505
505
506 $ hg branch 'two'
506 $ hg branch 'two'
507 marked working directory as branch two
507 marked working directory as branch two
508 (branches are permanent and global, did you want a bookmark?)
508 (branches are permanent and global, did you want a bookmark?)
509 $ echo 'c' > c
509 $ echo 'c' > c
510 $ hg ci -Am 'C'
510 $ hg ci -Am 'C'
511 adding c
511 adding c
512
512
513 $ hg up -q 0
513 $ hg up -q 0
514 $ echo 'd' > d
514 $ echo 'd' > d
515 $ hg ci -Am 'D'
515 $ hg ci -Am 'D'
516 adding d
516 adding d
517
517
518 $ hg tglog
518 $ hg tglog
519 @ 3: 'D'
519 @ 3: 'D'
520 |
520 |
521 | o 2: 'C' two
521 | o 2: 'C' two
522 | |
522 | |
523 | o 1: 'B' one
523 | o 1: 'B' one
524 |/
524 |/
525 o 0: 'A'
525 o 0: 'A'
526
526
527 $ hg rebase --keepbranches --collapse -s 1 -d 3
527 $ hg rebase --keepbranches --collapse -s 1 -d 3
528 abort: cannot collapse multiple named branches
528 abort: cannot collapse multiple named branches
529 [255]
529 [255]
530
530
531 $ repeatchange() {
531 $ repeatchange() {
532 > hg checkout $1
532 > hg checkout $1
533 > hg cp d z
533 > hg cp d z
534 > echo blah >> z
534 > echo blah >> z
535 > hg commit -Am "$2" --user "$3"
535 > hg commit -Am "$2" --user "$3"
536 > }
536 > }
537 $ repeatchange 3 "E" "user1"
537 $ repeatchange 3 "E" "user1"
538 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
538 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
539 $ repeatchange 3 "E" "user2"
539 $ repeatchange 3 "E" "user2"
540 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
540 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
541 created new head
541 created new head
542 $ hg tglog
542 $ hg tglog
543 @ 5: 'E'
543 @ 5: 'E'
544 |
544 |
545 | o 4: 'E'
545 | o 4: 'E'
546 |/
546 |/
547 o 3: 'D'
547 o 3: 'D'
548 |
548 |
549 | o 2: 'C' two
549 | o 2: 'C' two
550 | |
550 | |
551 | o 1: 'B' one
551 | o 1: 'B' one
552 |/
552 |/
553 o 0: 'A'
553 o 0: 'A'
554
554
555 $ hg rebase -s 5 -d 4
555 $ hg rebase -s 5 -d 4
556 saved backup bundle to $TESTTMP/e/.hg/strip-backup/*-backup.hg (glob)
556 saved backup bundle to $TESTTMP/e/.hg/strip-backup/*-backup.hg (glob)
557 $ hg tglog
557 $ hg tglog
558 @ 4: 'E'
558 @ 4: 'E'
559 |
559 |
560 o 3: 'D'
560 o 3: 'D'
561 |
561 |
562 | o 2: 'C' two
562 | o 2: 'C' two
563 | |
563 | |
564 | o 1: 'B' one
564 | o 1: 'B' one
565 |/
565 |/
566 o 0: 'A'
566 o 0: 'A'
567
567
568 $ hg export tip
568 $ hg export tip
569 # HG changeset patch
569 # HG changeset patch
570 # User user1
570 # User user1
571 # Date 0 0
571 # Date 0 0
572 # Thu Jan 01 00:00:00 1970 +0000
572 # Node ID f338eb3c2c7cc5b5915676a2376ba7ac558c5213
573 # Node ID f338eb3c2c7cc5b5915676a2376ba7ac558c5213
573 # Parent 41acb9dca9eb976e84cd21fcb756b4afa5a35c09
574 # Parent 41acb9dca9eb976e84cd21fcb756b4afa5a35c09
574 E
575 E
575
576
576 diff -r 41acb9dca9eb -r f338eb3c2c7c z
577 diff -r 41acb9dca9eb -r f338eb3c2c7c z
577 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
578 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
578 +++ b/z Thu Jan 01 00:00:00 1970 +0000
579 +++ b/z Thu Jan 01 00:00:00 1970 +0000
579 @@ -0,0 +1,2 @@
580 @@ -0,0 +1,2 @@
580 +d
581 +d
581 +blah
582 +blah
582
583
583 $ cd ..
584 $ cd ..
584
585
585 Rebase, collapse and copies
586 Rebase, collapse and copies
586
587
587 $ hg init copies
588 $ hg init copies
588 $ cd copies
589 $ cd copies
589 $ hg unbundle "$TESTDIR/bundles/renames.hg"
590 $ hg unbundle "$TESTDIR/bundles/renames.hg"
590 adding changesets
591 adding changesets
591 adding manifests
592 adding manifests
592 adding file changes
593 adding file changes
593 added 4 changesets with 11 changes to 7 files (+1 heads)
594 added 4 changesets with 11 changes to 7 files (+1 heads)
594 (run 'hg heads' to see heads, 'hg merge' to merge)
595 (run 'hg heads' to see heads, 'hg merge' to merge)
595 $ hg up -q tip
596 $ hg up -q tip
596 $ hg tglog
597 $ hg tglog
597 @ 3: 'move2'
598 @ 3: 'move2'
598 |
599 |
599 o 2: 'move1'
600 o 2: 'move1'
600 |
601 |
601 | o 1: 'change'
602 | o 1: 'change'
602 |/
603 |/
603 o 0: 'add'
604 o 0: 'add'
604
605
605 $ hg rebase --collapse -d 1
606 $ hg rebase --collapse -d 1
606 merging a and d to d
607 merging a and d to d
607 merging b and e to e
608 merging b and e to e
608 merging c and f to f
609 merging c and f to f
609 merging e and g to g
610 merging e and g to g
610 merging f and c to c
611 merging f and c to c
611 saved backup bundle to $TESTTMP/copies/.hg/strip-backup/*-backup.hg (glob)
612 saved backup bundle to $TESTTMP/copies/.hg/strip-backup/*-backup.hg (glob)
612 $ hg st
613 $ hg st
613 $ hg st --copies --change .
614 $ hg st --copies --change .
614 A d
615 A d
615 a
616 a
616 A g
617 A g
617 b
618 b
618 R b
619 R b
619 $ cat c
620 $ cat c
620 c
621 c
621 c
622 c
622 $ cat d
623 $ cat d
623 a
624 a
624 a
625 a
625 $ cat g
626 $ cat g
626 b
627 b
627 b
628 b
628 $ hg log -r . --template "{file_copies}\n"
629 $ hg log -r . --template "{file_copies}\n"
629 d (a)g (b)
630 d (a)g (b)
630
631
631 Test collapsing a middle revision in-place
632 Test collapsing a middle revision in-place
632
633
633 $ hg tglog
634 $ hg tglog
634 @ 2: 'Collapsed revision
635 @ 2: 'Collapsed revision
635 | * move1
636 | * move1
636 | * move2'
637 | * move2'
637 o 1: 'change'
638 o 1: 'change'
638 |
639 |
639 o 0: 'add'
640 o 0: 'add'
640
641
641 $ hg rebase --collapse -r 1 -d 0
642 $ hg rebase --collapse -r 1 -d 0
642 abort: can't remove original changesets with unrebased descendants
643 abort: can't remove original changesets with unrebased descendants
643 (use --keep to keep original changesets)
644 (use --keep to keep original changesets)
644 [255]
645 [255]
645
646
646 Test collapsing in place
647 Test collapsing in place
647
648
648 $ hg rebase --collapse -b . -d 0
649 $ hg rebase --collapse -b . -d 0
649 saved backup bundle to $TESTTMP/copies/.hg/strip-backup/*-backup.hg (glob)
650 saved backup bundle to $TESTTMP/copies/.hg/strip-backup/*-backup.hg (glob)
650 $ hg st --change . --copies
651 $ hg st --change . --copies
651 M a
652 M a
652 M c
653 M c
653 A d
654 A d
654 a
655 a
655 A g
656 A g
656 b
657 b
657 R b
658 R b
658 $ cat a
659 $ cat a
659 a
660 a
660 a
661 a
661 $ cat c
662 $ cat c
662 c
663 c
663 c
664 c
664 $ cat d
665 $ cat d
665 a
666 a
666 a
667 a
667 $ cat g
668 $ cat g
668 b
669 b
669 b
670 b
670 $ cd ..
671 $ cd ..
671
672
672
673
673 Test stripping a revision with another child
674 Test stripping a revision with another child
674
675
675 $ hg init f
676 $ hg init f
676 $ cd f
677 $ cd f
677
678
678 $ echo A > A
679 $ echo A > A
679 $ hg ci -Am A
680 $ hg ci -Am A
680 adding A
681 adding A
681 $ echo B > B
682 $ echo B > B
682 $ hg ci -Am B
683 $ hg ci -Am B
683 adding B
684 adding B
684
685
685 $ hg up -q 0
686 $ hg up -q 0
686
687
687 $ echo C > C
688 $ echo C > C
688 $ hg ci -Am C
689 $ hg ci -Am C
689 adding C
690 adding C
690 created new head
691 created new head
691
692
692 $ hg tglog
693 $ hg tglog
693 @ 2: 'C'
694 @ 2: 'C'
694 |
695 |
695 | o 1: 'B'
696 | o 1: 'B'
696 |/
697 |/
697 o 0: 'A'
698 o 0: 'A'
698
699
699
700
700
701
701 $ hg heads --template="{rev}:{node} {branch}: {desc}\n"
702 $ hg heads --template="{rev}:{node} {branch}: {desc}\n"
702 2:c5cefa58fd557f84b72b87f970135984337acbc5 default: C
703 2:c5cefa58fd557f84b72b87f970135984337acbc5 default: C
703 1:27547f69f25460a52fff66ad004e58da7ad3fb56 default: B
704 1:27547f69f25460a52fff66ad004e58da7ad3fb56 default: B
704
705
705 $ hg strip 2
706 $ hg strip 2
706 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
707 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
707 saved backup bundle to $TESTTMP/f/.hg/strip-backup/*-backup.hg (glob)
708 saved backup bundle to $TESTTMP/f/.hg/strip-backup/*-backup.hg (glob)
708
709
709 $ hg tglog
710 $ hg tglog
710 o 1: 'B'
711 o 1: 'B'
711 |
712 |
712 @ 0: 'A'
713 @ 0: 'A'
713
714
714
715
715
716
716 $ hg heads --template="{rev}:{node} {branch}: {desc}\n"
717 $ hg heads --template="{rev}:{node} {branch}: {desc}\n"
717 1:27547f69f25460a52fff66ad004e58da7ad3fb56 default: B
718 1:27547f69f25460a52fff66ad004e58da7ad3fb56 default: B
718
719
719 $ cd ..
720 $ cd ..
720
721
721
722
722
723
723
724
@@ -1,343 +1,347 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > graphlog=
3 > graphlog=
4 > rebase=
4 > rebase=
5 > mq=
5 > mq=
6 >
6 >
7 > [mq]
7 > [mq]
8 > plain=true
8 > plain=true
9 >
9 >
10 > [alias]
10 > [alias]
11 > tglog = log -G --template "{rev}: '{desc}' tags: {tags}\n"
11 > tglog = log -G --template "{rev}: '{desc}' tags: {tags}\n"
12 > EOF
12 > EOF
13
13
14
14
15 $ hg init a
15 $ hg init a
16 $ cd a
16 $ cd a
17 $ hg qinit -c
17 $ hg qinit -c
18
18
19 $ echo c1 > f
19 $ echo c1 > f
20 $ hg add f
20 $ hg add f
21 $ hg ci -m C1
21 $ hg ci -m C1
22
22
23 $ echo r1 > f
23 $ echo r1 > f
24 $ hg ci -m R1
24 $ hg ci -m R1
25
25
26 $ hg up -q 0
26 $ hg up -q 0
27
27
28 $ hg qnew f.patch
28 $ hg qnew f.patch
29 $ echo mq1 > f
29 $ echo mq1 > f
30 $ hg qref -m P0
30 $ hg qref -m P0
31
31
32 $ hg qnew f2.patch
32 $ hg qnew f2.patch
33 $ echo mq2 > f
33 $ echo mq2 > f
34 $ hg qref -m P1
34 $ hg qref -m P1
35
35
36 $ hg tglog
36 $ hg tglog
37 @ 3: 'P1' tags: f2.patch qtip tip
37 @ 3: 'P1' tags: f2.patch qtip tip
38 |
38 |
39 o 2: 'P0' tags: f.patch qbase
39 o 2: 'P0' tags: f.patch qbase
40 |
40 |
41 | o 1: 'R1' tags:
41 | o 1: 'R1' tags:
42 |/
42 |/
43 o 0: 'C1' tags: qparent
43 o 0: 'C1' tags: qparent
44
44
45
45
46 Rebase - try to rebase on an applied mq patch:
46 Rebase - try to rebase on an applied mq patch:
47
47
48 $ hg rebase -s 1 -d 3
48 $ hg rebase -s 1 -d 3
49 abort: cannot rebase onto an applied mq patch
49 abort: cannot rebase onto an applied mq patch
50 [255]
50 [255]
51
51
52 Rebase - same thing, but mq patch is default dest:
52 Rebase - same thing, but mq patch is default dest:
53
53
54 $ hg up -q 1
54 $ hg up -q 1
55 $ hg rebase
55 $ hg rebase
56 abort: cannot rebase onto an applied mq patch
56 abort: cannot rebase onto an applied mq patch
57 [255]
57 [255]
58 $ hg up -q qtip
58 $ hg up -q qtip
59
59
60 Rebase - generate a conflict:
60 Rebase - generate a conflict:
61
61
62 $ hg rebase -s 2 -d 1
62 $ hg rebase -s 2 -d 1
63 merging f
63 merging f
64 warning: conflicts during merge.
64 warning: conflicts during merge.
65 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
65 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
66 abort: unresolved conflicts (see hg resolve, then hg rebase --continue)
66 abort: unresolved conflicts (see hg resolve, then hg rebase --continue)
67 [255]
67 [255]
68
68
69 Fix the 1st conflict:
69 Fix the 1st conflict:
70
70
71 $ echo mq1r1 > f
71 $ echo mq1r1 > f
72 $ hg resolve -m f
72 $ hg resolve -m f
73 $ hg rebase -c
73 $ hg rebase -c
74 merging f
74 merging f
75 warning: conflicts during merge.
75 warning: conflicts during merge.
76 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
76 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
77 abort: unresolved conflicts (see hg resolve, then hg rebase --continue)
77 abort: unresolved conflicts (see hg resolve, then hg rebase --continue)
78 [255]
78 [255]
79
79
80 Fix the 2nd conflict:
80 Fix the 2nd conflict:
81
81
82 $ echo mq1r1mq2 > f
82 $ echo mq1r1mq2 > f
83 $ hg resolve -m f
83 $ hg resolve -m f
84 $ hg rebase -c
84 $ hg rebase -c
85 saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)
85 saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)
86
86
87 $ hg tglog
87 $ hg tglog
88 @ 3: 'P1' tags: f2.patch qtip tip
88 @ 3: 'P1' tags: f2.patch qtip tip
89 |
89 |
90 o 2: 'P0' tags: f.patch qbase
90 o 2: 'P0' tags: f.patch qbase
91 |
91 |
92 o 1: 'R1' tags: qparent
92 o 1: 'R1' tags: qparent
93 |
93 |
94 o 0: 'C1' tags:
94 o 0: 'C1' tags:
95
95
96 $ hg up -q qbase
96 $ hg up -q qbase
97
97
98 $ cat f
98 $ cat f
99 mq1r1
99 mq1r1
100
100
101 $ cat .hg/patches/f.patch
101 $ cat .hg/patches/f.patch
102 # HG changeset patch
102 # HG changeset patch
103 # User test
103 # User test
104 # Date ?????????? ? (glob)
104 # Date ?????????? ? (glob)
105 # * (glob)
105 # Node ID ???????????????????????????????????????? (glob)
106 # Node ID ???????????????????????????????????????? (glob)
106 # Parent bac9ed9960d8992bcad75864a879fa76cadaf1b0
107 # Parent bac9ed9960d8992bcad75864a879fa76cadaf1b0
107 P0
108 P0
108
109
109 diff -r bac9ed9960d8 -r ???????????? f (glob)
110 diff -r bac9ed9960d8 -r ???????????? f (glob)
110 --- a/f Thu Jan 01 00:00:00 1970 +0000
111 --- a/f Thu Jan 01 00:00:00 1970 +0000
111 +++ b/f ??? ??? ?? ??:??:?? ???? ????? (glob)
112 +++ b/f ??? ??? ?? ??:??:?? ???? ????? (glob)
112 @@ -1,1 +1,1 @@
113 @@ -1,1 +1,1 @@
113 -r1
114 -r1
114 +mq1r1
115 +mq1r1
115
116
116 Update to qtip:
117 Update to qtip:
117
118
118 $ hg up -q qtip
119 $ hg up -q qtip
119
120
120 $ cat f
121 $ cat f
121 mq1r1mq2
122 mq1r1mq2
122
123
123 $ cat .hg/patches/f2.patch
124 $ cat .hg/patches/f2.patch
124 # HG changeset patch
125 # HG changeset patch
125 # User test
126 # User test
126 # Date ?????????? ? (glob)
127 # Date ?????????? ? (glob)
128 # * (glob)
127 # Node ID ???????????????????????????????????????? (glob)
129 # Node ID ???????????????????????????????????????? (glob)
128 # Parent ???????????????????????????????????????? (glob)
130 # Parent ???????????????????????????????????????? (glob)
129 P1
131 P1
130
132
131 diff -r ???????????? -r ???????????? f (glob)
133 diff -r ???????????? -r ???????????? f (glob)
132 --- a/f ??? ??? ?? ??:??:?? ???? ????? (glob)
134 --- a/f ??? ??? ?? ??:??:?? ???? ????? (glob)
133 +++ b/f ??? ??? ?? ??:??:?? ???? ????? (glob)
135 +++ b/f ??? ??? ?? ??:??:?? ???? ????? (glob)
134 @@ -1,1 +1,1 @@
136 @@ -1,1 +1,1 @@
135 -mq1r1
137 -mq1r1
136 +mq1r1mq2
138 +mq1r1mq2
137
139
138 Adding one git-style patch and one normal:
140 Adding one git-style patch and one normal:
139
141
140 $ hg qpop -a
142 $ hg qpop -a
141 popping f2.patch
143 popping f2.patch
142 popping f.patch
144 popping f.patch
143 patch queue now empty
145 patch queue now empty
144
146
145 $ rm -fr .hg/patches
147 $ rm -fr .hg/patches
146 $ hg qinit -c
148 $ hg qinit -c
147
149
148 $ hg up -q 0
150 $ hg up -q 0
149
151
150 $ hg qnew --git f_git.patch
152 $ hg qnew --git f_git.patch
151 $ echo mq1 > p
153 $ echo mq1 > p
152 $ hg add p
154 $ hg add p
153 $ hg qref --git -m 'P0 (git)'
155 $ hg qref --git -m 'P0 (git)'
154
156
155 $ hg qnew f.patch
157 $ hg qnew f.patch
156 $ echo mq2 > p
158 $ echo mq2 > p
157 $ hg qref -m P1
159 $ hg qref -m P1
158 $ hg qci -m 'save patch state'
160 $ hg qci -m 'save patch state'
159
161
160 $ hg qseries -s
162 $ hg qseries -s
161 f_git.patch: P0 (git)
163 f_git.patch: P0 (git)
162 f.patch: P1
164 f.patch: P1
163
165
164 $ hg -R .hg/patches manifest
166 $ hg -R .hg/patches manifest
165 .hgignore
167 .hgignore
166 f.patch
168 f.patch
167 f_git.patch
169 f_git.patch
168 series
170 series
169
171
170 $ cat .hg/patches/f_git.patch
172 $ cat .hg/patches/f_git.patch
171 P0 (git)
173 P0 (git)
172
174
173 diff --git a/p b/p
175 diff --git a/p b/p
174 new file mode 100644
176 new file mode 100644
175 --- /dev/null
177 --- /dev/null
176 +++ b/p
178 +++ b/p
177 @@ -0,0 +1,1 @@
179 @@ -0,0 +1,1 @@
178 +mq1
180 +mq1
179
181
180 $ cat .hg/patches/f.patch
182 $ cat .hg/patches/f.patch
181 P1
183 P1
182
184
183 diff -r ???????????? p (glob)
185 diff -r ???????????? p (glob)
184 --- a/p ??? ??? ?? ??:??:?? ???? ????? (glob)
186 --- a/p ??? ??? ?? ??:??:?? ???? ????? (glob)
185 +++ b/p ??? ??? ?? ??:??:?? ???? ????? (glob)
187 +++ b/p ??? ??? ?? ??:??:?? ???? ????? (glob)
186 @@ -1,1 +1,1 @@
188 @@ -1,1 +1,1 @@
187 -mq1
189 -mq1
188 +mq2
190 +mq2
189
191
190
192
191 Rebase the applied mq patches:
193 Rebase the applied mq patches:
192
194
193 $ hg rebase -s 2 -d 1
195 $ hg rebase -s 2 -d 1
194 saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)
196 saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)
195
197
196 $ hg qci -m 'save patch state'
198 $ hg qci -m 'save patch state'
197
199
198 $ hg qseries -s
200 $ hg qseries -s
199 f_git.patch: P0 (git)
201 f_git.patch: P0 (git)
200 f.patch: P1
202 f.patch: P1
201
203
202 $ hg -R .hg/patches manifest
204 $ hg -R .hg/patches manifest
203 .hgignore
205 .hgignore
204 f.patch
206 f.patch
205 f_git.patch
207 f_git.patch
206 series
208 series
207
209
208 $ cat .hg/patches/f_git.patch
210 $ cat .hg/patches/f_git.patch
209 # HG changeset patch
211 # HG changeset patch
210 # User test
212 # User test
211 # Date ?????????? ? (glob)
213 # Date ?????????? ? (glob)
214 # * (glob)
212 # Node ID ???????????????????????????????????????? (glob)
215 # Node ID ???????????????????????????????????????? (glob)
213 # Parent bac9ed9960d8992bcad75864a879fa76cadaf1b0
216 # Parent bac9ed9960d8992bcad75864a879fa76cadaf1b0
214 P0 (git)
217 P0 (git)
215
218
216 diff --git a/p b/p
219 diff --git a/p b/p
217 new file mode 100644
220 new file mode 100644
218 --- /dev/null
221 --- /dev/null
219 +++ b/p
222 +++ b/p
220 @@ -0,0 +1,1 @@
223 @@ -0,0 +1,1 @@
221 +mq1
224 +mq1
222
225
223 $ cat .hg/patches/f.patch
226 $ cat .hg/patches/f.patch
224 # HG changeset patch
227 # HG changeset patch
225 # User test
228 # User test
226 # Date ?????????? ? (glob)
229 # Date ?????????? ? (glob)
230 # * (glob)
227 # Node ID ???????????????????????????????????????? (glob)
231 # Node ID ???????????????????????????????????????? (glob)
228 # Parent ???????????????????????????????????????? (glob)
232 # Parent ???????????????????????????????????????? (glob)
229 P1
233 P1
230
234
231 diff -r ???????????? -r ???????????? p (glob)
235 diff -r ???????????? -r ???????????? p (glob)
232 --- a/p ??? ??? ?? ??:??:?? ???? ????? (glob)
236 --- a/p ??? ??? ?? ??:??:?? ???? ????? (glob)
233 +++ b/p ??? ??? ?? ??:??:?? ???? ????? (glob)
237 +++ b/p ??? ??? ?? ??:??:?? ???? ????? (glob)
234 @@ -1,1 +1,1 @@
238 @@ -1,1 +1,1 @@
235 -mq1
239 -mq1
236 +mq2
240 +mq2
237
241
238 $ cd ..
242 $ cd ..
239
243
240 Rebase with guards
244 Rebase with guards
241
245
242 $ hg init foo
246 $ hg init foo
243 $ cd foo
247 $ cd foo
244 $ echo a > a
248 $ echo a > a
245 $ hg ci -Am a
249 $ hg ci -Am a
246 adding a
250 adding a
247
251
248 Create mq repo with guarded patches foo and bar and empty patch:
252 Create mq repo with guarded patches foo and bar and empty patch:
249
253
250 $ hg qinit
254 $ hg qinit
251 $ echo guarded > guarded
255 $ echo guarded > guarded
252 $ hg add guarded
256 $ hg add guarded
253 $ hg qnew guarded
257 $ hg qnew guarded
254 $ hg qnew empty-important -m 'important commit message'
258 $ hg qnew empty-important -m 'important commit message'
255 $ echo bar > bar
259 $ echo bar > bar
256 $ hg add bar
260 $ hg add bar
257 $ hg qnew bar
261 $ hg qnew bar
258 $ echo foo > foo
262 $ echo foo > foo
259 $ hg add foo
263 $ hg add foo
260 $ hg qnew foo
264 $ hg qnew foo
261 $ hg qpop -a
265 $ hg qpop -a
262 popping foo
266 popping foo
263 popping bar
267 popping bar
264 popping empty-important
268 popping empty-important
265 popping guarded
269 popping guarded
266 patch queue now empty
270 patch queue now empty
267 $ hg qguard guarded +guarded
271 $ hg qguard guarded +guarded
268 $ hg qguard bar +baz
272 $ hg qguard bar +baz
269 $ hg qguard foo +baz
273 $ hg qguard foo +baz
270 $ hg qselect baz
274 $ hg qselect baz
271 number of unguarded, unapplied patches has changed from 1 to 3
275 number of unguarded, unapplied patches has changed from 1 to 3
272 $ hg qpush bar
276 $ hg qpush bar
273 applying empty-important
277 applying empty-important
274 patch empty-important is empty
278 patch empty-important is empty
275 applying bar
279 applying bar
276 now at: bar
280 now at: bar
277
281
278 $ hg qguard -l
282 $ hg qguard -l
279 guarded: +guarded
283 guarded: +guarded
280 empty-important: unguarded
284 empty-important: unguarded
281 bar: +baz
285 bar: +baz
282 foo: +baz
286 foo: +baz
283
287
284 $ hg tglog
288 $ hg tglog
285 @ 2: 'imported patch bar' tags: bar qtip tip
289 @ 2: 'imported patch bar' tags: bar qtip tip
286 |
290 |
287 o 1: 'important commit message' tags: empty-important qbase
291 o 1: 'important commit message' tags: empty-important qbase
288 |
292 |
289 o 0: 'a' tags: qparent
293 o 0: 'a' tags: qparent
290
294
291 Create new head to rebase bar onto:
295 Create new head to rebase bar onto:
292
296
293 $ hg up -C 0
297 $ hg up -C 0
294 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
298 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
295 $ echo b > b
299 $ echo b > b
296 $ hg add b
300 $ hg add b
297 $ hg ci -m b
301 $ hg ci -m b
298 created new head
302 created new head
299 $ hg up -C 2
303 $ hg up -C 2
300 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
304 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
301 $ echo a >> a
305 $ echo a >> a
302 $ hg qref
306 $ hg qref
303
307
304 $ hg tglog
308 $ hg tglog
305 @ 3: '[mq]: bar' tags: bar qtip tip
309 @ 3: '[mq]: bar' tags: bar qtip tip
306 |
310 |
307 | o 2: 'b' tags:
311 | o 2: 'b' tags:
308 | |
312 | |
309 o | 1: 'important commit message' tags: empty-important qbase
313 o | 1: 'important commit message' tags: empty-important qbase
310 |/
314 |/
311 o 0: 'a' tags: qparent
315 o 0: 'a' tags: qparent
312
316
313
317
314 Rebase bar (make sure series order is preserved and empty-important also is
318 Rebase bar (make sure series order is preserved and empty-important also is
315 removed from the series):
319 removed from the series):
316
320
317 $ hg qseries
321 $ hg qseries
318 guarded
322 guarded
319 empty-important
323 empty-important
320 bar
324 bar
321 foo
325 foo
322 $ [ -f .hg/patches/empty-important ]
326 $ [ -f .hg/patches/empty-important ]
323 $ hg -q rebase -d 2
327 $ hg -q rebase -d 2
324 $ hg qseries
328 $ hg qseries
325 guarded
329 guarded
326 bar
330 bar
327 foo
331 foo
328 $ [ -f .hg/patches/empty-important ]
332 $ [ -f .hg/patches/empty-important ]
329 [1]
333 [1]
330
334
331 $ hg qguard -l
335 $ hg qguard -l
332 guarded: +guarded
336 guarded: +guarded
333 bar: +baz
337 bar: +baz
334 foo: +baz
338 foo: +baz
335
339
336 $ hg tglog
340 $ hg tglog
337 @ 2:* '[mq]: bar' tags: bar qbase qtip tip (glob)
341 @ 2:* '[mq]: bar' tags: bar qbase qtip tip (glob)
338 |
342 |
339 o 1:* 'b' tags: qparent (glob)
343 o 1:* 'b' tags: qparent (glob)
340 |
344 |
341 o 0:* 'a' tags: (glob)
345 o 0:* 'a' tags: (glob)
342
346
343 $ cd ..
347 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now