Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.py @ 44999:d1471dbbdd63
merge: don't grab wlock when merging in memory
I noticed this because we have an internal extension that does an
in-memory rebase while holding only a repo lock, which resulted in a
developer warning about the working copy lock being taken after the
repo lock.
Differential Revision: https://phab.mercurial-scm.org/D8665
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 24 Jun 2020 23:17:56 -0700 |
parents | 818b4f19ef23 |
children | a56ba57c837d |
comparison
equal
deleted
inserted
replaced
44998:f2de8f31cb59 | 44999:d1471dbbdd63 |
---|---|
1570 UPDATECHECK_LINEAR, | 1570 UPDATECHECK_LINEAR, |
1571 UPDATECHECK_NO_CONFLICT, | 1571 UPDATECHECK_NO_CONFLICT, |
1572 ), | 1572 ), |
1573 ) | 1573 ) |
1574 ) | 1574 ) |
1575 with repo.wlock(): | 1575 if wc is not None and wc.isinmemory(): |
1576 maybe_wlock = util.nullcontextmanager() | |
1577 else: | |
1578 maybe_wlock = repo.wlock() | |
1579 with maybe_wlock: | |
1576 if wc is None: | 1580 if wc is None: |
1577 wc = repo[None] | 1581 wc = repo[None] |
1578 pl = wc.parents() | 1582 pl = wc.parents() |
1579 p1 = pl[0] | 1583 p1 = pl[0] |
1580 p2 = repo[node] | 1584 p2 = repo[node] |