Commits

Pierre-Yves David committed a38b3d0

add dedicated command to mark changeset as published or ready

This command coul be generated.

  • Participants
  • Parent commits f5e1055
  • Branches default

Comments (0)

Files changed (2)

 # 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>')),
     }
 
 

File tests/test-draft.t

   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"