~brz/brz-debian/byoci

« back to all changes in this revision

Viewing changes to quilt.py

  • Committer: Jelmer Vernooij
  • Date: 2017-11-14 04:33:50 UTC
  • mto: This revision was merged to the branch mainline in revision 776.
  • Revision ID: jelmer@jelmer.uk-20171114043350-e8kd31e7pmz33a0j
Swap arguments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
    """Find the list of applied quilt patches.
154
154
 
155
155
    """
156
 
    file_id = tree.path2id(".pc/applied-patches")
157
 
    if file_id is None:
158
 
        return []
159
156
    try:
160
157
        return [patch.rstrip("\n") for patch in
161
 
            tree.get_file_lines(file_id, ".pc/applied-patches")
 
158
            tree.get_file_lines(".pc/applied-patches")
162
159
            if patch.strip() != ""]
 
160
    except errors.NoSuchFile:
 
161
        return []
163
162
    except (IOError, OSError), e:
164
163
        if e.errno == errno.ENOENT:
165
164
            # File has already been removed
194
193
 
195
194
    :param tree: Tree to read from
196
195
    """
197
 
    file_id = tree.path2id("debian/patches/series")
198
 
    if file_id is None:
199
 
        return []
200
196
    try:
201
197
        return [patch.rstrip("\n") for patch in
202
 
            tree.get_file_lines(file_id, "debian/patches/series")
 
198
            tree.get_file_lines("debian/patches/series")
203
199
            if patch.strip() != ""]
204
200
    except (IOError, OSError), e:
205
201
        if e.errno == errno.ENOENT:
206
202
            # File has already been removed
207
203
            return []
208
204
        raise
 
205
    except errors.NoSuchFile:
 
206
        return []