# HG changeset patch # User Christian Ebert # Date 1304705590 -7200 # Node ID eb234d5d695c1838bb5cebd4c939fdd5f1fb45dc # Parent 95e99c4d10d315f5d7c9797ab01f7030c7d20df5# Parent eb562ea207c3b2e300070779face6d4ac3f3f5e9 Merge with stable diff -r 95e99c4d10d3 -r eb234d5d695c hgkw/keyword.py --- a/hgkw/keyword.py Sun May 01 18:18:31 2011 +0100 +++ b/hgkw/keyword.py Fri May 06 20:13:10 2011 +0200 @@ -413,7 +413,7 @@ demoitems('keywordset', ui.configitems('keywordset')) demoitems('keywordmaps', kwmaps.iteritems()) keywords = '$' + '$\n$'.join(sorted(kwmaps.keys())) + '$\n' - repo.wopener(fn, 'w').write(keywords) + repo.wopener.write(fn, keywords) repo[None].add([fn]) ui.note(_('\nkeywords written to %s:\n') % fn) ui.note(keywords) diff -r 95e99c4d10d3 -r eb234d5d695c tests/run-tests.py --- a/tests/run-tests.py Sun May 01 18:18:31 2011 +0100 +++ b/tests/run-tests.py Fri May 06 20:13:10 2011 +0200 @@ -104,6 +104,7 @@ 'jobs': ('HGTEST_JOBS', 1), 'timeout': ('HGTEST_TIMEOUT', 180), 'port': ('HGTEST_PORT', 20059), + 'shell': ('HGTEST_SHELL', '/bin/sh'), } def parseargs(): @@ -149,6 +150,8 @@ help="retest failed tests") parser.add_option("-S", "--noskips", action="store_true", help="don't report skip tests verbosely") + parser.add_option("--shell", type="string", + help="shell to use (default: $%s or %s)" % defaults['shell']) parser.add_option("-t", "--timeout", type="int", help="kill errant tests after TIMEOUT seconds" " (default: $%s or %d)" % defaults['timeout']) @@ -168,8 +171,8 @@ parser.add_option('--extra-config-opt', action="append", help='set the given config opt in the test hgrc') - for option, default in defaults.items(): - defaults[option] = int(os.environ.get(*default)) + for option, (envvar, default) in defaults.items(): + defaults[option] = type(default)(os.environ.get(envvar, default)) parser.set_defaults(**defaults) (options, args) = parser.parse_args() @@ -177,6 +180,10 @@ if 'java' in sys.platform or '__pypy__' in sys.modules: options.pure = True + if not (os.path.isfile(options.shell) and + os.access(options.shell, os.X_OK)): + parser.error('--shell must be executable') + if options.with_hg: if not (os.path.isfile(options.with_hg) and os.access(options.with_hg, os.X_OK)): @@ -527,7 +534,7 @@ os.write(fd, l) os.close(fd) - cmd = '/bin/sh "%s"' % name + cmd = '"%s" "%s"' % (options.shell, name) vlog("# Running", cmd) exitcode, output = run(cmd, wd, options, replacements) # do not merge output if skipped, return hghave message instead @@ -917,6 +924,9 @@ name = '--' + opt.replace('_', '-') if value is True: opts.append(name) + elif isinstance(value, list): + for v in value: + opts.append(name + '=' + str(v)) elif value is not None: opts.append(name + '=' + str(value)) diff -r 95e99c4d10d3 -r eb234d5d695c tests/test-keyword.t --- a/tests/test-keyword.t Sun May 01 18:18:31 2011 +0100 +++ b/tests/test-keyword.t Fri May 06 20:13:10 2011 +0200 @@ -982,7 +982,7 @@ $ HGMERGE=internal:local hg resolve -a $ hg commit -m localresolve $ cat m - $Id: m 41efa6d38e9b Thu, 01 Jan 1970 00:00:00 +0000 test $ + $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ bar Test restricted mode with transplant -b @@ -1000,19 +1000,19 @@ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -y transplant -b foo tip applying 4aa30d025d50 - 4aa30d025d50 transplanted to 5a4da427c162 + 4aa30d025d50 transplanted to e00abbf63521 Expansion in changeset but not in file $ hg tip -p - changeset: 11:5a4da427c162 + changeset: 11:e00abbf63521 tag: tip - parent: 9:41efa6d38e9b + parent: 9:800511b3a22d user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 9foobranch - diff -r 41efa6d38e9b -r 5a4da427c162 a + diff -r 800511b3a22d -r e00abbf63521 a --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +1,4 @@ @@ -1023,7 +1023,7 @@ $ head -n 2 a foobranch - expand $Id: a 5a4da427c162 Thu, 01 Jan 1970 00:00:00 +0000 test $ + expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $ Turn off expansion