Mercurial > emacs
comparison lisp/vc/vc-mtn.el @ 111449:132f2dfd549f
Merge from emacs-23
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 09 Nov 2010 15:07:10 -0500 |
parents | d3584b6b6247 |
children | 417b1e4d63cd |
comparison
equal
deleted
inserted
replaced
111448:321fbae3e04d | 111449:132f2dfd549f |
---|---|
108 (t 'up-to-date))))) | 108 (t 'up-to-date))))) |
109 | 109 |
110 (defun vc-mtn-after-dir-status (update-function) | 110 (defun vc-mtn-after-dir-status (update-function) |
111 (let (result) | 111 (let (result) |
112 (goto-char (point-min)) | 112 (goto-char (point-min)) |
113 (re-search-forward "Current branch: \\(.*\\)\nChanges against parent \\(.*\\)" nil t) | 113 (re-search-forward "\\(?:Current b\\|B\\)ranch: *\\(.*\\)\n?\nChanges against parent \\(.*\\)" nil t) |
114 (while (re-search-forward | 114 (while (re-search-forward |
115 "^ \\(?:\\(patched \\)\\|\\(added \\)\\)\\(.*\\)$" nil t) | 115 "^ \\(?:\\(patched \\)\\|\\(added \\)\\)\\(.*\\)$" nil t) |
116 (cond ((match-end 1) (push (list (match-string 3) 'edited) result)) | 116 (cond ((match-end 1) (push (list (match-string 3) 'edited) result)) |
117 ((match-end 2) (push (list (match-string 3) 'added) result)))) | 117 ((match-end 2) (push (list (match-string 3) 'added) result)))) |
118 (funcall update-function result))) | 118 (funcall update-function result))) |
127 ;; return nil. | 127 ;; return nil. |
128 (ignore-errors | 128 (ignore-errors |
129 (with-temp-buffer | 129 (with-temp-buffer |
130 (vc-mtn-command t 0 file "status") | 130 (vc-mtn-command t 0 file "status") |
131 (goto-char (point-min)) | 131 (goto-char (point-min)) |
132 (re-search-forward "Current branch: \\(.*\\)\nChanges against parent \\(.*\\)") | 132 (re-search-forward "\\(?:Current b\\|B\\)ranch: *\\(.*\\)\n?\nChanges against parent \\(.*\\)") |
133 (match-string 2)))) | 133 (match-string 2)))) |
134 | 134 |
135 (defun vc-mtn-workfile-branch (file) | 135 (defun vc-mtn-workfile-branch (file) |
136 ;; If `mtn' fails or returns status>0, or if the search files, just | 136 ;; If `mtn' fails or returns status>0, or if the search files, just |
137 ;; return nil. | 137 ;; return nil. |
138 (ignore-errors | 138 (ignore-errors |
139 (with-temp-buffer | 139 (with-temp-buffer |
140 (vc-mtn-command t 0 file "status") | 140 (vc-mtn-command t 0 file "status") |
141 (goto-char (point-min)) | 141 (goto-char (point-min)) |
142 (re-search-forward "Current branch: \\(.*\\)\nChanges against parent \\(.*\\)") | 142 (re-search-forward "\\(?:Current b\\|B\\)ranch: *\\(.*\\)\n?\nChanges against parent \\(.*\\)") |
143 (match-string 1)))) | 143 (match-string 1)))) |
144 | 144 |
145 (defun vc-mtn-workfile-unchanged-p (file) | 145 (defun vc-mtn-workfile-unchanged-p (file) |
146 (not (eq (vc-mtn-state file) 'edited))) | 146 (not (eq (vc-mtn-state file) 'edited))) |
147 | 147 |