Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 42528:e079e001d536
rebase: fix in-memory rebasing of copy of empty file
Classic Python mistake of unintentionally treating None and empty
string the same.
Differential Revision: https://phab.mercurial-scm.org/D6570
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 24 Jun 2019 16:01:22 -0700 |
parents | 87a34c767384 |
children | 97b03f0e7c7b |
comparison
equal
deleted
inserted
replaced
42527:4a6826868625 | 42528:e079e001d536 |
---|---|
2157 # data not provided, let's see if we already have some; if not, let's | 2157 # data not provided, let's see if we already have some; if not, let's |
2158 # grab it from our underlying context, so that we always have data if | 2158 # grab it from our underlying context, so that we always have data if |
2159 # the file is marked as existing. | 2159 # the file is marked as existing. |
2160 if exists and data is None: | 2160 if exists and data is None: |
2161 oldentry = self._cache.get(path) or {} | 2161 oldentry = self._cache.get(path) or {} |
2162 data = oldentry.get('data') or self._wrappedctx[path].data() | 2162 data = oldentry.get('data') |
2163 if data is None: | |
2164 data = self._wrappedctx[path].data() | |
2163 | 2165 |
2164 self._cache[path] = { | 2166 self._cache[path] = { |
2165 'exists': exists, | 2167 'exists': exists, |
2166 'data': data, | 2168 'data': data, |
2167 'date': date, | 2169 'date': date, |