summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-01-29 13:42:38 +0100
committerGuido Günther <agx@sigxcpu.org>2017-01-29 13:42:46 +0100
commit22013adfd525378a278676b5f0b4d66834f17afa (patch)
tree48124037869f173fc20fe082a4e7cc33cc94fd09
parentfd7a3775dc6df2bf38e804533b3df153690524b3 (diff)
pq: Filter out comments from series diff
When creating the delta of added and dropped pachtches ignore comment lines in the series file. Closes: #852817
-rwxr-xr-xgbp/scripts/pq.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/gbp/scripts/pq.py b/gbp/scripts/pq.py
index 18191a14..2693d30d 100755
--- a/gbp/scripts/pq.py
+++ b/gbp/scripts/pq.py
@@ -1,6 +1,6 @@
# vim: set fileencoding=utf-8 :
#
-# (C) 2011,2014 Guido Günther <agx@sigxcpu.org>
+# (C) 2011,2014,2017 Guido Günther <agx@sigxcpu.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@@ -112,14 +112,14 @@ def compare_series(old, new):
"""
Compare new pathes to lists of patches already exported
- >>> compare_series(['a', 'b'], ['b', 'c'])
+ >>> compare_series(['# comment', 'a', 'b'], ['b', 'c'])
(['c'], ['a'])
>>> compare_series([], [])
([], [])
"""
added = set(new).difference(old)
- removed = set(old).difference(new)
- return (list(added), list(removed))
+ removed = [l for l in set(old).difference(new) if not l.startswith('#')]
+ return (list(added), removed)
def format_series_diff(added, removed, options):