1. 10 Sep, 2020 2 commits
  2. 12 Sep, 2020 1 commit
    • Yuya Nishihara's avatar
      log: introduce struct that carries log traversal options · c1d0f83d62c4
      Yuya Nishihara authored
      I tried to refactor logcmdutil.getrevs() without using an options struct,
      but none of these attempts didn't work out. Since every stage of getrevs()
      needs various log command options (e.g. both matcher and revset query need
      file patterns), it isn't possible to cleanly split getrevs() into a command
      layer and a core logic.
      
      So, this patch introduces a named struct to carry command options in slightly
      abstracted way, which will be later used by "hg grep" and "hg churn". More
      fields will be added to the walkopt struct.
      
      Type hints aren't verified. I couldn't figure out how to teach pytype to
      load its own attr type stubs in place of our .thirdparty.attr. Conditional
      import didn't work. s/^from \.thirdparty // is the only way I found pytype
      could parse the @attr.ib decorator.
      c1d0f83d62c4
  3. 21 Sep, 2020 2 commits
  4. 18 Sep, 2020 2 commits
  5. 09 Jul, 2020 1 commit
  6. 23 Jun, 2020 1 commit
  7. 02 Jun, 2020 1 commit
    • Yuya Nishihara's avatar
      graft: fix --base value to be saved in state file · 2dc5ae953c4a
      Yuya Nishihara authored
      'True' just works because it is treated as an integer revision '1' and
      only the truthiness of the basectx is important. If multiple source revisions
      were supported with --base, the resumed graft operation would go wrong.
      
      --HG--
      branch : stable
      2dc5ae953c4a
  8. 26 May, 2020 1 commit
  9. 10 Sep, 2020 2 commits
  10. 09 Sep, 2020 1 commit
    • Yuya Nishihara's avatar
      grep: fix hash(linestate) to not include linenum · e47385ef4e17
      Yuya Nishihara authored
      linestate.__eq__() just compares the line values whereas __hash__() does
      hash both self.line and self.linenum, which violates the rule. __hash__()
      was added at fb502719c75c, "python 2.6 compatibility: add __hash__ to
      classes that have __eq__" with no additional remarks, so this would probably
      be a simple mistake.
      
      The test output changed because difflib.SequenceMatcher() internally uses
      a dict. As you can see, the line "export" is unchanged at the revision 2,
      so the new output is correct.
      e47385ef4e17
  11. 10 Aug, 2020 1 commit
    • Pulkit Goyal's avatar
      mergestate: use _stateextras instead of merge records for commit related info · 0652a533fe3c
      Pulkit Goyal authored
      There is a set of information related to a merge which is needed on commit. We
      want to store such information in the mergestate so that we can read it while
      committing.
      
      For this purpose, we are using merge records and introduced a merge
      entry state for that. However this won't scale and is not clean way to implement
      this.
      
      This patch reworks the existing logic related to this to use _stateextras and
      read from it.
      
      Right now the information stored is not very descriptive but it will be in next
      patch.
      
      Using _stateextras also makes MERGE_RECORD_MERGED_OTHER useless and only to be
      kept for BC.
      
      Differential Revision: https://phab.mercurial-scm.org/D8920
      0652a533fe3c
  12. 11 Aug, 2020 1 commit
    • Martin von Zweigbergk's avatar
      revert: remove dangerous `parents` argument from `cmdutil.revert()` · 8c466bcb0879
      Martin von Zweigbergk authored
      As we found out the hard way (thanks to spectral@ for figuring it
      out!), `cmdutil.revert()`'s `parents` argument must be
      `repo.dirstate.parents()` or things may go wrong. We had an extension
      that passed in the target commit as the first parent. The `hg split`
      command from the evolve extension seems to have made the same mistake,
      but I haven't looked carefully.
      
      The problem is that `cmdutil._performrevert()` calls
      `dirstate.normal()` on reverted files if the commit to revert to
      equals the first parent. So if you pass in `ctx=foo` and
      `parents=(foo.node(), nullid)`, then `dirstate.normal()` will be
      called for the revert files, even though they might not be clean in
      the working copy.
      
      There doesn't seem to be any reason, other than a tiny performance
      benefit, to passing the `parents` around instead of looking them up
      again in `cmdutil._performrevert()`, so that's what this patch does.
      
      Differential Revision: https://phab.mercurial-scm.org/D8925
      8c466bcb0879
  13. 28 Jul, 2020 1 commit
  14. 16 Jul, 2020 1 commit
  15. 14 Apr, 2020 1 commit
  16. 01 Mar, 2020 1 commit
    • Manuel Jacob's avatar
      branch: make --force work even when specifying revs · 92b7caf4cb9e
      Manuel Jacob authored
      The `hg branch` command accepts a `--force` parameter that allows to
      "set branch name even if it shadows an existing branch". However, before this
      patch, that didn’t work when specifying revs with `-r`.
      
      --HG--
      branch : stable
      92b7caf4cb9e
  17. 09 Apr, 2020 1 commit
    • Pulkit Goyal's avatar
      mergestate: store about files resolved in favour of other · 1b8fd4af3318
      Pulkit Goyal authored
      Committing a merge sometimes wrongly creates a new filenode where it can re-use
      an existing one. This happens because the commit code does it's own calculation
      and does not know what happened on merge.
      
      This starts storing information in mergestate about files which were
      automatically merged and the other/remote version of file was used.
      We need this information at commit to pick the filenode parent for the new
      commit.
      
      This issue was found by Pierre-Yves David and idea to store the relevant parts
      in mergestate is also suggested by him.
      
      Somethings which can be further investigated are:
      
      1) refactoring of commit logic more to depend on this information
      2) maybe a more generic solution?
      
      Differential Revision: https://phab.mercurial-scm.org/D8392
      1b8fd4af3318
  18. 25 Jan, 2020 1 commit
  19. 22 Jan, 2020 1 commit
  20. 28 Dec, 2019 2 commits
  21. 30 Dec, 2019 1 commit
  22. 27 Dec, 2019 1 commit
  23. 12 Dec, 2019 1 commit
    • Martin von Zweigbergk's avatar
      config: drop debug messages saying where config was read from · 6b6872822b32
      Martin von Zweigbergk authored
      `hg config --debug` includes lines like this:
      
        set config by: $EDITOR
      
      but also lines like this:
      
        $EDITOR: ui.editor=emacs -nw
      
      The `set config by` messages don't seem to provide much additional
      information over what we get from the `$EDITOR:`-type message. I could
      imagine wanting to see which values got overriden by a later entry,
      but that information is already not present. So let's just remove the
      first type of output. My next patch would otherwise amplify the
      redundant output (there would be one `set config by` for each line in
      `mergetools.rc`).
      
      Differential Revision: https://phab.mercurial-scm.org/D7627
      6b6872822b32
  24. 13 Dec, 2019 3 commits
  25. 12 Dec, 2019 4 commits
  26. 10 Dec, 2019 3 commits
  27. 27 Oct, 2019 2 commits