Show More
@@ -26,8 +26,7 b' whitespace.' | |||||
26 |
|
26 | |||
27 | Other effects in addition to color, like bold and underlined text, are |
|
27 | Other effects in addition to color, like bold and underlined text, are | |
28 | also available. Effects are rendered with the ECMA-48 SGR control |
|
28 | also available. Effects are rendered with the ECMA-48 SGR control | |
29 |
function (aka ANSI escape codes). |
|
29 | function (aka ANSI escape codes). | |
30 | render_text function, which can be used to add effects to any text. |
|
|||
31 |
|
30 | |||
32 | Default effects may be overridden from your configuration file:: |
|
31 | Default effects may be overridden from your configuration file:: | |
33 |
|
32 |
@@ -319,7 +319,11 b' def _wrapcmd(ui, cmd, table, wrapfn):' | |||||
319 | '''wrap the command''' |
|
319 | '''wrap the command''' | |
320 | def graph(orig, *args, **kwargs): |
|
320 | def graph(orig, *args, **kwargs): | |
321 | if kwargs['graph']: |
|
321 | if kwargs['graph']: | |
322 | return wrapfn(*args, **kwargs) |
|
322 | try: | |
|
323 | return wrapfn(*args, **kwargs) | |||
|
324 | except TypeError, e: | |||
|
325 | if len(args) > wrapfn.func_code.co_argcount: | |||
|
326 | raise util.Abort(_('--graph option allows at most one file')) | |||
323 | return orig(*args, **kwargs) |
|
327 | return orig(*args, **kwargs) | |
324 | entry = extensions.wrapcommand(table, cmd, graph) |
|
328 | entry = extensions.wrapcommand(table, cmd, graph) | |
325 | entry[1].append(('G', 'graph', None, _("show the revision DAG"))) |
|
329 | entry[1].append(('G', 'graph', None, _("show the revision DAG"))) |
@@ -1455,9 +1455,10 b' class queue(object):' | |||||
1455 |
|
1455 | |||
1456 | try: |
|
1456 | try: | |
1457 | # might be nice to attempt to roll back strip after this |
|
1457 | # might be nice to attempt to roll back strip after this | |
1458 | patchf.rename() |
|
|||
1459 | n = repo.commit(message, user, ph.date, match=match, |
|
1458 | n = repo.commit(message, user, ph.date, match=match, | |
1460 | force=True) |
|
1459 | force=True) | |
|
1460 | # only write patch after a successful commit | |||
|
1461 | patchf.rename() | |||
1461 | self.applied.append(statusentry(n, patchfn)) |
|
1462 | self.applied.append(statusentry(n, patchfn)) | |
1462 | except: |
|
1463 | except: | |
1463 | ctx = repo[cparents[0]] |
|
1464 | ctx = repo[cparents[0]] |
@@ -105,6 +105,10 b' def runcmd(cmd, env):' | |||||
105 | p = subprocess.Popen(cmd, stdout=subprocess.PIPE, |
|
105 | p = subprocess.Popen(cmd, stdout=subprocess.PIPE, | |
106 | stderr=subprocess.PIPE, env=env) |
|
106 | stderr=subprocess.PIPE, env=env) | |
107 | out, err = p.communicate() |
|
107 | out, err = p.communicate() | |
|
108 | return out, err | |||
|
109 | ||||
|
110 | def runhg(cmd, env): | |||
|
111 | out, err = runcmd(cmd, env) | |||
108 | # If root is executing setup.py, but the repository is owned by |
|
112 | # If root is executing setup.py, but the repository is owned by | |
109 | # another user (as in "sudo python setup.py install") we will get |
|
113 | # another user (as in "sudo python setup.py install") we will get | |
110 | # trust warnings since the .hg/hgrc file is untrusted. That is |
|
114 | # trust warnings since the .hg/hgrc file is untrusted. That is | |
@@ -135,7 +139,7 b" if os.path.isdir('.hg'):" | |||||
135 | # error 0xc0150004. See: http://bugs.python.org/issue3440 |
|
139 | # error 0xc0150004. See: http://bugs.python.org/issue3440 | |
136 | env['SystemRoot'] = os.environ['SystemRoot'] |
|
140 | env['SystemRoot'] = os.environ['SystemRoot'] | |
137 | cmd = [sys.executable, 'hg', 'id', '-i', '-t'] |
|
141 | cmd = [sys.executable, 'hg', 'id', '-i', '-t'] | |
138 |
l = run |
|
142 | l = runhg(cmd, env).split() | |
139 | while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags |
|
143 | while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags | |
140 | l.pop() |
|
144 | l.pop() | |
141 | if len(l) > 1: # tag found |
|
145 | if len(l) > 1: # tag found | |
@@ -145,7 +149,7 b" if os.path.isdir('.hg'):" | |||||
145 | elif len(l) == 1: # no tag found |
|
149 | elif len(l) == 1: # no tag found | |
146 | cmd = [sys.executable, 'hg', 'parents', '--template', |
|
150 | cmd = [sys.executable, 'hg', 'parents', '--template', | |
147 | '{latesttag}+{latesttagdistance}-'] |
|
151 | '{latesttag}+{latesttagdistance}-'] | |
148 |
version = run |
|
152 | version = runhg(cmd, env) + l[0] | |
149 | if version.endswith('+'): |
|
153 | if version.endswith('+'): | |
150 | version += time.strftime('%Y%m%d') |
|
154 | version += time.strftime('%Y%m%d') | |
151 | elif os.path.exists('.hg_archival.txt'): |
|
155 | elif os.path.exists('.hg_archival.txt'): | |
@@ -361,7 +365,7 b" if os.name == 'nt':" | |||||
361 | if sys.platform == 'darwin' and os.path.exists('/usr/bin/xcodebuild'): |
|
365 | if sys.platform == 'darwin' and os.path.exists('/usr/bin/xcodebuild'): | |
362 | # XCode 4.0 dropped support for ppc architecture, which is hardcoded in |
|
366 | # XCode 4.0 dropped support for ppc architecture, which is hardcoded in | |
363 | # distutils.sysconfig |
|
367 | # distutils.sysconfig | |
364 | version = runcmd(['/usr/bin/xcodebuild', '-version'], {}).splitlines()[0] |
|
368 | version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0].splitlines()[0] | |
365 | # Also parse only first digit, because 3.2.1 can't be parsed nicely |
|
369 | # Also parse only first digit, because 3.2.1 can't be parsed nicely | |
366 | if (version.startswith('Xcode') and |
|
370 | if (version.startswith('Xcode') and | |
367 | StrictVersion(version.split()[1]) >= StrictVersion('4.0')): |
|
371 | StrictVersion(version.split()[1]) >= StrictVersion('4.0')): |
@@ -686,6 +686,11 b' Unused arguments:' | |||||
686 | show revision history alongside an ASCII revision graph |
|
686 | show revision history alongside an ASCII revision graph | |
687 | [255] |
|
687 | [255] | |
688 |
|
688 | |||
|
689 | Only one file is allowed: | |||
|
690 | $ hg log -G foo bar | |||
|
691 | abort: --graph option allows at most one file | |||
|
692 | [255] | |||
|
693 | ||||
689 | Empty revision range - display nothing: |
|
694 | Empty revision range - display nothing: | |
690 | $ hg glog -r 1..0 |
|
695 | $ hg glog -r 1..0 | |
691 |
|
696 |
@@ -487,3 +487,38 b' Issue1441 with git patches:' | |||||
487 |
|
487 | |||
488 | $ cd .. |
|
488 | $ cd .. | |
489 |
|
489 | |||
|
490 | Refresh with bad usernames. Mercurial used to abort on bad usernames, | |||
|
491 | but only after writing the bad name into the patch. | |||
|
492 | ||||
|
493 | $ hg init bad-usernames | |||
|
494 | $ cd bad-usernames | |||
|
495 | $ touch a | |||
|
496 | $ hg add a | |||
|
497 | $ hg qnew a | |||
|
498 | $ hg qrefresh -u 'foo | |||
|
499 | > bar' | |||
|
500 | transaction abort! | |||
|
501 | rollback completed | |||
|
502 | refresh interrupted while patch was popped! (revert --all, qpush to recover) | |||
|
503 | abort: username 'foo\nbar' contains a newline! | |||
|
504 | [255] | |||
|
505 | $ cat .hg/patches/a | |||
|
506 | # HG changeset patch | |||
|
507 | # Parent 0000000000000000000000000000000000000000 | |||
|
508 | diff --git a/a b/a | |||
|
509 | new file mode 100644 | |||
|
510 | $ hg qpush | |||
|
511 | applying a | |||
|
512 | now at: a | |||
|
513 | $ hg qrefresh -u ' ' | |||
|
514 | transaction abort! | |||
|
515 | rollback completed | |||
|
516 | refresh interrupted while patch was popped! (revert --all, qpush to recover) | |||
|
517 | abort: empty username! | |||
|
518 | [255] | |||
|
519 | $ cat .hg/patches/a | |||
|
520 | # HG changeset patch | |||
|
521 | # Parent 0000000000000000000000000000000000000000 | |||
|
522 | diff --git a/a b/a | |||
|
523 | new file mode 100644 | |||
|
524 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now