hg
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Wed, 25 Mar 2015 13:55:35 +0900
changeset 24472 1bf71faf042e
parent 21812 73e4a02e6d23
child 29172 2ea9c9aa6e60
permissions -rwxr-xr-x
cmdutil: allow bailifchanged to ignore merging in progress In "commands.update()", "cmdutil.bailifchanged()" isn't used for "abort if the working directory is dirty", because it forcibly examines about merging in progress. "workingctx.dirty()" used in "commands.update()" can't detect changes of largefiles in the working directory without "repo.lfstatus = True" wrapping. This is only reason of "commands.update()" wrapping by largefiles extension. On the other hand, "cmdutil.bailifchanged()" already wrapped by largefiles extension can detect changes of largefiles. This patch is a preparations for replacing "workingctx.dirty()" and raising Abort in "commands.update()" by "cmdutil.bailifchanged()". It can remove redundant "commands.update()" wrapping.

#!/usr/bin/env python
#
# mercurial - scalable distributed SCM
#
# 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.

import os
import sys

if os.environ.get('HGUNICODEPEDANTRY', False):
    reload(sys)
    sys.setdefaultencoding("undefined")


libdir = '@LIBDIR@'

if libdir != '@' 'LIBDIR' '@':
    if not os.path.isabs(libdir):
        libdir = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                              libdir)
        libdir = os.path.abspath(libdir)
    sys.path.insert(0, libdir)

# enable importing on demand to reduce startup time
try:
    from mercurial import demandimport; demandimport.enable()
except ImportError:
    import sys
    sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
                     ' '.join(sys.path))
    sys.stderr.write("(check your install and PYTHONPATH)\n")
    sys.exit(-1)

import mercurial.util
import mercurial.dispatch

for fp in (sys.stdin, sys.stdout, sys.stderr):
    mercurial.util.setbinary(fp)

mercurial.dispatch.run()