Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 18:16:29 +0530] rev 45288
merge: introduce mergeresult.updateactions() and use it
We don't want direct editing and access of mergeresult._actions because soon we
will like to maintain data in other structures also.
Differential Revision: https://phab.mercurial-scm.org/D8826
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 17:57:23 +0530] rev 45287
merge: pass mergeresult instead of actions in _checkunknownfiles() (API)
Differential Revision: https://phab.mercurial-scm.org/D8825
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 17:52:33 +0530] rev 45286
merge: pass mergeresult obj instead of actions dict in _resolvetrivial()
Differential Revision: https://phab.mercurial-scm.org/D8824
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 17:49:13 +0530] rev 45285
merge: pass mergeresult obj instead of actions in _filternarrowactions()
We want to use rich mergeresult object and it's APIs instead of handling a
dictionary.
Differential Revision: https://phab.mercurial-scm.org/D8823
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 17:31:26 +0530] rev 45284
merge: pass mergeresult in checkpassconflicts() instead of actions (API)
This is a part of series which aims to use mergeresult obj instead of an action
dictionary.
Differential Revision: https://phab.mercurial-scm.org/D8822
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 16:23:55 +0530] rev 45283
merge: add removefile() to mergeresult object
There are cases where some further calculation makes the file not needing to be
merged anymore and hence needs to be dropped in mergeresult object. This adds a
function for that.
Differential Revision: https://phab.mercurial-scm.org/D8821
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 16:18:39 +0530] rev 45282
merge: introduce mergeresult.addfile() and use it
We want to use mergeresult object at more and more places instead of this
actions dict to simplify code and further add new APIs to mergeresult object.
This patch introduces `addfile()` which adds a new file to the internal actions
dict for now.
Differential Revision: https://phab.mercurial-scm.org/D8820
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 15:56:11 +0530] rev 45281
merge: make mergeresult constructor initialize empty object
In future patches, we will be going to update mergeresult object
instead of building an actions dict and then setting it in the object.
Differential Revision: https://phab.mercurial-scm.org/D8819
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 15:15:20 +0530] rev 45280
merge: improve documentation of fbid dict used for merge bid
I improved the comments explaning what the dict contains meanwhile organizing
the comment structure which prevents some confusion.
Due to formatting issues, the empty dict was wrapped in `()` which might decieve
in thinking that it's a tuple of dict until you decide to find a comma.
Differential Revision: https://phab.mercurial-scm.org/D8818
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 14:45:00 +0530] rev 45279
merge: move conversion of file-key dict to action-key dict in mergeresult
Initially the actions dict which we get has file has keys, but later we want a
dict which has actions as keys. This patch moves code computing that to
mergeresult class as that's where it should be anyway.
Differential Revision: https://phab.mercurial-scm.org/D8817
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 02 Aug 2020 10:12:21 -0700] rev 45278
merge: introduce hasconflicts() on mergeresult object
This and upcoming patches will improve the mergeresult object making it more
powerful and provide clean APIs for various things. Doing this will clean up the
core merge code which is present in `update()` a bit.
Differential Revision: https://phab.mercurial-scm.org/D8816
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 14 Jul 2020 16:40:28 +0530] rev 45277
merge: remove no longer required ACTION_GET_OTHER_AND_STORE
In
1b8fd4af33189c84feadb47c74d659ec31cde3b9 I (ab)used merge actions to pass
info from manifestmerge() to applyupdates() and store info in mergestate.
In previous patches, we introduced a separate return value from manifestmerge()
and calculateupdates() and an argument to applyupdates() which achieved the same
thing.
Let's remove this no longer required messy code.
Differential Revision: https://phab.mercurial-scm.org/D8744
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 14 Jul 2020 16:31:52 +0530] rev 45276
merge: pass commitinfo to applyupdates() and get it stored in mergestate
This patch passes the commitinfo calulcated in manifestmerge() to applyupdates()
so that it can be read there and stored in mergestate. On commit, we can read
mergestate for such information and act accordingly.
This patch also makes ACTION_GET_OTHER_AND_STORE not required anymore. Next
patch will remove the messy code surrounding it.
Differential Revision: https://phab.mercurial-scm.org/D8743
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 14 Jul 2020 16:21:08 +0530] rev 45275
merge: introduce 'commitinfo' in mergeresult
commitinfo will be used to pass information which is required on commit phase
from the merge phase.
One common example is, merge chooses filenode from second parent and we need to
tell commit to choose that. Right now this one and related cases are not very
neatly implement and there is no clear line on how to pass on such information.
Upcoming patches will try to work on in this area and make things easier.
Differential Revision: https://phab.mercurial-scm.org/D8742
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 23 Jul 2020 18:03:14 +0530] rev 45274
merge: return a mergeresult obj from manifestmerge(), calculateupdates() (API)
Earlier, manifestmerge() and calculateupdates() returns a tuple of three things.
I wanted to add one more thing to return value.
Introducing a special class which represents results of a merge will help
understand better and also ease adding new return values.
Differential Revision: https://phab.mercurial-scm.org/D8799
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 03 Aug 2020 23:13:58 +0530] rev 45273
Added signature for changeset
7fc3c5fbc65f
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 03 Aug 2020 23:13:52 +0530] rev 45272
Added tag 5.5 for changeset
7fc3c5fbc65f
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 01 Aug 2020 18:39:28 +0530] rev 45271
mergestate: fix BC breakage introduced because of removal of a merge record
In
fcd0cff3400a I removed the usage of RECORD_RESOLVED_OTHER. However I also
removed the reading support, hence if there is any user who runs into merge
conflict with older version of hg, upgrades hg and then tries to read
mergestate, they will end up with an MergeRecordUnsupportedError.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 30 Jul 2020 22:49:51 -0700] rev 45270
packaging: delete unnecessary updating of `dirs` list
The `dirs` list is not used and it seems it also wasn't used when this
code was added in
395b0e132836 (Don't copy hidden files/directories
during `setup.py install`, 2009-07-14).
Differential Revision: https://phab.mercurial-scm.org/D8857
Martin von Zweigbergk <martinvonz@google.com> [Sun, 02 Aug 2020 10:08:18 -0700] rev 45269
packaging: make "mercurial.defaultrc" a key in package_data
Before this patch, we had a `mercurial` key with a `defaultrc/*.rc`
value. It seems more correct to have a `mercurial.defaultrc` key with
a `*.rc` value since `mercurial.defaultrc` it became a pacakge in
1390bb81163e (help: get helptext/ data from `resources` module if
available, 2019-12-12).
Differential Revision: https://phab.mercurial-scm.org/D8856
Martin von Zweigbergk <martinvonz@google.com> [Thu, 30 Jul 2020 12:22:41 -0700] rev 45268
templatespec: use new factory functions in hooklib
Differential Revision: https://phab.mercurial-scm.org/D8853
Martin von Zweigbergk <martinvonz@google.com> [Mon, 20 Jul 2020 22:43:33 -0700] rev 45267
templatespec: use new factory functions in logcmdutil
Differential Revision: https://phab.mercurial-scm.org/D8848
Martin von Zweigbergk <martinvonz@google.com> [Mon, 20 Jul 2020 21:33:28 -0700] rev 45266
templatespec: move check for non-unicode to lower-level function
Now that we have the factory functions, it makes sense to have the
check there.
Differential Revision: https://phab.mercurial-scm.org/D8847
Martin von Zweigbergk <martinvonz@google.com> [Mon, 20 Jul 2020 21:32:10 -0700] rev 45265
templatespec: logcmdutil.templatespec() gets either template or mapfile
The callers of the function already never pass (non-`None`) values for
both, so let's check that and call the new factory functions.
Differential Revision: https://phab.mercurial-scm.org/D8846
Martin von Zweigbergk <martinvonz@google.com> [Thu, 16 Jul 2020 13:33:46 -0700] rev 45264
templatespec: create a factory function for each type there is
Most of the arguments to the `templatespec` constructor are mutually
exclusive, so each combination creates a different type of
templatespec. Let's clarify that by creating factory functions.
I've left the callers in `logcmdutil` unchanged for now because they
are more complex and `logcmdutil.templatespec()` is slightly higher
level in that it is specific to changesets.
My larger goal is to add support frozen binaries (specifically
PyOxidizer) by adding a specific type of `templatespec` for built-in
templates. That will get its own factory function.
Differential Revision: https://phab.mercurial-scm.org/D8845
Martin von Zweigbergk <martinvonz@google.com> [Wed, 29 Jul 2020 10:42:09 -0700] rev 45263
templater: stop accepting a single style to stylemap()
The code seems to have been for compatibility across
d3dbdca92458
(hgweb: don't choke when an inexistent style is requested (
issue1901),
2009-11-12).
Differential Revision: https://phab.mercurial-scm.org/D8844
Martin von Zweigbergk <martinvonz@google.com> [Thu, 23 Jul 2020 10:20:48 -0700] rev 45262
formatter: inline a variable assigned from `templater.templater.frommapfile`
The variable doesn't get reused and it doesn't help formatting, so I
don't see any reason for it.
Differential Revision: https://phab.mercurial-scm.org/D8807
Martin von Zweigbergk <martinvonz@google.com> [Wed, 22 Jul 2020 21:23:46 -0700] rev 45261
templater: don't normalize path separators to '/' when interacting with OS
`_readmapfile()` is about reading a map file from the file system, so
we shouldn't use our `util.normpath()`, which also normalizes `os.sep`
to '/'.
Differential Revision: https://phab.mercurial-scm.org/D8806
Martin von Zweigbergk <martinvonz@google.com> [Thu, 23 Jul 2020 22:50:20 -0700] rev 45260
formatter: remove now-unnecessary check for file-ness
`templater.templatepath()` now returns non-`None` only for files, so
the caller doesn't have to check.
Differential Revision: https://phab.mercurial-scm.org/D8805
Martin von Zweigbergk <martinvonz@google.com> [Thu, 23 Jul 2020 22:47:55 -0700] rev 45259
templater: make templatepath() not return directory paths
The previous patch added a test showing an unusal error message. This
make it more like other error messages.
Differential Revision: https://phab.mercurial-scm.org/D8804