diff --git a/hgext/zeroconf/__init__.py b/hgext/zeroconf/__init__.py --- a/hgext/zeroconf/__init__.py +++ b/hgext/zeroconf/__init__.py @@ -163,8 +163,8 @@ def config(orig, self, section, key, def return path return orig(self, section, key, default, untrusted) -def configitems(orig, self, section, untrusted=False): - repos = orig(self, section, untrusted) +def configitems(orig, self, section, *args, **kwargs): + repos = orig(self, section, *args, **kwargs) if section == "paths": repos += getzcpaths() return repos diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -2850,10 +2850,6 @@ def revert(ui, repo, ctx, parents, *pats mf = ctx.manifest() if node == p2: parent = p2 - if node == parent: - pmf = mf - else: - pmf = None # need all matching names in dirstate and manifest of target rev, # so have to walk both. do not print errors if files exist in one @@ -2968,11 +2964,7 @@ def revert(ui, repo, ctx, parents, *pats # in case of merge, files that are actually added can be reported as # modified, we need to post process the result if p2 != nullid: - if pmf is None: - # only need parent manifest in the merge case, - # so do not read by default - pmf = repo[parent].manifest() - mergeadd = dsmodified - set(pmf) + mergeadd = dsmodified - smf dsadded |= mergeadd dsmodified -= mergeadd diff --git a/mercurial/fileset.py b/mercurial/fileset.py --- a/mercurial/fileset.py +++ b/mercurial/fileset.py @@ -435,8 +435,8 @@ def eol(mctx, x): styles. """ - # i18n: "encoding" is a keyword - enc = getstring(x, _("encoding requires an encoding name")) + # i18n: "eol" is a keyword + enc = getstring(x, _("eol requires a style name")) s = [] for f in mctx.existing(): diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt --- a/mercurial/help/config.txt +++ b/mercurial/help/config.txt @@ -276,7 +276,7 @@ run arbitrary commands. As an example, : will let you do ``hg echo foo`` to have ``foo`` printed in your terminal. A better example might be:: - purge = !$HG status --no-status --unknown -0 | xargs -0 rm + purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm which will make ``hg purge`` delete all unknown files in the repository in the same manner as the purge extension. @@ -334,7 +334,7 @@ Each line has the following format:: where ```` is used to group arguments into authentication entries. Example:: - foo.prefix = hg.intevation.org/mercurial + foo.prefix = hg.intevation.de/mercurial foo.username = foo foo.password = bar foo.schemes = http https @@ -977,7 +977,8 @@ The CA chain and web.cacerts is not used For example:: [hostfingerprints] - hg.intevation.org = fa:1f:d9:48:f1:e7:74:30:38:8d:d8:58:b6:94:b8:58:28:7d:8b:d0 + hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33 + hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33 This feature is only supported when using Python 2.6 or later. diff --git a/mercurial/help/templates.txt b/mercurial/help/templates.txt --- a/mercurial/help/templates.txt +++ b/mercurial/help/templates.txt @@ -43,13 +43,13 @@ In addition to filters, there are some b .. functionsmarker -Also, for any expression that returns a list, there is a list operator: +Also, for any expression that returns a list, there is a list operator:: -- expr % "{template}" + expr % "{template}" -As seen in the above example, "{template}" is interpreted as a template. -To prevent it from being interpreted, you can use an escape character "\{" -or a raw string prefix, "r'...'". +As seen in the above example, ``{template}`` is interpreted as a template. +To prevent it from being interpreted, you can use an escape character ``\{`` +or a raw string prefix, ``r'...'``. Some sample command line templates: diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -796,7 +796,7 @@ class ui(object): If ui is not interactive, the default is returned. """ if not self.interactive(): - self.write(msg, ' ', default, "\n") + self.write(msg, ' ', default or '', "\n") return default try: r = self._readline(self.label(msg, 'ui.prompt')) diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -304,7 +304,7 @@ class hgbuildext(build_ext): class hgbuildscripts(build_scripts): def run(self): - if os.name != 'nt': + if os.name != 'nt' or self.distribution.pure: return build_scripts.run(self) exebuilt = False diff --git a/tests/test-committer.t b/tests/test-committer.t --- a/tests/test-committer.t +++ b/tests/test-committer.t @@ -66,6 +66,31 @@ date: Thu Jan 01 00:00:00 1970 +0000 summary: commit-1 +# test prompt username + + $ cat > .hg/hgrc < [ui] + > askusername = True + > EOF + + $ echo 12345 > asdf + $ hg commit --config ui.interactive=False -m ask + enter a commit username: + no username found, using '[^']*' instead (re) + $ hg rollback -q + + $ hg commit --config ui.interactive=True -m ask < Asked User + > EOF + enter a commit username: Asked User + $ hg tip + changeset: 5:84c91d963b70 + tag: tip + user: Asked User + date: Thu Jan 01 00:00:00 1970 +0000 + summary: ask + + # test no .hg/hgrc (uses generated non-interactive username) $ echo space > asdf diff --git a/tests/test-paths.t b/tests/test-paths.t --- a/tests/test-paths.t +++ b/tests/test-paths.t @@ -97,6 +97,14 @@ password should be masked in plain outpu } ] +zeroconf wraps ui.configitems(), which shouldn't crash at least: + + $ hg paths --config extensions.zeroconf= + dupe = $TESTTMP/b#tip (glob) + dupe:pushurl = https://example.com/dupe + expand = $TESTTMP/a/$SOMETHING/bar (glob) + insecure = http://foo:***@example.com/ + $ cd .. sub-options for an undeclared path are ignored diff --git a/tests/test-revert.t b/tests/test-revert.t --- a/tests/test-revert.t +++ b/tests/test-revert.t @@ -1076,3 +1076,72 @@ check resulting directory against the -- $ cd .. $ diff -U 0 -- content-base-all.txt content-base-explicit.txt | grep _ [1] + +Revert to an ancestor of P2 during a merge (issue5052) +----------------------------------------------------- + +(prepare the repository) + + $ hg init issue5052 + $ cd issue5052 + $ echo '.\.orig' > .hgignore + $ echo 0 > root + $ hg ci -qAm C0 + $ echo 0 > A + $ hg ci -qAm C1 + $ echo 1 >> A + $ hg ci -qm C2 + $ hg up -q 0 + $ echo 1 > B + $ hg ci -qAm C3 + $ hg status --rev 'ancestor(.,2)' --rev 2 + A A + $ hg log -G -T '{rev} ({files})\n' + @ 3 (B) + | + | o 2 (A) + | | + | o 1 (A) + |/ + o 0 (.hgignore root) + + +actual tests: reverting to something else than a merge parent + + $ hg merge + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) + + $ hg status --rev 'p1()' + M A + $ hg status --rev 'p2()' + A B + $ hg status --rev '1' + M A + A B + $ hg revert --rev 1 --all + reverting A + removing B + $ hg status --rev 1 + +From the other parents + + $ hg up -C 'p2()' + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg merge + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) + + $ hg status --rev 'p1()' + M B + $ hg status --rev 'p2()' + A A + $ hg status --rev '1' + M A + A B + $ hg revert --rev 1 --all + reverting A + removing B + $ hg status --rev 1 + + $ cd ..