Skip to content
Snippets Groups Projects
  1. May 06, 2017
    • Gregory Szorc's avatar
    • Gregory Szorc's avatar
      revlog: rename _chunkraw to _getsegmentforrevs() · 75e93d95
      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.
      75e93d95
    • Gregory Szorc's avatar
      perf: store reference to revlog._chunkraw in a local variable · 112ba1c7
      Gregory Szorc authored
      To prepare for renaming revlog._chunkraw, we stuff a reference to this
      metho in a local variable. This does 2 things. First, it moves the
      attribute lookup outside of a loop, which more accurately measures
      the time of the code being invoked. Second, it allows us to alias
      to different methods depending on their presence (perf.py needs to
      support running against old Mercurial versions).
      
      Removing an attribute lookup from a tigh loop appears to shift the
      numbers slightly with mozilla-central:
      
      $ hg perfrevlogchunks -c
      
      ! read
      ! wall 0.354789 comb 0.340000 user 0.330000 sys 0.010000 (best of 28)
      ! wall 0.335932 comb 0.330000 user 0.290000 sys 0.040000 (best of 30)
      ! read w/ reused fd
      ! wall 0.342326 comb 0.340000 user 0.320000 sys 0.020000 (best of 29)
      ! wall 0.332857 comb 0.340000 user 0.290000 sys 0.050000 (best of 30)
      ! read batch
      ! wall 0.023623 comb 0.020000 user 0.000000 sys 0.020000 (best of 124)
      ! wall 0.023666 comb 0.020000 user 0.000000 sys 0.020000 (best of 125)
      ! read batch w/ reused fd
      ! wall 0.023828 comb 0.020000 user 0.000000 sys 0.020000 (best of 124)
      ! wall 0.023556 comb 0.020000 user 0.000000 sys 0.020000 (best of 126)
      112ba1c7
    • Gregory Szorc's avatar
      revlog: rename internal functions containing "chunk" to use "segment" · 1395f843
      Gregory Szorc authored
      Currently, "chunk" is overloaded in revlog terminology to mean
      multiple things. One of them refers to a segment of raw data from
      the revlog. This commit renames various methods only used within
      revlog.py to have "segment" in their name instead of "chunk."
      
      While I was here, I also made the names more descriptive. e.g.
      "_loadchunk()" becomes "_readsegment()" because it actually does
      I/O.
      1395f843
    • Jun Wu's avatar
      fsmonitor: do not nuke dirstate filecache · bf3af0ec
      Jun Wu authored
      In the future, chg may prefill repo's dirstate filecache so it's valuable
      and should be kept. Previously we drop both filecache and property cache for
      dirstate during fsmonitor reposetup, this patch changes it to only drop
      property cache but keep the filecache.
      bf3af0ec
    • Gregory Szorc's avatar
      perf: move gettimer() call · c68c400d
      Gregory Szorc authored
      This is more consistent with other perf* functions.
      c68c400d
    • Gregory Szorc's avatar
      perf: don't clobber startrev variable · 6b582f9b
      Gregory Szorc authored
      Previously, the "startrev" argument would be ignored due to
      "startrev = 0" in the benchmark function. This meant that
      `hg perfrevlog` always started at revision 0.
      
      Rename the local variable to "beginrev" so the variable does the
      right thing.
      6b582f9b
  2. May 05, 2017
    • Pierre-Yves David's avatar
      bundle: add optional 'tagsfnodecache' data to on disk bundle (issue5543) · d7f93ebb
      Pierre-Yves David authored
      This should help performance when unbundling.
      d7f93ebb
    • Pierre-Yves David's avatar
      bundle2: move tagsfnodecache generation in a generic function · 6068712c
      Pierre-Yves David authored
      This will help us reusing the logic for `hg bundle`.
      6068712c
    • Pierre-Yves David's avatar
      bundle: introduce an higher level function to write bundle on disk · 9dc36df7
      Pierre-Yves David authored
      The current function ('writebundle') is focussing on getting an existing
      changegroup to disk. It is no easy ways to includes more part in the generated
      bundle2. So we introduce a slightly higher level function that is fed the
      'outgoing' object (that defines the bundled spec) and the bundlespec parameters
      (to control the changegroup generation and inclusion of other parts).
      
      This is creating the third logic dedicated to create a consistent bundle2 (the
      other 2 are the push code and the getbundle code). We should probably reconcile
      them at some points but they all takes different types of input. So we need to
      introduce an intermediate "object" that each different input could be converted
      to. Such unified "bundle2 specification" could be fed to some unified code.
      
      We start by having the `hg bundle` related code on its own to helps defines its
      specific needs first. Once the common and specific parts of each logic will be
      known we can start unification.
      9dc36df7
  3. May 04, 2017
  4. May 07, 2017
    • Matt Harbison's avatar
      extdiff: copy back files to the working directory if the size changed · affd753d
      Matt Harbison authored
      In theory, it should be enough to pay attention only to the modification time
      when detecting if a snapshotted working directory file changed.  In practice,
      BeyondCompare preserves all file attributes when syncing files at the directory
      level.  (If you open the file and sync individual hunks, then mtime does change,
      and everything was being copied back as desired.)  I'm not sure how many other
      synchronization tools would trigger this issue, but it's annoyingly inconsistent
      (if a single file is diffed, it isn't snapshotted, so the same BeyondCompare
      file sync operation _is_ visible, because wdir() is updated in place.
      
      I filed a bug with them, and they stated it is on their wish list, but won't be
      fixed in the near term.  This isn't a complete fix (there is still the case of
      the size not changing), but this seems like a trivial enough change to fix most
      of the problem.  I suppose we could fool around with making files in the other
      snapshot readonly, and copy back if we see the readonly bit copied.  That seems
      pretty hacky though, and only works if the external tool copies all attributes.
      affd753d
    • Matt Harbison's avatar
  5. May 06, 2017
  6. Aug 13, 2016
  7. Aug 12, 2016
    • Yuya Nishihara's avatar
      policy: add "cext" package which will host CPython extension modules · c4858385
      Yuya Nishihara authored
      I'm going to restructure cext/pure modules and get rid of our hgimporter
      hack. C extension modules will be moved to cext/ directory so old and new
      compiled modules can coexist in development tree. This is necessary to
      run 'hg bisect' without recompiling.
      
      New extension modules will be loaded by an importer function:
      
        base85 = policy.importmod('base85')  # select pure.base85 or cext.base85
      
      This will also allow us to split cffi from pure modules, which is currently
      difficult because pure modules can't be imported by name.
      c4858385
  8. May 02, 2017
  9. Apr 26, 2017
    • Yuya Nishihara's avatar
      debuginstall: check C extensions only if they are loadable per policy · 85dc5a25
      Yuya Nishihara authored
      This check is useless in pure installation and I want to make it directly
      import C extension modules.
      85dc5a25
    • Yuya Nishihara's avatar
      osutil: proxy through util (and platform) modules (API) · d74b0cff
      Yuya Nishihara authored
      See the previous commit for why. Marked as API change since osutil.listdir()
      seems widely used in third-party extensions.
      
      The win32mbcs extension is updated to wrap both util. and windows. aliases.
      d74b0cff
    • Yuya Nishihara's avatar
      mpatch: proxy through mdiff module · 0c73634d
      Yuya Nishihara authored
      See the previous commit for why.
      0c73634d
    • Yuya Nishihara's avatar
      bdiff: proxy through mdiff module · ded48ad5
      Yuya Nishihara authored
      See the previous commit for why.
      
      mdiff seems a good place to host bdiff functions. bdiff.bdiff was already
      aliased as textdiff, so we use it.
      ded48ad5
    • Yuya Nishihara's avatar
      base85: proxy through util module · 4462a981
      Yuya Nishihara authored
      I'm going to replace hgimporter with a simpler import function, so we can
      access to pure/cext modules by name:
      
        # util.py
        base85 = policy.importmod('base85')  # select pure.base85 or cext.base85
      
        # cffi/base85.py
        from ..pure.base85 import *  # may re-export pure.base85 functions
      
      This means we'll have to use policy.importmod() function in place of the
      standard import statement, but we wouldn't want to write it every place where
      C extension modules are used. So this patch makes util host base85 functions.
      4462a981
  10. May 02, 2017
  11. May 08, 2017
  12. May 04, 2017
  13. May 06, 2017
    • Jun Wu's avatar
      diff: correct binary testing logic · 0c67ab3d
      Jun Wu authored
      This seems to be more correct given the table drawn in the previous patch.
      
      Namely, "losedatafn" and "opts.git" are removed, "not opts.text" is added.
      
        - losedatafn: diff output (binary) should not be affected by "losedatafn"
        - opts.git: binary testing is helpful for detecting a fast path in the
          next path. the fast path can also be used if opts.git is False
        - opts.text: if it's set, we should treat the content as non-binary
      0c67ab3d
  14. May 05, 2017
  15. May 04, 2017
    • Jun Wu's avatar
      diff: use fctx.size() to test empty · 776127b2
      Jun Wu authored
      fctx.size() could have a fast path that does not require loading content.
      776127b2
    • Jun Wu's avatar
      diff: use fctx.isbinary() to test binary · e62cf13e
      Jun Wu authored
      The end goal is to avoid calling fctx.data() when unnecessary. For example,
      if diff.nobinary=1 and files are binary, the expected behavior is to print
      "Binary file has changed". That could avoid reading fctx.data() sometimes.
      
      This is mainly to enable an external LFS extension to skip expensive binary
      file loading sometimes (read: most of the time with diff.nobinary=1 and
      diff.text=0), without any behavior changes to mercurial (i.e. whether a file
      is LFS or not does not change any behavior, LFS could be 100% transparent to
      users).
      e62cf13e
  16. Apr 20, 2017
  17. May 01, 2017
Loading