##// END OF EJS Templates
relink: avoid trying to lock the same repo twice
Martin Geisler -
r13657:b6910274 stable
parent child Browse files
Show More
@@ -44,6 +44,10 b' def relink(ui, repo, origin=None, **opts'
44 if not src.local():
44 if not src.local():
45 raise util.Abort('must specify local origin repository')
45 raise util.Abort('must specify local origin repository')
46 ui.status(_('relinking %s to %s\n') % (src.store.path, repo.store.path))
46 ui.status(_('relinking %s to %s\n') % (src.store.path, repo.store.path))
47 if repo.root == src.root:
48 ui.status(_('there is nothing to relink\n'))
49 return
50
47 locallock = repo.lock()
51 locallock = repo.lock()
48 try:
52 try:
49 remotelock = src.lock()
53 remotelock = src.lock()
@@ -31,6 +31,12 b' create source repository'
31 $ echo a >> b
31 $ echo a >> b
32 $ hg ci -Am changefiles
32 $ hg ci -Am changefiles
33
33
34 don't sit forever trying to double-lock the source repo
35
36 $ hg relink .
37 relinking $TESTTMP/repo/.hg/store to $TESTTMP/repo/.hg/store
38 there is nothing to relink
39
34 Test files are read in binary mode
40 Test files are read in binary mode
35
41
36 $ python -c "file('.hg/store/data/dummy.i', 'wb').write('a\r\nb\n')"
42 $ python -c "file('.hg/store/data/dummy.i', 'wb').write('a\r\nb\n')"
General Comments 0
You need to be logged in to leave comments. Login now