##// END OF EJS Templates
[PATCH] Add ui.expandpath command...
mpm@selenic.com -
r506:1f81ebff default
parent child Browse files
Show More
@@ -267,11 +267,7 b' def cat(ui, repo, file, rev = []):'
267 267
268 268 def clone(ui, source, dest = None, **opts):
269 269 """make a copy of an existing repository"""
270 paths = {}
271 for name, path in ui.configitems("paths"):
272 paths[name] = path
273
274 if source in paths: source = paths[source]
270 source = ui.expandpath(source)
275 271
276 272 created = success = False
277 273
@@ -549,12 +545,7 b' def parents(ui, repo, node = None):'
549 545
550 546 def pull(ui, repo, source="default", **opts):
551 547 """pull changes from the specified source"""
552 paths = {}
553 for name, path in ui.configitems("paths"):
554 paths[name] = path
555
556 if source in paths:
557 source = paths[source]
548 source = ui.expandpath(source)
558 549
559 550 ui.status('pulling from %s\n' % (source))
560 551
@@ -571,11 +562,7 b' def pull(ui, repo, source="default", **o'
571 562
572 563 def push(ui, repo, dest="default-push"):
573 564 """push changes to the specified destination"""
574 paths = {}
575 for name, path in ui.configitems("paths"):
576 paths[name] = path
577
578 if dest in paths: dest = paths[dest]
565 dest = ui.expandpath(dest)
579 566
580 567 if not dest.startswith("ssh://"):
581 568 ui.warn("abort: can only push to ssh:// destinations currently\n")
@@ -41,6 +41,13 b' class ui:'
41 41 return self.cdata.items(section)
42 42 return []
43 43
44 def expandpath(self, loc):
45 paths = {}
46 for name, path in self.configitems("paths"):
47 paths[name] = path
48
49 return paths.get(loc, loc)
50
44 51 def write(self, *args):
45 52 for a in args:
46 53 sys.stdout.write(str(a))
General Comments 0
You need to be logged in to leave comments. Login now