Commits

Yujie Wu  committed 72cb71e Merge

flow: Merged <hotfix/0.9.5> 'develop_promote' to <hotfix/0.9.5> ('hotfix/0.9.5').

  • Participants
  • Parent commits ca0cb89, ffcd939
  • Branches hotfix/0.9.5

Comments (0)

Files changed (1)

File src/hgflow.py

         """
         kwarg          = _getopt( self.ui, "promote", kwarg )
         rev            = kwarg.pop( "rev",     None )
+        tag_name       = kwarg.pop( "tag",     None )
         message        = kwarg.pop( "message", None )
         message        = (message + "\n") if (message) else ""
         orig_workspace = self.curr_workspace
                 self._commit( message = message + ("%sPromoted %s '%s' (%s) to '%s'." %
                               (self.msg_prefix, stream, promoted_branch.basename( stream ),
                                short( promoted_node ), dest,)), **kwarg )
+                if (tag_name) :
+                    self._tag( tag_name, **kwarg )
         else :
-            for s in stream.destin() :
+            destin = [STREAM["master"],] if (STREAM["develop"] == stream) else stream.destin()
+            for s in destin :
                 if (s == stream) :
                     continue
                 trunk = s.trunk()
                     self._commit( message = message + ("%sPromoted %s '%s' (%s) to '%s'." %
                                   (self.msg_prefix, stream, promoted_branch.basename( stream ),
                                    short( promoted_node ), trunk,)), **kwarg )
+                    if (tag_name) :
+                        self._tag( tag_name, **kwarg )
                 else :
                     self._error( "Cannot determine promote destination." )
                     return
 "@promote" : """
 Merge the workspace branch to destination branches. The destination branches,
 if omitted, will default to the trunk of the destination stream. The destination
-streams of basic streams are listed as follows:
+streams of the basic streams are listed as follows:
 
    stream          destination
 ------------+-----------------------
  <feature>    <develop>
- <develop>    n/a
+ <develop>    <master>
  <release>    <develop> & <master>
  <hotfix>     <develop> & <master>
  <master>     n/a
  natural      stream-trunk
  
 syntax:
-{{{hg flow <stream> promote [<branch-full-name>...] [<option>...]}}}
+{{{hg flow <stream> promote [<destination-branch-full-name>...] [<option>...]}}}
 
 The workspace branch must be in <stream>. If the `-r` option is omitted, its
 value will default to the head of the workspace branch.
 option:
 -r --rev REV       Revision to promote to other branches.
 -m --message TEXT  Record TEXT as commit message when promote branch.
+-t --tag NAME      Tag the merging changeset with NAME
 -d --date DATE     Record the specified DATE as commit date.
 """,
         
 "list"    : ("closed",),
 "log"     : ("file", "date", "keyword", "patch", "git", "limit", "graph", "closed", "onstream",),
 "abort"   : ("erase", "message", "onstream",),
-"promote" : ("rev", "message", "date", "onstream",),
+"promote" : ("rev", "message", "tag", "date", "onstream",),
 "rebase"  : ("dest", "onstream",),
 }
 
       ("e", "erase",     False, _("Erase branch after it is merged successfully or aborted. [finish, abort]"),     ),
       ("d", "date",      '',    _("Record the specified date as commit date. [start, finish, promote]"), _('DATE'),),
       ("m", "message",   '',    _("Record TEXT as commit message. [start, finish, promote, abort]"),     _('TEXT'),),
+      ("t", "tag",       '',    _("Tag the merging changeset with NAME. [promote]"),                     _('NAME'),),
       ("c", "closed",    False, _("Show normal and closed branches in stream. [list, log]"),                       ),
       ("F", "file",      [],    _("File to show history of. [log]"),                                     _('FILE'),),
       ("d", "date",      '',    _("Show revisions matching date spec. [log]"),                           _('DATE'),),