##// END OF EJS Templates
ui: show prompt choice if input is not a tty but is forced to be interactive...
Mads Kiilerich -
r22589:9ab18a91 default
parent child Browse files
Show More
@@ -1,888 +1,892
1 1 # ui.py - user interface bits for mercurial
2 2 #
3 3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
4 4 #
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 7
8 8 from i18n import _
9 9 import errno, getpass, os, socket, sys, tempfile, traceback
10 10 import config, scmutil, util, error, formatter
11 11 from node import hex
12 12
13 13 samplehgrcs = {
14 14 'user':
15 15 """# example user config (see "hg help config" for more info)
16 16 [ui]
17 17 # name and email, e.g.
18 18 # username = Jane Doe <jdoe@example.com>
19 19 username =
20 20
21 21 [extensions]
22 22 # uncomment these lines to enable some popular extensions
23 23 # (see "hg help extensions" for more info)
24 24 #
25 25 # pager =
26 26 # progress =
27 27 # color =""",
28 28
29 29 'local':
30 30 """# example repository config (see "hg help config" for more info)
31 31 """,
32 32
33 33 'global':
34 34 """# example system-wide hg config (see "hg help config" for more info)
35 35
36 36 [extensions]
37 37 # uncomment these lines to enable some popular extensions
38 38 # (see "hg help extensions" for more info)
39 39 #
40 40 # blackbox =
41 41 # progress =
42 42 # color =
43 43 # pager =""",
44 44 }
45 45
46 46 class ui(object):
47 47 def __init__(self, src=None):
48 48 # _buffers: used for temporary capture of output
49 49 self._buffers = []
50 50 # _bufferstates: Should the temporary capture includes stderr
51 51 self._bufferstates = []
52 52 self.quiet = self.verbose = self.debugflag = self.tracebackflag = False
53 53 self._reportuntrusted = True
54 54 self._ocfg = config.config() # overlay
55 55 self._tcfg = config.config() # trusted
56 56 self._ucfg = config.config() # untrusted
57 57 self._trustusers = set()
58 58 self._trustgroups = set()
59 59 self.callhooks = True
60 60
61 61 if src:
62 62 self.fout = src.fout
63 63 self.ferr = src.ferr
64 64 self.fin = src.fin
65 65
66 66 self._tcfg = src._tcfg.copy()
67 67 self._ucfg = src._ucfg.copy()
68 68 self._ocfg = src._ocfg.copy()
69 69 self._trustusers = src._trustusers.copy()
70 70 self._trustgroups = src._trustgroups.copy()
71 71 self.environ = src.environ
72 72 self.callhooks = src.callhooks
73 73 self.fixconfig()
74 74 else:
75 75 self.fout = sys.stdout
76 76 self.ferr = sys.stderr
77 77 self.fin = sys.stdin
78 78
79 79 # shared read-only environment
80 80 self.environ = os.environ
81 81 # we always trust global config files
82 82 for f in scmutil.rcpath():
83 83 self.readconfig(f, trust=True)
84 84
85 85 def copy(self):
86 86 return self.__class__(self)
87 87
88 88 def formatter(self, topic, opts):
89 89 return formatter.formatter(self, topic, opts)
90 90
91 91 def _trusted(self, fp, f):
92 92 st = util.fstat(fp)
93 93 if util.isowner(st):
94 94 return True
95 95
96 96 tusers, tgroups = self._trustusers, self._trustgroups
97 97 if '*' in tusers or '*' in tgroups:
98 98 return True
99 99
100 100 user = util.username(st.st_uid)
101 101 group = util.groupname(st.st_gid)
102 102 if user in tusers or group in tgroups or user == util.username():
103 103 return True
104 104
105 105 if self._reportuntrusted:
106 106 self.warn(_('not trusting file %s from untrusted '
107 107 'user %s, group %s\n') % (f, user, group))
108 108 return False
109 109
110 110 def readconfig(self, filename, root=None, trust=False,
111 111 sections=None, remap=None):
112 112 try:
113 113 fp = open(filename)
114 114 except IOError:
115 115 if not sections: # ignore unless we were looking for something
116 116 return
117 117 raise
118 118
119 119 cfg = config.config()
120 120 trusted = sections or trust or self._trusted(fp, filename)
121 121
122 122 try:
123 123 cfg.read(filename, fp, sections=sections, remap=remap)
124 124 fp.close()
125 125 except error.ConfigError, inst:
126 126 if trusted:
127 127 raise
128 128 self.warn(_("ignored: %s\n") % str(inst))
129 129
130 130 if self.plain():
131 131 for k in ('debug', 'fallbackencoding', 'quiet', 'slash',
132 132 'logtemplate', 'style',
133 133 'traceback', 'verbose'):
134 134 if k in cfg['ui']:
135 135 del cfg['ui'][k]
136 136 for k, v in cfg.items('defaults'):
137 137 del cfg['defaults'][k]
138 138 # Don't remove aliases from the configuration if in the exceptionlist
139 139 if self.plain('alias'):
140 140 for k, v in cfg.items('alias'):
141 141 del cfg['alias'][k]
142 142
143 143 if trusted:
144 144 self._tcfg.update(cfg)
145 145 self._tcfg.update(self._ocfg)
146 146 self._ucfg.update(cfg)
147 147 self._ucfg.update(self._ocfg)
148 148
149 149 if root is None:
150 150 root = os.path.expanduser('~')
151 151 self.fixconfig(root=root)
152 152
153 153 def fixconfig(self, root=None, section=None):
154 154 if section in (None, 'paths'):
155 155 # expand vars and ~
156 156 # translate paths relative to root (or home) into absolute paths
157 157 root = root or os.getcwd()
158 158 for c in self._tcfg, self._ucfg, self._ocfg:
159 159 for n, p in c.items('paths'):
160 160 if not p:
161 161 continue
162 162 if '%%' in p:
163 163 self.warn(_("(deprecated '%%' in path %s=%s from %s)\n")
164 164 % (n, p, self.configsource('paths', n)))
165 165 p = p.replace('%%', '%')
166 166 p = util.expandpath(p)
167 167 if not util.hasscheme(p) and not os.path.isabs(p):
168 168 p = os.path.normpath(os.path.join(root, p))
169 169 c.set("paths", n, p)
170 170
171 171 if section in (None, 'ui'):
172 172 # update ui options
173 173 self.debugflag = self.configbool('ui', 'debug')
174 174 self.verbose = self.debugflag or self.configbool('ui', 'verbose')
175 175 self.quiet = not self.debugflag and self.configbool('ui', 'quiet')
176 176 if self.verbose and self.quiet:
177 177 self.quiet = self.verbose = False
178 178 self._reportuntrusted = self.debugflag or self.configbool("ui",
179 179 "report_untrusted", True)
180 180 self.tracebackflag = self.configbool('ui', 'traceback', False)
181 181
182 182 if section in (None, 'trusted'):
183 183 # update trust information
184 184 self._trustusers.update(self.configlist('trusted', 'users'))
185 185 self._trustgroups.update(self.configlist('trusted', 'groups'))
186 186
187 187 def backupconfig(self, section, item):
188 188 return (self._ocfg.backup(section, item),
189 189 self._tcfg.backup(section, item),
190 190 self._ucfg.backup(section, item),)
191 191 def restoreconfig(self, data):
192 192 self._ocfg.restore(data[0])
193 193 self._tcfg.restore(data[1])
194 194 self._ucfg.restore(data[2])
195 195
196 196 def setconfig(self, section, name, value, source=''):
197 197 for cfg in (self._ocfg, self._tcfg, self._ucfg):
198 198 cfg.set(section, name, value, source)
199 199 self.fixconfig(section=section)
200 200
201 201 def _data(self, untrusted):
202 202 return untrusted and self._ucfg or self._tcfg
203 203
204 204 def configsource(self, section, name, untrusted=False):
205 205 return self._data(untrusted).source(section, name) or 'none'
206 206
207 207 def config(self, section, name, default=None, untrusted=False):
208 208 if isinstance(name, list):
209 209 alternates = name
210 210 else:
211 211 alternates = [name]
212 212
213 213 for n in alternates:
214 214 value = self._data(untrusted).get(section, n, None)
215 215 if value is not None:
216 216 name = n
217 217 break
218 218 else:
219 219 value = default
220 220
221 221 if self.debugflag and not untrusted and self._reportuntrusted:
222 222 for n in alternates:
223 223 uvalue = self._ucfg.get(section, n)
224 224 if uvalue is not None and uvalue != value:
225 225 self.debug("ignoring untrusted configuration option "
226 226 "%s.%s = %s\n" % (section, n, uvalue))
227 227 return value
228 228
229 229 def configpath(self, section, name, default=None, untrusted=False):
230 230 'get a path config item, expanded relative to repo root or config file'
231 231 v = self.config(section, name, default, untrusted)
232 232 if v is None:
233 233 return None
234 234 if not os.path.isabs(v) or "://" not in v:
235 235 src = self.configsource(section, name, untrusted)
236 236 if ':' in src:
237 237 base = os.path.dirname(src.rsplit(':')[0])
238 238 v = os.path.join(base, os.path.expanduser(v))
239 239 return v
240 240
241 241 def configbool(self, section, name, default=False, untrusted=False):
242 242 """parse a configuration element as a boolean
243 243
244 244 >>> u = ui(); s = 'foo'
245 245 >>> u.setconfig(s, 'true', 'yes')
246 246 >>> u.configbool(s, 'true')
247 247 True
248 248 >>> u.setconfig(s, 'false', 'no')
249 249 >>> u.configbool(s, 'false')
250 250 False
251 251 >>> u.configbool(s, 'unknown')
252 252 False
253 253 >>> u.configbool(s, 'unknown', True)
254 254 True
255 255 >>> u.setconfig(s, 'invalid', 'somevalue')
256 256 >>> u.configbool(s, 'invalid')
257 257 Traceback (most recent call last):
258 258 ...
259 259 ConfigError: foo.invalid is not a boolean ('somevalue')
260 260 """
261 261
262 262 v = self.config(section, name, None, untrusted)
263 263 if v is None:
264 264 return default
265 265 if isinstance(v, bool):
266 266 return v
267 267 b = util.parsebool(v)
268 268 if b is None:
269 269 raise error.ConfigError(_("%s.%s is not a boolean ('%s')")
270 270 % (section, name, v))
271 271 return b
272 272
273 273 def configint(self, section, name, default=None, untrusted=False):
274 274 """parse a configuration element as an integer
275 275
276 276 >>> u = ui(); s = 'foo'
277 277 >>> u.setconfig(s, 'int1', '42')
278 278 >>> u.configint(s, 'int1')
279 279 42
280 280 >>> u.setconfig(s, 'int2', '-42')
281 281 >>> u.configint(s, 'int2')
282 282 -42
283 283 >>> u.configint(s, 'unknown', 7)
284 284 7
285 285 >>> u.setconfig(s, 'invalid', 'somevalue')
286 286 >>> u.configint(s, 'invalid')
287 287 Traceback (most recent call last):
288 288 ...
289 289 ConfigError: foo.invalid is not an integer ('somevalue')
290 290 """
291 291
292 292 v = self.config(section, name, None, untrusted)
293 293 if v is None:
294 294 return default
295 295 try:
296 296 return int(v)
297 297 except ValueError:
298 298 raise error.ConfigError(_("%s.%s is not an integer ('%s')")
299 299 % (section, name, v))
300 300
301 301 def configbytes(self, section, name, default=0, untrusted=False):
302 302 """parse a configuration element as a quantity in bytes
303 303
304 304 Units can be specified as b (bytes), k or kb (kilobytes), m or
305 305 mb (megabytes), g or gb (gigabytes).
306 306
307 307 >>> u = ui(); s = 'foo'
308 308 >>> u.setconfig(s, 'val1', '42')
309 309 >>> u.configbytes(s, 'val1')
310 310 42
311 311 >>> u.setconfig(s, 'val2', '42.5 kb')
312 312 >>> u.configbytes(s, 'val2')
313 313 43520
314 314 >>> u.configbytes(s, 'unknown', '7 MB')
315 315 7340032
316 316 >>> u.setconfig(s, 'invalid', 'somevalue')
317 317 >>> u.configbytes(s, 'invalid')
318 318 Traceback (most recent call last):
319 319 ...
320 320 ConfigError: foo.invalid is not a byte quantity ('somevalue')
321 321 """
322 322
323 323 value = self.config(section, name)
324 324 if value is None:
325 325 if not isinstance(default, str):
326 326 return default
327 327 value = default
328 328 try:
329 329 return util.sizetoint(value)
330 330 except error.ParseError:
331 331 raise error.ConfigError(_("%s.%s is not a byte quantity ('%s')")
332 332 % (section, name, value))
333 333
334 334 def configlist(self, section, name, default=None, untrusted=False):
335 335 """parse a configuration element as a list of comma/space separated
336 336 strings
337 337
338 338 >>> u = ui(); s = 'foo'
339 339 >>> u.setconfig(s, 'list1', 'this,is "a small" ,test')
340 340 >>> u.configlist(s, 'list1')
341 341 ['this', 'is', 'a small', 'test']
342 342 """
343 343
344 344 def _parse_plain(parts, s, offset):
345 345 whitespace = False
346 346 while offset < len(s) and (s[offset].isspace() or s[offset] == ','):
347 347 whitespace = True
348 348 offset += 1
349 349 if offset >= len(s):
350 350 return None, parts, offset
351 351 if whitespace:
352 352 parts.append('')
353 353 if s[offset] == '"' and not parts[-1]:
354 354 return _parse_quote, parts, offset + 1
355 355 elif s[offset] == '"' and parts[-1][-1] == '\\':
356 356 parts[-1] = parts[-1][:-1] + s[offset]
357 357 return _parse_plain, parts, offset + 1
358 358 parts[-1] += s[offset]
359 359 return _parse_plain, parts, offset + 1
360 360
361 361 def _parse_quote(parts, s, offset):
362 362 if offset < len(s) and s[offset] == '"': # ""
363 363 parts.append('')
364 364 offset += 1
365 365 while offset < len(s) and (s[offset].isspace() or
366 366 s[offset] == ','):
367 367 offset += 1
368 368 return _parse_plain, parts, offset
369 369
370 370 while offset < len(s) and s[offset] != '"':
371 371 if (s[offset] == '\\' and offset + 1 < len(s)
372 372 and s[offset + 1] == '"'):
373 373 offset += 1
374 374 parts[-1] += '"'
375 375 else:
376 376 parts[-1] += s[offset]
377 377 offset += 1
378 378
379 379 if offset >= len(s):
380 380 real_parts = _configlist(parts[-1])
381 381 if not real_parts:
382 382 parts[-1] = '"'
383 383 else:
384 384 real_parts[0] = '"' + real_parts[0]
385 385 parts = parts[:-1]
386 386 parts.extend(real_parts)
387 387 return None, parts, offset
388 388
389 389 offset += 1
390 390 while offset < len(s) and s[offset] in [' ', ',']:
391 391 offset += 1
392 392
393 393 if offset < len(s):
394 394 if offset + 1 == len(s) and s[offset] == '"':
395 395 parts[-1] += '"'
396 396 offset += 1
397 397 else:
398 398 parts.append('')
399 399 else:
400 400 return None, parts, offset
401 401
402 402 return _parse_plain, parts, offset
403 403
404 404 def _configlist(s):
405 405 s = s.rstrip(' ,')
406 406 if not s:
407 407 return []
408 408 parser, parts, offset = _parse_plain, [''], 0
409 409 while parser:
410 410 parser, parts, offset = parser(parts, s, offset)
411 411 return parts
412 412
413 413 result = self.config(section, name, untrusted=untrusted)
414 414 if result is None:
415 415 result = default or []
416 416 if isinstance(result, basestring):
417 417 result = _configlist(result.lstrip(' ,\n'))
418 418 if result is None:
419 419 result = default or []
420 420 return result
421 421
422 422 def has_section(self, section, untrusted=False):
423 423 '''tell whether section exists in config.'''
424 424 return section in self._data(untrusted)
425 425
426 426 def configitems(self, section, untrusted=False):
427 427 items = self._data(untrusted).items(section)
428 428 if self.debugflag and not untrusted and self._reportuntrusted:
429 429 for k, v in self._ucfg.items(section):
430 430 if self._tcfg.get(section, k) != v:
431 431 self.debug("ignoring untrusted configuration option "
432 432 "%s.%s = %s\n" % (section, k, v))
433 433 return items
434 434
435 435 def walkconfig(self, untrusted=False):
436 436 cfg = self._data(untrusted)
437 437 for section in cfg.sections():
438 438 for name, value in self.configitems(section, untrusted):
439 439 yield section, name, value
440 440
441 441 def plain(self, feature=None):
442 442 '''is plain mode active?
443 443
444 444 Plain mode means that all configuration variables which affect
445 445 the behavior and output of Mercurial should be
446 446 ignored. Additionally, the output should be stable,
447 447 reproducible and suitable for use in scripts or applications.
448 448
449 449 The only way to trigger plain mode is by setting either the
450 450 `HGPLAIN' or `HGPLAINEXCEPT' environment variables.
451 451
452 452 The return value can either be
453 453 - False if HGPLAIN is not set, or feature is in HGPLAINEXCEPT
454 454 - True otherwise
455 455 '''
456 456 if 'HGPLAIN' not in os.environ and 'HGPLAINEXCEPT' not in os.environ:
457 457 return False
458 458 exceptions = os.environ.get('HGPLAINEXCEPT', '').strip().split(',')
459 459 if feature and exceptions:
460 460 return feature not in exceptions
461 461 return True
462 462
463 463 def username(self):
464 464 """Return default username to be used in commits.
465 465
466 466 Searched in this order: $HGUSER, [ui] section of hgrcs, $EMAIL
467 467 and stop searching if one of these is set.
468 468 If not found and ui.askusername is True, ask the user, else use
469 469 ($LOGNAME or $USER or $LNAME or $USERNAME) + "@full.hostname".
470 470 """
471 471 user = os.environ.get("HGUSER")
472 472 if user is None:
473 473 user = self.config("ui", ["username", "user"])
474 474 if user is not None:
475 475 user = os.path.expandvars(user)
476 476 if user is None:
477 477 user = os.environ.get("EMAIL")
478 478 if user is None and self.configbool("ui", "askusername"):
479 479 user = self.prompt(_("enter a commit username:"), default=None)
480 480 if user is None and not self.interactive():
481 481 try:
482 482 user = '%s@%s' % (util.getuser(), socket.getfqdn())
483 483 self.warn(_("no username found, using '%s' instead\n") % user)
484 484 except KeyError:
485 485 pass
486 486 if not user:
487 487 raise util.Abort(_('no username supplied'),
488 488 hint=_('use "hg config --edit" '
489 489 'to set your username'))
490 490 if "\n" in user:
491 491 raise util.Abort(_("username %s contains a newline\n") % repr(user))
492 492 return user
493 493
494 494 def shortuser(self, user):
495 495 """Return a short representation of a user name or email address."""
496 496 if not self.verbose:
497 497 user = util.shortuser(user)
498 498 return user
499 499
500 500 def expandpath(self, loc, default=None):
501 501 """Return repository location relative to cwd or from [paths]"""
502 502 if util.hasscheme(loc) or os.path.isdir(os.path.join(loc, '.hg')):
503 503 return loc
504 504
505 505 path = self.config('paths', loc)
506 506 if not path and default is not None:
507 507 path = self.config('paths', default)
508 508 return path or loc
509 509
510 510 def pushbuffer(self, error=False):
511 511 """install a buffer to capture standar output of the ui object
512 512
513 513 If error is True, the error output will be captured too."""
514 514 self._buffers.append([])
515 515 self._bufferstates.append(error)
516 516
517 517 def popbuffer(self, labeled=False):
518 518 '''pop the last buffer and return the buffered output
519 519
520 520 If labeled is True, any labels associated with buffered
521 521 output will be handled. By default, this has no effect
522 522 on the output returned, but extensions and GUI tools may
523 523 handle this argument and returned styled output. If output
524 524 is being buffered so it can be captured and parsed or
525 525 processed, labeled should not be set to True.
526 526 '''
527 527 self._bufferstates.pop()
528 528 return "".join(self._buffers.pop())
529 529
530 530 def write(self, *args, **opts):
531 531 '''write args to output
532 532
533 533 By default, this method simply writes to the buffer or stdout,
534 534 but extensions or GUI tools may override this method,
535 535 write_err(), popbuffer(), and label() to style output from
536 536 various parts of hg.
537 537
538 538 An optional keyword argument, "label", can be passed in.
539 539 This should be a string containing label names separated by
540 540 space. Label names take the form of "topic.type". For example,
541 541 ui.debug() issues a label of "ui.debug".
542 542
543 543 When labeling output for a specific command, a label of
544 544 "cmdname.type" is recommended. For example, status issues
545 545 a label of "status.modified" for modified files.
546 546 '''
547 547 if self._buffers:
548 548 self._buffers[-1].extend([str(a) for a in args])
549 549 else:
550 550 for a in args:
551 551 self.fout.write(str(a))
552 552
553 553 def write_err(self, *args, **opts):
554 554 try:
555 555 if self._bufferstates and self._bufferstates[-1]:
556 556 return self.write(*args, **opts)
557 557 if not getattr(self.fout, 'closed', False):
558 558 self.fout.flush()
559 559 for a in args:
560 560 self.ferr.write(str(a))
561 561 # stderr may be buffered under win32 when redirected to files,
562 562 # including stdout.
563 563 if not getattr(self.ferr, 'closed', False):
564 564 self.ferr.flush()
565 565 except IOError, inst:
566 566 if inst.errno not in (errno.EPIPE, errno.EIO, errno.EBADF):
567 567 raise
568 568
569 569 def flush(self):
570 570 try: self.fout.flush()
571 571 except (IOError, ValueError): pass
572 572 try: self.ferr.flush()
573 573 except (IOError, ValueError): pass
574 574
575 575 def _isatty(self, fh):
576 576 if self.configbool('ui', 'nontty', False):
577 577 return False
578 578 return util.isatty(fh)
579 579
580 580 def interactive(self):
581 581 '''is interactive input allowed?
582 582
583 583 An interactive session is a session where input can be reasonably read
584 584 from `sys.stdin'. If this function returns false, any attempt to read
585 585 from stdin should fail with an error, unless a sensible default has been
586 586 specified.
587 587
588 588 Interactiveness is triggered by the value of the `ui.interactive'
589 589 configuration variable or - if it is unset - when `sys.stdin' points
590 590 to a terminal device.
591 591
592 592 This function refers to input only; for output, see `ui.formatted()'.
593 593 '''
594 594 i = self.configbool("ui", "interactive", None)
595 595 if i is None:
596 596 # some environments replace stdin without implementing isatty
597 597 # usually those are non-interactive
598 598 return self._isatty(self.fin)
599 599
600 600 return i
601 601
602 602 def termwidth(self):
603 603 '''how wide is the terminal in columns?
604 604 '''
605 605 if 'COLUMNS' in os.environ:
606 606 try:
607 607 return int(os.environ['COLUMNS'])
608 608 except ValueError:
609 609 pass
610 610 return util.termwidth()
611 611
612 612 def formatted(self):
613 613 '''should formatted output be used?
614 614
615 615 It is often desirable to format the output to suite the output medium.
616 616 Examples of this are truncating long lines or colorizing messages.
617 617 However, this is not often not desirable when piping output into other
618 618 utilities, e.g. `grep'.
619 619
620 620 Formatted output is triggered by the value of the `ui.formatted'
621 621 configuration variable or - if it is unset - when `sys.stdout' points
622 622 to a terminal device. Please note that `ui.formatted' should be
623 623 considered an implementation detail; it is not intended for use outside
624 624 Mercurial or its extensions.
625 625
626 626 This function refers to output only; for input, see `ui.interactive()'.
627 627 This function always returns false when in plain mode, see `ui.plain()'.
628 628 '''
629 629 if self.plain():
630 630 return False
631 631
632 632 i = self.configbool("ui", "formatted", None)
633 633 if i is None:
634 634 # some environments replace stdout without implementing isatty
635 635 # usually those are non-interactive
636 636 return self._isatty(self.fout)
637 637
638 638 return i
639 639
640 640 def _readline(self, prompt=''):
641 641 if self._isatty(self.fin):
642 642 try:
643 643 # magically add command line editing support, where
644 644 # available
645 645 import readline
646 646 # force demandimport to really load the module
647 647 readline.read_history_file
648 648 # windows sometimes raises something other than ImportError
649 649 except Exception:
650 650 pass
651 651
652 652 # call write() so output goes through subclassed implementation
653 653 # e.g. color extension on Windows
654 654 self.write(prompt)
655 655
656 656 # instead of trying to emulate raw_input, swap (self.fin,
657 657 # self.fout) with (sys.stdin, sys.stdout)
658 658 oldin = sys.stdin
659 659 oldout = sys.stdout
660 660 sys.stdin = self.fin
661 661 sys.stdout = self.fout
662 662 # prompt ' ' must exist; otherwise readline may delete entire line
663 663 # - http://bugs.python.org/issue12833
664 664 line = raw_input(' ')
665 665 sys.stdin = oldin
666 666 sys.stdout = oldout
667 667
668 668 # When stdin is in binary mode on Windows, it can cause
669 669 # raw_input() to emit an extra trailing carriage return
670 670 if os.linesep == '\r\n' and line and line[-1] == '\r':
671 671 line = line[:-1]
672 672 return line
673 673
674 674 def prompt(self, msg, default="y"):
675 675 """Prompt user with msg, read response.
676 676 If ui is not interactive, the default is returned.
677 677 """
678 678 if not self.interactive():
679 679 self.write(msg, ' ', default, "\n")
680 680 return default
681 681 try:
682 682 r = self._readline(self.label(msg, 'ui.prompt'))
683 683 if not r:
684 return default
684 r = default
685 # sometimes self.interactive disagrees with isatty,
686 # show default response
687 if not util.isatty(self.fin):
688 self.write(r, "\n")
685 689 return r
686 690 except EOFError:
687 691 raise util.Abort(_('response expected'))
688 692
689 693 @staticmethod
690 694 def extractchoices(prompt):
691 695 """Extract prompt message and list of choices from specified prompt.
692 696
693 697 This returns tuple "(message, choices)", and "choices" is the
694 698 list of tuple "(response character, text without &)".
695 699 """
696 700 parts = prompt.split('$$')
697 701 msg = parts[0].rstrip(' ')
698 702 choices = [p.strip(' ') for p in parts[1:]]
699 703 return (msg,
700 704 [(s[s.index('&') + 1].lower(), s.replace('&', '', 1))
701 705 for s in choices])
702 706
703 707 def promptchoice(self, prompt, default=0):
704 708 """Prompt user with a message, read response, and ensure it matches
705 709 one of the provided choices. The prompt is formatted as follows:
706 710
707 711 "would you like fries with that (Yn)? $$ &Yes $$ &No"
708 712
709 713 The index of the choice is returned. Responses are case
710 714 insensitive. If ui is not interactive, the default is
711 715 returned.
712 716 """
713 717
714 718 msg, choices = self.extractchoices(prompt)
715 719 resps = [r for r, t in choices]
716 720 while True:
717 721 r = self.prompt(msg, resps[default])
718 722 if r.lower() in resps:
719 723 return resps.index(r.lower())
720 724 self.write(_("unrecognized response\n"))
721 725
722 726 def getpass(self, prompt=None, default=None):
723 727 if not self.interactive():
724 728 return default
725 729 try:
726 730 self.write_err(self.label(prompt or _('password: '), 'ui.prompt'))
727 731 # disable getpass() only if explicitly specified. it's still valid
728 732 # to interact with tty even if fin is not a tty.
729 733 if self.configbool('ui', 'nontty'):
730 734 return self.fin.readline().rstrip('\n')
731 735 else:
732 736 return getpass.getpass('')
733 737 except EOFError:
734 738 raise util.Abort(_('response expected'))
735 739 def status(self, *msg, **opts):
736 740 '''write status message to output (if ui.quiet is False)
737 741
738 742 This adds an output label of "ui.status".
739 743 '''
740 744 if not self.quiet:
741 745 opts['label'] = opts.get('label', '') + ' ui.status'
742 746 self.write(*msg, **opts)
743 747 def warn(self, *msg, **opts):
744 748 '''write warning message to output (stderr)
745 749
746 750 This adds an output label of "ui.warning".
747 751 '''
748 752 opts['label'] = opts.get('label', '') + ' ui.warning'
749 753 self.write_err(*msg, **opts)
750 754 def note(self, *msg, **opts):
751 755 '''write note to output (if ui.verbose is True)
752 756
753 757 This adds an output label of "ui.note".
754 758 '''
755 759 if self.verbose:
756 760 opts['label'] = opts.get('label', '') + ' ui.note'
757 761 self.write(*msg, **opts)
758 762 def debug(self, *msg, **opts):
759 763 '''write debug message to output (if ui.debugflag is True)
760 764
761 765 This adds an output label of "ui.debug".
762 766 '''
763 767 if self.debugflag:
764 768 opts['label'] = opts.get('label', '') + ' ui.debug'
765 769 self.write(*msg, **opts)
766 770 def edit(self, text, user, extra={}, editform=None):
767 771 (fd, name) = tempfile.mkstemp(prefix="hg-editor-", suffix=".txt",
768 772 text=True)
769 773 try:
770 774 f = os.fdopen(fd, "w")
771 775 f.write(text)
772 776 f.close()
773 777
774 778 environ = {'HGUSER': user}
775 779 if 'transplant_source' in extra:
776 780 environ.update({'HGREVISION': hex(extra['transplant_source'])})
777 781 for label in ('source', 'rebase_source'):
778 782 if label in extra:
779 783 environ.update({'HGREVISION': extra[label]})
780 784 break
781 785 if editform:
782 786 environ.update({'HGEDITFORM': editform})
783 787
784 788 editor = self.geteditor()
785 789
786 790 util.system("%s \"%s\"" % (editor, name),
787 791 environ=environ,
788 792 onerr=util.Abort, errprefix=_("edit failed"),
789 793 out=self.fout)
790 794
791 795 f = open(name)
792 796 t = f.read()
793 797 f.close()
794 798 finally:
795 799 os.unlink(name)
796 800
797 801 return t
798 802
799 803 def traceback(self, exc=None, force=False):
800 804 '''print exception traceback if traceback printing enabled or forced.
801 805 only to call in exception handler. returns true if traceback
802 806 printed.'''
803 807 if self.tracebackflag or force:
804 808 if exc is None:
805 809 exc = sys.exc_info()
806 810 cause = getattr(exc[1], 'cause', None)
807 811
808 812 if cause is not None:
809 813 causetb = traceback.format_tb(cause[2])
810 814 exctb = traceback.format_tb(exc[2])
811 815 exconly = traceback.format_exception_only(cause[0], cause[1])
812 816
813 817 # exclude frame where 'exc' was chained and rethrown from exctb
814 818 self.write_err('Traceback (most recent call last):\n',
815 819 ''.join(exctb[:-1]),
816 820 ''.join(causetb),
817 821 ''.join(exconly))
818 822 else:
819 823 traceback.print_exception(exc[0], exc[1], exc[2],
820 824 file=self.ferr)
821 825 return self.tracebackflag or force
822 826
823 827 def geteditor(self):
824 828 '''return editor to use'''
825 829 if sys.platform == 'plan9':
826 830 # vi is the MIPS instruction simulator on Plan 9. We
827 831 # instead default to E to plumb commit messages to
828 832 # avoid confusion.
829 833 editor = 'E'
830 834 else:
831 835 editor = 'vi'
832 836 return (os.environ.get("HGEDITOR") or
833 837 self.config("ui", "editor") or
834 838 os.environ.get("VISUAL") or
835 839 os.environ.get("EDITOR", editor))
836 840
837 841 def progress(self, topic, pos, item="", unit="", total=None):
838 842 '''show a progress message
839 843
840 844 With stock hg, this is simply a debug message that is hidden
841 845 by default, but with extensions or GUI tools it may be
842 846 visible. 'topic' is the current operation, 'item' is a
843 847 non-numeric marker of the current position (i.e. the currently
844 848 in-process file), 'pos' is the current numeric position (i.e.
845 849 revision, bytes, etc.), unit is a corresponding unit label,
846 850 and total is the highest expected pos.
847 851
848 852 Multiple nested topics may be active at a time.
849 853
850 854 All topics should be marked closed by setting pos to None at
851 855 termination.
852 856 '''
853 857
854 858 if pos is None or not self.debugflag:
855 859 return
856 860
857 861 if unit:
858 862 unit = ' ' + unit
859 863 if item:
860 864 item = ' ' + item
861 865
862 866 if total:
863 867 pct = 100.0 * pos / total
864 868 self.debug('%s:%s %s/%s%s (%4.2f%%)\n'
865 869 % (topic, item, pos, total, unit, pct))
866 870 else:
867 871 self.debug('%s:%s %s%s\n' % (topic, item, pos, unit))
868 872
869 873 def log(self, service, *msg, **opts):
870 874 '''hook for logging facility extensions
871 875
872 876 service should be a readily-identifiable subsystem, which will
873 877 allow filtering.
874 878 message should be a newline-terminated string to log.
875 879 '''
876 880 pass
877 881
878 882 def label(self, msg, label):
879 883 '''style msg based on supplied label
880 884
881 885 Like ui.write(), this just returns msg unchanged, but extensions
882 886 and GUI tools can override it to allow styling output without
883 887 writing it.
884 888
885 889 ui.write(s, 'label') is equivalent to
886 890 ui.write(ui.label(s, 'label')).
887 891 '''
888 892 return msg
@@ -1,202 +1,206
1 1 Setup
2 2
3 3 $ echo "[color]" >> $HGRCPATH
4 4 $ echo "mode = ansi" >> $HGRCPATH
5 5 $ echo "[extensions]" >> $HGRCPATH
6 6 $ echo "color=" >> $HGRCPATH
7 7 $ hg init repo
8 8 $ cd repo
9 9 $ cat > a <<EOF
10 10 > c
11 11 > c
12 12 > a
13 13 > a
14 14 > b
15 15 > a
16 16 > a
17 17 > c
18 18 > c
19 19 > EOF
20 20 $ hg ci -Am adda
21 21 adding a
22 22 $ cat > a <<EOF
23 23 > c
24 24 > c
25 25 > a
26 26 > a
27 27 > dd
28 28 > a
29 29 > a
30 30 > c
31 31 > c
32 32 > EOF
33 33
34 34 default context
35 35
36 36 $ hg diff --nodates --color=always
37 37 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
38 38 \x1b[0;31;1m--- a/a\x1b[0m (esc)
39 39 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
40 40 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
41 41 c
42 42 a
43 43 a
44 44 \x1b[0;31m-b\x1b[0m (esc)
45 45 \x1b[0;32m+dd\x1b[0m (esc)
46 46 a
47 47 a
48 48 c
49 49
50 50 --unified=2
51 51
52 52 $ hg diff --nodates -U 2 --color=always
53 53 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
54 54 \x1b[0;31;1m--- a/a\x1b[0m (esc)
55 55 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
56 56 \x1b[0;35m@@ -3,5 +3,5 @@\x1b[0m (esc)
57 57 a
58 58 a
59 59 \x1b[0;31m-b\x1b[0m (esc)
60 60 \x1b[0;32m+dd\x1b[0m (esc)
61 61 a
62 62 a
63 63
64 64 diffstat
65 65
66 66 $ hg diff --stat --color=always
67 67 a | 2 \x1b[0;32m+\x1b[0m\x1b[0;31m-\x1b[0m (esc)
68 68 1 files changed, 1 insertions(+), 1 deletions(-)
69 69 $ echo "record=" >> $HGRCPATH
70 70 $ echo "[ui]" >> $HGRCPATH
71 71 $ echo "interactive=true" >> $HGRCPATH
72 72 $ echo "[diff]" >> $HGRCPATH
73 73 $ echo "git=True" >> $HGRCPATH
74 74
75 75 #if execbit
76 76
77 77 record
78 78
79 79 $ chmod +x a
80 80 $ hg record --color=always -m moda a <<EOF
81 81 > y
82 82 > y
83 83 > EOF
84 84 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
85 85 \x1b[0;36;1mold mode 100644\x1b[0m (esc)
86 86 \x1b[0;36;1mnew mode 100755\x1b[0m (esc)
87 87 1 hunks, 1 lines changed
88 \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m (esc)
88 \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
89
89 90 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
90 91 c
91 92 a
92 93 a
93 94 \x1b[0;31m-b\x1b[0m (esc)
94 95 \x1b[0;32m+dd\x1b[0m (esc)
95 96 a
96 97 a
97 98 c
98 \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m (esc)
99 \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
100
99 101
100 102 $ echo "[extensions]" >> $HGRCPATH
101 103 $ echo "mq=" >> $HGRCPATH
102 104 $ hg rollback
103 105 repository tip rolled back to revision 0 (undo commit)
104 106 working directory now based on revision 0
105 107
106 108 qrecord
107 109
108 110 $ hg qrecord --color=always -m moda patch <<EOF
109 111 > y
110 112 > y
111 113 > EOF
112 114 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
113 115 \x1b[0;36;1mold mode 100644\x1b[0m (esc)
114 116 \x1b[0;36;1mnew mode 100755\x1b[0m (esc)
115 117 1 hunks, 1 lines changed
116 \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m (esc)
118 \x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
119
117 120 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
118 121 c
119 122 a
120 123 a
121 124 \x1b[0;31m-b\x1b[0m (esc)
122 125 \x1b[0;32m+dd\x1b[0m (esc)
123 126 a
124 127 a
125 128 c
126 \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m (esc)
129 \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
130
127 131
128 132 $ hg qpop -a
129 133 popping patch
130 134 patch queue now empty
131 135
132 136 #endif
133 137
134 138 issue3712: test colorization of subrepo diff
135 139
136 140 $ hg init sub
137 141 $ echo b > sub/b
138 142 $ hg -R sub commit -Am 'create sub'
139 143 adding b
140 144 $ echo 'sub = sub' > .hgsub
141 145 $ hg add .hgsub
142 146 $ hg commit -m 'add subrepo sub'
143 147 $ echo aa >> a
144 148 $ echo bb >> sub/b
145 149
146 150 $ hg diff --color=always -S
147 151 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
148 152 \x1b[0;31;1m--- a/a\x1b[0m (esc)
149 153 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
150 154 \x1b[0;35m@@ -7,3 +7,4 @@\x1b[0m (esc)
151 155 a
152 156 c
153 157 c
154 158 \x1b[0;32m+aa\x1b[0m (esc)
155 159 \x1b[0;1mdiff --git a/sub/b b/sub/b\x1b[0m (esc)
156 160 \x1b[0;31;1m--- a/sub/b\x1b[0m (esc)
157 161 \x1b[0;32;1m+++ b/sub/b\x1b[0m (esc)
158 162 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
159 163 b
160 164 \x1b[0;32m+bb\x1b[0m (esc)
161 165
162 166 test tabs
163 167
164 168 $ cat >> a <<EOF
165 169 > one tab
166 170 > two tabs
167 171 > end tab
168 172 > mid tab
169 173 > all tabs
170 174 > EOF
171 175 $ hg diff --nodates --color=always
172 176 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
173 177 \x1b[0;31;1m--- a/a\x1b[0m (esc)
174 178 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
175 179 \x1b[0;35m@@ -7,3 +7,9 @@\x1b[0m (esc)
176 180 a
177 181 c
178 182 c
179 183 \x1b[0;32m+aa\x1b[0m (esc)
180 184 \x1b[0;32m+\x1b[0m \x1b[0;32mone tab\x1b[0m (esc)
181 185 \x1b[0;32m+\x1b[0m \x1b[0;32mtwo tabs\x1b[0m (esc)
182 186 \x1b[0;32m+end tab\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
183 187 \x1b[0;32m+mid\x1b[0m \x1b[0;32mtab\x1b[0m (esc)
184 188 \x1b[0;32m+\x1b[0m \x1b[0;32mall\x1b[0m \x1b[0;32mtabs\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
185 189 $ echo "[color]" >> $HGRCPATH
186 190 $ echo "diff.tab = bold magenta" >> $HGRCPATH
187 191 $ hg diff --nodates --color=always
188 192 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
189 193 \x1b[0;31;1m--- a/a\x1b[0m (esc)
190 194 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
191 195 \x1b[0;35m@@ -7,3 +7,9 @@\x1b[0m (esc)
192 196 a
193 197 c
194 198 c
195 199 \x1b[0;32m+aa\x1b[0m (esc)
196 200 \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mone tab\x1b[0m (esc)
197 201 \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtwo tabs\x1b[0m (esc)
198 202 \x1b[0;32m+end tab\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
199 203 \x1b[0;32m+mid\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtab\x1b[0m (esc)
200 204 \x1b[0;32m+\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mall\x1b[0m\x1b[0;1;35m \x1b[0m\x1b[0;32mtabs\x1b[0m\x1b[0;1;41m \x1b[0m (esc)
201 205
202 206 $ cd ..
@@ -1,369 +1,381
1 1
2 2 $ echo "[extensions]" >> $HGRCPATH
3 3 $ echo "largefiles =" >> $HGRCPATH
4 4
5 5 Create the repository outside $HOME since largefiles write to
6 6 $HOME/.cache/largefiles.
7 7
8 8 $ hg init test
9 9 $ cd test
10 10 $ echo "root" > root
11 11 $ hg add root
12 12 $ hg commit -m "Root commit"
13 13
14 14 $ echo "large" > foo
15 15 $ hg add --large foo
16 16 $ hg commit -m "Add foo as a largefile"
17 17
18 18 $ hg update -r 0
19 19 getting changed largefiles
20 20 0 largefiles updated, 1 removed
21 21 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
22 22
23 23 $ echo "normal" > foo
24 24 $ hg add foo
25 25 $ hg commit -m "Add foo as normal file"
26 26 created new head
27 27
28 28 Normal file in the working copy, keeping the normal version:
29 29
30 30 $ echo "n" | hg merge --config ui.interactive=Yes
31 31 remote turned local normal file foo into a largefile
32 use (l)argefile or keep (n)ormal file? getting changed largefiles
32 use (l)argefile or keep (n)ormal file? n
33 getting changed largefiles
33 34 0 largefiles updated, 0 removed
34 35 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
35 36 (branch merge, don't forget to commit)
36 37
37 38 $ hg status
38 39 $ cat foo
39 40 normal
40 41
41 42 Normal file in the working copy, keeping the largefile version:
42 43
43 44 $ hg update -q -C
44 45 $ echo "l" | hg merge --config ui.interactive=Yes
45 46 remote turned local normal file foo into a largefile
46 use (l)argefile or keep (n)ormal file? getting changed largefiles
47 use (l)argefile or keep (n)ormal file? l
48 getting changed largefiles
47 49 1 largefiles updated, 0 removed
48 50 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
49 51 (branch merge, don't forget to commit)
50 52
51 53 $ hg status
52 54 M foo
53 55
54 56 $ hg diff --nodates
55 57 diff -r fa129ab6b5a7 .hglf/foo
56 58 --- /dev/null
57 59 +++ b/.hglf/foo
58 60 @@ -0,0 +1,1 @@
59 61 +7f7097b041ccf68cc5561e9600da4655d21c6d18
60 62 diff -r fa129ab6b5a7 foo
61 63 --- a/foo
62 64 +++ /dev/null
63 65 @@ -1,1 +0,0 @@
64 66 -normal
65 67
66 68 $ cat foo
67 69 large
68 70
69 71 Largefile in the working copy, keeping the normal version:
70 72
71 73 $ hg update -q -C -r 1
72 74 $ echo "n" | hg merge --config ui.interactive=Yes
73 75 remote turned local largefile foo into a normal file
74 keep (l)argefile or use (n)ormal file? getting changed largefiles
76 keep (l)argefile or use (n)ormal file? n
77 getting changed largefiles
75 78 0 largefiles updated, 0 removed
76 79 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
77 80 (branch merge, don't forget to commit)
78 81
79 82 $ hg status
80 83 M foo
81 84
82 85 $ hg diff --nodates
83 86 diff -r ff521236428a .hglf/foo
84 87 --- a/.hglf/foo
85 88 +++ /dev/null
86 89 @@ -1,1 +0,0 @@
87 90 -7f7097b041ccf68cc5561e9600da4655d21c6d18
88 91 diff -r ff521236428a foo
89 92 --- /dev/null
90 93 +++ b/foo
91 94 @@ -0,0 +1,1 @@
92 95 +normal
93 96
94 97 $ cat foo
95 98 normal
96 99
97 100 Largefile in the working copy, keeping the largefile version:
98 101
99 102 $ hg update -q -C -r 1
100 103 $ echo "l" | hg merge --config ui.interactive=Yes
101 104 remote turned local largefile foo into a normal file
102 keep (l)argefile or use (n)ormal file? getting changed largefiles
105 keep (l)argefile or use (n)ormal file? l
106 getting changed largefiles
103 107 1 largefiles updated, 0 removed
104 108 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
105 109 (branch merge, don't forget to commit)
106 110
107 111 $ hg status
108 112
109 113 $ cat foo
110 114 large
111 115
112 116 Whatever ... commit something so we can invoke merge when updating
113 117
114 118 $ hg commit -m '3: Merge'
115 119
116 120 Updating from largefile to normal - no reason to prompt
117 121
118 122 $ hg up -r 2
119 123 getting changed largefiles
120 124 0 largefiles updated, 0 removed
121 125 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
122 126 $ cat foo
123 127 normal
124 128
125 129 (the update above used to leave the working dir in a very weird state - clean it
126 130 $ hg up -qr null
127 131 $ hg up -qr 2
128 132 )
129 133
130 134 Updating from normal to largefile - no reason to prompt
131 135
132 136 $ hg up -r 3
133 137 getting changed largefiles
134 138 1 largefiles updated, 0 removed
135 139 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
136 140 $ cat foo
137 141 large
138 142
139 143 $ cd ..
140 144
141 145
142 146 Systematic testing of merges involving largefiles:
143 147
144 148 Ancestor: normal Parent: normal= Parent: large result: large
145 149 Ancestor: normal Parent: normal2 Parent: large result: ?
146 150 Ancestor: large Parent: large= Parent: normal result: normal
147 151 Ancestor: large Parent: large2 Parent: normal result: ?
148 152
149 153 All cases should try merging both ways.
150 154 "=" means same file content.
151 155
152 156 Prepare test repo:
153 157
154 158 $ hg init merges
155 159 $ cd merges
156 160 $ touch f1
157 161 $ hg ci -Aqm "0-root" --config extensions.largefiles=!
158 162
159 163 Ensure that .hg/largefiles isn't created before largefiles are added
160 164 #if unix-permissions
161 165 $ chmod 555 .hg
162 166 #endif
163 167 $ hg status
164 168 #if unix-permissions
165 169 $ chmod 755 .hg
166 170 #endif
167 171
168 172 $ test -f .hg/largefiles
169 173 [1]
170 174
171 175 ancestor is "normal":
172 176 $ echo normal > f
173 177 $ hg ci -Aqm "1-normal-ancestor"
174 178 $ touch f2
175 179 $ hg ci -Aqm "2-normal-unchanged"
176 180 $ hg tag -l "normal="
177 181 $ echo normal2 > f
178 182 $ hg ci -m "3-normal2"
179 183 $ hg tag -l "normal2"
180 184 $ hg up -qr 1
181 185 $ hg rm f
182 186 $ echo large > f
183 187 $ hg add --large f
184 188 $ hg ci -qm "4-normal-to-large"
185 189 $ hg tag -l "large"
186 190
187 191 $ hg up -qr null
188 192
189 193 ancestor is "large":
190 194 $ echo large > f
191 195 $ hg add --large f
192 196 $ hg ci -qm "5-large-ancestor"
193 197 $ touch f2
194 198 $ hg ci -Aqm "6-large-unchanged"
195 199 $ hg tag -l "large="
196 200 $ echo large2 > f
197 201 $ hg ci -m "7-large2"
198 202 $ hg tag -l "large2"
199 203 $ hg up -qr 5
200 204 $ hg rm f
201 205 $ echo normal > f
202 206 $ hg ci -qAm "8-large-to-normal"
203 207 $ hg tag -l "normal"
204 208
205 209 Ancestor: normal Parent: normal= Parent: large result: large
206 210
207 211 $ hg up -Cqr normal=
208 212 $ hg merge -r large
209 213 getting changed largefiles
210 214 1 largefiles updated, 0 removed
211 215 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
212 216 (branch merge, don't forget to commit)
213 217 $ cat f
214 218 large
215 219
216 220 swap
217 221
218 222 $ hg up -Cqr large
219 223 $ hg merge -r normal=
220 224 getting changed largefiles
221 225 0 largefiles updated, 0 removed
222 226 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
223 227 (branch merge, don't forget to commit)
224 228 $ cat f
225 229 large
226 230
227 231 Ancestor: normal Parent: normal2 Parent: large result: ?
228 232 (annoying extra prompt ... but it do not do any serious harm)
229 233
230 234 $ hg up -Cqr normal2
231 235 $ hg merge -r large
232 236 local changed f which remote deleted
233 237 use (c)hanged version or (d)elete? c
234 238 remote turned local normal file f into a largefile
235 239 use (l)argefile or keep (n)ormal file? l
236 240 getting changed largefiles
237 241 1 largefiles updated, 0 removed
238 242 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
239 243 (branch merge, don't forget to commit)
240 244 $ cat f
241 245 large
242 246
243 247 $ hg up -Cqr normal2
244 248 $ ( echo c; echo n ) | hg merge -r large --config ui.interactive=Yes
245 249 local changed f which remote deleted
246 use (c)hanged version or (d)elete? remote turned local normal file f into a largefile
247 use (l)argefile or keep (n)ormal file? getting changed largefiles
250 use (c)hanged version or (d)elete? c
251 remote turned local normal file f into a largefile
252 use (l)argefile or keep (n)ormal file? n
253 getting changed largefiles
248 254 0 largefiles updated, 0 removed
249 255 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
250 256 (branch merge, don't forget to commit)
251 257 $ cat f
252 258 normal2
253 259
254 260 $ hg up -Cqr normal2
255 261 $ echo d | hg merge -r large --config ui.interactive=Yes
256 262 local changed f which remote deleted
257 use (c)hanged version or (d)elete? getting changed largefiles
263 use (c)hanged version or (d)elete? d
264 getting changed largefiles
258 265 1 largefiles updated, 0 removed
259 266 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
260 267 (branch merge, don't forget to commit)
261 268 $ cat f
262 269 large
263 270
264 271 swap
265 272
266 273 $ hg up -Cqr large
267 274 $ hg merge -r normal2
268 275 remote changed f which local deleted
269 276 use (c)hanged version or leave (d)eleted? c
270 277 remote turned local largefile f into a normal file
271 278 keep (l)argefile or use (n)ormal file? l
272 279 getting changed largefiles
273 280 1 largefiles updated, 0 removed
274 281 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
275 282 (branch merge, don't forget to commit)
276 283 $ cat f
277 284 large
278 285
279 286 $ hg up -Cqr large
280 287 $ ( echo c; echo n ) | hg merge -r normal2 --config ui.interactive=Yes
281 288 remote changed f which local deleted
282 use (c)hanged version or leave (d)eleted? remote turned local largefile f into a normal file
283 keep (l)argefile or use (n)ormal file? getting changed largefiles
289 use (c)hanged version or leave (d)eleted? c
290 remote turned local largefile f into a normal file
291 keep (l)argefile or use (n)ormal file? n
292 getting changed largefiles
284 293 0 largefiles updated, 0 removed
285 294 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
286 295 (branch merge, don't forget to commit)
287 296 $ cat f
288 297 normal2
289 298
290 299 $ hg up -Cqr large
291 300 $ echo d | hg merge -r normal2 --config ui.interactive=Yes
292 301 remote changed f which local deleted
293 use (c)hanged version or leave (d)eleted? getting changed largefiles
302 use (c)hanged version or leave (d)eleted? d
303 getting changed largefiles
294 304 0 largefiles updated, 0 removed
295 305 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
296 306 (branch merge, don't forget to commit)
297 307 $ cat f
298 308 large
299 309
300 310 Ancestor: large Parent: large= Parent: normal result: normal
301 311
302 312 $ hg up -Cqr large=
303 313 $ hg merge -r normal
304 314 getting changed largefiles
305 315 0 largefiles updated, 0 removed
306 316 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
307 317 (branch merge, don't forget to commit)
308 318 $ cat f
309 319 normal
310 320
311 321 swap
312 322
313 323 $ hg up -Cqr normal
314 324 $ hg merge -r large=
315 325 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
316 326 (branch merge, don't forget to commit)
317 327 $ cat f
318 328 normal
319 329
320 330 Ancestor: large Parent: large2 Parent: normal result: ?
321 331 (annoying extra prompt ... but it do not do any serious harm)
322 332
323 333 $ hg up -Cqr large2
324 334 $ hg merge -r normal
325 335 local changed .hglf/f which remote deleted
326 336 use (c)hanged version or (d)elete? c
327 337 remote turned local largefile f into a normal file
328 338 keep (l)argefile or use (n)ormal file? l
329 339 getting changed largefiles
330 340 1 largefiles updated, 0 removed
331 341 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
332 342 (branch merge, don't forget to commit)
333 343 $ cat f
334 344 large2
335 345
336 346 $ hg up -Cqr large2
337 347 $ echo d | hg merge -r normal --config ui.interactive=Yes
338 348 local changed .hglf/f which remote deleted
339 use (c)hanged version or (d)elete? getting changed largefiles
349 use (c)hanged version or (d)elete? d
350 getting changed largefiles
340 351 0 largefiles updated, 0 removed
341 352 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
342 353 (branch merge, don't forget to commit)
343 354 $ cat f
344 355 normal
345 356
346 357 swap
347 358
348 359 $ hg up -Cqr normal
349 360 $ hg merge -r large2
350 361 remote changed .hglf/f which local deleted
351 362 use (c)hanged version or leave (d)eleted? c
352 363 remote turned local normal file f into a largefile
353 364 use (l)argefile or keep (n)ormal file? l
354 365 getting changed largefiles
355 366 1 largefiles updated, 0 removed
356 367 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
357 368 (branch merge, don't forget to commit)
358 369 $ cat f
359 370 large2
360 371
361 372 $ hg up -Cqr normal
362 373 $ echo d | hg merge -r large2 --config ui.interactive=Yes
363 374 remote changed .hglf/f which local deleted
364 use (c)hanged version or leave (d)eleted? 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
375 use (c)hanged version or leave (d)eleted? d
376 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
365 377 (branch merge, don't forget to commit)
366 378 $ cat f
367 379 normal
368 380
369 381 $ cd ..
@@ -1,1310 +1,1318
1 1 $ cat <<EOF >> $HGRCPATH
2 2 > [extensions]
3 3 > keyword =
4 4 > mq =
5 5 > notify =
6 6 > record =
7 7 > transplant =
8 8 > [ui]
9 9 > interactive = true
10 10 > EOF
11 11
12 12 hide outer repo
13 13 $ hg init
14 14
15 15 Run kwdemo before [keyword] files are set up
16 16 as it would succeed without uisetup otherwise
17 17
18 18 $ hg --quiet kwdemo
19 19 [extensions]
20 20 keyword =
21 21 [keyword]
22 22 demo.txt =
23 23 [keywordset]
24 24 svn = False
25 25 [keywordmaps]
26 26 Author = {author|user}
27 27 Date = {date|utcdate}
28 28 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
29 29 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
30 30 RCSFile = {file|basename},v
31 31 RCSfile = {file|basename},v
32 32 Revision = {node|short}
33 33 Source = {root}/{file},v
34 34 $Author: test $
35 35 $Date: ????/??/?? ??:??:?? $ (glob)
36 36 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
37 37 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
38 38 $RCSFile: demo.txt,v $
39 39 $RCSfile: demo.txt,v $
40 40 $Revision: ???????????? $ (glob)
41 41 $Source: */demo.txt,v $ (glob)
42 42
43 43 $ hg --quiet kwdemo "Branch = {branches}"
44 44 [extensions]
45 45 keyword =
46 46 [keyword]
47 47 demo.txt =
48 48 [keywordset]
49 49 svn = False
50 50 [keywordmaps]
51 51 Branch = {branches}
52 52 $Branch: demobranch $
53 53
54 54 $ cat <<EOF >> $HGRCPATH
55 55 > [keyword]
56 56 > ** =
57 57 > b = ignore
58 58 > i = ignore
59 59 > [hooks]
60 60 > EOF
61 61 $ cp $HGRCPATH $HGRCPATH.nohooks
62 62 > cat <<EOF >> $HGRCPATH
63 63 > commit=
64 64 > commit.test=cp a hooktest
65 65 > EOF
66 66
67 67 $ hg init Test-bndl
68 68 $ cd Test-bndl
69 69
70 70 kwshrink should exit silently in empty/invalid repo
71 71
72 72 $ hg kwshrink
73 73
74 74 Symlinks cannot be created on Windows.
75 75 A bundle to test this was made with:
76 76 hg init t
77 77 cd t
78 78 echo a > a
79 79 ln -s a sym
80 80 hg add sym
81 81 hg ci -m addsym -u mercurial
82 82 hg bundle --base null ../test-keyword.hg
83 83
84 84 $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg
85 85 pulling from *test-keyword.hg (glob)
86 86 requesting all changes
87 87 adding changesets
88 88 adding manifests
89 89 adding file changes
90 90 added 1 changesets with 1 changes to 1 files
91 91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 92
93 93 $ echo 'expand $Id$' > a
94 94 $ echo 'do not process $Id:' >> a
95 95 $ echo 'xxx $' >> a
96 96 $ echo 'ignore $Id$' > b
97 97
98 98 Output files as they were created
99 99
100 100 $ cat a b
101 101 expand $Id$
102 102 do not process $Id:
103 103 xxx $
104 104 ignore $Id$
105 105
106 106 no kwfiles
107 107
108 108 $ hg kwfiles
109 109
110 110 untracked candidates
111 111
112 112 $ hg -v kwfiles --unknown
113 113 k a
114 114
115 115 Add files and check status
116 116
117 117 $ hg addremove
118 118 adding a
119 119 adding b
120 120 $ hg status
121 121 A a
122 122 A b
123 123
124 124
125 125 Default keyword expansion including commit hook
126 126 Interrupted commit should not change state or run commit hook
127 127
128 128 $ hg --debug commit
129 129 abort: empty commit message
130 130 [255]
131 131 $ hg status
132 132 A a
133 133 A b
134 134
135 135 Commit with several checks
136 136
137 137 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
138 138 a
139 139 b
140 140 overwriting a expanding keywords
141 141 running hook commit.test: cp a hooktest
142 142 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
143 143 $ hg status
144 144 ? hooktest
145 145 $ hg debugrebuildstate
146 146 $ hg --quiet identify
147 147 ef63ca68695b
148 148
149 149 cat files in working directory with keywords expanded
150 150
151 151 $ cat a b
152 152 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
153 153 do not process $Id:
154 154 xxx $
155 155 ignore $Id$
156 156
157 157 hg cat files and symlink, no expansion
158 158
159 159 $ hg cat sym a b && echo
160 160 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
161 161 do not process $Id:
162 162 xxx $
163 163 ignore $Id$
164 164 a
165 165
166 166 $ diff a hooktest
167 167
168 168 $ cp $HGRCPATH.nohooks $HGRCPATH
169 169 $ rm hooktest
170 170
171 171 hg status of kw-ignored binary file starting with '\1\n'
172 172
173 173 >>> open("i", "wb").write("\1\nfoo")
174 174 $ hg -q commit -Am metasep i
175 175 $ hg status
176 176 >>> open("i", "wb").write("\1\nbar")
177 177 $ hg status
178 178 M i
179 179 $ hg -q commit -m "modify metasep" i
180 180 $ hg status --rev 2:3
181 181 M i
182 182 $ touch empty
183 183 $ hg -q commit -A -m "another file"
184 184 $ hg status -A --rev 3:4 i
185 185 C i
186 186
187 187 $ hg -q strip -n 2
188 188
189 189 Test hook execution
190 190
191 191 bundle
192 192
193 193 $ hg bundle --base null ../kw.hg
194 194 2 changesets found
195 195 $ cd ..
196 196 $ hg init Test
197 197 $ cd Test
198 198
199 199 Notify on pull to check whether keywords stay as is in email
200 200 ie. if patch.diff wrapper acts as it should
201 201
202 202 $ cat <<EOF >> $HGRCPATH
203 203 > [hooks]
204 204 > incoming.notify = python:hgext.notify.hook
205 205 > [notify]
206 206 > sources = pull
207 207 > diffstat = False
208 208 > maxsubject = 15
209 209 > [reposubs]
210 210 > * = Test
211 211 > EOF
212 212
213 213 Pull from bundle and trigger notify
214 214
215 215 $ hg pull -u ../kw.hg
216 216 pulling from ../kw.hg
217 217 requesting all changes
218 218 adding changesets
219 219 adding manifests
220 220 adding file changes
221 221 added 2 changesets with 3 changes to 3 files
222 222 Content-Type: text/plain; charset="us-ascii"
223 223 MIME-Version: 1.0
224 224 Content-Transfer-Encoding: 7bit
225 225 Date: * (glob)
226 226 Subject: changeset in...
227 227 From: mercurial
228 228 X-Hg-Notification: changeset a2392c293916
229 229 Message-Id: <hg.a2392c293916*> (glob)
230 230 To: Test
231 231
232 232 changeset a2392c293916 in $TESTTMP/Test (glob)
233 233 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
234 234 description:
235 235 addsym
236 236
237 237 diffs (6 lines):
238 238
239 239 diff -r 000000000000 -r a2392c293916 sym
240 240 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
241 241 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
242 242 @@ -0,0 +1,1 @@
243 243 +a
244 244 \ No newline at end of file
245 245 Content-Type: text/plain; charset="us-ascii"
246 246 MIME-Version: 1.0
247 247 Content-Transfer-Encoding: 7bit
248 248 Date:* (glob)
249 249 Subject: changeset in...
250 250 From: User Name <user@example.com>
251 251 X-Hg-Notification: changeset ef63ca68695b
252 252 Message-Id: <hg.ef63ca68695b*> (glob)
253 253 To: Test
254 254
255 255 changeset ef63ca68695b in $TESTTMP/Test (glob)
256 256 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
257 257 description:
258 258 absym
259 259
260 260 diffs (12 lines):
261 261
262 262 diff -r a2392c293916 -r ef63ca68695b a
263 263 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
264 264 +++ b/a Thu Jan 01 00:00:00 1970 +0000
265 265 @@ -0,0 +1,3 @@
266 266 +expand $Id$
267 267 +do not process $Id:
268 268 +xxx $
269 269 diff -r a2392c293916 -r ef63ca68695b b
270 270 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
271 271 +++ b/b Thu Jan 01 00:00:00 1970 +0000
272 272 @@ -0,0 +1,1 @@
273 273 +ignore $Id$
274 274 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
275 275
276 276 $ cp $HGRCPATH.nohooks $HGRCPATH
277 277
278 278 Touch files and check with status
279 279
280 280 $ touch a b
281 281 $ hg status
282 282
283 283 Update and expand
284 284
285 285 $ rm sym a b
286 286 $ hg update -C
287 287 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
288 288 $ cat a b
289 289 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
290 290 do not process $Id:
291 291 xxx $
292 292 ignore $Id$
293 293
294 294 Check whether expansion is filewise and file mode is preserved
295 295
296 296 $ echo '$Id$' > c
297 297 $ echo 'tests for different changenodes' >> c
298 298 #if unix-permissions
299 299 $ chmod 600 c
300 300 $ ls -l c | cut -b 1-10
301 301 -rw-------
302 302 #endif
303 303
304 304 commit file c
305 305
306 306 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
307 307 adding c
308 308 #if unix-permissions
309 309 $ ls -l c | cut -b 1-10
310 310 -rw-------
311 311 #endif
312 312
313 313 force expansion
314 314
315 315 $ hg -v kwexpand
316 316 overwriting a expanding keywords
317 317 overwriting c expanding keywords
318 318
319 319 compare changenodes in a and c
320 320
321 321 $ cat a c
322 322 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
323 323 do not process $Id:
324 324 xxx $
325 325 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
326 326 tests for different changenodes
327 327
328 328 record
329 329
330 330 $ echo '$Id$' > r
331 331 $ hg add r
332 332
333 333 record chunk
334 334
335 335 >>> lines = open('a', 'rb').readlines()
336 336 >>> lines.insert(1, 'foo\n')
337 337 >>> lines.append('bar\n')
338 338 >>> open('a', 'wb').writelines(lines)
339 339 $ hg record -d '10 1' -m rectest a<<EOF
340 340 > y
341 341 > y
342 342 > n
343 343 > EOF
344 344 diff --git a/a b/a
345 345 2 hunks, 2 lines changed
346 examine changes to 'a'? [Ynesfdaq?]
346 examine changes to 'a'? [Ynesfdaq?] y
347
347 348 @@ -1,3 +1,4 @@
348 349 expand $Id$
349 350 +foo
350 351 do not process $Id:
351 352 xxx $
352 record change 1/2 to 'a'? [Ynesfdaq?]
353 record change 1/2 to 'a'? [Ynesfdaq?] y
354
353 355 @@ -2,2 +3,3 @@
354 356 do not process $Id:
355 357 xxx $
356 358 +bar
357 record change 2/2 to 'a'? [Ynesfdaq?]
359 record change 2/2 to 'a'? [Ynesfdaq?] n
360
358 361
359 362 $ hg identify
360 363 5f5eb23505c3+ tip
361 364 $ hg status
362 365 M a
363 366 A r
364 367
365 368 Cat modified file a
366 369
367 370 $ cat a
368 371 expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
369 372 foo
370 373 do not process $Id:
371 374 xxx $
372 375 bar
373 376
374 377 Diff remaining chunk
375 378
376 379 $ hg diff a
377 380 diff -r 5f5eb23505c3 a
378 381 --- a/a Thu Jan 01 00:00:09 1970 -0000
379 382 +++ b/a * (glob)
380 383 @@ -2,3 +2,4 @@
381 384 foo
382 385 do not process $Id:
383 386 xxx $
384 387 +bar
385 388
386 389 $ hg rollback
387 390 repository tip rolled back to revision 2 (undo commit)
388 391 working directory now based on revision 2
389 392
390 393 Record all chunks in file a
391 394
392 395 $ echo foo > msg
393 396
394 397 - do not use "hg record -m" here!
395 398
396 399 $ hg record -l msg -d '11 1' a<<EOF
397 400 > y
398 401 > y
399 402 > y
400 403 > EOF
401 404 diff --git a/a b/a
402 405 2 hunks, 2 lines changed
403 examine changes to 'a'? [Ynesfdaq?]
406 examine changes to 'a'? [Ynesfdaq?] y
407
404 408 @@ -1,3 +1,4 @@
405 409 expand $Id$
406 410 +foo
407 411 do not process $Id:
408 412 xxx $
409 record change 1/2 to 'a'? [Ynesfdaq?]
413 record change 1/2 to 'a'? [Ynesfdaq?] y
414
410 415 @@ -2,2 +3,3 @@
411 416 do not process $Id:
412 417 xxx $
413 418 +bar
414 record change 2/2 to 'a'? [Ynesfdaq?]
419 record change 2/2 to 'a'? [Ynesfdaq?] y
420
415 421
416 422 File a should be clean
417 423
418 424 $ hg status -A a
419 425 C a
420 426
421 427 rollback and revert expansion
422 428
423 429 $ cat a
424 430 expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
425 431 foo
426 432 do not process $Id:
427 433 xxx $
428 434 bar
429 435 $ hg --verbose rollback
430 436 repository tip rolled back to revision 2 (undo commit)
431 437 working directory now based on revision 2
432 438 overwriting a expanding keywords
433 439 $ hg status a
434 440 M a
435 441 $ cat a
436 442 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
437 443 foo
438 444 do not process $Id:
439 445 xxx $
440 446 bar
441 447 $ echo '$Id$' > y
442 448 $ echo '$Id$' > z
443 449 $ hg add y
444 450 $ hg commit -Am "rollback only" z
445 451 $ cat z
446 452 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
447 453 $ hg --verbose rollback
448 454 repository tip rolled back to revision 2 (undo commit)
449 455 working directory now based on revision 2
450 456 overwriting z shrinking keywords
451 457
452 458 Only z should be overwritten
453 459
454 460 $ hg status a y z
455 461 M a
456 462 A y
457 463 A z
458 464 $ cat z
459 465 $Id$
460 466 $ hg forget y z
461 467 $ rm y z
462 468
463 469 record added file alone
464 470
465 471 $ hg -v record -l msg -d '12 2' r<<EOF
466 472 > y
467 473 > EOF
468 474 diff --git a/r b/r
469 475 new file mode 100644
470 examine changes to 'r'? [Ynesfdaq?]
476 examine changes to 'r'? [Ynesfdaq?] y
477
471 478 r
472 479 committed changeset 3:82a2f715724d
473 480 overwriting r expanding keywords
474 481 - status call required for dirstate.normallookup() check
475 482 $ hg status r
476 483 $ hg --verbose rollback
477 484 repository tip rolled back to revision 2 (undo commit)
478 485 working directory now based on revision 2
479 486 overwriting r shrinking keywords
480 487 $ hg forget r
481 488 $ rm msg r
482 489 $ hg update -C
483 490 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
484 491
485 492 record added keyword ignored file
486 493
487 494 $ echo '$Id$' > i
488 495 $ hg add i
489 496 $ hg --verbose record -d '13 1' -m recignored<<EOF
490 497 > y
491 498 > EOF
492 499 diff --git a/i b/i
493 500 new file mode 100644
494 examine changes to 'i'? [Ynesfdaq?]
501 examine changes to 'i'? [Ynesfdaq?] y
502
495 503 i
496 504 committed changeset 3:9f40ceb5a072
497 505 $ cat i
498 506 $Id$
499 507 $ hg -q rollback
500 508 $ hg forget i
501 509 $ rm i
502 510
503 511 amend
504 512
505 513 $ echo amend >> a
506 514 $ echo amend >> b
507 515 $ hg -q commit -d '14 1' -m 'prepare amend'
508 516
509 517 $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
510 518 overwriting a expanding keywords
511 519 $ hg -q id
512 520 67d8c481a6be
513 521 $ head -1 a
514 522 expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $
515 523
516 524 $ hg -q strip -n tip
517 525
518 526 Test patch queue repo
519 527
520 528 $ hg init --mq
521 529 $ hg qimport -r tip -n mqtest.diff
522 530 $ hg commit --mq -m mqtest
523 531
524 532 Keywords should not be expanded in patch
525 533
526 534 $ cat .hg/patches/mqtest.diff
527 535 # HG changeset patch
528 536 # User User Name <user@example.com>
529 537 # Date 1 0
530 538 # Thu Jan 01 00:00:01 1970 +0000
531 539 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
532 540 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
533 541 cndiff
534 542
535 543 diff -r ef63ca68695b -r 40a904bbbe4c c
536 544 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
537 545 +++ b/c Thu Jan 01 00:00:01 1970 +0000
538 546 @@ -0,0 +1,2 @@
539 547 +$Id$
540 548 +tests for different changenodes
541 549
542 550 $ hg qpop
543 551 popping mqtest.diff
544 552 patch queue now empty
545 553
546 554 qgoto, implying qpush, should expand
547 555
548 556 $ hg qgoto mqtest.diff
549 557 applying mqtest.diff
550 558 now at: mqtest.diff
551 559 $ cat c
552 560 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
553 561 tests for different changenodes
554 562 $ hg cat c
555 563 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
556 564 tests for different changenodes
557 565
558 566 Keywords should not be expanded in filelog
559 567
560 568 $ hg --config 'extensions.keyword=!' cat c
561 569 $Id$
562 570 tests for different changenodes
563 571
564 572 qpop and move on
565 573
566 574 $ hg qpop
567 575 popping mqtest.diff
568 576 patch queue now empty
569 577
570 578 Copy and show added kwfiles
571 579
572 580 $ hg cp a c
573 581 $ hg kwfiles
574 582 a
575 583 c
576 584
577 585 Commit and show expansion in original and copy
578 586
579 587 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
580 588 invalid branchheads cache (served): tip differs
581 589 c
582 590 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
583 591 invalid branchheads cache (served): tip differs
584 592 overwriting c expanding keywords
585 593 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
586 594 $ cat a c
587 595 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
588 596 do not process $Id:
589 597 xxx $
590 598 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
591 599 do not process $Id:
592 600 xxx $
593 601
594 602 Touch copied c and check its status
595 603
596 604 $ touch c
597 605 $ hg status
598 606
599 607 Copy kwfile to keyword ignored file unexpanding keywords
600 608
601 609 $ hg --verbose copy a i
602 610 copying a to i
603 611 overwriting i shrinking keywords
604 612 $ head -n 1 i
605 613 expand $Id$
606 614 $ hg forget i
607 615 $ rm i
608 616
609 617 Copy ignored file to ignored file: no overwriting
610 618
611 619 $ hg --verbose copy b i
612 620 copying b to i
613 621 $ hg forget i
614 622 $ rm i
615 623
616 624 cp symlink file; hg cp -A symlink file (part1)
617 625 - copied symlink points to kwfile: overwrite
618 626
619 627 #if symlink
620 628 $ cp sym i
621 629 $ ls -l i
622 630 -rw-r--r--* (glob)
623 631 $ head -1 i
624 632 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
625 633 $ hg copy --after --verbose sym i
626 634 copying sym to i
627 635 overwriting i shrinking keywords
628 636 $ head -1 i
629 637 expand $Id$
630 638 $ hg forget i
631 639 $ rm i
632 640 #endif
633 641
634 642 Test different options of hg kwfiles
635 643
636 644 $ hg kwfiles
637 645 a
638 646 c
639 647 $ hg -v kwfiles --ignore
640 648 I b
641 649 I sym
642 650 $ hg kwfiles --all
643 651 K a
644 652 K c
645 653 I b
646 654 I sym
647 655
648 656 Diff specific revision
649 657
650 658 $ hg diff --rev 1
651 659 diff -r ef63ca68695b c
652 660 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
653 661 +++ b/c * (glob)
654 662 @@ -0,0 +1,3 @@
655 663 +expand $Id$
656 664 +do not process $Id:
657 665 +xxx $
658 666
659 667 Status after rollback:
660 668
661 669 $ hg rollback
662 670 repository tip rolled back to revision 1 (undo commit)
663 671 working directory now based on revision 1
664 672 $ hg status
665 673 A c
666 674 $ hg update --clean
667 675 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
668 676
669 677 #if symlink
670 678
671 679 cp symlink file; hg cp -A symlink file (part2)
672 680 - copied symlink points to kw ignored file: do not overwrite
673 681
674 682 $ cat a > i
675 683 $ ln -s i symignored
676 684 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
677 685 $ cp symignored x
678 686 $ hg copy --after --verbose symignored x
679 687 copying symignored to x
680 688 $ head -n 1 x
681 689 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
682 690 $ hg forget x
683 691 $ rm x
684 692
685 693 $ hg rollback
686 694 repository tip rolled back to revision 1 (undo commit)
687 695 working directory now based on revision 1
688 696 $ hg update --clean
689 697 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
690 698 $ rm i symignored
691 699
692 700 #endif
693 701
694 702 Custom keywordmaps as argument to kwdemo
695 703
696 704 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
697 705 [extensions]
698 706 keyword =
699 707 [keyword]
700 708 ** =
701 709 b = ignore
702 710 demo.txt =
703 711 i = ignore
704 712 [keywordset]
705 713 svn = False
706 714 [keywordmaps]
707 715 Xinfo = {author}: {desc}
708 716 $Xinfo: test: hg keyword configuration and expansion example $
709 717
710 718 Configure custom keywordmaps
711 719
712 720 $ cat <<EOF >>$HGRCPATH
713 721 > [keywordmaps]
714 722 > Id = {file} {node|short} {date|rfc822date} {author|user}
715 723 > Xinfo = {author}: {desc}
716 724 > EOF
717 725
718 726 Cat and hg cat files before custom expansion
719 727
720 728 $ cat a b
721 729 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
722 730 do not process $Id:
723 731 xxx $
724 732 ignore $Id$
725 733 $ hg cat sym a b && echo
726 734 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
727 735 do not process $Id:
728 736 xxx $
729 737 ignore $Id$
730 738 a
731 739
732 740 Write custom keyword and prepare multi-line commit message
733 741
734 742 $ echo '$Xinfo$' >> a
735 743 $ cat <<EOF >> log
736 744 > firstline
737 745 > secondline
738 746 > EOF
739 747
740 748 Interrupted commit should not change state
741 749
742 750 $ hg commit
743 751 abort: empty commit message
744 752 [255]
745 753 $ hg status
746 754 M a
747 755 ? c
748 756 ? log
749 757
750 758 Commit with multi-line message and custom expansion
751 759
752 760 |Note:
753 761 |
754 762 | After the last rollback, the "served" branchheads cache became invalid, but
755 763 | all changesets in the repo were public. For filtering this means:
756 764 | "immutable" == "served" == ø.
757 765 |
758 766 | As the "served" cache is invalid, we fall back to the "immutable" cache. But
759 767 | no update is needed between "immutable" and "served" and the "served" cache
760 768 | is not updated on disk. The on-disk version therefore stays invalid for some
761 769 | time. This explains why the "served" branchheads cache is detected as
762 770 | invalid here.
763 771
764 772 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
765 773 invalid branchheads cache (served): tip differs
766 774 a
767 775 invalid branchheads cache (served): tip differs
768 776 overwriting a expanding keywords
769 777 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
770 778 $ rm log
771 779
772 780 Stat, verify and show custom expansion (firstline)
773 781
774 782 $ hg status
775 783 ? c
776 784 $ hg verify
777 785 checking changesets
778 786 checking manifests
779 787 crosschecking files in changesets and manifests
780 788 checking files
781 789 3 files, 3 changesets, 4 total revisions
782 790 $ cat a b
783 791 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
784 792 do not process $Id:
785 793 xxx $
786 794 $Xinfo: User Name <user@example.com>: firstline $
787 795 ignore $Id$
788 796 $ hg cat sym a b && echo
789 797 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
790 798 do not process $Id:
791 799 xxx $
792 800 $Xinfo: User Name <user@example.com>: firstline $
793 801 ignore $Id$
794 802 a
795 803
796 804 annotate
797 805
798 806 $ hg annotate a
799 807 1: expand $Id$
800 808 1: do not process $Id:
801 809 1: xxx $
802 810 2: $Xinfo$
803 811
804 812 remove with status checks
805 813
806 814 $ hg debugrebuildstate
807 815 $ hg remove a
808 816 $ hg --debug commit -m rma
809 817 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
810 818 $ hg status
811 819 ? c
812 820
813 821 Rollback, revert, and check expansion
814 822
815 823 $ hg rollback
816 824 repository tip rolled back to revision 2 (undo commit)
817 825 working directory now based on revision 2
818 826 $ hg status
819 827 R a
820 828 ? c
821 829 $ hg revert --no-backup --rev tip a
822 830 $ cat a
823 831 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
824 832 do not process $Id:
825 833 xxx $
826 834 $Xinfo: User Name <user@example.com>: firstline $
827 835
828 836 Clone to test global and local configurations
829 837
830 838 $ cd ..
831 839
832 840 Expansion in destination with global configuration
833 841
834 842 $ hg --quiet clone Test globalconf
835 843 $ cat globalconf/a
836 844 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
837 845 do not process $Id:
838 846 xxx $
839 847 $Xinfo: User Name <user@example.com>: firstline $
840 848
841 849 No expansion in destination with local configuration in origin only
842 850
843 851 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
844 852 $ cat localconf/a
845 853 expand $Id$
846 854 do not process $Id:
847 855 xxx $
848 856 $Xinfo$
849 857
850 858 Clone to test incoming
851 859
852 860 $ hg clone -r1 Test Test-a
853 861 adding changesets
854 862 adding manifests
855 863 adding file changes
856 864 added 2 changesets with 3 changes to 3 files
857 865 updating to branch default
858 866 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
859 867 $ cd Test-a
860 868 $ cat <<EOF >> .hg/hgrc
861 869 > [paths]
862 870 > default = ../Test
863 871 > EOF
864 872 $ hg incoming
865 873 comparing with $TESTTMP/Test (glob)
866 874 searching for changes
867 875 changeset: 2:bb948857c743
868 876 tag: tip
869 877 user: User Name <user@example.com>
870 878 date: Thu Jan 01 00:00:02 1970 +0000
871 879 summary: firstline
872 880
873 881 Imported patch should not be rejected
874 882
875 883 >>> import re
876 884 >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
877 885 >>> open('a', 'wb').write(text)
878 886 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
879 887 a
880 888 overwriting a expanding keywords
881 889 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
882 890 $ hg export -o ../rejecttest.diff tip
883 891 $ cd ../Test
884 892 $ hg import ../rejecttest.diff
885 893 applying ../rejecttest.diff
886 894 $ cat a b
887 895 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
888 896 do not process $Id: rejecttest
889 897 xxx $
890 898 $Xinfo: User Name <user@example.com>: rejects? $
891 899 ignore $Id$
892 900
893 901 $ hg rollback
894 902 repository tip rolled back to revision 2 (undo import)
895 903 working directory now based on revision 2
896 904 $ hg update --clean
897 905 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
898 906
899 907 kwexpand/kwshrink on selected files
900 908
901 909 $ mkdir x
902 910 $ hg copy a x/a
903 911 $ hg --verbose kwshrink a
904 912 overwriting a shrinking keywords
905 913 - sleep required for dirstate.normal() check
906 914 $ sleep 1
907 915 $ hg status a
908 916 $ hg --verbose kwexpand a
909 917 overwriting a expanding keywords
910 918 $ hg status a
911 919
912 920 kwexpand x/a should abort
913 921
914 922 $ hg --verbose kwexpand x/a
915 923 abort: outstanding uncommitted changes
916 924 [255]
917 925 $ cd x
918 926 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
919 927 x/a
920 928 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
921 929 overwriting x/a expanding keywords
922 930 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
923 931 $ cat a
924 932 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
925 933 do not process $Id:
926 934 xxx $
927 935 $Xinfo: User Name <user@example.com>: xa $
928 936
929 937 kwshrink a inside directory x
930 938
931 939 $ hg --verbose kwshrink a
932 940 overwriting x/a shrinking keywords
933 941 $ cat a
934 942 expand $Id$
935 943 do not process $Id:
936 944 xxx $
937 945 $Xinfo$
938 946 $ cd ..
939 947
940 948 kwexpand nonexistent
941 949
942 950 $ hg kwexpand nonexistent
943 951 nonexistent:* (glob)
944 952
945 953
946 954 #if serve
947 955 hg serve
948 956 - expand with hgweb file
949 957 - no expansion with hgweb annotate/changeset/filediff
950 958 - check errors
951 959
952 960 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
953 961 $ cat hg.pid >> $DAEMON_PIDS
954 962 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/a/?style=raw'
955 963 200 Script output follows
956 964
957 965 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
958 966 do not process $Id:
959 967 xxx $
960 968 $Xinfo: User Name <user@example.com>: firstline $
961 969 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/a/?style=raw'
962 970 200 Script output follows
963 971
964 972
965 973 user@1: expand $Id$
966 974 user@1: do not process $Id:
967 975 user@1: xxx $
968 976 user@2: $Xinfo$
969 977
970 978
971 979
972 980
973 981 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'rev/tip/?style=raw'
974 982 200 Script output follows
975 983
976 984
977 985 # HG changeset patch
978 986 # User User Name <user@example.com>
979 987 # Date 3 0
980 988 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
981 989 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
982 990 xa
983 991
984 992 diff -r bb948857c743 -r b4560182a3f9 x/a
985 993 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
986 994 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
987 995 @@ -0,0 +1,4 @@
988 996 +expand $Id$
989 997 +do not process $Id:
990 998 +xxx $
991 999 +$Xinfo$
992 1000
993 1001 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'diff/bb948857c743/a?style=raw'
994 1002 200 Script output follows
995 1003
996 1004
997 1005 diff -r ef63ca68695b -r bb948857c743 a
998 1006 --- a/a Thu Jan 01 00:00:00 1970 +0000
999 1007 +++ b/a Thu Jan 01 00:00:02 1970 +0000
1000 1008 @@ -1,3 +1,4 @@
1001 1009 expand $Id$
1002 1010 do not process $Id:
1003 1011 xxx $
1004 1012 +$Xinfo$
1005 1013
1006 1014
1007 1015
1008 1016
1009 1017 $ cat errors.log
1010 1018 #endif
1011 1019
1012 1020 Prepare merge and resolve tests
1013 1021
1014 1022 $ echo '$Id$' > m
1015 1023 $ hg add m
1016 1024 $ hg commit -m 4kw
1017 1025 $ echo foo >> m
1018 1026 $ hg commit -m 5foo
1019 1027
1020 1028 simplemerge
1021 1029
1022 1030 $ hg update 4
1023 1031 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1024 1032 $ echo foo >> m
1025 1033 $ hg commit -m 6foo
1026 1034 created new head
1027 1035 $ hg merge
1028 1036 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1029 1037 (branch merge, don't forget to commit)
1030 1038 $ hg commit -m simplemerge
1031 1039 $ cat m
1032 1040 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
1033 1041 foo
1034 1042
1035 1043 conflict: keyword should stay outside conflict zone
1036 1044
1037 1045 $ hg update 4
1038 1046 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1039 1047 $ echo bar >> m
1040 1048 $ hg commit -m 8bar
1041 1049 created new head
1042 1050 $ hg merge
1043 1051 merging m
1044 1052 warning: conflicts during merge.
1045 1053 merging m incomplete! (edit conflicts, then use 'hg resolve --mark')
1046 1054 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1047 1055 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1048 1056 [1]
1049 1057 $ cat m
1050 1058 $Id$
1051 1059 <<<<<<< local: 88a80c8d172e - test: 8bar
1052 1060 bar
1053 1061 =======
1054 1062 foo
1055 1063 >>>>>>> other: 85d2d2d732a5 - test: simplemerge
1056 1064
1057 1065 resolve to local
1058 1066
1059 1067 $ HGMERGE=internal:local hg resolve -a
1060 1068 (no more unresolved files)
1061 1069 $ hg commit -m localresolve
1062 1070 $ cat m
1063 1071 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1064 1072 bar
1065 1073
1066 1074 Test restricted mode with transplant -b
1067 1075
1068 1076 $ hg update 6
1069 1077 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1070 1078 $ hg branch foo
1071 1079 marked working directory as branch foo
1072 1080 (branches are permanent and global, did you want a bookmark?)
1073 1081 $ mv a a.bak
1074 1082 $ echo foobranch > a
1075 1083 $ cat a.bak >> a
1076 1084 $ rm a.bak
1077 1085 $ hg commit -m 9foobranch
1078 1086 $ hg update default
1079 1087 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1080 1088 $ hg -y transplant -b foo tip
1081 1089 applying 4aa30d025d50
1082 1090 4aa30d025d50 transplanted to e00abbf63521
1083 1091
1084 1092 Expansion in changeset but not in file
1085 1093
1086 1094 $ hg tip -p
1087 1095 changeset: 11:e00abbf63521
1088 1096 tag: tip
1089 1097 parent: 9:800511b3a22d
1090 1098 user: test
1091 1099 date: Thu Jan 01 00:00:00 1970 +0000
1092 1100 summary: 9foobranch
1093 1101
1094 1102 diff -r 800511b3a22d -r e00abbf63521 a
1095 1103 --- a/a Thu Jan 01 00:00:00 1970 +0000
1096 1104 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1097 1105 @@ -1,3 +1,4 @@
1098 1106 +foobranch
1099 1107 expand $Id$
1100 1108 do not process $Id:
1101 1109 xxx $
1102 1110
1103 1111 $ head -n 2 a
1104 1112 foobranch
1105 1113 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1106 1114
1107 1115 Turn off expansion
1108 1116
1109 1117 $ hg -q rollback
1110 1118 $ hg -q update -C
1111 1119
1112 1120 kwshrink with unknown file u
1113 1121
1114 1122 $ cp a u
1115 1123 $ hg --verbose kwshrink
1116 1124 overwriting a shrinking keywords
1117 1125 overwriting m shrinking keywords
1118 1126 overwriting x/a shrinking keywords
1119 1127
1120 1128 Keywords shrunk in working directory, but not yet disabled
1121 1129 - cat shows unexpanded keywords
1122 1130 - hg cat shows expanded keywords
1123 1131
1124 1132 $ cat a b
1125 1133 expand $Id$
1126 1134 do not process $Id:
1127 1135 xxx $
1128 1136 $Xinfo$
1129 1137 ignore $Id$
1130 1138 $ hg cat sym a b && echo
1131 1139 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1132 1140 do not process $Id:
1133 1141 xxx $
1134 1142 $Xinfo: User Name <user@example.com>: firstline $
1135 1143 ignore $Id$
1136 1144 a
1137 1145
1138 1146 Now disable keyword expansion
1139 1147
1140 1148 $ cp $HGRCPATH $HGRCPATH.backup
1141 1149 $ rm "$HGRCPATH"
1142 1150 $ cat a b
1143 1151 expand $Id$
1144 1152 do not process $Id:
1145 1153 xxx $
1146 1154 $Xinfo$
1147 1155 ignore $Id$
1148 1156 $ hg cat sym a b && echo
1149 1157 expand $Id$
1150 1158 do not process $Id:
1151 1159 xxx $
1152 1160 $Xinfo$
1153 1161 ignore $Id$
1154 1162 a
1155 1163
1156 1164 enable keyword expansion again
1157 1165
1158 1166 $ cat $HGRCPATH.backup >> $HGRCPATH
1159 1167
1160 1168 Test restricted mode with unshelve
1161 1169
1162 1170 $ cat <<EOF >> $HGRCPATH
1163 1171 > [extensions]
1164 1172 > shelve =
1165 1173 > EOF
1166 1174
1167 1175 $ echo xxxx >> a
1168 1176 $ hg diff
1169 1177 diff -r 800511b3a22d a
1170 1178 --- a/a Thu Jan 01 00:00:00 1970 +0000
1171 1179 +++ b/a * (glob)
1172 1180 @@ -2,3 +2,4 @@
1173 1181 do not process $Id:
1174 1182 xxx $
1175 1183 $Xinfo$
1176 1184 +xxxx
1177 1185 $ hg shelve -q --name tmp
1178 1186 $ hg shelve --list --patch
1179 1187 tmp (*) changes to 'localresolve' (glob)
1180 1188
1181 1189 diff --git a/a b/a
1182 1190 --- a/a
1183 1191 +++ b/a
1184 1192 @@ -2,3 +2,4 @@
1185 1193 do not process $Id:
1186 1194 xxx $
1187 1195 $Xinfo$
1188 1196 +xxxx
1189 1197
1190 1198 $ hg update -q -C 10
1191 1199 $ hg unshelve -q tmp
1192 1200 $ hg diff
1193 1201 diff -r 4aa30d025d50 a
1194 1202 --- a/a Thu Jan 01 00:00:00 1970 +0000
1195 1203 +++ b/a * (glob)
1196 1204 @@ -3,3 +3,4 @@
1197 1205 do not process $Id:
1198 1206 xxx $
1199 1207 $Xinfo$
1200 1208 +xxxx
1201 1209
1202 1210 Test restricted mode with rebase
1203 1211
1204 1212 $ cat <<EOF >> $HGRCPATH
1205 1213 > [extensions]
1206 1214 > rebase =
1207 1215 > EOF
1208 1216
1209 1217 $ hg update -q -C 9
1210 1218
1211 1219 $ echo xxxx >> a
1212 1220 $ hg commit -m '#11'
1213 1221 $ hg diff -c 11
1214 1222 diff -r 800511b3a22d -r b07670694489 a
1215 1223 --- a/a Thu Jan 01 00:00:00 1970 +0000
1216 1224 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1217 1225 @@ -2,3 +2,4 @@
1218 1226 do not process $Id:
1219 1227 xxx $
1220 1228 $Xinfo$
1221 1229 +xxxx
1222 1230
1223 1231 $ hg diff -c 10
1224 1232 diff -r 27d48ee14f67 -r 4aa30d025d50 a
1225 1233 --- a/a Thu Jan 01 00:00:00 1970 +0000
1226 1234 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1227 1235 @@ -1,3 +1,4 @@
1228 1236 +foobranch
1229 1237 expand $Id$
1230 1238 do not process $Id:
1231 1239 xxx $
1232 1240
1233 1241 $ hg rebase -q -s 10 -d 11 --keep
1234 1242 $ hg diff -r 9 -r 12 a
1235 1243 diff -r 800511b3a22d -r 1939b927726c a
1236 1244 --- a/a Thu Jan 01 00:00:00 1970 +0000
1237 1245 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1238 1246 @@ -1,4 +1,6 @@
1239 1247 +foobranch
1240 1248 expand $Id$
1241 1249 do not process $Id:
1242 1250 xxx $
1243 1251 $Xinfo$
1244 1252 +xxxx
1245 1253
1246 1254 Test restricted mode with graft
1247 1255
1248 1256 $ hg graft -q 10
1249 1257 $ hg diff -r 9 -r 13 a
1250 1258 diff -r 800511b3a22d -r 01a68de1003a a
1251 1259 --- a/a Thu Jan 01 00:00:00 1970 +0000
1252 1260 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1253 1261 @@ -1,4 +1,6 @@
1254 1262 +foobranch
1255 1263 expand $Id$
1256 1264 do not process $Id:
1257 1265 xxx $
1258 1266 $Xinfo$
1259 1267 +xxxx
1260 1268
1261 1269 Test restricted mode with backout
1262 1270
1263 1271 $ hg backout -q 11
1264 1272 $ hg diff a
1265 1273 diff -r 01a68de1003a a
1266 1274 --- a/a Thu Jan 01 00:00:00 1970 +0000
1267 1275 +++ b/a * (glob)
1268 1276 @@ -3,4 +3,3 @@
1269 1277 do not process $Id:
1270 1278 xxx $
1271 1279 $Xinfo$
1272 1280 -xxxx
1273 1281
1274 1282 Test restricted mode with histedit
1275 1283
1276 1284 $ cat <<EOF >> $HGRCPATH
1277 1285 > [extensions]
1278 1286 > histedit =
1279 1287 > EOF
1280 1288
1281 1289 $ hg commit -m 'backout #11'
1282 1290 $ hg histedit -q --command - 13 <<EOF
1283 1291 > pick 49f5f2d940c3 14 backout #11
1284 1292 > pick 01a68de1003a 13 9foobranch
1285 1293 > EOF
1286 1294
1287 1295 Test restricted mode with fetch (with merge)
1288 1296
1289 1297 $ cat <<EOF >> $HGRCPATH
1290 1298 > [extensions]
1291 1299 > fetch =
1292 1300 > EOF
1293 1301
1294 1302 $ hg clone -q -r 9 . ../fetch-merge
1295 1303 $ cd ../fetch-merge
1296 1304 $ hg -R ../Test export 10 | hg import -q -
1297 1305 $ hg fetch -q -r 11
1298 1306 $ hg diff -r 9 a
1299 1307 diff -r 800511b3a22d a
1300 1308 --- a/a Thu Jan 01 00:00:00 1970 +0000
1301 1309 +++ b/a * (glob)
1302 1310 @@ -1,4 +1,6 @@
1303 1311 +foobranch
1304 1312 expand $Id$
1305 1313 do not process $Id:
1306 1314 xxx $
1307 1315 $Xinfo$
1308 1316 +xxxx
1309 1317
1310 1318 $ cd ..
@@ -1,519 +1,527
1 1 This file focuses mainly on updating largefiles in the working
2 2 directory (and ".hg/largefiles/dirstate")
3 3
4 4 $ cat >> $HGRCPATH <<EOF
5 5 > [ui]
6 6 > merge = internal:fail
7 7 > [extensions]
8 8 > largefiles =
9 9 > EOF
10 10
11 11 $ hg init repo
12 12 $ cd repo
13 13
14 14 $ echo large1 > large1
15 15 $ echo large2 > large2
16 16 $ hg add --large large1 large2
17 17 $ echo normal1 > normal1
18 18 $ hg add normal1
19 19 $ hg commit -m '#0'
20 20 $ echo 'large1 in #1' > large1
21 21 $ echo 'normal1 in #1' > normal1
22 22 $ hg commit -m '#1'
23 23 $ hg update -q -C 0
24 24 $ echo 'large2 in #2' > large2
25 25 $ hg commit -m '#2'
26 26 created new head
27 27
28 28 Test that "hg merge" updates largefiles from "other" correctly
29 29
30 30 (getting largefiles from "other" normally)
31 31
32 32 $ hg status -A large1
33 33 C large1
34 34 $ cat large1
35 35 large1
36 36 $ cat .hglf/large1
37 37 4669e532d5b2c093a78eca010077e708a071bb64
38 38 $ hg merge --config debug.dirstate.delaywrite=2
39 39 getting changed largefiles
40 40 1 largefiles updated, 0 removed
41 41 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
42 42 (branch merge, don't forget to commit)
43 43 $ hg status -A large1
44 44 M large1
45 45 $ cat large1
46 46 large1 in #1
47 47 $ cat .hglf/large1
48 48 58e24f733a964da346e2407a2bee99d9001184f5
49 49 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
50 50 -4669e532d5b2c093a78eca010077e708a071bb64
51 51 +58e24f733a964da346e2407a2bee99d9001184f5
52 52
53 53 (getting largefiles from "other" via conflict prompt)
54 54
55 55 $ hg update -q -C 2
56 56 $ echo 'large1 in #3' > large1
57 57 $ echo 'normal1 in #3' > normal1
58 58 $ hg commit -m '#3'
59 59 $ cat .hglf/large1
60 60 e5bb990443d6a92aaf7223813720f7566c9dd05b
61 61 $ hg merge --config debug.dirstate.delaywrite=2 --config ui.interactive=True <<EOF
62 62 > o
63 63 > EOF
64 64 largefile large1 has a merge conflict
65 65 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
66 66 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
67 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? merging normal1
67 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
68 merging normal1
68 69 warning: conflicts during merge.
69 70 merging normal1 incomplete! (edit conflicts, then use 'hg resolve --mark')
70 71 getting changed largefiles
71 72 1 largefiles updated, 0 removed
72 73 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
73 74 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
74 75 [1]
75 76 $ hg status -A large1
76 77 M large1
77 78 $ cat large1
78 79 large1 in #1
79 80 $ cat .hglf/large1
80 81 58e24f733a964da346e2407a2bee99d9001184f5
81 82
82 83 Test that "hg revert -r REV" updates largefiles from "REV" correctly
83 84
84 85 $ hg update -q -C 3
85 86 $ hg status -A large1
86 87 C large1
87 88 $ cat large1
88 89 large1 in #3
89 90 $ cat .hglf/large1
90 91 e5bb990443d6a92aaf7223813720f7566c9dd05b
91 92 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
92 93 -4669e532d5b2c093a78eca010077e708a071bb64
93 94 +58e24f733a964da346e2407a2bee99d9001184f5
94 95 $ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1
95 96 $ hg status -A large1
96 97 M large1
97 98 $ cat large1
98 99 large1 in #1
99 100 $ cat .hglf/large1
100 101 58e24f733a964da346e2407a2bee99d9001184f5
101 102
102 103 Test that "hg rollback" restores status of largefiles correctly
103 104
104 105 $ hg update -C -q
105 106 $ hg remove large1
106 107 $ test -f .hglf/large1
107 108 [1]
108 109 $ hg forget large2
109 110 $ test -f .hglf/large2
110 111 [1]
111 112 $ echo largeX > largeX
112 113 $ hg add --large largeX
113 114 $ cat .hglf/largeX
114 115
115 116 $ hg commit -m 'will be rollback-ed soon'
116 117 $ echo largeY > largeY
117 118 $ hg add --large largeY
118 119 $ hg status -A large1
119 120 large1: No such file or directory
120 121 $ hg status -A large2
121 122 ? large2
122 123 $ hg status -A largeX
123 124 C largeX
124 125 $ hg status -A largeY
125 126 A largeY
126 127 $ hg rollback
127 128 repository tip rolled back to revision 3 (undo commit)
128 129 working directory now based on revision 3
129 130 $ hg status -A large1
130 131 R large1
131 132 $ test -f .hglf/large1
132 133 [1]
133 134 $ hg status -A large2
134 135 R large2
135 136 $ test -f .hglf/large2
136 137 [1]
137 138 $ hg status -A largeX
138 139 A largeX
139 140 $ cat .hglf/largeX
140 141
141 142 $ hg status -A largeY
142 143 ? largeY
143 144 $ test -f .hglf/largeY
144 145 [1]
145 146
146 147 Test that "hg rollback" restores standins correctly
147 148
148 149 $ hg commit -m 'will be rollback-ed soon'
149 150 $ hg update -q -C 2
150 151 $ cat large1
151 152 large1
152 153 $ cat .hglf/large1
153 154 4669e532d5b2c093a78eca010077e708a071bb64
154 155 $ cat large2
155 156 large2 in #2
156 157 $ cat .hglf/large2
157 158 3cfce6277e7668985707b6887ce56f9f62f6ccd9
158 159
159 160 $ hg rollback -q -f
160 161 $ cat large1
161 162 large1
162 163 $ cat .hglf/large1
163 164 4669e532d5b2c093a78eca010077e708a071bb64
164 165 $ cat large2
165 166 large2 in #2
166 167 $ cat .hglf/large2
167 168 3cfce6277e7668985707b6887ce56f9f62f6ccd9
168 169
169 170 (rollback the parent of the working directory, when the parent of it
170 171 is not branch-tip)
171 172
172 173 $ hg update -q -C 1
173 174 $ cat .hglf/large1
174 175 58e24f733a964da346e2407a2bee99d9001184f5
175 176 $ cat .hglf/large2
176 177 1deebade43c8c498a3c8daddac0244dc55d1331d
177 178
178 179 $ echo normalX > normalX
179 180 $ hg add normalX
180 181 $ hg commit -m 'will be rollback-ed soon'
181 182 $ hg rollback -q
182 183
183 184 $ cat .hglf/large1
184 185 58e24f733a964da346e2407a2bee99d9001184f5
185 186 $ cat .hglf/large2
186 187 1deebade43c8c498a3c8daddac0244dc55d1331d
187 188
188 189 Test that "hg status" shows status of largefiles correctly just after
189 190 automated commit like rebase/transplant
190 191
191 192 $ cat >> .hg/hgrc <<EOF
192 193 > [extensions]
193 194 > rebase =
194 195 > strip =
195 196 > transplant =
196 197 > EOF
197 198 $ hg update -q -C 1
198 199 $ hg remove large1
199 200 $ echo largeX > largeX
200 201 $ hg add --large largeX
201 202 $ hg commit -m '#4'
202 203
203 204 $ hg rebase -s 1 -d 2 --keep
204 205 $ hg status -A large1
205 206 large1: No such file or directory
206 207 $ hg status -A largeX
207 208 C largeX
208 209 $ hg strip -q 5
209 210
210 211 $ hg update -q -C 2
211 212 $ hg transplant -q 1 4
212 213 $ hg status -A large1
213 214 large1: No such file or directory
214 215 $ hg status -A largeX
215 216 C largeX
216 217 $ hg strip -q 5
217 218
218 219 $ hg update -q -C 2
219 220 $ hg transplant -q --merge 1 --merge 4
220 221 $ hg status -A large1
221 222 large1: No such file or directory
222 223 $ hg status -A largeX
223 224 C largeX
224 225 $ hg strip -q 5
225 226
226 227 Test that linear merge can detect modification (and conflict) correctly
227 228
228 229 (linear merge without conflict)
229 230
230 231 $ echo 'large2 for linear merge (no conflict)' > large2
231 232 $ hg update 3 --config debug.dirstate.delaywrite=2
232 233 getting changed largefiles
233 234 1 largefiles updated, 0 removed
234 235 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
235 236 $ hg status -A large2
236 237 M large2
237 238 $ cat large2
238 239 large2 for linear merge (no conflict)
239 240 $ cat .hglf/large2
240 241 9c4bf8f1b33536d6e5f89447e10620cfe52ea710
241 242
242 243 (linear merge with conflict, choosing "other")
243 244
244 245 $ hg update -q -C 2
245 246 $ echo 'large1 for linear merge (conflict)' > large1
246 247 $ hg update 3 --config ui.interactive=True <<EOF
247 248 > o
248 249 > EOF
249 250 largefile large1 has a merge conflict
250 251 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
251 252 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
252 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? getting changed largefiles
253 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? o
254 getting changed largefiles
253 255 1 largefiles updated, 0 removed
254 256 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
255 257 $ hg status -A large1
256 258 C large1
257 259 $ cat large1
258 260 large1 in #3
259 261 $ cat .hglf/large1
260 262 e5bb990443d6a92aaf7223813720f7566c9dd05b
261 263
262 264 (linear merge with conflict, choosing "local")
263 265
264 266 $ hg update -q -C 2
265 267 $ echo 'large1 for linear merge (conflict)' > large1
266 268 $ hg update 3 --config debug.dirstate.delaywrite=2
267 269 largefile large1 has a merge conflict
268 270 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
269 271 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
270 272 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
271 273 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
272 274 $ hg status -A large1
273 275 M large1
274 276 $ cat large1
275 277 large1 for linear merge (conflict)
276 278 $ cat .hglf/large1
277 279 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
278 280
279 281 Test a linear merge to a revision containing same-name normal file
280 282
281 283 $ hg update -q -C 3
282 284 $ hg remove large2
283 285 $ echo 'large2 as normal file' > large2
284 286 $ hg add large2
285 287 $ echo 'large3 as normal file' > large3
286 288 $ hg add large3
287 289 $ hg commit -m '#5'
288 290 $ hg manifest
289 291 .hglf/large1
290 292 large2
291 293 large3
292 294 normal1
293 295
294 296 (modified largefile is already switched to normal)
295 297
296 298 $ hg update -q -C 2
297 299 $ echo 'modified large2 for linear merge' > large2
298 300 $ hg update -q 5
299 301 local changed .hglf/large2 which remote deleted
300 302 use (c)hanged version or (d)elete? c
301 303 remote turned local largefile large2 into a normal file
302 304 keep (l)argefile or use (n)ormal file? l
303 305 $ hg debugdirstate --nodates | grep large2
304 306 a 0 -1 .hglf/large2
305 307 r 0 0 large2
306 308 $ hg status -A large2
307 309 A large2
308 310 $ cat large2
309 311 modified large2 for linear merge
310 312
311 313 (added largefile is already committed as normal)
312 314
313 315 $ hg update -q -C 2
314 316 $ echo 'large3 as large file for linear merge' > large3
315 317 $ hg add --large large3
316 318 $ hg update -q 5
317 319 remote turned local largefile large3 into a normal file
318 320 keep (l)argefile or use (n)ormal file? l
319 321 $ hg debugdirstate --nodates | grep large3
320 322 a 0 -1 .hglf/large3
321 323 r 0 0 large3
322 324 $ hg status -A large3
323 325 A large3
324 326 $ cat large3
325 327 large3 as large file for linear merge
326 328 $ rm -f large3 .hglf/large3
327 329
328 330 Test that the internal linear merging works correctly
329 331 (both heads are stripped to keep pairing of revision number and commit log)
330 332
331 333 $ hg update -q -C 2
332 334 $ hg strip 3 4
333 335 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-backup.hg (glob)
334 336 $ mv .hg/strip-backup/9530e27857f7-backup.hg $TESTTMP
335 337
336 338 (internal linear merging at "hg pull --update")
337 339
338 340 $ echo 'large1 for linear merge (conflict)' > large1
339 341 $ echo 'large2 for linear merge (conflict with normal file)' > large2
340 342 $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-backup.hg
341 343 pulling from $TESTTMP/9530e27857f7-backup.hg (glob)
342 344 searching for changes
343 345 adding changesets
344 346 adding manifests
345 347 adding file changes
346 348 added 3 changesets with 5 changes to 5 files
347 349 local changed .hglf/large2 which remote deleted
348 350 use (c)hanged version or (d)elete? c
349 351 remote turned local largefile large2 into a normal file
350 352 keep (l)argefile or use (n)ormal file? l
351 353 largefile large1 has a merge conflict
352 354 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
353 355 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
354 356 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
355 357 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
356 358
357 359 $ hg status -A large1
358 360 M large1
359 361 $ cat large1
360 362 large1 for linear merge (conflict)
361 363 $ cat .hglf/large1
362 364 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
363 365 $ hg status -A large2
364 366 A large2
365 367 $ cat large2
366 368 large2 for linear merge (conflict with normal file)
367 369 $ cat .hglf/large2
368 370 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
369 371
370 372 (internal linear merging at "hg unbundle --update")
371 373
372 374 $ hg update -q -C 2
373 375 $ hg rollback -q
374 376
375 377 $ echo 'large1 for linear merge (conflict)' > large1
376 378 $ echo 'large2 for linear merge (conflict with normal file)' > large2
377 379 $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-backup.hg
378 380 adding changesets
379 381 adding manifests
380 382 adding file changes
381 383 added 3 changesets with 5 changes to 5 files
382 384 local changed .hglf/large2 which remote deleted
383 385 use (c)hanged version or (d)elete? c
384 386 remote turned local largefile large2 into a normal file
385 387 keep (l)argefile or use (n)ormal file? l
386 388 largefile large1 has a merge conflict
387 389 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
388 390 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
389 391 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
390 392 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
391 393
392 394 $ hg status -A large1
393 395 M large1
394 396 $ cat large1
395 397 large1 for linear merge (conflict)
396 398 $ cat .hglf/large1
397 399 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
398 400 $ hg status -A large2
399 401 A large2
400 402 $ cat large2
401 403 large2 for linear merge (conflict with normal file)
402 404 $ cat .hglf/large2
403 405 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
404 406
405 407 (internal linear merging in subrepo at "hg update")
406 408
407 409 $ cd ..
408 410 $ hg init subparent
409 411 $ cd subparent
410 412
411 413 $ hg clone -q -u 2 ../repo sub
412 414 $ cat > .hgsub <<EOF
413 415 > sub = sub
414 416 > EOF
415 417 $ hg add .hgsub
416 418 $ hg commit -m '#0@parent'
417 419 $ cat .hgsubstate
418 420 f74e50bd9e5594b7cf1e6c5cbab86ddd25f3ca2f sub
419 421 $ hg -R sub update -q
420 422 $ hg commit -m '#1@parent'
421 423 $ cat .hgsubstate
422 424 d65e59e952a9638e2ce863b41a420ca723dd3e8d sub
423 425 $ hg update -q 0
424 426
425 427 $ echo 'large1 for linear merge (conflict)' > sub/large1
426 428 $ echo 'large2 for linear merge (conflict with normal file)' > sub/large2
427 429 $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF
428 430 > m
429 431 > r
430 432 > c
431 433 > l
432 434 > l
433 435 > EOF
434 436 subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9)
435 (M)erge, keep (l)ocal or keep (r)emote? subrepository sources for sub differ (in checked out version)
437 (M)erge, keep (l)ocal or keep (r)emote? m
438 subrepository sources for sub differ (in checked out version)
436 439 use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)?
437 local changed .hglf/large2 which remote deleted
438 use (c)hanged version or (d)elete? remote turned local largefile large2 into a normal file
439 keep (l)argefile or use (n)ormal file? largefile large1 has a merge conflict
440 r
441 local changed .hglf/large2 which remote deleted
442 use (c)hanged version or (d)elete? c
443 remote turned local largefile large2 into a normal file
444 keep (l)argefile or use (n)ormal file? l
445 largefile large1 has a merge conflict
440 446 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
441 447 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
442 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
448 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
449 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
443 450 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
444 451
445 452 $ hg -R sub status -A sub/large1
446 453 M sub/large1
447 454 $ cat sub/large1
448 455 large1 for linear merge (conflict)
449 456 $ cat sub/.hglf/large1
450 457 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
451 458 $ hg -R sub status -A sub/large2
452 459 A sub/large2
453 460 $ cat sub/large2
454 461 large2 for linear merge (conflict with normal file)
455 462 $ cat sub/.hglf/large2
456 463 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
457 464
458 465 $ cd ..
459 466 $ cd repo
460 467
461 468 Test that rebase updates largefiles in the working directory even if
462 469 it is aborted by conflict.
463 470
464 471 $ hg update -q -C 3
465 472 $ cat .hglf/large1
466 473 e5bb990443d6a92aaf7223813720f7566c9dd05b
467 474 $ cat large1
468 475 large1 in #3
469 476 $ hg rebase -s 1 -d 3 --keep --config ui.interactive=True <<EOF
470 477 > o
471 478 > EOF
472 479 largefile large1 has a merge conflict
473 480 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
474 481 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
475 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? merging normal1
482 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
483 merging normal1
476 484 warning: conflicts during merge.
477 485 merging normal1 incomplete! (edit conflicts, then use 'hg resolve --mark')
478 486 unresolved conflicts (see hg resolve, then hg rebase --continue)
479 487 [1]
480 488 $ cat .hglf/large1
481 489 58e24f733a964da346e2407a2bee99d9001184f5
482 490 $ cat large1
483 491 large1 in #1
484 492
485 493 $ hg rebase -q --abort
486 494 rebase aborted
487 495
488 496 Test that transplant updates largefiles, of which standins are safely
489 497 changed, even if it is aborted by conflict of other.
490 498
491 499 $ hg update -q -C 5
492 500 $ cat .hglf/large1
493 501 e5bb990443d6a92aaf7223813720f7566c9dd05b
494 502 $ cat large1
495 503 large1 in #3
496 504 $ hg diff -c 4 .hglf/largeX | grep '^[+-][0-9a-z]'
497 505 +fa44618ea25181aff4f48b70428294790cec9f61
498 506 $ hg transplant 4
499 507 applying 07d6153b5c04
500 508 patching file .hglf/large1
501 509 Hunk #1 FAILED at 0
502 510 1 out of 1 hunks FAILED -- saving rejects to file .hglf/large1.rej
503 511 patch failed to apply
504 512 abort: fix up the merge and run hg transplant --continue
505 513 [255]
506 514 $ hg status -A large1
507 515 C large1
508 516 $ cat .hglf/large1
509 517 e5bb990443d6a92aaf7223813720f7566c9dd05b
510 518 $ cat large1
511 519 large1 in #3
512 520 $ hg status -A largeX
513 521 A largeX
514 522 $ cat .hglf/largeX
515 523 fa44618ea25181aff4f48b70428294790cec9f61
516 524 $ cat largeX
517 525 largeX
518 526
519 527 $ cd ..
@@ -1,142 +1,150
1 1 Test for
2 2 b5605d88dc27: Make ui.prompt repeat on "unrecognized response" again
3 3 (issue897)
4 4
5 5 840e2b315c1f: Fix misleading error and prompts during update/merge
6 6 (issue556)
7 7
8 8 $ status() {
9 9 > echo "--- status ---"
10 10 > hg st -A file1 file2
11 11 > for file in file1 file2; do
12 12 > if [ -f $file ]; then
13 13 > echo "--- $file ---"
14 14 > cat $file
15 15 > else
16 16 > echo "*** $file does not exist"
17 17 > fi
18 18 > done
19 19 > }
20 20
21 21 $ hg init
22 22
23 23 $ echo 1 > file1
24 24 $ echo 2 > file2
25 25 $ hg ci -Am 'added file1 and file2'
26 26 adding file1
27 27 adding file2
28 28
29 29 $ hg rm file1
30 30 $ echo changed >> file2
31 31 $ hg ci -m 'removed file1, changed file2'
32 32
33 33 $ hg co 0
34 34 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
35 35
36 36 $ echo changed >> file1
37 37 $ hg rm file2
38 38 $ hg ci -m 'changed file1, removed file2'
39 39 created new head
40 40
41 41
42 42 Non-interactive merge:
43 43
44 44 $ hg merge -y
45 45 local changed file1 which remote deleted
46 46 use (c)hanged version or (d)elete? c
47 47 remote changed file2 which local deleted
48 48 use (c)hanged version or leave (d)eleted? c
49 49 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
50 50 (branch merge, don't forget to commit)
51 51
52 52 $ status
53 53 --- status ---
54 54 M file2
55 55 C file1
56 56 --- file1 ---
57 57 1
58 58 changed
59 59 --- file2 ---
60 60 2
61 61 changed
62 62
63 63
64 64 Interactive merge:
65 65
66 66 $ hg co -C
67 67 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
68 68
69 69 $ hg merge --config ui.interactive=true <<EOF
70 70 > c
71 71 > d
72 72 > EOF
73 73 local changed file1 which remote deleted
74 use (c)hanged version or (d)elete? remote changed file2 which local deleted
75 use (c)hanged version or leave (d)eleted? 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 use (c)hanged version or (d)elete? c
75 remote changed file2 which local deleted
76 use (c)hanged version or leave (d)eleted? d
77 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
76 78 (branch merge, don't forget to commit)
77 79
78 80 $ status
79 81 --- status ---
80 82 file2: * (glob)
81 83 C file1
82 84 --- file1 ---
83 85 1
84 86 changed
85 87 *** file2 does not exist
86 88
87 89
88 90 Interactive merge with bad input:
89 91
90 92 $ hg co -C
91 93 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 94
93 95 $ hg merge --config ui.interactive=true <<EOF
94 96 > foo
95 97 > bar
96 98 > d
97 99 > baz
98 100 > c
99 101 > EOF
100 102 local changed file1 which remote deleted
101 use (c)hanged version or (d)elete? unrecognized response
103 use (c)hanged version or (d)elete? foo
104 unrecognized response
102 105 local changed file1 which remote deleted
103 use (c)hanged version or (d)elete? unrecognized response
106 use (c)hanged version or (d)elete? bar
107 unrecognized response
104 108 local changed file1 which remote deleted
105 use (c)hanged version or (d)elete? remote changed file2 which local deleted
106 use (c)hanged version or leave (d)eleted? unrecognized response
109 use (c)hanged version or (d)elete? d
107 110 remote changed file2 which local deleted
108 use (c)hanged version or leave (d)eleted? 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
111 use (c)hanged version or leave (d)eleted? baz
112 unrecognized response
113 remote changed file2 which local deleted
114 use (c)hanged version or leave (d)eleted? c
115 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
109 116 (branch merge, don't forget to commit)
110 117
111 118 $ status
112 119 --- status ---
113 120 M file2
114 121 R file1
115 122 *** file1 does not exist
116 123 --- file2 ---
117 124 2
118 125 changed
119 126
120 127
121 128 Interactive merge with not enough input:
122 129
123 130 $ hg co -C
124 131 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
125 132
126 133 $ hg merge --config ui.interactive=true <<EOF
127 134 > d
128 135 > EOF
129 136 local changed file1 which remote deleted
130 use (c)hanged version or (d)elete? remote changed file2 which local deleted
137 use (c)hanged version or (d)elete? d
138 remote changed file2 which local deleted
131 139 use (c)hanged version or leave (d)eleted? abort: response expected
132 140 [255]
133 141
134 142 $ status
135 143 --- status ---
136 144 file2: * (glob)
137 145 C file1
138 146 --- file1 ---
139 147 1
140 148 changed
141 149 *** file2 does not exist
142 150
@@ -1,346 +1,356
1 1 Create configuration
2 2
3 3 $ echo "[ui]" >> $HGRCPATH
4 4 $ echo "interactive=true" >> $HGRCPATH
5 5
6 6 help qrefresh (no record)
7 7
8 8 $ echo "[extensions]" >> $HGRCPATH
9 9 $ echo "mq=" >> $HGRCPATH
10 10 $ hg help qrefresh
11 11 hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...
12 12
13 13 update the current patch
14 14
15 15 If any file patterns are provided, the refreshed patch will contain only
16 16 the modifications that match those patterns; the remaining modifications
17 17 will remain in the working directory.
18 18
19 19 If -s/--short is specified, files currently included in the patch will be
20 20 refreshed just like matched files and remain in the patch.
21 21
22 22 If -e/--edit is specified, Mercurial will start your configured editor for
23 23 you to enter a message. In case qrefresh fails, you will find a backup of
24 24 your message in ".hg/last-message.txt".
25 25
26 26 hg add/remove/copy/rename work as usual, though you might want to use git-
27 27 style patches (-g/--git or [diff] git=1) to track copies and renames. See
28 28 the diffs help topic for more information on the git diff format.
29 29
30 30 Returns 0 on success.
31 31
32 32 options ([+] can be repeated):
33 33
34 34 -e --edit invoke editor on commit messages
35 35 -g --git use git extended diff format
36 36 -s --short refresh only files already in the patch and
37 37 specified files
38 38 -U --currentuser add/update author field in patch with current user
39 39 -u --user USER add/update author field in patch with given user
40 40 -D --currentdate add/update date field in patch with current date
41 41 -d --date DATE add/update date field in patch with given date
42 42 -I --include PATTERN [+] include names matching the given patterns
43 43 -X --exclude PATTERN [+] exclude names matching the given patterns
44 44 -m --message TEXT use text as commit message
45 45 -l --logfile FILE read commit message from file
46 46
47 47 (some details hidden, use --verbose to show complete help)
48 48
49 49 help qrefresh (record)
50 50
51 51 $ echo "record=" >> $HGRCPATH
52 52 $ hg help qrefresh
53 53 hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...
54 54
55 55 update the current patch
56 56
57 57 If any file patterns are provided, the refreshed patch will contain only
58 58 the modifications that match those patterns; the remaining modifications
59 59 will remain in the working directory.
60 60
61 61 If -s/--short is specified, files currently included in the patch will be
62 62 refreshed just like matched files and remain in the patch.
63 63
64 64 If -e/--edit is specified, Mercurial will start your configured editor for
65 65 you to enter a message. In case qrefresh fails, you will find a backup of
66 66 your message in ".hg/last-message.txt".
67 67
68 68 hg add/remove/copy/rename work as usual, though you might want to use git-
69 69 style patches (-g/--git or [diff] git=1) to track copies and renames. See
70 70 the diffs help topic for more information on the git diff format.
71 71
72 72 Returns 0 on success.
73 73
74 74 options ([+] can be repeated):
75 75
76 76 -e --edit invoke editor on commit messages
77 77 -g --git use git extended diff format
78 78 -s --short refresh only files already in the patch and
79 79 specified files
80 80 -U --currentuser add/update author field in patch with current user
81 81 -u --user USER add/update author field in patch with given user
82 82 -D --currentdate add/update date field in patch with current date
83 83 -d --date DATE add/update date field in patch with given date
84 84 -I --include PATTERN [+] include names matching the given patterns
85 85 -X --exclude PATTERN [+] exclude names matching the given patterns
86 86 -m --message TEXT use text as commit message
87 87 -l --logfile FILE read commit message from file
88 88 -i --interactive interactively select changes to refresh
89 89
90 90 (some details hidden, use --verbose to show complete help)
91 91
92 92 $ hg init a
93 93 $ cd a
94 94
95 95 Base commit
96 96
97 97 $ cat > 1.txt <<EOF
98 98 > 1
99 99 > 2
100 100 > 3
101 101 > 4
102 102 > 5
103 103 > EOF
104 104 $ cat > 2.txt <<EOF
105 105 > a
106 106 > b
107 107 > c
108 108 > d
109 109 > e
110 110 > f
111 111 > EOF
112 112
113 113 $ mkdir dir
114 114 $ cat > dir/a.txt <<EOF
115 115 > hello world
116 116 >
117 117 > someone
118 118 > up
119 119 > there
120 120 > loves
121 121 > me
122 122 > EOF
123 123
124 124 $ hg add 1.txt 2.txt dir/a.txt
125 125 $ hg commit -m aaa
126 126 $ hg qnew -d '0 0' patch
127 127
128 128 Changing files
129 129
130 130 $ sed -e 's/2/2 2/;s/4/4 4/' 1.txt > 1.txt.new
131 131 $ sed -e 's/b/b b/' 2.txt > 2.txt.new
132 132 $ sed -e 's/hello world/hello world!/' dir/a.txt > dir/a.txt.new
133 133
134 134 $ mv -f 1.txt.new 1.txt
135 135 $ mv -f 2.txt.new 2.txt
136 136 $ mv -f dir/a.txt.new dir/a.txt
137 137
138 138 Whole diff
139 139
140 140 $ hg diff --nodates
141 141 diff -r ed27675cb5df 1.txt
142 142 --- a/1.txt
143 143 +++ b/1.txt
144 144 @@ -1,5 +1,5 @@
145 145 1
146 146 -2
147 147 +2 2
148 148 3
149 149 -4
150 150 +4 4
151 151 5
152 152 diff -r ed27675cb5df 2.txt
153 153 --- a/2.txt
154 154 +++ b/2.txt
155 155 @@ -1,5 +1,5 @@
156 156 a
157 157 -b
158 158 +b b
159 159 c
160 160 d
161 161 e
162 162 diff -r ed27675cb5df dir/a.txt
163 163 --- a/dir/a.txt
164 164 +++ b/dir/a.txt
165 165 @@ -1,4 +1,4 @@
166 166 -hello world
167 167 +hello world!
168 168
169 169 someone
170 170 up
171 171
172 172 partial qrefresh
173 173
174 174 $ hg qrefresh -i -d '0 0' <<EOF
175 175 > y
176 176 > y
177 177 > n
178 178 > y
179 179 > y
180 180 > n
181 181 > EOF
182 182 diff --git a/1.txt b/1.txt
183 183 2 hunks, 2 lines changed
184 examine changes to '1.txt'? [Ynesfdaq?]
184 examine changes to '1.txt'? [Ynesfdaq?] y
185
185 186 @@ -1,3 +1,3 @@
186 187 1
187 188 -2
188 189 +2 2
189 190 3
190 record change 1/4 to '1.txt'? [Ynesfdaq?]
191 record change 1/4 to '1.txt'? [Ynesfdaq?] y
192
191 193 @@ -3,3 +3,3 @@
192 194 3
193 195 -4
194 196 +4 4
195 197 5
196 record change 2/4 to '1.txt'? [Ynesfdaq?]
198 record change 2/4 to '1.txt'? [Ynesfdaq?] n
199
197 200 diff --git a/2.txt b/2.txt
198 201 1 hunks, 1 lines changed
199 examine changes to '2.txt'? [Ynesfdaq?]
202 examine changes to '2.txt'? [Ynesfdaq?] y
203
200 204 @@ -1,5 +1,5 @@
201 205 a
202 206 -b
203 207 +b b
204 208 c
205 209 d
206 210 e
207 record change 3/4 to '2.txt'? [Ynesfdaq?]
211 record change 3/4 to '2.txt'? [Ynesfdaq?] y
212
208 213 diff --git a/dir/a.txt b/dir/a.txt
209 214 1 hunks, 1 lines changed
210 examine changes to 'dir/a.txt'? [Ynesfdaq?]
215 examine changes to 'dir/a.txt'? [Ynesfdaq?] n
216
211 217
212 218 After partial qrefresh 'tip'
213 219
214 220 $ hg tip -p
215 221 changeset: 1:0738af1a8211
216 222 tag: patch
217 223 tag: qbase
218 224 tag: qtip
219 225 tag: tip
220 226 user: test
221 227 date: Thu Jan 01 00:00:00 1970 +0000
222 228 summary: [mq]: patch
223 229
224 230 diff -r 1fd39ab63a33 -r 0738af1a8211 1.txt
225 231 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
226 232 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
227 233 @@ -1,5 +1,5 @@
228 234 1
229 235 -2
230 236 +2 2
231 237 3
232 238 4
233 239 5
234 240 diff -r 1fd39ab63a33 -r 0738af1a8211 2.txt
235 241 --- a/2.txt Thu Jan 01 00:00:00 1970 +0000
236 242 +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000
237 243 @@ -1,5 +1,5 @@
238 244 a
239 245 -b
240 246 +b b
241 247 c
242 248 d
243 249 e
244 250
245 251 After partial qrefresh 'diff'
246 252
247 253 $ hg diff --nodates
248 254 diff -r 0738af1a8211 1.txt
249 255 --- a/1.txt
250 256 +++ b/1.txt
251 257 @@ -1,5 +1,5 @@
252 258 1
253 259 2 2
254 260 3
255 261 -4
256 262 +4 4
257 263 5
258 264 diff -r 0738af1a8211 dir/a.txt
259 265 --- a/dir/a.txt
260 266 +++ b/dir/a.txt
261 267 @@ -1,4 +1,4 @@
262 268 -hello world
263 269 +hello world!
264 270
265 271 someone
266 272 up
267 273
268 274 qrefresh interactively everything else
269 275
270 276 $ hg qrefresh -i -d '0 0' <<EOF
271 277 > y
272 278 > y
273 279 > y
274 280 > y
275 281 > EOF
276 282 diff --git a/1.txt b/1.txt
277 283 1 hunks, 1 lines changed
278 examine changes to '1.txt'? [Ynesfdaq?]
284 examine changes to '1.txt'? [Ynesfdaq?] y
285
279 286 @@ -1,5 +1,5 @@
280 287 1
281 288 2 2
282 289 3
283 290 -4
284 291 +4 4
285 292 5
286 record change 1/2 to '1.txt'? [Ynesfdaq?]
293 record change 1/2 to '1.txt'? [Ynesfdaq?] y
294
287 295 diff --git a/dir/a.txt b/dir/a.txt
288 296 1 hunks, 1 lines changed
289 examine changes to 'dir/a.txt'? [Ynesfdaq?]
297 examine changes to 'dir/a.txt'? [Ynesfdaq?] y
298
290 299 @@ -1,4 +1,4 @@
291 300 -hello world
292 301 +hello world!
293 302
294 303 someone
295 304 up
296 record change 2/2 to 'dir/a.txt'? [Ynesfdaq?]
305 record change 2/2 to 'dir/a.txt'? [Ynesfdaq?] y
306
297 307
298 308 After final qrefresh 'tip'
299 309
300 310 $ hg tip -p
301 311 changeset: 1:2c3f66afeed9
302 312 tag: patch
303 313 tag: qbase
304 314 tag: qtip
305 315 tag: tip
306 316 user: test
307 317 date: Thu Jan 01 00:00:00 1970 +0000
308 318 summary: [mq]: patch
309 319
310 320 diff -r 1fd39ab63a33 -r 2c3f66afeed9 1.txt
311 321 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
312 322 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
313 323 @@ -1,5 +1,5 @@
314 324 1
315 325 -2
316 326 +2 2
317 327 3
318 328 -4
319 329 +4 4
320 330 5
321 331 diff -r 1fd39ab63a33 -r 2c3f66afeed9 2.txt
322 332 --- a/2.txt Thu Jan 01 00:00:00 1970 +0000
323 333 +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000
324 334 @@ -1,5 +1,5 @@
325 335 a
326 336 -b
327 337 +b b
328 338 c
329 339 d
330 340 e
331 341 diff -r 1fd39ab63a33 -r 2c3f66afeed9 dir/a.txt
332 342 --- a/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
333 343 +++ b/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
334 344 @@ -1,4 +1,4 @@
335 345 -hello world
336 346 +hello world!
337 347
338 348 someone
339 349 up
340 350
341 351
342 352 After qrefresh 'diff'
343 353
344 354 $ hg diff --nodates
345 355
346 356 $ cd ..
@@ -1,601 +1,609
1 1 $ echo "[ui]" >> $HGRCPATH
2 2 $ echo "commitsubrepos = Yes" >> $HGRCPATH
3 3 $ echo "[extensions]" >> $HGRCPATH
4 4 $ echo "mq=" >> $HGRCPATH
5 5 $ echo "record=" >> $HGRCPATH
6 6 $ echo "[diff]" >> $HGRCPATH
7 7 $ echo "nodates=1" >> $HGRCPATH
8 8
9 9 $ stdin=`pwd`/stdin.tmp
10 10
11 11 fn to create new repository w/dirty subrepo, and cd into it
12 12 $ mkrepo() {
13 13 > hg init $1
14 14 > cd $1
15 15 > hg qinit
16 16 > }
17 17
18 18 fn to create dirty subrepo
19 19 $ mksubrepo() {
20 20 > hg init $1
21 21 > cd $1
22 22 > echo a > a
23 23 > hg add
24 24 > cd ..
25 25 > }
26 26
27 27 $ testadd() {
28 28 > cat - > "$stdin"
29 29 > mksubrepo sub
30 30 > echo sub = sub >> .hgsub
31 31 > hg add .hgsub
32 32 > echo % abort when adding .hgsub w/dirty subrepo
33 33 > hg status -S
34 34 > echo '%' $*
35 35 > cat "$stdin" | hg $*
36 36 > echo [$?]
37 37 > hg -R sub ci -m0sub
38 38 > echo % update substate when adding .hgsub w/clean updated subrepo
39 39 > hg status -S
40 40 > echo '%' $*
41 41 > cat "$stdin" | hg $*
42 42 > hg debugsub
43 43 > }
44 44
45 45 $ testmod() {
46 46 > cat - > "$stdin"
47 47 > mksubrepo sub2
48 48 > echo sub2 = sub2 >> .hgsub
49 49 > echo % abort when modifying .hgsub w/dirty subrepo
50 50 > hg status -S
51 51 > echo '%' $*
52 52 > cat "$stdin" | hg $*
53 53 > echo [$?]
54 54 > hg -R sub2 ci -m0sub2
55 55 > echo % update substate when modifying .hgsub w/clean updated subrepo
56 56 > hg status -S
57 57 > echo '%' $*
58 58 > cat "$stdin" | hg $*
59 59 > hg debugsub
60 60 > }
61 61
62 62 $ testrm1() {
63 63 > cat - > "$stdin"
64 64 > mksubrepo sub3
65 65 > echo sub3 = sub3 >> .hgsub
66 66 > hg ci -Aqmsub3
67 67 > $EXTRA
68 68 > echo b >> sub3/a
69 69 > hg rm .hgsub
70 70 > echo % update substate when removing .hgsub w/dirty subrepo
71 71 > hg status -S
72 72 > echo '%' $*
73 73 > cat "$stdin" | hg $*
74 74 > echo % debugsub should be empty
75 75 > hg debugsub
76 76 > }
77 77
78 78 $ testrm2() {
79 79 > cat - > "$stdin"
80 80 > mksubrepo sub4
81 81 > echo sub4 = sub4 >> .hgsub
82 82 > hg ci -Aqmsub4
83 83 > $EXTRA
84 84 > hg rm .hgsub
85 85 > echo % update substate when removing .hgsub w/clean updated subrepo
86 86 > hg status -S
87 87 > echo '%' $*
88 88 > cat "$stdin" | hg $*
89 89 > echo % debugsub should be empty
90 90 > hg debugsub
91 91 > }
92 92
93 93
94 94 handle subrepos safely on qnew
95 95
96 96 $ mkrepo repo-2499-qnew
97 97 $ testadd qnew -X path:no-effect -m0 0.diff
98 98 adding a
99 99 % abort when adding .hgsub w/dirty subrepo
100 100 A .hgsub
101 101 A sub/a
102 102 % qnew -X path:no-effect -m0 0.diff
103 103 abort: uncommitted changes in subrepository sub
104 104 [255]
105 105 % update substate when adding .hgsub w/clean updated subrepo
106 106 A .hgsub
107 107 % qnew -X path:no-effect -m0 0.diff
108 108 path sub
109 109 source sub
110 110 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
111 111
112 112 $ testmod qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
113 113 adding a
114 114 % abort when modifying .hgsub w/dirty subrepo
115 115 M .hgsub
116 116 A sub2/a
117 117 % qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
118 118 abort: uncommitted changes in subrepository sub2
119 119 [255]
120 120 % update substate when modifying .hgsub w/clean updated subrepo
121 121 M .hgsub
122 122 % qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
123 123 path sub
124 124 source sub
125 125 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
126 126 path sub2
127 127 source sub2
128 128 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
129 129
130 130 $ hg qpop -qa
131 131 patch queue now empty
132 132 $ testrm1 qnew -m2 2.diff
133 133 adding a
134 134 % update substate when removing .hgsub w/dirty subrepo
135 135 M sub3/a
136 136 R .hgsub
137 137 % qnew -m2 2.diff
138 138 % debugsub should be empty
139 139
140 140 $ hg qpop -qa
141 141 patch queue now empty
142 142 $ testrm2 qnew -m3 3.diff
143 143 adding a
144 144 % update substate when removing .hgsub w/clean updated subrepo
145 145 R .hgsub
146 146 % qnew -m3 3.diff
147 147 % debugsub should be empty
148 148
149 149 $ cd ..
150 150
151 151
152 152 handle subrepos safely on qrefresh
153 153
154 154 $ mkrepo repo-2499-qrefresh
155 155 $ hg qnew -m0 0.diff
156 156 $ testadd qrefresh
157 157 adding a
158 158 % abort when adding .hgsub w/dirty subrepo
159 159 A .hgsub
160 160 A sub/a
161 161 % qrefresh
162 162 abort: uncommitted changes in subrepository sub
163 163 [255]
164 164 % update substate when adding .hgsub w/clean updated subrepo
165 165 A .hgsub
166 166 % qrefresh
167 167 path sub
168 168 source sub
169 169 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
170 170
171 171 $ hg qnew -m1 1.diff
172 172 $ testmod qrefresh
173 173 adding a
174 174 % abort when modifying .hgsub w/dirty subrepo
175 175 M .hgsub
176 176 A sub2/a
177 177 % qrefresh
178 178 abort: uncommitted changes in subrepository sub2
179 179 [255]
180 180 % update substate when modifying .hgsub w/clean updated subrepo
181 181 M .hgsub
182 182 % qrefresh
183 183 path sub
184 184 source sub
185 185 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
186 186 path sub2
187 187 source sub2
188 188 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
189 189
190 190 $ hg qpop -qa
191 191 patch queue now empty
192 192 $ EXTRA='hg qnew -m2 2.diff'
193 193 $ testrm1 qrefresh
194 194 adding a
195 195 % update substate when removing .hgsub w/dirty subrepo
196 196 M sub3/a
197 197 R .hgsub
198 198 % qrefresh
199 199 % debugsub should be empty
200 200
201 201 $ hg qpop -qa
202 202 patch queue now empty
203 203 $ EXTRA='hg qnew -m3 3.diff'
204 204 $ testrm2 qrefresh
205 205 adding a
206 206 % update substate when removing .hgsub w/clean updated subrepo
207 207 R .hgsub
208 208 % qrefresh
209 209 % debugsub should be empty
210 210 $ EXTRA=
211 211
212 212 $ cd ..
213 213
214 214
215 215 handle subrepos safely on qpush/qpop
216 216 (and we cannot qpop / qpush with a modified subrepo)
217 217
218 218 $ mkrepo repo-2499-qpush
219 219 $ mksubrepo sub
220 220 adding a
221 221 $ hg -R sub ci -m0sub
222 222 $ echo sub = sub > .hgsub
223 223 $ hg add .hgsub
224 224 $ hg commit -m0
225 225 $ hg debugsub
226 226 path sub
227 227 source sub
228 228 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
229 229 $ echo foo > ./sub/a
230 230 $ hg -R sub commit -m foo
231 231 $ hg commit -m1
232 232 $ hg qimport -r "0:tip"
233 233 $ hg -R sub id --id
234 234 aa037b301eba
235 235
236 236 qpop
237 237 $ hg -R sub update 0000
238 238 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
239 239 $ hg qpop
240 240 abort: local changed subrepos found, refresh first
241 241 [255]
242 242 $ hg revert sub
243 243 reverting subrepo sub
244 244 adding sub/a
245 245 $ hg qpop
246 246 popping 1.diff
247 247 now at: 0.diff
248 248 $ hg status -AS
249 249 C .hgsub
250 250 C .hgsubstate
251 251 C sub/a
252 252 $ hg -R sub id --id
253 253 b2fdb12cd82b
254 254
255 255 qpush
256 256 $ hg -R sub update 0000
257 257 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
258 258 $ hg qpush
259 259 abort: local changed subrepos found, refresh first
260 260 [255]
261 261 $ hg revert sub
262 262 reverting subrepo sub
263 263 adding sub/a
264 264 $ hg qpush
265 265 applying 1.diff
266 266 subrepository sub diverged (local revision: b2fdb12cd82b, remote revision: aa037b301eba)
267 267 (M)erge, keep (l)ocal or keep (r)emote? m
268 268 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
269 269 now at: 1.diff
270 270 $ hg status -AS
271 271 C .hgsub
272 272 C .hgsubstate
273 273 C sub/a
274 274 $ hg -R sub id --id
275 275 aa037b301eba
276 276
277 277 $ cd ..
278 278
279 279
280 280 handle subrepos safely on qrecord
281 281
282 282 $ mkrepo repo-2499-qrecord
283 283 $ testadd qrecord --config ui.interactive=1 -m0 0.diff <<EOF
284 284 > y
285 285 > y
286 286 > EOF
287 287 adding a
288 288 % abort when adding .hgsub w/dirty subrepo
289 289 A .hgsub
290 290 A sub/a
291 291 % qrecord --config ui.interactive=1 -m0 0.diff
292 292 diff --git a/.hgsub b/.hgsub
293 293 new file mode 100644
294 examine changes to '.hgsub'? [Ynesfdaq?]
294 examine changes to '.hgsub'? [Ynesfdaq?] y
295
295 296 abort: uncommitted changes in subrepository sub
296 297 [255]
297 298 % update substate when adding .hgsub w/clean updated subrepo
298 299 A .hgsub
299 300 % qrecord --config ui.interactive=1 -m0 0.diff
300 301 diff --git a/.hgsub b/.hgsub
301 302 new file mode 100644
302 examine changes to '.hgsub'? [Ynesfdaq?]
303 examine changes to '.hgsub'? [Ynesfdaq?] y
304
303 305 path sub
304 306 source sub
305 307 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
306 308
307 309 $ testmod qrecord --config ui.interactive=1 -m1 1.diff <<EOF
308 310 > y
309 311 > y
310 312 > EOF
311 313 adding a
312 314 % abort when modifying .hgsub w/dirty subrepo
313 315 M .hgsub
314 316 A sub2/a
315 317 % qrecord --config ui.interactive=1 -m1 1.diff
316 318 diff --git a/.hgsub b/.hgsub
317 319 1 hunks, 1 lines changed
318 examine changes to '.hgsub'? [Ynesfdaq?]
320 examine changes to '.hgsub'? [Ynesfdaq?] y
321
319 322 @@ -1,1 +1,2 @@
320 323 sub = sub
321 324 +sub2 = sub2
322 record this change to '.hgsub'? [Ynesfdaq?]
325 record this change to '.hgsub'? [Ynesfdaq?] y
326
323 327 abort: uncommitted changes in subrepository sub2
324 328 [255]
325 329 % update substate when modifying .hgsub w/clean updated subrepo
326 330 M .hgsub
327 331 % qrecord --config ui.interactive=1 -m1 1.diff
328 332 diff --git a/.hgsub b/.hgsub
329 333 1 hunks, 1 lines changed
330 examine changes to '.hgsub'? [Ynesfdaq?]
334 examine changes to '.hgsub'? [Ynesfdaq?] y
335
331 336 @@ -1,1 +1,2 @@
332 337 sub = sub
333 338 +sub2 = sub2
334 record this change to '.hgsub'? [Ynesfdaq?]
339 record this change to '.hgsub'? [Ynesfdaq?] y
340
335 341 path sub
336 342 source sub
337 343 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
338 344 path sub2
339 345 source sub2
340 346 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
341 347
342 348 $ hg qpop -qa
343 349 patch queue now empty
344 350 $ testrm1 qrecord --config ui.interactive=1 -m2 2.diff <<EOF
345 351 > y
346 352 > y
347 353 > EOF
348 354 adding a
349 355 % update substate when removing .hgsub w/dirty subrepo
350 356 M sub3/a
351 357 R .hgsub
352 358 % qrecord --config ui.interactive=1 -m2 2.diff
353 359 diff --git a/.hgsub b/.hgsub
354 360 deleted file mode 100644
355 examine changes to '.hgsub'? [Ynesfdaq?]
361 examine changes to '.hgsub'? [Ynesfdaq?] y
362
356 363 % debugsub should be empty
357 364
358 365 $ hg qpop -qa
359 366 patch queue now empty
360 367 $ testrm2 qrecord --config ui.interactive=1 -m3 3.diff <<EOF
361 368 > y
362 369 > y
363 370 > EOF
364 371 adding a
365 372 % update substate when removing .hgsub w/clean updated subrepo
366 373 R .hgsub
367 374 % qrecord --config ui.interactive=1 -m3 3.diff
368 375 diff --git a/.hgsub b/.hgsub
369 376 deleted file mode 100644
370 examine changes to '.hgsub'? [Ynesfdaq?]
377 examine changes to '.hgsub'? [Ynesfdaq?] y
378
371 379 % debugsub should be empty
372 380
373 381 $ cd ..
374 382
375 383
376 384 correctly handle subrepos with patch queues
377 385 $ mkrepo repo-subrepo-with-queue
378 386 $ mksubrepo sub
379 387 adding a
380 388 $ hg -R sub qnew sub0.diff
381 389 $ echo sub = sub >> .hgsub
382 390 $ hg add .hgsub
383 391 $ hg qnew 0.diff
384 392
385 393 $ cd ..
386 394
387 395 check whether MQ operations can import updated .hgsubstate correctly
388 396 both into 'revision' and 'patch file under .hg/patches':
389 397
390 398 $ hg init importing-hgsubstate
391 399 $ cd importing-hgsubstate
392 400
393 401 $ echo a > a
394 402 $ hg commit -u test -d '0 0' -Am '#0 in parent'
395 403 adding a
396 404 $ hg init sub
397 405 $ echo sa > sub/sa
398 406 $ hg -R sub commit -u test -d '0 0' -Am '#0 in sub'
399 407 adding sa
400 408 $ echo 'sub = sub' > .hgsub
401 409 $ touch .hgsubstate
402 410 $ hg add .hgsub .hgsubstate
403 411
404 412 $ hg qnew -u test -d '0 0' import-at-qnew
405 413 $ hg -R sub parents --template '{node} sub\n'
406 414 b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
407 415 $ cat .hgsubstate
408 416 b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
409 417 $ hg diff -c tip
410 418 diff -r f499373e340c -r f69e96d86e75 .hgsub
411 419 --- /dev/null
412 420 +++ b/.hgsub
413 421 @@ -0,0 +1,1 @@
414 422 +sub = sub
415 423 diff -r f499373e340c -r f69e96d86e75 .hgsubstate
416 424 --- /dev/null
417 425 +++ b/.hgsubstate
418 426 @@ -0,0 +1,1 @@
419 427 +b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
420 428 $ cat .hg/patches/import-at-qnew
421 429 # HG changeset patch
422 430 # User test
423 431 # Date 0 0
424 432 # Parent f499373e340cdca5d01dee904aeb42dd2a325e71
425 433
426 434 diff -r f499373e340c -r f69e96d86e75 .hgsub
427 435 --- /dev/null
428 436 +++ b/.hgsub
429 437 @@ -0,0 +1,1 @@
430 438 +sub = sub
431 439 diff -r f499373e340c -r f69e96d86e75 .hgsubstate
432 440 --- /dev/null
433 441 +++ b/.hgsubstate
434 442 @@ -0,0 +1,1 @@
435 443 +b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
436 444 $ hg parents --template '{node}\n'
437 445 f69e96d86e75a6d4fd88285dc9697acb23951041
438 446 $ hg parents --template '{files}\n'
439 447 .hgsub .hgsubstate
440 448
441 449 check also whether qnew not including ".hgsubstate" explicitly causes
442 450 as same result (in node hash) as one including it.
443 451
444 452 $ hg qpop -a -q
445 453 patch queue now empty
446 454 $ hg qdelete import-at-qnew
447 455 $ echo 'sub = sub' > .hgsub
448 456 $ hg add .hgsub
449 457 $ rm -f .hgsubstate
450 458 $ hg qnew -u test -d '0 0' import-at-qnew
451 459 $ hg parents --template '{node}\n'
452 460 f69e96d86e75a6d4fd88285dc9697acb23951041
453 461 $ hg parents --template '{files}\n'
454 462 .hgsub .hgsubstate
455 463
456 464 check whether qrefresh imports updated .hgsubstate correctly
457 465
458 466 $ hg qpop
459 467 popping import-at-qnew
460 468 patch queue now empty
461 469 $ hg qpush
462 470 applying import-at-qnew
463 471 now at: import-at-qnew
464 472 $ hg parents --template '{files}\n'
465 473 .hgsub .hgsubstate
466 474
467 475 $ hg qnew import-at-qrefresh
468 476 $ echo sb > sub/sb
469 477 $ hg -R sub commit -u test -d '0 0' -Am '#1 in sub'
470 478 adding sb
471 479 $ hg qrefresh -u test -d '0 0'
472 480 $ hg -R sub parents --template '{node} sub\n'
473 481 88ac1bef5ed43b689d1d200b59886b675dec474b sub
474 482 $ cat .hgsubstate
475 483 88ac1bef5ed43b689d1d200b59886b675dec474b sub
476 484 $ hg diff -c tip
477 485 diff -r 05b056bb9c8c -r d987bec230f4 .hgsubstate
478 486 --- a/.hgsubstate
479 487 +++ b/.hgsubstate
480 488 @@ -1,1 +1,1 @@
481 489 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
482 490 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
483 491 $ cat .hg/patches/import-at-qrefresh
484 492 # HG changeset patch
485 493 # User test
486 494 # Date 0 0
487 495 # Parent 05b056bb9c8c05ff15258b84fd42ab3527271033
488 496
489 497 diff -r 05b056bb9c8c .hgsubstate
490 498 --- a/.hgsubstate
491 499 +++ b/.hgsubstate
492 500 @@ -1,1 +1,1 @@
493 501 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
494 502 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
495 503 $ hg parents --template '{files}\n'
496 504 .hgsubstate
497 505
498 506 $ hg qrefresh -u test -d '0 0'
499 507 $ cat .hgsubstate
500 508 88ac1bef5ed43b689d1d200b59886b675dec474b sub
501 509 $ hg diff -c tip
502 510 diff -r 05b056bb9c8c -r d987bec230f4 .hgsubstate
503 511 --- a/.hgsubstate
504 512 +++ b/.hgsubstate
505 513 @@ -1,1 +1,1 @@
506 514 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
507 515 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
508 516 $ cat .hg/patches/import-at-qrefresh
509 517 # HG changeset patch
510 518 # User test
511 519 # Date 0 0
512 520 # Parent 05b056bb9c8c05ff15258b84fd42ab3527271033
513 521
514 522 diff -r 05b056bb9c8c .hgsubstate
515 523 --- a/.hgsubstate
516 524 +++ b/.hgsubstate
517 525 @@ -1,1 +1,1 @@
518 526 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
519 527 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
520 528 $ hg parents --template '{files}\n'
521 529 .hgsubstate
522 530
523 531 $ hg update -C tip
524 532 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
525 533 $ hg qpop -a
526 534 popping import-at-qrefresh
527 535 popping import-at-qnew
528 536 patch queue now empty
529 537
530 538 $ hg -R sub update -C 0
531 539 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
532 540 $ echo 'sub = sub' > .hgsub
533 541 $ hg commit -Am '#1 in parent'
534 542 adding .hgsub
535 543 $ hg -R sub update -C 1
536 544 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
537 545 $ hg commit -Am '#2 in parent (but will be rolled back soon)'
538 546 $ hg rollback
539 547 repository tip rolled back to revision 1 (undo commit)
540 548 working directory now based on revision 1
541 549 $ hg status
542 550 M .hgsubstate
543 551 $ hg qnew -u test -d '0 0' checkstate-at-qnew
544 552 $ hg -R sub parents --template '{node} sub\n'
545 553 88ac1bef5ed43b689d1d200b59886b675dec474b sub
546 554 $ cat .hgsubstate
547 555 88ac1bef5ed43b689d1d200b59886b675dec474b sub
548 556 $ hg diff -c tip
549 557 diff -r 4d91eb2fa1d1 -r 1259c112d884 .hgsubstate
550 558 --- a/.hgsubstate
551 559 +++ b/.hgsubstate
552 560 @@ -1,1 +1,1 @@
553 561 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
554 562 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
555 563 $ cat .hg/patches/checkstate-at-qnew
556 564 # HG changeset patch
557 565 # User test
558 566 # Date 0 0
559 567 # Parent 4d91eb2fa1d1b22ec513347b9cd06f6b49d470fa
560 568
561 569 diff -r 4d91eb2fa1d1 -r 1259c112d884 .hgsubstate
562 570 --- a/.hgsubstate
563 571 +++ b/.hgsubstate
564 572 @@ -1,1 +1,1 @@
565 573 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
566 574 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
567 575 $ hg parents --template '{files}\n'
568 576 .hgsubstate
569 577
570 578 check whether qrefresh not including ".hgsubstate" explicitly causes
571 579 as same result (in node hash) as one including it.
572 580
573 581 $ hg update -C -q 0
574 582 $ hg qpop -a -q
575 583 patch queue now empty
576 584 $ hg qnew -u test -d '0 0' add-hgsub-at-qrefresh
577 585 $ echo 'sub = sub' > .hgsub
578 586 $ echo > .hgsubstate
579 587 $ hg add .hgsub .hgsubstate
580 588 $ hg qrefresh -u test -d '0 0'
581 589 $ hg parents --template '{node}\n'
582 590 7c48c35501aae6770ed9c2517014628615821a8e
583 591 $ hg parents --template '{files}\n'
584 592 .hgsub .hgsubstate
585 593
586 594 $ hg qpop -a -q
587 595 patch queue now empty
588 596 $ hg qdelete add-hgsub-at-qrefresh
589 597 $ hg qnew -u test -d '0 0' add-hgsub-at-qrefresh
590 598 $ echo 'sub = sub' > .hgsub
591 599 $ hg add .hgsub
592 600 $ rm -f .hgsubstate
593 601 $ hg qrefresh -u test -d '0 0'
594 602 $ hg parents --template '{node}\n'
595 603 7c48c35501aae6770ed9c2517014628615821a8e
596 604 $ hg parents --template '{files}\n'
597 605 .hgsub .hgsubstate
598 606
599 607 $ cd ..
600 608
601 609 $ cd ..
@@ -1,2591 +1,2592
1 1 Note for future hackers of patchbomb: this file is a bit heavy on
2 2 wildcards in test expectations due to how many things like hostnames
3 3 tend to make it into outputs. As a result, you may need to perform the
4 4 following regular expression substitutions:
5 5 @$HOSTNAME> -> @*> (glob)
6 6 Mercurial-patchbomb/.* -> Mercurial-patchbomb/* (glob)
7 7 /mixed; boundary="===+[0-9]+==" -> /mixed; boundary="===*== (glob)"
8 8 --===+[0-9]+=+--$ -> --===*=-- (glob)
9 9 --===+[0-9]+=+$ -> --===*= (glob)
10 10
11 11 $ cat > prune-blank-after-boundary.py <<EOF
12 12 > import sys
13 13 > skipblank = False
14 14 > trim = lambda x: x.strip(' \r\n')
15 15 > for l in sys.stdin:
16 16 > if trim(l).endswith('=--') or trim(l).endswith('=='):
17 17 > skipblank = True
18 18 > print l,
19 19 > continue
20 20 > if not trim(l) and skipblank:
21 21 > continue
22 22 > skipblank = False
23 23 > print l,
24 24 > EOF
25 25 $ FILTERBOUNDARY="python `pwd`/prune-blank-after-boundary.py"
26 26 $ echo "[extensions]" >> $HGRCPATH
27 27 $ echo "patchbomb=" >> $HGRCPATH
28 28
29 29 $ hg init t
30 30 $ cd t
31 31 $ echo a > a
32 32 $ hg commit -Ama -d '1 0'
33 33 adding a
34 34
35 35 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -r tip
36 36 this patch series consists of 1 patches.
37 37
38 38
39 39 displaying [PATCH] a ...
40 40 Content-Type: text/plain; charset="us-ascii"
41 41 MIME-Version: 1.0
42 42 Content-Transfer-Encoding: 7bit
43 43 Subject: [PATCH] a
44 44 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
45 45 X-Mercurial-Series-Index: 1
46 46 X-Mercurial-Series-Total: 1
47 47 Message-Id: <8580ff50825a50c8f716.60@*> (glob)
48 48 X-Mercurial-Series-Id: <8580ff50825a50c8f716.60@*> (glob)
49 49 User-Agent: Mercurial-patchbomb/* (glob)
50 50 Date: Thu, 01 Jan 1970 00:01:00 +0000
51 51 From: quux
52 52 To: foo
53 53 Cc: bar
54 54
55 55 # HG changeset patch
56 56 # User test
57 57 # Date 1 0
58 58 # Thu Jan 01 00:00:01 1970 +0000
59 59 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
60 60 # Parent 0000000000000000000000000000000000000000
61 61 a
62 62
63 63 diff -r 000000000000 -r 8580ff50825a a
64 64 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
65 65 +++ b/a Thu Jan 01 00:00:01 1970 +0000
66 66 @@ -0,0 +1,1 @@
67 67 +a
68 68
69 69
70 70 $ hg --config ui.interactive=1 email --confirm -n -f quux -t foo -c bar -r tip<<EOF
71 71 > n
72 72 > EOF
73 73 this patch series consists of 1 patches.
74 74
75 75
76 76 Final summary:
77 77
78 78 From: quux
79 79 To: foo
80 80 Cc: bar
81 81 Subject: [PATCH] a
82 82 a | 1 +
83 83 1 files changed, 1 insertions(+), 0 deletions(-)
84 84
85 are you sure you want to send (yn)? abort: patchbomb canceled
85 are you sure you want to send (yn)? n
86 abort: patchbomb canceled
86 87 [255]
87 88
88 89 $ echo b > b
89 90 $ hg commit -Amb -d '2 0'
90 91 adding b
91 92
92 93 $ hg email --date '1970-1-1 0:2' -n -f quux -t foo -c bar -s test -r 0:tip
93 94 this patch series consists of 2 patches.
94 95
95 96
96 97 Write the introductory message for the patch series.
97 98
98 99
99 100 displaying [PATCH 0 of 2] test ...
100 101 Content-Type: text/plain; charset="us-ascii"
101 102 MIME-Version: 1.0
102 103 Content-Transfer-Encoding: 7bit
103 104 Subject: [PATCH 0 of 2] test
104 105 Message-Id: <patchbomb.120@*> (glob)
105 106 User-Agent: Mercurial-patchbomb/* (glob)
106 107 Date: Thu, 01 Jan 1970 00:02:00 +0000
107 108 From: quux
108 109 To: foo
109 110 Cc: bar
110 111
111 112
112 113 displaying [PATCH 1 of 2] a ...
113 114 Content-Type: text/plain; charset="us-ascii"
114 115 MIME-Version: 1.0
115 116 Content-Transfer-Encoding: 7bit
116 117 Subject: [PATCH 1 of 2] a
117 118 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
118 119 X-Mercurial-Series-Index: 1
119 120 X-Mercurial-Series-Total: 2
120 121 Message-Id: <8580ff50825a50c8f716.121@*> (glob)
121 122 X-Mercurial-Series-Id: <8580ff50825a50c8f716.121@*> (glob)
122 123 In-Reply-To: <patchbomb.120@*> (glob)
123 124 References: <patchbomb.120@*> (glob)
124 125 User-Agent: Mercurial-patchbomb/* (glob)
125 126 Date: Thu, 01 Jan 1970 00:02:01 +0000
126 127 From: quux
127 128 To: foo
128 129 Cc: bar
129 130
130 131 # HG changeset patch
131 132 # User test
132 133 # Date 1 0
133 134 # Thu Jan 01 00:00:01 1970 +0000
134 135 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
135 136 # Parent 0000000000000000000000000000000000000000
136 137 a
137 138
138 139 diff -r 000000000000 -r 8580ff50825a a
139 140 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
140 141 +++ b/a Thu Jan 01 00:00:01 1970 +0000
141 142 @@ -0,0 +1,1 @@
142 143 +a
143 144
144 145 displaying [PATCH 2 of 2] b ...
145 146 Content-Type: text/plain; charset="us-ascii"
146 147 MIME-Version: 1.0
147 148 Content-Transfer-Encoding: 7bit
148 149 Subject: [PATCH 2 of 2] b
149 150 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
150 151 X-Mercurial-Series-Index: 2
151 152 X-Mercurial-Series-Total: 2
152 153 Message-Id: <97d72e5f12c7e84f8506.122@*> (glob)
153 154 X-Mercurial-Series-Id: <8580ff50825a50c8f716.121@*> (glob)
154 155 In-Reply-To: <patchbomb.120@*> (glob)
155 156 References: <patchbomb.120@*> (glob)
156 157 User-Agent: Mercurial-patchbomb/* (glob)
157 158 Date: Thu, 01 Jan 1970 00:02:02 +0000
158 159 From: quux
159 160 To: foo
160 161 Cc: bar
161 162
162 163 # HG changeset patch
163 164 # User test
164 165 # Date 2 0
165 166 # Thu Jan 01 00:00:02 1970 +0000
166 167 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
167 168 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
168 169 b
169 170
170 171 diff -r 8580ff50825a -r 97d72e5f12c7 b
171 172 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
172 173 +++ b/b Thu Jan 01 00:00:02 1970 +0000
173 174 @@ -0,0 +1,1 @@
174 175 +b
175 176
176 177
177 178 .hg/last-email.txt
178 179
179 180 $ cat > editor.sh << '__EOF__'
180 181 > echo "a precious introductory message" > "$1"
181 182 > __EOF__
182 183 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg email -n -t foo -s test -r 0:tip > /dev/null
183 184 $ cat .hg/last-email.txt
184 185 a precious introductory message
185 186
186 187 $ hg email -m test.mbox -f quux -t foo -c bar -s test 0:tip \
187 188 > --config extensions.progress= --config progress.assume-tty=1 \
188 189 > --config progress.delay=0 --config progress.refresh=0 \
189 190 > --config progress.width=60
190 191 this patch series consists of 2 patches.
191 192
192 193
193 194 Write the introductory message for the patch series.
194 195
195 196 \r (no-eol) (esc)
196 197 sending [ ] 0/3\r (no-eol) (esc)
197 198 sending [ ] 0/3\r (no-eol) (esc)
198 199 \r (no-eol) (esc)
199 200 \r (no-eol) (esc)
200 201 \r (no-eol) (esc)
201 202 \r (no-eol) (esc)
202 203 sending [==============> ] 1/3\r (no-eol) (esc)
203 204 sending [==============> ] 1/3\r (no-eol) (esc)
204 205 \r (no-eol) (esc)
205 206 \r (no-eol) (esc)
206 207 \r (no-eol) (esc)
207 208 \r (no-eol) (esc)
208 209 sending [=============================> ] 2/3\r (no-eol) (esc)
209 210 sending [=============================> ] 2/3\r (no-eol) (esc)
210 211 \r (esc)
211 212 sending [PATCH 0 of 2] test ...
212 213 sending [PATCH 1 of 2] a ...
213 214 sending [PATCH 2 of 2] b ...
214 215
215 216 $ cd ..
216 217
217 218 $ hg clone -q t t2
218 219 $ cd t2
219 220 $ echo c > c
220 221 $ hg commit -Amc -d '3 0'
221 222 adding c
222 223
223 224 $ cat > description <<EOF
224 225 > a multiline
225 226 >
226 227 > description
227 228 > EOF
228 229
229 230
230 231 test bundle and description:
231 232 $ hg email --date '1970-1-1 0:3' -n -f quux -t foo \
232 233 > -c bar -s test -r tip -b --desc description | $FILTERBOUNDARY
233 234 searching for changes
234 235 1 changesets found
235 236
236 237 displaying test ...
237 238 Content-Type: multipart/mixed; boundary="===*==" (glob)
238 239 MIME-Version: 1.0
239 240 Subject: test
240 241 Message-Id: <patchbomb.180@*> (glob)
241 242 User-Agent: Mercurial-patchbomb/* (glob)
242 243 Date: Thu, 01 Jan 1970 00:03:00 +0000
243 244 From: quux
244 245 To: foo
245 246 Cc: bar
246 247
247 248 --===*= (glob)
248 249 Content-Type: text/plain; charset="us-ascii"
249 250 MIME-Version: 1.0
250 251 Content-Transfer-Encoding: 7bit
251 252
252 253 a multiline
253 254
254 255 description
255 256
256 257 --===*= (glob)
257 258 Content-Type: application/x-mercurial-bundle
258 259 MIME-Version: 1.0
259 260 Content-Disposition: attachment; filename="bundle.hg"
260 261 Content-Transfer-Encoding: base64
261 262
262 263 SEcxMEJaaDkxQVkmU1nvR7I3AAAN////lFYQWj1/4HwRkdC/AywIAk0E4pfoSIIIgQCgGEQOcLAA
263 264 2tA1VPyp4mkeoG0EaaPU0GTT1GjRiNPIg9CZGBqZ6UbU9J+KFU09DNUaGgAAAAAANAGgAAAAA1U8
264 265 oGgAADQGgAANNANAAAAAAZipFLz3XoakCEQB3PVPyHJVi1iYkAAKQAZQGpQGZESInRnCFMqLDla2
265 266 Bx3qfRQeA2N4lnzKkAmP8kR2asievLLXXebVU8Vg4iEBqcJNJAxIapSU6SM4888ZAciRG6MYAIEE
266 267 SlIBpFisgGkyRjX//TMtfcUAEsGu56+YnE1OlTZmzKm8BSu2rvo4rHAYYaadIFFuTy0LYgIkgLVD
267 268 sgVa2F19D1tx9+hgbAygLgQwaIqcDdgA4BjQgIiz/AEP72++llgDKhKducqodGE4B0ETqF3JFOFC
268 269 Q70eyNw=
269 270 --===*=-- (glob)
270 271
271 272 utf-8 patch:
272 273 $ python -c 'fp = open("utf", "wb"); fp.write("h\xC3\xB6mma!\n"); fp.close();'
273 274 $ hg commit -A -d '4 0' -m 'utf-8 content'
274 275 adding description
275 276 adding utf
276 277
277 278 no mime encoding for email --test:
278 279 $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n
279 280 this patch series consists of 1 patches.
280 281
281 282
282 283 displaying [PATCH] utf-8 content ...
283 284 Content-Type: text/plain; charset="us-ascii"
284 285 MIME-Version: 1.0
285 286 Content-Transfer-Encoding: 8bit
286 287 Subject: [PATCH] utf-8 content
287 288 X-Mercurial-Node: 909a00e13e9d78b575aeee23dddbada46d5a143f
288 289 X-Mercurial-Series-Index: 1
289 290 X-Mercurial-Series-Total: 1
290 291 Message-Id: <909a00e13e9d78b575ae.240@*> (glob)
291 292 X-Mercurial-Series-Id: <909a00e13e9d78b575ae.240@*> (glob)
292 293 User-Agent: Mercurial-patchbomb/* (glob)
293 294 Date: Thu, 01 Jan 1970 00:04:00 +0000
294 295 From: quux
295 296 To: foo
296 297 Cc: bar
297 298
298 299 # HG changeset patch
299 300 # User test
300 301 # Date 4 0
301 302 # Thu Jan 01 00:00:04 1970 +0000
302 303 # Node ID 909a00e13e9d78b575aeee23dddbada46d5a143f
303 304 # Parent ff2c9fa2018b15fa74b33363bda9527323e2a99f
304 305 utf-8 content
305 306
306 307 diff -r ff2c9fa2018b -r 909a00e13e9d description
307 308 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
308 309 +++ b/description Thu Jan 01 00:00:04 1970 +0000
309 310 @@ -0,0 +1,3 @@
310 311 +a multiline
311 312 +
312 313 +description
313 314 diff -r ff2c9fa2018b -r 909a00e13e9d utf
314 315 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
315 316 +++ b/utf Thu Jan 01 00:00:04 1970 +0000
316 317 @@ -0,0 +1,1 @@
317 318 +h\xc3\xb6mma! (esc)
318 319
319 320
320 321 mime encoded mbox (base64):
321 322 $ hg email --date '1970-1-1 0:4' -f 'Q <quux>' -t foo -c bar -r tip -m mbox
322 323 this patch series consists of 1 patches.
323 324
324 325
325 326 sending [PATCH] utf-8 content ...
326 327
327 328 $ cat mbox
328 329 From quux ... ... .. ..:..:.. .... (re)
329 330 Content-Type: text/plain; charset="utf-8"
330 331 MIME-Version: 1.0
331 332 Content-Transfer-Encoding: base64
332 333 Subject: [PATCH] utf-8 content
333 334 X-Mercurial-Node: 909a00e13e9d78b575aeee23dddbada46d5a143f
334 335 X-Mercurial-Series-Index: 1
335 336 X-Mercurial-Series-Total: 1
336 337 Message-Id: <909a00e13e9d78b575ae.240@*> (glob)
337 338 X-Mercurial-Series-Id: <909a00e13e9d78b575ae.240@*> (glob)
338 339 User-Agent: Mercurial-patchbomb/* (glob)
339 340 Date: Thu, 01 Jan 1970 00:04:00 +0000
340 341 From: Q <quux>
341 342 To: foo
342 343 Cc: bar
343 344
344 345 IyBIRyBjaGFuZ2VzZXQgcGF0Y2gKIyBVc2VyIHRlc3QKIyBEYXRlIDQgMAojICAgICAgVGh1IEph
345 346 biAwMSAwMDowMDowNCAxOTcwICswMDAwCiMgTm9kZSBJRCA5MDlhMDBlMTNlOWQ3OGI1NzVhZWVl
346 347 MjNkZGRiYWRhNDZkNWExNDNmCiMgUGFyZW50ICBmZjJjOWZhMjAxOGIxNWZhNzRiMzMzNjNiZGE5
347 348 NTI3MzIzZTJhOTlmCnV0Zi04IGNvbnRlbnQKCmRpZmYgLXIgZmYyYzlmYTIwMThiIC1yIDkwOWEw
348 349 MGUxM2U5ZCBkZXNjcmlwdGlvbgotLS0gL2Rldi9udWxsCVRodSBKYW4gMDEgMDA6MDA6MDAgMTk3
349 350 MCArMDAwMAorKysgYi9kZXNjcmlwdGlvbglUaHUgSmFuIDAxIDAwOjAwOjA0IDE5NzAgKzAwMDAK
350 351 QEAgLTAsMCArMSwzIEBACithIG11bHRpbGluZQorCitkZXNjcmlwdGlvbgpkaWZmIC1yIGZmMmM5
351 352 ZmEyMDE4YiAtciA5MDlhMDBlMTNlOWQgdXRmCi0tLSAvZGV2L251bGwJVGh1IEphbiAwMSAwMDow
352 353 MDowMCAxOTcwICswMDAwCisrKyBiL3V0ZglUaHUgSmFuIDAxIDAwOjAwOjA0IDE5NzAgKzAwMDAK
353 354 QEAgLTAsMCArMSwxIEBACitow7ZtbWEhCg==
354 355
355 356
356 357 $ python -c 'print open("mbox").read().split("\n\n")[1].decode("base64")'
357 358 # HG changeset patch
358 359 # User test
359 360 # Date 4 0
360 361 # Thu Jan 01 00:00:04 1970 +0000
361 362 # Node ID 909a00e13e9d78b575aeee23dddbada46d5a143f
362 363 # Parent ff2c9fa2018b15fa74b33363bda9527323e2a99f
363 364 utf-8 content
364 365
365 366 diff -r ff2c9fa2018b -r 909a00e13e9d description
366 367 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
367 368 +++ b/description Thu Jan 01 00:00:04 1970 +0000
368 369 @@ -0,0 +1,3 @@
369 370 +a multiline
370 371 +
371 372 +description
372 373 diff -r ff2c9fa2018b -r 909a00e13e9d utf
373 374 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
374 375 +++ b/utf Thu Jan 01 00:00:04 1970 +0000
375 376 @@ -0,0 +1,1 @@
376 377 +h\xc3\xb6mma! (esc)
377 378
378 379 $ rm mbox
379 380
380 381 mime encoded mbox (quoted-printable):
381 382 $ python -c 'fp = open("long", "wb"); fp.write("%s\nfoo\n\nbar\n" % ("x" * 1024)); fp.close();'
382 383 $ hg commit -A -d '4 0' -m 'long line'
383 384 adding long
384 385
385 386 no mime encoding for email --test:
386 387 $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n
387 388 this patch series consists of 1 patches.
388 389
389 390
390 391 displaying [PATCH] long line ...
391 392 Content-Type: text/plain; charset="us-ascii"
392 393 MIME-Version: 1.0
393 394 Content-Transfer-Encoding: quoted-printable
394 395 Subject: [PATCH] long line
395 396 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
396 397 X-Mercurial-Series-Index: 1
397 398 X-Mercurial-Series-Total: 1
398 399 Message-Id: <a2ea8fc83dd8b93cfd86.240@*> (glob)
399 400 X-Mercurial-Series-Id: <a2ea8fc83dd8b93cfd86.240@*> (glob)
400 401 User-Agent: Mercurial-patchbomb/* (glob)
401 402 Date: Thu, 01 Jan 1970 00:04:00 +0000
402 403 From: quux
403 404 To: foo
404 405 Cc: bar
405 406
406 407 # HG changeset patch
407 408 # User test
408 409 # Date 4 0
409 410 # Thu Jan 01 00:00:04 1970 +0000
410 411 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
411 412 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
412 413 long line
413 414
414 415 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
415 416 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
416 417 +++ b/long Thu Jan 01 00:00:04 1970 +0000
417 418 @@ -0,0 +1,4 @@
418 419 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
419 420 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
420 421 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
421 422 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
422 423 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
423 424 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
424 425 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
425 426 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
426 427 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
427 428 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
428 429 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
429 430 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
430 431 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
431 432 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
432 433 +foo
433 434 +
434 435 +bar
435 436
436 437
437 438 mime encoded mbox (quoted-printable):
438 439 $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -m mbox
439 440 this patch series consists of 1 patches.
440 441
441 442
442 443 sending [PATCH] long line ...
443 444 $ cat mbox
444 445 From quux ... ... .. ..:..:.. .... (re)
445 446 Content-Type: text/plain; charset="us-ascii"
446 447 MIME-Version: 1.0
447 448 Content-Transfer-Encoding: quoted-printable
448 449 Subject: [PATCH] long line
449 450 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
450 451 X-Mercurial-Series-Index: 1
451 452 X-Mercurial-Series-Total: 1
452 453 Message-Id: <a2ea8fc83dd8b93cfd86.240@*> (glob)
453 454 X-Mercurial-Series-Id: <a2ea8fc83dd8b93cfd86.240@*> (glob)
454 455 User-Agent: Mercurial-patchbomb/* (glob)
455 456 Date: Thu, 01 Jan 1970 00:04:00 +0000
456 457 From: quux
457 458 To: foo
458 459 Cc: bar
459 460
460 461 # HG changeset patch
461 462 # User test
462 463 # Date 4 0
463 464 # Thu Jan 01 00:00:04 1970 +0000
464 465 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
465 466 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
466 467 long line
467 468
468 469 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
469 470 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
470 471 +++ b/long Thu Jan 01 00:00:04 1970 +0000
471 472 @@ -0,0 +1,4 @@
472 473 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
473 474 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
474 475 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
475 476 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
476 477 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
477 478 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
478 479 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
479 480 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
480 481 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
481 482 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
482 483 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
483 484 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
484 485 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
485 486 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
486 487 +foo
487 488 +
488 489 +bar
489 490
490 491
491 492
492 493 $ rm mbox
493 494
494 495 iso-8859-1 patch:
495 496 $ python -c 'fp = open("isolatin", "wb"); fp.write("h\xF6mma!\n"); fp.close();'
496 497 $ hg commit -A -d '5 0' -m 'isolatin 8-bit encoding'
497 498 adding isolatin
498 499
499 500 fake ascii mbox:
500 501 $ hg email --date '1970-1-1 0:5' -f quux -t foo -c bar -r tip -m mbox
501 502 this patch series consists of 1 patches.
502 503
503 504
504 505 sending [PATCH] isolatin 8-bit encoding ...
505 506 $ cat mbox
506 507 From quux ... ... .. ..:..:.. .... (re)
507 508 Content-Type: text/plain; charset="us-ascii"
508 509 MIME-Version: 1.0
509 510 Content-Transfer-Encoding: 8bit
510 511 Subject: [PATCH] isolatin 8-bit encoding
511 512 X-Mercurial-Node: 240fb913fc1b7ff15ddb9f33e73d82bf5277c720
512 513 X-Mercurial-Series-Index: 1
513 514 X-Mercurial-Series-Total: 1
514 515 Message-Id: <240fb913fc1b7ff15ddb.300@*> (glob)
515 516 X-Mercurial-Series-Id: <240fb913fc1b7ff15ddb.300@*> (glob)
516 517 User-Agent: Mercurial-patchbomb/* (glob)
517 518 Date: Thu, 01 Jan 1970 00:05:00 +0000
518 519 From: quux
519 520 To: foo
520 521 Cc: bar
521 522
522 523 # HG changeset patch
523 524 # User test
524 525 # Date 5 0
525 526 # Thu Jan 01 00:00:05 1970 +0000
526 527 # Node ID 240fb913fc1b7ff15ddb9f33e73d82bf5277c720
527 528 # Parent a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
528 529 isolatin 8-bit encoding
529 530
530 531 diff -r a2ea8fc83dd8 -r 240fb913fc1b isolatin
531 532 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
532 533 +++ b/isolatin Thu Jan 01 00:00:05 1970 +0000
533 534 @@ -0,0 +1,1 @@
534 535 +h\xf6mma! (esc)
535 536
536 537
537 538
538 539 test diffstat for single patch:
539 540 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y -r 2
540 541 this patch series consists of 1 patches.
541 542
542 543
543 544 Final summary:
544 545
545 546 From: quux
546 547 To: foo
547 548 Cc: bar
548 549 Subject: [PATCH] test
549 550 c | 1 +
550 551 1 files changed, 1 insertions(+), 0 deletions(-)
551 552
552 553 are you sure you want to send (yn)? y
553 554
554 555 displaying [PATCH] test ...
555 556 Content-Type: text/plain; charset="us-ascii"
556 557 MIME-Version: 1.0
557 558 Content-Transfer-Encoding: 7bit
558 559 Subject: [PATCH] test
559 560 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
560 561 X-Mercurial-Series-Index: 1
561 562 X-Mercurial-Series-Total: 1
562 563 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
563 564 X-Mercurial-Series-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
564 565 User-Agent: Mercurial-patchbomb/* (glob)
565 566 Date: Thu, 01 Jan 1970 00:01:00 +0000
566 567 From: quux
567 568 To: foo
568 569 Cc: bar
569 570
570 571 c | 1 +
571 572 1 files changed, 1 insertions(+), 0 deletions(-)
572 573
573 574
574 575 # HG changeset patch
575 576 # User test
576 577 # Date 3 0
577 578 # Thu Jan 01 00:00:03 1970 +0000
578 579 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
579 580 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
580 581 c
581 582
582 583 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
583 584 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
584 585 +++ b/c Thu Jan 01 00:00:03 1970 +0000
585 586 @@ -0,0 +1,1 @@
586 587 +c
587 588
588 589
589 590 test diffstat for multiple patches:
590 591 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y \
591 592 > -r 0:1
592 593 this patch series consists of 2 patches.
593 594
594 595
595 596 Write the introductory message for the patch series.
596 597
597 598
598 599 Final summary:
599 600
600 601 From: quux
601 602 To: foo
602 603 Cc: bar
603 604 Subject: [PATCH 0 of 2] test
604 605 a | 1 +
605 606 b | 1 +
606 607 2 files changed, 2 insertions(+), 0 deletions(-)
607 608 Subject: [PATCH 1 of 2] a
608 609 a | 1 +
609 610 1 files changed, 1 insertions(+), 0 deletions(-)
610 611 Subject: [PATCH 2 of 2] b
611 612 b | 1 +
612 613 1 files changed, 1 insertions(+), 0 deletions(-)
613 614
614 615 are you sure you want to send (yn)? y
615 616
616 617 displaying [PATCH 0 of 2] test ...
617 618 Content-Type: text/plain; charset="us-ascii"
618 619 MIME-Version: 1.0
619 620 Content-Transfer-Encoding: 7bit
620 621 Subject: [PATCH 0 of 2] test
621 622 Message-Id: <patchbomb.60@*> (glob)
622 623 User-Agent: Mercurial-patchbomb/* (glob)
623 624 Date: Thu, 01 Jan 1970 00:01:00 +0000
624 625 From: quux
625 626 To: foo
626 627 Cc: bar
627 628
628 629
629 630 a | 1 +
630 631 b | 1 +
631 632 2 files changed, 2 insertions(+), 0 deletions(-)
632 633
633 634 displaying [PATCH 1 of 2] a ...
634 635 Content-Type: text/plain; charset="us-ascii"
635 636 MIME-Version: 1.0
636 637 Content-Transfer-Encoding: 7bit
637 638 Subject: [PATCH 1 of 2] a
638 639 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
639 640 X-Mercurial-Series-Index: 1
640 641 X-Mercurial-Series-Total: 2
641 642 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
642 643 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
643 644 In-Reply-To: <patchbomb.60@*> (glob)
644 645 References: <patchbomb.60@*> (glob)
645 646 User-Agent: Mercurial-patchbomb/* (glob)
646 647 Date: Thu, 01 Jan 1970 00:01:01 +0000
647 648 From: quux
648 649 To: foo
649 650 Cc: bar
650 651
651 652 a | 1 +
652 653 1 files changed, 1 insertions(+), 0 deletions(-)
653 654
654 655
655 656 # HG changeset patch
656 657 # User test
657 658 # Date 1 0
658 659 # Thu Jan 01 00:00:01 1970 +0000
659 660 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
660 661 # Parent 0000000000000000000000000000000000000000
661 662 a
662 663
663 664 diff -r 000000000000 -r 8580ff50825a a
664 665 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
665 666 +++ b/a Thu Jan 01 00:00:01 1970 +0000
666 667 @@ -0,0 +1,1 @@
667 668 +a
668 669
669 670 displaying [PATCH 2 of 2] b ...
670 671 Content-Type: text/plain; charset="us-ascii"
671 672 MIME-Version: 1.0
672 673 Content-Transfer-Encoding: 7bit
673 674 Subject: [PATCH 2 of 2] b
674 675 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
675 676 X-Mercurial-Series-Index: 2
676 677 X-Mercurial-Series-Total: 2
677 678 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
678 679 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
679 680 In-Reply-To: <patchbomb.60@*> (glob)
680 681 References: <patchbomb.60@*> (glob)
681 682 User-Agent: Mercurial-patchbomb/* (glob)
682 683 Date: Thu, 01 Jan 1970 00:01:02 +0000
683 684 From: quux
684 685 To: foo
685 686 Cc: bar
686 687
687 688 b | 1 +
688 689 1 files changed, 1 insertions(+), 0 deletions(-)
689 690
690 691
691 692 # HG changeset patch
692 693 # User test
693 694 # Date 2 0
694 695 # Thu Jan 01 00:00:02 1970 +0000
695 696 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
696 697 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
697 698 b
698 699
699 700 diff -r 8580ff50825a -r 97d72e5f12c7 b
700 701 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
701 702 +++ b/b Thu Jan 01 00:00:02 1970 +0000
702 703 @@ -0,0 +1,1 @@
703 704 +b
704 705
705 706
706 707 test inline for single patch:
707 708 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2 | $FILTERBOUNDARY
708 709 this patch series consists of 1 patches.
709 710
710 711
711 712 displaying [PATCH] test ...
712 713 Content-Type: multipart/mixed; boundary="===*==" (glob)
713 714 MIME-Version: 1.0
714 715 Subject: [PATCH] test
715 716 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
716 717 X-Mercurial-Series-Index: 1
717 718 X-Mercurial-Series-Total: 1
718 719 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
719 720 X-Mercurial-Series-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
720 721 User-Agent: Mercurial-patchbomb/* (glob)
721 722 Date: Thu, 01 Jan 1970 00:01:00 +0000
722 723 From: quux
723 724 To: foo
724 725 Cc: bar
725 726
726 727 --===*= (glob)
727 728 Content-Type: text/x-patch; charset="us-ascii"
728 729 MIME-Version: 1.0
729 730 Content-Transfer-Encoding: 7bit
730 731 Content-Disposition: inline; filename=t2.patch
731 732
732 733 # HG changeset patch
733 734 # User test
734 735 # Date 3 0
735 736 # Thu Jan 01 00:00:03 1970 +0000
736 737 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
737 738 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
738 739 c
739 740
740 741 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
741 742 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
742 743 +++ b/c Thu Jan 01 00:00:03 1970 +0000
743 744 @@ -0,0 +1,1 @@
744 745 +c
745 746
746 747 --===*=-- (glob)
747 748
748 749
749 750 test inline for single patch (quoted-printable):
750 751 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 4 | $FILTERBOUNDARY
751 752 this patch series consists of 1 patches.
752 753
753 754
754 755 displaying [PATCH] test ...
755 756 Content-Type: multipart/mixed; boundary="===*==" (glob)
756 757 MIME-Version: 1.0
757 758 Subject: [PATCH] test
758 759 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
759 760 X-Mercurial-Series-Index: 1
760 761 X-Mercurial-Series-Total: 1
761 762 Message-Id: <a2ea8fc83dd8b93cfd86.60@*> (glob)
762 763 X-Mercurial-Series-Id: <a2ea8fc83dd8b93cfd86.60@*> (glob)
763 764 User-Agent: Mercurial-patchbomb/* (glob)
764 765 Date: Thu, 01 Jan 1970 00:01:00 +0000
765 766 From: quux
766 767 To: foo
767 768 Cc: bar
768 769
769 770 --===*= (glob)
770 771 Content-Type: text/x-patch; charset="us-ascii"
771 772 MIME-Version: 1.0
772 773 Content-Transfer-Encoding: quoted-printable
773 774 Content-Disposition: inline; filename=t2.patch
774 775
775 776 # HG changeset patch
776 777 # User test
777 778 # Date 4 0
778 779 # Thu Jan 01 00:00:04 1970 +0000
779 780 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
780 781 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
781 782 long line
782 783
783 784 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
784 785 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
785 786 +++ b/long Thu Jan 01 00:00:04 1970 +0000
786 787 @@ -0,0 +1,4 @@
787 788 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
788 789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
789 790 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
790 791 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
791 792 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
792 793 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
793 794 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
794 795 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
795 796 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
796 797 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
797 798 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
798 799 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
799 800 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
800 801 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
801 802 +foo
802 803 +
803 804 +bar
804 805
805 806 --===*=-- (glob)
806 807
807 808 test inline for multiple patches:
808 809 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i \
809 810 > -r 0:1 -r 4 | $FILTERBOUNDARY
810 811 this patch series consists of 3 patches.
811 812
812 813
813 814 Write the introductory message for the patch series.
814 815
815 816
816 817 displaying [PATCH 0 of 3] test ...
817 818 Content-Type: text/plain; charset="us-ascii"
818 819 MIME-Version: 1.0
819 820 Content-Transfer-Encoding: 7bit
820 821 Subject: [PATCH 0 of 3] test
821 822 Message-Id: <patchbomb.60@*> (glob)
822 823 User-Agent: Mercurial-patchbomb/* (glob)
823 824 Date: Thu, 01 Jan 1970 00:01:00 +0000
824 825 From: quux
825 826 To: foo
826 827 Cc: bar
827 828
828 829
829 830 displaying [PATCH 1 of 3] a ...
830 831 Content-Type: multipart/mixed; boundary="===*==" (glob)
831 832 MIME-Version: 1.0
832 833 Subject: [PATCH 1 of 3] a
833 834 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
834 835 X-Mercurial-Series-Index: 1
835 836 X-Mercurial-Series-Total: 3
836 837 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
837 838 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
838 839 In-Reply-To: <patchbomb.60@*> (glob)
839 840 References: <patchbomb.60@*> (glob)
840 841 User-Agent: Mercurial-patchbomb/* (glob)
841 842 Date: Thu, 01 Jan 1970 00:01:01 +0000
842 843 From: quux
843 844 To: foo
844 845 Cc: bar
845 846
846 847 --===*= (glob)
847 848 Content-Type: text/x-patch; charset="us-ascii"
848 849 MIME-Version: 1.0
849 850 Content-Transfer-Encoding: 7bit
850 851 Content-Disposition: inline; filename=t2-1.patch
851 852
852 853 # HG changeset patch
853 854 # User test
854 855 # Date 1 0
855 856 # Thu Jan 01 00:00:01 1970 +0000
856 857 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
857 858 # Parent 0000000000000000000000000000000000000000
858 859 a
859 860
860 861 diff -r 000000000000 -r 8580ff50825a a
861 862 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
862 863 +++ b/a Thu Jan 01 00:00:01 1970 +0000
863 864 @@ -0,0 +1,1 @@
864 865 +a
865 866
866 867 --===*=-- (glob)
867 868 displaying [PATCH 2 of 3] b ...
868 869 Content-Type: multipart/mixed; boundary="===*==" (glob)
869 870 MIME-Version: 1.0
870 871 Subject: [PATCH 2 of 3] b
871 872 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
872 873 X-Mercurial-Series-Index: 2
873 874 X-Mercurial-Series-Total: 3
874 875 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
875 876 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
876 877 In-Reply-To: <patchbomb.60@*> (glob)
877 878 References: <patchbomb.60@*> (glob)
878 879 User-Agent: Mercurial-patchbomb/* (glob)
879 880 Date: Thu, 01 Jan 1970 00:01:02 +0000
880 881 From: quux
881 882 To: foo
882 883 Cc: bar
883 884
884 885 --===*= (glob)
885 886 Content-Type: text/x-patch; charset="us-ascii"
886 887 MIME-Version: 1.0
887 888 Content-Transfer-Encoding: 7bit
888 889 Content-Disposition: inline; filename=t2-2.patch
889 890
890 891 # HG changeset patch
891 892 # User test
892 893 # Date 2 0
893 894 # Thu Jan 01 00:00:02 1970 +0000
894 895 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
895 896 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
896 897 b
897 898
898 899 diff -r 8580ff50825a -r 97d72e5f12c7 b
899 900 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
900 901 +++ b/b Thu Jan 01 00:00:02 1970 +0000
901 902 @@ -0,0 +1,1 @@
902 903 +b
903 904
904 905 --===*=-- (glob)
905 906 displaying [PATCH 3 of 3] long line ...
906 907 Content-Type: multipart/mixed; boundary="===*==" (glob)
907 908 MIME-Version: 1.0
908 909 Subject: [PATCH 3 of 3] long line
909 910 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
910 911 X-Mercurial-Series-Index: 3
911 912 X-Mercurial-Series-Total: 3
912 913 Message-Id: <a2ea8fc83dd8b93cfd86.63@*> (glob)
913 914 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
914 915 In-Reply-To: <patchbomb.60@*> (glob)
915 916 References: <patchbomb.60@*> (glob)
916 917 User-Agent: Mercurial-patchbomb/* (glob)
917 918 Date: Thu, 01 Jan 1970 00:01:03 +0000
918 919 From: quux
919 920 To: foo
920 921 Cc: bar
921 922
922 923 --===*= (glob)
923 924 Content-Type: text/x-patch; charset="us-ascii"
924 925 MIME-Version: 1.0
925 926 Content-Transfer-Encoding: quoted-printable
926 927 Content-Disposition: inline; filename=t2-3.patch
927 928
928 929 # HG changeset patch
929 930 # User test
930 931 # Date 4 0
931 932 # Thu Jan 01 00:00:04 1970 +0000
932 933 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
933 934 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
934 935 long line
935 936
936 937 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
937 938 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
938 939 +++ b/long Thu Jan 01 00:00:04 1970 +0000
939 940 @@ -0,0 +1,4 @@
940 941 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
941 942 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
942 943 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
943 944 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
944 945 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
945 946 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
946 947 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
947 948 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
948 949 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
949 950 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
950 951 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
951 952 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
952 953 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
953 954 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
954 955 +foo
955 956 +
956 957 +bar
957 958
958 959 --===*=-- (glob)
959 960
960 961 test attach for single patch:
961 962 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 2 | $FILTERBOUNDARY
962 963 this patch series consists of 1 patches.
963 964
964 965
965 966 displaying [PATCH] test ...
966 967 Content-Type: multipart/mixed; boundary="===*==" (glob)
967 968 MIME-Version: 1.0
968 969 Subject: [PATCH] test
969 970 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
970 971 X-Mercurial-Series-Index: 1
971 972 X-Mercurial-Series-Total: 1
972 973 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
973 974 X-Mercurial-Series-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
974 975 User-Agent: Mercurial-patchbomb/* (glob)
975 976 Date: Thu, 01 Jan 1970 00:01:00 +0000
976 977 From: quux
977 978 To: foo
978 979 Cc: bar
979 980
980 981 --===*= (glob)
981 982 Content-Type: text/plain; charset="us-ascii"
982 983 MIME-Version: 1.0
983 984 Content-Transfer-Encoding: 7bit
984 985
985 986 Patch subject is complete summary.
986 987
987 988
988 989
989 990 --===*= (glob)
990 991 Content-Type: text/x-patch; charset="us-ascii"
991 992 MIME-Version: 1.0
992 993 Content-Transfer-Encoding: 7bit
993 994 Content-Disposition: attachment; filename=t2.patch
994 995
995 996 # HG changeset patch
996 997 # User test
997 998 # Date 3 0
998 999 # Thu Jan 01 00:00:03 1970 +0000
999 1000 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1000 1001 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1001 1002 c
1002 1003
1003 1004 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1004 1005 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1005 1006 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1006 1007 @@ -0,0 +1,1 @@
1007 1008 +c
1008 1009
1009 1010 --===*=-- (glob)
1010 1011
1011 1012 test attach for single patch (quoted-printable):
1012 1013 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 4 | $FILTERBOUNDARY
1013 1014 this patch series consists of 1 patches.
1014 1015
1015 1016
1016 1017 displaying [PATCH] test ...
1017 1018 Content-Type: multipart/mixed; boundary="===*==" (glob)
1018 1019 MIME-Version: 1.0
1019 1020 Subject: [PATCH] test
1020 1021 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
1021 1022 X-Mercurial-Series-Index: 1
1022 1023 X-Mercurial-Series-Total: 1
1023 1024 Message-Id: <a2ea8fc83dd8b93cfd86.60@*> (glob)
1024 1025 X-Mercurial-Series-Id: <a2ea8fc83dd8b93cfd86.60@*> (glob)
1025 1026 User-Agent: Mercurial-patchbomb/* (glob)
1026 1027 Date: Thu, 01 Jan 1970 00:01:00 +0000
1027 1028 From: quux
1028 1029 To: foo
1029 1030 Cc: bar
1030 1031
1031 1032 --===*= (glob)
1032 1033 Content-Type: text/plain; charset="us-ascii"
1033 1034 MIME-Version: 1.0
1034 1035 Content-Transfer-Encoding: 7bit
1035 1036
1036 1037 Patch subject is complete summary.
1037 1038
1038 1039
1039 1040
1040 1041 --===*= (glob)
1041 1042 Content-Type: text/x-patch; charset="us-ascii"
1042 1043 MIME-Version: 1.0
1043 1044 Content-Transfer-Encoding: quoted-printable
1044 1045 Content-Disposition: attachment; filename=t2.patch
1045 1046
1046 1047 # HG changeset patch
1047 1048 # User test
1048 1049 # Date 4 0
1049 1050 # Thu Jan 01 00:00:04 1970 +0000
1050 1051 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
1051 1052 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
1052 1053 long line
1053 1054
1054 1055 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
1055 1056 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1056 1057 +++ b/long Thu Jan 01 00:00:04 1970 +0000
1057 1058 @@ -0,0 +1,4 @@
1058 1059 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1059 1060 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1060 1061 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1061 1062 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1062 1063 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1063 1064 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1064 1065 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1065 1066 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1066 1067 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1067 1068 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1068 1069 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1069 1070 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1070 1071 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1071 1072 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1072 1073 +foo
1073 1074 +
1074 1075 +bar
1075 1076
1076 1077 --===*=-- (glob)
1077 1078
1078 1079 test attach and body for single patch:
1079 1080 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a --body -r 2 | $FILTERBOUNDARY
1080 1081 this patch series consists of 1 patches.
1081 1082
1082 1083
1083 1084 displaying [PATCH] test ...
1084 1085 Content-Type: multipart/mixed; boundary="===*==" (glob)
1085 1086 MIME-Version: 1.0
1086 1087 Subject: [PATCH] test
1087 1088 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1088 1089 X-Mercurial-Series-Index: 1
1089 1090 X-Mercurial-Series-Total: 1
1090 1091 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1091 1092 X-Mercurial-Series-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1092 1093 User-Agent: Mercurial-patchbomb/* (glob)
1093 1094 Date: Thu, 01 Jan 1970 00:01:00 +0000
1094 1095 From: quux
1095 1096 To: foo
1096 1097 Cc: bar
1097 1098
1098 1099 --===*= (glob)
1099 1100 Content-Type: text/plain; charset="us-ascii"
1100 1101 MIME-Version: 1.0
1101 1102 Content-Transfer-Encoding: 7bit
1102 1103
1103 1104 # HG changeset patch
1104 1105 # User test
1105 1106 # Date 3 0
1106 1107 # Thu Jan 01 00:00:03 1970 +0000
1107 1108 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1108 1109 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1109 1110 c
1110 1111
1111 1112 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1112 1113 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1113 1114 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1114 1115 @@ -0,0 +1,1 @@
1115 1116 +c
1116 1117
1117 1118 --===*= (glob)
1118 1119 Content-Type: text/x-patch; charset="us-ascii"
1119 1120 MIME-Version: 1.0
1120 1121 Content-Transfer-Encoding: 7bit
1121 1122 Content-Disposition: attachment; filename=t2.patch
1122 1123
1123 1124 # HG changeset patch
1124 1125 # User test
1125 1126 # Date 3 0
1126 1127 # Thu Jan 01 00:00:03 1970 +0000
1127 1128 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1128 1129 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1129 1130 c
1130 1131
1131 1132 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1132 1133 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1133 1134 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1134 1135 @@ -0,0 +1,1 @@
1135 1136 +c
1136 1137
1137 1138 --===*=-- (glob)
1138 1139
1139 1140 test attach for multiple patches:
1140 1141 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a \
1141 1142 > -r 0:1 -r 4 | $FILTERBOUNDARY
1142 1143 this patch series consists of 3 patches.
1143 1144
1144 1145
1145 1146 Write the introductory message for the patch series.
1146 1147
1147 1148
1148 1149 displaying [PATCH 0 of 3] test ...
1149 1150 Content-Type: text/plain; charset="us-ascii"
1150 1151 MIME-Version: 1.0
1151 1152 Content-Transfer-Encoding: 7bit
1152 1153 Subject: [PATCH 0 of 3] test
1153 1154 Message-Id: <patchbomb.60@*> (glob)
1154 1155 User-Agent: Mercurial-patchbomb/* (glob)
1155 1156 Date: Thu, 01 Jan 1970 00:01:00 +0000
1156 1157 From: quux
1157 1158 To: foo
1158 1159 Cc: bar
1159 1160
1160 1161
1161 1162 displaying [PATCH 1 of 3] a ...
1162 1163 Content-Type: multipart/mixed; boundary="===*==" (glob)
1163 1164 MIME-Version: 1.0
1164 1165 Subject: [PATCH 1 of 3] a
1165 1166 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1166 1167 X-Mercurial-Series-Index: 1
1167 1168 X-Mercurial-Series-Total: 3
1168 1169 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
1169 1170 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
1170 1171 In-Reply-To: <patchbomb.60@*> (glob)
1171 1172 References: <patchbomb.60@*> (glob)
1172 1173 User-Agent: Mercurial-patchbomb/* (glob)
1173 1174 Date: Thu, 01 Jan 1970 00:01:01 +0000
1174 1175 From: quux
1175 1176 To: foo
1176 1177 Cc: bar
1177 1178
1178 1179 --===*= (glob)
1179 1180 Content-Type: text/plain; charset="us-ascii"
1180 1181 MIME-Version: 1.0
1181 1182 Content-Transfer-Encoding: 7bit
1182 1183
1183 1184 Patch subject is complete summary.
1184 1185
1185 1186
1186 1187
1187 1188 --===*= (glob)
1188 1189 Content-Type: text/x-patch; charset="us-ascii"
1189 1190 MIME-Version: 1.0
1190 1191 Content-Transfer-Encoding: 7bit
1191 1192 Content-Disposition: attachment; filename=t2-1.patch
1192 1193
1193 1194 # HG changeset patch
1194 1195 # User test
1195 1196 # Date 1 0
1196 1197 # Thu Jan 01 00:00:01 1970 +0000
1197 1198 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1198 1199 # Parent 0000000000000000000000000000000000000000
1199 1200 a
1200 1201
1201 1202 diff -r 000000000000 -r 8580ff50825a a
1202 1203 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1203 1204 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1204 1205 @@ -0,0 +1,1 @@
1205 1206 +a
1206 1207
1207 1208 --===*=-- (glob)
1208 1209 displaying [PATCH 2 of 3] b ...
1209 1210 Content-Type: multipart/mixed; boundary="===*==" (glob)
1210 1211 MIME-Version: 1.0
1211 1212 Subject: [PATCH 2 of 3] b
1212 1213 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1213 1214 X-Mercurial-Series-Index: 2
1214 1215 X-Mercurial-Series-Total: 3
1215 1216 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
1216 1217 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
1217 1218 In-Reply-To: <patchbomb.60@*> (glob)
1218 1219 References: <patchbomb.60@*> (glob)
1219 1220 User-Agent: Mercurial-patchbomb/* (glob)
1220 1221 Date: Thu, 01 Jan 1970 00:01:02 +0000
1221 1222 From: quux
1222 1223 To: foo
1223 1224 Cc: bar
1224 1225
1225 1226 --===*= (glob)
1226 1227 Content-Type: text/plain; charset="us-ascii"
1227 1228 MIME-Version: 1.0
1228 1229 Content-Transfer-Encoding: 7bit
1229 1230
1230 1231 Patch subject is complete summary.
1231 1232
1232 1233
1233 1234
1234 1235 --===*= (glob)
1235 1236 Content-Type: text/x-patch; charset="us-ascii"
1236 1237 MIME-Version: 1.0
1237 1238 Content-Transfer-Encoding: 7bit
1238 1239 Content-Disposition: attachment; filename=t2-2.patch
1239 1240
1240 1241 # HG changeset patch
1241 1242 # User test
1242 1243 # Date 2 0
1243 1244 # Thu Jan 01 00:00:02 1970 +0000
1244 1245 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1245 1246 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1246 1247 b
1247 1248
1248 1249 diff -r 8580ff50825a -r 97d72e5f12c7 b
1249 1250 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1250 1251 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1251 1252 @@ -0,0 +1,1 @@
1252 1253 +b
1253 1254
1254 1255 --===*=-- (glob)
1255 1256 displaying [PATCH 3 of 3] long line ...
1256 1257 Content-Type: multipart/mixed; boundary="===*==" (glob)
1257 1258 MIME-Version: 1.0
1258 1259 Subject: [PATCH 3 of 3] long line
1259 1260 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
1260 1261 X-Mercurial-Series-Index: 3
1261 1262 X-Mercurial-Series-Total: 3
1262 1263 Message-Id: <a2ea8fc83dd8b93cfd86.63@*> (glob)
1263 1264 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
1264 1265 In-Reply-To: <patchbomb.60@*> (glob)
1265 1266 References: <patchbomb.60@*> (glob)
1266 1267 User-Agent: Mercurial-patchbomb/* (glob)
1267 1268 Date: Thu, 01 Jan 1970 00:01:03 +0000
1268 1269 From: quux
1269 1270 To: foo
1270 1271 Cc: bar
1271 1272
1272 1273 --===*= (glob)
1273 1274 Content-Type: text/plain; charset="us-ascii"
1274 1275 MIME-Version: 1.0
1275 1276 Content-Transfer-Encoding: 7bit
1276 1277
1277 1278 Patch subject is complete summary.
1278 1279
1279 1280
1280 1281
1281 1282 --===*= (glob)
1282 1283 Content-Type: text/x-patch; charset="us-ascii"
1283 1284 MIME-Version: 1.0
1284 1285 Content-Transfer-Encoding: quoted-printable
1285 1286 Content-Disposition: attachment; filename=t2-3.patch
1286 1287
1287 1288 # HG changeset patch
1288 1289 # User test
1289 1290 # Date 4 0
1290 1291 # Thu Jan 01 00:00:04 1970 +0000
1291 1292 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
1292 1293 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
1293 1294 long line
1294 1295
1295 1296 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
1296 1297 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1297 1298 +++ b/long Thu Jan 01 00:00:04 1970 +0000
1298 1299 @@ -0,0 +1,4 @@
1299 1300 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1300 1301 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1301 1302 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1302 1303 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1303 1304 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1304 1305 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1305 1306 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1306 1307 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1307 1308 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1308 1309 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1309 1310 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1310 1311 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1311 1312 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1312 1313 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1313 1314 +foo
1314 1315 +
1315 1316 +bar
1316 1317
1317 1318 --===*=-- (glob)
1318 1319
1319 1320 test intro for single patch:
1320 1321 $ hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
1321 1322 > -r 2
1322 1323 this patch series consists of 1 patches.
1323 1324
1324 1325
1325 1326 Write the introductory message for the patch series.
1326 1327
1327 1328
1328 1329 displaying [PATCH 0 of 1] test ...
1329 1330 Content-Type: text/plain; charset="us-ascii"
1330 1331 MIME-Version: 1.0
1331 1332 Content-Transfer-Encoding: 7bit
1332 1333 Subject: [PATCH 0 of 1] test
1333 1334 Message-Id: <patchbomb.60@*> (glob)
1334 1335 User-Agent: Mercurial-patchbomb/* (glob)
1335 1336 Date: Thu, 01 Jan 1970 00:01:00 +0000
1336 1337 From: quux
1337 1338 To: foo
1338 1339 Cc: bar
1339 1340
1340 1341
1341 1342 displaying [PATCH 1 of 1] c ...
1342 1343 Content-Type: text/plain; charset="us-ascii"
1343 1344 MIME-Version: 1.0
1344 1345 Content-Transfer-Encoding: 7bit
1345 1346 Subject: [PATCH 1 of 1] c
1346 1347 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1347 1348 X-Mercurial-Series-Index: 1
1348 1349 X-Mercurial-Series-Total: 1
1349 1350 Message-Id: <ff2c9fa2018b15fa74b3.61@*> (glob)
1350 1351 X-Mercurial-Series-Id: <ff2c9fa2018b15fa74b3.61@*> (glob)
1351 1352 In-Reply-To: <patchbomb.60@*> (glob)
1352 1353 References: <patchbomb.60@*> (glob)
1353 1354 User-Agent: Mercurial-patchbomb/* (glob)
1354 1355 Date: Thu, 01 Jan 1970 00:01:01 +0000
1355 1356 From: quux
1356 1357 To: foo
1357 1358 Cc: bar
1358 1359
1359 1360 # HG changeset patch
1360 1361 # User test
1361 1362 # Date 3 0
1362 1363 # Thu Jan 01 00:00:03 1970 +0000
1363 1364 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1364 1365 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1365 1366 c
1366 1367
1367 1368 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1368 1369 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1369 1370 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1370 1371 @@ -0,0 +1,1 @@
1371 1372 +c
1372 1373
1373 1374
1374 1375 test --desc without --intro for a single patch:
1375 1376 $ echo foo > intro.text
1376 1377 $ hg email --date '1970-1-1 0:1' -n --desc intro.text -f quux -t foo -c bar \
1377 1378 > -s test -r 2
1378 1379 this patch series consists of 1 patches.
1379 1380
1380 1381
1381 1382 displaying [PATCH 0 of 1] test ...
1382 1383 Content-Type: text/plain; charset="us-ascii"
1383 1384 MIME-Version: 1.0
1384 1385 Content-Transfer-Encoding: 7bit
1385 1386 Subject: [PATCH 0 of 1] test
1386 1387 Message-Id: <patchbomb.60@*> (glob)
1387 1388 User-Agent: Mercurial-patchbomb/* (glob)
1388 1389 Date: Thu, 01 Jan 1970 00:01:00 +0000
1389 1390 From: quux
1390 1391 To: foo
1391 1392 Cc: bar
1392 1393
1393 1394 foo
1394 1395
1395 1396 displaying [PATCH 1 of 1] c ...
1396 1397 Content-Type: text/plain; charset="us-ascii"
1397 1398 MIME-Version: 1.0
1398 1399 Content-Transfer-Encoding: 7bit
1399 1400 Subject: [PATCH 1 of 1] c
1400 1401 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1401 1402 X-Mercurial-Series-Index: 1
1402 1403 X-Mercurial-Series-Total: 1
1403 1404 Message-Id: <ff2c9fa2018b15fa74b3.61@*> (glob)
1404 1405 X-Mercurial-Series-Id: <ff2c9fa2018b15fa74b3.61@*> (glob)
1405 1406 In-Reply-To: <patchbomb.60@*> (glob)
1406 1407 References: <patchbomb.60@*> (glob)
1407 1408 User-Agent: Mercurial-patchbomb/* (glob)
1408 1409 Date: Thu, 01 Jan 1970 00:01:01 +0000
1409 1410 From: quux
1410 1411 To: foo
1411 1412 Cc: bar
1412 1413
1413 1414 # HG changeset patch
1414 1415 # User test
1415 1416 # Date 3 0
1416 1417 # Thu Jan 01 00:00:03 1970 +0000
1417 1418 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1418 1419 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1419 1420 c
1420 1421
1421 1422 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1422 1423 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1423 1424 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1424 1425 @@ -0,0 +1,1 @@
1425 1426 +c
1426 1427
1427 1428
1428 1429 test intro for multiple patches:
1429 1430 $ hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
1430 1431 > -r 0:1
1431 1432 this patch series consists of 2 patches.
1432 1433
1433 1434
1434 1435 Write the introductory message for the patch series.
1435 1436
1436 1437
1437 1438 displaying [PATCH 0 of 2] test ...
1438 1439 Content-Type: text/plain; charset="us-ascii"
1439 1440 MIME-Version: 1.0
1440 1441 Content-Transfer-Encoding: 7bit
1441 1442 Subject: [PATCH 0 of 2] test
1442 1443 Message-Id: <patchbomb.60@*> (glob)
1443 1444 User-Agent: Mercurial-patchbomb/* (glob)
1444 1445 Date: Thu, 01 Jan 1970 00:01:00 +0000
1445 1446 From: quux
1446 1447 To: foo
1447 1448 Cc: bar
1448 1449
1449 1450
1450 1451 displaying [PATCH 1 of 2] a ...
1451 1452 Content-Type: text/plain; charset="us-ascii"
1452 1453 MIME-Version: 1.0
1453 1454 Content-Transfer-Encoding: 7bit
1454 1455 Subject: [PATCH 1 of 2] a
1455 1456 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1456 1457 X-Mercurial-Series-Index: 1
1457 1458 X-Mercurial-Series-Total: 2
1458 1459 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
1459 1460 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
1460 1461 In-Reply-To: <patchbomb.60@*> (glob)
1461 1462 References: <patchbomb.60@*> (glob)
1462 1463 User-Agent: Mercurial-patchbomb/* (glob)
1463 1464 Date: Thu, 01 Jan 1970 00:01:01 +0000
1464 1465 From: quux
1465 1466 To: foo
1466 1467 Cc: bar
1467 1468
1468 1469 # HG changeset patch
1469 1470 # User test
1470 1471 # Date 1 0
1471 1472 # Thu Jan 01 00:00:01 1970 +0000
1472 1473 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1473 1474 # Parent 0000000000000000000000000000000000000000
1474 1475 a
1475 1476
1476 1477 diff -r 000000000000 -r 8580ff50825a a
1477 1478 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1478 1479 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1479 1480 @@ -0,0 +1,1 @@
1480 1481 +a
1481 1482
1482 1483 displaying [PATCH 2 of 2] b ...
1483 1484 Content-Type: text/plain; charset="us-ascii"
1484 1485 MIME-Version: 1.0
1485 1486 Content-Transfer-Encoding: 7bit
1486 1487 Subject: [PATCH 2 of 2] b
1487 1488 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1488 1489 X-Mercurial-Series-Index: 2
1489 1490 X-Mercurial-Series-Total: 2
1490 1491 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
1491 1492 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
1492 1493 In-Reply-To: <patchbomb.60@*> (glob)
1493 1494 References: <patchbomb.60@*> (glob)
1494 1495 User-Agent: Mercurial-patchbomb/* (glob)
1495 1496 Date: Thu, 01 Jan 1970 00:01:02 +0000
1496 1497 From: quux
1497 1498 To: foo
1498 1499 Cc: bar
1499 1500
1500 1501 # HG changeset patch
1501 1502 # User test
1502 1503 # Date 2 0
1503 1504 # Thu Jan 01 00:00:02 1970 +0000
1504 1505 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1505 1506 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1506 1507 b
1507 1508
1508 1509 diff -r 8580ff50825a -r 97d72e5f12c7 b
1509 1510 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1510 1511 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1511 1512 @@ -0,0 +1,1 @@
1512 1513 +b
1513 1514
1514 1515
1515 1516 test reply-to via config:
1516 1517 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -r 2 \
1517 1518 > --config patchbomb.reply-to='baz@example.com'
1518 1519 this patch series consists of 1 patches.
1519 1520
1520 1521
1521 1522 displaying [PATCH] test ...
1522 1523 Content-Type: text/plain; charset="us-ascii"
1523 1524 MIME-Version: 1.0
1524 1525 Content-Transfer-Encoding: 7bit
1525 1526 Subject: [PATCH] test
1526 1527 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1527 1528 X-Mercurial-Series-Index: 1
1528 1529 X-Mercurial-Series-Total: 1
1529 1530 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1530 1531 X-Mercurial-Series-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1531 1532 User-Agent: Mercurial-patchbomb/* (glob)
1532 1533 Date: Thu, 01 Jan 1970 00:01:00 +0000
1533 1534 From: quux
1534 1535 To: foo
1535 1536 Cc: bar
1536 1537 Reply-To: baz@example.com
1537 1538
1538 1539 # HG changeset patch
1539 1540 # User test
1540 1541 # Date 3 0
1541 1542 # Thu Jan 01 00:00:03 1970 +0000
1542 1543 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1543 1544 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1544 1545 c
1545 1546
1546 1547 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1547 1548 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1548 1549 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1549 1550 @@ -0,0 +1,1 @@
1550 1551 +c
1551 1552
1552 1553
1553 1554 test reply-to via command line:
1554 1555 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -r 2 \
1555 1556 > --reply-to baz --reply-to fred
1556 1557 this patch series consists of 1 patches.
1557 1558
1558 1559
1559 1560 displaying [PATCH] test ...
1560 1561 Content-Type: text/plain; charset="us-ascii"
1561 1562 MIME-Version: 1.0
1562 1563 Content-Transfer-Encoding: 7bit
1563 1564 Subject: [PATCH] test
1564 1565 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1565 1566 X-Mercurial-Series-Index: 1
1566 1567 X-Mercurial-Series-Total: 1
1567 1568 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1568 1569 X-Mercurial-Series-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1569 1570 User-Agent: Mercurial-patchbomb/* (glob)
1570 1571 Date: Thu, 01 Jan 1970 00:01:00 +0000
1571 1572 From: quux
1572 1573 To: foo
1573 1574 Cc: bar
1574 1575 Reply-To: baz, fred
1575 1576
1576 1577 # HG changeset patch
1577 1578 # User test
1578 1579 # Date 3 0
1579 1580 # Thu Jan 01 00:00:03 1970 +0000
1580 1581 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1581 1582 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1582 1583 c
1583 1584
1584 1585 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1585 1586 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1586 1587 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1587 1588 @@ -0,0 +1,1 @@
1588 1589 +c
1589 1590
1590 1591
1591 1592 tagging csets:
1592 1593 $ hg tag -r0 zero zero.foo
1593 1594 $ hg tag -r1 one one.patch
1594 1595 $ hg tag -r2 two two.diff
1595 1596
1596 1597 test inline for single named patch:
1597 1598 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i \
1598 1599 > -r 2 | $FILTERBOUNDARY
1599 1600 this patch series consists of 1 patches.
1600 1601
1601 1602
1602 1603 displaying [PATCH] test ...
1603 1604 Content-Type: multipart/mixed; boundary="===*==" (glob)
1604 1605 MIME-Version: 1.0
1605 1606 Subject: [PATCH] test
1606 1607 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1607 1608 X-Mercurial-Series-Index: 1
1608 1609 X-Mercurial-Series-Total: 1
1609 1610 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1610 1611 X-Mercurial-Series-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1611 1612 User-Agent: Mercurial-patchbomb/* (glob)
1612 1613 Date: Thu, 01 Jan 1970 00:01:00 +0000
1613 1614 From: quux
1614 1615 To: foo
1615 1616 Cc: bar
1616 1617
1617 1618 --===*= (glob)
1618 1619 Content-Type: text/x-patch; charset="us-ascii"
1619 1620 MIME-Version: 1.0
1620 1621 Content-Transfer-Encoding: 7bit
1621 1622 Content-Disposition: inline; filename=two.diff
1622 1623
1623 1624 # HG changeset patch
1624 1625 # User test
1625 1626 # Date 3 0
1626 1627 # Thu Jan 01 00:00:03 1970 +0000
1627 1628 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1628 1629 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1629 1630 c
1630 1631
1631 1632 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1632 1633 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1633 1634 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1634 1635 @@ -0,0 +1,1 @@
1635 1636 +c
1636 1637
1637 1638 --===*=-- (glob)
1638 1639
1639 1640 test inline for multiple named/unnamed patches:
1640 1641 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i \
1641 1642 > -r 0:1 | $FILTERBOUNDARY
1642 1643 this patch series consists of 2 patches.
1643 1644
1644 1645
1645 1646 Write the introductory message for the patch series.
1646 1647
1647 1648
1648 1649 displaying [PATCH 0 of 2] test ...
1649 1650 Content-Type: text/plain; charset="us-ascii"
1650 1651 MIME-Version: 1.0
1651 1652 Content-Transfer-Encoding: 7bit
1652 1653 Subject: [PATCH 0 of 2] test
1653 1654 Message-Id: <patchbomb.60@*> (glob)
1654 1655 User-Agent: Mercurial-patchbomb/* (glob)
1655 1656 Date: Thu, 01 Jan 1970 00:01:00 +0000
1656 1657 From: quux
1657 1658 To: foo
1658 1659 Cc: bar
1659 1660
1660 1661
1661 1662 displaying [PATCH 1 of 2] a ...
1662 1663 Content-Type: multipart/mixed; boundary="===*==" (glob)
1663 1664 MIME-Version: 1.0
1664 1665 Subject: [PATCH 1 of 2] a
1665 1666 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1666 1667 X-Mercurial-Series-Index: 1
1667 1668 X-Mercurial-Series-Total: 2
1668 1669 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
1669 1670 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
1670 1671 In-Reply-To: <patchbomb.60@*> (glob)
1671 1672 References: <patchbomb.60@*> (glob)
1672 1673 User-Agent: Mercurial-patchbomb/* (glob)
1673 1674 Date: Thu, 01 Jan 1970 00:01:01 +0000
1674 1675 From: quux
1675 1676 To: foo
1676 1677 Cc: bar
1677 1678
1678 1679 --===*= (glob)
1679 1680 Content-Type: text/x-patch; charset="us-ascii"
1680 1681 MIME-Version: 1.0
1681 1682 Content-Transfer-Encoding: 7bit
1682 1683 Content-Disposition: inline; filename=t2-1.patch
1683 1684
1684 1685 # HG changeset patch
1685 1686 # User test
1686 1687 # Date 1 0
1687 1688 # Thu Jan 01 00:00:01 1970 +0000
1688 1689 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1689 1690 # Parent 0000000000000000000000000000000000000000
1690 1691 a
1691 1692
1692 1693 diff -r 000000000000 -r 8580ff50825a a
1693 1694 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1694 1695 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1695 1696 @@ -0,0 +1,1 @@
1696 1697 +a
1697 1698
1698 1699 --===*=-- (glob)
1699 1700 displaying [PATCH 2 of 2] b ...
1700 1701 Content-Type: multipart/mixed; boundary="===*==" (glob)
1701 1702 MIME-Version: 1.0
1702 1703 Subject: [PATCH 2 of 2] b
1703 1704 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1704 1705 X-Mercurial-Series-Index: 2
1705 1706 X-Mercurial-Series-Total: 2
1706 1707 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
1707 1708 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
1708 1709 In-Reply-To: <patchbomb.60@*> (glob)
1709 1710 References: <patchbomb.60@*> (glob)
1710 1711 User-Agent: Mercurial-patchbomb/* (glob)
1711 1712 Date: Thu, 01 Jan 1970 00:01:02 +0000
1712 1713 From: quux
1713 1714 To: foo
1714 1715 Cc: bar
1715 1716
1716 1717 --===*= (glob)
1717 1718 Content-Type: text/x-patch; charset="us-ascii"
1718 1719 MIME-Version: 1.0
1719 1720 Content-Transfer-Encoding: 7bit
1720 1721 Content-Disposition: inline; filename=one.patch
1721 1722
1722 1723 # HG changeset patch
1723 1724 # User test
1724 1725 # Date 2 0
1725 1726 # Thu Jan 01 00:00:02 1970 +0000
1726 1727 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1727 1728 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1728 1729 b
1729 1730
1730 1731 diff -r 8580ff50825a -r 97d72e5f12c7 b
1731 1732 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1732 1733 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1733 1734 @@ -0,0 +1,1 @@
1734 1735 +b
1735 1736
1736 1737 --===*=-- (glob)
1737 1738
1738 1739
1739 1740 test inreplyto:
1740 1741 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
1741 1742 > -r tip
1742 1743 this patch series consists of 1 patches.
1743 1744
1744 1745
1745 1746 displaying [PATCH] Added tag two, two.diff for changeset ff2c9fa2018b ...
1746 1747 Content-Type: text/plain; charset="us-ascii"
1747 1748 MIME-Version: 1.0
1748 1749 Content-Transfer-Encoding: 7bit
1749 1750 Subject: [PATCH] Added tag two, two.diff for changeset ff2c9fa2018b
1750 1751 X-Mercurial-Node: 7aead2484924c445ad8ce2613df91f52f9e502ed
1751 1752 X-Mercurial-Series-Index: 1
1752 1753 X-Mercurial-Series-Total: 1
1753 1754 Message-Id: <7aead2484924c445ad8c.60@*> (glob)
1754 1755 X-Mercurial-Series-Id: <7aead2484924c445ad8c.60@*> (glob)
1755 1756 In-Reply-To: <baz>
1756 1757 References: <baz>
1757 1758 User-Agent: Mercurial-patchbomb/* (glob)
1758 1759 Date: Thu, 01 Jan 1970 00:01:00 +0000
1759 1760 From: quux
1760 1761 To: foo
1761 1762 Cc: bar
1762 1763
1763 1764 # HG changeset patch
1764 1765 # User test
1765 1766 # Date 0 0
1766 1767 # Thu Jan 01 00:00:00 1970 +0000
1767 1768 # Node ID 7aead2484924c445ad8ce2613df91f52f9e502ed
1768 1769 # Parent 045ca29b1ea20e4940411e695e20e521f2f0f98e
1769 1770 Added tag two, two.diff for changeset ff2c9fa2018b
1770 1771
1771 1772 diff -r 045ca29b1ea2 -r 7aead2484924 .hgtags
1772 1773 --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000
1773 1774 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
1774 1775 @@ -2,3 +2,5 @@
1775 1776 8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
1776 1777 97d72e5f12c7e84f85064aa72e5a297142c36ed9 one
1777 1778 97d72e5f12c7e84f85064aa72e5a297142c36ed9 one.patch
1778 1779 +ff2c9fa2018b15fa74b33363bda9527323e2a99f two
1779 1780 +ff2c9fa2018b15fa74b33363bda9527323e2a99f two.diff
1780 1781
1781 1782 no intro message in non-interactive mode
1782 1783 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
1783 1784 > -r 0:1
1784 1785 this patch series consists of 2 patches.
1785 1786
1786 1787 (optional) Subject: [PATCH 0 of 2]
1787 1788
1788 1789 displaying [PATCH 1 of 2] a ...
1789 1790 Content-Type: text/plain; charset="us-ascii"
1790 1791 MIME-Version: 1.0
1791 1792 Content-Transfer-Encoding: 7bit
1792 1793 Subject: [PATCH 1 of 2] a
1793 1794 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1794 1795 X-Mercurial-Series-Index: 1
1795 1796 X-Mercurial-Series-Total: 2
1796 1797 Message-Id: <8580ff50825a50c8f716.60@*> (glob)
1797 1798 X-Mercurial-Series-Id: <8580ff50825a50c8f716.60@*> (glob)
1798 1799 In-Reply-To: <baz>
1799 1800 References: <baz>
1800 1801 User-Agent: Mercurial-patchbomb/* (glob)
1801 1802 Date: Thu, 01 Jan 1970 00:01:00 +0000
1802 1803 From: quux
1803 1804 To: foo
1804 1805 Cc: bar
1805 1806
1806 1807 # HG changeset patch
1807 1808 # User test
1808 1809 # Date 1 0
1809 1810 # Thu Jan 01 00:00:01 1970 +0000
1810 1811 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1811 1812 # Parent 0000000000000000000000000000000000000000
1812 1813 a
1813 1814
1814 1815 diff -r 000000000000 -r 8580ff50825a a
1815 1816 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1816 1817 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1817 1818 @@ -0,0 +1,1 @@
1818 1819 +a
1819 1820
1820 1821 displaying [PATCH 2 of 2] b ...
1821 1822 Content-Type: text/plain; charset="us-ascii"
1822 1823 MIME-Version: 1.0
1823 1824 Content-Transfer-Encoding: 7bit
1824 1825 Subject: [PATCH 2 of 2] b
1825 1826 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1826 1827 X-Mercurial-Series-Index: 2
1827 1828 X-Mercurial-Series-Total: 2
1828 1829 Message-Id: <97d72e5f12c7e84f8506.61@*> (glob)
1829 1830 X-Mercurial-Series-Id: <8580ff50825a50c8f716.60@*> (glob)
1830 1831 In-Reply-To: <baz>
1831 1832 References: <baz>
1832 1833 User-Agent: Mercurial-patchbomb/* (glob)
1833 1834 Date: Thu, 01 Jan 1970 00:01:01 +0000
1834 1835 From: quux
1835 1836 To: foo
1836 1837 Cc: bar
1837 1838
1838 1839 # HG changeset patch
1839 1840 # User test
1840 1841 # Date 2 0
1841 1842 # Thu Jan 01 00:00:02 1970 +0000
1842 1843 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1843 1844 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1844 1845 b
1845 1846
1846 1847 diff -r 8580ff50825a -r 97d72e5f12c7 b
1847 1848 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1848 1849 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1849 1850 @@ -0,0 +1,1 @@
1850 1851 +b
1851 1852
1852 1853
1853 1854
1854 1855
1855 1856 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
1856 1857 > -s test -r 0:1
1857 1858 this patch series consists of 2 patches.
1858 1859
1859 1860
1860 1861 Write the introductory message for the patch series.
1861 1862
1862 1863
1863 1864 displaying [PATCH 0 of 2] test ...
1864 1865 Content-Type: text/plain; charset="us-ascii"
1865 1866 MIME-Version: 1.0
1866 1867 Content-Transfer-Encoding: 7bit
1867 1868 Subject: [PATCH 0 of 2] test
1868 1869 Message-Id: <patchbomb.60@*> (glob)
1869 1870 In-Reply-To: <baz>
1870 1871 References: <baz>
1871 1872 User-Agent: Mercurial-patchbomb/* (glob)
1872 1873 Date: Thu, 01 Jan 1970 00:01:00 +0000
1873 1874 From: quux
1874 1875 To: foo
1875 1876 Cc: bar
1876 1877
1877 1878
1878 1879 displaying [PATCH 1 of 2] a ...
1879 1880 Content-Type: text/plain; charset="us-ascii"
1880 1881 MIME-Version: 1.0
1881 1882 Content-Transfer-Encoding: 7bit
1882 1883 Subject: [PATCH 1 of 2] a
1883 1884 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1884 1885 X-Mercurial-Series-Index: 1
1885 1886 X-Mercurial-Series-Total: 2
1886 1887 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
1887 1888 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
1888 1889 In-Reply-To: <patchbomb.60@*> (glob)
1889 1890 References: <patchbomb.60@*> (glob)
1890 1891 User-Agent: Mercurial-patchbomb/* (glob)
1891 1892 Date: Thu, 01 Jan 1970 00:01:01 +0000
1892 1893 From: quux
1893 1894 To: foo
1894 1895 Cc: bar
1895 1896
1896 1897 # HG changeset patch
1897 1898 # User test
1898 1899 # Date 1 0
1899 1900 # Thu Jan 01 00:00:01 1970 +0000
1900 1901 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1901 1902 # Parent 0000000000000000000000000000000000000000
1902 1903 a
1903 1904
1904 1905 diff -r 000000000000 -r 8580ff50825a a
1905 1906 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1906 1907 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1907 1908 @@ -0,0 +1,1 @@
1908 1909 +a
1909 1910
1910 1911 displaying [PATCH 2 of 2] b ...
1911 1912 Content-Type: text/plain; charset="us-ascii"
1912 1913 MIME-Version: 1.0
1913 1914 Content-Transfer-Encoding: 7bit
1914 1915 Subject: [PATCH 2 of 2] b
1915 1916 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1916 1917 X-Mercurial-Series-Index: 2
1917 1918 X-Mercurial-Series-Total: 2
1918 1919 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
1919 1920 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
1920 1921 In-Reply-To: <patchbomb.60@*> (glob)
1921 1922 References: <patchbomb.60@*> (glob)
1922 1923 User-Agent: Mercurial-patchbomb/* (glob)
1923 1924 Date: Thu, 01 Jan 1970 00:01:02 +0000
1924 1925 From: quux
1925 1926 To: foo
1926 1927 Cc: bar
1927 1928
1928 1929 # HG changeset patch
1929 1930 # User test
1930 1931 # Date 2 0
1931 1932 # Thu Jan 01 00:00:02 1970 +0000
1932 1933 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1933 1934 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1934 1935 b
1935 1936
1936 1937 diff -r 8580ff50825a -r 97d72e5f12c7 b
1937 1938 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1938 1939 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1939 1940 @@ -0,0 +1,1 @@
1940 1941 +b
1941 1942
1942 1943
1943 1944 test single flag for single patch (and no warning when not mailing dirty rev):
1944 1945 $ hg up -qr1
1945 1946 $ echo dirt > a
1946 1947 $ hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
1947 1948 > -r 2 | $FILTERBOUNDARY
1948 1949 this patch series consists of 1 patches.
1949 1950
1950 1951
1951 1952 displaying [PATCH fooFlag] test ...
1952 1953 Content-Type: text/plain; charset="us-ascii"
1953 1954 MIME-Version: 1.0
1954 1955 Content-Transfer-Encoding: 7bit
1955 1956 Subject: [PATCH fooFlag] test
1956 1957 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1957 1958 X-Mercurial-Series-Index: 1
1958 1959 X-Mercurial-Series-Total: 1
1959 1960 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1960 1961 X-Mercurial-Series-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
1961 1962 User-Agent: Mercurial-patchbomb/* (glob)
1962 1963 Date: Thu, 01 Jan 1970 00:01:00 +0000
1963 1964 From: quux
1964 1965 To: foo
1965 1966 Cc: bar
1966 1967
1967 1968 # HG changeset patch
1968 1969 # User test
1969 1970 # Date 3 0
1970 1971 # Thu Jan 01 00:00:03 1970 +0000
1971 1972 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1972 1973 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1973 1974 c
1974 1975
1975 1976 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1976 1977 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1977 1978 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1978 1979 @@ -0,0 +1,1 @@
1979 1980 +c
1980 1981
1981 1982
1982 1983 test single flag for multiple patches (and warning when mailing dirty rev):
1983 1984 $ hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
1984 1985 > -r 0:1
1985 1986 warning: working directory has uncommitted changes
1986 1987 this patch series consists of 2 patches.
1987 1988
1988 1989
1989 1990 Write the introductory message for the patch series.
1990 1991
1991 1992
1992 1993 displaying [PATCH 0 of 2 fooFlag] test ...
1993 1994 Content-Type: text/plain; charset="us-ascii"
1994 1995 MIME-Version: 1.0
1995 1996 Content-Transfer-Encoding: 7bit
1996 1997 Subject: [PATCH 0 of 2 fooFlag] test
1997 1998 Message-Id: <patchbomb.60@*> (glob)
1998 1999 User-Agent: Mercurial-patchbomb/* (glob)
1999 2000 Date: Thu, 01 Jan 1970 00:01:00 +0000
2000 2001 From: quux
2001 2002 To: foo
2002 2003 Cc: bar
2003 2004
2004 2005
2005 2006 displaying [PATCH 1 of 2 fooFlag] a ...
2006 2007 Content-Type: text/plain; charset="us-ascii"
2007 2008 MIME-Version: 1.0
2008 2009 Content-Transfer-Encoding: 7bit
2009 2010 Subject: [PATCH 1 of 2 fooFlag] a
2010 2011 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
2011 2012 X-Mercurial-Series-Index: 1
2012 2013 X-Mercurial-Series-Total: 2
2013 2014 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
2014 2015 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
2015 2016 In-Reply-To: <patchbomb.60@*> (glob)
2016 2017 References: <patchbomb.60@*> (glob)
2017 2018 User-Agent: Mercurial-patchbomb/* (glob)
2018 2019 Date: Thu, 01 Jan 1970 00:01:01 +0000
2019 2020 From: quux
2020 2021 To: foo
2021 2022 Cc: bar
2022 2023
2023 2024 # HG changeset patch
2024 2025 # User test
2025 2026 # Date 1 0
2026 2027 # Thu Jan 01 00:00:01 1970 +0000
2027 2028 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
2028 2029 # Parent 0000000000000000000000000000000000000000
2029 2030 a
2030 2031
2031 2032 diff -r 000000000000 -r 8580ff50825a a
2032 2033 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2033 2034 +++ b/a Thu Jan 01 00:00:01 1970 +0000
2034 2035 @@ -0,0 +1,1 @@
2035 2036 +a
2036 2037
2037 2038 displaying [PATCH 2 of 2 fooFlag] b ...
2038 2039 Content-Type: text/plain; charset="us-ascii"
2039 2040 MIME-Version: 1.0
2040 2041 Content-Transfer-Encoding: 7bit
2041 2042 Subject: [PATCH 2 of 2 fooFlag] b
2042 2043 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2043 2044 X-Mercurial-Series-Index: 2
2044 2045 X-Mercurial-Series-Total: 2
2045 2046 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
2046 2047 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
2047 2048 In-Reply-To: <patchbomb.60@*> (glob)
2048 2049 References: <patchbomb.60@*> (glob)
2049 2050 User-Agent: Mercurial-patchbomb/* (glob)
2050 2051 Date: Thu, 01 Jan 1970 00:01:02 +0000
2051 2052 From: quux
2052 2053 To: foo
2053 2054 Cc: bar
2054 2055
2055 2056 # HG changeset patch
2056 2057 # User test
2057 2058 # Date 2 0
2058 2059 # Thu Jan 01 00:00:02 1970 +0000
2059 2060 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2060 2061 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
2061 2062 b
2062 2063
2063 2064 diff -r 8580ff50825a -r 97d72e5f12c7 b
2064 2065 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2065 2066 +++ b/b Thu Jan 01 00:00:02 1970 +0000
2066 2067 @@ -0,0 +1,1 @@
2067 2068 +b
2068 2069
2069 2070 $ hg revert --no-b a
2070 2071 $ hg up -q
2071 2072
2072 2073 test multiple flags for single patch:
2073 2074 $ hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
2074 2075 > -c bar -s test -r 2
2075 2076 this patch series consists of 1 patches.
2076 2077
2077 2078
2078 2079 displaying [PATCH fooFlag barFlag] test ...
2079 2080 Content-Type: text/plain; charset="us-ascii"
2080 2081 MIME-Version: 1.0
2081 2082 Content-Transfer-Encoding: 7bit
2082 2083 Subject: [PATCH fooFlag barFlag] test
2083 2084 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
2084 2085 X-Mercurial-Series-Index: 1
2085 2086 X-Mercurial-Series-Total: 1
2086 2087 Message-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
2087 2088 X-Mercurial-Series-Id: <ff2c9fa2018b15fa74b3.60@*> (glob)
2088 2089 User-Agent: Mercurial-patchbomb/* (glob)
2089 2090 Date: Thu, 01 Jan 1970 00:01:00 +0000
2090 2091 From: quux
2091 2092 To: foo
2092 2093 Cc: bar
2093 2094
2094 2095 # HG changeset patch
2095 2096 # User test
2096 2097 # Date 3 0
2097 2098 # Thu Jan 01 00:00:03 1970 +0000
2098 2099 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
2099 2100 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2100 2101 c
2101 2102
2102 2103 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
2103 2104 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2104 2105 +++ b/c Thu Jan 01 00:00:03 1970 +0000
2105 2106 @@ -0,0 +1,1 @@
2106 2107 +c
2107 2108
2108 2109
2109 2110 test multiple flags for multiple patches:
2110 2111 $ hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
2111 2112 > -c bar -s test -r 0:1
2112 2113 this patch series consists of 2 patches.
2113 2114
2114 2115
2115 2116 Write the introductory message for the patch series.
2116 2117
2117 2118
2118 2119 displaying [PATCH 0 of 2 fooFlag barFlag] test ...
2119 2120 Content-Type: text/plain; charset="us-ascii"
2120 2121 MIME-Version: 1.0
2121 2122 Content-Transfer-Encoding: 7bit
2122 2123 Subject: [PATCH 0 of 2 fooFlag barFlag] test
2123 2124 Message-Id: <patchbomb.60@*> (glob)
2124 2125 User-Agent: Mercurial-patchbomb/* (glob)
2125 2126 Date: Thu, 01 Jan 1970 00:01:00 +0000
2126 2127 From: quux
2127 2128 To: foo
2128 2129 Cc: bar
2129 2130
2130 2131
2131 2132 displaying [PATCH 1 of 2 fooFlag barFlag] a ...
2132 2133 Content-Type: text/plain; charset="us-ascii"
2133 2134 MIME-Version: 1.0
2134 2135 Content-Transfer-Encoding: 7bit
2135 2136 Subject: [PATCH 1 of 2 fooFlag barFlag] a
2136 2137 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
2137 2138 X-Mercurial-Series-Index: 1
2138 2139 X-Mercurial-Series-Total: 2
2139 2140 Message-Id: <8580ff50825a50c8f716.61@*> (glob)
2140 2141 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
2141 2142 In-Reply-To: <patchbomb.60@*> (glob)
2142 2143 References: <patchbomb.60@*> (glob)
2143 2144 User-Agent: Mercurial-patchbomb/* (glob)
2144 2145 Date: Thu, 01 Jan 1970 00:01:01 +0000
2145 2146 From: quux
2146 2147 To: foo
2147 2148 Cc: bar
2148 2149
2149 2150 # HG changeset patch
2150 2151 # User test
2151 2152 # Date 1 0
2152 2153 # Thu Jan 01 00:00:01 1970 +0000
2153 2154 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
2154 2155 # Parent 0000000000000000000000000000000000000000
2155 2156 a
2156 2157
2157 2158 diff -r 000000000000 -r 8580ff50825a a
2158 2159 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2159 2160 +++ b/a Thu Jan 01 00:00:01 1970 +0000
2160 2161 @@ -0,0 +1,1 @@
2161 2162 +a
2162 2163
2163 2164 displaying [PATCH 2 of 2 fooFlag barFlag] b ...
2164 2165 Content-Type: text/plain; charset="us-ascii"
2165 2166 MIME-Version: 1.0
2166 2167 Content-Transfer-Encoding: 7bit
2167 2168 Subject: [PATCH 2 of 2 fooFlag barFlag] b
2168 2169 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2169 2170 X-Mercurial-Series-Index: 2
2170 2171 X-Mercurial-Series-Total: 2
2171 2172 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob)
2172 2173 X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob)
2173 2174 In-Reply-To: <patchbomb.60@*> (glob)
2174 2175 References: <patchbomb.60@*> (glob)
2175 2176 User-Agent: Mercurial-patchbomb/* (glob)
2176 2177 Date: Thu, 01 Jan 1970 00:01:02 +0000
2177 2178 From: quux
2178 2179 To: foo
2179 2180 Cc: bar
2180 2181
2181 2182 # HG changeset patch
2182 2183 # User test
2183 2184 # Date 2 0
2184 2185 # Thu Jan 01 00:00:02 1970 +0000
2185 2186 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2186 2187 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
2187 2188 b
2188 2189
2189 2190 diff -r 8580ff50825a -r 97d72e5f12c7 b
2190 2191 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2191 2192 +++ b/b Thu Jan 01 00:00:02 1970 +0000
2192 2193 @@ -0,0 +1,1 @@
2193 2194 +b
2194 2195
2195 2196
2196 2197 test multi-address parsing:
2197 2198 $ hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t 'spam<spam><eggs>' \
2198 2199 > -t toast -c 'foo,bar@example.com' -c '"A, B <>" <a@example.com>' -s test -r 0 \
2199 2200 > --config email.bcc='"Quux, A." <quux>'
2200 2201 this patch series consists of 1 patches.
2201 2202
2202 2203
2203 2204 sending [PATCH] test ...
2204 2205 $ cat < tmp.mbox
2205 2206 From quux ... ... .. ..:..:.. .... (re)
2206 2207 Content-Type: text/plain; charset="us-ascii"
2207 2208 MIME-Version: 1.0
2208 2209 Content-Transfer-Encoding: 7bit
2209 2210 Subject: [PATCH] test
2210 2211 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
2211 2212 X-Mercurial-Series-Index: 1
2212 2213 X-Mercurial-Series-Total: 1
2213 2214 Message-Id: <8580ff50825a50c8f716.315532860@*> (glob)
2214 2215 X-Mercurial-Series-Id: <8580ff50825a50c8f716.315532860@*> (glob)
2215 2216 User-Agent: Mercurial-patchbomb/* (glob)
2216 2217 Date: Tue, 01 Jan 1980 00:01:00 +0000
2217 2218 From: quux
2218 2219 To: spam <spam>, eggs, toast
2219 2220 Cc: foo, bar@example.com, "A, B <>" <a@example.com>
2220 2221 Bcc: "Quux, A." <quux>
2221 2222
2222 2223 # HG changeset patch
2223 2224 # User test
2224 2225 # Date 1 0
2225 2226 # Thu Jan 01 00:00:01 1970 +0000
2226 2227 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
2227 2228 # Parent 0000000000000000000000000000000000000000
2228 2229 a
2229 2230
2230 2231 diff -r 000000000000 -r 8580ff50825a a
2231 2232 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2232 2233 +++ b/a Thu Jan 01 00:00:01 1970 +0000
2233 2234 @@ -0,0 +1,1 @@
2234 2235 +a
2235 2236
2236 2237
2237 2238
2238 2239 test multi-byte domain parsing:
2239 2240 $ UUML=`python -c 'import sys; sys.stdout.write("\374")'`
2240 2241 $ HGENCODING=iso-8859-1
2241 2242 $ export HGENCODING
2242 2243 $ hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t "bar@${UUML}nicode.com" -s test -r 0
2243 2244 this patch series consists of 1 patches.
2244 2245
2245 2246 Cc:
2246 2247
2247 2248 sending [PATCH] test ...
2248 2249
2249 2250 $ cat tmp.mbox
2250 2251 From quux ... ... .. ..:..:.. .... (re)
2251 2252 Content-Type: text/plain; charset="us-ascii"
2252 2253 MIME-Version: 1.0
2253 2254 Content-Transfer-Encoding: 7bit
2254 2255 Subject: [PATCH] test
2255 2256 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
2256 2257 X-Mercurial-Series-Index: 1
2257 2258 X-Mercurial-Series-Total: 1
2258 2259 Message-Id: <8580ff50825a50c8f716.315532860@*> (glob)
2259 2260 X-Mercurial-Series-Id: <8580ff50825a50c8f716.315532860@*> (glob)
2260 2261 User-Agent: Mercurial-patchbomb/* (glob)
2261 2262 Date: Tue, 01 Jan 1980 00:01:00 +0000
2262 2263 From: quux
2263 2264 To: bar@xn--nicode-2ya.com
2264 2265
2265 2266 # HG changeset patch
2266 2267 # User test
2267 2268 # Date 1 0
2268 2269 # Thu Jan 01 00:00:01 1970 +0000
2269 2270 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
2270 2271 # Parent 0000000000000000000000000000000000000000
2271 2272 a
2272 2273
2273 2274 diff -r 000000000000 -r 8580ff50825a a
2274 2275 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2275 2276 +++ b/a Thu Jan 01 00:00:01 1970 +0000
2276 2277 @@ -0,0 +1,1 @@
2277 2278 +a
2278 2279
2279 2280
2280 2281
2281 2282 test outgoing:
2282 2283 $ hg up 1
2283 2284 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
2284 2285
2285 2286 $ hg branch test
2286 2287 marked working directory as branch test
2287 2288 (branches are permanent and global, did you want a bookmark?)
2288 2289
2289 2290 $ echo d > d
2290 2291 $ hg add d
2291 2292 $ hg ci -md -d '4 0'
2292 2293 $ echo d >> d
2293 2294 $ hg ci -mdd -d '5 0'
2294 2295 $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n"
2295 2296 @ 10:3b6f1ec9dde9 dd
2296 2297 |
2297 2298 o 9:2f9fa9b998c5 d
2298 2299 |
2299 2300 | o 8:7aead2484924 Added tag two, two.diff for changeset ff2c9fa2018b
2300 2301 | |
2301 2302 | o 7:045ca29b1ea2 Added tag one, one.patch for changeset 97d72e5f12c7
2302 2303 | |
2303 2304 | o 6:5d5ef15dfe5e Added tag zero, zero.foo for changeset 8580ff50825a
2304 2305 | |
2305 2306 | o 5:240fb913fc1b isolatin 8-bit encoding
2306 2307 | |
2307 2308 | o 4:a2ea8fc83dd8 long line
2308 2309 | |
2309 2310 | o 3:909a00e13e9d utf-8 content
2310 2311 | |
2311 2312 | o 2:ff2c9fa2018b c
2312 2313 |/
2313 2314 o 1:97d72e5f12c7 b
2314 2315 |
2315 2316 o 0:8580ff50825a a
2316 2317
2317 2318 $ hg phase --force --secret -r 10
2318 2319 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t -r 'rev(10) or rev(6)'
2319 2320 comparing with ../t
2320 2321 From [test]: test
2321 2322 this patch series consists of 6 patches.
2322 2323
2323 2324
2324 2325 Write the introductory message for the patch series.
2325 2326
2326 2327 Cc:
2327 2328
2328 2329 displaying [PATCH 0 of 6] test ...
2329 2330 Content-Type: text/plain; charset="us-ascii"
2330 2331 MIME-Version: 1.0
2331 2332 Content-Transfer-Encoding: 7bit
2332 2333 Subject: [PATCH 0 of 6] test
2333 2334 Message-Id: <patchbomb.315532860@*> (glob)
2334 2335 User-Agent: Mercurial-patchbomb/* (glob)
2335 2336 Date: Tue, 01 Jan 1980 00:01:00 +0000
2336 2337 From: test
2337 2338 To: foo
2338 2339
2339 2340
2340 2341 displaying [PATCH 1 of 6] c ...
2341 2342 Content-Type: text/plain; charset="us-ascii"
2342 2343 MIME-Version: 1.0
2343 2344 Content-Transfer-Encoding: 7bit
2344 2345 Subject: [PATCH 1 of 6] c
2345 2346 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
2346 2347 X-Mercurial-Series-Index: 1
2347 2348 X-Mercurial-Series-Total: 6
2348 2349 Message-Id: <ff2c9fa2018b15fa74b3.315532861@*> (glob)
2349 2350 X-Mercurial-Series-Id: <ff2c9fa2018b15fa74b3.315532861@*> (glob)
2350 2351 In-Reply-To: <patchbomb.315532860@*> (glob)
2351 2352 References: <patchbomb.315532860@*> (glob)
2352 2353 User-Agent: Mercurial-patchbomb/* (glob)
2353 2354 Date: Tue, 01 Jan 1980 00:01:01 +0000
2354 2355 From: test
2355 2356 To: foo
2356 2357
2357 2358 # HG changeset patch
2358 2359 # User test
2359 2360 # Date 3 0
2360 2361 # Thu Jan 01 00:00:03 1970 +0000
2361 2362 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
2362 2363 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2363 2364 c
2364 2365
2365 2366 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
2366 2367 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2367 2368 +++ b/c Thu Jan 01 00:00:03 1970 +0000
2368 2369 @@ -0,0 +1,1 @@
2369 2370 +c
2370 2371
2371 2372 displaying [PATCH 2 of 6] utf-8 content ...
2372 2373 Content-Type: text/plain; charset="us-ascii"
2373 2374 MIME-Version: 1.0
2374 2375 Content-Transfer-Encoding: 8bit
2375 2376 Subject: [PATCH 2 of 6] utf-8 content
2376 2377 X-Mercurial-Node: 909a00e13e9d78b575aeee23dddbada46d5a143f
2377 2378 X-Mercurial-Series-Index: 2
2378 2379 X-Mercurial-Series-Total: 6
2379 2380 Message-Id: <909a00e13e9d78b575ae.315532862@*> (glob)
2380 2381 X-Mercurial-Series-Id: <ff2c9fa2018b15fa74b3.315532861@*> (glob)
2381 2382 In-Reply-To: <patchbomb.315532860@*> (glob)
2382 2383 References: <patchbomb.315532860@*> (glob)
2383 2384 User-Agent: Mercurial-patchbomb/* (glob)
2384 2385 Date: Tue, 01 Jan 1980 00:01:02 +0000
2385 2386 From: test
2386 2387 To: foo
2387 2388
2388 2389 # HG changeset patch
2389 2390 # User test
2390 2391 # Date 4 0
2391 2392 # Thu Jan 01 00:00:04 1970 +0000
2392 2393 # Node ID 909a00e13e9d78b575aeee23dddbada46d5a143f
2393 2394 # Parent ff2c9fa2018b15fa74b33363bda9527323e2a99f
2394 2395 utf-8 content
2395 2396
2396 2397 diff -r ff2c9fa2018b -r 909a00e13e9d description
2397 2398 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2398 2399 +++ b/description Thu Jan 01 00:00:04 1970 +0000
2399 2400 @@ -0,0 +1,3 @@
2400 2401 +a multiline
2401 2402 +
2402 2403 +description
2403 2404 diff -r ff2c9fa2018b -r 909a00e13e9d utf
2404 2405 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2405 2406 +++ b/utf Thu Jan 01 00:00:04 1970 +0000
2406 2407 @@ -0,0 +1,1 @@
2407 2408 +h\xc3\xb6mma! (esc)
2408 2409
2409 2410 displaying [PATCH 3 of 6] long line ...
2410 2411 Content-Type: text/plain; charset="us-ascii"
2411 2412 MIME-Version: 1.0
2412 2413 Content-Transfer-Encoding: quoted-printable
2413 2414 Subject: [PATCH 3 of 6] long line
2414 2415 X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
2415 2416 X-Mercurial-Series-Index: 3
2416 2417 X-Mercurial-Series-Total: 6
2417 2418 Message-Id: <a2ea8fc83dd8b93cfd86.315532863@*> (glob)
2418 2419 X-Mercurial-Series-Id: <ff2c9fa2018b15fa74b3.315532861@*> (glob)
2419 2420 In-Reply-To: <patchbomb.315532860@*> (glob)
2420 2421 References: <patchbomb.315532860@*> (glob)
2421 2422 User-Agent: Mercurial-patchbomb/* (glob)
2422 2423 Date: Tue, 01 Jan 1980 00:01:03 +0000
2423 2424 From: test
2424 2425 To: foo
2425 2426
2426 2427 # HG changeset patch
2427 2428 # User test
2428 2429 # Date 4 0
2429 2430 # Thu Jan 01 00:00:04 1970 +0000
2430 2431 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
2431 2432 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f
2432 2433 long line
2433 2434
2434 2435 diff -r 909a00e13e9d -r a2ea8fc83dd8 long
2435 2436 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2436 2437 +++ b/long Thu Jan 01 00:00:04 1970 +0000
2437 2438 @@ -0,0 +1,4 @@
2438 2439 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2439 2440 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2440 2441 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2441 2442 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2442 2443 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2443 2444 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2444 2445 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2445 2446 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2446 2447 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2447 2448 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2448 2449 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2449 2450 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2450 2451 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2451 2452 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2452 2453 +foo
2453 2454 +
2454 2455 +bar
2455 2456
2456 2457 displaying [PATCH 4 of 6] isolatin 8-bit encoding ...
2457 2458 Content-Type: text/plain; charset="us-ascii"
2458 2459 MIME-Version: 1.0
2459 2460 Content-Transfer-Encoding: 8bit
2460 2461 Subject: [PATCH 4 of 6] isolatin 8-bit encoding
2461 2462 X-Mercurial-Node: 240fb913fc1b7ff15ddb9f33e73d82bf5277c720
2462 2463 X-Mercurial-Series-Index: 4
2463 2464 X-Mercurial-Series-Total: 6
2464 2465 Message-Id: <240fb913fc1b7ff15ddb.315532864@*> (glob)
2465 2466 X-Mercurial-Series-Id: <ff2c9fa2018b15fa74b3.315532861@*> (glob)
2466 2467 In-Reply-To: <patchbomb.315532860@*> (glob)
2467 2468 References: <patchbomb.315532860@*> (glob)
2468 2469 User-Agent: Mercurial-patchbomb/* (glob)
2469 2470 Date: Tue, 01 Jan 1980 00:01:04 +0000
2470 2471 From: test
2471 2472 To: foo
2472 2473
2473 2474 # HG changeset patch
2474 2475 # User test
2475 2476 # Date 5 0
2476 2477 # Thu Jan 01 00:00:05 1970 +0000
2477 2478 # Node ID 240fb913fc1b7ff15ddb9f33e73d82bf5277c720
2478 2479 # Parent a2ea8fc83dd8b93cfd86ac97b28287204ab806e1
2479 2480 isolatin 8-bit encoding
2480 2481
2481 2482 diff -r a2ea8fc83dd8 -r 240fb913fc1b isolatin
2482 2483 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2483 2484 +++ b/isolatin Thu Jan 01 00:00:05 1970 +0000
2484 2485 @@ -0,0 +1,1 @@
2485 2486 +h\xf6mma! (esc)
2486 2487
2487 2488 displaying [PATCH 5 of 6] Added tag zero, zero.foo for changeset 8580ff50825a ...
2488 2489 Content-Type: text/plain; charset="us-ascii"
2489 2490 MIME-Version: 1.0
2490 2491 Content-Transfer-Encoding: 7bit
2491 2492 Subject: [PATCH 5 of 6] Added tag zero, zero.foo for changeset 8580ff50825a
2492 2493 X-Mercurial-Node: 5d5ef15dfe5e7bd3a4ee154b5fff76c7945ec433
2493 2494 X-Mercurial-Series-Index: 5
2494 2495 X-Mercurial-Series-Total: 6
2495 2496 Message-Id: <5d5ef15dfe5e7bd3a4ee.315532865@*> (glob)
2496 2497 X-Mercurial-Series-Id: <ff2c9fa2018b15fa74b3.315532861@*> (glob)
2497 2498 In-Reply-To: <patchbomb.315532860@*> (glob)
2498 2499 References: <patchbomb.315532860@*> (glob)
2499 2500 User-Agent: Mercurial-patchbomb/* (glob)
2500 2501 Date: Tue, 01 Jan 1980 00:01:05 +0000
2501 2502 From: test
2502 2503 To: foo
2503 2504
2504 2505 # HG changeset patch
2505 2506 # User test
2506 2507 # Date 0 0
2507 2508 # Thu Jan 01 00:00:00 1970 +0000
2508 2509 # Node ID 5d5ef15dfe5e7bd3a4ee154b5fff76c7945ec433
2509 2510 # Parent 240fb913fc1b7ff15ddb9f33e73d82bf5277c720
2510 2511 Added tag zero, zero.foo for changeset 8580ff50825a
2511 2512
2512 2513 diff -r 240fb913fc1b -r 5d5ef15dfe5e .hgtags
2513 2514 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2514 2515 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
2515 2516 @@ -0,0 +1,2 @@
2516 2517 +8580ff50825a50c8f716709acdf8de0deddcd6ab zero
2517 2518 +8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
2518 2519
2519 2520 displaying [PATCH 6 of 6] d ...
2520 2521 Content-Type: text/plain; charset="us-ascii"
2521 2522 MIME-Version: 1.0
2522 2523 Content-Transfer-Encoding: 7bit
2523 2524 Subject: [PATCH 6 of 6] d
2524 2525 X-Mercurial-Node: 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
2525 2526 X-Mercurial-Series-Index: 6
2526 2527 X-Mercurial-Series-Total: 6
2527 2528 Message-Id: <2f9fa9b998c5fe3ac2bd.315532866@*> (glob)
2528 2529 X-Mercurial-Series-Id: <ff2c9fa2018b15fa74b3.315532861@*> (glob)
2529 2530 In-Reply-To: <patchbomb.315532860@*> (glob)
2530 2531 References: <patchbomb.315532860@*> (glob)
2531 2532 User-Agent: Mercurial-patchbomb/* (glob)
2532 2533 Date: Tue, 01 Jan 1980 00:01:06 +0000
2533 2534 From: test
2534 2535 To: foo
2535 2536
2536 2537 # HG changeset patch
2537 2538 # User test
2538 2539 # Date 4 0
2539 2540 # Thu Jan 01 00:00:04 1970 +0000
2540 2541 # Branch test
2541 2542 # Node ID 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
2542 2543 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2543 2544 d
2544 2545
2545 2546 diff -r 97d72e5f12c7 -r 2f9fa9b998c5 d
2546 2547 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2547 2548 +++ b/d Thu Jan 01 00:00:04 1970 +0000
2548 2549 @@ -0,0 +1,1 @@
2549 2550 +d
2550 2551
2551 2552
2552 2553 dest#branch URIs:
2553 2554 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t#test
2554 2555 comparing with ../t
2555 2556 From [test]: test
2556 2557 this patch series consists of 1 patches.
2557 2558
2558 2559 Cc:
2559 2560
2560 2561 displaying [PATCH] test ...
2561 2562 Content-Type: text/plain; charset="us-ascii"
2562 2563 MIME-Version: 1.0
2563 2564 Content-Transfer-Encoding: 7bit
2564 2565 Subject: [PATCH] test
2565 2566 X-Mercurial-Node: 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
2566 2567 X-Mercurial-Series-Index: 1
2567 2568 X-Mercurial-Series-Total: 1
2568 2569 Message-Id: <2f9fa9b998c5fe3ac2bd.315532860@*> (glob)
2569 2570 X-Mercurial-Series-Id: <2f9fa9b998c5fe3ac2bd.315532860@*> (glob)
2570 2571 User-Agent: Mercurial-patchbomb/* (glob)
2571 2572 Date: Tue, 01 Jan 1980 00:01:00 +0000
2572 2573 From: test
2573 2574 To: foo
2574 2575
2575 2576 # HG changeset patch
2576 2577 # User test
2577 2578 # Date 4 0
2578 2579 # Thu Jan 01 00:00:04 1970 +0000
2579 2580 # Branch test
2580 2581 # Node ID 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
2581 2582 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2582 2583 d
2583 2584
2584 2585 diff -r 97d72e5f12c7 -r 2f9fa9b998c5 d
2585 2586 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2586 2587 +++ b/d Thu Jan 01 00:00:04 1970 +0000
2587 2588 @@ -0,0 +1,1 @@
2588 2589 +d
2589 2590
2590 2591
2591 2592 $ cd ..
@@ -1,400 +1,410
1 1 Create configuration
2 2
3 3 $ echo "[ui]" >> $HGRCPATH
4 4 $ echo "interactive=true" >> $HGRCPATH
5 5
6 6 help record (no record)
7 7
8 8 $ hg help record
9 9 record extension - commands to interactively select changes for
10 10 commit/qrefresh
11 11
12 12 (use "hg help extensions" for information on enabling extensions)
13 13
14 14 help qrecord (no record)
15 15
16 16 $ hg help qrecord
17 17 'qrecord' is provided by the following extension:
18 18
19 19 record commands to interactively select changes for commit/qrefresh
20 20
21 21 (use "hg help extensions" for information on enabling extensions)
22 22
23 23 $ echo "[extensions]" >> $HGRCPATH
24 24 $ echo "record=" >> $HGRCPATH
25 25
26 26 help record (record)
27 27
28 28 $ hg help record
29 29 hg record [OPTION]... [FILE]...
30 30
31 31 interactively select changes to commit
32 32
33 33 If a list of files is omitted, all changes reported by "hg status" will be
34 34 candidates for recording.
35 35
36 36 See "hg help dates" for a list of formats valid for -d/--date.
37 37
38 38 You will be prompted for whether to record changes to each modified file,
39 39 and for files with multiple changes, for each change to use. For each
40 40 query, the following responses are possible:
41 41
42 42 y - record this change
43 43 n - skip this change
44 44 e - edit this change manually
45 45
46 46 s - skip remaining changes to this file
47 47 f - record remaining changes to this file
48 48
49 49 d - done, skip remaining changes and files
50 50 a - record all changes to all remaining files
51 51 q - quit, recording no changes
52 52
53 53 ? - display help
54 54
55 55 This command is not available when committing a merge.
56 56
57 57 options ([+] can be repeated):
58 58
59 59 -A --addremove mark new/missing files as added/removed before
60 60 committing
61 61 --close-branch mark a branch as closed, hiding it from the branch
62 62 list
63 63 --amend amend the parent of the working dir
64 64 -s --secret use the secret phase for committing
65 65 -e --edit invoke editor on commit messages
66 66 -I --include PATTERN [+] include names matching the given patterns
67 67 -X --exclude PATTERN [+] exclude names matching the given patterns
68 68 -m --message TEXT use text as commit message
69 69 -l --logfile FILE read commit message from file
70 70 -d --date DATE record the specified date as commit date
71 71 -u --user USER record the specified user as committer
72 72 -S --subrepos recurse into subrepositories
73 73 -w --ignore-all-space ignore white space when comparing lines
74 74 -b --ignore-space-change ignore changes in the amount of white space
75 75 -B --ignore-blank-lines ignore changes whose lines are all blank
76 76
77 77 (some details hidden, use --verbose to show complete help)
78 78
79 79 help (no mq, so no qrecord)
80 80
81 81 $ hg help qrecord
82 82 hg qrecord [OPTION]... PATCH [FILE]...
83 83
84 84 interactively record a new patch
85 85
86 86 See "hg help qnew" & "hg help record" for more information and usage.
87 87
88 88 (some details hidden, use --verbose to show complete help)
89 89
90 90 $ hg init a
91 91
92 92 qrecord (mq not present)
93 93
94 94 $ hg -R a qrecord
95 95 hg qrecord: invalid arguments
96 96 hg qrecord [OPTION]... PATCH [FILE]...
97 97
98 98 interactively record a new patch
99 99
100 100 (use "hg qrecord -h" to show more help)
101 101 [255]
102 102
103 103 qrecord patch (mq not present)
104 104
105 105 $ hg -R a qrecord patch
106 106 abort: 'mq' extension not loaded
107 107 [255]
108 108
109 109 help (bad mq)
110 110
111 111 $ echo "mq=nonexistent" >> $HGRCPATH
112 112 $ hg help qrecord
113 113 *** failed to import extension mq from nonexistent: [Errno *] * (glob)
114 114 hg qrecord [OPTION]... PATCH [FILE]...
115 115
116 116 interactively record a new patch
117 117
118 118 See "hg help qnew" & "hg help record" for more information and usage.
119 119
120 120 (some details hidden, use --verbose to show complete help)
121 121
122 122 help (mq present)
123 123
124 124 $ sed 's/mq=nonexistent/mq=/' $HGRCPATH > hgrc.tmp
125 125 $ mv hgrc.tmp $HGRCPATH
126 126
127 127 $ hg help qrecord
128 128 hg qrecord [OPTION]... PATCH [FILE]...
129 129
130 130 interactively record a new patch
131 131
132 132 See "hg help qnew" & "hg help record" for more information and usage.
133 133
134 134 options ([+] can be repeated):
135 135
136 136 -e --edit invoke editor on commit messages
137 137 -g --git use git extended diff format
138 138 -U --currentuser add "From: <current user>" to patch
139 139 -u --user USER add "From: <USER>" to patch
140 140 -D --currentdate add "Date: <current date>" to patch
141 141 -d --date DATE add "Date: <DATE>" to patch
142 142 -I --include PATTERN [+] include names matching the given patterns
143 143 -X --exclude PATTERN [+] exclude names matching the given patterns
144 144 -m --message TEXT use text as commit message
145 145 -l --logfile FILE read commit message from file
146 146 -w --ignore-all-space ignore white space when comparing lines
147 147 -b --ignore-space-change ignore changes in the amount of white space
148 148 -B --ignore-blank-lines ignore changes whose lines are all blank
149 149 --mq operate on patch repository
150 150
151 151 (some details hidden, use --verbose to show complete help)
152 152
153 153 $ cd a
154 154
155 155 Base commit
156 156
157 157 $ cat > 1.txt <<EOF
158 158 > 1
159 159 > 2
160 160 > 3
161 161 > 4
162 162 > 5
163 163 > EOF
164 164 $ cat > 2.txt <<EOF
165 165 > a
166 166 > b
167 167 > c
168 168 > d
169 169 > e
170 170 > f
171 171 > EOF
172 172
173 173 $ mkdir dir
174 174 $ cat > dir/a.txt <<EOF
175 175 > hello world
176 176 >
177 177 > someone
178 178 > up
179 179 > there
180 180 > loves
181 181 > me
182 182 > EOF
183 183
184 184 $ hg add 1.txt 2.txt dir/a.txt
185 185 $ hg commit -m 'initial checkin'
186 186
187 187 Changing files
188 188
189 189 $ sed -e 's/2/2 2/;s/4/4 4/' 1.txt > 1.txt.new
190 190 $ sed -e 's/b/b b/' 2.txt > 2.txt.new
191 191 $ sed -e 's/hello world/hello world!/' dir/a.txt > dir/a.txt.new
192 192
193 193 $ mv -f 1.txt.new 1.txt
194 194 $ mv -f 2.txt.new 2.txt
195 195 $ mv -f dir/a.txt.new dir/a.txt
196 196
197 197 Whole diff
198 198
199 199 $ hg diff --nodates
200 200 diff -r 1057167b20ef 1.txt
201 201 --- a/1.txt
202 202 +++ b/1.txt
203 203 @@ -1,5 +1,5 @@
204 204 1
205 205 -2
206 206 +2 2
207 207 3
208 208 -4
209 209 +4 4
210 210 5
211 211 diff -r 1057167b20ef 2.txt
212 212 --- a/2.txt
213 213 +++ b/2.txt
214 214 @@ -1,5 +1,5 @@
215 215 a
216 216 -b
217 217 +b b
218 218 c
219 219 d
220 220 e
221 221 diff -r 1057167b20ef dir/a.txt
222 222 --- a/dir/a.txt
223 223 +++ b/dir/a.txt
224 224 @@ -1,4 +1,4 @@
225 225 -hello world
226 226 +hello world!
227 227
228 228 someone
229 229 up
230 230
231 231 qrecord with bad patch name, should abort before prompting
232 232
233 233 $ hg qrecord .hg
234 234 abort: patch name cannot begin with ".hg"
235 235 [255]
236 236
237 237 qrecord a.patch
238 238
239 239 $ hg qrecord -d '0 0' -m aaa a.patch <<EOF
240 240 > y
241 241 > y
242 242 > n
243 243 > y
244 244 > y
245 245 > n
246 246 > EOF
247 247 diff --git a/1.txt b/1.txt
248 248 2 hunks, 2 lines changed
249 examine changes to '1.txt'? [Ynesfdaq?]
249 examine changes to '1.txt'? [Ynesfdaq?] y
250
250 251 @@ -1,3 +1,3 @@
251 252 1
252 253 -2
253 254 +2 2
254 255 3
255 record change 1/4 to '1.txt'? [Ynesfdaq?]
256 record change 1/4 to '1.txt'? [Ynesfdaq?] y
257
256 258 @@ -3,3 +3,3 @@
257 259 3
258 260 -4
259 261 +4 4
260 262 5
261 record change 2/4 to '1.txt'? [Ynesfdaq?]
263 record change 2/4 to '1.txt'? [Ynesfdaq?] n
264
262 265 diff --git a/2.txt b/2.txt
263 266 1 hunks, 1 lines changed
264 examine changes to '2.txt'? [Ynesfdaq?]
267 examine changes to '2.txt'? [Ynesfdaq?] y
268
265 269 @@ -1,5 +1,5 @@
266 270 a
267 271 -b
268 272 +b b
269 273 c
270 274 d
271 275 e
272 record change 3/4 to '2.txt'? [Ynesfdaq?]
276 record change 3/4 to '2.txt'? [Ynesfdaq?] y
277
273 278 diff --git a/dir/a.txt b/dir/a.txt
274 279 1 hunks, 1 lines changed
275 examine changes to 'dir/a.txt'? [Ynesfdaq?]
280 examine changes to 'dir/a.txt'? [Ynesfdaq?] n
281
276 282
277 283 After qrecord a.patch 'tip'"
278 284
279 285 $ hg tip -p
280 286 changeset: 1:5d1ca63427ee
281 287 tag: a.patch
282 288 tag: qbase
283 289 tag: qtip
284 290 tag: tip
285 291 user: test
286 292 date: Thu Jan 01 00:00:00 1970 +0000
287 293 summary: aaa
288 294
289 295 diff -r 1057167b20ef -r 5d1ca63427ee 1.txt
290 296 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
291 297 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
292 298 @@ -1,5 +1,5 @@
293 299 1
294 300 -2
295 301 +2 2
296 302 3
297 303 4
298 304 5
299 305 diff -r 1057167b20ef -r 5d1ca63427ee 2.txt
300 306 --- a/2.txt Thu Jan 01 00:00:00 1970 +0000
301 307 +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000
302 308 @@ -1,5 +1,5 @@
303 309 a
304 310 -b
305 311 +b b
306 312 c
307 313 d
308 314 e
309 315
310 316
311 317 After qrecord a.patch 'diff'"
312 318
313 319 $ hg diff --nodates
314 320 diff -r 5d1ca63427ee 1.txt
315 321 --- a/1.txt
316 322 +++ b/1.txt
317 323 @@ -1,5 +1,5 @@
318 324 1
319 325 2 2
320 326 3
321 327 -4
322 328 +4 4
323 329 5
324 330 diff -r 5d1ca63427ee dir/a.txt
325 331 --- a/dir/a.txt
326 332 +++ b/dir/a.txt
327 333 @@ -1,4 +1,4 @@
328 334 -hello world
329 335 +hello world!
330 336
331 337 someone
332 338 up
333 339
334 340 qrecord b.patch
335 341
336 342 $ hg qrecord -d '0 0' -m bbb b.patch <<EOF
337 343 > y
338 344 > y
339 345 > y
340 346 > y
341 347 > EOF
342 348 diff --git a/1.txt b/1.txt
343 349 1 hunks, 1 lines changed
344 examine changes to '1.txt'? [Ynesfdaq?]
350 examine changes to '1.txt'? [Ynesfdaq?] y
351
345 352 @@ -1,5 +1,5 @@
346 353 1
347 354 2 2
348 355 3
349 356 -4
350 357 +4 4
351 358 5
352 record change 1/2 to '1.txt'? [Ynesfdaq?]
359 record change 1/2 to '1.txt'? [Ynesfdaq?] y
360
353 361 diff --git a/dir/a.txt b/dir/a.txt
354 362 1 hunks, 1 lines changed
355 examine changes to 'dir/a.txt'? [Ynesfdaq?]
363 examine changes to 'dir/a.txt'? [Ynesfdaq?] y
364
356 365 @@ -1,4 +1,4 @@
357 366 -hello world
358 367 +hello world!
359 368
360 369 someone
361 370 up
362 record change 2/2 to 'dir/a.txt'? [Ynesfdaq?]
371 record change 2/2 to 'dir/a.txt'? [Ynesfdaq?] y
372
363 373
364 374 After qrecord b.patch 'tip'
365 375
366 376 $ hg tip -p
367 377 changeset: 2:b056198bf878
368 378 tag: b.patch
369 379 tag: qtip
370 380 tag: tip
371 381 user: test
372 382 date: Thu Jan 01 00:00:00 1970 +0000
373 383 summary: bbb
374 384
375 385 diff -r 5d1ca63427ee -r b056198bf878 1.txt
376 386 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
377 387 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
378 388 @@ -1,5 +1,5 @@
379 389 1
380 390 2 2
381 391 3
382 392 -4
383 393 +4 4
384 394 5
385 395 diff -r 5d1ca63427ee -r b056198bf878 dir/a.txt
386 396 --- a/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
387 397 +++ b/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
388 398 @@ -1,4 +1,4 @@
389 399 -hello world
390 400 +hello world!
391 401
392 402 someone
393 403 up
394 404
395 405
396 406 After qrecord b.patch 'diff'
397 407
398 408 $ hg diff --nodates
399 409
400 410 $ cd ..
@@ -1,1302 +1,1371
1 1 Set up a repo
2 2
3 3 $ echo "[ui]" >> $HGRCPATH
4 4 $ echo "interactive=true" >> $HGRCPATH
5 5 $ echo "[extensions]" >> $HGRCPATH
6 6 $ echo "record=" >> $HGRCPATH
7 7
8 8 $ hg init a
9 9 $ cd a
10 10
11 11 Select no files
12 12
13 13 $ touch empty-rw
14 14 $ hg add empty-rw
15 15
16 16 $ hg record empty-rw<<EOF
17 17 > n
18 18 > EOF
19 19 diff --git a/empty-rw b/empty-rw
20 20 new file mode 100644
21 examine changes to 'empty-rw'? [Ynesfdaq?]
21 examine changes to 'empty-rw'? [Ynesfdaq?] n
22
22 23 no changes to record
23 24
24 25 $ hg tip -p
25 26 changeset: -1:000000000000
26 27 tag: tip
27 28 user:
28 29 date: Thu Jan 01 00:00:00 1970 +0000
29 30
30 31
31 32
32 33 Select files but no hunks
33 34
34 35 $ hg record empty-rw<<EOF
35 36 > y
36 37 > n
37 38 > EOF
38 39 diff --git a/empty-rw b/empty-rw
39 40 new file mode 100644
40 examine changes to 'empty-rw'? [Ynesfdaq?]
41 examine changes to 'empty-rw'? [Ynesfdaq?] y
42
41 43 abort: empty commit message
42 44 [255]
43 45
44 46 $ hg tip -p
45 47 changeset: -1:000000000000
46 48 tag: tip
47 49 user:
48 50 date: Thu Jan 01 00:00:00 1970 +0000
49 51
50 52
51 53
52 54 Record empty file
53 55
54 56 $ hg record -d '0 0' -m empty empty-rw<<EOF
55 57 > y
56 58 > y
57 59 > EOF
58 60 diff --git a/empty-rw b/empty-rw
59 61 new file mode 100644
60 examine changes to 'empty-rw'? [Ynesfdaq?]
62 examine changes to 'empty-rw'? [Ynesfdaq?] y
63
61 64
62 65 $ hg tip -p
63 66 changeset: 0:c0708cf4e46e
64 67 tag: tip
65 68 user: test
66 69 date: Thu Jan 01 00:00:00 1970 +0000
67 70 summary: empty
68 71
69 72
70 73
71 74 Summary shows we updated to the new cset
72 75
73 76 $ hg summary
74 77 parent: 0:c0708cf4e46e tip
75 78 empty
76 79 branch: default
77 80 commit: (clean)
78 81 update: (current)
79 82
80 83 Rename empty file
81 84
82 85 $ hg mv empty-rw empty-rename
83 86 $ hg record -d '1 0' -m rename<<EOF
84 87 > y
85 88 > EOF
86 89 diff --git a/empty-rw b/empty-rename
87 90 rename from empty-rw
88 91 rename to empty-rename
89 examine changes to 'empty-rw' and 'empty-rename'? [Ynesfdaq?]
92 examine changes to 'empty-rw' and 'empty-rename'? [Ynesfdaq?] y
93
90 94
91 95 $ hg tip -p
92 96 changeset: 1:d695e8dcb197
93 97 tag: tip
94 98 user: test
95 99 date: Thu Jan 01 00:00:01 1970 +0000
96 100 summary: rename
97 101
98 102
99 103
100 104 Copy empty file
101 105
102 106 $ hg cp empty-rename empty-copy
103 107 $ hg record -d '2 0' -m copy<<EOF
104 108 > y
105 109 > EOF
106 110 diff --git a/empty-rename b/empty-copy
107 111 copy from empty-rename
108 112 copy to empty-copy
109 examine changes to 'empty-rename' and 'empty-copy'? [Ynesfdaq?]
113 examine changes to 'empty-rename' and 'empty-copy'? [Ynesfdaq?] y
114
110 115
111 116 $ hg tip -p
112 117 changeset: 2:1d4b90bea524
113 118 tag: tip
114 119 user: test
115 120 date: Thu Jan 01 00:00:02 1970 +0000
116 121 summary: copy
117 122
118 123
119 124
120 125 Delete empty file
121 126
122 127 $ hg rm empty-copy
123 128 $ hg record -d '3 0' -m delete<<EOF
124 129 > y
125 130 > EOF
126 131 diff --git a/empty-copy b/empty-copy
127 132 deleted file mode 100644
128 examine changes to 'empty-copy'? [Ynesfdaq?]
133 examine changes to 'empty-copy'? [Ynesfdaq?] y
134
129 135
130 136 $ hg tip -p
131 137 changeset: 3:b39a238f01a1
132 138 tag: tip
133 139 user: test
134 140 date: Thu Jan 01 00:00:03 1970 +0000
135 141 summary: delete
136 142
137 143
138 144
139 145 Add binary file
140 146
141 147 $ hg bundle --base -2 tip.bundle
142 148 1 changesets found
143 149 $ hg add tip.bundle
144 150 $ hg record -d '4 0' -m binary<<EOF
145 151 > y
146 152 > EOF
147 153 diff --git a/tip.bundle b/tip.bundle
148 154 new file mode 100644
149 155 this is a binary file
150 examine changes to 'tip.bundle'? [Ynesfdaq?]
156 examine changes to 'tip.bundle'? [Ynesfdaq?] y
157
151 158
152 159 $ hg tip -p
153 160 changeset: 4:ad816da3711e
154 161 tag: tip
155 162 user: test
156 163 date: Thu Jan 01 00:00:04 1970 +0000
157 164 summary: binary
158 165
159 166 diff -r b39a238f01a1 -r ad816da3711e tip.bundle
160 167 Binary file tip.bundle has changed
161 168
162 169
163 170 Change binary file
164 171
165 172 $ hg bundle --base -2 tip.bundle
166 173 1 changesets found
167 174 $ hg record -d '5 0' -m binary-change<<EOF
168 175 > y
169 176 > EOF
170 177 diff --git a/tip.bundle b/tip.bundle
171 178 this modifies a binary file (all or nothing)
172 examine changes to 'tip.bundle'? [Ynesfdaq?]
179 examine changes to 'tip.bundle'? [Ynesfdaq?] y
180
173 181
174 182 $ hg tip -p
175 183 changeset: 5:dccd6f3eb485
176 184 tag: tip
177 185 user: test
178 186 date: Thu Jan 01 00:00:05 1970 +0000
179 187 summary: binary-change
180 188
181 189 diff -r ad816da3711e -r dccd6f3eb485 tip.bundle
182 190 Binary file tip.bundle has changed
183 191
184 192
185 193 Rename and change binary file
186 194
187 195 $ hg mv tip.bundle top.bundle
188 196 $ hg bundle --base -2 top.bundle
189 197 1 changesets found
190 198 $ hg record -d '6 0' -m binary-change-rename<<EOF
191 199 > y
192 200 > EOF
193 201 diff --git a/tip.bundle b/top.bundle
194 202 rename from tip.bundle
195 203 rename to top.bundle
196 204 this modifies a binary file (all or nothing)
197 examine changes to 'tip.bundle' and 'top.bundle'? [Ynesfdaq?]
205 examine changes to 'tip.bundle' and 'top.bundle'? [Ynesfdaq?] y
206
198 207
199 208 $ hg tip -p
200 209 changeset: 6:7fa44105f5b3
201 210 tag: tip
202 211 user: test
203 212 date: Thu Jan 01 00:00:06 1970 +0000
204 213 summary: binary-change-rename
205 214
206 215 diff -r dccd6f3eb485 -r 7fa44105f5b3 tip.bundle
207 216 Binary file tip.bundle has changed
208 217 diff -r dccd6f3eb485 -r 7fa44105f5b3 top.bundle
209 218 Binary file top.bundle has changed
210 219
211 220
212 221 Add plain file
213 222
214 223 $ for i in 1 2 3 4 5 6 7 8 9 10; do
215 224 > echo $i >> plain
216 225 > done
217 226
218 227 $ hg add plain
219 228 $ hg record -d '7 0' -m plain plain<<EOF
220 229 > y
221 230 > y
222 231 > EOF
223 232 diff --git a/plain b/plain
224 233 new file mode 100644
225 examine changes to 'plain'? [Ynesfdaq?]
234 examine changes to 'plain'? [Ynesfdaq?] y
235
226 236
227 237 $ hg tip -p
228 238 changeset: 7:11fb457c1be4
229 239 tag: tip
230 240 user: test
231 241 date: Thu Jan 01 00:00:07 1970 +0000
232 242 summary: plain
233 243
234 244 diff -r 7fa44105f5b3 -r 11fb457c1be4 plain
235 245 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
236 246 +++ b/plain Thu Jan 01 00:00:07 1970 +0000
237 247 @@ -0,0 +1,10 @@
238 248 +1
239 249 +2
240 250 +3
241 251 +4
242 252 +5
243 253 +6
244 254 +7
245 255 +8
246 256 +9
247 257 +10
248 258
249 259 Modify end of plain file with username unset
250 260
251 261 $ echo 11 >> plain
252 262 $ unset HGUSER
253 263 $ hg record --config ui.username= -d '8 0' -m end plain
254 264 abort: no username supplied
255 265 (use "hg config --edit" to set your username)
256 266 [255]
257 267
258 268
259 269 Modify end of plain file, also test that diffopts are accounted for
260 270
261 271 $ HGUSER="test"
262 272 $ export HGUSER
263 273 $ hg record --config diff.showfunc=true -d '8 0' -m end plain <<EOF
264 274 > y
265 275 > y
266 276 > EOF
267 277 diff --git a/plain b/plain
268 278 1 hunks, 1 lines changed
269 examine changes to 'plain'? [Ynesfdaq?]
279 examine changes to 'plain'? [Ynesfdaq?] y
280
270 281 @@ -8,3 +8,4 @@ 7
271 282 8
272 283 9
273 284 10
274 285 +11
275 record this change to 'plain'? [Ynesfdaq?]
286 record this change to 'plain'? [Ynesfdaq?] y
287
276 288
277 289 Modify end of plain file, no EOL
278 290
279 291 $ hg tip --template '{node}' >> plain
280 292 $ hg record -d '9 0' -m noeol plain <<EOF
281 293 > y
282 294 > y
283 295 > EOF
284 296 diff --git a/plain b/plain
285 297 1 hunks, 1 lines changed
286 examine changes to 'plain'? [Ynesfdaq?]
298 examine changes to 'plain'? [Ynesfdaq?] y
299
287 300 @@ -9,3 +9,4 @@
288 301 9
289 302 10
290 303 11
291 304 +7264f99c5f5ff3261504828afa4fb4d406c3af54
292 305 \ No newline at end of file
293 record this change to 'plain'? [Ynesfdaq?]
306 record this change to 'plain'? [Ynesfdaq?] y
307
294 308
295 309 Modify end of plain file, add EOL
296 310
297 311 $ echo >> plain
298 312 $ echo 1 > plain2
299 313 $ hg add plain2
300 314 $ hg record -d '10 0' -m eol plain plain2 <<EOF
301 315 > y
302 316 > y
303 317 > y
304 318 > EOF
305 319 diff --git a/plain b/plain
306 320 1 hunks, 1 lines changed
307 examine changes to 'plain'? [Ynesfdaq?]
321 examine changes to 'plain'? [Ynesfdaq?] y
322
308 323 @@ -9,4 +9,4 @@
309 324 9
310 325 10
311 326 11
312 327 -7264f99c5f5ff3261504828afa4fb4d406c3af54
313 328 \ No newline at end of file
314 329 +7264f99c5f5ff3261504828afa4fb4d406c3af54
315 record change 1/2 to 'plain'? [Ynesfdaq?]
330 record change 1/2 to 'plain'? [Ynesfdaq?] y
331
316 332 diff --git a/plain2 b/plain2
317 333 new file mode 100644
318 examine changes to 'plain2'? [Ynesfdaq?]
334 examine changes to 'plain2'? [Ynesfdaq?] y
335
319 336
320 337 Modify beginning, trim end, record both, add another file to test
321 338 changes numbering
322 339
323 340 $ rm plain
324 341 $ for i in 2 2 3 4 5 6 7 8 9 10; do
325 342 > echo $i >> plain
326 343 > done
327 344 $ echo 2 >> plain2
328 345
329 346 $ hg record -d '10 0' -m begin-and-end plain plain2 <<EOF
330 347 > y
331 348 > y
332 349 > y
333 350 > y
334 351 > y
335 352 > EOF
336 353 diff --git a/plain b/plain
337 354 2 hunks, 3 lines changed
338 examine changes to 'plain'? [Ynesfdaq?]
355 examine changes to 'plain'? [Ynesfdaq?] y
356
339 357 @@ -1,4 +1,4 @@
340 358 -1
341 359 +2
342 360 2
343 361 3
344 362 4
345 record change 1/3 to 'plain'? [Ynesfdaq?]
363 record change 1/3 to 'plain'? [Ynesfdaq?] y
364
346 365 @@ -8,5 +8,3 @@
347 366 8
348 367 9
349 368 10
350 369 -11
351 370 -7264f99c5f5ff3261504828afa4fb4d406c3af54
352 record change 2/3 to 'plain'? [Ynesfdaq?]
371 record change 2/3 to 'plain'? [Ynesfdaq?] y
372
353 373 diff --git a/plain2 b/plain2
354 374 1 hunks, 1 lines changed
355 examine changes to 'plain2'? [Ynesfdaq?]
375 examine changes to 'plain2'? [Ynesfdaq?] y
376
356 377 @@ -1,1 +1,2 @@
357 378 1
358 379 +2
359 record change 3/3 to 'plain2'? [Ynesfdaq?]
380 record change 3/3 to 'plain2'? [Ynesfdaq?] y
381
360 382
361 383 $ hg tip -p
362 384 changeset: 11:21df83db12b8
363 385 tag: tip
364 386 user: test
365 387 date: Thu Jan 01 00:00:10 1970 +0000
366 388 summary: begin-and-end
367 389
368 390 diff -r ddb8b281c3ff -r 21df83db12b8 plain
369 391 --- a/plain Thu Jan 01 00:00:10 1970 +0000
370 392 +++ b/plain Thu Jan 01 00:00:10 1970 +0000
371 393 @@ -1,4 +1,4 @@
372 394 -1
373 395 +2
374 396 2
375 397 3
376 398 4
377 399 @@ -8,5 +8,3 @@
378 400 8
379 401 9
380 402 10
381 403 -11
382 404 -7264f99c5f5ff3261504828afa4fb4d406c3af54
383 405 diff -r ddb8b281c3ff -r 21df83db12b8 plain2
384 406 --- a/plain2 Thu Jan 01 00:00:10 1970 +0000
385 407 +++ b/plain2 Thu Jan 01 00:00:10 1970 +0000
386 408 @@ -1,1 +1,2 @@
387 409 1
388 410 +2
389 411
390 412
391 413 Trim beginning, modify end
392 414
393 415 $ rm plain
394 416 > for i in 4 5 6 7 8 9 10.new; do
395 417 > echo $i >> plain
396 418 > done
397 419
398 420 Record end
399 421
400 422 $ hg record -d '11 0' -m end-only plain <<EOF
401 423 > y
402 424 > n
403 425 > y
404 426 > EOF
405 427 diff --git a/plain b/plain
406 428 2 hunks, 4 lines changed
407 examine changes to 'plain'? [Ynesfdaq?]
429 examine changes to 'plain'? [Ynesfdaq?] y
430
408 431 @@ -1,9 +1,6 @@
409 432 -2
410 433 -2
411 434 -3
412 435 4
413 436 5
414 437 6
415 438 7
416 439 8
417 440 9
418 record change 1/2 to 'plain'? [Ynesfdaq?]
441 record change 1/2 to 'plain'? [Ynesfdaq?] n
442
419 443 @@ -4,7 +1,7 @@
420 444 4
421 445 5
422 446 6
423 447 7
424 448 8
425 449 9
426 450 -10
427 451 +10.new
428 record change 2/2 to 'plain'? [Ynesfdaq?]
452 record change 2/2 to 'plain'? [Ynesfdaq?] y
453
429 454
430 455 $ hg tip -p
431 456 changeset: 12:99337501826f
432 457 tag: tip
433 458 user: test
434 459 date: Thu Jan 01 00:00:11 1970 +0000
435 460 summary: end-only
436 461
437 462 diff -r 21df83db12b8 -r 99337501826f plain
438 463 --- a/plain Thu Jan 01 00:00:10 1970 +0000
439 464 +++ b/plain Thu Jan 01 00:00:11 1970 +0000
440 465 @@ -7,4 +7,4 @@
441 466 7
442 467 8
443 468 9
444 469 -10
445 470 +10.new
446 471
447 472
448 473 Record beginning
449 474
450 475 $ hg record -d '12 0' -m begin-only plain <<EOF
451 476 > y
452 477 > y
453 478 > EOF
454 479 diff --git a/plain b/plain
455 480 1 hunks, 3 lines changed
456 examine changes to 'plain'? [Ynesfdaq?]
481 examine changes to 'plain'? [Ynesfdaq?] y
482
457 483 @@ -1,6 +1,3 @@
458 484 -2
459 485 -2
460 486 -3
461 487 4
462 488 5
463 489 6
464 record this change to 'plain'? [Ynesfdaq?]
490 record this change to 'plain'? [Ynesfdaq?] y
491
465 492
466 493 $ hg tip -p
467 494 changeset: 13:bbd45465d540
468 495 tag: tip
469 496 user: test
470 497 date: Thu Jan 01 00:00:12 1970 +0000
471 498 summary: begin-only
472 499
473 500 diff -r 99337501826f -r bbd45465d540 plain
474 501 --- a/plain Thu Jan 01 00:00:11 1970 +0000
475 502 +++ b/plain Thu Jan 01 00:00:12 1970 +0000
476 503 @@ -1,6 +1,3 @@
477 504 -2
478 505 -2
479 506 -3
480 507 4
481 508 5
482 509 6
483 510
484 511
485 512 Add to beginning, trim from end
486 513
487 514 $ rm plain
488 515 $ for i in 1 2 3 4 5 6 7 8 9; do
489 516 > echo $i >> plain
490 517 > done
491 518
492 519 Record end
493 520
494 521 $ hg record --traceback -d '13 0' -m end-again plain<<EOF
495 522 > y
496 523 > n
497 524 > y
498 525 > EOF
499 526 diff --git a/plain b/plain
500 527 2 hunks, 4 lines changed
501 examine changes to 'plain'? [Ynesfdaq?]
528 examine changes to 'plain'? [Ynesfdaq?] y
529
502 530 @@ -1,6 +1,9 @@
503 531 +1
504 532 +2
505 533 +3
506 534 4
507 535 5
508 536 6
509 537 7
510 538 8
511 539 9
512 record change 1/2 to 'plain'? [Ynesfdaq?]
540 record change 1/2 to 'plain'? [Ynesfdaq?] n
541
513 542 @@ -1,7 +4,6 @@
514 543 4
515 544 5
516 545 6
517 546 7
518 547 8
519 548 9
520 549 -10.new
521 record change 2/2 to 'plain'? [Ynesfdaq?]
550 record change 2/2 to 'plain'? [Ynesfdaq?] y
551
522 552
523 553 Add to beginning, middle, end
524 554
525 555 $ rm plain
526 556 $ for i in 1 2 3 4 5 5.new 5.reallynew 6 7 8 9 10 11; do
527 557 > echo $i >> plain
528 558 > done
529 559
530 560 Record beginning, middle
531 561
532 562 $ hg record -d '14 0' -m middle-only plain <<EOF
533 563 > y
534 564 > y
535 565 > y
536 566 > n
537 567 > EOF
538 568 diff --git a/plain b/plain
539 569 3 hunks, 7 lines changed
540 examine changes to 'plain'? [Ynesfdaq?]
570 examine changes to 'plain'? [Ynesfdaq?] y
571
541 572 @@ -1,2 +1,5 @@
542 573 +1
543 574 +2
544 575 +3
545 576 4
546 577 5
547 record change 1/3 to 'plain'? [Ynesfdaq?]
578 record change 1/3 to 'plain'? [Ynesfdaq?] y
579
548 580 @@ -1,6 +4,8 @@
549 581 4
550 582 5
551 583 +5.new
552 584 +5.reallynew
553 585 6
554 586 7
555 587 8
556 588 9
557 record change 2/3 to 'plain'? [Ynesfdaq?]
589 record change 2/3 to 'plain'? [Ynesfdaq?] y
590
558 591 @@ -3,4 +8,6 @@
559 592 6
560 593 7
561 594 8
562 595 9
563 596 +10
564 597 +11
565 record change 3/3 to 'plain'? [Ynesfdaq?]
598 record change 3/3 to 'plain'? [Ynesfdaq?] n
599
566 600
567 601 $ hg tip -p
568 602 changeset: 15:f34a7937ec33
569 603 tag: tip
570 604 user: test
571 605 date: Thu Jan 01 00:00:14 1970 +0000
572 606 summary: middle-only
573 607
574 608 diff -r 82c065d0b850 -r f34a7937ec33 plain
575 609 --- a/plain Thu Jan 01 00:00:13 1970 +0000
576 610 +++ b/plain Thu Jan 01 00:00:14 1970 +0000
577 611 @@ -1,5 +1,10 @@
578 612 +1
579 613 +2
580 614 +3
581 615 4
582 616 5
583 617 +5.new
584 618 +5.reallynew
585 619 6
586 620 7
587 621 8
588 622
589 623
590 624 Record end
591 625
592 626 $ hg record -d '15 0' -m end-only plain <<EOF
593 627 > y
594 628 > y
595 629 > EOF
596 630 diff --git a/plain b/plain
597 631 1 hunks, 2 lines changed
598 examine changes to 'plain'? [Ynesfdaq?]
632 examine changes to 'plain'? [Ynesfdaq?] y
633
599 634 @@ -9,3 +9,5 @@
600 635 7
601 636 8
602 637 9
603 638 +10
604 639 +11
605 record this change to 'plain'? [Ynesfdaq?]
640 record this change to 'plain'? [Ynesfdaq?] y
641
606 642
607 643 $ hg tip -p
608 644 changeset: 16:f9900b71a04c
609 645 tag: tip
610 646 user: test
611 647 date: Thu Jan 01 00:00:15 1970 +0000
612 648 summary: end-only
613 649
614 650 diff -r f34a7937ec33 -r f9900b71a04c plain
615 651 --- a/plain Thu Jan 01 00:00:14 1970 +0000
616 652 +++ b/plain Thu Jan 01 00:00:15 1970 +0000
617 653 @@ -9,3 +9,5 @@
618 654 7
619 655 8
620 656 9
621 657 +10
622 658 +11
623 659
624 660
625 661 $ mkdir subdir
626 662 $ cd subdir
627 663 $ echo a > a
628 664 $ hg ci -d '16 0' -Amsubdir
629 665 adding subdir/a
630 666
631 667 $ echo a >> a
632 668 $ hg record -d '16 0' -m subdir-change a <<EOF
633 669 > y
634 670 > y
635 671 > EOF
636 672 diff --git a/subdir/a b/subdir/a
637 673 1 hunks, 1 lines changed
638 examine changes to 'subdir/a'? [Ynesfdaq?]
674 examine changes to 'subdir/a'? [Ynesfdaq?] y
675
639 676 @@ -1,1 +1,2 @@
640 677 a
641 678 +a
642 record this change to 'subdir/a'? [Ynesfdaq?]
679 record this change to 'subdir/a'? [Ynesfdaq?] y
680
643 681
644 682 $ hg tip -p
645 683 changeset: 18:61be427a9deb
646 684 tag: tip
647 685 user: test
648 686 date: Thu Jan 01 00:00:16 1970 +0000
649 687 summary: subdir-change
650 688
651 689 diff -r a7ffae4d61cb -r 61be427a9deb subdir/a
652 690 --- a/subdir/a Thu Jan 01 00:00:16 1970 +0000
653 691 +++ b/subdir/a Thu Jan 01 00:00:16 1970 +0000
654 692 @@ -1,1 +1,2 @@
655 693 a
656 694 +a
657 695
658 696
659 697 $ echo a > f1
660 698 $ echo b > f2
661 699 $ hg add f1 f2
662 700
663 701 $ hg ci -mz -d '17 0'
664 702
665 703 $ echo a >> f1
666 704 $ echo b >> f2
667 705
668 706 Help, quit
669 707
670 708 $ hg record <<EOF
671 709 > ?
672 710 > q
673 711 > EOF
674 712 diff --git a/subdir/f1 b/subdir/f1
675 713 1 hunks, 1 lines changed
676 examine changes to 'subdir/f1'? [Ynesfdaq?]
714 examine changes to 'subdir/f1'? [Ynesfdaq?] ?
715
677 716 y - yes, record this change
678 717 n - no, skip this change
679 718 e - edit this change manually
680 719 s - skip remaining changes to this file
681 720 f - record remaining changes to this file
682 721 d - done, skip remaining changes and files
683 722 a - record all changes to all remaining files
684 723 q - quit, recording no changes
685 724 ? - ? (display help)
686 examine changes to 'subdir/f1'? [Ynesfdaq?]
725 examine changes to 'subdir/f1'? [Ynesfdaq?] q
726
687 727 abort: user quit
688 728 [255]
689 729
690 730 Skip
691 731
692 732 $ hg record <<EOF
693 733 > s
694 734 > EOF
695 735 diff --git a/subdir/f1 b/subdir/f1
696 736 1 hunks, 1 lines changed
697 examine changes to 'subdir/f1'? [Ynesfdaq?]
737 examine changes to 'subdir/f1'? [Ynesfdaq?] s
738
698 739 diff --git a/subdir/f2 b/subdir/f2
699 740 1 hunks, 1 lines changed
700 741 examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
701 742 [255]
702 743
703 744 No
704 745
705 746 $ hg record <<EOF
706 747 > n
707 748 > EOF
708 749 diff --git a/subdir/f1 b/subdir/f1
709 750 1 hunks, 1 lines changed
710 examine changes to 'subdir/f1'? [Ynesfdaq?]
751 examine changes to 'subdir/f1'? [Ynesfdaq?] n
752
711 753 diff --git a/subdir/f2 b/subdir/f2
712 754 1 hunks, 1 lines changed
713 755 examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
714 756 [255]
715 757
716 758 f, quit
717 759
718 760 $ hg record <<EOF
719 761 > f
720 762 > q
721 763 > EOF
722 764 diff --git a/subdir/f1 b/subdir/f1
723 765 1 hunks, 1 lines changed
724 examine changes to 'subdir/f1'? [Ynesfdaq?]
766 examine changes to 'subdir/f1'? [Ynesfdaq?] f
767
725 768 diff --git a/subdir/f2 b/subdir/f2
726 769 1 hunks, 1 lines changed
727 examine changes to 'subdir/f2'? [Ynesfdaq?]
770 examine changes to 'subdir/f2'? [Ynesfdaq?] q
771
728 772 abort: user quit
729 773 [255]
730 774
731 775 s, all
732 776
733 777 $ hg record -d '18 0' -mx <<EOF
734 778 > s
735 779 > a
736 780 > EOF
737 781 diff --git a/subdir/f1 b/subdir/f1
738 782 1 hunks, 1 lines changed
739 examine changes to 'subdir/f1'? [Ynesfdaq?]
783 examine changes to 'subdir/f1'? [Ynesfdaq?] s
784
740 785 diff --git a/subdir/f2 b/subdir/f2
741 786 1 hunks, 1 lines changed
742 examine changes to 'subdir/f2'? [Ynesfdaq?]
787 examine changes to 'subdir/f2'? [Ynesfdaq?] a
788
743 789
744 790 $ hg tip -p
745 791 changeset: 20:b3df3dda369a
746 792 tag: tip
747 793 user: test
748 794 date: Thu Jan 01 00:00:18 1970 +0000
749 795 summary: x
750 796
751 797 diff -r 6e02d6c9906d -r b3df3dda369a subdir/f2
752 798 --- a/subdir/f2 Thu Jan 01 00:00:17 1970 +0000
753 799 +++ b/subdir/f2 Thu Jan 01 00:00:18 1970 +0000
754 800 @@ -1,1 +1,2 @@
755 801 b
756 802 +b
757 803
758 804
759 805 f
760 806
761 807 $ hg record -d '19 0' -my <<EOF
762 808 > f
763 809 > EOF
764 810 diff --git a/subdir/f1 b/subdir/f1
765 811 1 hunks, 1 lines changed
766 examine changes to 'subdir/f1'? [Ynesfdaq?]
812 examine changes to 'subdir/f1'? [Ynesfdaq?] f
813
767 814
768 815 $ hg tip -p
769 816 changeset: 21:38ec577f126b
770 817 tag: tip
771 818 user: test
772 819 date: Thu Jan 01 00:00:19 1970 +0000
773 820 summary: y
774 821
775 822 diff -r b3df3dda369a -r 38ec577f126b subdir/f1
776 823 --- a/subdir/f1 Thu Jan 01 00:00:18 1970 +0000
777 824 +++ b/subdir/f1 Thu Jan 01 00:00:19 1970 +0000
778 825 @@ -1,1 +1,2 @@
779 826 a
780 827 +a
781 828
782 829
783 830 #if execbit
784 831
785 832 Preserve chmod +x
786 833
787 834 $ chmod +x f1
788 835 $ echo a >> f1
789 836 $ hg record -d '20 0' -mz <<EOF
790 837 > y
791 838 > y
792 839 > y
793 840 > EOF
794 841 diff --git a/subdir/f1 b/subdir/f1
795 842 old mode 100644
796 843 new mode 100755
797 844 1 hunks, 1 lines changed
798 examine changes to 'subdir/f1'? [Ynesfdaq?]
845 examine changes to 'subdir/f1'? [Ynesfdaq?] y
846
799 847 @@ -1,2 +1,3 @@
800 848 a
801 849 a
802 850 +a
803 record this change to 'subdir/f1'? [Ynesfdaq?]
851 record this change to 'subdir/f1'? [Ynesfdaq?] y
852
804 853
805 854 $ hg tip --config diff.git=True -p
806 855 changeset: 22:3261adceb075
807 856 tag: tip
808 857 user: test
809 858 date: Thu Jan 01 00:00:20 1970 +0000
810 859 summary: z
811 860
812 861 diff --git a/subdir/f1 b/subdir/f1
813 862 old mode 100644
814 863 new mode 100755
815 864 --- a/subdir/f1
816 865 +++ b/subdir/f1
817 866 @@ -1,2 +1,3 @@
818 867 a
819 868 a
820 869 +a
821 870
822 871
823 872 Preserve execute permission on original
824 873
825 874 $ echo b >> f1
826 875 $ hg record -d '21 0' -maa <<EOF
827 876 > y
828 877 > y
829 878 > y
830 879 > EOF
831 880 diff --git a/subdir/f1 b/subdir/f1
832 881 1 hunks, 1 lines changed
833 examine changes to 'subdir/f1'? [Ynesfdaq?]
882 examine changes to 'subdir/f1'? [Ynesfdaq?] y
883
834 884 @@ -1,3 +1,4 @@
835 885 a
836 886 a
837 887 a
838 888 +b
839 record this change to 'subdir/f1'? [Ynesfdaq?]
889 record this change to 'subdir/f1'? [Ynesfdaq?] y
890
840 891
841 892 $ hg tip --config diff.git=True -p
842 893 changeset: 23:b429867550db
843 894 tag: tip
844 895 user: test
845 896 date: Thu Jan 01 00:00:21 1970 +0000
846 897 summary: aa
847 898
848 899 diff --git a/subdir/f1 b/subdir/f1
849 900 --- a/subdir/f1
850 901 +++ b/subdir/f1
851 902 @@ -1,3 +1,4 @@
852 903 a
853 904 a
854 905 a
855 906 +b
856 907
857 908
858 909 Preserve chmod -x
859 910
860 911 $ chmod -x f1
861 912 $ echo c >> f1
862 913 $ hg record -d '22 0' -mab <<EOF
863 914 > y
864 915 > y
865 916 > y
866 917 > EOF
867 918 diff --git a/subdir/f1 b/subdir/f1
868 919 old mode 100755
869 920 new mode 100644
870 921 1 hunks, 1 lines changed
871 examine changes to 'subdir/f1'? [Ynesfdaq?]
922 examine changes to 'subdir/f1'? [Ynesfdaq?] y
923
872 924 @@ -2,3 +2,4 @@
873 925 a
874 926 a
875 927 b
876 928 +c
877 record this change to 'subdir/f1'? [Ynesfdaq?]
929 record this change to 'subdir/f1'? [Ynesfdaq?] y
930
878 931
879 932 $ hg tip --config diff.git=True -p
880 933 changeset: 24:0b082130c20a
881 934 tag: tip
882 935 user: test
883 936 date: Thu Jan 01 00:00:22 1970 +0000
884 937 summary: ab
885 938
886 939 diff --git a/subdir/f1 b/subdir/f1
887 940 old mode 100755
888 941 new mode 100644
889 942 --- a/subdir/f1
890 943 +++ b/subdir/f1
891 944 @@ -2,3 +2,4 @@
892 945 a
893 946 a
894 947 b
895 948 +c
896 949
897 950
898 951 #else
899 952
900 953 Slightly bogus tests to get almost same repo structure as when x bit is used
901 954 - but with different hashes.
902 955
903 956 Mock "Preserve chmod +x"
904 957
905 958 $ echo a >> f1
906 959 $ hg record -d '20 0' -mz <<EOF
907 960 > y
908 961 > y
909 962 > y
910 963 > EOF
911 964 diff --git a/subdir/f1 b/subdir/f1
912 965 1 hunks, 1 lines changed
913 966 examine changes to 'subdir/f1'? [Ynesfdaq?]
914 967 @@ -1,2 +1,3 @@
915 968 a
916 969 a
917 970 +a
918 971 record this change to 'subdir/f1'? [Ynesfdaq?]
919 972
920 973 $ hg tip --config diff.git=True -p
921 974 changeset: 22:0d463bd428f5
922 975 tag: tip
923 976 user: test
924 977 date: Thu Jan 01 00:00:20 1970 +0000
925 978 summary: z
926 979
927 980 diff --git a/subdir/f1 b/subdir/f1
928 981 --- a/subdir/f1
929 982 +++ b/subdir/f1
930 983 @@ -1,2 +1,3 @@
931 984 a
932 985 a
933 986 +a
934 987
935 988
936 989 Mock "Preserve execute permission on original"
937 990
938 991 $ echo b >> f1
939 992 $ hg record -d '21 0' -maa <<EOF
940 993 > y
941 994 > y
942 995 > y
943 996 > EOF
944 997 diff --git a/subdir/f1 b/subdir/f1
945 998 1 hunks, 1 lines changed
946 999 examine changes to 'subdir/f1'? [Ynesfdaq?]
947 1000 @@ -1,3 +1,4 @@
948 1001 a
949 1002 a
950 1003 a
951 1004 +b
952 1005 record this change to 'subdir/f1'? [Ynesfdaq?]
953 1006
954 1007 $ hg tip --config diff.git=True -p
955 1008 changeset: 23:0eab41a3e524
956 1009 tag: tip
957 1010 user: test
958 1011 date: Thu Jan 01 00:00:21 1970 +0000
959 1012 summary: aa
960 1013
961 1014 diff --git a/subdir/f1 b/subdir/f1
962 1015 --- a/subdir/f1
963 1016 +++ b/subdir/f1
964 1017 @@ -1,3 +1,4 @@
965 1018 a
966 1019 a
967 1020 a
968 1021 +b
969 1022
970 1023
971 1024 Mock "Preserve chmod -x"
972 1025
973 1026 $ chmod -x f1
974 1027 $ echo c >> f1
975 1028 $ hg record -d '22 0' -mab <<EOF
976 1029 > y
977 1030 > y
978 1031 > y
979 1032 > EOF
980 1033 diff --git a/subdir/f1 b/subdir/f1
981 1034 1 hunks, 1 lines changed
982 1035 examine changes to 'subdir/f1'? [Ynesfdaq?]
983 1036 @@ -2,3 +2,4 @@
984 1037 a
985 1038 a
986 1039 b
987 1040 +c
988 1041 record this change to 'subdir/f1'? [Ynesfdaq?]
989 1042
990 1043 $ hg tip --config diff.git=True -p
991 1044 changeset: 24:f4f718f27b7c
992 1045 tag: tip
993 1046 user: test
994 1047 date: Thu Jan 01 00:00:22 1970 +0000
995 1048 summary: ab
996 1049
997 1050 diff --git a/subdir/f1 b/subdir/f1
998 1051 --- a/subdir/f1
999 1052 +++ b/subdir/f1
1000 1053 @@ -2,3 +2,4 @@
1001 1054 a
1002 1055 a
1003 1056 b
1004 1057 +c
1005 1058
1006 1059
1007 1060 #endif
1008 1061
1009 1062 $ cd ..
1010 1063
1011 1064
1012 1065 Abort early when a merge is in progress
1013 1066
1014 1067 $ hg up 4
1015 1068 1 files updated, 0 files merged, 6 files removed, 0 files unresolved
1016 1069
1017 1070 $ touch iwillmergethat
1018 1071 $ hg add iwillmergethat
1019 1072
1020 1073 $ hg branch thatbranch
1021 1074 marked working directory as branch thatbranch
1022 1075 (branches are permanent and global, did you want a bookmark?)
1023 1076
1024 1077 $ hg ci -m'new head'
1025 1078
1026 1079 $ hg up default
1027 1080 6 files updated, 0 files merged, 2 files removed, 0 files unresolved
1028 1081
1029 1082 $ hg merge thatbranch
1030 1083 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1031 1084 (branch merge, don't forget to commit)
1032 1085
1033 1086 $ hg record -m'will abort'
1034 1087 abort: cannot partially commit a merge (use "hg commit" instead)
1035 1088 [255]
1036 1089
1037 1090 $ hg up -C
1038 1091 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1039 1092
1040 1093 Editing patch (and ignoring trailing text)
1041 1094
1042 1095 $ cat > editor.sh << '__EOF__'
1043 1096 > sed -e 7d -e '5s/^-/ /' -e '/^# ---/i\
1044 1097 > trailing\nditto' "$1" > tmp
1045 1098 > mv tmp "$1"
1046 1099 > __EOF__
1047 1100 $ cat > editedfile << '__EOF__'
1048 1101 > This is the first line
1049 1102 > This is the second line
1050 1103 > This is the third line
1051 1104 > __EOF__
1052 1105 $ hg add editedfile
1053 1106 $ hg commit -medit-patch-1
1054 1107 $ cat > editedfile << '__EOF__'
1055 1108 > This line has changed
1056 1109 > This change will be committed
1057 1110 > This is the third line
1058 1111 > __EOF__
1059 1112 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record -d '23 0' -medit-patch-2 <<EOF
1060 1113 > y
1061 1114 > e
1062 1115 > EOF
1063 1116 diff --git a/editedfile b/editedfile
1064 1117 1 hunks, 2 lines changed
1065 examine changes to 'editedfile'? [Ynesfdaq?]
1118 examine changes to 'editedfile'? [Ynesfdaq?] y
1119
1066 1120 @@ -1,3 +1,3 @@
1067 1121 -This is the first line
1068 1122 -This is the second line
1069 1123 +This line has changed
1070 1124 +This change will be committed
1071 1125 This is the third line
1072 record this change to 'editedfile'? [Ynesfdaq?]
1126 record this change to 'editedfile'? [Ynesfdaq?] e
1127
1073 1128 $ cat editedfile
1074 1129 This line has changed
1075 1130 This change will be committed
1076 1131 This is the third line
1077 1132 $ hg cat -r tip editedfile
1078 1133 This is the first line
1079 1134 This change will be committed
1080 1135 This is the third line
1081 1136 $ hg revert editedfile
1082 1137
1083 1138 Trying to edit patch for whole file
1084 1139
1085 1140 $ echo "This is the fourth line" >> editedfile
1086 1141 $ hg record <<EOF
1087 1142 > e
1088 1143 > q
1089 1144 > EOF
1090 1145 diff --git a/editedfile b/editedfile
1091 1146 1 hunks, 1 lines changed
1092 examine changes to 'editedfile'? [Ynesfdaq?]
1147 examine changes to 'editedfile'? [Ynesfdaq?] e
1148
1093 1149 cannot edit patch for whole file
1094 examine changes to 'editedfile'? [Ynesfdaq?]
1150 examine changes to 'editedfile'? [Ynesfdaq?] q
1151
1095 1152 abort: user quit
1096 1153 [255]
1097 1154 $ hg revert editedfile
1098 1155
1099 1156 Removing changes from patch
1100 1157
1101 1158 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1102 1159 $ mv tmp editedfile
1103 1160 $ echo "This line has been added" >> editedfile
1104 1161 $ cat > editor.sh << '__EOF__'
1105 1162 > sed -e 's/^[-+]/ /' "$1" > tmp
1106 1163 > mv tmp "$1"
1107 1164 > __EOF__
1108 1165 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
1109 1166 > y
1110 1167 > e
1111 1168 > EOF
1112 1169 diff --git a/editedfile b/editedfile
1113 1170 1 hunks, 3 lines changed
1114 examine changes to 'editedfile'? [Ynesfdaq?]
1171 examine changes to 'editedfile'? [Ynesfdaq?] y
1172
1115 1173 @@ -1,3 +1,3 @@
1116 1174 -This is the first line
1117 1175 -This change will be committed
1118 1176 -This is the third line
1119 1177 +This change will not be committed
1120 1178 +This is the second line
1121 1179 +This line has been added
1122 record this change to 'editedfile'? [Ynesfdaq?]
1180 record this change to 'editedfile'? [Ynesfdaq?] e
1181
1123 1182 no changes to record
1124 1183 $ cat editedfile
1125 1184 This change will not be committed
1126 1185 This is the second line
1127 1186 This line has been added
1128 1187 $ hg cat -r tip editedfile
1129 1188 This is the first line
1130 1189 This change will be committed
1131 1190 This is the third line
1132 1191 $ hg revert editedfile
1133 1192
1134 1193 Invalid patch
1135 1194
1136 1195 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1137 1196 $ mv tmp editedfile
1138 1197 $ echo "This line has been added" >> editedfile
1139 1198 $ cat > editor.sh << '__EOF__'
1140 1199 > sed s/This/That/ "$1" > tmp
1141 1200 > mv tmp "$1"
1142 1201 > __EOF__
1143 1202 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
1144 1203 > y
1145 1204 > e
1146 1205 > EOF
1147 1206 diff --git a/editedfile b/editedfile
1148 1207 1 hunks, 3 lines changed
1149 examine changes to 'editedfile'? [Ynesfdaq?]
1208 examine changes to 'editedfile'? [Ynesfdaq?] y
1209
1150 1210 @@ -1,3 +1,3 @@
1151 1211 -This is the first line
1152 1212 -This change will be committed
1153 1213 -This is the third line
1154 1214 +This change will not be committed
1155 1215 +This is the second line
1156 1216 +This line has been added
1157 record this change to 'editedfile'? [Ynesfdaq?]
1217 record this change to 'editedfile'? [Ynesfdaq?] e
1218
1158 1219 patching file editedfile
1159 1220 Hunk #1 FAILED at 0
1160 1221 1 out of 1 hunks FAILED -- saving rejects to file editedfile.rej
1161 1222 abort: patch failed to apply
1162 1223 [255]
1163 1224 $ cat editedfile
1164 1225 This change will not be committed
1165 1226 This is the second line
1166 1227 This line has been added
1167 1228 $ hg cat -r tip editedfile
1168 1229 This is the first line
1169 1230 This change will be committed
1170 1231 This is the third line
1171 1232 $ cat editedfile.rej
1172 1233 --- editedfile
1173 1234 +++ editedfile
1174 1235 @@ -1,3 +1,3 @@
1175 1236 -That is the first line
1176 1237 -That change will be committed
1177 1238 -That is the third line
1178 1239 +That change will not be committed
1179 1240 +That is the second line
1180 1241 +That line has been added
1181 1242
1182 1243 Malformed patch - error handling
1183 1244
1184 1245 $ cat > editor.sh << '__EOF__'
1185 1246 > sed -e '/^@/p' "$1" > tmp
1186 1247 > mv tmp "$1"
1187 1248 > __EOF__
1188 1249 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
1189 1250 > y
1190 1251 > e
1191 1252 > EOF
1192 1253 diff --git a/editedfile b/editedfile
1193 1254 1 hunks, 3 lines changed
1194 examine changes to 'editedfile'? [Ynesfdaq?]
1255 examine changes to 'editedfile'? [Ynesfdaq?] y
1256
1195 1257 @@ -1,3 +1,3 @@
1196 1258 -This is the first line
1197 1259 -This change will be committed
1198 1260 -This is the third line
1199 1261 +This change will not be committed
1200 1262 +This is the second line
1201 1263 +This line has been added
1202 record this change to 'editedfile'? [Ynesfdaq?]
1264 record this change to 'editedfile'? [Ynesfdaq?] e
1265
1203 1266 abort: error parsing patch: unhandled transition: range -> range
1204 1267 [255]
1205 1268
1206 1269 random text in random positions is still an error
1207 1270
1208 1271 $ cat > editor.sh << '__EOF__'
1209 1272 > sed -e '/^@/i\
1210 1273 > other' "$1" > tmp
1211 1274 > mv tmp "$1"
1212 1275 > __EOF__
1213 1276 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
1214 1277 > y
1215 1278 > e
1216 1279 > EOF
1217 1280 diff --git a/editedfile b/editedfile
1218 1281 1 hunks, 3 lines changed
1219 examine changes to 'editedfile'? [Ynesfdaq?]
1282 examine changes to 'editedfile'? [Ynesfdaq?] y
1283
1220 1284 @@ -1,3 +1,3 @@
1221 1285 -This is the first line
1222 1286 -This change will be committed
1223 1287 -This is the third line
1224 1288 +This change will not be committed
1225 1289 +This is the second line
1226 1290 +This line has been added
1227 record this change to 'editedfile'? [Ynesfdaq?]
1291 record this change to 'editedfile'? [Ynesfdaq?] e
1292
1228 1293 abort: error parsing patch: unhandled transition: file -> other
1229 1294 [255]
1230 1295
1231 1296 $ hg up -C
1232 1297 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1233 1298
1234 1299 With win32text
1235 1300
1236 1301 $ echo '[extensions]' >> .hg/hgrc
1237 1302 $ echo 'win32text = ' >> .hg/hgrc
1238 1303 $ echo '[decode]' >> .hg/hgrc
1239 1304 $ echo '** = cleverdecode:' >> .hg/hgrc
1240 1305 $ echo '[encode]' >> .hg/hgrc
1241 1306 $ echo '** = cleverencode:' >> .hg/hgrc
1242 1307 $ echo '[patch]' >> .hg/hgrc
1243 1308 $ echo 'eol = crlf' >> .hg/hgrc
1244 1309
1245 1310 Ignore win32text deprecation warning for now:
1246 1311
1247 1312 $ echo '[win32text]' >> .hg/hgrc
1248 1313 $ echo 'warn = no' >> .hg/hgrc
1249 1314
1250 1315 $ echo d >> subdir/f1
1251 1316 $ hg record -d '24 0' -mw1 <<EOF
1252 1317 > y
1253 1318 > y
1254 1319 > EOF
1255 1320 diff --git a/subdir/f1 b/subdir/f1
1256 1321 1 hunks, 1 lines changed
1257 examine changes to 'subdir/f1'? [Ynesfdaq?]
1322 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1323
1258 1324 @@ -3,3 +3,4 @@
1259 1325 a
1260 1326 b
1261 1327 c
1262 1328 +d
1263 record this change to 'subdir/f1'? [Ynesfdaq?]
1329 record this change to 'subdir/f1'? [Ynesfdaq?] y
1330
1264 1331
1265 1332 $ hg tip -p
1266 1333 changeset: 28:* (glob)
1267 1334 tag: tip
1268 1335 user: test
1269 1336 date: Thu Jan 01 00:00:24 1970 +0000
1270 1337 summary: w1
1271 1338
1272 1339 diff -r ???????????? -r ???????????? subdir/f1 (glob)
1273 1340 --- a/subdir/f1 Thu Jan 01 00:00:23 1970 +0000
1274 1341 +++ b/subdir/f1 Thu Jan 01 00:00:24 1970 +0000
1275 1342 @@ -3,3 +3,4 @@
1276 1343 a
1277 1344 b
1278 1345 c
1279 1346 +d
1280 1347
1281 1348 Test --user when ui.username not set
1282 1349 $ unset HGUSER
1283 1350 $ echo e >> subdir/f1
1284 1351 $ hg record --config ui.username= -d '8 0' --user xyz -m "user flag" <<EOF
1285 1352 > y
1286 1353 > y
1287 1354 > EOF
1288 1355 diff --git a/subdir/f1 b/subdir/f1
1289 1356 1 hunks, 1 lines changed
1290 examine changes to 'subdir/f1'? [Ynesfdaq?]
1357 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1358
1291 1359 @@ -4,3 +4,4 @@
1292 1360 b
1293 1361 c
1294 1362 d
1295 1363 +e
1296 record this change to 'subdir/f1'? [Ynesfdaq?]
1364 record this change to 'subdir/f1'? [Ynesfdaq?] y
1365
1297 1366 $ hg log --template '{author}\n' -l 1
1298 1367 xyz
1299 1368 $ HGUSER="test"
1300 1369 $ export HGUSER
1301 1370
1302 1371 $ cd ..
@@ -1,763 +1,771
1 1 #require killdaemons
2 2
3 3 $ cat <<EOF >> $HGRCPATH
4 4 > [extensions]
5 5 > transplant=
6 6 > EOF
7 7
8 8 $ hg init t
9 9 $ cd t
10 10 $ echo r1 > r1
11 11 $ hg ci -Amr1 -d'0 0'
12 12 adding r1
13 13 $ echo r2 > r2
14 14 $ hg ci -Amr2 -d'1 0'
15 15 adding r2
16 16 $ hg up 0
17 17 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
18 18
19 19 $ echo b1 > b1
20 20 $ hg ci -Amb1 -d '0 0'
21 21 adding b1
22 22 created new head
23 23 $ echo b2 > b2
24 24 $ hg ci -Amb2 -d '1 0'
25 25 adding b2
26 26 $ echo b3 > b3
27 27 $ hg ci -Amb3 -d '2 0'
28 28 adding b3
29 29
30 30 $ hg log --template '{rev} {parents} {desc}\n'
31 31 4 b3
32 32 3 b2
33 33 2 0:17ab29e464c6 b1
34 34 1 r2
35 35 0 r1
36 36
37 37 $ hg clone . ../rebase
38 38 updating to branch default
39 39 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
40 40 $ cd ../rebase
41 41
42 42 $ hg up -C 1
43 43 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
44 44
45 45 rebase b onto r1
46 46 (this also tests that editor is not invoked if '--edit' is not specified)
47 47
48 48 $ HGEDITOR=cat hg transplant -a -b tip
49 49 applying 37a1297eb21b
50 50 37a1297eb21b transplanted to e234d668f844
51 51 applying 722f4667af76
52 52 722f4667af76 transplanted to 539f377d78df
53 53 applying a53251cdf717
54 54 a53251cdf717 transplanted to ffd6818a3975
55 55 $ hg log --template '{rev} {parents} {desc}\n'
56 56 7 b3
57 57 6 b2
58 58 5 1:d11e3596cc1a b1
59 59 4 b3
60 60 3 b2
61 61 2 0:17ab29e464c6 b1
62 62 1 r2
63 63 0 r1
64 64
65 65 test transplanted revset
66 66
67 67 $ hg log -r 'transplanted()' --template '{rev} {parents} {desc}\n'
68 68 5 1:d11e3596cc1a b1
69 69 6 b2
70 70 7 b3
71 71 $ hg help revsets | grep transplanted
72 72 "transplanted([set])"
73 73 Transplanted changesets in set, or all transplanted changesets.
74 74
75 75 test transplanted keyword
76 76
77 77 $ hg log --template '{rev} {transplanted}\n'
78 78 7 a53251cdf717679d1907b289f991534be05c997a
79 79 6 722f4667af767100cb15b6a79324bf8abbfe1ef4
80 80 5 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21
81 81 4
82 82 3
83 83 2
84 84 1
85 85 0
86 86
87 87 test destination() revset predicate with a transplant of a transplant; new
88 88 clone so subsequent rollback isn't affected
89 89 (this also tests that editor is invoked if '--edit' is specified)
90 90
91 91 $ hg clone -q . ../destination
92 92 $ cd ../destination
93 93 $ hg up -Cq 0
94 94 $ hg branch -q b4
95 95 $ hg ci -qm "b4"
96 96 $ hg status --rev "7^1" --rev 7
97 97 A b3
98 98 $ cat > $TESTTMP/checkeditform.sh <<EOF
99 99 > env | grep HGEDITFORM
100 100 > true
101 101 > EOF
102 102 $ HGEDITOR="sh $TESTTMP/checkeditform.sh; cat" hg transplant --edit 7
103 103 applying ffd6818a3975
104 104 HGEDITFORM=transplant.normal
105 105 b3
106 106
107 107
108 108 HG: Enter commit message. Lines beginning with 'HG:' are removed.
109 109 HG: Leave message empty to abort commit.
110 110 HG: --
111 111 HG: user: test
112 112 HG: branch 'b4'
113 113 HG: added b3
114 114 ffd6818a3975 transplanted to 502236fa76bb
115 115
116 116
117 117 $ hg log -r 'destination()'
118 118 changeset: 5:e234d668f844
119 119 parent: 1:d11e3596cc1a
120 120 user: test
121 121 date: Thu Jan 01 00:00:00 1970 +0000
122 122 summary: b1
123 123
124 124 changeset: 6:539f377d78df
125 125 user: test
126 126 date: Thu Jan 01 00:00:01 1970 +0000
127 127 summary: b2
128 128
129 129 changeset: 7:ffd6818a3975
130 130 user: test
131 131 date: Thu Jan 01 00:00:02 1970 +0000
132 132 summary: b3
133 133
134 134 changeset: 9:502236fa76bb
135 135 branch: b4
136 136 tag: tip
137 137 user: test
138 138 date: Thu Jan 01 00:00:02 1970 +0000
139 139 summary: b3
140 140
141 141 $ hg log -r 'destination(a53251cdf717)'
142 142 changeset: 7:ffd6818a3975
143 143 user: test
144 144 date: Thu Jan 01 00:00:02 1970 +0000
145 145 summary: b3
146 146
147 147 changeset: 9:502236fa76bb
148 148 branch: b4
149 149 tag: tip
150 150 user: test
151 151 date: Thu Jan 01 00:00:02 1970 +0000
152 152 summary: b3
153 153
154 154
155 155 test subset parameter in reverse order
156 156 $ hg log -r 'reverse(all()) and destination(a53251cdf717)'
157 157 changeset: 9:502236fa76bb
158 158 branch: b4
159 159 tag: tip
160 160 user: test
161 161 date: Thu Jan 01 00:00:02 1970 +0000
162 162 summary: b3
163 163
164 164 changeset: 7:ffd6818a3975
165 165 user: test
166 166 date: Thu Jan 01 00:00:02 1970 +0000
167 167 summary: b3
168 168
169 169
170 170 back to the original dir
171 171 $ cd ../rebase
172 172
173 173 rollback the transplant
174 174 $ hg rollback
175 175 repository tip rolled back to revision 4 (undo transplant)
176 176 working directory now based on revision 1
177 177 $ hg tip -q
178 178 4:a53251cdf717
179 179 $ hg parents -q
180 180 1:d11e3596cc1a
181 181 $ hg status
182 182 ? b1
183 183 ? b2
184 184 ? b3
185 185
186 186 $ hg clone ../t ../prune
187 187 updating to branch default
188 188 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 189 $ cd ../prune
190 190
191 191 $ hg up -C 1
192 192 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
193 193
194 194 rebase b onto r1, skipping b2
195 195
196 196 $ hg transplant -a -b tip -p 3
197 197 applying 37a1297eb21b
198 198 37a1297eb21b transplanted to e234d668f844
199 199 applying a53251cdf717
200 200 a53251cdf717 transplanted to 7275fda4d04f
201 201 $ hg log --template '{rev} {parents} {desc}\n'
202 202 6 b3
203 203 5 1:d11e3596cc1a b1
204 204 4 b3
205 205 3 b2
206 206 2 0:17ab29e464c6 b1
207 207 1 r2
208 208 0 r1
209 209
210 210 test same-parent transplant with --log
211 211
212 212 $ hg clone -r 1 ../t ../sameparent
213 213 adding changesets
214 214 adding manifests
215 215 adding file changes
216 216 added 2 changesets with 2 changes to 2 files
217 217 updating to branch default
218 218 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
219 219 $ cd ../sameparent
220 220 $ hg transplant --log -s ../prune 5
221 221 searching for changes
222 222 applying e234d668f844
223 223 e234d668f844 transplanted to e07aea8ecf9c
224 224 $ hg log --template '{rev} {parents} {desc}\n'
225 225 2 b1
226 226 (transplanted from e234d668f844e1b1a765f01db83a32c0c7bfa170)
227 227 1 r2
228 228 0 r1
229 229 remote transplant
230 230
231 231 $ hg clone -r 1 ../t ../remote
232 232 adding changesets
233 233 adding manifests
234 234 adding file changes
235 235 added 2 changesets with 2 changes to 2 files
236 236 updating to branch default
237 237 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
238 238 $ cd ../remote
239 239 $ hg transplant --log -s ../t 2 4
240 240 searching for changes
241 241 applying 37a1297eb21b
242 242 37a1297eb21b transplanted to c19cf0ccb069
243 243 applying a53251cdf717
244 244 a53251cdf717 transplanted to f7fe5bf98525
245 245 $ hg log --template '{rev} {parents} {desc}\n'
246 246 3 b3
247 247 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
248 248 2 b1
249 249 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
250 250 1 r2
251 251 0 r1
252 252
253 253 skip previous transplants
254 254
255 255 $ hg transplant -s ../t -a -b 4
256 256 searching for changes
257 257 applying 722f4667af76
258 258 722f4667af76 transplanted to 47156cd86c0b
259 259 $ hg log --template '{rev} {parents} {desc}\n'
260 260 4 b2
261 261 3 b3
262 262 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
263 263 2 b1
264 264 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
265 265 1 r2
266 266 0 r1
267 267
268 268 skip local changes transplanted to the source
269 269
270 270 $ echo b4 > b4
271 271 $ hg ci -Amb4 -d '3 0'
272 272 adding b4
273 273 $ hg clone ../t ../pullback
274 274 updating to branch default
275 275 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 276 $ cd ../pullback
277 277 $ hg transplant -s ../remote -a -b tip
278 278 searching for changes
279 279 applying 4333daefcb15
280 280 4333daefcb15 transplanted to 5f42c04e07cc
281 281
282 282
283 283 remote transplant with pull
284 284
285 285 $ hg -R ../t serve -p $HGPORT -d --pid-file=../t.pid
286 286 $ cat ../t.pid >> $DAEMON_PIDS
287 287
288 288 $ hg clone -r 0 ../t ../rp
289 289 adding changesets
290 290 adding manifests
291 291 adding file changes
292 292 added 1 changesets with 1 changes to 1 files
293 293 updating to branch default
294 294 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
295 295 $ cd ../rp
296 296 $ hg transplant -s http://localhost:$HGPORT/ 2 4
297 297 searching for changes
298 298 searching for changes
299 299 adding changesets
300 300 adding manifests
301 301 adding file changes
302 302 added 1 changesets with 1 changes to 1 files
303 303 applying a53251cdf717
304 304 a53251cdf717 transplanted to 8d9279348abb
305 305 $ hg log --template '{rev} {parents} {desc}\n'
306 306 2 b3
307 307 1 b1
308 308 0 r1
309 309
310 310 remote transplant without pull
311 311
312 312 $ hg pull -q http://localhost:$HGPORT/
313 313 $ hg transplant -s http://localhost:$HGPORT/ 2 4
314 314 searching for changes
315 315 skipping already applied revision 2:8d9279348abb
316 316 applying 722f4667af76
317 317 722f4667af76 transplanted to 76e321915884
318 318
319 319 transplant --continue
320 320
321 321 $ hg init ../tc
322 322 $ cd ../tc
323 323 $ cat <<EOF > foo
324 324 > foo
325 325 > bar
326 326 > baz
327 327 > EOF
328 328 $ echo toremove > toremove
329 329 $ echo baz > baz
330 330 $ hg ci -Amfoo
331 331 adding baz
332 332 adding foo
333 333 adding toremove
334 334 $ cat <<EOF > foo
335 335 > foo2
336 336 > bar2
337 337 > baz2
338 338 > EOF
339 339 $ rm toremove
340 340 $ echo added > added
341 341 $ hg ci -Amfoo2
342 342 adding added
343 343 removing toremove
344 344 $ echo bar > bar
345 345 $ cat > baz <<EOF
346 346 > before baz
347 347 > baz
348 348 > after baz
349 349 > EOF
350 350 $ hg ci -Ambar
351 351 adding bar
352 352 $ echo bar2 >> bar
353 353 $ hg ci -mbar2
354 354 $ hg up 0
355 355 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
356 356 $ echo foobar > foo
357 357 $ hg ci -mfoobar
358 358 created new head
359 359 $ hg transplant 1:3
360 360 applying 46ae92138f3c
361 361 patching file foo
362 362 Hunk #1 FAILED at 0
363 363 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
364 364 patch failed to apply
365 365 abort: fix up the merge and run hg transplant --continue
366 366 [255]
367 367
368 368 transplant -c shouldn't use an old changeset
369 369
370 370 $ hg up -C
371 371 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
372 372 $ rm added
373 373 $ hg transplant 1
374 374 applying 46ae92138f3c
375 375 patching file foo
376 376 Hunk #1 FAILED at 0
377 377 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
378 378 patch failed to apply
379 379 abort: fix up the merge and run hg transplant --continue
380 380 [255]
381 381 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e
382 382 HGEDITFORM=transplant.normal
383 383 46ae92138f3c transplanted as 9159dada197d
384 384 $ hg transplant 1:3
385 385 skipping already applied revision 1:46ae92138f3c
386 386 applying 9d6d6b5a8275
387 387 9d6d6b5a8275 transplanted to 2d17a10c922f
388 388 applying 1dab759070cf
389 389 1dab759070cf transplanted to e06a69927eb0
390 390 $ hg locate
391 391 added
392 392 bar
393 393 baz
394 394 foo
395 395
396 396 test multiple revisions and --continue
397 397
398 398 $ hg up -qC 0
399 399 $ echo bazbaz > baz
400 400 $ hg ci -Am anotherbaz baz
401 401 created new head
402 402 $ hg transplant 1:3
403 403 applying 46ae92138f3c
404 404 46ae92138f3c transplanted to 1024233ea0ba
405 405 applying 9d6d6b5a8275
406 406 patching file baz
407 407 Hunk #1 FAILED at 0
408 408 1 out of 1 hunks FAILED -- saving rejects to file baz.rej
409 409 patch failed to apply
410 410 abort: fix up the merge and run hg transplant --continue
411 411 [255]
412 412 $ echo fixed > baz
413 413 $ hg transplant --continue
414 414 9d6d6b5a8275 transplanted as d80c49962290
415 415 applying 1dab759070cf
416 416 1dab759070cf transplanted to aa0ffe6bd5ae
417 417
418 418 $ cd ..
419 419
420 420 Issue1111: Test transplant --merge
421 421
422 422 $ hg init t1111
423 423 $ cd t1111
424 424 $ echo a > a
425 425 $ hg ci -Am adda
426 426 adding a
427 427 $ echo b >> a
428 428 $ hg ci -m appendb
429 429 $ echo c >> a
430 430 $ hg ci -m appendc
431 431 $ hg up -C 0
432 432 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
433 433 $ echo d >> a
434 434 $ hg ci -m appendd
435 435 created new head
436 436
437 437 transplant
438 438
439 439 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant -m 1 -e
440 440 applying 42dc4432fd35
441 441 HGEDITFORM=transplant.merge
442 442 1:42dc4432fd35 merged at a9f4acbac129
443 443 $ hg update -q -C 2
444 444 $ cat > a <<EOF
445 445 > x
446 446 > y
447 447 > z
448 448 > EOF
449 449 $ hg commit -m replace
450 450 $ hg update -q -C 4
451 451 $ hg transplant -m 5
452 452 applying 600a3cdcb41d
453 453 patching file a
454 454 Hunk #1 FAILED at 0
455 455 1 out of 1 hunks FAILED -- saving rejects to file a.rej
456 456 patch failed to apply
457 457 abort: fix up the merge and run hg transplant --continue
458 458 [255]
459 459 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e
460 460 HGEDITFORM=transplant.merge
461 461 600a3cdcb41d transplanted as a3f88be652e0
462 462
463 463 $ cd ..
464 464
465 465 test transplant into empty repository
466 466
467 467 $ hg init empty
468 468 $ cd empty
469 469 $ hg transplant -s ../t -b tip -a
470 470 adding changesets
471 471 adding manifests
472 472 adding file changes
473 473 added 4 changesets with 4 changes to 4 files
474 474
475 475 test "--merge" causing pull from source repository on local host
476 476
477 477 $ hg --config extensions.mq= -q strip 2
478 478 $ hg transplant -s ../t --merge tip
479 479 searching for changes
480 480 searching for changes
481 481 adding changesets
482 482 adding manifests
483 483 adding file changes
484 484 added 2 changesets with 2 changes to 2 files
485 485 applying a53251cdf717
486 486 4:a53251cdf717 merged at 4831f4dc831a
487 487
488 488 test interactive transplant
489 489
490 490 $ hg --config extensions.strip= -q strip 0
491 491 $ hg -R ../t log -G --template "{rev}:{node|short}"
492 492 @ 4:a53251cdf717
493 493 |
494 494 o 3:722f4667af76
495 495 |
496 496 o 2:37a1297eb21b
497 497 |
498 498 | o 1:d11e3596cc1a
499 499 |/
500 500 o 0:17ab29e464c6
501 501
502 502 $ hg transplant -q --config ui.interactive=true -s ../t <<EOF
503 503 > p
504 504 > y
505 505 > n
506 506 > n
507 507 > m
508 508 > c
509 509 > EOF
510 510 0:17ab29e464c6
511 apply changeset? [ynmpcq?]: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
511 apply changeset? [ynmpcq?]: p
512 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
512 513 +++ b/r1 Thu Jan 01 00:00:00 1970 +0000
513 514 @@ -0,0 +1,1 @@
514 515 +r1
515 apply changeset? [ynmpcq?]: 1:d11e3596cc1a
516 apply changeset? [ynmpcq?]: 2:37a1297eb21b
517 apply changeset? [ynmpcq?]: 3:722f4667af76
518 apply changeset? [ynmpcq?]: 4:a53251cdf717
519 apply changeset? [ynmpcq?]: (no-eol)
516 apply changeset? [ynmpcq?]: y
517 1:d11e3596cc1a
518 apply changeset? [ynmpcq?]: n
519 2:37a1297eb21b
520 apply changeset? [ynmpcq?]: n
521 3:722f4667af76
522 apply changeset? [ynmpcq?]: m
523 4:a53251cdf717
524 apply changeset? [ynmpcq?]: c
520 525 $ hg log -G --template "{node|short}"
521 526 @ 88be5dde5260
522 527 |\
523 528 | o 722f4667af76
524 529 | |
525 530 | o 37a1297eb21b
526 531 |/
527 532 o 17ab29e464c6
528 533
529 534 $ hg transplant -q --config ui.interactive=true -s ../t <<EOF
530 535 > x
531 536 > ?
532 537 > y
533 538 > q
534 539 > EOF
535 540 1:d11e3596cc1a
536 apply changeset? [ynmpcq?]: unrecognized response
537 apply changeset? [ynmpcq?]: y: yes, transplant this changeset
541 apply changeset? [ynmpcq?]: x
542 unrecognized response
543 apply changeset? [ynmpcq?]: ?
544 y: yes, transplant this changeset
538 545 n: no, skip this changeset
539 546 m: merge at this changeset
540 547 p: show patch
541 548 c: commit selected changesets
542 549 q: quit and cancel transplant
543 550 ?: ? (show this help)
544 apply changeset? [ynmpcq?]: 4:a53251cdf717
545 apply changeset? [ynmpcq?]: (no-eol)
551 apply changeset? [ynmpcq?]: y
552 4:a53251cdf717
553 apply changeset? [ynmpcq?]: q
546 554 $ hg heads --template "{node|short}\n"
547 555 88be5dde5260
548 556
549 557 $ cd ..
550 558
551 559
552 560 #if unix-permissions system-sh
553 561
554 562 test filter
555 563
556 564 $ hg init filter
557 565 $ cd filter
558 566 $ cat <<'EOF' >test-filter
559 567 > #!/bin/sh
560 568 > sed 's/r1/r2/' $1 > $1.new
561 569 > mv $1.new $1
562 570 > EOF
563 571 $ chmod +x test-filter
564 572 $ hg transplant -s ../t -b tip -a --filter ./test-filter
565 573 filtering * (glob)
566 574 applying 17ab29e464c6
567 575 17ab29e464c6 transplanted to e9ffc54ea104
568 576 filtering * (glob)
569 577 applying 37a1297eb21b
570 578 37a1297eb21b transplanted to 348b36d0b6a5
571 579 filtering * (glob)
572 580 applying 722f4667af76
573 581 722f4667af76 transplanted to 0aa6979afb95
574 582 filtering * (glob)
575 583 applying a53251cdf717
576 584 a53251cdf717 transplanted to 14f8512272b5
577 585 $ hg log --template '{rev} {parents} {desc}\n'
578 586 3 b3
579 587 2 b2
580 588 1 b1
581 589 0 r2
582 590 $ cd ..
583 591
584 592
585 593 test filter with failed patch
586 594
587 595 $ cd filter
588 596 $ hg up 0
589 597 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
590 598 $ echo foo > b1
591 599 $ hg ci -Am foo
592 600 adding b1
593 601 adding test-filter
594 602 created new head
595 603 $ hg transplant 1 --filter ./test-filter
596 604 filtering * (glob)
597 605 applying 348b36d0b6a5
598 606 file b1 already exists
599 607 1 out of 1 hunks FAILED -- saving rejects to file b1.rej
600 608 patch failed to apply
601 609 abort: fix up the merge and run hg transplant --continue
602 610 [255]
603 611 $ cd ..
604 612
605 613 test environment passed to filter
606 614
607 615 $ hg init filter-environment
608 616 $ cd filter-environment
609 617 $ cat <<'EOF' >test-filter-environment
610 618 > #!/bin/sh
611 619 > echo "Transplant by $HGUSER" >> $1
612 620 > echo "Transplant from rev $HGREVISION" >> $1
613 621 > EOF
614 622 $ chmod +x test-filter-environment
615 623 $ hg transplant -s ../t --filter ./test-filter-environment 0
616 624 filtering * (glob)
617 625 applying 17ab29e464c6
618 626 17ab29e464c6 transplanted to 5190e68026a0
619 627
620 628 $ hg log --template '{rev} {parents} {desc}\n'
621 629 0 r1
622 630 Transplant by test
623 631 Transplant from rev 17ab29e464c6ca53e329470efe2a9918ac617a6f
624 632 $ cd ..
625 633
626 634 test transplant with filter handles invalid changelog
627 635
628 636 $ hg init filter-invalid-log
629 637 $ cd filter-invalid-log
630 638 $ cat <<'EOF' >test-filter-invalid-log
631 639 > #!/bin/sh
632 640 > echo "" > $1
633 641 > EOF
634 642 $ chmod +x test-filter-invalid-log
635 643 $ hg transplant -s ../t --filter ./test-filter-invalid-log 0
636 644 filtering * (glob)
637 645 abort: filter corrupted changeset (no user or date)
638 646 [255]
639 647 $ cd ..
640 648
641 649 #endif
642 650
643 651
644 652 test with a win32ext like setup (differing EOLs)
645 653
646 654 $ hg init twin1
647 655 $ cd twin1
648 656 $ echo a > a
649 657 $ echo b > b
650 658 $ echo b >> b
651 659 $ hg ci -Am t
652 660 adding a
653 661 adding b
654 662 $ echo a > b
655 663 $ echo b >> b
656 664 $ hg ci -m changeb
657 665 $ cd ..
658 666
659 667 $ hg init twin2
660 668 $ cd twin2
661 669 $ echo '[patch]' >> .hg/hgrc
662 670 $ echo 'eol = crlf' >> .hg/hgrc
663 671 $ python -c "file('b', 'wb').write('b\r\nb\r\n')"
664 672 $ hg ci -Am addb
665 673 adding b
666 674 $ hg transplant -s ../twin1 tip
667 675 searching for changes
668 676 warning: repository is unrelated
669 677 applying 2e849d776c17
670 678 2e849d776c17 transplanted to 8e65bebc063e
671 679 $ cat b
672 680 a\r (esc)
673 681 b\r (esc)
674 682 $ cd ..
675 683
676 684 test transplant with merge changeset is skipped
677 685
678 686 $ hg init merge1a
679 687 $ cd merge1a
680 688 $ echo a > a
681 689 $ hg ci -Am a
682 690 adding a
683 691 $ hg branch b
684 692 marked working directory as branch b
685 693 (branches are permanent and global, did you want a bookmark?)
686 694 $ hg ci -m branchb
687 695 $ echo b > b
688 696 $ hg ci -Am b
689 697 adding b
690 698 $ hg update default
691 699 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
692 700 $ hg merge b
693 701 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
694 702 (branch merge, don't forget to commit)
695 703 $ hg ci -m mergeb
696 704 $ cd ..
697 705
698 706 $ hg init merge1b
699 707 $ cd merge1b
700 708 $ hg transplant -s ../merge1a tip
701 709 $ cd ..
702 710
703 711 test transplant with merge changeset accepts --parent
704 712
705 713 $ hg init merge2a
706 714 $ cd merge2a
707 715 $ echo a > a
708 716 $ hg ci -Am a
709 717 adding a
710 718 $ hg branch b
711 719 marked working directory as branch b
712 720 (branches are permanent and global, did you want a bookmark?)
713 721 $ hg ci -m branchb
714 722 $ echo b > b
715 723 $ hg ci -Am b
716 724 adding b
717 725 $ hg update default
718 726 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
719 727 $ hg merge b
720 728 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
721 729 (branch merge, don't forget to commit)
722 730 $ hg ci -m mergeb
723 731 $ cd ..
724 732
725 733 $ hg init merge2b
726 734 $ cd merge2b
727 735 $ hg transplant -s ../merge2a --parent 0 tip
728 736 applying be9f9b39483f
729 737 be9f9b39483f transplanted to 9959e51f94d1
730 738 $ cd ..
731 739
732 740 test transplanting a patch turning into a no-op
733 741
734 742 $ hg init binarysource
735 743 $ cd binarysource
736 744 $ echo a > a
737 745 $ hg ci -Am adda a
738 746 >>> file('b', 'wb').write('\0b1')
739 747 $ hg ci -Am addb b
740 748 >>> file('b', 'wb').write('\0b2')
741 749 $ hg ci -m changeb b
742 750 $ cd ..
743 751
744 752 $ hg clone -r0 binarysource binarydest
745 753 adding changesets
746 754 adding manifests
747 755 adding file changes
748 756 added 1 changesets with 1 changes to 1 files
749 757 updating to branch default
750 758 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
751 759 $ cd binarydest
752 760 $ cp ../binarysource/b b
753 761 $ hg ci -Am addb2 b
754 762 $ hg transplant -s ../binarysource 2
755 763 searching for changes
756 764 applying 7a7d57e15850
757 765 skipping emptied changeset 7a7d57e15850
758 766 $ cd ..
759 767
760 768 Explicitly kill daemons to let the test exit on Windows
761 769
762 770 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
763 771
General Comments 0
You need to be logged in to leave comments. Login now