comparison tests/test-topic-tutorial.t @ 6882:3ac0e0375509 stable

tests: small fixes to the user-visible text in test-topic-tutorial.t
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 02 Oct 2024 19:52:23 +0400
parents beee3d9a129a
children 61e8bd377791
comparison
equal deleted inserted replaced
6881:beee3d9a129a 6882:3ac0e0375509
18 18
19 $ cd server 19 $ cd server
20 20
21 $ cat >> .hg/hgrc << EOF 21 $ cat >> .hg/hgrc << EOF
22 > [ui] 22 > [ui]
23 > user= Shopping Master 23 > user = Shopping Master
24 > EOF 24 > EOF
25 25
26 $ cat >> shopping << EOF 26 $ cat >> shopping << EOF
27 > Spam 27 > Spam
28 > Whizzo butter 28 > Whizzo butter
41 updating to branch default 41 updating to branch default
42 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 42 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
43 $ cd client 43 $ cd client
44 $ cat >> .hg/hgrc << EOF 44 $ cat >> .hg/hgrc << EOF
45 > [ui] 45 > [ui]
46 > user= Tutorial User 46 > user = Tutorial User
47 > EOF 47 > EOF
48 #if docgraph-ext 48 #if docgraph-ext
49 $ . "$TESTDIR/testlib/docgraph_setup.sh" #rest-ignore 49 $ . "$TESTDIR/testlib/docgraph_setup.sh" #rest-ignore
50 #endif 50 #endif
51 51
98 98
99 $ hg topics food 99 $ hg topics food
100 marked working directory as topic: food 100 marked working directory as topic: food
101 101
102 Much like a named branch, our topic is active but it does not contain any 102 Much like a named branch, our topic is active but it does not contain any
103 changeset yet: 103 changesets yet:
104 104
105 $ hg topics 105 $ hg topics
106 * food (0 changesets) 106 * food (0 changesets)
107 107
108 $ hg summary 108 $ hg summary
711 711
712 712
713 Keep working within topics 713 Keep working within topics
714 ========================== 714 ==========================
715 715
716 Making sure all your new local commit are made within a topic will help you 716 Making sure all your new local commits are made within a topic will help you
717 organize your work. It is possible to ensure this through the Mercurial 717 organize your work. It is possible to ensure this through the Mercurial
718 configuration. 718 configuration.
719 719
720 For this tutorial, we'll add the config at the repository level: 720 For this tutorial, we'll add the config at the repository level:
721 721
722 $ cat << EOF >> .hg/hgrc 722 $ cat << EOF >> .hg/hgrc
723 > [experimental] 723 > [experimental]
724 > topic-mode = enforce 724 > topic-mode = enforce
725 > EOF 725 > EOF
726 726
727 You can also use `hg config --edit` to update your mercurial configuration. 727 You can also use `hg config --edit` to update your Mercurial configuration.
728 728
729 729
730 Once enforcement is turned on. New local commit will be denied if no topic is active. 730 Once enforcement is turned on, new local commits will be denied if no topic is active.
731 731
732 $ echo sickle >> shopping 732 $ echo sickle >> shopping
733 $ hg commit -m 'Adding sickle' 733 $ hg commit -m 'Adding sickle'
734 abort: no active topic 734 abort: no active topic
735 (see 'hg help -e topic.topic-mode' for details) 735 (see 'hg help -e topic.topic-mode' for details)
762 $ hg commit -m 'Adding saw' 762 $ hg commit -m 'Adding saw'
763 763
764 $ echo drill >> shopping 764 $ echo drill >> shopping
765 $ hg commit -m 'Adding drill' 765 $ hg commit -m 'Adding drill'
766 766
767 But we are not sure we will actually go to the hardware store, so in the 767 But we are not sure if we will actually go to the hardware store, so in the
768 meantime, we want to extend the list with drinks. We go back to the official 768 meantime, we want to extend the list with drinks. We go back to the official
769 default branch and start a new topic: 769 default branch and start a new topic:
770 770
771 $ hg update default 771 $ hg update default
772 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 772 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
813 813
814 $ hg rebase 814 $ hg rebase
815 nothing to rebase 815 nothing to rebase
816 [1] 816 [1]
817 817
818 We simulate independant contributions to the repo with this 818 We simulate independent contributions to the repo with this
819 activity: 819 activity:
820 820
821 $ cd ../server 821 $ cd ../server
822 $ hg update 822 $ hg update
823 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 823 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
830 $ cat foo >> shopping 830 $ cat foo >> shopping
831 $ rm foo 831 $ rm foo
832 $ hg commit -m 'add a pair of shoes' 832 $ hg commit -m 'add a pair of shoes'
833 $ cd ../client 833 $ cd ../client
834 834
835 Let's discover what other people did contribute: 835 Let's discover what other people have contributed:
836 836
837 $ hg pull 837 $ hg pull
838 pulling from $TESTTMP/server (glob) 838 pulling from $TESTTMP/server (glob)
839 searching for changes 839 searching for changes
840 adding changesets 840 adding changesets
1061 rebasing 7:cffff85af537 tools "Adding saw" 1061 rebasing 7:cffff85af537 tools "Adding saw"
1062 merging shopping 1062 merging shopping
1063 rebasing 8:34255b455dac tools "Adding drill" 1063 rebasing 8:34255b455dac tools "Adding drill"
1064 merging shopping 1064 merging shopping
1065 1065
1066 But what about the other topic? You can use 'hg topics --verbose' to see 1066 But what about the other topic? You can use ``hg topics --verbose`` to see
1067 information about all the topics: 1067 information about all the topics:
1068 1068
1069 $ hg topics --verbose 1069 $ hg topics --verbose
1070 drinks (on branch: default, 2 changesets, 2 behind) 1070 drinks (on branch: default, 2 changesets, 2 behind)
1071 * tools (on branch: default, 3 changesets) 1071 * tools (on branch: default, 3 changesets)
1072 1072
1073 The "2 behind" is telling you that there are 2 new changesets over the base of the topic. 1073 The "2 behind" is telling you that there are 2 new changesets on top of the base of the topic.
1074 1074
1075 Pushing that topic would create a new head, and therefore will be prevented: 1075 Pushing that topic would create a new head, and therefore will be prevented:
1076 1076
1077 $ hg push --rev drinks 1077 $ hg push --rev drinks
1078 pushing to $TESTTMP/server (glob) 1078 pushing to $TESTTMP/server (glob)
1081 (merge or see 'hg help push' for details about pushing new heads) 1081 (merge or see 'hg help push' for details about pushing new heads)
1082 [20] 1082 [20]
1083 1083
1084 1084
1085 Even after a rebase, pushing all active topics at the same time would publish 1085 Even after a rebase, pushing all active topics at the same time would publish
1086 them to the default branch, and then mercurial would complain about the 1086 them to the default branch, and then Mercurial would complain about the
1087 multiple *public* heads it would create on that branch: 1087 multiple *public* heads it would create on that branch:
1088 1088
1089 $ hg rebase -b drinks 1089 $ hg rebase -b drinks
1090 rebasing 9:8dfa45bd5e0c drinks "Adding apple juice" 1090 rebasing 9:8dfa45bd5e0c drinks "Adding apple juice"
1091 merging shopping 1091 merging shopping
1111 adding manifests 1111 adding manifests
1112 adding file changes 1112 adding file changes
1113 added 2 changesets with 2 changes to 1 files 1113 added 2 changesets with 2 changes to 1 files
1114 2 new obsolescence markers 1114 2 new obsolescence markers
1115 1115
1116 The published topic has now faded out, and the other is now marked as 1116 The published topic has now faded out, and the other is now marked as being
1117 "behind": 1117 "behind":
1118 1118
1119 $ hg topics --verbose 1119 $ hg topics --verbose
1120 * tools (on branch: default, 3 changesets, 2 behind) 1120 * tools (on branch: default, 3 changesets, 2 behind)
1121 1121
1131 =========================== 1131 ===========================
1132 1132
1133 Navigating within your stack 1133 Navigating within your stack
1134 ---------------------------- 1134 ----------------------------
1135 1135
1136 As we saw before `stack` displays changesets on your current topic in a clean way: 1136 As we saw before ``stack`` displays changesets on your current topic in a clean way:
1137 1137
1138 $ hg topics --verbose 1138 $ hg topics --verbose
1139 * tools (on branch: default, 3 changesets, 2 behind) 1139 * tools (on branch: default, 3 changesets, 2 behind)
1140 1140
1141 $ hg stack 1141 $ hg stack
1144 s3@ Adding drill (current) 1144 s3@ Adding drill (current)
1145 s2: Adding saw 1145 s2: Adding saw
1146 s1: Adding hammer 1146 s1: Adding hammer
1147 s0^ add a pair of shoes (base) 1147 s0^ add a pair of shoes (base)
1148 1148
1149 You can navigate in your current stack with `previous` and `next`. 1149 You can navigate in your current stack with ``previous`` and ``next``.
1150 1150
1151 `previous` will bring you back to the parent of the topic head. 1151 ``previous`` will bring you back to the parent of the topic head.
1152 1152
1153 $ hg previous 1153 $ hg previous
1154 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 1154 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1155 [s2] Adding saw 1155 [s2] Adding saw
1156 1156
1160 s3: Adding drill 1160 s3: Adding drill
1161 s2@ Adding saw (current) 1161 s2@ Adding saw (current)
1162 s1: Adding hammer 1162 s1: Adding hammer
1163 s0^ add a pair of shoes (base) 1163 s0^ add a pair of shoes (base)
1164 1164
1165 `next` will move you forward to the topic head. 1165 ``next`` will move you forward to the topic head.
1166 1166
1167 $ hg next 1167 $ hg next
1168 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 1168 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1169 [s3] Adding drill 1169 [s3] Adding drill
1170 1170
1174 s3@ Adding drill (current) 1174 s3@ Adding drill (current)
1175 s2: Adding saw 1175 s2: Adding saw
1176 s1: Adding hammer 1176 s1: Adding hammer
1177 s0^ add a pair of shoes (base) 1177 s0^ add a pair of shoes (base)
1178 1178
1179 You can also directly jump to a changeset within your stack with the revset `t#`. 1179 You can also directly jump to a changeset within your stack with the revset ``s<number>``.
1180 1180
1181 $ hg update s1 1181 $ hg update s1
1182 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 1182 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1183 1183
1184 $ hg stack 1184 $ hg stack
1362 s3$ Adding drill (orphan) 1362 s3$ Adding drill (orphan)
1363 s2$ Adding saw (orphan) 1363 s2$ Adding saw (orphan)
1364 s1@ Adding hammer to the shopping list (current) 1364 s1@ Adding hammer to the shopping list (current)
1365 s0^ add a pair of shoes (base) 1365 s0^ add a pair of shoes (base)
1366 1366
1367 It's easy to stabilize the situation, `next` has an `--evolve` option. It will 1367 It's easy to stabilize the situation, ``next`` has an ``--evolve`` option
1368 do the necessary relocation of `s2` and `s3` over the new `s1` without having 1368 (turned on by default nowadays). It will do the necessary relocation of `s2`
1369 to do that rebase by hand.: 1369 and `s3` over the new `s1` without having to do that rebase by hand:
1370 1370
1371 $ hg next --evolve 1371 $ hg next --evolve
1372 move:[s2] Adding saw 1372 move:[s2] Adding saw
1373 atop:[s1] Adding hammer to the shopping list 1373 atop:[s1] Adding hammer to the shopping list
1374 working directory is now at d5c51ee5762a 1374 working directory is now at d5c51ee5762a
1394 s3@ Adding drill (current) 1394 s3@ Adding drill (current)
1395 s2: Adding saw 1395 s2: Adding saw
1396 s1: Adding hammer to the shopping list 1396 s1: Adding hammer to the shopping list
1397 s0^ add a pair of shoes (base) 1397 s0^ add a pair of shoes (base)
1398 1398
1399 Let's take a look at `hg log` once again: 1399 Let's take a look at ``hg log`` once again:
1400 1400
1401 $ hg log -G -r "s0::" 1401 $ hg log -G -r "s0::"
1402 @ changeset: 20:bae3758e46bf 1402 @ changeset: 20:bae3758e46bf
1403 | tag: tip 1403 | tag: tip
1404 | topic: tools 1404 | topic: tools
1830 adding file changes 1830 adding file changes
1831 added 4 changesets with 4 changes to 1 files (+1 heads) 1831 added 4 changesets with 4 changes to 1 files (+1 heads)
1832 8 new obsolescence markers 1832 8 new obsolescence markers
1833 1833
1834 Pushing the new topic branch to a non-publishing server did not require 1834 Pushing the new topic branch to a non-publishing server did not require
1835 --force. As long as new heads are on their own topic, Mercurial will not 1835 ``--force``. As long as new heads are on their own topic, Mercurial will not
1836 complain about them. 1836 complain about them.
1837 1837
1838 From another client, we will get them with their topic: 1838 From another client, we will get them with their topic:
1839 1839
1840 $ cd ../other-client 1840 $ cd ../other-client