Commit Diff


commit - ef85a376d8f41068fa9c6b11bc1fff98e3e9520c
commit + 466be1387519f6af17726af568d8943cbcf0e66c
blob - 1a217d6ed3b9754e118aea878d1450e35c34790d
blob + 88a6dc75585a2d1b900d0d9d747bfb9a2540b8cb
--- regress/cmdline/backout.sh
+++ regress/cmdline/backout.sh
@@ -285,9 +285,9 @@ test_backout_logmsg_ref() {
 	local short_id=$(printf '%.7s' $branch_rev)
 	local ymd2=`date -u -r $commit_time2 +"%F"`
 	local short_id2="newbranch"
-	local sorted=$(printf "$branch_rev\n$branch_rev2" | sort)
+	local wt_sorted=$(printf "$branch_rev\n$branch_rev2" | sort)
 
-	for r in $sorted; do
+	for r in $wt_sorted; do
 		echo $sep >> $testroot/stdout.expected
 		if [ $r == $branch_rev ]; then
 			echo "backout $r" >> $testroot/stdout.expected
@@ -394,10 +394,10 @@ test_backout_logmsg_ref() {
 	local b2_changeset2=" M  epsilon/new2"
 	date=`date -u -r $b2_commit_time +"%a %b %e %X %Y UTC"`
 	date2=`date -u -r $b2_commit_time2 +"%a %b %e %X %Y UTC"`
-	sorted=$(printf "$branch2_rev\n$branch2_rev2" | sort)
+	local wt2_sorted=$(printf "$branch2_rev\n$branch2_rev2" | sort)
 
 	echo -n > $testroot/stdout.expected
-	for r in $sorted; do
+	for r in $wt2_sorted; do
 		echo $sep >> $testroot/stdout.expected
 		if [ $r == $branch2_rev ]; then
 			echo "backout $r" >> $testroot/stdout.expected
@@ -429,18 +429,41 @@ test_backout_logmsg_ref() {
 		return 1
 	fi
 
-	# ensure both wt and wt2 logmsg refs can be retrieved from the repo
-	sorted=`printf \
-	    "$branch_rev\n$branch_rev2\n$branch2_rev\n$branch2_rev2" | sort`
+	# ensure both wt and wt2 logmsg refs can be retrieved and the
+	# work tree UUID is displayed when listing refs from the repo
+	local wt_uuid=$(cat $testroot/wt/.got/uuid)
+	local wt2_uuid=$(cat $testroot/wt2/.got/uuid)
+	local wt_first=`printf "$wt_uuid\n$wt2_uuid" | sort | head -1`
 
-	echo -n > $testroot/stdout.expected
-	for r in $sorted; do
-		echo "backout $r" >> $testroot/stdout.expected
+	for r in $wt_sorted; do
+		echo -n "backout $r" >> $testroot/wt.list
+		if [ $r == $branch_rev2 ]; then
+			echo -n " (newbranch)" >> $testroot/wt.list
+		fi
+		echo >> $testroot/wt.list
+		echo "work tree: $wt_uuid" >> $testroot/wt.list
 	done
 
-	(cd $testroot/repo && got backout -l | grep ^backout | \
-	    sort | cut -f1,2 -d' ' > $testroot/stdout)
+	for r in $wt2_sorted; do
+		echo -n "backout $r" >> $testroot/wt2.list
+		if [ $r == $branch2_rev2 ]; then
+			echo -n " (newbranch2)" >> $testroot/wt2.list
+		fi
+		echo >> $testroot/wt2.list
+		echo "work tree: $wt2_uuid" >> $testroot/wt2.list
+	done
 
+	if [ $wt_uuid == $wt_first ]; then
+		mv $testroot/wt.list $testroot/stdout.expected
+		cat $testroot/wt2.list >> $testroot/stdout.expected
+	else
+		mv $testroot/wt2.list $testroot/stdout.expected
+		cat $testroot/wt.list >> $testroot/stdout.expected
+	fi
+
+	(cd $testroot/repo && got backout -l | egrep "^(backout|work)" \
+	    > $testroot/stdout)
+
 	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret=$?
 	if [ $ret -ne 0 ]; then
blob - 2cc07373cc5a1d2286aa7311f48980d94a8c0180
blob + fac54ca43c8da9be765539a05b8b421d64c36807
--- regress/cmdline/cherrypick.sh
+++ regress/cmdline/cherrypick.sh
@@ -1768,9 +1768,9 @@ test_cherrypick_logmsg_ref() {
 	local short_id=$(printf '%.7s' $branch_rev)
 	local ymd2=`date -u -r $commit_time2 +"%F"`
 	local short_id2="newbranch"
-	local sorted=$(printf "$branch_rev\n$branch_rev2" | sort)
+	local wt_sorted=$(printf "$branch_rev\n$branch_rev2" | sort)
 
-	for r in $sorted; do
+	for r in $wt_sorted; do
 		echo $sep >> $testroot/stdout.expected
 		if [ $r == $branch_rev ]; then
 			echo "cherrypick $r" >> $testroot/stdout.expected
@@ -1877,10 +1877,10 @@ test_cherrypick_logmsg_ref() {
 	local b2_changeset2=" M  epsilon/new2"
 	date=`date -u -r $b2_commit_time +"%a %b %e %X %Y UTC"`
 	date2=`date -u -r $b2_commit_time2 +"%a %b %e %X %Y UTC"`
-	sorted=$(printf "$branch2_rev\n$branch2_rev2" | sort)
+	local wt2_sorted=$(printf "$branch2_rev\n$branch2_rev2" | sort)
 
 	echo -n > $testroot/stdout.expected
-	for r in $sorted; do
+	for r in $wt2_sorted; do
 		echo $sep >> $testroot/stdout.expected
 		if [ $r == $branch2_rev ]; then
 			echo "cherrypick $r" >> $testroot/stdout.expected
@@ -1912,18 +1912,41 @@ test_cherrypick_logmsg_ref() {
 		return 1
 	fi
 
-	# ensure both wt and wt2 logmsg refs can be retrieved from the repo
-	sorted=`printf \
-	    "$branch_rev\n$branch_rev2\n$branch2_rev\n$branch2_rev2" | sort`
+	# ensure both wt and wt2 logmsg refs can be retrieved and the
+	# work tree UUID is displayed when listing refs from the repo
+	local wt_uuid=$(cat $testroot/wt/.got/uuid)
+	local wt2_uuid=$(cat $testroot/wt2/.got/uuid)
+	local wt_first=`printf "$wt_uuid\n$wt2_uuid" | sort | head -1`
 
-	echo -n > $testroot/stdout.expected
-	for r in $sorted; do
-		echo "cherrypick $r" >> $testroot/stdout.expected
+	for r in $wt_sorted; do
+		echo -n "cherrypick $r" >> $testroot/wt.list
+		if [ $r == $branch_rev2 ]; then
+			echo -n " (newbranch)" >> $testroot/wt.list
+		fi
+		echo >> $testroot/wt.list
+		echo "work tree: $wt_uuid" >> $testroot/wt.list
 	done
 
-	(cd $testroot/repo && got cherrypick -l | grep ^cherrypick | \
-	    sort | cut -f1,2 -d' ' > $testroot/stdout)
+	for r in $wt2_sorted; do
+		echo -n "cherrypick $r" >> $testroot/wt2.list
+		if [ $r == $branch2_rev2 ]; then
+			echo -n " (newbranch2)" >> $testroot/wt2.list
+		fi
+		echo >> $testroot/wt2.list
+		echo "work tree: $wt2_uuid" >> $testroot/wt2.list
+	done
 
+	if [ $wt_uuid == $wt_first ]; then
+		mv $testroot/wt.list $testroot/stdout.expected
+		cat $testroot/wt2.list >> $testroot/stdout.expected
+	else
+		mv $testroot/wt2.list $testroot/stdout.expected
+		cat $testroot/wt.list >> $testroot/stdout.expected
+	fi
+
+	(cd $testroot/repo && got cherrypick -l | egrep "^(cherrypick|work)" \
+	    > $testroot/stdout)
+
 	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret=$?
 	if [ $ret -ne 0 ]; then