##// END OF EJS Templates
util: use ~ as a suffix for a temp file in the same directory as a source file...
util: use ~ as a suffix for a temp file in the same directory as a source file Tools like Buck have patterns to ignore the creation of files (in the working copy) that match certain patterns: https://github.com/facebook/buck/blob/39278a4f0701c5239eae148968dc1ed4cc8661f7/src/com/facebook/buck/cli/Main.java#L259-L299 When Buck sees a new source file (as reported by Watchman), it has to invalidate a number of caches associated with the directory that contains the file. Using a standard suffix, such as `~`, would make it easier for Buck and others to filter out these types of file creation events. The other uses of `tempfile.mkstemp()` in Hg do not appear to be problematic because they (generally speaking) do not specify the `dir` parameter, so the new file is created in the system-appropriate temp directory, which is outside the working copy. Test Plan: `make tests` Differential Revision: https://phab.mercurial-scm.org/D468

File last commit:

r30494:c1149533 default
r34004:2ad02863 default
Show More
mergeutil.py
22 lines | 701 B | text/x-python | PythonLexer
# mergeutil.py - help for merge processing in mercurial
#
# Copyright 2005-2007 Matt Mackall <mpm@selenic.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
from .i18n import _
from . import (
error,
)
def checkunresolved(ms):
if list(ms.unresolved()):
raise error.Abort(_("unresolved merge conflicts "
"(see 'hg help resolve')"))
if ms.mdstate() != 's' or list(ms.driverresolved()):
raise error.Abort(_('driver-resolved merge conflicts'),
hint=_('run "hg resolve --all" to resolve'))