This instance will be upgraded to Heptapod 0.21.0rc2 on 2021-04-16 at 14:00 UTC+2 (a few minutes of down time)

  1. 22 Oct, 2020 2 commits
  2. 23 Oct, 2020 2 commits
  3. 23 Mar, 2020 1 commit
    • Kyle Lippincott's avatar
      darwin: use vim, not vi, to avoid data-loss inducing posix behavior · c23877cb25a5
      Kyle Lippincott authored
      Apple's version of vim, available at (for Catalina, but this behavior
      has been there for a while) has several tweaks from the version of vim from Most of these tweaks appear to be for "Unix2003" compatibility.
      One of the tweaks is that if any ex command raises an error, the entire
      process will (when you exit, possibly minutes/hours later) also exit non-zero.
      Ex commands are things like `:foo`.
      Luckily, they only enabled this if vim was executed (via a symlink or copying
      the binary) as `vi` or `ex`. If you start it as `vim`, it doesn't have this
      behavior, so let's do that.
      To see this in action, run the following two commands on macOS:
        $ vi -c ':unknown' -c ':qa' ; echo $?
        $ vim -c ':unknown' -c ':qa' ; echo $?
      We don't want to start ignoring non-zero return types from the editor because
      that will mean you can't use `:cquit` to intentionally exit 1 (which,
      shows up as 2 if you combine an ex command error and a cquit, but only a 1 if
      you just use cquit, so we can't differentiate between the two statuses). Since
      we can't differentiate, we have to assume that all non-zero exit codes are
      intentional and an indication of the user's desire to not continue with whatever
      we're doing. If this was a complicated `hg split` or `hg histedit`, this is
      especially disastrous :(
      Differential Revision:
      branch : stable
  4. 17 Jan, 2020 1 commit
    • Matt Harbison's avatar
      config: add a function to insert non-file based, but overridable settings · e2278581b1c6
      Matt Harbison authored
      This will be used in the next patch.
      Until relatively recently (473510bf0575), there was no official way for
      extensions to inject per-repo config data, so it probably makes sense that
      `ui.setconfig()` items are sticky, and not affected by loading more config
      files.  But that makes it cumbersome if the extension wants to allow the data it
      might add to be overridden by any data in the local hgrc file.  The only thing I
      could get to work was to load the local hgrc first, and then check if the source
      for the config item that should be overridden was *not* the local hgrc file
      name.  But that's brittle because in addition to the file name, the source
      contains the line number, there are the usual '\' vs '/' platform differences,
      Differential Revision:
  5. 30 Dec, 2019 2 commits
    • Matt Harbison's avatar
      ui: add the ability to apply `defaultrc` configs from resources · 1864efbe90d9
      Matt Harbison authored
      We will want the ability to cat out these resources, but the same would apply to
      templates, so I'm going to wait for the dust to settle on that.  Reading the
      default config directly from the filesystem is still in place for now.
      Differential Revision:
    • Matt Harbison's avatar
      ui: refactor `readconfig()` into a form that can consume resources · 5ac0e6f19eb4
      Matt Harbison authored
      The old form can't completely go away, because files outside of packages still
      need to be read.  The name passed in here is a tuple of `package name, resource`
      as needed by the resource API.
      I like the idea of stating the config file is embedded in the executable by
      listing is as `exe!package.resource`.  This would be consistent with how
      `debuginstall` points to the executable for the python executable, lib, and
      installed modules.  While in practice the filesystem path is available from the
      backing ResourceReader when the resource is opened, it is a relative path on py2
      and absolute on py3.  Further, while this would show in the `hg config` output
      for each option if set as such here, it doesn't show in the `reading from...`
      line when `--debug` is used.  The file isn't actually open where that prints, so
      there's no way I see to get that info there.  So I opted for the simple prefix
      to distinguish resources from files.
      Differential Revision:
  6. 28 Dec, 2019 1 commit
  7. 27 Dec, 2019 1 commit
  8. 11 Dec, 2019 2 commits
  9. 14 Dec, 2019 2 commits
  10. 02 Nov, 2019 1 commit
    • Gregory Szorc's avatar
      ui: flush before prompting for input with readline · aaa046919043
      Gregory Szorc authored
      I was using `hg absorb` with Python 3 and noticed that the
      prompt was appearing without any output about what would be
      done. After I answered the prompt, the output was printed
      to stdout.
      This appears to be a buffering difference between Python 2
      and Python 3.
      To work around it, this commit adds an explicit flush() before
      calling the raw input function when readline is used.
      branch : stable
  11. 01 Dec, 2019 1 commit
  12. 12 Sep, 2019 1 commit
  13. 09 Jun, 2020 1 commit
  14. 02 Jul, 2020 1 commit
  15. 18 Jun, 2020 1 commit
  16. 04 Jun, 2020 1 commit
    • Manuel Jacob's avatar
      ui: replace `self._ferr` with identical `dest` · 484e04dc7f42
      Manuel Jacob authored
      Originally, it was part of a larger change that was abandoned. IMHO it makes the
      code slightly cleaner and saves one attribute access, so I decided to send it
      anyway instead of throwing it away.
  17. 08 Nov, 2019 1 commit
    • Augie Fackler's avatar
      cleanup: remove pointless r-prefixes on single-quoted strings · 9f70512ae2cf
      Augie Fackler authored
      This is the promised second step on single-quoted strings. These had
      existed because our source transformer didn't turn r'' into b'', so we
      had tagged some strings as r-strings to get "native" strings on both
      Pythons. Now that the transformer is gone, we can dispense with this
      I ran
          hg locate 'set:added() or modified() or clean()' | egrep '.*\.py$'  | xargs egrep --color=never -n  -- \[\^b\]\[\^a-z\]r\'\[\^\'\\\\\]\*\'\[\^\'\
      in an emacs grep-mode buffer, and then used a keyboard macro to
      iterate over the results and remove the r prefix as needed.
      # skip-blame removing unneeded r prefixes left over from Python 3 migration.
      Differential Revision:
  18. 09 Oct, 2019 1 commit
    • Denis Laxalde's avatar
      py3: decode prompt string before calling rawinput · 57efd5bd2ca2
      Denis Laxalde authored
      Calling input() (aka pycompat.rawinput() on python3) with a byte string
      displays a byte string in the console. E.g. in interactive commit, we
      get: b"examine changes to '<file>'?\n(enter ? for help) [Ynesfdaq?]".
      Similarly, "hg email" prompts are messed up.
      We thus decode the prompt string before running rawinput().
  19. 06 Jul, 2019 1 commit
  20. 28 Jun, 2019 1 commit
  21. 24 Jan, 2019 3 commits
  22. 28 Nov, 2018 1 commit
    • Yuya Nishihara's avatar
      ui: optimize buffered write with no label · ff927ecb12f9
      Yuya Nishihara authored
      This was spotted while making fastannotate faster again after ditching its
      own formatter. Since I'm going to inline _write() into ui.write(), I decided
      to include this patch in this series.
      Here, the cost of '(self.label(a, label) for a in args)' was significant
      in hot loops.
      branch : stable
  23. 05 Nov, 2018 1 commit
  24. 19 Mar, 2020 1 commit
    • Micha Wiedenmann's avatar
      ui: use "procutil.shellsplit" to parse command · b746a22349f9
      Micha Wiedenmann authored
      A commandline containing a space ('"C:\\Program Files\\bar.exe" "..."')
      must not simply split at whitespace, instead quoting has to be taken into
      account. Use "shlex.split()" to parse it instead.
      This can improve the error message if we fail to launch a user
      editor which does not exist. Consider
           editor = "C:\Program Files\editor\editor.exe"
      where the path does not exist. "hg histedit" currently aborts with
      > Abort: edit failed: Program exited with status 1
      here "Program" is not part of the message but the name of the program
      that failed (i.e. `basename("C:\\Program ")`). With this change the message
      instead reads
      > Abort: edit failed: C:\Program Files\editor\editor.exe exited with
      > status 1
      which is also not ideal since infact "cmd.exe" exited with code 1, not
      the editor. But the real error message ("File not found") gets swallowed by
      `procutil` and including the correct path improves the error message
  25. 26 Sep, 2018 2 commits
  26. 08 Jan, 2019 1 commit
  27. 13 Jan, 2019 1 commit
  28. 08 Jan, 2019 1 commit
    • Martin von Zweigbergk's avatar
      progress: write ui.progress() in terms of ui.makeprogress() · 8cf92ca92bfe
      Martin von Zweigbergk authored
      I think ui.makeprogress() should be the preferred interface and we
      should deprecate ui.progress(). All in-core callers already use
      ui.makeprogress(). Moving the logic to the scmutil.progress() will let
      us make further improvements.
      This seems to have sped up `hg perfprogress` from 1.92 s to 1.85 s,
      perhaps because we now skip the indirection of updating the progress
      bar via ui.progress().
      Differential Revision:
  29. 26 Sep, 2018 1 commit
    • Yuya Nishihara's avatar
      chgserver: do not send system() back to client if stdio redirected (issue5992) · 23a00bc90a3c
      Yuya Nishihara authored
      As the chg client doesn't know server-side stdio redirection, the server
      shouldn't upcall on "runsystem" request if the stdio streams are redirected.
      This patch teaches ui to remember the redirection flag, which is updated by
      the caller right now. Future patches (for default) will add ui methods to
      manage this flag internally.
      branch : stable
  30. 31 Jul, 2018 1 commit
    • Gregory Szorc's avatar
      ui: remove commands.status.terse=u from ui.tweakdefaults · fe3ca1e6f786
      Gregory Szorc authored
      commands.status.terse=u can add significant overhead when operating
      on large repositories. Using the Firefox repository:
      HGRCPATH= hg --time status
      time: real 1.340 secs (user 0.960+0.000 sys 0.380+0.000)
      HGRCPATH= hg --time --config commands.status.terse=u status
      time: real 2.420 secs (user 2.070+0.000 sys 0.360+0.000)
      HGRCPATH= hg --time --config extensions.fsmonitor= status
      time: real 0.080 secs (user 0.050+0.010 sys 0.040+0.000)
      HGRCPATH= ~/src/hg/hg --time --config extensions.fsmonitor= --config commands.status.terse=u status
      time: real 2.470 secs (user 2.080+0.000 sys 0.390+0.000)
      The performance regression - especially when fsmonitor is being
      used - is too much to stomach for the 4.7 release. We've decided
      to remove commands.status.terse=u from ui.tweakdefaults until we
      can improve its performance, hopefully in the 4.8 cycle.
      This commit effectively backs out 6acf41bb8d40.
      branch : stable
  31. 07 Oct, 2019 1 commit
    • Gregory Szorc's avatar
      py3: finish porting iteritems() to pycompat and remove source transformer · d783f945a701
      Gregory Szorc authored
      This commit finishes porting .iteritems() to pycompat.iteritems()
      for the mercurial package.
      The translation of .iteritems() to .items() was the last conversion
      performed by the source transformer. With the porting to pycompat
      complete, we no longer have a need for the source transformer. So
      the source transformer has been removed. Good riddance! The code
      base is now compatible with Python 2 and Python 3.
      For the record, as the person who introduced the source transformer,
      it brings me joy to delete it. It accomplished its goal to facilitate
      a port to Python 3 without overly burdening people on some painful
      low-level differences between Python 2 and 3. It is unfortunate we
      still have to wallpaper over many differences with the pycompat
      shim. But it is what it is.
      Differential Revision:
  32. 06 Oct, 2019 1 commit
    • Gregory Szorc's avatar
      py3: define and use pycompat.itervalues() · 74802979dd9d
      Gregory Szorc authored
      .itervalues() only exists on Python 2. Python 3's equivalent is
      .values(). But we don't want to blindly use .values() everywhere
      because on Python 2, it will create a list, which will have performance
      This commit introduces pycompat.itervalues() which will call the appropriate
      method on the passed object. We update all callers of obj.itervalues()
      to pycompat.itervalues(obj) instead.
      With this commit, the only source tranforming remaining is for
      iteritems(). Victory is near...
      Differential Revision: