Skip to content
Snippets Groups Projects
  1. Jan 02, 2016
  2. Jan 01, 2016
  3. Dec 29, 2015
    • Siddharth Agarwal's avatar
      merge: while checking for unknown files don't follow symlinks (issue5027) · 6a6e78f8
      Siddharth Agarwal authored
      Previously, we were using Python's native 'os.path.isfile' method which follows
      symlinks. In this case, since we're operating on repo contents, we don't want
      to follow symlinks.
      
      There's a behaviour change here, as shown by the second part of the added test.
      Consider a symlink 'f' pointing to a file containing 'abc'. If we try and
      replace it with a file with contents 'abc', previously we would have let it
      though. Now we don't. Although this breaks naive inspection with tools like
      'cat' and 'diff', on balance I believe this is the right change.
      6a6e78f8
  4. Dec 26, 2015
    • Yuya Nishihara's avatar
      push: restore old behavior of default-push (issue5000) · ca8ada49
      Yuya Nishihara authored
      This effectively backs out dceaef70e410 and 10917b062adf.
      
      We can't handle "default-push" just like "default:pushurl" because it is a
      stand-alone named path. Instead, I have two ideas to work around the issue:
      
       a. two defaults: getpath(dest, default=('default-push', 'default'))
       b. virtual path: getpath(dest, default=':default')
      
      (a) is conservative approach and will have less trouble, but callers have
      to specify they need "default-push" or "default". (b) generates hidden
      ":default" path from "default" and "default-push", and callers request
      ":default". This will require some tricks and won't work if there are
      conflicting sub-options valid for both "pull" and "push".
      
      I'll take (a) for default branch. This patch should NOT BE MERGED to default
      except for tests because it would break handling of "pushurl" sub-option.
      ca8ada49
  5. Dec 16, 2015
  6. Dec 15, 2015
  7. Dec 16, 2015
    • Sean Farley's avatar
      crecord: use try/except for import of curses · 7cc65461
      Sean Farley authored
      Not only does this improve fragility with 'if os.name == ...' it will help
      future patches enable the behavior to fallback to use plain record when curses
      is unavailable (e.g. python compiled without curses support).
      7cc65461
  8. Dec 23, 2015
    • Katsunori FUJIWARA's avatar
      mq: use fallback patch name if no alpha-numeric in summary line (issue5025) · 707cdf2c
      Katsunori FUJIWARA authored
      Before this patch, "hg qimport -r REV" fails, if the summary line of
      description of REV doesn't contain any alpha-numeric bytes.
      
      In this case, all bytes in the summary line 'title' are dropped from
      'namebase' by the code path below.
      
           namebase = re.sub('[\s\W_]+', '_', title.lower()).strip('_')
      
      'makepatchname()' immediately returns this empty string as valid patch
      name, because patch name conflicting against empty string never
      exists.
      
      Then, "hg qimport -r REV" is aborted at creation of patch file with
      empty filename.
      
      This situation isn't so rare. For example, ordinary texts in Japanese
      often consist of non alpha-numeric bytes in UTF-8.
      
      This patch makes 'makepatchname()' use fallback patch name if the
      summary line of imported revision doesn't contain any alpha-numeric
      bytes.
      707cdf2c
  9. Dec 19, 2015
  10. Dec 18, 2015
    • Gregory Szorc's avatar
      revlog: seek to end of file before writing (issue4943) · e240e914
      Gregory Szorc authored
      Revlogs were recently refactored to open file handles in "a+" and use a
      persistent file handle for reading and writing. This drastically
      reduced the number of file handles being opened.
      
      Unfortunately, it appears that some versions of Solaris lose the file
      offset when performing a write after the handle has been seeked.
      
      The simplest workaround is to seek to EOF on files opened in a+ mode
      before writing to them, which is what this patch does.
      
      Ideally, this code would exist in the vfs layer. However, this would
      require creating a proxy class for file objects in order to provide a
      custom implementation of write(). This would add overhead. Since
      revlogs are the only files we open in a+ mode, the one-off workaround
      in revlog.py should be sufficient.
      
      This patch appears to have little to no impact on performance on my
      Linux machine.
      e240e914
  11. Nov 30, 2015
  12. Dec 12, 2015
    • Siddharth Agarwal's avatar
      record: don't dereference symlinks while copying over stat data · d9e3ebe5
      Siddharth Agarwal authored
      Previously, we could be calling os.utime or os.chflags (via shutil.copystat) on
      a symlink. These functions dereference symlinks, so this would have caused the
      timestamp of the target to be set. On a read-only or similarly weird
      filesystem, this might cause an exception to be raised.
      
      This is pretty hard to test because conjuring up a read-only filesystem for
      test purposes is non-trivial.
      d9e3ebe5
    • Siddharth Agarwal's avatar
      copyfile: add an optional parameter to copy other stat data · c48ecc0b
      Siddharth Agarwal authored
      Contrary to the comment, I didn't see any evidence that we were copying
      atime/mtime at all. This adds a parameter to copyfile to optionally copy it and
      other stat data, with the default being to not copy it.
      
      Many systems don't support changing the timestamp of a symlink, but we don't
      need that in general anyway -- copystat is mostly useful for editors, most of
      which will dereference symlinks anyway.
      c48ecc0b
  13. Dec 07, 2015
  14. Dec 03, 2015
    • Sietse Brouwer's avatar
      dirstate: don't write repo.currenttransaction to repo.dirstate if repo · 10695f8f
      Sietse Brouwer authored
      is None (issue4983)
      
      Some hooks, such as post-init and post-clone, do not get a repo parameter in
      their environment. If there is no repo, there is no repo.currenttransaction();
      attempting to retrieve it anyway was causing crashes. Now currenttransaction is
      only retrieved and written if the repo is not None.
      10695f8f
  15. Dec 02, 2015
  16. Nov 25, 2015
  17. Dec 01, 2015
  18. Nov 15, 2015
    • liscju's avatar
      rebase: add returning value from pullrebase function · 6979fe2a
      liscju authored
      So far pullrebase function has always returned None value, no matter
      what orig function returned. This behaviour made impossible for
      pull to change returned value from mercurial process (it has always
      ended with 0 value by default). This patch makes pullrebase returning
      with returned value from orig.
      6979fe2a
  19. Nov 13, 2015
  20. Nov 12, 2015
    • Gregory Szorc's avatar
      tags: create new sortdict for performance reasons · 8a256cee
      Gregory Szorc authored
      sortdict internally maintains a list of keys in insertion order. When a
      key is replaced via __setitem__, we .remove() from this list. This
      involves a linear scan and array adjustment. This is an expensive
      operation.
      
      The tags reading code was calling into sortdict.__setitem__ for each tag
      in a read .hgtags revision. For repositories with thousands of tags or
      thousands of .hgtags revisions, the overhead from list.remove()
      noticeable.
      
      This patch creates a new sortdict() so __setitem__ calls don't incur a
      list.remove.
      
      This doesn't appear to have any performance impact on my Firefox
      repository. But that's only because tags reading doesn't show up in
      profiles to begin with. I'm still waiting to hear from a user with over
      10,000 tags and hundreds of heads on the impact of this patch.
      8a256cee
    • Katsunori FUJIWARA's avatar
      share: wrap bmstore._writerepo for transaction sensitivity (issue4940) · a7eecd02
      Katsunori FUJIWARA authored
      46dec89fe888 made 'bmstore.write()' transaction sensitive, to restore
      original bookmarks correctly at failure of a transaction.
      
      For example, shelve and unshelve imply steps below:
      
        before 46dec89fe888:
          1. move active bookmark forward at internal rebasing
          2. 'bmstore.write()' writes updated ones into .hg/bookmarks
          3. rollback transaction to remove internal commits
          4. restore updated bookmarks manually
      
        after 46dec89fe888:
          1. move active bookmark forward at internal rebasing
          2. 'bmstore.write()' doesn't write updated ones into .hg/bookmarks
             (these are written into .hg/bookmarks.pending, if external hook
             is spawn)
          3. rollback transaction to remove internal commits
          4. .hg/bookmarks should be clean, because it isn't changed while
             transaction running: see (2) above
      
      But if shelve or unshelve is executed in the repository created with
      "shared bookmarks" ("hg share -B"), this doesn't work as expected,
      because:
      
        - share extension makes 'bmstore.write()' write updated bookmarks
          into .hg/bookmarks of shared source repository regardless of
          transaction activity, and
      
        - intentional transaction failure at the end of shelve/unshelve
          doesn't restore already updated .hg/bookmarks of shared source
      
      This patch makes share extension wrap 'bmstore._writerepo()' instead
      of 'bmstore.write()', because the former is used to actually write
      bookmark changes out.
      a7eecd02
  21. Nov 10, 2015
  22. Nov 09, 2015
  23. Nov 07, 2015
    • Anton Shestakov's avatar
      dockerlib: allow non-unique uid and gid of $DBUILDUSER (issue4657) · 271a8020
      Anton Shestakov authored
      There are make targets for building mercurial packages for various
      distributions using docker. One of the preparation steps before building is to
      create inside the docker image a user with the same uid/gid as the current user
      on the host system, so that the resulting files have appropriate
      ownership/permissions.
      
      It's possible to run `make docker-<distro>` as a user with uid or gid that is
      already present in a vanilla docker container of that distibution. For example,
      issue4657 is about failing to build fedora packages as a user with uid=999 and
      gid=999 because these ids are already used in fedora, and groupadd fails.
      useradd would fail too, if the flow ever got to it (and there was a user with
      such uid already).
      
      A straightforward (maybe too much) way to fix this is to allow non-unique uid
      and gid for the new user and group that get created inside the image. I'm not
      sure of the implications of this, but marmoute encouraged me to try and send
      this patch for stable.
      271a8020
  24. Nov 09, 2015
    • Mateusz Kwapich's avatar
      dirstate: fix filefoldmap incosistency on file delete · 663eff02
      Mateusz Kwapich authored
      The _filefoldmap is not updated in when files are deleted from dirstate. In the
      case where the file with the same but differently cased name is added afterwards
      it renders _filefoldmap incorrect.  Those steps must occur to for a problem to
      reproduce:
       - call status (with listunknown=True),
       - update working rectory to a commit which does a casefolding change (A -> a)
       - call status again (it will show the file "a" as deleted)
      
      Unfortunately I'm unable to write a test for it because I don't know any
      core-mercurial command able to reproduce those steps.
      
      The bug was originally spotted when hgwatchman was enabled. It caused the
      changeset contents change during hg rebase (one file unrelarted to changeset
      was deleted in it after rebase).
      
      The hgwatchman is able to hit it because when hgignore changes the hgwatchmans
      overridestatus is calling original status with listunknown=True.
      663eff02
    • Steve Borho's avatar
      wix: style-coal.css has been renamed · 29ca5b76
      Steve Borho authored
      29ca5b76
  25. Nov 05, 2015
  26. Nov 06, 2015
    • Matt Mackall's avatar
      posix: retry on symlink race in checklink · c750ed59
      Matt Mackall authored
      Multiple threads might attempt to check links with the same temporary
      name. This would cause one side to get an EEXIST error and wrongly
      fail the support check. Here, we simply retry if our temporary name
      exists.
      c750ed59
    • Pierre-Yves David's avatar
      changegroup: back code change of e7c618cee8df out · c4895f9b
      Pierre-Yves David authored
      The previous changeset is a simpler way of fixing issue4934 without changing the
      spirit of the code. We can remove the dual call to 'delayupdate' but we keep the
      tests to show that the issue is still fixed.
      c4895f9b
Loading