Show More
@@ -2201,7 +2201,19 b' def debuglocks(ui, repo, **opts):' | |||||
2201 | except error.LockHeld: |
|
2201 | except error.LockHeld: | |
2202 | raise error.Abort(_(b'lock is already held')) |
|
2202 | raise error.Abort(_(b'lock is already held')) | |
2203 | if len(locks): |
|
2203 | if len(locks): | |
2204 | ui.promptchoice(_(b"ready to release the lock (y)? $$ &Yes")) |
|
2204 | try: | |
|
2205 | if ui.interactive(): | |||
|
2206 | prompt = _(b"ready to release the lock (y)? $$ &Yes") | |||
|
2207 | ui.promptchoice(prompt) | |||
|
2208 | else: | |||
|
2209 | msg = b"%d locks held, waiting for signal\n" | |||
|
2210 | msg %= len(locks) | |||
|
2211 | ui.status(msg) | |||
|
2212 | while True: # XXX wait for a signal | |||
|
2213 | time.sleep(0.1) | |||
|
2214 | except KeyboardInterrupt: | |||
|
2215 | msg = b"signal-received releasing locks\n" | |||
|
2216 | ui.status(msg) | |||
2205 | return 0 |
|
2217 | return 0 | |
2206 | finally: |
|
2218 | finally: | |
2207 | release(*locks) |
|
2219 | release(*locks) |
General Comments 0
You need to be logged in to leave comments.
Login now