comparison mercurial/commands.py @ 963:84355e3e4493

Add -e and --remotecmd for clone and pull too
author mpm@selenic.com
date Fri, 19 Aug 2005 22:11:48 -0800
parents 3e11d5038649
children a425123e6afe
comparison
equal deleted inserted replaced
962:5730e90c025b 963:84355e3e4493
487 self.dir_ = None 487 self.dir_ = None
488 def __del__(self): 488 def __del__(self):
489 if self.dir_: 489 if self.dir_:
490 self.rmtree(self.dir_, True) 490 self.rmtree(self.dir_, True)
491 491
492 if opts['ssh']:
493 ui.setconfig("ui", "ssh", opts['ssh'])
494 if opts['remotecmd']:
495 ui.setconfig("ui", "remotecmd", opts['remotecmd'])
496
492 d = Dircleanup(dest) 497 d = Dircleanup(dest)
493 abspath = source 498 abspath = source
494 source = ui.expandpath(source) 499 source = ui.expandpath(source)
495 other = hg.repository(ui, source) 500 other = hg.repository(ui, source)
496 501
913 918
914 def pull(ui, repo, source="default", **opts): 919 def pull(ui, repo, source="default", **opts):
915 """pull changes from the specified source""" 920 """pull changes from the specified source"""
916 source = ui.expandpath(source) 921 source = ui.expandpath(source)
917 ui.status('pulling from %s\n' % (source)) 922 ui.status('pulling from %s\n' % (source))
923
924 if opts['ssh']:
925 ui.setconfig("ui", "ssh", opts['ssh'])
926 if opts['remotecmd']:
927 ui.setconfig("ui", "remotecmd", opts['remotecmd'])
918 928
919 other = hg.repository(ui, source) 929 other = hg.repository(ui, source)
920 r = repo.pull(other) 930 r = repo.pull(other)
921 if not r: 931 if not r:
922 if opts['update']: 932 if opts['update']:
1268 (cat, 1278 (cat,
1269 [('o', 'output', "", 'output to file')], 1279 [('o', 'output', "", 'output to file')],
1270 'hg cat [-o OUTFILE] FILE [REV]'), 1280 'hg cat [-o OUTFILE] FILE [REV]'),
1271 "^clone": 1281 "^clone":
1272 (clone, 1282 (clone,
1273 [('U', 'noupdate', None, 'skip update after cloning')], 1283 [('U', 'noupdate', None, 'skip update after cloning'),
1274 'hg clone [-U] SOURCE [DEST]'), 1284 ('e', 'ssh', "", 'ssh command'),
1285 ('', 'remotecmd', "", 'remote hg command')],
1286 'hg clone [OPTIONS] SOURCE [DEST]'),
1275 "^commit|ci": 1287 "^commit|ci":
1276 (commit, 1288 (commit,
1277 [('A', 'addremove', None, 'run add/remove during commit'), 1289 [('A', 'addremove', None, 'run add/remove during commit'),
1278 ('I', 'include', [], 'include path in search'), 1290 ('I', 'include', [], 'include path in search'),
1279 ('X', 'exclude', [], 'exclude path from search'), 1291 ('X', 'exclude', [], 'exclude path from search'),
1338 "outgoing|out": (outgoing, [], 'hg outgoing [DEST]'), 1350 "outgoing|out": (outgoing, [], 'hg outgoing [DEST]'),
1339 "parents": (parents, [], 'hg parents [REV]'), 1351 "parents": (parents, [], 'hg parents [REV]'),
1340 "paths": (paths, [], 'hg paths [NAME]'), 1352 "paths": (paths, [], 'hg paths [NAME]'),
1341 "^pull": 1353 "^pull":
1342 (pull, 1354 (pull,
1343 [('u', 'update', None, 'update working directory')], 1355 [('u', 'update', None, 'update working directory'),
1344 'hg pull [-u] [SOURCE]'), 1356 ('e', 'ssh', "", 'ssh command'),
1357 ('', 'remotecmd', "", 'remote hg command')],
1358 'hg pull [OPTIONS] [SOURCE]'),
1345 "^push": 1359 "^push":
1346 (push, 1360 (push,
1347 [('f', 'force', None, 'force push'), 1361 [('f', 'force', None, 'force push'),
1348 ('e', 'ssh', "", 'ssh command'), 1362 ('e', 'ssh', "", 'ssh command'),
1349 ('', 'remotecmd', "", 'remote hg command')], 1363 ('', 'remotecmd', "", 'remote hg command')],