Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 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 | f2d1f5fd0179 |
comparison
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'), |