<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">On 2/11/2015 11:53 AM, Gregory Szorc
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAKQoGamh2j99A85HX7dXNZHGA=51cGaeNeubaN7ZGq5FaHPy7A@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">On Wed, Feb 11, 2015 at 8:32 AM, Ryan
            McElroy <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:rm@fb.com" target="_blank">rm@fb.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex"><span class=""><br>
                On 2/11/2015 6:37 AM, Augie Fackler wrote:<br>
                <blockquote class="gmail_quote" style="margin:0px 0px
                  0px 0.8ex;border-left:1px solid
                  rgb(204,204,204);padding-left:1ex">
                  On Feb 10, 2015, at 10:43 PM, Ryan McElroy <<a
                    moz-do-not-send="true" href="mailto:rm@fb.com"
                    target="_blank">rm@fb.com</a>> wrote:<br>
                  <br>
                  <blockquote class="gmail_quote" style="margin:0px 0px
                    0px 0.8ex;border-left:1px solid
                    rgb(204,204,204);padding-left:1ex">
                    # HG changeset patch<br>
                    # User Ryan McElroy <<a moz-do-not-send="true"
                      href="mailto:rm@fb.com" target="_blank">rm@fb.com</a>><br>
                    # Date 1423508565 28800<br>
                    #      Mon Feb 09 11:02:45 2015 -0800<br>
                    # Node ID dac1fbb56786c2033e188e7b762a9429cd7ff621<br>
                    # Parent  ff5caa8dfd993680d9602ca6ebb14da9de10d5f4<br>
                    extensions: allow replacing command synopsis<br>
                  </blockquote>
                  Hm, interesting. Can you give a sample reason why we
                  should support this?<br>
                  <br>
                </blockquote>
              </span>
              In general, this will allow extensions that wrap/extend
              commands to be better integrated.<br>
              <br>
              Specifically, in the remotenames extension, we're adding
              some new flags to commands -- some examples are --to to
              the push command, and --all and --remote to bookmarks.
              Today, you can't edit the synopsis string in the command
              tuple because tuples and strings are both immutable. The
              list of args is extensible because it's a list (and
              editing a list doens't change the tuple that contains it).
              However, we are unable to add the new flags to the command
              synopsis. This would allow us to do that.<br>
              <br>
              I can update the commit message to include these reasons
              and send out a V2 -- let me know.<br>
            </blockquote>
            <div><br>
            </div>
            <div>Instead of direct docstring manipulation, how about an
              API to add extension-specific "sections" to the docstring.
              This could result in something like the following, without
              concerns that extensions would interfere with each other.<br>
              <br>
              hg push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]<br>
              <br>
              push changes to the specified destination<br>
              <br>
                  Push changesets from the local repository to the
              specified destination.<br>
              <br>
                  ...<br>
              <br>
                  Returns 0 if push was successful, 1 if nothing to
              push.<br>
              <br>
            </div>
            <div>    pushrebase extension<br>
              <br>
            </div>
            <div>        pushrebase will enable "hg push" to
              automatically rebase pushed changes on the server.<br>
              <br>
            </div>
            <div>    firefoxtree extension<br>
              <br>
            </div>
            <div>        firefoxtree changes the behavior of pushes to
              Firefox repositories so the default push revision is ".".
              This will prevent<br>
            </div>
            <div>        attempted pushes of multiple heads, which would
              only get rejected due to a server-side hook.<br>
              <br>
              options ([+] can be repeated):<br>
              <br>
               -f --force                 force push<br>
               -r --rev REV [+]           a changeset intended to be
              included in the<br>
              <br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    Note that this patch doesn't touch docstrings, only synopses, which
    are the shorter version of help.<br>
    <br>
    However, you are right -- the "correct" way to do this is to
    introduce ways for extensions to more intelligently manipulate both
    the synopsis and the docstring, most likely through appending (but
    an argument might be made to allow other manipulations as well).<br>
    <br>
    For now, appending will suffice for my needs, so I'll send out a
    series that enables appending only to both the synopsis and the
    docstring.<br>
  </body>
</html>