--- a/hgext/mq.py Fri Mar 11 04:14:54 2016 +0900
+++ b/hgext/mq.py Fri Mar 11 15:24:27 2016 -0600
@@ -1118,6 +1118,7 @@
"""Return a suitable filename for title, adding a suffix to make
it unique in the existing list"""
namebase = re.sub('[\s\W_]+', '_', title.lower()).strip('_')
+ namebase = namebase[:75] # avoid too long name (issue5117)
if namebase:
try:
self.checkreservedname(namebase)
--- a/mercurial/cmdutil.py Fri Mar 11 04:14:54 2016 +0900
+++ b/mercurial/cmdutil.py Fri Mar 11 15:24:27 2016 -0600
@@ -2374,14 +2374,15 @@
for subpath in sorted(ctx.substate):
def matchessubrepo(subpath):
- return (m.always() or m.exact(subpath)
+ return (m.exact(subpath)
or any(f.startswith(subpath + '/') for f in m.files()))
if subrepos or matchessubrepo(subpath):
sub = ctx.sub(subpath)
try:
submatch = matchmod.subdirmatcher(subpath, m)
- if sub.printfiles(ui, submatch, fm, fmt, subrepos) == 0:
+ recurse = m.exact(subpath) or subrepos
+ if sub.printfiles(ui, submatch, fm, fmt, recurse) == 0:
ret = 0
except error.LookupError:
ui.status(_("skipping missing subrepository: %s\n")
--- a/mercurial/pure/bdiff.py Fri Mar 11 04:14:54 2016 +0900
+++ b/mercurial/pure/bdiff.py Fri Mar 11 15:24:27 2016 -0600
@@ -7,6 +7,7 @@
from __future__ import absolute_import
+import array
import difflib
import re
import struct
@@ -50,9 +51,15 @@
r.append(prev)
return r
+def _tostring(c):
+ if type(c) is array.array:
+ # this copy overhead isn't ideal
+ return c.tostring()
+ return str(c)
+
def bdiff(a, b):
- a = str(a).splitlines(True)
- b = str(b).splitlines(True)
+ a = _tostring(a).splitlines(True)
+ b = _tostring(b).splitlines(True)
if not a:
s = "".join(b)
--- a/tests/test-clone-uncompressed.t Fri Mar 11 04:14:54 2016 +0900
+++ b/tests/test-clone-uncompressed.t Fri Mar 11 15:24:27 2016 -0600
@@ -1,5 +1,8 @@
#require serve
+Initialize repository
+the status call is to check for issue5130
+
$ hg init server
$ cd server
$ touch foo
@@ -8,6 +11,7 @@
... with open(str(i), 'wb') as fh:
... fh.write(str(i))
$ hg -q commit -A -m 'add a lot of files'
+ $ hg st
$ hg serve -p $HGPORT -d --pid-file=hg.pid
$ cat hg.pid >> $DAEMON_PIDS
$ cd ..
--- a/tests/test-mq-qimport.t Fri Mar 11 04:14:54 2016 +0900
+++ b/tests/test-mq-qimport.t Fri Mar 11 15:24:27 2016 -0600
@@ -331,3 +331,12 @@
2.diff
taken__2
+check very long patch name
+
+ $ hg qpop -qa
+ patch queue now empty
+ $ echo >> b
+ $ hg commit -m 'abcdefghi pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ $ hg qimport -r .
+ $ hg qap
+ abcdefghi_pqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghi_pqrstuvwxyzabcdefg
--- a/tests/test-subrepo-deep-nested-change.t Fri Mar 11 04:14:54 2016 +0900
+++ b/tests/test-subrepo-deep-nested-change.t Fri Mar 11 15:24:27 2016 -0600
@@ -303,6 +303,12 @@
sub1/sub2/folder/bar (glob)
sub1/sub2/x.txt (glob)
+ $ hg files
+ .hgsub
+ .hgsubstate
+ foo/bar/abc (glob)
+ main
+
$ hg files -S -r '.^' sub1/sub2/folder
sub1/sub2/folder/test.txt (glob)