398 return mergemod.update(repo, node, False, True, choose)[3] > 0 |
398 return mergemod.update(repo, node, False, True, choose)[3] > 0 |
399 |
399 |
400 def verify(repo): |
400 def verify(repo): |
401 """verify the consistency of a repository""" |
401 """verify the consistency of a repository""" |
402 return verifymod.verify(repo) |
402 return verifymod.verify(repo) |
|
403 |
|
404 def remoteui(src, opts): |
|
405 'build a remote ui from ui or repo and opts' |
|
406 if hasattr(src, 'baseui'): # looks like a repository |
|
407 dst = src.baseui.copy() # drop repo-specific config |
|
408 src = src.ui # copy target options from repo |
|
409 else: # assume it's a global ui object |
|
410 dst = src.copy() # keep all global options |
|
411 |
|
412 # copy ssh-specific options |
|
413 for o in 'ssh', 'remotecmd': |
|
414 v = opts.get(o) or src.config('ui', o) |
|
415 if v: |
|
416 dst.setconfig("ui", o, v) |
|
417 |
|
418 # copy bundle-specific options |
|
419 r = src.config('bundle', 'mainreporoot') |
|
420 if r: |
|
421 dst.setconfig('bundle', 'mainreporoot', r) |
|
422 |
|
423 # copy auth and http_proxy section settings |
|
424 for sect in ('auth', 'http_proxy'): |
|
425 for key, val in src.configitems(sect): |
|
426 dst.setconfig(sect, key, val) |
|
427 |
|
428 return dst |