12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- (define-module (guix build hg)
- #:use-module (guix build utils)
- #:use-module (srfi srfi-34)
- #:use-module (ice-9 format)
- #:export (hg-fetch))
- (define* (hg-fetch url changeset directory
- #:key (hg-command "hg"))
- "Fetch CHANGESET from URL into DIRECTORY. CHANGESET must be a valid
- Mercurial changeset identifier. Return #t on success, #f otherwise."
- (mkdir-p directory)
- (guard (c ((invoke-error? c)
- (report-invoke-error c)
- (delete-file-recursively directory)
- #f))
- (with-directory-excursion directory
- (invoke hg-command
- "clone" url
- "--rev" changeset
-
-
- "--insecure"
- directory)
-
-
-
-
-
- (for-each delete-file-recursively
- (find-files directory "^\\.hg$" #:directories? #t))
- #t)))
|