When creating the .pc/ directory, quilt writes the value of
QUILT_PATCHES to .pc/.quilt_patches. On all subsequent invocations,
quilt uses the contents of .pc/.quilt_patches as the value of
QUILT_PATCHES, rather than the value set in quiltrc.

All the callers in quilt.el really expect the per-project setting from
.pc/.quilt_patches, so return the value set therein if present.

Signed-off-by: Ondřej Lysoněk <[email protected]>
---
 lib/quilt.el | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/lib/quilt.el b/lib/quilt.el
index ca55980..fb6df35 100644
--- a/lib/quilt.el
+++ b/lib/quilt.el
@@ -48,9 +48,20 @@
           (kill-buffer (current-buffer))))
       (getenv var)))
 
+(defun quilt--per-project-patches-directory ()
+  (let ((qd (quilt-dir)))
+    (if qd
+        (let ((project-config (concat qd "/"
+                                      (quilt-pc-directory) "/.quilt_patches")))
+          (if (file-readable-p project-config)
+              (with-temp-buffer
+                (insert-file-contents-literally project-config)
+                (substring (buffer-string) 0 -1)))))))
+
 (defun quilt-patches-directory ()
   "Return the location of patch files."
-  (or (quilt--get-config-variable "QUILT_PATCHES")
+  (or (quilt--per-project-patches-directory)
+      (quilt--get-config-variable "QUILT_PATCHES")
       "patches"))
 
 (defun quilt-pc-directory ()
-- 
2.25.4


_______________________________________________
Quilt-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to