# HG changeset patch # User Matt Mackall # Date 1457731467 21600 # Node ID 3072ce74094586de86d6afc259c4285b4ebb3dcb # Parent 7108834c76a265b17daada2378cc0a3c51a125d8# Parent 48e1a641765d541a4bdc3f36b69cb3f5974040af merge with stable diff -r 7108834c76a2 -r 3072ce740945 hgext/mq.py --- 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) diff -r 7108834c76a2 -r 3072ce740945 mercurial/cmdutil.py --- 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") diff -r 7108834c76a2 -r 3072ce740945 mercurial/pure/bdiff.py --- 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) diff -r 7108834c76a2 -r 3072ce740945 tests/test-clone-uncompressed.t --- 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 .. diff -r 7108834c76a2 -r 3072ce740945 tests/test-mq-qimport.t --- 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 diff -r 7108834c76a2 -r 3072ce740945 tests/test-subrepo-deep-nested-change.t --- 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)