]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/vc/vc-hg.el (vc-hg-create-tag, vc-hg-retrieve-tag): New functions.
authorSantiago Payà i Miralta <santiagopim@gmail.com>
Fri, 6 Jun 2014 16:38:44 +0000 (12:38 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 6 Jun 2014 16:38:44 +0000 (12:38 -0400)
Fixes: debbugs:17586
lisp/ChangeLog
lisp/vc/vc-hg.el

index 3b9b1e9f5b9ec49ed851be98f794b0f1c6cf4404..735a558aa62378fc012f51f52c945bcfa213362a 100644 (file)
@@ -1,5 +1,8 @@
 2014-06-06  Santiago Payà i Miralta  <santiagopim@gmail.com>
 
+       * vc/vc-hg.el (vc-hg-create-tag, vc-hg-retrieve-tag): New functions
+       (bug#17586).
+
        * vc/vc-hg.el (vc-hg-log-graph): New var.
        (vc-hg-print-log): Use it.
        (vc-hg-root-log-format): Include branch name and bookmarks; ignore
index 28cf48f54d600383f99f5a3304d1623fca3365b3..598a84a5739b3da8d91bb45f8a4b42a5299670b3 100644 (file)
@@ -82,8 +82,8 @@
 ;; - annotate-current-time ()                  NOT NEEDED
 ;; - annotate-extract-revision-at-line ()      OK
 ;; TAG SYSTEM
-;; - create-tag (dir name branchp)             NEEDED
-;; - retrieve-tag (dir name update)            NEEDED
+;; - create-tag (dir name branchp)             OK
+;; - retrieve-tag (dir name update)            OK FIXME UPDATE BUFFERS
 ;; MISCELLANEOUS
 ;; - make-version-backups-p (file)             ??
 ;; - repository-hostname (dirname)             ??
@@ -391,8 +391,26 @@ Optional arg REVISION is a revision to annotate from."
       (if (match-beginning 3)
          (match-string-no-properties 1)
        (cons (match-string-no-properties 1)
-             (expand-file-name (match-string-no-properties 4)
-                               (vc-hg-root default-directory)))))))
+      (expand-file-name (match-string-no-properties 4)
+ (vc-hg-root default-directory)))))))
+
+;;; Tag system
+
+(defun vc-hg-create-tag (dir name branchp)
+  "Attach the tag NAME to the state of the working copy."
+  (let ((default-directory dir))
+    (and (vc-hg-command nil 0 nil "status")
+         (vc-hg-command nil 0 nil (if branchp "bookmark" "tag") name))))
+
+(defun vc-hg-retrieve-tag (dir name update)
+  "Retrieve the version tagged by NAME of all registered files at or below DIR."
+  (let ((default-directory dir))
+    (vc-hg-command nil 0 nil "update" name)
+    ;; FIXME: update buffers if `update' is true
+    ;; TODO: update *vc-change-log* buffer so can see @ if --graph
+    ))
+
+;;; Miscellaneous
 
 (defun vc-hg-previous-revision (_file rev)
   (let ((newrev (1- (string-to-number rev))))