From 027e137019a92a400f361df829695cc488f2dfd3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gustav=20H=C3=A5llberg?= Date: Fri, 31 Jul 2009 00:57:59 +0200 Subject: [PATCH] stgit.el: Open the destination file on applied renames or copies MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Gustav HÃ¥llberg --- contrib/stgit.el | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/contrib/stgit.el b/contrib/stgit.el index 00e54d6..63a253d 100644 --- a/contrib/stgit.el +++ b/contrib/stgit.el @@ -472,15 +472,21 @@ at point." (let ((file (cond ((looking-at "\\([CR]\\)\\([0-9]*\\)\0\\([^\0]*\\)\0\\([^\0]*\\)\0") - (make-stgit-file - :old-perm old-perm - :new-perm new-perm - :copy-or-rename t - :cr-score (string-to-number (match-string 2)) - :cr-from (match-string 3) - :cr-to (match-string 4) - :status (stgit-file-status-code (match-string 1)) - :file (match-string 3))) + (let* ((patch-status (stgit-patch-status patch)) + (file-subexp (if (eq patch-status 'unapplied) + 3 + 4)) + (file (match-string file-subexp))) + (make-stgit-file + :old-perm old-perm + :new-perm new-perm + :copy-or-rename t + :cr-score (string-to-number (match-string 2)) + :cr-from (match-string 3) + :cr-to (match-string 4) + :status (stgit-file-status-code + (match-string 1)) + :file file))) ((looking-at "\\([ABD-QS-Z]\\)\0\\([^\0]*\\)\0") (make-stgit-file :old-perm old-perm @@ -489,7 +495,8 @@ at point." :cr-score nil :cr-from nil :cr-to nil - :status (stgit-file-status-code (match-string 1)) + :status (stgit-file-status-code + (match-string 1)) :file (match-string 2)))))) (ewoc-enter-last ewoc file)) (goto-char (match-end 0)))) -- 2.11.0