<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 19/02/2019 13:52, Pulkit Goyal
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAJ-kjL9=EOkriKa9-dm5q1bUoh7QJSyoqgfVExfJjo89nd9WNA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">
            <div class="gmail_default"
              style="font-family:arial,helvetica,sans-serif"><br>
            </div>
          </div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">On Fri, Feb 15, 2019 at
              6:11 PM Raphaël Gomès <<a
                href="mailto:raphael.gomes@octobus.net"
                moz-do-not-send="true">raphael.gomes@octobus.net</a>>
              wrote:<br>
            </div>
            <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 Raphaël Gomès <<a
                href="mailto:rgomes@octobus.net" target="_blank"
                moz-do-not-send="true">rgomes@octobus.net</a>><br>
              # Date 1550068454 -3600<br>
              #      Wed Feb 13 15:34:14 2019 +0100<br>
              # Node ID f850e5c85eeee47df95cd4bcb38b4ade5b5af955<br>
              # Parent  91701785c2c56a3ee395038488758ad2e1865265<br>
              # EXP-Topic cmd-test<br>
              cmdtest: add a new command that checks revset matching<br>
              <br>
              This command is meant to ease scripting that need to check
              revsets validity<br>
              on a repository. Right now, doing such revset testing
              requires abuse of `hg log`<br>
              output parsing, and is less than ideal.<br>
              <br>
              It mirrors the `test` shell builtin which is used in
              almost every shell script<br>
              for branching.<br>
              <br>
              This is a first draft of this command, there is of room
              for adjustement and evolution,<br>
              like fileset matching or other arguments.<br>
            </blockquote>
            <div><br>
            </div>
            <div class="gmail_default"
              style="font-family:arial,helvetica,sans-serif">You can use
              the `expectsize()` revset which is recently implemented
              and pass the size as 0. So if a revset is empty, the
              operation will succeed and you will get 0 as return value.
              If there are revs in the revset, it will abort.</div>
          </div>
        </div>
      </div>
    </blockquote>
    The expectsize revset is less flexible, and provide an ambiguous
    return code when it does not match (same return as an invalid
    revset). The revset seems useful in itself, but having a clear and
    extensible command will make scripting simpler, clearer and less
    error-prone.<br>
  </body>
</html>