Skip to content
Snippets Groups Projects
  1. Aug 16, 2022
  2. Apr 20, 2022
    • E. C. Masloch's avatar
      rebase: add boolean config item rebase.store-source · cfff73cab721
      E. C. Masloch authored
      This allows to use rebase without recording a rebase_source extra
      field. This is useful for example to build a mirror converted from
      another SCM (such as svn) by converting only new revisions, and
      then incrementally add them to the destination by pulling from the
      newly converted (unrelated) repo and rebasing the new revisions
      onto the last old already stored changeset. Without this patch the
      rebased changesets would always receive some rebase_source that
      would depend on the particular history of the conversion process,
      instead of only depending on the original source revisions.
      
      This is used to implement a hg mirror repo of SvarDOS (a partially
      nonfree but completely redistributable DOS distribution) in the
      scripts at https://hg.pushbx.org/ecm/svardos.scr/
      
      In particular, cre.sh creates an svn mirror, upd.sh recreates an
      entire hg repo from the svn mirror (which takes too long to do in a
      regular job), and akt.sh uses hg convert with the config item
      convert.svn.startrev to incrementally convert only the two most
      recent revisions already found in the mirror destination plus any
      possible new revisions. If any are found, the temporary repo's
      changesets are pulled into the destination (as changesets from an
      unrelated repository). Then the changesets corresponding to the new
      revisions are rebased onto the prior final changeset. (Finally, the
      two remaining duplicates of the prior head and its parent are
      stripped from the destination repository.)
      
      Without this patch, the particular rebase_source extra field would
      depend on the order and times at which akt.sh was used, instead of
      only depending on the source repository. In other words, whatever
      sequence of upd.sh and akt.sh is used at whatever times, it is
      desired that the final output repositories always match each other
      exactly.
      cfff73cab721
  3. Jul 25, 2022
  4. Aug 25, 2022
  5. Aug 23, 2022
    • Arun Kulshreshtha's avatar
      bisect: avoid adding irrelevant revisions to bisect state · 816236523765
      Arun Kulshreshtha authored
      When adding new revisions to the bisect state, it only makes sense to add
      information about revisions that are under consideration (i.e., those that are
      topologically between the known good and bad revisions). However, if the user
      passes in a revset (e.g., '!merge()' to exclude merge commits), hg will resolve
      the revset first and add all matching revisions to the bisect state (which in
      this case would likely be the majority of revisions in the repo). To avoid this,
      revisions should only be added to the bisect state if they are between the good
      and bad revisions (and therefore relevant to the bisection).
      
      --
      
      Here are the results of some performance tests using the `mozilla-central` repo
      (since it is one of the largest freely-available hg repositories in the wild).
      These tests compare the performance of a locally-built `hg` before and after
      application of this series. Note that `--noupdate` is passed to avoid including
      update time (which should not vary across cases).
      
      Setup (run between each test):
        $ hg bisect --reset
        $ hg bisect --noupdate --bad 56c3ad4bde5c70714b784ccf15d099e0df0f5bde
        $ hg bisect --noupdate --good 57426696adaf08298af3027fa77486fee0633b13
      
      Test using a revset that returns a very large number of revisions:
        $ time hg bisect --noupdate --skip '!merge()' > /dev/null
      
      Before:
        real    0m9.398s
        user    0m9.233s
        sys     0m0.120s
      
      After:
        real    0m1.513s
        user    0m1.425s
        sys     0m0.052s
      
      Test using a revset that is expensive to compute:
        $ time hg bisect --noupdate --skip 'desc("Bug")' > /dev/null
      
      Before:
        real    0m49.853s
        user    0m49.580s
        sys     0m0.243s
      
      After:
        real    0m4.120s
        user    0m4.036s
        sys     0m0.048s
      816236523765
    • Arun Kulshreshtha's avatar
      bisect: limit ancestors to revs topologically between good and bad revs · 3ef153aa1eed
      Arun Kulshreshtha authored
      Previously, when constructing its dict of revisions to their ancestors, bisect
      would populate the dict with ALL of the descendents of the good set, which is
      a bit silly because it is impossible for a revision that is a descendent of the
      minimum known bad revision to be the first bad rev. Instead it makes more sense
      to limit the revisions to just those topologically between the good and bad.
      3ef153aa1eed
    • Arun Kulshreshtha's avatar
      bisect: bypass changectx when translating revs to nodes · a0b57cabc245
      Arun Kulshreshtha authored
      When resolving the revset given by the user into node hashes, use the changelog
      to perform the translation rather than the repo object. This avoids the overhead
      of constructing a changectx which is immediately discarded.
      a0b57cabc245
  6. Aug 24, 2022
  7. Jul 28, 2022
  8. Aug 17, 2022
  9. Aug 10, 2022
  10. Aug 02, 2022
  11. Jul 28, 2022
  12. Aug 08, 2022
  13. Aug 17, 2022
  14. Aug 16, 2022
  15. Aug 10, 2022
    • Arun Kulshreshtha's avatar
      dispatch: change cwd when loading local config · 3681a47611b8
      Arun Kulshreshtha authored
      Previously, the `_getlocal` function would not correctly load the repo config
      when given a relative `rpath` and an alternate cwd via the `wd` parameter.
      
      Normally when `--cwd` is specified, hg changes to the given directory before
      attempting to load the local config (and therefore does not specify a `wd`).
      The only time the function is called with `wd` set is when hg is running as a
      command server (e.g., with chg), in which case each forked worker process will
      attempt to configure itself via `_getlocal` before responding to the client.
      When given a relative repo path, the worker fails to load the repo config,
      detects a config mismatch with the client, and enters a redirect/respawn loop.
      
      To fix this, we can simply change to the desired working directory during
      config loading. (Note that simply concatenating `wd` and `rpath` won't work
      in all cases. The repo path could be something more complicated than a simple
      relative path, such as a `union:` repo.)
      3681a47611b8
  16. Aug 08, 2022
  17. Aug 12, 2022
  18. Aug 15, 2022
    • Arseniy Alekseyev's avatar
      revlog: make _partialmatch fail fast on almost-hex inputs · 5fe7e9eda0f3
      Arseniy Alekseyev authored
      Before this change, resolving a revision like [0123456789^] on
      a large repo can take multiple seconds because:
      
      - hg does not realize this is a revset, so it tries various things,
      including _partialmatch(b"0123456789^")
      - after the rust lookup fails, it falls back to pure hg
      - pure hg takes all-but-last chars and converts them to binary,
      which *succeeds*, so it does the expensive part.
      5fe7e9eda0f3
  19. Jul 11, 2022
  20. Jul 18, 2022
    • Matt Harbison's avatar
      setup: use the full executable manifest from `python.exe` · ece490b02a9b
      Matt Harbison authored
      The manifest embedded by the build process (before the string here is added)
      already accounts for the `<requestedExecutionLevel level="asInvoker" ...>`
      setting.  (Note that the PyOxidizer build is missing this, so it will likely
      trigger the UAC escalation prompt on each run.)  However, using `mt.exe` to
      merge the fragment with what is already in the manifest seems to strip all
      whitespace, making it unreadable.
      
      Since Mercurial can be run via `python.exe`, it makes sense that we would have
      the same manifest settings (like the supported OS list), though I'm unaware of
      any functionality this enables.  It also has the nice effect of making the
      content readable from a resource editor.  The manifest comes from python 3.9.12.
      
      Note that this seems to strip the `<?xml ... ?>` declaration when viewed with
      ResourceHacker 5.1.7, but this was also the state of things with the previous
      commit, and `mt.exe "-inputresource:hg.exe;#1" -out:extracted` does contain the
      declaration and the BOM in both cases.  No idea why this differs from other
      executables.
      ece490b02a9b
    • Matt Harbison's avatar
      setup: unconditionally enable the `long-paths-support` option on Windows · 747c4fc20886
      Matt Harbison authored
      I don't see anything talking about why this was experimental in the first place,
      but maybe it was concern about the level of python2 support for it.  But now,
      both `python.exe` and the PyOxidizer build of `hg.exe` have a manifest that
      enables it, so leaving it off would mean some Mercurial installations could
      operate on a repo with long paths, and others couldn't.  Note that only the wide
      character functions (XxxW) will have the length restriction lifted.
      
      Sadly, distutils applies `/MANIFEST:EMBED` to the linker in a way that can't
      easily be turned off, so we can't use `/MANIFESTFILE` with `extra_preargs` on
      `link_executable`.  Fortunately, the compiler object provides a path to the
      `mt.exe` it found during initialization, because the previous incarnation seems
      to have assumed it is being run within an activated Visual Studio environment.
      That causes MSYS builds to fail, and probably would have broke the CI
      environment.
      747c4fc20886
    • Matt Harbison's avatar
      setup: stop shadowing the builtin `dir` symbol · 5cf73de964e1
      Matt Harbison authored
      I hit this when debugging what's available on the compiler.
      5cf73de964e1
    • Kered13's avatar
      subrepo: avoid opening console window for non-native subrepos on Windows · b9fcf54030d7
      Kered13 authored
      Prevent annoying command prompt windows popping up when using TortoiseHG with
      Git and SVN subrepos by passing creationflags=subprocess.CREATE_NO_WINDOW to
      subprocess.Popen.
      b9fcf54030d7
  21. Jul 13, 2022
    • Matt Harbison's avatar
      ci: bump pytype to 2022.03.29 · 5baf873ccb6e
      Matt Harbison authored
      This is as far as we can go without running into issues with the vendored `attr`
      package.  I tried updating that to the latest, and not only did it not fix the
      issue, but test-util.py failed due to some poking at `attr` internals that
      apparently is no longer valid.
      
      The `libcst` package is now pinned to what I have locally because trying to
      install the latest (0.4.7) complains that it can't find the Rust compiler.  We
      should probably use a requirements file instead (and/or figure out why it can't
      find the Rust compiler), but I don't feel like dealing with another side quest.
      5baf873ccb6e
Loading