178 |
178 |
179 if repo.svfs.tryunlink(b'lock'): |
179 if repo.svfs.tryunlink(b'lock'): |
180 ui.status(_(b'had to break store lock\n')) |
180 ui.status(_(b'had to break store lock\n')) |
181 if repo.vfs.tryunlink(b'wlock'): |
181 if repo.vfs.tryunlink(b'wlock'): |
182 ui.status(_(b'had to break working copy lock\n')) |
182 ui.status(_(b'had to break working copy lock\n')) |
183 |
183 # If another process relock after the breacking above, the next locking |
184 ui.status(_(b'recovering after interrupted transaction, if any\n')) |
184 # will have to wait. |
185 repo.recover() |
185 with repo.wlock(), repo.lock(): |
186 |
186 ui.status(_(b'recovering after interrupted transaction, if any\n')) |
187 ui.status(_(b'pulling from %s\n') % source) |
187 repo.recover() |
188 if repo_created and not opts.get('initial_clone_minimal'): |
188 |
189 pull_revs = [] |
189 ui.status(_(b'pulling from %s\n') % source) |
190 else: |
190 if repo_created and not opts.get('initial_clone_minimal'): |
191 pull_revs = [rev] |
191 pull_revs = [] |
192 overrides = {(b'ui', b'quiet'): True} |
192 else: |
193 with repo.ui.configoverride(overrides, b'chainsaw-update'): |
193 pull_revs = [rev] |
194 pull = cmdutil.findcmd(b'pull', commands.table)[1][0] |
194 overrides = {(b'ui', b'quiet'): True} |
195 pull(repo.ui, repo, source, rev=pull_revs, remote_hidden=False) |
195 with repo.ui.configoverride(overrides, b'chainsaw-update'): |
196 |
196 pull = cmdutil.findcmd(b'pull', commands.table)[1][0] |
197 purge = cmdutil.findcmd(b'purge', commands.table)[1][0] |
197 pull(repo.ui, repo, source, rev=pull_revs, remote_hidden=False) |
198 purge( |
198 |
199 ui, |
199 purge = cmdutil.findcmd(b'purge', commands.table)[1][0] |
200 repo, |
200 purge( |
201 dirs=True, |
201 ui, |
202 all=opts.get('purge_ignored'), |
202 repo, |
203 files=opts.get('purge_unknown'), |
203 dirs=True, |
204 confirm=False, |
204 all=opts.get('purge_ignored'), |
205 ) |
205 files=opts.get('purge_unknown'), |
206 |
206 confirm=False, |
207 ui.status(_(b'updating to revision \'%s\'\n') % rev) |
|
208 update = cmdutil.findcmd(b'update', commands.table)[1][0] |
|
209 update(ui, repo, rev=rev, clean=True) |
|
210 |
|
211 ui.status( |
|
212 _( |
|
213 b'chainsaw-update to revision \'%s\' ' |
|
214 b'for repository at \'%s\' done\n' |
|
215 ) |
207 ) |
216 % (rev, repo.root) |
208 |
217 ) |
209 ui.status(_(b'updating to revision \'%s\'\n') % rev) |
|
210 update = cmdutil.findcmd(b'update', commands.table)[1][0] |
|
211 update(ui, repo, rev=rev, clean=True) |
|
212 |
|
213 ui.status( |
|
214 _( |
|
215 b'chainsaw-update to revision \'%s\' ' |
|
216 b'for repository at \'%s\' done\n' |
|
217 ) |
|
218 % (rev, repo.root) |
|
219 ) |