##// END OF EJS Templates
hidden: support for explicitly accessing hidden changesets in wireproto server...
Manuel Jacob -
r51311:4cafe20b default
parent child Browse files
Show More
@@ -23,6 +23,7 b' from . import ('
23 exchange,
23 exchange,
24 pushkey as pushkeymod,
24 pushkey as pushkeymod,
25 pycompat,
25 pycompat,
26 repoview,
26 requirements as requirementsmod,
27 requirements as requirementsmod,
27 streamclone,
28 streamclone,
28 util,
29 util,
@@ -60,7 +61,7 b' def clientcompressionsupport(proto):'
60 # wire protocol command can either return a string or one of these classes.
61 # wire protocol command can either return a string or one of these classes.
61
62
62
63
63 def getdispatchrepo(repo, proto, command):
64 def getdispatchrepo(repo, proto, command, accesshidden=False):
64 """Obtain the repo used for processing wire protocol commands.
65 """Obtain the repo used for processing wire protocol commands.
65
66
66 The intent of this function is to serve as a monkeypatch point for
67 The intent of this function is to serve as a monkeypatch point for
@@ -68,11 +69,21 b' def getdispatchrepo(repo, proto, command'
68 specialized circumstances.
69 specialized circumstances.
69 """
70 """
70 viewconfig = repo.ui.config(b'server', b'view')
71 viewconfig = repo.ui.config(b'server', b'view')
72
73 # Only works if the filter actually supports being upgraded to show hidden
74 # changesets.
75 if (
76 accesshidden
77 and viewconfig is not None
78 and viewconfig + b'.hidden' in repoview.filtertable
79 ):
80 viewconfig += b'.hidden'
81
71 return repo.filtered(viewconfig)
82 return repo.filtered(viewconfig)
72
83
73
84
74 def dispatch(repo, proto, command):
85 def dispatch(repo, proto, command, accesshidden=False):
75 repo = getdispatchrepo(repo, proto, command)
86 repo = getdispatchrepo(repo, proto, command, accesshidden=accesshidden)
76
87
77 func, spec = commands[command]
88 func, spec = commands[command]
78 args = proto.getargs(spec)
89 args = proto.getargs(spec)
General Comments 0
You need to be logged in to leave comments. Login now