D2013: commit: allow --no-secret to override phases.new-commit setting

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Feb 6 16:26:02 EST 2018


martinvonz added a comment.


  In https://phab.mercurial-scm.org/D2013#34320, @spectral wrote:
  
  > In https://phab.mercurial-scm.org/D2013#33867, @martinvonz wrote:
  >
  > > I wonder if we should instead have a --draft option for this. Reasons:
  > >
  > > - If we ever add a fourth phase (like Jun's proposed "archived" phase), then --no-secret doesn't clearly indicate "draft", it could just as well be "archived".
  > > - Actually, we of course already do have a third phase. One could imagine a "hg commit --public", although that's probably not useful enough to warrant its own option, but it seems to suggest that "--no-secret" doesn't necessarily mean "draft".
  > > - I find this tri-state boolean weird. "--secret" kind of defaults to off, but it can be made "more off" with "--no-secret".
  >
  >
  > Yeah, I wasn't sure I liked it when writing it, and I'm fine with changing it, but do we really want a proliferation of flags?  Perhaps we want a generic 'phase' flag, so one can specify -s or --secret (BC and it's the "most common" case), and --phase <public|draft|secret|archived> for more advanced use-cases?  This runs into a couple small problems, specifically that there's now "more than one way to do it [specify secret]", it's a lot of typing, and I don't think we should abbreviate it `-p` (it just doesn't feel like it's going to be common enough to warrant any abbreviation, let alone 'p', which could stand for phase, or patch, or path, or a number of other words that we might eventually add to `commit` and be sad about not being able to abbreviate in the obvious fashion)
  
  
  I think "--phase <phase>" makes sense, but it is a little long as you said. Since the real goal of this series is to preserve the phase on `hg split`, I'll see if I can do that by adding general support to scmutil.cleanupnodes() instead (Kyle and I already talked about this offline).

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2013

To: spectral, #hg-reviewers
Cc: martinvonz, mercurial-devel


More information about the Mercurial-devel mailing list