--- a/hgext/pager.py Sun Jun 20 20:02:27 2010 +0200
+++ b/hgext/pager.py Sun Jun 20 23:37:09 2010 +0200
@@ -78,6 +78,9 @@
raise
def uisetup(ui):
+ if ui.plain():
+ return
+
def pagecmd(orig, ui, options, cmd, cmdfunc):
p = ui.config("pager", "pager", os.environ.get("PAGER"))
if p and sys.stdout.isatty() and '--debugger' not in sys.argv:
--- a/hgext/patchbomb.py Sun Jun 20 20:02:27 2010 +0200
+++ b/hgext/patchbomb.py Sun Jun 20 23:37:09 2010 +0200
@@ -235,7 +235,15 @@
_charsets = mail._charsets(ui)
- def outgoing(dest, revs):
+ bundle = opts.get('bundle')
+ date = opts.get('date')
+ mbox = opts.get('mbox')
+ outgoing = opts.get('outgoing')
+ rev = opts.get('rev')
+ # internal option used by pbranches
+ patches = opts.get('patches')
+
+ def getoutgoing(dest, revs):
'''Return the revisions present locally but not in dest'''
dest = ui.expandpath(dest or 'default-push', dest or 'default')
dest, branches = hg.parseurl(dest)
@@ -271,38 +279,36 @@
pass
os.rmdir(tmpdir)
- if not (opts.get('test') or opts.get('mbox')):
+ if not (opts.get('test') or mbox):
# really sending
mail.validateconfig(ui)
- if not (revs or opts.get('rev')
- or opts.get('outgoing') or opts.get('bundle')
- or opts.get('patches')):
+ if not (revs or rev or outgoing or bundle or patches):
raise util.Abort(_('specify at least one changeset with -r or -o'))
- if opts.get('outgoing') and opts.get('bundle'):
+ if outgoing and bundle:
raise util.Abort(_("--outgoing mode always on with --bundle;"
" do not re-specify --outgoing"))
- if opts.get('outgoing') or opts.get('bundle'):
+ if outgoing or bundle:
if len(revs) > 1:
raise util.Abort(_("too many destinations"))
dest = revs and revs[0] or None
revs = []
- if opts.get('rev'):
+ if rev:
if revs:
raise util.Abort(_('use only one form to specify the revision'))
- revs = opts.get('rev')
+ revs = rev
- if opts.get('outgoing'):
- revs = outgoing(dest, opts.get('rev'))
- if opts.get('bundle'):
+ if outgoing:
+ revs = getoutgoing(dest, rev)
+ if bundle:
opts['revs'] = revs
# start
- if opts.get('date'):
- start_time = util.parsedate(opts.get('date'))
+ if date:
+ start_time = util.parsedate(date)
else:
start_time = util.makedate()
@@ -381,11 +387,9 @@
ui.config('patchbomb', 'from') or
prompt(ui, 'From', ui.username()))
- # internal option used by pbranches
- patches = opts.get('patches')
if patches:
msgs = getpatchmsgs(patches, opts.get('patchnames'))
- elif opts.get('bundle'):
+ elif bundle:
msgs = getbundlemsgs(getbundle(dest))
else:
msgs = getpatchmsgs(list(getpatches(revs)))
@@ -463,9 +467,9 @@
raise
if fp is not ui:
fp.close()
- elif opts.get('mbox'):
+ elif mbox:
ui.status(_('Writing '), subj, ' ...\n')
- fp = open(opts.get('mbox'), 'In-Reply-To' in m and 'ab+' or 'wb+')
+ fp = open(mbox, 'In-Reply-To' in m and 'ab+' or 'wb+')
generator = email.Generator.Generator(fp, mangle_from_=True)
# Should be time.asctime(), but Windows prints 2-characters day
# of month instead of one. Make them print the same thing.
--- a/hgext/transplant.py Sun Jun 20 20:02:27 2010 +0200
+++ b/hgext/transplant.py Sun Jun 20 23:37:09 2010 +0200
@@ -341,7 +341,7 @@
node = revlog.bin(line[10:])
elif line.startswith('# Parent '):
parents.append(revlog.bin(line[9:]))
- elif not line.startswith('#'):
+ elif not line.startswith('# '):
inmsg = True
message.append(line)
return (node, user, date, '\n'.join(message), parents)
--- a/mercurial/cmdutil.py Sun Jun 20 20:02:27 2010 +0200
+++ b/mercurial/cmdutil.py Sun Jun 20 23:37:09 2010 +0200
@@ -163,12 +163,13 @@
seen.add(rev)
l.append(rev)
continue
- elif spec in repo: # single unquoted rev
+ elif spec and spec in repo: # single unquoted rev
rev = revfix(repo, spec, None)
if rev in seen:
continue
seen.add(rev)
l.append(rev)
+ continue
except error.RepoLookupError:
pass
--- a/mercurial/help/config.txt Sun Jun 20 20:02:27 2010 +0200
+++ b/mercurial/help/config.txt Sun Jun 20 23:37:09 2010 +0200
@@ -22,6 +22,19 @@
- ``<install-root>/etc/mercurial/hgrc``
- ``<install-root>/etc/mercurial/hgrc.d/*.rc``
+If there is a per-repository configuration file which is not owned by
+the active user, Mercurial will warn you that the file is skipped::
+
+ not trusting file <repo>/.hg/hgrc from untrusted user USER, group GROUP
+
+If this bothers you, the warning can be silenced (the file would still
+be ignored) or trust can be established. Use one of the following
+settings, the syntax is explained below:
+
+- ``ui.report_untrusted = False``
+- ``trusted.users = USER``
+- ``trusted.groups = GROUP``
+
The configuration files for Mercurial use a simple ini-file format. A
configuration file consists of sections, led by a ``[section]`` header
and followed by ``name = value`` entries::
--- a/mercurial/merge.py Sun Jun 20 20:02:27 2010 +0200
+++ b/mercurial/merge.py Sun Jun 20 23:37:09 2010 +0200
@@ -467,7 +467,8 @@
raise util.Abort(_("outstanding uncommitted merges"))
if branchmerge:
if pa == p2:
- raise util.Abort(_("can't merge with ancestor"))
+ raise util.Abort(_("merging with a working directory ancestor"
+ " has no effect"))
elif pa == p1:
if p1.branch() != p2.branch():
fastforward = True
--- a/mercurial/parser.py Sun Jun 20 20:02:27 2010 +0200
+++ b/mercurial/parser.py Sun Jun 20 23:37:09 2010 +0200
@@ -62,13 +62,13 @@
expr = (suffix[0], expr)
else:
# handle infix rules
- infix = self._elements[token][2]
+ if len(e) < 3 or not e[2]:
+ raise error.ParseError("not an infix: %s" % token, pos)
+ infix = e[2]
if len(infix) == 3 and infix[2] == self.current[0]:
self._match(infix[2], pos)
expr = (infix[0], expr, (None))
else:
- if not infix[0]:
- raise error.ParseError("not an infix: %s" % token, pos)
expr = (infix[0], expr, self._parse(infix[1]))
if len(infix) == 3:
self._match(infix[2], pos)
--- a/mercurial/ui.py Sun Jun 20 20:02:27 2010 +0200
+++ b/mercurial/ui.py Sun Jun 20 23:37:09 2010 +0200
@@ -369,7 +369,7 @@
if not getattr(sys.stderr, 'closed', False):
sys.stderr.flush()
except IOError, inst:
- if inst.errno != errno.EPIPE:
+ if inst.errno not in (errno.EPIPE, errno.EIO):
raise
def flush(self):
--- a/mercurial/url.py Sun Jun 20 20:02:27 2010 +0200
+++ b/mercurial/url.py Sun Jun 20 23:37:09 2010 +0200
@@ -556,6 +556,13 @@
return
raise
+ # Python 2.6.5 will keep resetting the retry count on redirects, for
+ # example when the server returns 401 on failing auth (like google code
+ # currently does). We stop the endless recursion by not resetting the
+ # count.
+ def reset_retry_count(self):
+ pass
+
def getauthinfo(path):
scheme, netloc, urlpath, query, frag = urlparse.urlsplit(path)
if not urlpath:
--- a/tests/test-import Sun Jun 20 20:02:27 2010 +0200
+++ b/tests/test-import Sun Jun 20 23:37:09 2010 +0200
@@ -296,31 +296,31 @@
EOF
cd ..
-echo '% test import with similarity (issue295)'
+echo '% test import with similarity and git and strip (issue295 et al.)'
hg init sim
cd sim
echo 'this is a test' > a
hg ci -Ama
cat > ../rename.diff <<EOF
-diff --git a/a b/a
+diff --git a/foo/a b/foo/a
deleted file mode 100644
---- a/a
+--- a/foo/a
+++ /dev/null
@@ -1,1 +0,0 @@
-this is a test
-diff --git a/b b/b
+diff --git a/foo/b b/foo/b
new file mode 100644
--- /dev/null
-+++ b/b
++++ b/foo/b
@@ -0,0 +1,2 @@
+this is a test
+foo
EOF
-hg import --no-commit -v -s 1 ../rename.diff
+hg import --no-commit -v -s 1 ../rename.diff -p2
hg st -C
hg revert -a
rm b
-hg import --no-commit -v -s 100 ../rename.diff
+hg import --no-commit -v -s 100 ../rename.diff -p2
hg st -C
cd ..
--- a/tests/test-import.out Sun Jun 20 20:02:27 2010 +0200
+++ b/tests/test-import.out Sun Jun 20 23:37:09 2010 +0200
@@ -279,7 +279,7 @@
% test paths outside repo root
applying patch from stdin
abort: ../outside/foo not under root
-% test import with similarity (issue295)
+% test import with similarity and git and strip (issue295 et al.)
adding a
applying ../rename.diff
patching file a
--- a/tests/test-issue619.out Sun Jun 20 20:02:27 2010 +0200
+++ b/tests/test-issue619.out Sun Jun 20 23:37:09 2010 +0200
@@ -6,5 +6,5 @@
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
bogus fast-forward should fail
-abort: can't merge with ancestor
+abort: merging with a working directory ancestor has no effect
done
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-revset Sun Jun 20 23:37:09 2010 +0200
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+try() {
+ echo '% hg debugrevspec' $@
+ hg debugrevspec $@
+}
+
+hg init repo
+cd repo
+hg branch a
+hg ci -m "plain name"
+hg branch b
+hg ci -m "another plain name"
+hg branch a-b-c-
+hg ci -m "with dashes"
+hg branch -- -a-b-c-
+hg ci -m "with leading dash"
+hg branch +a+b+c+
+hg ci -m "with plusses"
+hg branch /a/b/c/
+hg ci -m "with slashes"
+hg branch _a_b_c_
+hg ci -m "with underscores"
+hg branch .a.b.c.
+hg ci -m "with dots"
+
+# names that should work without quoting
+try a
+try b-a
+try _a_b_c_
+try _a_b_c_-a
+try .a.b.c.
+try .a.b.c.-a
+
+# quoting needed
+try '"-a-b-c-"'
+try '"-a-b-c-"-a'
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-revset.out Sun Jun 20 23:37:09 2010 +0200
@@ -0,0 +1,24 @@
+marked working directory as branch a
+marked working directory as branch b
+marked working directory as branch a-b-c-
+marked working directory as branch -a-b-c-
+marked working directory as branch +a+b+c+
+marked working directory as branch /a/b/c/
+marked working directory as branch _a_b_c_
+marked working directory as branch .a.b.c.
+% hg debugrevspec a
+0
+% hg debugrevspec b-a
+1
+% hg debugrevspec _a_b_c_
+6
+% hg debugrevspec _a_b_c_-a
+6
+% hg debugrevspec .a.b.c.
+7
+% hg debugrevspec .a.b.c.-a
+7
+% hg debugrevspec "-a-b-c-"
+3
+% hg debugrevspec "-a-b-c-"-a
+3