merge with stable
authorAugie Fackler <augie@google.com>
Thu, 09 May 2019 18:37:37 -0400
changeset 42267 838f3a094b4f
parent 42266 b3fc78c028ef (current diff)
parent 42263 ce5f1232631f (diff)
child 42268 af13e2088f77
merge with stable
tests/test-revset.t
--- 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,
--- 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]
--- 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
 
--- 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 <<EOF
+  > 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 <<EOF
--- a/tests/test-revset.t	Wed May 08 21:25:23 2019 -0700
+++ b/tests/test-revset.t	Thu May 09 18:37:37 2019 -0400
@@ -472,6 +472,12 @@
   $ log 'extra(unknown=branch)'
   hg: parse error: extra got an unexpected keyword argument 'unknown'
   [255]
+  $ log 'extra((), x)'
+  hg: parse error: first argument to extra must be a string
+  [255]
+  $ log 'extra(label=x, ())'
+  hg: parse error: extra got an invalid argument
+  [255]
 
   $ try 'foo=bar|baz'
   (keyvalue