changeset 15:a38b3d0a1562

add dedicated command to mark changeset as published or ready This command coul be generated.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 25 May 2011 02:19:20 +0200
parents f5e1055a3f68
children fd9f50406cb8
files states.py tests/test-draft.t
diffstat 2 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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"