diff --git a/hgext/relink.py b/hgext/relink.py index 0e200e1801f4741f52ce8525ca874369a96b6e5a_aGdleHQvcmVsaW5rLnB5..a73f38d8bbdbab6c8d30b3149daf79546c2d33ef_aGdleHQvcmVsaW5rLnB5 100644 --- a/hgext/relink.py +++ b/hgext/relink.py @@ -42,5 +42,5 @@ hg.remoteui(repo, opts), ui.expandpath(origin or 'default-relink', origin or 'default')) if not src.local(): - raise util.Abort('must specify local origin repository') + raise util.Abort(_('must specify local origin repository')) ui.status(_('relinking %s to %s\n') % (src.store.path, repo.store.path)) @@ -46,4 +46,8 @@ 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')) + return + locallock = repo.lock() try: remotelock = src.lock() diff --git a/tests/test-relink.t b/tests/test-relink.t index 0e200e1801f4741f52ce8525ca874369a96b6e5a_dGVzdHMvdGVzdC1yZWxpbmsudA==..a73f38d8bbdbab6c8d30b3149daf79546c2d33ef_dGVzdHMvdGVzdC1yZWxpbmsudA== 100644 --- a/tests/test-relink.t +++ b/tests/test-relink.t @@ -36,6 +36,13 @@ $ cat $TESTDIR/binfile.bin >> b $ hg ci -m anotherchange +don't sit forever trying to double-lock the source repo + + $ hg relink . + relinking $TESTTMP/repo/.hg/store to $TESTTMP/repo/.hg/store + there is nothing to relink + + Test files are read in binary mode $ python -c "file('.hg/store/data/dummy.i', 'wb').write('a\r\nb\n')"