Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 28503:138ec8835e63
hg: acquire wlock while updating the working directory via updatetotally
updatetotally() might be invoked outside wlock scope (e.g. invocation
via postincoming() at "hg unbundle" or "hg pull").
In such case, acquisition of wlock is needed for consistent view,
because parallel "hg update" and/or "hg bookmarks" might change
working directory status while executing updatetotally().
Strictly speaking, truly consistent updating should acquire also store
lock, because active bookmark might be moved to another one outside
wlock scope (e.g. pulling from other repository causes updating
current active one).
Acquisition of wlock in this patch ensures consistency in as same
level as past "hg update".
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sat, 12 Mar 2016 04:35:42 +0900 |
parents | 66513f6ca038 |
children | 0e330d7d9f53 |
comparison
equal
deleted
inserted
replaced
28502:e0d19d955608 | 28503:138ec8835e63 |
---|---|
712 :clean: whether changes in the working directory can be discarded | 712 :clean: whether changes in the working directory can be discarded |
713 :check: whether changes in the working directory should be checked | 713 :check: whether changes in the working directory should be checked |
714 | 714 |
715 This returns whether conflict is detected at updating or not. | 715 This returns whether conflict is detected at updating or not. |
716 """ | 716 """ |
717 if True: | 717 with repo.wlock(): |
718 movemarkfrom = None | 718 movemarkfrom = None |
719 warndest = False | 719 warndest = False |
720 if checkout is None: | 720 if checkout is None: |
721 updata = destutil.destupdate(repo, clean=clean, check=check) | 721 updata = destutil.destupdate(repo, clean=clean, check=check) |
722 checkout, movemarkfrom, brev = updata | 722 checkout, movemarkfrom, brev = updata |