diff hgext/relink.py @ 13657:b69102740e57 stable

relink: avoid trying to lock the same repo twice
author Martin Geisler <mg@lazybytes.net>
date Wed, 16 Mar 2011 15:34:10 +0100
parents 0793d763e413
children 6cc306093b99
line wrap: on
line diff
--- a/hgext/relink.py	Mon Mar 14 21:35:31 2011 +0100
+++ b/hgext/relink.py	Wed Mar 16 15:34:10 2011 +0100
@@ -44,6 +44,10 @@
     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'))
+        return
+
     locallock = repo.lock()
     try:
         remotelock = src.lock()