changeset 404:a1ecef497721

[PATCH] Unintuive use -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [PATCH] Unintuive use From: Vincent Danjean <vdanjean.ml@free.fr> > 1) "hg pull" does not tell what and if it does something. > 2) hg does not tell if the data have been merge or not, if we have to > call resolve, ... Here is a patch for 1) and 2). It also add an option to 'pull' to call update if there is something new. Tweaked by mpm: - change message style - use ui.status - change option from resolve to update manifest hash: a61a7af00ef2f33867f6c88f95dc8258cb1a3e51 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCuMcpywK+sNU5EO8RAucjAKC06gwAico7Wz5YOcp5u9NVxEhItwCfcIzA VmiifZTj5ZUjTTcPhmiKh2M= =rbLT -----END PGP SIGNATURE-----
author mpm@selenic.com
date Tue, 21 Jun 2005 18:04:25 -0800
parents fda7bb480020
children 99470ae6b424
files mercurial/commands.py tests/test-simple-update.out
diffstat 2 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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'),
--- a/tests/test-simple-update.out	Tue Jun 21 17:53:01 2005 -0800
+++ b/tests/test-simple-update.out	Tue Jun 21 18:04:25 2005 -0800
@@ -19,11 +19,13 @@
 + hg commit -t 2
 + cd ../test
 + hg pull ../branch
+pulling from ../branch
 searching for changes
 adding changesets
 adding manifests
 adding file revisions
 modified 1 files, added 1 changesets and 1 new revisions
+(run 'hg update' to get a working copy)
 + hg verify
 checking changesets
 checking manifests