##// END OF EJS Templates
split: new extension to split changesets...
split: new extension to split changesets This diff introduces an experimental split extension to split changesets. The implementation is largely inspired by Laurent Charignon's implementation for mutable-history (changeset 9603aa1ecdfd54b0d86e262318a72e0a2ffeb6cc [1]) This version contains various improvements: - Rebase by default. This is more friendly for new users. Split won't lead to merge conflicts so a rebase won't give the user more trouble. This has been on by default at Facebook for months now and seems to be a good UX improvement. The rebase skips obsoleted or orphaned changesets, which can avoid issues like allowdivergence, merge conflicts, etc. This is more flexible because the user can decide what to do next (see the last test case in test-split.t) - Remove "Done split? [y/n]" prompt. That could be detected by checking `repo.status()` instead. - Works with obsstore disabled. Without obsstore, split uses strip to clean up old nodes, and it can even handle split a non-head changeset with "allowunstable" disabled, since it runs a rebase to solve the "unstable" issue in a same transaction. - More friendly editor text. Put what has been already split into the editor text so users won't lost track about where they are. [1]: https://bitbucket.org/marmoute/mutable-history/commits/9603aa1ecdfd54b Differential Revision: https://phab.mercurial-scm.org/D1082

File last commit:

r33862:3cfc9070 default
r35471:02ea370c @7 default
Show More
__init__.py
79 lines | 2.4 KiB | text/x-python | PythonLexer
Siddharth Agarwal
demandimport: move to separate package...
r32420 # hgdemandimport - global demand-loading of modules for Mercurial
#
# Copyright 2017 Facebook Inc.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''demandimport - automatic demand-loading of modules'''
# This is in a separate package from mercurial because in Python 3,
# demand loading is per-package. Keeping demandimport in the mercurial package
# would disable demand loading for any modules in mercurial.
from __future__ import absolute_import
Jun Wu
demandimport: move HGDEMANDIMPORT test to __init__.py...
r33861 import os
Siddharth Agarwal
demandimport: move ignore list to __init__.py...
r32422 import sys
Siddharth Agarwal
demandimport: add python 3 implementation...
r32423 if sys.version_info[0] >= 3:
from . import demandimportpy3 as demandimport
else:
from . import demandimportpy2 as demandimport
Siddharth Agarwal
demandimport: move to separate package...
r32420
Siddharth Agarwal
demandimport: move ignore list to __init__.py...
r32422 # Extensions can add to this list if necessary.
ignore = [
'__future__',
'_hashlib',
# ImportError during pkg_resources/__init__.py:fixup_namespace_package
'_imp',
'_xmlplus',
'fcntl',
'nt', # pathlib2 tests the existence of built-in 'nt' module
'win32com.gen_py',
'win32com.shell', # 'appdirs' tries to import win32com.shell
'_winreg', # 2.7 mimetypes needs immediate ImportError
'pythoncom',
# imported by tarfile, not available under Windows
'pwd',
'grp',
# imported by profile, itself imported by hotshot.stats,
# not available under Windows
'resource',
# this trips up many extension authors
'gtk',
# setuptools' pkg_resources.py expects "from __main__ import x" to
# raise ImportError if x not defined
'__main__',
'_ssl', # conditional imports in the stdlib, issue1964
'_sre', # issue4920
'rfc822',
'mimetools',
'sqlalchemy.events', # has import-time side effects (issue5085)
# setuptools 8 expects this module to explode early when not on windows
'distutils.msvc9compiler',
'__builtin__',
'builtins',
'urwid.command_map', # for pudb
]
_pypy = '__pypy__' in sys.builtin_module_names
if _pypy:
ignore.extend([
# _ctypes.pointer is shadowed by "from ... import pointer" (PyPy 5)
'_ctypes.pointer',
])
demandimport.init(ignore)
Siddharth Agarwal
demandimport: move to separate package...
r32420 # Re-export.
isenabled = demandimport.isenabled
disable = demandimport.disable
deactivated = demandimport.deactivated
Jun Wu
demandimport: move HGDEMANDIMPORT test to __init__.py...
r33861
def enable():
Jun Wu
demandimport: disable if chg is being used...
r33862 # chg pre-imports modules so do not enable demandimport for it
if ('CHGINTERNALMARK' not in os.environ
and os.environ.get('HGDEMANDIMPORT') != 'disable'):
Jun Wu
demandimport: move HGDEMANDIMPORT test to __init__.py...
r33861 demandimport.enable()