changeset 13659:a73f38d8bbdb

merge with stable
author Martin Geisler <mg@lazybytes.net>
date Wed, 16 Mar 2011 16:07:06 +0100
parents 0e200e1801f4 (current diff) 6cc306093b99 (diff)
children a56c1b2bff18
files hgext/relink.py tests/test-relink.t
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/relink.py	Wed Mar 16 13:51:47 2011 +0100
+++ b/hgext/relink.py	Wed Mar 16 16:07:06 2011 +0100
@@ -42,8 +42,12 @@
         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))
+    if repo.root == src.root:
+        ui.status(_('there is nothing to relink\n'))
+        return
+
     locallock = repo.lock()
     try:
         remotelock = src.lock()
--- a/tests/test-relink.t	Wed Mar 16 13:51:47 2011 +0100
+++ b/tests/test-relink.t	Wed Mar 16 16:07:06 2011 +0100
@@ -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')"