~bzr-builddeb-hackers/bzr-builddeb/trunk

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Jelmer Vernooij
  • Date: 2012-01-13 10:25:27 UTC
  • mfrom: (678.4.6 pre-commit-quilt)
  • Revision ID: jelmer@samba.org-20120113102527-utbchrplx5nnzixx
Add pre-commit hook that warns about applied quilt patches, and can
automatically unapply/apply all quilt patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
    return db.tag_name(changelog.version)
192
192
 
193
193
 
 
194
def start_commit_check_quilt(tree):
 
195
    """start_commit hook which checks the state of quilt patches.
 
196
    """
 
197
    if tree.path2id("debian/patches") is None:
 
198
        # No patches to worry about
 
199
        return
 
200
    from bzrlib.plugins.builddeb.merge_quilt import start_commit_quilt_patches
 
201
    start_commit_quilt_patches(tree)
 
202
 
 
203
 
194
204
def pre_merge(merger):
195
205
    pre_merge_fix_ancestry(merger)
196
206
    pre_merge_quilt(merger)
359
369
        "bzrlib.mutabletree", "MutableTree.hooks",
360
370
        'post_build_tree', post_build_tree_quilt,
361
371
        'Applying quilt patches.')
362
 
 
 
372
    install_lazy_named_hook(
 
373
        "bzrlib.mutabletree", "MutableTree.hooks",
 
374
        "start_commit", start_commit_check_quilt,
 
375
        "Check for (un)applied quilt patches")
363
376
 
364
377
try:
365
378
    from bzrlib.revisionspec import revspec_registry