Package: git-buildpackage
Version: 0.6.32
Severity: wishlist
Tags: patch

Hello,

Preserving patch names as the default behaviour for all gbp-pq actions
would simplify its use.

Best regards,

Carlos

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.0.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages git-buildpackage depends on:
ii  devscripts            2.15.5
ii  git                   1:2.1.4-2.1
ii  man-db                2.7.0.2-5
ii  python                2.7.9-1
ii  python-dateutil       2.2-2
ii  python-pkg-resources  17.0-1
ii  python-six            1.9.0-3

Versions of packages git-buildpackage recommends:
ii  cowbuilder       0.73
ii  pbuilder         0.215+nmu4
ii  pristine-tar     1.33
ii  python-requests  2.7.0-3

Versions of packages git-buildpackage suggests:
ii  python-notify  0.1.1-4
ii  unzip          6.0-17

-- no debconf information
>From 7eeca5adf88254235e8d574a7308a6ec975a57db Mon Sep 17 00:00:00 2001
From: Carlos Maddela <[email protected]>
Date: Mon, 13 Jul 2015 21:02:48 +1000
Subject: [PATCH] Preserve patch name when applying single patch also.

---
 gbp/scripts/common/pq.py | 5 +++--
 tests/13_test_gbp_pq.py  | 2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/gbp/scripts/common/pq.py b/gbp/scripts/common/pq.py
index 5580426..2bd4187 100644
--- a/gbp/scripts/common/pq.py
+++ b/gbp/scripts/common/pq.py
@@ -296,8 +296,9 @@ def switch_to_pq_branch(repo, branch):
 
 def apply_single_patch(repo, branch, patch, fallback_author, topic=None):
     switch_to_pq_branch(repo, branch)
-    apply_and_commit_patch(repo, patch, fallback_author, topic)
-    gbp.log.info("Applied %s" % os.path.basename(patch.path))
+    name = os.path.basename(patch.path)
+    apply_and_commit_patch(repo, patch, fallback_author, topic, name=name)
+    gbp.log.info("Applied %s" % name)
 
 
 def apply_and_commit_patch(repo, patch, fallback_author, topic=None, name=None):
diff --git a/tests/13_test_gbp_pq.py b/tests/13_test_gbp_pq.py
index e78cdd0..70b59f5 100644
--- a/tests/13_test_gbp_pq.py
+++ b/tests/13_test_gbp_pq.py
@@ -101,6 +101,8 @@ class TestApplySinglePatch(testutils.DebianGitTestRepo):
 
         pq.apply_single_patch(self.repo, 'master', patch, None)
         self.assertIn('foo', self.repo.list_files())
+        info = self.repo.get_commit_info('HEAD')
+        self.assertIn('Gbp-Pq: Name foo.patch', info['body'])
 
 
 class TestWritePatch(testutils.DebianGitTestRepo):
-- 
2.1.4

Reply via email to