2228 if not opts['show_revs']: |
2229 if not opts['show_revs']: |
2229 return |
2230 return |
2230 for c in revs: |
2231 for c in revs: |
2231 ui.write("%d\n" % c) |
2232 ui.write("%d\n" % c) |
2232 |
2233 |
|
2234 @command('debugserve', [ |
|
2235 ('', 'sshstdio', False, _('run an SSH server bound to process handles')), |
|
2236 ('', 'logiofd', '', _('file descriptor to log server I/O to')), |
|
2237 ('', 'logiofile', '', _('file to log server I/O to')), |
|
2238 ], '') |
|
2239 def debugserve(ui, repo, **opts): |
|
2240 """run a server with advanced settings |
|
2241 |
|
2242 This command is similar to :hg:`serve`. It exists partially as a |
|
2243 workaround to the fact that ``hg serve --stdio`` must have specific |
|
2244 arguments for security reasons. |
|
2245 """ |
|
2246 opts = pycompat.byteskwargs(opts) |
|
2247 |
|
2248 if not opts['sshstdio']: |
|
2249 raise error.Abort(_('only --sshstdio is currently supported')) |
|
2250 |
|
2251 logfh = None |
|
2252 |
|
2253 if opts['logiofd'] and opts['logiofile']: |
|
2254 raise error.Abort(_('cannot use both --logiofd and --logiofile')) |
|
2255 |
|
2256 if opts['logiofd']: |
|
2257 # Line buffered because output is line based. |
|
2258 logfh = os.fdopen(int(opts['logiofd']), 'ab', 1) |
|
2259 elif opts['logiofile']: |
|
2260 logfh = open(opts['logiofile'], 'ab', 1) |
|
2261 |
|
2262 s = wireprotoserver.sshserver(ui, repo, logfh=logfh) |
|
2263 s.serve_forever() |
|
2264 |
2233 @command('debugsetparents', [], _('REV1 [REV2]')) |
2265 @command('debugsetparents', [], _('REV1 [REV2]')) |
2234 def debugsetparents(ui, repo, rev1, rev2=None): |
2266 def debugsetparents(ui, repo, rev1, rev2=None): |
2235 """manually set the parents of the current working directory |
2267 """manually set the parents of the current working directory |
2236 |
2268 |
2237 This is useful for writing repository conversion tools, but should |
2269 This is useful for writing repository conversion tools, but should |