--- a/mercurial/commands.py Tue Jun 21 17:53:01 2005 -0800
+++ b/mercurial/commands.py Tue Jun 21 18:04:25 2005 -0800
@@ -472,17 +472,27 @@
addremove(ui, repo, *files)
repo.commit(files, text)
-def pull(ui, repo, source="default"):
+def pull(ui, repo, source="default", **opts):
"""pull changes from the specified source"""
paths = {}
for name, path in ui.configitems("paths"):
paths[name] = path
- if source in paths: source = paths[source]
+ if source in paths:
+ source = paths[source]
+
+ ui.status('pulling from %s\n' % (source))
other = hg.repository(ui, source)
cg = repo.getchangegroup(other)
- repo.addchangegroup(cg)
+ r = repo.addchangegroup(cg)
+ if cg and not r:
+ if opts['update']:
+ return update(ui, repo)
+ else:
+ ui.status("(run 'hg update' to get a working copy)\n")
+
+ return r
def push(ui, repo, dest="default-push"):
"""push changes to the specified destination"""
@@ -678,7 +688,9 @@
('b', 'base', "", 'base path'),
('q', 'quiet', "", 'silence diff')],
"hg import [options] patches"),
- "pull|merge": (pull, [], 'hg pull [source]'),
+ "pull|merge": (pull,
+ [('u', 'update', None, 'update working directory')],
+ 'hg pull [options] [source]'),
"push": (push, [], 'hg push <destination>'),
"rawcommit": (rawcommit,
[('p', 'parent', [], 'parent'),