Patchwork relink: abort earlier when on different devices (issue3916)

login
register
mail settings
Submitter Simon Heimberg
Date Nov. 11, 2013, 10:03 p.m.
Message ID <879de101e03bc224aa1b.1384207397@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/2910/
State Accepted
Commit c69e5911888d78ea25bfb16fa6ffc59b19faa048
Headers show

Comments

Simon Heimberg - Nov. 11, 2013, 10:03 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1384005058 -3600
#      Sat Nov 09 14:50:58 2013 +0100
# Node ID 879de101e03bc224aa1b7ba0cb00dc1408187b6e
# Parent  72deba4502a34ae9586ebd610979322b037ce523
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).
Matt Mackall - Nov. 22, 2013, 9:35 p.m.
On Mon, 2013-11-11 at 23:03 +0100, Simon Heimberg wrote:
> # HG changeset patch
> # User Simon Heimberg <simohe@besonet.ch>
> # Date 1384005058 -3600
> #      Sat Nov 09 14:50:58 2013 +0100
> # Node ID 879de101e03bc224aa1b7ba0cb00dc1408187b6e
> # Parent  72deba4502a34ae9586ebd610979322b037ce523
> relink: abort earlier when on different devices (issue3916)

Queued for default, thanks.

Patch

diff -r 72deba4502a3 -r 879de101e03b hgext/relink.py
--- a/hgext/relink.py	Sat Nov 09 14:50:46 2013 +0100
+++ b/hgext/relink.py	Sat Nov 09 14:50:58 2013 +0100
@@ -48,6 +48,10 @@ 
         ui.status(_('there is nothing to relink\n'))
         return
 
+    if not util.samedevice(src.store.path, repo.store.path):
+        # No point in continuing
+        raise util.Abort(_('source and destination are on different devices'))
+
     locallock = repo.lock()
     try:
         remotelock = src.lock()