~jelmer/brz-debian/stop-bundling-quilt

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Jelmer Vernooij
  • Date: 2019-06-08 22:20:09 UTC
  • Revision ID: jelmer@jelmer.uk-20190608222009-jt4xrkrl66mnfdrm
Move start_commit_check_quilt.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
import breezy
31
31
from ...commands import plugin_cmds
32
 
from ...config import option_registry, Option, bool_from_store
33
32
from ...sixish import (
34
33
    viewitems,
35
34
    )
199
198
    return db.tag_name(changelog.version)
200
199
 
201
200
 
202
 
def start_commit_check_quilt(tree):
203
 
    """start_commit hook which checks the state of quilt patches.
204
 
    """
205
 
    if not tree.is_versioned("debian/patches"):
206
 
        # No patches to worry about
207
 
        return
208
 
    from . import util
209
 
    this_source_format = util.tree_get_source_format(tree)
210
 
    if this_source_format != util.FORMAT_3_0_QUILT:
211
 
        trace.mutter("skipping smart quilt merge, not a 3.0 (quilt) tree.")
212
 
        return
213
 
    config = util.debuild_config(tree)
214
 
    policy = config.quilt_commit_policy
215
 
    from .quilt.merge import start_commit_quilt_patches
216
 
    start_commit_quilt_patches(tree, policy)
217
 
 
218
 
 
219
201
def post_merge_quilt_cleanup(merger):
220
202
    import shutil
221
203
    for dir in getattr(merger, "_quilt_tempdirs", []):
296
278
    "breezy.mutabletree", "MutableTree.hooks",
297
279
    'post_build_tree', post_build_tree_quilt,
298
280
    'Applying quilt patches.')
299
 
install_lazy_named_hook(
300
 
    "breezy.mutabletree", "MutableTree.hooks",
301
 
    "start_commit", start_commit_check_quilt,
302
 
    "Check for (un)applied quilt patches")
303
 
 
304
 
option_registry.register(
305
 
    Option('quilt.smart_merge', default=True, from_unicode=bool_from_store,
306
 
           help="Unapply quilt patches before merging."))
307
 
 
308
281
 
309
282
def load_tests(loader, basic_tests, pattern):
310
283
    basic_tests.addTest(