Skip to content
Snippets Groups Projects
  1. Apr 24, 2015
    • Katsunori FUJIWARA's avatar
      revert: apply normallookup on reverted file if size isn't changed (issue4583) · 21b33f04
      Katsunori FUJIWARA authored
      Before this patch, reverting a file to the revision other than the
      parent doesn't update dirstate. This seems to expect that timestamp
      and/or size will be changed by reverting.
      
      But if (1) dirstate of file "f" is filled with timestamp before
      reverting and (2) size and timestamp of file "f" isn't changed at
      reverting, file "f" is recognized as CLEAN unexpectedly.
      
      This patch applies "dirstate.normallookup()" on reverted file, if size
      isn't changed.
      
      Making "localrepository.wwrite()" return length of written data is
      needed to avoid additional (and redundant) "lstat(2)" on the reverted
      file. "filectx.size()" can't be used to know it, because data may be
      decoded at being written out.
      
      BTW, interactive reverting may cause similar problem, too. But this
      patch doesn't focus on fixing it, because (1) interactive (maybe slow)
      reverting changes one (or both) of size/timestamp of reverted files in
      many usecases, and (2) changes to fix it seems not suitable for stable
      branch.
      21b33f04
  2. Apr 23, 2015
  3. Apr 22, 2015
    • Martin von Zweigbergk's avatar
      revert: accept just -I/-X without paths or -a/-i (issue4592) · 45bd336e
      Martin von Zweigbergk authored
      'hg revert -I foo' currently fails with
      
        abort: no files or directories specified
        (use --all to revert all files, or 'hg update 1' to update)
      
      It doesn't seem intentional that -I/-X without other paths or
      --all/--interactive should fail, and it doesn't seem that harmful to
      allow it either, so let's just do that.
      45bd336e
  4. Apr 21, 2015
    • Laurent Charignon's avatar
      record: change wording for record curses interface · a5e3634b
      Laurent Charignon authored
      We are using record and crecord in different context, not just for commiting
      changes but also reverting and shelving changes. This diff changes the wording
      from commiting to confirming changes to avoid confusing the users with what
      they are doing.
      a5e3634b
  5. Apr 23, 2015
    • Yuya Nishihara's avatar
      wix: remove cacert.pem from Windows distribution · 6e38b6fc
      Yuya Nishihara authored
      It should not be included in the Windows installers because it prevents
      loading CA certificates from the system store on Python 2.7.9, implemented
      by 760a86865f80. The msi packages bundles Python 2.7.9, so cacert.pem is no
      longer necessary.
      
      Backed out changeset e5c2338d76b5
      6e38b6fc
    • Katsunori FUJIWARA's avatar
      tests: use double quote to quote arguments in hook for portability · b2c1ff96
      Katsunori FUJIWARA authored
      On windows, single quote doesn't work as quote character in hook
      command line, because "cmd.exe" doesn't recognize it as quoting
      character. And this causes failure of test.
      
      This patch uses double quote to quote arguments in hook instead of
      single quote for portability.
      
      Even though single quotes for "[hooks] pretxncommit" in
      test-clone-pull-corruption.t seems to work correctly (may MinGW sh
      treat specially ?) AFAIK, this patch also replaces them by double
      quotes for consistency.
      b2c1ff96
  6. Apr 22, 2015
    • Laurent Charignon's avatar
      record: fix record with change on moved file crashes (issue4619) · edf907bd
      Laurent Charignon authored
      reverting 79fceed67676, add a test to prevent the issue from coming back.
      edf907bd
    • Katsunori FUJIWARA's avatar
      check-code: check os.path.join(*, '') not working correctly with Python 2.7.9 · 1f9127c9
      Katsunori FUJIWARA authored
      Since Python 2.7.9, "os.path.join(path, '')" doesn't append "os.sep"
      for UNC path (see issue4557 for detail).
      1f9127c9
    • Katsunori FUJIWARA's avatar
      unionrepo: use pathutil.normasprefix to ensure os.sep at the end of cwd · e4f75c93
      Katsunori FUJIWARA authored
      Since Python 2.7.9, "os.path.join(path, '')" doesn't add "os.sep" at
      the end of UNC path (see issue4557 for detail).
      
      This makes unionrepo incorrectly work, if:
      
        1. cwd is the root of UNC share (e.g. "\host\share"), and
        2. mainreporoot is near cwd (e.g. "\host\sharefoo\repo")
           - host of UNC path is same as one of cwd
           - share of UNC path starts with one of cwd
        3. "repopath" isn't specified in URI (e.g. "union:path/to/repo2")
      
      For example:
      
        $ hg --cwd \host\share -R \host\sharefoo\repo incoming union:path\to\repo2
      
      In this case:
      
        - os.path.join(r"\host\share", "") returns r"\host\share",
        - r"\host\sharefoo\repo".startswith(r"\host\share") returns True, then
        - r"foo\repo" is treated as repopath of unionrepo instead of
          r"\host\sharefoo\repo"
      
      This causes failure of combining "\host\sharefoo\repo" and another
      repository: in addition to it, "\host\share\foo\repo" may be combined
      with another repository, if it accidentally exists.
      
      This patch uses "pathutil.normasprefix()" to ensure "os.sep" at the
      end of cwd safely, even with some problematic encodings, which use
      0x5c (= "os.sep" on Windows) as the tail byte of some multi-byte
      characters.
      
      BTW, normalization before "pathutil.normasprefix()" isn't needed in
      this case, because "os.getcwd()" always returns normalized one.
      e4f75c93
    • Katsunori FUJIWARA's avatar
      bundlerepo: use pathutil.normasprefix to ensure os.sep at the end of cwd · 6e31e127
      Katsunori FUJIWARA authored
      Since Python 2.7.9, "os.path.join(path, '')" doesn't add "os.sep" at
      the end of UNC path (see issue4557 for detail).
      
      This makes bundlerepo incorrectly work, if:
      
        1. cwd is the root of UNC share (e.g. "\host\share"), and
        2. mainreporoot is near cwd (e.g. "\host\sharefoo\repo")
           - host of UNC path is same as one of cwd
           - share of UNC path starts with one of cwd
        3. "repopath" isn't specified in bundle URI
           (e.g. "bundle:bundlefile" or just "bundlefile")
      
      For example:
      
        $ hg --cwd \host\share -R \host\sharefoo\repo incoming bundle
      
      In this case:
      
        - os.path.join(r"\host\share", "") returns r"\host\share",
        - r"\host\sharefoo\repo".startswith(r"\host\share") returns True, then
        - r"foo\repo" is treated as repopath of bundlerepo instead of
          r"\host\sharefoo\repo"
      
      This causes failure of combining "\host\sharefoo\repo" and bundle
      file: in addition to it, "\host\share\foo\repo" may be combined with
      bundle file, if it accidentally exists.
      
      This patch uses "pathutil.normasprefix()" to ensure "os.sep" at the
      end of cwd safely, even with some problematic encodings, which use
      0x5c (= "os.sep" on Windows) as the tail byte of some multi-byte
      characters.
      
      BTW, normalization before "pathutil.normasprefix()" isn't needed in
      this case, because "os.getcwd()" always returns normalized one.
      6e31e127
    • Katsunori FUJIWARA's avatar
      dirstate: use pathutil.normasprefix to ensure os.sep at the end of root · cb981009
      Katsunori FUJIWARA authored
      3cc630be5f09 replaced "os.path.join(root, '')" by
      "root.endswith(os.sep)" examination, because Python 2.7.9 changes
      behavior of "os.path.join(path, '')" on UNC path.
      
      But some problematic encodings use 0x5c (= "os.sep" on Windows) as the
      tail byte of some multi-byte characters, and replacement above
      prevents Mercurial from working on the repository, of which root path
      ends with such multi-byte character, regardless of enabling win32mbcs.
      
      This patch uses "pathutil.normasprefix()" instead of
      "root.endswith(os.sep)" examination, to ensure "os.sep" at the end of
      "dirstate._rootdir" even with problematic encodings.
      
      "root" of dirstate can be passed to "pathutil.normasprefix()" without
      normalization, because it is always given from "repo.root" =
      "repo.wvfs.base", which is normalized by "os.path.realpath()".
      
      Using "util.endswithsep()" instead of "str.endswith(os.sep)" also
      fixes this problem, but this patch chooses "pathutil.normasprefix()"
      to centralize "adding os.sep if endswith(os.sep)" logic into it.
      cb981009
    • Wagner Bruna's avatar
      5947a68f
    • Wagner Bruna's avatar
      histedit: fix typo in abort message · 2bb0e6cc
      Wagner Bruna authored
      2bb0e6cc
    • Wagner Bruna's avatar
  7. Apr 21, 2015
  8. Apr 20, 2015
  9. Apr 18, 2015
  10. Apr 19, 2015
  11. Apr 18, 2015
    • Matt Harbison's avatar
      largefiles: don't mangle filesets when fixing up the log matcher · 2553ef73
      Matt Harbison authored
      The fileset-generated.t test previously failed with this:
      
        +  hg: parse error: unknown identifier: .hglf/modified
        +  (did you mean 'modified'?)
        +  [255]
      
      Filesets will find the standins on their own, without any help.  While that's
      useful for some things like modified(), clean(), etc., it is wrong for things
      like size().  Proper fileset support for largefiles is not trivial, but this was
      failing with just the extension enabled on a normal repo.
      2553ef73
    • Matt Harbison's avatar
      largefiles: don't crash when cloning to a remote repo · e4e69ceb
      Matt Harbison authored
      The immediate crash was when checking for requirements immediately after this,
      but lfcommands.downloadlfiles() will also crash if --all-largefiles is
      specified.  That has been in place since atleast 5884812686f7 (2.3-rc) without
      anyone noticing.
      
      I can't tell from the peer classes if there's a way to make the custom largefile
      functionality work in this case, but atleast it doesn't crash.
      e4e69ceb
  12. Apr 17, 2015
Loading