Skip to content
Browse files

Merge remote-tracking branch 'upstream/master' into topic_push_uses_s…

…et_upstream
  • Loading branch information...
2 parents 9fd088d + b57ac59 commit 91bf7428b593c66bad41f68d7778826879a82247 Jeff Bellegarde committed Dec 2, 2011
Showing with 54 additions and 40 deletions.
  1. +3 −3 magit-stgit.el
  2. +1 −0 magit-svn.el
  3. +16 −1 magit-topgit.el
  4. +34 −36 magit.el
View
6 magit-stgit.el
@@ -87,9 +87,9 @@
magit-stgit--enabled
(setq magit-stgit--enabled
(if (member (concat (magit-get-current-branch) ".stgit")
- (mapcar '(lambda (line)
- (string-match "^\\*?\s*\\([^\s]*\\)" line)
- (match-string 1 line))
+ (mapcar #'(lambda (line)
+ (string-match "^\\*?\s*\\([^\s]*\\)" line)
+ (match-string 1 line))
(magit-git-lines "branch")))
t
nil))))
View
1 magit-svn.el
@@ -75,6 +75,7 @@
(src (replace-regexp-in-string "\\*" "\\\\(.*\\\\)" (car pats)))
(dst (replace-regexp-in-string "\\*" "\\\\1" (cadr pats)))
(base-url (replace-regexp-in-string "\\+" "\\\\+" base-url))
+ (base-url (replace-regexp-in-string "//.+@" "//" base-url))
(pat1 (concat "^" src "$"))
(pat2 (cond ((equal src "") (concat "^" base-url "$"))
(t (concat "^" base-url "/" src "$")))))
View
17 magit-topgit.el
@@ -109,7 +109,7 @@
(magit-with-section topic 'topic
(magit-set-section-info topic)
(let ((beg (1+ (line-beginning-position)))
- (end (line-end-position)))
+ (end (line-end-position)))
(when (plist-get flags :current)
(put-text-property beg end 'face 'magit-topgit-current))
(when (plist-get flags :empty)
@@ -150,5 +150,20 @@
(add-hook 'magit-remote-update-command-hook 'magit-topgit-remote-update)
(add-hook 'magit-push-command-hook 'magit-topgit-push)
+(defun magit-topgit-get-top-bases-color (suffix)
+ (list nil nil))
+
+(defun magit-topgit-get-remote-top-bases-color (suffix)
+ (when (string-match "^\\(?:[^/]+\\)/top-bases" suffix)
+ (list nil nil)))
+
+;; hide refs in the top-bases namespace, as they're not meant for the user
+(add-to-list 'magit-refs-namespaces
+ '("top-bases" magit-topgit-get-top-bases-color))
+
+;; same thing for top-bases namespace in any remote
+(add-hook 'magit-log-remotes-color-hook
+ 'magit-topgit-get-remote-top-bases-color)
+
(provide 'magit-topgit)
;;; magit-topgit.el ends here
View
70 magit.el
@@ -414,14 +414,6 @@ Many Magit faces inherit from this one by default."
"Face for highlighting marked item."
:group 'magit-faces)
-(defface magit-log-tag-label
- '((((class color) (background light))
- :background "LightGoldenRod")
- (((class color) (background dark))
- :background "DarkGoldenRod"))
- "Face for git tag labels shown in log buffer."
- :group 'magit-faces)
-
(defface magit-log-head-label-bisect-good
'((((class color) (background light))
:box t
@@ -531,14 +523,6 @@ Do not customize this (used in the `magit-key-mode' implementation).")
"Face for unknown ref labels shown in log buffer."
:group 'magit-faces)
-(defface magit-menu-selected-option
- '((((class color) (background light))
- :foreground "red")
- (((class color) (background dark))
- :foreground "orange"))
- "Face for selected options on magit's menu"
- :group 'magit-faces)
-
(defvar magit-mode-map
(let ((map (make-keymap)))
(suppress-keymap map t)
@@ -1857,7 +1841,7 @@ order until one return non nil. If they all return nil then body will be called.
It used to define hookable magit command: command defined by this
function can be enriched by magit extension like magit-topgit and magit-svn"
(declare (indent defun)
- (debug (&define name lambda-list
+ (debug (&define name lambda-list
[&optional stringp] ; Match the doc string, if present.
[&optional ("interactive" interactive)]
def-body)))
@@ -2899,9 +2883,17 @@ must return a string which will represent the log line.")
(match-string 1 suffix))
'magit-log-head-label-patches))
+(defvar magit-log-remotes-color-hook nil)
+
+(defun magit-log-get-remotes-color (suffix)
+ (or
+ (run-hook-with-args-until-success
+ 'magit-log-remotes-color-hook suffix)
+ (list suffix 'magit-log-head-label-remote)))
+
(defvar magit-refs-namespaces
'(("tags" . magit-log-head-label-tags)
- ("remotes" . magit-log-head-label-remote)
+ ("remotes" magit-log-get-remotes-color)
("heads" . magit-log-head-label-local)
("patches" magit-log-get-patches-color)
("bisect" magit-log-get-bisect-state-color)))
@@ -2928,14 +2920,17 @@ must return a string which will represent the log line.")
"The default log line generator."
(let ((string-refs
(when refs
- (concat (mapconcat
- (lambda (r)
- (destructuring-bind (label face)
- (magit-ref-get-label-color r)
- (propertize label 'face face)))
- refs
- " ")
- " "))))
+ (let ((colored-labels
+ (delete nil
+ (mapcar (lambda (r)
+ (destructuring-bind (label face)
+ (magit-ref-get-label-color r)
+ (and label
+ (propertize label 'face face))))
+ refs))))
+ (concat
+ (mapconcat 'identity colored-labels " ")
+ " ")))))
(concat
(if sha1
@@ -3352,7 +3347,8 @@ to consider it or not when called with that buffer current."
"Only prompt to save buffers which are within the current git project (as
determined by the dir passed to `magit-status'."
(and buffer-file-name
- (magit-get-top-dir (file-name-directory buffer-file-name))))
+ (eq (magit-get-top-dir dir)
+ (magit-get-top-dir (file-name-directory buffer-file-name)))))
;;;###autoload
(defun magit-status (dir)
@@ -3894,15 +3890,18 @@ If there is no default remote, ask for one."
(magit-set merge-branch "branch" branch "merge"))
(apply 'magit-run-git-async "pull" "-v" magit-custom-options)))
-(eval-when-compile (require 'pcomplete))
+(eval-when-compile (require 'eshell))
+
+(defun magit-parse-arguments (command)
+ (require 'eshell)
+ (with-temp-buffer
+ (insert command)
+ (mapcar 'eval (eshell-parse-arguments (point-min) (point-max)))))
(defun magit-shell-command (command)
"Perform arbitrary shell COMMAND."
(interactive "sCommand: ")
- (require 'pcomplete)
- (let ((args (car (with-temp-buffer
- (insert command)
- (pcomplete-parse-buffer-arguments))))
+ (let ((args (magit-parse-arguments command))
(magit-process-popup-time 0))
(magit-run* args nil nil nil t)))
@@ -3913,9 +3912,7 @@ Similar to `magit-shell-command', but involves slightly less
typing and automatically refreshes the status buffer."
(interactive "sRun git like this: ")
(require 'pcomplete)
- (let ((args (car (with-temp-buffer
- (insert command)
- (pcomplete-parse-buffer-arguments))))
+ (let ((args (magit-parse-arguments command))
(magit-process-popup-time 0))
(magit-with-refresh
(magit-run* (append (cons magit-git-executable
@@ -5010,7 +5007,8 @@ Return values:
(if (functionp 'server-running-p)
(server-running-p)
(condition-case nil
- (if server-use-tcp
+ (if (and (boundp 'server-use-tcp)
+ server-use-tcp)
(with-temp-buffer
(insert-file-contents-literally (expand-file-name server-name server-auth-dir))
(or (and (looking-at "127\\.0\\.0\\.1:[0-9]+ \\([0-9]+\\)")

0 comments on commit 91bf742

Please sign in to comment.
Something went wrong with that request. Please try again.