/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/plugins/quilt/wrapper.py

  • Committer: Jelmer Vernooij
  • Date: 2019-06-22 11:51:56 UTC
  • mfrom: (7356 work)
  • mto: This revision was merged to the branch mainline in revision 7358.
  • Revision ID: jelmer@jelmer.uk-20190622115156-20uwy6b97g94bbv1
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    )
33
33
 
34
34
 
 
35
DEFAULT_PATCHES_DIR = 'patches'
 
36
DEFAULT_SERIES_FILE = 'series'
 
37
 
 
38
 
35
39
class QuiltError(errors.BzrError):
36
40
 
37
41
    _fmt = "An error (%(retcode)d) occurred running quilt: %(stderr)s%(extra)s"
68
72
    if patches_dir is not None:
69
73
        env["QUILT_PATCHES"] = patches_dir
70
74
    else:
71
 
        env["QUILT_PATCHES"] = os.path.join(working_dir, "patches")
 
75
        env["QUILT_PATCHES"] = os.path.join(working_dir, DEFAULT_PATCHES_DIR)
72
76
    if series_file is not None:
73
77
        env["QUILT_SERIES"] = series_file
74
78
    else:
75
 
        env["QUILT_SERIES"] = os.path.join(env["QUILT_PATCHES"], "series")
 
79
        env["QUILT_SERIES"] = DEFAULT_SERIES_FILE
76
80
    # Hide output if -q is in use.
77
81
    if quiet is None:
78
82
        quiet = trace.is_quiet()
212
216
        raise
213
217
 
214
218
 
215
 
def quilt_series(tree, series_file):
 
219
def quilt_series(tree, series_path):
216
220
    """Find the list of patches.
217
221
 
218
222
    :param tree: Tree to read from
219
223
    """
220
224
    try:
221
225
        return [patch.rstrip(b"\n").decode(osutils._fs_enc) for patch in
222
 
                tree.get_file_lines(series_file)
 
226
                tree.get_file_lines(series_path)
223
227
                if patch.strip() != b""]
224
228
    except (IOError, OSError) as e:
225
229
        if e.errno == errno.ENOENT: