# HG changeset patch # User Augie Fackler # Date 1557441457 14400 # Node ID 838f3a094b4fb9169c5a8552a7ae01c7735fe62a # Parent b3fc78c028efa8c39545b9cedc471111675bba4b# Parent ce5f1232631ffd86d283e0087cf29b19a5bb039a merge with stable diff -r b3fc78c028ef -r 838f3a094b4f mercurial/cmdutil.py --- a/mercurial/cmdutil.py Wed May 08 21:25:23 2019 -0700 +++ b/mercurial/cmdutil.py Thu May 09 18:37:37 2019 -0400 @@ -272,6 +272,15 @@ raise error.Abort(_('cannot partially commit a merge ' '(use "hg commit" instead)')) + def fail(f, msg): + raise error.Abort('%s: %s' % (f, msg)) + + force = opts.get('force') + if not force: + vdirs = [] + match.explicitdir = vdirs.append + match.bad = fail + status = repo.status(match=match) overrides = {(b'ui', b'commitsubrepos'): True} @@ -294,15 +303,6 @@ dirtyreason = wctx.sub(s).dirtyreason(True) raise error.Abort(dirtyreason) - def fail(f, msg): - raise error.Abort('%s: %s' % (f, msg)) - - force = opts.get('force') - if not force: - vdirs = [] - match.explicitdir = vdirs.append - match.bad = fail - if not force: repo.checkcommitpatterns(wctx, vdirs, match, status, fail) diffopts = patch.difffeatureopts(ui, opts=opts, whitespace=True, diff -r b3fc78c028ef -r 838f3a094b4f mercurial/parser.py --- a/mercurial/parser.py Wed May 08 21:25:23 2019 -0700 +++ b/mercurial/parser.py Thu May 09 18:37:37 2019 -0400 @@ -147,7 +147,8 @@ arguments are rejected, but missing keyword arguments are just omitted. """ poskeys, varkey, keys, optkey = argspec - kwstart = next((i for i, x in enumerate(trees) if x[0] == keyvaluenode), + kwstart = next((i for i, x in enumerate(trees) + if x and x[0] == keyvaluenode), len(trees)) if kwstart < len(poskeys): raise error.ParseError(_("%(func)s takes at least %(nargs)d positional " @@ -171,7 +172,7 @@ if optkey: args[optkey] = util.sortdict() for x in trees[kwstart:]: - if x[0] != keyvaluenode or x[1][0] != keynode: + if not x or x[0] != keyvaluenode or x[1][0] != keynode: raise error.ParseError(_("%(func)s got an invalid argument") % {'func': funcname}) k = x[1][1] diff -r b3fc78c028ef -r 838f3a094b4f mercurial/sslutil.py --- a/mercurial/sslutil.py Wed May 08 21:25:23 2019 -0700 +++ b/mercurial/sslutil.py Thu May 09 18:37:37 2019 -0400 @@ -722,7 +722,7 @@ certs = certifi.where() if os.path.exists(certs): ui.debug('using ca certificates from certifi\n') - return certs + return pycompat.fsencode(certs) except (ImportError, AttributeError): pass diff -r b3fc78c028ef -r 838f3a094b4f tests/test-commit-interactive.t --- a/tests/test-commit-interactive.t Wed May 08 21:25:23 2019 -0700 +++ b/tests/test-commit-interactive.t Thu May 09 18:37:37 2019 -0400 @@ -775,12 +775,24 @@ +10 +11 +Interactive commit can name a directory instead of files (issue6131) $ mkdir subdir + $ echo a > subdir/a + $ hg ci -d '16 0' -i subdir -Amsubdir < y + > y + > EOF + adding subdir/a + diff --git a/subdir/a b/subdir/a + new file mode 100644 + examine changes to 'subdir/a'? [Ynesfdaq?] y + + @@ -0,0 +1,1 @@ + +a + record this change to 'subdir/a'? [Ynesfdaq?] y + $ cd subdir - $ echo a > a - $ hg ci -d '16 0' -Amsubdir - adding subdir/a $ echo a >> a $ hg commit -i -d '16 0' -m subdir-change a <