From: Gustav HÃ¥llberg Date: Thu, 30 Jul 2009 22:57:59 +0000 (+0200) Subject: stgit.el: Open the destination file on applied renames or copies X-Git-Tag: v0.15-rc2~11^2~42 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/027e137019a92a400f361df829695cc488f2dfd3 stgit.el: Open the destination file on applied renames or copies Signed-off-by: Gustav HÃ¥llberg --- 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))))