Show More
@@ -0,0 +1,38 b'' | |||
|
1 | #!/bin/sh | |
|
2 | ||
|
3 | try() { | |
|
4 | echo '% hg debugrevspec' $@ | |
|
5 | hg debugrevspec $@ | |
|
6 | } | |
|
7 | ||
|
8 | hg init repo | |
|
9 | cd repo | |
|
10 | hg branch a | |
|
11 | hg ci -m "plain name" | |
|
12 | hg branch b | |
|
13 | hg ci -m "another plain name" | |
|
14 | hg branch a-b-c- | |
|
15 | hg ci -m "with dashes" | |
|
16 | hg branch -- -a-b-c- | |
|
17 | hg ci -m "with leading dash" | |
|
18 | hg branch +a+b+c+ | |
|
19 | hg ci -m "with plusses" | |
|
20 | hg branch /a/b/c/ | |
|
21 | hg ci -m "with slashes" | |
|
22 | hg branch _a_b_c_ | |
|
23 | hg ci -m "with underscores" | |
|
24 | hg branch .a.b.c. | |
|
25 | hg ci -m "with dots" | |
|
26 | ||
|
27 | # names that should work without quoting | |
|
28 | try a | |
|
29 | try b-a | |
|
30 | try _a_b_c_ | |
|
31 | try _a_b_c_-a | |
|
32 | try .a.b.c. | |
|
33 | try .a.b.c.-a | |
|
34 | ||
|
35 | # quoting needed | |
|
36 | try '"-a-b-c-"' | |
|
37 | try '"-a-b-c-"-a' | |
|
38 |
@@ -0,0 +1,24 b'' | |||
|
1 | marked working directory as branch a | |
|
2 | marked working directory as branch b | |
|
3 | marked working directory as branch a-b-c- | |
|
4 | marked working directory as branch -a-b-c- | |
|
5 | marked working directory as branch +a+b+c+ | |
|
6 | marked working directory as branch /a/b/c/ | |
|
7 | marked working directory as branch _a_b_c_ | |
|
8 | marked working directory as branch .a.b.c. | |
|
9 | % hg debugrevspec a | |
|
10 | 0 | |
|
11 | % hg debugrevspec b-a | |
|
12 | 1 | |
|
13 | % hg debugrevspec _a_b_c_ | |
|
14 | 6 | |
|
15 | % hg debugrevspec _a_b_c_-a | |
|
16 | 6 | |
|
17 | % hg debugrevspec .a.b.c. | |
|
18 | 7 | |
|
19 | % hg debugrevspec .a.b.c.-a | |
|
20 | 7 | |
|
21 | % hg debugrevspec "-a-b-c-" | |
|
22 | 3 | |
|
23 | % hg debugrevspec "-a-b-c-"-a | |
|
24 | 3 |
@@ -78,6 +78,9 b' def _runpager(p):' | |||
|
78 | 78 | raise |
|
79 | 79 | |
|
80 | 80 | def uisetup(ui): |
|
81 | if ui.plain(): | |
|
82 | return | |
|
83 | ||
|
81 | 84 | def pagecmd(orig, ui, options, cmd, cmdfunc): |
|
82 | 85 | p = ui.config("pager", "pager", os.environ.get("PAGER")) |
|
83 | 86 | if p and sys.stdout.isatty() and '--debugger' not in sys.argv: |
@@ -235,7 +235,15 b' def patchbomb(ui, repo, *revs, **opts):' | |||
|
235 | 235 | |
|
236 | 236 | _charsets = mail._charsets(ui) |
|
237 | 237 | |
|
238 | def outgoing(dest, revs): | |
|
238 | bundle = opts.get('bundle') | |
|
239 | date = opts.get('date') | |
|
240 | mbox = opts.get('mbox') | |
|
241 | outgoing = opts.get('outgoing') | |
|
242 | rev = opts.get('rev') | |
|
243 | # internal option used by pbranches | |
|
244 | patches = opts.get('patches') | |
|
245 | ||
|
246 | def getoutgoing(dest, revs): | |
|
239 | 247 | '''Return the revisions present locally but not in dest''' |
|
240 | 248 | dest = ui.expandpath(dest or 'default-push', dest or 'default') |
|
241 | 249 | dest, branches = hg.parseurl(dest) |
@@ -271,38 +279,36 b' def patchbomb(ui, repo, *revs, **opts):' | |||
|
271 | 279 | pass |
|
272 | 280 | os.rmdir(tmpdir) |
|
273 | 281 | |
|
274 |
if not (opts.get('test') or |
|
|
282 | if not (opts.get('test') or mbox): | |
|
275 | 283 | # really sending |
|
276 | 284 | mail.validateconfig(ui) |
|
277 | 285 | |
|
278 | if not (revs or opts.get('rev') | |
|
279 | or opts.get('outgoing') or opts.get('bundle') | |
|
280 | or opts.get('patches')): | |
|
286 | if not (revs or rev or outgoing or bundle or patches): | |
|
281 | 287 | raise util.Abort(_('specify at least one changeset with -r or -o')) |
|
282 | 288 | |
|
283 |
if |
|
|
289 | if outgoing and bundle: | |
|
284 | 290 | raise util.Abort(_("--outgoing mode always on with --bundle;" |
|
285 | 291 | " do not re-specify --outgoing")) |
|
286 | 292 | |
|
287 |
if |
|
|
293 | if outgoing or bundle: | |
|
288 | 294 | if len(revs) > 1: |
|
289 | 295 | raise util.Abort(_("too many destinations")) |
|
290 | 296 | dest = revs and revs[0] or None |
|
291 | 297 | revs = [] |
|
292 | 298 | |
|
293 |
if |
|
|
299 | if rev: | |
|
294 | 300 | if revs: |
|
295 | 301 | raise util.Abort(_('use only one form to specify the revision')) |
|
296 |
revs = |
|
|
302 | revs = rev | |
|
297 | 303 | |
|
298 |
if |
|
|
299 |
revs = outgoing(dest, |
|
|
300 |
if |
|
|
304 | if outgoing: | |
|
305 | revs = getoutgoing(dest, rev) | |
|
306 | if bundle: | |
|
301 | 307 | opts['revs'] = revs |
|
302 | 308 | |
|
303 | 309 | # start |
|
304 |
if |
|
|
305 |
start_time = util.parsedate( |
|
|
310 | if date: | |
|
311 | start_time = util.parsedate(date) | |
|
306 | 312 | else: |
|
307 | 313 | start_time = util.makedate() |
|
308 | 314 | |
@@ -381,11 +387,9 b' def patchbomb(ui, repo, *revs, **opts):' | |||
|
381 | 387 | ui.config('patchbomb', 'from') or |
|
382 | 388 | prompt(ui, 'From', ui.username())) |
|
383 | 389 | |
|
384 | # internal option used by pbranches | |
|
385 | patches = opts.get('patches') | |
|
386 | 390 | if patches: |
|
387 | 391 | msgs = getpatchmsgs(patches, opts.get('patchnames')) |
|
388 |
elif |
|
|
392 | elif bundle: | |
|
389 | 393 | msgs = getbundlemsgs(getbundle(dest)) |
|
390 | 394 | else: |
|
391 | 395 | msgs = getpatchmsgs(list(getpatches(revs))) |
@@ -463,9 +467,9 b' def patchbomb(ui, repo, *revs, **opts):' | |||
|
463 | 467 | raise |
|
464 | 468 | if fp is not ui: |
|
465 | 469 | fp.close() |
|
466 |
elif |
|
|
470 | elif mbox: | |
|
467 | 471 | ui.status(_('Writing '), subj, ' ...\n') |
|
468 |
fp = open( |
|
|
472 | fp = open(mbox, 'In-Reply-To' in m and 'ab+' or 'wb+') | |
|
469 | 473 | generator = email.Generator.Generator(fp, mangle_from_=True) |
|
470 | 474 | # Should be time.asctime(), but Windows prints 2-characters day |
|
471 | 475 | # of month instead of one. Make them print the same thing. |
@@ -341,7 +341,7 b' class transplanter(object):' | |||
|
341 | 341 | node = revlog.bin(line[10:]) |
|
342 | 342 | elif line.startswith('# Parent '): |
|
343 | 343 | parents.append(revlog.bin(line[9:])) |
|
344 | elif not line.startswith('#'): | |
|
344 | elif not line.startswith('# '): | |
|
345 | 345 | inmsg = True |
|
346 | 346 | message.append(line) |
|
347 | 347 | return (node, user, date, '\n'.join(message), parents) |
@@ -163,12 +163,13 b' def revrange(repo, revs):' | |||
|
163 | 163 | seen.add(rev) |
|
164 | 164 | l.append(rev) |
|
165 | 165 | continue |
|
166 | elif spec in repo: # single unquoted rev | |
|
166 | elif spec and spec in repo: # single unquoted rev | |
|
167 | 167 | rev = revfix(repo, spec, None) |
|
168 | 168 | if rev in seen: |
|
169 | 169 | continue |
|
170 | 170 | seen.add(rev) |
|
171 | 171 | l.append(rev) |
|
172 | continue | |
|
172 | 173 | except error.RepoLookupError: |
|
173 | 174 | pass |
|
174 | 175 |
@@ -22,6 +22,19 b' On Unix, these files are read:' | |||
|
22 | 22 | - ``<install-root>/etc/mercurial/hgrc`` |
|
23 | 23 | - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` |
|
24 | 24 | |
|
25 | If there is a per-repository configuration file which is not owned by | |
|
26 | the active user, Mercurial will warn you that the file is skipped:: | |
|
27 | ||
|
28 | not trusting file <repo>/.hg/hgrc from untrusted user USER, group GROUP | |
|
29 | ||
|
30 | If this bothers you, the warning can be silenced (the file would still | |
|
31 | be ignored) or trust can be established. Use one of the following | |
|
32 | settings, the syntax is explained below: | |
|
33 | ||
|
34 | - ``ui.report_untrusted = False`` | |
|
35 | - ``trusted.users = USER`` | |
|
36 | - ``trusted.groups = GROUP`` | |
|
37 | ||
|
25 | 38 | The configuration files for Mercurial use a simple ini-file format. A |
|
26 | 39 | configuration file consists of sections, led by a ``[section]`` header |
|
27 | 40 | and followed by ``name = value`` entries:: |
@@ -467,7 +467,8 b' def update(repo, node, branchmerge, forc' | |||
|
467 | 467 | raise util.Abort(_("outstanding uncommitted merges")) |
|
468 | 468 | if branchmerge: |
|
469 | 469 | if pa == p2: |
|
470 |
raise util.Abort(_(" |
|
|
470 | raise util.Abort(_("merging with a working directory ancestor" | |
|
471 | " has no effect")) | |
|
471 | 472 | elif pa == p1: |
|
472 | 473 | if p1.branch() != p2.branch(): |
|
473 | 474 | fastforward = True |
@@ -62,13 +62,13 b' class parser(object):' | |||
|
62 | 62 | expr = (suffix[0], expr) |
|
63 | 63 | else: |
|
64 | 64 | # handle infix rules |
|
65 |
i |
|
|
65 | if len(e) < 3 or not e[2]: | |
|
66 | raise error.ParseError("not an infix: %s" % token, pos) | |
|
67 | infix = e[2] | |
|
66 | 68 | if len(infix) == 3 and infix[2] == self.current[0]: |
|
67 | 69 | self._match(infix[2], pos) |
|
68 | 70 | expr = (infix[0], expr, (None)) |
|
69 | 71 | else: |
|
70 | if not infix[0]: | |
|
71 | raise error.ParseError("not an infix: %s" % token, pos) | |
|
72 | 72 | expr = (infix[0], expr, self._parse(infix[1])) |
|
73 | 73 | if len(infix) == 3: |
|
74 | 74 | self._match(infix[2], pos) |
@@ -369,7 +369,7 b' class ui(object):' | |||
|
369 | 369 | if not getattr(sys.stderr, 'closed', False): |
|
370 | 370 | sys.stderr.flush() |
|
371 | 371 | except IOError, inst: |
|
372 |
if inst.errno |
|
|
372 | if inst.errno not in (errno.EPIPE, errno.EIO): | |
|
373 | 373 | raise |
|
374 | 374 | |
|
375 | 375 | def flush(self): |
@@ -556,6 +556,13 b' class httpdigestauthhandler(urllib2.HTTP' | |||
|
556 | 556 | return |
|
557 | 557 | raise |
|
558 | 558 | |
|
559 | # Python 2.6.5 will keep resetting the retry count on redirects, for | |
|
560 | # example when the server returns 401 on failing auth (like google code | |
|
561 | # currently does). We stop the endless recursion by not resetting the | |
|
562 | # count. | |
|
563 | def reset_retry_count(self): | |
|
564 | pass | |
|
565 | ||
|
559 | 566 | def getauthinfo(path): |
|
560 | 567 | scheme, netloc, urlpath, query, frag = urlparse.urlsplit(path) |
|
561 | 568 | if not urlpath: |
@@ -296,31 +296,31 b' rename to bar' | |||
|
296 | 296 | EOF |
|
297 | 297 | cd .. |
|
298 | 298 | |
|
299 | echo '% test import with similarity (issue295)' | |
|
299 | echo '% test import with similarity and git and strip (issue295 et al.)' | |
|
300 | 300 | hg init sim |
|
301 | 301 | cd sim |
|
302 | 302 | echo 'this is a test' > a |
|
303 | 303 | hg ci -Ama |
|
304 | 304 | cat > ../rename.diff <<EOF |
|
305 | diff --git a/a b/a | |
|
305 | diff --git a/foo/a b/foo/a | |
|
306 | 306 | deleted file mode 100644 |
|
307 | --- a/a | |
|
307 | --- a/foo/a | |
|
308 | 308 | +++ /dev/null |
|
309 | 309 | @@ -1,1 +0,0 @@ |
|
310 | 310 | -this is a test |
|
311 | diff --git a/b b/b | |
|
311 | diff --git a/foo/b b/foo/b | |
|
312 | 312 | new file mode 100644 |
|
313 | 313 | --- /dev/null |
|
314 | +++ b/b | |
|
314 | +++ b/foo/b | |
|
315 | 315 | @@ -0,0 +1,2 @@ |
|
316 | 316 | +this is a test |
|
317 | 317 | +foo |
|
318 | 318 | EOF |
|
319 | hg import --no-commit -v -s 1 ../rename.diff | |
|
319 | hg import --no-commit -v -s 1 ../rename.diff -p2 | |
|
320 | 320 | hg st -C |
|
321 | 321 | hg revert -a |
|
322 | 322 | rm b |
|
323 | hg import --no-commit -v -s 100 ../rename.diff | |
|
323 | hg import --no-commit -v -s 100 ../rename.diff -p2 | |
|
324 | 324 | hg st -C |
|
325 | 325 | cd .. |
|
326 | 326 |
@@ -279,7 +279,7 b' bb' | |||
|
279 | 279 | % test paths outside repo root |
|
280 | 280 | applying patch from stdin |
|
281 | 281 | abort: ../outside/foo not under root |
|
282 | % test import with similarity (issue295) | |
|
282 | % test import with similarity and git and strip (issue295 et al.) | |
|
283 | 283 | adding a |
|
284 | 284 | applying ../rename.diff |
|
285 | 285 | patching file a |
General Comments 0
You need to be logged in to leave comments.
Login now