summaryrefslogtreecommitdiff
path: root/hgext/relink.py
diff options
context:
space:
mode:
Diffstat (limited to 'hgext/relink.py')
-rw-r--r--hgext/relink.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/hgext/relink.py b/hgext/relink.py
index f2e6bf1..f4d8f09 100644
--- a/hgext/relink.py
+++ b/hgext/relink.py
@@ -11,8 +11,6 @@ from mercurial import hg, util
from mercurial.i18n import _
import os, stat
-testedwith = 'internal'
-
def relink(ui, repo, origin=None, **opts):
"""recreate hardlinks between two repositories
@@ -38,11 +36,12 @@ def relink(ui, repo, origin=None, **opts):
command is running. (Both repositories will be locked against
writes.)
"""
- if (not util.safehasattr(util, 'samefile') or
- not util.safehasattr(util, 'samedevice')):
+ if not hasattr(util, 'samefile') or not hasattr(util, 'samedevice'):
raise util.Abort(_('hardlinks are not supported on this system'))
src = hg.repository(ui, ui.expandpath(origin or 'default-relink',
origin or 'default'))
+ if not src.local():
+ raise util.Abort(_('must specify local origin repository'))
ui.status(_('relinking %s to %s\n') % (src.store.path, repo.store.path))
if repo.root == src.root:
ui.status(_('there is nothing to relink\n'))
@@ -79,7 +78,7 @@ def collect(src, ui):
dirnames.sort()
relpath = dirpath[len(src) + seplen:]
for filename in sorted(filenames):
- if filename[-2:] not in ('.d', '.i'):
+ if not filename[-2:] in ('.d', '.i'):
continue
st = os.stat(os.path.join(dirpath, filename))
if not stat.S_ISREG(st.st_mode):