Mercurial > hg
annotate hgext/narrow/narrowwirepeer.py @ 42961:460f8bf58020
osutil: allow disabling setprocname via a define passed to the compiler
In some situations, we run a custom python launcher that appears to not set up
Py_GetArgcArgv correctly. We then proceed to promptly crash when we attempt to
dereference NULL. Being able to completely disable setprocname is beneficial in
these situations, since we won't even attempt to use it, even if the case that
causes the crash is fixed.
Right now, if I compile osutil.so with -DSETPROCNAME_USE_NONE, the compilation
fails on python3 due to SETPROCNAME_USE_NONE redefinition. I could possibly
work around that, but it's likely helpful to have a way of disabling this
completely without it being brittle (i.e. if python3 ever gains the ability to
perform this operation).
Differential Revision: https://phab.mercurial-scm.org/D6865
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Tue, 17 Sep 2019 14:57:42 -0700 |
parents | c2676b5a9f59 |
children | 2372284d9457 |
rev | line source |
---|---|
36079
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
1 # narrowwirepeer.py - passes narrow spec with unbundle command |
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
2 # |
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
3 # Copyright 2017 Google, Inc. |
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
4 # |
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
5 # This software may be used and distributed according to the terms of the |
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
6 # GNU General Public License version 2 or any later version. |
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
7 |
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
8 from __future__ import absolute_import |
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
9 |
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
10 from mercurial import ( |
40070
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
11 bundle2, |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
12 error, |
36079
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
13 extensions, |
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
14 hg, |
40070
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
15 narrowspec, |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
16 pycompat, |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
17 wireprototypes, |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
18 wireprotov1peer, |
39523
c90514043eaa
narrow: add narrow and ellipses as server capabilities
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
36351
diff
changeset
|
19 wireprotov1server, |
36079
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
20 ) |
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
21 |
42415
c767e655ffda
narrow: use narrow_widen wireproto command to widen in case of ellipses
Pulkit Goyal <7895pulkit@gmail.com>
parents:
40344
diff
changeset
|
22 from . import narrowbundle2 |
c767e655ffda
narrow: use narrow_widen wireproto command to widen in case of ellipses
Pulkit Goyal <7895pulkit@gmail.com>
parents:
40344
diff
changeset
|
23 |
36079
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
24 def uisetup(): |
40070
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
25 wireprotov1peer.wirepeer.narrow_widen = peernarrowwiden |
39523
c90514043eaa
narrow: add narrow and ellipses as server capabilities
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
36351
diff
changeset
|
26 |
36079
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
27 def reposetup(repo): |
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
28 def wirereposetup(ui, peer): |
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
29 def wrapped(orig, cmd, *args, **kwargs): |
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
30 if cmd == 'unbundle': |
36102
b60c577b6e03
narrowwirepeer: add TODO about how we add wireproto args to unbundle :(
Augie Fackler <augie@google.com>
parents:
36101
diff
changeset
|
31 # TODO: don't blindly add include/exclude wireproto |
b60c577b6e03
narrowwirepeer: add TODO about how we add wireproto args to unbundle :(
Augie Fackler <augie@google.com>
parents:
36101
diff
changeset
|
32 # arguments to unbundle. |
36079
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
33 include, exclude = repo.narrowpats |
36351
87e950a070e6
narrowwirepeer: add some strkwargs to fix a crash on py3
Augie Fackler <augie@google.com>
parents:
36160
diff
changeset
|
34 kwargs[r"includepats"] = ','.join(include) |
87e950a070e6
narrowwirepeer: add some strkwargs to fix a crash on py3
Augie Fackler <augie@google.com>
parents:
36160
diff
changeset
|
35 kwargs[r"excludepats"] = ','.join(exclude) |
36079
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
36 return orig(cmd, *args, **kwargs) |
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
37 extensions.wrapfunction(peer, '_calltwowaystream', wrapped) |
a2a6e724d61a
narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
38 hg.wirepeersetupfuncs.append(wirereposetup) |
40070
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
39 |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
40 @wireprotov1server.wireprotocommand('narrow_widen', 'oldincludes oldexcludes' |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
41 ' newincludes newexcludes' |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
42 ' commonheads cgversion' |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
43 ' known ellipses', |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
44 permission='pull') |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
45 def narrow_widen(repo, proto, oldincludes, oldexcludes, newincludes, |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
46 newexcludes, commonheads, cgversion, known, ellipses): |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
47 """wireprotocol command to send data when a narrow clone is widen. We will |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
48 be sending a changegroup here. |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
49 |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
50 The current set of arguments which are required: |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
51 oldincludes: the old includes of the narrow copy |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
52 oldexcludes: the old excludes of the narrow copy |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
53 newincludes: the new includes of the narrow copy |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
54 newexcludes: the new excludes of the narrow copy |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
55 commonheads: list of heads which are common between the server and client |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
56 cgversion(maybe): the changegroup version to produce |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
57 known: list of nodes which are known on the client (used in ellipses cases) |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
58 ellipses: whether to send ellipses data or not |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
59 """ |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
60 |
40148
74558635dad5
narrow: don't compress the bundle2 when sending 'error:abort'
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
40075
diff
changeset
|
61 preferuncompressed = False |
40070
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
62 try: |
42944
c2676b5a9f59
narrow: don't hexify paths and double-hexify known nodes on wire (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
42417
diff
changeset
|
63 def splitpaths(data): |
c2676b5a9f59
narrow: don't hexify paths and double-hexify known nodes on wire (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
42417
diff
changeset
|
64 # work around ''.split(',') => [''] |
c2676b5a9f59
narrow: don't hexify paths and double-hexify known nodes on wire (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
42417
diff
changeset
|
65 return data.split(b',') if data else [] |
c2676b5a9f59
narrow: don't hexify paths and double-hexify known nodes on wire (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
42417
diff
changeset
|
66 oldincludes = splitpaths(oldincludes) |
c2676b5a9f59
narrow: don't hexify paths and double-hexify known nodes on wire (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
42417
diff
changeset
|
67 newincludes = splitpaths(newincludes) |
c2676b5a9f59
narrow: don't hexify paths and double-hexify known nodes on wire (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
42417
diff
changeset
|
68 oldexcludes = splitpaths(oldexcludes) |
c2676b5a9f59
narrow: don't hexify paths and double-hexify known nodes on wire (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
42417
diff
changeset
|
69 newexcludes = splitpaths(newexcludes) |
40070
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
70 # validate the patterns |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
71 narrowspec.validatepatterns(set(oldincludes)) |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
72 narrowspec.validatepatterns(set(newincludes)) |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
73 narrowspec.validatepatterns(set(oldexcludes)) |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
74 narrowspec.validatepatterns(set(newexcludes)) |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
75 |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
76 common = wireprototypes.decodelist(commonheads) |
42415
c767e655ffda
narrow: use narrow_widen wireproto command to widen in case of ellipses
Pulkit Goyal <7895pulkit@gmail.com>
parents:
40344
diff
changeset
|
77 known = wireprototypes.decodelist(known) |
40070
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
78 if ellipses == '0': |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
79 ellipses = False |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
80 else: |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
81 ellipses = bool(ellipses) |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
82 cgversion = cgversion |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
83 |
42417
a97b12f726e4
narrow: pass the bundle to bundle2.widen_bundle() instead of generating there
Pulkit Goyal <7895pulkit@gmail.com>
parents:
42415
diff
changeset
|
84 bundler = bundle2.bundle20(repo.ui) |
42415
c767e655ffda
narrow: use narrow_widen wireproto command to widen in case of ellipses
Pulkit Goyal <7895pulkit@gmail.com>
parents:
40344
diff
changeset
|
85 if not ellipses: |
c767e655ffda
narrow: use narrow_widen wireproto command to widen in case of ellipses
Pulkit Goyal <7895pulkit@gmail.com>
parents:
40344
diff
changeset
|
86 newmatch = narrowspec.match(repo.root, include=newincludes, |
c767e655ffda
narrow: use narrow_widen wireproto command to widen in case of ellipses
Pulkit Goyal <7895pulkit@gmail.com>
parents:
40344
diff
changeset
|
87 exclude=newexcludes) |
c767e655ffda
narrow: use narrow_widen wireproto command to widen in case of ellipses
Pulkit Goyal <7895pulkit@gmail.com>
parents:
40344
diff
changeset
|
88 oldmatch = narrowspec.match(repo.root, include=oldincludes, |
c767e655ffda
narrow: use narrow_widen wireproto command to widen in case of ellipses
Pulkit Goyal <7895pulkit@gmail.com>
parents:
40344
diff
changeset
|
89 exclude=oldexcludes) |
42417
a97b12f726e4
narrow: pass the bundle to bundle2.widen_bundle() instead of generating there
Pulkit Goyal <7895pulkit@gmail.com>
parents:
42415
diff
changeset
|
90 bundle2.widen_bundle(bundler, repo, oldmatch, newmatch, common, |
a97b12f726e4
narrow: pass the bundle to bundle2.widen_bundle() instead of generating there
Pulkit Goyal <7895pulkit@gmail.com>
parents:
42415
diff
changeset
|
91 known, cgversion, ellipses) |
42415
c767e655ffda
narrow: use narrow_widen wireproto command to widen in case of ellipses
Pulkit Goyal <7895pulkit@gmail.com>
parents:
40344
diff
changeset
|
92 else: |
c767e655ffda
narrow: use narrow_widen wireproto command to widen in case of ellipses
Pulkit Goyal <7895pulkit@gmail.com>
parents:
40344
diff
changeset
|
93 narrowbundle2.generateellipsesbundle2(bundler, repo, oldincludes, |
c767e655ffda
narrow: use narrow_widen wireproto command to widen in case of ellipses
Pulkit Goyal <7895pulkit@gmail.com>
parents:
40344
diff
changeset
|
94 oldexcludes, newincludes, newexcludes, cgversion, common, |
c767e655ffda
narrow: use narrow_widen wireproto command to widen in case of ellipses
Pulkit Goyal <7895pulkit@gmail.com>
parents:
40344
diff
changeset
|
95 list(common), known, None) |
40070
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
96 except error.Abort as exc: |
40071
e8132a8897da
narrow: start returning bundle2 from widen_bundle()
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
40070
diff
changeset
|
97 bundler = bundle2.bundle20(repo.ui) |
40070
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
98 manargs = [('message', pycompat.bytestr(exc))] |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
99 advargs = [] |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
100 if exc.hint is not None: |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
101 advargs.append(('hint', exc.hint)) |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
102 bundler.addpart(bundle2.bundlepart('error:abort', manargs, advargs)) |
40148
74558635dad5
narrow: don't compress the bundle2 when sending 'error:abort'
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
40075
diff
changeset
|
103 preferuncompressed = True |
40070
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
104 |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
105 chunks = bundler.getchunks() |
40148
74558635dad5
narrow: don't compress the bundle2 when sending 'error:abort'
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
40075
diff
changeset
|
106 return wireprototypes.streamres(gen=chunks, |
74558635dad5
narrow: don't compress the bundle2 when sending 'error:abort'
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
40075
diff
changeset
|
107 prefer_uncompressed=preferuncompressed) |
40070
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
108 |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
109 def peernarrowwiden(remote, **kwargs): |
42944
c2676b5a9f59
narrow: don't hexify paths and double-hexify known nodes on wire (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
42417
diff
changeset
|
110 for ch in (r'commonheads', r'known'): |
40070
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
111 kwargs[ch] = wireprototypes.encodelist(kwargs[ch]) |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
112 |
42944
c2676b5a9f59
narrow: don't hexify paths and double-hexify known nodes on wire (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
42417
diff
changeset
|
113 for ch in (r'oldincludes', r'newincludes', r'oldexcludes', r'newexcludes'): |
c2676b5a9f59
narrow: don't hexify paths and double-hexify known nodes on wire (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
42417
diff
changeset
|
114 kwargs[ch] = b','.join(kwargs[ch]) |
c2676b5a9f59
narrow: don't hexify paths and double-hexify known nodes on wire (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
42417
diff
changeset
|
115 |
40212
885d5cf9b6a4
py3: add some r'' prefixes in hgext/narrow/narrowwirepeer.py
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
40148
diff
changeset
|
116 kwargs[r'ellipses'] = '%i' % bool(kwargs[r'ellipses']) |
40070
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
117 f = remote._callcompressable('narrow_widen', **kwargs) |
8feae5b989bc
narrow: the first version of narrow_widen wireprotocol command
Pulkit Goyal <pulkit@yandex-team.ru>
parents:
39934
diff
changeset
|
118 return bundle2.getunbundler(remote.ui, f) |