diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2011-10-01 20:49:36 +0000 |
---|---|---|
committer | Lorry <lorry@roadtrain.codethink.co.uk> | 2012-09-27 13:27:51 +0000 |
commit | 921ced43c48c1d170452a7b251b94cc96ec8dd44 (patch) | |
tree | 3c4a89176ea67fe4c7bf7b375488361a823c95fa /hgext/relink.py | |
parent | 9039c805b0a7e36220101323f82735f08a104b37 (diff) | |
download | mercurial-tarball-921ced43c48c1d170452a7b251b94cc96ec8dd44.tar.gz |
Imported from /srv/lorry/lorry-area/mercurial-tarball/mercurial-1.9.3.tar.gz.HEADmercurial-1.9.3master
Diffstat (limited to 'hgext/relink.py')
-rw-r--r-- | hgext/relink.py | 9 |
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): |