Skip to content
Snippets Groups Projects
  1. Dec 22, 2017
  2. 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
  3. Dec 16, 2017
  4. Dec 22, 2017
  5. 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
  6. 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
  7. Dec 05, 2017
  8. 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
  9. 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
  10. Dec 21, 2017
  11. Dec 19, 2017
  12. 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
  13. Dec 20, 2017
  14. Dec 21, 2017
  15. Dec 20, 2017
    • Jun Wu's avatar
      commandserver: unblock SIGCHLD · 3a119a42
      Jun Wu authored
      This enables the SIGCHLD handler to work properly if some buggy program
      started chg server with SIGCHLD blocked.
      
      A test of this probably requires C code, but we don't have such kind of
      tests already. Since this is a simple and clear fix, I'm leaving it as
      "untested" but I did a manual test and there were no longer zombie workers.
      
      Differential Revision: https://phab.mercurial-scm.org/D1737
      3a119a42
    • Jun Wu's avatar
      osutil: add a function to unblock signals · 8652ab40
      Jun Wu authored
      Signals could be blocked by something like:
      
        #include <unistd.h>
        #include <signal.h>
        int main(int argc, char * const argv[]) {
          sigset_t set;
          sigfillset(&set);
          sigprocmask(SIG_BLOCK, &set, NULL);
          execv("/bin/hg", argv);
          return 0;
        }
      
      One of the problems is if SIGCHLD is blocked, chgserver would not reap
      zombie workers since it depends on SIGCHLD handler entirely.
      
      While it's the parent process to blame but it seems a good idea to just
      unblock the signal from hg. FWIW git does that for SIGPIPE already [1].
      
      Unfortunately Python 2 does not reset or provide APIs to change signal
      masks. Therefore let's add one in osutil. Note: Python 3.3 introduced
      `signal.pthread_sigmask` which solves the problem.
      
      `sigprocmask` is part of POSIX [2] so there is no feature testing in
      `setup.py`.
      
      [1]: https://github.com/git/git/commit/7559a1be8a0afb10df41d25e4cf4c5285a5faef1
      [2]: http://pubs.opengroup.org/onlinepubs/7908799/xsh/sigprocmask.html
      
      Differential Revision: https://phab.mercurial-scm.org/D1736
      8652ab40
  16. Dec 18, 2017
  17. Dec 19, 2017
    • Yuya Nishihara's avatar
      log: make "slowpath" condition slightly more readable · 5bec509d
      Yuya Nishihara authored
      Before 8e0e334bad42 and 6c76c42a5893, the condition was "anypats() or
      (files() and --removed)". This can be read as "<match is actually slow>
      or <walk files including removed revs>". So "not always()" (i.e. walk
      file revs) seems more appropriate here.
      
      The logic should be unchanged:
      
        not anypats() => always() or isexact() or prefix()
        isexact()     => not always()
        prefix()      => not always()
      5bec509d
  18. Dec 18, 2017
  19. Jun 25, 2017
    • Jun Wu's avatar
      split: new extension to split changesets · 02ea370c
      Jun Wu authored
      This diff introduces an experimental split extension to split changesets.
      
      The implementation is largely inspired by Laurent Charignon's implementation
      for mutable-history (changeset 9603aa1ecdfd54b0d86e262318a72e0a2ffeb6cc [1])
      
      This version contains various improvements:
      
        - Rebase by default.
          This is more friendly for new users. Split won't lead to merge conflicts
          so a rebase won't give the user more trouble.
          This has been on by default at Facebook for months now and seems to be a
          good UX improvement.
          The rebase skips obsoleted or orphaned changesets, which can avoid
          issues like allowdivergence, merge conflicts, etc. This is more flexible
          because the user can decide what to do next (see the last test case in
          test-split.t)
      
        - Remove "Done split? [y/n]" prompt.
          That could be detected by checking `repo.status()` instead.
      
        - Works with obsstore disabled.
          Without obsstore, split uses strip to clean up old nodes, and it can
          even handle split a non-head changeset with "allowunstable" disabled,
          since it runs a rebase to solve the "unstable" issue in a same
          transaction.
      
        - More friendly editor text.
          Put what has been already split into the editor text so users won't lost
          track about where they are.
      
      [1]: https://bitbucket.org/marmoute/mutable-history/commits/9603aa1ecdfd54b
      
      Differential Revision: https://phab.mercurial-scm.org/D1082
      02ea370c
  20. Dec 19, 2017
  21. Dec 18, 2017
  22. Dec 17, 2017
    • Matt Harbison's avatar
      run-tests: use context managers for file descriptors · e3177389
      Matt Harbison authored
      I've seen the following error a few times recently when running the tests with
      `yes | ./run-tests.py --local -j9 -i`:
      
      Errored test-add.t: Traceback (most recent call last):
        File "./run-tests.py", line 821, in run
          self.runTest()
        File "./run-tests.py", line 910, in runTest
          if self._result.addOutputMismatch(self, ret, out, self._refout):
        File "./run-tests.py", line 1774, in addOutputMismatch
          rename(test.errpath, test.path)
        File "./run-tests.py", line 571, in rename
          os.remove(src)
      WindowsError: [Error 32] The process cannot access the file because it is being
       used by another process: 'c:\\Users\\Matt\\projects\\hg\\tests\\test-add.t.err'
      
      This change doesn't fix the problem, but it seems like a simple enough
      improvement.
      e3177389
  23. Dec 13, 2017
    • Matt Harbison's avatar
      run-tests: add substitution patterns for common '\' path output on Windows · 24528dba
      Matt Harbison authored
      The goal is to reduce the amount of hand tuning of new/changed tests that is
      required on Windows.  Since the OS prints the proper paths everywhere else, this
      is limited to Windows.  These are based on the check-code rules that were
      dropped in 5feb782c7a95.
      
      There are some minor tweaks, because those were trying to detect '/' paths
      without a '(glob)' at the end, whereas these detect '\' paths. Also, it looks
      like the 'no changes made to subrepo' one was broke, because the path to the
      subrepo has been getting output but was not in the pattern.  End anchors are
      dropped because '(glob)' is no longer required, but '(feature !)' annotations
      are a possibility.
      
      The 'saved backup bundle' pattern dropped from run-tests.py was simply carrying
      over the first capture group.  The replace() method runs prior to evaluating
      '\1', but it wasn't doing anything because of the 'r' prefix on '\\'.
      
      The 'not recording move' entry is new, because I stumbled upon it searching for
      some of these patterns.  There are probably others.
      24528dba
Loading