mercurial/__init__.py
author Martin von Zweigbergk <martinvonz@google.com>
Tue, 01 Jun 2021 15:19:08 -0700
changeset 47372 9e6e12e1a87e
parent 43106 d783f945a701
child 48875 6000f5b25c9b
permissions -rw-r--r--
merge: make applyupdates() not mutate mresult argument We have an extension at work that overrides `merge.applyupdates()` to make it skip some writes and instead instruct the virtual filesystem we use to get a different version. That override doesn't work correctly when doing `hg co -m` and there's a modified file in the dirstate that's deleted in the destination. That's because `applyupdates()` mutates its `mresult` argument and our extension had passed in a modified copied of `mresult` to the overridden function, which resulted in the mutation not having any effect. This patch fixes that by letting the caller (i.e. `merge._update()`) update `mresult` with the extra actions instead. Besides fixing our internal extension, that seems cleaner to me anyway (better to not mutate `mresult` only in some cases and we can skip some of the logic if we're not going to update the dirstate anyway). Differential Revision: https://phab.mercurial-scm.org/D10830

# __init__.py - Startup and module loading logic for Mercurial.
#
# Copyright 2015 Gregory Szorc <gregory.szorc@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.

from __future__ import absolute_import

# Allow 'from mercurial import demandimport' to keep working.
import hgdemandimport

demandimport = hgdemandimport