diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-08-09 19:17:37 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-08-09 19:23:20 +0200 |
commit | a8789475a921a1bd87b43e6f30b8f3e8613c0fa7 (patch) | |
tree | a6e02497111ac39a237e5bbd624a2e5364e2a63a | |
parent | 2da9e9ef8c1a045ea5e93ea12b5ab2d60a4f8aff (diff) | |
download | git-buildpackage-a8789475a921a1bd87b43e6f30b8f3e8613c0fa7.tar.gz git-buildpackage-a8789475a921a1bd87b43e6f30b8f3e8613c0fa7.tar.bz2 git-buildpackage-a8789475a921a1bd87b43e6f30b8f3e8613c0fa7.zip |
Ignore comments and empty lines in series files
Closes; #637224
-rw-r--r-- | gbp/pq.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -75,6 +75,9 @@ class PatchQueue(list): <gbp.pq.Patch path='./a' strip=1 >, <gbp.pq.Patch path='./a/b' topic='a' strip=2 >] + >>> PatchQueue._read_series(['# foo', 'a/b', '', '# bar'], '.') + [<gbp.pq.Patch path='./a/b' topic='a' >] + @param series: series of patches in quilt format @type series: iterable of strings @param patch_dir: path prefix to prepend to each patch path @@ -83,6 +86,11 @@ class PatchQueue(list): queue = PatchQueue() for line in series: + try: + if line[0] in [ '\n', '#' ]: + continue + except IndexError: + continue # ignore empty lines queue.append(klass._parse_line(line, patch_dir)) return queue |