Skip to content
Snippets Groups Projects
  1. Oct 12, 2020
  2. Oct 22, 2020
  3. Nov 12, 2020
  4. Nov 11, 2020
  5. Nov 06, 2020
    • Gregory Szorc's avatar
      global: use python3 in shebangs · c102b704
      Gregory Szorc authored
      Python 3 is the future. We want Python scripts to be using Python 3
      by default.
      
      This change updates all `#!/usr/bin/env python` shebangs to use
      `python3`.
      
      Does this mean all scripts use or require Python 3: no.
      
      In the test environment, the `PATH` environment variable in tests is
      updated to guarantee that the Python executable used to run
      run-tests.py is used. Since test scripts all now use
      `#!/usr/bin/env python3`, we had to update this code to install
      a `python3` symlink instead of `python`.
      
      It is possible there are some random scripts now executed with the
      incorrect Python interpreter in some contexts. However, I would argue
      that this was a pre-existing bug: we should almost always be executing
      new Python processes using the `sys.executable` from the originating
      Python script, as `python` or `python3` won't guarantee we'll use the
      same interpreter.
      
      Differential Revision: https://phab.mercurial-scm.org/D9273
      c102b704
  6. Nov 09, 2020
  7. Oct 22, 2020
  8. Oct 07, 2020
  9. Oct 22, 2020
    • Martin von Zweigbergk's avatar
      errors: add config that lets user get more detailed exit codes · 21733e8c
      Martin von Zweigbergk authored
      This adds an experimental config that lets the user get more detailed
      exit codes. For example, there will be a specific error code for
      input/user errors. This is part of
      https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan. I've made the
      config part of tweakdefaults.
      
      I've made the config enabled by default in tests. My reasoning is that
      we want to see that each specific error case gives the right exit code
      and we don't want to duplicate all error cases in the entire test
      suite. It also makes it easy to grep the `.t` files for `[255]` to
      find which cases we have left to fix. The logic for the current exit
      codes is quite simple, so I'm not too worried about regressions
      there. I've added a test case specifically for the "legacy" exit
      codes.
      
      I've set the detailed exit status only for the case of
      `InterventionRequired` and `SystemExit` for now (the cases where we
      currently return something other than 255), just to show that it
      works.
      
      Differential Revision: https://phab.mercurial-scm.org/D9238
      21733e8c
  10. Nov 08, 2020
    • Martin von Zweigbergk's avatar
      worker: raise exception instead of calling sys.exit() with child's code · 8f07f5a9
      Martin von Zweigbergk authored
      When a worker process returns an error code, we would call
      `sys.exit()` with that exit code on the main process. The `SystemExit`
      exception would then get caught in `scmutil.callcatch()`, which would
      return that error code. The comment there says "Commands shouldn't
      sys.exit directly", which I agree with. This patch changes it so we
      raise a specific exception when a worker fails so we can catch
      instead. I think that means that `SystemExit` is now always an
      internal error.
      
      (I had earlier thought that this call to `sys.exit()` was from within
      the child process until Matt Harbison made me look again, so thanks
      for that!)
      
      Differential Revision: https://phab.mercurial-scm.org/D9287
      8f07f5a9
  11. Jun 23, 2020
    • Martin von Zweigbergk's avatar
      copies: handle more cases where a file got replaced by a copy · 58e7ee23
      Martin von Zweigbergk authored
      This patch fixes the changeset-centric version in a pretty
      straight-forward way. It fixes it to automatically resolve the
      conflict, which is better than resulting in a modify/delete conflict
      as it was before b4057d001760 (merge: when rename was made on both
      sides, use ancestor as merge base, 2020-01-22).
      
      I'll leave it for later to test and explicitly handle cases where
      files have been renamed to the same target on different sides of the
      merge.
      
      Differential Revision: https://phab.mercurial-scm.org/D8653
      58e7ee23
    • Martin von Zweigbergk's avatar
      tests: test more cases where a file got replaced by a copy · 4b79e92a
      Martin von Zweigbergk authored
      This adds a test where a file is modified on one branch and is renamed
      onto another file in another branch. That should ideally be
      automatically resolved (by propagating the modification to the rename
      destination). Alternatively, it could be considered a modify/delete
      conflict. It should at least not be automatically resolved by ignoring
      the modification. However, that is what actually happens with the
      changeset-centric algorithm since I broke it in b4057d001760 (merge:
      when rename was made on both sides, use ancestor as merge base,
      2020-01-22). Before that commit, it resulted in a modify/delete
      conflict. The filelog-centric algorithm was broken already before that
      commit.
      
      Differential Revision: https://phab.mercurial-scm.org/D8652
      4b79e92a
  12. Oct 20, 2020
  13. Oct 29, 2020
    • Dan Villiom Podlaski Christiansen's avatar
      commit: warn the user when a commit already exists · 976b26bd
      Dan Villiom Podlaski Christiansen authored
      Sometimes, a commit will result in an exact match of a preexisting
      commit, and if that commit isn't a branch head, hg will incorrectly
      note that it created a new head. Instead, we should warn the user that
      commit already existed in the repository.
      
      In practice, this bug is rather uncommon, and will only occur when the
      usr explicitly sets the date.
      
      Please note that this commit contains an API change to
      cmdutil.commitstatus()
      
      Differential Revision: https://phab.mercurial-scm.org/D9257
      976b26bd
  14. Oct 16, 2020
  15. Oct 26, 2020
  16. Oct 29, 2020
  17. Oct 13, 2020
  18. Oct 29, 2020
    • Martin von Zweigbergk's avatar
      templates: include all non-branch namespaces in default one-line summary · e9555305
      Martin von Zweigbergk authored
      I left out branches and custom namespaces on purpose from D9252
      because I figured that people like us (Google) who have custom
      namespaces can also have custom configs. However, I just realized that
      this makes everyone with the topic extension lose the topic they've
      had in rebase output for a long time (ever since someone was nice
      enough to add it in D741). Sorry about the churn.
      
      The more generic template couldn't easily keep the "log.bookmark"
      label in the template because the namespace is called "bookmarks"
      (plural). That means that we can't be compatible with users' existing
      configs for "log.bookmark", so I decided to change the labels to be in
      a brand-new "oneline-summary" namespace.
      
      Differential Revision: https://phab.mercurial-scm.org/D9262
      e9555305
    • Martin von Zweigbergk's avatar
      branching: merge with stable · 330c258f
      Martin von Zweigbergk authored
      330c258f
  19. Oct 24, 2020
    • Matt Harbison's avatar
      repoview: only pin obsolete wdir parents while there are unresolved conflicts · 341e014f
      Matt Harbison authored
      I noticed after doing an update from an obsolete revision with a dirty wdir that
      the obsolete commit stayed visible for no obvious reason.  It was decided in
      85b03b1e4715 not to clear mergestate once all of the conflicts were resolved, in
      order to allow re-resolving.  Since the point of pinning the obsolete parents
      was to allow resolving in the first place (aaeccdb6e654), it makes sense to also
      gate it on whether or not there are any remaining files to resolve.  This might
      result in pinning again if files are marked unresolved again, but that seems
      reasonable, given that it still solves the original issue.
      
      Note that this isn't purely cosmetic- pushing with a pinned obsolete revision is
      likely to cause complaints about pushing multiple heads or other unexpected
      errors.  So the faster it comes out of that state, the better.
      
      Differential Revision: https://phab.mercurial-scm.org/D9248
      341e014f
  20. Oct 28, 2020
  21. Oct 23, 2020
    • Yuya Nishihara's avatar
      url: do not continue HTTP authentication with user=None (issue6425) · ff48eea4
      Yuya Nishihara authored
      I initially thought this is a py3-compat bug of passwordmgr._writedebug(),
      but actually returning (None, str) pair is wrong at all. HTTP authentication
      would continue with user="None" in that case.
      
      Since registering a password of user=None should also be wrong, this patch
      simply adds early return.
      ff48eea4
  22. Oct 29, 2020
  23. Oct 13, 2020
  24. Oct 18, 2020
  25. Oct 15, 2020
    • Pierre-Yves David's avatar
      clonebundles: move a bundle of clone bundle related code to a new module · 74271829
      Pierre-Yves David authored
      In the process on general clone bundle automatically, we need to make some
      function available more widely. This is a good opportunity to extract a
      significant amount of code from `mercurial.exchange` into a new
      `mercurial.bundlecaches`. This make `mercurial.exchange` move under the 3K line
      range (hooray…).
      
      The module is called `bundlecaches` because I expect it to be eventually useful
      for more than just clone bundle (like pull bunbles).
      
      Differential Revision: https://phab.mercurial-scm.org/D9208
      74271829
  26. Jul 01, 2020
  27. Sep 18, 2020
  28. Oct 14, 2020
  29. Oct 22, 2020
    • Martin von Zweigbergk's avatar
      config: move message about leading spaces in config to config.py · 0883413e
      Martin von Zweigbergk authored
      When the config parser raises a ParseError, it uses the line that
      failed to parse as the error message. It doesn't currently tell the
      user anything about why it failed to parse. b13b99d39a46 (config:
      highlight parse error caused by leading spaces (issue3214),
      2014-03-16) added a checked based on the error *message* having
      leading spaces. That has worked fine because only the config parser
      uses the line itself as error message (I think the revset and fileset
      parsers use more user-friendly proper messages). It still feels like a
      hack. Let's make the config parser give a useful message about leading
      whitespace instead. We should ideally follow up with more useful
      messages for other parse errors in config files.
      
      Differential Revision: https://phab.mercurial-scm.org/D9241
      0883413e
  30. Oct 27, 2020
  31. Oct 23, 2020
  32. Oct 26, 2020
  33. Oct 23, 2020
Loading