/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
4869.4.1 by Andrew Bennetts
Add plugin for merging bzr's NEWS file to contrib/.
1
# Copyright (C) 2010 Canonical Ltd
2
#
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
5131.2.2 by Martin
Catch a couple of missed plugin module docstrings, note need for assignment to __doc__ in developer documentation and NEWS
17
__doc__ = """Merge hook for bzr's NEWS file.
4869.4.1 by Andrew Bennetts
Add plugin for merging bzr's NEWS file to contrib/.
18
4869.3.27 by Andrew Bennetts
Move news_merge plugin from contrib to bzrlib/plugins, change it to be enabled via a 'news_merge_files' config option, move more code out of the __init__ to minimise overhead, and add lots of docstrings, add NEWS entry.
19
To enable this plugin, add a section to your branch.conf or location.conf
20
like::
21
22
    [/home/user/code/bzr]
23
    news_merge_files = NEWS
24
25
The news_merge_files config option takes a list of file paths, separated by
26
commas.
27
28
Limitations:
29
30
* if there's a conflict in more than just bullet points, this doesn't yet know
31
  how to resolve that, so bzr will fallback to the default line-based merge.
4869.4.1 by Andrew Bennetts
Add plugin for merging bzr's NEWS file to contrib/.
32
"""
33
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
34
# Since we are a built-in plugin we share the breezy version
7143.11.1 by Jelmer Vernooij
Remove some unused imports.
35
from ... import version_info  # noqa: F401
6624 by Jelmer Vernooij
Merge Python3 porting work ('py3 pokes')
36
from ...hooks import install_lazy_named_hook
4869.4.1 by Andrew Bennetts
Add plugin for merging bzr's NEWS file to contrib/.
37
38
4797.5.1 by Robert Collins
Support state on per-file merging to permit more efficient use of configuration data.
39
def news_merge_hook(merger):
40
    """Merger.merge_file_content hook for bzr-format NEWS files."""
6624 by Jelmer Vernooij
Merge Python3 porting work ('py3 pokes')
41
    from .news_merge import NewsMerger
5622.3.14 by Jelmer Vernooij
use lazy hook installation in bundled plugins.
42
    return NewsMerger(merger)
43
44
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
45
install_lazy_named_hook("breezy.merge", "Merger.hooks", "merge_file_content",
7143.15.2 by Jelmer Vernooij
Run autopep8.
46
                        news_merge_hook, "NEWS file merge")
4869.3.34 by Vincent Ladeuil
Finish the patch based on reviews.
47
48
7045.1.1 by Jelmer Vernooij
Fix another 300 tests.
49
def test_suite():
50
    from . import tests
51
    return tests.test_suite()