add dedicated command to mark changeset as published or ready
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Wed, 25 May 2011 02:19:20 +0200
changeset 15 a38b3d0a1562
parent 14 f5e1055a3f68
child 16 fd9f50406cb8
add dedicated command to mark changeset as published or ready This command coul be generated.
states.py
tests/test-draft.t
--- a/states.py	Wed May 25 02:14:36 2011 +0200
+++ b/states.py	Wed May 25 02:19:20 2011 +0200
@@ -111,19 +111,20 @@
 # New commands
 #############################
 
-def cmdsetstate(ui, repo, statename, *changesets):
-    """change changeset state"""
-    for state in STATES: # few states
-        if state.name == statename:
-            break
-    else:
-        raise util.Abort(_('unknown state: %s') % statename)
+def cmdpublished(ui, repo, *changesets):
     revs = scmutil.revrange(repo, changesets)
-    repo.setstate(state, [repo.changelog.node(rev) for rev in revs])
+    repo.setstate(ST0, [repo.changelog.node(rev) for rev in revs])
     return 0
 
+def cmdready(ui, repo, *changesets):
+    revs = scmutil.revrange(repo, changesets)
+    repo.setstate(ST1, [repo.changelog.node(rev) for rev in revs])
+    return 0
+
+#autogen this
 cmdtable = {
-    'setstate':  (cmdsetstate,   [], _('<state> <revset>')),
+    'published':  (cmdpublished,   [], _('<revset>')),
+    'ready':  (cmdready,   [], _('<revset>')),
     }
 
 
--- a/tests/test-draft.t	Wed May 25 02:14:36 2011 +0200
+++ b/tests/test-draft.t	Wed May 25 02:19:20 2011 +0200
@@ -30,7 +30,7 @@
   adding manifests
   adding file changes
   added 2 changesets with 2 changes to 1 files
-  $ hg setstate published 1 # until we fix push
+  $ hg publish 1 # until we fix push
   $ echo "tree" >> savanna
   $ hg add savanna
   $ hg ci -m "terrain"