Mercurial > hg > mercurial-crew-with-dirclash
comparison contrib/mq.el @ 5116:2ffe3e2a1ac2
merge with crew-stable
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Tue, 07 Aug 2007 10:28:14 +0200 |
parents | ea7b982b6c08 |
children | 9873cbb134b2 |
comparison
equal
deleted
inserted
replaced
5114:bcf6ba3fcbe4 | 5116:2ffe3e2a1ac2 |
---|---|
129 (let ((bol (point))) | 129 (let ((bol (point))) |
130 (end-of-line) | 130 (end-of-line) |
131 (let ((line (buffer-substring bol (point)))) | 131 (let ((line (buffer-substring bol (point)))) |
132 (when (> (length line) 0) | 132 (when (> (length line) 0) |
133 line)))) | 133 line)))) |
134 | 134 |
135 (defun mq-push (&optional patch) | 135 (defun mq-push (&optional patch) |
136 "Push patches until PATCH is reached. | 136 "Push patches until PATCH is reached. |
137 If PATCH is nil, push at most one patch." | 137 If PATCH is nil, push at most one patch." |
138 (interactive (list (mq-read-patch-name "qunapplied" " to push" | 138 (interactive (list (mq-read-patch-name "qunapplied" " to push" |
139 current-prefix-arg))) | 139 current-prefix-arg))) |
164 (sit-for 0) | 164 (sit-for 0) |
165 (when last-line | 165 (when last-line |
166 (if ok | 166 (if ok |
167 (message "Pushing... %s" last-line) | 167 (message "Pushing... %s" last-line) |
168 (error "Pushing... %s" last-line))))) | 168 (error "Pushing... %s" last-line))))) |
169 | 169 |
170 (defun mq-push-all () | 170 (defun mq-push-all () |
171 "Push patches until all are applied." | 171 "Push patches until all are applied." |
172 (interactive) | 172 (interactive) |
173 (mq-push "-a")) | 173 (mq-push "-a")) |
174 | 174 |
193 (sit-for 0) | 193 (sit-for 0) |
194 (when last-line | 194 (when last-line |
195 (if ok | 195 (if ok |
196 (message "Popping... %s" last-line) | 196 (message "Popping... %s" last-line) |
197 (error "Popping... %s" last-line))))) | 197 (error "Popping... %s" last-line))))) |
198 | 198 |
199 (defun mq-pop-all () | 199 (defun mq-pop-all () |
200 "Push patches until none are applied." | 200 "Push patches until none are applied." |
201 (interactive) | 201 (interactive) |
202 (mq-pop "-a")) | 202 (mq-pop "-a")) |
203 | 203 |
253 (run-hooks 'mq-edit-finish-hook) | 253 (run-hooks 'mq-edit-finish-hook) |
254 (mq-refresh-internal hg-root "-m" (buffer-substring (point-min) (point-max))) | 254 (mq-refresh-internal hg-root "-m" (buffer-substring (point-min) (point-max))) |
255 (let ((buf mq-prev-buffer)) | 255 (let ((buf mq-prev-buffer)) |
256 (kill-buffer nil) | 256 (kill-buffer nil) |
257 (switch-to-buffer buf))) | 257 (switch-to-buffer buf))) |
258 | 258 |
259 (defun mq-edit-kill () | 259 (defun mq-edit-kill () |
260 "Kill the edit currently being prepared." | 260 "Kill the edit currently being prepared." |
261 (interactive) | 261 (interactive) |
262 (when (or (not (buffer-modified-p)) (y-or-n-p "Really kill this edit? ")) | 262 (when (or (not (buffer-modified-p)) (y-or-n-p "Really kill this edit? ")) |
263 (let ((buf mq-prev-buffer)) | 263 (let ((buf mq-prev-buffer)) |
314 major-mode 'mq-edit-mode | 314 major-mode 'mq-edit-mode |
315 mode-name "MQ-Edit") | 315 mode-name "MQ-Edit") |
316 (set-buffer-modified-p nil) | 316 (set-buffer-modified-p nil) |
317 (setq buffer-undo-list nil) | 317 (setq buffer-undo-list nil) |
318 (run-hooks 'text-mode-hook 'mq-edit-mode-hook)) | 318 (run-hooks 'text-mode-hook 'mq-edit-mode-hook)) |
319 | 319 |
320 (defun mq-refresh-edit () | 320 (defun mq-refresh-edit () |
321 "Refresh the topmost applied patch, editing the patch description." | 321 "Refresh the topmost applied patch, editing the patch description." |
322 (interactive) | 322 (interactive) |
323 (while mq-prev-buffer | 323 (while mq-prev-buffer |
324 (set-buffer mq-prev-buffer)) | 324 (set-buffer mq-prev-buffer)) |