diff mercurial/commands.py @ 232:fc4a6e5b5812

hg resolve: merge a given node into the working directory -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hg resolve: merge a given node into the working directory This is the first pass at working directory-based merges. Doing a resolve adds a second parent to the working directory state for the next commit. manifest hash: 827b19995dd2d7686286da3b62c7d5fe3e0bc48c -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCoMSHywK+sNU5EO8RAnOkAJsHH9jviMJcQJ4JurFuSlrbIwKqRACdHgNC kkfoAxX2E5jkuOeSJ1Hjalk= =bdrT -----END PGP SIGNATURE-----
author mpm@selenic.com
date Fri, 03 Jun 2005 12:58:47 -0800
parents 00ea3613f82c
children 4f802588cdfb 4f802588cdfb afe895fcc0d0
line wrap: on
line diff
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -153,6 +153,14 @@ def parents(ui, repo, node = None):
         if n != hg.nullid:
             ui.write("%d:%s\n" % (repo.changelog.rev(n), hg.hex(n)))
 
+def resolve(ui, repo, node = None):
+    '''merge a given node or the current tip into the working dir'''
+    if not node:
+        node = repo.changelog.tip()
+    else:
+        node = repo.lookup(node)
+    repo.resolve(node)
+
 def status(ui, repo):
     '''show changed files in the working directory
 
@@ -184,6 +192,7 @@ table = {
                       ('c', 'changeset', None, 'show changeset')],
                      'hg annotate [-u] [-c] [-n] [-r id] [files]'),
     "parents": (parents, [], 'hg parents [node]'),
+    "resolve": (resolve, [], 'hg resolve [node]'),
     "status": (status, [], 'hg status'),
     "undo": (undo, [], 'hg undo'),
     }