tests/test-topic-tutorial.t
branchmercurial-4.3
changeset 4077 9c025ec4af88
parent 3936 537fd9a86c06
parent 4076 f9a850018daa
child 4174 e07e764c0f48
equal deleted inserted replaced
4033:b609412b42b0 4077:9c025ec4af88
   250 command:
   250 command:
   251 
   251 
   252   $ hg stack
   252   $ hg stack
   253   ### topic: food
   253   ### topic: food
   254   ### target: default (branch)
   254   ### target: default (branch)
   255   t2@ adding fruits (current)
   255   s2@ adding fruits (current)
   256   t1: adding condiments
   256   s1: adding condiments
   257   t0^ Shopping list (base)
   257   s0^ Shopping list (base)
   258 
   258 
   259 The topic deactivates when we update away from it:
   259 The topic deactivates when we update away from it:
   260 
   260 
   261   $ hg update default
   261   $ hg update default
   262   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   262   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   610 
   610 
   611   $ hg topics --list
   611   $ hg topics --list
   612   ### topic: food
   612   ### topic: food
   613   ### target: default (branch)
   613   ### target: default (branch)
   614   (stack is empty)
   614   (stack is empty)
   615   t0^ adding fruits (base current)
   615   s0^ adding fruits (base current)
   616 
   616 
   617   $ hg log --graph
   617   $ hg log --graph
   618   @  changeset:   5:2d50db8b5b4c
   618   @  changeset:   5:2d50db8b5b4c
   619   |  tag:         tip
   619   |  tag:         tip
   620   |  user:        test
   620   |  user:        test
   787 The information displayed by ``hg stack`` adapts to the active topic:
   787 The information displayed by ``hg stack`` adapts to the active topic:
   788 
   788 
   789   $ hg stack
   789   $ hg stack
   790   ### topic: drinks
   790   ### topic: drinks
   791   ### target: default (branch)
   791   ### target: default (branch)
   792   t2@ Adding orange juice (current)
   792   s2@ Adding orange juice (current)
   793   t1: Adding apple juice
   793   s1: Adding apple juice
   794   t0^ adding fruits (base)
   794   s0^ adding fruits (base)
   795 
   795 
   796   $ hg update tools
   796   $ hg update tools
   797   switching to topic tools
   797   switching to topic tools
   798   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   798   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   799 
   799 
   800   $ hg stack
   800   $ hg stack
   801   ### topic: tools
   801   ### topic: tools
   802   ### target: default (branch)
   802   ### target: default (branch)
   803   t3@ Adding drill (current)
   803   s3@ Adding drill (current)
   804   t2: Adding saw
   804   s2: Adding saw
   805   t1: Adding hammer
   805   s1: Adding hammer
   806   t0^ adding fruits (base)
   806   s0^ adding fruits (base)
   807 
   807 
   808 They are seen as independent branches by Mercurial. No rebase or merge
   808 They are seen as independent branches by Mercurial. No rebase or merge
   809 between them will be attempted by default:
   809 between them will be attempted by default:
   810 
   810 
   811   $ hg rebase
   811   $ hg rebase
  1116    * tools (on branch: default, 3 changesets, 2 behind)
  1116    * tools (on branch: default, 3 changesets, 2 behind)
  1117 
  1117 
  1118   $ hg stack
  1118   $ hg stack
  1119   ### topic: tools
  1119   ### topic: tools
  1120   ### target: default (branch), 2 behind
  1120   ### target: default (branch), 2 behind
  1121   t3@ Adding drill (current)
  1121   s3@ Adding drill (current)
  1122   t2: Adding saw
  1122   s2: Adding saw
  1123   t1: Adding hammer
  1123   s1: Adding hammer
  1124   t0^ add a pair of shoes (base)
  1124   s0^ add a pair of shoes (base)
  1125 
  1125 
  1126 Working Within Your Stack
  1126 Working Within Your Stack
  1127 ===========================
  1127 ===========================
  1128 
  1128 
  1129 Navigating within your stack
  1129 Navigating within your stack
  1135    * tools (on branch: default, 3 changesets, 2 behind)
  1135    * tools (on branch: default, 3 changesets, 2 behind)
  1136 
  1136 
  1137   $ hg stack
  1137   $ hg stack
  1138   ### topic: tools
  1138   ### topic: tools
  1139   ### target: default (branch), 2 behind
  1139   ### target: default (branch), 2 behind
  1140   t3@ Adding drill (current)
  1140   s3@ Adding drill (current)
  1141   t2: Adding saw
  1141   s2: Adding saw
  1142   t1: Adding hammer
  1142   s1: Adding hammer
  1143   t0^ add a pair of shoes (base)
  1143   s0^ add a pair of shoes (base)
  1144 
  1144 
  1145 You can navigate in your current stack with `previous` and `next`.
  1145 You can navigate in your current stack with `previous` and `next`.
  1146 
  1146 
  1147 `previous` will bring you back to the parent of the topic head.
  1147 `previous` will bring you back to the parent of the topic head.
  1148 
  1148 
  1151   [14] Adding saw
  1151   [14] Adding saw
  1152 
  1152 
  1153   $ hg stack
  1153   $ hg stack
  1154   ### topic: tools
  1154   ### topic: tools
  1155   ### target: default (branch), 2 behind
  1155   ### target: default (branch), 2 behind
  1156   t3: Adding drill
  1156   s3: Adding drill
  1157   t2@ Adding saw (current)
  1157   s2@ Adding saw (current)
  1158   t1: Adding hammer
  1158   s1: Adding hammer
  1159   t0^ add a pair of shoes (base)
  1159   s0^ add a pair of shoes (base)
  1160 
  1160 
  1161 `next` will move you forward to the topic head.
  1161 `next` will move you forward to the topic head.
  1162 
  1162 
  1163   $ hg next
  1163   $ hg next
  1164   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1164   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1165   [15] Adding drill
  1165   [15] Adding drill
  1166 
  1166 
  1167   $ hg stack
  1167   $ hg stack
  1168   ### topic: tools
  1168   ### topic: tools
  1169   ### target: default (branch), 2 behind
  1169   ### target: default (branch), 2 behind
  1170   t3@ Adding drill (current)
  1170   s3@ Adding drill (current)
  1171   t2: Adding saw
  1171   s2: Adding saw
  1172   t1: Adding hammer
  1172   s1: Adding hammer
  1173   t0^ add a pair of shoes (base)
  1173   s0^ add a pair of shoes (base)
  1174 
  1174 
  1175 You can also directly jump to a changeset within your stack with the revset `t#`.
  1175 You can also directly jump to a changeset within your stack with the revset `t#`.
  1176 
  1176 
  1177   $ hg update t1
  1177   $ hg update s1
  1178   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1178   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1179 
  1179 
  1180   $ hg stack
  1180   $ hg stack
  1181   ### topic: tools
  1181   ### topic: tools
  1182   ### target: default (branch), 2 behind
  1182   ### target: default (branch), 2 behind
  1183   t3: Adding drill
  1183   s3: Adding drill
  1184   t2: Adding saw
  1184   s2: Adding saw
  1185   t1@ Adding hammer (current)
  1185   s1@ Adding hammer (current)
  1186   t0^ add a pair of shoes (base)
  1186   s0^ add a pair of shoes (base)
  1187 
  1187 
  1188 Editing your work mid-stack
  1188 Editing your work mid-stack
  1189 ---------------------------
  1189 ---------------------------
  1190 
  1190 
  1191 It's easy to edit your work inside your stack:
  1191 It's easy to edit your work inside your stack:
  1192 
  1192 
  1193   $ hg stack
  1193   $ hg stack
  1194   ### topic: tools
  1194   ### topic: tools
  1195   ### target: default (branch), 2 behind
  1195   ### target: default (branch), 2 behind
  1196   t3: Adding drill
  1196   s3: Adding drill
  1197   t2: Adding saw
  1197   s2: Adding saw
  1198   t1@ Adding hammer (current)
  1198   s1@ Adding hammer (current)
  1199   t0^ add a pair of shoes (base)
  1199   s0^ add a pair of shoes (base)
  1200 
  1200 
  1201   $ hg amend -m "Adding hammer to the shopping list"
  1201   $ hg amend -m "Adding hammer to the shopping list"
  1202   2 new unstable changesets
  1202   2 new unstable changesets
  1203 
  1203 
  1204 Understanding the current situation with hg log is not so easy, because
  1204 Understanding the current situation with hg log is not so easy, because
  1205 it shows too many things:
  1205 it shows too many things:
  1206 
  1206 
  1207   $ hg log -G -r "t0::"
  1207   $ hg log -G -r "s0::"
  1208   @  changeset:   18:b7509bd417f8
  1208   @  changeset:   18:b7509bd417f8
  1209   |  tag:         tip
  1209   |  tag:         tip
  1210   |  topic:       tools
  1210   |  topic:       tools
  1211   |  parent:      12:fbff9bc37a43
  1211   |  parent:      12:fbff9bc37a43
  1212   |  user:        test
  1212   |  user:        test
  1250   ~  date:        Thu Jan 01 00:00:00 1970 +0000
  1250   ~  date:        Thu Jan 01 00:00:00 1970 +0000
  1251      summary:     add a pair of shoes
  1251      summary:     add a pair of shoes
  1252   
  1252   
  1253 
  1253 
  1254 #if docgraph-ext
  1254 #if docgraph-ext
  1255   $ hg docgraph -r "t0::" --sphinx-directive --rankdir LR #rest-ignore
  1255   $ hg docgraph -r "s0::" --sphinx-directive --rankdir LR #rest-ignore
  1256   .. graphviz::
  1256   .. graphviz::
  1257   
  1257   
  1258       strict digraph "Mercurial graph" {
  1258       strict digraph "Mercurial graph" {
  1259       	graph [rankdir=LR,
  1259       	graph [rankdir=LR,
  1260       		splines=polyline
  1260       		splines=polyline
  1353 Fortunately stack shows you a better visualization:
  1353 Fortunately stack shows you a better visualization:
  1354 
  1354 
  1355   $ hg stack
  1355   $ hg stack
  1356   ### topic: tools
  1356   ### topic: tools
  1357   ### target: default (branch), 2 behind
  1357   ### target: default (branch), 2 behind
  1358   t3$ Adding drill (unstable)
  1358   s3$ Adding drill (unstable)
  1359   t2$ Adding saw (unstable)
  1359   s2$ Adding saw (unstable)
  1360   t1@ Adding hammer to the shopping list (current)
  1360   s1@ Adding hammer to the shopping list (current)
  1361   t0^ add a pair of shoes (base)
  1361   s0^ add a pair of shoes (base)
  1362 
  1362 
  1363 It's easy to stabilize the situation, `next` has an `--evolve` option.  It will
  1363 It's easy to stabilize the situation, `next` has an `--evolve` option.  It will
  1364 do the necessary relocation of `t2` and `t3` over the new `t1` without having
  1364 do the necessary relocation of `s2` and `s3` over the new `s1` without having
  1365 to do that rebase by hand.:
  1365 to do that rebase by hand.:
  1366 
  1366 
  1367   $ hg next --evolve
  1367   $ hg next --evolve
  1368   move:[14] Adding saw
  1368   move:[14] Adding saw
  1369   atop:[18] Adding hammer to the shopping list
  1369   atop:[18] Adding hammer to the shopping list
  1370   working directory now at d5c51ee5762a
  1370   working directory now at d5c51ee5762a
  1371 
  1371 
  1372   $ hg stack
  1372   $ hg stack
  1373   ### topic: tools
  1373   ### topic: tools
  1374   ### target: default (branch), 2 behind
  1374   ### target: default (branch), 2 behind
  1375   t3$ Adding drill (unstable)
  1375   s3$ Adding drill (unstable)
  1376   t2@ Adding saw (current)
  1376   s2@ Adding saw (current)
  1377   t1: Adding hammer to the shopping list
  1377   s1: Adding hammer to the shopping list
  1378   t0^ add a pair of shoes (base)
  1378   s0^ add a pair of shoes (base)
  1379 
  1379 
  1380 One more to go:
  1380 One more to go:
  1381 
  1381 
  1382   $ hg next --evolve
  1382   $ hg next --evolve
  1383   move:[15] Adding drill
  1383   move:[15] Adding drill
  1385   working directory now at bae3758e46bf
  1385   working directory now at bae3758e46bf
  1386 
  1386 
  1387   $ hg stack
  1387   $ hg stack
  1388   ### topic: tools
  1388   ### topic: tools
  1389   ### target: default (branch), 2 behind
  1389   ### target: default (branch), 2 behind
  1390   t3@ Adding drill (current)
  1390   s3@ Adding drill (current)
  1391   t2: Adding saw
  1391   s2: Adding saw
  1392   t1: Adding hammer to the shopping list
  1392   s1: Adding hammer to the shopping list
  1393   t0^ add a pair of shoes (base)
  1393   s0^ add a pair of shoes (base)
  1394 
  1394 
  1395 Let's take a look at `hg log` once again:
  1395 Let's take a look at `hg log` once again:
  1396 
  1396 
  1397   $ hg log -G -r "t0::"
  1397   $ hg log -G -r "s0::"
  1398   @  changeset:   20:bae3758e46bf
  1398   @  changeset:   20:bae3758e46bf
  1399   |  tag:         tip
  1399   |  tag:         tip
  1400   |  topic:       tools
  1400   |  topic:       tools
  1401   |  user:        test
  1401   |  user:        test
  1402   |  date:        Thu Jan 01 00:00:00 1970 +0000
  1402   |  date:        Thu Jan 01 00:00:00 1970 +0000
  1431   ~  date:        Thu Jan 01 00:00:00 1970 +0000
  1431   ~  date:        Thu Jan 01 00:00:00 1970 +0000
  1432      summary:     add a pair of shoes
  1432      summary:     add a pair of shoes
  1433   
  1433   
  1434 
  1434 
  1435 #if docgraph-ext
  1435 #if docgraph-ext
  1436   $ hg docgraph -r "t0::" --sphinx-directive --rankdir LR #rest-ignore
  1436   $ hg docgraph -r "s0::" --sphinx-directive --rankdir LR #rest-ignore
  1437   .. graphviz::
  1437   .. graphviz::
  1438   
  1438   
  1439       strict digraph "Mercurial graph" {
  1439       strict digraph "Mercurial graph" {
  1440       	graph [rankdir=LR,
  1440       	graph [rankdir=LR,
  1441       		splines=polyline
  1441       		splines=polyline
  1516 Multi-headed stack
  1516 Multi-headed stack
  1517 ------------------
  1517 ------------------
  1518 
  1518 
  1519 Stack is also very helpful when you have a multi-headed stack:
  1519 Stack is also very helpful when you have a multi-headed stack:
  1520 
  1520 
  1521   $ hg up t1
  1521   $ hg up s1
  1522   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1522   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1523 
  1523 
  1524   $ echo "nails" > new_shopping
  1524   $ echo "nails" > new_shopping
  1525   $ cat shopping >> new_shopping
  1525   $ cat shopping >> new_shopping
  1526   $ mv new_shopping shopping
  1526   $ mv new_shopping shopping
  1528   $ hg commit -m 'Adding nails'
  1528   $ hg commit -m 'Adding nails'
  1529 
  1529 
  1530   $ hg stack
  1530   $ hg stack
  1531   ### topic: tools (2 heads)
  1531   ### topic: tools (2 heads)
  1532   ### target: default (branch), 2 behind
  1532   ### target: default (branch), 2 behind
  1533   t4: Adding drill
  1533   s4: Adding drill
  1534   t3: Adding saw
  1534   s3: Adding saw
  1535   t1^ Adding hammer to the shopping list (base)
  1535   s1^ Adding hammer to the shopping list (base)
  1536   t2@ Adding nails (current)
  1536   s2@ Adding nails (current)
  1537   t1: Adding hammer to the shopping list
  1537   s1: Adding hammer to the shopping list
  1538   t0^ add a pair of shoes (base)
  1538   s0^ add a pair of shoes (base)
  1539 
  1539 
  1540 Solving this situation is easy with a topic: use merge or rebase.
  1540 Solving this situation is easy with a topic: use merge or rebase.
  1541 Merge within a multi-headed stack will use the other topic head as
  1541 Merge within a multi-headed stack will use the other topic head as
  1542 destination if the topic has two heads. But rebasing will yield a
  1542 destination if the topic has two heads. But rebasing will yield a
  1543 completely linear history so it's what we will do.
  1543 completely linear history so it's what we will do.
  1766       	19 -> 20	 [arrowhead=none,
  1766       	19 -> 20	 [arrowhead=none,
  1767       		penwidth=2.0];
  1767       		penwidth=2.0];
  1768       }
  1768       }
  1769 #endif
  1769 #endif
  1770 
  1770 
  1771   $ hg up t4
  1771   $ hg up s4
  1772   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1772   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1773 
  1773 
  1774   $ hg rebase
  1774   $ hg rebase
  1775   rebasing 19:d5c51ee5762a "Adding saw"
  1775   rebasing 19:d5c51ee5762a "Adding saw"
  1776   merging shopping
  1776   merging shopping
  1778   merging shopping
  1778   merging shopping
  1779 
  1779 
  1780   $ hg stack
  1780   $ hg stack
  1781   ### topic: tools
  1781   ### topic: tools
  1782   ### target: default (branch), 2 behind
  1782   ### target: default (branch), 2 behind
  1783   t4@ Adding drill (current)
  1783   s4@ Adding drill (current)
  1784   t3: Adding saw
  1784   s3: Adding saw
  1785   t2: Adding nails
  1785   s2: Adding nails
  1786   t1: Adding hammer to the shopping list
  1786   s1: Adding hammer to the shopping list
  1787   t0^ add a pair of shoes (base)
  1787   s0^ add a pair of shoes (base)
  1788 
  1788 
  1789 Collaborating through a non-publishing server
  1789 Collaborating through a non-publishing server
  1790 =============================================
  1790 =============================================
  1791 
  1791 
  1792 .. setup:
  1792 .. setup:
  1852   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1852   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1853 
  1853 
  1854   $ hg stack
  1854   $ hg stack
  1855   ### topic: tools
  1855   ### topic: tools
  1856   ### target: default (branch), 2 behind
  1856   ### target: default (branch), 2 behind
  1857   t4@ Adding drill (current)
  1857   s4@ Adding drill (current)
  1858   t3: Adding saw
  1858   s3: Adding saw
  1859   t2: Adding nails
  1859   s2: Adding nails
  1860   t1: Adding hammer to the shopping list
  1860   s1: Adding hammer to the shopping list
  1861   t0^ add a pair of shoes (base)
  1861   s0^ add a pair of shoes (base)
  1862 
  1862 
  1863 We can also add new changesets and share them:
  1863 We can also add new changesets and share them:
  1864 
  1864 
  1865   $ echo screws >> shopping
  1865   $ echo screws >> shopping
  1866 
  1866 
  1891   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1891   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1892 
  1892 
  1893   $ hg stack
  1893   $ hg stack
  1894   ### topic: tools
  1894   ### topic: tools
  1895   ### target: default (branch), 2 behind
  1895   ### target: default (branch), 2 behind
  1896   t5@ Adding screws (current)
  1896   s5@ Adding screws (current)
  1897   t4: Adding drill
  1897   s4: Adding drill
  1898   t3: Adding saw
  1898   s3: Adding saw
  1899   t2: Adding nails
  1899   s2: Adding nails
  1900   t1: Adding hammer to the shopping list
  1900   s1: Adding hammer to the shopping list
  1901   t0^ add a pair of shoes (base)
  1901   s0^ add a pair of shoes (base)