Skip to content
Snippets Groups Projects
  1. Feb 03, 2016
  2. Feb 09, 2016
    • timeless's avatar
      blackbox: log dirty state · b862e793
      timeless authored
      If blackbox.dirty = True, use `+` to indicate dirty repositories.
      b862e793
    • timeless's avatar
      blackbox: log working directory version · caa2a0c6
      timeless authored
      Without this, while you could see the list of commands run,
      it wasn't possible to identify what they were doing, because commads
      could rely on revsets (including remote input which varies over time).
      caa2a0c6
  3. Feb 08, 2016
  4. Feb 03, 2016
    • timeless's avatar
      blackbox: avoid creating multiple file handles for a single log · 45313f5a
      timeless authored
      There are multiple ui objects in Mercurial that can relate to a repository,
      before this change, each one would have its own file pointer, which
      results in unfortunate logging behavior.
      
      Also, any log rotation results would be bad because only the
      active blackboxui object's file pointer would be refreshed.
      
      Note that this does not prevent two long running hg commands for the same
      repository from causing problems.
      45313f5a
  5. Feb 24, 2016
  6. Feb 22, 2016
    • Martin von Zweigbergk's avatar
      changegroup: drop special-casing of flat manifests · a4286175
      Martin von Zweigbergk authored
      Since c08814b48ae5 (changegroup: avoid iterating the whole manifest,
      2015-12-04), the manifest linkrev callback iterates over only the
      files that were touched according the the changeset. Before that
      change, we iterated over all files returned in
      manifest.readfast(). That method returns the files in the delta, if
      the delta parent is a parent, otherwise it returns the full
      manifest. Most manifest revisions end up using one of the parents as
      its delta parent, so most of the time, the method returns a short
      manifest. It seems that that happens often enough that it doesn't
      really matter; I could not reproduce the timings reported in that
      change.
      
      Since the treemanifest code now works quite differently, and since
      that code also works correctly for flat manifests, let's drop the
      special-casing of flat manifests.
      a4286175
  7. Feb 13, 2016
    • Martin von Zweigbergk's avatar
      changegroup: fix treemanifests on merges · 1ac8ce13
      Martin von Zweigbergk authored
      The current code for generating treemanifest revisions takes the list
      of files in the changeset and finds the directories from them. This
      does not work for merges, since a merge may pick file A from one side
      and file B from another and neither of them would appear in the
      changeset's "files" list, but the manifest would still change.
      
      Fix this by instead walking the root manifest log for all needed
      revisions, storing all needed file and subdirectory revisions, then
      recursively visiting the subdirectories. This also turns out to be
      faster: cloning a version of hg core converted to treemanifests went
      from ~28s to ~19s (timing somewhat unfair: before this patch, timed
      until crash; after this patch, timed until manifests complete).
      
      The new algorithm is used only on treemanifest repos. Although it
      works equally well on flat manifests, we leave the iteration over
      files in the changeset for flat manifests for now.
      1ac8ce13
  8. Dec 27, 2015
  9. Feb 25, 2016
    • Pierre-Yves David's avatar
      test: update test-bundle2-format.t comment · b57d45ec
      Pierre-Yves David authored
      Now that bundle2 is used by default for all exchanges, this comment is obviously
      out of date. Having deep testing of the API and expected behavior of the format
      and its processing is still valuable, so the comment is updated.
      b57d45ec
  10. Feb 24, 2016
    • Jun Wu's avatar
      chg: extract gethgcmd logic to a function · a3d73e06
      Jun Wu authored
      gethgcmd is to get original hg (not chg) binary name. This patch extracts
      the logic from execcmdserver to make it available for the following patch.
      a3d73e06
    • Katsunori FUJIWARA's avatar
      destutil: use cached branch information instead of query for efficiency · e333cea7
      Katsunori FUJIWARA authored
      Before this patch, calculation of "the tipmost branch head on current
      branch" uses revset query "max(.::(head() and branch(BRANCH)))", but
      this isn't efficiency, because:
      
        - head() predicate lists up heads on all branches, but
        - branch() predicate eliminates heads on other branches
      
      In addition to it, without "literal:" prefix for branch name,
      branch(BRANCH) tries to (1) look up BRANCH in "repo.branchmap()" and
      (2) look up BRANCH as symbol name again, if there is no branch
      matching against BRANCH. The latter looking up is obviously redundant.
      
      This patch uses repo.branchheads(closed=True) to get all branch heads
      on specified branch instead of "head() and branch(BRANCH)" revset
      query part.
      
      This patch also makes catching RepoLookupError meaningless, because it
      is only raised by revset predicate "branch()". But "currentbranch in
      repo.branchmap()" can detect whether currentbranch actually exists or
      not.
      
      Therefore, this patch replaces try/except for RepoLookupError by
      if/else for "currentbranch in repo.branchmap()".
      e333cea7
    • Katsunori FUJIWARA's avatar
    • Katsunori FUJIWARA's avatar
      destutil: remove redundant examination · 2c29f157
      Katsunori FUJIWARA authored
      Before this patch, "len(heads) != len(otherheads)" is examined to
      detect whether message should be displayed or not.
      
      But if "repo.revs('%ln and parents()', heads)", heads should contain
      "parents()" and otherheads is always less than heads.
      2c29f157
    • Katsunori FUJIWARA's avatar
      destutil: add new local variable to increase readability · 9da2283d
      Katsunori FUJIWARA authored
      Before this patch, local variable 'heads' is used not only for "all
      branch heads" but also for "branch heads other than current parent".
      
      This patch newly adds local variable 'otherheads' for the latter
      purpose, to increase readability.
      9da2283d
  11. Feb 13, 2016
  12. Feb 12, 2016
    • Martin von Zweigbergk's avatar
      changegroup: include subdirectory manifests in verbose size · 8e13b237
      Martin von Zweigbergk authored
      When verbose logging is one, we report the size in bytes of the
      manifest data in the changegroup. For files, we report the size per
      file, but I'm not sure we need that level of detail (i.e. size per
      directory manifest). Instead, report a single figure for the size of
      root manifest plus submanifests.
      8e13b237
    • Martin von Zweigbergk's avatar
      changegroup: make _packmanifests() dumber · abf12026
      Martin von Zweigbergk authored
      The next few patches will rewrite the manifest generation code to work
      with merges. We will then walk dirlogs recursively. This prepares for
      that by moving much of the treemanifest code out of _packmanifests()
      and into generatemanifests(). For this to work, it also adds
      _manifestsdone() method that returns the "end of manifests" close
      chunk for cg3 and an empty string for cg1 and cg2.
      abf12026
    • Martin von Zweigbergk's avatar
      changegroup: extract generatemanifests() · 1c36cc8e
      Martin von Zweigbergk authored
      The changegroup.generate() function is pretty long, so let's extract
      the manifest generation part of it.
      1c36cc8e
  13. Feb 23, 2016
  14. Feb 24, 2016
    • Kostia Balytskyi's avatar
      templater: fix list templating bug · 5c11702f
      Kostia Balytskyi authored
      High-level use case: printing a list of objects with formatter
      when each object in turn contains a list of properties (like
      when % template symbol is used in {things % '{thing}'}
      
      Let the top-level list contain one thing with two properties:
      objs = [{
         'props': [
           { 'value': 1, 'show': 1 },
           { 'value': 2 }]
      }]
      
      (please note that second property does not have 'show' key)
      
      If a templateformatter is used to print this with template
        "{props % '{if(show, value)}'}"
      current implementation will print value for both properties,
      which is a bug. This happens because in `templater.runmap`
      function we only rewrite mapping values with existing new
      values for each item. If some mapping value is missing in
      the item, it will not be removed.
      5c11702f
    • Pierre-Yves David's avatar
      histedit: also handle locally missing nodes when reading obsolescence · 8ec5478a
      Pierre-Yves David authored
      The previous version of the code was interpreting markers to a missing
      node as a prune in all cases. The expected way to handle such
      situation is to keep reading markers, only turning successors into
      "prune" if they are at the end of a chain.
      
      We update the code and add a test for this.
      8ec5478a
    • Jun Wu's avatar
      chgserver: auto exit after being idle for too long or lose the socket file · 0a853dc9
      Jun Wu authored
      This is a part of the one server per config series. In multiple-server setup,
      new server may be started for a temporary config change like in command line,
      --config extensions.foo=bar.py. This may end up with a lot of not so useful
      server processes. Other questions are about socket file and process management,
      How to stop these processes? What if a new server wants to listen on a same
      address, replacing the old one?
      
      This patch introduces AutoExitMixIn, which will:
      
      1. Exit after being idle for too long. So useless servers won't run forever.
      2. Periodically check the ownership of socket file, exit if it is no longer
         owned. This brings strong consistency between the filesystem and the
         process, and handles some race conditions neatly.
         Since rename is atomic, a new server can just have a same server address
         with an old one and won't worry about how to make sure the old server is
         killed, address conflict, service downtime issues.
         The user can safely stop all servers by simply removing the socket files,
         without worrying about outdated or accidentally removed pidfiles.
      0a853dc9
    • Jun Wu's avatar
      check-code: allow old style class with special comments · 97fe8880
      Jun Wu authored
      The following chgserver change will use an old style class to comply with
      SocketServer's code style. This patch made it possible to pass check-code.
      97fe8880
    • Matt Mackall's avatar
      merge with stable · 41dcd754
      Matt Mackall authored
      41dcd754
    • Durham Goode's avatar
      revset: use smartset minus operator · d2ac8b57
      Durham Goode authored
      Previously, revsets like 'X - Y' were translated to be 'X and not Y'. This can
      be expensive, since if Y is a single commit then 'not Y' becomes a huge set and
      sometimes the query optimizer doesn't account for it well.
      
      This patch changes revsets to use the built in smartset minus operator, which is
      often smarter than 'X and not Y'.
      
      On a large repo this saves 2.2 seconds on rebase and histedit because "X:: - X"
      becomes almost instant.
      
      Relevant performance numbers from revsetbenchmark.py
      
      revset #13: roots((tip~100::) - (tip~100::tip))
         plain         min           max           first         last          reverse       rev..rst      rev..ast      sort          sor..rst      sor..ast
      0) 0.001080      0.001107      0.001102      0.001118      0.001121      0.001114      0.001141      0.001123      0.001099      0.001123      0.001137
      1) 0.000708  65% 0.000738  66% 0.000735  66% 0.000739  66% 0.000784  69% 0.000780  70% 0.000807  70% 0.000756  67% 0.000727  66% 0.000759  67% 0.000808  71%
      
      revset #14: roots((0::) - (0::tip))
         plain         min           max           first         last          reverse       rev..rst      rev..ast      sort          sor..rst      sor..ast
      0) 0.131304      0.079168      0.133129      0.076560      0.048179      0.133349      0.049153      0.077097      0.129689      0.076212      0.048543
      1) 0.065066  49% 0.036941  46% 0.066063  49% 0.034755  45% 0.048558      0.071091  53% 0.047679      0.034984  45% 0.064572  49% 0.035680  46% 0.048508
      
      revset #22: (not public() - obsolete())
         plain         min           max           first         last          reverse       rev..rst      rev..ast      sort          sor..rst      sor..ast
      0) 0.000139      0.000133      0.000133      0.000138      0.000134      0.000155      0.000157      0.000152      0.000157      0.000156      0.000153
      1) 0.000108  77% 0.000129      0.000129      0.000134      0.000132      0.000127  81% 0.000151      0.000147      0.000127  80% 0.000152      0.000149
      
      revset #25: (20000::) - (20000)
         plain         min           max           first         last          reverse       rev..rst      rev..ast      sort          sor..rst      sor..ast
      0) 0.050560      0.045513      0.022593      0.043588      0.021909      0.045517      0.021822      0.044660      0.049740      0.044227      0.021819
      1) 0.018614  36% 0.000171   0% 0.019659  87% 0.000168   0% 0.015543  70% 0.021069  46% 0.015623  71% 0.000180   0% 0.018658  37% 0.000186   0% 0.015750  72%
      d2ac8b57
  15. Feb 23, 2016
    • Kostia Balytskyi's avatar
      histedit: make histedit aware of obsolescense not stored in state (issue4800) · eed7d8c0
      Kostia Balytskyi authored
      Before this change, when histedit exited to interactive session (during edit
      command for example), user could introduce obsolescence markers that would not
      be known to histedit. For example, user could've amended one of the commits.
      The fact of this amendment would not be stored in histedit's state file
      and later, when histedit would try to process all the replacements,
      one of the final successors (in histedit's opinion) would turn out to be hidden.
      This behavior is described in issue4800. This commit fixes it.
      eed7d8c0
  16. Feb 10, 2016
    • Martin von Zweigbergk's avatar
      treemanifest: allow setting flag to 't' · f7c5c784
      Martin von Zweigbergk authored
      When using treemanifests, an on-disk manifest entry with the 't' flag
      set means that that entry is a directory and not a file. When read
      into memory, these become instances of the treemanifest class. The 't'
      flag should therefore never be visible to outside of manifest.py, so
      setflag() checks that it is not called with the 't' flag. However, it
      turns out that it will be useful for the narrowhg extension to expose
      the 't' flag to the user (see below), so let's drop the assertion.
      
      The narrowhg extension allows cloning only a given set of files and
      directories. Filelogs and dirlogs that don't match that set will not
      be included in the clone. The extension currently doesn't work with
      treemanifests. I plan on changing it so directories outside the narrow
      clone appear in the manifest. For example, if a directory 'outside/'
      is not part of the narrow clone, it will look like a file 'outside'
      with the 't' flag set. That will make e.g. manifestmerge() just work
      in most cases (and make it well prepared to handle the other
      cases).
      f7c5c784
  17. Feb 24, 2016
  18. Dec 27, 2015
  19. Jan 04, 2016
  20. Dec 27, 2015
    • Yuya Nishihara's avatar
      templatefilters: add "utf8" to get utf-8 bytes from local-encoding text · 8ddf8935
      Yuya Nishihara authored
      This will be applied prior to "|json" filter. This sounds like odd, but it
      is necessary to handle local-encoding text as well as raw filename bytes.
      
      Because filenames are bytes in Mercurial and Unix world, {filename|json} should
      preserve the original byte sequence, which implies
      
        {x|json} -> '"' toutf8b(x) '"'
      
      On the other hand, most template strings are in local encoding. Because
      "|json" filter have to be byte-transparent to filenames, we need something to
      annotate an input as a local string, that's what "|utf8" will do.
      
        {x|utf8|json} -> '"' toutf8b(fromlocal(x)) '"'
      
      "|utf8" is an explicit call, so aborts if input bytes can't be converted to
      UTF-8.
      8ddf8935
    • Yuya Nishihara's avatar
      templatefilters: drop broken "jsonescape" from filters table (BC) · f4418ff2
      Yuya Nishihara authored
      It's been unused, undocumented and flawed in that it expects a unicode input,
      never works correctly if an input has non-ascii character. We should use "json"
      filter instead.
      f4418ff2
  21. Feb 21, 2016
  22. Feb 08, 2016
  23. Feb 11, 2016
    • Martin von Zweigbergk's avatar
      verify: show progress while verifying dirlogs · 53f42c8d
      Martin von Zweigbergk authored
      In repos with treemanifests, the non-root-directory dirlogs often have
      many more total revisions than the root manifest log has. This change
      adds progress out to that part of 'hg verify'. Since the verification
      is recursive along the directory tree, we don't know how many total
      revisions there are at the beginning of the command, so instead we
      report progress in units of directories, much like we report progress
      for verification of files today.
      
      I'm not very happy with passing both 'storefiles' and 'progress' into
      the recursive calls. I tried passing in just a 'visitdir(dir)'
      callback, but the results did not seem better overall. I'm happy to
      update if anyone has better ideas.
      53f42c8d
Loading