Bug 3916 - relink could check if the files are on the same device before collecting the files
Summary: relink could check if the files are on the same device before collecting the ...
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: relink (show other bugs)
Version: earlier
Hardware: PC Windows
: wish feature
Assignee: Simon Heimberg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-01 13:32 UTC by Simon Heimberg
Modified: 2017-11-01 18:05 UTC (History)
5 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Heimberg 2013-05-01 13:32 UTC
relink first checks the candidate files and then checks if the files are located on the same device. I do not see any disadvantages by checking the device first. This would result in a speedup when a repo on a network drive is selected by accident.

Currently samedevice is checked in prune() for every file. This should probably be kept. But it could additionaly be tested for the repo folder (.hg, .hg/store or ...) in relink() before calling collect().
Comment 1 Matt Mackall 2013-05-01 15:33 UTC
$ hg --config extensions.churn= churn hgext/relink.py | head
jesse.glick@sun.com              149 ****************************************************************
mg@lazybytes.net                  49 *********************
timeless@gmail.com                26 ***********
sid.bugzilla@gmail.com            24 **********
mpm@selenic.com                   16 *******
mg@aragost.com                     9 ****
durin42@gmail.com                  5 **
adrian@cadifra.com                 2 *
benoit.boissinot@ens-lyon.org      2 *
brodie@bitheap.org                 2 *
Comment 2 Jesse Glick 2013-05-01 15:50 UTC
For what it’s worth I (formerly jesse.glick@sun.com) no longer use Mercurial on a regular basis, so I am not likely to be submitting new patches.
Comment 3 HG Bot 2013-11-22 18:30 UTC
Fixed by http://selenic.com/repo/hg/rev/c69e5911888d
Simon Heimberg <simohe@besonet.ch>
relink: abort earlier when on different devices (issue3916)

Add a first check of the devices before collecting candidate files. This is
much quicker when big repos are on different devices.
Keep the existing check in prune. It checks for same device of the files. This
could probably be different in a special repo store (with symlinks).

(please test the fix)