[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/lisp ChangeLog vc-git.el
From: |
Dan Nicolaescu |
Subject: |
[Emacs-diffs] emacs/lisp ChangeLog vc-git.el |
Date: |
Tue, 08 Dec 2009 15:57:01 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Dan Nicolaescu <dann> 09/12/08 15:57:01
Modified files:
lisp : ChangeLog vc-git.el
Log message:
Add support for stashing a snapshot of the current tree.
* vc-git.el (vc-git-stash-snapshot): New function.
(vc-git-stash-map, vc-git-extra-menu-map): Add a mapping for it.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16868&r2=1.16869
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/vc-git.el?cvsroot=emacs&r1=1.105&r2=1.106
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16868
retrieving revision 1.16869
diff -u -b -r1.16868 -r1.16869
--- ChangeLog 8 Dec 2009 11:27:53 -0000 1.16868
+++ ChangeLog 8 Dec 2009 15:56:57 -0000 1.16869
@@ -1,3 +1,9 @@
+2009-12-08 Dan Nicolaescu <address@hidden>
+
+ Add support for stashing a snapshot of the current tree.
+ * vc-git.el (vc-git-stash-snapshot): New function.
+ (vc-git-stash-map, vc-git-extra-menu-map): Add a mapping for it.
+
2009-12-08 Jose E. Marchesi <address@hidden>
* play/gomoku.el (gomoku-mode-map): Remap `move-(beginning|end)-of-line'
Index: vc-git.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-git.el,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -b -r1.105 -r1.106
--- vc-git.el 7 Dec 2009 09:02:16 -0000 1.105
+++ vc-git.el 8 Dec 2009 15:57:00 -0000 1.106
@@ -414,6 +414,7 @@
(define-key map "\C-m" 'vc-git-stash-show-at-point)
(define-key map "A" 'vc-git-stash-apply-at-point)
(define-key map "P" 'vc-git-stash-pop-at-point)
+ (define-key map "S" 'vc-git-stash-snapshot)
map))
(defvar vc-git-stash-menu-map
@@ -756,8 +757,11 @@
(define-key map [git-grep]
'(menu-item "Git grep..." vc-git-grep
:help "Run the `git grep' command"))
+ (define-key map [git-sn]
+ '(menu-item "Stash a snapshot" vc-git-stash-snapshot
+ :help "Stash the current state of the tree and keep the
current state"))
(define-key map [git-st]
- '(menu-item "Stash..." vc-git-stash
+ '(menu-item "Create Stash..." vc-git-stash
:help "Stash away changes"))
(define-key map [git-ss]
'(menu-item "Show Stash..." vc-git-stash-show
@@ -863,6 +867,17 @@
(vc-git-command "*vc-git-stash*" 0 nil "stash" "pop" "-q" name)
(vc-resynch-buffer (vc-git-root default-directory) t t))
+(defun vc-git-stash-snapshot ()
+ "Create a stash with the current tree state."
+ (interactive)
+ (vc-git--call nil "stash" "save"
+ (let ((ct (current-time)))
+ (concat
+ (format-time-string "Snapshot on %Y-%m-%d" ct)
+ (format-time-string " at %H:%M" ct))))
+ (vc-git-command "*vc-git-stash*" 0 nil "stash" "apply" "-q" "address@hidden")
+ (vc-resynch-buffer (vc-git-root default-directory) t t))
+
(defun vc-git-stash-list ()
(delete
""
@@ -882,7 +897,7 @@
(defun vc-git-stash-delete-at-point ()
(interactive)
(let ((stash (vc-git-stash-get-at-point (point))))
- (when (y-or-n-p (format "Remove stash %s ?" stash))
+ (when (y-or-n-p (format "Remove stash %s ? " stash))
(vc-git--run-command-string nil "stash" "drop" (format "address@hidden"
stash))
(vc-dir-refresh))))