Code duplication in Mercurial

Martin Schröder martin.schroeder at nerdluecht.de
Sat Jul 13 17:54:04 CDT 2013


Maybe it would be helpful to publish the output of CloneDigger so that
not everyone needs to run it.

And maybe you can submit patches deduplicating code?

> For the sake of interest today I ran CloneDigger
> (http://clonedigger.sourceforge.net/) on the hg codebase, and it found
> a lot of places with duplicate code there (it counted about 200
> duplicates). Some places have exact the same code, while some differ
> in variable names, or something like this. For example, there are same
> pieces of code in mercurial/hgweb/webcommand.py which are related to
> dealing with number of shown revisions (of course, it's just one
> example). Probably, some of the duplicates are worth moving into
> separate functions (also, there are almost equal different functions,
> which can me merged into one with extra argument). Now I'm writing it
> here just to point at this, as the code duplication can make it more
> difficult to change something in code correctly.
> 
> P.S.: CloneDigger took more than 10 minutes and 1.5 Gb of memory to run.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
> 



More information about the Mercurial-devel mailing list