Skip to content
Snippets Groups Projects
  1. Jan 10, 2017
    • Remi Chaintron's avatar
      revlog: flag processor · c1b7b2285522
      Remi Chaintron authored
      Add the ability for revlog objects to process revision flags and apply
      registered transforms on read/write operations.
      
      This patch introduces:
      - the 'revlog._processflags()' method that looks at revision flags and applies
        flag processors registered on them. Due to the need to handle non-commutative
        operations, flag transforms are applied in stable order but the order in which
        the transforms are applied is reversed between read and write operations.
      - the 'addflagprocessor()' method allowing to register processors on flags.
        Flag processors are defined as a 3-tuple of (read, write, raw) functions to be
        applied depending on the operation being performed.
      - an update on 'revlog.addrevision()' behavior. The current flagprocessor design
        relies on extensions to wrap around 'addrevision()' to set flags on revision
        data, and on the flagprocessor to perform the actual transformation of its
        contents. In the lfs case, this means we need to process flags before we meet
        the 2GB size check, leading to performing some operations before it happens:
        - if flags are set on the revision data, we assume some extensions might be
          modifying the contents using the flag processor next, and we compute the
          node for the original revision data (still allowing extension to override
          the node by wrapping around 'addrevision()').
        - we then invoke the flag processor to apply registered transforms (in lfs's
          case, drastically reducing the size of large blobs).
        - finally, we proceed with the 2GB size check.
      
      Note: In the case a cachedelta is passed to 'addrevision()' and we detect the
      flag processor modified the revision data, we chose to trust the flag processor
      and drop the cachedelta.
      c1b7b2285522
  2. Jan 05, 2017
    • Remi Chaintron's avatar
      revlog: pass revlog flags to addrevision · e12c0fa1f65b
      Remi Chaintron authored
      Adding the ability to passing flags to addrevision instead of simply passing
      default flags to _addrevision will allow extensions relying on flag transforms
      to wrap around addrevision() in order to update revlog flags.
      
      The first use case of this patch will be the lfs extension marking nodes as
      stored externally when the contents are larger than the defined threshold.
      
      One of the reasons leading to setting flags in addrevision() wrappers in the
      flag processor design is that it allows to detect files larger than the 2GB
      limit before the check is performed, which allows lfs to transform the contents
      into metadata.
      e12c0fa1f65b
    • Remi Chaintron's avatar
      revlog: add 'raw' argument to revision and _addrevision · 2df983125d37
      Remi Chaintron authored
      This patch introduces a new 'raw' argument (defaults to False) to revlog's
      revision() and _addrevision() methods.
      When the 'raw' argument is set to True, it indicates the revision data should be
      handled as raw data by the flagprocessor.
      
      Note: Given revlog.addgroup() calls are restricted to changegroup generation, we
      can always set raw to True when calling revlog._addrevision() from
      revlog.addgroup().
      2df983125d37
  3. Jan 09, 2017
    • Jun Wu's avatar
      pager: do not special case chg · d3e2d39b97ea
      Jun Wu authored
      Since chg has its own _runpager implementation, it's no longer necessary to
      special-case chg in the pager extension. This will effectively enable the
      new chg pager code path that runs inside runcommand.
      d3e2d39b97ea
    • Jun Wu's avatar
      chg: remove getpager support · fde9692a02c0
      Jun Wu authored
      We have enough bits to switch to the new chg pager code path in runcommand.
      So just remove the legacy getpager support.
      
      This is a red-only patch, and will break chg's pager support temporarily.
      fde9692a02c0
    • Jun Wu's avatar
      chgserver: implement chgui._runpager · 493935e0327a
      Jun Wu authored
      This patch implements chgui._runpager in a relatively simple way. A more
      clean way is to move the core logic of "attachio" to "ui", which will be
      done later after chg runs uisetup per request.
      493935e0327a
    • Jun Wu's avatar
      chgserver: make S channel support pager request · 815e1cefd082
      Jun Wu authored
      This patch adds the "pager" support for the S channel. The pager API allows
      running some subcommands, namely attachio, and waiting for the client to be
      properly synchronized.
      815e1cefd082
    • Jun Wu's avatar
      chg: handle pager request client-side · a45c0f42271f
      Jun Wu authored
      This patch implements the simple S-channel pager handling at chg
      client-side.
      
      Note: It does not deal with environ and cwd currently for simplicity, which
      will be fixed later.
      a45c0f42271f
    • Jun Wu's avatar
      chgserver: use util.shellenviron · 2957409449ac
      Jun Wu authored
      This avoids code duplication.
      2957409449ac
    • Jun Wu's avatar
      util: extract the logic calculating environment variables · d9e5b0aeeb90
      Jun Wu authored
      The method will be reused in chgserver. Move it out so it can be reused.
      d9e5b0aeeb90
  4. Jan 07, 2017
  5. Jan 08, 2017
    • Matt Harbison's avatar
      test-obsolete: stabilize output on platforms without 'serve' support · 66448a53bdac
      Matt Harbison authored
      The conditional was updating the repository, which wasn't reflected in
      subsequent logs on Windows, so the conditional is narrowed to just the serve
      commands.  The serve operation generates log files, so those are deleted to keep
      the output of summary consistent.
      66448a53bdac
    • Matt Harbison's avatar
      tests: update globs for Windows · d4ec69ff652a
      Matt Harbison authored
      The extra glob in test-command-template.t caused it to say no result was
      reported.  It used to be (within the past year), that both this and the missing
      glob cases could be fixed simply by editing any output in the test, and
      re-running it in interactive mode.  But that no longer works, and I had to diff
      *.t against *.t.err.  I didn't dig into what changed.
      d4ec69ff652a
    • Matt Harbison's avatar
      help: merge the various operator sections of revsets, filesets and templates · b8a188a6f191
      Matt Harbison authored
      Having sections for specific operator types assumes the user already knows what
      type of operators are supported.  By having a common heading, the user can
      simply lookup help for "(revsets|filesets|templates).operators".
      b8a188a6f191
    • Matt Harbison's avatar
      help: apply the section headings from revsets to templates · 107014f4848b
      Matt Harbison authored
      Unlike filesets, there are a few distinct headings that are not shared with
      revsets.  But common names are used where possible.
      107014f4848b
    • Matt Harbison's avatar
      help: apply the section headings from revsets to filesets · a4bc8fff67fc
      Matt Harbison authored
      This has the nice property of visually breaking up the wall of text.  It also
      allows specific smaller sections to be called out.  For example,
      `hg help filesets.predicates` now prints just the predicate section.  At the
      moment, the revset headings are a superset of the fileset headings, so there is
      consistency in how example, predicate and operator help is called out.
      
      The reference to `hg help patterns` was moved to the overview section, so that
      it isn't stuck in the examples section.
      a4bc8fff67fc
  6. Jan 06, 2017
    • Jun Wu's avatar
      chg: check type read from S channel · 7438cb35979a
      Jun Wu authored
      The previous patch added the check server-side. This patch added it
      client-side.
      7438cb35979a
    • Jun Wu's avatar
      chgserver: check type passed to S channel · 18eb63ec8475
      Jun Wu authored
      It currently only supports the "system" type. Add an explicit check.
      18eb63ec8475
    • Jun Wu's avatar
      chg: send type information via S channel (BC) · dd897eb1699e
      Jun Wu authored
      Previously S channel is only used to send system commands. It will also be
      used to send pager commands. So add a type parameter.
      
      This breaks older chg clients. But chg and hg should always come from a
      single commit and be packed into a single package. Supporting running
      inconsistent versions of chg and hg seems to be unnecessarily complicated
      with little benefit. So just make the change and assume people won't use
      inconsistent chg with hg.
      dd897eb1699e
  7. Jan 01, 2017
    • Valters Vingolds's avatar
      rebase: fail-fast the pull if working dir is not clean (BC) · c2bd2f77965b
      Valters Vingolds authored
      Refuse to run 'hg pull --rebase' if there are uncommitted changes:
      so that instead of going ahead with fetching changes and then suddenly aborting
      the rebase, we can warn user of uncommitted changes (or unclean repo state)
      right up front.
      In tests, we create a 'histedit' session to verify that also an unfinished
      state is detected and handled.
      c2bd2f77965b
  8. Jan 06, 2017
  9. Dec 26, 2016
    • Jun Wu's avatar
      pager: wrap ui._runpager · 117e15c30e6c
      Jun Wu authored
      As discussed at [1], ui._runpager will be the new low-level API accepting a
      pager command to actually run the pager. And ui.pager is the high-level API
      which reads config directly from self.
      
      This change is necessary for chgserver to override _runpager cleanly.
      
      [1]: www.mercurial-scm.org/pipermail/mercurial-devel/2016-December/091656.html
      117e15c30e6c
  10. Jan 07, 2017
  11. Jan 04, 2017
  12. Dec 28, 2016
    • Denis Laxalde's avatar
      context: add a `blockancestors(fctx, fromline, toline)` function · ce662ee40d2d
      Denis Laxalde authored
      This yields ancestors of `fctx` by only keeping changesets touching the file
      within specified linerange = (fromline, toline).
      
      Matching revisions are found by inspecting the result of `mdiff.allblocks()`,
      filtered by `mdiff.blocksinrange()`, to find out if there are blocks of type
      "!" within specified line range.
      
      If, at some iteration, an ancestor with an empty line range is encountered,
      the algorithm stops as it means that the considered block of lines actually
      has been introduced in the revision of this iteration. Otherwise, we finally
      yield the initial revision of the file as the block originates from it.
      
      When a merge changeset is encountered during ancestors lookup, we consider
      there's a diff in the current line range as long as there is a diff between
      the merge changeset and at least one of its parents (in the current line
      range).
      ce662ee40d2d
  13. Jan 03, 2017
  14. Jan 06, 2017
  15. Dec 28, 2016
    • Gregory Szorc's avatar
      hgweb: link to raw-file on annotation page (BC) · 011122b3b1c4
      Gregory Szorc authored
      Every other template has the "raw" link load "raw-file." However,
      fileannotate.tmpl's "raw" link loads "raw-annotate." This feels
      inconsistent and wrong.
      
      As far as I can tell, linking to the "raw annotate" view has occurred
      since 2006.
      011122b3b1c4
  16. Jan 04, 2017
    • Martin von Zweigbergk's avatar
      repair: combine two loops over changelog revisions · 987dbe87aad6
      Martin von Zweigbergk authored
      This just saves a few lines.
      987dbe87aad6
    • Martin von Zweigbergk's avatar
      repair: speed up stripping of many roots · 2e4862646f02
      Martin von Zweigbergk authored
      repair.strip() expects a set of root revisions to strip. It then
      builds the full set of descedants by walking the descandants of
      each. It is rare that more than a few roots get passed in, but if that
      happens, it will wastefully walk the changelog for each root. So let's
      just walk it once.
      
      I noticed this because the narrowhg extension was passing not only
      roots, but all the commits to strip. When there were tens of thousands
      of commits to strip, this resulted in quadratic behavior with that
      extension.
      2e4862646f02
Loading