Skip to content
Snippets Groups Projects
  1. Dec 01, 2020
  2. Dec 14, 2020
  3. Dec 03, 2020
  4. Dec 11, 2020
  5. Dec 09, 2020
    • Martin von Zweigbergk's avatar
      mergetools: add new conflict marker format with diffs in · bdc2bf68f19e
      Martin von Zweigbergk authored
      I use 3-way conflict markers. Often when I resolve them, I manually
      compare one the base with one side and apply the differences to the
      other side. That can be hard when the conflict marker is large. This
      patch introduces a new type of conflict marker, which I'm hoping will
      make it easier to resolve conflicts.
      
      The new format uses `<<<<<<<` and `>>>>>>>` to open and close the
      markers, just like our existing 2-way and 3-way conflict
      markers. Instead of having 2 or 3 snapshots (left+right or
      left+base+right), it has a sequence of diffs. A diff looks like this:
      
      ```
      ------- base
      +++++++ left
       a
      -b
      +c
       d
      ```
      
      A diff that adds one side ("diff from nothing") has a `=======` header
      instead and does not have have `+` prefixed on its lines. A regular
      3-way merge can be viewed as adding one side plus a diff between the
      base and the other side. It thus has two ways of being represented,
      depending on which side is being diffed:
      
      ```
      <<<<<<<
      ======= left
      contents
      on
      left
      ------- base
      +++++++ right
       contents
       on
      -left
      +right
      >>>>>>>
      ```
      or
      ```
      <<<<<<<
      ------- base
      +++++++ left
       contents
       on
      -right
      +left
      ======= right
      contents
      on
      right
      >>>>>>>
      ```
      
      I've made it so the new merge tool tries to pick a version that has
      the most common lines (no difference in the example above).
      
      
      I've called the new tool "mergediff" to stick to the convention of
      starting with "merge" if the tool tries a regular 3-way merge.
      
      The idea came from my pet VCS (placeholder name `jj`), which has
      support for octopus merges and other ways of ending up with merges of
      more than 3 versions. I wanted to be able to represent such conflicts
      in the working copy and therefore thought of this format (although I
      have not yet implemented it in my VCS). I then attended a meeting with
      Larry McVoy, who said BitKeeper has an option (`bk smerge -g`) for
      showing a similar format, which reminded me to actually attempt this
      in Mercurial.
      
      Differential Revision: https://phab.mercurial-scm.org/D9551
      bdc2bf68f19e
  6. Dec 10, 2020
  7. Dec 09, 2020
  8. Dec 08, 2020
    • Matt Harbison's avatar
      hghave: update the check for virtualenv · 1b5e0d0bdb05
      Matt Harbison authored
      This started as `hghave --test-features` failing on Windows in `test-hghave.t`.
      IDK how this worked, as neither my Linux nor Windows machines have the old
      attribute with virtualenv 20.2.2, even on py2.  I think this was noticed
      recently because 357d8415aa27 mentioned an AttributeError, and mitigated by
      making this py2 only.  But as mentioned, this is also a problem on py2 (where
      the failure was observed).
      
      When I got this working by removing the attribute reference, the command in the
      test failed because the `--no-site-package` argument was removed some time ago.
      Therefore, this backs out 357d8415aa27 and references a known good attribute
      (which was done to suppress the warning about an unused import) that also
      ensures the command does not need the argument.  Since there appears to be
      (minor) broken stuff on py3, manually apply the `no-py3` guard that was backed
      out of the check itself.
      
      Differential Revision: https://phab.mercurial-scm.org/D9547
      1b5e0d0bdb05
  9. Dec 05, 2020
  10. Dec 03, 2020
    • Kyle Lippincott's avatar
      treemanifest: stop storing full path for each item in manifest._lazydirs · 93e09d370003
      Kyle Lippincott authored
      This information is obtainable, if needed, based on the lazydirs key (which is
      the entry name) and the manifest's `dir()` method.
      
      ### Performance
      
      This is actually both a memory and a performance improvement, but it's likely to
      be a very small one in most situations. In the pathological repo I've been using
      for testing other performance work I've done recently, this reduced the time for
      a rebase operation (rebasing two commits across a public-phase change that
      touches a sibling of one of my tracked directories where the common parent is
      massive (>>10k entries)):
      
      #### Before
      
      ```
        Time (mean ± σ):      4.059 s ±  0.121 s    [User: 0.9 ms, System: 0.6 ms]
        Range (min … max):    3.941 s …  4.352 s    10 runs
      ```
      
      #### After
      
      ```
        Time (mean ± σ):      3.707 s ±  0.060 s    [User: 0.8 ms, System: 0.8 ms]
        Range (min … max):    3.648 s …  3.818 s    10 runs
      ```
      
      Differential Revision: https://phab.mercurial-scm.org/D9553
      93e09d370003
  11. Dec 08, 2020
    • Matt Harbison's avatar
      extensions: avoid including `__index__` in the disabled extension list · 1ced08423d59
      Matt Harbison authored
      This generated module contains a dictionary of all bundled extension names and
      their help for builds that cannot enumerate extensions in the filesystem.
      
      The disabled list gets displayed in `hg help extensions`, and is also used by
      `setup.py` to populate `__index__.py` when building.  I haven't seen it sneak
      into either py2exe or PyOxidizer builds, but it does show up when running tests
      locally after having created an installer.
      
      Differential Revision: https://phab.mercurial-scm.org/D9544
      1ced08423d59
  12. Dec 09, 2020
    • Matt Harbison's avatar
      windows: continue looking at `%HOME%` for user config files with py3.8+ · 224af78021de
      Matt Harbison authored
      The `%HOME%` variable is explicitly called out in `hg help config` as a location
      that is consulted when reading user files, but python stopped looking at it
      when expanding '~' in py3.8+.[1]  Restore that old functionality by copying in
      the old implementation (and simplifying it to just use bytes).  It could be
      simplfied further, since only '~' is passed, but I'm not sure yet if we need to
      make this a generic utility function on Windows.  There are other uses of
      `os.path.expanduser()`, but this is the only case I know of that documents
      `%HOME%` usage.
      
      (The reason for removing it was that it typically isn't set, but it actually is
      set in MSYS and PowerShell, and `%HOME%` and `%USERPROFILE%` are different in
      MSYS.  I could be convinced to just replace all uses with this as a general
      utility, so we don't have to think too hard about BC.)
      
      [1] https://bugs.python.org/issue36264
      
      Differential Revision: https://phab.mercurial-scm.org/D9559
      224af78021de
    • Matt Harbison's avatar
      run-tests: configure the environment to expand `~` properly with Windows py38+ · 08fd76a553c9
      Matt Harbison authored
      This was causing tests to point to the actual home path on the system, not the
      test defined one.
      
      Differential Revision: https://phab.mercurial-scm.org/D9558
      08fd76a553c9
    • Matt Harbison's avatar
      run-tests: fix `HGTESTEXTRAEXTENSIONS` with py3 · af3a6900f893
      Matt Harbison authored
      Since `extensions` was a str and `section` bytes, it never populated anything.
      If it had, it would have put bytes into the environment dictionary that is all
      str.  As everything starts and ends as str, remove the incomplete attempt at
      byteification.  It doesn't appear that we had any test coverage of this bit of
      code, so also add a non-extension config to make sure it is filtered out
      properly.
      
      Differential Revision: https://phab.mercurial-scm.org/D9557
      af3a6900f893
  13. Dec 04, 2020
  14. Dec 07, 2020
    • Simon Sapin's avatar
      persistent-nodemap: properly ignore non-existent `.nd` data file · 8ff2d8359d0f
      Simon Sapin authored
      This code was meant to handle the case of a nodemap docket file
      pointing to a nodemap data file that doesn’t exist (anymore),
      but most likely caused an `UnboundLocalError` exception instead
      when `data` was used on the next line without being defined.
      
      This case is theoretically possible with a race condition
      between two hg processes, but is hard to reproduce or test:
      
      * Process A reads a docket file and finds a UID in it
        that points to a given data file name.
      * Process B decides that this same data file needs compacting.
        It writes a new one with a different UID,
        overwrites the docket file,
        then removes the old data file.
      * Only then process A tries to a open a file that doesn’t exist anymore.
      
      Differential Revision: https://phab.mercurial-scm.org/D9533
      8ff2d8359d0f
  15. Dec 10, 2020
  16. Dec 03, 2020
  17. Dec 02, 2020
    • Pulkit Goyal's avatar
      tests: conditionalize output in test-ssh.t with chg+py3 · e0866c047e64
      Pulkit Goyal authored
      Because of our wrapping around sys.std* and python3 internal buffering, the
      output order changes. The change in order seems like harmless because just few
      lines above the same command is run which results in same output.
      
      This makes `test-ssh.t` works with --chg on python 3.
      
      Differential Revision: https://phab.mercurial-scm.org/D9502
      e0866c047e64
    • Pulkit Goyal's avatar
      dispatch: disable line ending normalization on sys.stdin if its None · 7e1b4154cdca
      Pulkit Goyal authored
      Fixes test-chg.t on python 3 with chg.
      
      Differential Revision: https://phab.mercurial-scm.org/D9501
      7e1b4154cdca
    • Pulkit Goyal's avatar
      procutils: don't try to get `.buffer` if sys.stdin is None · 81c1f5d1801f
      Pulkit Goyal authored
      While hunting down following test failure of test-chg.t on Python 3, I stumbled
      the case when `.buffer` is not available as sys.stdin is None.
      
      	--- /home/pulkit/repo/hg-committed/tests/test-chg.t
      	+++ /home/pulkit/repo/hg-committed/tests/test-chg.t.err
      	@@ -203,7 +203,31 @@
      	   $ CHGDEBUG=1 chg version -q 0<&-
      		 chg: debug: * stdio fds are missing (glob)
      	     chg: debug: * execute original hg (glob)
      		 -  Mercurial Distributed SCM * (glob)
      		 +  Traceback (most recent call last):
      		 +    File "/tmp/hgtests.avspvsq4/install/bin/hg", line 43, in <module>
      		 +      dispatch.run()
      		 +    File "/usr/lib/python3.6/importlib/util.py", line 233, in
      		 __getattribute__
      		 +      self.__spec__.loader.exec_module(self)
      		 +    File "<frozen importlib._bootstrap_external>", line 678, in
      		 exec_module
      		 +    File "<frozen importlib._bootstrap>", line 219, in
      		 _call_with_frames_removed
      		 +    File
      		 "/tmp/hgtests.avspvsq4/install/lib/python/mercurial/dispatch.py", line
      		 726, in <module>
      		 +      class lazyaliasentry(object):
      		 +    File
      		 "/tmp/hgtests.avspvsq4/install/lib/python/mercurial/dispatch.py", line
      		 737, in lazyaliasentry
      		 +      @util.propertycache
      		 +    File "/usr/lib/python3.6/importlib/util.py", line 233, in
      		 __getattribute__
      		 +      self.__spec__.loader.exec_module(self)
      		 +    File "<frozen importlib._bootstrap_external>", line 678, in
      		 exec_module
      		 +    File "<frozen importlib._bootstrap>", line 219, in
      		 _call_with_frames_removed
      		 +    File "/tmp/hgtests.avspvsq4/install/lib/python/mercurial/util.py",
      		 line 3473, in <module>
      		 +      f=procutil.stderr,
      		 +    File "/usr/lib/python3.6/importlib/util.py", line 233, in
      		 __getattribute__
      		 +      self.__spec__.loader.exec_module(self)
      		 +    File "<frozen importlib._bootstrap_external>", line 678, in
      		 exec_module
      		 +    File "<frozen importlib._bootstrap>", line 219, in
      		 _call_with_frames_removed
      		 +    File
      		 "/tmp/hgtests.avspvsq4/install/lib/python/mercurial/utils/procutil.py",
      		 line 127, in <module>
      		 +      stdin = sys.stdin.buffer
      		 +  AttributeError: 'NoneType' object has no attribute 'buffer'
      		 +  [1]
      
      		  server lifecycle
      		   ----------------
      
      Differential Revision: https://phab.mercurial-scm.org/D9500
      81c1f5d1801f
  18. Dec 09, 2020
    • Martin von Zweigbergk's avatar
      share: remove unexpected heading from "verbose" container in help test · c80f9e3daec3
      Martin von Zweigbergk authored
      `test-gendoc-*.t` have been failing for me since 91425656e2b1 (share:
      add documentation about share-safe mode in `hg help -e share`,
      2020-11-27) with this kind of output:
      
      ```
          --- /usr/local/google/home/martinvonz/hg/tests/test-gendoc-ru.t
          +++ /usr/local/google/home/martinvonz/hg/tests/test-gendoc-ru.t.err
          @@ -2,3 +2,9 @@
      
             $ $TESTDIR/check-gendoc ru
             checking for parse errors
          +  gendoc.txt:12818: (SEVERE/4) Unexpected section title.
          +
          +  Sharing requirements and configs of source repository with shares
          +  -----------------------------------------------------------------
          +  Exiting due to level-4 (SEVERE) system message.
          +  [1]
      ```
      
      This patch fixes that.
      
      Differential Revision: https://phab.mercurial-scm.org/D9552
      c80f9e3daec3
  19. Dec 08, 2020
  20. Dec 06, 2020
  21. Dec 08, 2020
Loading