- Jul 06, 2020
-
-
Pierre-Yves David authored
This function is exclusively used in `commitctx`. So we should extract it too for consistency and to reduce the `localrepo` bloat. This is part of a larger refactoring/cleanup of the commitctx code to clarify and augment the logic gathering metadata useful for copy tracing. The current code is a tad too long and entangled to make such update easy. Differential Revision: https://phab.mercurial-scm.org/D8710
-
Pierre-Yves David authored
the function have few callers (< 15) is quite long a mostly independent from the repository itself. It seems like a good candidate to reduce the bloatness of the localrepository class. Extracting it will help us cleaning the code up and splitting it into more reasonable-size function. We don't use a copy trick because the amount of code extract is quite small (<5%) and the de-indent means every single line change anyway. So this is not deemed valuable to do so. This is part of a larger refactoring/cleanup of the commitctx code to clarify and augment the logic gathering metadata useful for copy tracing. The current code is a tad too long and entangled to make such update easy. Differential Revision: https://phab.mercurial-scm.org/D8709
-
Pierre-Yves David authored
This block cut off a lot of logic, documenting the why and how seems useful to future reader. This is part of a larger refactoring/cleanup of the commitctx code to clarify and augment the logic gathering metadata useful for copy tracing. The current code is a tad too long and entangled to make such update easy. We start with easy and small cleanup. Differential Revision: https://phab.mercurial-scm.org/D8700
-
- Jul 21, 2020
-
-
Martin von Zweigbergk authored
Both `templatedir()` and `web.templatepath` are now always a single path (or None). Differential Revision: https://phab.mercurial-scm.org/D8788
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D8787
-
Martin von Zweigbergk authored
The function returns either a singleton list or an empty list, so it makes more sense to return a value or None. The plural in the name also doesn't make sense, but `templatepath()` is already taken, so I renamed it to `templatedir()` instead. Differential Revision: https://phab.mercurial-scm.org/D8786
-
Martin von Zweigbergk authored
The function iterates over a hard-coded list of one element since d844e220792a (templater: don't search randomly for templates - trust util.datapath, 2014-09-28). Differential Revision: https://phab.mercurial-scm.org/D8785
-
- Jul 06, 2020
-
-
Pierre-Yves David authored
This is simple to have all the simple case unfold before the 100+ line one. Otherwise it is hard to relate the `else` to the initial conditionnal. This is part of a larger refactoring/cleanup of the commitctx code to clarify and augment the logic gathering metadata useful for copy tracing. The current code is a tad too long and entangled to make such update easy. We start with easy and small cleanup. Differential Revision: https://phab.mercurial-scm.org/D8708
-
Pierre-Yves David authored
This achieve the same result with clearer code. This is part of a larger refactoring/cleanup of the commitctx code to clarify and augment the logic gathering metadata useful for copy tracing. The current code is a tad too long and entangled to make such update easy. We start with easy and small cleanup. Differential Revision: https://phab.mercurial-scm.org/D8707
-
Pierre-Yves David authored
The variable contains content that are both added and modified. "changed" could be confused with "modified" only, so we pick a less ambiguous naming that will help with more unification. For example, it would make sense to shove the "removed" item in there since this is how the variable is used. This is part of a larger refactoring/cleanup of the commitctx code to clarify and augment the logic gathering metadata useful for copy tracing. The current code is a tad too long and entangled to make such update easy. We start with easy and small cleanup. Differential Revision: https://phab.mercurial-scm.org/D8706
-
- Jul 07, 2020
-
-
Pierre-Yves David authored
A small change that makes the code flow clearer. This is part of a larger refactoring/cleanup of the commitctx code to clarify and augment the logic gathering metadata useful for copy tracing. The current code is a tad too long and entangled to make such update easy. We start with easy and small cleanup. Differential Revision: https://phab.mercurial-scm.org/D8704
-
- Jul 06, 2020
-
-
Pierre-Yves David authored
When possible, lets avoid recomputing the same information again. This is part of a larger refactoring/cleanup of the commitctx code to clarify and augment the logic gathering metadata useful for copy tracing. The current code is a tad too long and entangled to make such update easy. We start with easy and small cleanup. Differential Revision: https://phab.mercurial-scm.org/D8703
-
Pierre-Yves David authored
Instead of mutating a list passed in argument, we simply return the information from the `_filecommit` function. This make for a cleaner API and allow for richer information to be returned. That richer information will be used in the next commit to avoid duplicated computation. This is part of a larger refactoring/cleanup of the commitctx code to clarify and augment the logic gathering metadata useful for copy tracing. The current code is a tad too long and entangled to make such update easy. We start with easy and small cleanup. Differential Revision: https://phab.mercurial-scm.org/D8702
-
- Jul 18, 2020
-
-
Yuya Nishihara authored
It helps understand which object should be decrefed on goto release.
-
Yuya Nishihara authored
The phaseroots variable is used for two different objects: borrowed set and owned dict of sets. It's hard to track which object should have to be decrefed on error return.
-
Yuya Nishihara authored
"N" means "O" without incref, so we can just return the created tuple.
-
Yuya Nishihara authored
This should never happen, but the code looks wrong without PyErr_Set*() call.
-
Yuya Nishihara authored
-
Yuya Nishihara authored
PySet_Check() does not set an exception.
-
- Jul 19, 2020
-
-
Yuya Nishihara authored
The stat object would be freed on error for the same reason as the previous patch. makestat() can be inlined, but this patch doesn't change it. https://github.com/python/cpython/blob/2.7/Python/modsupport.c#L292 The __APPLE__ code is untested.
-
Yuya Nishihara authored
Since Py_BuildValue() steals the ownership of "N" arguments, these objects would already be freed if Py_BuildValue() returned NULL. https://github.com/python/cpython/blob/2.7/Python/modsupport.c#L292
-
- Jul 20, 2020
-
-
Manuel Jacob authored
The previous regex only matched the first digit, so "clang-format version 10.0.0" was recognized as version 1.
-
- Jul 14, 2020
-
-
Daniel Ploch authored
This enables extensions to define commands that delgate to rebase, evolve, etc. one or more times to also have their own unfinished states for the full sequence of operations without monkey-patching _unfinishedstates. Differential Revision: https://phab.mercurial-scm.org/D8714
-
- Jul 17, 2020
-
-
Manuel Jacob authored
In changeset f55099982bc5, I introduced the message "became empty and became ...", which I was never very happy with. Raphaël Gomès suggested "became empty as ...". That sounds much nicer. Differential Revision: https://phab.mercurial-scm.org/D8765
-
- Jul 18, 2020
-
-
Jörg Sonnenberger authored
Differential Revision: https://phab.mercurial-scm.org/D8767
-
- Jul 14, 2020
-
-
Pulkit Goyal authored
In future patches, I want to add one more return value which represents information which needs to stored and used at commit time. Differential Revision: https://phab.mercurial-scm.org/D8741
-
- Jul 09, 2020
-
-
Pulkit Goyal authored
merge.update() is quite hard to understand, found this an easy win. The end goal is to have better organized merge and mergestate handling and then fix some related bugs. Differential Revision: https://phab.mercurial-scm.org/D8740
-
Pulkit Goyal authored
Understanding that dict is important for understanding how mergestate is performing operations on dirstate. Differential Revision: https://phab.mercurial-scm.org/D8739
-
Pulkit Goyal authored
The old variable name `r` makes it ~impossible to understand what does it mean. One can only understand that after going to callers and hoping that its documented there. I also documented return value of the function involved while I was there. Differential Revision: https://phab.mercurial-scm.org/D8738
-
Pulkit Goyal authored
This function is updating dirstate which sounds like not something which a method on mergestate class should do. Also this just calls another function. Lets directly call that function and remove this reducing mergestate responsibility a bit. There was single caller which is updated. Differential Revision: https://phab.mercurial-scm.org/D8737
-
Pulkit Goyal authored
This makes clear which mergestate record is used for what and group them based on how they are used right now. Differential Revision: https://phab.mercurial-scm.org/D8719
-
Pulkit Goyal authored
I tried to find users of this but was unable to find. Seems like RECORD_OVERRIDE is doing for what they were used before. Differential Revision: https://phab.mercurial-scm.org/D8718
-
Pulkit Goyal authored
I am trying to divide the records into certain groups and then have dedicated objects for them. Taking baby steps in that direction. Differential Revision: https://phab.mercurial-scm.org/D8717
-
Pulkit Goyal authored
This was introduced in last cycle however while working on refactoring mergestate, I realized it's unncessary. This will break users who did a merge using previous version, did this kind of storage and before commiting updated the mercurial version. Differential Revision: https://phab.mercurial-scm.org/D8716
-
Pulkit Goyal authored
addpath() seems to imply that we are adding a new path/entry to the mergestate. Differential Revision: https://phab.mercurial-scm.org/D8715
-
- Jul 18, 2020
-
-
Manuel Jacob authored
Python 2 file objects have the `softspace` attribute (https://docs.python.org/2/library/stdtypes.html#file.softspace), which is used by the print statement to track its internal state. The documentation demands from file-like objects only that the attribute is writable and initialized to 0. Method `file.write()` sets it to 0, but this is not documented. Historically, sys.stdout was replaced by an instance of the `winstdout` class, so it needed to behave exactly the same (the softspace fix was introduced in 705278e70457). Nowadays we don’t replace sys.stdout and don’t use the print statement on `winstdout` instances, so we can safely drop it.
-
- Jul 17, 2020
-
-
Manuel Jacob authored
Copying the function is not nice, but moving around stuff to avoid the circular import didn’t seem to be worth the effort.
-
Manuel Jacob authored
The previous code was using `outgoing.ancestorsof`, which was originally called `outgoing.missingheads` although not containing the missing heads. This confusion was probably the reason why the buggy code was written. The actually outgoing changesets are stored in `outgoing.missing`. By checking all outgoing changesets, we avoid the problem and can show the list of all obsolete or unstable changesets, which is more helpful for the user.
-
Manuel Jacob authored
When there’re no outgoing changes, push doesn’t complain about unstable changesets. There is currently a bug (see issue6372) that causes that there is an abort on push when the outgoing changes contain another changeset even if that is not obsolete or unstable. A test case and fix for that is sent in the next patch.
-
Rodrigo Damazio Bovendorp authored
Differential Revision: https://phab.mercurial-scm.org/D8763
-