emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/vc-got 8014bde 101/145: implement half create-tag


From: ELPA Syncer
Subject: [elpa] externals/vc-got 8014bde 101/145: implement half create-tag
Date: Thu, 9 Sep 2021 15:58:42 -0400 (EDT)

branch: externals/vc-got
commit 8014bde1e7ea7f7d61b9cbd5907e41413ed7a36f
Author: Omar Polo <op@omarpolo.com>
Commit: Omar Polo <op@omarpolo.com>

    implement half create-tag
    
    Now vc-got should be able to create branches.  Creating tags is more
    difficult thought, because got requires a message (i.e. wants
    "annotated" tags and not lightweight ones.
---
 vc-got.el | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/vc-got.el b/vc-got.el
index b9c71b2..f70e048 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -89,7 +89,9 @@
 ;; - mergebase                          NOT IMPLEMENTED
 ;;
 ;; TAG SYSTEM
-;; - create-tag                         NOT IMPLEMENTED
+;; - create-tag                         PARTIALLY IMPLEMENTED
+;;      figure out how to read a message for the tag; can only create
+;;      branches.
 ;; - retrieve-tag                       NOT IMPLEMENTED
 ;;
 ;; MISCELLANEOUS                        NOT IMPLEMENTED
@@ -390,6 +392,16 @@ files on disk."
             (push (match-string 2) table))
           table)))))
 
+(defun vc-got--branch (name)
+  "Try to create and switch to the branch called NAME."
+  (let (process-file-side-effects)
+    (vc-got-with-worktree default-directory
+      (with-temp-buffer
+        (if (zerop (vc-got--call "branch" name))
+            t
+          (error "[vc-got] can't create branch %s: %s" name
+                 (buffer-string)))))))
+
 
 ;; Backend properties
 
@@ -785,6 +797,19 @@ Value is returned as floating point fractional number of 
days."
       (match-string-no-properties 1))))
 
 
+;; Tag system
+
+(defun vc-got-create-tag (_dir name branchp)
+  "Attach the tag NAME to the state of the worktree.
+DIR is ignored (tags are global, not per-file).
+If BRANCHP is true, NAME should create a new branch."
+  ;; TODO: vc reccomends to ensure that all the file are in a clean
+  ;; state, but is it useful?
+  (if branchp
+      (vc-got--branch name)
+    (error "[vc-got] create tags is not implemented (yet)")))
+
+
 ;; Miscellaneous
 
 (defun vc-got-previous-revision (file rev)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]