diff options
author | Guido Günther <agx@sigxcpu.org> | 2014-10-14 19:18:20 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-10-14 21:52:22 +0200 |
commit | 81dab4be2a8941767b524af79ca22991c0dce109 (patch) | |
tree | 96693ddeae9c42297431338877b5e76ab097c3a1 | |
parent | 8ff800d817989c3d32ef7af829b9a6d962f29ef6 (diff) | |
download | git-buildpackage-81dab4be2a8941767b524af79ca22991c0dce109.tar.gz git-buildpackage-81dab4be2a8941767b524af79ca22991c0dce109.tar.bz2 git-buildpackage-81dab4be2a8941767b524af79ca22991c0dce109.zip |
pq: Don't fail commit if the series file is empty on the source branch
-rwxr-xr-x | gbp/scripts/pq.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gbp/scripts/pq.py b/gbp/scripts/pq.py index d9f49d4f..e78f92cc 100755 --- a/gbp/scripts/pq.py +++ b/gbp/scripts/pq.py @@ -116,8 +116,13 @@ def commit_patches(repo, branch, patches, options): return ([], []) vfs = gbp.git.vfs.GitVfs(repo, branch) - oldseries = vfs.open('debian/patches/series') - oldpatches = [ p.strip() for p in oldseries.readlines() ] + try: + oldseries = vfs.open('debian/patches/series') + oldpatches = [ p.strip() for p in oldseries.readlines() ] + oldseries.close() + except IOError: + # No series file yet + oldpatches = [] newpatches = [ p[len(PATCH_DIR):] for p in patches ] # FIXME: handle case were only the contents of the patches changed |