mercurial/commands.py
changeset 404 a1ecef497721
parent 403 fda7bb480020
child 417 f2d1f5fd0179
equal deleted inserted replaced
403:fda7bb480020 404:a1ecef497721
   470 
   470 
   471         if len(files) > 0:
   471         if len(files) > 0:
   472             addremove(ui, repo, *files)
   472             addremove(ui, repo, *files)
   473         repo.commit(files, text)
   473         repo.commit(files, text)
   474 
   474 
   475 def pull(ui, repo, source="default"):
   475 def pull(ui, repo, source="default", **opts):
   476     """pull changes from the specified source"""
   476     """pull changes from the specified source"""
   477     paths = {}
   477     paths = {}
   478     for name, path in ui.configitems("paths"):
   478     for name, path in ui.configitems("paths"):
   479         paths[name] = path
   479         paths[name] = path
   480 
   480 
   481     if source in paths: source = paths[source]
   481     if source in paths:
       
   482         source = paths[source]
       
   483 
       
   484     ui.status('pulling from %s\n' % (source))
   482     
   485     
   483     other = hg.repository(ui, source)
   486     other = hg.repository(ui, source)
   484     cg = repo.getchangegroup(other)
   487     cg = repo.getchangegroup(other)
   485     repo.addchangegroup(cg)
   488     r = repo.addchangegroup(cg)
       
   489     if cg and not r:
       
   490         if opts['update']:
       
   491             return update(ui, repo)
       
   492 	else:
       
   493             ui.status("(run 'hg update' to get a working copy)\n")
       
   494 
       
   495     return r
   486 
   496 
   487 def push(ui, repo, dest="default-push"):
   497 def push(ui, repo, dest="default-push"):
   488     """push changes to the specified destination"""
   498     """push changes to the specified destination"""
   489     paths = {}
   499     paths = {}
   490     for name, path in ui.configitems("paths"):
   500     for name, path in ui.configitems("paths"):
   676     "patch|import": (patch,
   686     "patch|import": (patch,
   677                      [('p', 'strip', 1, 'path strip'),
   687                      [('p', 'strip', 1, 'path strip'),
   678                       ('b', 'base', "", 'base path'),
   688                       ('b', 'base', "", 'base path'),
   679                       ('q', 'quiet', "", 'silence diff')],
   689                       ('q', 'quiet', "", 'silence diff')],
   680                      "hg import [options] patches"),
   690                      "hg import [options] patches"),
   681     "pull|merge": (pull, [], 'hg pull [source]'),
   691     "pull|merge": (pull, 
       
   692                   [('u', 'update', None, 'update working directory')],
       
   693 		  'hg pull [options] [source]'),
   682     "push": (push, [], 'hg push <destination>'),
   694     "push": (push, [], 'hg push <destination>'),
   683     "rawcommit": (rawcommit,
   695     "rawcommit": (rawcommit,
   684                   [('p', 'parent', [], 'parent'),
   696                   [('p', 'parent', [], 'parent'),
   685                    ('d', 'date', "", 'data'),
   697                    ('d', 'date', "", 'data'),
   686                    ('u', 'user', "", 'user'),
   698                    ('u', 'user', "", 'user'),