branch: externals/vc-jj
commit 758d444d71daaef8e6c52c6742dab35f21190b5f
Author: Kristoffer Balintona <[email protected]>
Commit: Kristoffer Balintona <[email protected]>
fix: `vc-jj-previous-revision` when FILE is non-nil
The "ancestors(REV)" revset includes REV itself, meaning
(vc-jj-previous-revision SOME-FILE REV): would always return REV
instead of the revision before REV.
So exclude REV from the revset: "ancestors(REV) ~REV".
---
vc-jj.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vc-jj.el b/vc-jj.el
index 0ffaa784ab..f730c3a152 100644
--- a/vc-jj.el
+++ b/vc-jj.el
@@ -1144,7 +1144,7 @@ For jj, modify `.gitignore' and call `jj untrack' or `jj
track'."
"JJ-specific version of `vc-previous-revision'."
(if file
(vc-jj--command-parseable "log" "--no-graph" "--limit" "1"
- "-r" (concat "ancestors(" rev ")")
+ "-r" (format "ancestors(%s) & ~%s" rev rev)
"-T" "change_id"
"--" (vc-jj--filename-to-fileset file))
;; The jj manual states that "for merges, [first_parent] only