# HG changeset patch # User Peter Arrenbrecht # Date 1276012617 -7200 # Node ID 7a6ac83a15b08324c45aa43b27e8f83c51479e51 # Parent 534c6949491853cd17c1b627457871fd376903c6 revset: add some tests diff -r 534c69494918 -r 7a6ac83a15b0 tests/test-revset --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-revset Tue Jun 08 17:56:57 2010 +0200 @@ -0,0 +1,38 @@ +#!/bin/sh + +try() { + echo '% hg debugrevspec' $@ + hg debugrevspec $@ +} + +hg init repo +cd repo +hg branch a +hg ci -m "plain name" +hg branch b +hg ci -m "another plain name" +hg branch a-b-c- +hg ci -m "with dashes" +hg branch -- -a-b-c- +hg ci -m "with leading dash" +hg branch +a+b+c+ +hg ci -m "with plusses" +hg branch /a/b/c/ +hg ci -m "with slashes" +hg branch _a_b_c_ +hg ci -m "with underscores" +hg branch .a.b.c. +hg ci -m "with dots" + +# names that should work without quoting +try a +try b-a +try _a_b_c_ +try _a_b_c_-a +try .a.b.c. +try .a.b.c.-a + +# quoting needed +try '"-a-b-c-"' +try '"-a-b-c-"-a' + diff -r 534c69494918 -r 7a6ac83a15b0 tests/test-revset.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-revset.out Tue Jun 08 17:56:57 2010 +0200 @@ -0,0 +1,24 @@ +marked working directory as branch a +marked working directory as branch b +marked working directory as branch a-b-c- +marked working directory as branch -a-b-c- +marked working directory as branch +a+b+c+ +marked working directory as branch /a/b/c/ +marked working directory as branch _a_b_c_ +marked working directory as branch .a.b.c. +% hg debugrevspec a +0 +% hg debugrevspec b-a +1 +% hg debugrevspec _a_b_c_ +6 +% hg debugrevspec _a_b_c_-a +6 +% hg debugrevspec .a.b.c. +7 +% hg debugrevspec .a.b.c.-a +7 +% hg debugrevspec "-a-b-c-" +3 +% hg debugrevspec "-a-b-c-"-a +3