summaryrefslogtreecommitdiffstats
path: root/lisp/ravi-init-vc.el
diff options
context:
space:
mode:
authorRavi R Kiran <aine.marina@gmail.com>2017-03-06 03:52:53 (GMT)
committerRavi R Kiran <aine.marina@gmail.com>2017-03-06 04:09:01 (GMT)
commit2abbccd18bbbd2d783ea6b1a3d6bfe468f3810c8 (patch)
tree33cfce5296601d738713de378ea2bc6fc9bf1575 /lisp/ravi-init-vc.el
parent35d9dd9ff71881c3e162a6b9d0cd651e1636d542 (diff)
downloaddotemacs-2abbccd18bbbd2d783ea6b1a3d6bfe468f3810c8.zip
dotemacs-2abbccd18bbbd2d783ea6b1a3d6bfe468f3810c8.tar.gz
dotemacs-2abbccd18bbbd2d783ea6b1a3d6bfe468f3810c8.tar.bz2
Sync to a different host if specified
Diffstat (limited to 'lisp/ravi-init-vc.el')
-rw-r--r--lisp/ravi-init-vc.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/ravi-init-vc.el b/lisp/ravi-init-vc.el
index e464d2f..8ddba5c 100644
--- a/lisp/ravi-init-vc.el
+++ b/lisp/ravi-init-vc.el
@@ -41,6 +41,14 @@
(setq magit-restore-window-configuration t)
(add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh)
+ (defun ravi/sync-top-level ()
+ (when (and (boundp 'ravi/sync-top-level-host)
+ (not (s-equals? (car s-split-up-to "\\." (system-name) 1)
+ (car s-split-up-to "\\." ravi/sync-top-level-host 1))))
+ (message "Synchronizing with %s" ravi/sync-top-level-host)
+ (shell-command (concat "rsync -a " (magit-toplevel) " " ravi/sync-top-level-host ":" (magit-toplevel)))))
+ (add-hook 'magit-post-refresh-hook 'ravi/sync-top-level)
+
(use-package magit-svn
:config (add-hook 'magit-mode-hook 'magit-svn-mode)
:ensure t)