~jelmer/brz-debian/git-import-fixes

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Jelmer Vernooij
  • Date: 2018-10-11 19:03:39 UTC
  • Revision ID: jelmer@jelmer.uk-20181011190339-i3o9k7727avblg9u
More python3 fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
155
155
            j1, j2 = group[0][3], group[-1][4]
156
156
            for line in new_text[j1:j2]:
157
157
                if line.startswith(b"  "):
 
158
                    # Debian Policy Manual states that debian/changelog must be UTF-8
158
159
                    changes.append(line.decode('utf-8'))
159
160
    if not changes:
160
161
        return start_message
 
162
 
161
163
    from .util import strip_changelog_message
162
164
    changes = strip_changelog_message(changes)
163
 
    return "".join(changes)
 
165
 
 
166
    return ''.join(changes)
164
167
 
165
168
 
166
169
def debian_changelog_commit(commit, start_message):
167
170
    """hooked into breezy.msgeditor set_commit_message.
168
171
     Set the commit message from debian/changelog and set any LP: #1234 to bug
169
172
     fixed tags."""
170
 
    from .util import (
171
 
        debuild_config, find_bugs_fixed)
 
173
    from .util import debuild_config, find_bugs_fixed
172
174
 
173
175
    t = commit.work_tree
174
176
    config = debuild_config(t, False)
182
184
    bugs_fixed = find_bugs_fixed([changes], commit.work_tree.branch)
183
185
    commit.builder._revprops["bugs"] = "\n".join(bugs_fixed)
184
186
 
185
 
    # Debian Policy Manual states that debian/changelog must be UTF-8
186
 
    return changes.decode("utf-8")
 
187
    return changes
187
188
 
188
189
 
189
190
def changelog_merge_hook_factory(merger):