# HG changeset patch # User Martin Geisler # Date 1277069829 -7200 # Node ID b4467a7d5c75aadbad2e8de3763f3df5a9fef17b # Parent fff28d436489054f889687d7308b3cfa5806e775# Parent 6f1d1ed3e19aaf4bfc14741956e0e6ff06fbe9d2 Merge with mpm diff -r fff28d436489 -r b4467a7d5c75 hgext/pager.py --- 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: diff -r fff28d436489 -r b4467a7d5c75 hgext/patchbomb.py --- 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. diff -r fff28d436489 -r b4467a7d5c75 hgext/transplant.py --- 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) diff -r fff28d436489 -r b4467a7d5c75 mercurial/cmdutil.py --- 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 diff -r fff28d436489 -r b4467a7d5c75 mercurial/help/config.txt --- 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 @@ - ``/etc/mercurial/hgrc`` - ``/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 /.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:: diff -r fff28d436489 -r b4467a7d5c75 mercurial/merge.py --- 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 diff -r fff28d436489 -r b4467a7d5c75 mercurial/parser.py --- 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) diff -r fff28d436489 -r b4467a7d5c75 mercurial/ui.py --- 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): diff -r fff28d436489 -r b4467a7d5c75 mercurial/url.py --- 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: diff -r fff28d436489 -r b4467a7d5c75 tests/test-import --- 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 <