Commit Graph

24 Commits

Author SHA1 Message Date
Pierre-Yves David
63f0ebdb7f upgrade: simplify the "origin" dispatch in dry run
We could compute the final set we need directly.
2017-04-11 00:03:11 +02:00
Pierre-Yves David
0befb32302 upgrade: use 'improvement' object for action too
This simplify multiple pieces of code. For now we restrict this upgrade to the
top level function to keep this patch simple.
2017-04-10 23:11:45 +02:00
Pierre-Yves David
8343e068f0 upgrade: implement equality for 'improvement' object
Through the code, we use a mix of 'improvement' object and string. Having a
single type would be simpler. For this we need the object to be comparable.
2017-04-10 23:10:03 +02:00
Pierre-Yves David
28e1ded0a7 upgrade: simplify some of the initial dispatch for dry run
Since we already have the list of deficiencies, we can use it directly.
2017-04-10 22:15:17 +02:00
Pierre-Yves David
917b0eb147 upgrade: simplify 'determineactions'
Since we only takes 'deficiencies', we can simplify the function and clarify its
arguments.
2017-04-07 18:39:27 +02:00
Pierre-Yves David
dbe4fb45ab upgrade: filter optimizations outside of 'determineactions'
This sounds like higher level logic to process arguments.

Moving it out of 'determineactions' will allow passing only deficiencies to the
function. Then, in a future changeset, we will remove  dispatch on "improvement
type" within the function. See next changeset for details.
2017-04-11 23:46:16 +02:00
Pierre-Yves David
74208899a2 upgrade: directly iterate over optimisations
Since we already have the list of optimisations independent from the
deficiencies, we can use it directly.

(we make a dual assignement in this changeset to simplify the next one)
2017-04-07 18:46:27 +02:00
Pierre-Yves David
a5369d6f5d upgrade: simplify optimisations validation
Since we fetch optimizations distinctly from the deficiencies, we can simplify
some code.
2017-04-10 21:01:06 +02:00
Pierre-Yves David
6e51b0fbf0 upgrade: split finding deficiencies from finding optimisations
Our ultimate goal is to make it easier to get a diagnostic of the repository
format. A first important and step for that is to separate part related to
repository format from the optimisation. We start by having two different
functions returning the two categories of possible "improvement".
2017-04-10 21:00:52 +02:00
Pierre-Yves David
a73976f4f4 upgrade: update the copyright statement 2017-04-11 22:07:40 +02:00
Pierre-Yves David
ef922b1da6 upgrade: update the header comment 2017-04-11 22:07:15 +02:00
Pierre-Yves David
f958f09136 upgrade: import 'localrepo' globally
The in-function imports mention a cycle that seems to no longer be relevant. As
a result, we just import it globally.
2017-04-11 22:01:13 +02:00
Yuya Nishihara
0c147d5d5b merge with stable 2017-04-11 23:12:14 +09:00
Pierre-Yves David
26d206d2eb upgrade: drop the prefix to the '_finishdatamigration' function
Now that we are in the 'upgrade' module we can simplify the name.
2017-04-10 18:06:22 +02:00
Pierre-Yves David
00c5df46ac upgrade: drop the prefix to the '_filterstorefile' function
Now that we are in the 'upgrade' module we can simplify the name.
2017-04-10 18:06:12 +02:00
Pierre-Yves David
5b86dfbc64 upgrade: drop the prefix to the 'determineactions' function
Now that we are in the 'upgrade' module we can simplify the name.
2017-04-10 18:05:57 +02:00
Pierre-Yves David
05aee6cdc6 upgrade: drop the prefix to the 'findimprovements' function
Now that we are in the 'upgrade' module we can simplify the name.
2017-04-10 18:05:42 +02:00
Pierre-Yves David
11540e4514 upgrade: drop the prefix to the 'supporteddestrequirements' function
Now that we are in the 'upgrade' module we can simplify the name.
2017-04-10 18:04:50 +02:00
Pierre-Yves David
22b935febf upgrade: drop the prefix to the 'allowednewrequirements' function
Now that we are in the 'upgrade' module we can simplify the name.
2017-04-10 18:03:11 +02:00
Pierre-Yves David
b2c10b5f98 upgrade: drop the prefix to the 'improvement' class
Now that we are in the 'upgrade' module we can simplify the name.
2017-04-10 18:01:29 +02:00
Pierre-Yves David
c84b2083be upgrade: drop the prefix to the 'supportremovedrequirements' function
Now that we are in the 'upgrade' module we can simplify the name.
2017-04-10 18:00:27 +02:00
Pierre-Yves David
32ac44c068 upgrade: drop the prefix to the 'blocksourcerequirements' function
Now that we are in the 'upgrade' module we can simplify the name.
2017-04-10 17:56:29 +02:00
Pierre-Yves David
14adb0955f upgrade: drop the prefix to the 'requiredsourcerequirements' function
Now that we are in the 'upgrade' module we can simplify the name.
2017-04-10 17:55:47 +02:00
Pierre-Yves David
64e5cd2f7e upgrade: extract code in its own module
Given about 2/3 or 'mercurial.repair' is now about repository upgrade, I think
it is fair to move it into its own module.

An expected benefit is the ability to drop the 'upgrade' prefix of many
functions. This will be done in coming changesets.
2017-04-07 18:53:17 +02:00