User:Sfink/Mercurial: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created page with '== qimportbz == * clone http://hg.mozilla.org/users/robarnold_cmu.edu/qimportbz * put the result into the [extensions] section of your ~/.hgrc == conflicts == qpush creates .r…')
 
Line 9: Line 9:
* Open a .rej file in emacs and do ctrl-c ctrl-c to go to the corresponding source file
* Open a .rej file in emacs and do ctrl-c ctrl-c to go to the corresponding source file
* ctrl-c ctrl-a re-attempts the apply (I guess that's useful if you edit the patch's context or something?)
* ctrl-c ctrl-a re-attempts the apply (I guess that's useful if you edit the patch's context or something?)
I would like to know my current state with respect to those rejects, so I implemented a "delete-this-file" command in emacs and bound it to Ctrl-C Ctrl-D. That way I can easily nuke the .rej files when I have sucked their guts out.
<pre>
(defun delete-this-file ()
  "Delete the current buffer's file and close the buffer"
  (interactive)
  (if (y-or-n-p "Delete this file and close the buffer?")
      (progn (delete-file buffer-file-name)
    (kill-buffer))))
(global-set-key "\C-c\C-d" 'delete-this-file)
</pre>
This should really be done with a keymap or something, I think. I don't really know elisp.

Revision as of 23:57, 15 June 2010

qimportbz

conflicts

qpush creates .rej files with any conflicts.

  • Open a .rej file in emacs and do ctrl-c ctrl-c to go to the corresponding source file
  • ctrl-c ctrl-a re-attempts the apply (I guess that's useful if you edit the patch's context or something?)

I would like to know my current state with respect to those rejects, so I implemented a "delete-this-file" command in emacs and bound it to Ctrl-C Ctrl-D. That way I can easily nuke the .rej files when I have sucked their guts out.

(defun delete-this-file ()
  "Delete the current buffer's file and close the buffer"
  (interactive)
  (if (y-or-n-p "Delete this file and close the buffer?")
      (progn (delete-file buffer-file-name)
	     (kill-buffer))))

(global-set-key "\C-c\C-d" 'delete-this-file)

This should really be done with a keymap or something, I think. I don't really know elisp.