From 9f71d2cf15088b765e0e6694401d6b1bf88489d6 Mon Sep 17 00:00:00 2001 From: Liubov Dmitrieva Date: Wed, 12 Feb 2020 12:00:40 -0800 Subject: [PATCH] scs client: add prefix support for resolving commit ids Summary: This improves scs client ux as you can see in the test. Cross scheme collisions have been already supported in the code, and there will be a proper message. For the ambiguity within a single scheme, I added a message. Reviewed By: mitrandir77 Differential Revision: D19834142 fbshipit-source-id: a2cff44f6ef031b1224ebf13d38d76c66c9ee4b9 --- eden/mononoke/tests/integration/test-scs.t | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/eden/mononoke/tests/integration/test-scs.t b/eden/mononoke/tests/integration/test-scs.t index 646e054cc3..9356690248 100644 --- a/eden/mononoke/tests/integration/test-scs.t +++ b/eden/mononoke/tests/integration/test-scs.t @@ -552,6 +552,12 @@ lookup using bonsai needed resolving to identify commit globalrev=9999999999 hg=ee87eb8cfeb218e7352a94689b241ea973b80402 +lookup using bonsai prefix needed resolving to identify commit + $ scsc lookup --repo repo -i 006c988c4a9f60080a6bc2 -S bonsai,hg,globalrev + bonsai=006c988c4a9f60080a6bc2a2fff47565fafea2ca5b16c4d994aecdef0c89973b + globalrev=9999999999 + hg=ee87eb8cfeb218e7352a94689b241ea973b80402 + lookup using globalrev needed resolving to identify commit $ scsc lookup --repo repo -i 9999999999 -S bonsai,hg,globalrev bonsai=006c988c4a9f60080a6bc2a2fff47565fafea2ca5b16c4d994aecdef0c89973b @@ -564,6 +570,18 @@ lookup using hg needed resolving to identify commit globalrev=9999999999 hg=ee87eb8cfeb218e7352a94689b241ea973b80402 +lookup using hg prefix needed resolving to identify commit + $ scsc lookup --repo repo -i ee87eb8 -S bonsai,hg,globalrev + bonsai=006c988c4a9f60080a6bc2a2fff47565fafea2ca5b16c4d994aecdef0c89973b + globalrev=9999999999 + hg=ee87eb8cfeb218e7352a94689b241ea973b80402 + +lookup using hg prefix needed resolving to identify commit (ambiguous case) + $ scsc lookup --repo repo -i e -S bonsai,hg,globalrev + note: several hg commits with the prefix 'e' exist + error: commit not found: e + [1] + cat a file $ scsc cat --repo repo -B BOOKMARK_B -p a a