##// END OF EJS Templates
merge with crew
Matt Mackall -
r15524:e7119b09 merge default
parent child Browse files
Show More
@@ -1,1272 +1,1272 b''
1 1 #!/usr/bin/env python
2 2 #
3 3 # run-tests.py - Run a set of tests on Mercurial
4 4 #
5 5 # Copyright 2006 Matt Mackall <mpm@selenic.com>
6 6 #
7 7 # This software may be used and distributed according to the terms of the
8 8 # GNU General Public License version 2 or any later version.
9 9
10 10 # Modifying this script is tricky because it has many modes:
11 11 # - serial (default) vs parallel (-jN, N > 1)
12 12 # - no coverage (default) vs coverage (-c, -C, -s)
13 13 # - temp install (default) vs specific hg script (--with-hg, --local)
14 14 # - tests are a mix of shell scripts and Python scripts
15 15 #
16 16 # If you change this script, it is recommended that you ensure you
17 17 # haven't broken it by running it in various modes with a representative
18 18 # sample of test scripts. For example:
19 19 #
20 20 # 1) serial, no coverage, temp install:
21 21 # ./run-tests.py test-s*
22 22 # 2) serial, no coverage, local hg:
23 23 # ./run-tests.py --local test-s*
24 24 # 3) serial, coverage, temp install:
25 25 # ./run-tests.py -c test-s*
26 26 # 4) serial, coverage, local hg:
27 27 # ./run-tests.py -c --local test-s* # unsupported
28 28 # 5) parallel, no coverage, temp install:
29 29 # ./run-tests.py -j2 test-s*
30 30 # 6) parallel, no coverage, local hg:
31 31 # ./run-tests.py -j2 --local test-s*
32 32 # 7) parallel, coverage, temp install:
33 33 # ./run-tests.py -j2 -c test-s* # currently broken
34 34 # 8) parallel, coverage, local install:
35 35 # ./run-tests.py -j2 -c --local test-s* # unsupported (and broken)
36 36 # 9) parallel, custom tmp dir:
37 37 # ./run-tests.py -j2 --tmpdir /tmp/myhgtests
38 38 #
39 39 # (You could use any subset of the tests: test-s* happens to match
40 40 # enough that it's worth doing parallel runs, few enough that it
41 41 # completes fairly quickly, includes both shell and Python scripts, and
42 42 # includes some scripts that run daemon processes.)
43 43
44 44 from distutils import version
45 45 import difflib
46 46 import errno
47 47 import optparse
48 48 import os
49 49 import shutil
50 50 import subprocess
51 51 import signal
52 52 import sys
53 53 import tempfile
54 54 import time
55 55 import re
56 56 import threading
57 57
58 58 processlock = threading.Lock()
59 59
60 60 closefds = os.name == 'posix'
61 61 def Popen4(cmd, wd, timeout):
62 62 processlock.acquire()
63 63 p = subprocess.Popen(cmd, shell=True, bufsize=-1, cwd=wd,
64 64 close_fds=closefds,
65 65 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
66 66 stderr=subprocess.STDOUT)
67 67 processlock.release()
68 68
69 69 p.fromchild = p.stdout
70 70 p.tochild = p.stdin
71 71 p.childerr = p.stderr
72 72
73 73 p.timeout = False
74 74 if timeout:
75 75 def t():
76 76 start = time.time()
77 77 while time.time() - start < timeout and p.returncode is None:
78 78 time.sleep(1)
79 79 p.timeout = True
80 80 if p.returncode is None:
81 81 terminate(p)
82 82 threading.Thread(target=t).start()
83 83
84 84 return p
85 85
86 86 # reserved exit code to skip test (used by hghave)
87 87 SKIPPED_STATUS = 80
88 88 SKIPPED_PREFIX = 'skipped: '
89 89 FAILED_PREFIX = 'hghave check failed: '
90 90 PYTHON = sys.executable.replace('\\', '/')
91 91 IMPL_PATH = 'PYTHONPATH'
92 92 if 'java' in sys.platform:
93 93 IMPL_PATH = 'JYTHONPATH'
94 94
95 95 requiredtools = ["python", "diff", "grep", "unzip", "gunzip", "bunzip2", "sed"]
96 96
97 97 defaults = {
98 98 'jobs': ('HGTEST_JOBS', 1),
99 99 'timeout': ('HGTEST_TIMEOUT', 180),
100 100 'port': ('HGTEST_PORT', 20059),
101 101 'shell': ('HGTEST_SHELL', '/bin/sh'),
102 102 }
103 103
104 104 def parselistfiles(files, listtype, warn=True):
105 105 entries = dict()
106 106 for filename in files:
107 107 try:
108 108 path = os.path.expanduser(os.path.expandvars(filename))
109 109 f = open(path, "r")
110 110 except IOError, err:
111 111 if err.errno != errno.ENOENT:
112 112 raise
113 113 if warn:
114 114 print "warning: no such %s file: %s" % (listtype, filename)
115 115 continue
116 116
117 117 for line in f.readlines():
118 118 line = line.split('#', 1)[0].strip()
119 119 if line:
120 120 entries[line] = filename
121 121
122 122 f.close()
123 123 return entries
124 124
125 125 def parseargs():
126 126 parser = optparse.OptionParser("%prog [options] [tests]")
127 127
128 128 # keep these sorted
129 129 parser.add_option("--blacklist", action="append",
130 130 help="skip tests listed in the specified blacklist file")
131 131 parser.add_option("--whitelist", action="append",
132 132 help="always run tests listed in the specified whitelist file")
133 133 parser.add_option("-C", "--annotate", action="store_true",
134 134 help="output files annotated with coverage")
135 135 parser.add_option("--child", type="int",
136 136 help="run as child process, summary to given fd")
137 137 parser.add_option("-c", "--cover", action="store_true",
138 138 help="print a test coverage report")
139 139 parser.add_option("-d", "--debug", action="store_true",
140 140 help="debug mode: write output of test scripts to console"
141 141 " rather than capturing and diff'ing it (disables timeout)")
142 142 parser.add_option("-f", "--first", action="store_true",
143 143 help="exit on the first test failure")
144 144 parser.add_option("--inotify", action="store_true",
145 145 help="enable inotify extension when running tests")
146 146 parser.add_option("-i", "--interactive", action="store_true",
147 147 help="prompt to accept changed output")
148 148 parser.add_option("-j", "--jobs", type="int",
149 149 help="number of jobs to run in parallel"
150 150 " (default: $%s or %d)" % defaults['jobs'])
151 151 parser.add_option("--keep-tmpdir", action="store_true",
152 152 help="keep temporary directory after running tests")
153 153 parser.add_option("-k", "--keywords",
154 154 help="run tests matching keywords")
155 155 parser.add_option("-l", "--local", action="store_true",
156 156 help="shortcut for --with-hg=<testdir>/../hg")
157 157 parser.add_option("-n", "--nodiff", action="store_true",
158 158 help="skip showing test changes")
159 159 parser.add_option("-p", "--port", type="int",
160 160 help="port on which servers should listen"
161 161 " (default: $%s or %d)" % defaults['port'])
162 162 parser.add_option("--pure", action="store_true",
163 163 help="use pure Python code instead of C extensions")
164 164 parser.add_option("-R", "--restart", action="store_true",
165 165 help="restart at last error")
166 166 parser.add_option("-r", "--retest", action="store_true",
167 167 help="retest failed tests")
168 168 parser.add_option("-S", "--noskips", action="store_true",
169 169 help="don't report skip tests verbosely")
170 170 parser.add_option("--shell", type="string",
171 171 help="shell to use (default: $%s or %s)" % defaults['shell'])
172 172 parser.add_option("-t", "--timeout", type="int",
173 173 help="kill errant tests after TIMEOUT seconds"
174 174 " (default: $%s or %d)" % defaults['timeout'])
175 175 parser.add_option("--tmpdir", type="string",
176 176 help="run tests in the given temporary directory"
177 177 " (implies --keep-tmpdir)")
178 178 parser.add_option("-v", "--verbose", action="store_true",
179 179 help="output verbose messages")
180 180 parser.add_option("--view", type="string",
181 181 help="external diff viewer")
182 182 parser.add_option("--with-hg", type="string",
183 183 metavar="HG",
184 184 help="test using specified hg script rather than a "
185 185 "temporary installation")
186 186 parser.add_option("-3", "--py3k-warnings", action="store_true",
187 187 help="enable Py3k warnings on Python 2.6+")
188 188 parser.add_option('--extra-config-opt', action="append",
189 189 help='set the given config opt in the test hgrc')
190 190
191 191 for option, (envvar, default) in defaults.items():
192 192 defaults[option] = type(default)(os.environ.get(envvar, default))
193 193 parser.set_defaults(**defaults)
194 194 (options, args) = parser.parse_args()
195 195
196 196 # jython is always pure
197 197 if 'java' in sys.platform or '__pypy__' in sys.modules:
198 198 options.pure = True
199 199
200 200 if options.with_hg:
201 201 if not (os.path.isfile(options.with_hg) and
202 202 os.access(options.with_hg, os.X_OK)):
203 203 parser.error('--with-hg must specify an executable hg script')
204 204 if not os.path.basename(options.with_hg) == 'hg':
205 205 sys.stderr.write('warning: --with-hg should specify an hg script\n')
206 206 if options.local:
207 207 testdir = os.path.dirname(os.path.realpath(sys.argv[0]))
208 208 hgbin = os.path.join(os.path.dirname(testdir), 'hg')
209 209 if not os.access(hgbin, os.X_OK):
210 210 parser.error('--local specified, but %r not found or not executable'
211 211 % hgbin)
212 212 options.with_hg = hgbin
213 213
214 214 options.anycoverage = options.cover or options.annotate
215 215 if options.anycoverage:
216 216 try:
217 217 import coverage
218 218 covver = version.StrictVersion(coverage.__version__).version
219 219 if covver < (3, 3):
220 220 parser.error('coverage options require coverage 3.3 or later')
221 221 except ImportError:
222 222 parser.error('coverage options now require the coverage package')
223 223
224 224 if options.anycoverage and options.local:
225 225 # this needs some path mangling somewhere, I guess
226 226 parser.error("sorry, coverage options do not work when --local "
227 227 "is specified")
228 228
229 229 global vlog
230 230 if options.verbose:
231 231 if options.jobs > 1 or options.child is not None:
232 232 pid = "[%d]" % os.getpid()
233 233 else:
234 234 pid = None
235 235 def vlog(*msg):
236 236 iolock.acquire()
237 237 if pid:
238 238 print pid,
239 239 for m in msg:
240 240 print m,
241 241 print
242 242 sys.stdout.flush()
243 243 iolock.release()
244 244 else:
245 245 vlog = lambda *msg: None
246 246
247 247 if options.tmpdir:
248 248 options.tmpdir = os.path.expanduser(options.tmpdir)
249 249
250 250 if options.jobs < 1:
251 251 parser.error('--jobs must be positive')
252 252 if options.interactive and options.jobs > 1:
253 253 print '(--interactive overrides --jobs)'
254 254 options.jobs = 1
255 255 if options.interactive and options.debug:
256 256 parser.error("-i/--interactive and -d/--debug are incompatible")
257 257 if options.debug:
258 258 if options.timeout != defaults['timeout']:
259 259 sys.stderr.write(
260 260 'warning: --timeout option ignored with --debug\n')
261 261 options.timeout = 0
262 262 if options.py3k_warnings:
263 263 if sys.version_info[:2] < (2, 6) or sys.version_info[:2] >= (3, 0):
264 264 parser.error('--py3k-warnings can only be used on Python 2.6+')
265 265 if options.blacklist:
266 266 options.blacklist = parselistfiles(options.blacklist, 'blacklist')
267 267 if options.whitelist:
268 268 options.whitelisted = parselistfiles(options.whitelist, 'whitelist',
269 269 warn=options.child is None)
270 270 else:
271 271 options.whitelisted = {}
272 272
273 273 return (options, args)
274 274
275 275 def rename(src, dst):
276 276 """Like os.rename(), trade atomicity and opened files friendliness
277 277 for existing destination support.
278 278 """
279 279 shutil.copy(src, dst)
280 280 os.remove(src)
281 281
282 282 def splitnewlines(text):
283 283 '''like str.splitlines, but only split on newlines.
284 284 keep line endings.'''
285 285 i = 0
286 286 lines = []
287 287 while True:
288 288 n = text.find('\n', i)
289 289 if n == -1:
290 290 last = text[i:]
291 291 if last:
292 292 lines.append(last)
293 293 return lines
294 294 lines.append(text[i:n + 1])
295 295 i = n + 1
296 296
297 297 def parsehghaveoutput(lines):
298 298 '''Parse hghave log lines.
299 299 Return tuple of lists (missing, failed):
300 300 * the missing/unknown features
301 301 * the features for which existence check failed'''
302 302 missing = []
303 303 failed = []
304 304 for line in lines:
305 305 if line.startswith(SKIPPED_PREFIX):
306 306 line = line.splitlines()[0]
307 307 missing.append(line[len(SKIPPED_PREFIX):])
308 308 elif line.startswith(FAILED_PREFIX):
309 309 line = line.splitlines()[0]
310 310 failed.append(line[len(FAILED_PREFIX):])
311 311
312 312 return missing, failed
313 313
314 314 def showdiff(expected, output, ref, err):
315 315 print
316 316 for line in difflib.unified_diff(expected, output, ref, err):
317 317 sys.stdout.write(line)
318 318
319 319 def findprogram(program):
320 320 """Search PATH for a executable program"""
321 321 for p in os.environ.get('PATH', os.defpath).split(os.pathsep):
322 322 name = os.path.join(p, program)
323 323 if os.name == 'nt' or os.access(name, os.X_OK):
324 324 return name
325 325 return None
326 326
327 327 def checktools():
328 328 # Before we go any further, check for pre-requisite tools
329 329 # stuff from coreutils (cat, rm, etc) are not tested
330 330 for p in requiredtools:
331 331 if os.name == 'nt':
332 332 p += '.exe'
333 333 found = findprogram(p)
334 334 if found:
335 335 vlog("# Found prerequisite", p, "at", found)
336 336 else:
337 337 print "WARNING: Did not find prerequisite tool: "+p
338 338
339 339 def terminate(proc):
340 340 """Terminate subprocess (with fallback for Python versions < 2.6)"""
341 341 vlog('# Terminating process %d' % proc.pid)
342 342 try:
343 343 getattr(proc, 'terminate', lambda : os.kill(proc.pid, signal.SIGTERM))()
344 344 except OSError:
345 345 pass
346 346
347 347 def killdaemons():
348 348 # Kill off any leftover daemon processes
349 349 try:
350 350 fp = open(DAEMON_PIDS)
351 351 for line in fp:
352 352 try:
353 353 pid = int(line)
354 354 except ValueError:
355 355 continue
356 356 try:
357 357 os.kill(pid, 0)
358 358 vlog('# Killing daemon process %d' % pid)
359 359 os.kill(pid, signal.SIGTERM)
360 360 time.sleep(0.25)
361 361 os.kill(pid, 0)
362 362 vlog('# Daemon process %d is stuck - really killing it' % pid)
363 363 os.kill(pid, signal.SIGKILL)
364 364 except OSError, err:
365 365 if err.errno != errno.ESRCH:
366 366 raise
367 367 fp.close()
368 368 os.unlink(DAEMON_PIDS)
369 369 except IOError:
370 370 pass
371 371
372 372 def cleanup(options):
373 373 if not options.keep_tmpdir:
374 374 vlog("# Cleaning up HGTMP", HGTMP)
375 375 shutil.rmtree(HGTMP, True)
376 376
377 377 def usecorrectpython():
378 378 # some tests run python interpreter. they must use same
379 379 # interpreter we use or bad things will happen.
380 380 exedir, exename = os.path.split(sys.executable)
381 381 if exename in ('python', 'python.exe'):
382 382 path = findprogram(exename)
383 383 if os.path.dirname(path) == exedir:
384 384 return
385 385 else:
386 386 exename = 'python'
387 387 vlog('# Making python executable in test path use correct Python')
388 388 mypython = os.path.join(BINDIR, exename)
389 389 try:
390 390 os.symlink(sys.executable, mypython)
391 391 except AttributeError:
392 392 # windows fallback
393 393 shutil.copyfile(sys.executable, mypython)
394 394 shutil.copymode(sys.executable, mypython)
395 395
396 396 def installhg(options):
397 397 vlog("# Performing temporary installation of HG")
398 398 installerrs = os.path.join("tests", "install.err")
399 399 pure = options.pure and "--pure" or ""
400 400
401 401 # Run installer in hg root
402 402 script = os.path.realpath(sys.argv[0])
403 403 hgroot = os.path.dirname(os.path.dirname(script))
404 404 os.chdir(hgroot)
405 405 nohome = '--home=""'
406 406 if os.name == 'nt':
407 407 # The --home="" trick works only on OS where os.sep == '/'
408 408 # because of a distutils convert_path() fast-path. Avoid it at
409 409 # least on Windows for now, deal with .pydistutils.cfg bugs
410 410 # when they happen.
411 411 nohome = ''
412 412 cmd = ('%s setup.py %s clean --all'
413 413 ' build --build-base="%s"'
414 414 ' install --force --prefix="%s" --install-lib="%s"'
415 415 ' --install-scripts="%s" %s >%s 2>&1'
416 416 % (sys.executable, pure, os.path.join(HGTMP, "build"),
417 417 INST, PYTHONDIR, BINDIR, nohome, installerrs))
418 418 vlog("# Running", cmd)
419 419 if os.system(cmd) == 0:
420 420 if not options.verbose:
421 421 os.remove(installerrs)
422 422 else:
423 423 f = open(installerrs)
424 424 for line in f:
425 425 print line,
426 426 f.close()
427 427 sys.exit(1)
428 428 os.chdir(TESTDIR)
429 429
430 430 usecorrectpython()
431 431
432 432 vlog("# Installing dummy diffstat")
433 433 f = open(os.path.join(BINDIR, 'diffstat'), 'w')
434 434 f.write('#!' + sys.executable + '\n'
435 435 'import sys\n'
436 436 'files = 0\n'
437 437 'for line in sys.stdin:\n'
438 438 ' if line.startswith("diff "):\n'
439 439 ' files += 1\n'
440 440 'sys.stdout.write("files patched: %d\\n" % files)\n')
441 441 f.close()
442 442 os.chmod(os.path.join(BINDIR, 'diffstat'), 0700)
443 443
444 444 if options.py3k_warnings and not options.anycoverage:
445 445 vlog("# Updating hg command to enable Py3k Warnings switch")
446 446 f = open(os.path.join(BINDIR, 'hg'), 'r')
447 447 lines = [line.rstrip() for line in f]
448 448 lines[0] += ' -3'
449 449 f.close()
450 450 f = open(os.path.join(BINDIR, 'hg'), 'w')
451 451 for line in lines:
452 452 f.write(line + '\n')
453 453 f.close()
454 454
455 455 hgbat = os.path.join(BINDIR, 'hg.bat')
456 456 if os.path.isfile(hgbat):
457 457 # hg.bat expects to be put in bin/scripts while run-tests.py
458 458 # installation layout put it in bin/ directly. Fix it
459 459 f = open(hgbat, 'rb')
460 460 data = f.read()
461 461 f.close()
462 462 if '"%~dp0..\python" "%~dp0hg" %*' in data:
463 463 data = data.replace('"%~dp0..\python" "%~dp0hg" %*',
464 464 '"%~dp0python" "%~dp0hg" %*')
465 465 f = open(hgbat, 'wb')
466 466 f.write(data)
467 467 f.close()
468 468 else:
469 469 print 'WARNING: cannot fix hg.bat reference to python.exe'
470 470
471 471 if options.anycoverage:
472 472 custom = os.path.join(TESTDIR, 'sitecustomize.py')
473 473 target = os.path.join(PYTHONDIR, 'sitecustomize.py')
474 474 vlog('# Installing coverage trigger to %s' % target)
475 475 shutil.copyfile(custom, target)
476 476 rc = os.path.join(TESTDIR, '.coveragerc')
477 477 vlog('# Installing coverage rc to %s' % rc)
478 478 os.environ['COVERAGE_PROCESS_START'] = rc
479 479 fn = os.path.join(INST, '..', '.coverage')
480 480 os.environ['COVERAGE_FILE'] = fn
481 481
482 482 def outputcoverage(options):
483 483
484 484 vlog('# Producing coverage report')
485 485 os.chdir(PYTHONDIR)
486 486
487 487 def covrun(*args):
488 488 cmd = 'coverage %s' % ' '.join(args)
489 489 vlog('# Running: %s' % cmd)
490 490 os.system(cmd)
491 491
492 492 if options.child:
493 493 return
494 494
495 495 covrun('-c')
496 496 omit = ','.join([BINDIR, TESTDIR])
497 497 covrun('-i', '-r', '"--omit=%s"' % omit) # report
498 498 if options.annotate:
499 499 adir = os.path.join(TESTDIR, 'annotated')
500 500 if not os.path.isdir(adir):
501 501 os.mkdir(adir)
502 502 covrun('-i', '-a', '"--directory=%s"' % adir, '"--omit=%s"' % omit)
503 503
504 504 def pytest(test, wd, options, replacements):
505 505 py3kswitch = options.py3k_warnings and ' -3' or ''
506 506 cmd = '%s%s "%s"' % (PYTHON, py3kswitch, test)
507 507 vlog("# Running", cmd)
508 508 return run(cmd, wd, options, replacements)
509 509
510 510 def shtest(test, wd, options, replacements):
511 cmd = '"%s"' % test
511 cmd = '%s "%s"' % (options.shell, test)
512 512 vlog("# Running", cmd)
513 513 return run(cmd, wd, options, replacements)
514 514
515 515 needescape = re.compile(r'[\x00-\x08\x0b-\x1f\x7f-\xff]').search
516 516 escapesub = re.compile(r'[\x00-\x08\x0b-\x1f\\\x7f-\xff]').sub
517 517 escapemap = dict((chr(i), r'\x%02x' % i) for i in range(256))
518 518 escapemap.update({'\\': '\\\\', '\r': r'\r'})
519 519 def escapef(m):
520 520 return escapemap[m.group(0)]
521 521 def stringescape(s):
522 522 return escapesub(escapef, s)
523 523
524 524 def rematch(el, l):
525 525 try:
526 526 # ensure that the regex matches to the end of the string
527 527 return re.match(el + r'\Z', l)
528 528 except re.error:
529 529 # el is an invalid regex
530 530 return False
531 531
532 532 def globmatch(el, l):
533 533 # The only supported special characters are * and ? plus / which also
534 534 # matches \ on windows. Escaping of these caracters is supported.
535 535 i, n = 0, len(el)
536 536 res = ''
537 537 while i < n:
538 538 c = el[i]
539 539 i += 1
540 540 if c == '\\' and el[i] in '*?\\/':
541 541 res += el[i - 1:i + 1]
542 542 i += 1
543 543 elif c == '*':
544 544 res += '.*'
545 545 elif c == '?':
546 546 res += '.'
547 547 elif c == '/' and os.name == 'nt':
548 548 res += '[/\\\\]'
549 549 else:
550 550 res += re.escape(c)
551 551 return rematch(res, l)
552 552
553 553 def linematch(el, l):
554 554 if el == l: # perfect match (fast)
555 555 return True
556 556 if (el and
557 557 (el.endswith(" (re)\n") and rematch(el[:-6] + '\n', l) or
558 558 el.endswith(" (glob)\n") and globmatch(el[:-8] + '\n', l) or
559 559 el.endswith(" (esc)\n") and
560 560 (el[:-7].decode('string-escape') + '\n' == l or
561 561 el[:-7].decode('string-escape').replace('\r', '') +
562 562 '\n' == l and os.name == 'nt'))):
563 563 return True
564 564 return False
565 565
566 566 def tsttest(test, wd, options, replacements):
567 567 # We generate a shell script which outputs unique markers to line
568 568 # up script results with our source. These markers include input
569 569 # line number and the last return code
570 570 salt = "SALT" + str(time.time())
571 571 def addsalt(line, inpython):
572 572 if inpython:
573 573 script.append('%s %d 0\n' % (salt, line))
574 574 else:
575 575 script.append('echo %s %s $?\n' % (salt, line))
576 576
577 577 # After we run the shell script, we re-unify the script output
578 578 # with non-active parts of the source, with synchronization by our
579 579 # SALT line number markers. The after table contains the
580 580 # non-active components, ordered by line number
581 581 after = {}
582 582 pos = prepos = -1
583 583
584 584 # Expected shellscript output
585 585 expected = {}
586 586
587 587 # We keep track of whether or not we're in a Python block so we
588 588 # can generate the surrounding doctest magic
589 589 inpython = False
590 590
591 591 f = open(test)
592 592 t = f.readlines()
593 593 f.close()
594 594
595 595 script = []
596 596 for n, l in enumerate(t):
597 597 if not l.endswith('\n'):
598 598 l += '\n'
599 599 if l.startswith(' >>> '): # python inlines
600 600 after.setdefault(pos, []).append(l)
601 601 prepos = pos
602 602 pos = n
603 603 if not inpython:
604 604 # we've just entered a Python block, add the header
605 605 inpython = True
606 606 addsalt(prepos, False) # make sure we report the exit code
607 607 script.append('%s -m heredoctest <<EOF\n' % PYTHON)
608 608 addsalt(n, True)
609 609 script.append(l[2:])
610 610 if l.startswith(' ... '): # python inlines
611 611 after.setdefault(prepos, []).append(l)
612 612 script.append(l[2:])
613 613 elif l.startswith(' $ '): # commands
614 614 if inpython:
615 615 script.append("EOF\n")
616 616 inpython = False
617 617 after.setdefault(pos, []).append(l)
618 618 prepos = pos
619 619 pos = n
620 620 addsalt(n, False)
621 621 script.append(l[4:])
622 622 elif l.startswith(' > '): # continuations
623 623 after.setdefault(prepos, []).append(l)
624 624 script.append(l[4:])
625 625 elif l.startswith(' '): # results
626 626 # queue up a list of expected results
627 627 expected.setdefault(pos, []).append(l[2:])
628 628 else:
629 629 if inpython:
630 630 script.append("EOF\n")
631 631 inpython = False
632 632 # non-command/result - queue up for merged output
633 633 after.setdefault(pos, []).append(l)
634 634
635 635 if inpython:
636 636 script.append("EOF\n")
637 637 addsalt(n + 1, False)
638 638
639 639 # Write out the script and execute it
640 640 fd, name = tempfile.mkstemp(suffix='hg-tst')
641 641 try:
642 642 for l in script:
643 643 os.write(fd, l)
644 644 os.close(fd)
645 645
646 646 cmd = '%s "%s"' % (options.shell, name)
647 647 vlog("# Running", cmd)
648 648 exitcode, output = run(cmd, wd, options, replacements)
649 649 # do not merge output if skipped, return hghave message instead
650 650 # similarly, with --debug, output is None
651 651 if exitcode == SKIPPED_STATUS or output is None:
652 652 return exitcode, output
653 653 finally:
654 654 os.remove(name)
655 655
656 656 # Merge the script output back into a unified test
657 657
658 658 pos = -1
659 659 postout = []
660 660 ret = 0
661 661 for n, l in enumerate(output):
662 662 lout, lcmd = l, None
663 663 if salt in l:
664 664 lout, lcmd = l.split(salt, 1)
665 665
666 666 if lout:
667 667 if lcmd:
668 668 # output block had no trailing newline, clean up
669 669 lout += ' (no-eol)\n'
670 670
671 671 # find the expected output at the current position
672 672 el = None
673 673 if pos in expected and expected[pos]:
674 674 el = expected[pos].pop(0)
675 675
676 676 if linematch(el, lout):
677 677 postout.append(" " + el)
678 678 else:
679 679 if needescape(lout):
680 680 lout = stringescape(lout.rstrip('\n')) + " (esc)\n"
681 681 postout.append(" " + lout) # let diff deal with it
682 682
683 683 if lcmd:
684 684 # add on last return code
685 685 ret = int(lcmd.split()[1])
686 686 if ret != 0:
687 687 postout.append(" [%s]\n" % ret)
688 688 if pos in after:
689 689 # merge in non-active test bits
690 690 postout += after.pop(pos)
691 691 pos = int(lcmd.split()[0])
692 692
693 693 if pos in after:
694 694 postout += after.pop(pos)
695 695
696 696 return exitcode, postout
697 697
698 698 wifexited = getattr(os, "WIFEXITED", lambda x: False)
699 699 def run(cmd, wd, options, replacements):
700 700 """Run command in a sub-process, capturing the output (stdout and stderr).
701 701 Return a tuple (exitcode, output). output is None in debug mode."""
702 702 # TODO: Use subprocess.Popen if we're running on Python 2.4
703 703 if options.debug:
704 704 proc = subprocess.Popen(cmd, shell=True, cwd=wd)
705 705 ret = proc.wait()
706 706 return (ret, None)
707 707
708 708 proc = Popen4(cmd, wd, options.timeout)
709 709 def cleanup():
710 710 terminate(proc)
711 711 ret = proc.wait()
712 712 if ret == 0:
713 713 ret = signal.SIGTERM << 8
714 714 killdaemons()
715 715 return ret
716 716
717 717 output = ''
718 718 proc.tochild.close()
719 719
720 720 try:
721 721 output = proc.fromchild.read()
722 722 except KeyboardInterrupt:
723 723 vlog('# Handling keyboard interrupt')
724 724 cleanup()
725 725 raise
726 726
727 727 ret = proc.wait()
728 728 if wifexited(ret):
729 729 ret = os.WEXITSTATUS(ret)
730 730
731 731 if proc.timeout:
732 732 ret = 'timeout'
733 733
734 734 if ret:
735 735 killdaemons()
736 736
737 737 for s, r in replacements:
738 738 output = re.sub(s, r, output)
739 739 return ret, splitnewlines(output)
740 740
741 741 def runone(options, test):
742 742 '''tristate output:
743 743 None -> skipped
744 744 True -> passed
745 745 False -> failed'''
746 746
747 747 global results, resultslock, iolock
748 748
749 749 testpath = os.path.join(TESTDIR, test)
750 750
751 751 def result(l, e):
752 752 resultslock.acquire()
753 753 results[l].append(e)
754 754 resultslock.release()
755 755
756 756 def skip(msg):
757 757 if not options.verbose:
758 758 result('s', (test, msg))
759 759 else:
760 760 iolock.acquire()
761 761 print "\nSkipping %s: %s" % (testpath, msg)
762 762 iolock.release()
763 763 return None
764 764
765 765 def fail(msg, ret):
766 766 if not options.nodiff:
767 767 iolock.acquire()
768 768 print "\nERROR: %s %s" % (testpath, msg)
769 769 iolock.release()
770 770 if (not ret and options.interactive
771 771 and os.path.exists(testpath + ".err")):
772 772 iolock.acquire()
773 773 print "Accept this change? [n] ",
774 774 answer = sys.stdin.readline().strip()
775 775 iolock.release()
776 776 if answer.lower() in "y yes".split():
777 777 if test.endswith(".t"):
778 778 rename(testpath + ".err", testpath)
779 779 else:
780 780 rename(testpath + ".err", testpath + ".out")
781 781 result('p', test)
782 782 return
783 783 result('f', (test, msg))
784 784
785 785 def success():
786 786 result('p', test)
787 787
788 788 def ignore(msg):
789 789 result('i', (test, msg))
790 790
791 791 if (os.path.basename(test).startswith("test-") and '~' not in test and
792 792 ('.' not in test or test.endswith('.py') or
793 793 test.endswith('.bat') or test.endswith('.t'))):
794 794 if not os.path.exists(test):
795 795 skip("doesn't exist")
796 796 return None
797 797 else:
798 798 vlog('# Test file', test, 'not supported, ignoring')
799 799 return None # not a supported test, don't record
800 800
801 801 if not (options.whitelisted and test in options.whitelisted):
802 802 if options.blacklist and test in options.blacklist:
803 803 skip("blacklisted")
804 804 return None
805 805
806 806 if options.retest and not os.path.exists(test + ".err"):
807 807 ignore("not retesting")
808 808 return None
809 809
810 810 if options.keywords:
811 811 fp = open(test)
812 812 t = fp.read().lower() + test.lower()
813 813 fp.close()
814 814 for k in options.keywords.lower().split():
815 815 if k in t:
816 816 break
817 817 else:
818 818 ignore("doesn't match keyword")
819 819 return None
820 820
821 821 vlog("# Test", test)
822 822
823 823 # create a fresh hgrc
824 824 hgrc = open(HGRCPATH, 'w+')
825 825 hgrc.write('[ui]\n')
826 826 hgrc.write('slash = True\n')
827 827 hgrc.write('[defaults]\n')
828 828 hgrc.write('backout = -d "0 0"\n')
829 829 hgrc.write('commit = -d "0 0"\n')
830 830 hgrc.write('tag = -d "0 0"\n')
831 831 if options.inotify:
832 832 hgrc.write('[extensions]\n')
833 833 hgrc.write('inotify=\n')
834 834 hgrc.write('[inotify]\n')
835 835 hgrc.write('pidfile=%s\n' % DAEMON_PIDS)
836 836 hgrc.write('appendpid=True\n')
837 837 if options.extra_config_opt:
838 838 for opt in options.extra_config_opt:
839 839 section, key = opt.split('.', 1)
840 840 assert '=' in key, ('extra config opt %s must '
841 841 'have an = for assignment' % opt)
842 842 hgrc.write('[%s]\n%s\n' % (section, key))
843 843 hgrc.close()
844 844
845 845 ref = os.path.join(TESTDIR, test+".out")
846 846 err = os.path.join(TESTDIR, test+".err")
847 847 if os.path.exists(err):
848 848 os.remove(err) # Remove any previous output files
849 849 try:
850 850 tf = open(testpath)
851 851 firstline = tf.readline().rstrip()
852 852 tf.close()
853 853 except:
854 854 firstline = ''
855 855 lctest = test.lower()
856 856
857 857 if lctest.endswith('.py') or firstline == '#!/usr/bin/env python':
858 858 runner = pytest
859 859 elif lctest.endswith('.t'):
860 860 runner = tsttest
861 861 ref = testpath
862 862 else:
863 863 # do not try to run non-executable programs
864 864 if not os.access(testpath, os.X_OK):
865 865 return skip("not executable")
866 866 runner = shtest
867 867
868 868 # Make a tmp subdirectory to work in
869 869 testtmp = os.environ["TESTTMP"] = os.environ["HOME"] = \
870 870 os.path.join(HGTMP, os.path.basename(test)).replace('\\', '/')
871 871
872 872 replacements = [
873 873 (r':%s\b' % options.port, ':$HGPORT'),
874 874 (r':%s\b' % (options.port + 1), ':$HGPORT1'),
875 875 (r':%s\b' % (options.port + 2), ':$HGPORT2'),
876 876 ]
877 877 if os.name == 'nt':
878 878 replacements.append((r'\r\n', '\n'))
879 879 replacements.append(
880 880 (''.join(c.isalpha() and '[%s%s]' % (c.lower(), c.upper()) or
881 881 c in '/\\' and r'[/\\]' or
882 882 c.isdigit() and c or
883 883 '\\' + c
884 884 for c in testtmp), '$TESTTMP'))
885 885 else:
886 886 replacements.append((re.escape(testtmp), '$TESTTMP'))
887 887
888 888 os.mkdir(testtmp)
889 889 ret, out = runner(testpath, testtmp, options, replacements)
890 890 vlog("# Ret was:", ret)
891 891
892 892 mark = '.'
893 893
894 894 skipped = (ret == SKIPPED_STATUS)
895 895
896 896 # If we're not in --debug mode and reference output file exists,
897 897 # check test output against it.
898 898 if options.debug:
899 899 refout = None # to match "out is None"
900 900 elif os.path.exists(ref):
901 901 f = open(ref, "r")
902 902 refout = list(splitnewlines(f.read()))
903 903 f.close()
904 904 else:
905 905 refout = []
906 906
907 907 if (ret != 0 or out != refout) and not skipped and not options.debug:
908 908 # Save errors to a file for diagnosis
909 909 f = open(err, "wb")
910 910 for line in out:
911 911 f.write(line)
912 912 f.close()
913 913
914 914 if skipped:
915 915 mark = 's'
916 916 if out is None: # debug mode: nothing to parse
917 917 missing = ['unknown']
918 918 failed = None
919 919 else:
920 920 missing, failed = parsehghaveoutput(out)
921 921 if not missing:
922 922 missing = ['irrelevant']
923 923 if failed:
924 924 fail("hghave failed checking for %s" % failed[-1], ret)
925 925 skipped = False
926 926 else:
927 927 skip(missing[-1])
928 928 elif ret == 'timeout':
929 929 mark = 't'
930 930 fail("timed out", ret)
931 931 elif out != refout:
932 932 mark = '!'
933 933 if not options.nodiff:
934 934 iolock.acquire()
935 935 if options.view:
936 936 os.system("%s %s %s" % (options.view, ref, err))
937 937 else:
938 938 showdiff(refout, out, ref, err)
939 939 iolock.release()
940 940 if ret:
941 941 fail("output changed and returned error code %d" % ret, ret)
942 942 else:
943 943 fail("output changed", ret)
944 944 ret = 1
945 945 elif ret:
946 946 mark = '!'
947 947 fail("returned error code %d" % ret, ret)
948 948 else:
949 949 success()
950 950
951 951 if not options.verbose:
952 952 iolock.acquire()
953 953 sys.stdout.write(mark)
954 954 sys.stdout.flush()
955 955 iolock.release()
956 956
957 957 killdaemons()
958 958
959 959 if not options.keep_tmpdir:
960 960 shutil.rmtree(testtmp, True)
961 961 if skipped:
962 962 return None
963 963 return ret == 0
964 964
965 965 _hgpath = None
966 966
967 967 def _gethgpath():
968 968 """Return the path to the mercurial package that is actually found by
969 969 the current Python interpreter."""
970 970 global _hgpath
971 971 if _hgpath is not None:
972 972 return _hgpath
973 973
974 974 cmd = '%s -c "import mercurial; print mercurial.__path__[0]"'
975 975 pipe = os.popen(cmd % PYTHON)
976 976 try:
977 977 _hgpath = pipe.read().strip()
978 978 finally:
979 979 pipe.close()
980 980 return _hgpath
981 981
982 982 def _checkhglib(verb):
983 983 """Ensure that the 'mercurial' package imported by python is
984 984 the one we expect it to be. If not, print a warning to stderr."""
985 985 expecthg = os.path.join(PYTHONDIR, 'mercurial')
986 986 actualhg = _gethgpath()
987 987 if os.path.abspath(actualhg) != os.path.abspath(expecthg):
988 988 sys.stderr.write('warning: %s with unexpected mercurial lib: %s\n'
989 989 ' (expected %s)\n'
990 990 % (verb, actualhg, expecthg))
991 991
992 992 def runchildren(options, tests):
993 993 if INST:
994 994 installhg(options)
995 995 _checkhglib("Testing")
996 996
997 997 optcopy = dict(options.__dict__)
998 998 optcopy['jobs'] = 1
999 999
1000 1000 # Because whitelist has to override keyword matches, we have to
1001 1001 # actually load the whitelist in the children as well, so we allow
1002 1002 # the list of whitelist files to pass through and be parsed in the
1003 1003 # children, but not the dict of whitelisted tests resulting from
1004 1004 # the parse, used here to override blacklisted tests.
1005 1005 whitelist = optcopy['whitelisted'] or []
1006 1006 del optcopy['whitelisted']
1007 1007
1008 1008 blacklist = optcopy['blacklist'] or []
1009 1009 del optcopy['blacklist']
1010 1010 blacklisted = []
1011 1011
1012 1012 if optcopy['with_hg'] is None:
1013 1013 optcopy['with_hg'] = os.path.join(BINDIR, "hg")
1014 1014 optcopy.pop('anycoverage', None)
1015 1015
1016 1016 opts = []
1017 1017 for opt, value in optcopy.iteritems():
1018 1018 name = '--' + opt.replace('_', '-')
1019 1019 if value is True:
1020 1020 opts.append(name)
1021 1021 elif isinstance(value, list):
1022 1022 for v in value:
1023 1023 opts.append(name + '=' + str(v))
1024 1024 elif value is not None:
1025 1025 opts.append(name + '=' + str(value))
1026 1026
1027 1027 tests.reverse()
1028 1028 jobs = [[] for j in xrange(options.jobs)]
1029 1029 while tests:
1030 1030 for job in jobs:
1031 1031 if not tests:
1032 1032 break
1033 1033 test = tests.pop()
1034 1034 if test not in whitelist and test in blacklist:
1035 1035 blacklisted.append(test)
1036 1036 else:
1037 1037 job.append(test)
1038 1038 fps = {}
1039 1039
1040 1040 for j, job in enumerate(jobs):
1041 1041 if not job:
1042 1042 continue
1043 1043 rfd, wfd = os.pipe()
1044 1044 childopts = ['--child=%d' % wfd, '--port=%d' % (options.port + j * 3)]
1045 1045 childtmp = os.path.join(HGTMP, 'child%d' % j)
1046 1046 childopts += ['--tmpdir', childtmp]
1047 1047 cmdline = [PYTHON, sys.argv[0]] + opts + childopts + job
1048 1048 vlog(' '.join(cmdline))
1049 1049 fps[os.spawnvp(os.P_NOWAIT, cmdline[0], cmdline)] = os.fdopen(rfd, 'r')
1050 1050 os.close(wfd)
1051 1051 signal.signal(signal.SIGINT, signal.SIG_IGN)
1052 1052 failures = 0
1053 1053 tested, skipped, failed = 0, 0, 0
1054 1054 skips = []
1055 1055 fails = []
1056 1056 while fps:
1057 1057 pid, status = os.wait()
1058 1058 fp = fps.pop(pid)
1059 1059 l = fp.read().splitlines()
1060 1060 try:
1061 1061 test, skip, fail = map(int, l[:3])
1062 1062 except ValueError:
1063 1063 test, skip, fail = 0, 0, 0
1064 1064 split = -fail or len(l)
1065 1065 for s in l[3:split]:
1066 1066 skips.append(s.split(" ", 1))
1067 1067 for s in l[split:]:
1068 1068 fails.append(s.split(" ", 1))
1069 1069 tested += test
1070 1070 skipped += skip
1071 1071 failed += fail
1072 1072 vlog('pid %d exited, status %d' % (pid, status))
1073 1073 failures |= status
1074 1074 print
1075 1075 skipped += len(blacklisted)
1076 1076 if not options.noskips:
1077 1077 for s in skips:
1078 1078 print "Skipped %s: %s" % (s[0], s[1])
1079 1079 for s in blacklisted:
1080 1080 print "Skipped %s: blacklisted" % s
1081 1081 for s in fails:
1082 1082 print "Failed %s: %s" % (s[0], s[1])
1083 1083
1084 1084 _checkhglib("Tested")
1085 1085 print "# Ran %d tests, %d skipped, %d failed." % (
1086 1086 tested, skipped, failed)
1087 1087
1088 1088 if options.anycoverage:
1089 1089 outputcoverage(options)
1090 1090 sys.exit(failures != 0)
1091 1091
1092 1092 results = dict(p=[], f=[], s=[], i=[])
1093 1093 resultslock = threading.Lock()
1094 1094 iolock = threading.Lock()
1095 1095
1096 1096 def runqueue(options, tests, results):
1097 1097 for test in tests:
1098 1098 ret = runone(options, test)
1099 1099 if options.first and ret is not None and not ret:
1100 1100 break
1101 1101
1102 1102 def runtests(options, tests):
1103 1103 global DAEMON_PIDS, HGRCPATH
1104 1104 DAEMON_PIDS = os.environ["DAEMON_PIDS"] = os.path.join(HGTMP, 'daemon.pids')
1105 1105 HGRCPATH = os.environ["HGRCPATH"] = os.path.join(HGTMP, '.hgrc')
1106 1106
1107 1107 try:
1108 1108 if INST:
1109 1109 installhg(options)
1110 1110 _checkhglib("Testing")
1111 1111
1112 1112 if options.restart:
1113 1113 orig = list(tests)
1114 1114 while tests:
1115 1115 if os.path.exists(tests[0] + ".err"):
1116 1116 break
1117 1117 tests.pop(0)
1118 1118 if not tests:
1119 1119 print "running all tests"
1120 1120 tests = orig
1121 1121
1122 1122 runqueue(options, tests, results)
1123 1123
1124 1124 failed = len(results['f'])
1125 1125 tested = len(results['p']) + failed
1126 1126 skipped = len(results['s'])
1127 1127 ignored = len(results['i'])
1128 1128
1129 1129 if options.child:
1130 1130 fp = os.fdopen(options.child, 'w')
1131 1131 fp.write('%d\n%d\n%d\n' % (tested, skipped, failed))
1132 1132 for s in results['s']:
1133 1133 fp.write("%s %s\n" % s)
1134 1134 for s in results['f']:
1135 1135 fp.write("%s %s\n" % s)
1136 1136 fp.close()
1137 1137 else:
1138 1138 print
1139 1139 for s in results['s']:
1140 1140 print "Skipped %s: %s" % s
1141 1141 for s in results['f']:
1142 1142 print "Failed %s: %s" % s
1143 1143 _checkhglib("Tested")
1144 1144 print "# Ran %d tests, %d skipped, %d failed." % (
1145 1145 tested, skipped + ignored, failed)
1146 1146
1147 1147 if options.anycoverage:
1148 1148 outputcoverage(options)
1149 1149 except KeyboardInterrupt:
1150 1150 failed = True
1151 1151 print "\ninterrupted!"
1152 1152
1153 1153 if failed:
1154 1154 sys.exit(1)
1155 1155
1156 1156 def main():
1157 1157 (options, args) = parseargs()
1158 1158 if not options.child:
1159 1159 os.umask(022)
1160 1160
1161 1161 checktools()
1162 1162
1163 1163 if len(args) == 0:
1164 1164 args = os.listdir(".")
1165 1165 args.sort()
1166 1166
1167 1167 tests = args
1168 1168
1169 1169 # Reset some environment variables to well-known values so that
1170 1170 # the tests produce repeatable output.
1171 1171 os.environ['LANG'] = os.environ['LC_ALL'] = os.environ['LANGUAGE'] = 'C'
1172 1172 os.environ['TZ'] = 'GMT'
1173 1173 os.environ["EMAIL"] = "Foo Bar <foo.bar@example.com>"
1174 1174 os.environ['CDPATH'] = ''
1175 1175 os.environ['COLUMNS'] = '80'
1176 1176 os.environ['GREP_OPTIONS'] = ''
1177 1177 os.environ['http_proxy'] = ''
1178 1178 os.environ['no_proxy'] = ''
1179 1179 os.environ['NO_PROXY'] = ''
1180 1180
1181 1181 # unset env related to hooks
1182 1182 for k in os.environ.keys():
1183 1183 if k.startswith('HG_'):
1184 1184 # can't remove on solaris
1185 1185 os.environ[k] = ''
1186 1186 del os.environ[k]
1187 1187
1188 1188 global TESTDIR, HGTMP, INST, BINDIR, PYTHONDIR, COVERAGE_FILE
1189 1189 TESTDIR = os.environ["TESTDIR"] = os.getcwd()
1190 1190 if options.tmpdir:
1191 1191 options.keep_tmpdir = True
1192 1192 tmpdir = options.tmpdir
1193 1193 if os.path.exists(tmpdir):
1194 1194 # Meaning of tmpdir has changed since 1.3: we used to create
1195 1195 # HGTMP inside tmpdir; now HGTMP is tmpdir. So fail if
1196 1196 # tmpdir already exists.
1197 1197 sys.exit("error: temp dir %r already exists" % tmpdir)
1198 1198
1199 1199 # Automatically removing tmpdir sounds convenient, but could
1200 1200 # really annoy anyone in the habit of using "--tmpdir=/tmp"
1201 1201 # or "--tmpdir=$HOME".
1202 1202 #vlog("# Removing temp dir", tmpdir)
1203 1203 #shutil.rmtree(tmpdir)
1204 1204 os.makedirs(tmpdir)
1205 1205 else:
1206 1206 tmpdir = tempfile.mkdtemp('', 'hgtests.')
1207 1207 HGTMP = os.environ['HGTMP'] = os.path.realpath(tmpdir)
1208 1208 DAEMON_PIDS = None
1209 1209 HGRCPATH = None
1210 1210
1211 1211 os.environ["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"'
1212 1212 os.environ["HGMERGE"] = "internal:merge"
1213 1213 os.environ["HGUSER"] = "test"
1214 1214 os.environ["HGENCODING"] = "ascii"
1215 1215 os.environ["HGENCODINGMODE"] = "strict"
1216 1216 os.environ["HGPORT"] = str(options.port)
1217 1217 os.environ["HGPORT1"] = str(options.port + 1)
1218 1218 os.environ["HGPORT2"] = str(options.port + 2)
1219 1219
1220 1220 if options.with_hg:
1221 1221 INST = None
1222 1222 BINDIR = os.path.dirname(os.path.realpath(options.with_hg))
1223 1223
1224 1224 # This looks redundant with how Python initializes sys.path from
1225 1225 # the location of the script being executed. Needed because the
1226 1226 # "hg" specified by --with-hg is not the only Python script
1227 1227 # executed in the test suite that needs to import 'mercurial'
1228 1228 # ... which means it's not really redundant at all.
1229 1229 PYTHONDIR = BINDIR
1230 1230 else:
1231 1231 INST = os.path.join(HGTMP, "install")
1232 1232 BINDIR = os.environ["BINDIR"] = os.path.join(INST, "bin")
1233 1233 PYTHONDIR = os.path.join(INST, "lib", "python")
1234 1234
1235 1235 os.environ["BINDIR"] = BINDIR
1236 1236 os.environ["PYTHON"] = PYTHON
1237 1237
1238 1238 if not options.child:
1239 1239 path = [BINDIR] + os.environ["PATH"].split(os.pathsep)
1240 1240 os.environ["PATH"] = os.pathsep.join(path)
1241 1241
1242 1242 # Include TESTDIR in PYTHONPATH so that out-of-tree extensions
1243 1243 # can run .../tests/run-tests.py test-foo where test-foo
1244 1244 # adds an extension to HGRC
1245 1245 pypath = [PYTHONDIR, TESTDIR]
1246 1246 # We have to augment PYTHONPATH, rather than simply replacing
1247 1247 # it, in case external libraries are only available via current
1248 1248 # PYTHONPATH. (In particular, the Subversion bindings on OS X
1249 1249 # are in /opt/subversion.)
1250 1250 oldpypath = os.environ.get(IMPL_PATH)
1251 1251 if oldpypath:
1252 1252 pypath.append(oldpypath)
1253 1253 os.environ[IMPL_PATH] = os.pathsep.join(pypath)
1254 1254
1255 1255 COVERAGE_FILE = os.path.join(TESTDIR, ".coverage")
1256 1256
1257 1257 vlog("# Using TESTDIR", TESTDIR)
1258 1258 vlog("# Using HGTMP", HGTMP)
1259 1259 vlog("# Using PATH", os.environ["PATH"])
1260 1260 vlog("# Using", IMPL_PATH, os.environ[IMPL_PATH])
1261 1261
1262 1262 try:
1263 1263 if len(tests) > 1 and options.jobs > 1:
1264 1264 runchildren(options, tests)
1265 1265 else:
1266 1266 runtests(options, tests)
1267 1267 finally:
1268 1268 time.sleep(1)
1269 1269 cleanup(options)
1270 1270
1271 1271 if __name__ == '__main__':
1272 1272 main()
@@ -1,1923 +1,1923 b''
1 1 > do_push()
2 2 > {
3 3 > user=$1
4 4 > shift
5 5 > echo "Pushing as user $user"
6 6 > echo 'hgrc = """'
7 7 > sed -e 1,2d b/.hg/hgrc | grep -v fakegroups.py
8 8 > echo '"""'
9 9 > if test -f acl.config; then
10 10 > echo 'acl.config = """'
11 11 > cat acl.config
12 12 > echo '"""'
13 13 > fi
14 14 > # On AIX /etc/profile sets LOGNAME read-only. So
15 15 > # LOGNAME=$user hg --cws a --debug push ../b
16 16 > # fails with "This variable is read only."
17 17 > # Use env to work around this.
18 18 > env LOGNAME=$user hg --cwd a --debug push ../b
19 19 > hg --cwd b rollback
20 20 > hg --cwd b --quiet tip
21 21 > echo
22 22 > }
23 23
24 24 > init_config()
25 25 > {
26 26 > cat > fakegroups.py <<EOF
27 27 > from hgext import acl
28 28 > def fakegetusers(ui, group):
29 29 > try:
30 30 > return acl._getusersorig(ui, group)
31 31 > except:
32 32 > return ["fred", "betty"]
33 33 > acl._getusersorig = acl._getusers
34 34 > acl._getusers = fakegetusers
35 35 > EOF
36 36 > rm -f acl.config
37 37 > cat > $config <<EOF
38 38 > [hooks]
39 39 > pretxnchangegroup.acl = python:hgext.acl.hook
40 40 > [acl]
41 41 > sources = push
42 42 > [extensions]
43 43 > f=`pwd`/fakegroups.py
44 44 > EOF
45 45 > }
46 46
47 47 $ hg init a
48 48 $ cd a
49 49 $ mkdir foo foo/Bar quux
50 50 $ echo 'in foo' > foo/file.txt
51 51 $ echo 'in foo/Bar' > foo/Bar/file.txt
52 52 $ echo 'in quux' > quux/file.py
53 53 $ hg add -q
54 54 $ hg ci -m 'add files' -d '1000000 0'
55 55 $ echo >> foo/file.txt
56 56 $ hg ci -m 'change foo/file' -d '1000001 0'
57 57 $ echo >> foo/Bar/file.txt
58 58 $ hg ci -m 'change foo/Bar/file' -d '1000002 0'
59 59 $ echo >> quux/file.py
60 60 $ hg ci -m 'change quux/file' -d '1000003 0'
61 61 $ hg tip --quiet
62 62 3:911600dab2ae
63 63
64 64 $ cd ..
65 65 $ hg clone -r 0 a b
66 66 adding changesets
67 67 adding manifests
68 68 adding file changes
69 69 added 1 changesets with 3 changes to 3 files
70 70 updating to branch default
71 71 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
72 72
73 73 $ echo '[extensions]' >> $HGRCPATH
74 74 $ echo 'acl =' >> $HGRCPATH
75 75
76 76 $ config=b/.hg/hgrc
77 77
78 78 Extension disabled for lack of a hook
79 79
80 80 $ do_push fred
81 81 Pushing as user fred
82 82 hgrc = """
83 83 """
84 84 pushing to ../b
85 85 query 1; heads
86 86 searching for changes
87 87 all remote heads known locally
88 88 3 changesets found
89 89 list of changesets:
90 90 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
91 91 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
92 92 911600dab2ae7a9baff75958b84fe606851ce955
93 93 adding changesets
94 94 bundling: 1/3 changesets (33.33%)
95 95 bundling: 2/3 changesets (66.67%)
96 96 bundling: 3/3 changesets (100.00%)
97 97 bundling: 1/3 manifests (33.33%)
98 98 bundling: 2/3 manifests (66.67%)
99 99 bundling: 3/3 manifests (100.00%)
100 100 bundling: foo/Bar/file.txt 1/3 files (33.33%)
101 101 bundling: foo/file.txt 2/3 files (66.67%)
102 102 bundling: quux/file.py 3/3 files (100.00%)
103 103 changesets: 1 chunks
104 104 add changeset ef1ea85a6374
105 105 changesets: 2 chunks
106 106 add changeset f9cafe1212c8
107 107 changesets: 3 chunks
108 108 add changeset 911600dab2ae
109 109 adding manifests
110 110 manifests: 1/3 chunks (33.33%)
111 111 manifests: 2/3 chunks (66.67%)
112 112 manifests: 3/3 chunks (100.00%)
113 113 adding file changes
114 114 adding foo/Bar/file.txt revisions
115 115 files: 1/3 chunks (33.33%)
116 116 adding foo/file.txt revisions
117 117 files: 2/3 chunks (66.67%)
118 118 adding quux/file.py revisions
119 119 files: 3/3 chunks (100.00%)
120 120 added 3 changesets with 3 changes to 3 files
121 121 updating the branch cache
122 122 checking for updated bookmarks
123 123 repository tip rolled back to revision 0 (undo push)
124 124 0:6675d58eff77
125 125
126 126
127 127 $ echo '[hooks]' >> $config
128 128 $ echo 'pretxnchangegroup.acl = python:hgext.acl.hook' >> $config
129 129
130 130 Extension disabled for lack of acl.sources
131 131
132 132 $ do_push fred
133 133 Pushing as user fred
134 134 hgrc = """
135 135 [hooks]
136 136 pretxnchangegroup.acl = python:hgext.acl.hook
137 137 """
138 138 pushing to ../b
139 139 query 1; heads
140 140 searching for changes
141 141 all remote heads known locally
142 142 invalidating branch cache (tip differs)
143 143 3 changesets found
144 144 list of changesets:
145 145 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
146 146 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
147 147 911600dab2ae7a9baff75958b84fe606851ce955
148 148 adding changesets
149 149 bundling: 1/3 changesets (33.33%)
150 150 bundling: 2/3 changesets (66.67%)
151 151 bundling: 3/3 changesets (100.00%)
152 152 bundling: 1/3 manifests (33.33%)
153 153 bundling: 2/3 manifests (66.67%)
154 154 bundling: 3/3 manifests (100.00%)
155 155 bundling: foo/Bar/file.txt 1/3 files (33.33%)
156 156 bundling: foo/file.txt 2/3 files (66.67%)
157 157 bundling: quux/file.py 3/3 files (100.00%)
158 158 changesets: 1 chunks
159 159 add changeset ef1ea85a6374
160 160 changesets: 2 chunks
161 161 add changeset f9cafe1212c8
162 162 changesets: 3 chunks
163 163 add changeset 911600dab2ae
164 164 adding manifests
165 165 manifests: 1/3 chunks (33.33%)
166 166 manifests: 2/3 chunks (66.67%)
167 167 manifests: 3/3 chunks (100.00%)
168 168 adding file changes
169 169 adding foo/Bar/file.txt revisions
170 170 files: 1/3 chunks (33.33%)
171 171 adding foo/file.txt revisions
172 172 files: 2/3 chunks (66.67%)
173 173 adding quux/file.py revisions
174 174 files: 3/3 chunks (100.00%)
175 175 added 3 changesets with 3 changes to 3 files
176 176 calling hook pretxnchangegroup.acl: hgext.acl.hook
177 177 acl: changes have source "push" - skipping
178 178 updating the branch cache
179 179 checking for updated bookmarks
180 180 repository tip rolled back to revision 0 (undo push)
181 181 0:6675d58eff77
182 182
183 183
184 184 No [acl.allow]/[acl.deny]
185 185
186 186 $ echo '[acl]' >> $config
187 187 $ echo 'sources = push' >> $config
188 188 $ do_push fred
189 189 Pushing as user fred
190 190 hgrc = """
191 191 [hooks]
192 192 pretxnchangegroup.acl = python:hgext.acl.hook
193 193 [acl]
194 194 sources = push
195 195 """
196 196 pushing to ../b
197 197 query 1; heads
198 198 searching for changes
199 199 all remote heads known locally
200 200 invalidating branch cache (tip differs)
201 201 3 changesets found
202 202 list of changesets:
203 203 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
204 204 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
205 205 911600dab2ae7a9baff75958b84fe606851ce955
206 206 adding changesets
207 207 bundling: 1/3 changesets (33.33%)
208 208 bundling: 2/3 changesets (66.67%)
209 209 bundling: 3/3 changesets (100.00%)
210 210 bundling: 1/3 manifests (33.33%)
211 211 bundling: 2/3 manifests (66.67%)
212 212 bundling: 3/3 manifests (100.00%)
213 213 bundling: foo/Bar/file.txt 1/3 files (33.33%)
214 214 bundling: foo/file.txt 2/3 files (66.67%)
215 215 bundling: quux/file.py 3/3 files (100.00%)
216 216 changesets: 1 chunks
217 217 add changeset ef1ea85a6374
218 218 changesets: 2 chunks
219 219 add changeset f9cafe1212c8
220 220 changesets: 3 chunks
221 221 add changeset 911600dab2ae
222 222 adding manifests
223 223 manifests: 1/3 chunks (33.33%)
224 224 manifests: 2/3 chunks (66.67%)
225 225 manifests: 3/3 chunks (100.00%)
226 226 adding file changes
227 227 adding foo/Bar/file.txt revisions
228 228 files: 1/3 chunks (33.33%)
229 229 adding foo/file.txt revisions
230 230 files: 2/3 chunks (66.67%)
231 231 adding quux/file.py revisions
232 232 files: 3/3 chunks (100.00%)
233 233 added 3 changesets with 3 changes to 3 files
234 234 calling hook pretxnchangegroup.acl: hgext.acl.hook
235 235 acl: checking access for user "fred"
236 236 acl: acl.allow.branches not enabled
237 237 acl: acl.deny.branches not enabled
238 238 acl: acl.allow not enabled
239 239 acl: acl.deny not enabled
240 240 acl: branch access granted: "ef1ea85a6374" on branch "default"
241 241 acl: path access granted: "ef1ea85a6374"
242 242 acl: branch access granted: "f9cafe1212c8" on branch "default"
243 243 acl: path access granted: "f9cafe1212c8"
244 244 acl: branch access granted: "911600dab2ae" on branch "default"
245 245 acl: path access granted: "911600dab2ae"
246 246 updating the branch cache
247 247 checking for updated bookmarks
248 248 repository tip rolled back to revision 0 (undo push)
249 249 0:6675d58eff77
250 250
251 251
252 252 Empty [acl.allow]
253 253
254 254 $ echo '[acl.allow]' >> $config
255 255 $ do_push fred
256 256 Pushing as user fred
257 257 hgrc = """
258 258 [hooks]
259 259 pretxnchangegroup.acl = python:hgext.acl.hook
260 260 [acl]
261 261 sources = push
262 262 [acl.allow]
263 263 """
264 264 pushing to ../b
265 265 query 1; heads
266 266 searching for changes
267 267 all remote heads known locally
268 268 invalidating branch cache (tip differs)
269 269 3 changesets found
270 270 list of changesets:
271 271 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
272 272 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
273 273 911600dab2ae7a9baff75958b84fe606851ce955
274 274 adding changesets
275 275 bundling: 1/3 changesets (33.33%)
276 276 bundling: 2/3 changesets (66.67%)
277 277 bundling: 3/3 changesets (100.00%)
278 278 bundling: 1/3 manifests (33.33%)
279 279 bundling: 2/3 manifests (66.67%)
280 280 bundling: 3/3 manifests (100.00%)
281 281 bundling: foo/Bar/file.txt 1/3 files (33.33%)
282 282 bundling: foo/file.txt 2/3 files (66.67%)
283 283 bundling: quux/file.py 3/3 files (100.00%)
284 284 changesets: 1 chunks
285 285 add changeset ef1ea85a6374
286 286 changesets: 2 chunks
287 287 add changeset f9cafe1212c8
288 288 changesets: 3 chunks
289 289 add changeset 911600dab2ae
290 290 adding manifests
291 291 manifests: 1/3 chunks (33.33%)
292 292 manifests: 2/3 chunks (66.67%)
293 293 manifests: 3/3 chunks (100.00%)
294 294 adding file changes
295 295 adding foo/Bar/file.txt revisions
296 296 files: 1/3 chunks (33.33%)
297 297 adding foo/file.txt revisions
298 298 files: 2/3 chunks (66.67%)
299 299 adding quux/file.py revisions
300 300 files: 3/3 chunks (100.00%)
301 301 added 3 changesets with 3 changes to 3 files
302 302 calling hook pretxnchangegroup.acl: hgext.acl.hook
303 303 acl: checking access for user "fred"
304 304 acl: acl.allow.branches not enabled
305 305 acl: acl.deny.branches not enabled
306 306 acl: acl.allow enabled, 0 entries for user fred
307 307 acl: acl.deny not enabled
308 308 acl: branch access granted: "ef1ea85a6374" on branch "default"
309 309 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
310 310 transaction abort!
311 311 rollback completed
312 312 abort: acl: user "fred" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
313 313 no rollback information available
314 314 0:6675d58eff77
315 315
316 316
317 317 fred is allowed inside foo/
318 318
319 319 $ echo 'foo/** = fred' >> $config
320 320 $ do_push fred
321 321 Pushing as user fred
322 322 hgrc = """
323 323 [hooks]
324 324 pretxnchangegroup.acl = python:hgext.acl.hook
325 325 [acl]
326 326 sources = push
327 327 [acl.allow]
328 328 foo/** = fred
329 329 """
330 330 pushing to ../b
331 331 query 1; heads
332 332 searching for changes
333 333 all remote heads known locally
334 334 3 changesets found
335 335 list of changesets:
336 336 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
337 337 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
338 338 911600dab2ae7a9baff75958b84fe606851ce955
339 339 adding changesets
340 340 bundling: 1/3 changesets (33.33%)
341 341 bundling: 2/3 changesets (66.67%)
342 342 bundling: 3/3 changesets (100.00%)
343 343 bundling: 1/3 manifests (33.33%)
344 344 bundling: 2/3 manifests (66.67%)
345 345 bundling: 3/3 manifests (100.00%)
346 346 bundling: foo/Bar/file.txt 1/3 files (33.33%)
347 347 bundling: foo/file.txt 2/3 files (66.67%)
348 348 bundling: quux/file.py 3/3 files (100.00%)
349 349 changesets: 1 chunks
350 350 add changeset ef1ea85a6374
351 351 changesets: 2 chunks
352 352 add changeset f9cafe1212c8
353 353 changesets: 3 chunks
354 354 add changeset 911600dab2ae
355 355 adding manifests
356 356 manifests: 1/3 chunks (33.33%)
357 357 manifests: 2/3 chunks (66.67%)
358 358 manifests: 3/3 chunks (100.00%)
359 359 adding file changes
360 360 adding foo/Bar/file.txt revisions
361 361 files: 1/3 chunks (33.33%)
362 362 adding foo/file.txt revisions
363 363 files: 2/3 chunks (66.67%)
364 364 adding quux/file.py revisions
365 365 files: 3/3 chunks (100.00%)
366 366 added 3 changesets with 3 changes to 3 files
367 367 calling hook pretxnchangegroup.acl: hgext.acl.hook
368 368 acl: checking access for user "fred"
369 369 acl: acl.allow.branches not enabled
370 370 acl: acl.deny.branches not enabled
371 371 acl: acl.allow enabled, 1 entries for user fred
372 372 acl: acl.deny not enabled
373 373 acl: branch access granted: "ef1ea85a6374" on branch "default"
374 374 acl: path access granted: "ef1ea85a6374"
375 375 acl: branch access granted: "f9cafe1212c8" on branch "default"
376 376 acl: path access granted: "f9cafe1212c8"
377 377 acl: branch access granted: "911600dab2ae" on branch "default"
378 378 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
379 379 transaction abort!
380 380 rollback completed
381 381 abort: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
382 382 no rollback information available
383 383 0:6675d58eff77
384 384
385 385
386 386 Empty [acl.deny]
387 387
388 388 $ echo '[acl.deny]' >> $config
389 389 $ do_push barney
390 390 Pushing as user barney
391 391 hgrc = """
392 392 [hooks]
393 393 pretxnchangegroup.acl = python:hgext.acl.hook
394 394 [acl]
395 395 sources = push
396 396 [acl.allow]
397 397 foo/** = fred
398 398 [acl.deny]
399 399 """
400 400 pushing to ../b
401 401 query 1; heads
402 402 searching for changes
403 403 all remote heads known locally
404 404 3 changesets found
405 405 list of changesets:
406 406 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
407 407 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
408 408 911600dab2ae7a9baff75958b84fe606851ce955
409 409 adding changesets
410 410 bundling: 1/3 changesets (33.33%)
411 411 bundling: 2/3 changesets (66.67%)
412 412 bundling: 3/3 changesets (100.00%)
413 413 bundling: 1/3 manifests (33.33%)
414 414 bundling: 2/3 manifests (66.67%)
415 415 bundling: 3/3 manifests (100.00%)
416 416 bundling: foo/Bar/file.txt 1/3 files (33.33%)
417 417 bundling: foo/file.txt 2/3 files (66.67%)
418 418 bundling: quux/file.py 3/3 files (100.00%)
419 419 changesets: 1 chunks
420 420 add changeset ef1ea85a6374
421 421 changesets: 2 chunks
422 422 add changeset f9cafe1212c8
423 423 changesets: 3 chunks
424 424 add changeset 911600dab2ae
425 425 adding manifests
426 426 manifests: 1/3 chunks (33.33%)
427 427 manifests: 2/3 chunks (66.67%)
428 428 manifests: 3/3 chunks (100.00%)
429 429 adding file changes
430 430 adding foo/Bar/file.txt revisions
431 431 files: 1/3 chunks (33.33%)
432 432 adding foo/file.txt revisions
433 433 files: 2/3 chunks (66.67%)
434 434 adding quux/file.py revisions
435 435 files: 3/3 chunks (100.00%)
436 436 added 3 changesets with 3 changes to 3 files
437 437 calling hook pretxnchangegroup.acl: hgext.acl.hook
438 438 acl: checking access for user "barney"
439 439 acl: acl.allow.branches not enabled
440 440 acl: acl.deny.branches not enabled
441 441 acl: acl.allow enabled, 0 entries for user barney
442 442 acl: acl.deny enabled, 0 entries for user barney
443 443 acl: branch access granted: "ef1ea85a6374" on branch "default"
444 444 error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
445 445 transaction abort!
446 446 rollback completed
447 447 abort: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
448 448 no rollback information available
449 449 0:6675d58eff77
450 450
451 451
452 452 fred is allowed inside foo/, but not foo/bar/ (case matters)
453 453
454 454 $ echo 'foo/bar/** = fred' >> $config
455 455 $ do_push fred
456 456 Pushing as user fred
457 457 hgrc = """
458 458 [hooks]
459 459 pretxnchangegroup.acl = python:hgext.acl.hook
460 460 [acl]
461 461 sources = push
462 462 [acl.allow]
463 463 foo/** = fred
464 464 [acl.deny]
465 465 foo/bar/** = fred
466 466 """
467 467 pushing to ../b
468 468 query 1; heads
469 469 searching for changes
470 470 all remote heads known locally
471 471 3 changesets found
472 472 list of changesets:
473 473 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
474 474 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
475 475 911600dab2ae7a9baff75958b84fe606851ce955
476 476 adding changesets
477 477 bundling: 1/3 changesets (33.33%)
478 478 bundling: 2/3 changesets (66.67%)
479 479 bundling: 3/3 changesets (100.00%)
480 480 bundling: 1/3 manifests (33.33%)
481 481 bundling: 2/3 manifests (66.67%)
482 482 bundling: 3/3 manifests (100.00%)
483 483 bundling: foo/Bar/file.txt 1/3 files (33.33%)
484 484 bundling: foo/file.txt 2/3 files (66.67%)
485 485 bundling: quux/file.py 3/3 files (100.00%)
486 486 changesets: 1 chunks
487 487 add changeset ef1ea85a6374
488 488 changesets: 2 chunks
489 489 add changeset f9cafe1212c8
490 490 changesets: 3 chunks
491 491 add changeset 911600dab2ae
492 492 adding manifests
493 493 manifests: 1/3 chunks (33.33%)
494 494 manifests: 2/3 chunks (66.67%)
495 495 manifests: 3/3 chunks (100.00%)
496 496 adding file changes
497 497 adding foo/Bar/file.txt revisions
498 498 files: 1/3 chunks (33.33%)
499 499 adding foo/file.txt revisions
500 500 files: 2/3 chunks (66.67%)
501 501 adding quux/file.py revisions
502 502 files: 3/3 chunks (100.00%)
503 503 added 3 changesets with 3 changes to 3 files
504 504 calling hook pretxnchangegroup.acl: hgext.acl.hook
505 505 acl: checking access for user "fred"
506 506 acl: acl.allow.branches not enabled
507 507 acl: acl.deny.branches not enabled
508 508 acl: acl.allow enabled, 1 entries for user fred
509 509 acl: acl.deny enabled, 1 entries for user fred
510 510 acl: branch access granted: "ef1ea85a6374" on branch "default"
511 511 acl: path access granted: "ef1ea85a6374"
512 512 acl: branch access granted: "f9cafe1212c8" on branch "default"
513 513 acl: path access granted: "f9cafe1212c8"
514 514 acl: branch access granted: "911600dab2ae" on branch "default"
515 515 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
516 516 transaction abort!
517 517 rollback completed
518 518 abort: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
519 519 no rollback information available
520 520 0:6675d58eff77
521 521
522 522
523 523 fred is allowed inside foo/, but not foo/Bar/
524 524
525 525 $ echo 'foo/Bar/** = fred' >> $config
526 526 $ do_push fred
527 527 Pushing as user fred
528 528 hgrc = """
529 529 [hooks]
530 530 pretxnchangegroup.acl = python:hgext.acl.hook
531 531 [acl]
532 532 sources = push
533 533 [acl.allow]
534 534 foo/** = fred
535 535 [acl.deny]
536 536 foo/bar/** = fred
537 537 foo/Bar/** = fred
538 538 """
539 539 pushing to ../b
540 540 query 1; heads
541 541 searching for changes
542 542 all remote heads known locally
543 543 3 changesets found
544 544 list of changesets:
545 545 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
546 546 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
547 547 911600dab2ae7a9baff75958b84fe606851ce955
548 548 adding changesets
549 549 bundling: 1/3 changesets (33.33%)
550 550 bundling: 2/3 changesets (66.67%)
551 551 bundling: 3/3 changesets (100.00%)
552 552 bundling: 1/3 manifests (33.33%)
553 553 bundling: 2/3 manifests (66.67%)
554 554 bundling: 3/3 manifests (100.00%)
555 555 bundling: foo/Bar/file.txt 1/3 files (33.33%)
556 556 bundling: foo/file.txt 2/3 files (66.67%)
557 557 bundling: quux/file.py 3/3 files (100.00%)
558 558 changesets: 1 chunks
559 559 add changeset ef1ea85a6374
560 560 changesets: 2 chunks
561 561 add changeset f9cafe1212c8
562 562 changesets: 3 chunks
563 563 add changeset 911600dab2ae
564 564 adding manifests
565 565 manifests: 1/3 chunks (33.33%)
566 566 manifests: 2/3 chunks (66.67%)
567 567 manifests: 3/3 chunks (100.00%)
568 568 adding file changes
569 569 adding foo/Bar/file.txt revisions
570 570 files: 1/3 chunks (33.33%)
571 571 adding foo/file.txt revisions
572 572 files: 2/3 chunks (66.67%)
573 573 adding quux/file.py revisions
574 574 files: 3/3 chunks (100.00%)
575 575 added 3 changesets with 3 changes to 3 files
576 576 calling hook pretxnchangegroup.acl: hgext.acl.hook
577 577 acl: checking access for user "fred"
578 578 acl: acl.allow.branches not enabled
579 579 acl: acl.deny.branches not enabled
580 580 acl: acl.allow enabled, 1 entries for user fred
581 581 acl: acl.deny enabled, 2 entries for user fred
582 582 acl: branch access granted: "ef1ea85a6374" on branch "default"
583 583 acl: path access granted: "ef1ea85a6374"
584 584 acl: branch access granted: "f9cafe1212c8" on branch "default"
585 585 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
586 586 transaction abort!
587 587 rollback completed
588 588 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
589 589 no rollback information available
590 590 0:6675d58eff77
591 591
592 592
593 593 $ echo 'barney is not mentioned => not allowed anywhere'
594 594 barney is not mentioned => not allowed anywhere
595 595 $ do_push barney
596 596 Pushing as user barney
597 597 hgrc = """
598 598 [hooks]
599 599 pretxnchangegroup.acl = python:hgext.acl.hook
600 600 [acl]
601 601 sources = push
602 602 [acl.allow]
603 603 foo/** = fred
604 604 [acl.deny]
605 605 foo/bar/** = fred
606 606 foo/Bar/** = fred
607 607 """
608 608 pushing to ../b
609 609 query 1; heads
610 610 searching for changes
611 611 all remote heads known locally
612 612 3 changesets found
613 613 list of changesets:
614 614 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
615 615 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
616 616 911600dab2ae7a9baff75958b84fe606851ce955
617 617 adding changesets
618 618 bundling: 1/3 changesets (33.33%)
619 619 bundling: 2/3 changesets (66.67%)
620 620 bundling: 3/3 changesets (100.00%)
621 621 bundling: 1/3 manifests (33.33%)
622 622 bundling: 2/3 manifests (66.67%)
623 623 bundling: 3/3 manifests (100.00%)
624 624 bundling: foo/Bar/file.txt 1/3 files (33.33%)
625 625 bundling: foo/file.txt 2/3 files (66.67%)
626 626 bundling: quux/file.py 3/3 files (100.00%)
627 627 changesets: 1 chunks
628 628 add changeset ef1ea85a6374
629 629 changesets: 2 chunks
630 630 add changeset f9cafe1212c8
631 631 changesets: 3 chunks
632 632 add changeset 911600dab2ae
633 633 adding manifests
634 634 manifests: 1/3 chunks (33.33%)
635 635 manifests: 2/3 chunks (66.67%)
636 636 manifests: 3/3 chunks (100.00%)
637 637 adding file changes
638 638 adding foo/Bar/file.txt revisions
639 639 files: 1/3 chunks (33.33%)
640 640 adding foo/file.txt revisions
641 641 files: 2/3 chunks (66.67%)
642 642 adding quux/file.py revisions
643 643 files: 3/3 chunks (100.00%)
644 644 added 3 changesets with 3 changes to 3 files
645 645 calling hook pretxnchangegroup.acl: hgext.acl.hook
646 646 acl: checking access for user "barney"
647 647 acl: acl.allow.branches not enabled
648 648 acl: acl.deny.branches not enabled
649 649 acl: acl.allow enabled, 0 entries for user barney
650 650 acl: acl.deny enabled, 0 entries for user barney
651 651 acl: branch access granted: "ef1ea85a6374" on branch "default"
652 652 error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
653 653 transaction abort!
654 654 rollback completed
655 655 abort: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
656 656 no rollback information available
657 657 0:6675d58eff77
658 658
659 659
660 660 barney is allowed everywhere
661 661
662 662 $ echo '[acl.allow]' >> $config
663 663 $ echo '** = barney' >> $config
664 664 $ do_push barney
665 665 Pushing as user barney
666 666 hgrc = """
667 667 [hooks]
668 668 pretxnchangegroup.acl = python:hgext.acl.hook
669 669 [acl]
670 670 sources = push
671 671 [acl.allow]
672 672 foo/** = fred
673 673 [acl.deny]
674 674 foo/bar/** = fred
675 675 foo/Bar/** = fred
676 676 [acl.allow]
677 677 ** = barney
678 678 """
679 679 pushing to ../b
680 680 query 1; heads
681 681 searching for changes
682 682 all remote heads known locally
683 683 3 changesets found
684 684 list of changesets:
685 685 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
686 686 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
687 687 911600dab2ae7a9baff75958b84fe606851ce955
688 688 adding changesets
689 689 bundling: 1/3 changesets (33.33%)
690 690 bundling: 2/3 changesets (66.67%)
691 691 bundling: 3/3 changesets (100.00%)
692 692 bundling: 1/3 manifests (33.33%)
693 693 bundling: 2/3 manifests (66.67%)
694 694 bundling: 3/3 manifests (100.00%)
695 695 bundling: foo/Bar/file.txt 1/3 files (33.33%)
696 696 bundling: foo/file.txt 2/3 files (66.67%)
697 697 bundling: quux/file.py 3/3 files (100.00%)
698 698 changesets: 1 chunks
699 699 add changeset ef1ea85a6374
700 700 changesets: 2 chunks
701 701 add changeset f9cafe1212c8
702 702 changesets: 3 chunks
703 703 add changeset 911600dab2ae
704 704 adding manifests
705 705 manifests: 1/3 chunks (33.33%)
706 706 manifests: 2/3 chunks (66.67%)
707 707 manifests: 3/3 chunks (100.00%)
708 708 adding file changes
709 709 adding foo/Bar/file.txt revisions
710 710 files: 1/3 chunks (33.33%)
711 711 adding foo/file.txt revisions
712 712 files: 2/3 chunks (66.67%)
713 713 adding quux/file.py revisions
714 714 files: 3/3 chunks (100.00%)
715 715 added 3 changesets with 3 changes to 3 files
716 716 calling hook pretxnchangegroup.acl: hgext.acl.hook
717 717 acl: checking access for user "barney"
718 718 acl: acl.allow.branches not enabled
719 719 acl: acl.deny.branches not enabled
720 720 acl: acl.allow enabled, 1 entries for user barney
721 721 acl: acl.deny enabled, 0 entries for user barney
722 722 acl: branch access granted: "ef1ea85a6374" on branch "default"
723 723 acl: path access granted: "ef1ea85a6374"
724 724 acl: branch access granted: "f9cafe1212c8" on branch "default"
725 725 acl: path access granted: "f9cafe1212c8"
726 726 acl: branch access granted: "911600dab2ae" on branch "default"
727 727 acl: path access granted: "911600dab2ae"
728 728 updating the branch cache
729 729 checking for updated bookmarks
730 730 repository tip rolled back to revision 0 (undo push)
731 731 0:6675d58eff77
732 732
733 733
734 734 wilma can change files with a .txt extension
735 735
736 736 $ echo '**/*.txt = wilma' >> $config
737 737 $ do_push wilma
738 738 Pushing as user wilma
739 739 hgrc = """
740 740 [hooks]
741 741 pretxnchangegroup.acl = python:hgext.acl.hook
742 742 [acl]
743 743 sources = push
744 744 [acl.allow]
745 745 foo/** = fred
746 746 [acl.deny]
747 747 foo/bar/** = fred
748 748 foo/Bar/** = fred
749 749 [acl.allow]
750 750 ** = barney
751 751 **/*.txt = wilma
752 752 """
753 753 pushing to ../b
754 754 query 1; heads
755 755 searching for changes
756 756 all remote heads known locally
757 757 invalidating branch cache (tip differs)
758 758 3 changesets found
759 759 list of changesets:
760 760 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
761 761 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
762 762 911600dab2ae7a9baff75958b84fe606851ce955
763 763 adding changesets
764 764 bundling: 1/3 changesets (33.33%)
765 765 bundling: 2/3 changesets (66.67%)
766 766 bundling: 3/3 changesets (100.00%)
767 767 bundling: 1/3 manifests (33.33%)
768 768 bundling: 2/3 manifests (66.67%)
769 769 bundling: 3/3 manifests (100.00%)
770 770 bundling: foo/Bar/file.txt 1/3 files (33.33%)
771 771 bundling: foo/file.txt 2/3 files (66.67%)
772 772 bundling: quux/file.py 3/3 files (100.00%)
773 773 changesets: 1 chunks
774 774 add changeset ef1ea85a6374
775 775 changesets: 2 chunks
776 776 add changeset f9cafe1212c8
777 777 changesets: 3 chunks
778 778 add changeset 911600dab2ae
779 779 adding manifests
780 780 manifests: 1/3 chunks (33.33%)
781 781 manifests: 2/3 chunks (66.67%)
782 782 manifests: 3/3 chunks (100.00%)
783 783 adding file changes
784 784 adding foo/Bar/file.txt revisions
785 785 files: 1/3 chunks (33.33%)
786 786 adding foo/file.txt revisions
787 787 files: 2/3 chunks (66.67%)
788 788 adding quux/file.py revisions
789 789 files: 3/3 chunks (100.00%)
790 790 added 3 changesets with 3 changes to 3 files
791 791 calling hook pretxnchangegroup.acl: hgext.acl.hook
792 792 acl: checking access for user "wilma"
793 793 acl: acl.allow.branches not enabled
794 794 acl: acl.deny.branches not enabled
795 795 acl: acl.allow enabled, 1 entries for user wilma
796 796 acl: acl.deny enabled, 0 entries for user wilma
797 797 acl: branch access granted: "ef1ea85a6374" on branch "default"
798 798 acl: path access granted: "ef1ea85a6374"
799 799 acl: branch access granted: "f9cafe1212c8" on branch "default"
800 800 acl: path access granted: "f9cafe1212c8"
801 801 acl: branch access granted: "911600dab2ae" on branch "default"
802 802 error: pretxnchangegroup.acl hook failed: acl: user "wilma" not allowed on "quux/file.py" (changeset "911600dab2ae")
803 803 transaction abort!
804 804 rollback completed
805 805 abort: acl: user "wilma" not allowed on "quux/file.py" (changeset "911600dab2ae")
806 806 no rollback information available
807 807 0:6675d58eff77
808 808
809 809
810 810 file specified by acl.config does not exist
811 811
812 812 $ echo '[acl]' >> $config
813 813 $ echo 'config = ../acl.config' >> $config
814 814 $ do_push barney
815 815 Pushing as user barney
816 816 hgrc = """
817 817 [hooks]
818 818 pretxnchangegroup.acl = python:hgext.acl.hook
819 819 [acl]
820 820 sources = push
821 821 [acl.allow]
822 822 foo/** = fred
823 823 [acl.deny]
824 824 foo/bar/** = fred
825 825 foo/Bar/** = fred
826 826 [acl.allow]
827 827 ** = barney
828 828 **/*.txt = wilma
829 829 [acl]
830 830 config = ../acl.config
831 831 """
832 832 pushing to ../b
833 833 query 1; heads
834 834 searching for changes
835 835 all remote heads known locally
836 836 3 changesets found
837 837 list of changesets:
838 838 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
839 839 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
840 840 911600dab2ae7a9baff75958b84fe606851ce955
841 841 adding changesets
842 842 bundling: 1/3 changesets (33.33%)
843 843 bundling: 2/3 changesets (66.67%)
844 844 bundling: 3/3 changesets (100.00%)
845 845 bundling: 1/3 manifests (33.33%)
846 846 bundling: 2/3 manifests (66.67%)
847 847 bundling: 3/3 manifests (100.00%)
848 848 bundling: foo/Bar/file.txt 1/3 files (33.33%)
849 849 bundling: foo/file.txt 2/3 files (66.67%)
850 850 bundling: quux/file.py 3/3 files (100.00%)
851 851 changesets: 1 chunks
852 852 add changeset ef1ea85a6374
853 853 changesets: 2 chunks
854 854 add changeset f9cafe1212c8
855 855 changesets: 3 chunks
856 856 add changeset 911600dab2ae
857 857 adding manifests
858 858 manifests: 1/3 chunks (33.33%)
859 859 manifests: 2/3 chunks (66.67%)
860 860 manifests: 3/3 chunks (100.00%)
861 861 adding file changes
862 862 adding foo/Bar/file.txt revisions
863 863 files: 1/3 chunks (33.33%)
864 864 adding foo/file.txt revisions
865 865 files: 2/3 chunks (66.67%)
866 866 adding quux/file.py revisions
867 867 files: 3/3 chunks (100.00%)
868 868 added 3 changesets with 3 changes to 3 files
869 869 calling hook pretxnchangegroup.acl: hgext.acl.hook
870 870 acl: checking access for user "barney"
871 error: pretxnchangegroup.acl hook raised an exception: [Errno 2] No such file or directory: '../acl.config'
871 error: pretxnchangegroup.acl hook raised an exception: [Errno 2] *: '../acl.config' (glob)
872 872 transaction abort!
873 873 rollback completed
874 abort: No such file or directory: ../acl.config
874 abort: *: ../acl.config (glob)
875 875 no rollback information available
876 876 0:6675d58eff77
877 877
878 878
879 879 betty is allowed inside foo/ by a acl.config file
880 880
881 881 $ echo '[acl.allow]' >> acl.config
882 882 $ echo 'foo/** = betty' >> acl.config
883 883 $ do_push betty
884 884 Pushing as user betty
885 885 hgrc = """
886 886 [hooks]
887 887 pretxnchangegroup.acl = python:hgext.acl.hook
888 888 [acl]
889 889 sources = push
890 890 [acl.allow]
891 891 foo/** = fred
892 892 [acl.deny]
893 893 foo/bar/** = fred
894 894 foo/Bar/** = fred
895 895 [acl.allow]
896 896 ** = barney
897 897 **/*.txt = wilma
898 898 [acl]
899 899 config = ../acl.config
900 900 """
901 901 acl.config = """
902 902 [acl.allow]
903 903 foo/** = betty
904 904 """
905 905 pushing to ../b
906 906 query 1; heads
907 907 searching for changes
908 908 all remote heads known locally
909 909 3 changesets found
910 910 list of changesets:
911 911 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
912 912 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
913 913 911600dab2ae7a9baff75958b84fe606851ce955
914 914 adding changesets
915 915 bundling: 1/3 changesets (33.33%)
916 916 bundling: 2/3 changesets (66.67%)
917 917 bundling: 3/3 changesets (100.00%)
918 918 bundling: 1/3 manifests (33.33%)
919 919 bundling: 2/3 manifests (66.67%)
920 920 bundling: 3/3 manifests (100.00%)
921 921 bundling: foo/Bar/file.txt 1/3 files (33.33%)
922 922 bundling: foo/file.txt 2/3 files (66.67%)
923 923 bundling: quux/file.py 3/3 files (100.00%)
924 924 changesets: 1 chunks
925 925 add changeset ef1ea85a6374
926 926 changesets: 2 chunks
927 927 add changeset f9cafe1212c8
928 928 changesets: 3 chunks
929 929 add changeset 911600dab2ae
930 930 adding manifests
931 931 manifests: 1/3 chunks (33.33%)
932 932 manifests: 2/3 chunks (66.67%)
933 933 manifests: 3/3 chunks (100.00%)
934 934 adding file changes
935 935 adding foo/Bar/file.txt revisions
936 936 files: 1/3 chunks (33.33%)
937 937 adding foo/file.txt revisions
938 938 files: 2/3 chunks (66.67%)
939 939 adding quux/file.py revisions
940 940 files: 3/3 chunks (100.00%)
941 941 added 3 changesets with 3 changes to 3 files
942 942 calling hook pretxnchangegroup.acl: hgext.acl.hook
943 943 acl: checking access for user "betty"
944 944 acl: acl.allow.branches not enabled
945 945 acl: acl.deny.branches not enabled
946 946 acl: acl.allow enabled, 1 entries for user betty
947 947 acl: acl.deny enabled, 0 entries for user betty
948 948 acl: branch access granted: "ef1ea85a6374" on branch "default"
949 949 acl: path access granted: "ef1ea85a6374"
950 950 acl: branch access granted: "f9cafe1212c8" on branch "default"
951 951 acl: path access granted: "f9cafe1212c8"
952 952 acl: branch access granted: "911600dab2ae" on branch "default"
953 953 error: pretxnchangegroup.acl hook failed: acl: user "betty" not allowed on "quux/file.py" (changeset "911600dab2ae")
954 954 transaction abort!
955 955 rollback completed
956 956 abort: acl: user "betty" not allowed on "quux/file.py" (changeset "911600dab2ae")
957 957 no rollback information available
958 958 0:6675d58eff77
959 959
960 960
961 961 acl.config can set only [acl.allow]/[acl.deny]
962 962
963 963 $ echo '[hooks]' >> acl.config
964 964 $ echo 'changegroup.acl = false' >> acl.config
965 965 $ do_push barney
966 966 Pushing as user barney
967 967 hgrc = """
968 968 [hooks]
969 969 pretxnchangegroup.acl = python:hgext.acl.hook
970 970 [acl]
971 971 sources = push
972 972 [acl.allow]
973 973 foo/** = fred
974 974 [acl.deny]
975 975 foo/bar/** = fred
976 976 foo/Bar/** = fred
977 977 [acl.allow]
978 978 ** = barney
979 979 **/*.txt = wilma
980 980 [acl]
981 981 config = ../acl.config
982 982 """
983 983 acl.config = """
984 984 [acl.allow]
985 985 foo/** = betty
986 986 [hooks]
987 987 changegroup.acl = false
988 988 """
989 989 pushing to ../b
990 990 query 1; heads
991 991 searching for changes
992 992 all remote heads known locally
993 993 3 changesets found
994 994 list of changesets:
995 995 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
996 996 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
997 997 911600dab2ae7a9baff75958b84fe606851ce955
998 998 adding changesets
999 999 bundling: 1/3 changesets (33.33%)
1000 1000 bundling: 2/3 changesets (66.67%)
1001 1001 bundling: 3/3 changesets (100.00%)
1002 1002 bundling: 1/3 manifests (33.33%)
1003 1003 bundling: 2/3 manifests (66.67%)
1004 1004 bundling: 3/3 manifests (100.00%)
1005 1005 bundling: foo/Bar/file.txt 1/3 files (33.33%)
1006 1006 bundling: foo/file.txt 2/3 files (66.67%)
1007 1007 bundling: quux/file.py 3/3 files (100.00%)
1008 1008 changesets: 1 chunks
1009 1009 add changeset ef1ea85a6374
1010 1010 changesets: 2 chunks
1011 1011 add changeset f9cafe1212c8
1012 1012 changesets: 3 chunks
1013 1013 add changeset 911600dab2ae
1014 1014 adding manifests
1015 1015 manifests: 1/3 chunks (33.33%)
1016 1016 manifests: 2/3 chunks (66.67%)
1017 1017 manifests: 3/3 chunks (100.00%)
1018 1018 adding file changes
1019 1019 adding foo/Bar/file.txt revisions
1020 1020 files: 1/3 chunks (33.33%)
1021 1021 adding foo/file.txt revisions
1022 1022 files: 2/3 chunks (66.67%)
1023 1023 adding quux/file.py revisions
1024 1024 files: 3/3 chunks (100.00%)
1025 1025 added 3 changesets with 3 changes to 3 files
1026 1026 calling hook pretxnchangegroup.acl: hgext.acl.hook
1027 1027 acl: checking access for user "barney"
1028 1028 acl: acl.allow.branches not enabled
1029 1029 acl: acl.deny.branches not enabled
1030 1030 acl: acl.allow enabled, 1 entries for user barney
1031 1031 acl: acl.deny enabled, 0 entries for user barney
1032 1032 acl: branch access granted: "ef1ea85a6374" on branch "default"
1033 1033 acl: path access granted: "ef1ea85a6374"
1034 1034 acl: branch access granted: "f9cafe1212c8" on branch "default"
1035 1035 acl: path access granted: "f9cafe1212c8"
1036 1036 acl: branch access granted: "911600dab2ae" on branch "default"
1037 1037 acl: path access granted: "911600dab2ae"
1038 1038 updating the branch cache
1039 1039 checking for updated bookmarks
1040 1040 repository tip rolled back to revision 0 (undo push)
1041 1041 0:6675d58eff77
1042 1042
1043 1043
1044 1044 asterisk
1045 1045
1046 1046 $ init_config
1047 1047
1048 1048 asterisk test
1049 1049
1050 1050 $ echo '[acl.allow]' >> $config
1051 1051 $ echo "** = fred" >> $config
1052 1052
1053 1053 fred is always allowed
1054 1054
1055 1055 $ do_push fred
1056 1056 Pushing as user fred
1057 1057 hgrc = """
1058 1058 [acl]
1059 1059 sources = push
1060 1060 [extensions]
1061 1061 [acl.allow]
1062 1062 ** = fred
1063 1063 """
1064 1064 pushing to ../b
1065 1065 query 1; heads
1066 1066 searching for changes
1067 1067 all remote heads known locally
1068 1068 invalidating branch cache (tip differs)
1069 1069 3 changesets found
1070 1070 list of changesets:
1071 1071 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1072 1072 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1073 1073 911600dab2ae7a9baff75958b84fe606851ce955
1074 1074 adding changesets
1075 1075 bundling: 1/3 changesets (33.33%)
1076 1076 bundling: 2/3 changesets (66.67%)
1077 1077 bundling: 3/3 changesets (100.00%)
1078 1078 bundling: 1/3 manifests (33.33%)
1079 1079 bundling: 2/3 manifests (66.67%)
1080 1080 bundling: 3/3 manifests (100.00%)
1081 1081 bundling: foo/Bar/file.txt 1/3 files (33.33%)
1082 1082 bundling: foo/file.txt 2/3 files (66.67%)
1083 1083 bundling: quux/file.py 3/3 files (100.00%)
1084 1084 changesets: 1 chunks
1085 1085 add changeset ef1ea85a6374
1086 1086 changesets: 2 chunks
1087 1087 add changeset f9cafe1212c8
1088 1088 changesets: 3 chunks
1089 1089 add changeset 911600dab2ae
1090 1090 adding manifests
1091 1091 manifests: 1/3 chunks (33.33%)
1092 1092 manifests: 2/3 chunks (66.67%)
1093 1093 manifests: 3/3 chunks (100.00%)
1094 1094 adding file changes
1095 1095 adding foo/Bar/file.txt revisions
1096 1096 files: 1/3 chunks (33.33%)
1097 1097 adding foo/file.txt revisions
1098 1098 files: 2/3 chunks (66.67%)
1099 1099 adding quux/file.py revisions
1100 1100 files: 3/3 chunks (100.00%)
1101 1101 added 3 changesets with 3 changes to 3 files
1102 1102 calling hook pretxnchangegroup.acl: hgext.acl.hook
1103 1103 acl: checking access for user "fred"
1104 1104 acl: acl.allow.branches not enabled
1105 1105 acl: acl.deny.branches not enabled
1106 1106 acl: acl.allow enabled, 1 entries for user fred
1107 1107 acl: acl.deny not enabled
1108 1108 acl: branch access granted: "ef1ea85a6374" on branch "default"
1109 1109 acl: path access granted: "ef1ea85a6374"
1110 1110 acl: branch access granted: "f9cafe1212c8" on branch "default"
1111 1111 acl: path access granted: "f9cafe1212c8"
1112 1112 acl: branch access granted: "911600dab2ae" on branch "default"
1113 1113 acl: path access granted: "911600dab2ae"
1114 1114 updating the branch cache
1115 1115 checking for updated bookmarks
1116 1116 repository tip rolled back to revision 0 (undo push)
1117 1117 0:6675d58eff77
1118 1118
1119 1119
1120 1120 $ echo '[acl.deny]' >> $config
1121 1121 $ echo "foo/Bar/** = *" >> $config
1122 1122
1123 1123 no one is allowed inside foo/Bar/
1124 1124
1125 1125 $ do_push fred
1126 1126 Pushing as user fred
1127 1127 hgrc = """
1128 1128 [acl]
1129 1129 sources = push
1130 1130 [extensions]
1131 1131 [acl.allow]
1132 1132 ** = fred
1133 1133 [acl.deny]
1134 1134 foo/Bar/** = *
1135 1135 """
1136 1136 pushing to ../b
1137 1137 query 1; heads
1138 1138 searching for changes
1139 1139 all remote heads known locally
1140 1140 invalidating branch cache (tip differs)
1141 1141 3 changesets found
1142 1142 list of changesets:
1143 1143 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1144 1144 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1145 1145 911600dab2ae7a9baff75958b84fe606851ce955
1146 1146 adding changesets
1147 1147 bundling: 1/3 changesets (33.33%)
1148 1148 bundling: 2/3 changesets (66.67%)
1149 1149 bundling: 3/3 changesets (100.00%)
1150 1150 bundling: 1/3 manifests (33.33%)
1151 1151 bundling: 2/3 manifests (66.67%)
1152 1152 bundling: 3/3 manifests (100.00%)
1153 1153 bundling: foo/Bar/file.txt 1/3 files (33.33%)
1154 1154 bundling: foo/file.txt 2/3 files (66.67%)
1155 1155 bundling: quux/file.py 3/3 files (100.00%)
1156 1156 changesets: 1 chunks
1157 1157 add changeset ef1ea85a6374
1158 1158 changesets: 2 chunks
1159 1159 add changeset f9cafe1212c8
1160 1160 changesets: 3 chunks
1161 1161 add changeset 911600dab2ae
1162 1162 adding manifests
1163 1163 manifests: 1/3 chunks (33.33%)
1164 1164 manifests: 2/3 chunks (66.67%)
1165 1165 manifests: 3/3 chunks (100.00%)
1166 1166 adding file changes
1167 1167 adding foo/Bar/file.txt revisions
1168 1168 files: 1/3 chunks (33.33%)
1169 1169 adding foo/file.txt revisions
1170 1170 files: 2/3 chunks (66.67%)
1171 1171 adding quux/file.py revisions
1172 1172 files: 3/3 chunks (100.00%)
1173 1173 added 3 changesets with 3 changes to 3 files
1174 1174 calling hook pretxnchangegroup.acl: hgext.acl.hook
1175 1175 acl: checking access for user "fred"
1176 1176 acl: acl.allow.branches not enabled
1177 1177 acl: acl.deny.branches not enabled
1178 1178 acl: acl.allow enabled, 1 entries for user fred
1179 1179 acl: acl.deny enabled, 1 entries for user fred
1180 1180 acl: branch access granted: "ef1ea85a6374" on branch "default"
1181 1181 acl: path access granted: "ef1ea85a6374"
1182 1182 acl: branch access granted: "f9cafe1212c8" on branch "default"
1183 1183 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1184 1184 transaction abort!
1185 1185 rollback completed
1186 1186 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1187 1187 no rollback information available
1188 1188 0:6675d58eff77
1189 1189
1190 1190
1191 1191 Groups
1192 1192
1193 1193 $ init_config
1194 1194
1195 1195 OS-level groups
1196 1196
1197 1197 $ echo '[acl.allow]' >> $config
1198 1198 $ echo "** = @group1" >> $config
1199 1199
1200 1200 @group1 is always allowed
1201 1201
1202 1202 $ do_push fred
1203 1203 Pushing as user fred
1204 1204 hgrc = """
1205 1205 [acl]
1206 1206 sources = push
1207 1207 [extensions]
1208 1208 [acl.allow]
1209 1209 ** = @group1
1210 1210 """
1211 1211 pushing to ../b
1212 1212 query 1; heads
1213 1213 searching for changes
1214 1214 all remote heads known locally
1215 1215 3 changesets found
1216 1216 list of changesets:
1217 1217 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1218 1218 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1219 1219 911600dab2ae7a9baff75958b84fe606851ce955
1220 1220 adding changesets
1221 1221 bundling: 1/3 changesets (33.33%)
1222 1222 bundling: 2/3 changesets (66.67%)
1223 1223 bundling: 3/3 changesets (100.00%)
1224 1224 bundling: 1/3 manifests (33.33%)
1225 1225 bundling: 2/3 manifests (66.67%)
1226 1226 bundling: 3/3 manifests (100.00%)
1227 1227 bundling: foo/Bar/file.txt 1/3 files (33.33%)
1228 1228 bundling: foo/file.txt 2/3 files (66.67%)
1229 1229 bundling: quux/file.py 3/3 files (100.00%)
1230 1230 changesets: 1 chunks
1231 1231 add changeset ef1ea85a6374
1232 1232 changesets: 2 chunks
1233 1233 add changeset f9cafe1212c8
1234 1234 changesets: 3 chunks
1235 1235 add changeset 911600dab2ae
1236 1236 adding manifests
1237 1237 manifests: 1/3 chunks (33.33%)
1238 1238 manifests: 2/3 chunks (66.67%)
1239 1239 manifests: 3/3 chunks (100.00%)
1240 1240 adding file changes
1241 1241 adding foo/Bar/file.txt revisions
1242 1242 files: 1/3 chunks (33.33%)
1243 1243 adding foo/file.txt revisions
1244 1244 files: 2/3 chunks (66.67%)
1245 1245 adding quux/file.py revisions
1246 1246 files: 3/3 chunks (100.00%)
1247 1247 added 3 changesets with 3 changes to 3 files
1248 1248 calling hook pretxnchangegroup.acl: hgext.acl.hook
1249 1249 acl: checking access for user "fred"
1250 1250 acl: acl.allow.branches not enabled
1251 1251 acl: acl.deny.branches not enabled
1252 1252 acl: "group1" not defined in [acl.groups]
1253 1253 acl: acl.allow enabled, 1 entries for user fred
1254 1254 acl: acl.deny not enabled
1255 1255 acl: branch access granted: "ef1ea85a6374" on branch "default"
1256 1256 acl: path access granted: "ef1ea85a6374"
1257 1257 acl: branch access granted: "f9cafe1212c8" on branch "default"
1258 1258 acl: path access granted: "f9cafe1212c8"
1259 1259 acl: branch access granted: "911600dab2ae" on branch "default"
1260 1260 acl: path access granted: "911600dab2ae"
1261 1261 updating the branch cache
1262 1262 checking for updated bookmarks
1263 1263 repository tip rolled back to revision 0 (undo push)
1264 1264 0:6675d58eff77
1265 1265
1266 1266
1267 1267 $ echo '[acl.deny]' >> $config
1268 1268 $ echo "foo/Bar/** = @group1" >> $config
1269 1269
1270 1270 @group is allowed inside anything but foo/Bar/
1271 1271
1272 1272 $ do_push fred
1273 1273 Pushing as user fred
1274 1274 hgrc = """
1275 1275 [acl]
1276 1276 sources = push
1277 1277 [extensions]
1278 1278 [acl.allow]
1279 1279 ** = @group1
1280 1280 [acl.deny]
1281 1281 foo/Bar/** = @group1
1282 1282 """
1283 1283 pushing to ../b
1284 1284 query 1; heads
1285 1285 searching for changes
1286 1286 all remote heads known locally
1287 1287 invalidating branch cache (tip differs)
1288 1288 3 changesets found
1289 1289 list of changesets:
1290 1290 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1291 1291 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1292 1292 911600dab2ae7a9baff75958b84fe606851ce955
1293 1293 adding changesets
1294 1294 bundling: 1/3 changesets (33.33%)
1295 1295 bundling: 2/3 changesets (66.67%)
1296 1296 bundling: 3/3 changesets (100.00%)
1297 1297 bundling: 1/3 manifests (33.33%)
1298 1298 bundling: 2/3 manifests (66.67%)
1299 1299 bundling: 3/3 manifests (100.00%)
1300 1300 bundling: foo/Bar/file.txt 1/3 files (33.33%)
1301 1301 bundling: foo/file.txt 2/3 files (66.67%)
1302 1302 bundling: quux/file.py 3/3 files (100.00%)
1303 1303 changesets: 1 chunks
1304 1304 add changeset ef1ea85a6374
1305 1305 changesets: 2 chunks
1306 1306 add changeset f9cafe1212c8
1307 1307 changesets: 3 chunks
1308 1308 add changeset 911600dab2ae
1309 1309 adding manifests
1310 1310 manifests: 1/3 chunks (33.33%)
1311 1311 manifests: 2/3 chunks (66.67%)
1312 1312 manifests: 3/3 chunks (100.00%)
1313 1313 adding file changes
1314 1314 adding foo/Bar/file.txt revisions
1315 1315 files: 1/3 chunks (33.33%)
1316 1316 adding foo/file.txt revisions
1317 1317 files: 2/3 chunks (66.67%)
1318 1318 adding quux/file.py revisions
1319 1319 files: 3/3 chunks (100.00%)
1320 1320 added 3 changesets with 3 changes to 3 files
1321 1321 calling hook pretxnchangegroup.acl: hgext.acl.hook
1322 1322 acl: checking access for user "fred"
1323 1323 acl: acl.allow.branches not enabled
1324 1324 acl: acl.deny.branches not enabled
1325 1325 acl: "group1" not defined in [acl.groups]
1326 1326 acl: acl.allow enabled, 1 entries for user fred
1327 1327 acl: "group1" not defined in [acl.groups]
1328 1328 acl: acl.deny enabled, 1 entries for user fred
1329 1329 acl: branch access granted: "ef1ea85a6374" on branch "default"
1330 1330 acl: path access granted: "ef1ea85a6374"
1331 1331 acl: branch access granted: "f9cafe1212c8" on branch "default"
1332 1332 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1333 1333 transaction abort!
1334 1334 rollback completed
1335 1335 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1336 1336 no rollback information available
1337 1337 0:6675d58eff77
1338 1338
1339 1339
1340 1340 Invalid group
1341 1341
1342 1342 Disable the fakegroups trick to get real failures
1343 1343
1344 1344 $ grep -v fakegroups $config > config.tmp
1345 1345 $ mv config.tmp $config
1346 1346 $ echo '[acl.allow]' >> $config
1347 1347 $ echo "** = @unlikelytoexist" >> $config
1348 1348 $ do_push fred 2>&1 | grep unlikelytoexist
1349 1349 ** = @unlikelytoexist
1350 1350 acl: "unlikelytoexist" not defined in [acl.groups]
1351 1351 error: pretxnchangegroup.acl hook failed: group 'unlikelytoexist' is undefined
1352 1352 abort: group 'unlikelytoexist' is undefined
1353 1353
1354 1354
1355 1355 Branch acl tests setup
1356 1356
1357 1357 $ init_config
1358 1358 $ cd b
1359 1359 $ hg up
1360 1360 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1361 1361 $ hg branch foobar
1362 1362 marked working directory as branch foobar
1363 1363 $ hg commit -m 'create foobar'
1364 1364 $ echo 'foo contents' > abc.txt
1365 1365 $ hg add abc.txt
1366 1366 $ hg commit -m 'foobar contents'
1367 1367 $ cd ..
1368 1368 $ hg --cwd a pull ../b
1369 1369 pulling from ../b
1370 1370 searching for changes
1371 1371 adding changesets
1372 1372 adding manifests
1373 1373 adding file changes
1374 1374 added 2 changesets with 1 changes to 1 files (+1 heads)
1375 1375 (run 'hg heads' to see heads)
1376 1376
1377 1377 Create additional changeset on foobar branch
1378 1378
1379 1379 $ cd a
1380 1380 $ hg up -C foobar
1381 1381 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1382 1382 $ echo 'foo contents2' > abc.txt
1383 1383 $ hg commit -m 'foobar contents2'
1384 1384 $ cd ..
1385 1385
1386 1386
1387 1387 No branch acls specified
1388 1388
1389 1389 $ do_push astro
1390 1390 Pushing as user astro
1391 1391 hgrc = """
1392 1392 [acl]
1393 1393 sources = push
1394 1394 [extensions]
1395 1395 """
1396 1396 pushing to ../b
1397 1397 query 1; heads
1398 1398 searching for changes
1399 1399 all remote heads known locally
1400 1400 4 changesets found
1401 1401 list of changesets:
1402 1402 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1403 1403 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1404 1404 911600dab2ae7a9baff75958b84fe606851ce955
1405 1405 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1406 1406 adding changesets
1407 1407 bundling: 1/4 changesets (25.00%)
1408 1408 bundling: 2/4 changesets (50.00%)
1409 1409 bundling: 3/4 changesets (75.00%)
1410 1410 bundling: 4/4 changesets (100.00%)
1411 1411 bundling: 1/4 manifests (25.00%)
1412 1412 bundling: 2/4 manifests (50.00%)
1413 1413 bundling: 3/4 manifests (75.00%)
1414 1414 bundling: 4/4 manifests (100.00%)
1415 1415 bundling: abc.txt 1/4 files (25.00%)
1416 1416 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1417 1417 bundling: foo/file.txt 3/4 files (75.00%)
1418 1418 bundling: quux/file.py 4/4 files (100.00%)
1419 1419 changesets: 1 chunks
1420 1420 add changeset ef1ea85a6374
1421 1421 changesets: 2 chunks
1422 1422 add changeset f9cafe1212c8
1423 1423 changesets: 3 chunks
1424 1424 add changeset 911600dab2ae
1425 1425 changesets: 4 chunks
1426 1426 add changeset e8fc755d4d82
1427 1427 adding manifests
1428 1428 manifests: 1/4 chunks (25.00%)
1429 1429 manifests: 2/4 chunks (50.00%)
1430 1430 manifests: 3/4 chunks (75.00%)
1431 1431 manifests: 4/4 chunks (100.00%)
1432 1432 adding file changes
1433 1433 adding abc.txt revisions
1434 1434 files: 1/4 chunks (25.00%)
1435 1435 adding foo/Bar/file.txt revisions
1436 1436 files: 2/4 chunks (50.00%)
1437 1437 adding foo/file.txt revisions
1438 1438 files: 3/4 chunks (75.00%)
1439 1439 adding quux/file.py revisions
1440 1440 files: 4/4 chunks (100.00%)
1441 1441 added 4 changesets with 4 changes to 4 files (+1 heads)
1442 1442 calling hook pretxnchangegroup.acl: hgext.acl.hook
1443 1443 acl: checking access for user "astro"
1444 1444 acl: acl.allow.branches not enabled
1445 1445 acl: acl.deny.branches not enabled
1446 1446 acl: acl.allow not enabled
1447 1447 acl: acl.deny not enabled
1448 1448 acl: branch access granted: "ef1ea85a6374" on branch "default"
1449 1449 acl: path access granted: "ef1ea85a6374"
1450 1450 acl: branch access granted: "f9cafe1212c8" on branch "default"
1451 1451 acl: path access granted: "f9cafe1212c8"
1452 1452 acl: branch access granted: "911600dab2ae" on branch "default"
1453 1453 acl: path access granted: "911600dab2ae"
1454 1454 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1455 1455 acl: path access granted: "e8fc755d4d82"
1456 1456 updating the branch cache
1457 1457 checking for updated bookmarks
1458 1458 repository tip rolled back to revision 2 (undo push)
1459 1459 2:fb35475503ef
1460 1460
1461 1461
1462 1462 Branch acl deny test
1463 1463
1464 1464 $ echo "[acl.deny.branches]" >> $config
1465 1465 $ echo "foobar = *" >> $config
1466 1466 $ do_push astro
1467 1467 Pushing as user astro
1468 1468 hgrc = """
1469 1469 [acl]
1470 1470 sources = push
1471 1471 [extensions]
1472 1472 [acl.deny.branches]
1473 1473 foobar = *
1474 1474 """
1475 1475 pushing to ../b
1476 1476 query 1; heads
1477 1477 searching for changes
1478 1478 all remote heads known locally
1479 1479 invalidating branch cache (tip differs)
1480 1480 4 changesets found
1481 1481 list of changesets:
1482 1482 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1483 1483 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1484 1484 911600dab2ae7a9baff75958b84fe606851ce955
1485 1485 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1486 1486 adding changesets
1487 1487 bundling: 1/4 changesets (25.00%)
1488 1488 bundling: 2/4 changesets (50.00%)
1489 1489 bundling: 3/4 changesets (75.00%)
1490 1490 bundling: 4/4 changesets (100.00%)
1491 1491 bundling: 1/4 manifests (25.00%)
1492 1492 bundling: 2/4 manifests (50.00%)
1493 1493 bundling: 3/4 manifests (75.00%)
1494 1494 bundling: 4/4 manifests (100.00%)
1495 1495 bundling: abc.txt 1/4 files (25.00%)
1496 1496 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1497 1497 bundling: foo/file.txt 3/4 files (75.00%)
1498 1498 bundling: quux/file.py 4/4 files (100.00%)
1499 1499 changesets: 1 chunks
1500 1500 add changeset ef1ea85a6374
1501 1501 changesets: 2 chunks
1502 1502 add changeset f9cafe1212c8
1503 1503 changesets: 3 chunks
1504 1504 add changeset 911600dab2ae
1505 1505 changesets: 4 chunks
1506 1506 add changeset e8fc755d4d82
1507 1507 adding manifests
1508 1508 manifests: 1/4 chunks (25.00%)
1509 1509 manifests: 2/4 chunks (50.00%)
1510 1510 manifests: 3/4 chunks (75.00%)
1511 1511 manifests: 4/4 chunks (100.00%)
1512 1512 adding file changes
1513 1513 adding abc.txt revisions
1514 1514 files: 1/4 chunks (25.00%)
1515 1515 adding foo/Bar/file.txt revisions
1516 1516 files: 2/4 chunks (50.00%)
1517 1517 adding foo/file.txt revisions
1518 1518 files: 3/4 chunks (75.00%)
1519 1519 adding quux/file.py revisions
1520 1520 files: 4/4 chunks (100.00%)
1521 1521 added 4 changesets with 4 changes to 4 files (+1 heads)
1522 1522 calling hook pretxnchangegroup.acl: hgext.acl.hook
1523 1523 acl: checking access for user "astro"
1524 1524 acl: acl.allow.branches not enabled
1525 1525 acl: acl.deny.branches enabled, 1 entries for user astro
1526 1526 acl: acl.allow not enabled
1527 1527 acl: acl.deny not enabled
1528 1528 acl: branch access granted: "ef1ea85a6374" on branch "default"
1529 1529 acl: path access granted: "ef1ea85a6374"
1530 1530 acl: branch access granted: "f9cafe1212c8" on branch "default"
1531 1531 acl: path access granted: "f9cafe1212c8"
1532 1532 acl: branch access granted: "911600dab2ae" on branch "default"
1533 1533 acl: path access granted: "911600dab2ae"
1534 1534 error: pretxnchangegroup.acl hook failed: acl: user "astro" denied on branch "foobar" (changeset "e8fc755d4d82")
1535 1535 transaction abort!
1536 1536 rollback completed
1537 1537 abort: acl: user "astro" denied on branch "foobar" (changeset "e8fc755d4d82")
1538 1538 no rollback information available
1539 1539 2:fb35475503ef
1540 1540
1541 1541
1542 1542 Branch acl empty allow test
1543 1543
1544 1544 $ init_config
1545 1545 $ echo "[acl.allow.branches]" >> $config
1546 1546 $ do_push astro
1547 1547 Pushing as user astro
1548 1548 hgrc = """
1549 1549 [acl]
1550 1550 sources = push
1551 1551 [extensions]
1552 1552 [acl.allow.branches]
1553 1553 """
1554 1554 pushing to ../b
1555 1555 query 1; heads
1556 1556 searching for changes
1557 1557 all remote heads known locally
1558 1558 4 changesets found
1559 1559 list of changesets:
1560 1560 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1561 1561 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1562 1562 911600dab2ae7a9baff75958b84fe606851ce955
1563 1563 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1564 1564 adding changesets
1565 1565 bundling: 1/4 changesets (25.00%)
1566 1566 bundling: 2/4 changesets (50.00%)
1567 1567 bundling: 3/4 changesets (75.00%)
1568 1568 bundling: 4/4 changesets (100.00%)
1569 1569 bundling: 1/4 manifests (25.00%)
1570 1570 bundling: 2/4 manifests (50.00%)
1571 1571 bundling: 3/4 manifests (75.00%)
1572 1572 bundling: 4/4 manifests (100.00%)
1573 1573 bundling: abc.txt 1/4 files (25.00%)
1574 1574 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1575 1575 bundling: foo/file.txt 3/4 files (75.00%)
1576 1576 bundling: quux/file.py 4/4 files (100.00%)
1577 1577 changesets: 1 chunks
1578 1578 add changeset ef1ea85a6374
1579 1579 changesets: 2 chunks
1580 1580 add changeset f9cafe1212c8
1581 1581 changesets: 3 chunks
1582 1582 add changeset 911600dab2ae
1583 1583 changesets: 4 chunks
1584 1584 add changeset e8fc755d4d82
1585 1585 adding manifests
1586 1586 manifests: 1/4 chunks (25.00%)
1587 1587 manifests: 2/4 chunks (50.00%)
1588 1588 manifests: 3/4 chunks (75.00%)
1589 1589 manifests: 4/4 chunks (100.00%)
1590 1590 adding file changes
1591 1591 adding abc.txt revisions
1592 1592 files: 1/4 chunks (25.00%)
1593 1593 adding foo/Bar/file.txt revisions
1594 1594 files: 2/4 chunks (50.00%)
1595 1595 adding foo/file.txt revisions
1596 1596 files: 3/4 chunks (75.00%)
1597 1597 adding quux/file.py revisions
1598 1598 files: 4/4 chunks (100.00%)
1599 1599 added 4 changesets with 4 changes to 4 files (+1 heads)
1600 1600 calling hook pretxnchangegroup.acl: hgext.acl.hook
1601 1601 acl: checking access for user "astro"
1602 1602 acl: acl.allow.branches enabled, 0 entries for user astro
1603 1603 acl: acl.deny.branches not enabled
1604 1604 acl: acl.allow not enabled
1605 1605 acl: acl.deny not enabled
1606 1606 error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1607 1607 transaction abort!
1608 1608 rollback completed
1609 1609 abort: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1610 1610 no rollback information available
1611 1611 2:fb35475503ef
1612 1612
1613 1613
1614 1614 Branch acl allow other
1615 1615
1616 1616 $ init_config
1617 1617 $ echo "[acl.allow.branches]" >> $config
1618 1618 $ echo "* = george" >> $config
1619 1619 $ do_push astro
1620 1620 Pushing as user astro
1621 1621 hgrc = """
1622 1622 [acl]
1623 1623 sources = push
1624 1624 [extensions]
1625 1625 [acl.allow.branches]
1626 1626 * = george
1627 1627 """
1628 1628 pushing to ../b
1629 1629 query 1; heads
1630 1630 searching for changes
1631 1631 all remote heads known locally
1632 1632 4 changesets found
1633 1633 list of changesets:
1634 1634 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1635 1635 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1636 1636 911600dab2ae7a9baff75958b84fe606851ce955
1637 1637 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1638 1638 adding changesets
1639 1639 bundling: 1/4 changesets (25.00%)
1640 1640 bundling: 2/4 changesets (50.00%)
1641 1641 bundling: 3/4 changesets (75.00%)
1642 1642 bundling: 4/4 changesets (100.00%)
1643 1643 bundling: 1/4 manifests (25.00%)
1644 1644 bundling: 2/4 manifests (50.00%)
1645 1645 bundling: 3/4 manifests (75.00%)
1646 1646 bundling: 4/4 manifests (100.00%)
1647 1647 bundling: abc.txt 1/4 files (25.00%)
1648 1648 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1649 1649 bundling: foo/file.txt 3/4 files (75.00%)
1650 1650 bundling: quux/file.py 4/4 files (100.00%)
1651 1651 changesets: 1 chunks
1652 1652 add changeset ef1ea85a6374
1653 1653 changesets: 2 chunks
1654 1654 add changeset f9cafe1212c8
1655 1655 changesets: 3 chunks
1656 1656 add changeset 911600dab2ae
1657 1657 changesets: 4 chunks
1658 1658 add changeset e8fc755d4d82
1659 1659 adding manifests
1660 1660 manifests: 1/4 chunks (25.00%)
1661 1661 manifests: 2/4 chunks (50.00%)
1662 1662 manifests: 3/4 chunks (75.00%)
1663 1663 manifests: 4/4 chunks (100.00%)
1664 1664 adding file changes
1665 1665 adding abc.txt revisions
1666 1666 files: 1/4 chunks (25.00%)
1667 1667 adding foo/Bar/file.txt revisions
1668 1668 files: 2/4 chunks (50.00%)
1669 1669 adding foo/file.txt revisions
1670 1670 files: 3/4 chunks (75.00%)
1671 1671 adding quux/file.py revisions
1672 1672 files: 4/4 chunks (100.00%)
1673 1673 added 4 changesets with 4 changes to 4 files (+1 heads)
1674 1674 calling hook pretxnchangegroup.acl: hgext.acl.hook
1675 1675 acl: checking access for user "astro"
1676 1676 acl: acl.allow.branches enabled, 0 entries for user astro
1677 1677 acl: acl.deny.branches not enabled
1678 1678 acl: acl.allow not enabled
1679 1679 acl: acl.deny not enabled
1680 1680 error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1681 1681 transaction abort!
1682 1682 rollback completed
1683 1683 abort: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1684 1684 no rollback information available
1685 1685 2:fb35475503ef
1686 1686
1687 1687 $ do_push george
1688 1688 Pushing as user george
1689 1689 hgrc = """
1690 1690 [acl]
1691 1691 sources = push
1692 1692 [extensions]
1693 1693 [acl.allow.branches]
1694 1694 * = george
1695 1695 """
1696 1696 pushing to ../b
1697 1697 query 1; heads
1698 1698 searching for changes
1699 1699 all remote heads known locally
1700 1700 4 changesets found
1701 1701 list of changesets:
1702 1702 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1703 1703 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1704 1704 911600dab2ae7a9baff75958b84fe606851ce955
1705 1705 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1706 1706 adding changesets
1707 1707 bundling: 1/4 changesets (25.00%)
1708 1708 bundling: 2/4 changesets (50.00%)
1709 1709 bundling: 3/4 changesets (75.00%)
1710 1710 bundling: 4/4 changesets (100.00%)
1711 1711 bundling: 1/4 manifests (25.00%)
1712 1712 bundling: 2/4 manifests (50.00%)
1713 1713 bundling: 3/4 manifests (75.00%)
1714 1714 bundling: 4/4 manifests (100.00%)
1715 1715 bundling: abc.txt 1/4 files (25.00%)
1716 1716 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1717 1717 bundling: foo/file.txt 3/4 files (75.00%)
1718 1718 bundling: quux/file.py 4/4 files (100.00%)
1719 1719 changesets: 1 chunks
1720 1720 add changeset ef1ea85a6374
1721 1721 changesets: 2 chunks
1722 1722 add changeset f9cafe1212c8
1723 1723 changesets: 3 chunks
1724 1724 add changeset 911600dab2ae
1725 1725 changesets: 4 chunks
1726 1726 add changeset e8fc755d4d82
1727 1727 adding manifests
1728 1728 manifests: 1/4 chunks (25.00%)
1729 1729 manifests: 2/4 chunks (50.00%)
1730 1730 manifests: 3/4 chunks (75.00%)
1731 1731 manifests: 4/4 chunks (100.00%)
1732 1732 adding file changes
1733 1733 adding abc.txt revisions
1734 1734 files: 1/4 chunks (25.00%)
1735 1735 adding foo/Bar/file.txt revisions
1736 1736 files: 2/4 chunks (50.00%)
1737 1737 adding foo/file.txt revisions
1738 1738 files: 3/4 chunks (75.00%)
1739 1739 adding quux/file.py revisions
1740 1740 files: 4/4 chunks (100.00%)
1741 1741 added 4 changesets with 4 changes to 4 files (+1 heads)
1742 1742 calling hook pretxnchangegroup.acl: hgext.acl.hook
1743 1743 acl: checking access for user "george"
1744 1744 acl: acl.allow.branches enabled, 1 entries for user george
1745 1745 acl: acl.deny.branches not enabled
1746 1746 acl: acl.allow not enabled
1747 1747 acl: acl.deny not enabled
1748 1748 acl: branch access granted: "ef1ea85a6374" on branch "default"
1749 1749 acl: path access granted: "ef1ea85a6374"
1750 1750 acl: branch access granted: "f9cafe1212c8" on branch "default"
1751 1751 acl: path access granted: "f9cafe1212c8"
1752 1752 acl: branch access granted: "911600dab2ae" on branch "default"
1753 1753 acl: path access granted: "911600dab2ae"
1754 1754 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1755 1755 acl: path access granted: "e8fc755d4d82"
1756 1756 updating the branch cache
1757 1757 checking for updated bookmarks
1758 1758 repository tip rolled back to revision 2 (undo push)
1759 1759 2:fb35475503ef
1760 1760
1761 1761
1762 1762 Branch acl conflicting allow
1763 1763 asterisk ends up applying to all branches and allowing george to
1764 1764 push foobar into the remote
1765 1765
1766 1766 $ init_config
1767 1767 $ echo "[acl.allow.branches]" >> $config
1768 1768 $ echo "foobar = astro" >> $config
1769 1769 $ echo "* = george" >> $config
1770 1770 $ do_push george
1771 1771 Pushing as user george
1772 1772 hgrc = """
1773 1773 [acl]
1774 1774 sources = push
1775 1775 [extensions]
1776 1776 [acl.allow.branches]
1777 1777 foobar = astro
1778 1778 * = george
1779 1779 """
1780 1780 pushing to ../b
1781 1781 query 1; heads
1782 1782 searching for changes
1783 1783 all remote heads known locally
1784 1784 invalidating branch cache (tip differs)
1785 1785 4 changesets found
1786 1786 list of changesets:
1787 1787 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1788 1788 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1789 1789 911600dab2ae7a9baff75958b84fe606851ce955
1790 1790 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1791 1791 adding changesets
1792 1792 bundling: 1/4 changesets (25.00%)
1793 1793 bundling: 2/4 changesets (50.00%)
1794 1794 bundling: 3/4 changesets (75.00%)
1795 1795 bundling: 4/4 changesets (100.00%)
1796 1796 bundling: 1/4 manifests (25.00%)
1797 1797 bundling: 2/4 manifests (50.00%)
1798 1798 bundling: 3/4 manifests (75.00%)
1799 1799 bundling: 4/4 manifests (100.00%)
1800 1800 bundling: abc.txt 1/4 files (25.00%)
1801 1801 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1802 1802 bundling: foo/file.txt 3/4 files (75.00%)
1803 1803 bundling: quux/file.py 4/4 files (100.00%)
1804 1804 changesets: 1 chunks
1805 1805 add changeset ef1ea85a6374
1806 1806 changesets: 2 chunks
1807 1807 add changeset f9cafe1212c8
1808 1808 changesets: 3 chunks
1809 1809 add changeset 911600dab2ae
1810 1810 changesets: 4 chunks
1811 1811 add changeset e8fc755d4d82
1812 1812 adding manifests
1813 1813 manifests: 1/4 chunks (25.00%)
1814 1814 manifests: 2/4 chunks (50.00%)
1815 1815 manifests: 3/4 chunks (75.00%)
1816 1816 manifests: 4/4 chunks (100.00%)
1817 1817 adding file changes
1818 1818 adding abc.txt revisions
1819 1819 files: 1/4 chunks (25.00%)
1820 1820 adding foo/Bar/file.txt revisions
1821 1821 files: 2/4 chunks (50.00%)
1822 1822 adding foo/file.txt revisions
1823 1823 files: 3/4 chunks (75.00%)
1824 1824 adding quux/file.py revisions
1825 1825 files: 4/4 chunks (100.00%)
1826 1826 added 4 changesets with 4 changes to 4 files (+1 heads)
1827 1827 calling hook pretxnchangegroup.acl: hgext.acl.hook
1828 1828 acl: checking access for user "george"
1829 1829 acl: acl.allow.branches enabled, 1 entries for user george
1830 1830 acl: acl.deny.branches not enabled
1831 1831 acl: acl.allow not enabled
1832 1832 acl: acl.deny not enabled
1833 1833 acl: branch access granted: "ef1ea85a6374" on branch "default"
1834 1834 acl: path access granted: "ef1ea85a6374"
1835 1835 acl: branch access granted: "f9cafe1212c8" on branch "default"
1836 1836 acl: path access granted: "f9cafe1212c8"
1837 1837 acl: branch access granted: "911600dab2ae" on branch "default"
1838 1838 acl: path access granted: "911600dab2ae"
1839 1839 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1840 1840 acl: path access granted: "e8fc755d4d82"
1841 1841 updating the branch cache
1842 1842 checking for updated bookmarks
1843 1843 repository tip rolled back to revision 2 (undo push)
1844 1844 2:fb35475503ef
1845 1845
1846 1846 Branch acl conflicting deny
1847 1847
1848 1848 $ init_config
1849 1849 $ echo "[acl.deny.branches]" >> $config
1850 1850 $ echo "foobar = astro" >> $config
1851 1851 $ echo "default = astro" >> $config
1852 1852 $ echo "* = george" >> $config
1853 1853 $ do_push george
1854 1854 Pushing as user george
1855 1855 hgrc = """
1856 1856 [acl]
1857 1857 sources = push
1858 1858 [extensions]
1859 1859 [acl.deny.branches]
1860 1860 foobar = astro
1861 1861 default = astro
1862 1862 * = george
1863 1863 """
1864 1864 pushing to ../b
1865 1865 query 1; heads
1866 1866 searching for changes
1867 1867 all remote heads known locally
1868 1868 invalidating branch cache (tip differs)
1869 1869 4 changesets found
1870 1870 list of changesets:
1871 1871 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1872 1872 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1873 1873 911600dab2ae7a9baff75958b84fe606851ce955
1874 1874 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1875 1875 adding changesets
1876 1876 bundling: 1/4 changesets (25.00%)
1877 1877 bundling: 2/4 changesets (50.00%)
1878 1878 bundling: 3/4 changesets (75.00%)
1879 1879 bundling: 4/4 changesets (100.00%)
1880 1880 bundling: 1/4 manifests (25.00%)
1881 1881 bundling: 2/4 manifests (50.00%)
1882 1882 bundling: 3/4 manifests (75.00%)
1883 1883 bundling: 4/4 manifests (100.00%)
1884 1884 bundling: abc.txt 1/4 files (25.00%)
1885 1885 bundling: foo/Bar/file.txt 2/4 files (50.00%)
1886 1886 bundling: foo/file.txt 3/4 files (75.00%)
1887 1887 bundling: quux/file.py 4/4 files (100.00%)
1888 1888 changesets: 1 chunks
1889 1889 add changeset ef1ea85a6374
1890 1890 changesets: 2 chunks
1891 1891 add changeset f9cafe1212c8
1892 1892 changesets: 3 chunks
1893 1893 add changeset 911600dab2ae
1894 1894 changesets: 4 chunks
1895 1895 add changeset e8fc755d4d82
1896 1896 adding manifests
1897 1897 manifests: 1/4 chunks (25.00%)
1898 1898 manifests: 2/4 chunks (50.00%)
1899 1899 manifests: 3/4 chunks (75.00%)
1900 1900 manifests: 4/4 chunks (100.00%)
1901 1901 adding file changes
1902 1902 adding abc.txt revisions
1903 1903 files: 1/4 chunks (25.00%)
1904 1904 adding foo/Bar/file.txt revisions
1905 1905 files: 2/4 chunks (50.00%)
1906 1906 adding foo/file.txt revisions
1907 1907 files: 3/4 chunks (75.00%)
1908 1908 adding quux/file.py revisions
1909 1909 files: 4/4 chunks (100.00%)
1910 1910 added 4 changesets with 4 changes to 4 files (+1 heads)
1911 1911 calling hook pretxnchangegroup.acl: hgext.acl.hook
1912 1912 acl: checking access for user "george"
1913 1913 acl: acl.allow.branches not enabled
1914 1914 acl: acl.deny.branches enabled, 1 entries for user george
1915 1915 acl: acl.allow not enabled
1916 1916 acl: acl.deny not enabled
1917 1917 error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
1918 1918 transaction abort!
1919 1919 rollback completed
1920 1920 abort: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
1921 1921 no rollback information available
1922 1922 2:fb35475503ef
1923 1923
@@ -1,136 +1,136 b''
1 1 $ "$TESTDIR/hghave" no-windows || exit 80
2 2
3 3 $ hg init a
4 4 $ cd a
5 5 $ echo a > a
6 6 $ hg add -n
7 7 adding a
8 8 $ hg st
9 9 ? a
10 10 $ hg add
11 11 adding a
12 12 $ hg st
13 13 A a
14 14 $ hg forget a
15 15 $ hg add
16 16 adding a
17 17 $ hg st
18 18 A a
19 19
20 20 $ echo b > b
21 21 $ hg add -n b
22 22 $ hg st
23 23 A a
24 24 ? b
25 25 $ hg add b
26 26 $ hg st
27 27 A a
28 28 A b
29 29
30 30 should fail
31 31
32 32 $ hg add b
33 33 b already tracked!
34 34 $ hg st
35 35 A a
36 36 A b
37 37
38 38 $ echo foo > con.xml
39 39 $ hg --config ui.portablefilenames=jump add con.xml
40 40 abort: ui.portablefilenames value is invalid ('jump')
41 41 [255]
42 42 $ hg --config ui.portablefilenames=abort add con.xml
43 43 abort: filename contains 'con', which is reserved on Windows: 'con.xml'
44 44 [255]
45 45 $ hg st
46 46 A a
47 47 A b
48 48 ? con.xml
49 49 $ hg add con.xml
50 50 warning: filename contains 'con', which is reserved on Windows: 'con.xml'
51 51 $ hg st
52 52 A a
53 53 A b
54 54 A con.xml
55 55 $ echo bla > 'hello:world'
56 56 $ hg --config ui.portablefilenames=abort add
57 57 adding hello:world
58 58 abort: filename contains ':', which is reserved on Windows: 'hello:world'
59 59 [255]
60 60 $ hg st
61 61 A a
62 62 A b
63 63 A con.xml
64 64 ? hello:world
65 65 $ hg --config ui.portablefilenames=ignore add
66 66 adding hello:world
67 67 $ hg st
68 68 A a
69 69 A b
70 70 A con.xml
71 71 A hello:world
72 72
73 73 $ hg ci -m 0 --traceback
74 74
75 75 should fail
76 76
77 77 $ hg add a
78 78 a already tracked!
79 79
80 80 $ echo aa > a
81 81 $ hg ci -m 1
82 82 $ hg up 0
83 83 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 84 $ echo aaa > a
85 85 $ hg ci -m 2
86 86 created new head
87 87
88 88 $ hg merge
89 89 merging a
90 90 warning: conflicts during merge.
91 91 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
92 92 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
93 93 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
94 94 [1]
95 95 $ hg st
96 96 M a
97 97 ? a.orig
98 98
99 99 should fail
100 100
101 101 $ hg add a
102 102 a already tracked!
103 103 $ hg st
104 104 M a
105 105 ? a.orig
106 106 $ hg resolve -m a
107 107 $ hg ci -m merge
108 108
109 109 Issue683: peculiarity with hg revert of an removed then added file
110 110
111 111 $ hg forget a
112 112 $ hg add a
113 113 $ hg st
114 114 ? a.orig
115 115 $ hg rm a
116 116 $ hg st
117 117 R a
118 118 ? a.orig
119 119 $ echo a > a
120 120 $ hg add a
121 121 $ hg st
122 122 M a
123 123 ? a.orig
124 124
125 125 $ hg add c && echo "unexpected addition of missing file"
126 c: No such file or directory
126 c: * (glob)
127 127 [1]
128 128 $ echo c > c
129 129 $ hg add d c && echo "unexpected addition of missing file"
130 d: No such file or directory
130 d: * (glob)
131 131 [1]
132 132 $ hg st
133 133 M a
134 134 A c
135 135 ? a.orig
136 136
@@ -1,84 +1,84 b''
1 1 $ "$TESTDIR/hghave" symlink || exit 80
2 2
3 3 $ hg init
4 4
5 5 should fail
6 6
7 7 $ hg add .hg/00changelog.i
8 8 abort: path contains illegal component: .hg/00changelog.i (glob)
9 9 [255]
10 10
11 11 $ mkdir a
12 12 $ echo a > a/a
13 13 $ hg ci -Ama
14 14 adding a/a
15 15 $ ln -s a b
16 16 $ echo b > a/b
17 17
18 18 should fail
19 19
20 20 $ hg add b/b
21 21 abort: path 'b/b' traverses symbolic link 'b' (glob)
22 22 [255]
23 23
24 24 should succeed
25 25
26 26 $ hg add b
27 27
28 28 should still fail - maybe
29 29
30 30 $ hg add b/b
31 31 abort: path 'b/b' traverses symbolic link 'b' (glob)
32 32 [255]
33 33
34 34 unbundle tampered bundle
35 35
36 36 $ hg init target
37 37 $ cd target
38 38 $ hg unbundle $TESTDIR/bundles/tampered.hg
39 39 adding changesets
40 40 adding manifests
41 41 adding file changes
42 42 added 5 changesets with 6 changes to 6 files (+4 heads)
43 43 (run 'hg heads' to see heads, 'hg merge' to merge)
44 44
45 45 attack .hg/test
46 46
47 47 $ hg manifest -r0
48 48 .hg/test
49 49 $ hg update -Cr0
50 50 abort: path contains illegal component: .hg/test
51 51 [255]
52 52
53 53 attack foo/.hg/test
54 54
55 55 $ hg manifest -r1
56 56 foo/.hg/test
57 57 $ hg update -Cr1
58 58 abort: path 'foo/.hg/test' is inside nested repo 'foo'
59 59 [255]
60 60
61 61 attack back/test where back symlinks to ..
62 62
63 63 $ hg manifest -r2
64 64 back
65 65 back/test
66 66 $ hg update -Cr2
67 67 abort: path 'back/test' traverses symbolic link 'back'
68 68 [255]
69 69
70 70 attack ../test
71 71
72 72 $ hg manifest -r3
73 73 ../test
74 74 $ hg update -Cr3
75 75 abort: path contains illegal component: ../test
76 76 [255]
77 77
78 78 attack /tmp/test
79 79
80 80 $ hg manifest -r4
81 81 /tmp/test
82 82 $ hg update -Cr4
83 abort: No such file or directory: $TESTTMP/target//tmp/test
83 abort: *: $TESTTMP/target//tmp/test (glob)
84 84 [255]
@@ -1,288 +1,288 b''
1 1 $ hg init basic
2 2 $ cd basic
3 3
4 4 should complain
5 5
6 6 $ hg backout
7 7 abort: please specify a revision to backout
8 8 [255]
9 9 $ hg backout -r 0 0
10 10 abort: please specify just one revision
11 11 [255]
12 12
13 13 basic operation
14 14
15 15 $ echo a > a
16 16 $ hg commit -d '0 0' -A -m a
17 17 adding a
18 18 $ echo b >> a
19 19 $ hg commit -d '1 0' -m b
20 20
21 21 $ hg backout -d '2 0' tip --tool=true
22 22 reverting a
23 23 changeset 2:2929462c3dff backs out changeset 1:a820f4f40a57
24 24 $ cat a
25 25 a
26 26
27 27 file that was removed is recreated
28 28
29 29 $ cd ..
30 30 $ hg init remove
31 31 $ cd remove
32 32
33 33 $ echo content > a
34 34 $ hg commit -d '0 0' -A -m a
35 35 adding a
36 36
37 37 $ hg rm a
38 38 $ hg commit -d '1 0' -m b
39 39
40 40 $ hg backout -d '2 0' tip --tool=true
41 41 adding a
42 42 changeset 2:de31bdc76c0d backs out changeset 1:76862dcce372
43 43 $ cat a
44 44 content
45 45
46 46 backout of backout is as if nothing happened
47 47
48 48 $ hg backout -d '3 0' --merge tip --tool=true
49 49 removing a
50 50 changeset 3:7f6d0f120113 backs out changeset 2:de31bdc76c0d
51 $ cat a 2>/dev/null || echo cat: a: No such file or directory
52 cat: a: No such file or directory
51 $ test -f a
52 [1]
53 53
54 54 across branch
55 55
56 56 $ cd ..
57 57 $ hg init branch
58 58 $ cd branch
59 59 $ echo a > a
60 60 $ hg ci -Am0
61 61 adding a
62 62 $ echo b > b
63 63 $ hg ci -Am1
64 64 adding b
65 65 $ hg co -C 0
66 66 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
67 67
68 68 should fail
69 69
70 70 $ hg backout 1
71 71 abort: cannot backout change on a different branch
72 72 [255]
73 73 $ echo c > c
74 74 $ hg ci -Am2
75 75 adding c
76 76 created new head
77 77
78 78 should fail
79 79
80 80 $ hg backout 1
81 81 abort: cannot backout change on a different branch
82 82 [255]
83 83
84 84 backout with merge
85 85
86 86 $ cd ..
87 87 $ hg init merge
88 88 $ cd merge
89 89
90 90 $ echo line 1 > a
91 91 $ echo line 2 >> a
92 92 $ hg commit -d '0 0' -A -m a
93 93 adding a
94 94
95 95 remove line 1
96 96
97 97 $ echo line 2 > a
98 98 $ hg commit -d '1 0' -m b
99 99
100 100 $ echo line 3 >> a
101 101 $ hg commit -d '2 0' -m c
102 102
103 103 $ hg backout --merge -d '3 0' 1 --tool=true
104 104 reverting a
105 105 created new head
106 106 changeset 3:26b8ccb9ad91 backs out changeset 1:5a50a024c182
107 107 merging with changeset 3:26b8ccb9ad91
108 108 merging a
109 109 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
110 110 (branch merge, don't forget to commit)
111 111 $ hg commit -d '4 0' -m d
112 112
113 113 check line 1 is back
114 114
115 115 $ cat a
116 116 line 1
117 117 line 2
118 118 line 3
119 119
120 120 backout should not back out subsequent changesets
121 121
122 122 $ hg init onecs
123 123 $ cd onecs
124 124 $ echo 1 > a
125 125 $ hg commit -d '0 0' -A -m a
126 126 adding a
127 127 $ echo 2 >> a
128 128 $ hg commit -d '1 0' -m b
129 129 $ echo 1 > b
130 130 $ hg commit -d '2 0' -A -m c
131 131 adding b
132 132
133 133 without --merge
134 134 $ hg backout -d '3 0' 1 --tool=true
135 135 reverting a
136 136 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
137 137 $ hg locate b
138 138 b
139 139 $ hg update -C tip
140 140 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 141 $ hg locate b
142 142 b
143 143
144 144 with --merge
145 145 $ hg backout --merge -d '3 0' 1 --tool=true
146 146 reverting a
147 147 created new head
148 148 changeset 3:3202beb76721 backs out changeset 1:22bca4c721e5
149 149 merging with changeset 3:3202beb76721
150 150 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
151 151 (branch merge, don't forget to commit)
152 152 $ hg locate b
153 153 b
154 154 $ hg update -C tip
155 155 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
156 156 $ hg locate b
157 157 [1]
158 158
159 159 $ cd ..
160 160 $ hg init m
161 161 $ cd m
162 162 $ echo a > a
163 163 $ hg commit -d '0 0' -A -m a
164 164 adding a
165 165 $ echo b > b
166 166 $ hg commit -d '1 0' -A -m b
167 167 adding b
168 168 $ echo c > c
169 169 $ hg commit -d '2 0' -A -m b
170 170 adding c
171 171 $ hg update 1
172 172 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
173 173 $ echo d > d
174 174 $ hg commit -d '3 0' -A -m c
175 175 adding d
176 176 created new head
177 177 $ hg merge 2
178 178 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
179 179 (branch merge, don't forget to commit)
180 180 $ hg commit -d '4 0' -A -m d
181 181
182 182 backout of merge should fail
183 183
184 184 $ hg backout 4
185 185 abort: cannot backout a merge changeset
186 186 [255]
187 187
188 188 backout of merge with bad parent should fail
189 189
190 190 $ hg backout --parent 0 4
191 191 abort: cb9a9f314b8b is not a parent of b2f3bb92043e
192 192 [255]
193 193
194 194 backout of non-merge with parent should fail
195 195
196 196 $ hg backout --parent 0 3
197 197 abort: cannot use --parent on non-merge changeset
198 198 [255]
199 199
200 200 backout with valid parent should be ok
201 201
202 202 $ hg backout -d '5 0' --parent 2 4 --tool=true
203 203 removing d
204 204 changeset 5:10e5328c8435 backs out changeset 4:b2f3bb92043e
205 205
206 206 $ hg rollback
207 207 repository tip rolled back to revision 4 (undo commit)
208 208 working directory now based on revision 4
209 209 $ hg update -C
210 210 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
211 211
212 212 $ hg backout -d '6 0' --parent 3 4 --tool=true
213 213 removing c
214 214 changeset 5:033590168430 backs out changeset 4:b2f3bb92043e
215 215
216 216 $ cd ..
217 217
218 218 named branches
219 219
220 220 $ hg init named_branches
221 221 $ cd named_branches
222 222
223 223 $ echo default > default
224 224 $ hg ci -d '0 0' -Am default
225 225 adding default
226 226 $ hg branch branch1
227 227 marked working directory as branch branch1
228 228 $ echo branch1 > file1
229 229 $ hg ci -d '1 0' -Am file1
230 230 adding file1
231 231 $ hg branch branch2
232 232 marked working directory as branch branch2
233 233 $ echo branch2 > file2
234 234 $ hg ci -d '2 0' -Am file2
235 235 adding file2
236 236
237 237 without --merge
238 238 $ hg backout -r 1 --tool=true
239 239 removing file1
240 240 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
241 241 $ hg branch
242 242 branch2
243 243 $ hg status -A
244 244 R file1
245 245 C default
246 246 C file2
247 247
248 248 with --merge
249 249 $ hg update -qC
250 250 $ hg backout --merge -d '3 0' -r 1 -m 'backout on branch1' --tool=true
251 251 removing file1
252 252 created new head
253 253 changeset 3:d4e8f6db59fb backs out changeset 1:bf1602f437f3
254 254 merging with changeset 3:d4e8f6db59fb
255 255 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
256 256 (branch merge, don't forget to commit)
257 257 $ hg update -q -C 2
258 258
259 259 on branch2 with branch1 not merged, so file1 should still exist:
260 260
261 261 $ hg id
262 262 45bbcd363bf0 (branch2)
263 263 $ hg st -A
264 264 C default
265 265 C file1
266 266 C file2
267 267
268 268 on branch2 with branch1 merged, so file1 should be gone:
269 269
270 270 $ hg merge
271 271 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
272 272 (branch merge, don't forget to commit)
273 273 $ hg ci -d '4 0' -m 'merge backout of branch1'
274 274 $ hg id
275 275 22149cdde76d (branch2) tip
276 276 $ hg st -A
277 277 C default
278 278 C file2
279 279
280 280 on branch1, so no file1 and file2:
281 281
282 282 $ hg co -C branch1
283 283 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
284 284 $ hg id
285 285 bf1602f437f3 (branch1)
286 286 $ hg st -A
287 287 C default
288 288 C file1
@@ -1,32 +1,32 b''
1 1 $ "$TESTDIR/hghave" serve || exit 80
2 2
3 3 $ hg clone http://localhost:$HGPORT/ copy
4 4 abort: error: Connection refused
5 5 [255]
6 6
7 $ test -d copy || echo copy: No such file or directory
8 copy: No such file or directory
7 $ test -d copy
8 [1]
9 9
10 10 $ cat > dumb.py <<EOF
11 11 > import BaseHTTPServer, SimpleHTTPServer, os, signal
12 12 > def run(server_class=BaseHTTPServer.HTTPServer,
13 13 > handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
14 14 > server_address = ('localhost', int(os.environ['HGPORT']))
15 15 > httpd = server_class(server_address, handler_class)
16 16 > httpd.serve_forever()
17 17 > signal.signal(signal.SIGTERM, lambda x: sys.exit(0))
18 18 > run()
19 19 > EOF
20 20
21 21 $ python dumb.py 2>/dev/null &
22 22 $ echo $! >> $DAEMON_PIDS
23 23
24 24 give the server some time to start running
25 25
26 26 $ sleep 1
27 27
28 28 $ hg clone http://localhost:$HGPORT/foo copy2 2>&1
29 29 abort: HTTP Error 404: * (glob)
30 30 [255]
31 31
32 32 $ kill $!
@@ -1,466 +1,468 b''
1 $ "$TESTDIR/hghave" system-sh || exit 80
2
1 3 $ hg init
2 4
3 5
4 6 committing changes
5 7
6 8 $ count=0
7 9 $ echo > a
8 10 $ while test $count -lt 32 ; do
9 11 > echo 'a' >> a
10 12 > test $count -eq 0 && hg add
11 13 > hg ci -m "msg $count" -d "$count 0"
12 14 > count=`expr $count + 1`
13 15 > done
14 16 adding a
15 17
16 18
17 19 $ hg log
18 20 changeset: 31:58c80a7c8a40
19 21 tag: tip
20 22 user: test
21 23 date: Thu Jan 01 00:00:31 1970 +0000
22 24 summary: msg 31
23 25
24 26 changeset: 30:ed2d2f24b11c
25 27 user: test
26 28 date: Thu Jan 01 00:00:30 1970 +0000
27 29 summary: msg 30
28 30
29 31 changeset: 29:b5bd63375ab9
30 32 user: test
31 33 date: Thu Jan 01 00:00:29 1970 +0000
32 34 summary: msg 29
33 35
34 36 changeset: 28:8e0c2264c8af
35 37 user: test
36 38 date: Thu Jan 01 00:00:28 1970 +0000
37 39 summary: msg 28
38 40
39 41 changeset: 27:288867a866e9
40 42 user: test
41 43 date: Thu Jan 01 00:00:27 1970 +0000
42 44 summary: msg 27
43 45
44 46 changeset: 26:3efc6fd51aeb
45 47 user: test
46 48 date: Thu Jan 01 00:00:26 1970 +0000
47 49 summary: msg 26
48 50
49 51 changeset: 25:02a84173a97a
50 52 user: test
51 53 date: Thu Jan 01 00:00:25 1970 +0000
52 54 summary: msg 25
53 55
54 56 changeset: 24:10e0acd3809e
55 57 user: test
56 58 date: Thu Jan 01 00:00:24 1970 +0000
57 59 summary: msg 24
58 60
59 61 changeset: 23:5ec79163bff4
60 62 user: test
61 63 date: Thu Jan 01 00:00:23 1970 +0000
62 64 summary: msg 23
63 65
64 66 changeset: 22:06c7993750ce
65 67 user: test
66 68 date: Thu Jan 01 00:00:22 1970 +0000
67 69 summary: msg 22
68 70
69 71 changeset: 21:e5db6aa3fe2a
70 72 user: test
71 73 date: Thu Jan 01 00:00:21 1970 +0000
72 74 summary: msg 21
73 75
74 76 changeset: 20:7128fb4fdbc9
75 77 user: test
76 78 date: Thu Jan 01 00:00:20 1970 +0000
77 79 summary: msg 20
78 80
79 81 changeset: 19:52798545b482
80 82 user: test
81 83 date: Thu Jan 01 00:00:19 1970 +0000
82 84 summary: msg 19
83 85
84 86 changeset: 18:86977a90077e
85 87 user: test
86 88 date: Thu Jan 01 00:00:18 1970 +0000
87 89 summary: msg 18
88 90
89 91 changeset: 17:03515f4a9080
90 92 user: test
91 93 date: Thu Jan 01 00:00:17 1970 +0000
92 94 summary: msg 17
93 95
94 96 changeset: 16:a2e6ea4973e9
95 97 user: test
96 98 date: Thu Jan 01 00:00:16 1970 +0000
97 99 summary: msg 16
98 100
99 101 changeset: 15:e7fa0811edb0
100 102 user: test
101 103 date: Thu Jan 01 00:00:15 1970 +0000
102 104 summary: msg 15
103 105
104 106 changeset: 14:ce8f0998e922
105 107 user: test
106 108 date: Thu Jan 01 00:00:14 1970 +0000
107 109 summary: msg 14
108 110
109 111 changeset: 13:9d7d07bc967c
110 112 user: test
111 113 date: Thu Jan 01 00:00:13 1970 +0000
112 114 summary: msg 13
113 115
114 116 changeset: 12:1941b52820a5
115 117 user: test
116 118 date: Thu Jan 01 00:00:12 1970 +0000
117 119 summary: msg 12
118 120
119 121 changeset: 11:7b4cd9578619
120 122 user: test
121 123 date: Thu Jan 01 00:00:11 1970 +0000
122 124 summary: msg 11
123 125
124 126 changeset: 10:7c5eff49a6b6
125 127 user: test
126 128 date: Thu Jan 01 00:00:10 1970 +0000
127 129 summary: msg 10
128 130
129 131 changeset: 9:eb44510ef29a
130 132 user: test
131 133 date: Thu Jan 01 00:00:09 1970 +0000
132 134 summary: msg 9
133 135
134 136 changeset: 8:453eb4dba229
135 137 user: test
136 138 date: Thu Jan 01 00:00:08 1970 +0000
137 139 summary: msg 8
138 140
139 141 changeset: 7:03750880c6b5
140 142 user: test
141 143 date: Thu Jan 01 00:00:07 1970 +0000
142 144 summary: msg 7
143 145
144 146 changeset: 6:a3d5c6fdf0d3
145 147 user: test
146 148 date: Thu Jan 01 00:00:06 1970 +0000
147 149 summary: msg 6
148 150
149 151 changeset: 5:7874a09ea728
150 152 user: test
151 153 date: Thu Jan 01 00:00:05 1970 +0000
152 154 summary: msg 5
153 155
154 156 changeset: 4:9b2ba8336a65
155 157 user: test
156 158 date: Thu Jan 01 00:00:04 1970 +0000
157 159 summary: msg 4
158 160
159 161 changeset: 3:b53bea5e2fcb
160 162 user: test
161 163 date: Thu Jan 01 00:00:03 1970 +0000
162 164 summary: msg 3
163 165
164 166 changeset: 2:db07c04beaca
165 167 user: test
166 168 date: Thu Jan 01 00:00:02 1970 +0000
167 169 summary: msg 2
168 170
169 171 changeset: 1:5cd978ea5149
170 172 user: test
171 173 date: Thu Jan 01 00:00:01 1970 +0000
172 174 summary: msg 1
173 175
174 176 changeset: 0:b99c7b9c8e11
175 177 user: test
176 178 date: Thu Jan 01 00:00:00 1970 +0000
177 179 summary: msg 0
178 180
179 181
180 182 $ hg up -C
181 183 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
182 184
183 185 bisect test
184 186
185 187 $ hg bisect -r
186 188 $ hg bisect -b
187 189 $ hg bisect -g 1
188 190 Testing changeset 16:a2e6ea4973e9 (30 changesets remaining, ~4 tests)
189 191 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
190 192 $ hg bisect -g
191 193 Testing changeset 23:5ec79163bff4 (15 changesets remaining, ~3 tests)
192 194 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 195
194 196 skip
195 197
196 198 $ hg bisect -s
197 199 Testing changeset 24:10e0acd3809e (15 changesets remaining, ~3 tests)
198 200 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
199 201 $ hg bisect -g
200 202 Testing changeset 27:288867a866e9 (7 changesets remaining, ~2 tests)
201 203 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
202 204 $ hg bisect -g
203 205 Testing changeset 29:b5bd63375ab9 (4 changesets remaining, ~2 tests)
204 206 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
205 207 $ hg bisect -b
206 208 Testing changeset 28:8e0c2264c8af (2 changesets remaining, ~1 tests)
207 209 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
208 210 $ hg bisect -g
209 211 The first bad revision is:
210 212 changeset: 29:b5bd63375ab9
211 213 user: test
212 214 date: Thu Jan 01 00:00:29 1970 +0000
213 215 summary: msg 29
214 216
215 217
216 218 mark revsets instead of single revs
217 219
218 220 $ hg bisect -r
219 221 $ hg bisect -b "0::3"
220 222 $ hg bisect -s "13::16"
221 223 $ hg bisect -g "26::tip"
222 224 Testing changeset 12:1941b52820a5 (23 changesets remaining, ~4 tests)
223 225 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
224 226 $ cat .hg/bisect.state
225 227 skip 9d7d07bc967ca98ad0600c24953fd289ad5fa991
226 228 skip ce8f0998e922c179e80819d5066fbe46e2998784
227 229 skip e7fa0811edb063f6319531f0d0a865882138e180
228 230 skip a2e6ea4973e9196ddd3386493b0c214b41fd97d3
229 231 bad b99c7b9c8e11558adef3fad9af211c58d46f325b
230 232 bad 5cd978ea51499179507ee7b6f340d2dbaa401185
231 233 bad db07c04beaca44cf24832541e7f4a2346a95275b
232 234 bad b53bea5e2fcb30d3e00bd3409507a5659ce0fd8b
233 235 good 3efc6fd51aeb8594398044c6c846ca59ae021203
234 236 good 288867a866e9adb7a29880b66936c874b80f4651
235 237 good 8e0c2264c8af790daf3585ada0669d93dee09c83
236 238 good b5bd63375ab9a290419f2024b7f4ee9ea7ce90a8
237 239 good ed2d2f24b11c368fa8aa0da9f4e1db580abade59
238 240 good 58c80a7c8a4025a94cedaf7b4a4e3124e8909a96
239 241
240 242 bisect reverse test
241 243
242 244 $ hg bisect -r
243 245 $ hg bisect -b null
244 246 $ hg bisect -g tip
245 247 Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests)
246 248 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
247 249 $ hg bisect -g
248 250 Testing changeset 7:03750880c6b5 (16 changesets remaining, ~4 tests)
249 251 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
250 252
251 253 skip
252 254
253 255 $ hg bisect -s
254 256 Testing changeset 6:a3d5c6fdf0d3 (16 changesets remaining, ~4 tests)
255 257 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
256 258 $ hg bisect -g
257 259 Testing changeset 2:db07c04beaca (7 changesets remaining, ~2 tests)
258 260 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
259 261 $ hg bisect -g
260 262 Testing changeset 0:b99c7b9c8e11 (3 changesets remaining, ~1 tests)
261 263 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
262 264 $ hg bisect -b
263 265 Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests)
264 266 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
265 267 $ hg bisect -g
266 268 The first good revision is:
267 269 changeset: 1:5cd978ea5149
268 270 user: test
269 271 date: Thu Jan 01 00:00:01 1970 +0000
270 272 summary: msg 1
271 273
272 274
273 275 $ hg bisect -r
274 276 $ hg bisect -g tip
275 277 $ hg bisect -b tip
276 278 abort: starting revisions are not directly related
277 279 [255]
278 280
279 281 $ hg bisect -r
280 282 $ hg bisect -g null
281 283 $ hg bisect -bU tip
282 284 Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests)
283 285 $ hg id
284 286 5cd978ea5149
285 287
286 288
287 289 Issue1228: hg bisect crashes when you skip the last rev in bisection
288 290 Issue1182: hg bisect exception
289 291
290 292 $ hg bisect -r
291 293 $ hg bisect -b 4
292 294 $ hg bisect -g 0
293 295 Testing changeset 2:db07c04beaca (4 changesets remaining, ~2 tests)
294 296 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
295 297 $ hg bisect -s
296 298 Testing changeset 1:5cd978ea5149 (4 changesets remaining, ~2 tests)
297 299 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
298 300 $ hg bisect -s
299 301 Testing changeset 3:b53bea5e2fcb (4 changesets remaining, ~2 tests)
300 302 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
301 303 $ hg bisect -s
302 304 Due to skipped revisions, the first bad revision could be any of:
303 305 changeset: 1:5cd978ea5149
304 306 user: test
305 307 date: Thu Jan 01 00:00:01 1970 +0000
306 308 summary: msg 1
307 309
308 310 changeset: 2:db07c04beaca
309 311 user: test
310 312 date: Thu Jan 01 00:00:02 1970 +0000
311 313 summary: msg 2
312 314
313 315 changeset: 3:b53bea5e2fcb
314 316 user: test
315 317 date: Thu Jan 01 00:00:03 1970 +0000
316 318 summary: msg 3
317 319
318 320 changeset: 4:9b2ba8336a65
319 321 user: test
320 322 date: Thu Jan 01 00:00:04 1970 +0000
321 323 summary: msg 4
322 324
323 325
324 326
325 327 reproduce non converging bisect, issue1182
326 328
327 329 $ hg bisect -r
328 330 $ hg bisect -g 0
329 331 $ hg bisect -b 2
330 332 Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests)
331 333 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
332 334 $ hg bisect -s
333 335 Due to skipped revisions, the first bad revision could be any of:
334 336 changeset: 1:5cd978ea5149
335 337 user: test
336 338 date: Thu Jan 01 00:00:01 1970 +0000
337 339 summary: msg 1
338 340
339 341 changeset: 2:db07c04beaca
340 342 user: test
341 343 date: Thu Jan 01 00:00:02 1970 +0000
342 344 summary: msg 2
343 345
344 346
345 347
346 348 test no action
347 349
348 350 $ hg bisect -r
349 351 $ hg bisect
350 352 abort: cannot bisect (no known good revisions)
351 353 [255]
352 354
353 355
354 356 reproduce AssertionError, issue1445
355 357
356 358 $ hg bisect -r
357 359 $ hg bisect -b 6
358 360 $ hg bisect -g 0
359 361 Testing changeset 3:b53bea5e2fcb (6 changesets remaining, ~2 tests)
360 362 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
361 363 $ hg bisect -s
362 364 Testing changeset 2:db07c04beaca (6 changesets remaining, ~2 tests)
363 365 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
364 366 $ hg bisect -s
365 367 Testing changeset 4:9b2ba8336a65 (6 changesets remaining, ~2 tests)
366 368 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
367 369 $ hg bisect -s
368 370 Testing changeset 1:5cd978ea5149 (6 changesets remaining, ~2 tests)
369 371 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
370 372 $ hg bisect -s
371 373 Testing changeset 5:7874a09ea728 (6 changesets remaining, ~2 tests)
372 374 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
373 375 $ hg bisect -g
374 376 The first bad revision is:
375 377 changeset: 6:a3d5c6fdf0d3
376 378 user: test
377 379 date: Thu Jan 01 00:00:06 1970 +0000
378 380 summary: msg 6
379 381
380 382 $ hg log -r "bisect(good)"
381 383 changeset: 0:b99c7b9c8e11
382 384 user: test
383 385 date: Thu Jan 01 00:00:00 1970 +0000
384 386 summary: msg 0
385 387
386 388 changeset: 5:7874a09ea728
387 389 user: test
388 390 date: Thu Jan 01 00:00:05 1970 +0000
389 391 summary: msg 5
390 392
391 393 $ hg log -r "bisect(bad)"
392 394 changeset: 6:a3d5c6fdf0d3
393 395 user: test
394 396 date: Thu Jan 01 00:00:06 1970 +0000
395 397 summary: msg 6
396 398
397 399 $ hg log -r "bisect(skip)"
398 400 changeset: 1:5cd978ea5149
399 401 user: test
400 402 date: Thu Jan 01 00:00:01 1970 +0000
401 403 summary: msg 1
402 404
403 405 changeset: 2:db07c04beaca
404 406 user: test
405 407 date: Thu Jan 01 00:00:02 1970 +0000
406 408 summary: msg 2
407 409
408 410 changeset: 3:b53bea5e2fcb
409 411 user: test
410 412 date: Thu Jan 01 00:00:03 1970 +0000
411 413 summary: msg 3
412 414
413 415 changeset: 4:9b2ba8336a65
414 416 user: test
415 417 date: Thu Jan 01 00:00:04 1970 +0000
416 418 summary: msg 4
417 419
418 420
419 421 test legacy bisected() keyword
420 422
421 423 $ hg log -r "bisected(bad)"
422 424 changeset: 6:a3d5c6fdf0d3
423 425 user: test
424 426 date: Thu Jan 01 00:00:06 1970 +0000
425 427 summary: msg 6
426 428
427 429
428 430 $ set +e
429 431
430 432 test invalid command
431 433 assuming that the shell returns 127 if command not found ...
432 434
433 435 $ hg bisect -r
434 436 $ hg bisect --command 'exit 127'
435 437 abort: failed to execute exit 127
436 438 [255]
437 439
438 440
439 441 test bisecting command
440 442
441 443 $ cat > script.py <<EOF
442 444 > #!/usr/bin/env python
443 445 > import sys
444 446 > from mercurial import ui, hg
445 447 > repo = hg.repository(ui.ui(), '.')
446 448 > if repo['.'].rev() < 6:
447 449 > sys.exit(1)
448 450 > EOF
449 451 $ chmod +x script.py
450 452 $ hg bisect -r
451 453 $ hg bisect --good tip
452 454 $ hg bisect --bad 0
453 455 Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests)
454 456 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
455 457 $ hg bisect --command "'`pwd`/script.py' and some parameters"
456 458 Changeset 15:e7fa0811edb0: good
457 459 Changeset 7:03750880c6b5: good
458 460 Changeset 3:b53bea5e2fcb: bad
459 461 Changeset 5:7874a09ea728: bad
460 462 Changeset 6:a3d5c6fdf0d3: good
461 463 The first good revision is:
462 464 changeset: 6:a3d5c6fdf0d3
463 465 user: test
464 466 date: Thu Jan 01 00:00:06 1970 +0000
465 467 summary: msg 6
466 468
@@ -1,574 +1,576 b''
1 $ "$TESTDIR/hghave" system-sh || exit 80
2
1 3 Setting up test
2 4
3 5 $ hg init test
4 6 $ cd test
5 7 $ echo 0 > afile
6 8 $ hg add afile
7 9 $ hg commit -m "0.0"
8 10 $ echo 1 >> afile
9 11 $ hg commit -m "0.1"
10 12 $ echo 2 >> afile
11 13 $ hg commit -m "0.2"
12 14 $ echo 3 >> afile
13 15 $ hg commit -m "0.3"
14 16 $ hg update -C 0
15 17 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 18 $ echo 1 >> afile
17 19 $ hg commit -m "1.1"
18 20 created new head
19 21 $ echo 2 >> afile
20 22 $ hg commit -m "1.2"
21 23 $ echo "a line" > fred
22 24 $ echo 3 >> afile
23 25 $ hg add fred
24 26 $ hg commit -m "1.3"
25 27 $ hg mv afile adifferentfile
26 28 $ hg commit -m "1.3m"
27 29 $ hg update -C 3
28 30 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
29 31 $ hg mv afile anotherfile
30 32 $ hg commit -m "0.3m"
31 33 $ hg verify
32 34 checking changesets
33 35 checking manifests
34 36 crosschecking files in changesets and manifests
35 37 checking files
36 38 4 files, 9 changesets, 7 total revisions
37 39 $ cd ..
38 40 $ hg init empty
39 41
40 42 Bundle --all
41 43
42 44 $ hg -R test bundle --all all.hg
43 45 9 changesets found
44 46
45 47 Bundle test to full.hg
46 48
47 49 $ hg -R test bundle full.hg empty
48 50 searching for changes
49 51 9 changesets found
50 52
51 53 Unbundle full.hg in test
52 54
53 55 $ hg -R test unbundle full.hg
54 56 adding changesets
55 57 adding manifests
56 58 adding file changes
57 59 added 0 changesets with 0 changes to 4 files
58 60 (run 'hg update' to get a working copy)
59 61
60 62 Verify empty
61 63
62 64 $ hg -R empty heads
63 65 [1]
64 66 $ hg -R empty verify
65 67 checking changesets
66 68 checking manifests
67 69 crosschecking files in changesets and manifests
68 70 checking files
69 71 0 files, 0 changesets, 0 total revisions
70 72
71 73 Pull full.hg into test (using --cwd)
72 74
73 75 $ hg --cwd test pull ../full.hg
74 76 pulling from ../full.hg
75 77 searching for changes
76 78 no changes found
77 79
78 80 Pull full.hg into empty (using --cwd)
79 81
80 82 $ hg --cwd empty pull ../full.hg
81 83 pulling from ../full.hg
82 84 requesting all changes
83 85 adding changesets
84 86 adding manifests
85 87 adding file changes
86 88 added 9 changesets with 7 changes to 4 files (+1 heads)
87 89 (run 'hg heads' to see heads, 'hg merge' to merge)
88 90
89 91 Rollback empty
90 92
91 93 $ hg -R empty rollback
92 94 repository tip rolled back to revision -1 (undo pull)
93 95
94 96 Pull full.hg into empty again (using --cwd)
95 97
96 98 $ hg --cwd empty pull ../full.hg
97 99 pulling from ../full.hg
98 100 requesting all changes
99 101 adding changesets
100 102 adding manifests
101 103 adding file changes
102 104 added 9 changesets with 7 changes to 4 files (+1 heads)
103 105 (run 'hg heads' to see heads, 'hg merge' to merge)
104 106
105 107 Pull full.hg into test (using -R)
106 108
107 109 $ hg -R test pull full.hg
108 110 pulling from full.hg
109 111 searching for changes
110 112 no changes found
111 113
112 114 Pull full.hg into empty (using -R)
113 115
114 116 $ hg -R empty pull full.hg
115 117 pulling from full.hg
116 118 searching for changes
117 119 no changes found
118 120
119 121 Rollback empty
120 122
121 123 $ hg -R empty rollback
122 124 repository tip rolled back to revision -1 (undo pull)
123 125
124 126 Pull full.hg into empty again (using -R)
125 127
126 128 $ hg -R empty pull full.hg
127 129 pulling from full.hg
128 130 requesting all changes
129 131 adding changesets
130 132 adding manifests
131 133 adding file changes
132 134 added 9 changesets with 7 changes to 4 files (+1 heads)
133 135 (run 'hg heads' to see heads, 'hg merge' to merge)
134 136
135 137 Log -R full.hg in fresh empty
136 138
137 139 $ rm -r empty
138 140 $ hg init empty
139 141 $ cd empty
140 142 $ hg -R bundle://../full.hg log
141 143 changeset: 8:aa35859c02ea
142 144 tag: tip
143 145 parent: 3:eebf5a27f8ca
144 146 user: test
145 147 date: Thu Jan 01 00:00:00 1970 +0000
146 148 summary: 0.3m
147 149
148 150 changeset: 7:a6a34bfa0076
149 151 user: test
150 152 date: Thu Jan 01 00:00:00 1970 +0000
151 153 summary: 1.3m
152 154
153 155 changeset: 6:7373c1169842
154 156 user: test
155 157 date: Thu Jan 01 00:00:00 1970 +0000
156 158 summary: 1.3
157 159
158 160 changeset: 5:1bb50a9436a7
159 161 user: test
160 162 date: Thu Jan 01 00:00:00 1970 +0000
161 163 summary: 1.2
162 164
163 165 changeset: 4:095197eb4973
164 166 parent: 0:f9ee2f85a263
165 167 user: test
166 168 date: Thu Jan 01 00:00:00 1970 +0000
167 169 summary: 1.1
168 170
169 171 changeset: 3:eebf5a27f8ca
170 172 user: test
171 173 date: Thu Jan 01 00:00:00 1970 +0000
172 174 summary: 0.3
173 175
174 176 changeset: 2:e38ba6f5b7e0
175 177 user: test
176 178 date: Thu Jan 01 00:00:00 1970 +0000
177 179 summary: 0.2
178 180
179 181 changeset: 1:34c2bf6b0626
180 182 user: test
181 183 date: Thu Jan 01 00:00:00 1970 +0000
182 184 summary: 0.1
183 185
184 186 changeset: 0:f9ee2f85a263
185 187 user: test
186 188 date: Thu Jan 01 00:00:00 1970 +0000
187 189 summary: 0.0
188 190
189 191 Make sure bundlerepo doesn't leak tempfiles (issue2491)
190 192
191 193 $ ls .hg
192 194 00changelog.i
193 195 cache
194 196 requires
195 197 store
196 198
197 199 Pull ../full.hg into empty (with hook)
198 200
199 201 $ echo '[hooks]' >> .hg/hgrc
200 202 $ echo 'changegroup = python "$TESTDIR"/printenv.py changegroup' >> .hg/hgrc
201 203
202 204 doesn't work (yet ?)
203 205
204 206 hg -R bundle://../full.hg verify
205 207
206 208 $ hg pull bundle://../full.hg
207 209 pulling from bundle:../full.hg
208 210 requesting all changes
209 211 adding changesets
210 212 adding manifests
211 213 adding file changes
212 214 added 9 changesets with 7 changes to 4 files (+1 heads)
213 215 changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:../full.hg
214 216 (run 'hg heads' to see heads, 'hg merge' to merge)
215 217
216 218 Rollback empty
217 219
218 220 $ hg rollback
219 221 repository tip rolled back to revision -1 (undo pull)
220 222 $ cd ..
221 223
222 224 Log -R bundle:empty+full.hg
223 225
224 226 $ hg -R bundle:empty+full.hg log --template="{rev} "; echo ""
225 227 8 7 6 5 4 3 2 1 0
226 228
227 229 Pull full.hg into empty again (using -R; with hook)
228 230
229 231 $ hg -R empty pull full.hg
230 232 pulling from full.hg
231 233 requesting all changes
232 234 adding changesets
233 235 adding manifests
234 236 adding file changes
235 237 added 9 changesets with 7 changes to 4 files (+1 heads)
236 238 changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:empty+full.hg
237 239 (run 'hg heads' to see heads, 'hg merge' to merge)
238 240
239 241 Create partial clones
240 242
241 243 $ rm -r empty
242 244 $ hg init empty
243 245 $ hg clone -r 3 test partial
244 246 adding changesets
245 247 adding manifests
246 248 adding file changes
247 249 added 4 changesets with 4 changes to 1 files
248 250 updating to branch default
249 251 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
250 252 $ hg clone partial partial2
251 253 updating to branch default
252 254 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
253 255 $ cd partial
254 256
255 257 Log -R full.hg in partial
256 258
257 259 $ hg -R bundle://../full.hg log
258 260 changeset: 8:aa35859c02ea
259 261 tag: tip
260 262 parent: 3:eebf5a27f8ca
261 263 user: test
262 264 date: Thu Jan 01 00:00:00 1970 +0000
263 265 summary: 0.3m
264 266
265 267 changeset: 7:a6a34bfa0076
266 268 user: test
267 269 date: Thu Jan 01 00:00:00 1970 +0000
268 270 summary: 1.3m
269 271
270 272 changeset: 6:7373c1169842
271 273 user: test
272 274 date: Thu Jan 01 00:00:00 1970 +0000
273 275 summary: 1.3
274 276
275 277 changeset: 5:1bb50a9436a7
276 278 user: test
277 279 date: Thu Jan 01 00:00:00 1970 +0000
278 280 summary: 1.2
279 281
280 282 changeset: 4:095197eb4973
281 283 parent: 0:f9ee2f85a263
282 284 user: test
283 285 date: Thu Jan 01 00:00:00 1970 +0000
284 286 summary: 1.1
285 287
286 288 changeset: 3:eebf5a27f8ca
287 289 user: test
288 290 date: Thu Jan 01 00:00:00 1970 +0000
289 291 summary: 0.3
290 292
291 293 changeset: 2:e38ba6f5b7e0
292 294 user: test
293 295 date: Thu Jan 01 00:00:00 1970 +0000
294 296 summary: 0.2
295 297
296 298 changeset: 1:34c2bf6b0626
297 299 user: test
298 300 date: Thu Jan 01 00:00:00 1970 +0000
299 301 summary: 0.1
300 302
301 303 changeset: 0:f9ee2f85a263
302 304 user: test
303 305 date: Thu Jan 01 00:00:00 1970 +0000
304 306 summary: 0.0
305 307
306 308
307 309 Incoming full.hg in partial
308 310
309 311 $ hg incoming bundle://../full.hg
310 312 comparing with bundle:../full.hg
311 313 searching for changes
312 314 changeset: 4:095197eb4973
313 315 parent: 0:f9ee2f85a263
314 316 user: test
315 317 date: Thu Jan 01 00:00:00 1970 +0000
316 318 summary: 1.1
317 319
318 320 changeset: 5:1bb50a9436a7
319 321 user: test
320 322 date: Thu Jan 01 00:00:00 1970 +0000
321 323 summary: 1.2
322 324
323 325 changeset: 6:7373c1169842
324 326 user: test
325 327 date: Thu Jan 01 00:00:00 1970 +0000
326 328 summary: 1.3
327 329
328 330 changeset: 7:a6a34bfa0076
329 331 user: test
330 332 date: Thu Jan 01 00:00:00 1970 +0000
331 333 summary: 1.3m
332 334
333 335 changeset: 8:aa35859c02ea
334 336 tag: tip
335 337 parent: 3:eebf5a27f8ca
336 338 user: test
337 339 date: Thu Jan 01 00:00:00 1970 +0000
338 340 summary: 0.3m
339 341
340 342
341 343 Outgoing -R full.hg vs partial2 in partial
342 344
343 345 $ hg -R bundle://../full.hg outgoing ../partial2
344 346 comparing with ../partial2
345 347 searching for changes
346 348 changeset: 4:095197eb4973
347 349 parent: 0:f9ee2f85a263
348 350 user: test
349 351 date: Thu Jan 01 00:00:00 1970 +0000
350 352 summary: 1.1
351 353
352 354 changeset: 5:1bb50a9436a7
353 355 user: test
354 356 date: Thu Jan 01 00:00:00 1970 +0000
355 357 summary: 1.2
356 358
357 359 changeset: 6:7373c1169842
358 360 user: test
359 361 date: Thu Jan 01 00:00:00 1970 +0000
360 362 summary: 1.3
361 363
362 364 changeset: 7:a6a34bfa0076
363 365 user: test
364 366 date: Thu Jan 01 00:00:00 1970 +0000
365 367 summary: 1.3m
366 368
367 369 changeset: 8:aa35859c02ea
368 370 tag: tip
369 371 parent: 3:eebf5a27f8ca
370 372 user: test
371 373 date: Thu Jan 01 00:00:00 1970 +0000
372 374 summary: 0.3m
373 375
374 376
375 377 Outgoing -R does-not-exist.hg vs partial2 in partial
376 378
377 379 $ hg -R bundle://../does-not-exist.hg outgoing ../partial2
378 abort: No such file or directory: ../does-not-exist.hg
380 abort: *: ../does-not-exist.hg (glob)
379 381 [255]
380 382 $ cd ..
381 383
382 384 Direct clone from bundle (all-history)
383 385
384 386 $ hg clone full.hg full-clone
385 387 requesting all changes
386 388 adding changesets
387 389 adding manifests
388 390 adding file changes
389 391 added 9 changesets with 7 changes to 4 files (+1 heads)
390 392 updating to branch default
391 393 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
392 394 $ hg -R full-clone heads
393 395 changeset: 8:aa35859c02ea
394 396 tag: tip
395 397 parent: 3:eebf5a27f8ca
396 398 user: test
397 399 date: Thu Jan 01 00:00:00 1970 +0000
398 400 summary: 0.3m
399 401
400 402 changeset: 7:a6a34bfa0076
401 403 user: test
402 404 date: Thu Jan 01 00:00:00 1970 +0000
403 405 summary: 1.3m
404 406
405 407 $ rm -r full-clone
406 408
407 409 When cloning from a non-copiable repository into '', do not
408 410 recurse infinitely (issue 2528)
409 411
410 412 $ hg clone full.hg ''
411 abort: No such file or directory
413 abort: * (glob)
412 414 [255]
413 415
414 416 test for http://mercurial.selenic.com/bts/issue216
415 417
416 418 Unbundle incremental bundles into fresh empty in one go
417 419
418 420 $ rm -r empty
419 421 $ hg init empty
420 422 $ hg -R test bundle --base null -r 0 ../0.hg
421 423 1 changesets found
422 424 $ hg -R test bundle --base 0 -r 1 ../1.hg
423 425 1 changesets found
424 426 $ hg -R empty unbundle -u ../0.hg ../1.hg
425 427 adding changesets
426 428 adding manifests
427 429 adding file changes
428 430 added 1 changesets with 1 changes to 1 files
429 431 adding changesets
430 432 adding manifests
431 433 adding file changes
432 434 added 1 changesets with 1 changes to 1 files
433 435 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
434 436
435 437 test for 540d1059c802
436 438
437 439 test for 540d1059c802
438 440
439 441 $ hg init orig
440 442 $ cd orig
441 443 $ echo foo > foo
442 444 $ hg add foo
443 445 $ hg ci -m 'add foo'
444 446
445 447 $ hg clone . ../copy
446 448 updating to branch default
447 449 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
448 450 $ hg tag foo
449 451
450 452 $ cd ../copy
451 453 $ echo >> foo
452 454 $ hg ci -m 'change foo'
453 455 $ hg bundle ../bundle.hg ../orig
454 456 searching for changes
455 457 1 changesets found
456 458
457 459 $ cd ../orig
458 460 $ hg incoming ../bundle.hg
459 461 comparing with ../bundle.hg
460 462 searching for changes
461 463 changeset: 2:ed1b79f46b9a
462 464 tag: tip
463 465 parent: 0:bbd179dfa0a7
464 466 user: test
465 467 date: Thu Jan 01 00:00:00 1970 +0000
466 468 summary: change foo
467 469
468 470 $ cd ..
469 471
470 472 test bundle with # in the filename (issue2154):
471 473
472 474 $ cp bundle.hg 'test#bundle.hg'
473 475 $ cd orig
474 476 $ hg incoming '../test#bundle.hg'
475 477 comparing with ../test
476 478 abort: unknown revision 'bundle.hg'!
477 479 [255]
478 480
479 481 note that percent encoding is not handled:
480 482
481 483 $ hg incoming ../test%23bundle.hg
482 484 abort: repository ../test%23bundle.hg not found!
483 485 [255]
484 486 $ cd ..
485 487
486 488 test for http://mercurial.selenic.com/bts/issue1144
487 489
488 490 test that verify bundle does not traceback
489 491
490 492 partial history bundle, fails w/ unkown parent
491 493
492 494 $ hg -R bundle.hg verify
493 495 abort: 00changelog.i@bbd179dfa0a7: unknown parent!
494 496 [255]
495 497
496 498 full history bundle, refuses to verify non-local repo
497 499
498 500 $ hg -R all.hg verify
499 501 abort: cannot verify bundle or remote repos
500 502 [255]
501 503
502 504 but, regular verify must continue to work
503 505
504 506 $ hg -R orig verify
505 507 checking changesets
506 508 checking manifests
507 509 crosschecking files in changesets and manifests
508 510 checking files
509 511 2 files, 2 changesets, 2 total revisions
510 512
511 513 diff against bundle
512 514
513 515 $ hg init b
514 516 $ cd b
515 517 $ hg -R ../all.hg diff -r tip
516 518 diff -r aa35859c02ea anotherfile
517 519 --- a/anotherfile Thu Jan 01 00:00:00 1970 +0000
518 520 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
519 521 @@ -1,4 +0,0 @@
520 522 -0
521 523 -1
522 524 -2
523 525 -3
524 526 $ cd ..
525 527
526 528 bundle single branch
527 529
528 530 $ hg init branchy
529 531 $ cd branchy
530 532 $ echo a >a
531 533 $ hg ci -Ama
532 534 adding a
533 535 $ echo b >b
534 536 $ hg ci -Amb
535 537 adding b
536 538 $ echo b1 >b1
537 539 $ hg ci -Amb1
538 540 adding b1
539 541 $ hg up 0
540 542 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
541 543 $ echo c >c
542 544 $ hg ci -Amc
543 545 adding c
544 546 created new head
545 547 $ echo c1 >c1
546 548 $ hg ci -Amc1
547 549 adding c1
548 550 $ hg clone -q .#tip part
549 551
550 552 == bundling via incoming
551 553
552 554 $ hg in -R part --bundle incoming.hg --template "{node}\n" .
553 555 comparing with .
554 556 searching for changes
555 557 d2ae7f538514cd87c17547b0de4cea71fe1af9fb
556 558 5ece8e77363e2b5269e27c66828b72da29e4341a
557 559
558 560 == bundling
559 561
560 562 $ hg bundle bundle.hg part --debug
561 563 query 1; heads
562 564 searching for changes
563 565 all remote heads known locally
564 566 2 changesets found
565 567 list of changesets:
566 568 d2ae7f538514cd87c17547b0de4cea71fe1af9fb
567 569 5ece8e77363e2b5269e27c66828b72da29e4341a
568 570 bundling: 1/2 changesets (50.00%)
569 571 bundling: 2/2 changesets (100.00%)
570 572 bundling: 1/2 manifests (50.00%)
571 573 bundling: 2/2 manifests (100.00%)
572 574 bundling: b 1/2 files (50.00%)
573 575 bundling: b1 2/2 files (100.00%)
574 576
@@ -1,459 +1,459 b''
1 1 Prepare repo a:
2 2
3 3 $ hg init a
4 4 $ cd a
5 5 $ echo a > a
6 6 $ hg add a
7 7 $ hg commit -m test
8 8 $ echo first line > b
9 9 $ hg add b
10 10
11 11 Create a non-inlined filelog:
12 12
13 $ python -c 'for x in range(10000): print x' >> data1
13 $ python -c 'file("data1", "wb").write("".join("%s\n" % x for x in range(10000)))'
14 14 $ for j in 0 1 2 3 4 5 6 7 8 9; do
15 15 > cat data1 >> b
16 16 > hg commit -m test
17 17 > done
18 18
19 19 List files in store/data (should show a 'b.d'):
20 20
21 21 $ for i in .hg/store/data/*; do
22 22 > echo $i
23 23 > done
24 24 .hg/store/data/a.i
25 25 .hg/store/data/b.d
26 26 .hg/store/data/b.i
27 27
28 28 Default operation:
29 29
30 30 $ hg clone . ../b
31 31 updating to branch default
32 32 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 33 $ cd ../b
34 34 $ cat a
35 35 a
36 36 $ hg verify
37 37 checking changesets
38 38 checking manifests
39 39 crosschecking files in changesets and manifests
40 40 checking files
41 41 2 files, 11 changesets, 11 total revisions
42 42
43 43 Invalid dest '' must abort:
44 44
45 45 $ hg clone . ''
46 abort: No such file or directory
46 abort: * (glob)
47 47 [255]
48 48
49 49 No update, with debug option:
50 50
51 51 $ hg --debug clone -U . ../c
52 52 linked 8 files
53 53 $ cd ../c
54 54 $ cat a 2>/dev/null || echo "a not present"
55 55 a not present
56 56 $ hg verify
57 57 checking changesets
58 58 checking manifests
59 59 crosschecking files in changesets and manifests
60 60 checking files
61 61 2 files, 11 changesets, 11 total revisions
62 62
63 63 Default destination:
64 64
65 65 $ mkdir ../d
66 66 $ cd ../d
67 67 $ hg clone ../a
68 68 destination directory: a
69 69 updating to branch default
70 70 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
71 71 $ cd a
72 72 $ hg cat a
73 73 a
74 74 $ cd ../..
75 75
76 76 Check that we drop the 'file:' from the path before writing the .hgrc:
77 77
78 78 $ hg clone file:a e
79 79 updating to branch default
80 80 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 81 $ grep 'file:' e/.hg/hgrc
82 82 [1]
83 83
84 84 Check that path aliases are expanded:
85 85
86 86 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
87 87 $ hg -R f showconfig paths.default
88 $TESTTMP/a#0
88 $TESTTMP/a#0 (glob)
89 89
90 90 Use --pull:
91 91
92 92 $ hg clone --pull a g
93 93 requesting all changes
94 94 adding changesets
95 95 adding manifests
96 96 adding file changes
97 97 added 11 changesets with 11 changes to 2 files
98 98 updating to branch default
99 99 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
100 100 $ hg -R g verify
101 101 checking changesets
102 102 checking manifests
103 103 crosschecking files in changesets and manifests
104 104 checking files
105 105 2 files, 11 changesets, 11 total revisions
106 106
107 107 Invalid dest '' with --pull must abort (issue2528):
108 108
109 109 $ hg clone --pull a ''
110 abort: No such file or directory
110 abort: * (glob)
111 111 [255]
112 112
113 113 Clone to '.':
114 114
115 115 $ mkdir h
116 116 $ cd h
117 117 $ hg clone ../a .
118 118 updating to branch default
119 119 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
120 120 $ cd ..
121 121
122 122
123 123 *** Tests for option -u ***
124 124
125 125 Adding some more history to repo a:
126 126
127 127 $ cd a
128 128 $ hg tag ref1
129 129 $ echo the quick brown fox >a
130 130 $ hg ci -m "hacked default"
131 131 $ hg up ref1
132 132 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
133 133 $ hg branch stable
134 134 marked working directory as branch stable
135 135 $ echo some text >a
136 136 $ hg ci -m "starting branch stable"
137 137 $ hg tag ref2
138 138 $ echo some more text >a
139 139 $ hg ci -m "another change for branch stable"
140 140 $ hg up ref2
141 141 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
142 142 $ hg parents
143 143 changeset: 13:e8ece76546a6
144 144 branch: stable
145 145 tag: ref2
146 146 parent: 10:a7949464abda
147 147 user: test
148 148 date: Thu Jan 01 00:00:00 1970 +0000
149 149 summary: starting branch stable
150 150
151 151
152 152 Repo a has two heads:
153 153
154 154 $ hg heads
155 155 changeset: 15:0aae7cf88f0d
156 156 branch: stable
157 157 tag: tip
158 158 user: test
159 159 date: Thu Jan 01 00:00:00 1970 +0000
160 160 summary: another change for branch stable
161 161
162 162 changeset: 12:f21241060d6a
163 163 user: test
164 164 date: Thu Jan 01 00:00:00 1970 +0000
165 165 summary: hacked default
166 166
167 167
168 168 $ cd ..
169 169
170 170
171 171 Testing --noupdate with --updaterev (must abort):
172 172
173 173 $ hg clone --noupdate --updaterev 1 a ua
174 174 abort: cannot specify both --noupdate and --updaterev
175 175 [255]
176 176
177 177
178 178 Testing clone -u:
179 179
180 180 $ hg clone -u . a ua
181 181 updating to branch stable
182 182 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
183 183
184 184 Repo ua has both heads:
185 185
186 186 $ hg -R ua heads
187 187 changeset: 15:0aae7cf88f0d
188 188 branch: stable
189 189 tag: tip
190 190 user: test
191 191 date: Thu Jan 01 00:00:00 1970 +0000
192 192 summary: another change for branch stable
193 193
194 194 changeset: 12:f21241060d6a
195 195 user: test
196 196 date: Thu Jan 01 00:00:00 1970 +0000
197 197 summary: hacked default
198 198
199 199
200 200 Same revision checked out in repo a and ua:
201 201
202 202 $ hg -R a parents --template "{node|short}\n"
203 203 e8ece76546a6
204 204 $ hg -R ua parents --template "{node|short}\n"
205 205 e8ece76546a6
206 206
207 207 $ rm -r ua
208 208
209 209
210 210 Testing clone --pull -u:
211 211
212 212 $ hg clone --pull -u . a ua
213 213 requesting all changes
214 214 adding changesets
215 215 adding manifests
216 216 adding file changes
217 217 added 16 changesets with 16 changes to 3 files (+1 heads)
218 218 updating to branch stable
219 219 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
220 220
221 221 Repo ua has both heads:
222 222
223 223 $ hg -R ua heads
224 224 changeset: 15:0aae7cf88f0d
225 225 branch: stable
226 226 tag: tip
227 227 user: test
228 228 date: Thu Jan 01 00:00:00 1970 +0000
229 229 summary: another change for branch stable
230 230
231 231 changeset: 12:f21241060d6a
232 232 user: test
233 233 date: Thu Jan 01 00:00:00 1970 +0000
234 234 summary: hacked default
235 235
236 236
237 237 Same revision checked out in repo a and ua:
238 238
239 239 $ hg -R a parents --template "{node|short}\n"
240 240 e8ece76546a6
241 241 $ hg -R ua parents --template "{node|short}\n"
242 242 e8ece76546a6
243 243
244 244 $ rm -r ua
245 245
246 246
247 247 Testing clone -u <branch>:
248 248
249 249 $ hg clone -u stable a ua
250 250 updating to branch stable
251 251 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
252 252
253 253 Repo ua has both heads:
254 254
255 255 $ hg -R ua heads
256 256 changeset: 15:0aae7cf88f0d
257 257 branch: stable
258 258 tag: tip
259 259 user: test
260 260 date: Thu Jan 01 00:00:00 1970 +0000
261 261 summary: another change for branch stable
262 262
263 263 changeset: 12:f21241060d6a
264 264 user: test
265 265 date: Thu Jan 01 00:00:00 1970 +0000
266 266 summary: hacked default
267 267
268 268
269 269 Branch 'stable' is checked out:
270 270
271 271 $ hg -R ua parents
272 272 changeset: 15:0aae7cf88f0d
273 273 branch: stable
274 274 tag: tip
275 275 user: test
276 276 date: Thu Jan 01 00:00:00 1970 +0000
277 277 summary: another change for branch stable
278 278
279 279
280 280 $ rm -r ua
281 281
282 282
283 283 Testing default checkout:
284 284
285 285 $ hg clone a ua
286 286 updating to branch default
287 287 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
288 288
289 289 Repo ua has both heads:
290 290
291 291 $ hg -R ua heads
292 292 changeset: 15:0aae7cf88f0d
293 293 branch: stable
294 294 tag: tip
295 295 user: test
296 296 date: Thu Jan 01 00:00:00 1970 +0000
297 297 summary: another change for branch stable
298 298
299 299 changeset: 12:f21241060d6a
300 300 user: test
301 301 date: Thu Jan 01 00:00:00 1970 +0000
302 302 summary: hacked default
303 303
304 304
305 305 Branch 'default' is checked out:
306 306
307 307 $ hg -R ua parents
308 308 changeset: 12:f21241060d6a
309 309 user: test
310 310 date: Thu Jan 01 00:00:00 1970 +0000
311 311 summary: hacked default
312 312
313 313
314 314 $ rm -r ua
315 315
316 316
317 317 Testing #<branch>:
318 318
319 319 $ hg clone -u . a#stable ua
320 320 adding changesets
321 321 adding manifests
322 322 adding file changes
323 323 added 14 changesets with 14 changes to 3 files
324 324 updating to branch stable
325 325 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
326 326
327 327 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
328 328
329 329 $ hg -R ua heads
330 330 changeset: 13:0aae7cf88f0d
331 331 branch: stable
332 332 tag: tip
333 333 user: test
334 334 date: Thu Jan 01 00:00:00 1970 +0000
335 335 summary: another change for branch stable
336 336
337 337 changeset: 10:a7949464abda
338 338 user: test
339 339 date: Thu Jan 01 00:00:00 1970 +0000
340 340 summary: test
341 341
342 342
343 343 Same revision checked out in repo a and ua:
344 344
345 345 $ hg -R a parents --template "{node|short}\n"
346 346 e8ece76546a6
347 347 $ hg -R ua parents --template "{node|short}\n"
348 348 e8ece76546a6
349 349
350 350 $ rm -r ua
351 351
352 352
353 353 Testing -u -r <branch>:
354 354
355 355 $ hg clone -u . -r stable a ua
356 356 adding changesets
357 357 adding manifests
358 358 adding file changes
359 359 added 14 changesets with 14 changes to 3 files
360 360 updating to branch stable
361 361 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
362 362
363 363 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
364 364
365 365 $ hg -R ua heads
366 366 changeset: 13:0aae7cf88f0d
367 367 branch: stable
368 368 tag: tip
369 369 user: test
370 370 date: Thu Jan 01 00:00:00 1970 +0000
371 371 summary: another change for branch stable
372 372
373 373 changeset: 10:a7949464abda
374 374 user: test
375 375 date: Thu Jan 01 00:00:00 1970 +0000
376 376 summary: test
377 377
378 378
379 379 Same revision checked out in repo a and ua:
380 380
381 381 $ hg -R a parents --template "{node|short}\n"
382 382 e8ece76546a6
383 383 $ hg -R ua parents --template "{node|short}\n"
384 384 e8ece76546a6
385 385
386 386 $ rm -r ua
387 387
388 388
389 389 Testing -r <branch>:
390 390
391 391 $ hg clone -r stable a ua
392 392 adding changesets
393 393 adding manifests
394 394 adding file changes
395 395 added 14 changesets with 14 changes to 3 files
396 396 updating to branch stable
397 397 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
398 398
399 399 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
400 400
401 401 $ hg -R ua heads
402 402 changeset: 13:0aae7cf88f0d
403 403 branch: stable
404 404 tag: tip
405 405 user: test
406 406 date: Thu Jan 01 00:00:00 1970 +0000
407 407 summary: another change for branch stable
408 408
409 409 changeset: 10:a7949464abda
410 410 user: test
411 411 date: Thu Jan 01 00:00:00 1970 +0000
412 412 summary: test
413 413
414 414
415 415 Branch 'stable' is checked out:
416 416
417 417 $ hg -R ua parents
418 418 changeset: 13:0aae7cf88f0d
419 419 branch: stable
420 420 tag: tip
421 421 user: test
422 422 date: Thu Jan 01 00:00:00 1970 +0000
423 423 summary: another change for branch stable
424 424
425 425
426 426 $ rm -r ua
427 427
428 428
429 429 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
430 430 iterable in addbranchrevs()
431 431
432 432 $ cat <<EOF > simpleclone.py
433 433 > from mercurial import ui, hg
434 434 > myui = ui.ui()
435 435 > repo = hg.repository(myui, 'a')
436 436 > hg.clone(myui, {}, repo, dest="ua")
437 437 > EOF
438 438
439 439 $ python simpleclone.py
440 440 updating to branch default
441 441 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
442 442
443 443 $ rm -r ua
444 444
445 445 $ cat <<EOF > branchclone.py
446 446 > from mercurial import ui, hg
447 447 > myui = ui.ui()
448 448 > repo = hg.repository(myui, 'a')
449 449 > hg.clone(myui, {}, repo, dest="ua", branch=["stable",])
450 450 > EOF
451 451
452 452 $ python branchclone.py
453 453 adding changesets
454 454 adding manifests
455 455 adding file changes
456 456 added 14 changesets with 14 changes to 3 files
457 457 updating to branch stable
458 458 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
459 459 $ rm -r ua
@@ -1,283 +1,283 b''
1 1 $ "$TESTDIR/hghave" symlink || exit 80
2 2
3 3 commit date test
4 4
5 5 $ hg init test
6 6 $ cd test
7 7 $ echo foo > foo
8 8 $ hg add foo
9 9 $ HGEDITOR=true hg commit -m ""
10 10 abort: empty commit message
11 11 [255]
12 12 $ hg commit -d '0 0' -m commit-1
13 13 $ echo foo >> foo
14 14 $ hg commit -d '1 4444444' -m commit-3
15 15 abort: impossible time zone offset: 4444444
16 16 [255]
17 17 $ hg commit -d '1 15.1' -m commit-4
18 18 abort: invalid date: '1\t15.1'
19 19 [255]
20 20 $ hg commit -d 'foo bar' -m commit-5
21 21 abort: invalid date: 'foo bar'
22 22 [255]
23 23 $ hg commit -d ' 1 4444' -m commit-6
24 24 $ hg commit -d '111111111111 0' -m commit-7
25 25 abort: date exceeds 32 bits: 111111111111
26 26 [255]
27 27 $ hg commit -d '-7654321 3600' -m commit-7
28 28 abort: negative date value: -7654321
29 29 [255]
30 30
31 31 commit added file that has been deleted
32 32
33 33 $ echo bar > bar
34 34 $ hg add bar
35 35 $ rm bar
36 36 $ hg commit -m commit-8
37 37 nothing changed (1 missing files, see 'hg status')
38 38 [1]
39 39 $ hg commit -m commit-8-2 bar
40 40 abort: bar: file not found!
41 41 [255]
42 42
43 43 $ hg -q revert -a --no-backup
44 44
45 45 $ mkdir dir
46 46 $ echo boo > dir/file
47 47 $ hg add
48 48 adding dir/file (glob)
49 49 $ hg -v commit -m commit-9 dir
50 50 dir/file
51 51 committed changeset 2:d2a76177cb42
52 52
53 53 $ echo > dir.file
54 54 $ hg add
55 55 adding dir.file
56 56 $ hg commit -m commit-10 dir dir.file
57 57 abort: dir: no match under directory!
58 58 [255]
59 59
60 60 $ echo >> dir/file
61 61 $ mkdir bleh
62 62 $ mkdir dir2
63 63 $ cd bleh
64 64 $ hg commit -m commit-11 .
65 65 abort: bleh: no match under directory!
66 66 [255]
67 67 $ hg commit -m commit-12 ../dir ../dir2
68 68 abort: dir2: no match under directory!
69 69 [255]
70 70 $ hg -v commit -m commit-13 ../dir
71 71 dir/file
72 72 committed changeset 3:1cd62a2d8db5
73 73 $ cd ..
74 74
75 75 $ hg commit -m commit-14 does-not-exist
76 abort: does-not-exist: No such file or directory
76 abort: does-not-exist: * (glob)
77 77 [255]
78 78 $ ln -s foo baz
79 79 $ hg commit -m commit-15 baz
80 80 abort: baz: file not tracked!
81 81 [255]
82 82 $ touch quux
83 83 $ hg commit -m commit-16 quux
84 84 abort: quux: file not tracked!
85 85 [255]
86 86 $ echo >> dir/file
87 87 $ hg -v commit -m commit-17 dir/file
88 88 dir/file
89 89 committed changeset 4:49176991390e
90 90
91 91 An empty date was interpreted as epoch origin
92 92
93 93 $ echo foo >> foo
94 94 $ hg commit -d '' -m commit-no-date
95 95 $ hg tip --template '{date|isodate}\n' | grep '1970'
96 96 [1]
97 97
98 98 Make sure we do not obscure unknown requires file entries (issue2649)
99 99
100 100 $ echo foo >> foo
101 101 $ echo fake >> .hg/requires
102 102 $ hg commit -m bla
103 103 abort: unknown repository format: requires features 'fake' (upgrade Mercurial)!
104 104 [255]
105 105
106 106 $ cd ..
107 107
108 108
109 109 partial subdir commit test
110 110
111 111 $ hg init test2
112 112 $ cd test2
113 113 $ mkdir foo
114 114 $ echo foo > foo/foo
115 115 $ mkdir bar
116 116 $ echo bar > bar/bar
117 117 $ hg add
118 118 adding bar/bar (glob)
119 119 adding foo/foo (glob)
120 120 $ hg ci -m commit-subdir-1 foo
121 121 $ hg ci -m commit-subdir-2 bar
122 122
123 123 subdir log 1
124 124
125 125 $ hg log -v foo
126 126 changeset: 0:f97e73a25882
127 127 user: test
128 128 date: Thu Jan 01 00:00:00 1970 +0000
129 129 files: foo/foo
130 130 description:
131 131 commit-subdir-1
132 132
133 133
134 134
135 135 subdir log 2
136 136
137 137 $ hg log -v bar
138 138 changeset: 1:aa809156d50d
139 139 tag: tip
140 140 user: test
141 141 date: Thu Jan 01 00:00:00 1970 +0000
142 142 files: bar/bar
143 143 description:
144 144 commit-subdir-2
145 145
146 146
147 147
148 148 full log
149 149
150 150 $ hg log -v
151 151 changeset: 1:aa809156d50d
152 152 tag: tip
153 153 user: test
154 154 date: Thu Jan 01 00:00:00 1970 +0000
155 155 files: bar/bar
156 156 description:
157 157 commit-subdir-2
158 158
159 159
160 160 changeset: 0:f97e73a25882
161 161 user: test
162 162 date: Thu Jan 01 00:00:00 1970 +0000
163 163 files: foo/foo
164 164 description:
165 165 commit-subdir-1
166 166
167 167
168 168 $ cd ..
169 169
170 170
171 171 dot and subdir commit test
172 172
173 173 $ hg init test3
174 174 $ cd test3
175 175 $ mkdir foo
176 176 $ echo foo content > foo/plain-file
177 177 $ hg add foo/plain-file
178 178 $ hg ci -m commit-foo-subdir foo
179 179 $ echo modified foo content > foo/plain-file
180 180 $ hg ci -m commit-foo-dot .
181 181
182 182 full log
183 183
184 184 $ hg log -v
185 185 changeset: 1:95b38e3a5b2e
186 186 tag: tip
187 187 user: test
188 188 date: Thu Jan 01 00:00:00 1970 +0000
189 189 files: foo/plain-file
190 190 description:
191 191 commit-foo-dot
192 192
193 193
194 194 changeset: 0:65d4e9386227
195 195 user: test
196 196 date: Thu Jan 01 00:00:00 1970 +0000
197 197 files: foo/plain-file
198 198 description:
199 199 commit-foo-subdir
200 200
201 201
202 202
203 203 subdir log
204 204
205 205 $ cd foo
206 206 $ hg log .
207 207 changeset: 1:95b38e3a5b2e
208 208 tag: tip
209 209 user: test
210 210 date: Thu Jan 01 00:00:00 1970 +0000
211 211 summary: commit-foo-dot
212 212
213 213 changeset: 0:65d4e9386227
214 214 user: test
215 215 date: Thu Jan 01 00:00:00 1970 +0000
216 216 summary: commit-foo-subdir
217 217
218 218 $ cd ..
219 219 $ cd ..
220 220
221 221 Issue1049: Hg permits partial commit of merge without warning
222 222
223 223 $ cd ..
224 224 $ hg init issue1049
225 225 $ cd issue1049
226 226 $ echo a > a
227 227 $ hg ci -Ama
228 228 adding a
229 229 $ echo a >> a
230 230 $ hg ci -mb
231 231 $ hg up 0
232 232 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
233 233 $ echo b >> a
234 234 $ hg ci -mc
235 235 created new head
236 236 $ HGMERGE=true hg merge
237 237 merging a
238 238 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
239 239 (branch merge, don't forget to commit)
240 240
241 241 should fail because we are specifying a file name
242 242
243 243 $ hg ci -mmerge a
244 244 abort: cannot partially commit a merge (do not specify files or patterns)
245 245 [255]
246 246
247 247 should fail because we are specifying a pattern
248 248
249 249 $ hg ci -mmerge -I a
250 250 abort: cannot partially commit a merge (do not specify files or patterns)
251 251 [255]
252 252
253 253 should succeed
254 254
255 255 $ hg ci -mmerge
256 256 $ cd ..
257 257
258 258
259 259 test commit message content
260 260
261 261 $ hg init commitmsg
262 262 $ cd commitmsg
263 263 $ echo changed > changed
264 264 $ echo removed > removed
265 265 $ hg ci -qAm init
266 266
267 267 $ hg rm removed
268 268 $ echo changed >> changed
269 269 $ echo added > added
270 270 $ hg add added
271 271 $ HGEDITOR=cat hg ci -A
272 272
273 273
274 274 HG: Enter commit message. Lines beginning with 'HG:' are removed.
275 275 HG: Leave message empty to abort commit.
276 276 HG: --
277 277 HG: user: test
278 278 HG: branch 'default'
279 279 HG: added added
280 280 HG: changed changed
281 281 HG: removed removed
282 282 abort: empty commit message
283 283 [255]
@@ -1,45 +1,45 b''
1 1 $ hg init a
2 2 $ cd a
3 3
4 4 $ hg diff inexistent1 inexistent2
5 inexistent1: No such file or directory
6 inexistent2: No such file or directory
5 inexistent1: * (glob)
6 inexistent2: * (glob)
7 7
8 8 $ echo bar > foo
9 9 $ hg add foo
10 10 $ hg ci -m 'add foo'
11 11
12 12 $ echo foobar > foo
13 13 $ hg ci -m 'change foo'
14 14
15 15 $ hg --quiet diff -r 0 -r 1
16 16 --- a/foo Thu Jan 01 00:00:00 1970 +0000
17 17 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
18 18 @@ -1,1 +1,1 @@
19 19 -bar
20 20 +foobar
21 21
22 22 $ hg diff -r 0 -r 1
23 23 diff -r a99fb63adac3 -r 9b8568d3af2f foo
24 24 --- a/foo Thu Jan 01 00:00:00 1970 +0000
25 25 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
26 26 @@ -1,1 +1,1 @@
27 27 -bar
28 28 +foobar
29 29
30 30 $ hg --verbose diff -r 0 -r 1
31 31 diff -r a99fb63adac3 -r 9b8568d3af2f foo
32 32 --- a/foo Thu Jan 01 00:00:00 1970 +0000
33 33 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
34 34 @@ -1,1 +1,1 @@
35 35 -bar
36 36 +foobar
37 37
38 38 $ hg --debug diff -r 0 -r 1
39 39 diff -r a99fb63adac3f31816a22f665bc3b7a7655b30f4 -r 9b8568d3af2f1749445eef03aede868a6f39f210 foo
40 40 --- a/foo Thu Jan 01 00:00:00 1970 +0000
41 41 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
42 42 @@ -1,1 +1,1 @@
43 43 -bar
44 44 +foobar
45 45
@@ -1,18 +1,18 b''
1 1 $ hg init
2 2
3 $ python -c 'print "confuse str.splitlines\nembedded\rnewline"' > a
3 $ python -c 'file("a", "wb").write("confuse str.splitlines\nembedded\rnewline\n")'
4 4 $ hg ci -Ama -d '1 0'
5 5 adding a
6 6
7 7 $ echo clean diff >> a
8 8 $ hg ci -mb -d '2 0'
9 9
10 10 $ hg diff -r0 -r1
11 11 diff -r 107ba6f817b5 -r 310ce7989cdc a
12 12 --- a/a Thu Jan 01 00:00:01 1970 +0000
13 13 +++ b/a Thu Jan 01 00:00:02 1970 +0000
14 14 @@ -1,2 +1,3 @@
15 15 confuse str.splitlines
16 16 embedded\rnewline (esc)
17 17 +clean diff
18 18
@@ -1,94 +1,94 b''
1 1 import sys, os, subprocess
2 2
3 if subprocess.call(['%s/hghave' % os.environ['TESTDIR'], 'cacheable']):
3 if subprocess.call(['python', '%s/hghave' % os.environ['TESTDIR'], 'cacheable']):
4 4 sys.exit(80)
5 5
6 6 from mercurial import util, scmutil, extensions
7 7
8 8 filecache = scmutil.filecache
9 9
10 10 class fakerepo(object):
11 11 def __init__(self):
12 12 self._filecache = {}
13 13
14 14 def join(self, p):
15 15 return p
16 16
17 17 def sjoin(self, p):
18 18 return p
19 19
20 20 @filecache('x')
21 21 def cached(self):
22 22 print 'creating'
23 23
24 24 def invalidate(self):
25 25 for k in self._filecache:
26 26 try:
27 27 delattr(self, k)
28 28 except AttributeError:
29 29 pass
30 30
31 31 def basic(repo):
32 32 # file doesn't exist, calls function
33 33 repo.cached
34 34
35 35 repo.invalidate()
36 36 # file still doesn't exist, uses cache
37 37 repo.cached
38 38
39 39 # create empty file
40 40 f = open('x', 'w')
41 41 f.close()
42 42 repo.invalidate()
43 43 # should recreate the object
44 44 repo.cached
45 45
46 46 f = open('x', 'w')
47 47 f.write('a')
48 48 f.close()
49 49 repo.invalidate()
50 50 # should recreate the object
51 51 repo.cached
52 52
53 53 repo.invalidate()
54 54 # stats file again, nothing changed, reuses object
55 55 repo.cached
56 56
57 57 # atomic replace file, size doesn't change
58 58 # hopefully st_mtime doesn't change as well so this doesn't use the cache
59 59 # because of inode change
60 60 f = scmutil.opener('.')('x', 'w', atomictemp=True)
61 61 f.write('b')
62 62 f.close()
63 63
64 64 repo.invalidate()
65 65 repo.cached
66 66
67 67 def fakeuncacheable():
68 68 def wrapcacheable(orig, *args, **kwargs):
69 69 return False
70 70
71 71 def wrapinit(orig, *args, **kwargs):
72 72 pass
73 73
74 74 originit = extensions.wrapfunction(util.cachestat, '__init__', wrapinit)
75 75 origcacheable = extensions.wrapfunction(util.cachestat, 'cacheable',
76 76 wrapcacheable)
77 77
78 78 try:
79 79 os.remove('x')
80 80 except:
81 81 pass
82 82
83 83 basic(fakerepo())
84 84
85 85 util.cachestat.cacheable = origcacheable
86 86 util.cachestat.__init__ = originit
87 87
88 88 print 'basic:'
89 89 print
90 90 basic(fakerepo())
91 91 print
92 92 print 'fakeuncacheable:'
93 93 print
94 94 fakeuncacheable()
@@ -1,996 +1,998 b''
1 1 $ hg init a
2 2 $ mkdir a/d1
3 3 $ mkdir a/d1/d2
4 4 $ echo line 1 > a/a
5 5 $ echo line 1 > a/d1/d2/a
6 6 $ hg --cwd a ci -Ama
7 7 adding a
8 8 adding d1/d2/a
9 9
10 10 $ echo line 2 >> a/a
11 11 $ hg --cwd a ci -u someone -d '1 0' -m'second change'
12 12
13 13 import with no args:
14 14
15 15 $ hg --cwd a import
16 16 abort: need at least one patch to import
17 17 [255]
18 18
19 19 generate patches for the test
20 20
21 21 $ hg --cwd a export tip > exported-tip.patch
22 22 $ hg --cwd a diff -r0:1 > diffed-tip.patch
23 23
24 24
25 25 import exported patch
26 26
27 27 $ hg clone -r0 a b
28 28 adding changesets
29 29 adding manifests
30 30 adding file changes
31 31 added 1 changesets with 2 changes to 2 files
32 32 updating to branch default
33 33 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 34 $ hg --cwd b import ../exported-tip.patch
35 35 applying ../exported-tip.patch
36 36
37 37 message and committer should be same
38 38
39 39 $ hg --cwd b tip
40 40 changeset: 1:1d4bd90af0e4
41 41 tag: tip
42 42 user: someone
43 43 date: Thu Jan 01 00:00:01 1970 +0000
44 44 summary: second change
45 45
46 46 $ rm -r b
47 47
48 48
49 49 import exported patch with external patcher
50 50
51 51 $ cat > dummypatch.py <<EOF
52 52 > print 'patching file a'
53 53 > file('a', 'wb').write('line2\n')
54 54 > EOF
55 55 $ chmod +x dummypatch.py
56 56 $ hg clone -r0 a b
57 57 adding changesets
58 58 adding manifests
59 59 adding file changes
60 60 added 1 changesets with 2 changes to 2 files
61 61 updating to branch default
62 62 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 63 $ hg --config ui.patch='python ../dummypatch.py' --cwd b import ../exported-tip.patch
64 64 applying ../exported-tip.patch
65 65 $ cat b/a
66 66 line2
67 67 $ rm -r b
68 68
69 69
70 70 import of plain diff should fail without message
71 71
72 72 $ hg clone -r0 a b
73 73 adding changesets
74 74 adding manifests
75 75 adding file changes
76 76 added 1 changesets with 2 changes to 2 files
77 77 updating to branch default
78 78 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
79 79 $ hg --cwd b import ../diffed-tip.patch
80 80 applying ../diffed-tip.patch
81 81 abort: empty commit message
82 82 [255]
83 83 $ rm -r b
84 84
85 85
86 86 import of plain diff should be ok with message
87 87
88 88 $ hg clone -r0 a b
89 89 adding changesets
90 90 adding manifests
91 91 adding file changes
92 92 added 1 changesets with 2 changes to 2 files
93 93 updating to branch default
94 94 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
95 95 $ hg --cwd b import -mpatch ../diffed-tip.patch
96 96 applying ../diffed-tip.patch
97 97 $ rm -r b
98 98
99 99
100 100 import of plain diff with specific date and user
101 101
102 102 $ hg clone -r0 a b
103 103 adding changesets
104 104 adding manifests
105 105 adding file changes
106 106 added 1 changesets with 2 changes to 2 files
107 107 updating to branch default
108 108 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 109 $ hg --cwd b import -mpatch -d '1 0' -u 'user@nowhere.net' ../diffed-tip.patch
110 110 applying ../diffed-tip.patch
111 111 $ hg -R b tip -pv
112 112 changeset: 1:ca68f19f3a40
113 113 tag: tip
114 114 user: user@nowhere.net
115 115 date: Thu Jan 01 00:00:01 1970 +0000
116 116 files: a
117 117 description:
118 118 patch
119 119
120 120
121 121 diff -r 80971e65b431 -r ca68f19f3a40 a
122 122 --- a/a Thu Jan 01 00:00:00 1970 +0000
123 123 +++ b/a Thu Jan 01 00:00:01 1970 +0000
124 124 @@ -1,1 +1,2 @@
125 125 line 1
126 126 +line 2
127 127
128 128 $ rm -r b
129 129
130 130
131 131 import of plain diff should be ok with --no-commit
132 132
133 133 $ hg clone -r0 a b
134 134 adding changesets
135 135 adding manifests
136 136 adding file changes
137 137 added 1 changesets with 2 changes to 2 files
138 138 updating to branch default
139 139 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 140 $ hg --cwd b import --no-commit ../diffed-tip.patch
141 141 applying ../diffed-tip.patch
142 142 $ hg --cwd b diff --nodates
143 143 diff -r 80971e65b431 a
144 144 --- a/a
145 145 +++ b/a
146 146 @@ -1,1 +1,2 @@
147 147 line 1
148 148 +line 2
149 149 $ rm -r b
150 150
151 151
152 152 import of malformed plain diff should fail
153 153
154 154 $ hg clone -r0 a b
155 155 adding changesets
156 156 adding manifests
157 157 adding file changes
158 158 added 1 changesets with 2 changes to 2 files
159 159 updating to branch default
160 160 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
161 161 $ sed 's/1,1/foo/' < diffed-tip.patch > broken.patch
162 162 $ hg --cwd b import -mpatch ../broken.patch
163 163 applying ../broken.patch
164 164 abort: bad hunk #1
165 165 [255]
166 166 $ rm -r b
167 167
168 168
169 169 hg -R repo import
170 170 put the clone in a subdir - having a directory named "a"
171 171 used to hide a bug.
172 172
173 173 $ mkdir dir
174 174 $ hg clone -r0 a dir/b
175 175 adding changesets
176 176 adding manifests
177 177 adding file changes
178 178 added 1 changesets with 2 changes to 2 files
179 179 updating to branch default
180 180 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
181 181 $ cd dir
182 182 $ hg -R b import ../exported-tip.patch
183 183 applying ../exported-tip.patch
184 184 $ cd ..
185 185 $ rm -r dir
186 186
187 187
188 188 import from stdin
189 189
190 190 $ hg clone -r0 a b
191 191 adding changesets
192 192 adding manifests
193 193 adding file changes
194 194 added 1 changesets with 2 changes to 2 files
195 195 updating to branch default
196 196 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
197 197 $ hg --cwd b import - < exported-tip.patch
198 198 applying patch from stdin
199 199 $ rm -r b
200 200
201 201
202 202 import two patches in one stream
203 203
204 204 $ hg init b
205 205 $ hg --cwd a export 0:tip | hg --cwd b import -
206 206 applying patch from stdin
207 207 $ hg --cwd a id
208 208 1d4bd90af0e4 tip
209 209 $ hg --cwd b id
210 210 1d4bd90af0e4 tip
211 211 $ rm -r b
212 212
213 213
214 214 override commit message
215 215
216 216 $ hg clone -r0 a b
217 217 adding changesets
218 218 adding manifests
219 219 adding file changes
220 220 added 1 changesets with 2 changes to 2 files
221 221 updating to branch default
222 222 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
223 223 $ hg --cwd b import -m 'override' - < exported-tip.patch
224 224 applying patch from stdin
225 225 $ hg --cwd b tip | grep override
226 226 summary: override
227 227 $ rm -r b
228 228
229 229 $ cat > mkmsg.py <<EOF
230 230 > import email.Message, sys
231 231 > msg = email.Message.Message()
232 232 > patch = open(sys.argv[1], 'rb').read()
233 233 > msg.set_payload('email commit message\n' + patch)
234 234 > msg['Subject'] = 'email patch'
235 235 > msg['From'] = 'email patcher'
236 > sys.stdout.write(msg.as_string())
236 > file(sys.argv[2], 'wb').write(msg.as_string())
237 237 > EOF
238 238
239 239
240 240 plain diff in email, subject, message body
241 241
242 242 $ hg clone -r0 a b
243 243 adding changesets
244 244 adding manifests
245 245 adding file changes
246 246 added 1 changesets with 2 changes to 2 files
247 247 updating to branch default
248 248 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
249 $ python mkmsg.py diffed-tip.patch > msg.patch
249 $ python mkmsg.py diffed-tip.patch msg.patch
250 250 $ hg --cwd b import ../msg.patch
251 251 applying ../msg.patch
252 252 $ hg --cwd b tip | grep email
253 253 user: email patcher
254 254 summary: email patch
255 255 $ rm -r b
256 256
257 257
258 258 plain diff in email, no subject, message body
259 259
260 260 $ hg clone -r0 a b
261 261 adding changesets
262 262 adding manifests
263 263 adding file changes
264 264 added 1 changesets with 2 changes to 2 files
265 265 updating to branch default
266 266 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
267 267 $ grep -v '^Subject:' msg.patch | hg --cwd b import -
268 268 applying patch from stdin
269 269 $ rm -r b
270 270
271 271
272 272 plain diff in email, subject, no message body
273 273
274 274 $ hg clone -r0 a b
275 275 adding changesets
276 276 adding manifests
277 277 adding file changes
278 278 added 1 changesets with 2 changes to 2 files
279 279 updating to branch default
280 280 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
281 281 $ grep -v '^email ' msg.patch | hg --cwd b import -
282 282 applying patch from stdin
283 283 $ rm -r b
284 284
285 285
286 286 plain diff in email, no subject, no message body, should fail
287 287
288 288 $ hg clone -r0 a b
289 289 adding changesets
290 290 adding manifests
291 291 adding file changes
292 292 added 1 changesets with 2 changes to 2 files
293 293 updating to branch default
294 294 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
295 295 $ egrep -v '^(Subject|email)' msg.patch | hg --cwd b import -
296 296 applying patch from stdin
297 297 abort: empty commit message
298 298 [255]
299 299 $ rm -r b
300 300
301 301
302 302 hg export in email, should use patch header
303 303
304 304 $ hg clone -r0 a b
305 305 adding changesets
306 306 adding manifests
307 307 adding file changes
308 308 added 1 changesets with 2 changes to 2 files
309 309 updating to branch default
310 310 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
311 $ python mkmsg.py exported-tip.patch | hg --cwd b import -
311 $ python mkmsg.py exported-tip.patch msg.patch
312 $ cat msg.patch | hg --cwd b import -
312 313 applying patch from stdin
313 314 $ hg --cwd b tip | grep second
314 315 summary: second change
315 316 $ rm -r b
316 317
317 318
318 319 subject: duplicate detection, removal of [PATCH]
319 320 The '---' tests the gitsendmail handling without proper mail headers
320 321
321 322 $ cat > mkmsg2.py <<EOF
322 323 > import email.Message, sys
323 324 > msg = email.Message.Message()
324 325 > patch = open(sys.argv[1], 'rb').read()
325 326 > msg.set_payload('email patch\n\nnext line\n---\n' + patch)
326 327 > msg['Subject'] = '[PATCH] email patch'
327 328 > msg['From'] = 'email patcher'
328 > sys.stdout.write(msg.as_string())
329 > file(sys.argv[2], 'wb').write(msg.as_string())
329 330 > EOF
330 331
331 332
332 333 plain diff in email, [PATCH] subject, message body with subject
333 334
334 335 $ hg clone -r0 a b
335 336 adding changesets
336 337 adding manifests
337 338 adding file changes
338 339 added 1 changesets with 2 changes to 2 files
339 340 updating to branch default
340 341 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
341 $ python mkmsg2.py diffed-tip.patch | hg --cwd b import -
342 $ python mkmsg2.py diffed-tip.patch msg.patch
343 $ cat msg.patch | hg --cwd b import -
342 344 applying patch from stdin
343 345 $ hg --cwd b tip --template '{desc}\n'
344 346 email patch
345 347
346 348 next line
347 349 ---
348 350 $ rm -r b
349 351
350 352
351 353 Issue963: Parent of working dir incorrect after import of multiple
352 354 patches and rollback
353 355
354 356 We weren't backing up the correct dirstate file when importing many
355 357 patches: import patch1 patch2; rollback
356 358
357 359 $ echo line 3 >> a/a
358 360 $ hg --cwd a ci -m'third change'
359 361 $ hg --cwd a export -o '../patch%R' 1 2
360 362 $ hg clone -qr0 a b
361 363 $ hg --cwd b parents --template 'parent: {rev}\n'
362 364 parent: 0
363 365 $ hg --cwd b import -v ../patch1 ../patch2
364 366 applying ../patch1
365 367 patching file a
366 368 a
367 369 created 1d4bd90af0e4
368 370 applying ../patch2
369 371 patching file a
370 372 a
371 373 created 6d019af21222
372 374 $ hg --cwd b rollback
373 375 repository tip rolled back to revision 0 (undo import)
374 376 working directory now based on revision 0
375 377 $ hg --cwd b parents --template 'parent: {rev}\n'
376 378 parent: 0
377 379 $ rm -r b
378 380
379 381
380 382 importing a patch in a subdirectory failed at the commit stage
381 383
382 384 $ echo line 2 >> a/d1/d2/a
383 385 $ hg --cwd a ci -u someoneelse -d '1 0' -m'subdir change'
384 386
385 387 hg import in a subdirectory
386 388
387 389 $ hg clone -r0 a b
388 390 adding changesets
389 391 adding manifests
390 392 adding file changes
391 393 added 1 changesets with 2 changes to 2 files
392 394 updating to branch default
393 395 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
394 396 $ hg --cwd a export tip > tmp
395 397 $ sed -e 's/d1\/d2\///' < tmp > subdir-tip.patch
396 398 $ dir=`pwd`
397 399 $ cd b/d1/d2 2>&1 > /dev/null
398 400 $ hg import ../../../subdir-tip.patch
399 401 applying ../../../subdir-tip.patch
400 402 $ cd "$dir"
401 403
402 404 message should be 'subdir change'
403 405 committer should be 'someoneelse'
404 406
405 407 $ hg --cwd b tip
406 408 changeset: 1:3577f5aea227
407 409 tag: tip
408 410 user: someoneelse
409 411 date: Thu Jan 01 00:00:01 1970 +0000
410 412 summary: subdir change
411 413
412 414
413 415 should be empty
414 416
415 417 $ hg --cwd b status
416 418
417 419
418 420 Test fuzziness (ambiguous patch location, fuzz=2)
419 421
420 422 $ hg init fuzzy
421 423 $ cd fuzzy
422 424 $ echo line1 > a
423 425 $ echo line0 >> a
424 426 $ echo line3 >> a
425 427 $ hg ci -Am adda
426 428 adding a
427 429 $ echo line1 > a
428 430 $ echo line2 >> a
429 431 $ echo line0 >> a
430 432 $ echo line3 >> a
431 433 $ hg ci -m change a
432 434 $ hg export tip > fuzzy-tip.patch
433 435 $ hg up -C 0
434 436 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
435 437 $ echo line1 > a
436 438 $ echo line0 >> a
437 439 $ echo line1 >> a
438 440 $ echo line0 >> a
439 441 $ hg ci -m brancha
440 442 created new head
441 443 $ hg import --no-commit -v fuzzy-tip.patch
442 444 applying fuzzy-tip.patch
443 445 patching file a
444 446 Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
445 447 applied to working directory
446 448 $ hg revert -a
447 449 reverting a
448 450
449 451
450 452 import with --no-commit should have written .hg/last-message.txt
451 453
452 454 $ cat .hg/last-message.txt
453 455 change (no-eol)
454 456
455 457
456 458 test fuzziness with eol=auto
457 459
458 460 $ hg --config patch.eol=auto import --no-commit -v fuzzy-tip.patch
459 461 applying fuzzy-tip.patch
460 462 patching file a
461 463 Hunk #1 succeeded at 1 with fuzz 2 (offset -2 lines).
462 464 applied to working directory
463 465 $ cd ..
464 466
465 467
466 468 Test hunk touching empty files (issue906)
467 469
468 470 $ hg init empty
469 471 $ cd empty
470 472 $ touch a
471 473 $ touch b1
472 474 $ touch c1
473 475 $ echo d > d
474 476 $ hg ci -Am init
475 477 adding a
476 478 adding b1
477 479 adding c1
478 480 adding d
479 481 $ echo a > a
480 482 $ echo b > b1
481 483 $ hg mv b1 b2
482 484 $ echo c > c1
483 485 $ hg copy c1 c2
484 486 $ rm d
485 487 $ touch d
486 488 $ hg diff --git
487 489 diff --git a/a b/a
488 490 --- a/a
489 491 +++ b/a
490 492 @@ -0,0 +1,1 @@
491 493 +a
492 494 diff --git a/b1 b/b2
493 495 rename from b1
494 496 rename to b2
495 497 --- a/b1
496 498 +++ b/b2
497 499 @@ -0,0 +1,1 @@
498 500 +b
499 501 diff --git a/c1 b/c1
500 502 --- a/c1
501 503 +++ b/c1
502 504 @@ -0,0 +1,1 @@
503 505 +c
504 506 diff --git a/c1 b/c2
505 507 copy from c1
506 508 copy to c2
507 509 --- a/c1
508 510 +++ b/c2
509 511 @@ -0,0 +1,1 @@
510 512 +c
511 513 diff --git a/d b/d
512 514 --- a/d
513 515 +++ b/d
514 516 @@ -1,1 +0,0 @@
515 517 -d
516 518 $ hg ci -m empty
517 519 $ hg export --git tip > empty.diff
518 520 $ hg up -C 0
519 521 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
520 522 $ hg import empty.diff
521 523 applying empty.diff
522 524 $ for name in a b1 b2 c1 c2 d; do
523 525 > echo % $name file
524 526 > test -f $name && cat $name
525 527 > done
526 528 % a file
527 529 a
528 530 % b1 file
529 531 % b2 file
530 532 b
531 533 % c1 file
532 534 c
533 535 % c2 file
534 536 c
535 537 % d file
536 538 $ cd ..
537 539
538 540
539 541 Test importing a patch ending with a binary file removal
540 542
541 543 $ hg init binaryremoval
542 544 $ cd binaryremoval
543 545 $ echo a > a
544 546 $ python -c "file('b', 'wb').write('a\x00b')"
545 547 $ hg ci -Am addall
546 548 adding a
547 549 adding b
548 550 $ hg rm a
549 551 $ hg rm b
550 552 $ hg st
551 553 R a
552 554 R b
553 555 $ hg ci -m remove
554 556 $ hg export --git . > remove.diff
555 557 $ cat remove.diff | grep git
556 558 diff --git a/a b/a
557 559 diff --git a/b b/b
558 560 $ hg up -C 0
559 561 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
560 562 $ hg import remove.diff
561 563 applying remove.diff
562 564 $ hg manifest
563 565 $ cd ..
564 566
565 567
566 568 Issue927: test update+rename with common name
567 569
568 570 $ hg init t
569 571 $ cd t
570 572 $ touch a
571 573 $ hg ci -Am t
572 574 adding a
573 575 $ echo a > a
574 576
575 577 Here, bfile.startswith(afile)
576 578
577 579 $ hg copy a a2
578 580 $ hg ci -m copya
579 581 $ hg export --git tip > copy.diff
580 582 $ hg up -C 0
581 583 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
582 584 $ hg import copy.diff
583 585 applying copy.diff
584 586
585 587 a should contain an 'a'
586 588
587 589 $ cat a
588 590 a
589 591
590 592 and a2 should have duplicated it
591 593
592 594 $ cat a2
593 595 a
594 596 $ cd ..
595 597
596 598
597 599 test -p0
598 600
599 601 $ hg init p0
600 602 $ cd p0
601 603 $ echo a > a
602 604 $ hg ci -Am t
603 605 adding a
604 606 $ hg import -p0 - << EOF
605 607 > foobar
606 608 > --- a Sat Apr 12 22:43:58 2008 -0400
607 609 > +++ a Sat Apr 12 22:44:05 2008 -0400
608 610 > @@ -1,1 +1,1 @@
609 611 > -a
610 612 > +bb
611 613 > EOF
612 614 applying patch from stdin
613 615 $ hg status
614 616 $ cat a
615 617 bb
616 618 $ cd ..
617 619
618 620
619 621 test paths outside repo root
620 622
621 623 $ mkdir outside
622 624 $ touch outside/foo
623 625 $ hg init inside
624 626 $ cd inside
625 627 $ hg import - <<EOF
626 628 > diff --git a/a b/b
627 629 > rename from ../outside/foo
628 630 > rename to bar
629 631 > EOF
630 632 applying patch from stdin
631 633 abort: path contains illegal component: ../outside/foo
632 634 [255]
633 635 $ cd ..
634 636
635 637
636 638 test import with similarity and git and strip (issue295 et al.)
637 639
638 640 $ hg init sim
639 641 $ cd sim
640 642 $ echo 'this is a test' > a
641 643 $ hg ci -Ama
642 644 adding a
643 645 $ cat > ../rename.diff <<EOF
644 646 > diff --git a/foo/a b/foo/a
645 647 > deleted file mode 100644
646 648 > --- a/foo/a
647 649 > +++ /dev/null
648 650 > @@ -1,1 +0,0 @@
649 651 > -this is a test
650 652 > diff --git a/foo/b b/foo/b
651 653 > new file mode 100644
652 654 > --- /dev/null
653 655 > +++ b/foo/b
654 656 > @@ -0,0 +1,2 @@
655 657 > +this is a test
656 658 > +foo
657 659 > EOF
658 660 $ hg import --no-commit -v -s 1 ../rename.diff -p2
659 661 applying ../rename.diff
660 662 patching file a
661 663 patching file b
662 664 removing a
663 665 adding b
664 666 recording removal of a as rename to b (88% similar)
665 667 applied to working directory
666 668 $ hg st -C
667 669 A b
668 670 a
669 671 R a
670 672 $ hg revert -a
671 673 undeleting a
672 674 forgetting b
673 675 $ rm b
674 676 $ hg import --no-commit -v -s 100 ../rename.diff -p2
675 677 applying ../rename.diff
676 678 patching file a
677 679 patching file b
678 680 removing a
679 681 adding b
680 682 applied to working directory
681 683 $ hg st -C
682 684 A b
683 685 R a
684 686 $ cd ..
685 687
686 688
687 689 Issue1495: add empty file from the end of patch
688 690
689 691 $ hg init addemptyend
690 692 $ cd addemptyend
691 693 $ touch a
692 694 $ hg addremove
693 695 adding a
694 696 $ hg ci -m "commit"
695 697 $ cat > a.patch <<EOF
696 698 > add a, b
697 699 > diff --git a/a b/a
698 700 > --- a/a
699 701 > +++ b/a
700 702 > @@ -0,0 +1,1 @@
701 703 > +a
702 704 > diff --git a/b b/b
703 705 > new file mode 100644
704 706 > EOF
705 707 $ hg import --no-commit a.patch
706 708 applying a.patch
707 709
708 710 apply a good patch followed by an empty patch (mainly to ensure
709 711 that dirstate is *not* updated when import crashes)
710 712 $ hg update -q -C .
711 713 $ rm b
712 714 $ touch empty.patch
713 715 $ hg import a.patch empty.patch
714 716 applying a.patch
715 717 applying empty.patch
716 718 transaction abort!
717 719 rollback completed
718 720 abort: empty.patch: no diffs found
719 721 [255]
720 722 $ hg tip --template '{rev} {desc|firstline}\n'
721 723 0 commit
722 724 $ hg -q status
723 725 M a
724 726 $ cd ..
725 727
726 728 create file when source is not /dev/null
727 729
728 730 $ cat > create.patch <<EOF
729 731 > diff -Naur proj-orig/foo proj-new/foo
730 732 > --- proj-orig/foo 1969-12-31 16:00:00.000000000 -0800
731 733 > +++ proj-new/foo 2009-07-17 16:50:45.801368000 -0700
732 734 > @@ -0,0 +1,1 @@
733 735 > +a
734 736 > EOF
735 737
736 738 some people have patches like the following too
737 739
738 740 $ cat > create2.patch <<EOF
739 741 > diff -Naur proj-orig/foo proj-new/foo
740 742 > --- proj-orig/foo.orig 1969-12-31 16:00:00.000000000 -0800
741 743 > +++ proj-new/foo 2009-07-17 16:50:45.801368000 -0700
742 744 > @@ -0,0 +1,1 @@
743 745 > +a
744 746 > EOF
745 747 $ hg init oddcreate
746 748 $ cd oddcreate
747 749 $ hg import --no-commit ../create.patch
748 750 applying ../create.patch
749 751 $ cat foo
750 752 a
751 753 $ rm foo
752 754 $ hg revert foo
753 755 $ hg import --no-commit ../create2.patch
754 756 applying ../create2.patch
755 757 $ cat foo
756 758 a
757 759
758 760
759 761 Issue1859: first line mistaken for email headers
760 762
761 763 $ hg init emailconfusion
762 764 $ cd emailconfusion
763 765 $ cat > a.patch <<EOF
764 766 > module: summary
765 767 >
766 768 > description
767 769 >
768 770 >
769 771 > diff -r 000000000000 -r 9b4c1e343b55 test.txt
770 772 > --- /dev/null
771 773 > +++ b/a
772 774 > @@ -0,0 +1,1 @@
773 775 > +a
774 776 > EOF
775 777 $ hg import -d '0 0' a.patch
776 778 applying a.patch
777 779 $ hg parents -v
778 780 changeset: 0:5a681217c0ad
779 781 tag: tip
780 782 user: test
781 783 date: Thu Jan 01 00:00:00 1970 +0000
782 784 files: a
783 785 description:
784 786 module: summary
785 787
786 788 description
787 789
788 790
789 791 $ cd ..
790 792
791 793
792 794 --- in commit message
793 795
794 796 $ hg init commitconfusion
795 797 $ cd commitconfusion
796 798 $ cat > a.patch <<EOF
797 799 > module: summary
798 800 >
799 801 > --- description
800 802 >
801 803 > diff --git a/a b/a
802 804 > new file mode 100644
803 805 > --- /dev/null
804 806 > +++ b/a
805 807 > @@ -0,0 +1,1 @@
806 808 > +a
807 809 > EOF
808 810 > hg import -d '0 0' a.patch
809 811 > hg parents -v
810 812 > cd ..
811 813 >
812 814 > echo '% tricky header splitting'
813 815 > cat > trickyheaders.patch <<EOF
814 816 > From: User A <user@a>
815 817 > Subject: [PATCH] from: tricky!
816 818 >
817 819 > # HG changeset patch
818 820 > # User User B
819 821 > # Date 1266264441 18000
820 822 > # Branch stable
821 823 > # Node ID f2be6a1170ac83bf31cb4ae0bad00d7678115bc0
822 824 > # Parent 0000000000000000000000000000000000000000
823 825 > from: tricky!
824 826 >
825 827 > That is not a header.
826 828 >
827 829 > diff -r 000000000000 -r f2be6a1170ac foo
828 830 > --- /dev/null
829 831 > +++ b/foo
830 832 > @@ -0,0 +1,1 @@
831 833 > +foo
832 834 > EOF
833 835 applying a.patch
834 836 changeset: 0:f34d9187897d
835 837 tag: tip
836 838 user: test
837 839 date: Thu Jan 01 00:00:00 1970 +0000
838 840 files: a
839 841 description:
840 842 module: summary
841 843
842 844
843 845 % tricky header splitting
844 846
845 847 $ hg init trickyheaders
846 848 $ cd trickyheaders
847 849 $ hg import -d '0 0' ../trickyheaders.patch
848 850 applying ../trickyheaders.patch
849 851 $ hg export --git tip
850 852 # HG changeset patch
851 853 # User User B
852 854 # Date 0 0
853 855 # Node ID eb56ab91903632294ac504838508cb370c0901d2
854 856 # Parent 0000000000000000000000000000000000000000
855 857 from: tricky!
856 858
857 859 That is not a header.
858 860
859 861 diff --git a/foo b/foo
860 862 new file mode 100644
861 863 --- /dev/null
862 864 +++ b/foo
863 865 @@ -0,0 +1,1 @@
864 866 +foo
865 867 $ cd ..
866 868
867 869
868 870 Issue2102: hg export and hg import speak different languages
869 871
870 872 $ hg init issue2102
871 873 $ cd issue2102
872 874 $ mkdir -p src/cmd/gc
873 875 $ touch src/cmd/gc/mksys.bash
874 876 $ hg ci -Am init
875 877 adding src/cmd/gc/mksys.bash
876 878 $ hg import - <<EOF
877 879 > # HG changeset patch
878 880 > # User Rob Pike
879 881 > # Date 1216685449 25200
880 882 > # Node ID 03aa2b206f499ad6eb50e6e207b9e710d6409c98
881 883 > # Parent 93d10138ad8df586827ca90b4ddb5033e21a3a84
882 884 > help management of empty pkg and lib directories in perforce
883 885 >
884 886 > R=gri
885 887 > DELTA=4 (4 added, 0 deleted, 0 changed)
886 888 > OCL=13328
887 889 > CL=13328
888 890 >
889 891 > diff --git a/lib/place-holder b/lib/place-holder
890 892 > new file mode 100644
891 893 > --- /dev/null
892 894 > +++ b/lib/place-holder
893 895 > @@ -0,0 +1,2 @@
894 896 > +perforce does not maintain empty directories.
895 897 > +this file helps.
896 898 > diff --git a/pkg/place-holder b/pkg/place-holder
897 899 > new file mode 100644
898 900 > --- /dev/null
899 901 > +++ b/pkg/place-holder
900 902 > @@ -0,0 +1,2 @@
901 903 > +perforce does not maintain empty directories.
902 904 > +this file helps.
903 905 > diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash
904 906 > old mode 100644
905 907 > new mode 100755
906 908 > EOF
907 909 applying patch from stdin
908 910 $ hg sum
909 911 parent: 1:d59915696727 tip
910 912 help management of empty pkg and lib directories in perforce
911 913 branch: default
912 914 commit: (clean)
913 915 update: (current)
914 916 $ hg diff --git -c tip
915 917 diff --git a/lib/place-holder b/lib/place-holder
916 918 new file mode 100644
917 919 --- /dev/null
918 920 +++ b/lib/place-holder
919 921 @@ -0,0 +1,2 @@
920 922 +perforce does not maintain empty directories.
921 923 +this file helps.
922 924 diff --git a/pkg/place-holder b/pkg/place-holder
923 925 new file mode 100644
924 926 --- /dev/null
925 927 +++ b/pkg/place-holder
926 928 @@ -0,0 +1,2 @@
927 929 +perforce does not maintain empty directories.
928 930 +this file helps.
929 931 diff --git a/src/cmd/gc/mksys.bash b/src/cmd/gc/mksys.bash
930 932 old mode 100644
931 933 new mode 100755
932 934 $ cd ..
933 935
934 936
935 937 diff lines looking like headers
936 938
937 939 $ hg init difflineslikeheaders
938 940 $ cd difflineslikeheaders
939 941 $ echo a >a
940 942 $ echo b >b
941 943 $ echo c >c
942 944 $ hg ci -Am1
943 945 adding a
944 946 adding b
945 947 adding c
946 948
947 949 $ echo "key: value" >>a
948 950 $ echo "key: value" >>b
949 951 $ echo "foo" >>c
950 952 $ hg ci -m2
951 953
952 954 $ hg up -C 0
953 955 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
954 956 $ hg diff --git -c1 >want
955 957 $ hg diff -c1 | hg import --no-commit -
956 958 applying patch from stdin
957 959 $ hg diff --git >have
958 960 $ diff want have
959 961 $ cd ..
960 962
961 963 import a unified diff with no lines of context (diff -U0)
962 964
963 965 $ hg init diffzero
964 966 $ cd diffzero
965 967 $ cat > f << EOF
966 968 > c2
967 969 > c4
968 970 > c5
969 971 > EOF
970 972 $ hg commit -Am0
971 973 adding f
972 974
973 975 $ hg import --no-commit - << EOF
974 976 > # HG changeset patch
975 977 > # User test
976 978 > # Date 0 0
977 979 > # Node ID f4974ab632f3dee767567b0576c0ec9a4508575c
978 980 > # Parent 8679a12a975b819fae5f7ad3853a2886d143d794
979 981 > 1
980 982 > diff -r 8679a12a975b -r f4974ab632f3 f
981 983 > --- a/f Thu Jan 01 00:00:00 1970 +0000
982 984 > +++ b/f Thu Jan 01 00:00:00 1970 +0000
983 985 > @@ -0,0 +1,1 @@
984 986 > +c1
985 987 > @@ -1,0 +3,1 @@
986 988 > +c3
987 989 > @@ -3,1 +4,0 @@
988 990 > -c5
989 991 > EOF
990 992 applying patch from stdin
991 993
992 994 $ cat f
993 995 c1
994 996 c2
995 997 c3
996 998 c4
@@ -1,844 +1,845 b''
1 1 $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80
2 2
3 3 $ cat >> $HGRCPATH <<EOF
4 4 > [extensions]
5 5 > largefiles=
6 6 > purge=
7 7 > rebase=
8 8 > transplant=
9 9 > [largefiles]
10 10 > minsize=2
11 11 > patterns=glob:**.dat
12 12 > EOF
13 13
14 14 Create the repo with a couple of revisions of both large and normal
15 15 files, testing that status correctly shows largefiles.
16 16
17 17 $ hg init a
18 18 $ cd a
19 19 $ mkdir sub
20 20 $ echo normal1 > normal1
21 21 $ echo normal2 > sub/normal2
22 22 $ echo large1 > large1
23 23 $ echo large2 > sub/large2
24 24 $ hg add normal1 sub/normal2
25 25 $ hg add --large large1 sub/large2
26 26 $ hg commit -m "add files"
27 27 $ echo normal11 > normal1
28 28 $ echo normal22 > sub/normal2
29 29 $ echo large11 > large1
30 30 $ echo large22 > sub/large2
31 31 $ hg st
32 32 M large1
33 33 M normal1
34 34 M sub/large2
35 35 M sub/normal2
36 36 $ hg commit -m "edit files"
37 37
38 38 Commit preserved largefile contents.
39 39
40 40 $ cat normal1
41 41 normal11
42 42 $ cat large1
43 43 large11
44 44 $ cat sub/normal2
45 45 normal22
46 46 $ cat sub/large2
47 47 large22
48 48
49 49 Remove both largefiles and normal files.
50 50
51 51 $ hg remove normal1 large1
52 52 $ hg commit -m "remove files"
53 53 $ ls
54 54 sub
55 55
56 56 Copy both largefiles and normal files.
57 57
58 58 $ hg cp sub/normal2 normal1
59 59 $ hg cp sub/large2 large1
60 60 $ hg commit -m "copy files"
61 61 $ cat normal1
62 62 normal22
63 63 $ cat large1
64 64 large22
65 65
66 66 Test moving largefiles and verify that normal files are also unaffected.
67 67
68 68 $ hg mv normal1 normal3
69 69 $ hg mv large1 large3
70 70 $ hg mv sub/normal2 sub/normal4
71 71 $ hg mv sub/large2 sub/large4
72 72 $ hg commit -m "move files"
73 73 $ cat normal3
74 74 normal22
75 75 $ cat large3
76 76 large22
77 77 $ cat sub/normal4
78 78 normal22
79 79 $ cat sub/large4
80 80 large22
81 81
82 82 Test archiving the various revisions. These hit corner cases known with
83 83 archiving.
84 84
85 85 $ hg archive -r 0 ../archive0
86 86 $ hg archive -r 1 ../archive1
87 87 $ hg archive -r 2 ../archive2
88 88 $ hg archive -r 3 ../archive3
89 89 $ hg archive -r 4 ../archive4
90 90 $ cd ../archive0
91 91 $ cat normal1
92 92 normal1
93 93 $ cat large1
94 94 large1
95 95 $ cat sub/normal2
96 96 normal2
97 97 $ cat sub/large2
98 98 large2
99 99 $ cd ../archive1
100 100 $ cat normal1
101 101 normal11
102 102 $ cat large1
103 103 large11
104 104 $ cat sub/normal2
105 105 normal22
106 106 $ cat sub/large2
107 107 large22
108 108 $ cd ../archive2
109 109 $ ls
110 110 sub
111 111 $ cat sub/normal2
112 112 normal22
113 113 $ cat sub/large2
114 114 large22
115 115 $ cd ../archive3
116 116 $ cat normal1
117 117 normal22
118 118 $ cat large1
119 119 large22
120 120 $ cat sub/normal2
121 121 normal22
122 122 $ cat sub/large2
123 123 large22
124 124 $ cd ../archive4
125 125 $ cat normal3
126 126 normal22
127 127 $ cat large3
128 128 large22
129 129 $ cat sub/normal4
130 130 normal22
131 131 $ cat sub/large4
132 132 large22
133 133
134 134 Commit corner case: specify files to commit.
135 135
136 136 $ cd ../a
137 137 $ echo normal3 > normal3
138 138 $ echo large3 > large3
139 139 $ echo normal4 > sub/normal4
140 140 $ echo large4 > sub/large4
141 141 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
142 142 $ cat normal3
143 143 normal3
144 144 $ cat large3
145 145 large3
146 146 $ cat sub/normal4
147 147 normal4
148 148 $ cat sub/large4
149 149 large4
150 150
151 151 One more commit corner case: commit from a subdirectory.
152 152
153 153 $ cd ../a
154 154 $ echo normal33 > normal3
155 155 $ echo large33 > large3
156 156 $ echo normal44 > sub/normal4
157 157 $ echo large44 > sub/large4
158 158 $ cd sub
159 159 $ hg commit -m "edit files yet again"
160 160 $ cat ../normal3
161 161 normal33
162 162 $ cat ../large3
163 163 large33
164 164 $ cat normal4
165 165 normal44
166 166 $ cat large4
167 167 large44
168 168
169 169 Committing standins is not allowed.
170 170
171 171 $ cd ..
172 172 $ echo large3 > large3
173 173 $ hg commit .hglf/large3 -m "try to commit standin"
174 174 abort: file ".hglf/large3" is a largefile standin
175 175 (commit the largefile itself instead)
176 176 [255]
177 177
178 178 Corner cases for adding largefiles.
179 179
180 180 $ echo large5 > large5
181 181 $ hg add --large large5
182 182 $ hg add --large large5
183 183 large5 already a largefile
184 184 $ mkdir sub2
185 185 $ echo large6 > sub2/large6
186 186 $ echo large7 > sub2/large7
187 187 $ hg add --large sub2
188 188 adding sub2/large6 as a largefile (glob)
189 189 adding sub2/large7 as a largefile (glob)
190 190 $ hg st
191 191 M large3
192 192 A large5
193 193 A sub2/large6
194 194 A sub2/large7
195 195
196 196 Config settings (pattern **.dat, minsize 2 MB) are respected.
197 197
198 198 $ echo testdata > test.dat
199 199 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
200 200 $ hg add
201 201 adding reallylarge as a largefile
202 202 adding test.dat as a largefile
203 203
204 204 Test that minsize and --lfsize handle float values;
205 205 also tests that --lfsize overrides largefiles.minsize.
206 206 (0.250 MB = 256 kB = 262144 B)
207 207
208 208 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
209 209 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
210 210 $ hg --config largefiles.minsize=.25 add
211 211 adding ratherlarge as a largefile
212 212 adding medium
213 213 $ hg forget medium
214 214 $ hg --config largefiles.minsize=.25 add --lfsize=.125
215 215 adding medium as a largefile
216 216 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
217 217 $ hg --config largefiles.minsize=.25 add --lfsize=.125
218 218 adding notlarge
219 219 $ hg forget notlarge
220 220
221 221 Test forget on largefiles.
222 222
223 223 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
224 224 $ hg st
225 225 A sub2/large6
226 226 A sub2/large7
227 227 R large3
228 228 ? large5
229 229 ? medium
230 230 ? notlarge
231 231 ? ratherlarge
232 232 ? reallylarge
233 233 ? test.dat
234 234 $ hg commit -m "add/edit more largefiles"
235 235 $ hg st
236 236 ? large3
237 237 ? large5
238 238 ? medium
239 239 ? notlarge
240 240 ? ratherlarge
241 241 ? reallylarge
242 242 ? test.dat
243 243
244 244 Purge with largefiles: verify that largefiles are still in the working
245 245 dir after a purge.
246 246
247 247 $ hg purge --all
248 248 $ cat sub/large4
249 249 large44
250 250 $ cat sub2/large6
251 251 large6
252 252 $ cat sub2/large7
253 253 large7
254 254
255 255 Clone a largefiles repo.
256 256
257 257 $ cd ..
258 258 $ hg clone a b
259 259 updating to branch default
260 260 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
261 261 getting changed largefiles
262 262 3 largefiles updated, 0 removed
263 263 $ cd b
264 264 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
265 265 7:daea875e9014 add/edit more largefiles
266 266 6:4355d653f84f edit files yet again
267 267 5:9d5af5072dbd edit files again
268 268 4:74c02385b94c move files
269 269 3:9e8fbc4bce62 copy files
270 270 2:51a0ae4d5864 remove files
271 271 1:ce8896473775 edit files
272 272 0:30d30fe6a5be add files
273 273 $ cat normal3
274 274 normal33
275 275 $ cat sub/normal4
276 276 normal44
277 277 $ cat sub/large4
278 278 large44
279 279 $ cat sub2/large6
280 280 large6
281 281 $ cat sub2/large7
282 282 large7
283 283 $ cd ..
284 284 $ hg clone a -r 3 c
285 285 adding changesets
286 286 adding manifests
287 287 adding file changes
288 288 added 4 changesets with 10 changes to 4 files
289 289 updating to branch default
290 290 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
291 291 getting changed largefiles
292 292 2 largefiles updated, 0 removed
293 293 $ cd c
294 294 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
295 295 3:9e8fbc4bce62 copy files
296 296 2:51a0ae4d5864 remove files
297 297 1:ce8896473775 edit files
298 298 0:30d30fe6a5be add files
299 299 $ cat normal1
300 300 normal22
301 301 $ cat large1
302 302 large22
303 303 $ cat sub/normal2
304 304 normal22
305 305 $ cat sub/large2
306 306 large22
307 307
308 308 Old revisions of a clone have correct largefiles content (this also
309 309 tests update).
310 310
311 311 $ hg update -r 1
312 312 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
313 313 getting changed largefiles
314 314 1 largefiles updated, 0 removed
315 315 $ cat large1
316 316 large11
317 317 $ cat sub/large2
318 318 large22
319 319
320 320 Rebasing between two repositories does not revert largefiles to old
321 321 revisions (this was a very bad bug that took a lot of work to fix).
322 322
323 323 $ cd ..
324 324 $ hg clone a d
325 325 updating to branch default
326 326 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
327 327 getting changed largefiles
328 328 3 largefiles updated, 0 removed
329 329 $ cd b
330 330 $ echo large4-modified > sub/large4
331 331 $ echo normal3-modified > normal3
332 332 $ hg commit -m "modify normal file and largefile in repo b"
333 333 $ cd ../d
334 334 $ echo large6-modified > sub2/large6
335 335 $ echo normal4-modified > sub/normal4
336 336 $ hg commit -m "modify normal file largefile in repo d"
337 337 $ cd ..
338 338 $ hg clone d e
339 339 updating to branch default
340 340 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
341 341 getting changed largefiles
342 342 3 largefiles updated, 0 removed
343 343 $ cd d
344 344 $ hg pull --rebase ../b
345 345 pulling from ../b
346 346 searching for changes
347 347 adding changesets
348 348 adding manifests
349 349 adding file changes
350 350 added 1 changesets with 2 changes to 2 files (+1 heads)
351 351 getting changed largefiles
352 352 1 largefiles updated, 0 removed
353 353 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
354 354 nothing to rebase
355 355 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
356 356 9:598410d3eb9a modify normal file largefile in repo d
357 357 8:a381d2c8c80e modify normal file and largefile in repo b
358 358 7:daea875e9014 add/edit more largefiles
359 359 6:4355d653f84f edit files yet again
360 360 5:9d5af5072dbd edit files again
361 361 4:74c02385b94c move files
362 362 3:9e8fbc4bce62 copy files
363 363 2:51a0ae4d5864 remove files
364 364 1:ce8896473775 edit files
365 365 0:30d30fe6a5be add files
366 366 $ cat normal3
367 367 normal3-modified
368 368 $ cat sub/normal4
369 369 normal4-modified
370 370 $ cat sub/large4
371 371 large4-modified
372 372 $ cat sub2/large6
373 373 large6-modified
374 374 $ cat sub2/large7
375 375 large7
376 376 $ cd ../e
377 377 $ hg pull ../b
378 378 pulling from ../b
379 379 searching for changes
380 380 adding changesets
381 381 adding manifests
382 382 adding file changes
383 383 added 1 changesets with 2 changes to 2 files (+1 heads)
384 384 (run 'hg heads' to see heads, 'hg merge' to merge)
385 385 $ hg rebase
386 386 getting changed largefiles
387 387 1 largefiles updated, 0 removed
388 388 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
389 389 $ hg log
390 390 changeset: 9:598410d3eb9a
391 391 tag: tip
392 392 user: test
393 393 date: Thu Jan 01 00:00:00 1970 +0000
394 394 summary: modify normal file largefile in repo d
395 395
396 396 changeset: 8:a381d2c8c80e
397 397 user: test
398 398 date: Thu Jan 01 00:00:00 1970 +0000
399 399 summary: modify normal file and largefile in repo b
400 400
401 401 changeset: 7:daea875e9014
402 402 user: test
403 403 date: Thu Jan 01 00:00:00 1970 +0000
404 404 summary: add/edit more largefiles
405 405
406 406 changeset: 6:4355d653f84f
407 407 user: test
408 408 date: Thu Jan 01 00:00:00 1970 +0000
409 409 summary: edit files yet again
410 410
411 411 changeset: 5:9d5af5072dbd
412 412 user: test
413 413 date: Thu Jan 01 00:00:00 1970 +0000
414 414 summary: edit files again
415 415
416 416 changeset: 4:74c02385b94c
417 417 user: test
418 418 date: Thu Jan 01 00:00:00 1970 +0000
419 419 summary: move files
420 420
421 421 changeset: 3:9e8fbc4bce62
422 422 user: test
423 423 date: Thu Jan 01 00:00:00 1970 +0000
424 424 summary: copy files
425 425
426 426 changeset: 2:51a0ae4d5864
427 427 user: test
428 428 date: Thu Jan 01 00:00:00 1970 +0000
429 429 summary: remove files
430 430
431 431 changeset: 1:ce8896473775
432 432 user: test
433 433 date: Thu Jan 01 00:00:00 1970 +0000
434 434 summary: edit files
435 435
436 436 changeset: 0:30d30fe6a5be
437 437 user: test
438 438 date: Thu Jan 01 00:00:00 1970 +0000
439 439 summary: add files
440 440
441 441 $ cat normal3
442 442 normal3-modified
443 443 $ cat sub/normal4
444 444 normal4-modified
445 445 $ cat sub/large4
446 446 large4-modified
447 447 $ cat sub2/large6
448 448 large6-modified
449 449 $ cat sub2/large7
450 450 large7
451 451
452 452 Rollback on largefiles.
453 453
454 454 $ echo large4-modified-again > sub/large4
455 455 $ hg commit -m "Modify large4 again"
456 456 $ hg rollback
457 457 repository tip rolled back to revision 9 (undo commit)
458 458 working directory now based on revision 9
459 459 $ hg st
460 460 M sub/large4
461 461 $ hg log
462 462 changeset: 9:598410d3eb9a
463 463 tag: tip
464 464 user: test
465 465 date: Thu Jan 01 00:00:00 1970 +0000
466 466 summary: modify normal file largefile in repo d
467 467
468 468 changeset: 8:a381d2c8c80e
469 469 user: test
470 470 date: Thu Jan 01 00:00:00 1970 +0000
471 471 summary: modify normal file and largefile in repo b
472 472
473 473 changeset: 7:daea875e9014
474 474 user: test
475 475 date: Thu Jan 01 00:00:00 1970 +0000
476 476 summary: add/edit more largefiles
477 477
478 478 changeset: 6:4355d653f84f
479 479 user: test
480 480 date: Thu Jan 01 00:00:00 1970 +0000
481 481 summary: edit files yet again
482 482
483 483 changeset: 5:9d5af5072dbd
484 484 user: test
485 485 date: Thu Jan 01 00:00:00 1970 +0000
486 486 summary: edit files again
487 487
488 488 changeset: 4:74c02385b94c
489 489 user: test
490 490 date: Thu Jan 01 00:00:00 1970 +0000
491 491 summary: move files
492 492
493 493 changeset: 3:9e8fbc4bce62
494 494 user: test
495 495 date: Thu Jan 01 00:00:00 1970 +0000
496 496 summary: copy files
497 497
498 498 changeset: 2:51a0ae4d5864
499 499 user: test
500 500 date: Thu Jan 01 00:00:00 1970 +0000
501 501 summary: remove files
502 502
503 503 changeset: 1:ce8896473775
504 504 user: test
505 505 date: Thu Jan 01 00:00:00 1970 +0000
506 506 summary: edit files
507 507
508 508 changeset: 0:30d30fe6a5be
509 509 user: test
510 510 date: Thu Jan 01 00:00:00 1970 +0000
511 511 summary: add files
512 512
513 513 $ cat sub/large4
514 514 large4-modified-again
515 515
516 516 "update --check" refuses to update with uncommitted changes.
517 517 $ hg update --check 8
518 518 abort: uncommitted local changes
519 519 [255]
520 520
521 521 "update --clean" leaves correct largefiles in working copy.
522 522
523 523 $ hg update --clean
524 524 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
525 525 getting changed largefiles
526 526 1 largefiles updated, 0 removed
527 527 $ cat normal3
528 528 normal3-modified
529 529 $ cat sub/normal4
530 530 normal4-modified
531 531 $ cat sub/large4
532 532 large4-modified
533 533 $ cat sub2/large6
534 534 large6-modified
535 535 $ cat sub2/large7
536 536 large7
537 537
538 538 Now "update check" is happy.
539 539 $ hg update --check 8
540 540 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
541 541 getting changed largefiles
542 542 1 largefiles updated, 0 removed
543 543 $ hg update --check
544 544 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
545 545 getting changed largefiles
546 546 1 largefiles updated, 0 removed
547 547
548 548 "revert" works on largefiles (and normal files too).
549 549 $ echo hack3 >> normal3
550 550 $ echo hack4 >> sub/normal4
551 551 $ echo hack4 >> sub/large4
552 552 $ hg rm sub2/large6
553 553 $ echo new >> sub2/large8
554 554 $ hg add --large sub2/large8
555 555 # XXX we don't really want to report that we're reverting the standin;
556 556 # that's just an implementation detail. But I don't see an obvious fix. ;-(
557 557 $ hg revert sub
558 558 reverting .hglf/sub/large4 (glob)
559 559 reverting sub/normal4 (glob)
560 560 $ hg status
561 561 M normal3
562 562 A sub2/large8
563 563 R sub2/large6
564 564 ? sub/large4.orig
565 565 ? sub/normal4.orig
566 566 $ cat sub/normal4
567 567 normal4-modified
568 568 $ cat sub/large4
569 569 large4-modified
570 570 $ hg revert -a --no-backup
571 571 undeleting .hglf/sub2/large6 (glob)
572 572 forgetting .hglf/sub2/large8 (glob)
573 573 reverting normal3
574 574 $ hg status
575 575 ? sub/large4.orig
576 576 ? sub/normal4.orig
577 577 ? sub2/large8
578 578 $ cat normal3
579 579 normal3-modified
580 580 $ cat sub2/large6
581 581 large6-modified
582 582 $ rm sub/*.orig sub2/large8
583 583
584 584 revert some files to an older revision
585 585 $ hg revert --no-backup -r 8 sub2
586 586 reverting .hglf/sub2/large6 (glob)
587 587 $ cat sub2/large6
588 588 large6
589 589 $ hg revert --no-backup sub2
590 590 reverting .hglf/sub2/large6 (glob)
591 591 $ hg status
592 592
593 593 "verify --large" actually verifies largefiles
594 594
595 595 $ hg verify --large
596 596 checking changesets
597 597 checking manifests
598 598 crosschecking files in changesets and manifests
599 599 checking files
600 600 10 files, 10 changesets, 28 total revisions
601 601 searching 1 changesets for largefiles
602 602 verified existence of 3 revisions of 3 largefiles
603 603
604 604 Merging does not revert to old versions of largefiles (this has also
605 605 been very problematic).
606 606
607 607 $ cd ..
608 608 $ hg clone -r 7 e f
609 609 adding changesets
610 610 adding manifests
611 611 adding file changes
612 612 added 8 changesets with 24 changes to 10 files
613 613 updating to branch default
614 614 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
615 615 getting changed largefiles
616 616 3 largefiles updated, 0 removed
617 617 $ cd f
618 618 $ echo "large4-merge-test" > sub/large4
619 619 $ hg commit -m "Modify large4 to test merge"
620 620 $ hg pull ../e
621 621 pulling from ../e
622 622 searching for changes
623 623 adding changesets
624 624 adding manifests
625 625 adding file changes
626 626 added 2 changesets with 4 changes to 4 files (+1 heads)
627 627 (run 'hg heads' to see heads, 'hg merge' to merge)
628 628 $ hg merge
629 629 merging sub/large4
630 630 largefile sub/large4 has a merge conflict
631 631 keep (l)ocal or take (o)ther? l
632 632 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
633 633 (branch merge, don't forget to commit)
634 634 getting changed largefiles
635 635 1 largefiles updated, 0 removed
636 636 $ hg commit -m "Merge repos e and f"
637 637 $ cat normal3
638 638 normal3-modified
639 639 $ cat sub/normal4
640 640 normal4-modified
641 641 $ cat sub/large4
642 642 large4-merge-test
643 643 $ cat sub2/large6
644 644 large6-modified
645 645 $ cat sub2/large7
646 646 large7
647 647
648 648 Test that a normal file and a largefile with the same name and path cannot
649 649 coexist.
650 650
651 651 $ rm sub2/large7
652 652 $ echo "largeasnormal" > sub2/large7
653 653 $ hg add sub2/large7
654 654 sub2/large7 already a largefile
655 655
656 656 Test that transplanting a largefile change works correctly.
657 657
658 658 $ cd ..
659 659 $ hg clone -r 8 d g
660 660 adding changesets
661 661 adding manifests
662 662 adding file changes
663 663 added 9 changesets with 26 changes to 10 files
664 664 updating to branch default
665 665 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
666 666 getting changed largefiles
667 667 3 largefiles updated, 0 removed
668 668 $ cd g
669 669 $ hg transplant -s ../d 598410d3eb9a
670 670 searching for changes
671 671 searching for changes
672 672 adding changesets
673 673 adding manifests
674 674 adding file changes
675 675 added 1 changesets with 2 changes to 2 files
676 676 getting changed largefiles
677 677 1 largefiles updated, 0 removed
678 678 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
679 679 9:598410d3eb9a modify normal file largefile in repo d
680 680 8:a381d2c8c80e modify normal file and largefile in repo b
681 681 7:daea875e9014 add/edit more largefiles
682 682 6:4355d653f84f edit files yet again
683 683 5:9d5af5072dbd edit files again
684 684 4:74c02385b94c move files
685 685 3:9e8fbc4bce62 copy files
686 686 2:51a0ae4d5864 remove files
687 687 1:ce8896473775 edit files
688 688 0:30d30fe6a5be add files
689 689 $ cat normal3
690 690 normal3-modified
691 691 $ cat sub/normal4
692 692 normal4-modified
693 693 $ cat sub/large4
694 694 large4-modified
695 695 $ cat sub2/large6
696 696 large6-modified
697 697 $ cat sub2/large7
698 698 large7
699 699 $ cd ..
700 700
701 701 vanilla clients not locked out from largefiles servers on vanilla repos
702 702 $ mkdir r1
703 703 $ cd r1
704 704 $ hg init
705 705 $ echo c1 > f1
706 706 $ hg add f1
707 707 $ hg com -m "m1"
708 708 $ cd ..
709 709 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
710 710 $ cat hg.pid >> $DAEMON_PIDS
711 711 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
712 712 requesting all changes
713 713 adding changesets
714 714 adding manifests
715 715 adding file changes
716 716 added 1 changesets with 1 changes to 1 files
717 717 updating to branch default
718 718 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
719 719
720 720 largefiles clients still work with vanilla servers
721 721 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
722 722 $ cat hg.pid >> $DAEMON_PIDS
723 723 $ hg clone http://localhost:$HGPORT1 r3
724 724 requesting all changes
725 725 adding changesets
726 726 adding manifests
727 727 adding file changes
728 728 added 1 changesets with 1 changes to 1 files
729 729 updating to branch default
730 730 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
731 731
732 732 vanilla clients locked out from largefiles http repos
733 733 $ mkdir r4
734 734 $ cd r4
735 735 $ hg init
736 736 $ echo c1 > f1
737 737 $ hg add --large f1
738 738 $ hg com -m "m1"
739 739 $ cd ..
740 740 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
741 741 $ cat hg.pid >> $DAEMON_PIDS
742 742 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
743 743 abort: remote error:
744 744
745 745 This repository uses the largefiles extension.
746 746
747 747 Please enable it in your Mercurial config file.
748 748 [255]
749 749
750 750 used all HGPORTs, kill all daemons
751 751 $ "$TESTDIR/killdaemons.py"
752 752
753 753 vanilla clients locked out from largefiles ssh repos
754 754 $ hg --config extensions.largefiles=! clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/r4 r5
755 755 abort: remote error:
756 756
757 757 This repository uses the largefiles extension.
758 758
759 759 Please enable it in your Mercurial config file.
760 760 [255]
761 761
762 762 largefiles clients refuse to push largefiles repos to vanilla servers
763 763 $ mkdir r6
764 764 $ cd r6
765 765 $ hg init
766 766 $ echo c1 > f1
767 767 $ hg add f1
768 768 $ hg com -m "m1"
769 769 $ cat >> .hg/hgrc <<!
770 770 > [web]
771 771 > push_ssl = false
772 772 > allow_push = *
773 773 > !
774 774 $ cd ..
775 775 $ hg clone r6 r7
776 776 updating to branch default
777 777 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
778 778 $ cd r7
779 779 $ echo c2 > f2
780 780 $ hg add --large f2
781 781 $ hg com -m "m2"
782 782 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
783 783 $ cat ../hg.pid >> $DAEMON_PIDS
784 784 $ hg push http://localhost:$HGPORT
785 785 pushing to http://localhost:$HGPORT/
786 786 searching for changes
787 787 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
788 788 [255]
789 789 $ cd ..
790 790
791 791 $ cd ..
792 792
793 793 Clone a local repository owned by another user
794 794 We have to simulate that here by setting $HOME and removing write permissions
795 795 $ ORIGHOME="$HOME"
796 796 $ mkdir alice
797 797 $ HOME="`pwd`/alice"
798 798 $ cd alice
799 799 $ hg init pubrepo
800 800 $ cd pubrepo
801 801 $ dd if=/dev/urandom bs=1k count=11k > a-large-file 2> /dev/null
802 802 $ hg add --large a-large-file
803 803 $ hg commit -m "Add a large file"
804 804 $ cd ..
805 805 $ chmod -R a-w pubrepo
806 806 $ cd ..
807 807 $ mkdir bob
808 808 $ HOME="`pwd`/bob"
809 809 $ cd bob
810 810 $ hg clone --pull ../alice/pubrepo pubrepo
811 811 requesting all changes
812 812 adding changesets
813 813 adding manifests
814 814 adding file changes
815 815 added 1 changesets with 1 changes to 1 files
816 816 updating to branch default
817 817 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
818 818 getting changed largefiles
819 819 1 largefiles updated, 0 removed
820 820 $ cd ..
821 $ chmod -R u+w alice/pubrepo
821 822 $ HOME="$ORIGHOME"
822 823
823 824 Symlink to a large largefile should behave the same as a symlink to a normal file
824 825 $ hg init largesymlink
825 826 $ cd largesymlink
826 827 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
827 828 $ hg add --large largefile
828 829 $ hg commit -m "commit a large file"
829 830 $ ln -s largefile largelink
830 831 $ hg add largelink
831 832 $ hg commit -m "commit a large symlink"
832 833 $ rm -f largelink
833 834 $ hg up >/dev/null
834 835 $ test -f largelink
835 836 [1]
836 837 $ test -L largelink
837 838 [1]
838 839 $ rm -f largelink # make next part of the test independent of the previous
839 840 $ hg up -C >/dev/null
840 841 $ test -f largelink
841 842 $ test -L largelink
842 843 $ cd ..
843 844
844 845
@@ -1,142 +1,142 b''
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 74 use (c)hanged version or (d)elete? remote changed file2 which local deleted
75 75 use (c)hanged version or leave (d)eleted? 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
76 76 (branch merge, don't forget to commit)
77 77
78 78 $ status
79 79 --- status ---
80 file2: No such file or directory
80 file2: * (glob)
81 81 C file1
82 82 --- file1 ---
83 83 1
84 84 changed
85 85 *** file2 does not exist
86 86
87 87
88 88 Interactive merge with bad input:
89 89
90 90 $ hg co -C
91 91 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 92
93 93 $ hg merge --config ui.interactive=true <<EOF
94 94 > foo
95 95 > bar
96 96 > d
97 97 > baz
98 98 > c
99 99 > EOF
100 100 local changed file1 which remote deleted
101 101 use (c)hanged version or (d)elete? unrecognized response
102 102 local changed file1 which remote deleted
103 103 use (c)hanged version or (d)elete? unrecognized response
104 104 local changed file1 which remote deleted
105 105 use (c)hanged version or (d)elete? remote changed file2 which local deleted
106 106 use (c)hanged version or leave (d)eleted? unrecognized response
107 107 remote changed file2 which local deleted
108 108 use (c)hanged version or leave (d)eleted? 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
109 109 (branch merge, don't forget to commit)
110 110
111 111 $ status
112 112 --- status ---
113 113 M file2
114 114 R file1
115 115 *** file1 does not exist
116 116 --- file2 ---
117 117 2
118 118 changed
119 119
120 120
121 121 Interactive merge with not enough input:
122 122
123 123 $ hg co -C
124 124 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
125 125
126 126 $ hg merge --config ui.interactive=true <<EOF
127 127 > d
128 128 > EOF
129 129 local changed file1 which remote deleted
130 130 use (c)hanged version or (d)elete? remote changed file2 which local deleted
131 131 use (c)hanged version or leave (d)eleted? abort: response expected
132 132 [255]
133 133
134 134 $ status
135 135 --- status ---
136 file2: No such file or directory
136 file2: * (glob)
137 137 C file1
138 138 --- file1 ---
139 139 1
140 140 changed
141 141 *** file2 does not exist
142 142
@@ -1,744 +1,746 b''
1 $ "$TESTDIR/hghave" system-sh || exit 80
2
1 3 test merge-tools configuration - mostly exercising filemerge.py
2 4
3 5 $ unset HGMERGE # make sure HGMERGE doesn't interfere with the test
4 6 $ hg init
5 7
6 8 revision 0
7 9
8 10 $ echo "revision 0" > f
9 11 $ echo "space" >> f
10 12 $ hg commit -Am "revision 0"
11 13 adding f
12 14
13 15 revision 1
14 16
15 17 $ echo "revision 1" > f
16 18 $ echo "space" >> f
17 19 $ hg commit -Am "revision 1"
18 20 $ hg update 0 > /dev/null
19 21
20 22 revision 2
21 23
22 24 $ echo "revision 2" > f
23 25 $ echo "space" >> f
24 26 $ hg commit -Am "revision 2"
25 27 created new head
26 28 $ hg update 0 > /dev/null
27 29
28 30 revision 3 - simple to merge
29 31
30 32 $ echo "revision 3" >> f
31 33 $ hg commit -Am "revision 3"
32 34 created new head
33 35 $ echo "[merge-tools]" > .hg/hgrc
34 36
35 37 $ beforemerge() {
36 38 > cat .hg/hgrc
37 39 > echo "# hg update -C 1"
38 40 > hg update -C 1 > /dev/null
39 41 > }
40 42 $ aftermerge() {
41 43 > echo "# cat f"
42 44 > cat f
43 45 > echo "# hg stat"
44 46 > hg stat
45 47 > rm -f f.orig
46 48 > }
47 49 $ domerge() {
48 50 > beforemerge
49 51 > echo "# hg merge $*"
50 52 > hg merge $*
51 53 > aftermerge
52 54 > }
53 55
54 56 Tool selection
55 57
56 58 default is internal merge:
57 59
58 60 $ beforemerge
59 61 [merge-tools]
60 62 # hg update -C 1
61 63
62 64 hg merge -r 2
63 65 override $PATH to ensure hgmerge not visible; use $PYTHON in case we're
64 66 running from a devel copy, not a temp installation
65 67
66 68 $ PATH="$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2
67 69 merging f
68 70 warning: conflicts during merge.
69 71 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
70 72 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
71 73 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
72 74 [1]
73 75 $ aftermerge
74 76 # cat f
75 77 <<<<<<< local
76 78 revision 1
77 79 =======
78 80 revision 2
79 81 >>>>>>> other
80 82 space
81 83 # hg stat
82 84 M f
83 85 ? f.orig
84 86
85 87 simplest hgrc using false for merge:
86 88
87 89 $ echo "false.whatever=" >> .hg/hgrc
88 90 $ domerge -r 2
89 91 [merge-tools]
90 92 false.whatever=
91 93 # hg update -C 1
92 94 # hg merge -r 2
93 95 merging f
94 96 merging f failed!
95 97 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
96 98 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
97 99 # cat f
98 100 revision 1
99 101 space
100 102 # hg stat
101 103 M f
102 104 ? f.orig
103 105
104 106 true with higher .priority gets precedence:
105 107
106 108 $ echo "true.priority=1" >> .hg/hgrc
107 109 $ domerge -r 2
108 110 [merge-tools]
109 111 false.whatever=
110 112 true.priority=1
111 113 # hg update -C 1
112 114 # hg merge -r 2
113 115 merging f
114 116 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
115 117 (branch merge, don't forget to commit)
116 118 # cat f
117 119 revision 1
118 120 space
119 121 # hg stat
120 122 M f
121 123
122 124 unless lowered on command line:
123 125
124 126 $ domerge -r 2 --config merge-tools.true.priority=-7
125 127 [merge-tools]
126 128 false.whatever=
127 129 true.priority=1
128 130 # hg update -C 1
129 131 # hg merge -r 2 --config merge-tools.true.priority=-7
130 132 merging f
131 133 merging f failed!
132 134 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
133 135 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
134 136 # cat f
135 137 revision 1
136 138 space
137 139 # hg stat
138 140 M f
139 141 ? f.orig
140 142
141 143 or false set higher on command line:
142 144
143 145 $ domerge -r 2 --config merge-tools.false.priority=117
144 146 [merge-tools]
145 147 false.whatever=
146 148 true.priority=1
147 149 # hg update -C 1
148 150 # hg merge -r 2 --config merge-tools.false.priority=117
149 151 merging f
150 152 merging f failed!
151 153 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
152 154 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
153 155 # cat f
154 156 revision 1
155 157 space
156 158 # hg stat
157 159 M f
158 160 ? f.orig
159 161
160 162 or true.executable not found in PATH:
161 163
162 164 $ domerge -r 2 --config merge-tools.true.executable=nonexistingmergetool
163 165 [merge-tools]
164 166 false.whatever=
165 167 true.priority=1
166 168 # hg update -C 1
167 169 # hg merge -r 2 --config merge-tools.true.executable=nonexistingmergetool
168 170 merging f
169 171 merging f failed!
170 172 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
171 173 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
172 174 # cat f
173 175 revision 1
174 176 space
175 177 # hg stat
176 178 M f
177 179 ? f.orig
178 180
179 181 or true.executable with bogus path:
180 182
181 183 $ domerge -r 2 --config merge-tools.true.executable=/nonexisting/mergetool
182 184 [merge-tools]
183 185 false.whatever=
184 186 true.priority=1
185 187 # hg update -C 1
186 188 # hg merge -r 2 --config merge-tools.true.executable=/nonexisting/mergetool
187 189 merging f
188 190 merging f failed!
189 191 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
190 192 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
191 193 # cat f
192 194 revision 1
193 195 space
194 196 # hg stat
195 197 M f
196 198 ? f.orig
197 199
198 200 but true.executable set to cat found in PATH works:
199 201
200 202 $ echo "true.executable=cat" >> .hg/hgrc
201 203 $ domerge -r 2
202 204 [merge-tools]
203 205 false.whatever=
204 206 true.priority=1
205 207 true.executable=cat
206 208 # hg update -C 1
207 209 # hg merge -r 2
208 210 merging f
209 211 revision 1
210 212 space
211 213 revision 0
212 214 space
213 215 revision 2
214 216 space
215 217 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
216 218 (branch merge, don't forget to commit)
217 219 # cat f
218 220 revision 1
219 221 space
220 222 # hg stat
221 223 M f
222 224
223 225 and true.executable set to cat with path works:
224 226
225 227 $ domerge -r 2 --config merge-tools.true.executable=cat
226 228 [merge-tools]
227 229 false.whatever=
228 230 true.priority=1
229 231 true.executable=cat
230 232 # hg update -C 1
231 233 # hg merge -r 2 --config merge-tools.true.executable=cat
232 234 merging f
233 235 revision 1
234 236 space
235 237 revision 0
236 238 space
237 239 revision 2
238 240 space
239 241 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
240 242 (branch merge, don't forget to commit)
241 243 # cat f
242 244 revision 1
243 245 space
244 246 # hg stat
245 247 M f
246 248
247 249 environment variables in true.executable are handled:
248 250
249 251 $ cat > $HGTMP/merge.sh <<EOF
250 252 > #!/bin/sh
251 253 > echo 'custom merge tool'
252 254 > EOF
253 255 $ chmod +x $HGTMP/merge.sh
254 256 $ domerge -r 2 --config merge-tools.true.executable='$HGTMP/merge.sh'
255 257 [merge-tools]
256 258 false.whatever=
257 259 true.priority=1
258 260 true.executable=cat
259 261 # hg update -C 1
260 262 # hg merge -r 2 --config merge-tools.true.executable=$HGTMP/merge.sh
261 263 merging f
262 264 custom merge tool
263 265 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
264 266 (branch merge, don't forget to commit)
265 267 # cat f
266 268 revision 1
267 269 space
268 270 # hg stat
269 271 M f
270 272
271 273 Tool selection and merge-patterns
272 274
273 275 merge-patterns specifies new tool false:
274 276
275 277 $ domerge -r 2 --config merge-patterns.f=false
276 278 [merge-tools]
277 279 false.whatever=
278 280 true.priority=1
279 281 true.executable=cat
280 282 # hg update -C 1
281 283 # hg merge -r 2 --config merge-patterns.f=false
282 284 merging f
283 285 merging f failed!
284 286 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
285 287 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
286 288 # cat f
287 289 revision 1
288 290 space
289 291 # hg stat
290 292 M f
291 293 ? f.orig
292 294
293 295 merge-patterns specifies executable not found in PATH and gets warning:
294 296
295 297 $ domerge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistingmergetool
296 298 [merge-tools]
297 299 false.whatever=
298 300 true.priority=1
299 301 true.executable=cat
300 302 # hg update -C 1
301 303 # hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistingmergetool
302 304 couldn't find merge tool true specified for f
303 305 merging f
304 306 merging f failed!
305 307 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
306 308 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
307 309 # cat f
308 310 revision 1
309 311 space
310 312 # hg stat
311 313 M f
312 314 ? f.orig
313 315
314 316 merge-patterns specifies executable with bogus path and gets warning:
315 317
316 318 $ domerge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexisting/mergetool
317 319 [merge-tools]
318 320 false.whatever=
319 321 true.priority=1
320 322 true.executable=cat
321 323 # hg update -C 1
322 324 # hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexisting/mergetool
323 325 couldn't find merge tool true specified for f
324 326 merging f
325 327 merging f failed!
326 328 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
327 329 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
328 330 # cat f
329 331 revision 1
330 332 space
331 333 # hg stat
332 334 M f
333 335 ? f.orig
334 336
335 337 ui.merge overrules priority
336 338
337 339 ui.merge specifies false:
338 340
339 341 $ domerge -r 2 --config ui.merge=false
340 342 [merge-tools]
341 343 false.whatever=
342 344 true.priority=1
343 345 true.executable=cat
344 346 # hg update -C 1
345 347 # hg merge -r 2 --config ui.merge=false
346 348 merging f
347 349 merging f failed!
348 350 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
349 351 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
350 352 # cat f
351 353 revision 1
352 354 space
353 355 # hg stat
354 356 M f
355 357 ? f.orig
356 358
357 359 ui.merge specifies internal:fail:
358 360
359 361 $ domerge -r 2 --config ui.merge=internal:fail
360 362 [merge-tools]
361 363 false.whatever=
362 364 true.priority=1
363 365 true.executable=cat
364 366 # hg update -C 1
365 367 # hg merge -r 2 --config ui.merge=internal:fail
366 368 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
367 369 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
368 370 # cat f
369 371 revision 1
370 372 space
371 373 # hg stat
372 374 M f
373 375
374 376 ui.merge specifies internal:local:
375 377
376 378 $ domerge -r 2 --config ui.merge=internal:local
377 379 [merge-tools]
378 380 false.whatever=
379 381 true.priority=1
380 382 true.executable=cat
381 383 # hg update -C 1
382 384 # hg merge -r 2 --config ui.merge=internal:local
383 385 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
384 386 (branch merge, don't forget to commit)
385 387 # cat f
386 388 revision 1
387 389 space
388 390 # hg stat
389 391 M f
390 392
391 393 ui.merge specifies internal:other:
392 394
393 395 $ domerge -r 2 --config ui.merge=internal:other
394 396 [merge-tools]
395 397 false.whatever=
396 398 true.priority=1
397 399 true.executable=cat
398 400 # hg update -C 1
399 401 # hg merge -r 2 --config ui.merge=internal:other
400 402 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
401 403 (branch merge, don't forget to commit)
402 404 # cat f
403 405 revision 2
404 406 space
405 407 # hg stat
406 408 M f
407 409
408 410 ui.merge specifies internal:prompt:
409 411
410 412 $ domerge -r 2 --config ui.merge=internal:prompt
411 413 [merge-tools]
412 414 false.whatever=
413 415 true.priority=1
414 416 true.executable=cat
415 417 # hg update -C 1
416 418 # hg merge -r 2 --config ui.merge=internal:prompt
417 419 no tool found to merge f
418 420 keep (l)ocal or take (o)ther? l
419 421 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
420 422 (branch merge, don't forget to commit)
421 423 # cat f
422 424 revision 1
423 425 space
424 426 # hg stat
425 427 M f
426 428
427 429 ui.merge specifies internal:dump:
428 430
429 431 $ domerge -r 2 --config ui.merge=internal:dump
430 432 [merge-tools]
431 433 false.whatever=
432 434 true.priority=1
433 435 true.executable=cat
434 436 # hg update -C 1
435 437 # hg merge -r 2 --config ui.merge=internal:dump
436 438 merging f
437 439 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
438 440 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
439 441 # cat f
440 442 revision 1
441 443 space
442 444 # hg stat
443 445 M f
444 446 ? f.base
445 447 ? f.local
446 448 ? f.orig
447 449 ? f.other
448 450
449 451 f.base:
450 452
451 453 $ cat f.base
452 454 revision 0
453 455 space
454 456
455 457 f.local:
456 458
457 459 $ cat f.local
458 460 revision 1
459 461 space
460 462
461 463 f.other:
462 464
463 465 $ cat f.other
464 466 revision 2
465 467 space
466 468 $ rm f.base f.local f.other
467 469
468 470 ui.merge specifies internal:other but is overruled by pattern for false:
469 471
470 472 $ domerge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
471 473 [merge-tools]
472 474 false.whatever=
473 475 true.priority=1
474 476 true.executable=cat
475 477 # hg update -C 1
476 478 # hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
477 479 merging f
478 480 merging f failed!
479 481 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
480 482 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
481 483 # cat f
482 484 revision 1
483 485 space
484 486 # hg stat
485 487 M f
486 488 ? f.orig
487 489
488 490 Premerge
489 491
490 492 ui.merge specifies internal:other but is overruled by --tool=false
491 493
492 494 $ domerge -r 2 --config ui.merge=internal:other --tool=false
493 495 [merge-tools]
494 496 false.whatever=
495 497 true.priority=1
496 498 true.executable=cat
497 499 # hg update -C 1
498 500 # hg merge -r 2 --config ui.merge=internal:other --tool=false
499 501 merging f
500 502 merging f failed!
501 503 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
502 504 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
503 505 # cat f
504 506 revision 1
505 507 space
506 508 # hg stat
507 509 M f
508 510 ? f.orig
509 511
510 512 HGMERGE specifies internal:other but is overruled by --tool=false
511 513
512 514 $ HGMERGE=internal:other ; export HGMERGE
513 515 $ domerge -r 2 --tool=false
514 516 [merge-tools]
515 517 false.whatever=
516 518 true.priority=1
517 519 true.executable=cat
518 520 # hg update -C 1
519 521 # hg merge -r 2 --tool=false
520 522 merging f
521 523 merging f failed!
522 524 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
523 525 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
524 526 # cat f
525 527 revision 1
526 528 space
527 529 # hg stat
528 530 M f
529 531 ? f.orig
530 532
531 533 $ unset HGMERGE # make sure HGMERGE doesn't interfere with remaining tests
532 534
533 535 Default is silent simplemerge:
534 536
535 537 $ domerge -r 3
536 538 [merge-tools]
537 539 false.whatever=
538 540 true.priority=1
539 541 true.executable=cat
540 542 # hg update -C 1
541 543 # hg merge -r 3
542 544 merging f
543 545 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
544 546 (branch merge, don't forget to commit)
545 547 # cat f
546 548 revision 1
547 549 space
548 550 revision 3
549 551 # hg stat
550 552 M f
551 553
552 554 .premerge=True is same:
553 555
554 556 $ domerge -r 3 --config merge-tools.true.premerge=True
555 557 [merge-tools]
556 558 false.whatever=
557 559 true.priority=1
558 560 true.executable=cat
559 561 # hg update -C 1
560 562 # hg merge -r 3 --config merge-tools.true.premerge=True
561 563 merging f
562 564 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
563 565 (branch merge, don't forget to commit)
564 566 # cat f
565 567 revision 1
566 568 space
567 569 revision 3
568 570 # hg stat
569 571 M f
570 572
571 573 .premerge=False executes merge-tool:
572 574
573 575 $ domerge -r 3 --config merge-tools.true.premerge=False
574 576 [merge-tools]
575 577 false.whatever=
576 578 true.priority=1
577 579 true.executable=cat
578 580 # hg update -C 1
579 581 # hg merge -r 3 --config merge-tools.true.premerge=False
580 582 merging f
581 583 revision 1
582 584 space
583 585 revision 0
584 586 space
585 587 revision 0
586 588 space
587 589 revision 3
588 590 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
589 591 (branch merge, don't forget to commit)
590 592 # cat f
591 593 revision 1
592 594 space
593 595 # hg stat
594 596 M f
595 597
596 598 Tool execution
597 599
598 600 set tools.args explicit to include $base $local $other $output:
599 601
600 602 $ beforemerge
601 603 [merge-tools]
602 604 false.whatever=
603 605 true.priority=1
604 606 true.executable=cat
605 607 # hg update -C 1
606 608 $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \
607 609 > | sed 's,==> .* <==,==> ... <==,g'
608 610 merging f
609 611 ==> ... <==
610 612 revision 0
611 613 space
612 614
613 615 ==> ... <==
614 616 revision 1
615 617 space
616 618
617 619 ==> ... <==
618 620 revision 2
619 621 space
620 622
621 623 ==> ... <==
622 624 revision 1
623 625 space
624 626 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
625 627 (branch merge, don't forget to commit)
626 628 $ aftermerge
627 629 # cat f
628 630 revision 1
629 631 space
630 632 # hg stat
631 633 M f
632 634
633 635 Merge with "echo mergeresult > $local":
634 636
635 637 $ beforemerge
636 638 [merge-tools]
637 639 false.whatever=
638 640 true.priority=1
639 641 true.executable=cat
640 642 # hg update -C 1
641 643 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local'
642 644 merging f
643 645 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
644 646 (branch merge, don't forget to commit)
645 647 $ aftermerge
646 648 # cat f
647 649 mergeresult
648 650 # hg stat
649 651 M f
650 652
651 653 - and $local is the file f:
652 654
653 655 $ beforemerge
654 656 [merge-tools]
655 657 false.whatever=
656 658 true.priority=1
657 659 true.executable=cat
658 660 # hg update -C 1
659 661 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f'
660 662 merging f
661 663 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
662 664 (branch merge, don't forget to commit)
663 665 $ aftermerge
664 666 # cat f
665 667 mergeresult
666 668 # hg stat
667 669 M f
668 670
669 671 Merge with "echo mergeresult > $output" - the variable is a bit magic:
670 672
671 673 $ beforemerge
672 674 [merge-tools]
673 675 false.whatever=
674 676 true.priority=1
675 677 true.executable=cat
676 678 # hg update -C 1
677 679 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output'
678 680 merging f
679 681 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
680 682 (branch merge, don't forget to commit)
681 683 $ aftermerge
682 684 # cat f
683 685 mergeresult
684 686 # hg stat
685 687 M f
686 688
687 689 Merge using tool with a path that must be quoted:
688 690
689 691 $ beforemerge
690 692 [merge-tools]
691 693 false.whatever=
692 694 true.priority=1
693 695 true.executable=cat
694 696 # hg update -C 1
695 697 $ cat <<EOF > 'my merge tool'
696 698 > #!/bin/sh
697 699 > cat "\$1" "\$2" "\$3" > "\$4"
698 700 > EOF
699 701 $ chmod +x 'my merge tool'
700 702 $ hg merge -r 2 --config merge-tools.true.executable='./my merge tool' --config merge-tools.true.args='$base $local $other $output'
701 703 merging f
702 704 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
703 705 (branch merge, don't forget to commit)
704 706 $ rm -f 'my merge tool'
705 707 $ aftermerge
706 708 # cat f
707 709 revision 0
708 710 space
709 711 revision 1
710 712 space
711 713 revision 2
712 714 space
713 715 # hg stat
714 716 M f
715 717
716 718 Merge post-processing
717 719
718 720 cat is a bad merge-tool and doesn't change:
719 721
720 722 $ domerge -y -r 2 --config merge-tools.true.checkchanged=1
721 723 [merge-tools]
722 724 false.whatever=
723 725 true.priority=1
724 726 true.executable=cat
725 727 # hg update -C 1
726 728 # hg merge -y -r 2 --config merge-tools.true.checkchanged=1
727 729 merging f
728 730 revision 1
729 731 space
730 732 revision 0
731 733 space
732 734 revision 2
733 735 space
734 736 output file f appears unchanged
735 737 was merge successful (yn)? n
736 738 merging f failed!
737 739 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
738 740 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
739 741 # cat f
740 742 revision 1
741 743 space
742 744 # hg stat
743 745 M f
744 746 ? f.orig
@@ -1,235 +1,235 b''
1 1
2 2 $ catpatch() {
3 3 > cat $1 | sed -e "s/^\(# Parent \).*/\1/"
4 4 > }
5 5 $ echo "[extensions]" >> $HGRCPATH
6 6 $ echo "mq=" >> $HGRCPATH
7 7 $ runtest() {
8 8 > hg init mq
9 9 > cd mq
10 10 >
11 11 > echo a > a
12 12 > hg ci -Ama
13 13 >
14 14 > echo '% qnew should refuse bad patch names'
15 15 > hg qnew series
16 16 > hg qnew status
17 17 > hg qnew guards
18 18 > hg qnew .
19 19 > hg qnew ..
20 20 > hg qnew .hgignore
21 21 > hg qnew .mqfoo
22 22 > hg qnew 'foo#bar'
23 23 > hg qnew 'foo:bar'
24 24 >
25 25 > hg qinit -c
26 26 >
27 27 > echo '% qnew with name containing slash'
28 28 > hg qnew foo/
29 29 > hg qnew foo/bar.patch
30 30 > hg qnew foo
31 31 > hg qseries
32 32 > hg qpop
33 33 > hg qdelete foo/bar.patch
34 34 >
35 35 > echo '% qnew with uncommitted changes'
36 36 > echo a > somefile
37 37 > hg add somefile
38 38 > hg qnew uncommitted.patch
39 39 > hg st
40 40 > hg qseries
41 41 >
42 42 > echo '% qnew implies add'
43 43 > hg -R .hg/patches st
44 44 >
45 45 > echo '% qnew missing'
46 46 > hg qnew missing.patch missing
47 47 >
48 48 > echo '% qnew -m'
49 49 > hg qnew -m 'foo bar' mtest.patch
50 50 > catpatch .hg/patches/mtest.patch
51 51 >
52 52 > echo '% qnew twice'
53 53 > hg qnew first.patch
54 54 > hg qnew first.patch
55 55 >
56 56 > touch ../first.patch
57 57 > hg qimport ../first.patch
58 58 >
59 59 > echo '% qnew -f from a subdirectory'
60 60 > hg qpop -a
61 61 > mkdir d
62 62 > cd d
63 63 > echo b > b
64 64 > hg ci -Am t
65 65 > echo b >> b
66 66 > hg st
67 67 > hg qnew -g -f p
68 68 > catpatch ../.hg/patches/p
69 69 >
70 70 > echo '% qnew -u with no username configured'
71 71 > HGUSER= hg qnew -u blue red
72 72 > catpatch ../.hg/patches/red
73 73 >
74 74 > echo '% qnew -e -u with no username configured'
75 75 > HGUSER= hg qnew -e -u chartreuse fucsia
76 76 > catpatch ../.hg/patches/fucsia
77 77 >
78 78 > echo '% fail when trying to import a merge'
79 79 > hg init merge
80 80 > cd merge
81 81 > touch a
82 82 > hg ci -Am null
83 83 > echo a >> a
84 84 > hg ci -m a
85 85 > hg up -r 0
86 86 > echo b >> a
87 87 > hg ci -m b
88 88 > hg merge -f 1
89 89 > hg resolve --mark a
90 90 > hg qnew -f merge
91 91 >
92 92 > cd ../../..
93 93 > rm -r mq
94 94 > }
95 95
96 96 plain headers
97 97
98 98 $ echo "[mq]" >> $HGRCPATH
99 99 $ echo "plain=true" >> $HGRCPATH
100 100 $ mkdir sandbox
101 101 $ (cd sandbox ; runtest)
102 102 adding a
103 103 % qnew should refuse bad patch names
104 104 abort: "series" cannot be used as the name of a patch
105 105 abort: "status" cannot be used as the name of a patch
106 106 abort: "guards" cannot be used as the name of a patch
107 107 abort: "." cannot be used as the name of a patch
108 108 abort: ".." cannot be used as the name of a patch
109 109 abort: patch name cannot begin with ".hg"
110 110 abort: patch name cannot begin with ".mq"
111 111 abort: "#" cannot be used in the name of a patch
112 112 abort: ":" cannot be used in the name of a patch
113 113 % qnew with name containing slash
114 114 abort: path ends in directory separator: foo/
115 115 abort: "foo" already exists as a directory
116 116 foo/bar.patch
117 117 popping foo/bar.patch
118 118 patch queue now empty
119 119 % qnew with uncommitted changes
120 120 uncommitted.patch
121 121 % qnew implies add
122 122 A .hgignore
123 123 A series
124 124 A uncommitted.patch
125 125 % qnew missing
126 abort: missing: No such file or directory
126 abort: missing: * (glob)
127 127 % qnew -m
128 128 foo bar
129 129
130 130 % qnew twice
131 131 abort: patch "first.patch" already exists
132 132 abort: patch "first.patch" already exists
133 133 % qnew -f from a subdirectory
134 134 popping first.patch
135 135 popping mtest.patch
136 136 popping uncommitted.patch
137 137 patch queue now empty
138 138 adding d/b
139 139 M d/b
140 140 diff --git a/d/b b/d/b
141 141 --- a/d/b
142 142 +++ b/d/b
143 143 @@ -1,1 +1,2 @@
144 144 b
145 145 +b
146 146 % qnew -u with no username configured
147 147 From: blue
148 148
149 149 % qnew -e -u with no username configured
150 150 From: chartreuse
151 151
152 152 % fail when trying to import a merge
153 153 adding a
154 154 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 155 created new head
156 156 merging a
157 157 warning: conflicts during merge.
158 158 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
159 159 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
160 160 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
161 161 abort: cannot manage merge changesets
162 162 $ rm -r sandbox
163 163
164 164 hg headers
165 165
166 166 $ echo "plain=false" >> $HGRCPATH
167 167 $ mkdir sandbox
168 168 $ (cd sandbox ; runtest)
169 169 adding a
170 170 % qnew should refuse bad patch names
171 171 abort: "series" cannot be used as the name of a patch
172 172 abort: "status" cannot be used as the name of a patch
173 173 abort: "guards" cannot be used as the name of a patch
174 174 abort: "." cannot be used as the name of a patch
175 175 abort: ".." cannot be used as the name of a patch
176 176 abort: patch name cannot begin with ".hg"
177 177 abort: patch name cannot begin with ".mq"
178 178 abort: "#" cannot be used in the name of a patch
179 179 abort: ":" cannot be used in the name of a patch
180 180 % qnew with name containing slash
181 181 abort: path ends in directory separator: foo/
182 182 abort: "foo" already exists as a directory
183 183 foo/bar.patch
184 184 popping foo/bar.patch
185 185 patch queue now empty
186 186 % qnew with uncommitted changes
187 187 uncommitted.patch
188 188 % qnew implies add
189 189 A .hgignore
190 190 A series
191 191 A uncommitted.patch
192 192 % qnew missing
193 abort: missing: No such file or directory
193 abort: missing: * (glob)
194 194 % qnew -m
195 195 # HG changeset patch
196 196 # Parent
197 197 foo bar
198 198
199 199 % qnew twice
200 200 abort: patch "first.patch" already exists
201 201 abort: patch "first.patch" already exists
202 202 % qnew -f from a subdirectory
203 203 popping first.patch
204 204 popping mtest.patch
205 205 popping uncommitted.patch
206 206 patch queue now empty
207 207 adding d/b
208 208 M d/b
209 209 # HG changeset patch
210 210 # Parent
211 211 diff --git a/d/b b/d/b
212 212 --- a/d/b
213 213 +++ b/d/b
214 214 @@ -1,1 +1,2 @@
215 215 b
216 216 +b
217 217 % qnew -u with no username configured
218 218 # HG changeset patch
219 219 # Parent
220 220 # User blue
221 221 % qnew -e -u with no username configured
222 222 # HG changeset patch
223 223 # Parent
224 224 # User chartreuse
225 225 % fail when trying to import a merge
226 226 adding a
227 227 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
228 228 created new head
229 229 merging a
230 230 warning: conflicts during merge.
231 231 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
232 232 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
233 233 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
234 234 abort: cannot manage merge changesets
235 235 $ rm -r sandbox
@@ -1,2236 +1,2238 b''
1 $ "$TESTDIR/hghave" system-sh || exit 80
2
1 3 $ fixheaders()
2 4 > {
3 5 > sed -e 's/\(Message-Id:.*@\).*/\1/' \
4 6 > -e 's/\(In-Reply-To:.*@\).*/\1/' \
5 7 > -e 's/\(References:.*@\).*/\1/' \
6 8 > -e 's/\(User-Agent:.*\)\/.*/\1/' \
7 9 > -e 's/===.*/===/'
8 10 > }
9 11 $ echo "[extensions]" >> $HGRCPATH
10 12 $ echo "patchbomb=" >> $HGRCPATH
11 13
12 14 $ hg init t
13 15 $ cd t
14 16 $ echo a > a
15 17 $ hg commit -Ama -d '1 0'
16 18 adding a
17 19
18 20 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -r tip
19 21 This patch series consists of 1 patches.
20 22
21 23
22 24 Displaying [PATCH] a ...
23 25 Content-Type: text/plain; charset="us-ascii"
24 26 MIME-Version: 1.0
25 27 Content-Transfer-Encoding: 7bit
26 28 Subject: [PATCH] a
27 29 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
28 30 Message-Id: <8580ff50825a50c8f716.60@* (glob)
29 31 User-Agent: Mercurial-patchbomb/* (glob)
30 32 Date: Thu, 01 Jan 1970 00:01:00 +0000
31 33 From: quux
32 34 To: foo
33 35 Cc: bar
34 36
35 37 # HG changeset patch
36 38 # User test
37 39 # Date 1 0
38 40 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
39 41 # Parent 0000000000000000000000000000000000000000
40 42 a
41 43
42 44 diff -r 000000000000 -r 8580ff50825a a
43 45 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
44 46 +++ b/a Thu Jan 01 00:00:01 1970 +0000
45 47 @@ -0,0 +1,1 @@
46 48 +a
47 49
48 50
49 51 $ hg --config ui.interactive=1 email --confirm -n -f quux -t foo -c bar -r tip<<EOF
50 52 > n
51 53 > EOF
52 54 This patch series consists of 1 patches.
53 55
54 56
55 57 Final summary:
56 58
57 59 From: quux
58 60 To: foo
59 61 Cc: bar
60 62 Subject: [PATCH] a
61 63 a | 1 +
62 64 1 files changed, 1 insertions(+), 0 deletions(-)
63 65
64 66 are you sure you want to send (yn)? abort: patchbomb canceled
65 67 [255]
66 68
67 69 $ echo b > b
68 70 $ hg commit -Amb -d '2 0'
69 71 adding b
70 72
71 73 $ hg email --date '1970-1-1 0:2' -n -f quux -t foo -c bar -s test -r 0:tip
72 74 This patch series consists of 2 patches.
73 75
74 76
75 77 Write the introductory message for the patch series.
76 78
77 79
78 80 Displaying [PATCH 0 of 2] test ...
79 81 Content-Type: text/plain; charset="us-ascii"
80 82 MIME-Version: 1.0
81 83 Content-Transfer-Encoding: 7bit
82 84 Subject: [PATCH 0 of 2] test
83 85 Message-Id: <patchbomb\.120@[^>]*> (re)
84 86 User-Agent: Mercurial-patchbomb/* (glob)
85 87 Date: Thu, 01 Jan 1970 00:02:00 +0000
86 88 From: quux
87 89 To: foo
88 90 Cc: bar
89 91
90 92
91 93 Displaying [PATCH 1 of 2] a ...
92 94 Content-Type: text/plain; charset="us-ascii"
93 95 MIME-Version: 1.0
94 96 Content-Transfer-Encoding: 7bit
95 97 Subject: [PATCH 1 of 2] a
96 98 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
97 99 Message-Id: <8580ff50825a50c8f716\.121@[^>]*> (re)
98 100 In-Reply-To: <patchbomb\.120@[^>]*> (re)
99 101 References: <patchbomb\.120@[^>]*> (re)
100 102 User-Agent: Mercurial-patchbomb/* (glob)
101 103 Date: Thu, 01 Jan 1970 00:02:01 +0000
102 104 From: quux
103 105 To: foo
104 106 Cc: bar
105 107
106 108 # HG changeset patch
107 109 # User test
108 110 # Date 1 0
109 111 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
110 112 # Parent 0000000000000000000000000000000000000000
111 113 a
112 114
113 115 diff -r 000000000000 -r 8580ff50825a a
114 116 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
115 117 +++ b/a Thu Jan 01 00:00:01 1970 +0000
116 118 @@ -0,0 +1,1 @@
117 119 +a
118 120
119 121 Displaying [PATCH 2 of 2] b ...
120 122 Content-Type: text/plain; charset="us-ascii"
121 123 MIME-Version: 1.0
122 124 Content-Transfer-Encoding: 7bit
123 125 Subject: [PATCH 2 of 2] b
124 126 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
125 127 Message-Id: <97d72e5f12c7e84f8506\.122@[^>]*> (re)
126 128 In-Reply-To: <patchbomb\.120@[^>]*> (re)
127 129 References: <patchbomb\.120@[^>]*> (re)
128 130 User-Agent: Mercurial-patchbomb/* (glob)
129 131 Date: Thu, 01 Jan 1970 00:02:02 +0000
130 132 From: quux
131 133 To: foo
132 134 Cc: bar
133 135
134 136 # HG changeset patch
135 137 # User test
136 138 # Date 2 0
137 139 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
138 140 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
139 141 b
140 142
141 143 diff -r 8580ff50825a -r 97d72e5f12c7 b
142 144 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
143 145 +++ b/b Thu Jan 01 00:00:02 1970 +0000
144 146 @@ -0,0 +1,1 @@
145 147 +b
146 148
147 149
148 150 .hg/last-email.txt
149 151
150 152 $ cat > editor << '__EOF__'
151 153 > #!/bin/sh
152 154 > echo "a precious introductory message" > "$1"
153 155 > __EOF__
154 156 $ chmod +x editor
155 157 $ HGEDITOR="'`pwd`'"/editor hg email -n -t foo -s test -r 0:tip > /dev/null
156 158 $ cat .hg/last-email.txt
157 159 a precious introductory message
158 160
159 161 $ hg email -m test.mbox -f quux -t foo -c bar -s test 0:tip \
160 162 > --config extensions.progress= --config progress.assume-tty=1 \
161 163 > --config progress.delay=0 --config progress.refresh=0 \
162 164 > --config progress.width=60 2>&1 | \
163 165 > python $TESTDIR/filtercr.py
164 166 This patch series consists of 2 patches.
165 167
166 168
167 169 Write the introductory message for the patch series.
168 170
169 171
170 172 writing [ ] 0/3
171 173 writing [ ] 0/3
172 174
173 175
174 176 writing [==============> ] 1/3
175 177 writing [==============> ] 1/3
176 178
177 179
178 180 writing [=============================> ] 2/3
179 181 writing [=============================> ] 2/3
180 182 \r (esc)
181 183 Writing [PATCH 0 of 2] test ...
182 184 Writing [PATCH 1 of 2] a ...
183 185 Writing [PATCH 2 of 2] b ...
184 186
185 187
186 188 $ cd ..
187 189
188 190 $ hg clone -q t t2
189 191 $ cd t2
190 192 $ echo c > c
191 193 $ hg commit -Amc -d '3 0'
192 194 adding c
193 195
194 196 $ cat > description <<EOF
195 197 > a multiline
196 198 >
197 199 > description
198 200 > EOF
199 201
200 202
201 203 test bundle and description:
202 204 $ hg email --date '1970-1-1 0:3' -n -f quux -t foo \
203 205 > -c bar -s test -r tip -b --desc description | fixheaders
204 206 searching for changes
205 207 1 changesets found
206 208
207 209 Displaying test ...
208 210 Content-Type: multipart/mixed; boundary="===
209 211 MIME-Version: 1.0
210 212 Subject: test
211 213 Message-Id: <patchbomb.180@
212 214 User-Agent: Mercurial-patchbomb
213 215 Date: Thu, 01 Jan 1970 00:03:00 +0000
214 216 From: quux
215 217 To: foo
216 218 Cc: bar
217 219
218 220 --===
219 221 Content-Type: text/plain; charset="us-ascii"
220 222 MIME-Version: 1.0
221 223 Content-Transfer-Encoding: 7bit
222 224
223 225 a multiline
224 226
225 227 description
226 228
227 229 --===
228 230 Content-Type: application/x-mercurial-bundle
229 231 MIME-Version: 1.0
230 232 Content-Disposition: attachment; filename="bundle.hg"
231 233 Content-Transfer-Encoding: base64
232 234
233 235 SEcxMEJaaDkxQVkmU1nvR7I3AAAN////lFYQWj1/4HwRkdC/AywIAk0E4pfoSIIIgQCgGEQOcLAA
234 236 2tA1VPyp4mkeoG0EaaPU0GTT1GjRiNPIg9CZGBqZ6UbU9J+KFU09DNUaGgAAAAAANAGgAAAAA1U8
235 237 oGgAADQGgAANNANAAAAAAZipFLz3XoakCEQB3PVPyHJVi1iYkAAKQAZQGpQGZESInRnCFMqLDla2
236 238 Bx3qfRQeA2N4lnzKkAmP8kR2asievLLXXebVU8Vg4iEBqcJNJAxIapSU6SM4888ZAciRG6MYAIEE
237 239 SlIBpFisgGkyRjX//TMtfcUAEsGu56+YnE1OlTZmzKm8BSu2rvo4rHAYYaadIFFuTy0LYgIkgLVD
238 240 sgVa2F19D1tx9+hgbAygLgQwaIqcDdgA4BjQgIiz/AEP72++llgDKhKducqodGE4B0ETqF3JFOFC
239 241 Q70eyNw=
240 242 --===
241 243
242 244 utf-8 patch:
243 245 $ python -c 'fp = open("utf", "wb"); fp.write("h\xC3\xB6mma!\n"); fp.close();'
244 246 $ hg commit -A -d '4 0' -m 'charset=utf-8; content-transfer-encoding: base64'
245 247 adding description
246 248 adding utf
247 249
248 250 no mime encoding for email --test:
249 251 $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n | fixheaders > mailtest
250 252
251 253 md5sum of 8-bit output:
252 254 $ $TESTDIR/md5sum.py mailtest
253 255 e726c29b3008e77994c7572563e57c34 mailtest
254 256
255 257 $ rm mailtest
256 258
257 259 mime encoded mbox (base64):
258 260 $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -m mbox
259 261 This patch series consists of 1 patches.
260 262
261 263
262 264 Writing [PATCH] charset=utf-8; content-transfer-encoding: base64 ...
263 265
264 266 $ cat mbox
265 267 From quux Thu Jan 01 00:04:01 1970
266 268 Content-Type: text/plain; charset="utf-8"
267 269 MIME-Version: 1.0
268 270 Content-Transfer-Encoding: base64
269 271 Subject: [PATCH] charset=utf-8; content-transfer-encoding: base64
270 272 X-Mercurial-Node: c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
271 273 Message-Id: <c3c9e37db9f4fe4882cd.240@* (glob)
272 274 User-Agent: Mercurial-patchbomb/* (glob)
273 275 Date: Thu, 01 Jan 1970 00:04:00 +0000
274 276 From: quux
275 277 To: foo
276 278 Cc: bar
277 279
278 280 IyBIRyBjaGFuZ2VzZXQgcGF0Y2gKIyBVc2VyIHRlc3QKIyBEYXRlIDQgMAojIE5vZGUgSUQgYzNj
279 281 OWUzN2RiOWY0ZmU0ODgyY2RhMzliYWY0MmZlZDZiYWQ4YjE1YQojIFBhcmVudCAgZmYyYzlmYTIw
280 282 MThiMTVmYTc0YjMzMzYzYmRhOTUyNzMyM2UyYTk5ZgpjaGFyc2V0PXV0Zi04OyBjb250ZW50LXRy
281 283 YW5zZmVyLWVuY29kaW5nOiBiYXNlNjQKCmRpZmYgLXIgZmYyYzlmYTIwMThiIC1yIGMzYzllMzdk
282 284 YjlmNCBkZXNjcmlwdGlvbgotLS0gL2Rldi9udWxsCVRodSBKYW4gMDEgMDA6MDA6MDAgMTk3MCAr
283 285 MDAwMAorKysgYi9kZXNjcmlwdGlvbglUaHUgSmFuIDAxIDAwOjAwOjA0IDE5NzAgKzAwMDAKQEAg
284 286 LTAsMCArMSwzIEBACithIG11bHRpbGluZQorCitkZXNjcmlwdGlvbgpkaWZmIC1yIGZmMmM5ZmEy
285 287 MDE4YiAtciBjM2M5ZTM3ZGI5ZjQgdXRmCi0tLSAvZGV2L251bGwJVGh1IEphbiAwMSAwMDowMDow
286 288 MCAxOTcwICswMDAwCisrKyBiL3V0ZglUaHUgSmFuIDAxIDAwOjAwOjA0IDE5NzAgKzAwMDAKQEAg
287 289 LTAsMCArMSwxIEBACitow7ZtbWEhCg==
288 290
289 291
290 292 $ rm mbox
291 293
292 294 mime encoded mbox (quoted-printable):
293 295 $ python -c 'fp = open("qp", "wb"); fp.write("%s\nfoo\n\nbar\n" % ("x" * 1024)); fp.close();'
294 296 $ hg commit -A -d '4 0' -m 'charset=utf-8; content-transfer-encoding: quoted-printable'
295 297 adding qp
296 298
297 299 no mime encoding for email --test:
298 300 $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n | \
299 301 > fixheaders > mailtest
300 302 md5sum of qp output:
301 303 $ $TESTDIR/md5sum.py mailtest
302 304 0402c7d033e04044e423bb04816f9dae mailtest
303 305 $ rm mailtest
304 306
305 307 mime encoded mbox (quoted-printable):
306 308 $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -m mbox
307 309 This patch series consists of 1 patches.
308 310
309 311
310 312 Writing [PATCH] charset=utf-8; content-transfer-encoding: quoted-printable ...
311 313 $ cat mbox | fixheaders
312 314 From quux Thu Jan 01 00:04:01 1970
313 315 Content-Type: text/plain; charset="us-ascii"
314 316 MIME-Version: 1.0
315 317 Content-Transfer-Encoding: quoted-printable
316 318 Subject: [PATCH] charset=utf-8; content-transfer-encoding: quoted-printable
317 319 X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
318 320 Message-Id: <c655633f8c87700bb38c.240@
319 321 User-Agent: Mercurial-patchbomb
320 322 Date: Thu, 01 Jan 1970 00:04:00 +0000
321 323 From: quux
322 324 To: foo
323 325 Cc: bar
324 326
325 327 # HG changeset patch
326 328 # User test
327 329 # Date 4 0
328 330 # Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
329 331 # Parent c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
330 332 charset=3Dutf-8; content-transfer-encoding: quoted-printable
331 333
332 334 diff -r c3c9e37db9f4 -r c655633f8c87 qp
333 335 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
334 336 +++ b/qp Thu Jan 01 00:00:04 1970 +0000
335 337 @@ -0,0 +1,4 @@
336 338 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
337 339 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
338 340 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
339 341 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
340 342 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
341 343 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
342 344 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
343 345 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
344 346 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
345 347 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
346 348 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
347 349 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
348 350 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
349 351 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
350 352 +foo
351 353 +
352 354 +bar
353 355
354 356
355 357
356 358 $ rm mbox
357 359
358 360 iso-8859-1 patch:
359 361 $ python -c 'fp = open("isolatin", "wb"); fp.write("h\xF6mma!\n"); fp.close();'
360 362 $ hg commit -A -d '5 0' -m 'charset=us-ascii; content-transfer-encoding: 8bit'
361 363 adding isolatin
362 364
363 365 fake ascii mbox:
364 366 $ hg email --date '1970-1-1 0:5' -f quux -t foo -c bar -r tip -m mbox
365 367 This patch series consists of 1 patches.
366 368
367 369
368 370 Writing [PATCH] charset=us-ascii; content-transfer-encoding: 8bit ...
369 371 $ fixheaders < mbox > mboxfix
370 372
371 373 md5sum of 8-bit output:
372 374 $ $TESTDIR/md5sum.py mboxfix
373 375 9ea043d8fc43a71045114508baed144b mboxfix
374 376
375 377 test diffstat for single patch:
376 378 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y -r 2 | \
377 379 > fixheaders
378 380 This patch series consists of 1 patches.
379 381
380 382
381 383 Final summary:
382 384
383 385 From: quux
384 386 To: foo
385 387 Cc: bar
386 388 Subject: [PATCH] test
387 389 c | 1 +
388 390 1 files changed, 1 insertions(+), 0 deletions(-)
389 391
390 392 are you sure you want to send (yn)? y
391 393
392 394 Displaying [PATCH] test ...
393 395 Content-Type: text/plain; charset="us-ascii"
394 396 MIME-Version: 1.0
395 397 Content-Transfer-Encoding: 7bit
396 398 Subject: [PATCH] test
397 399 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
398 400 Message-Id: <ff2c9fa2018b15fa74b3.60@
399 401 User-Agent: Mercurial-patchbomb
400 402 Date: Thu, 01 Jan 1970 00:01:00 +0000
401 403 From: quux
402 404 To: foo
403 405 Cc: bar
404 406
405 407 c | 1 +
406 408 1 files changed, 1 insertions(+), 0 deletions(-)
407 409
408 410
409 411 # HG changeset patch
410 412 # User test
411 413 # Date 3 0
412 414 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
413 415 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
414 416 c
415 417
416 418 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
417 419 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
418 420 +++ b/c Thu Jan 01 00:00:03 1970 +0000
419 421 @@ -0,0 +1,1 @@
420 422 +c
421 423
422 424
423 425 test diffstat for multiple patches:
424 426 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y \
425 427 > -r 0:1 | fixheaders
426 428 This patch series consists of 2 patches.
427 429
428 430
429 431 Write the introductory message for the patch series.
430 432
431 433
432 434 Final summary:
433 435
434 436 From: quux
435 437 To: foo
436 438 Cc: bar
437 439 Subject: [PATCH 0 of 2] test
438 440 a | 1 +
439 441 b | 1 +
440 442 2 files changed, 2 insertions(+), 0 deletions(-)
441 443 Subject: [PATCH 1 of 2] a
442 444 a | 1 +
443 445 1 files changed, 1 insertions(+), 0 deletions(-)
444 446 Subject: [PATCH 2 of 2] b
445 447 b | 1 +
446 448 1 files changed, 1 insertions(+), 0 deletions(-)
447 449
448 450 are you sure you want to send (yn)? y
449 451
450 452 Displaying [PATCH 0 of 2] test ...
451 453 Content-Type: text/plain; charset="us-ascii"
452 454 MIME-Version: 1.0
453 455 Content-Transfer-Encoding: 7bit
454 456 Subject: [PATCH 0 of 2] test
455 457 Message-Id: <patchbomb.60@
456 458 User-Agent: Mercurial-patchbomb
457 459 Date: Thu, 01 Jan 1970 00:01:00 +0000
458 460 From: quux
459 461 To: foo
460 462 Cc: bar
461 463
462 464
463 465 a | 1 +
464 466 b | 1 +
465 467 2 files changed, 2 insertions(+), 0 deletions(-)
466 468
467 469 Displaying [PATCH 1 of 2] a ...
468 470 Content-Type: text/plain; charset="us-ascii"
469 471 MIME-Version: 1.0
470 472 Content-Transfer-Encoding: 7bit
471 473 Subject: [PATCH 1 of 2] a
472 474 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
473 475 Message-Id: <8580ff50825a50c8f716.61@
474 476 In-Reply-To: <patchbomb.60@
475 477 References: <patchbomb.60@
476 478 User-Agent: Mercurial-patchbomb
477 479 Date: Thu, 01 Jan 1970 00:01:01 +0000
478 480 From: quux
479 481 To: foo
480 482 Cc: bar
481 483
482 484 a | 1 +
483 485 1 files changed, 1 insertions(+), 0 deletions(-)
484 486
485 487
486 488 # HG changeset patch
487 489 # User test
488 490 # Date 1 0
489 491 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
490 492 # Parent 0000000000000000000000000000000000000000
491 493 a
492 494
493 495 diff -r 000000000000 -r 8580ff50825a a
494 496 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
495 497 +++ b/a Thu Jan 01 00:00:01 1970 +0000
496 498 @@ -0,0 +1,1 @@
497 499 +a
498 500
499 501 Displaying [PATCH 2 of 2] b ...
500 502 Content-Type: text/plain; charset="us-ascii"
501 503 MIME-Version: 1.0
502 504 Content-Transfer-Encoding: 7bit
503 505 Subject: [PATCH 2 of 2] b
504 506 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
505 507 Message-Id: <97d72e5f12c7e84f8506.62@
506 508 In-Reply-To: <patchbomb.60@
507 509 References: <patchbomb.60@
508 510 User-Agent: Mercurial-patchbomb
509 511 Date: Thu, 01 Jan 1970 00:01:02 +0000
510 512 From: quux
511 513 To: foo
512 514 Cc: bar
513 515
514 516 b | 1 +
515 517 1 files changed, 1 insertions(+), 0 deletions(-)
516 518
517 519
518 520 # HG changeset patch
519 521 # User test
520 522 # Date 2 0
521 523 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
522 524 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
523 525 b
524 526
525 527 diff -r 8580ff50825a -r 97d72e5f12c7 b
526 528 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
527 529 +++ b/b Thu Jan 01 00:00:02 1970 +0000
528 530 @@ -0,0 +1,1 @@
529 531 +b
530 532
531 533
532 534 test inline for single patch:
533 535 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2 | \
534 536 > fixheaders
535 537 This patch series consists of 1 patches.
536 538
537 539
538 540 Displaying [PATCH] test ...
539 541 Content-Type: multipart/mixed; boundary="===
540 542 MIME-Version: 1.0
541 543 Subject: [PATCH] test
542 544 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
543 545 Message-Id: <ff2c9fa2018b15fa74b3.60@
544 546 User-Agent: Mercurial-patchbomb
545 547 Date: Thu, 01 Jan 1970 00:01:00 +0000
546 548 From: quux
547 549 To: foo
548 550 Cc: bar
549 551
550 552 --===
551 553 Content-Type: text/x-patch; charset="us-ascii"
552 554 MIME-Version: 1.0
553 555 Content-Transfer-Encoding: 7bit
554 556 Content-Disposition: inline; filename=t2.patch
555 557
556 558 # HG changeset patch
557 559 # User test
558 560 # Date 3 0
559 561 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
560 562 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
561 563 c
562 564
563 565 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
564 566 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
565 567 +++ b/c Thu Jan 01 00:00:03 1970 +0000
566 568 @@ -0,0 +1,1 @@
567 569 +c
568 570
569 571 --===
570 572
571 573
572 574 test inline for single patch (quoted-printable):
573 575 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 4 | \
574 576 > fixheaders
575 577 This patch series consists of 1 patches.
576 578
577 579
578 580 Displaying [PATCH] test ...
579 581 Content-Type: multipart/mixed; boundary="===
580 582 MIME-Version: 1.0
581 583 Subject: [PATCH] test
582 584 X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
583 585 Message-Id: <c655633f8c87700bb38c.60@
584 586 User-Agent: Mercurial-patchbomb
585 587 Date: Thu, 01 Jan 1970 00:01:00 +0000
586 588 From: quux
587 589 To: foo
588 590 Cc: bar
589 591
590 592 --===
591 593 Content-Type: text/x-patch; charset="us-ascii"
592 594 MIME-Version: 1.0
593 595 Content-Transfer-Encoding: quoted-printable
594 596 Content-Disposition: inline; filename=t2.patch
595 597
596 598 # HG changeset patch
597 599 # User test
598 600 # Date 4 0
599 601 # Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
600 602 # Parent c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
601 603 charset=3Dutf-8; content-transfer-encoding: quoted-printable
602 604
603 605 diff -r c3c9e37db9f4 -r c655633f8c87 qp
604 606 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
605 607 +++ b/qp Thu Jan 01 00:00:04 1970 +0000
606 608 @@ -0,0 +1,4 @@
607 609 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
608 610 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
609 611 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
610 612 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
611 613 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
612 614 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
613 615 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
614 616 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
615 617 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
616 618 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
617 619 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
618 620 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
619 621 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
620 622 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
621 623 +foo
622 624 +
623 625 +bar
624 626
625 627 --===
626 628
627 629 test inline for multiple patches:
628 630 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i \
629 631 > -r 0:1 -r 4 | fixheaders
630 632 This patch series consists of 3 patches.
631 633
632 634
633 635 Write the introductory message for the patch series.
634 636
635 637
636 638 Displaying [PATCH 0 of 3] test ...
637 639 Content-Type: text/plain; charset="us-ascii"
638 640 MIME-Version: 1.0
639 641 Content-Transfer-Encoding: 7bit
640 642 Subject: [PATCH 0 of 3] test
641 643 Message-Id: <patchbomb.60@
642 644 User-Agent: Mercurial-patchbomb
643 645 Date: Thu, 01 Jan 1970 00:01:00 +0000
644 646 From: quux
645 647 To: foo
646 648 Cc: bar
647 649
648 650
649 651 Displaying [PATCH 1 of 3] a ...
650 652 Content-Type: multipart/mixed; boundary="===
651 653 MIME-Version: 1.0
652 654 Subject: [PATCH 1 of 3] a
653 655 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
654 656 Message-Id: <8580ff50825a50c8f716.61@
655 657 In-Reply-To: <patchbomb.60@
656 658 References: <patchbomb.60@
657 659 User-Agent: Mercurial-patchbomb
658 660 Date: Thu, 01 Jan 1970 00:01:01 +0000
659 661 From: quux
660 662 To: foo
661 663 Cc: bar
662 664
663 665 --===
664 666 Content-Type: text/x-patch; charset="us-ascii"
665 667 MIME-Version: 1.0
666 668 Content-Transfer-Encoding: 7bit
667 669 Content-Disposition: inline; filename=t2-1.patch
668 670
669 671 # HG changeset patch
670 672 # User test
671 673 # Date 1 0
672 674 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
673 675 # Parent 0000000000000000000000000000000000000000
674 676 a
675 677
676 678 diff -r 000000000000 -r 8580ff50825a a
677 679 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
678 680 +++ b/a Thu Jan 01 00:00:01 1970 +0000
679 681 @@ -0,0 +1,1 @@
680 682 +a
681 683
682 684 --===
683 685 Displaying [PATCH 2 of 3] b ...
684 686 Content-Type: multipart/mixed; boundary="===
685 687 MIME-Version: 1.0
686 688 Subject: [PATCH 2 of 3] b
687 689 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
688 690 Message-Id: <97d72e5f12c7e84f8506.62@
689 691 In-Reply-To: <patchbomb.60@
690 692 References: <patchbomb.60@
691 693 User-Agent: Mercurial-patchbomb
692 694 Date: Thu, 01 Jan 1970 00:01:02 +0000
693 695 From: quux
694 696 To: foo
695 697 Cc: bar
696 698
697 699 --===
698 700 Content-Type: text/x-patch; charset="us-ascii"
699 701 MIME-Version: 1.0
700 702 Content-Transfer-Encoding: 7bit
701 703 Content-Disposition: inline; filename=t2-2.patch
702 704
703 705 # HG changeset patch
704 706 # User test
705 707 # Date 2 0
706 708 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
707 709 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
708 710 b
709 711
710 712 diff -r 8580ff50825a -r 97d72e5f12c7 b
711 713 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
712 714 +++ b/b Thu Jan 01 00:00:02 1970 +0000
713 715 @@ -0,0 +1,1 @@
714 716 +b
715 717
716 718 --===
717 719 Displaying [PATCH 3 of 3] charset=utf-8; content-transfer-encoding: quoted-printable ...
718 720 Content-Type: multipart/mixed; boundary="===
719 721 MIME-Version: 1.0
720 722 Subject: [PATCH 3 of 3] charset=utf-8;
721 723 content-transfer-encoding: quoted-printable
722 724 X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
723 725 Message-Id: <c655633f8c87700bb38c.63@
724 726 In-Reply-To: <patchbomb.60@
725 727 References: <patchbomb.60@
726 728 User-Agent: Mercurial-patchbomb
727 729 Date: Thu, 01 Jan 1970 00:01:03 +0000
728 730 From: quux
729 731 To: foo
730 732 Cc: bar
731 733
732 734 --===
733 735 Content-Type: text/x-patch; charset="us-ascii"
734 736 MIME-Version: 1.0
735 737 Content-Transfer-Encoding: quoted-printable
736 738 Content-Disposition: inline; filename=t2-3.patch
737 739
738 740 # HG changeset patch
739 741 # User test
740 742 # Date 4 0
741 743 # Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
742 744 # Parent c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
743 745 charset=3Dutf-8; content-transfer-encoding: quoted-printable
744 746
745 747 diff -r c3c9e37db9f4 -r c655633f8c87 qp
746 748 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
747 749 +++ b/qp Thu Jan 01 00:00:04 1970 +0000
748 750 @@ -0,0 +1,4 @@
749 751 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
750 752 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
751 753 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
752 754 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
753 755 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
754 756 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
755 757 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
756 758 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
757 759 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
758 760 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
759 761 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
760 762 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
761 763 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
762 764 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
763 765 +foo
764 766 +
765 767 +bar
766 768
767 769 --===
768 770
769 771 test attach for single patch:
770 772 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 2 | \
771 773 > fixheaders
772 774 This patch series consists of 1 patches.
773 775
774 776
775 777 Displaying [PATCH] test ...
776 778 Content-Type: multipart/mixed; boundary="===
777 779 MIME-Version: 1.0
778 780 Subject: [PATCH] test
779 781 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
780 782 Message-Id: <ff2c9fa2018b15fa74b3.60@
781 783 User-Agent: Mercurial-patchbomb
782 784 Date: Thu, 01 Jan 1970 00:01:00 +0000
783 785 From: quux
784 786 To: foo
785 787 Cc: bar
786 788
787 789 --===
788 790 Content-Type: text/plain; charset="us-ascii"
789 791 MIME-Version: 1.0
790 792 Content-Transfer-Encoding: 7bit
791 793
792 794 Patch subject is complete summary.
793 795
794 796
795 797
796 798 --===
797 799 Content-Type: text/x-patch; charset="us-ascii"
798 800 MIME-Version: 1.0
799 801 Content-Transfer-Encoding: 7bit
800 802 Content-Disposition: attachment; filename=t2.patch
801 803
802 804 # HG changeset patch
803 805 # User test
804 806 # Date 3 0
805 807 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
806 808 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
807 809 c
808 810
809 811 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
810 812 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
811 813 +++ b/c Thu Jan 01 00:00:03 1970 +0000
812 814 @@ -0,0 +1,1 @@
813 815 +c
814 816
815 817 --===
816 818
817 819 test attach for single patch (quoted-printable):
818 820 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 4 | \
819 821 > fixheaders
820 822 This patch series consists of 1 patches.
821 823
822 824
823 825 Displaying [PATCH] test ...
824 826 Content-Type: multipart/mixed; boundary="===
825 827 MIME-Version: 1.0
826 828 Subject: [PATCH] test
827 829 X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
828 830 Message-Id: <c655633f8c87700bb38c.60@
829 831 User-Agent: Mercurial-patchbomb
830 832 Date: Thu, 01 Jan 1970 00:01:00 +0000
831 833 From: quux
832 834 To: foo
833 835 Cc: bar
834 836
835 837 --===
836 838 Content-Type: text/plain; charset="us-ascii"
837 839 MIME-Version: 1.0
838 840 Content-Transfer-Encoding: 7bit
839 841
840 842 Patch subject is complete summary.
841 843
842 844
843 845
844 846 --===
845 847 Content-Type: text/x-patch; charset="us-ascii"
846 848 MIME-Version: 1.0
847 849 Content-Transfer-Encoding: quoted-printable
848 850 Content-Disposition: attachment; filename=t2.patch
849 851
850 852 # HG changeset patch
851 853 # User test
852 854 # Date 4 0
853 855 # Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
854 856 # Parent c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
855 857 charset=3Dutf-8; content-transfer-encoding: quoted-printable
856 858
857 859 diff -r c3c9e37db9f4 -r c655633f8c87 qp
858 860 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
859 861 +++ b/qp Thu Jan 01 00:00:04 1970 +0000
860 862 @@ -0,0 +1,4 @@
861 863 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
862 864 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
863 865 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
864 866 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
865 867 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
866 868 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
867 869 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
868 870 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
869 871 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
870 872 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
871 873 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
872 874 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
873 875 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
874 876 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
875 877 +foo
876 878 +
877 879 +bar
878 880
879 881 --===
880 882
881 883 test attach for multiple patches:
882 884 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a \
883 885 > -r 0:1 -r 4 | fixheaders
884 886 This patch series consists of 3 patches.
885 887
886 888
887 889 Write the introductory message for the patch series.
888 890
889 891
890 892 Displaying [PATCH 0 of 3] test ...
891 893 Content-Type: text/plain; charset="us-ascii"
892 894 MIME-Version: 1.0
893 895 Content-Transfer-Encoding: 7bit
894 896 Subject: [PATCH 0 of 3] test
895 897 Message-Id: <patchbomb.60@
896 898 User-Agent: Mercurial-patchbomb
897 899 Date: Thu, 01 Jan 1970 00:01:00 +0000
898 900 From: quux
899 901 To: foo
900 902 Cc: bar
901 903
902 904
903 905 Displaying [PATCH 1 of 3] a ...
904 906 Content-Type: multipart/mixed; boundary="===
905 907 MIME-Version: 1.0
906 908 Subject: [PATCH 1 of 3] a
907 909 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
908 910 Message-Id: <8580ff50825a50c8f716.61@
909 911 In-Reply-To: <patchbomb.60@
910 912 References: <patchbomb.60@
911 913 User-Agent: Mercurial-patchbomb
912 914 Date: Thu, 01 Jan 1970 00:01:01 +0000
913 915 From: quux
914 916 To: foo
915 917 Cc: bar
916 918
917 919 --===
918 920 Content-Type: text/plain; charset="us-ascii"
919 921 MIME-Version: 1.0
920 922 Content-Transfer-Encoding: 7bit
921 923
922 924 Patch subject is complete summary.
923 925
924 926
925 927
926 928 --===
927 929 Content-Type: text/x-patch; charset="us-ascii"
928 930 MIME-Version: 1.0
929 931 Content-Transfer-Encoding: 7bit
930 932 Content-Disposition: attachment; filename=t2-1.patch
931 933
932 934 # HG changeset patch
933 935 # User test
934 936 # Date 1 0
935 937 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
936 938 # Parent 0000000000000000000000000000000000000000
937 939 a
938 940
939 941 diff -r 000000000000 -r 8580ff50825a a
940 942 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
941 943 +++ b/a Thu Jan 01 00:00:01 1970 +0000
942 944 @@ -0,0 +1,1 @@
943 945 +a
944 946
945 947 --===
946 948 Displaying [PATCH 2 of 3] b ...
947 949 Content-Type: multipart/mixed; boundary="===
948 950 MIME-Version: 1.0
949 951 Subject: [PATCH 2 of 3] b
950 952 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
951 953 Message-Id: <97d72e5f12c7e84f8506.62@
952 954 In-Reply-To: <patchbomb.60@
953 955 References: <patchbomb.60@
954 956 User-Agent: Mercurial-patchbomb
955 957 Date: Thu, 01 Jan 1970 00:01:02 +0000
956 958 From: quux
957 959 To: foo
958 960 Cc: bar
959 961
960 962 --===
961 963 Content-Type: text/plain; charset="us-ascii"
962 964 MIME-Version: 1.0
963 965 Content-Transfer-Encoding: 7bit
964 966
965 967 Patch subject is complete summary.
966 968
967 969
968 970
969 971 --===
970 972 Content-Type: text/x-patch; charset="us-ascii"
971 973 MIME-Version: 1.0
972 974 Content-Transfer-Encoding: 7bit
973 975 Content-Disposition: attachment; filename=t2-2.patch
974 976
975 977 # HG changeset patch
976 978 # User test
977 979 # Date 2 0
978 980 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
979 981 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
980 982 b
981 983
982 984 diff -r 8580ff50825a -r 97d72e5f12c7 b
983 985 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
984 986 +++ b/b Thu Jan 01 00:00:02 1970 +0000
985 987 @@ -0,0 +1,1 @@
986 988 +b
987 989
988 990 --===
989 991 Displaying [PATCH 3 of 3] charset=utf-8; content-transfer-encoding: quoted-printable ...
990 992 Content-Type: multipart/mixed; boundary="===
991 993 MIME-Version: 1.0
992 994 Subject: [PATCH 3 of 3] charset=utf-8;
993 995 content-transfer-encoding: quoted-printable
994 996 X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
995 997 Message-Id: <c655633f8c87700bb38c.63@
996 998 In-Reply-To: <patchbomb.60@
997 999 References: <patchbomb.60@
998 1000 User-Agent: Mercurial-patchbomb
999 1001 Date: Thu, 01 Jan 1970 00:01:03 +0000
1000 1002 From: quux
1001 1003 To: foo
1002 1004 Cc: bar
1003 1005
1004 1006 --===
1005 1007 Content-Type: text/plain; charset="us-ascii"
1006 1008 MIME-Version: 1.0
1007 1009 Content-Transfer-Encoding: 7bit
1008 1010
1009 1011 Patch subject is complete summary.
1010 1012
1011 1013
1012 1014
1013 1015 --===
1014 1016 Content-Type: text/x-patch; charset="us-ascii"
1015 1017 MIME-Version: 1.0
1016 1018 Content-Transfer-Encoding: quoted-printable
1017 1019 Content-Disposition: attachment; filename=t2-3.patch
1018 1020
1019 1021 # HG changeset patch
1020 1022 # User test
1021 1023 # Date 4 0
1022 1024 # Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
1023 1025 # Parent c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
1024 1026 charset=3Dutf-8; content-transfer-encoding: quoted-printable
1025 1027
1026 1028 diff -r c3c9e37db9f4 -r c655633f8c87 qp
1027 1029 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1028 1030 +++ b/qp Thu Jan 01 00:00:04 1970 +0000
1029 1031 @@ -0,0 +1,4 @@
1030 1032 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1031 1033 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1032 1034 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1033 1035 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1034 1036 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1035 1037 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1036 1038 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1037 1039 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1038 1040 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1039 1041 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1040 1042 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1041 1043 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1042 1044 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
1043 1045 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1044 1046 +foo
1045 1047 +
1046 1048 +bar
1047 1049
1048 1050 --===
1049 1051
1050 1052 test intro for single patch:
1051 1053 $ hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
1052 1054 > -r 2 | fixheaders
1053 1055 This patch series consists of 1 patches.
1054 1056
1055 1057
1056 1058 Write the introductory message for the patch series.
1057 1059
1058 1060
1059 1061 Displaying [PATCH 0 of 1] test ...
1060 1062 Content-Type: text/plain; charset="us-ascii"
1061 1063 MIME-Version: 1.0
1062 1064 Content-Transfer-Encoding: 7bit
1063 1065 Subject: [PATCH 0 of 1] test
1064 1066 Message-Id: <patchbomb.60@
1065 1067 User-Agent: Mercurial-patchbomb
1066 1068 Date: Thu, 01 Jan 1970 00:01:00 +0000
1067 1069 From: quux
1068 1070 To: foo
1069 1071 Cc: bar
1070 1072
1071 1073
1072 1074 Displaying [PATCH 1 of 1] c ...
1073 1075 Content-Type: text/plain; charset="us-ascii"
1074 1076 MIME-Version: 1.0
1075 1077 Content-Transfer-Encoding: 7bit
1076 1078 Subject: [PATCH 1 of 1] c
1077 1079 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1078 1080 Message-Id: <ff2c9fa2018b15fa74b3.61@
1079 1081 In-Reply-To: <patchbomb.60@
1080 1082 References: <patchbomb.60@
1081 1083 User-Agent: Mercurial-patchbomb
1082 1084 Date: Thu, 01 Jan 1970 00:01:01 +0000
1083 1085 From: quux
1084 1086 To: foo
1085 1087 Cc: bar
1086 1088
1087 1089 # HG changeset patch
1088 1090 # User test
1089 1091 # Date 3 0
1090 1092 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1091 1093 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1092 1094 c
1093 1095
1094 1096 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1095 1097 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1096 1098 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1097 1099 @@ -0,0 +1,1 @@
1098 1100 +c
1099 1101
1100 1102
1101 1103 test --desc without --intro for a single patch:
1102 1104 $ echo foo > intro.text
1103 1105 $ hg email --date '1970-1-1 0:1' -n --desc intro.text -f quux -t foo -c bar \
1104 1106 > -s test -r 2 | fixheaders
1105 1107 This patch series consists of 1 patches.
1106 1108
1107 1109
1108 1110 Displaying [PATCH 0 of 1] test ...
1109 1111 Content-Type: text/plain; charset="us-ascii"
1110 1112 MIME-Version: 1.0
1111 1113 Content-Transfer-Encoding: 7bit
1112 1114 Subject: [PATCH 0 of 1] test
1113 1115 Message-Id: <patchbomb.60@
1114 1116 User-Agent: Mercurial-patchbomb
1115 1117 Date: Thu, 01 Jan 1970 00:01:00 +0000
1116 1118 From: quux
1117 1119 To: foo
1118 1120 Cc: bar
1119 1121
1120 1122 foo
1121 1123
1122 1124 Displaying [PATCH 1 of 1] c ...
1123 1125 Content-Type: text/plain; charset="us-ascii"
1124 1126 MIME-Version: 1.0
1125 1127 Content-Transfer-Encoding: 7bit
1126 1128 Subject: [PATCH 1 of 1] c
1127 1129 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1128 1130 Message-Id: <ff2c9fa2018b15fa74b3.61@
1129 1131 In-Reply-To: <patchbomb.60@
1130 1132 References: <patchbomb.60@
1131 1133 User-Agent: Mercurial-patchbomb
1132 1134 Date: Thu, 01 Jan 1970 00:01:01 +0000
1133 1135 From: quux
1134 1136 To: foo
1135 1137 Cc: bar
1136 1138
1137 1139 # HG changeset patch
1138 1140 # User test
1139 1141 # Date 3 0
1140 1142 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1141 1143 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1142 1144 c
1143 1145
1144 1146 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1145 1147 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1146 1148 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1147 1149 @@ -0,0 +1,1 @@
1148 1150 +c
1149 1151
1150 1152
1151 1153 test intro for multiple patches:
1152 1154 $ hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \
1153 1155 > -r 0:1 | fixheaders
1154 1156 This patch series consists of 2 patches.
1155 1157
1156 1158
1157 1159 Write the introductory message for the patch series.
1158 1160
1159 1161
1160 1162 Displaying [PATCH 0 of 2] test ...
1161 1163 Content-Type: text/plain; charset="us-ascii"
1162 1164 MIME-Version: 1.0
1163 1165 Content-Transfer-Encoding: 7bit
1164 1166 Subject: [PATCH 0 of 2] test
1165 1167 Message-Id: <patchbomb.60@
1166 1168 User-Agent: Mercurial-patchbomb
1167 1169 Date: Thu, 01 Jan 1970 00:01:00 +0000
1168 1170 From: quux
1169 1171 To: foo
1170 1172 Cc: bar
1171 1173
1172 1174
1173 1175 Displaying [PATCH 1 of 2] a ...
1174 1176 Content-Type: text/plain; charset="us-ascii"
1175 1177 MIME-Version: 1.0
1176 1178 Content-Transfer-Encoding: 7bit
1177 1179 Subject: [PATCH 1 of 2] a
1178 1180 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1179 1181 Message-Id: <8580ff50825a50c8f716.61@
1180 1182 In-Reply-To: <patchbomb.60@
1181 1183 References: <patchbomb.60@
1182 1184 User-Agent: Mercurial-patchbomb
1183 1185 Date: Thu, 01 Jan 1970 00:01:01 +0000
1184 1186 From: quux
1185 1187 To: foo
1186 1188 Cc: bar
1187 1189
1188 1190 # HG changeset patch
1189 1191 # User test
1190 1192 # Date 1 0
1191 1193 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1192 1194 # Parent 0000000000000000000000000000000000000000
1193 1195 a
1194 1196
1195 1197 diff -r 000000000000 -r 8580ff50825a a
1196 1198 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1197 1199 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1198 1200 @@ -0,0 +1,1 @@
1199 1201 +a
1200 1202
1201 1203 Displaying [PATCH 2 of 2] b ...
1202 1204 Content-Type: text/plain; charset="us-ascii"
1203 1205 MIME-Version: 1.0
1204 1206 Content-Transfer-Encoding: 7bit
1205 1207 Subject: [PATCH 2 of 2] b
1206 1208 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1207 1209 Message-Id: <97d72e5f12c7e84f8506.62@
1208 1210 In-Reply-To: <patchbomb.60@
1209 1211 References: <patchbomb.60@
1210 1212 User-Agent: Mercurial-patchbomb
1211 1213 Date: Thu, 01 Jan 1970 00:01:02 +0000
1212 1214 From: quux
1213 1215 To: foo
1214 1216 Cc: bar
1215 1217
1216 1218 # HG changeset patch
1217 1219 # User test
1218 1220 # Date 2 0
1219 1221 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1220 1222 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1221 1223 b
1222 1224
1223 1225 diff -r 8580ff50825a -r 97d72e5f12c7 b
1224 1226 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1225 1227 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1226 1228 @@ -0,0 +1,1 @@
1227 1229 +b
1228 1230
1229 1231
1230 1232 test reply-to via config:
1231 1233 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -r 2 \
1232 1234 > --config patchbomb.reply-to='baz@example.com' | fixheaders
1233 1235 This patch series consists of 1 patches.
1234 1236
1235 1237
1236 1238 Displaying [PATCH] test ...
1237 1239 Content-Type: text/plain; charset="us-ascii"
1238 1240 MIME-Version: 1.0
1239 1241 Content-Transfer-Encoding: 7bit
1240 1242 Subject: [PATCH] test
1241 1243 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1242 1244 Message-Id: <ff2c9fa2018b15fa74b3.60@
1243 1245 User-Agent: Mercurial-patchbomb
1244 1246 Date: Thu, 01 Jan 1970 00:01:00 +0000
1245 1247 From: quux
1246 1248 To: foo
1247 1249 Cc: bar
1248 1250 Reply-To: baz@example.com
1249 1251
1250 1252 # HG changeset patch
1251 1253 # User test
1252 1254 # Date 3 0
1253 1255 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1254 1256 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1255 1257 c
1256 1258
1257 1259 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1258 1260 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1259 1261 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1260 1262 @@ -0,0 +1,1 @@
1261 1263 +c
1262 1264
1263 1265
1264 1266 test reply-to via command line:
1265 1267 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -r 2 \
1266 1268 > --reply-to baz --reply-to fred | fixheaders
1267 1269 This patch series consists of 1 patches.
1268 1270
1269 1271
1270 1272 Displaying [PATCH] test ...
1271 1273 Content-Type: text/plain; charset="us-ascii"
1272 1274 MIME-Version: 1.0
1273 1275 Content-Transfer-Encoding: 7bit
1274 1276 Subject: [PATCH] test
1275 1277 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1276 1278 Message-Id: <ff2c9fa2018b15fa74b3.60@
1277 1279 User-Agent: Mercurial-patchbomb
1278 1280 Date: Thu, 01 Jan 1970 00:01:00 +0000
1279 1281 From: quux
1280 1282 To: foo
1281 1283 Cc: bar
1282 1284 Reply-To: baz, fred
1283 1285
1284 1286 # HG changeset patch
1285 1287 # User test
1286 1288 # Date 3 0
1287 1289 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1288 1290 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1289 1291 c
1290 1292
1291 1293 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1292 1294 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1293 1295 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1294 1296 @@ -0,0 +1,1 @@
1295 1297 +c
1296 1298
1297 1299
1298 1300 tagging csets:
1299 1301 $ hg tag -r0 zero zero.foo
1300 1302 $ hg tag -r1 one one.patch
1301 1303 $ hg tag -r2 two two.diff
1302 1304
1303 1305 test inline for single named patch:
1304 1306 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2 | \
1305 1307 > fixheaders
1306 1308 This patch series consists of 1 patches.
1307 1309
1308 1310
1309 1311 Displaying [PATCH] test ...
1310 1312 Content-Type: multipart/mixed; boundary="===
1311 1313 MIME-Version: 1.0
1312 1314 Subject: [PATCH] test
1313 1315 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1314 1316 Message-Id: <ff2c9fa2018b15fa74b3.60@
1315 1317 User-Agent: Mercurial-patchbomb
1316 1318 Date: Thu, 01 Jan 1970 00:01:00 +0000
1317 1319 From: quux
1318 1320 To: foo
1319 1321 Cc: bar
1320 1322
1321 1323 --===
1322 1324 Content-Type: text/x-patch; charset="us-ascii"
1323 1325 MIME-Version: 1.0
1324 1326 Content-Transfer-Encoding: 7bit
1325 1327 Content-Disposition: inline; filename=two.diff
1326 1328
1327 1329 # HG changeset patch
1328 1330 # User test
1329 1331 # Date 3 0
1330 1332 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1331 1333 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1332 1334 c
1333 1335
1334 1336 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1335 1337 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1336 1338 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1337 1339 @@ -0,0 +1,1 @@
1338 1340 +c
1339 1341
1340 1342 --===
1341 1343
1342 1344 test inline for multiple named/unnamed patches:
1343 1345 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 0:1 | \
1344 1346 > fixheaders
1345 1347 This patch series consists of 2 patches.
1346 1348
1347 1349
1348 1350 Write the introductory message for the patch series.
1349 1351
1350 1352
1351 1353 Displaying [PATCH 0 of 2] test ...
1352 1354 Content-Type: text/plain; charset="us-ascii"
1353 1355 MIME-Version: 1.0
1354 1356 Content-Transfer-Encoding: 7bit
1355 1357 Subject: [PATCH 0 of 2] test
1356 1358 Message-Id: <patchbomb.60@
1357 1359 User-Agent: Mercurial-patchbomb
1358 1360 Date: Thu, 01 Jan 1970 00:01:00 +0000
1359 1361 From: quux
1360 1362 To: foo
1361 1363 Cc: bar
1362 1364
1363 1365
1364 1366 Displaying [PATCH 1 of 2] a ...
1365 1367 Content-Type: multipart/mixed; boundary="===
1366 1368 MIME-Version: 1.0
1367 1369 Subject: [PATCH 1 of 2] a
1368 1370 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1369 1371 Message-Id: <8580ff50825a50c8f716.61@
1370 1372 In-Reply-To: <patchbomb.60@
1371 1373 References: <patchbomb.60@
1372 1374 User-Agent: Mercurial-patchbomb
1373 1375 Date: Thu, 01 Jan 1970 00:01:01 +0000
1374 1376 From: quux
1375 1377 To: foo
1376 1378 Cc: bar
1377 1379
1378 1380 --===
1379 1381 Content-Type: text/x-patch; charset="us-ascii"
1380 1382 MIME-Version: 1.0
1381 1383 Content-Transfer-Encoding: 7bit
1382 1384 Content-Disposition: inline; filename=t2-1.patch
1383 1385
1384 1386 # HG changeset patch
1385 1387 # User test
1386 1388 # Date 1 0
1387 1389 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1388 1390 # Parent 0000000000000000000000000000000000000000
1389 1391 a
1390 1392
1391 1393 diff -r 000000000000 -r 8580ff50825a a
1392 1394 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1393 1395 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1394 1396 @@ -0,0 +1,1 @@
1395 1397 +a
1396 1398
1397 1399 --===
1398 1400 Displaying [PATCH 2 of 2] b ...
1399 1401 Content-Type: multipart/mixed; boundary="===
1400 1402 MIME-Version: 1.0
1401 1403 Subject: [PATCH 2 of 2] b
1402 1404 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1403 1405 Message-Id: <97d72e5f12c7e84f8506.62@
1404 1406 In-Reply-To: <patchbomb.60@
1405 1407 References: <patchbomb.60@
1406 1408 User-Agent: Mercurial-patchbomb
1407 1409 Date: Thu, 01 Jan 1970 00:01:02 +0000
1408 1410 From: quux
1409 1411 To: foo
1410 1412 Cc: bar
1411 1413
1412 1414 --===
1413 1415 Content-Type: text/x-patch; charset="us-ascii"
1414 1416 MIME-Version: 1.0
1415 1417 Content-Transfer-Encoding: 7bit
1416 1418 Content-Disposition: inline; filename=one.patch
1417 1419
1418 1420 # HG changeset patch
1419 1421 # User test
1420 1422 # Date 2 0
1421 1423 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1422 1424 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1423 1425 b
1424 1426
1425 1427 diff -r 8580ff50825a -r 97d72e5f12c7 b
1426 1428 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1427 1429 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1428 1430 @@ -0,0 +1,1 @@
1429 1431 +b
1430 1432
1431 1433 --===
1432 1434
1433 1435
1434 1436 test inreplyto:
1435 1437 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
1436 1438 > -r tip | fixheaders
1437 1439 This patch series consists of 1 patches.
1438 1440
1439 1441
1440 1442 Displaying [PATCH] Added tag two, two.diff for changeset ff2c9fa2018b ...
1441 1443 Content-Type: text/plain; charset="us-ascii"
1442 1444 MIME-Version: 1.0
1443 1445 Content-Transfer-Encoding: 7bit
1444 1446 Subject: [PATCH] Added tag two, two.diff for changeset ff2c9fa2018b
1445 1447 X-Mercurial-Node: e317db6a6f288748d1f6cb064f3810fcba66b1b6
1446 1448 Message-Id: <e317db6a6f288748d1f6.60@
1447 1449 In-Reply-To: <baz>
1448 1450 References: <baz>
1449 1451 User-Agent: Mercurial-patchbomb
1450 1452 Date: Thu, 01 Jan 1970 00:01:00 +0000
1451 1453 From: quux
1452 1454 To: foo
1453 1455 Cc: bar
1454 1456
1455 1457 # HG changeset patch
1456 1458 # User test
1457 1459 # Date 0 0
1458 1460 # Node ID e317db6a6f288748d1f6cb064f3810fcba66b1b6
1459 1461 # Parent eae5fcf795eee29d0e45ffc9f519a91cd79fc9ff
1460 1462 Added tag two, two.diff for changeset ff2c9fa2018b
1461 1463
1462 1464 diff -r eae5fcf795ee -r e317db6a6f28 .hgtags
1463 1465 --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000
1464 1466 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
1465 1467 @@ -2,3 +2,5 @@
1466 1468 8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
1467 1469 97d72e5f12c7e84f85064aa72e5a297142c36ed9 one
1468 1470 97d72e5f12c7e84f85064aa72e5a297142c36ed9 one.patch
1469 1471 +ff2c9fa2018b15fa74b33363bda9527323e2a99f two
1470 1472 +ff2c9fa2018b15fa74b33363bda9527323e2a99f two.diff
1471 1473
1472 1474 no intro message in non-interactive mode
1473 1475 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
1474 1476 > -r 0:1 | fixheaders
1475 1477 This patch series consists of 2 patches.
1476 1478
1477 1479 Subject: [PATCH 0 of 2]
1478 1480
1479 1481 Displaying [PATCH 1 of 2] a ...
1480 1482 Content-Type: text/plain; charset="us-ascii"
1481 1483 MIME-Version: 1.0
1482 1484 Content-Transfer-Encoding: 7bit
1483 1485 Subject: [PATCH 1 of 2] a
1484 1486 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1485 1487 Message-Id: <8580ff50825a50c8f716.60@
1486 1488 In-Reply-To: <baz>
1487 1489 References: <baz>
1488 1490 User-Agent: Mercurial-patchbomb
1489 1491 Date: Thu, 01 Jan 1970 00:01:00 +0000
1490 1492 From: quux
1491 1493 To: foo
1492 1494 Cc: bar
1493 1495
1494 1496 # HG changeset patch
1495 1497 # User test
1496 1498 # Date 1 0
1497 1499 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1498 1500 # Parent 0000000000000000000000000000000000000000
1499 1501 a
1500 1502
1501 1503 diff -r 000000000000 -r 8580ff50825a a
1502 1504 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1503 1505 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1504 1506 @@ -0,0 +1,1 @@
1505 1507 +a
1506 1508
1507 1509 Displaying [PATCH 2 of 2] b ...
1508 1510 Content-Type: text/plain; charset="us-ascii"
1509 1511 MIME-Version: 1.0
1510 1512 Content-Transfer-Encoding: 7bit
1511 1513 Subject: [PATCH 2 of 2] b
1512 1514 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1513 1515 Message-Id: <97d72e5f12c7e84f8506.61@
1514 1516 In-Reply-To: <8580ff50825a50c8f716.60@
1515 1517 References: <8580ff50825a50c8f716.60@
1516 1518 User-Agent: Mercurial-patchbomb
1517 1519 Date: Thu, 01 Jan 1970 00:01:01 +0000
1518 1520 From: quux
1519 1521 To: foo
1520 1522 Cc: bar
1521 1523
1522 1524 # HG changeset patch
1523 1525 # User test
1524 1526 # Date 2 0
1525 1527 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1526 1528 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1527 1529 b
1528 1530
1529 1531 diff -r 8580ff50825a -r 97d72e5f12c7 b
1530 1532 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1531 1533 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1532 1534 @@ -0,0 +1,1 @@
1533 1535 +b
1534 1536
1535 1537
1536 1538
1537 1539
1538 1540 $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \
1539 1541 > -s test -r 0:1 | fixheaders
1540 1542 This patch series consists of 2 patches.
1541 1543
1542 1544
1543 1545 Write the introductory message for the patch series.
1544 1546
1545 1547
1546 1548 Displaying [PATCH 0 of 2] test ...
1547 1549 Content-Type: text/plain; charset="us-ascii"
1548 1550 MIME-Version: 1.0
1549 1551 Content-Transfer-Encoding: 7bit
1550 1552 Subject: [PATCH 0 of 2] test
1551 1553 Message-Id: <patchbomb.60@
1552 1554 In-Reply-To: <baz>
1553 1555 References: <baz>
1554 1556 User-Agent: Mercurial-patchbomb
1555 1557 Date: Thu, 01 Jan 1970 00:01:00 +0000
1556 1558 From: quux
1557 1559 To: foo
1558 1560 Cc: bar
1559 1561
1560 1562
1561 1563 Displaying [PATCH 1 of 2] a ...
1562 1564 Content-Type: text/plain; charset="us-ascii"
1563 1565 MIME-Version: 1.0
1564 1566 Content-Transfer-Encoding: 7bit
1565 1567 Subject: [PATCH 1 of 2] a
1566 1568 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1567 1569 Message-Id: <8580ff50825a50c8f716.61@
1568 1570 In-Reply-To: <patchbomb.60@
1569 1571 References: <patchbomb.60@
1570 1572 User-Agent: Mercurial-patchbomb
1571 1573 Date: Thu, 01 Jan 1970 00:01:01 +0000
1572 1574 From: quux
1573 1575 To: foo
1574 1576 Cc: bar
1575 1577
1576 1578 # HG changeset patch
1577 1579 # User test
1578 1580 # Date 1 0
1579 1581 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1580 1582 # Parent 0000000000000000000000000000000000000000
1581 1583 a
1582 1584
1583 1585 diff -r 000000000000 -r 8580ff50825a a
1584 1586 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1585 1587 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1586 1588 @@ -0,0 +1,1 @@
1587 1589 +a
1588 1590
1589 1591 Displaying [PATCH 2 of 2] b ...
1590 1592 Content-Type: text/plain; charset="us-ascii"
1591 1593 MIME-Version: 1.0
1592 1594 Content-Transfer-Encoding: 7bit
1593 1595 Subject: [PATCH 2 of 2] b
1594 1596 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1595 1597 Message-Id: <97d72e5f12c7e84f8506.62@
1596 1598 In-Reply-To: <patchbomb.60@
1597 1599 References: <patchbomb.60@
1598 1600 User-Agent: Mercurial-patchbomb
1599 1601 Date: Thu, 01 Jan 1970 00:01:02 +0000
1600 1602 From: quux
1601 1603 To: foo
1602 1604 Cc: bar
1603 1605
1604 1606 # HG changeset patch
1605 1607 # User test
1606 1608 # Date 2 0
1607 1609 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1608 1610 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1609 1611 b
1610 1612
1611 1613 diff -r 8580ff50825a -r 97d72e5f12c7 b
1612 1614 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1613 1615 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1614 1616 @@ -0,0 +1,1 @@
1615 1617 +b
1616 1618
1617 1619
1618 1620 test single flag for single patch:
1619 1621 $ hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
1620 1622 > -r 2 | fixheaders
1621 1623 This patch series consists of 1 patches.
1622 1624
1623 1625
1624 1626 Displaying [PATCH fooFlag] test ...
1625 1627 Content-Type: text/plain; charset="us-ascii"
1626 1628 MIME-Version: 1.0
1627 1629 Content-Transfer-Encoding: 7bit
1628 1630 Subject: [PATCH fooFlag] test
1629 1631 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1630 1632 Message-Id: <ff2c9fa2018b15fa74b3.60@
1631 1633 User-Agent: Mercurial-patchbomb
1632 1634 Date: Thu, 01 Jan 1970 00:01:00 +0000
1633 1635 From: quux
1634 1636 To: foo
1635 1637 Cc: bar
1636 1638
1637 1639 # HG changeset patch
1638 1640 # User test
1639 1641 # Date 3 0
1640 1642 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1641 1643 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1642 1644 c
1643 1645
1644 1646 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1645 1647 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1646 1648 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1647 1649 @@ -0,0 +1,1 @@
1648 1650 +c
1649 1651
1650 1652
1651 1653 test single flag for multiple patches:
1652 1654 $ hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \
1653 1655 > -r 0:1 | fixheaders
1654 1656 This patch series consists of 2 patches.
1655 1657
1656 1658
1657 1659 Write the introductory message for the patch series.
1658 1660
1659 1661
1660 1662 Displaying [PATCH 0 of 2 fooFlag] test ...
1661 1663 Content-Type: text/plain; charset="us-ascii"
1662 1664 MIME-Version: 1.0
1663 1665 Content-Transfer-Encoding: 7bit
1664 1666 Subject: [PATCH 0 of 2 fooFlag] test
1665 1667 Message-Id: <patchbomb.60@
1666 1668 User-Agent: Mercurial-patchbomb
1667 1669 Date: Thu, 01 Jan 1970 00:01:00 +0000
1668 1670 From: quux
1669 1671 To: foo
1670 1672 Cc: bar
1671 1673
1672 1674
1673 1675 Displaying [PATCH 1 of 2 fooFlag] a ...
1674 1676 Content-Type: text/plain; charset="us-ascii"
1675 1677 MIME-Version: 1.0
1676 1678 Content-Transfer-Encoding: 7bit
1677 1679 Subject: [PATCH 1 of 2 fooFlag] a
1678 1680 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1679 1681 Message-Id: <8580ff50825a50c8f716.61@
1680 1682 In-Reply-To: <patchbomb.60@
1681 1683 References: <patchbomb.60@
1682 1684 User-Agent: Mercurial-patchbomb
1683 1685 Date: Thu, 01 Jan 1970 00:01:01 +0000
1684 1686 From: quux
1685 1687 To: foo
1686 1688 Cc: bar
1687 1689
1688 1690 # HG changeset patch
1689 1691 # User test
1690 1692 # Date 1 0
1691 1693 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1692 1694 # Parent 0000000000000000000000000000000000000000
1693 1695 a
1694 1696
1695 1697 diff -r 000000000000 -r 8580ff50825a a
1696 1698 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1697 1699 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1698 1700 @@ -0,0 +1,1 @@
1699 1701 +a
1700 1702
1701 1703 Displaying [PATCH 2 of 2 fooFlag] b ...
1702 1704 Content-Type: text/plain; charset="us-ascii"
1703 1705 MIME-Version: 1.0
1704 1706 Content-Transfer-Encoding: 7bit
1705 1707 Subject: [PATCH 2 of 2 fooFlag] b
1706 1708 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1707 1709 Message-Id: <97d72e5f12c7e84f8506.62@
1708 1710 In-Reply-To: <patchbomb.60@
1709 1711 References: <patchbomb.60@
1710 1712 User-Agent: Mercurial-patchbomb
1711 1713 Date: Thu, 01 Jan 1970 00:01:02 +0000
1712 1714 From: quux
1713 1715 To: foo
1714 1716 Cc: bar
1715 1717
1716 1718 # HG changeset patch
1717 1719 # User test
1718 1720 # Date 2 0
1719 1721 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1720 1722 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1721 1723 b
1722 1724
1723 1725 diff -r 8580ff50825a -r 97d72e5f12c7 b
1724 1726 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1725 1727 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1726 1728 @@ -0,0 +1,1 @@
1727 1729 +b
1728 1730
1729 1731
1730 1732 test mutiple flags for single patch:
1731 1733 $ hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
1732 1734 > -c bar -s test -r 2 | fixheaders
1733 1735 This patch series consists of 1 patches.
1734 1736
1735 1737
1736 1738 Displaying [PATCH fooFlag barFlag] test ...
1737 1739 Content-Type: text/plain; charset="us-ascii"
1738 1740 MIME-Version: 1.0
1739 1741 Content-Transfer-Encoding: 7bit
1740 1742 Subject: [PATCH fooFlag barFlag] test
1741 1743 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1742 1744 Message-Id: <ff2c9fa2018b15fa74b3.60@
1743 1745 User-Agent: Mercurial-patchbomb
1744 1746 Date: Thu, 01 Jan 1970 00:01:00 +0000
1745 1747 From: quux
1746 1748 To: foo
1747 1749 Cc: bar
1748 1750
1749 1751 # HG changeset patch
1750 1752 # User test
1751 1753 # Date 3 0
1752 1754 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1753 1755 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1754 1756 c
1755 1757
1756 1758 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1757 1759 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1758 1760 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1759 1761 @@ -0,0 +1,1 @@
1760 1762 +c
1761 1763
1762 1764
1763 1765 test multiple flags for multiple patches:
1764 1766 $ hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \
1765 1767 > -c bar -s test -r 0:1 | fixheaders
1766 1768 This patch series consists of 2 patches.
1767 1769
1768 1770
1769 1771 Write the introductory message for the patch series.
1770 1772
1771 1773
1772 1774 Displaying [PATCH 0 of 2 fooFlag barFlag] test ...
1773 1775 Content-Type: text/plain; charset="us-ascii"
1774 1776 MIME-Version: 1.0
1775 1777 Content-Transfer-Encoding: 7bit
1776 1778 Subject: [PATCH 0 of 2 fooFlag barFlag] test
1777 1779 Message-Id: <patchbomb.60@
1778 1780 User-Agent: Mercurial-patchbomb
1779 1781 Date: Thu, 01 Jan 1970 00:01:00 +0000
1780 1782 From: quux
1781 1783 To: foo
1782 1784 Cc: bar
1783 1785
1784 1786
1785 1787 Displaying [PATCH 1 of 2 fooFlag barFlag] a ...
1786 1788 Content-Type: text/plain; charset="us-ascii"
1787 1789 MIME-Version: 1.0
1788 1790 Content-Transfer-Encoding: 7bit
1789 1791 Subject: [PATCH 1 of 2 fooFlag barFlag] a
1790 1792 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1791 1793 Message-Id: <8580ff50825a50c8f716.61@
1792 1794 In-Reply-To: <patchbomb.60@
1793 1795 References: <patchbomb.60@
1794 1796 User-Agent: Mercurial-patchbomb
1795 1797 Date: Thu, 01 Jan 1970 00:01:01 +0000
1796 1798 From: quux
1797 1799 To: foo
1798 1800 Cc: bar
1799 1801
1800 1802 # HG changeset patch
1801 1803 # User test
1802 1804 # Date 1 0
1803 1805 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1804 1806 # Parent 0000000000000000000000000000000000000000
1805 1807 a
1806 1808
1807 1809 diff -r 000000000000 -r 8580ff50825a a
1808 1810 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1809 1811 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1810 1812 @@ -0,0 +1,1 @@
1811 1813 +a
1812 1814
1813 1815 Displaying [PATCH 2 of 2 fooFlag barFlag] b ...
1814 1816 Content-Type: text/plain; charset="us-ascii"
1815 1817 MIME-Version: 1.0
1816 1818 Content-Transfer-Encoding: 7bit
1817 1819 Subject: [PATCH 2 of 2 fooFlag barFlag] b
1818 1820 X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1819 1821 Message-Id: <97d72e5f12c7e84f8506.62@
1820 1822 In-Reply-To: <patchbomb.60@
1821 1823 References: <patchbomb.60@
1822 1824 User-Agent: Mercurial-patchbomb
1823 1825 Date: Thu, 01 Jan 1970 00:01:02 +0000
1824 1826 From: quux
1825 1827 To: foo
1826 1828 Cc: bar
1827 1829
1828 1830 # HG changeset patch
1829 1831 # User test
1830 1832 # Date 2 0
1831 1833 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1832 1834 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab
1833 1835 b
1834 1836
1835 1837 diff -r 8580ff50825a -r 97d72e5f12c7 b
1836 1838 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1837 1839 +++ b/b Thu Jan 01 00:00:02 1970 +0000
1838 1840 @@ -0,0 +1,1 @@
1839 1841 +b
1840 1842
1841 1843
1842 1844 test multi-address parsing:
1843 1845 $ hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t 'spam<spam><eggs>' \
1844 1846 > -t toast -c 'foo,bar@example.com' -c '"A, B <>" <a@example.com>' -s test -r 0 \
1845 1847 > --config email.bcc='"Quux, A." <quux>'
1846 1848 This patch series consists of 1 patches.
1847 1849
1848 1850
1849 1851 Writing [PATCH] test ...
1850 1852 $ fixheaders < tmp.mbox
1851 1853 From quux Tue Jan 01 00:01:01 1980
1852 1854 Content-Type: text/plain; charset="us-ascii"
1853 1855 MIME-Version: 1.0
1854 1856 Content-Transfer-Encoding: 7bit
1855 1857 Subject: [PATCH] test
1856 1858 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1857 1859 Message-Id: <8580ff50825a50c8f716.315532860@
1858 1860 User-Agent: Mercurial-patchbomb
1859 1861 Date: Tue, 01 Jan 1980 00:01:00 +0000
1860 1862 From: quux
1861 1863 To: spam <spam>, eggs, toast
1862 1864 Cc: foo, bar@example.com, "A, B <>" <a@example.com>
1863 1865 Bcc: "Quux, A." <quux>
1864 1866
1865 1867 # HG changeset patch
1866 1868 # User test
1867 1869 # Date 1 0
1868 1870 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1869 1871 # Parent 0000000000000000000000000000000000000000
1870 1872 a
1871 1873
1872 1874 diff -r 000000000000 -r 8580ff50825a a
1873 1875 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1874 1876 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1875 1877 @@ -0,0 +1,1 @@
1876 1878 +a
1877 1879
1878 1880
1879 1881
1880 1882 test multi-byte domain parsing:
1881 1883 $ UUML=`python -c 'import sys; sys.stdout.write("\374")'`
1882 1884 $ HGENCODING=iso-8859-1
1883 1885 $ export HGENCODING
1884 1886 $ hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t "bar@${UUML}nicode.com" -s test -r 0
1885 1887 This patch series consists of 1 patches.
1886 1888
1887 1889 Cc:
1888 1890
1889 1891 Writing [PATCH] test ...
1890 1892
1891 1893 $ cat tmp.mbox
1892 1894 From quux Tue Jan 01 00:01:01 1980
1893 1895 Content-Type: text/plain; charset="us-ascii"
1894 1896 MIME-Version: 1.0
1895 1897 Content-Transfer-Encoding: 7bit
1896 1898 Subject: [PATCH] test
1897 1899 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
1898 1900 Message-Id: <8580ff50825a50c8f716.315532860@* (glob)
1899 1901 User-Agent: Mercurial-patchbomb/* (glob)
1900 1902 Date: Tue, 01 Jan 1980 00:01:00 +0000
1901 1903 From: quux
1902 1904 To: bar@xn--nicode-2ya.com
1903 1905
1904 1906 # HG changeset patch
1905 1907 # User test
1906 1908 # Date 1 0
1907 1909 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab
1908 1910 # Parent 0000000000000000000000000000000000000000
1909 1911 a
1910 1912
1911 1913 diff -r 000000000000 -r 8580ff50825a a
1912 1914 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1913 1915 +++ b/a Thu Jan 01 00:00:01 1970 +0000
1914 1916 @@ -0,0 +1,1 @@
1915 1917 +a
1916 1918
1917 1919
1918 1920
1919 1921 test outgoing:
1920 1922 $ hg up 1
1921 1923 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
1922 1924
1923 1925 $ hg branch test
1924 1926 marked working directory as branch test
1925 1927
1926 1928 $ echo d > d
1927 1929 $ hg add d
1928 1930 $ hg ci -md -d '4 0'
1929 1931 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t
1930 1932 comparing with ../t
1931 1933 searching for changes
1932 1934 From [test]: test
1933 1935 This patch series consists of 8 patches.
1934 1936
1935 1937
1936 1938 Write the introductory message for the patch series.
1937 1939
1938 1940 Cc:
1939 1941
1940 1942 Displaying [PATCH 0 of 8] test ...
1941 1943 Content-Type: text/plain; charset="us-ascii"
1942 1944 MIME-Version: 1.0
1943 1945 Content-Transfer-Encoding: 7bit
1944 1946 Subject: [PATCH 0 of 8] test
1945 1947 Message-Id: <patchbomb.315532860@* (glob)
1946 1948 User-Agent: Mercurial-patchbomb/* (glob)
1947 1949 Date: Tue, 01 Jan 1980 00:01:00 +0000
1948 1950 From: test
1949 1951 To: foo
1950 1952
1951 1953
1952 1954 Displaying [PATCH 1 of 8] c ...
1953 1955 Content-Type: text/plain; charset="us-ascii"
1954 1956 MIME-Version: 1.0
1955 1957 Content-Transfer-Encoding: 7bit
1956 1958 Subject: [PATCH 1 of 8] c
1957 1959 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
1958 1960 Message-Id: <ff2c9fa2018b15fa74b3.315532861@* (glob)
1959 1961 In-Reply-To: <patchbomb\.315532860@[^>]*> (re)
1960 1962 References: <patchbomb\.315532860@[^>]*> (re)
1961 1963 User-Agent: Mercurial-patchbomb/* (glob)
1962 1964 Date: Tue, 01 Jan 1980 00:01:01 +0000
1963 1965 From: test
1964 1966 To: foo
1965 1967
1966 1968 # HG changeset patch
1967 1969 # User test
1968 1970 # Date 3 0
1969 1971 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f
1970 1972 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
1971 1973 c
1972 1974
1973 1975 diff -r 97d72e5f12c7 -r ff2c9fa2018b c
1974 1976 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1975 1977 +++ b/c Thu Jan 01 00:00:03 1970 +0000
1976 1978 @@ -0,0 +1,1 @@
1977 1979 +c
1978 1980
1979 1981 Displaying [PATCH 2 of 8] charset=utf-8; content-transfer-encoding: base64 ...
1980 1982 Content-Type: text/plain; charset="us-ascii"
1981 1983 MIME-Version: 1.0
1982 1984 Content-Transfer-Encoding: 8bit
1983 1985 Subject: [PATCH 2 of 8] charset=utf-8; content-transfer-encoding: base64
1984 1986 X-Mercurial-Node: c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
1985 1987 Message-Id: <c3c9e37db9f4fe4882cd.315532862@* (glob)
1986 1988 In-Reply-To: <patchbomb\.315532860@[^>]*> (re)
1987 1989 References: <patchbomb\.315532860@[^>]*> (re)
1988 1990 User-Agent: Mercurial-patchbomb/* (glob)
1989 1991 Date: Tue, 01 Jan 1980 00:01:02 +0000
1990 1992 From: test
1991 1993 To: foo
1992 1994
1993 1995 # HG changeset patch
1994 1996 # User test
1995 1997 # Date 4 0
1996 1998 # Node ID c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
1997 1999 # Parent ff2c9fa2018b15fa74b33363bda9527323e2a99f
1998 2000 charset=utf-8; content-transfer-encoding: base64
1999 2001
2000 2002 diff -r ff2c9fa2018b -r c3c9e37db9f4 description
2001 2003 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2002 2004 +++ b/description Thu Jan 01 00:00:04 1970 +0000
2003 2005 @@ -0,0 +1,3 @@
2004 2006 +a multiline
2005 2007 +
2006 2008 +description
2007 2009 diff -r ff2c9fa2018b -r c3c9e37db9f4 utf
2008 2010 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2009 2011 +++ b/utf Thu Jan 01 00:00:04 1970 +0000
2010 2012 @@ -0,0 +1,1 @@
2011 2013 +h\xc3\xb6mma! (esc)
2012 2014
2013 2015 Displaying [PATCH 3 of 8] charset=utf-8; content-transfer-encoding: quoted-printable ...
2014 2016 Content-Type: text/plain; charset="us-ascii"
2015 2017 MIME-Version: 1.0
2016 2018 Content-Transfer-Encoding: quoted-printable
2017 2019 Subject: [PATCH 3 of 8] charset=utf-8;
2018 2020 content-transfer-encoding: quoted-printable
2019 2021 X-Mercurial-Node: c655633f8c87700bb38cc6a59a2753bdc5a6c376
2020 2022 Message-Id: <c655633f8c87700bb38c.315532863@* (glob)
2021 2023 In-Reply-To: <patchbomb\.315532860@[^>]*> (re)
2022 2024 References: <patchbomb\.315532860@[^>]*> (re)
2023 2025 User-Agent: Mercurial-patchbomb/* (glob)
2024 2026 Date: Tue, 01 Jan 1980 00:01:03 +0000
2025 2027 From: test
2026 2028 To: foo
2027 2029
2028 2030 # HG changeset patch
2029 2031 # User test
2030 2032 # Date 4 0
2031 2033 # Node ID c655633f8c87700bb38cc6a59a2753bdc5a6c376
2032 2034 # Parent c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
2033 2035 charset=3Dutf-8; content-transfer-encoding: quoted-printable
2034 2036
2035 2037 diff -r c3c9e37db9f4 -r c655633f8c87 qp
2036 2038 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2037 2039 +++ b/qp Thu Jan 01 00:00:04 1970 +0000
2038 2040 @@ -0,0 +1,4 @@
2039 2041 +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2040 2042 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2041 2043 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2042 2044 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2043 2045 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2044 2046 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2045 2047 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2046 2048 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2047 2049 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2048 2050 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2049 2051 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2050 2052 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2051 2053 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
2052 2054 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2053 2055 +foo
2054 2056 +
2055 2057 +bar
2056 2058
2057 2059 Displaying [PATCH 4 of 8] charset=us-ascii; content-transfer-encoding: 8bit ...
2058 2060 Content-Type: text/plain; charset="us-ascii"
2059 2061 MIME-Version: 1.0
2060 2062 Content-Transfer-Encoding: 8bit
2061 2063 Subject: [PATCH 4 of 8] charset=us-ascii; content-transfer-encoding: 8bit
2062 2064 X-Mercurial-Node: 22d0f96be12f5945fd67d101af58f7bc8263c835
2063 2065 Message-Id: <22d0f96be12f5945fd67.315532864@* (glob)
2064 2066 In-Reply-To: <patchbomb\.315532860@[^>]*> (re)
2065 2067 References: <patchbomb\.315532860@[^>]*> (re)
2066 2068 User-Agent: Mercurial-patchbomb/* (glob)
2067 2069 Date: Tue, 01 Jan 1980 00:01:04 +0000
2068 2070 From: test
2069 2071 To: foo
2070 2072
2071 2073 # HG changeset patch
2072 2074 # User test
2073 2075 # Date 5 0
2074 2076 # Node ID 22d0f96be12f5945fd67d101af58f7bc8263c835
2075 2077 # Parent c655633f8c87700bb38cc6a59a2753bdc5a6c376
2076 2078 charset=us-ascii; content-transfer-encoding: 8bit
2077 2079
2078 2080 diff -r c655633f8c87 -r 22d0f96be12f isolatin
2079 2081 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2080 2082 +++ b/isolatin Thu Jan 01 00:00:05 1970 +0000
2081 2083 @@ -0,0 +1,1 @@
2082 2084 +h\xf6mma! (esc)
2083 2085
2084 2086 Displaying [PATCH 5 of 8] Added tag zero, zero.foo for changeset 8580ff50825a ...
2085 2087 Content-Type: text/plain; charset="us-ascii"
2086 2088 MIME-Version: 1.0
2087 2089 Content-Transfer-Encoding: 7bit
2088 2090 Subject: [PATCH 5 of 8] Added tag zero, zero.foo for changeset 8580ff50825a
2089 2091 X-Mercurial-Node: dd9c2b4b8a8a0934d5523c15f2c119b362360903
2090 2092 Message-Id: <dd9c2b4b8a8a0934d552.315532865@* (glob)
2091 2093 In-Reply-To: <patchbomb\.315532860@[^>]*> (re)
2092 2094 References: <patchbomb\.315532860@[^>]*> (re)
2093 2095 User-Agent: Mercurial-patchbomb/* (glob)
2094 2096 Date: Tue, 01 Jan 1980 00:01:05 +0000
2095 2097 From: test
2096 2098 To: foo
2097 2099
2098 2100 # HG changeset patch
2099 2101 # User test
2100 2102 # Date 0 0
2101 2103 # Node ID dd9c2b4b8a8a0934d5523c15f2c119b362360903
2102 2104 # Parent 22d0f96be12f5945fd67d101af58f7bc8263c835
2103 2105 Added tag zero, zero.foo for changeset 8580ff50825a
2104 2106
2105 2107 diff -r 22d0f96be12f -r dd9c2b4b8a8a .hgtags
2106 2108 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2107 2109 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
2108 2110 @@ -0,0 +1,2 @@
2109 2111 +8580ff50825a50c8f716709acdf8de0deddcd6ab zero
2110 2112 +8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
2111 2113
2112 2114 Displaying [PATCH 6 of 8] Added tag one, one.patch for changeset 97d72e5f12c7 ...
2113 2115 Content-Type: text/plain; charset="us-ascii"
2114 2116 MIME-Version: 1.0
2115 2117 Content-Transfer-Encoding: 7bit
2116 2118 Subject: [PATCH 6 of 8] Added tag one, one.patch for changeset 97d72e5f12c7
2117 2119 X-Mercurial-Node: eae5fcf795eee29d0e45ffc9f519a91cd79fc9ff
2118 2120 Message-Id: <eae5fcf795eee29d0e45.315532866@* (glob)
2119 2121 In-Reply-To: <patchbomb\.315532860@[^>]*> (re)
2120 2122 References: <patchbomb\.315532860@[^>]*> (re)
2121 2123 User-Agent: Mercurial-patchbomb/* (glob)
2122 2124 Date: Tue, 01 Jan 1980 00:01:06 +0000
2123 2125 From: test
2124 2126 To: foo
2125 2127
2126 2128 # HG changeset patch
2127 2129 # User test
2128 2130 # Date 0 0
2129 2131 # Node ID eae5fcf795eee29d0e45ffc9f519a91cd79fc9ff
2130 2132 # Parent dd9c2b4b8a8a0934d5523c15f2c119b362360903
2131 2133 Added tag one, one.patch for changeset 97d72e5f12c7
2132 2134
2133 2135 diff -r dd9c2b4b8a8a -r eae5fcf795ee .hgtags
2134 2136 --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000
2135 2137 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
2136 2138 @@ -1,2 +1,4 @@
2137 2139 8580ff50825a50c8f716709acdf8de0deddcd6ab zero
2138 2140 8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
2139 2141 +97d72e5f12c7e84f85064aa72e5a297142c36ed9 one
2140 2142 +97d72e5f12c7e84f85064aa72e5a297142c36ed9 one.patch
2141 2143
2142 2144 Displaying [PATCH 7 of 8] Added tag two, two.diff for changeset ff2c9fa2018b ...
2143 2145 Content-Type: text/plain; charset="us-ascii"
2144 2146 MIME-Version: 1.0
2145 2147 Content-Transfer-Encoding: 7bit
2146 2148 Subject: [PATCH 7 of 8] Added tag two, two.diff for changeset ff2c9fa2018b
2147 2149 X-Mercurial-Node: e317db6a6f288748d1f6cb064f3810fcba66b1b6
2148 2150 Message-Id: <e317db6a6f288748d1f6.315532867@* (glob)
2149 2151 In-Reply-To: <patchbomb\.315532860@[^>]*> (re)
2150 2152 References: <patchbomb\.315532860@[^>]*> (re)
2151 2153 User-Agent: Mercurial-patchbomb/* (glob)
2152 2154 Date: Tue, 01 Jan 1980 00:01:07 +0000
2153 2155 From: test
2154 2156 To: foo
2155 2157
2156 2158 # HG changeset patch
2157 2159 # User test
2158 2160 # Date 0 0
2159 2161 # Node ID e317db6a6f288748d1f6cb064f3810fcba66b1b6
2160 2162 # Parent eae5fcf795eee29d0e45ffc9f519a91cd79fc9ff
2161 2163 Added tag two, two.diff for changeset ff2c9fa2018b
2162 2164
2163 2165 diff -r eae5fcf795ee -r e317db6a6f28 .hgtags
2164 2166 --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000
2165 2167 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
2166 2168 @@ -2,3 +2,5 @@
2167 2169 8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo
2168 2170 97d72e5f12c7e84f85064aa72e5a297142c36ed9 one
2169 2171 97d72e5f12c7e84f85064aa72e5a297142c36ed9 one.patch
2170 2172 +ff2c9fa2018b15fa74b33363bda9527323e2a99f two
2171 2173 +ff2c9fa2018b15fa74b33363bda9527323e2a99f two.diff
2172 2174
2173 2175 Displaying [PATCH 8 of 8] d ...
2174 2176 Content-Type: text/plain; charset="us-ascii"
2175 2177 MIME-Version: 1.0
2176 2178 Content-Transfer-Encoding: 7bit
2177 2179 Subject: [PATCH 8 of 8] d
2178 2180 X-Mercurial-Node: 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
2179 2181 Message-Id: <2f9fa9b998c5fe3ac2bd\.315532868[^>]*> (re)
2180 2182 In-Reply-To: <patchbomb\.315532860@[^>]*> (re)
2181 2183 References: <patchbomb\.315532860@[^>]*> (re)
2182 2184 User-Agent: Mercurial-patchbomb/* (glob)
2183 2185 Date: Tue, 01 Jan 1980 00:01:08 +0000
2184 2186 From: test
2185 2187 To: foo
2186 2188
2187 2189 # HG changeset patch
2188 2190 # User test
2189 2191 # Date 4 0
2190 2192 # Branch test
2191 2193 # Node ID 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
2192 2194 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2193 2195 d
2194 2196
2195 2197 diff -r 97d72e5f12c7 -r 2f9fa9b998c5 d
2196 2198 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2197 2199 +++ b/d Thu Jan 01 00:00:04 1970 +0000
2198 2200 @@ -0,0 +1,1 @@
2199 2201 +d
2200 2202
2201 2203
2202 2204 dest#branch URIs:
2203 2205 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t#test
2204 2206 comparing with ../t
2205 2207 searching for changes
2206 2208 From [test]: test
2207 2209 This patch series consists of 1 patches.
2208 2210
2209 2211 Cc:
2210 2212
2211 2213 Displaying [PATCH] test ...
2212 2214 Content-Type: text/plain; charset="us-ascii"
2213 2215 MIME-Version: 1.0
2214 2216 Content-Transfer-Encoding: 7bit
2215 2217 Subject: [PATCH] test
2216 2218 X-Mercurial-Node: 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
2217 2219 Message-Id: <2f9fa9b998c5fe3ac2bd.315532860@* (glob)
2218 2220 User-Agent: Mercurial-patchbomb/* (glob)
2219 2221 Date: Tue, 01 Jan 1980 00:01:00 +0000
2220 2222 From: test
2221 2223 To: foo
2222 2224
2223 2225 # HG changeset patch
2224 2226 # User test
2225 2227 # Date 4 0
2226 2228 # Branch test
2227 2229 # Node ID 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268
2228 2230 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9
2229 2231 d
2230 2232
2231 2233 diff -r 97d72e5f12c7 -r 2f9fa9b998c5 d
2232 2234 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2233 2235 +++ b/d Thu Jan 01 00:00:04 1970 +0000
2234 2236 @@ -0,0 +1,1 @@
2235 2237 +d
2236 2238
@@ -1,117 +1,119 b''
1 $ "$TESTDIR/hghave" system-sh || exit 80
2
1 3 Verify that pending changesets are seen by pretxn* hooks but not by other
2 4 processes that access the destination repo while the hooks are running.
3 5
4 6 The hooks (python and external) both reject changesets after some think time,
5 7 during which another process runs pull. Each hook creates a file ('notify') to
6 8 indicate to the controlling process that it is running; the process removes the
7 9 file to indicate the hook can terminate.
8 10
9 11 init env vars
10 12
11 13 $ d=`pwd`
12 14 $ maxwait=20
13 15
14 16 utility to run the test - start a push in the background and run pull
15 17
16 18 $ dotest() {
17 19 > rm -f notify
18 20 > printf 'push '; hg -R child-push tip --template '{node}\n'
19 21 > hg -R child-push -q push > push.out 2>&1 &
20 22 >
21 23 > # wait for hook to create the notify file
22 24 > i=$maxwait
23 25 > while [ ! -f notify -a $i != 0 ]; do
24 26 > sleep 1
25 27 > i=`expr $i - 1`
26 28 > done
27 29 >
28 30 > # run pull
29 31 > hg -R child-pull -q pull
30 32 > rc=$?
31 33 >
32 34 > # tell hook to finish; notify should exist.
33 35 > rm notify
34 36 > wait
35 37 >
36 38 > cat push.out
37 39 > printf 'pull '; hg -R child-pull tip --template '{node}\n'
38 40 > return $rc
39 41 > }
40 42
41 43 python hook
42 44
43 45 $ cat <<EOF > reject.py
44 46 > import os, time
45 47 > from mercurial import ui, localrepo
46 48 > def rejecthook(ui, repo, hooktype, node, **opts):
47 49 > ui.write('hook %s\\n' % repo['tip'].hex())
48 50 > # create the notify file so caller knows we're running
49 51 > fpath = os.path.join('$d', 'notify')
50 52 > f = open(fpath, 'w')
51 53 > f.close()
52 54 > # wait for ack - caller should delete the notify file
53 55 > i = $maxwait
54 56 > while os.path.exists(fpath) and i > 0:
55 57 > time.sleep(1)
56 58 > i -= 1
57 59 > return True # reject the changesets
58 60 > EOF
59 61
60 62 external hook
61 63
62 64 $ cat <<EOF > reject.sh
63 65 > #! /bin/sh
64 66 > printf 'hook '; hg tip --template '{node}\\n'
65 67 > # create the notify file so caller knows we're running
66 68 > fpath=$d/notify
67 69 > touch \$fpath
68 70 > # wait for ack - caller should delete the notify file
69 71 > i=$maxwait
70 72 > while [ -f \$fpath -a \$i != 0 ]; do
71 73 > sleep 1
72 74 > i=\`expr \$i - 1\`
73 75 > done
74 76 > exit 1 # reject the changesets
75 77 > EOF
76 78 $ chmod +x reject.sh
77 79
78 80 create repos
79 81
80 82 $ hg init parent
81 83 $ hg clone -q parent child-push
82 84 $ hg clone -q parent child-pull
83 85 $ echo a > child-push/a
84 86 $ hg -R child-push add child-push/a
85 87 $ hg -R child-push commit -m a -d '1000000 0'
86 88
87 89 test python hook
88 90
89 91 $ cat <<EOF > parent/.hg/hgrc
90 92 > [extensions]
91 93 > reject = $d/reject.py
92 94 > [hooks]
93 95 > pretxnchangegroup = python:reject.rejecthook
94 96 > EOF
95 97
96 98 $ dotest
97 99 push 29b62aeb769fdf78d8d9c5f28b017f76d7ef824b
98 100 hook 29b62aeb769fdf78d8d9c5f28b017f76d7ef824b
99 101 transaction abort!
100 102 rollback completed
101 103 abort: pretxnchangegroup hook failed
102 104 pull 0000000000000000000000000000000000000000
103 105
104 106 test external hook
105 107
106 108 $ cat <<EOF > parent/.hg/hgrc
107 109 > [hooks]
108 110 > pretxnchangegroup = $d/reject.sh
109 111 > EOF
110 112
111 113 $ dotest
112 114 push 29b62aeb769fdf78d8d9c5f28b017f76d7ef824b
113 115 hook 29b62aeb769fdf78d8d9c5f28b017f76d7ef824b
114 116 transaction abort!
115 117 rollback completed
116 118 abort: pretxnchangegroup hook exited with status 1
117 119 pull 0000000000000000000000000000000000000000
@@ -1,29 +1,31 b''
1 $ "$TESTDIR/hghave" unix-permissions || exit 80
2
1 3 $ hg init a
2 4 $ cd a
3 5 $ echo foo > b
4 6 $ hg add b
5 7 $ hg ci -m "b"
6 8
7 9 $ chmod -w .hg/store
8 10
9 11 $ cd ..
10 12
11 13 $ hg clone a b
12 14 requesting all changes
13 15 adding changesets
14 16 adding manifests
15 17 adding file changes
16 18 added 1 changesets with 1 changes to 1 files
17 19 updating to branch default
18 20 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 21
20 22 $ chmod +w a/.hg/store # let test clean up
21 23
22 24 $ cd b
23 25 $ hg verify
24 26 checking changesets
25 27 checking manifests
26 28 crosschecking files in changesets and manifests
27 29 checking files
28 30 1 files, 1 changesets, 1 total revisions
29 31
@@ -1,397 +1,397 b''
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 commit/qrefresh
10 10
11 11 use "hg help extensions" for information on enabling extensions
12 12
13 13 help qrecord (no record)
14 14
15 15 $ hg help qrecord
16 16 'qrecord' is provided by the following extension:
17 17
18 18 record commands to interactively select changes for commit/qrefresh
19 19
20 20 use "hg help extensions" for information on enabling extensions
21 21
22 22 $ echo "[extensions]" >> $HGRCPATH
23 23 $ echo "record=" >> $HGRCPATH
24 24
25 25 help record (record)
26 26
27 27 $ hg help record
28 28 hg record [OPTION]... [FILE]...
29 29
30 30 interactively select changes to commit
31 31
32 32 If a list of files is omitted, all changes reported by "hg status" will be
33 33 candidates for recording.
34 34
35 35 See "hg help dates" for a list of formats valid for -d/--date.
36 36
37 37 You will be prompted for whether to record changes to each modified file,
38 38 and for files with multiple changes, for each change to use. For each
39 39 query, the following responses are possible:
40 40
41 41 y - record this change
42 42 n - skip this change
43 43
44 44 s - skip remaining changes to this file
45 45 f - record remaining changes to this file
46 46
47 47 d - done, skip remaining changes and files
48 48 a - record all changes to all remaining files
49 49 q - quit, recording no changes
50 50
51 51 ? - display help
52 52
53 53 This command is not available when committing a merge.
54 54
55 55 options:
56 56
57 57 -A --addremove mark new/missing files as added/removed before
58 58 committing
59 59 --close-branch mark a branch as closed, hiding it from the branch
60 60 list
61 61 -I --include PATTERN [+] include names matching the given patterns
62 62 -X --exclude PATTERN [+] exclude names matching the given patterns
63 63 -m --message TEXT use text as commit message
64 64 -l --logfile FILE read commit message from file
65 65 -d --date DATE record the specified date as commit date
66 66 -u --user USER record the specified user as committer
67 67 -S --subrepos recurse into subrepositories
68 68 -w --ignore-all-space ignore white space when comparing lines
69 69 -b --ignore-space-change ignore changes in the amount of white space
70 70 -B --ignore-blank-lines ignore changes whose lines are all blank
71 71
72 72 [+] marked option can be specified multiple times
73 73
74 74 use "hg -v help record" to show more info
75 75
76 76 help (no mq, so no qrecord)
77 77
78 78 $ hg help qrecord
79 79 hg qrecord [OPTION]... PATCH [FILE]...
80 80
81 81 interactively record a new patch
82 82
83 83 See "hg help qnew" & "hg help record" for more information and usage.
84 84
85 85 use "hg -v help qrecord" to show more info
86 86
87 87 $ hg init a
88 88
89 89 qrecord (mq not present)
90 90
91 91 $ hg -R a qrecord
92 92 hg qrecord: invalid arguments
93 93 hg qrecord [OPTION]... PATCH [FILE]...
94 94
95 95 interactively record a new patch
96 96
97 97 use "hg help qrecord" to show the full help text
98 98 [255]
99 99
100 100 qrecord patch (mq not present)
101 101
102 102 $ hg -R a qrecord patch
103 103 abort: 'mq' extension not loaded
104 104 [255]
105 105
106 106 help (bad mq)
107 107
108 108 $ echo "mq=nonexistant" >> $HGRCPATH
109 109 $ hg help qrecord
110 *** failed to import extension mq from nonexistant: [Errno 2] No such file or directory
110 *** failed to import extension mq from nonexistant: [Errno 2] * (glob)
111 111 hg qrecord [OPTION]... PATCH [FILE]...
112 112
113 113 interactively record a new patch
114 114
115 115 See "hg help qnew" & "hg help record" for more information and usage.
116 116
117 117 use "hg -v help qrecord" to show more info
118 118
119 119 help (mq present)
120 120
121 121 $ sed 's/mq=nonexistant/mq=/' $HGRCPATH > hgrc.tmp
122 122 $ mv hgrc.tmp $HGRCPATH
123 123
124 124 $ hg help qrecord
125 125 hg qrecord [OPTION]... PATCH [FILE]...
126 126
127 127 interactively record a new patch
128 128
129 129 See "hg help qnew" & "hg help record" for more information and usage.
130 130
131 131 options:
132 132
133 133 -e --edit edit commit message
134 134 -g --git use git extended diff format
135 135 -U --currentuser add "From: <current user>" to patch
136 136 -u --user USER add "From: <USER>" to patch
137 137 -D --currentdate add "Date: <current date>" to patch
138 138 -d --date DATE add "Date: <DATE>" to patch
139 139 -I --include PATTERN [+] include names matching the given patterns
140 140 -X --exclude PATTERN [+] exclude names matching the given patterns
141 141 -m --message TEXT use text as commit message
142 142 -l --logfile FILE read commit message from file
143 143 -w --ignore-all-space ignore white space when comparing lines
144 144 -b --ignore-space-change ignore changes in the amount of white space
145 145 -B --ignore-blank-lines ignore changes whose lines are all blank
146 146 --mq operate on patch repository
147 147
148 148 [+] marked option can be specified multiple times
149 149
150 150 use "hg -v help qrecord" to show more info
151 151
152 152 $ cd a
153 153
154 154 Base commit
155 155
156 156 $ cat > 1.txt <<EOF
157 157 > 1
158 158 > 2
159 159 > 3
160 160 > 4
161 161 > 5
162 162 > EOF
163 163 $ cat > 2.txt <<EOF
164 164 > a
165 165 > b
166 166 > c
167 167 > d
168 168 > e
169 169 > f
170 170 > EOF
171 171
172 172 $ mkdir dir
173 173 $ cat > dir/a.txt <<EOF
174 174 > hello world
175 175 >
176 176 > someone
177 177 > up
178 178 > there
179 179 > loves
180 180 > me
181 181 > EOF
182 182
183 183 $ hg add 1.txt 2.txt dir/a.txt
184 184 $ hg commit -m 'initial checkin'
185 185
186 186 Changing files
187 187
188 188 $ sed -e 's/2/2 2/;s/4/4 4/' 1.txt > 1.txt.new
189 189 $ sed -e 's/b/b b/' 2.txt > 2.txt.new
190 190 $ sed -e 's/hello world/hello world!/' dir/a.txt > dir/a.txt.new
191 191
192 192 $ mv -f 1.txt.new 1.txt
193 193 $ mv -f 2.txt.new 2.txt
194 194 $ mv -f dir/a.txt.new dir/a.txt
195 195
196 196 Whole diff
197 197
198 198 $ hg diff --nodates
199 199 diff -r 1057167b20ef 1.txt
200 200 --- a/1.txt
201 201 +++ b/1.txt
202 202 @@ -1,5 +1,5 @@
203 203 1
204 204 -2
205 205 +2 2
206 206 3
207 207 -4
208 208 +4 4
209 209 5
210 210 diff -r 1057167b20ef 2.txt
211 211 --- a/2.txt
212 212 +++ b/2.txt
213 213 @@ -1,5 +1,5 @@
214 214 a
215 215 -b
216 216 +b b
217 217 c
218 218 d
219 219 e
220 220 diff -r 1057167b20ef dir/a.txt
221 221 --- a/dir/a.txt
222 222 +++ b/dir/a.txt
223 223 @@ -1,4 +1,4 @@
224 224 -hello world
225 225 +hello world!
226 226
227 227 someone
228 228 up
229 229
230 230 qrecord with bad patch name, should abort before prompting
231 231
232 232 $ hg qrecord .hg
233 233 abort: patch name cannot begin with ".hg"
234 234 [255]
235 235
236 236 qrecord a.patch
237 237
238 238 $ hg qrecord -d '0 0' -m aaa a.patch <<EOF
239 239 > y
240 240 > y
241 241 > n
242 242 > y
243 243 > y
244 244 > n
245 245 > EOF
246 246 diff --git a/1.txt b/1.txt
247 247 2 hunks, 2 lines changed
248 248 examine changes to '1.txt'? [Ynsfdaq?]
249 249 @@ -1,3 +1,3 @@
250 250 1
251 251 -2
252 252 +2 2
253 253 3
254 254 record change 1/4 to '1.txt'? [Ynsfdaq?]
255 255 @@ -3,3 +3,3 @@
256 256 3
257 257 -4
258 258 +4 4
259 259 5
260 260 record change 2/4 to '1.txt'? [Ynsfdaq?]
261 261 diff --git a/2.txt b/2.txt
262 262 1 hunks, 1 lines changed
263 263 examine changes to '2.txt'? [Ynsfdaq?]
264 264 @@ -1,5 +1,5 @@
265 265 a
266 266 -b
267 267 +b b
268 268 c
269 269 d
270 270 e
271 271 record change 3/4 to '2.txt'? [Ynsfdaq?]
272 272 diff --git a/dir/a.txt b/dir/a.txt
273 273 1 hunks, 1 lines changed
274 274 examine changes to 'dir/a.txt'? [Ynsfdaq?]
275 275
276 276 After qrecord a.patch 'tip'"
277 277
278 278 $ hg tip -p
279 279 changeset: 1:5d1ca63427ee
280 280 tag: a.patch
281 281 tag: qbase
282 282 tag: qtip
283 283 tag: tip
284 284 user: test
285 285 date: Thu Jan 01 00:00:00 1970 +0000
286 286 summary: aaa
287 287
288 288 diff -r 1057167b20ef -r 5d1ca63427ee 1.txt
289 289 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
290 290 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
291 291 @@ -1,5 +1,5 @@
292 292 1
293 293 -2
294 294 +2 2
295 295 3
296 296 4
297 297 5
298 298 diff -r 1057167b20ef -r 5d1ca63427ee 2.txt
299 299 --- a/2.txt Thu Jan 01 00:00:00 1970 +0000
300 300 +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000
301 301 @@ -1,5 +1,5 @@
302 302 a
303 303 -b
304 304 +b b
305 305 c
306 306 d
307 307 e
308 308
309 309
310 310 After qrecord a.patch 'diff'"
311 311
312 312 $ hg diff --nodates
313 313 diff -r 5d1ca63427ee 1.txt
314 314 --- a/1.txt
315 315 +++ b/1.txt
316 316 @@ -1,5 +1,5 @@
317 317 1
318 318 2 2
319 319 3
320 320 -4
321 321 +4 4
322 322 5
323 323 diff -r 5d1ca63427ee dir/a.txt
324 324 --- a/dir/a.txt
325 325 +++ b/dir/a.txt
326 326 @@ -1,4 +1,4 @@
327 327 -hello world
328 328 +hello world!
329 329
330 330 someone
331 331 up
332 332
333 333 qrecord b.patch
334 334
335 335 $ hg qrecord -d '0 0' -m bbb b.patch <<EOF
336 336 > y
337 337 > y
338 338 > y
339 339 > y
340 340 > EOF
341 341 diff --git a/1.txt b/1.txt
342 342 1 hunks, 1 lines changed
343 343 examine changes to '1.txt'? [Ynsfdaq?]
344 344 @@ -1,5 +1,5 @@
345 345 1
346 346 2 2
347 347 3
348 348 -4
349 349 +4 4
350 350 5
351 351 record change 1/2 to '1.txt'? [Ynsfdaq?]
352 352 diff --git a/dir/a.txt b/dir/a.txt
353 353 1 hunks, 1 lines changed
354 354 examine changes to 'dir/a.txt'? [Ynsfdaq?]
355 355 @@ -1,4 +1,4 @@
356 356 -hello world
357 357 +hello world!
358 358
359 359 someone
360 360 up
361 361 record change 2/2 to 'dir/a.txt'? [Ynsfdaq?]
362 362
363 363 After qrecord b.patch 'tip'
364 364
365 365 $ hg tip -p
366 366 changeset: 2:b056198bf878
367 367 tag: b.patch
368 368 tag: qtip
369 369 tag: tip
370 370 user: test
371 371 date: Thu Jan 01 00:00:00 1970 +0000
372 372 summary: bbb
373 373
374 374 diff -r 5d1ca63427ee -r b056198bf878 1.txt
375 375 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
376 376 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
377 377 @@ -1,5 +1,5 @@
378 378 1
379 379 2 2
380 380 3
381 381 -4
382 382 +4 4
383 383 5
384 384 diff -r 5d1ca63427ee -r b056198bf878 dir/a.txt
385 385 --- a/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
386 386 +++ b/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
387 387 @@ -1,4 +1,4 @@
388 388 -hello world
389 389 +hello world!
390 390
391 391 someone
392 392 up
393 393
394 394
395 395 After qrecord b.patch 'diff'
396 396
397 397 $ hg diff --nodates
@@ -1,395 +1,395 b''
1 1 $ cat >> $HGRCPATH <<EOF
2 2 > [extensions]
3 3 > graphlog=
4 4 > rebase=
5 5 >
6 6 > [alias]
7 7 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
8 8 > EOF
9 9
10 10
11 11 $ hg init a
12 12 $ cd a
13 13 $ hg unbundle $TESTDIR/bundles/rebase.hg
14 14 adding changesets
15 15 adding manifests
16 16 adding file changes
17 17 added 8 changesets with 7 changes to 7 files (+2 heads)
18 18 (run 'hg heads' to see heads, 'hg merge' to merge)
19 19 $ hg up tip
20 20 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
21 21
22 22 $ cd ..
23 23
24 24
25 25 Rebasing D onto H detaching from C:
26 26
27 27 $ hg clone -q -u . a a1
28 28 $ cd a1
29 29
30 30 $ hg tglog
31 31 @ 7: 'H'
32 32 |
33 33 | o 6: 'G'
34 34 |/|
35 35 o | 5: 'F'
36 36 | |
37 37 | o 4: 'E'
38 38 |/
39 39 | o 3: 'D'
40 40 | |
41 41 | o 2: 'C'
42 42 | |
43 43 | o 1: 'B'
44 44 |/
45 45 o 0: 'A'
46 46
47 47 $ hg rebase --detach -s 3 -d 7
48 48 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
49 49
50 50 $ hg tglog
51 51 @ 7: 'D'
52 52 |
53 53 o 6: 'H'
54 54 |
55 55 | o 5: 'G'
56 56 |/|
57 57 o | 4: 'F'
58 58 | |
59 59 | o 3: 'E'
60 60 |/
61 61 | o 2: 'C'
62 62 | |
63 63 | o 1: 'B'
64 64 |/
65 65 o 0: 'A'
66 66
67 67 $ hg manifest
68 68 A
69 69 D
70 70 F
71 71 H
72 72
73 73 $ cd ..
74 74
75 75
76 76 Rebasing C onto H detaching from B:
77 77
78 78 $ hg clone -q -u . a a2
79 79 $ cd a2
80 80
81 81 $ hg tglog
82 82 @ 7: 'H'
83 83 |
84 84 | o 6: 'G'
85 85 |/|
86 86 o | 5: 'F'
87 87 | |
88 88 | o 4: 'E'
89 89 |/
90 90 | o 3: 'D'
91 91 | |
92 92 | o 2: 'C'
93 93 | |
94 94 | o 1: 'B'
95 95 |/
96 96 o 0: 'A'
97 97
98 98 $ hg rebase --detach -s 2 -d 7
99 99 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
100 100
101 101 $ hg tglog
102 102 @ 7: 'D'
103 103 |
104 104 o 6: 'C'
105 105 |
106 106 o 5: 'H'
107 107 |
108 108 | o 4: 'G'
109 109 |/|
110 110 o | 3: 'F'
111 111 | |
112 112 | o 2: 'E'
113 113 |/
114 114 | o 1: 'B'
115 115 |/
116 116 o 0: 'A'
117 117
118 118 $ hg manifest
119 119 A
120 120 C
121 121 D
122 122 F
123 123 H
124 124
125 125 $ cd ..
126 126
127 127
128 128 Rebasing B onto H using detach (same as not using it):
129 129
130 130 $ hg clone -q -u . a a3
131 131 $ cd a3
132 132
133 133 $ hg tglog
134 134 @ 7: 'H'
135 135 |
136 136 | o 6: 'G'
137 137 |/|
138 138 o | 5: 'F'
139 139 | |
140 140 | o 4: 'E'
141 141 |/
142 142 | o 3: 'D'
143 143 | |
144 144 | o 2: 'C'
145 145 | |
146 146 | o 1: 'B'
147 147 |/
148 148 o 0: 'A'
149 149
150 150 $ hg rebase --detach -s 1 -d 7
151 151 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
152 152
153 153 $ hg tglog
154 154 @ 7: 'D'
155 155 |
156 156 o 6: 'C'
157 157 |
158 158 o 5: 'B'
159 159 |
160 160 o 4: 'H'
161 161 |
162 162 | o 3: 'G'
163 163 |/|
164 164 o | 2: 'F'
165 165 | |
166 166 | o 1: 'E'
167 167 |/
168 168 o 0: 'A'
169 169
170 170 $ hg manifest
171 171 A
172 172 B
173 173 C
174 174 D
175 175 F
176 176 H
177 177
178 178 $ cd ..
179 179
180 180
181 181 Rebasing C onto H detaching from B and collapsing:
182 182
183 183 $ hg clone -q -u . a a4
184 184 $ cd a4
185 185
186 186 $ hg tglog
187 187 @ 7: 'H'
188 188 |
189 189 | o 6: 'G'
190 190 |/|
191 191 o | 5: 'F'
192 192 | |
193 193 | o 4: 'E'
194 194 |/
195 195 | o 3: 'D'
196 196 | |
197 197 | o 2: 'C'
198 198 | |
199 199 | o 1: 'B'
200 200 |/
201 201 o 0: 'A'
202 202
203 203 $ hg rebase --detach --collapse -s 2 -d 7
204 204 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
205 205
206 206 $ hg tglog
207 207 @ 6: 'Collapsed revision
208 208 | * C
209 209 | * D'
210 210 o 5: 'H'
211 211 |
212 212 | o 4: 'G'
213 213 |/|
214 214 o | 3: 'F'
215 215 | |
216 216 | o 2: 'E'
217 217 |/
218 218 | o 1: 'B'
219 219 |/
220 220 o 0: 'A'
221 221
222 222 $ hg manifest
223 223 A
224 224 C
225 225 D
226 226 F
227 227 H
228 228
229 229 $ cd ..
230 230
231 231 Rebasing across null as ancestor
232 232 $ hg clone -q -U a a5
233 233
234 234 $ cd a5
235 235
236 236 $ echo x > x
237 237
238 238 $ hg add x
239 239
240 240 $ hg ci -m "extra branch"
241 241 created new head
242 242
243 243 $ hg tglog
244 244 @ 8: 'extra branch'
245 245
246 246 o 7: 'H'
247 247 |
248 248 | o 6: 'G'
249 249 |/|
250 250 o | 5: 'F'
251 251 | |
252 252 | o 4: 'E'
253 253 |/
254 254 | o 3: 'D'
255 255 | |
256 256 | o 2: 'C'
257 257 | |
258 258 | o 1: 'B'
259 259 |/
260 260 o 0: 'A'
261 261
262 262 $ hg rebase --detach -s 1 -d tip
263 263 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
264 264
265 265 $ hg tglog
266 266 @ 8: 'D'
267 267 |
268 268 o 7: 'C'
269 269 |
270 270 o 6: 'B'
271 271 |
272 272 o 5: 'extra branch'
273 273
274 274 o 4: 'H'
275 275 |
276 276 | o 3: 'G'
277 277 |/|
278 278 o | 2: 'F'
279 279 | |
280 280 | o 1: 'E'
281 281 |/
282 282 o 0: 'A'
283 283
284 284
285 285 $ hg rebase -d 5 -s 7
286 286 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/13547172c9c0-backup.hg (glob)
287 287 $ hg tglog
288 288 @ 8: 'D'
289 289 |
290 290 o 7: 'C'
291 291 |
292 292 | o 6: 'B'
293 293 |/
294 294 o 5: 'extra branch'
295 295
296 296 o 4: 'H'
297 297 |
298 298 | o 3: 'G'
299 299 |/|
300 300 o | 2: 'F'
301 301 | |
302 302 | o 1: 'E'
303 303 |/
304 304 o 0: 'A'
305 305
306 306 $ cd ..
307 307
308 308 Verify that target is not selected as external rev (issue3085)
309 309
310 310 $ hg clone -q -U a a6
311 311 $ cd a6
312 312 $ hg up -q 6
313 313
314 314 $ echo "I" >> E
315 315 $ hg ci -m "I"
316 316 $ hg merge 7
317 317 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
318 318 (branch merge, don't forget to commit)
319 319 $ hg ci -m "Merge"
320 320 $ echo "J" >> F
321 321 $ hg ci -m "J"
322 322
323 323 $ hg rebase -s 8 -d 7 --collapse --detach --config ui.merge=internal:other
324 324 remote changed E which local deleted
325 325 use (c)hanged version or leave (d)eleted? c
326 326 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob)
327 327
328 328 $ hg tglog
329 329 @ 8: 'Collapsed revision
330 330 | * I
331 331 | * Merge
332 332 | * J'
333 333 o 7: 'H'
334 334 |
335 335 | o 6: 'G'
336 336 |/|
337 337 o | 5: 'F'
338 338 | |
339 339 | o 4: 'E'
340 340 |/
341 341 | o 3: 'D'
342 342 | |
343 343 | o 2: 'C'
344 344 | |
345 345 | o 1: 'B'
346 346 |/
347 347 o 0: 'A'
348 348
349 349
350 350 $ hg parents
351 351 changeset: 8:9472f4b1d736
352 352 tag: tip
353 353 user: test
354 354 date: Thu Jan 01 00:00:00 1970 +0000
355 355 summary: Collapsed revision
356 356
357 357
358 358 $ cd ..
359 359
360 360 Ensure --continue restores a correct state (issue3046):
361 361 $ hg clone -q a a7
362 362 $ cd a7
363 363 $ hg up -q 3
364 364 $ echo 'H2' > H
365 365 $ hg ci -A -m 'H2'
366 366 adding H
367 367 $ hg rebase -s 8 -d 7 --detach --config ui.merge=internal:fail
368 368 merging H
369 369 warning: conflicts during merge.
370 370 merging H incomplete! (edit conflicts, then use 'hg resolve --mark')
371 371 abort: unresolved conflicts (see hg resolve, then hg rebase --continue)
372 372 [255]
373 373 $ hg resolve --all -t internal:local
374 374 $ hg rebase -c
375 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/6215fafa5447-backup.hg
375 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/6215fafa5447-backup.hg (glob)
376 376 $ hg tglog
377 377 @ 8: 'H2'
378 378 |
379 379 o 7: 'H'
380 380 |
381 381 | o 6: 'G'
382 382 |/|
383 383 o | 5: 'F'
384 384 | |
385 385 | o 4: 'E'
386 386 |/
387 387 | o 3: 'D'
388 388 | |
389 389 | o 2: 'C'
390 390 | |
391 391 | o 1: 'B'
392 392 |/
393 393 o 0: 'A'
394 394
395 395
@@ -1,276 +1,276 b''
1 1 $ "$TESTDIR/hghave" execbit || exit 80
2 2
3 3 $ hg init repo
4 4 $ cd repo
5 5 $ echo 123 > a
6 6 $ echo 123 > c
7 7 $ echo 123 > e
8 8 $ hg add a c e
9 9 $ hg commit -m "first" a c e
10 10
11 11 nothing changed
12 12
13 13 $ hg revert
14 14 abort: no files or directories specified
15 15 (use --all to revert all files)
16 16 [255]
17 17 $ hg revert --all
18 18
19 19 $ echo 123 > b
20 20
21 21 should show b unknown
22 22
23 23 $ hg status
24 24 ? b
25 25 $ echo 12 > c
26 26
27 27 should show b unknown and c modified
28 28
29 29 $ hg status
30 30 M c
31 31 ? b
32 32 $ hg add b
33 33
34 34 should show b added and c modified
35 35
36 36 $ hg status
37 37 M c
38 38 A b
39 39 $ hg rm a
40 40
41 41 should show a removed, b added and c modified
42 42
43 43 $ hg status
44 44 M c
45 45 A b
46 46 R a
47 47 $ hg revert a
48 48
49 49 should show b added, copy saved, and c modified
50 50
51 51 $ hg status
52 52 M c
53 53 A b
54 54 $ hg revert b
55 55
56 56 should show b unknown, and c modified
57 57
58 58 $ hg status
59 59 M c
60 60 ? b
61 61 $ hg revert --no-backup c
62 62
63 63 should show unknown: b
64 64
65 65 $ hg status
66 66 ? b
67 67 $ hg add b
68 68
69 69 should show b added
70 70
71 71 $ hg status b
72 72 A b
73 73 $ rm b
74 74
75 75 should show b deleted
76 76
77 77 $ hg status b
78 78 ! b
79 79 $ hg revert -v b
80 80 forgetting b
81 81
82 82 should not find b
83 83
84 84 $ hg status b
85 b: No such file or directory
85 b: * (glob)
86 86
87 87 should show a c e
88 88
89 89 $ ls
90 90 a
91 91 c
92 92 e
93 93
94 94 should verbosely save backup to e.orig
95 95
96 96 $ echo z > e
97 97 $ hg revert --all -v
98 98 saving current version of e as e.orig
99 99 reverting e
100 100
101 101 should say no changes needed
102 102
103 103 $ hg revert a
104 104 no changes needed to a
105 105
106 106 should say file not managed
107 107
108 108 $ echo q > q
109 109 $ hg revert q
110 110 file not managed: q
111 111 $ rm q
112 112
113 113 should say file not found
114 114
115 115 $ hg revert notfound
116 116 notfound: no such file in rev 334a9e57682c
117 117 $ touch d
118 118 $ hg add d
119 119 $ hg rm a
120 120 $ hg commit -m "second"
121 121 $ echo z > z
122 122 $ hg add z
123 123 $ hg st
124 124 A z
125 125 ? e.orig
126 126
127 127 should add a, remove d, forget z
128 128
129 129 $ hg revert --all -r0
130 130 adding a
131 131 removing d
132 132 forgetting z
133 133
134 134 should forget a, undelete d
135 135
136 136 $ hg revert --all -rtip
137 137 forgetting a
138 138 undeleting d
139 139 $ rm a *.orig
140 140
141 141 should silently add a
142 142
143 143 $ hg revert -r0 a
144 144 $ hg st a
145 145 A a
146 146 $ hg rm d
147 147 $ hg st d
148 148 R d
149 149
150 150 should silently keep d removed
151 151
152 152 $ hg revert -r0 d
153 153 $ hg st d
154 154 R d
155 155
156 156 $ hg update -C
157 157 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 158 $ chmod +x c
159 159 $ hg revert --all
160 160 reverting c
161 161
162 162 should print non-executable
163 163
164 164 $ test -x c || echo non-executable
165 165 non-executable
166 166
167 167 $ chmod +x c
168 168 $ hg commit -m exe
169 169
170 170 $ chmod -x c
171 171 $ hg revert --all
172 172 reverting c
173 173
174 174 should print executable
175 175
176 176 $ test -x c && echo executable
177 177 executable
178 178
179 179 $ cd ..
180 180
181 181
182 182 Issue241: update and revert produces inconsistent repositories
183 183
184 184 $ hg init a
185 185 $ cd a
186 186 $ echo a >> a
187 187 $ hg commit -A -d '1 0' -m a
188 188 adding a
189 189 $ echo a >> a
190 190 $ hg commit -d '2 0' -m a
191 191 $ hg update 0
192 192 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 193 $ mkdir b
194 194 $ echo b > b/b
195 195
196 196 should fail - no arguments
197 197
198 198 $ hg revert -rtip
199 199 abort: no files or directories specified
200 200 (use --all to revert all files, or 'hg update 1' to update)
201 201 [255]
202 202
203 203 should succeed
204 204
205 205 $ hg revert --all -rtip
206 206 reverting a
207 207
208 208
209 209 Issue332: confusing message when reverting directory
210 210
211 211 $ hg ci -A -m b
212 212 adding b/b
213 213 created new head
214 214 $ echo foobar > b/b
215 215 $ mkdir newdir
216 216 $ echo foo > newdir/newfile
217 217 $ hg add newdir/newfile
218 218 $ hg revert b newdir
219 219 reverting b/b (glob)
220 220 forgetting newdir/newfile (glob)
221 221 $ echo foobar > b/b
222 222 $ hg revert .
223 223 reverting b/b (glob)
224 224
225 225
226 226 reverting a rename target should revert the source
227 227
228 228 $ hg mv a newa
229 229 $ hg revert newa
230 230 $ hg st a newa
231 231 ? newa
232 232
233 233 $ cd ..
234 234
235 235 $ hg init ignored
236 236 $ cd ignored
237 237 $ echo '^ignored$' > .hgignore
238 238 $ echo '^ignoreddir$' >> .hgignore
239 239 $ echo '^removed$' >> .hgignore
240 240
241 241 $ mkdir ignoreddir
242 242 $ touch ignoreddir/file
243 243 $ touch ignoreddir/removed
244 244 $ touch ignored
245 245 $ touch removed
246 246
247 247 4 ignored files (we will add/commit everything)
248 248
249 249 $ hg st -A -X .hgignore
250 250 I ignored
251 251 I ignoreddir/file
252 252 I ignoreddir/removed
253 253 I removed
254 254 $ hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed
255 255
256 256 $ echo >> ignored
257 257 $ echo >> ignoreddir/file
258 258 $ hg rm removed ignoreddir/removed
259 259
260 260 should revert ignored* and undelete *removed
261 261
262 262 $ hg revert -a --no-backup
263 263 reverting ignored
264 264 reverting ignoreddir/file (glob)
265 265 undeleting ignoreddir/removed (glob)
266 266 undeleting removed
267 267 $ hg st -mardi
268 268
269 269 $ hg up -qC
270 270 $ echo >> ignored
271 271 $ hg rm removed
272 272
273 273 should silently revert the named files
274 274
275 275 $ hg revert --no-backup ignored removed
276 276 $ hg st -mardi
@@ -1,296 +1,296 b''
1 1 $ echo "[extensions]" >> $HGRCPATH
2 2 $ echo "color=" >> $HGRCPATH
3 3 $ echo "[color]" >> $HGRCPATH
4 4 $ echo "mode=ansi" >> $HGRCPATH
5 5 Terminfo codes compatibility fix
6 6 $ echo "color.none=0" >> $HGRCPATH
7 7
8 8 $ hg init repo1
9 9 $ cd repo1
10 10 $ mkdir a b a/1 b/1 b/2
11 11 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
12 12
13 13 hg status in repo root:
14 14
15 15 $ hg status --color=always
16 16 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
17 17 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
18 18 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
19 19 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
20 20 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
21 21 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
22 22
23 23 hg status . in repo root:
24 24
25 25 $ hg status --color=always .
26 26 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
27 27 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
28 28 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
29 29 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
30 30 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
31 31 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
32 32
33 33 $ hg status --color=always --cwd a
34 34 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
35 35 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
36 36 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
37 37 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
38 38 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
39 39 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
40 40 $ hg status --color=always --cwd a .
41 41 \x1b[0;35;1;4m? 1/in_a_1\x1b[0m (esc)
42 42 \x1b[0;35;1;4m? in_a\x1b[0m (esc)
43 43 $ hg status --color=always --cwd a ..
44 44 \x1b[0;35;1;4m? 1/in_a_1\x1b[0m (esc)
45 45 \x1b[0;35;1;4m? in_a\x1b[0m (esc)
46 46 \x1b[0;35;1;4m? ../b/1/in_b_1\x1b[0m (esc)
47 47 \x1b[0;35;1;4m? ../b/2/in_b_2\x1b[0m (esc)
48 48 \x1b[0;35;1;4m? ../b/in_b\x1b[0m (esc)
49 49 \x1b[0;35;1;4m? ../in_root\x1b[0m (esc)
50 50
51 51 $ hg status --color=always --cwd b
52 52 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
53 53 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
54 54 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
55 55 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
56 56 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
57 57 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
58 58 $ hg status --color=always --cwd b .
59 59 \x1b[0;35;1;4m? 1/in_b_1\x1b[0m (esc)
60 60 \x1b[0;35;1;4m? 2/in_b_2\x1b[0m (esc)
61 61 \x1b[0;35;1;4m? in_b\x1b[0m (esc)
62 62 $ hg status --color=always --cwd b ..
63 63 \x1b[0;35;1;4m? ../a/1/in_a_1\x1b[0m (esc)
64 64 \x1b[0;35;1;4m? ../a/in_a\x1b[0m (esc)
65 65 \x1b[0;35;1;4m? 1/in_b_1\x1b[0m (esc)
66 66 \x1b[0;35;1;4m? 2/in_b_2\x1b[0m (esc)
67 67 \x1b[0;35;1;4m? in_b\x1b[0m (esc)
68 68 \x1b[0;35;1;4m? ../in_root\x1b[0m (esc)
69 69
70 70 $ hg status --color=always --cwd a/1
71 71 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
72 72 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
73 73 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
74 74 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
75 75 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
76 76 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
77 77 $ hg status --color=always --cwd a/1 .
78 78 \x1b[0;35;1;4m? in_a_1\x1b[0m (esc)
79 79 $ hg status --color=always --cwd a/1 ..
80 80 \x1b[0;35;1;4m? in_a_1\x1b[0m (esc)
81 81 \x1b[0;35;1;4m? ../in_a\x1b[0m (esc)
82 82
83 83 $ hg status --color=always --cwd b/1
84 84 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
85 85 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
86 86 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
87 87 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
88 88 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
89 89 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
90 90 $ hg status --color=always --cwd b/1 .
91 91 \x1b[0;35;1;4m? in_b_1\x1b[0m (esc)
92 92 $ hg status --color=always --cwd b/1 ..
93 93 \x1b[0;35;1;4m? in_b_1\x1b[0m (esc)
94 94 \x1b[0;35;1;4m? ../2/in_b_2\x1b[0m (esc)
95 95 \x1b[0;35;1;4m? ../in_b\x1b[0m (esc)
96 96
97 97 $ hg status --color=always --cwd b/2
98 98 \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
99 99 \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
100 100 \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
101 101 \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
102 102 \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
103 103 \x1b[0;35;1;4m? in_root\x1b[0m (esc)
104 104 $ hg status --color=always --cwd b/2 .
105 105 \x1b[0;35;1;4m? in_b_2\x1b[0m (esc)
106 106 $ hg status --color=always --cwd b/2 ..
107 107 \x1b[0;35;1;4m? ../1/in_b_1\x1b[0m (esc)
108 108 \x1b[0;35;1;4m? in_b_2\x1b[0m (esc)
109 109 \x1b[0;35;1;4m? ../in_b\x1b[0m (esc)
110 110 $ cd ..
111 111
112 112 $ hg init repo2
113 113 $ cd repo2
114 114 $ touch modified removed deleted ignored
115 115 $ echo "^ignored$" > .hgignore
116 116 $ hg ci -A -m 'initial checkin'
117 117 adding .hgignore
118 118 adding deleted
119 119 adding modified
120 120 adding removed
121 121 $ touch modified added unknown ignored
122 122 $ hg add added
123 123 $ hg remove removed
124 124 $ rm deleted
125 125
126 126 hg status:
127 127
128 128 $ hg status --color=always
129 129 \x1b[0;32;1mA added\x1b[0m (esc)
130 130 \x1b[0;31;1mR removed\x1b[0m (esc)
131 131 \x1b[0;36;1;4m! deleted\x1b[0m (esc)
132 132 \x1b[0;35;1;4m? unknown\x1b[0m (esc)
133 133
134 134 hg status modified added removed deleted unknown never-existed ignored:
135 135
136 136 $ hg status --color=always modified added removed deleted unknown never-existed ignored
137 never-existed: No such file or directory
137 never-existed: * (glob)
138 138 \x1b[0;32;1mA added\x1b[0m (esc)
139 139 \x1b[0;31;1mR removed\x1b[0m (esc)
140 140 \x1b[0;36;1;4m! deleted\x1b[0m (esc)
141 141 \x1b[0;35;1;4m? unknown\x1b[0m (esc)
142 142
143 143 $ hg copy modified copied
144 144
145 145 hg status -C:
146 146
147 147 $ hg status --color=always -C
148 148 \x1b[0;32;1mA added\x1b[0m (esc)
149 149 \x1b[0;32;1mA copied\x1b[0m (esc)
150 150 \x1b[0;0m modified\x1b[0m (esc)
151 151 \x1b[0;31;1mR removed\x1b[0m (esc)
152 152 \x1b[0;36;1;4m! deleted\x1b[0m (esc)
153 153 \x1b[0;35;1;4m? unknown\x1b[0m (esc)
154 154
155 155 hg status -A:
156 156
157 157 $ hg status --color=always -A
158 158 \x1b[0;32;1mA added\x1b[0m (esc)
159 159 \x1b[0;32;1mA copied\x1b[0m (esc)
160 160 \x1b[0;0m modified\x1b[0m (esc)
161 161 \x1b[0;31;1mR removed\x1b[0m (esc)
162 162 \x1b[0;36;1;4m! deleted\x1b[0m (esc)
163 163 \x1b[0;35;1;4m? unknown\x1b[0m (esc)
164 164 \x1b[0;30;1mI ignored\x1b[0m (esc)
165 165 \x1b[0;0mC .hgignore\x1b[0m (esc)
166 166 \x1b[0;0mC modified\x1b[0m (esc)
167 167
168 168 hg status -A (with terminfo color):
169 169
170 170 $ mkdir $TESTTMP/terminfo
171 171 $ TERMINFO=$TESTTMP/terminfo tic $TESTDIR/hgterm.ti
172 172 $ TERM=hgterm TERMINFO=$TESTTMP/terminfo hg status --config color.mode=terminfo --color=always -A
173 173 \x1b[30m\x1b[32m\x1b[1mA added\x1b[30m (esc)
174 174 \x1b[30m\x1b[32m\x1b[1mA copied\x1b[30m (esc)
175 175 \x1b[30m\x1b[30m modified\x1b[30m (esc)
176 176 \x1b[30m\x1b[31m\x1b[1mR removed\x1b[30m (esc)
177 177 \x1b[30m\x1b[36m\x1b[1m\x1b[4m! deleted\x1b[30m (esc)
178 178 \x1b[30m\x1b[35m\x1b[1m\x1b[4m? unknown\x1b[30m (esc)
179 179 \x1b[30m\x1b[30m\x1b[1mI ignored\x1b[30m (esc)
180 180 \x1b[30m\x1b[30mC .hgignore\x1b[30m (esc)
181 181 \x1b[30m\x1b[30mC modified\x1b[30m (esc)
182 182
183 183
184 184 $ echo "^ignoreddir$" > .hgignore
185 185 $ mkdir ignoreddir
186 186 $ touch ignoreddir/file
187 187
188 188 hg status ignoreddir/file:
189 189
190 190 $ hg status --color=always ignoreddir/file
191 191
192 192 hg status -i ignoreddir/file:
193 193
194 194 $ hg status --color=always -i ignoreddir/file
195 195 \x1b[0;30;1mI ignoreddir/file\x1b[0m (esc)
196 196 $ cd ..
197 197
198 198 check 'status -q' and some combinations
199 199
200 200 $ hg init repo3
201 201 $ cd repo3
202 202 $ touch modified removed deleted ignored
203 203 $ echo "^ignored$" > .hgignore
204 204 $ hg commit -A -m 'initial checkin'
205 205 adding .hgignore
206 206 adding deleted
207 207 adding modified
208 208 adding removed
209 209 $ touch added unknown ignored
210 210 $ hg add added
211 211 $ echo "test" >> modified
212 212 $ hg remove removed
213 213 $ rm deleted
214 214 $ hg copy modified copied
215 215
216 216 test unknown color
217 217
218 218 $ hg --config color.status.modified=periwinkle status --color=always
219 219 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
220 220 M modified
221 221 \x1b[0;32;1mA added\x1b[0m (esc)
222 222 \x1b[0;32;1mA copied\x1b[0m (esc)
223 223 \x1b[0;31;1mR removed\x1b[0m (esc)
224 224 \x1b[0;36;1;4m! deleted\x1b[0m (esc)
225 225 \x1b[0;35;1;4m? unknown\x1b[0m (esc)
226 226
227 227 Run status with 2 different flags.
228 228 Check if result is the same or different.
229 229 If result is not as expected, raise error
230 230
231 231 $ assert() {
232 232 > hg status --color=always $1 > ../a
233 233 > hg status --color=always $2 > ../b
234 234 > if diff ../a ../b > /dev/null; then
235 235 > out=0
236 236 > else
237 237 > out=1
238 238 > fi
239 239 > if [ $3 -eq 0 ]; then
240 240 > df="same"
241 241 > else
242 242 > df="different"
243 243 > fi
244 244 > if [ $out -ne $3 ]; then
245 245 > echo "Error on $1 and $2, should be $df."
246 246 > fi
247 247 > }
248 248
249 249 assert flag1 flag2 [0-same | 1-different]
250 250
251 251 $ assert "-q" "-mard" 0
252 252 $ assert "-A" "-marduicC" 0
253 253 $ assert "-qA" "-mardcC" 0
254 254 $ assert "-qAui" "-A" 0
255 255 $ assert "-qAu" "-marducC" 0
256 256 $ assert "-qAi" "-mardicC" 0
257 257 $ assert "-qu" "-u" 0
258 258 $ assert "-q" "-u" 1
259 259 $ assert "-m" "-a" 1
260 260 $ assert "-r" "-d" 1
261 261 $ cd ..
262 262
263 263 test 'resolve -l'
264 264
265 265 $ hg init repo4
266 266 $ cd repo4
267 267 $ echo "file a" > a
268 268 $ echo "file b" > b
269 269 $ hg add a b
270 270 $ hg commit -m "initial"
271 271 $ echo "file a change 1" > a
272 272 $ echo "file b change 1" > b
273 273 $ hg commit -m "head 1"
274 274 $ hg update 0
275 275 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 276 $ echo "file a change 2" > a
277 277 $ echo "file b change 2" > b
278 278 $ hg commit -m "head 2"
279 279 created new head
280 280 $ hg merge
281 281 merging a
282 282 warning: conflicts during merge.
283 283 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
284 284 merging b
285 285 warning: conflicts during merge.
286 286 merging b incomplete! (edit conflicts, then use 'hg resolve --mark')
287 287 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
288 288 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
289 289 [1]
290 290 $ hg resolve -m b
291 291
292 292 hg resolve with one unresolved, one resolved:
293 293
294 294 $ hg resolve --color=always -l
295 295 \x1b[0;31;1mU a\x1b[0m (esc)
296 296 \x1b[0;32;1mR b\x1b[0m (esc)
@@ -1,274 +1,274 b''
1 1 $ hg init repo1
2 2 $ cd repo1
3 3 $ mkdir a b a/1 b/1 b/2
4 4 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
5 5
6 6 hg status in repo root:
7 7
8 8 $ hg status
9 9 ? a/1/in_a_1
10 10 ? a/in_a
11 11 ? b/1/in_b_1
12 12 ? b/2/in_b_2
13 13 ? b/in_b
14 14 ? in_root
15 15
16 16 hg status . in repo root:
17 17
18 18 $ hg status .
19 19 ? a/1/in_a_1
20 20 ? a/in_a
21 21 ? b/1/in_b_1
22 22 ? b/2/in_b_2
23 23 ? b/in_b
24 24 ? in_root
25 25
26 26 $ hg status --cwd a
27 27 ? a/1/in_a_1
28 28 ? a/in_a
29 29 ? b/1/in_b_1
30 30 ? b/2/in_b_2
31 31 ? b/in_b
32 32 ? in_root
33 33 $ hg status --cwd a .
34 34 ? 1/in_a_1
35 35 ? in_a
36 36 $ hg status --cwd a ..
37 37 ? 1/in_a_1
38 38 ? in_a
39 39 ? ../b/1/in_b_1
40 40 ? ../b/2/in_b_2
41 41 ? ../b/in_b
42 42 ? ../in_root
43 43
44 44 $ hg status --cwd b
45 45 ? a/1/in_a_1
46 46 ? a/in_a
47 47 ? b/1/in_b_1
48 48 ? b/2/in_b_2
49 49 ? b/in_b
50 50 ? in_root
51 51 $ hg status --cwd b .
52 52 ? 1/in_b_1
53 53 ? 2/in_b_2
54 54 ? in_b
55 55 $ hg status --cwd b ..
56 56 ? ../a/1/in_a_1
57 57 ? ../a/in_a
58 58 ? 1/in_b_1
59 59 ? 2/in_b_2
60 60 ? in_b
61 61 ? ../in_root
62 62
63 63 $ hg status --cwd a/1
64 64 ? a/1/in_a_1
65 65 ? a/in_a
66 66 ? b/1/in_b_1
67 67 ? b/2/in_b_2
68 68 ? b/in_b
69 69 ? in_root
70 70 $ hg status --cwd a/1 .
71 71 ? in_a_1
72 72 $ hg status --cwd a/1 ..
73 73 ? in_a_1
74 74 ? ../in_a
75 75
76 76 $ hg status --cwd b/1
77 77 ? a/1/in_a_1
78 78 ? a/in_a
79 79 ? b/1/in_b_1
80 80 ? b/2/in_b_2
81 81 ? b/in_b
82 82 ? in_root
83 83 $ hg status --cwd b/1 .
84 84 ? in_b_1
85 85 $ hg status --cwd b/1 ..
86 86 ? in_b_1
87 87 ? ../2/in_b_2
88 88 ? ../in_b
89 89
90 90 $ hg status --cwd b/2
91 91 ? a/1/in_a_1
92 92 ? a/in_a
93 93 ? b/1/in_b_1
94 94 ? b/2/in_b_2
95 95 ? b/in_b
96 96 ? in_root
97 97 $ hg status --cwd b/2 .
98 98 ? in_b_2
99 99 $ hg status --cwd b/2 ..
100 100 ? ../1/in_b_1
101 101 ? in_b_2
102 102 ? ../in_b
103 103 $ cd ..
104 104
105 105 $ hg init repo2
106 106 $ cd repo2
107 107 $ touch modified removed deleted ignored
108 108 $ echo "^ignored$" > .hgignore
109 109 $ hg ci -A -m 'initial checkin'
110 110 adding .hgignore
111 111 adding deleted
112 112 adding modified
113 113 adding removed
114 114 $ touch modified added unknown ignored
115 115 $ hg add added
116 116 $ hg remove removed
117 117 $ rm deleted
118 118
119 119 hg status:
120 120
121 121 $ hg status
122 122 A added
123 123 R removed
124 124 ! deleted
125 125 ? unknown
126 126
127 127 hg status modified added removed deleted unknown never-existed ignored:
128 128
129 129 $ hg status modified added removed deleted unknown never-existed ignored
130 never-existed: No such file or directory
130 never-existed: * (glob)
131 131 A added
132 132 R removed
133 133 ! deleted
134 134 ? unknown
135 135
136 136 $ hg copy modified copied
137 137
138 138 hg status -C:
139 139
140 140 $ hg status -C
141 141 A added
142 142 A copied
143 143 modified
144 144 R removed
145 145 ! deleted
146 146 ? unknown
147 147
148 148 hg status -A:
149 149
150 150 $ hg status -A
151 151 A added
152 152 A copied
153 153 modified
154 154 R removed
155 155 ! deleted
156 156 ? unknown
157 157 I ignored
158 158 C .hgignore
159 159 C modified
160 160
161 161
162 162 $ echo "^ignoreddir$" > .hgignore
163 163 $ mkdir ignoreddir
164 164 $ touch ignoreddir/file
165 165
166 166 hg status ignoreddir/file:
167 167
168 168 $ hg status ignoreddir/file
169 169
170 170 hg status -i ignoreddir/file:
171 171
172 172 $ hg status -i ignoreddir/file
173 173 I ignoreddir/file
174 174 $ cd ..
175 175
176 176 Check 'status -q' and some combinations
177 177
178 178 $ hg init repo3
179 179 $ cd repo3
180 180 $ touch modified removed deleted ignored
181 181 $ echo "^ignored$" > .hgignore
182 182 $ hg commit -A -m 'initial checkin'
183 183 adding .hgignore
184 184 adding deleted
185 185 adding modified
186 186 adding removed
187 187 $ touch added unknown ignored
188 188 $ hg add added
189 189 $ echo "test" >> modified
190 190 $ hg remove removed
191 191 $ rm deleted
192 192 $ hg copy modified copied
193 193
194 194 Run status with 2 different flags.
195 195 Check if result is the same or different.
196 196 If result is not as expected, raise error
197 197
198 198 $ assert() {
199 199 > hg status $1 > ../a
200 200 > hg status $2 > ../b
201 201 > if diff ../a ../b > /dev/null; then
202 202 > out=0
203 203 > else
204 204 > out=1
205 205 > fi
206 206 > if [ $3 -eq 0 ]; then
207 207 > df="same"
208 208 > else
209 209 > df="different"
210 210 > fi
211 211 > if [ $out -ne $3 ]; then
212 212 > echo "Error on $1 and $2, should be $df."
213 213 > fi
214 214 > }
215 215
216 216 Assert flag1 flag2 [0-same | 1-different]
217 217
218 218 $ assert "-q" "-mard" 0
219 219 $ assert "-A" "-marduicC" 0
220 220 $ assert "-qA" "-mardcC" 0
221 221 $ assert "-qAui" "-A" 0
222 222 $ assert "-qAu" "-marducC" 0
223 223 $ assert "-qAi" "-mardicC" 0
224 224 $ assert "-qu" "-u" 0
225 225 $ assert "-q" "-u" 1
226 226 $ assert "-m" "-a" 1
227 227 $ assert "-r" "-d" 1
228 228 $ cd ..
229 229
230 230 $ hg init repo4
231 231 $ cd repo4
232 232 $ touch modified removed deleted
233 233 $ hg ci -q -A -m 'initial checkin'
234 234 $ touch added unknown
235 235 $ hg add added
236 236 $ hg remove removed
237 237 $ rm deleted
238 238 $ echo x > modified
239 239 $ hg copy modified copied
240 240 $ hg ci -m 'test checkin' -d "1000001 0"
241 241 $ rm *
242 242 $ touch unrelated
243 243 $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0"
244 244
245 245 hg status --change 1:
246 246
247 247 $ hg status --change 1
248 248 M modified
249 249 A added
250 250 A copied
251 251 R removed
252 252
253 253 hg status --change 1 unrelated:
254 254
255 255 $ hg status --change 1 unrelated
256 256
257 257 hg status -C --change 1 added modified copied removed deleted:
258 258
259 259 $ hg status -C --change 1 added modified copied removed deleted
260 260 M modified
261 261 A added
262 262 A copied
263 263 modified
264 264 R removed
265 265
266 266 hg status -A --change 1:
267 267
268 268 $ hg status -A --change 1
269 269 M modified
270 270 A added
271 271 A copied
272 272 modified
273 273 R removed
274 274 C deleted
@@ -1,477 +1,477 b''
1 1 Create test repository:
2 2
3 3 $ hg init repo
4 4 $ cd repo
5 5 $ echo x1 > x.txt
6 6
7 7 $ hg init foo
8 8 $ cd foo
9 9 $ echo y1 > y.txt
10 10
11 11 $ hg init bar
12 12 $ cd bar
13 13 $ echo z1 > z.txt
14 14
15 15 $ cd ..
16 16 $ echo 'bar = bar' > .hgsub
17 17
18 18 $ cd ..
19 19 $ echo 'foo = foo' > .hgsub
20 20
21 21 Add files --- .hgsub files must go first to trigger subrepos:
22 22
23 23 $ hg add -S .hgsub
24 24 $ hg add -S foo/.hgsub
25 25 $ hg add -S foo/bar
26 adding foo/bar/z.txt
26 adding foo/bar/z.txt (glob)
27 27 $ hg add -S
28 28 adding x.txt
29 adding foo/y.txt
29 adding foo/y.txt (glob)
30 30
31 31 Test recursive status without committing anything:
32 32
33 33 $ hg status -S
34 34 A .hgsub
35 35 A foo/.hgsub
36 36 A foo/bar/z.txt
37 37 A foo/y.txt
38 38 A x.txt
39 39
40 40 Test recursive diff without committing anything:
41 41
42 42 $ hg diff --nodates -S foo
43 43 diff -r 000000000000 foo/.hgsub
44 44 --- /dev/null
45 45 +++ b/foo/.hgsub
46 46 @@ -0,0 +1,1 @@
47 47 +bar = bar
48 48 diff -r 000000000000 foo/y.txt
49 49 --- /dev/null
50 50 +++ b/foo/y.txt
51 51 @@ -0,0 +1,1 @@
52 52 +y1
53 53 diff -r 000000000000 foo/bar/z.txt
54 54 --- /dev/null
55 55 +++ b/foo/bar/z.txt
56 56 @@ -0,0 +1,1 @@
57 57 +z1
58 58
59 59 Commits:
60 60
61 61 $ hg commit -m fails
62 62 abort: uncommitted changes in subrepo foo
63 63 (use --subrepos for recursive commit)
64 64 [255]
65 65
66 66 The --subrepos flag overwrite the config setting:
67 67
68 68 $ hg commit -m 0-0-0 --config ui.commitsubrepos=No --subrepos
69 69 committing subrepository foo
70 committing subrepository foo/bar
70 committing subrepository foo/bar (glob)
71 71
72 72 $ cd foo
73 73 $ echo y2 >> y.txt
74 74 $ hg commit -m 0-1-0
75 75
76 76 $ cd bar
77 77 $ echo z2 >> z.txt
78 78 $ hg commit -m 0-1-1
79 79
80 80 $ cd ..
81 81 $ hg commit -m 0-2-1
82 82 committing subrepository bar
83 83
84 84 $ cd ..
85 85 $ hg commit -m 1-2-1
86 86 committing subrepository foo
87 87
88 88 Change working directory:
89 89
90 90 $ echo y3 >> foo/y.txt
91 91 $ echo z3 >> foo/bar/z.txt
92 92 $ hg status -S
93 93 M foo/bar/z.txt
94 94 M foo/y.txt
95 95 $ hg diff --nodates -S
96 96 diff -r d254738c5f5e foo/y.txt
97 97 --- a/foo/y.txt
98 98 +++ b/foo/y.txt
99 99 @@ -1,2 +1,3 @@
100 100 y1
101 101 y2
102 102 +y3
103 103 diff -r 9647f22de499 foo/bar/z.txt
104 104 --- a/foo/bar/z.txt
105 105 +++ b/foo/bar/z.txt
106 106 @@ -1,2 +1,3 @@
107 107 z1
108 108 z2
109 109 +z3
110 110
111 111 Status call crossing repository boundaries:
112 112
113 113 $ hg status -S foo/bar/z.txt
114 114 M foo/bar/z.txt
115 115 $ hg status -S -I 'foo/?.txt'
116 116 M foo/y.txt
117 117 $ hg status -S -I '**/?.txt'
118 118 M foo/bar/z.txt
119 119 M foo/y.txt
120 120 $ hg diff --nodates -S -I '**/?.txt'
121 121 diff -r d254738c5f5e foo/y.txt
122 122 --- a/foo/y.txt
123 123 +++ b/foo/y.txt
124 124 @@ -1,2 +1,3 @@
125 125 y1
126 126 y2
127 127 +y3
128 128 diff -r 9647f22de499 foo/bar/z.txt
129 129 --- a/foo/bar/z.txt
130 130 +++ b/foo/bar/z.txt
131 131 @@ -1,2 +1,3 @@
132 132 z1
133 133 z2
134 134 +z3
135 135
136 136 Status from within a subdirectory:
137 137
138 138 $ mkdir dir
139 139 $ cd dir
140 140 $ echo a1 > a.txt
141 141 $ hg status -S
142 142 M foo/bar/z.txt
143 143 M foo/y.txt
144 144 ? dir/a.txt
145 145 $ hg diff --nodates -S
146 146 diff -r d254738c5f5e foo/y.txt
147 147 --- a/foo/y.txt
148 148 +++ b/foo/y.txt
149 149 @@ -1,2 +1,3 @@
150 150 y1
151 151 y2
152 152 +y3
153 153 diff -r 9647f22de499 foo/bar/z.txt
154 154 --- a/foo/bar/z.txt
155 155 +++ b/foo/bar/z.txt
156 156 @@ -1,2 +1,3 @@
157 157 z1
158 158 z2
159 159 +z3
160 160
161 161 Status with relative path:
162 162
163 163 $ hg status -S ..
164 164 M ../foo/bar/z.txt
165 165 M ../foo/y.txt
166 166 ? a.txt
167 167 $ hg diff --nodates -S ..
168 168 diff -r d254738c5f5e foo/y.txt
169 169 --- a/foo/y.txt
170 170 +++ b/foo/y.txt
171 171 @@ -1,2 +1,3 @@
172 172 y1
173 173 y2
174 174 +y3
175 175 diff -r 9647f22de499 foo/bar/z.txt
176 176 --- a/foo/bar/z.txt
177 177 +++ b/foo/bar/z.txt
178 178 @@ -1,2 +1,3 @@
179 179 z1
180 180 z2
181 181 +z3
182 182 $ cd ..
183 183
184 184 Cleanup and final commit:
185 185
186 186 $ rm -r dir
187 187 $ hg commit --subrepos -m 2-3-2
188 188 committing subrepository foo
189 committing subrepository foo/bar
189 committing subrepository foo/bar (glob)
190 190
191 191 Log with the relationships between repo and its subrepo:
192 192
193 193 $ hg log --template '{rev}:{node|short} {desc}\n'
194 194 2:1326fa26d0c0 2-3-2
195 195 1:4b3c9ff4f66b 1-2-1
196 196 0:23376cbba0d8 0-0-0
197 197
198 198 $ hg -R foo log --template '{rev}:{node|short} {desc}\n'
199 199 3:65903cebad86 2-3-2
200 200 2:d254738c5f5e 0-2-1
201 201 1:8629ce7dcc39 0-1-0
202 202 0:af048e97ade2 0-0-0
203 203
204 204 $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n'
205 205 2:31ecbdafd357 2-3-2
206 206 1:9647f22de499 0-1-1
207 207 0:4904098473f9 0-0-0
208 208
209 209 Status between revisions:
210 210
211 211 $ hg status -S
212 212 $ hg status -S --rev 0:1
213 213 M .hgsubstate
214 214 M foo/.hgsubstate
215 215 M foo/bar/z.txt
216 216 M foo/y.txt
217 217 $ hg diff --nodates -S -I '**/?.txt' --rev 0:1
218 218 diff -r af048e97ade2 -r d254738c5f5e foo/y.txt
219 219 --- a/foo/y.txt
220 220 +++ b/foo/y.txt
221 221 @@ -1,1 +1,2 @@
222 222 y1
223 223 +y2
224 224 diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt
225 225 --- a/foo/bar/z.txt
226 226 +++ b/foo/bar/z.txt
227 227 @@ -1,1 +1,2 @@
228 228 z1
229 229 +z2
230 230
231 231 Enable progress extension for archive tests:
232 232
233 233 $ cp $HGRCPATH $HGRCPATH.no-progress
234 234 $ cat >> $HGRCPATH <<EOF
235 235 > [extensions]
236 236 > progress =
237 237 > [progress]
238 238 > assume-tty = 1
239 239 > delay = 0
240 240 > format = topic bar number
241 241 > refresh = 0
242 242 > width = 60
243 243 > EOF
244 244
245 245 Test archiving to a directory tree (the doubled lines in the output
246 246 only show up in the test output, not in real usage):
247 247
248 248 $ hg archive --subrepos ../archive 2>&1 | $TESTDIR/filtercr.py
249 249
250 250 archiving [ ] 0/3
251 251 archiving [ ] 0/3
252 252 archiving [=============> ] 1/3
253 253 archiving [=============> ] 1/3
254 254 archiving [===========================> ] 2/3
255 255 archiving [===========================> ] 2/3
256 256 archiving [==========================================>] 3/3
257 257 archiving [==========================================>] 3/3
258 258
259 259 archiving (foo) [ ] 0/3
260 260 archiving (foo) [ ] 0/3
261 261 archiving (foo) [===========> ] 1/3
262 262 archiving (foo) [===========> ] 1/3
263 263 archiving (foo) [=======================> ] 2/3
264 264 archiving (foo) [=======================> ] 2/3
265 265 archiving (foo) [====================================>] 3/3
266 266 archiving (foo) [====================================>] 3/3
267 267
268 268 archiving (foo/bar) [ ] 0/1 (glob)
269 269 archiving (foo/bar) [ ] 0/1 (glob)
270 270 archiving (foo/bar) [================================>] 1/1 (glob)
271 271 archiving (foo/bar) [================================>] 1/1 (glob)
272 272 \r (esc)
273 273 $ find ../archive | sort
274 274 ../archive
275 275 ../archive/.hg_archival.txt
276 276 ../archive/.hgsub
277 277 ../archive/.hgsubstate
278 278 ../archive/foo
279 279 ../archive/foo/.hgsub
280 280 ../archive/foo/.hgsubstate
281 281 ../archive/foo/bar
282 282 ../archive/foo/bar/z.txt
283 283 ../archive/foo/y.txt
284 284 ../archive/x.txt
285 285
286 286 Test archiving to zip file (unzip output is unstable):
287 287
288 288 $ hg archive --subrepos ../archive.zip 2>&1 | $TESTDIR/filtercr.py
289 289
290 290 archiving [ ] 0/3
291 291 archiving [ ] 0/3
292 292 archiving [=============> ] 1/3
293 293 archiving [=============> ] 1/3
294 294 archiving [===========================> ] 2/3
295 295 archiving [===========================> ] 2/3
296 296 archiving [==========================================>] 3/3
297 297 archiving [==========================================>] 3/3
298 298
299 299 archiving (foo) [ ] 0/3
300 300 archiving (foo) [ ] 0/3
301 301 archiving (foo) [===========> ] 1/3
302 302 archiving (foo) [===========> ] 1/3
303 303 archiving (foo) [=======================> ] 2/3
304 304 archiving (foo) [=======================> ] 2/3
305 305 archiving (foo) [====================================>] 3/3
306 306 archiving (foo) [====================================>] 3/3
307 307
308 308 archiving (foo/bar) [ ] 0/1 (glob)
309 309 archiving (foo/bar) [ ] 0/1 (glob)
310 310 archiving (foo/bar) [================================>] 1/1 (glob)
311 311 archiving (foo/bar) [================================>] 1/1 (glob)
312 312 \r (esc)
313 313
314 314 Test archiving a revision that references a subrepo that is not yet
315 315 cloned:
316 316
317 317 $ hg clone -U . ../empty
318 318 $ cd ../empty
319 319 $ hg archive --subrepos -r tip ../archive.tar.gz 2>&1 | $TESTDIR/filtercr.py
320 320
321 321 archiving [ ] 0/3
322 322 archiving [ ] 0/3
323 323 archiving [=============> ] 1/3
324 324 archiving [=============> ] 1/3
325 325 archiving [===========================> ] 2/3
326 326 archiving [===========================> ] 2/3
327 327 archiving [==========================================>] 3/3
328 328 archiving [==========================================>] 3/3
329 329
330 330 archiving (foo) [ ] 0/3
331 331 archiving (foo) [ ] 0/3
332 332 archiving (foo) [===========> ] 1/3
333 333 archiving (foo) [===========> ] 1/3
334 334 archiving (foo) [=======================> ] 2/3
335 335 archiving (foo) [=======================> ] 2/3
336 336 archiving (foo) [====================================>] 3/3
337 337 archiving (foo) [====================================>] 3/3
338 338
339 339 archiving (foo/bar) [ ] 0/1 (glob)
340 340 archiving (foo/bar) [ ] 0/1 (glob)
341 341 archiving (foo/bar) [================================>] 1/1 (glob)
342 342 archiving (foo/bar) [================================>] 1/1 (glob)
343 343
344 344 cloning subrepo foo from $TESTTMP/repo/foo
345 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
345 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
346 346
347 347 The newly cloned subrepos contain no working copy:
348 348
349 349 $ hg -R foo summary
350 350 parent: -1:000000000000 (no revision checked out)
351 351 branch: default
352 352 commit: (clean)
353 353 update: 4 new changesets (update)
354 354
355 355 Disable progress extension and cleanup:
356 356
357 357 $ mv $HGRCPATH.no-progress $HGRCPATH
358 358
359 359 Test archiving when there is a directory in the way for a subrepo
360 360 created by archive:
361 361
362 362 $ hg clone -U . ../almost-empty
363 363 $ cd ../almost-empty
364 364 $ mkdir foo
365 365 $ echo f > foo/f
366 366 $ hg archive --subrepos -r tip archive
367 367 cloning subrepo foo from $TESTTMP/empty/foo
368 abort: destination '$TESTTMP/almost-empty/foo' is not empty
368 abort: destination '$TESTTMP/almost-empty/foo' is not empty (glob)
369 369 [255]
370 370
371 371 Clone and test outgoing:
372 372
373 373 $ cd ..
374 374 $ hg clone repo repo2
375 375 updating to branch default
376 376 cloning subrepo foo from $TESTTMP/repo/foo
377 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
377 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob)
378 378 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
379 379 $ cd repo2
380 380 $ hg outgoing -S
381 comparing with $TESTTMP/repo
381 comparing with $TESTTMP/repo (glob)
382 382 searching for changes
383 383 no changes found
384 384 comparing with $TESTTMP/repo/foo
385 385 searching for changes
386 386 no changes found
387 387 comparing with $TESTTMP/repo/foo/bar
388 388 searching for changes
389 389 no changes found
390 390 [1]
391 391
392 392 Make nested change:
393 393
394 394 $ echo y4 >> foo/y.txt
395 395 $ hg diff --nodates -S
396 396 diff -r 65903cebad86 foo/y.txt
397 397 --- a/foo/y.txt
398 398 +++ b/foo/y.txt
399 399 @@ -1,3 +1,4 @@
400 400 y1
401 401 y2
402 402 y3
403 403 +y4
404 404 $ hg commit --subrepos -m 3-4-2
405 405 committing subrepository foo
406 406 $ hg outgoing -S
407 comparing with $TESTTMP/repo
407 comparing with $TESTTMP/repo (glob)
408 408 searching for changes
409 409 changeset: 3:2655b8ecc4ee
410 410 tag: tip
411 411 user: test
412 412 date: Thu Jan 01 00:00:00 1970 +0000
413 413 summary: 3-4-2
414 414
415 415 comparing with $TESTTMP/repo/foo
416 416 searching for changes
417 417 changeset: 4:e96193d6cb36
418 418 tag: tip
419 419 user: test
420 420 date: Thu Jan 01 00:00:00 1970 +0000
421 421 summary: 3-4-2
422 422
423 423 comparing with $TESTTMP/repo/foo/bar
424 424 searching for changes
425 425 no changes found
426 426
427 427
428 428 Switch to original repo and setup default path:
429 429
430 430 $ cd ../repo
431 431 $ echo '[paths]' >> .hg/hgrc
432 432 $ echo 'default = ../repo2' >> .hg/hgrc
433 433
434 434 Test incoming:
435 435
436 436 $ hg incoming -S
437 comparing with $TESTTMP/repo2
437 comparing with $TESTTMP/repo2 (glob)
438 438 searching for changes
439 439 changeset: 3:2655b8ecc4ee
440 440 tag: tip
441 441 user: test
442 442 date: Thu Jan 01 00:00:00 1970 +0000
443 443 summary: 3-4-2
444 444
445 445 comparing with $TESTTMP/repo2/foo
446 446 searching for changes
447 447 changeset: 4:e96193d6cb36
448 448 tag: tip
449 449 user: test
450 450 date: Thu Jan 01 00:00:00 1970 +0000
451 451 summary: 3-4-2
452 452
453 453 comparing with $TESTTMP/repo2/foo/bar
454 454 searching for changes
455 455 no changes found
456 456
457 457 $ hg incoming -S --bundle incoming.hg
458 458 abort: cannot combine --bundle and --subrepos
459 459 [255]
460 460
461 461 Test missing subrepo:
462 462
463 463 $ rm -r foo
464 464 $ hg status -S
465 465 warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"
466 466
467 467 Issue2619: IndexError: list index out of range on hg add with subrepos
468 468 The subrepo must sorts after the explicit filename.
469 469
470 470 $ cd ..
471 471 $ hg init test
472 472 $ cd test
473 473 $ hg init x
474 474 $ echo "x = x" >> .hgsub
475 475 $ hg add .hgsub
476 476 $ touch a x/a
477 477 $ hg add a x/a
@@ -1,1017 +1,1017 b''
1 1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
2 2
3 3 $ echo "[ui]" >> $HGRCPATH
4 4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
5 5
6 6 $ rm -rf sub
7 7 $ mkdir sub
8 8 $ cd sub
9 9 $ hg init t
10 10 $ cd t
11 11
12 12 first revision, no sub
13 13
14 14 $ echo a > a
15 15 $ hg ci -Am0
16 16 adding a
17 17
18 18 add first sub
19 19
20 20 $ echo s = s > .hgsub
21 21 $ hg add .hgsub
22 22 $ hg init s
23 23 $ echo a > s/a
24 24
25 25 Issue2232: committing a subrepo without .hgsub
26 26
27 27 $ hg ci -mbad s
28 28 abort: can't commit subrepos without .hgsub
29 29 [255]
30 30
31 31 $ hg -R s ci -Ams0
32 32 adding a
33 33 $ hg sum
34 34 parent: 0:f7b1eb17ad24 tip
35 35 0
36 36 branch: default
37 37 commit: 1 added, 1 subrepos
38 38 update: (current)
39 39 $ hg ci -m1
40 40 committing subrepository s
41 41
42 42 Revert can't (yet) revert subrepos:
43 43
44 44 $ echo b > s/a
45 45 $ hg revert s
46 46 s: reverting subrepos is unsupported
47 47
48 48 Revert currently ignores subrepos by default
49 49
50 50 $ hg revert -a
51 51 $ hg revert -R s -a -C
52 52 reverting s/a (glob)
53 53
54 54 Issue2022: update -C
55 55
56 56 $ echo b > s/a
57 57 $ hg sum
58 58 parent: 1:7cf8cfea66e4 tip
59 59 1
60 60 branch: default
61 61 commit: 1 subrepos
62 62 update: (current)
63 63 $ hg co -C 1
64 64 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
65 65 $ hg sum
66 66 parent: 1:7cf8cfea66e4 tip
67 67 1
68 68 branch: default
69 69 commit: (clean)
70 70 update: (current)
71 71
72 72 commands that require a clean repo should respect subrepos
73 73
74 74 $ echo b >> s/a
75 75 $ hg backout tip
76 76 abort: uncommitted changes in subrepo s
77 77 [255]
78 78 $ hg revert -C -R s s/a
79 79
80 80 add sub sub
81 81
82 82 $ echo ss = ss > s/.hgsub
83 83 $ hg init s/ss
84 84 $ echo a > s/ss/a
85 85 $ hg -R s add s/.hgsub
86 86 $ hg -R s/ss add s/ss/a
87 87 $ hg sum
88 88 parent: 1:7cf8cfea66e4 tip
89 89 1
90 90 branch: default
91 91 commit: 1 subrepos
92 92 update: (current)
93 93 $ hg ci -m2
94 94 committing subrepository s
95 95 committing subrepository s/ss (glob)
96 96 $ hg sum
97 97 parent: 2:df30734270ae tip
98 98 2
99 99 branch: default
100 100 commit: (clean)
101 101 update: (current)
102 102
103 103 bump sub rev (and check it is ignored by ui.commitsubrepos)
104 104
105 105 $ echo b > s/a
106 106 $ hg -R s ci -ms1
107 107 $ hg --config ui.commitsubrepos=no ci -m3
108 108 committing subrepository s
109 109
110 110 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
111 111
112 112 $ echo c > s/a
113 113 $ hg --config ui.commitsubrepos=no ci -m4
114 114 abort: uncommitted changes in subrepo s
115 115 (use --subrepos for recursive commit)
116 116 [255]
117 117 $ hg ci -m4
118 118 committing subrepository s
119 119 $ hg tip -R s
120 120 changeset: 3:1c833a7a9e3a
121 121 tag: tip
122 122 user: test
123 123 date: Thu Jan 01 00:00:00 1970 +0000
124 124 summary: 4
125 125
126 126
127 127 check caching
128 128
129 129 $ hg co 0
130 130 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
131 131 $ hg debugsub
132 132
133 133 restore
134 134
135 135 $ hg co
136 136 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
137 137 $ hg debugsub
138 138 path s
139 139 source s
140 140 revision 1c833a7a9e3a4445c711aaf0f012379cd0d4034e
141 141
142 142 new branch for merge tests
143 143
144 144 $ hg co 1
145 145 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 146 $ echo t = t >> .hgsub
147 147 $ hg init t
148 148 $ echo t > t/t
149 149 $ hg -R t add t
150 150 adding t/t (glob)
151 151
152 152 5
153 153
154 154 $ hg ci -m5 # add sub
155 155 committing subrepository t
156 156 created new head
157 157 $ echo t2 > t/t
158 158
159 159 6
160 160
161 161 $ hg st -R s
162 162 $ hg ci -m6 # change sub
163 163 committing subrepository t
164 164 $ hg debugsub
165 165 path s
166 166 source s
167 167 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
168 168 path t
169 169 source t
170 170 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
171 171 $ echo t3 > t/t
172 172
173 173 7
174 174
175 175 $ hg ci -m7 # change sub again for conflict test
176 176 committing subrepository t
177 177 $ hg rm .hgsub
178 178
179 179 8
180 180
181 181 $ hg ci -m8 # remove sub
182 182
183 183 merge tests
184 184
185 185 $ hg co -C 3
186 186 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
187 187 $ hg merge 5 # test adding
188 188 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 189 (branch merge, don't forget to commit)
190 190 $ hg debugsub
191 191 path s
192 192 source s
193 193 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
194 194 path t
195 195 source t
196 196 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
197 197 $ hg ci -m9
198 198 created new head
199 199 $ hg merge 6 --debug # test change
200 200 searching for copies back to rev 2
201 201 resolving manifests
202 202 overwrite None partial False
203 203 ancestor 1f14a2e2d3ec local f0d2028bf86d+ remote 1831e14459c4
204 204 .hgsubstate: versions differ -> m
205 205 updating: .hgsubstate 1/1 files (100.00%)
206 206 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
207 207 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
208 208 getting subrepo t
209 209 resolving manifests
210 210 overwrite True partial False
211 211 ancestor 60ca1237c194+ local 60ca1237c194+ remote 6747d179aa9a
212 212 t: remote is newer -> g
213 213 updating: t 1/1 files (100.00%)
214 214 getting t
215 215 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
216 216 (branch merge, don't forget to commit)
217 217 $ hg debugsub
218 218 path s
219 219 source s
220 220 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
221 221 path t
222 222 source t
223 223 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
224 224 $ echo conflict > t/t
225 225 $ hg ci -m10
226 226 committing subrepository t
227 227 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
228 228 searching for copies back to rev 2
229 229 resolving manifests
230 230 overwrite None partial False
231 231 ancestor 1831e14459c4 local e45c8b14af55+ remote f94576341bcf
232 232 .hgsubstate: versions differ -> m
233 233 updating: .hgsubstate 1/1 files (100.00%)
234 234 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
235 235 subrepo t: both sides changed, merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
236 236 merging subrepo t
237 237 searching for copies back to rev 2
238 238 resolving manifests
239 239 overwrite None partial False
240 240 ancestor 6747d179aa9a local 20a0db6fbf6c+ remote 7af322bc1198
241 241 t: versions differ -> m
242 242 preserving t for resolve of t
243 243 updating: t 1/1 files (100.00%)
244 244 picked tool 'internal:merge' for t (binary False symlink False)
245 245 merging t
246 246 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
247 247 warning: conflicts during merge.
248 248 merging t incomplete! (edit conflicts, then use 'hg resolve --mark')
249 249 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
250 250 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
251 251 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
252 252 (branch merge, don't forget to commit)
253 253
254 254 should conflict
255 255
256 256 $ cat t/t
257 257 <<<<<<< local
258 258 conflict
259 259 =======
260 260 t3
261 261 >>>>>>> other
262 262
263 263 clone
264 264
265 265 $ cd ..
266 266 $ hg clone t tc
267 267 updating to branch default
268 268 cloning subrepo s from $TESTTMP/sub/t/s (glob)
269 269 cloning subrepo s/ss from $TESTTMP/sub/t/s/ss (glob)
270 270 cloning subrepo t from $TESTTMP/sub/t/t (glob)
271 271 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
272 272 $ cd tc
273 273 $ hg debugsub
274 274 path s
275 275 source s
276 276 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
277 277 path t
278 278 source t
279 279 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
280 280
281 281 push
282 282
283 283 $ echo bah > t/t
284 284 $ hg ci -m11
285 285 committing subrepository t
286 286 $ hg push
287 287 pushing to $TESTTMP/sub/t (glob)
288 288 pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
289 289 searching for changes
290 290 no changes found
291 291 pushing subrepo s to $TESTTMP/sub/t/s (glob)
292 292 searching for changes
293 293 no changes found
294 294 pushing subrepo t to $TESTTMP/sub/t/t (glob)
295 295 searching for changes
296 296 adding changesets
297 297 adding manifests
298 298 adding file changes
299 299 added 1 changesets with 1 changes to 1 files
300 300 searching for changes
301 301 adding changesets
302 302 adding manifests
303 303 adding file changes
304 304 added 1 changesets with 1 changes to 1 files
305 305
306 306 push -f
307 307
308 308 $ echo bah > s/a
309 309 $ hg ci -m12
310 310 committing subrepository s
311 311 $ hg push
312 312 pushing to $TESTTMP/sub/t (glob)
313 313 pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
314 314 searching for changes
315 315 no changes found
316 316 pushing subrepo s to $TESTTMP/sub/t/s (glob)
317 317 searching for changes
318 318 abort: push creates new remote head 12a213df6fa9!
319 319 (did you forget to merge? use push -f to force)
320 320 [255]
321 321 $ hg push -f
322 322 pushing to $TESTTMP/sub/t (glob)
323 323 pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
324 324 searching for changes
325 325 no changes found
326 326 pushing subrepo s to $TESTTMP/sub/t/s (glob)
327 327 searching for changes
328 328 adding changesets
329 329 adding manifests
330 330 adding file changes
331 331 added 1 changesets with 1 changes to 1 files (+1 heads)
332 332 pushing subrepo t to $TESTTMP/sub/t/t (glob)
333 333 searching for changes
334 334 no changes found
335 335 searching for changes
336 336 adding changesets
337 337 adding manifests
338 338 adding file changes
339 339 added 1 changesets with 1 changes to 1 files
340 340
341 341 update
342 342
343 343 $ cd ../t
344 344 $ hg up -C # discard our earlier merge
345 345 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
346 346 $ echo blah > t/t
347 347 $ hg ci -m13
348 348 committing subrepository t
349 349
350 350 pull
351 351
352 352 $ cd ../tc
353 353 $ hg pull
354 354 pulling from $TESTTMP/sub/t (glob)
355 355 searching for changes
356 356 adding changesets
357 357 adding manifests
358 358 adding file changes
359 359 added 1 changesets with 1 changes to 1 files
360 360 (run 'hg update' to get a working copy)
361 361
362 362 should pull t
363 363
364 364 $ hg up
365 365 pulling subrepo t from $TESTTMP/sub/t/t (glob)
366 366 searching for changes
367 367 adding changesets
368 368 adding manifests
369 369 adding file changes
370 370 added 1 changesets with 1 changes to 1 files
371 371 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
372 372 $ cat t/t
373 373 blah
374 374
375 375 bogus subrepo path aborts
376 376
377 377 $ echo 'bogus=[boguspath' >> .hgsub
378 378 $ hg ci -m 'bogus subrepo path'
379 379 abort: missing ] in subrepo source
380 380 [255]
381 381
382 382 Issue1986: merge aborts when trying to merge a subrepo that
383 383 shouldn't need merging
384 384
385 385 # subrepo layout
386 386 #
387 387 # o 5 br
388 388 # /|
389 389 # o | 4 default
390 390 # | |
391 391 # | o 3 br
392 392 # |/|
393 393 # o | 2 default
394 394 # | |
395 395 # | o 1 br
396 396 # |/
397 397 # o 0 default
398 398
399 399 $ cd ..
400 400 $ rm -rf sub
401 401 $ hg init main
402 402 $ cd main
403 403 $ hg init s
404 404 $ cd s
405 405 $ echo a > a
406 406 $ hg ci -Am1
407 407 adding a
408 408 $ hg branch br
409 409 marked working directory as branch br
410 410 $ echo a >> a
411 411 $ hg ci -m1
412 412 $ hg up default
413 413 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
414 414 $ echo b > b
415 415 $ hg ci -Am1
416 416 adding b
417 417 $ hg up br
418 418 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
419 419 $ hg merge tip
420 420 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
421 421 (branch merge, don't forget to commit)
422 422 $ hg ci -m1
423 423 $ hg up 2
424 424 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
425 425 $ echo c > c
426 426 $ hg ci -Am1
427 427 adding c
428 428 $ hg up 3
429 429 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
430 430 $ hg merge 4
431 431 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
432 432 (branch merge, don't forget to commit)
433 433 $ hg ci -m1
434 434
435 435 # main repo layout:
436 436 #
437 437 # * <-- try to merge default into br again
438 438 # .`|
439 439 # . o 5 br --> substate = 5
440 440 # . |
441 441 # o | 4 default --> substate = 4
442 442 # | |
443 443 # | o 3 br --> substate = 2
444 444 # |/|
445 445 # o | 2 default --> substate = 2
446 446 # | |
447 447 # | o 1 br --> substate = 3
448 448 # |/
449 449 # o 0 default --> substate = 2
450 450
451 451 $ cd ..
452 452 $ echo 's = s' > .hgsub
453 453 $ hg -R s up 2
454 454 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
455 455 $ hg ci -Am1
456 456 adding .hgsub
457 457 committing subrepository s
458 458 $ hg branch br
459 459 marked working directory as branch br
460 460 $ echo b > b
461 461 $ hg -R s up 3
462 462 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
463 463 $ hg ci -Am1
464 464 adding b
465 465 committing subrepository s
466 466 $ hg up default
467 467 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
468 468 $ echo c > c
469 469 $ hg ci -Am1
470 470 adding c
471 471 $ hg up 1
472 472 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
473 473 $ hg merge 2
474 474 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
475 475 (branch merge, don't forget to commit)
476 476 $ hg ci -m1
477 477 $ hg up 2
478 478 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
479 479 $ hg -R s up 4
480 480 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
481 481 $ echo d > d
482 482 $ hg ci -Am1
483 483 adding d
484 484 committing subrepository s
485 485 $ hg up 3
486 486 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
487 487 $ hg -R s up 5
488 488 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
489 489 $ echo e > e
490 490 $ hg ci -Am1
491 491 adding e
492 492 committing subrepository s
493 493
494 494 $ hg up 5
495 495 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
496 496 $ hg merge 4 # try to merge default into br again
497 497 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
498 498 (branch merge, don't forget to commit)
499 499 $ cd ..
500 500
501 501 test subrepo delete from .hgsubstate
502 502
503 503 $ hg init testdelete
504 504 $ mkdir testdelete/nested testdelete/nested2
505 505 $ hg init testdelete/nested
506 506 $ hg init testdelete/nested2
507 507 $ echo test > testdelete/nested/foo
508 508 $ echo test > testdelete/nested2/foo
509 509 $ hg -R testdelete/nested add
510 510 adding testdelete/nested/foo (glob)
511 511 $ hg -R testdelete/nested2 add
512 512 adding testdelete/nested2/foo (glob)
513 513 $ hg -R testdelete/nested ci -m test
514 514 $ hg -R testdelete/nested2 ci -m test
515 515 $ echo nested = nested > testdelete/.hgsub
516 516 $ echo nested2 = nested2 >> testdelete/.hgsub
517 517 $ hg -R testdelete add
518 518 adding testdelete/.hgsub (glob)
519 519 $ hg -R testdelete ci -m "nested 1 & 2 added"
520 520 committing subrepository nested
521 521 committing subrepository nested2
522 522 $ echo nested = nested > testdelete/.hgsub
523 523 $ hg -R testdelete ci -m "nested 2 deleted"
524 524 $ cat testdelete/.hgsubstate
525 525 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
526 526 $ hg -R testdelete remove testdelete/.hgsub
527 527 $ hg -R testdelete ci -m ".hgsub deleted"
528 528 $ cat testdelete/.hgsubstate
529 529 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
530 530
531 531 test repository cloning
532 532
533 533 $ mkdir mercurial mercurial2
534 534 $ hg init nested_absolute
535 535 $ echo test > nested_absolute/foo
536 536 $ hg -R nested_absolute add
537 537 adding nested_absolute/foo (glob)
538 538 $ hg -R nested_absolute ci -mtest
539 539 $ cd mercurial
540 540 $ hg init nested_relative
541 541 $ echo test2 > nested_relative/foo2
542 542 $ hg -R nested_relative add
543 543 adding nested_relative/foo2 (glob)
544 544 $ hg -R nested_relative ci -mtest2
545 545 $ hg init main
546 546 $ echo "nested_relative = ../nested_relative" > main/.hgsub
547 547 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
548 548 $ hg -R main add
549 549 adding main/.hgsub (glob)
550 550 $ hg -R main ci -m "add subrepos"
551 551 committing subrepository nested_absolute
552 552 committing subrepository nested_relative
553 553 $ cd ..
554 554 $ hg clone mercurial/main mercurial2/main
555 555 updating to branch default
556 556 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
557 557 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
558 558 > mercurial2/main/nested_relative/.hg/hgrc
559 559 [paths]
560 560 default = $TESTTMP/sub/mercurial/nested_absolute
561 561 [paths]
562 562 default = $TESTTMP/sub/mercurial/nested_relative
563 563 $ rm -rf mercurial mercurial2
564 564
565 565 Issue1977: multirepo push should fail if subrepo push fails
566 566
567 567 $ hg init repo
568 568 $ hg init repo/s
569 569 $ echo a > repo/s/a
570 570 $ hg -R repo/s ci -Am0
571 571 adding a
572 572 $ echo s = s > repo/.hgsub
573 573 $ hg -R repo ci -Am1
574 574 adding .hgsub
575 575 committing subrepository s
576 576 $ hg clone repo repo2
577 577 updating to branch default
578 578 cloning subrepo s from $TESTTMP/sub/repo/s (glob)
579 579 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
580 580 $ hg -q -R repo2 pull -u
581 581 $ echo 1 > repo2/s/a
582 582 $ hg -R repo2/s ci -m2
583 583 $ hg -q -R repo2/s push
584 584 $ hg -R repo2/s up -C 0
585 585 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
586 586 $ echo 2 > repo2/s/a
587 587 $ hg -R repo2/s ci -m3
588 588 created new head
589 589 $ hg -R repo2 ci -m3
590 590 committing subrepository s
591 591 $ hg -q -R repo2 push
592 592 abort: push creates new remote head 9d66565e64e1!
593 593 (did you forget to merge? use push -f to force)
594 594 [255]
595 595 $ hg -R repo update
596 596 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
597 597 $ rm -rf repo2 repo
598 598
599 599
600 600 Issue1852 subrepos with relative paths always push/pull relative to default
601 601
602 602 Prepare a repo with subrepo
603 603
604 604 $ hg init issue1852a
605 605 $ cd issue1852a
606 606 $ hg init sub/repo
607 607 $ echo test > sub/repo/foo
608 608 $ hg -R sub/repo add sub/repo/foo
609 609 $ echo sub/repo = sub/repo > .hgsub
610 610 $ hg add .hgsub
611 611 $ hg ci -mtest
612 612 committing subrepository sub/repo (glob)
613 613 $ echo test >> sub/repo/foo
614 614 $ hg ci -mtest
615 615 committing subrepository sub/repo (glob)
616 616 $ cd ..
617 617
618 618 Create repo without default path, pull top repo, and see what happens on update
619 619
620 620 $ hg init issue1852b
621 621 $ hg -R issue1852b pull issue1852a
622 622 pulling from issue1852a
623 623 requesting all changes
624 624 adding changesets
625 625 adding manifests
626 626 adding file changes
627 627 added 2 changesets with 3 changes to 2 files
628 628 (run 'hg update' to get a working copy)
629 629 $ hg -R issue1852b update
630 630 abort: default path for subrepository sub/repo not found (glob)
631 631 [255]
632 632
633 633 Pull -u now doesn't help
634 634
635 635 $ hg -R issue1852b pull -u issue1852a
636 636 pulling from issue1852a
637 637 searching for changes
638 638 no changes found
639 639
640 640 Try the same, but with pull -u
641 641
642 642 $ hg init issue1852c
643 643 $ hg -R issue1852c pull -r0 -u issue1852a
644 644 pulling from issue1852a
645 645 adding changesets
646 646 adding manifests
647 647 adding file changes
648 648 added 1 changesets with 2 changes to 2 files
649 649 cloning subrepo sub/repo from issue1852a/sub/repo (glob)
650 650 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
651 651
652 652 Try to push from the other side
653 653
654 654 $ hg -R issue1852a push `pwd`/issue1852c
655 655 pushing to $TESTTMP/sub/issue1852c
656 656 pushing subrepo sub/repo to $TESTTMP/sub/issue1852c/sub/repo (glob)
657 657 searching for changes
658 658 no changes found
659 659 searching for changes
660 660 adding changesets
661 661 adding manifests
662 662 adding file changes
663 663 added 1 changesets with 1 changes to 1 files
664 664
665 665 Incoming and outgoing should not use the default path:
666 666
667 667 $ hg clone -q issue1852a issue1852d
668 668 $ hg -R issue1852d outgoing --subrepos issue1852c
669 669 comparing with issue1852c
670 670 searching for changes
671 671 no changes found
672 672 comparing with issue1852c/sub/repo
673 673 searching for changes
674 674 no changes found
675 675 [1]
676 676 $ hg -R issue1852d incoming --subrepos issue1852c
677 677 comparing with issue1852c
678 678 searching for changes
679 679 no changes found
680 680 comparing with issue1852c/sub/repo
681 681 searching for changes
682 682 no changes found
683 683 [1]
684 684
685 685 Check status of files when none of them belong to the first
686 686 subrepository:
687 687
688 688 $ hg init subrepo-status
689 689 $ cd subrepo-status
690 690 $ hg init subrepo-1
691 691 $ hg init subrepo-2
692 692 $ cd subrepo-2
693 693 $ touch file
694 694 $ hg add file
695 695 $ cd ..
696 696 $ echo subrepo-1 = subrepo-1 > .hgsub
697 697 $ echo subrepo-2 = subrepo-2 >> .hgsub
698 698 $ hg add .hgsub
699 699 $ hg ci -m 'Added subrepos'
700 700 committing subrepository subrepo-1
701 701 committing subrepository subrepo-2
702 702 $ hg st subrepo-2/file
703 703
704 704 Check hg update --clean
705 705 $ cd $TESTTMP/sub/t
706 706 $ rm -r t/t.orig
707 707 $ hg status -S --all
708 708 C .hgsub
709 709 C .hgsubstate
710 710 C a
711 711 C s/.hgsub
712 712 C s/.hgsubstate
713 713 C s/a
714 714 C s/ss/a
715 715 C t/t
716 716 $ echo c1 > s/a
717 717 $ cd s
718 718 $ echo c1 > b
719 719 $ echo c1 > c
720 720 $ hg add b
721 721 $ cd ..
722 722 $ hg status -S
723 723 M s/a
724 724 A s/b
725 725 ? s/c
726 726 $ hg update -C
727 727 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
728 728 $ hg status -S
729 729 ? s/b
730 730 ? s/c
731 731
732 732 Sticky subrepositories, no changes
733 733 $ cd $TESTTMP/sub/t
734 734 $ hg id
735 735 925c17564ef8 tip
736 736 $ hg -R s id
737 737 12a213df6fa9 tip
738 738 $ hg -R t id
739 739 52c0adc0515a tip
740 740 $ hg update 11
741 741 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
742 742 $ hg id
743 743 365661e5936a
744 744 $ hg -R s id
745 745 fc627a69481f
746 746 $ hg -R t id
747 747 e95bcfa18a35
748 748
749 749 Sticky subrepositorys, file changes
750 750 $ touch s/f1
751 751 $ touch t/f1
752 752 $ hg add -S s/f1
753 753 $ hg add -S t/f1
754 754 $ hg id
755 755 365661e5936a
756 756 $ hg -R s id
757 757 fc627a69481f+
758 758 $ hg -R t id
759 759 e95bcfa18a35+
760 760 $ hg update tip
761 761 subrepository sources for s differ
762 762 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)?
763 763 l
764 764 subrepository sources for t differ
765 765 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)?
766 766 l
767 767 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
768 768 $ hg id
769 769 925c17564ef8+ tip
770 770 $ hg -R s id
771 771 fc627a69481f+
772 772 $ hg -R t id
773 773 e95bcfa18a35+
774 774 $ hg update --clean tip
775 775 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
776 776
777 777 Sticky subrepository, revision updates
778 778 $ hg id
779 779 925c17564ef8 tip
780 780 $ hg -R s id
781 781 12a213df6fa9 tip
782 782 $ hg -R t id
783 783 52c0adc0515a tip
784 784 $ cd s
785 785 $ hg update -r -2
786 786 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
787 787 $ cd ../t
788 788 $ hg update -r 2
789 789 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
790 790 $ cd ..
791 791 $ hg update 10
792 792 subrepository sources for t differ (in checked out version)
793 793 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)?
794 794 l
795 795 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
796 796 $ hg id
797 797 e45c8b14af55+
798 798 $ hg -R s id
799 799 1c833a7a9e3a
800 800 $ hg -R t id
801 801 7af322bc1198
802 802
803 803 Sticky subrepository, file changes and revision updates
804 804 $ touch s/f1
805 805 $ touch t/f1
806 806 $ hg add -S s/f1
807 807 $ hg add -S t/f1
808 808 $ hg id
809 809 e45c8b14af55+
810 810 $ hg -R s id
811 811 1c833a7a9e3a+
812 812 $ hg -R t id
813 813 7af322bc1198+
814 814 $ hg update tip
815 815 subrepository sources for s differ
816 816 use (l)ocal source (1c833a7a9e3a) or (r)emote source (12a213df6fa9)?
817 817 l
818 818 subrepository sources for t differ
819 819 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)?
820 820 l
821 821 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
822 822 $ hg id
823 823 925c17564ef8 tip
824 824 $ hg -R s id
825 825 1c833a7a9e3a+
826 826 $ hg -R t id
827 827 7af322bc1198+
828 828
829 829 Sticky repository, update --clean
830 830 $ hg update --clean tip
831 831 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
832 832 $ hg id
833 833 925c17564ef8 tip
834 834 $ hg -R s id
835 835 12a213df6fa9 tip
836 836 $ hg -R t id
837 837 52c0adc0515a tip
838 838
839 839 Test subrepo already at intended revision:
840 840 $ cd s
841 841 $ hg update fc627a69481f
842 842 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
843 843 $ cd ..
844 844 $ hg update 11
845 845 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
846 846 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
847 847 $ hg id -n
848 848 11+
849 849 $ hg -R s id
850 850 fc627a69481f
851 851 $ hg -R t id
852 852 e95bcfa18a35
853 853
854 854 Test that removing .hgsubstate doesn't break anything:
855 855
856 856 $ hg rm -f .hgsubstate
857 857 $ hg ci -mrm
858 858 committing subrepository s
859 859 committing subrepository t
860 860 created new head
861 861 $ hg log -vr tip
862 862 changeset: 14:3941e0aa5236
863 863 tag: tip
864 864 parent: 11:365661e5936a
865 865 user: test
866 866 date: Thu Jan 01 00:00:00 1970 +0000
867 867 description:
868 868 rm
869 869
870 870
871 871
872 872 Test that removing .hgsub removes .hgsubstate:
873 873
874 874 $ hg rm .hgsub
875 875 $ hg ci -mrm2
876 876 $ hg log -vr tip
877 877 changeset: 15:8b31de9d13d1
878 878 tag: tip
879 879 user: test
880 880 date: Thu Jan 01 00:00:00 1970 +0000
881 881 files: .hgsub .hgsubstate
882 882 description:
883 883 rm2
884 884
885 885
886 886 Test behavior of add for explicit path in subrepo:
887 887 $ cd ..
888 888 $ hg init explicit
889 889 $ cd explicit
890 890 $ echo s = s > .hgsub
891 891 $ hg add .hgsub
892 892 $ hg init s
893 893 $ hg ci -m0
894 894 committing subrepository s
895 895 Adding with an explicit path in a subrepo adds the file
896 896 $ echo c1 > f1
897 897 $ echo c2 > s/f2
898 898 $ hg st -S
899 899 ? f1
900 900 ? s/f2
901 901 $ hg add s/f2
902 902 $ hg st -S
903 903 A s/f2
904 904 ? f1
905 905 $ hg ci -R s -m0
906 906 $ hg ci -Am1
907 907 adding f1
908 908 committing subrepository s
909 909 Adding with an explicit path in a subrepo with -S has the same behavior
910 910 $ echo c3 > f3
911 911 $ echo c4 > s/f4
912 912 $ hg st -S
913 913 ? f3
914 914 ? s/f4
915 915 $ hg add -S s/f4
916 916 $ hg st -S
917 917 A s/f4
918 918 ? f3
919 919 $ hg ci -R s -m1
920 920 $ hg ci -Ama2
921 921 adding f3
922 922 committing subrepository s
923 923 Adding without a path or pattern silently ignores subrepos
924 924 $ echo c5 > f5
925 925 $ echo c6 > s/f6
926 926 $ echo c7 > s/f7
927 927 $ hg st -S
928 928 ? f5
929 929 ? s/f6
930 930 ? s/f7
931 931 $ hg add
932 932 adding f5
933 933 $ hg st -S
934 934 A f5
935 935 ? s/f6
936 936 ? s/f7
937 937 $ hg ci -R s -Am2
938 938 adding f6
939 939 adding f7
940 940 $ hg ci -m3
941 941 committing subrepository s
942 942 Adding without a path or pattern with -S also adds files in subrepos
943 943 $ echo c8 > f8
944 944 $ echo c9 > s/f9
945 945 $ echo c10 > s/f10
946 946 $ hg st -S
947 947 ? f8
948 948 ? s/f10
949 949 ? s/f9
950 950 $ hg add -S
951 951 adding f8
952 adding s/f10
953 adding s/f9
952 adding s/f10 (glob)
953 adding s/f9 (glob)
954 954 $ hg st -S
955 955 A f8
956 956 A s/f10
957 957 A s/f9
958 958 $ hg ci -R s -m3
959 959 $ hg ci -m4
960 960 committing subrepository s
961 961 Adding with a pattern silently ignores subrepos
962 962 $ echo c11 > fm11
963 963 $ echo c12 > fn12
964 964 $ echo c13 > s/fm13
965 965 $ echo c14 > s/fn14
966 966 $ hg st -S
967 967 ? fm11
968 968 ? fn12
969 969 ? s/fm13
970 970 ? s/fn14
971 971 $ hg add 'glob:**fm*'
972 972 adding fm11
973 973 $ hg st -S
974 974 A fm11
975 975 ? fn12
976 976 ? s/fm13
977 977 ? s/fn14
978 978 $ hg ci -R s -Am4
979 979 adding fm13
980 980 adding fn14
981 981 $ hg ci -Am5
982 982 adding fn12
983 983 committing subrepository s
984 984 Adding with a pattern with -S also adds matches in subrepos
985 985 $ echo c15 > fm15
986 986 $ echo c16 > fn16
987 987 $ echo c17 > s/fm17
988 988 $ echo c18 > s/fn18
989 989 $ hg st -S
990 990 ? fm15
991 991 ? fn16
992 992 ? s/fm17
993 993 ? s/fn18
994 994 $ hg add -S 'glob:**fm*'
995 995 adding fm15
996 adding s/fm17
996 adding s/fm17 (glob)
997 997 $ hg st -S
998 998 A fm15
999 999 A s/fm17
1000 1000 ? fn16
1001 1001 ? s/fn18
1002 1002 $ hg ci -R s -Am5
1003 1003 adding fn18
1004 1004 $ hg ci -Am6
1005 1005 adding fn16
1006 1006 committing subrepository s
1007 1007
1008 1008 Test behavior of forget for explicit path in subrepo:
1009 1009 Forgetting an explicit path in a subrepo untracks the file
1010 1010 $ echo c19 > s/f19
1011 1011 $ hg add s/f19
1012 1012 $ hg st -S
1013 1013 A s/f19
1014 1014 $ hg forget s/f19
1015 1015 $ hg st -S
1016 1016 ? s/f19
1017 1017 $ rm s/f19
@@ -1,298 +1,300 b''
1 $ "$TESTDIR/hghave" system-sh || exit 80
2
1 3 $ hg init test
2 4 $ cd test
3 5
4 6 $ echo a > a
5 7 $ hg add a
6 8 $ hg commit -m "test"
7 9 $ hg history
8 10 changeset: 0:acb14030fe0a
9 11 tag: tip
10 12 user: test
11 13 date: Thu Jan 01 00:00:00 1970 +0000
12 14 summary: test
13 15
14 16
15 17 $ hg tag ' '
16 18 abort: tag names cannot consist entirely of whitespace
17 19 [255]
18 20
19 21 $ hg tag "bleah"
20 22 $ hg history
21 23 changeset: 1:d4f0d2909abc
22 24 tag: tip
23 25 user: test
24 26 date: Thu Jan 01 00:00:00 1970 +0000
25 27 summary: Added tag bleah for changeset acb14030fe0a
26 28
27 29 changeset: 0:acb14030fe0a
28 30 tag: bleah
29 31 user: test
30 32 date: Thu Jan 01 00:00:00 1970 +0000
31 33 summary: test
32 34
33 35
34 36 $ echo foo >> .hgtags
35 37 $ hg tag "bleah2"
36 38 abort: working copy of .hgtags is changed (please commit .hgtags manually)
37 39 [255]
38 40
39 41 $ hg revert .hgtags
40 42 $ hg tag -r 0 x y z y y z
41 43 abort: tag names must be unique
42 44 [255]
43 45 $ hg tag tap nada dot tip null .
44 46 abort: the name 'tip' is reserved
45 47 [255]
46 48 $ hg tag "bleah"
47 49 abort: tag 'bleah' already exists (use -f to force)
48 50 [255]
49 51 $ hg tag "blecch" "bleah"
50 52 abort: tag 'bleah' already exists (use -f to force)
51 53 [255]
52 54
53 55 $ hg tag --remove "blecch"
54 56 abort: tag 'blecch' does not exist
55 57 [255]
56 58 $ hg tag --remove "bleah" "blecch" "blough"
57 59 abort: tag 'blecch' does not exist
58 60 [255]
59 61
60 62 $ hg tag -r 0 "bleah0"
61 63 $ hg tag -l -r 1 "bleah1"
62 64 $ hg tag gack gawk gorp
63 65 $ hg tag -f gack
64 66 $ hg tag --remove gack gorp
65 67
66 68 $ hg tag "bleah "
67 69 abort: tag 'bleah' already exists (use -f to force)
68 70 [255]
69 71 $ hg tag " bleah"
70 72 abort: tag 'bleah' already exists (use -f to force)
71 73 [255]
72 74 $ hg tag " bleah"
73 75 abort: tag 'bleah' already exists (use -f to force)
74 76 [255]
75 77 $ hg tag -r 0 " bleahbleah "
76 78 $ hg tag -r 0 " bleah bleah "
77 79
78 80 $ cat .hgtags
79 81 acb14030fe0a21b60322c440ad2d20cf7685a376 bleah
80 82 acb14030fe0a21b60322c440ad2d20cf7685a376 bleah0
81 83 336fccc858a4eb69609a291105009e484a6b6b8d gack
82 84 336fccc858a4eb69609a291105009e484a6b6b8d gawk
83 85 336fccc858a4eb69609a291105009e484a6b6b8d gorp
84 86 336fccc858a4eb69609a291105009e484a6b6b8d gack
85 87 799667b6f2d9b957f73fa644a918c2df22bab58f gack
86 88 799667b6f2d9b957f73fa644a918c2df22bab58f gack
87 89 0000000000000000000000000000000000000000 gack
88 90 336fccc858a4eb69609a291105009e484a6b6b8d gorp
89 91 0000000000000000000000000000000000000000 gorp
90 92 acb14030fe0a21b60322c440ad2d20cf7685a376 bleahbleah
91 93 acb14030fe0a21b60322c440ad2d20cf7685a376 bleah bleah
92 94
93 95 $ cat .hg/localtags
94 96 d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
95 97
96 98 tagging on a non-head revision
97 99
98 100 $ hg update 0
99 101 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
100 102 $ hg tag -l localblah
101 103 $ hg tag "foobar"
102 104 abort: not at a branch head (use -f to force)
103 105 [255]
104 106 $ hg tag -f "foobar"
105 107 $ cat .hgtags
106 108 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
107 109 $ cat .hg/localtags
108 110 d4f0d2909abc9290e2773c08837d70c1794e3f5a bleah1
109 111 acb14030fe0a21b60322c440ad2d20cf7685a376 localblah
110 112
111 113 $ hg tag -l 'xx
112 114 > newline'
113 115 abort: '\n' cannot be used in a tag name
114 116 [255]
115 117 $ hg tag -l 'xx:xx'
116 118 abort: ':' cannot be used in a tag name
117 119 [255]
118 120
119 121 cloning local tags
120 122
121 123 $ cd ..
122 124 $ hg -R test log -r0:5
123 125 changeset: 0:acb14030fe0a
124 126 tag: bleah
125 127 tag: bleah bleah
126 128 tag: bleah0
127 129 tag: bleahbleah
128 130 tag: foobar
129 131 tag: localblah
130 132 user: test
131 133 date: Thu Jan 01 00:00:00 1970 +0000
132 134 summary: test
133 135
134 136 changeset: 1:d4f0d2909abc
135 137 tag: bleah1
136 138 user: test
137 139 date: Thu Jan 01 00:00:00 1970 +0000
138 140 summary: Added tag bleah for changeset acb14030fe0a
139 141
140 142 changeset: 2:336fccc858a4
141 143 tag: gawk
142 144 user: test
143 145 date: Thu Jan 01 00:00:00 1970 +0000
144 146 summary: Added tag bleah0 for changeset acb14030fe0a
145 147
146 148 changeset: 3:799667b6f2d9
147 149 user: test
148 150 date: Thu Jan 01 00:00:00 1970 +0000
149 151 summary: Added tag gack, gawk, gorp for changeset 336fccc858a4
150 152
151 153 changeset: 4:154eeb7c0138
152 154 user: test
153 155 date: Thu Jan 01 00:00:00 1970 +0000
154 156 summary: Added tag gack for changeset 799667b6f2d9
155 157
156 158 changeset: 5:b4bb47aaff09
157 159 user: test
158 160 date: Thu Jan 01 00:00:00 1970 +0000
159 161 summary: Removed tag gack, gorp
160 162
161 163 $ hg clone -q -rbleah1 test test1
162 164 $ hg -R test1 parents --style=compact
163 165 1[tip] d4f0d2909abc 1970-01-01 00:00 +0000 test
164 166 Added tag bleah for changeset acb14030fe0a
165 167
166 168 $ hg clone -q -r5 test#bleah1 test2
167 169 $ hg -R test2 parents --style=compact
168 170 5[tip] b4bb47aaff09 1970-01-01 00:00 +0000 test
169 171 Removed tag gack, gorp
170 172
171 173 $ hg clone -q -U test#bleah1 test3
172 174 $ hg -R test3 parents --style=compact
173 175
174 176 $ cd test
175 177
176 178 Issue601: hg tag doesn't do the right thing if .hgtags or localtags
177 179 doesn't end with EOL
178 180
179 181 $ python << EOF
180 182 > f = file('.hg/localtags'); last = f.readlines()[-1][:-1]; f.close()
181 183 > f = file('.hg/localtags', 'w'); f.write(last); f.close()
182 184 > EOF
183 185 $ cat .hg/localtags; echo
184 186 acb14030fe0a21b60322c440ad2d20cf7685a376 localblah
185 187 $ hg tag -l localnewline
186 188 $ cat .hg/localtags; echo
187 189 acb14030fe0a21b60322c440ad2d20cf7685a376 localblah
188 190 c2899151f4e76890c602a2597a650a72666681bf localnewline
189 191
190 192
191 193 $ python << EOF
192 194 > f = file('.hgtags'); last = f.readlines()[-1][:-1]; f.close()
193 195 > f = file('.hgtags', 'w'); f.write(last); f.close()
194 196 > EOF
195 197 $ hg ci -m'broken manual edit of .hgtags'
196 198 $ cat .hgtags; echo
197 199 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
198 200 $ hg tag newline
199 201 $ cat .hgtags; echo
200 202 acb14030fe0a21b60322c440ad2d20cf7685a376 foobar
201 203 a0eea09de1eeec777b46f2085260a373b2fbc293 newline
202 204
203 205
204 206 tag and branch using same name
205 207
206 208 $ hg branch tag-and-branch-same-name
207 209 marked working directory as branch tag-and-branch-same-name
208 210 $ hg ci -m"discouraged"
209 211 $ hg tag tag-and-branch-same-name
210 212 warning: tag tag-and-branch-same-name conflicts with existing branch name
211 213
212 214 test custom commit messages
213 215
214 216 $ cat > editor << '__EOF__'
215 217 > #!/bin/sh
216 218 > echo "custom tag message" > "$1"
217 219 > echo "second line" >> "$1"
218 220 > __EOF__
219 221 $ chmod +x editor
220 222 $ HGEDITOR="'`pwd`'"/editor hg tag custom-tag -e
221 223 $ hg log -l1 --template "{desc}\n"
222 224 custom tag message
223 225 second line
224 226
225 227
226 228 local tag with .hgtags modified
227 229
228 230 $ hg tag hgtags-modified
229 231 $ hg rollback
230 232 repository tip rolled back to revision 13 (undo commit)
231 233 working directory now based on revision 13
232 234 $ hg st
233 235 M .hgtags
234 236 ? .hgtags.orig
235 237 ? editor
236 238 $ hg tag --local baz
237 239 $ hg revert --no-backup .hgtags
238 240
239 241
240 242 tagging when at named-branch-head that's not a topo-head
241 243
242 244 $ hg up default
243 245 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
244 246 $ hg merge -t internal:local
245 247 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
246 248 (branch merge, don't forget to commit)
247 249 $ hg ci -m 'merge named branch'
248 250 $ hg up 13
249 251 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
250 252 $ hg tag new-topo-head
251 253
252 254
253 255 tagging on null rev
254 256
255 257 $ hg up null
256 258 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
257 259 $ hg tag nullrev
258 260 abort: not at a branch head (use -f to force)
259 261 [255]
260 262
261 263 $ hg init empty
262 264 $ hg tag -R empty nullrev
263 265
264 266 $ cd ..
265 267
266 268 tagging on an uncommitted merge (issue2542)
267 269
268 270 $ hg init repo-tag-uncommitted-merge
269 271 $ cd repo-tag-uncommitted-merge
270 272 $ echo c1 > f1
271 273 $ hg ci -Am0
272 274 adding f1
273 275 $ echo c2 > f2
274 276 $ hg ci -Am1
275 277 adding f2
276 278 $ hg co -q 0
277 279 $ hg branch b1
278 280 marked working directory as branch b1
279 281 $ hg ci -m2
280 282 $ hg up default
281 283 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
282 284 $ hg merge b1
283 285 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
284 286 (branch merge, don't forget to commit)
285 287
286 288 $ hg tag t1
287 289 abort: uncommitted merge
288 290 [255]
289 291 $ hg status
290 292 $ hg tag --rev 1 t2
291 293 abort: uncommitted merge
292 294 [255]
293 295 $ hg tag --rev 1 --local t3
294 296 $ hg tags -v
295 297 tip 2:2a156e8887cc
296 298 t3 1:c3adabd1a5f4 local
297 299
298 300 $ cd ..
@@ -1,320 +1,320 b''
1 1 $ "$TESTDIR/hghave" no-windows || exit 80
2 2
3 3 $ hg init t
4 4 $ cd t
5 5 $ mkdir -p beans
6 6 $ for b in kidney navy turtle borlotti black pinto; do
7 7 > echo $b > beans/$b
8 8 $ done
9 9 $ mkdir -p mammals/Procyonidae
10 10 $ for m in cacomistle coatimundi raccoon; do
11 11 > echo $m > mammals/Procyonidae/$m
12 12 $ done
13 13 $ echo skunk > mammals/skunk
14 14 $ echo fennel > fennel
15 15 $ echo fenugreek > fenugreek
16 16 $ echo fiddlehead > fiddlehead
17 17 $ echo glob:glob > glob:glob
18 18 $ hg addremove
19 19 adding beans/black
20 20 adding beans/borlotti
21 21 adding beans/kidney
22 22 adding beans/navy
23 23 adding beans/pinto
24 24 adding beans/turtle
25 25 adding fennel
26 26 adding fenugreek
27 27 adding fiddlehead
28 28 adding glob:glob
29 29 adding mammals/Procyonidae/cacomistle
30 30 adding mammals/Procyonidae/coatimundi
31 31 adding mammals/Procyonidae/raccoon
32 32 adding mammals/skunk
33 33 warning: filename contains ':', which is reserved on Windows: 'glob:glob'
34 34 $ hg commit -m "commit #0"
35 35
36 36 $ hg debugwalk
37 37 f beans/black beans/black
38 38 f beans/borlotti beans/borlotti
39 39 f beans/kidney beans/kidney
40 40 f beans/navy beans/navy
41 41 f beans/pinto beans/pinto
42 42 f beans/turtle beans/turtle
43 43 f fennel fennel
44 44 f fenugreek fenugreek
45 45 f fiddlehead fiddlehead
46 46 f glob:glob glob:glob
47 47 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
48 48 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
49 49 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
50 50 f mammals/skunk mammals/skunk
51 51 $ hg debugwalk -I.
52 52 f beans/black beans/black
53 53 f beans/borlotti beans/borlotti
54 54 f beans/kidney beans/kidney
55 55 f beans/navy beans/navy
56 56 f beans/pinto beans/pinto
57 57 f beans/turtle beans/turtle
58 58 f fennel fennel
59 59 f fenugreek fenugreek
60 60 f fiddlehead fiddlehead
61 61 f glob:glob glob:glob
62 62 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
63 63 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
64 64 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
65 65 f mammals/skunk mammals/skunk
66 66
67 67 $ cd mammals
68 68 $ hg debugwalk
69 69 f beans/black ../beans/black
70 70 f beans/borlotti ../beans/borlotti
71 71 f beans/kidney ../beans/kidney
72 72 f beans/navy ../beans/navy
73 73 f beans/pinto ../beans/pinto
74 74 f beans/turtle ../beans/turtle
75 75 f fennel ../fennel
76 76 f fenugreek ../fenugreek
77 77 f fiddlehead ../fiddlehead
78 78 f glob:glob ../glob:glob
79 79 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
80 80 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
81 81 f mammals/Procyonidae/raccoon Procyonidae/raccoon
82 82 f mammals/skunk skunk
83 83 $ hg debugwalk -X ../beans
84 84 f fennel ../fennel
85 85 f fenugreek ../fenugreek
86 86 f fiddlehead ../fiddlehead
87 87 f glob:glob ../glob:glob
88 88 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
89 89 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
90 90 f mammals/Procyonidae/raccoon Procyonidae/raccoon
91 91 f mammals/skunk skunk
92 92 $ hg debugwalk -I '*k'
93 93 f mammals/skunk skunk
94 94 $ hg debugwalk -I 'glob:*k'
95 95 f mammals/skunk skunk
96 96 $ hg debugwalk -I 'relglob:*k'
97 97 f beans/black ../beans/black
98 98 f fenugreek ../fenugreek
99 99 f mammals/skunk skunk
100 100 $ hg debugwalk -I 'relglob:*k' .
101 101 f mammals/skunk skunk
102 102 $ hg debugwalk -I 're:.*k$'
103 103 f beans/black ../beans/black
104 104 f fenugreek ../fenugreek
105 105 f mammals/skunk skunk
106 106 $ hg debugwalk -I 'relre:.*k$'
107 107 f beans/black ../beans/black
108 108 f fenugreek ../fenugreek
109 109 f mammals/skunk skunk
110 110 $ hg debugwalk -I 'path:beans'
111 111 f beans/black ../beans/black
112 112 f beans/borlotti ../beans/borlotti
113 113 f beans/kidney ../beans/kidney
114 114 f beans/navy ../beans/navy
115 115 f beans/pinto ../beans/pinto
116 116 f beans/turtle ../beans/turtle
117 117 $ hg debugwalk -I 'relpath:../beans'
118 118 f beans/black ../beans/black
119 119 f beans/borlotti ../beans/borlotti
120 120 f beans/kidney ../beans/kidney
121 121 f beans/navy ../beans/navy
122 122 f beans/pinto ../beans/pinto
123 123 f beans/turtle ../beans/turtle
124 124 $ hg debugwalk .
125 125 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
126 126 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
127 127 f mammals/Procyonidae/raccoon Procyonidae/raccoon
128 128 f mammals/skunk skunk
129 129 $ hg debugwalk -I.
130 130 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
131 131 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
132 132 f mammals/Procyonidae/raccoon Procyonidae/raccoon
133 133 f mammals/skunk skunk
134 134 $ hg debugwalk Procyonidae
135 135 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
136 136 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
137 137 f mammals/Procyonidae/raccoon Procyonidae/raccoon
138 138
139 139 $ cd Procyonidae
140 140 $ hg debugwalk .
141 141 f mammals/Procyonidae/cacomistle cacomistle
142 142 f mammals/Procyonidae/coatimundi coatimundi
143 143 f mammals/Procyonidae/raccoon raccoon
144 144 $ hg debugwalk ..
145 145 f mammals/Procyonidae/cacomistle cacomistle
146 146 f mammals/Procyonidae/coatimundi coatimundi
147 147 f mammals/Procyonidae/raccoon raccoon
148 148 f mammals/skunk ../skunk
149 149 $ cd ..
150 150
151 151 $ hg debugwalk ../beans
152 152 f beans/black ../beans/black
153 153 f beans/borlotti ../beans/borlotti
154 154 f beans/kidney ../beans/kidney
155 155 f beans/navy ../beans/navy
156 156 f beans/pinto ../beans/pinto
157 157 f beans/turtle ../beans/turtle
158 158 $ hg debugwalk .
159 159 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
160 160 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
161 161 f mammals/Procyonidae/raccoon Procyonidae/raccoon
162 162 f mammals/skunk skunk
163 163 $ hg debugwalk .hg
164 164 abort: path 'mammals/.hg' is inside nested repo 'mammals'
165 165 [255]
166 166 $ hg debugwalk ../.hg
167 167 abort: path contains illegal component: .hg
168 168 [255]
169 169 $ cd ..
170 170
171 171 $ hg debugwalk -Ibeans
172 172 f beans/black beans/black
173 173 f beans/borlotti beans/borlotti
174 174 f beans/kidney beans/kidney
175 175 f beans/navy beans/navy
176 176 f beans/pinto beans/pinto
177 177 f beans/turtle beans/turtle
178 178 $ hg debugwalk -I '{*,{b,m}*/*}k'
179 179 f beans/black beans/black
180 180 f fenugreek fenugreek
181 181 f mammals/skunk mammals/skunk
182 182 $ hg debugwalk 'glob:mammals/../beans/b*'
183 183 f beans/black beans/black
184 184 f beans/borlotti beans/borlotti
185 185 $ hg debugwalk '-X*/Procyonidae' mammals
186 186 f mammals/skunk mammals/skunk
187 187 $ hg debugwalk path:mammals
188 188 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
189 189 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
190 190 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
191 191 f mammals/skunk mammals/skunk
192 192 $ hg debugwalk ..
193 193 abort: .. not under root
194 194 [255]
195 195 $ hg debugwalk beans/../..
196 196 abort: beans/../.. not under root
197 197 [255]
198 198 $ hg debugwalk .hg
199 199 abort: path contains illegal component: .hg
200 200 [255]
201 201 $ hg debugwalk beans/../.hg
202 202 abort: path contains illegal component: .hg
203 203 [255]
204 204 $ hg debugwalk beans/../.hg/data
205 205 abort: path contains illegal component: .hg/data
206 206 [255]
207 207 $ hg debugwalk beans/.hg
208 208 abort: path 'beans/.hg' is inside nested repo 'beans'
209 209 [255]
210 210
211 211 Test absolute paths:
212 212
213 213 $ hg debugwalk `pwd`/beans
214 214 f beans/black beans/black
215 215 f beans/borlotti beans/borlotti
216 216 f beans/kidney beans/kidney
217 217 f beans/navy beans/navy
218 218 f beans/pinto beans/pinto
219 219 f beans/turtle beans/turtle
220 220 $ hg debugwalk `pwd`/..
221 221 abort: $TESTTMP/t/.. not under root
222 222 [255]
223 223
224 224 Test patterns:
225 225
226 226 $ hg debugwalk glob:\*
227 227 f fennel fennel
228 228 f fenugreek fenugreek
229 229 f fiddlehead fiddlehead
230 230 f glob:glob glob:glob
231 231
232 232 $ hg debugwalk 'glob:**e'
233 233 f beans/turtle beans/turtle
234 234 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
235 235
236 236 $ hg debugwalk 're:.*[kb]$'
237 237 f beans/black beans/black
238 238 f fenugreek fenugreek
239 239 f glob:glob glob:glob
240 240 f mammals/skunk mammals/skunk
241 241
242 242 $ hg debugwalk path:beans/black
243 243 f beans/black beans/black exact
244 244 $ hg debugwalk path:beans//black
245 245 f beans/black beans/black exact
246 246
247 247 $ hg debugwalk relglob:Procyonidae
248 248 $ hg debugwalk 'relglob:Procyonidae/**'
249 249 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
250 250 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
251 251 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
252 252 $ hg debugwalk 'relglob:Procyonidae/**' fennel
253 253 f fennel fennel exact
254 254 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
255 255 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
256 256 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
257 257 $ hg debugwalk beans 'glob:beans/*'
258 258 f beans/black beans/black
259 259 f beans/borlotti beans/borlotti
260 260 f beans/kidney beans/kidney
261 261 f beans/navy beans/navy
262 262 f beans/pinto beans/pinto
263 263 f beans/turtle beans/turtle
264 264 $ hg debugwalk 'glob:mamm**'
265 265 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
266 266 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
267 267 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
268 268 f mammals/skunk mammals/skunk
269 269 $ hg debugwalk 'glob:mamm**' fennel
270 270 f fennel fennel exact
271 271 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
272 272 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
273 273 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
274 274 f mammals/skunk mammals/skunk
275 275 $ hg debugwalk 'glob:j*'
276 276 $ hg debugwalk NOEXIST
277 NOEXIST: No such file or directory
277 NOEXIST: * (glob)
278 278
279 279 $ mkfifo fifo
280 280 $ hg debugwalk fifo
281 281 fifo: unsupported file type (type is fifo)
282 282
283 283 $ rm fenugreek
284 284 $ hg debugwalk fenugreek
285 285 f fenugreek fenugreek exact
286 286 $ hg rm fenugreek
287 287 $ hg debugwalk fenugreek
288 288 f fenugreek fenugreek exact
289 289 $ touch new
290 290 $ hg debugwalk new
291 291 f new new exact
292 292
293 293 $ mkdir ignored
294 294 $ touch ignored/file
295 295 $ echo '^ignored$' > .hgignore
296 296 $ hg debugwalk ignored
297 297 $ hg debugwalk ignored/file
298 298 f ignored/file ignored/file exact
299 299
300 300 Test listfile and listfile0
301 301
302 302 $ python -c "file('../listfile0', 'wb').write('fenugreek\0new\0')"
303 303 $ hg debugwalk -I 'listfile0:../listfile0'
304 304 f fenugreek fenugreek
305 305 f new new
306 306 $ python -c "file('../listfile', 'wb').write('fenugreek\nnew\r\nmammals/skunk\n')"
307 307 $ hg debugwalk -I 'listfile:../listfile'
308 308 f fenugreek fenugreek
309 309 f mammals/skunk mammals/skunk
310 310 f new new
311 311
312 312 $ cd ..
313 313 $ hg debugwalk -R t t/mammals/skunk
314 314 f mammals/skunk t/mammals/skunk exact
315 315 $ mkdir t2
316 316 $ cd t2
317 317 $ hg debugwalk -R ../t ../t/mammals/skunk
318 318 f mammals/skunk ../t/mammals/skunk exact
319 319 $ hg debugwalk --cwd ../t mammals/skunk
320 320 f mammals/skunk mammals/skunk exact
@@ -1,424 +1,424 b''
1 1
2 2 $ hg init t
3 3 $ cd t
4 4 $ cat > unix2dos.py <<EOF
5 5 > import sys
6 6 >
7 7 > for path in sys.argv[1:]:
8 8 > data = file(path, 'rb').read()
9 9 > data = data.replace('\n', '\r\n')
10 10 > file(path, 'wb').write(data)
11 11 > EOF
12 12 $ echo '[hooks]' >> .hg/hgrc
13 13 $ echo 'pretxncommit.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc
14 14 $ echo 'pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc
15 15 $ cat .hg/hgrc
16 16 [hooks]
17 17 pretxncommit.crlf = python:hgext.win32text.forbidcrlf
18 18 pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf
19 19
20 20 $ echo hello > f
21 21 $ hg add f
22 22
23 23 commit should succeed
24 24
25 25 $ hg ci -m 1
26 26
27 27 $ hg clone . ../zoz
28 28 updating to branch default
29 29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 30 $ cp .hg/hgrc ../zoz/.hg
31 31 $ python unix2dos.py f
32 32
33 33 commit should fail
34 34
35 35 $ hg ci -m 2.1
36 36 Attempt to commit or push text file(s) using CRLF line endings
37 37 in f583ea08d42a: f
38 38 transaction abort!
39 39 rollback completed
40 40 abort: pretxncommit.crlf hook failed
41 41 [255]
42 42
43 43 $ mv .hg/hgrc .hg/hgrc.bak
44 44
45 45 commits should succeed
46 46
47 47 $ hg ci -m 2
48 48 $ hg cp f g
49 49 $ hg ci -m 2.2
50 50
51 51 push should fail
52 52
53 53 $ hg push ../zoz
54 54 pushing to ../zoz
55 55 searching for changes
56 56 adding changesets
57 57 adding manifests
58 58 adding file changes
59 59 added 2 changesets with 2 changes to 2 files
60 60 Attempt to commit or push text file(s) using CRLF line endings
61 61 in bc2d09796734: g
62 62 in b1aa5cde7ff4: f
63 63
64 64 To prevent this mistake in your local repository,
65 65 add to Mercurial.ini or .hg/hgrc:
66 66
67 67 [hooks]
68 68 pretxncommit.crlf = python:hgext.win32text.forbidcrlf
69 69
70 70 and also consider adding:
71 71
72 72 [extensions]
73 73 win32text =
74 74 [encode]
75 75 ** = cleverencode:
76 76 [decode]
77 77 ** = cleverdecode:
78 78 transaction abort!
79 79 rollback completed
80 80 abort: pretxnchangegroup.crlf hook failed
81 81 [255]
82 82
83 83 $ mv .hg/hgrc.bak .hg/hgrc
84 84 $ echo hello > f
85 85 $ hg rm g
86 86
87 87 commit should succeed
88 88
89 89 $ hg ci -m 2.3
90 90
91 91 push should succeed
92 92
93 93 $ hg push ../zoz
94 94 pushing to ../zoz
95 95 searching for changes
96 96 adding changesets
97 97 adding manifests
98 98 adding file changes
99 99 added 3 changesets with 3 changes to 2 files
100 100
101 101 and now for something completely different
102 102
103 103 $ mkdir d
104 104 $ echo hello > d/f2
105 105 $ python unix2dos.py d/f2
106 106 $ hg add d/f2
107 107 $ hg ci -m 3
108 108 Attempt to commit or push text file(s) using CRLF line endings
109 109 in 053ba1a3035a: d/f2
110 110 transaction abort!
111 111 rollback completed
112 112 abort: pretxncommit.crlf hook failed
113 113 [255]
114 114 $ hg revert -a
115 forgetting d/f2
115 forgetting d/f2 (glob)
116 116 $ rm d/f2
117 117
118 118 $ hg rem f
119 119 $ hg ci -m 4
120 120
121 121 $ python -c 'file("bin", "wb").write("hello\x00\x0D\x0A")'
122 122 $ hg add bin
123 123 $ hg ci -m 5
124 124 $ hg log -v
125 125 changeset: 5:f0b1c8d75fce
126 126 tag: tip
127 127 user: test
128 128 date: Thu Jan 01 00:00:00 1970 +0000
129 129 files: bin
130 130 description:
131 131 5
132 132
133 133
134 134 changeset: 4:77796dbcd4ad
135 135 user: test
136 136 date: Thu Jan 01 00:00:00 1970 +0000
137 137 files: f
138 138 description:
139 139 4
140 140
141 141
142 142 changeset: 3:7c1b5430b350
143 143 user: test
144 144 date: Thu Jan 01 00:00:00 1970 +0000
145 145 files: f g
146 146 description:
147 147 2.3
148 148
149 149
150 150 changeset: 2:bc2d09796734
151 151 user: test
152 152 date: Thu Jan 01 00:00:00 1970 +0000
153 153 files: g
154 154 description:
155 155 2.2
156 156
157 157
158 158 changeset: 1:b1aa5cde7ff4
159 159 user: test
160 160 date: Thu Jan 01 00:00:00 1970 +0000
161 161 files: f
162 162 description:
163 163 2
164 164
165 165
166 166 changeset: 0:fcf06d5c4e1d
167 167 user: test
168 168 date: Thu Jan 01 00:00:00 1970 +0000
169 169 files: f
170 170 description:
171 171 1
172 172
173 173
174 174 $ hg clone . dupe
175 175 updating to branch default
176 176 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
177 177
178 178 $ for x in a b c d; do echo content > dupe/$x; done
179 179 $ hg -R dupe add
180 adding dupe/a
181 adding dupe/b
182 adding dupe/c
183 adding dupe/d
180 adding dupe/a (glob)
181 adding dupe/b (glob)
182 adding dupe/c (glob)
183 adding dupe/d (glob)
184 184 $ python unix2dos.py dupe/b dupe/c dupe/d
185 185 $ hg -R dupe ci -m a dupe/a
186 186 $ hg -R dupe ci -m b/c dupe/[bc]
187 187 $ hg -R dupe ci -m d dupe/d
188 188 $ hg -R dupe log -v
189 189 changeset: 8:67ac5962ab43
190 190 tag: tip
191 191 user: test
192 192 date: Thu Jan 01 00:00:00 1970 +0000
193 193 files: d
194 194 description:
195 195 d
196 196
197 197
198 198 changeset: 7:68c127d1834e
199 199 user: test
200 200 date: Thu Jan 01 00:00:00 1970 +0000
201 201 files: b c
202 202 description:
203 203 b/c
204 204
205 205
206 206 changeset: 6:adbf8bf7f31d
207 207 user: test
208 208 date: Thu Jan 01 00:00:00 1970 +0000
209 209 files: a
210 210 description:
211 211 a
212 212
213 213
214 214 changeset: 5:f0b1c8d75fce
215 215 user: test
216 216 date: Thu Jan 01 00:00:00 1970 +0000
217 217 files: bin
218 218 description:
219 219 5
220 220
221 221
222 222 changeset: 4:77796dbcd4ad
223 223 user: test
224 224 date: Thu Jan 01 00:00:00 1970 +0000
225 225 files: f
226 226 description:
227 227 4
228 228
229 229
230 230 changeset: 3:7c1b5430b350
231 231 user: test
232 232 date: Thu Jan 01 00:00:00 1970 +0000
233 233 files: f g
234 234 description:
235 235 2.3
236 236
237 237
238 238 changeset: 2:bc2d09796734
239 239 user: test
240 240 date: Thu Jan 01 00:00:00 1970 +0000
241 241 files: g
242 242 description:
243 243 2.2
244 244
245 245
246 246 changeset: 1:b1aa5cde7ff4
247 247 user: test
248 248 date: Thu Jan 01 00:00:00 1970 +0000
249 249 files: f
250 250 description:
251 251 2
252 252
253 253
254 254 changeset: 0:fcf06d5c4e1d
255 255 user: test
256 256 date: Thu Jan 01 00:00:00 1970 +0000
257 257 files: f
258 258 description:
259 259 1
260 260
261 261
262 262 $ hg pull dupe
263 263 pulling from dupe
264 264 searching for changes
265 265 adding changesets
266 266 adding manifests
267 267 adding file changes
268 268 added 3 changesets with 4 changes to 4 files
269 269 Attempt to commit or push text file(s) using CRLF line endings
270 270 in 67ac5962ab43: d
271 271 in 68c127d1834e: b
272 272 in 68c127d1834e: c
273 273
274 274 To prevent this mistake in your local repository,
275 275 add to Mercurial.ini or .hg/hgrc:
276 276
277 277 [hooks]
278 278 pretxncommit.crlf = python:hgext.win32text.forbidcrlf
279 279
280 280 and also consider adding:
281 281
282 282 [extensions]
283 283 win32text =
284 284 [encode]
285 285 ** = cleverencode:
286 286 [decode]
287 287 ** = cleverdecode:
288 288 transaction abort!
289 289 rollback completed
290 290 abort: pretxnchangegroup.crlf hook failed
291 291 [255]
292 292
293 293 $ hg log -v
294 294 changeset: 5:f0b1c8d75fce
295 295 tag: tip
296 296 user: test
297 297 date: Thu Jan 01 00:00:00 1970 +0000
298 298 files: bin
299 299 description:
300 300 5
301 301
302 302
303 303 changeset: 4:77796dbcd4ad
304 304 user: test
305 305 date: Thu Jan 01 00:00:00 1970 +0000
306 306 files: f
307 307 description:
308 308 4
309 309
310 310
311 311 changeset: 3:7c1b5430b350
312 312 user: test
313 313 date: Thu Jan 01 00:00:00 1970 +0000
314 314 files: f g
315 315 description:
316 316 2.3
317 317
318 318
319 319 changeset: 2:bc2d09796734
320 320 user: test
321 321 date: Thu Jan 01 00:00:00 1970 +0000
322 322 files: g
323 323 description:
324 324 2.2
325 325
326 326
327 327 changeset: 1:b1aa5cde7ff4
328 328 user: test
329 329 date: Thu Jan 01 00:00:00 1970 +0000
330 330 files: f
331 331 description:
332 332 2
333 333
334 334
335 335 changeset: 0:fcf06d5c4e1d
336 336 user: test
337 337 date: Thu Jan 01 00:00:00 1970 +0000
338 338 files: f
339 339 description:
340 340 1
341 341
342 342
343 343 $ rm .hg/hgrc
344 344 $ (echo some; echo text) > f3
345 345 $ python -c 'file("f4.bat", "wb").write("rem empty\x0D\x0A")'
346 346 $ hg add f3 f4.bat
347 347 $ hg ci -m 6
348 348 $ cat bin
349 349 hello\x00\r (esc)
350 350 $ cat f3
351 351 some
352 352 text
353 353 $ cat f4.bat
354 354 rem empty\r (esc)
355 355
356 356 $ echo '[extensions]' >> .hg/hgrc
357 357 $ echo 'win32text = ' >> .hg/hgrc
358 358 $ echo '[decode]' >> .hg/hgrc
359 359 $ echo '** = cleverdecode:' >> .hg/hgrc
360 360 $ echo '[encode]' >> .hg/hgrc
361 361 $ echo '** = cleverencode:' >> .hg/hgrc
362 362 $ cat .hg/hgrc
363 363 [extensions]
364 364 win32text =
365 365 [decode]
366 366 ** = cleverdecode:
367 367 [encode]
368 368 ** = cleverencode:
369 369
370 370 Trigger deprecation warning:
371 371
372 372 $ hg id -t
373 373 win32text is deprecated: http://mercurial.selenic.com/wiki/Win32TextExtension
374 374 tip
375 375
376 376 Disable warning:
377 377
378 378 $ echo '[win32text]' >> .hg/hgrc
379 379 $ echo 'warn = no' >> .hg/hgrc
380 380 $ hg id -t
381 381 tip
382 382
383 383 $ rm f3 f4.bat bin
384 384 $ hg co -C
385 385 WARNING: f4.bat already has CRLF line endings
386 386 and does not need EOL conversion by the win32text plugin.
387 387 Before your next commit, please reconsider your encode/decode settings in
388 388 Mercurial.ini or $TESTTMP/t/.hg/hgrc. (glob)
389 389 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
390 390 $ cat bin
391 391 hello\x00\r (esc)
392 392 $ cat f3
393 393 some\r (esc)
394 394 text\r (esc)
395 395 $ cat f4.bat
396 396 rem empty\r (esc)
397 397
398 398 $ python -c 'file("f5.sh", "wb").write("# empty\x0D\x0A")'
399 399 $ hg add f5.sh
400 400 $ hg ci -m 7
401 401 $ cat f5.sh
402 402 # empty\r (esc)
403 403 $ hg cat f5.sh
404 404 # empty
405 405 $ echo '% just linefeed' > linefeed
406 406 $ hg ci -qAm 8 linefeed
407 407 $ cat linefeed
408 408 % just linefeed
409 409 $ hg cat linefeed
410 410 % just linefeed
411 411 $ hg st -q
412 412 $ hg revert -a linefeed
413 413 no changes needed to linefeed
414 414 $ cat linefeed
415 415 % just linefeed
416 416 $ hg st -q
417 417 $ echo modified >> linefeed
418 418 $ hg st -q
419 419 M linefeed
420 420 $ hg revert -a
421 421 reverting linefeed
422 422 $ hg st -q
423 423 $ cat linefeed
424 424 % just linefeed\r (esc)
General Comments 0
You need to be logged in to leave comments. Login now