Skip to content
Snippets Groups Projects
  1. Dec 27, 2017
    • Gregory Szorc's avatar
      smartset: split generatorset classes to avoid cycle · 12a46ad6
      Gregory Szorc authored
      I uncovered a cycle manifesting in a memory leak by running
      `hgperfrevset '::tip'`. The cycle was due to generatorset.__init__
      assigning a bound method to self.__contains__. Internet sleuthing
      revealed that assigning a bound method to an instance attribute
      always creates a cycle.
      
      This commit creates two new variants of generatorset for the special
      cases of ascending and descending generators. The special
      implementations of __contains__ have been extracted to these classes
      where they are defined as __contains__.
      
      generatorset now implements __new__ and changes the spawned type to
      one of the new classes if needed.
      
      Differential Revision: https://phab.mercurial-scm.org/D1780
      12a46ad6
    • Phil Cohen's avatar
      merge: raise before running mergedriver if using IMM · 87918218
      Phil Cohen authored
      Merge driver scripts run in the working copy, so disable with IMM for now.
      
      Differential Revision: https://phab.mercurial-scm.org/D1781
      87918218
  2. Dec 26, 2017
  3. Dec 25, 2017
  4. Dec 19, 2017
    • Pulkit Goyal's avatar
      commands: use the new API to access hidden changesets in various commands · b378a3d8
      Pulkit Goyal authored
      In previous patches, we have added an internal API to unhide hidden changesets.
      This patch makes the following command use that api in nowarn mode i.e. there
      will be no warning while accessing hidden changesets.
      
      cat, diff, export, files, heads, identify, log, manifest, parents, status
      
      This patch also adds test demonstarting the behaviour.
      
      .. feature:: Accessing hidden changesets
      
          Set config option 'experimental.directaccess = True' to access hidden
          changesets from read only commands.
      
      Differential Revision: https://phab.mercurial-scm.org/D1735
      b378a3d8
  5. Dec 14, 2017
    • Pulkit Goyal's avatar
      scmutil: add utility fn to return repo object with user passed revs unhidden · 8bb90cc4
      Pulkit Goyal authored
      There has been a need for accessing hidden changesets by default without passing
      --hidden. This is currently done using the directaccess extension but is bit
      hacky.
      
      This patch adds a utility function to return a repo object having user passed
      revisions unhidden. This functionality will live behind a
      config option and won't be the default behaviour. There is also a config option
      added by this patch which tells whether we want to unhide only those revisions
      whose hashes are passed or should we consider revisions numbers also.
      
      Differential Revision: https://phab.mercurial-scm.org/D1733
      8bb90cc4
  6. Dec 18, 2017
  7. Dec 14, 2017
  8. Dec 22, 2017
  9. Dec 24, 2017
  10. Dec 22, 2017
  11. Dec 23, 2017
    • Gregory Szorc's avatar
      run-tests: extract sorting of tests to own function · 212a6e9a
      Gregory Szorc authored
      TestRunner._run() is a large function and is difficult to follow.
      Let's extract the test sorting to its own function to make it shorter.
      
      When I refactored run-tests.py several years ago, I put a lot of
      functionality in methods. The prevailing Mercurial style is to use
      functions - not classes - where possible. While refactoring the code,
      I decided to undo this historical mistake of mine by moving the code
      to a standalone function.
      
      Differential Revision: https://phab.mercurial-scm.org/D1750
      212a6e9a
  12. Dec 22, 2017
  13. Nov 21, 2017
    • Anton Shestakov's avatar
      hgweb: display fate of obsolete changesets · 1721ce06
      Anton Shestakov authored
      Operations that obsolete changesets store enough metadata to explain what
      happened after the fact. One way to get that metadata is showsuccsandmarkers
      function, which returns a list of successors of a particular changeset and
      appropriate obsolescence markers.
      
      Templates have a set of experimental functions that have names starting with
      obsfate. This patch uses some of these functions to interpret output of
      succsandmarkers() and produce human-friendly messages that describe what
      happened to an obsolete changeset, e.g. "pruned" or "rewritten as
      6:3de5eca88c00".
      
      In commonentry(), succsandmarkers property is made callable so it's only
      executed on demand; this saves time when changeset is not obsolete, and also in
      e.g. /shortlog view, where there are a lot of changesets, but we don't need to
      show each and every one in detail.
      
      In spartan theme, succsandmarkers is used instead of the simple "obsolete:
      yes", in other themes a new line is added to /rev page.
      1721ce06
  14. Dec 16, 2017
  15. Dec 22, 2017
  16. Dec 21, 2017
    • Matt Harbison's avatar
      lfs: only hardlink between the usercache and local store if the blob verifies · bb6a80fc
      Matt Harbison authored
      This fixes the issue where verify (and other read commands) would propagate
      corrupt blobs.  I originalled coded this to only hardlink if 'verify=True' for
      store.read(), but then good blobs weren't being linked, and this broke a bunch
      of tests.  (The blob in repo5 that is being corrupted seems to be linked into
      repo5 in the loop running dumpflog.py prior to it being corrupted, but only if
      verify=False is handled too.)  It's probably better to do a one time extra
      verification in order to create these files, so that the repo can be copied to a
      removable drive.
      
      Adding the same check to store.write() was only for completeness, but also needs
      to do a one time extra verification to avoid breaking tests.
      bb6a80fc
  17. Nov 17, 2017
    • Matt Harbison's avatar
      lfs: verify lfs object content when transferring to and from the remote store · 417e8e04
      Matt Harbison authored
      This avoids inserting corrupt files into the usercache, and local and remote
      stores.  One down side is that the bad file won't be available locally for
      forensic purposes after a remote download.  I'm thinking about adding an
      'incoming' directory to the local lfs store to handle the download, and then
      move it to the 'objects' directory after it passes verification.  That would
      have the additional benefit of not concatenating each transfer chunk in memory
      until the full file is transferred.
      
      Verification isn't needed when the data is passed back through the revlog
      interface or when the oid was just calculated, but otherwise it is on by
      default.  The additional overhead should be well worth avoiding problems with
      file based remote stores, or buggy lfs servers.
      
      Having two different verify functions is a little sad, but the full data of the
      blob is mostly passed around in memory, because that's what the revlog interface
      wants.  The upload function, however, chunks up the data.  It would be ideal if
      that was how the content is always handled, but that's probably a huge project.
      
      I don't really like printing the long hash, but `hg debugdata` isn't a public
      interface, and is the only way to get it.  The filelog and revision info is
      nowhere near this area, so recommending `hg verify` is the easiest thing to do.
      417e8e04
  18. Dec 05, 2017
  19. Nov 17, 2017
    • Matt Harbison's avatar
      test-lfs: add tests around corrupted lfs objects · 16660fd4
      Matt Harbison authored
      These are mostly tests against file:// based remote stores, because that's what
      we have the most control over.
      
      The test uploading a corrupt blob to lfs-test-server demonstrates an overly
      broad exception handler in the retry loop.  A corrupt blob is actually
      transferred in a download, but eventually caught when it is accessed (only after
      it leaves the corrupt file in a couple places locally).  I don't think we want
      to trust random 3rd party implementations, and this would be a problem if there
      were a `debuglfsdownload` command that simply cached the files.  And given the
      cryptic errors, we should probably validate the file hash locally before
      uploading, and also after downloading.
      16660fd4
  20. Dec 19, 2017
    • Matt Harbison's avatar
      lfs: add note messages indicating what store holds the lfs blob · 02f54a1e
      Matt Harbison authored
      The following corruption related patches were written prior to adding the user
      level cache, and it took awhile to track down why the tests changed.  (It
      generally made things more resilient.)  But I think this will be useful to the
      end user as well.  I didn't make it --debug level, because there can be a ton of
      info coming out of clone/push/pull --debug.  The pointers are sorted for test
      stability.
      
      I opted for ui.note() instead of checking ui.verbose and then using ui.write()
      for convenience, but I see most of this extension does the latter.  I have no
      idea what the preferred form is.
      02f54a1e
  21. Dec 21, 2017
  22. Dec 19, 2017
  23. Dec 21, 2017
    • Anton Shestakov's avatar
      paper: minor adjustments to table styles · 6915f6a4
      Anton Shestakov authored
      Adding a bit of padding to table columns on e.g. /log means content and headers
      are better aligned: headers already have this padding.
      
      Right margin is removed from #changesetEntry th because elements with display:
      table-cell (such as <th>) ignore margins anyway.
      6915f6a4
  24. Dec 20, 2017
  25. Dec 21, 2017
Loading