[PATCH 2 of 4 V2] copies: refactor checkcopies() into a top level method

Kevin Bullock kbullock+mercurial at ringworld.org
Tue May 7 13:27:33 CDT 2013


On 6 May 2013, at 10:14 PM, Durham Goode wrote:

> # HG changeset patch
> # User Durham Goode <durham at fb.com>
> # Date 1367430261 25200
> #      Wed May 01 10:44:21 2013 -0700
> # Node ID 9557401c5bab0a37d2e6eceb1fd13c66a75463f0
> # Parent  672183bf736b045705760066ef102a0a4cb52cca
> copies: refactor checkcopies() into a top level method
> 
> This moves checkcopies() out of mergecopies() and makes it a top level
> function in the copies module. This allows extensions to override it. For
> example, I'm developing a filelog replacement that doesn't have rev numbers
> so all the rev number dependent implementation here needs to be replaced
> by the extension.
> 
> No logic is changed in this commit.
> 
> diff --git a/mercurial/copies.py b/mercurial/copies.py
> --- a/mercurial/copies.py
> +++ b/mercurial/copies.py
> [...]
> @@ -386,3 +329,64 @@
>                     break
> 
>     return copy, movewithdir, diverge, renamedelete
> +
> +def checkcopies(ctx, f, m1, m2, ca, ma, limit, diverge, copy, fullcopy):

*Wow*, that's a lot of state to pass in. This wants a more complete docstring, and if there's any way to simplify the number of inputs this depends on, I'd do it.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list