##// END OF EJS Templates
brancing: merge stable into default
marmoute -
r52727:454fedda merge default
parent child Browse files
Show More
@@ -105,4 +105,4 b' def extsetup(ui):'
105 105 )
106 106 extensions.wrapfunction(webcommands, 'annotate', annotate_highlight)
107 107 webcommands.highlightcss = generate_css
108 webcommands.__all__.append(b'highlightcss')
108 webcommands.__all__.append('highlightcss')
@@ -1716,7 +1716,7 b' def _chisteditmain(repo, rules, stdscr):'
1716 1716 ch = encoding.strtolocal(stdscr.getkey())
1717 1717
1718 1718
1719 def _chistedit(ui, repo, freeargs, opts):
1719 def _chistedit(ui, repo, state, freeargs, opts):
1720 1720 """interactively edit changeset history via a curses interface
1721 1721
1722 1722 Provides a ncurses interface to histedit. Press ? in chistedit mode
@@ -1776,7 +1776,7 b' def _chistedit(ui, repo, freeargs, opts)'
1776 1776 for r in rules:
1777 1777 fp.write(r)
1778 1778 opts[b'commands'] = fp.name
1779 return _texthistedit(ui, repo, freeargs, opts)
1779 return _texthistedit(ui, repo, state, freeargs, opts)
1780 1780 except KeyboardInterrupt:
1781 1781 pass
1782 1782 return -1
@@ -1915,20 +1915,20 b' def histedit(ui, repo, *freeargs, **opts'
1915 1915 """
1916 1916 opts = pycompat.byteskwargs(opts)
1917 1917
1918 # kludge: _chistedit only works for starting an edit, not aborting
1919 # or continuing, so fall back to regular _texthistedit for those
1920 # operations.
1921 if ui.interface(b'histedit') == b'curses' and _getgoal(opts) == goalnew:
1922 return _chistedit(ui, repo, freeargs, opts)
1923 return _texthistedit(ui, repo, freeargs, opts)
1924
1925
1926 def _texthistedit(ui, repo, freeargs, opts):
1927 1918 state = histeditstate(repo)
1928 1919 with repo.wlock() as wlock, repo.lock() as lock:
1929 1920 state.wlock = wlock
1930 1921 state.lock = lock
1931 _histedit(ui, repo, state, freeargs, opts)
1922 # kludge: _chistedit only works for starting an edit, not aborting
1923 # or continuing, so fall back to regular _texthistedit for those
1924 # operations.
1925 if ui.interface(b'histedit') == b'curses' and _getgoal(opts) == goalnew:
1926 return _chistedit(ui, repo, state, freeargs, opts)
1927 return _texthistedit(ui, repo, state, freeargs, opts)
1928
1929
1930 def _texthistedit(ui, repo, state, freeargs, opts):
1931 _histedit(ui, repo, state, freeargs, opts)
1932 1932
1933 1933
1934 1934 goalcontinue = b'continue'
@@ -49,6 +49,8 b' from mercurial.upgrade_utils import ('
49 49 actions as upgrade_actions,
50 50 )
51 51
52 from mercurial.utils import urlutil
53
52 54 from . import (
53 55 lfcommands,
54 56 lfutil,
@@ -1139,7 +1141,10 b' def overrideclone(orig, ui, source, dest'
1139 1141 d = dest
1140 1142 if d is None:
1141 1143 d = hg.defaultdest(source)
1142 if opts.get('all_largefiles') and not hg.islocal(d):
1144 if opts.get('all_largefiles') and urlutil.url(d).scheme not in (
1145 b'file',
1146 None,
1147 ):
1143 1148 raise error.Abort(
1144 1149 _(b'--all-largefiles is incompatible with non-local destination %s')
1145 1150 % d
@@ -89,7 +89,7 b' import traceback'
89 89
90 90 from mercurial import pycompat
91 91
92 __all__ = [b"Zeroconf", b"ServiceInfo", b"ServiceBrowser"]
92 __all__ = ["Zeroconf", "ServiceInfo", "ServiceBrowser"]
93 93
94 94 # hook for threads
95 95
@@ -21,11 +21,11 b' lib = _bdiff.lib'
21 21
22 22
23 23 def blocks(sa: bytes, sb: bytes) -> List[Tuple[int, int, int, int]]:
24 a = ffi.new(b"struct bdiff_line**")
25 b = ffi.new(b"struct bdiff_line**")
26 ac = ffi.new(b"char[]", str(sa))
27 bc = ffi.new(b"char[]", str(sb))
28 l = ffi.new(b"struct bdiff_hunk*")
24 a = ffi.new("struct bdiff_line**")
25 b = ffi.new("struct bdiff_line**")
26 ac = ffi.new("char[]", bytes(sa))
27 bc = ffi.new("char[]", bytes(sb))
28 l = ffi.new("struct bdiff_hunk*")
29 29 try:
30 30 an = lib.bdiff_splitlines(ac, len(sa), a)
31 31 bn = lib.bdiff_splitlines(bc, len(sb), b)
@@ -49,11 +49,11 b' def blocks(sa: bytes, sb: bytes) -> List'
49 49
50 50
51 51 def bdiff(sa: bytes, sb: bytes) -> bytes:
52 a = ffi.new(b"struct bdiff_line**")
53 b = ffi.new(b"struct bdiff_line**")
54 ac = ffi.new(b"char[]", str(sa))
55 bc = ffi.new(b"char[]", str(sb))
56 l = ffi.new(b"struct bdiff_hunk*")
52 a = ffi.new("struct bdiff_line**")
53 b = ffi.new("struct bdiff_line**")
54 ac = ffi.new("char[]", bytes(sa))
55 bc = ffi.new("char[]", bytes(sb))
56 l = ffi.new("struct bdiff_hunk*")
57 57 try:
58 58 an = lib.bdiff_splitlines(ac, len(sa), a)
59 59 bn = lib.bdiff_splitlines(bc, len(sb), b)
@@ -76,7 +76,7 b' def bdiff(sa: bytes, sb: bytes) -> bytes'
76 76 lgt,
77 77 )
78 78 )
79 rl.append(str(ffi.buffer((b[0] + lb).l, lgt)))
79 rl.append(bytes(ffi.buffer((b[0] + lb).l, lgt)))
80 80 la = h.a2
81 81 lb = h.b2
82 82 h = h.next
@@ -19,8 +19,8 b' lib = _mpatch.lib'
19 19 @ffi.def_extern()
20 20 def cffi_get_next_item(arg, pos):
21 21 all, bins = ffi.from_handle(arg)
22 container = ffi.new(b"struct mpatch_flist*[1]")
23 to_pass = ffi.new(b"char[]", str(bins[pos]))
22 container = ffi.new("struct mpatch_flist*[1]")
23 to_pass = ffi.new("char[]", bytes(bins[pos]))
24 24 all.append(to_pass)
25 25 r = lib.mpatch_decode(to_pass, len(to_pass) - 1, container)
26 26 if r < 0:
@@ -41,7 +41,7 b' def patches(text: bytes, bins: List[byte'
41 41 if outlen < 0:
42 42 lib.mpatch_lfree(patch)
43 43 raise mpatchError(b"inconsistency detected")
44 buf = ffi.new(b"char[]", outlen)
44 buf = ffi.new("char[]", outlen)
45 45 if lib.mpatch_apply(buf, text, len(text), patch) < 0:
46 46 lib.mpatch_lfree(patch)
47 47 raise mpatchError(b"error applying patches")
@@ -39,8 +39,8 b' if pycompat.isdarwin:'
39 39 self.st_mtime = st_mtime
40 40 self.st_size = st_size
41 41
42 tv_sec_ofs = ffi.offsetof(b"struct timespec", b"tv_sec")
43 buf = ffi.new(b"char[]", listdir_batch_size)
42 tv_sec_ofs = ffi.offsetof("struct timespec", "tv_sec")
43 buf = ffi.new("char[]", listdir_batch_size)
44 44
45 45 def listdirinternal(dfd, req, stat, skip):
46 46 ret = []
@@ -50,16 +50,16 b' if pycompat.isdarwin:'
50 50 break
51 51 if r == -1:
52 52 raise OSError(ffi.errno, os.strerror(ffi.errno))
53 cur = ffi.cast(b"val_attrs_t*", buf)
53 cur = ffi.cast("val_attrs_t*", buf)
54 54 for i in range(r):
55 55 lgt = cur.length
56 assert lgt == ffi.cast(b'uint32_t*', cur)[0]
56 assert lgt == ffi.cast('uint32_t*', cur)[0]
57 57 ofs = cur.name_info.attr_dataoffset
58 58 str_lgt = cur.name_info.attr_length
59 base_ofs = ffi.offsetof(b'val_attrs_t', b'name_info')
59 base_ofs = ffi.offsetof('val_attrs_t', 'name_info')
60 60 name = bytes(
61 61 ffi.buffer(
62 ffi.cast(b"char*", cur) + base_ofs + ofs, str_lgt - 1
62 ffi.cast("char*", cur) + base_ofs + ofs, str_lgt - 1
63 63 )
64 64 )
65 65 tp = attrkinds[cur.obj_type]
@@ -84,12 +84,12 b' if pycompat.isdarwin:'
84 84 else:
85 85 ret.append((name, tp))
86 86 cur = ffi.cast(
87 b"val_attrs_t*", int(ffi.cast(b"intptr_t", cur)) + lgt
87 "val_attrs_t*", int(ffi.cast("intptr_t", cur)) + lgt
88 88 )
89 89 return ret
90 90
91 91 def listdir(path, stat=False, skip=None):
92 req = ffi.new(b"struct attrlist*")
92 req = ffi.new("struct attrlist*")
93 93 req.bitmapcount = lib.ATTR_BIT_MAP_COUNT
94 94 req.commonattr = (
95 95 lib.ATTR_CMN_RETURNED_ATTRS
@@ -464,7 +464,7 b' class hgweb:'
464 464
465 465 res.headers[b'ETag'] = tag
466 466
467 if cmd not in webcommands.__all__:
467 if pycompat.sysstr(cmd) not in webcommands.__all__:
468 468 msg = b'no such method: %s' % cmd
469 469 raise ErrorResponse(HTTP_BAD_REQUEST, msg)
470 470 else:
@@ -72,7 +72,7 b' class webcommand:'
72 72 self.name = name
73 73
74 74 def __call__(self, func):
75 __all__.append(self.name)
75 __all__.append(pycompat.sysstr(self.name))
76 76 commands[self.name] = func
77 77 return func
78 78
@@ -687,6 +687,6 b" if __name__ == '__main__':"
687 687 N = int(sys.argv[1])
688 688 url = sys.argv[2]
689 689 except (IndexError, ValueError):
690 print(b"%s <integer> <url>" % sys.argv[0])
690 print("%s <integer> <url>" % sys.argv[0])
691 691 else:
692 692 test(url, N)
@@ -6,7 +6,7 b' Profiler = _lsprof.Profiler'
6 6 # PyPy doesn't expose profiler_entry from the module.
7 7 profiler_entry = getattr(_lsprof, 'profiler_entry', None)
8 8
9 __all__ = [b'profile', b'Stats']
9 __all__ = ['profile', 'Stats']
10 10
11 11
12 12 def profile(f, *args, **kwds):
@@ -528,7 +528,7 b' def _filternarrowactions(narrowmatch, br'
528 528 """
529 529 # We mutate the items in the dict during iteration, so iterate
530 530 # over a copy.
531 for f, action in mresult.filemap():
531 for f, action in list(mresult.filemap()):
532 532 if narrowmatch(f):
533 533 pass
534 534 elif not branchmerge:
@@ -669,7 +669,7 b' class mergeresult:'
669 669 return sum(len(self._actionmapping[a]) for a in actions)
670 670
671 671 def filemap(self, sort=False):
672 if sorted:
672 if sort:
673 673 for key, val in sorted(self._filemapping.items()):
674 674 yield key, val
675 675 else:
@@ -243,7 +243,7 b' def compute_all_files_changes(ctx):'
243 243 return _process_linear(p1, ctx)
244 244 elif p1.rev() == nullrev and p2.rev() != nullrev:
245 245 # In the wild, one can encounter changeset where p1 is null but p2 is not
246 return _process_linear(p1, ctx, parent=2)
246 return _process_linear(p2, ctx, parent=2)
247 247 elif p1.rev() == p2.rev():
248 248 # In the wild, one can encounter such "non-merge"
249 249 return _process_linear(p1, ctx)
@@ -122,7 +122,7 b' def split(stream):'
122 122 if not m.is_multipart():
123 123 yield msgfp(m)
124 124 else:
125 ok_types = (b'text/plain', b'text/x-diff', b'text/x-patch')
125 ok_types = ('text/plain', 'text/x-diff', 'text/x-patch')
126 126 for part in m.walk():
127 127 ct = part.get_content_type()
128 128 if ct not in ok_types:
@@ -23,6 +23,7 b' import unicodedata'
23 23 from typing import (
24 24 Any,
25 25 AnyStr,
26 Callable,
26 27 Iterable,
27 28 Iterator,
28 29 List,
@@ -552,7 +553,7 b" if pycompat.sysplatform == b'OpenVMS':"
552 553 return False
553 554
554 555
555 _needsshellquote: Optional[Match[bytes]] = None
556 _needsshellquote: Optional[Callable[[bytes], Optional[Match[bytes]]]] = None
556 557
557 558
558 559 def shellquote(s: bytes) -> bytes:
@@ -126,7 +126,7 b' from . import ('
126 126 defaultdict = collections.defaultdict
127 127 contextmanager = contextlib.contextmanager
128 128
129 __all__ = [b'start', b'stop', b'reset', b'display', b'profile']
129 __all__ = ['start', 'stop', 'reset', 'display', 'profile']
130 130
131 131 skips = {
132 132 "util.py:check",
@@ -734,9 +734,9 b' checksum = "e2abad23fbc42b3700f2f279844d'
734 734
735 735 [[package]]
736 736 name = "libc"
737 version = "0.2.137"
737 version = "0.2.155"
738 738 source = "registry+https://github.com/rust-lang/crates.io-index"
739 checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89"
739 checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
740 740
741 741 [[package]]
742 742 name = "libm"
@@ -1178,6 +1178,7 b' dependencies = ['
1178 1178 "hg-core",
1179 1179 "home",
1180 1180 "lazy_static",
1181 "libc",
1181 1182 "log",
1182 1183 "logging_timer",
1183 1184 "rayon",
@@ -24,3 +24,4 b' shellexpand = { version = "3.1", feature'
24 24 whoami = "1.4"
25 25 which = "4.3.0"
26 26 rayon = "1.7.0"
27 libc = "0.2.155"
@@ -611,7 +611,11 b' pub fn run(invocation: &crate::CliInvoca'
611 611 log::info!("not writing dirstate from `status`: lock is held")
612 612 }
613 613 Err(LockError::Other(HgError::IoError { error, .. }))
614 if error.kind() == io::ErrorKind::PermissionDenied =>
614 if error.kind() == io::ErrorKind::PermissionDenied
615 || match error.raw_os_error() {
616 None => false,
617 Some(errno) => libc::EROFS == errno,
618 } =>
615 619 {
616 620 // `hg status` on a read-only repository is fine
617 621 }
@@ -1660,7 +1660,11 b" if os.name == 'nt':"
1660 1660 # Allow compiler/linker flags to be added to Visual Studio builds. Passing
1661 1661 # extra_link_args to distutils.extensions.Extension() doesn't have any
1662 1662 # effect.
1663 from distutils import msvccompiler
1663 try:
1664 # setuptools < 65.0
1665 from distutils import msvccompiler
1666 except ImportError:
1667 from distutils import _msvccompiler as msvccompiler
1664 1668
1665 1669 msvccompilerclass = msvccompiler.MSVCCompiler
1666 1670
@@ -20,4 +20,4 b' def raiseerror(web):'
20 20
21 21 def extsetup(ui):
22 22 setattr(webcommands, 'raiseerror', raiseerror)
23 webcommands.__all__.append(b'raiseerror')
23 webcommands.__all__.append('raiseerror')
@@ -1076,6 +1076,11 b' Ensure base clone command argument valid'
1076 1076 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
1077 1077 [255]
1078 1078
1079 $ touch existing_destination
1080 $ hg clone --all-largefiles a existing_destination
1081 abort: destination 'existing_destination' already exists
1082 [10]
1083
1079 1084 Test pulling with --all-largefiles flag. Also test that the largefiles are
1080 1085 downloaded from 'default' instead of 'default-push' when no source is specified
1081 1086 (issue3584)
General Comments 0
You need to be logged in to leave comments. Login now