Patchwork [11,of,11] upgrade: drop the prefix to the '_finishdatamigration' function

login
register
mail settings
Submitter Pierre-Yves David
Date April 10, 2017, 4:49 p.m.
Message ID <9edd96848f91a5dfe6e7.1491842942@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/20082/
State Accepted
Headers show

Comments

Pierre-Yves David - April 10, 2017, 4:49 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1491840382 -7200
#      Mon Apr 10 18:06:22 2017 +0200
# Node ID 9edd96848f91a5dfe6e713846b968483a8a28618
# Parent  ac8de371f662e5647d68cd67b721d6a0c37f1340
# EXP-Topic upgraderepo
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 9edd96848f91
upgrade: drop the prefix to the '_finishdatamigration' function

Now that we are in the 'upgrade' module we can simplify the name.
Ryan McElroy - April 10, 2017, 7:35 p.m.
On 4/10/17 5:49 PM, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
> # Date 1491840382 -7200
> #      Mon Apr 10 18:06:22 2017 +0200
> # Node ID 9edd96848f91a5dfe6e713846b968483a8a28618
> # Parent  ac8de371f662e5647d68cd67b721d6a0c37f1340
> # EXP-Topic upgraderepo
> upgrade: drop the prefix to the '_finishdatamigration' function

This series looks good to me; it's a straightforward code cleanup with 
some nice wins in function name size.

Marked as pre-reviewed on patchwork.

>
> Now that we are in the 'upgrade' module we can simplify the name.
>
> diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
> --- a/mercurial/upgrade.py
> +++ b/mercurial/upgrade.py
> @@ -487,7 +487,7 @@ def _filterstorefile(srcrepo, dstrepo, r
>   
>       return True
>   
> -def _upgradefinishdatamigration(ui, srcrepo, dstrepo, requirements):
> +def _finishdatamigration(ui, srcrepo, dstrepo, requirements):
>       """Hook point for extensions to perform additional actions during upgrade.
>   
>       This function is called after revlogs and store files have been copied but
> @@ -534,7 +534,7 @@ def _upgraderepo(ui, srcrepo, dstrepo, r
>           dst = dstrepo.store.vfs.join(p)
>           util.copyfile(src, dst, copystat=True)
>   
> -    _upgradefinishdatamigration(ui, srcrepo, dstrepo, requirements)
> +    _finishdatamigration(ui, srcrepo, dstrepo, requirements)
>   
>       ui.write(_('data fully migrated to temporary repository\n'))
>   
>
Yuya Nishihara - April 11, 2017, 2:17 p.m.
On Mon, 10 Apr 2017 20:35:59 +0100, Ryan McElroy wrote:
> On 4/10/17 5:49 PM, Pierre-Yves David wrote:
> > # HG changeset patch
> > # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
> > # Date 1491840382 -7200
> > #      Mon Apr 10 18:06:22 2017 +0200
> > # Node ID 9edd96848f91a5dfe6e713846b968483a8a28618
> > # Parent  ac8de371f662e5647d68cd67b721d6a0c37f1340
> > # EXP-Topic upgraderepo
> > upgrade: drop the prefix to the '_finishdatamigration' function
> 
> This series looks good to me; it's a straightforward code cleanup with 
> some nice wins in function name size.

Yea, queued, thanks. I'll merge the stable branch as I know there are
conflicts.

Please update the file header as a followup. It still says repair.py.
And there are some odd indent caused by shortened function name.
Augie Fackler - April 11, 2017, 3 p.m.
On Mon, Apr 10, 2017 at 06:49:02PM +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
> # Date 1491840382 -7200
> #      Mon Apr 10 18:06:22 2017 +0200
> # Node ID 9edd96848f91a5dfe6e713846b968483a8a28618
> # Parent  ac8de371f662e5647d68cd67b721d6a0c37f1340
> # EXP-Topic upgraderepo
> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 9edd96848f91
> upgrade: drop the prefix to the '_finishdatamigration' function

Queued these. While you're in here, please take a moment to consider
what the right public API surface area should be for this module, and
prefix all functions that shouldn't be in that surface area with a _
as a followup.

(In general I'd like us to get better about being intentional about
layers within Mercurial and this seems like a great place to start.)

>
> Now that we are in the 'upgrade' module we can simplify the name.
>
> diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
> --- a/mercurial/upgrade.py
> +++ b/mercurial/upgrade.py
> @@ -487,7 +487,7 @@ def _filterstorefile(srcrepo, dstrepo, r
>
>      return True
>
> -def _upgradefinishdatamigration(ui, srcrepo, dstrepo, requirements):
> +def _finishdatamigration(ui, srcrepo, dstrepo, requirements):
>      """Hook point for extensions to perform additional actions during upgrade.
>
>      This function is called after revlogs and store files have been copied but
> @@ -534,7 +534,7 @@ def _upgraderepo(ui, srcrepo, dstrepo, r
>          dst = dstrepo.store.vfs.join(p)
>          util.copyfile(src, dst, copystat=True)
>
> -    _upgradefinishdatamigration(ui, srcrepo, dstrepo, requirements)
> +    _finishdatamigration(ui, srcrepo, dstrepo, requirements)
>
>      ui.write(_('data fully migrated to temporary repository\n'))
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -487,7 +487,7 @@  def _filterstorefile(srcrepo, dstrepo, r
 
     return True
 
-def _upgradefinishdatamigration(ui, srcrepo, dstrepo, requirements):
+def _finishdatamigration(ui, srcrepo, dstrepo, requirements):
     """Hook point for extensions to perform additional actions during upgrade.
 
     This function is called after revlogs and store files have been copied but
@@ -534,7 +534,7 @@  def _upgraderepo(ui, srcrepo, dstrepo, r
         dst = dstrepo.store.vfs.join(p)
         util.copyfile(src, dst, copystat=True)
 
-    _upgradefinishdatamigration(ui, srcrepo, dstrepo, requirements)
+    _finishdatamigration(ui, srcrepo, dstrepo, requirements)
 
     ui.write(_('data fully migrated to temporary repository\n'))