Skip to content
Snippets Groups Projects
  1. Mar 02, 2017
    • Durham Goode's avatar
      treemanifest: make node reuse match flat manifest behavior · c134a33b1d73
      Durham Goode authored
      In a flat manifest, a node with the same content but different parents is still
      considered a new node. In the current tree manifests however, if the content is
      the same, we ignore the parents entirely and just reuse the existing node.
      
      In our external treemanifest extension, we want to allow having one treemanifest
      for every flat manifests, as a way of easeing the migration to treemanifests. To
      make this possible, let's change the root node treemanifest behavior to match
      the behavior for flat manifests, so we can have a 1:1 relationship.
      
      While this sounds like a BC breakage, it's not actually a state users can
      normally get in because: A) you can't make empty commits, and B) even if you try
      to make an empty commit (by making a commit then amending it's changes away),
      the higher level commit logic in localrepo.commitctx() forces the commit to use
      the original p1 manifest node if no files were changed. So this would only
      affect extensions and automation that reached passed the normal
      localrepo.commit() logic straight into the manifest logic.
      c134a33b1d73
  2. Mar 10, 2017
    • Augie Fackler's avatar
      2cdb1239ff8c
    • Augie Fackler's avatar
      parsers: drop old nonnormalentries method · b6ab0adf379d
      Augie Fackler authored
      This is okay to do because the Python will fall back transparently if
      the method is missing.
      b6ab0adf379d
    • Augie Fackler's avatar
      parsers: avoid leak of nonnset and otherpset · fffd1abb1337
      Augie Fackler authored
      Py_BuildValue increments the refcount, rather than stealing the
      reference, which I missed in code review.
      fffd1abb1337
    • Gregory Szorc's avatar
      sslutil: issue warning when [hostfingerprint] is used · f819aa9dbbf9
      Gregory Szorc authored
      Mercurial 3.9 added the [hostsecurity] section, which is better
      than [hostfingerprints] in every way.
      
      One of the ways that [hostsecurity] is better is that it supports
      SHA-256 and SHA-512 fingerprints, not just SHA-1 fingerprints.
      
      The world is moving away from SHA-1 because it is borderline
      secure. Mercurial should be part of that movement.
      
      This patch adds a warning when a valid SHA-1 fingerprint from
      the [hostfingerprints] section is being used. The warning informs
      users to switch to [hostsecurity]. It even prints the config
      option they should set. It uses the SHA-256 fingerprint because
      recommending a SHA-1 fingerprint in 2017 would be ill-advised.
      
      The warning will print itself on every connection to a server until
      it is fixed. There is no way to suppress the warning. I admit this
      is annoying. But given the security implications of sticking with
      SHA-1, I think this is justified. If this patch is accepted,
      I'll likely send a follow-up to start warning on SHA-1
      certificates in [hostsecurity] as well. Then sometime down
      the road, we can drop support for SHA-1 fingerprints.
      
      Credit for this idea comes from timeless in issue 5466.
      f819aa9dbbf9
    • Gregory Szorc's avatar
      setup: use setuptools on Windows (issue5400) · 718a57e95a89
      Gregory Szorc authored
      We've had a long, complicated history with setuptools. We want to
      make it the universal default. But when we do, it breaks things.
      
      `python setup.py build` is broken on Windows today. Forcing
      the use of setuptools via FORCE_SETUPTOOLS=1 unbreaks things.
      
      Since the previous bustage with making setuptools the default
      was on !Windows, it seems safe to move ahead with the setuptools
      transition on Windows. So this patch does that.
      718a57e95a89
    • Yuya Nishihara's avatar
      198cd5ad9db8
  3. Mar 09, 2017
  4. Aug 05, 2016
  5. Mar 09, 2017
  6. Aug 05, 2016
    • Pierre-Yves David's avatar
      repofilecache: directly use 'repo.vfs.join' · f84b0e926eb2
      Pierre-Yves David authored
      The 'vfs' attribute already have all methods we need, the value of going
      through the repository for this is low. so we removes it.
      f84b0e926eb2
    • Pierre-Yves David's avatar
      repofilecache: define a 'join' method · b9228a2219ca
      Pierre-Yves David authored
      We are about to turn the 'join' method of the base class Abstract, so we need
      on to be defined in the localrepo. The ultimate goal here is to be able to stop
      relying for the 'localrepo' class to have a 'join' methods (there is above one
      hundred methods on 'localrepo'. This change make te 'repo' file cache have its
      own code so that we can prepare this change to the repostory class.
      
      
      explicite join
      b9228a2219ca
  7. Mar 06, 2017
  8. Jan 24, 2017
  9. Mar 09, 2017
    • Jun Wu's avatar
      localrepo: rename proxycls to filteredrepo · 052bc876a879
      Jun Wu authored
      When debugging in a Python shell, the type of "repo" is "proxycls", which
      could confuse new people.
      
          In [1]: repo
          Out[1]: <mercurial.localrepo.proxycls at 0x7f65d4b976d0>
      
      Let's rename it to "filteredrepo" to make it clearer.
      052bc876a879
    • Durham Goode's avatar
      dirstate: track otherparent files same as nonnormal · 1c97a91a18dc
      Durham Goode authored
      Calling dirstate.setparents() is expensive in a large repo because it iterates
      over every file in the dirstate. It does so to undo any merge state or
      otherparent state files. Merge state files are already covered by
      dirstate._nonnormalset, so we just need to track otherparent files in a similar
      manner to avoid the full iteration here.
      
      Fixing this shaves 20-25% off histedit in large repos.
      
      I tested this by adding temporary debug logic to verify that the old files
      processed in the loop matched the new files processed in the loop and running
      the test suite.
      1c97a91a18dc
  10. Mar 06, 2017
    • Denis Laxalde's avatar
      hgweb: use patch.diffhunks in webutil.diffs to simplify the algorithm · cd29673cebdb
      Denis Laxalde authored
      Function patch.diffhunks yields items for a "block" (i.e. a file) as a whole
      so take advantage of this to simplify the algorithm and avoid parsing diff
      lines to determine whether we're starting a new "block" or not. Thus we drop
      to external block counter and rely on diffhunks iterations instead.
      We also take advantage of the fact that patch.diffhunks() yields *lines* of
      hunks (instead of a string) to avoid building a list that is ''.join-ed into a
      string that is then split.
      
      As lines in 'header' returned by patch.diffhunks() have no trailing new line,
      we need to insert it ourselves to match template expectations.
      cd29673cebdb
    • Denis Laxalde's avatar
  11. Mar 03, 2017
  12. Mar 02, 2017
    • Denis Laxalde's avatar
      mdiff: let _unidiff yield hunks as (<range information>, <hunk lines>) · 5e7fd3a0b17f
      Denis Laxalde authored
      Now _unidiff yields each hunk lines packed into a tuple with the "range
      information" `(s1, l1, s2, l2)` that is used to build the typical hunk header
      '@@ -s1,l1 +s2,l2 @@'.
      This will be used to make it possible to filter diff hunks based on this range
      information.
      
      The new "range information" is ignored in unidiff() (only caller of _unidiff)
      for now.
      5e7fd3a0b17f
  13. Jan 09, 2017
  14. Sep 27, 2016
  15. Mar 08, 2017
  16. Mar 03, 2017
  17. Mar 08, 2017
    • Durham Goode's avatar
      treemanifest: add tests covering hg diff of partial trees · 1871a1ee64ed
      Durham Goode authored
      Previously the hg files tests also covered the logic (i.e.
      treemanifest.matches) that governed how hg diff limited its diff. In a future
      patch we will be switching treemanifest.diff() to have a custom implementation,
      so let's go ahead and add equivalent test coverage for hg diff.
      1871a1ee64ed
    • Durham Goode's avatar
      context: remove uses of manifest.matches · bd884ef2ee46
      Durham Goode authored
      This removes the uses of manifest.matches in context.py in favor of the new
      manifest.diff(match) api. This is part of removing manifest.matches since it is
      O(manifest).
      
      To drop the dependency on ctx._manifestmatches(s) we transfer responsibilty for
      creating status oriented manifests over to ctx._buildstatusmanifest(s). This
      already existed for workingctx, we just need to implement a simple version for
      basectx. The old _manifestmatches functionality is basically identical to the
      _buildstatusmanifest functionality (minus the matching part), so no behavior
      should be lost.
      bd884ef2ee46
    • Durham Goode's avatar
      context: remove assumptions about manifest creation during _buildstatus · aac054e5389b
      Durham Goode authored
      Previously we called self.manifest() in some cases to preload the
      first manifest. This relied on the assumption that the later
      _manifestmatches() call did not duplicate any work the original
      self.manifest() call did. Let's remove that assumption, since it bit
      me during my refactors of this area and is easy to remove.
      aac054e5389b
    • Durham Goode's avatar
      context: move _manifest from committablectx to workingctx · 6a9d0d24fdb4
      Durham Goode authored
      committablectx had a _manifest implementation that was only used by the derived
      workingctx class. The other derived versions, like memctx and metadataonlyctx,
      define their own _manifest functions.
      
      Let's move the function down to workingctx, and let's break it into two parts,
      the _manifest part that reads from self._status, and the part that actually
      builds the new manifest. This separation will let us reuse the builder code in a
      future patch to answer _buildstatus with varying status inputs, since workingctx
      has special behavior for _buildstatus that the other ctx's don't have.
      6a9d0d24fdb4
  18. Mar 07, 2017
    • Durham Goode's avatar
      status: handle more node indicators in buildstatus · c414e339e7af
      Durham Goode authored
      There are several different node markers that indicate different working copy
      states. The context._buildstatus function was only handling one of them, and
      this patch makes it handle all of them (falling back to file content comparisons
      when in one of these states).
      
      This affects a future patch where we get rid of context._manifestmatches as part
      of getting rid of manifest.matches(). context._manifestmatches is currently
      hacky in that it uses the newnodeid for all added and modified files, which is
      why the current newnodeid check is sufficient. When we get rid of this function
      and use the normal manifest.diff function, we start to see the other indicators
      in the nodes, so they need to be handled or else the tests fail.
      c414e339e7af
  19. Mar 08, 2017
    • Durham Goode's avatar
      merge: remove uses of manifest.matches · 11831d755b51
      Durham Goode authored
      This gets rid of the manifest.matches calls in merge.py in favor of the new api.
      This is part of getting rid of manifest.matches since it is O(manifest).
      11831d755b51
  20. Mar 07, 2017
    • Durham Goode's avatar
      copies: remove use of manifest.matches · 5a909a8098a1
      Durham Goode authored
      Convert the existing use of manifest.matches to use the new api. This is part
      of getting rid of manifest.matches, since it is O(manifest).
      5a909a8098a1
    • Durham Goode's avatar
      manifest: add match argument to diff and filesnotin · 959ebff3505a
      Durham Goode authored
      As part of removing manifest.matches (since it is O(manifest)), let's start by
      adding match arguments to diff and filesnotin. As we'll see in later patches,
      these are the only flows that actually use matchers, so by moving the matching
      into the actual functions, other manifest implementations can make more efficient
      algorithsm.
      
      For instance, this will allow treemanifest diff's to only iterate over the files
      that are different AND meet the match criteria.
      
      No consumers are changed in this patches, but the code is fairly easy to verify
      visually. Future patches will convert consumers to use it.
      
      One test was affected because it did not use the kwargs version of the clean
      parameter.
      959ebff3505a
  21. Mar 08, 2017
Loading