Skip to content
Snippets Groups Projects
  1. Mar 02, 2017
    • Yuya Nishihara's avatar
      share: drop 'relshared' requirement as well · 344121b30f32
      Yuya Nishihara authored
      344121b30f32
    • Yuya Nishihara's avatar
      share: fix typo to drop 'shared' requirement on unshare · ecbd378d9a7e
      Yuya Nishihara authored
      This must be a typo and it seems correct to drop the requirement since the
      repo is no longer a shared repository.
      ecbd378d9a7e
    • Katsunori FUJIWARA's avatar
      similar: compare between actual file contents for exact identity · e1d035905b2e
      Katsunori FUJIWARA authored
      Before this patch, similarity detection logic (for addremove and
      automv) depends entirely on SHA-1 digesting. But this causes incorrect
      rename detection, if:
      
        - removing file A and adding file B occur at same committing, and
        - SHA-1 hash values of file A and B are same
      
      This may prevent security experts from managing sample files for
      SHAttered issue in Mercurial repository, for example.
      
        https://security.googleblog.com/2017/02/announcing-first-sha1-collision.html
        https://shattered.it/
      
      Hash collision itself isn't so serious for core repository
      functionality of Mercurial, described by mpm as below, though.
      
        https://www.mercurial-scm.org/wiki/mpm/SHA1
      
      This patch compares between actual file contents after hash comparison
      for exact identity.
      
      Even after this patch, SHA-1 is still used, because it is reasonable
      enough to quickly detect existence of "(almost) same" file.
      
        - replacing SHA-1 causes decreasing performance, and
        - replacement of it has ambiguity, yet
      
      Getting content of removed file (= rfctx.data()) at each exact
      comparison should be cheap enough, even though getting content of
      added one costs much.
      
        ======= ============== =====================
        file    fctx           data() reads from
        ======= ============== =====================
        removed filectx        in-memory revlog data
        added   workingfilectx storage
        ======= ============== =====================
      e1d035905b2e
  2. Mar 03, 2017
    • Jun Wu's avatar
      localrepo: handle rename with hardlinks properly · dd2364f5180a
      Jun Wu authored
      In "aftertrans", we rename "journal.*" to "undo.*". We expect "journal.*"
      files to disappear after renaming.
      
      However, if "journal.foo" and "undo.foo" refer to a same file (hardlink),
      rename may be a no-op, leaving both files on disk, according to Linux
      manpage [1]:
      
          If oldpath and newpath are existing hard links referring to the same
          file, then rename() does nothing, and returns  a  suc‐ cess status.
      
      The POSIX specification [2] is not very clear about what to do.
      
      To be safe, remove "undo.*" before the rename so "journal.*" cannot be left
      on disk.
      
      [1]: http://man7.org/linux/man-pages/man2/rename.2.html
      [2]: http://pubs.opengroup.org/onlinepubs/9699919799/
      dd2364f5180a
  3. Mar 02, 2017
    • Jun Wu's avatar
      dirstate: avoid unnecessary load+dump during backup · fc57a8b95f1b
      Jun Wu authored
      Previously, dirstate.savebackup unconditionally dumps the dirstate map to
      disk. It may require loading dirstate first to be able to dump it. Those
      operations could be expensive if the dirstate is big, and could be avoided
      if we know the dirstate file is up-to-date.
      
      This patch avoids the read and write if the dirstate is clean. In that case,
      we just do a plain copy without any serialization.
      
      This should make commands which use transactions but do not touch dirstate
      faster. For example, "hg bookmark -r REV NAME".
      fc57a8b95f1b
    • Jun Wu's avatar
      dirstate: try to use hardlink to backup dirstate · 1ef37b16b8e8
      Jun Wu authored
      This should be more efficient once util.copyfile has real hardlink support.
      1ef37b16b8e8
  4. Mar 06, 2017
  5. Mar 03, 2017
  6. Jan 24, 2015
  7. Mar 24, 2015
  8. Jan 24, 2015
    • Yuya Nishihara's avatar
      fileset: add class to host special handling of initial subset · ec5b56b50e19
      Yuya Nishihara authored
      Future patches will add a function to switch mctx.ctx object so that we can
      forcibly evaluate a fileset expression in a specified revision. For example,
      new "revs()" function will be used to match predicate agains another revision
      
        $ hg revert 'set:revs(42, added())'
      
      fullmatchctx class is similar to revset.fullreposet. It will allow us to
      recalculate the subset only if it is not filtered yet.
      ec5b56b50e19
  9. Feb 25, 2017
  10. Jan 18, 2015
  11. Mar 03, 2017
  12. Mar 07, 2017
    • Martin von Zweigbergk's avatar
      update: for "noconflict" updates, print "conflicting changes" on conflict · 7433b3bc55ee
      Martin von Zweigbergk authored
      With experimental.updatecheck=noconflict, if the update is aborted
      because of conlicts, "uncommitted changes" is not quite
      accurate. Let's use "conflicting changes" instead. Also fix the hint
      to recomment --clean, not --merge, since that's what we do for other
      failed updates.
      7433b3bc55ee
    • Martin von Zweigbergk's avatar
      tests: fix test-update-branches to remove non-conflicting file · 842489d18118
      Martin von Zweigbergk authored
      I was clearly very sloppy when I wrote the test case for
      experimental.updatecheck=noconflict. The test case that checks that
      one can move between commits with a removed file was deleting a file
      that was modified between the source and target commits, which
      resulted in a "change/delete" conflict. Since that is a conlict, the
      update correctly failed. Let's fix the test by removing a file that is
      not modified between the two commits.
      842489d18118
  13. Feb 25, 2017
Loading