mirror of
https://github.com/correl/melpa.git
synced 2024-11-14 19:19:32 +00:00
added Mercurial support
This commit is contained in:
parent
b58fd0020b
commit
26a2f6318e
1 changed files with 28 additions and 0 deletions
|
@ -258,6 +258,33 @@ seconds; the server cuts off after 10 requests in 20 seconds.")
|
||||||
(pb/find-parse-time
|
(pb/find-parse-time
|
||||||
"\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)"))))
|
"\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)"))))
|
||||||
|
|
||||||
|
(defun pb/hg-repo (dir)
|
||||||
|
"Get the current hg repo for DIR."
|
||||||
|
(with-temp-buffer
|
||||||
|
(pb/run-process dir "hg" "paths")
|
||||||
|
(goto-char (point-min))
|
||||||
|
(re-search-forward "default = \\(.*\\)")
|
||||||
|
(match-string-no-properties 1)))
|
||||||
|
|
||||||
|
(defun pb/checkout-hg (name config dir)
|
||||||
|
"Check package NAME with config CONFIG out of hg into DIR."
|
||||||
|
(let ((repo (plist-get config :url)))
|
||||||
|
(with-current-buffer (get-buffer-create "*package-build-checkout*")
|
||||||
|
(goto-char (point-max))
|
||||||
|
(cond
|
||||||
|
((and (file-exists-p (expand-file-name ".hg" dir))
|
||||||
|
(string-equal (pb/hg-repo dir) repo))
|
||||||
|
(print "checkout directory exists, updating...")
|
||||||
|
(pb/run-process dir "hg" "pull")
|
||||||
|
(pb/run-process dir "hg" "update"))
|
||||||
|
(t
|
||||||
|
(when (file-exists-p dir)
|
||||||
|
(delete-directory dir t nil))
|
||||||
|
(print "cloning repository")
|
||||||
|
(pb/run-process nil "hg" "clone" repo dir)))
|
||||||
|
(pb/run-process dir "hg" "tip" "--style" "compact")
|
||||||
|
(pb/find-parse-time
|
||||||
|
"\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}\\)"))))
|
||||||
|
|
||||||
(defun pb/dump (data file)
|
(defun pb/dump (data file)
|
||||||
"Write DATA to FILE as a pretty-printed Lisp sexp."
|
"Write DATA to FILE as a pretty-printed Lisp sexp."
|
||||||
|
@ -307,6 +334,7 @@ The file is written to `package-build-working-dir'."
|
||||||
"--exclude=.git*"
|
"--exclude=.git*"
|
||||||
"--exclude=_darcs"
|
"--exclude=_darcs"
|
||||||
"--exclude=.bzr"
|
"--exclude=.bzr"
|
||||||
|
"--exclude=.hg"
|
||||||
(or (mapcar (lambda (fn) (concat dir "/" fn)) files)
|
(or (mapcar (lambda (fn) (concat dir "/" fn)) files)
|
||||||
(list dir)))))
|
(list dir)))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue