##// END OF EJS Templates
Cleanups for repo.pull...
Matt Mackall -
r625:978011cf default
parent child Browse files
Show More
@@ -331,14 +331,15 b' def clone(ui, source, dest = None, **opt'
331 331
332 332 class dircleanup:
333 333 def __init__(self, dir):
334 import shutil
335 self.rmtree = shutil.rmtree
334 336 self.dir = dir
335 337 os.mkdir(dir)
336 338 def close(self):
337 339 self.dir = None
338 340 def __del__(self):
339 341 if self.dir:
340 import shutil
341 shutil.rmtree(self.dir, True)
342 self.rmtree(self.dir, True)
342 343
343 344 d = dircleanup(dest)
344 345
@@ -346,6 +347,7 b' def clone(ui, source, dest = None, **opt'
346 347 abspath = source
347 348 if not (source.startswith("http://") or
348 349 source.startswith("hg://") or
350 source.startswith("ssh://") or
349 351 source.startswith("old-http://")):
350 352 abspath = os.path.abspath(source)
351 353 d1 = os.stat(dest).st_dev
@@ -364,10 +366,7 b' def clone(ui, source, dest = None, **opt'
364 366 else:
365 367 repo = hg.repository(ui, dest, create=1)
366 368 other = hg.repository(ui, source)
367 fetch = repo.findincoming(other)
368 if fetch:
369 cg = other.changegroup(fetch)
370 repo.addchangegroup(cg)
369 repo.pull(other)
371 370
372 371 f = repo.opener("hgrc", "w")
373 372 f.write("[paths]\n")
@@ -694,18 +693,11 b' def parents(ui, repo, node = None):'
694 693 def pull(ui, repo, source="default", **opts):
695 694 """pull changes from the specified source"""
696 695 source = ui.expandpath(source)
697
698 696 ui.status('pulling from %s\n' % (source))
699 697
700 698 other = hg.repository(ui, source)
701 fetch = repo.findincoming(other)
702 if not fetch:
703 ui.status("no changes found\n")
704 return
705
706 cg = other.changegroup(fetch)
707 r = repo.addchangegroup(cg)
708 if cg and not r:
699 r = repo.pull(other)
700 if not r:
709 701 if opts['update']:
710 702 return update(ui, repo)
711 703 else:
General Comments 0
You need to be logged in to leave comments. Login now