Skip to content
Snippets Groups Projects
  1. May 02, 2017
    • Pierre-Yves David's avatar
      caches: stop warming the cache after changegroup application · 24f55686a63d
      Pierre-Yves David authored
      Now that we garantee that branchmap cache is updated at the end of the
      transaction we can drop this update. This removes a problematic case with
      nested transaction where the new cache could be written on disk before the
      transaction is finished (and even roll-backed)
      
      Such premature cache write was visible in the following test:
      
      * tests/test-acl.t
      * tests/test-rebase-conflicts.t
      
      In addition, running the cache update later means having more date about the
      state of the repository (in particular: phases). So we can generate caches with
      more information. This creates harmless changes to the following tests:
      
      * tests/test-hardlinks-whitelisted.t
      * tests/test-hardlinks.t
      * tests/test-phases.t
      * tests/test-tags.t
      * tests/test-inherit-mode.t
      24f55686a63d
    • Pierre-Yves David's avatar
      caches: move the 'updating the branch cache' message in 'updatecaches' · c2380b448265
      Pierre-Yves David authored
      We are about to remove the branchmap cache update in changegroup application.
      There is a debug message alongside this update that we do not want to loose. We
      move the message beforehand to simplify the test update in the next changeset.
      The message move is quite noisy and isolating that noise is useful.
      
      Most tests update are just line reordering since the message is issued at a
      later point during the transaction.
      
      After this changes, the message is displayed in more case since local commit
      creation also issue it.
      c2380b448265
    • Pierre-Yves David's avatar
      caches: stop warming the cache after 'localrepo.commitctx' · 2b6692df1bdf
      Pierre-Yves David authored
      Now that we garantee that branchmap cache are updated at the end of the
      transaction we can drop that one. This removes a problematic case with nested
      transaction where the new cache could be written on disk before the transaction
      is finished.
      
      The test change is harmless, since we update the cache at a later point, the
      dirstate have been updated in between.
      2b6692df1bdf
    • Pierre-Yves David's avatar
      caches: introduce a 'debugupdatecaches' command · ccef71de7d41
      Pierre-Yves David authored
      That command make sure caches are updated. This is based on
      'localrepo.updatecaches' so when we move support for new cache in that function this
      command will benefit from it.
      ccef71de7d41
    • Pierre-Yves David's avatar
      caches: call 'repo.updatecache()' in 'repo.destroyed()' · a72caf0af38e
      Pierre-Yves David authored
      Regenerating the cache after a 'strip' or a 'rollback' is useful. So we call the
      generic cache warming function as other caches than just branchmap will be
      updated there in the future.
      
      To do so, we have to make 'repo.updatecache()' able to take no arguments. In
      such cases, we reload all caches.
      a72caf0af38e
    • Pierre-Yves David's avatar
      caches: introduce a function to warm cache · 604d65e2c0b2
      Pierre-Yves David authored
      We have multiple caches that gain from being kept up to date. For example in a
      server setup, we want to make sure the branchcache cache is hot for other
      read-only clients.
      
      Right now each cache tries to update themself in place where new data have been
      added. However the approach is error prone (we might miss some spot) and
      fragile. When nested transaction are involved, such cache updates might happen
      before a top level transaction is committed. Writing caches for uncommitted
      data on disk.
      
      Having a single entry point, run at the end of each successful transaction,
      helps to ensure the cache is up to date and refreshed at the right time.
      
      We start with updating the branchmap cache but other will come.
      604d65e2c0b2
    • Pierre-Yves David's avatar
      transaction: track newly introduced revisions · 85ef5a073114
      Pierre-Yves David authored
      Tracking revisions is not the data that will unlock the most new capability.
      However, they are the simplest thing to track and still unlock some nice
      improvements in regard with caching.
      
      We plug ourself at the changelog level to make sure we do not miss any revision
      additions.
      
      The 'revs' set is configured at the repository level because the transaction
      itself does not needs to know that much about the business logic.
      85ef5a073114
    • Pierre-Yves David's avatar
      transaction: introduce "changes" dictionary to precisely track updates · 976681123416
      Pierre-Yves David authored
      The transaction is already tracking some data intended for hooks (in
      'hookargs'). However, that information is minimal as we optimise for
      passing data to other processes through environment variables. There are
      multiple places were we could use more complete and lower level
      information locally (eg: cache update, better report of changes to
      hooks, etc...).
      
      For this purpose we introduces a 'changes' dictionary on the
      transaction.  It is intended to track every changes happening to the
      repository (eg: new revs, bookmarks move, phases move, obs-markers,
      etc).
      
      For now we just adds the 'changes' dictionary. We'll adds more tracking
      and usages over time.
      976681123416
  2. May 11, 2017
  3. May 09, 2017
  4. May 12, 2017
    • Katsunori FUJIWARA's avatar
      debugcommands: add debugpickmergetool to examine which merge tool is chosen · 9bc36198338e
      Katsunori FUJIWARA authored
      Before this patch, there is no convenient way to know which merge tool
      is chosen for each managed files without actual merging.
      9bc36198338e
    • Katsunori FUJIWARA's avatar
      filemerge: add internal merge tool to dump files forcibly · 7e35d31b41fd
      Katsunori FUJIWARA authored
      Internal merge tool :dump implies premerge. Therefore, files aren't
      dumped, if premerge runs successfully.
      
      This undocumented behavior might confuse users, if they want to always
      dump files. But just making :dump omit premerge might cause backward
      compatibility issue for existing automation.
      
      This patch adds new internal merge tool :forcedump, which works as
      same as :dump, but omits premerge always.
      
      Internal tools annotated with "nomerge" should merge "change and
      delete" correctly, but _forcedump() can't. Therefore, it is annotated
      with "mergeonly" to always omit premerge, even though it doesn't merge
      files actually.
      
      This patch also adds explanation about premerge to :dump, to clarify
      how :dump actually works.
      
      BTW, this patch specifies internal tools with "internal:" prefix in
      newly added test scenario in test-merge-tools.t, even though this
      prefix is already deprecated. This is only for similarity to other
      tests in test-merge-tools.t.
      7e35d31b41fd
    • Katsunori FUJIWARA's avatar
      filemerge: make warning message more i18n friendly · 177742666abd
      Katsunori FUJIWARA authored
      Before this patch, " specified for " part of warning messages
      (e.g. "couldn't find merge tool TOOL specified for PAT") isn't
      translatable.
      177742666abd
    • Katsunori FUJIWARA's avatar
      filemerge: show warning about choice of :prompt only at an actual fallback · 7d4ce4b567c5
      Katsunori FUJIWARA authored
      Before this patch, internal merge tool :prompt shows "no tool found to
      merge FILE" line, even if :prompt is explicitly specified as a tool to
      be used.
      
      This patch shows warning message about choice of :prompt only at an
      actual fallback, in which case any tool is rejected by capability for
      binary or symlink.
      
      It is for backward compatibility to omit warning message in
      "changedelete" case.
      7d4ce4b567c5
  5. May 09, 2017
    • Durham Goode's avatar
      treemanifest: allow manifestrevlog to take an explicit treemanifest arg · d67991c4fefe
      Durham Goode authored
      Previously we relied on the opener options to tell the revlog to be a tree
      manifest. This makes it complicated for extensions to create treemanifests and
      normal manifests at the same time. Let's add a construtor argument to create a
      treemanifest revlog as well.
      
      I considered removing the options['treemanifest'] logic from manifestrevlog
      entirely, but doing so shifts the responsibility to the caller which ends up
      requiring changes in localrepo, bundlerepo, and unionrepo. I figured having the
      dual mechanism was better than polluting other parts of the code base with
      treemanifest knowledge.
      d67991c4fefe
  6. Apr 26, 2017
    • Yuya Nishihara's avatar
      policy: relax the default for in-place build · a04f5c651e52
      Yuya Nishihara authored
      We're going to make the 'c' policy more strict, where no missing attribute
      will be allowed. Since we want to run 'hg bisect' without rebuilding the C
      extension modules, we'll need a looser policy for development environment.
      
      The default for system installation isn't changed.
      
      Note that the current 'c' policy is practically 'allow'-ish as we have lots
      of adhoc fallbacks to pure functions.
      a04f5c651e52
  7. May 11, 2017
    • Jun Wu's avatar
      verify: always check rawsize · 8a137ef6e5da
      Jun Wu authored
      Previously, verify only checks "rawsize == len(rawtext)", if
      "len(fl.read()) != fl.size()".
      
      With flag processor, "len(fl.read()) != fl.size()" does not necessarily mean
      "rawsize == len(rawtext)". So we may miss a useful check.
      
      This patch removes the "if len(fl.read()) != fl.size()" condition so the
      rawsize check is always performed.
      
      With the condition removed, "fl.read(n)" looks unnecessary so a comment was
      added to explain the side effect is wanted.
      8a137ef6e5da
  8. May 12, 2017
  9. May 11, 2017
  10. May 12, 2017
  11. May 10, 2017
    • Jun Wu's avatar
      revlog: move part of "addrevision" to "addrawrevision" · 3de4c61b5087
      Jun Wu authored
      "addrawrevision" will be the public API to reuse revision rawdata elsewhere.
      It will be used by a future patch.
      3de4c61b5087
    • Jun Wu's avatar
      filectx: add an overlayfilectx class · 07da778f3b58
      Jun Wu authored
      The end goal is to make it possible to avoid potential expensive fctx.data()
      when unnecessary.
      
      While memctx is useful for creating new file contexts, there are many cases
      where we could reuse an existing raw file revision (amend, histedit, rebase,
      process a revision constructed by a remote peer, etc). The overlayfilectx
      class is made to support such reuse cases. Together with a later patch, hash
      calculation and expensive flag processor could be avoided.
      07da778f3b58
    • Jun Wu's avatar
      filectx: remove __new__ · 067985c26773
      Jun Wu authored
      It does not seem to be used anywhere, and breaks a later patch.
      067985c26773
  12. May 09, 2017
    • Jun Wu's avatar
      filectx: add a rawflags method · 651ee1681964
      Jun Wu authored
      The new method returns the low-level revlog flag. We already have "rawdata"
      so a "rawflags" makes sense.
      
      Both "rawflags" and "rawdata" will be used in a later patch.
      651ee1681964
  13. May 10, 2017
  14. Apr 30, 2017
  15. May 08, 2017
  16. May 02, 2017
    • Gregory Szorc's avatar
      setup: drop support for Python 2.6 (BC) · feb910d2f59b
      Gregory Szorc authored
      Per discussion on the mailing list and elsewhere, we've decided that
      Python 2.6 is too old to continue supporting. We keep accumulating
      hacks/fixes/workarounds for 2.6 and this is taking time away from
      more important work.
      
      So with this patch, we officially drop support for Python 2.6 and
      require Python 2.7 to run Mercurial.
      feb910d2f59b
  17. May 06, 2017
    • Gregory Szorc's avatar
      perf: move revlog construction and length calculation out of benchmark · 4c6b2076d292
      Gregory Szorc authored
      We don't need to measure the time it takes to open the revlog or
      calculate its length.
      
      This is more consistent with what other perf* functions do.
      
      While I was here, I also renamed the revlog variable from "r" to
      "rl" - again in the name of consistency.
      4c6b2076d292
    • Gregory Szorc's avatar
      perf: clear revlog caches on every iteration · 954f63391d71
      Gregory Szorc authored
      cmdutil.openrevlog() may return a cached revlog instance. This /may/
      be a recent "regression" due to refactoring of the manifest API. I'm
      not sure.
      
      Either way, this perf command was broken for at least manifests because
      subsequent invocations of the perf function would get cache hits from
      previous invocations, invalidating results. In the extreme case,
      testing the last revision in the revlog resulted in near-instantanous
      execution of subsequent runs (since the fulltext is cached). A time
      of ~1us would be reported in this case.
      954f63391d71
    • Gregory Szorc's avatar
      73c3e226d2fc
    • Gregory Szorc's avatar
      revlog: rename _chunkraw to _getsegmentforrevs() · 75e93d95aae6
      Gregory Szorc authored
      This completes our rename of internal revlog methods to
      distinguish between low-level raw revlog data "segments" and
      higher-level, per-revision "chunks."
      
      perf.py has been updated to consult both names so it will work
      against older Mercurial versions.
      75e93d95aae6
Loading