diff --git a/hgext/phabricator.py b/hgext/phabricator.py --- a/hgext/phabricator.py +++ b/hgext/phabricator.py @@ -465,6 +465,7 @@ @vcrcommand(b'phabsend', [(b'r', b'rev', [], _(b'revisions to send'), _(b'REV')), + (b'', b'branch', b'', _(b'comments review is for specific branch')), (b'', b'amend', True, _(b'update commit messages')), (b'', b'reviewer', [], _(b'specify reviewers')), (b'', b'confirm', None, _(b'ask for confirmation before sending'))], @@ -496,6 +497,15 @@ phabsend will check obsstore and the above association to decide whether to update an existing Differential Revision, or create a new one. + + When working with multiple named branches, one can specify which branch your + reviews/differentials are intended for using --branch flag. Doing that, + phabsend will add a comment to your differential about that. For example:: + + `hg phabsend -r . --branch stable` + + This will upload the parent of working directory and will add a comment on + related differential saying "This review is intented for stable branch". """ revs = list(revs) + opts.get(b'rev', []) revs = scmutil.revrange(repo, revs) @@ -524,6 +534,10 @@ drevids = [] # [int] diffmap = {} # {newnode: diff} + bmsg = None + if opts.get(b'branch'): + bmsg = b"This review is intended for `%s` branch." % opts[b'branch'] + # Send patches one by one so we know their Differential Revision IDs and # can provide dependency relationship lastrevid = None @@ -570,6 +584,12 @@ drevids.append(newrevid) lastrevid = newrevid + if bmsg: + # comment on the new differential created the this review is for + # this certain branch + callconduit(repo, b'differential.createcomment', + {b'revision_id': newrevid, b'message': bmsg}) + # Update commit messages and remove tags if opts.get(b'amend'): unfi = repo.unfiltered()