branch: externals/vc-got
commit 241a3b1222c05b9c84b192f6afa4ee6eb71f4a7f
Author: Omar Polo <[email protected]>
Commit: Omar Polo <[email protected]>
implement unregister
Even if it isn't really useful (it's only used in vc-transfer-file
AFAICS) but it's easy to do and maybe can help someone eventually.
See also github pr #7 for more background.
---
vc-got.el | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/vc-got.el b/vc-got.el
index 6a75d69..2f897c1 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -48,7 +48,7 @@
;; * register DONE
;; - responsible-p DONE
;; - receive-file NOT NEEDED, default `register' works
fine
-;; - unregister NOT IMPLEMENTED, no use case
+;; - unregister DONE
;; * checkin DONE
;; * find-revision DONE
;; * checkout NOT IMPLEMENTED
@@ -567,6 +567,12 @@ FILES is nil, consider all the files in DIR."
(defalias 'vc-got-responsible-p #'vc-got-root)
+(defun vc-got-unregister (file)
+ "Unregister FILE."
+ (with-temp-buffer
+ (unless (zerop (vc-got--call "remove" "-fk" "--" file))
+ (error "[vc-got] can't unregister %s: %s" file (buffer-string)))))
+
;; XXX: generally speaking, files cannot be nil. But we have to
;; handle that case too, because vc-got-stage-commit will call
;; vc-got-checkin with fileset nil to commit the current staged hunks.