Mercurial > hg
changeset 20012:a1d88278beff
merge with stable
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 16 Nov 2013 12:44:28 -0500 |
parents | 34d720b3b33e (current diff) cb466830826a (diff) |
children | 38acecdd016c |
files | contrib/check-code.py mercurial/util.py |
diffstat | 15 files changed, 181 insertions(+), 58 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/check-code.py Fri Nov 15 13:20:49 2013 -0800 +++ b/contrib/check-code.py Sat Nov 16 12:44:28 2013 -0500 @@ -26,8 +26,25 @@ return re.compile(pat) def repquote(m): - t = re.sub(r"\w", "x", m.group('text')) - t = re.sub(r"[^\s\nx]", "o", t) + fromc = '.:' + tochr = 'pq' + def encodechr(i): + if i > 255: + return 'u' + c = chr(i) + if c in ' \n': + return c + if c.isalpha(): + return 'x' + if c.isdigit(): + return 'n' + try: + return tochr[fromc.find(c)] + except (ValueError, IndexError): + return 'o' + t = m.group('text') + tt = ''.join(encodechr(i) for i in xrange(256)) + t = t.translate(tt) return m.group('quote') + t + m.group('quote') def reppython(m): @@ -263,6 +280,7 @@ ], # warnings [ + (r'(^| )pp +xxxxqq[ \n][^\n]', "add two newlines after '.. note::'"), ] ] @@ -449,6 +467,8 @@ else: p, msg = pat ignore = None + if i >= nerrs: + msg = "warning: " + msg pos = 0 n = 0 @@ -456,8 +476,6 @@ if prelines is None: prelines = pre.splitlines() postlines = post.splitlines(True) - if i >= nerrs: - msg = "warning: " + msg start = m.start() while n < len(postlines): @@ -484,6 +502,7 @@ bl, bu, br = blamecache[n] if bl == l: bd = '%s@%s' % (bu, br) + errors.append((f, lineno and n + 1, l, msg, bd)) result = False
--- a/hgext/eol.py Fri Nov 15 13:20:49 2013 -0800 +++ b/hgext/eol.py Sat Nov 16 12:44:28 2013 -0500 @@ -49,6 +49,7 @@ native = LF .. note:: + The rules will first apply when files are touched in the working copy, e.g. by updating to null and back to tip to touch all files.
--- a/hgext/keyword.py Fri Nov 15 13:20:49 2013 -0800 +++ b/hgext/keyword.py Sat Nov 16 12:44:28 2013 -0500 @@ -53,6 +53,7 @@ svn = True .. note:: + The more specific you are in your filename patterns the less you lose speed in huge repositories.
--- a/hgext/mq.py Fri Nov 15 13:20:49 2013 -0800 +++ b/hgext/mq.py Sat Nov 16 12:44:28 2013 -0500 @@ -2622,6 +2622,7 @@ With arguments, set guards for the named patch. .. note:: + Specifying negative guards now requires '--'. To set guards on another patch::
--- a/hgext/share.py Fri Nov 15 13:20:49 2013 -0800 +++ b/hgext/share.py Sat Nov 16 12:44:28 2013 -0500 @@ -17,6 +17,7 @@ history with another repository. .. note:: + using rollback or extensions that destroy/modify history (mq, rebase, etc.) can cause considerable confusion with shared clones. In particular, if two shared clones are both updated to
--- a/hgext/strip.py Fri Nov 15 13:20:49 2013 -0800 +++ b/hgext/strip.py Sat Nov 16 12:44:28 2013 -0500 @@ -51,7 +51,9 @@ if update: checklocalchanges(repo, force=force) urev, p2 = repo.changelog.parents(revs[0]) - if p2 != nullid and p2 in [x.node for x in repo.mq.applied]: + if (util.safehasattr(repo, 'mq') and + p2 != nullid + and p2 in [x.node for x in repo.mq.applied]): urev = p2 hg.clean(repo, urev) repo.dirstate.write()
--- a/i18n/pt_BR.po Fri Nov 15 13:20:49 2013 -0800 +++ b/i18n/pt_BR.po Sat Nov 16 12:44:28 2013 -0500 @@ -4339,13 +4339,22 @@ " Use \"min(outgoing() and ::.)\" or similar revset specification\n" " instead of --outgoing to specify edit target revision exactly in\n" " such ambiguous situation. See :hg:`help revsets` for detail about\n" -" selecting revisions.\n" -" " +" selecting revisions." msgstr "" " Ao invés de --outgoing, use \"min(outgoing() and ::.)\" ou outro\n" " revset semelhante para especificar com exatidão as revisões a serem\n" " editadas nessas situações.Veja :hg:`help revsets` para detalhes sobre\n" -" seleção de revisões.\n" +" seleção de revisões." + +msgid "" +" Returns 0 on success, 1 if user intervention is required (not only\n" +" for intentional \"edit\" command, but also for resolving unexpected\n" +" conflicts).\n" +" " +msgstr "" +" Devolve 0 para indicar sucesso, 1 se alguma intervenção do usuário\n" +" for necessária (tanto para um comando \"edit\" como para resolver\n" +" conflitos inesperados).\n" " " msgid "source has mq patches applied" @@ -5460,18 +5469,18 @@ #, python-format msgid "" -"%s has been turned into a largefile\n" -"use (l)argefile or keep as (n)ormal file?$$ &Largefile $$ &Normal file" -msgstr "" -"%s foi transformado em um largefile\n" +"remote turned local normal file %s into a largefile\n" +"use (l)argefile or keep (n)ormal file?$$ &Largefile $$ &Normal file" +msgstr "" +"o remoto transformou o arquivo local normal %s em um largefile\n" "usar (l)argefile ou manter como arquivo (n)ormal?$$ &Largefile $$ Arquivo &Normal" #, python-format msgid "" -"%s has been turned into a normal file\n" -"keep as (l)argefile or use (n)ormal file?$$ &Largefile $$ &Normal file" -msgstr "" -"%s foi transformado em um arquivo normal\n" +"remote turned local largefile %s into a normal file\n" +"keep (l)argefile or use (n)ormal file?$$ &Largefile $$ &Normal file" +msgstr "" +"o remoto transformou o largefile local %s em um arquivo normal\n" "manter como (l)argefile ou usar um arquivo (n)ormal?$$ &Largefile $$ Arquivo &Normal" #, python-format @@ -8399,10 +8408,12 @@ " --abort/-a." msgid "" -" Returns 0 on success, 1 if nothing to rebase.\n" -" " -msgstr "" -" Devolve 0 para indicar sucesso, 1 se não houver nada para rebasear.\n" +" Returns 0 on success, 1 if nothing to rebase or there are\n" +" unresolved conflicts.\n" +" " +msgstr "" +" Devolve 0 para indicar sucesso, 1 se não houver nada para rebasear\n" +" ou se houverem conflitos não resolvidos.\n" " " msgid "message can only be specified with collapse" @@ -19749,8 +19760,8 @@ msgid "Lastly, there is Mercurial's internal format:" msgstr "E por fim, há um formato interno do Mercurial:" -msgid "- ``1165432709 0`` (Wed Dec 6 13:18:29 2006 UTC)" -msgstr "- ``1165432709 0`` (Wed Dec 6 13:18:29 2006 UTC)" +msgid "- ``1165411109 0`` (Wed Dec 6 13:18:29 2006 UTC)" +msgstr "- ``1165411109 0`` (Wed Dec 6 13:18:29 2006 UTC)" msgid "" "This is the internal representation format for dates. The first number\n"
--- a/mercurial/commands.py Fri Nov 15 13:20:49 2013 -0800 +++ b/mercurial/commands.py Sat Nov 16 12:44:28 2013 -0500 @@ -397,6 +397,7 @@ changes and the merged result is left uncommitted. .. note:: + backout cannot be used to fix either an unwanted or incorrect merge. @@ -937,6 +938,7 @@ """set or show the current branch name .. note:: + Branch names are permanent and global. Use :hg:`bookmark` to create a light-weight bookmark instead. See :hg:`help glossary` for more information about named branches and bookmarks. @@ -2707,6 +2709,7 @@ Differences between files are shown using the unified diff format. .. note:: + diff may generate unexpected results for merges, as it will default to comparing against the working directory's first parent changeset if no revisions are specified. @@ -2796,6 +2799,7 @@ comment. .. note:: + export may generate unexpected diff output for merge changesets, as it will compare the merge changeset against its first parent only. @@ -2928,6 +2932,7 @@ continued with the -c/--continue option. .. note:: + The -c/--continue option does not reapply earlier options. .. container:: verbose @@ -3979,12 +3984,14 @@ changed files and full commit message are shown. .. note:: + log -p/--patch may generate unexpected diff output for merge changesets, as it will only compare the merge changeset against its first parent. Also, only files different from BOTH parents will appear in files:. .. note:: + for performance reasons, log FILE may omit duplicate changes made on branches and will not show deletions. To see all changes including duplicates and deletions, use the --removed @@ -4652,6 +4659,7 @@ only create a new branch without forcing other changes. .. note:: + Extra care should be taken with the -f/--force option, which will push all new heads on all branches, an action which will almost always cause confusion for collaborators. @@ -4976,6 +4984,7 @@ """restore files to their checkout state .. note:: + To check out earlier revisions, you should use :hg:`update REV`. To cancel an uncommitted merge (and lose your changes), use :hg:`update --clean .`. @@ -5306,6 +5315,7 @@ unless explicitly requested with -u/--unknown or -i/--ignored. .. note:: + status may appear to disagree with diff if permissions have changed or a merge has occurred. The standard diff format does not report permission changes and diff only reports changes
--- a/mercurial/hgweb/webcommands.py Fri Nov 15 13:20:49 2013 -0800 +++ b/mercurial/hgweb/webcommands.py Sat Nov 16 12:44:28 2013 -0500 @@ -151,9 +151,9 @@ yield web.repo[r] searchfuncs = { - MODE_REVISION: (revsearch, _('exact revision search')), - MODE_KEYWORD: (keywordsearch, _('literal keyword search')), - MODE_REVSET: (revsetsearch, _('revset expression search')), + MODE_REVISION: (revsearch, 'exact revision search'), + MODE_KEYWORD: (keywordsearch, 'literal keyword search'), + MODE_REVSET: (revsetsearch, 'revset expression search'), } def getsearchmode(query):
--- a/mercurial/minirst.py Fri Nov 15 13:20:49 2013 -0800 +++ b/mercurial/minirst.py Sat Nov 16 12:44:28 2013 -0500 @@ -106,6 +106,12 @@ # Partially minimized form: remove space and both # colons. blocks[i]['lines'][-1] = blocks[i]['lines'][-1][:-3] + elif len(blocks[i]['lines']) == 1 and \ + blocks[i]['lines'][0].lstrip(' ').startswith('.. ') and \ + blocks[i]['lines'][0].find(' ', 3) == -1: + # directive on its onw line, not a literal block + i += 1 + continue else: # Fully minimized form: remove just one colon. blocks[i]['lines'][-1] = blocks[i]['lines'][-1][:-1] @@ -375,6 +381,9 @@ if (blocks[i]['type'] == blocks[i - 1]['type'] and blocks[i]['type'] in ('bullet', 'option', 'field')): i += 1 + elif not blocks[i - 1]['lines']: + # no lines in previous block, do not seperate + i += 1 else: blocks.insert(i, dict(lines=[''], indent=0, type='margin')) i += 2 @@ -447,6 +456,8 @@ indent = ' ' * block['indent'] if block['type'] == 'admonition': admonition = _admonitiontitles[block['admonitiontitle']] + if not block['lines']: + return indent + admonition + '\n' hang = len(block['lines'][-1]) - len(block['lines'][-1].lstrip()) defindent = indent + hang * ' ' @@ -625,9 +636,9 @@ blocks = splitparagraphs(blocks) blocks = updatefieldlists(blocks) blocks = updateoptionlists(blocks) + blocks = findadmonitions(blocks) blocks = addmargins(blocks) blocks = prunecomments(blocks) - blocks = findadmonitions(blocks) return blocks, pruned def formatblocks(blocks, width):
--- a/mercurial/util.py Fri Nov 15 13:20:49 2013 -0800 +++ b/mercurial/util.py Sat Nov 16 12:44:28 2013 -0500 @@ -563,7 +563,7 @@ lpt1 lpt2 lpt3 lpt4 lpt5 lpt6 lpt7 lpt8 lpt9'''.split() _winreservedchars = ':*?"<>|' def checkwinfilename(path): - '''Check that the base-relative path is a valid filename on Windows. + r'''Check that the base-relative path is a valid filename on Windows. Returns None if the path is ok, or a UI string describing the problem. >>> checkwinfilename("just/a/normal/path") @@ -577,11 +577,19 @@ >>> checkwinfilename("foo/bar/bla:.txt") "filename contains ':', which is reserved on Windows" >>> checkwinfilename("foo/bar/b\07la.txt") - "filename contains '\\\\x07', which is invalid on Windows" + "filename contains '\\x07', which is invalid on Windows" >>> checkwinfilename("foo/bar/bla ") "filename ends with ' ', which is not allowed on Windows" >>> checkwinfilename("../bar") + >>> checkwinfilename("foo\\") + "filename ends with '\\', which is invalid on Windows" + >>> checkwinfilename("foo\\/bar") + "directory name ends with '\\', which is invalid on Windows" ''' + if path.endswith('\\'): + return _("filename ends with '\\', which is invalid on Windows") + if '\\/' in path: + return _("directory name ends with '\\', which is invalid on Windows") for n in path.replace('\\', '/').split('/'): if not n: continue
--- a/tests/test-check-code.t Fri Nov 15 13:20:49 2013 -0800 +++ b/tests/test-check-code.t Sat Nov 16 12:44:28 2013 -0500 @@ -185,12 +185,20 @@ $ cat > warning.t <<EOF > $ function warnonly { > > } + > $ diff -N aaa + > $ function onwarn {} > EOF $ "$check_code" warning.t $ "$check_code" --warn warning.t warning.t:1: > $ function warnonly { warning: don't use 'function', use old style + warning.t:3: + > $ diff -N aaa + warning: don't use 'diff -N' + warning.t:4: + > $ function onwarn {} + warning: don't use 'function', use old style [1] $ cat > raise-format.py <<EOF > raise SomeException, message @@ -204,3 +212,42 @@ don't use old-style two-argument raise, use Exception(message) [1] + $ cat > rst.py <<EOF + > """problematic rst text + > + > .. note:: + > wrong + > """ + > + > ''' + > + > .. note:: + > + > valid + > + > new text + > + > .. note:: + > + > also valid + > ''' + > + > """mixed + > + > .. note:: + > + > good + > + > .. note:: + > plus bad + > """ + > EOF + $ $check_code -w rst.py + rst.py:3: + > .. note:: + warning: add two newlines after '.. note::' + rst.py:26: + > .. note:: + warning: add two newlines after '.. note::' + [1] +
--- a/tests/test-extension.t Fri Nov 15 13:20:49 2013 -0800 +++ b/tests/test-extension.t Sat Nov 16 12:44:28 2013 -0500 @@ -131,6 +131,13 @@ Check "from __future__ import absolute_import" support for external libraries +#if windows + $ PATHSEP=";" +#else + $ PATHSEP=":" +#endif + $ export PATHSEP + $ mkdir $TESTTMP/libroot $ echo "s = 'libroot/ambig.py'" > $TESTTMP/libroot/ambig.py $ mkdir $TESTTMP/libroot/mod @@ -148,9 +155,9 @@ > def extsetup(): > print 'ambigabs.s=%s' % ambigabs.s > EOF - $ (PYTHONPATH=$PYTHONPATH:$TESTTMP/libroot; hg --config extensions.loadabs=loadabs.py root) + $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root) ambigabs.s=libroot/ambig.py - $TESTTMP/a + $TESTTMP/a (glob) #endif #if no-py3k @@ -163,9 +170,9 @@ > def extsetup(): > print 'ambigrel.s=%s' % ambigrel.s > EOF - $ (PYTHONPATH=$PYTHONPATH:$TESTTMP/libroot; hg --config extensions.loadrel=loadrel.py root) + $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root) ambigrel.s=libroot/mod/ambig.py - $TESTTMP/a + $TESTTMP/a (glob) #endif Check absolute/relative import of extension specific modules @@ -220,10 +227,10 @@ (extroot) import extroot: this is extroot.__init__ (extroot) from extroot.bar import s: this is extroot.bar (extroot) import extroot.bar in func(): this is extroot.bar - $TESTTMP/a + $TESTTMP/a (glob) #if no-py3k - $ rm -f $TESTTMP/extroot/foo.* + $ rm "$TESTTMP"/extroot/foo.* $ cat > $TESTTMP/extroot/foo.py <<EOF > # test relative import > buf = [] @@ -256,7 +263,7 @@ (extroot) import sub1: this is extroot.sub1.__init__ (extroot) from bar import s: this is extroot.bar (extroot) import bar in func(): this is extroot.bar - $TESTTMP/a + $TESTTMP/a (glob) #endif $ cd .. @@ -732,59 +739,59 @@ $ echo '# enable extension locally' >> src/.hg/hgrc $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> src/.hg/hgrc $ hg -R src status - reposetup() for $TESTTMP/reposetup-test/src + reposetup() for $TESTTMP/reposetup-test/src (glob) $ hg clone -U src clone-dst1 - reposetup() for $TESTTMP/reposetup-test/src + reposetup() for $TESTTMP/reposetup-test/src (glob) $ hg init push-dst1 $ hg -q -R src push push-dst1 - reposetup() for $TESTTMP/reposetup-test/src + reposetup() for $TESTTMP/reposetup-test/src (glob) $ hg init pull-src1 $ hg -q -R pull-src1 pull src - reposetup() for $TESTTMP/reposetup-test/src + reposetup() for $TESTTMP/reposetup-test/src (glob) $ echo '[extensions]' >> $HGRCPATH $ echo '# disable extension globally and explicitly' >> $HGRCPATH $ echo 'reposetuptest = !' >> $HGRCPATH $ hg clone -U src clone-dst2 - reposetup() for $TESTTMP/reposetup-test/src + reposetup() for $TESTTMP/reposetup-test/src (glob) $ hg init push-dst2 $ hg -q -R src push push-dst2 - reposetup() for $TESTTMP/reposetup-test/src + reposetup() for $TESTTMP/reposetup-test/src (glob) $ hg init pull-src2 $ hg -q -R pull-src2 pull src - reposetup() for $TESTTMP/reposetup-test/src + reposetup() for $TESTTMP/reposetup-test/src (glob) $ echo '[extensions]' >> $HGRCPATH $ echo '# enable extension globally' >> $HGRCPATH $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> $HGRCPATH $ hg clone -U src clone-dst3 - reposetup() for $TESTTMP/reposetup-test/src - reposetup() for $TESTTMP/reposetup-test/clone-dst3 + reposetup() for $TESTTMP/reposetup-test/src (glob) + reposetup() for $TESTTMP/reposetup-test/clone-dst3 (glob) $ hg init push-dst3 - reposetup() for $TESTTMP/reposetup-test/push-dst3 + reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob) $ hg -q -R src push push-dst3 - reposetup() for $TESTTMP/reposetup-test/src - reposetup() for $TESTTMP/reposetup-test/push-dst3 + reposetup() for $TESTTMP/reposetup-test/src (glob) + reposetup() for $TESTTMP/reposetup-test/push-dst3 (glob) $ hg init pull-src3 - reposetup() for $TESTTMP/reposetup-test/pull-src3 + reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob) $ hg -q -R pull-src3 pull src - reposetup() for $TESTTMP/reposetup-test/pull-src3 - reposetup() for $TESTTMP/reposetup-test/src + reposetup() for $TESTTMP/reposetup-test/pull-src3 (glob) + reposetup() for $TESTTMP/reposetup-test/src (glob) $ echo '[extensions]' >> src/.hg/hgrc $ echo '# disable extension locally' >> src/.hg/hgrc $ echo 'reposetuptest = !' >> src/.hg/hgrc $ hg clone -U src clone-dst4 - reposetup() for $TESTTMP/reposetup-test/clone-dst4 + reposetup() for $TESTTMP/reposetup-test/clone-dst4 (glob) $ hg init push-dst4 - reposetup() for $TESTTMP/reposetup-test/push-dst4 + reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob) $ hg -q -R src push push-dst4 - reposetup() for $TESTTMP/reposetup-test/push-dst4 + reposetup() for $TESTTMP/reposetup-test/push-dst4 (glob) $ hg init pull-src4 - reposetup() for $TESTTMP/reposetup-test/pull-src4 + reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob) $ hg -q -R pull-src4 pull src - reposetup() for $TESTTMP/reposetup-test/pull-src4 + reposetup() for $TESTTMP/reposetup-test/pull-src4 (glob) disabling in command line overlays with all configuration $ hg --config extensions.reposetuptest=! clone -U src clone-dst5 @@ -827,8 +834,8 @@ $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> parent/.hg/hgrc $ cp parent/.hg/hgrc parent/sub2/.hg/hgrc $ hg -R parent status -S -A - reposetup() for $TESTTMP/reposetup-test/parent - reposetup() for $TESTTMP/reposetup-test/parent/sub2 + reposetup() for $TESTTMP/reposetup-test/parent (glob) + reposetup() for $TESTTMP/reposetup-test/parent/sub2 (glob) C .hgsub C .hgsubstate C sub1/1
--- a/tests/test-minirst.py Fri Nov 15 13:20:49 2013 -0800 +++ b/tests/test-minirst.py Sat Nov 16 12:44:28 2013 -0500 @@ -202,6 +202,7 @@ admonitions = """ .. note:: + This is a note - Bullet 1
--- a/tests/test-minirst.py.out Fri Nov 15 13:20:49 2013 -0800 +++ b/tests/test-minirst.py.out Sat Nov 16 12:44:28 2013 -0500 @@ -683,7 +683,10 @@ html format: ---------------------------------------------------------------------- <p> -<b>Note:</b> This is a note +<b>Note:</b> +</p> +<p> +This is a note </p> <ul> <li> Bullet 1