Mercurial > hg
comparison hgext/chainsaw.py @ 51431:fe68a2dc0bf2
chainsaw-update: log actual locks breaking
Previously, the command would simply state that it was about
to break locks, not if there was actually some to break.
This version is race-free. It would be also possible to display
the content of the lock before hand (not race-free but informative
in almost all cases).
author | Georges Racinet <georges.racinet@octobus.net> |
---|---|
date | Wed, 17 Jan 2024 14:39:06 +0100 |
parents | bc88aa7472de |
children | d36a81d70f25 |
comparison
equal
deleted
inserted
replaced
51430:187c5769a629 | 51431:fe68a2dc0bf2 |
---|---|
118 source = opts['source'] | 118 source = opts['source'] |
119 if not rev: | 119 if not rev: |
120 raise error.InputError(_(b'specify a target revision with --rev')) | 120 raise error.InputError(_(b'specify a target revision with --rev')) |
121 if not source: | 121 if not source: |
122 raise error.InputError(_(b'specify a pull path with --source')) | 122 raise error.InputError(_(b'specify a pull path with --source')) |
123 ui.status(_(b'breaking locks, if any\n')) | 123 if repo.svfs.tryunlink(b'lock'): |
124 repo.svfs.tryunlink(b'lock') | 124 ui.status(_(b'had to break store lock\n')) |
125 repo.vfs.tryunlink(b'wlock') | 125 if repo.vfs.tryunlink(b'wlock'): |
126 ui.status(_(b'had to break working copy lock\n')) | |
126 | 127 |
127 ui.status(_(b'recovering after interrupted transaction, if any\n')) | 128 ui.status(_(b'recovering after interrupted transaction, if any\n')) |
128 repo.recover() | 129 repo.recover() |
129 | 130 |
130 ui.status(_(b'pulling from %s\n') % source) | 131 ui.status(_(b'pulling from %s\n') % source) |