1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631
|
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.8.1: http://docutils.sourceforge.net/" />
<title>hg</title>
<meta name="author" content="Matt Mackall <mpm@selenic.com>" />
<meta name="organization" content="Mercurial" />
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div class="document" id="hg">
<h1 class="title">hg</h1>
<h2 class="subtitle" id="mercurial-source-code-management-system">Mercurial source code management system</h2>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Matt Mackall <<a class="reference external" href="mailto:mpm@selenic.com">mpm@selenic.com</a>></td></tr>
<tr><th class="docinfo-name">Organization:</th>
<td>Mercurial</td></tr>
<tr class="field"><th class="docinfo-name">Manual section:</th><td class="field-body">1</td>
</tr>
<tr class="field"><th class="docinfo-name">Manual group:</th><td class="field-body">Mercurial Manual</td>
</tr>
</tbody>
</table>
<div class="contents htmlonly topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#synopsis" id="id37">Synopsis</a></li>
<li><a class="reference internal" href="#description" id="id38">Description</a></li>
<li><a class="reference internal" href="#command-elements" id="id39">Command Elements</a></li>
<li><a class="reference internal" href="#options" id="id40">Options</a></li>
<li><a class="reference internal" href="#commands" id="id41">Commands</a></li>
<li><a class="reference internal" href="#date-formats" id="id42">Date Formats</a></li>
<li><a class="reference internal" href="#diff-formats" id="id43">Diff Formats</a></li>
<li><a class="reference internal" href="#environment-variables" id="id44">Environment Variables</a></li>
<li><a class="reference internal" href="#using-additional-features" id="id45">Using Additional Features</a></li>
<li><a class="reference internal" href="#specifying-file-sets" id="id46">Specifying File Sets</a></li>
<li><a class="reference internal" href="#id1" id="id47">Glossary</a></li>
<li><a class="reference internal" href="#syntax-for-mercurial-ignore-files" id="id48">Syntax for Mercurial Ignore Files</a></li>
<li><a class="reference internal" href="#id2" id="id49">Synopsis</a></li>
<li><a class="reference internal" href="#id3" id="id50">Description</a></li>
<li><a class="reference internal" href="#syntax" id="id51">Syntax</a></li>
<li><a class="reference internal" href="#example" id="id52">Example</a></li>
<li><a class="reference internal" href="#configuring-hgweb" id="id53">Configuring hgweb</a></li>
<li><a class="reference internal" href="#id4" id="id54">Merge Tools</a></li>
<li><a class="reference internal" href="#specifying-multiple-revisions" id="id55">Specifying Multiple Revisions</a></li>
<li><a class="reference internal" href="#file-name-patterns" id="id56">File Name Patterns</a></li>
<li><a class="reference internal" href="#working-with-phases" id="id57">Working with Phases</a></li>
<li><a class="reference internal" href="#what-are-phases" id="id58">What are phases?</a></li>
<li><a class="reference internal" href="#how-are-phases-managed" id="id59">How are phases managed?</a></li>
<li><a class="reference internal" href="#phases-and-servers" id="id60">Phases and servers</a></li>
<li><a class="reference internal" href="#examples" id="id61">Examples</a></li>
<li><a class="reference internal" href="#specifying-single-revisions" id="id62">Specifying Single Revisions</a></li>
<li><a class="reference internal" href="#specifying-revision-sets" id="id63">Specifying Revision Sets</a></li>
<li><a class="reference internal" href="#subrepositories" id="id64">Subrepositories</a></li>
<li><a class="reference internal" href="#adding-a-subrepository" id="id65">Adding a Subrepository</a></li>
<li><a class="reference internal" href="#synchronizing-a-subrepository" id="id66">Synchronizing a Subrepository</a></li>
<li><a class="reference internal" href="#deleting-a-subrepository" id="id67">Deleting a Subrepository</a></li>
<li><a class="reference internal" href="#interaction-with-mercurial-commands" id="id68">Interaction with Mercurial Commands</a></li>
<li><a class="reference internal" href="#remapping-subrepositories-sources" id="id69">Remapping Subrepositories Sources</a></li>
<li><a class="reference internal" href="#template-usage" id="id70">Template Usage</a></li>
<li><a class="reference internal" href="#url-paths" id="id71">URL Paths</a></li>
<li><a class="reference internal" href="#id5" id="id72">Extensions</a></li>
<li><a class="reference internal" href="#files" id="id73">Files</a></li>
<li><a class="reference internal" href="#bugs" id="id74">Bugs</a></li>
<li><a class="reference internal" href="#see-also" id="id75">See Also</a></li>
<li><a class="reference internal" href="#author" id="id76">Author</a></li>
<li><a class="reference internal" href="#resources" id="id77">Resources</a></li>
<li><a class="reference internal" href="#copying" id="id78">Copying</a></li>
</ul>
</div>
<div class="section" id="synopsis">
<h1><a class="toc-backref" href="#contents">Synopsis</a></h1>
<p><strong>hg</strong> <em>command</em> [<em>option</em>]... [<em>argument</em>]...</p>
</div>
<div class="section" id="description">
<h1><a class="toc-backref" href="#contents">Description</a></h1>
<p>The <strong>hg</strong> command provides a command line interface to the Mercurial
system.</p>
</div>
<div class="section" id="command-elements">
<h1><a class="toc-backref" href="#contents">Command Elements</a></h1>
<dl class="docutils">
<dt>files...</dt>
<dd>indicates one or more filename or relative path filenames; see
<a class="reference internal" href="#file-name-patterns">File Name Patterns</a> for information on pattern matching</dd>
<dt>path</dt>
<dd>indicates a path on the local machine</dd>
<dt>revision</dt>
<dd>indicates a changeset which can be specified as a changeset
revision number, a tag, or a unique substring of the changeset
hash value</dd>
<dt>repository path</dt>
<dd>either the pathname of a local repository or the URI of a remote
repository.</dd>
</dl>
</div>
<div class="section" id="options">
<h1><a class="toc-backref" href="#contents">Options</a></h1>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-R</span>, <span class="option">--repository</span></kbd></td>
</tr>
<tr><td> </td><td>repository root directory or name of overlay bundle file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--cwd</span></kbd></td>
<td>change working directory</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-y</span>, <span class="option">--noninteractive</span></kbd></td>
</tr>
<tr><td> </td><td>do not prompt, automatically pick the first choice for all prompts</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-q</span>, <span class="option">--quiet</span></kbd></td>
<td>suppress output</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-v</span>, <span class="option">--verbose</span></kbd></td>
<td>enable additional output</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--config</span></kbd></td>
<td>set/override config option (use 'section.name=value')</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--debug</span></kbd></td>
<td>enable debugging output</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--debugger</span></kbd></td>
<td>start debugger</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--encoding</span></kbd></td>
<td>set the charset encoding (default: ascii)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--encodingmode</span></kbd></td>
<td>set the charset encoding mode (default: strict)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--traceback</span></kbd></td>
<td>always print a traceback on exception</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--time</span></kbd></td>
<td>time how long the command takes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--profile</span></kbd></td>
<td>print command execution profile</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--version</span></kbd></td>
<td>output version information and exit</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-h</span>, <span class="option">--help</span></kbd></td>
<td>display help and exit</td></tr>
</tbody>
</table>
</div>
<div class="section" id="commands">
<h1><a class="toc-backref" href="#contents">Commands</a></h1>
<div class="section" id="add">
<h2>add</h2>
<pre class="literal-block">
hg add [OPTION]... [FILE]...
</pre>
<p>Schedule files to be version controlled and added to the
repository.</p>
<p>The files will be added to the repository at the next commit. To
undo an add before that, see <a class="reference external" href="hg.1.html#forget"><tt class="docutils literal">hg forget</tt></a>.</p>
<p>If no names are given, add all files to the repository.</p>
<div class="verbose container">
<p>An example showing how new (unknown) files are added
automatically by <a class="reference external" href="hg.1.html#add"><tt class="docutils literal">hg add</tt></a>:</p>
<pre class="literal-block">
$ ls
foo.c
$ hg status
? foo.c
$ hg add
adding foo.c
$ hg status
A foo.c
</pre>
</div>
<p>Returns 0 if all files are successfully added.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td>
<td>recurse into subrepositories</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td>
<td>do not perform actions, just print output</td></tr>
</tbody>
</table>
</div>
<div class="section" id="addremove">
<h2>addremove</h2>
<pre class="literal-block">
hg addremove [OPTION]... [FILE]...
</pre>
<p>Add all new files and remove all missing files from the
repository.</p>
<p>New files are ignored if they match any of the patterns in
<tt class="docutils literal">.hgignore</tt>. As with add, these changes take effect at the next
commit.</p>
<p>Use the -s/--similarity option to detect renamed files. With a
parameter greater than 0, this compares every removed file with
every added file and records those similar enough as renames. This
option takes a percentage between 0 (disabled) and 100 (files must
be identical) as its parameter. Detecting renamed files this way
can be expensive. After using this option, <a class="reference external" href="hg.1.html#status"><tt class="docutils literal">hg status <span class="pre">-C</span></tt></a> can be
used to check which files were identified as moved or renamed.
If this option is not specified, only renames of identical files
are detected.</p>
<p>Returns 0 if all files are successfully added.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-s</span>, <span class="option">--similarity</span></kbd></td>
</tr>
<tr><td> </td><td>guess renamed files by similarity (0<=s<=100)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td>
<td>do not perform actions, just print output</td></tr>
</tbody>
</table>
</div>
<div class="section" id="annotate">
<h2>annotate</h2>
<pre class="literal-block">
hg annotate [-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...
</pre>
<p>List changes in files, showing the revision id responsible for
each line</p>
<p>This command is useful for discovering when a change was made and
by whom.</p>
<p>Without the -a/--text option, annotate will avoid processing files
it detects as binary. With -a, annotate will annotate the file
anyway, although the results will probably be neither useful
nor desirable.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>annotate the specified revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--follow</span></kbd></td>
<td>follow copies/renames and list the filename (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--no-follow</span></kbd></td>
<td>don't follow copies and renames</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--text</span></kbd></td>
<td>treat all files as text</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>list the author (long with -v)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--file</span></kbd></td>
<td>list the filename</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>list the date (short with -q)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--number</span></kbd></td>
<td>list the revision number (default)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-c</span>, <span class="option">--changeset</span></kbd></td>
</tr>
<tr><td> </td><td>list the changeset</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-l</span>, <span class="option">--line-number</span></kbd></td>
</tr>
<tr><td> </td><td>show line number at the first appearance</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-w</span>, <span class="option">--ignore-all-space</span></kbd></td>
</tr>
<tr><td> </td><td>ignore white space when comparing lines</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-b</span>, <span class="option">--ignore-space-change</span></kbd></td>
</tr>
<tr><td> </td><td>ignore changes in the amount of white space</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-B</span>, <span class="option">--ignore-blank-lines</span></kbd></td>
</tr>
<tr><td> </td><td>ignore changes whose lines are all blank</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td><p class="first">exclude names matching the given patterns</p>
<p class="last">aliases: blame</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="archive">
<h2>archive</h2>
<pre class="literal-block">
hg archive [OPTION]... DEST
</pre>
<p>By default, the revision used is the parent of the working
directory; use -r/--rev to specify a different revision.</p>
<p>The archive type is automatically detected based on file
extension (or override using -t/--type).</p>
<div class="verbose container">
<p>Examples:</p>
<ul>
<li><p class="first">create a zip file containing the 1.0 release:</p>
<pre class="literal-block">
hg archive -r 1.0 project-1.0.zip
</pre>
</li>
<li><p class="first">create a tarball excluding .hg files:</p>
<pre class="literal-block">
hg archive project.tar.gz -X ".hg*"
</pre>
</li>
</ul>
</div>
<p>Valid types are:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name"><tt class="docutils literal">files</tt>:</th><td class="field-body">a directory full of files (default)</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">tar</tt>:</th><td class="field-body">tar archive, uncompressed</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">tbz2</tt>:</th><td class="field-body">tar archive, compressed using bzip2</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">tgz</tt>:</th><td class="field-body">tar archive, compressed using gzip</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">uzip</tt>:</th><td class="field-body">zip archive, uncompressed</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">zip</tt>:</th><td class="field-body">zip archive, compressed using deflate</td>
</tr>
</tbody>
</table>
<p>The exact name of the destination archive or directory is given
using a format string; see <a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg help export</tt></a> for details.</p>
<p>Each member added to an archive file has a directory prefix
prepended. Use -p/--prefix to specify a format string for the
prefix. The default is the basename of the archive, with suffixes
removed.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">--no-decode</span></kbd></td>
<td>do not pass files through decoders</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--prefix</span></kbd></td>
<td>directory prefix for files in archive</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revision to distribute</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--type</span></kbd></td>
<td>type of distribution to create</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td>
<td>recurse into subrepositories</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="backout">
<h2>backout</h2>
<pre class="literal-block">
hg backout [OPTION]... [-r] REV
</pre>
<p>Prepare a new changeset with the effect of REV undone in the
current working directory.</p>
<p>If REV is the parent of the working directory, then this new changeset
is committed automatically. Otherwise, hg needs to merge the
changes and the merged result is left uncommitted.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">backout cannot be used to fix either an unwanted or
incorrect merge.</p>
</div>
<div class="verbose container">
<p>By default, the pending changeset will have one parent,
maintaining a linear history. With --merge, the pending
changeset will instead have two parents: the old parent of the
working directory and a new child of REV that simply undoes REV.</p>
<p>Before version 1.7, the behavior without --merge was equivalent
to specifying --merge followed by <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update <span class="pre">--clean</span> .</tt></a> to
cancel the merge and leave the child of REV as a head to be
merged separately.</p>
</div>
<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">--merge</span></kbd></td>
<td>merge with old dirstate parent after backout</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--parent</span></kbd></td>
<td>parent to choose when backing out merge (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revision to backout</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--tool</span></kbd></td>
<td>specify merge tool</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>record the specified date as commit date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>record the specified user as committer</td></tr>
</tbody>
</table>
</div>
<div class="section" id="bisect">
<h2>bisect</h2>
<pre class="literal-block">
hg bisect [-gbsr] [-U] [-c CMD] [REV]
</pre>
<p>This command helps to find changesets which introduce problems. To
use, mark the earliest changeset you know exhibits the problem as
bad, then mark the latest changeset which is free from the problem
as good. Bisect will update your working directory to a revision
for testing (unless the -U/--noupdate option is specified). Once
you have performed tests, mark the working directory as good or
bad, and bisect will either update to another candidate changeset
or announce that it has found the bad revision.</p>
<p>As a shortcut, you can also use the revision argument to mark a
revision as good or bad without checking it out first.</p>
<p>If you supply a command, it will be used for automatic bisection.
Its exit status will be used to mark revisions as good or bad:
status 0 means good, 125 means to skip the revision, 127
(command not found) will abort the bisection, and any other
non-zero exit status means the revision is bad.</p>
<div class="verbose container">
<p>Some examples:</p>
<ul>
<li><p class="first">start a bisection with known bad revision 12, and good revision 34:</p>
<pre class="literal-block">
hg bisect --bad 34
hg bisect --good 12
</pre>
</li>
<li><p class="first">advance the current bisection by marking current revision as good or
bad:</p>
<pre class="literal-block">
hg bisect --good
hg bisect --bad
</pre>
</li>
<li><p class="first">mark the current revision, or a known revision, to be skipped (eg. if
that revision is not usable because of another issue):</p>
<pre class="literal-block">
hg bisect --skip
hg bisect --skip 23
</pre>
</li>
<li><p class="first">forget the current bisection:</p>
<pre class="literal-block">
hg bisect --reset
</pre>
</li>
<li><p class="first">use 'make && make tests' to automatically find the first broken
revision:</p>
<pre class="literal-block">
hg bisect --reset
hg bisect --bad 34
hg bisect --good 12
hg bisect --command 'make && make tests'
</pre>
</li>
<li><p class="first">see all changesets whose states are already known in the current
bisection:</p>
<pre class="literal-block">
hg log -r "bisect(pruned)"
</pre>
</li>
<li><p class="first">see all changesets that took part in the current bisection:</p>
<pre class="literal-block">
hg log -r "bisect(range)"
</pre>
</li>
<li><p class="first">with the graphlog extension, you can even get a nice graph:</p>
<pre class="literal-block">
hg log --graph -r "bisect(range)"
</pre>
</li>
</ul>
<p>See <a class="reference external" href="hg.1.html#revsets"><tt class="docutils literal">hg help revsets</tt></a> for more about the <cite>bisect()</cite> keyword.</p>
</div>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--reset</span></kbd></td>
<td>reset bisect state</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--good</span></kbd></td>
<td>mark changeset good</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--bad</span></kbd></td>
<td>mark changeset bad</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--skip</span></kbd></td>
<td>skip testing changeset</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--extend</span></kbd></td>
<td>extend the bisect range</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--command</span></kbd></td>
<td>use command to check changeset state</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-U</span>, <span class="option">--noupdate</span></kbd></td>
<td>do not update to target</td></tr>
</tbody>
</table>
</div>
<div class="section" id="bookmarks">
<h2>bookmarks</h2>
<pre class="literal-block">
hg bookmarks [-f] [-d] [-i] [-m NAME] [-r REV] [NAME]
</pre>
<p>Bookmarks are pointers to certain commits that move when committing.
Bookmarks are local. They can be renamed, copied and deleted. It is
possible to use <a class="reference external" href="hg.1.html#merge"><tt class="docutils literal">hg merge NAME</tt></a> to merge from a given bookmark, and
<a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update NAME</tt></a> to update to a given bookmark.</p>
<p>You can use <a class="reference external" href="hg.1.html#bookmark"><tt class="docutils literal">hg bookmark NAME</tt></a> to set a bookmark on the working
directory's parent revision with the given name. If you specify
a revision using -r REV (where REV may be an existing bookmark),
the bookmark is assigned to that revision.</p>
<p>Bookmarks can be pushed and pulled between repositories (see <a class="reference external" href="hg.1.html#push"><tt class="docutils literal">hg help
push</tt></a> and <a class="reference external" href="hg.1.html#pull"><tt class="docutils literal">hg help pull</tt></a>). This requires both the local and remote
repositories to support bookmarks. For versions prior to 1.8, this means
the bookmarks extension must be enabled.</p>
<p>With -i/--inactive, the new bookmark will not be made the active
bookmark. If -r/--rev is given, the new bookmark will not be made
active even if -i/--inactive is not given. If no NAME is given, the
current active bookmark will be marked inactive.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>force</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--delete</span></kbd></td>
<td>delete a given bookmark</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--rename</span></kbd></td>
<td>rename a given bookmark</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-i</span>, <span class="option">--inactive</span></kbd></td>
<td>mark a bookmark inactive</td></tr>
</tbody>
</table>
</div>
<div class="section" id="branch">
<h2>branch</h2>
<pre class="literal-block">
hg branch [-fC] [NAME]
</pre>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">Branch names are permanent and global. Use <a class="reference external" href="hg.1.html#bookmark"><tt class="docutils literal">hg bookmark</tt></a> to create a
light-weight bookmark instead. See <a class="reference external" href="hg.1.html#glossary"><tt class="docutils literal">hg help glossary</tt></a> for more
information about named branches and bookmarks.</p>
</div>
<p>With no argument, show the current branch name. With one argument,
set the working directory branch name (the branch will not exist
in the repository until the next commit). Standard practice
recommends that primary development take place on the 'default'
branch.</p>
<p>Unless -f/--force is specified, branch will not let you set a
branch name that already exists, even if it's inactive.</p>
<p>Use -C/--clean to reset the working directory branch to that of
the parent of the working directory, negating a previous branch
change.</p>
<p>Use the command <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a> to switch to an existing branch. Use
<a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit <span class="pre">--close-branch</span></tt></a> to mark this branch as closed.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>set branch name even if it shadows an existing branch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-C</span>, <span class="option">--clean</span></kbd></td>
<td>reset branch name to parent branch name</td></tr>
</tbody>
</table>
</div>
<div class="section" id="branches">
<h2>branches</h2>
<pre class="literal-block">
hg branches [-ac]
</pre>
<p>List the repository's named branches, indicating which ones are
inactive. If -c/--closed is specified, also list branches which have
been marked closed (see <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit <span class="pre">--close-branch</span></tt></a>).</p>
<p>If -a/--active is specified, only show active branches. A branch
is considered active if it contains repository heads.</p>
<p>Use the command <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a> to switch to an existing branch.</p>
<p>Returns 0.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--active</span></kbd></td>
<td>show only branches that have unmerged heads</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--closed</span></kbd></td>
<td>show normal and closed branches</td></tr>
</tbody>
</table>
</div>
<div class="section" id="bundle">
<h2>bundle</h2>
<pre class="literal-block">
hg bundle [-f] [-t TYPE] [-a] [-r REV]... [--base REV]... FILE [DEST]
</pre>
<p>Generate a compressed changegroup file collecting changesets not
known to be in another repository.</p>
<p>If you omit the destination repository, then hg assumes the
destination will have all the nodes you specify with --base
parameters. To create a bundle containing all changesets, use
-a/--all (or --base null).</p>
<p>You can change compression method with the -t/--type option.
The available compression methods are: none, bzip2, and
gzip (by default, bundles are compressed using bzip2).</p>
<p>The bundle file can then be transferred using conventional means
and applied to another repository with the unbundle or pull
command. This is useful when direct push and pull are not
available or when exporting an entire repository is undesirable.</p>
<p>Applying bundles preserves all changeset contents including
permissions, copy/rename information, and revision history.</p>
<p>Returns 0 on success, 1 if no changes found.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>run even when the destination is unrelated</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>a changeset intended to be added to the destination</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>a specific branch you would like to bundle</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--base</span></kbd></td>
<td>a base changeset assumed to be available at the destination</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--all</span></kbd></td>
<td>bundle all changesets in the repository</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--type</span></kbd></td>
<td>bundle compression type to use (default: bzip2)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--insecure</span></kbd></td>
<td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
</tbody>
</table>
</div>
<div class="section" id="cat">
<h2>cat</h2>
<pre class="literal-block">
hg cat [OPTION]... FILE...
</pre>
<p>Print the specified files as they were at the given revision. If
no revision is given, the parent of the working directory is used,
or tip if no revision is checked out.</p>
<p>Output may be to a file, in which case the name of the file is
given using a format string. The formatting rules are the same as
for the export command, with the following additions:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name"><tt class="docutils literal">%s</tt>:</th><td class="field-body">basename of file being printed</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%d</tt>:</th><td class="field-body">dirname of file being printed, or '.' if in repository root</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%p</tt>:</th><td class="field-body">root-relative path name of file being printed</td>
</tr>
</tbody>
</table>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-o</span>, <span class="option">--output</span></kbd></td>
<td>print output to file with formatted name</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>print the given revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--decode</span></kbd></td>
<td>apply any matching decode filter</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="clone">
<h2>clone</h2>
<pre class="literal-block">
hg clone [OPTION]... SOURCE [DEST]
</pre>
<p>Create a copy of an existing repository in a new directory.</p>
<p>If no destination directory name is specified, it defaults to the
basename of the source.</p>
<p>The location of the source is added to the new repository's
<tt class="docutils literal">.hg/hgrc</tt> file, as the default to be used for future pulls.</p>
<p>Only local paths and <tt class="docutils literal"><span class="pre">ssh://</span></tt> URLs are supported as
destinations. For <tt class="docutils literal"><span class="pre">ssh://</span></tt> destinations, no working directory or
<tt class="docutils literal">.hg/hgrc</tt> will be created on the remote side.</p>
<p>To pull only a subset of changesets, specify one or more revisions
identifiers with -r/--rev or branches with -b/--branch. The
resulting clone will contain only the specified changesets and
their ancestors. These options (or 'clone src#rev dest') imply
--pull, even for local source repositories. Note that specifying a
tag will include the tagged changeset but not the changeset
containing the tag.</p>
<p>To check out a particular version, use -u/--update, or
-U/--noupdate to create a clone with no working directory.</p>
<div class="verbose container">
<p>For efficiency, hardlinks are used for cloning whenever the
source and destination are on the same filesystem (note this
applies only to the repository data, not to the working
directory). Some filesystems, such as AFS, implement hardlinking
incorrectly, but do not report errors. In these cases, use the
--pull option to avoid hardlinking.</p>
<p>In some cases, you can clone repositories and the working
directory using full hardlinks with</p>
<pre class="literal-block">
$ cp -al REPO REPOCLONE
</pre>
<p>This is the fastest way to clone, but it is not always safe. The
operation is not atomic (making sure REPO is not modified during
the operation is up to you) and you have to make sure your
editor breaks hardlinks (Emacs and most Linux Kernel tools do
so). Also, this is not compatible with certain extensions that
place their metadata under the .hg directory, such as mq.</p>
<p>Mercurial will update the working directory to the first applicable
revision from this list:</p>
<ol class="loweralpha simple">
<li>null if -U or the source repository has no changesets</li>
<li>if -u . and the source repository is local, the first parent of
the source repository's working directory</li>
<li>the changeset specified with -u (if a branch name, this means the
latest head of that branch)</li>
<li>the changeset specified with -r</li>
<li>the tipmost head specified with -b</li>
<li>the tipmost head specified with the url#branch source syntax</li>
<li>the tipmost head of the default branch</li>
<li>tip</li>
</ol>
<p>Examples:</p>
<ul>
<li><p class="first">clone a remote repository to a new directory named hg/:</p>
<pre class="literal-block">
hg clone http://selenic.com/hg
</pre>
</li>
<li><p class="first">create a lightweight local clone:</p>
<pre class="literal-block">
hg clone project/ project-feature/
</pre>
</li>
<li><p class="first">clone from an absolute path on an ssh server (note double-slash):</p>
<pre class="literal-block">
hg clone ssh://user@server//home/projects/alpha/
</pre>
</li>
<li><p class="first">do a high-speed clone over a LAN while checking out a
specified version:</p>
<pre class="literal-block">
hg clone --uncompressed http://server/repo -u 1.5
</pre>
</li>
<li><p class="first">create a repository without changesets after a particular revision:</p>
<pre class="literal-block">
hg clone -r 04e544 experimental/ good/
</pre>
</li>
<li><p class="first">clone (and track) a particular named branch:</p>
<pre class="literal-block">
hg clone http://selenic.com/hg#stable
</pre>
</li>
</ul>
</div>
<p>See <a class="reference external" href="hg.1.html#urls"><tt class="docutils literal">hg help urls</tt></a> for details on specifying URLs.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-U</span>, <span class="option">--noupdate</span></kbd></td>
<td>the clone will include an empty working copy (only a repository)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-u</span>, <span class="option">--updaterev</span></kbd></td>
</tr>
<tr><td> </td><td>revision, tag or branch to check out</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>include the specified changeset</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>clone only the specified branch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--pull</span></kbd></td>
<td>use pull protocol to copy metadata</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--uncompressed</span></kbd></td>
<td>use uncompressed transfer (fast over LAN)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--insecure</span></kbd></td>
<td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
</tbody>
</table>
</div>
<div class="section" id="commit">
<h2>commit</h2>
<pre class="literal-block">
hg commit [OPTION]... [FILE]...
</pre>
<p>Commit changes to the given files into the repository. Unlike a
centralized SCM, this operation is a local operation. See
<a class="reference external" href="hg.1.html#push"><tt class="docutils literal">hg push</tt></a> for a way to actively distribute your changes.</p>
<p>If a list of files is omitted, all changes reported by <a class="reference external" href="hg.1.html#status"><tt class="docutils literal">hg status</tt></a>
will be committed.</p>
<p>If you are committing the result of a merge, do not provide any
filenames or -I/-X filters.</p>
<p>If no commit message is specified, Mercurial starts your
configured editor where you can enter a message. In case your
commit fails, you will find a backup of your message in
<tt class="docutils literal"><span class="pre">.hg/last-message.txt</span></tt>.</p>
<p>The --amend flag can be used to amend the parent of the
working directory with a new commit that contains the changes
in the parent in addition to those currently reported by <a class="reference external" href="hg.1.html#status"><tt class="docutils literal">hg status</tt></a>,
if there are any. The old commit is stored in a backup bundle in
<tt class="docutils literal"><span class="pre">.hg/strip-backup</span></tt> (see <a class="reference external" href="hg.1.html#bundle"><tt class="docutils literal">hg help bundle</tt></a> and <a class="reference external" href="hg.1.html#unbundle"><tt class="docutils literal">hg help unbundle</tt></a>
on how to restore it).</p>
<p>Message, user and date are taken from the amended commit unless
specified. When a message isn't specified on the command line,
the editor will open with the message of the amended commit.</p>
<p>It is not possible to amend public changesets (see <a class="reference external" href="hg.1.html#phases"><tt class="docutils literal">hg help phases</tt></a>)
or changesets that have children.</p>
<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>Returns 0 on success, 1 if nothing changed.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-A</span>, <span class="option">--addremove</span></kbd></td>
</tr>
<tr><td> </td><td>mark new/missing files as added/removed before committing</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--close-branch</span></kbd></td>
<td>mark a branch as closed, hiding it from the branch list</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--amend</span></kbd></td>
<td>amend the parent of the working dir</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>record the specified date as commit date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>record the specified user as committer</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td>
<td><p class="first">recurse into subrepositories</p>
<p class="last">aliases: ci</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="copy">
<h2>copy</h2>
<pre class="literal-block">
hg copy [OPTION]... [SOURCE]... DEST
</pre>
<p>Mark dest as having copies of source files. If dest is a
directory, copies are put in that directory. If dest is a file,
the source must be a single file.</p>
<p>By default, this command copies the contents of files as they
exist in the working directory. If invoked with -A/--after, the
operation is recorded, but no copying is performed.</p>
<p>This command takes effect with the next commit. To undo a copy
before that, see <a class="reference external" href="hg.1.html#revert"><tt class="docutils literal">hg revert</tt></a>.</p>
<p>Returns 0 on success, 1 if errors are encountered.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-A</span>, <span class="option">--after</span></kbd></td>
<td>record a copy that has already occurred</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>forcibly copy over an existing managed file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td>
<td><p class="first">do not perform actions, just print output</p>
<p class="last">aliases: cp</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="diff">
<h2>diff</h2>
<pre class="literal-block">
hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
</pre>
<p>Show differences between revisions for the specified files.</p>
<p>Differences between files are shown using the unified diff format.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">diff may generate unexpected results for merges, as it will
default to comparing against the working directory's first
parent changeset if no revisions are specified.</p>
</div>
<p>When two revision arguments are given, then changes are shown
between those revisions. If only one revision is specified then
that revision is compared to the working directory, and, when no
revisions are specified, the working directory files are compared
to its parent.</p>
<p>Alternatively you can specify -c/--change with a revision to see
the changes in that changeset relative to its first parent.</p>
<p>Without the -a/--text option, diff will avoid generating diffs of
files it detects as binary. With -a, diff will generate a diff
anyway, probably with undesirable results.</p>
<p>Use the -g/--git option to generate diffs in the git extended diff
format. For more information, read <a class="reference external" href="hg.1.html#diffs"><tt class="docutils literal">hg help diffs</tt></a>.</p>
<div class="verbose container">
<p>Examples:</p>
<ul>
<li><p class="first">compare a file in the current working directory to its parent:</p>
<pre class="literal-block">
hg diff foo.c
</pre>
</li>
<li><p class="first">compare two historical versions of a directory, with rename info:</p>
<pre class="literal-block">
hg diff --git -r 1.0:1.2 lib/
</pre>
</li>
<li><p class="first">get change stats relative to the last change on some date:</p>
<pre class="literal-block">
hg diff --stat -r "date('may 2')"
</pre>
</li>
<li><p class="first">diff all newly-added files that contain a keyword:</p>
<pre class="literal-block">
hg diff "set:added() and grep(GNU)"
</pre>
</li>
<li><p class="first">compare a revision and its parents:</p>
<pre class="literal-block">
hg diff -c 9353 # compare against first parent
hg diff -r 9353^:9353 # same using revset syntax
hg diff -r 9353^2:9353 # compare against the second parent
</pre>
</li>
</ul>
</div>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--change</span></kbd></td>
<td>change made by revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--text</span></kbd></td>
<td>treat all files as text</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--nodates</span></kbd></td>
<td>omit dates from diff headers</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-p</span>, <span class="option">--show-function</span></kbd></td>
</tr>
<tr><td> </td><td>show which function each change is in</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--reverse</span></kbd></td>
<td>produce a diff that undoes the changes</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-w</span>, <span class="option">--ignore-all-space</span></kbd></td>
</tr>
<tr><td> </td><td>ignore white space when comparing lines</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-b</span>, <span class="option">--ignore-space-change</span></kbd></td>
</tr>
<tr><td> </td><td>ignore changes in the amount of white space</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-B</span>, <span class="option">--ignore-blank-lines</span></kbd></td>
</tr>
<tr><td> </td><td>ignore changes whose lines are all blank</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-U</span>, <span class="option">--unified</span></kbd></td>
<td>number of lines of context to show</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--stat</span></kbd></td>
<td>output diffstat-style summary of changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td>
<td>recurse into subrepositories</td></tr>
</tbody>
</table>
</div>
<div class="section" id="export">
<h2>export</h2>
<pre class="literal-block">
hg export [OPTION]... [-o OUTFILESPEC] REV...
</pre>
<p>Print the changeset header and diffs for one or more revisions.</p>
<p>The information shown in the changeset header is: author, date,
branch name (if non-default), changeset hash, parent(s) and commit
comment.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">export may generate unexpected diff output for merge
changesets, as it will compare the merge changeset against its
first parent only.</p>
</div>
<p>Output may be to a file, in which case the name of the file is
given using a format string. The formatting rules are as follows:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name"><tt class="docutils literal">%%</tt>:</th><td class="field-body">literal "%" character</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%H</tt>:</th><td class="field-body">changeset hash (40 hexadecimal digits)</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%N</tt>:</th><td class="field-body">number of patches being generated</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%R</tt>:</th><td class="field-body">changeset revision number</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%b</tt>:</th><td class="field-body">basename of the exporting repository</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%h</tt>:</th><td class="field-body">short-form changeset hash (12 hexadecimal digits)</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%m</tt>:</th><td class="field-body">first line of the commit message (only alphanumeric characters)</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%n</tt>:</th><td class="field-body">zero-padded sequence number, starting at 1</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">%r</tt>:</th><td class="field-body">zero-padded changeset revision number</td>
</tr>
</tbody>
</table>
<p>Without the -a/--text option, export will avoid generating diffs
of files it detects as binary. With -a, export will generate a
diff anyway, probably with undesirable results.</p>
<p>Use the -g/--git option to generate diffs in the git extended diff
format. See <a class="reference external" href="hg.1.html#diffs"><tt class="docutils literal">hg help diffs</tt></a> for more information.</p>
<p>With the --switch-parent option, the diff will be against the
second parent. It can be useful to review a merge.</p>
<div class="verbose container">
<p>Examples:</p>
<ul>
<li><p class="first">use export and import to transplant a bugfix to the current
branch:</p>
<pre class="literal-block">
hg export -r 9353 | hg import -
</pre>
</li>
<li><p class="first">export all the changesets between two revisions to a file with
rename information:</p>
<pre class="literal-block">
hg export --git -r 123:150 > changes.txt
</pre>
</li>
<li><p class="first">split outgoing changes into a series of patches with
descriptive names:</p>
<pre class="literal-block">
hg export -r "outgoing()" -o "%n-%m.patch"
</pre>
</li>
</ul>
</div>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-o</span>, <span class="option">--output</span></kbd></td>
<td>print output to file with formatted name</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--switch-parent</span></kbd></td>
</tr>
<tr><td> </td><td>diff against the second parent</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revisions to export</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--text</span></kbd></td>
<td>treat all files as text</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--nodates</span></kbd></td>
<td>omit dates from diff headers</td></tr>
</tbody>
</table>
</div>
<div class="section" id="forget">
<h2>forget</h2>
<pre class="literal-block">
hg forget [OPTION]... FILE...
</pre>
<p>Mark the specified files so they will no longer be tracked
after the next commit.</p>
<p>This only removes files from the current branch, not from the
entire project history, and it does not delete them from the
working directory.</p>
<p>To undo a forget before the next commit, see <a class="reference external" href="hg.1.html#add"><tt class="docutils literal">hg add</tt></a>.</p>
<div class="verbose container">
<p>Examples:</p>
<ul>
<li><p class="first">forget newly-added binary files:</p>
<pre class="literal-block">
hg forget "set:added() and binary()"
</pre>
</li>
<li><p class="first">forget files that would be excluded by .hgignore:</p>
<pre class="literal-block">
hg forget "set:hgignore()"
</pre>
</li>
</ul>
</div>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="graft">
<h2>graft</h2>
<pre class="literal-block">
hg graft [OPTION]... REVISION...
</pre>
<p>This command uses Mercurial's merge logic to copy individual
changes from other branches without merging branches in the
history graph. This is sometimes known as 'backporting' or
'cherry-picking'. By default, graft will copy user, date, and
description from the source changesets.</p>
<p>Changesets that are ancestors of the current revision, that have
already been grafted, or that are merges will be skipped.</p>
<p>If a graft merge results in conflicts, the graft process is
interrupted so that the current merge can be manually resolved.
Once all conflicts are addressed, the graft process can be
continued with the -c/--continue option.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">The -c/--continue option does not reapply earlier options.</p>
</div>
<div class="verbose container">
<p>Examples:</p>
<ul>
<li><p class="first">copy a single change to the stable branch and edit its description:</p>
<pre class="literal-block">
hg update stable
hg graft --edit 9393
</pre>
</li>
<li><p class="first">graft a range of changesets with one exception, updating dates:</p>
<pre class="literal-block">
hg graft -D "2085::2093 and not 2091"
</pre>
</li>
<li><p class="first">continue a graft after resolving conflicts:</p>
<pre class="literal-block">
hg graft -c
</pre>
</li>
<li><p class="first">show the source of a grafted changeset:</p>
<pre class="literal-block">
hg log --debug -r tip
</pre>
</li>
</ul>
</div>
<p>Returns 0 on successful completion.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--continue</span></kbd></td>
<td>resume interrupted graft</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
<td>invoke editor on commit messages</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-D</span>, <span class="option">--currentdate</span></kbd></td>
</tr>
<tr><td> </td><td>record the current date as commit date</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-U</span>, <span class="option">--currentuser</span></kbd></td>
</tr>
<tr><td> </td><td>record the current user as committer</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>record the specified date as commit date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>record the specified user as committer</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--tool</span></kbd></td>
<td>specify merge tool</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td>
<td>do not perform actions, just print output</td></tr>
</tbody>
</table>
</div>
<div class="section" id="grep">
<h2>grep</h2>
<pre class="literal-block">
hg grep [OPTION]... PATTERN [FILE]...
</pre>
<p>Search revisions of files for a regular expression.</p>
<p>This command behaves differently than Unix grep. It only accepts
Python/Perl regexps. It searches repository history, not the
working directory. It always prints the revision number in which a
match appears.</p>
<p>By default, grep only prints output for the first revision of a
file in which it finds a match. To get it to print every revision
that contains a change in match status ("-" for a match that
becomes a non-match, or "+" for a non-match that becomes a match),
use the --all flag.</p>
<p>Returns 0 if a match is found, 1 otherwise.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-0</span>, <span class="option">--print0</span></kbd></td>
<td>end fields with NUL</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--all</span></kbd></td>
<td>print all revisions that match</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--text</span></kbd></td>
<td>treat all files as text</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--follow</span></kbd></td>
<td>follow changeset history, or file history across copies and renames</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-i</span>, <span class="option">--ignore-case</span></kbd></td>
</tr>
<tr><td> </td><td>ignore case when matching</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-l</span>, <span class="option">--files-with-matches</span></kbd></td>
</tr>
<tr><td> </td><td>print only filenames and revisions that match</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-n</span>, <span class="option">--line-number</span></kbd></td>
</tr>
<tr><td> </td><td>print matching line numbers</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>only search files changed within revision range</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>list the author (long with -v)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>list the date (short with -q)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="heads">
<h2>heads</h2>
<pre class="literal-block">
hg heads [-ac] [-r STARTREV] [REV]...
</pre>
<p>With no arguments, show all repository branch heads.</p>
<p>Repository "heads" are changesets with no child changesets. They are
where development generally takes place and are the usual targets
for update and merge operations. Branch heads are changesets that have
no child changeset on the same branch.</p>
<p>If one or more REVs are given, only branch heads on the branches
associated with the specified changesets are shown. This means
that you can use <a class="reference external" href="hg.1.html#heads"><tt class="docutils literal">hg heads foo</tt></a> to see the heads on a branch
named <tt class="docutils literal">foo</tt>.</p>
<p>If -c/--closed is specified, also show branch heads marked closed
(see <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit <span class="pre">--close-branch</span></tt></a>).</p>
<p>If STARTREV is specified, only those heads that are descendants of
STARTREV will be displayed.</p>
<p>If -t/--topo is specified, named branch mechanics will be ignored and only
changesets without children will be shown.</p>
<p>Returns 0 if matching heads are found, 1 if not.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>show only heads which are descendants of STARTREV</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--topo</span></kbd></td>
<td>show topological heads only</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--active</span></kbd></td>
<td>show active branchheads only (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--closed</span></kbd></td>
<td>show normal and closed branch heads</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
</tbody>
</table>
</div>
<div class="section" id="help">
<h2>help</h2>
<pre class="literal-block">
hg help [-ec] [TOPIC]
</pre>
<p>With no arguments, print a list of commands with short help messages.</p>
<p>Given a topic, extension, or command name, print help for that
topic.</p>
<p>Returns 0 if successful.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-e</span>, <span class="option">--extension</span></kbd></td>
</tr>
<tr><td> </td><td>show only help for extensions</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--command</span></kbd></td>
<td>show only help for commands</td></tr>
</tbody>
</table>
</div>
<div class="section" id="identify">
<h2>identify</h2>
<pre class="literal-block">
hg identify [-nibtB] [-r REV] [SOURCE]
</pre>
<p>Print a summary identifying the repository state at REV using one or
two parent hash identifiers, followed by a "+" if the working
directory has uncommitted changes, the branch name (if not default),
a list of tags, and a list of bookmarks.</p>
<p>When REV is not given, print a summary of the current state of the
repository.</p>
<p>Specifying a path to a repository root or Mercurial bundle will
cause lookup to operate on that repository/bundle.</p>
<div class="verbose container">
<p>Examples:</p>
<ul>
<li><p class="first">generate a build identifier for the working directory:</p>
<pre class="literal-block">
hg id --id > build-id.dat
</pre>
</li>
<li><p class="first">find the revision corresponding to a tag:</p>
<pre class="literal-block">
hg id -n -r 1.3
</pre>
</li>
<li><p class="first">check the most recent revision of a remote repository:</p>
<pre class="literal-block">
hg id -r tip http://selenic.com/hg/
</pre>
</li>
</ul>
</div>
<p>Returns 0 if successful.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>identify the specified revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--num</span></kbd></td>
<td>show local revision number</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-i</span>, <span class="option">--id</span></kbd></td>
<td>show global revision id</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>show branch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--tags</span></kbd></td>
<td>show tags</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-B</span>, <span class="option">--bookmarks</span></kbd></td>
</tr>
<tr><td> </td><td>show bookmarks</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--insecure</span></kbd></td>
<td><p class="first">do not verify server certificate (ignoring web.cacerts config)</p>
<p class="last">aliases: id</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="import">
<h2>import</h2>
<pre class="literal-block">
hg import [OPTION]... PATCH...
</pre>
<p>Import a list of patches and commit them individually (unless
--no-commit is specified).</p>
<p>If there are outstanding changes in the working directory, import
will abort unless given the -f/--force flag.</p>
<p>You can import a patch straight from a mail message. Even patches
as attachments work (to use the body part, it must have type
text/plain or text/x-patch). From and Subject headers of email
message are used as default committer and commit message. All
text/plain body parts before first diff are added to commit
message.</p>
<p>If the imported patch was generated by <a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg export</tt></a>, user and
description from patch override values from message headers and
body. Values given on command line with -m/--message and -u/--user
override these.</p>
<p>If --exact is specified, import will set the working directory to
the parent of each patch before applying it, and will abort if the
resulting changeset has a different ID than the one recorded in
the patch. This may happen due to character set problems or other
deficiencies in the text patch format.</p>
<p>Use --bypass to apply and commit patches directly to the
repository, not touching the working directory. Without --exact,
patches will be applied on top of the working directory parent
revision.</p>
<p>With -s/--similarity, hg will attempt to discover renames and
copies in the patch in the same way as <a class="reference external" href="hg.1.html#addremove"><tt class="docutils literal">hg addremove</tt></a>.</p>
<p>To read a patch from standard input, use "-" as the patch name. If
a URL is specified, the patch will be downloaded from it.
See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<div class="verbose container">
<p>Examples:</p>
<ul>
<li><p class="first">import a traditional patch from a website and detect renames:</p>
<pre class="literal-block">
hg import -s 80 http://example.com/bugfix.patch
</pre>
</li>
<li><p class="first">import a changeset from an hgweb server:</p>
<pre class="literal-block">
hg import http://www.selenic.com/hg/rev/5ca8c111e9aa
</pre>
</li>
<li><p class="first">import all the patches in an Unix-style mbox:</p>
<pre class="literal-block">
hg import incoming-patches.mbox
</pre>
</li>
<li><p class="first">attempt to exactly restore an exported changeset (not always
possible):</p>
<pre class="literal-block">
hg import --exact proposed-fix.patch
</pre>
</li>
</ul>
</div>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--strip</span></kbd></td>
<td>directory strip option for patch. This has the same meaning as the corresponding patch option (default: 1)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--base</span></kbd></td>
<td>base path (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
<td>invoke editor on commit messages</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>skip check for outstanding uncommitted changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--no-commit</span></kbd></td>
<td>don't commit, just update the working directory</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--bypass</span></kbd></td>
<td>apply patch without touching the working directory</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--exact</span></kbd></td>
<td>apply patch to the nodes from which it was generated</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--import-branch</span></kbd></td>
</tr>
<tr><td> </td><td>use any branch information in patch (implied by --exact)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>record the specified date as commit date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>record the specified user as committer</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-s</span>, <span class="option">--similarity</span></kbd></td>
</tr>
<tr><td> </td><td><p class="first">guess renamed files by similarity (0<=s<=100)</p>
<p class="last">aliases: patch</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="incoming">
<h2>incoming</h2>
<pre class="literal-block">
hg incoming [-p] [-n] [-M] [-f] [-r REV]... [--bundle FILENAME] [SOURCE]
</pre>
<p>Show new changesets found in the specified path/URL or the default
pull location. These are the changesets that would have been pulled
if a pull at the time you issued this command.</p>
<p>For remote repository, using --bundle avoids downloading the
changesets twice if the incoming is followed by a pull.</p>
<p>See pull for valid source format details.</p>
<p>Returns 0 if there are incoming changes, 1 otherwise.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>run even if remote repository is unrelated</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-n</span>, <span class="option">--newest-first</span></kbd></td>
</tr>
<tr><td> </td><td>show newest record first</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--bundle</span></kbd></td>
<td>file to store the bundles into</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>a remote changeset intended to be added</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-B</span>, <span class="option">--bookmarks</span></kbd></td>
</tr>
<tr><td> </td><td>compare bookmarks</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>a specific branch you would like to pull</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--patch</span></kbd></td>
<td>show patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--limit</span></kbd></td>
<td>limit number of changes displayed</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-M</span>, <span class="option">--no-merges</span></kbd></td>
</tr>
<tr><td> </td><td>do not show merges</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--stat</span></kbd></td>
<td>output diffstat-style summary of changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--insecure</span></kbd></td>
<td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td>
<td><p class="first">recurse into subrepositories</p>
<p class="last">aliases: in</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="init">
<h2>init</h2>
<pre class="literal-block">
hg init [-e CMD] [--remotecmd CMD] [DEST]
</pre>
<p>Initialize a new repository in the given directory. If the given
directory does not exist, it will be created.</p>
<p>If no directory is given, the current directory is used.</p>
<p>It is possible to specify an <tt class="docutils literal"><span class="pre">ssh://</span></tt> URL as the destination.
See <a class="reference external" href="hg.1.html#urls"><tt class="docutils literal">hg help urls</tt></a> for more information.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--insecure</span></kbd></td>
<td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
</tbody>
</table>
</div>
<div class="section" id="locate">
<h2>locate</h2>
<pre class="literal-block">
hg locate [OPTION]... [PATTERN]...
</pre>
<p>Print files under Mercurial control in the working directory whose
names match the given patterns.</p>
<p>By default, this command searches all directories in the working
directory. To search just the current directory and its
subdirectories, use "--include .".</p>
<p>If no patterns are given to match, this command prints the names
of all files under Mercurial control in the working directory.</p>
<p>If you want to feed the output of this command into the "xargs"
command, use the -0 option to both this command and "xargs". This
will avoid the problem of "xargs" treating single filenames that
contain whitespace as multiple filenames.</p>
<p>Returns 0 if a match is found, 1 otherwise.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>search the repository as it is in REV</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-0</span>, <span class="option">--print0</span></kbd></td>
<td>end filenames with NUL, for use with xargs</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--fullpath</span></kbd></td>
<td>print complete paths from the filesystem root</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="log">
<h2>log</h2>
<pre class="literal-block">
hg log [OPTION]... [FILE]
</pre>
<p>Print the revision history of the specified files or the entire
project.</p>
<p>If no revision range is specified, the default is <tt class="docutils literal">tip:0</tt> unless
--follow is set, in which case the working directory parent is
used as the starting revision.</p>
<p>File history is shown without following rename or copy history of
files. Use -f/--follow with a filename to follow history across
renames and copies. --follow without a filename will only show
ancestors or descendants of the starting revision.</p>
<p>By default this command prints revision number and changeset id,
tags, non-trivial parents, user, date and time, and a summary for
each commit. When the -v/--verbose switch is used, the list of
changed files and full commit message are shown.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">log -p/--patch may generate unexpected diff output for merge
changesets, as it will only compare the merge changeset against
its first parent. Also, only files different from BOTH parents
will appear in files:.</p>
</div>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">for performance reasons, log FILE may omit duplicate changes
made on branches and will not show deletions. To see all
changes including duplicates and deletions, use the --removed
switch.</p>
</div>
<div class="verbose container">
<p>Some examples:</p>
<ul>
<li><p class="first">changesets with full descriptions and file lists:</p>
<pre class="literal-block">
hg log -v
</pre>
</li>
<li><p class="first">changesets ancestral to the working directory:</p>
<pre class="literal-block">
hg log -f
</pre>
</li>
<li><p class="first">last 10 commits on the current branch:</p>
<pre class="literal-block">
hg log -l 10 -b .
</pre>
</li>
<li><p class="first">changesets showing all modifications of a file, including removals:</p>
<pre class="literal-block">
hg log --removed file.c
</pre>
</li>
<li><p class="first">all changesets that touch a directory, with diffs, excluding merges:</p>
<pre class="literal-block">
hg log -Mp lib/
</pre>
</li>
<li><p class="first">all revision numbers that match a keyword:</p>
<pre class="literal-block">
hg log -k bug --template "{rev}\n"
</pre>
</li>
<li><p class="first">check if a given changeset is included is a tagged release:</p>
<pre class="literal-block">
hg log -r "a21ccf and ancestor(1.9)"
</pre>
</li>
<li><p class="first">find all changesets by some user in a date range:</p>
<pre class="literal-block">
hg log -k alice -d "may 2008 to jul 2008"
</pre>
</li>
<li><p class="first">summary of all changesets after the last tag:</p>
<pre class="literal-block">
hg log -r "last(tagged())::" --template "{desc|firstline}\n"
</pre>
</li>
</ul>
</div>
<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>See <a class="reference external" href="hg.1.html#revisions"><tt class="docutils literal">hg help revisions</tt></a> and <a class="reference external" href="hg.1.html#revsets"><tt class="docutils literal">hg help revsets</tt></a> for more about
specifying revisions.</p>
<p>See <a class="reference external" href="hg.1.html#templates"><tt class="docutils literal">hg help templates</tt></a> for more about pre-packaged styles and
specifying custom templates.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--follow</span></kbd></td>
<td>follow changeset history, or file history across copies and renames</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--follow-first</span></kbd></td>
<td>only follow the first parent of merge changesets (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>show revisions matching date spec</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-C</span>, <span class="option">--copies</span></kbd></td>
<td>show copied files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-k</span>, <span class="option">--keyword</span></kbd></td>
<td>do case-insensitive search for a given text</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>show the specified revision or range</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--removed</span></kbd></td>
<td>include revisions where files were removed</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-m</span>, <span class="option">--only-merges</span></kbd></td>
</tr>
<tr><td> </td><td>show only merges (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>revisions committed by user</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--only-branch</span></kbd></td>
<td>show only changesets within the given named branch (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>show changesets within the given named branch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-P</span>, <span class="option">--prune</span></kbd></td>
<td>do not display revision or any of its ancestors</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--hidden</span></kbd></td>
<td>show hidden changesets (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--patch</span></kbd></td>
<td>show patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--limit</span></kbd></td>
<td>limit number of changes displayed</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-M</span>, <span class="option">--no-merges</span></kbd></td>
</tr>
<tr><td> </td><td>do not show merges</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--stat</span></kbd></td>
<td>output diffstat-style summary of changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td><p class="first">exclude names matching the given patterns</p>
<p class="last">aliases: history</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="manifest">
<h2>manifest</h2>
<pre class="literal-block">
hg manifest [-r REV]
</pre>
<p>Print a list of version controlled files for the given revision.
If no revision is given, the first parent of the working directory
is used, or the null revision if no revision is checked out.</p>
<p>With -v, print file permissions, symlink and executable bits.
With --debug, print file revision hashes.</p>
<p>If option --all is specified, the list of all files from all revisions
is printed. This includes deleted and renamed files.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revision to display</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--all</span></kbd></td>
<td>list files from all revisions</td></tr>
</tbody>
</table>
</div>
<div class="section" id="merge">
<h2>merge</h2>
<pre class="literal-block">
hg merge [-P] [-f] [[-r] REV]
</pre>
<p>The current working directory is updated with all changes made in
the requested revision since the last common predecessor revision.</p>
<p>Files that changed between either parent are marked as changed for
the next commit and a commit must be performed before any further
updates to the repository are allowed. The next commit will have
two parents.</p>
<p><tt class="docutils literal"><span class="pre">--tool</span></tt> can be used to specify the merge tool used for file
merges. It overrides the HGMERGE environment variable and your
configuration files. See <a class="reference external" href="hg.1.html#merge-tools"><tt class="docutils literal">hg help <span class="pre">merge-tools</span></tt></a> for options.</p>
<p>If no revision is specified, the working directory's parent is a
head revision, and the current branch contains exactly one other
head, the other head is merged with by default. Otherwise, an
explicit revision with which to merge with must be provided.</p>
<p><a class="reference external" href="hg.1.html#resolve"><tt class="docutils literal">hg resolve</tt></a> must be used to resolve unresolved files.</p>
<p>To undo an uncommitted merge, use <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update <span class="pre">--clean</span> .</tt></a> which
will check out a clean copy of the original merge parent, losing
all changes.</p>
<p>Returns 0 on success, 1 if there are unresolved files.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>force a merge with outstanding changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revision to merge</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-P</span>, <span class="option">--preview</span></kbd></td>
<td>review revisions to merge (no merge is performed)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--tool</span></kbd></td>
<td>specify merge tool</td></tr>
</tbody>
</table>
</div>
<div class="section" id="outgoing">
<h2>outgoing</h2>
<pre class="literal-block">
hg outgoing [-M] [-p] [-n] [-f] [-r REV]... [DEST]
</pre>
<p>Show changesets not found in the specified destination repository
or the default push location. These are the changesets that would
be pushed if a push was requested.</p>
<p>See pull for details of valid destination formats.</p>
<p>Returns 0 if there are outgoing changes, 1 otherwise.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>run even when the destination is unrelated</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>a changeset intended to be included in the destination</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-n</span>, <span class="option">--newest-first</span></kbd></td>
</tr>
<tr><td> </td><td>show newest record first</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-B</span>, <span class="option">--bookmarks</span></kbd></td>
</tr>
<tr><td> </td><td>compare bookmarks</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>a specific branch you would like to push</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--patch</span></kbd></td>
<td>show patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--limit</span></kbd></td>
<td>limit number of changes displayed</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-M</span>, <span class="option">--no-merges</span></kbd></td>
</tr>
<tr><td> </td><td>do not show merges</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--stat</span></kbd></td>
<td>output diffstat-style summary of changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--insecure</span></kbd></td>
<td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td>
<td><p class="first">recurse into subrepositories</p>
<p class="last">aliases: out</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="parents">
<h2>parents</h2>
<pre class="literal-block">
hg parents [-r REV] [FILE]
</pre>
<p>Print the working directory's parent revisions. If a revision is
given via -r/--rev, the parent of that revision will be printed.
If a file argument is given, the revision in which the file was
last changed (before the working directory revision or the
argument to --rev if given) is printed.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>show parents of the specified revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
</tbody>
</table>
</div>
<div class="section" id="paths">
<h2>paths</h2>
<pre class="literal-block">
hg paths [NAME]
</pre>
<p>Show definition of symbolic path name NAME. If no name is given,
show definition of all available names.</p>
<p>Option -q/--quiet suppresses all output when searching for NAME
and shows only the path names when listing all definitions.</p>
<p>Path names are defined in the [paths] section of your
configuration file and in <tt class="docutils literal">/etc/mercurial/hgrc</tt>. If run inside a
repository, <tt class="docutils literal">.hg/hgrc</tt> is used, too.</p>
<p>The path names <tt class="docutils literal">default</tt> and <tt class="docutils literal"><span class="pre">default-push</span></tt> have a special
meaning. When performing a push or pull operation, they are used
as fallbacks if no location is specified on the command-line.
When <tt class="docutils literal"><span class="pre">default-push</span></tt> is set, it will be used for push and
<tt class="docutils literal">default</tt> will be used for pull; otherwise <tt class="docutils literal">default</tt> is used
as the fallback for both. When cloning a repository, the clone
source is written as <tt class="docutils literal">default</tt> in <tt class="docutils literal">.hg/hgrc</tt>. Note that
<tt class="docutils literal">default</tt> and <tt class="docutils literal"><span class="pre">default-push</span></tt> apply to all inbound (e.g.
<a class="reference external" href="hg.1.html#incoming"><tt class="docutils literal">hg incoming</tt></a>) and outbound (e.g. <a class="reference external" href="hg.1.html#outgoing"><tt class="docutils literal">hg outgoing</tt></a>, <a class="reference external" href="hg.1.html#email"><tt class="docutils literal">hg email</tt></a> and
<a class="reference external" href="hg.1.html#bundle"><tt class="docutils literal">hg bundle</tt></a>) operations.</p>
<p>See <a class="reference external" href="hg.1.html#urls"><tt class="docutils literal">hg help urls</tt></a> for more information.</p>
<p>Returns 0 on success.</p>
</div>
<div class="section" id="phase">
<h2>phase</h2>
<pre class="literal-block">
hg phase [-p|-d|-s] [-f] [-r] REV...
</pre>
<p>With no argument, show the phase name of specified revisions.</p>
<p>With one of -p/--public, -d/--draft or -s/--secret, change the
phase value of the specified revisions.</p>
<p>Unless -f/--force is specified, <a class="reference external" href="hg.1.html#phase"><tt class="docutils literal">hg phase</tt></a> won't move changeset from a
lower phase to an higher phase. Phases are ordered as follows:</p>
<pre class="literal-block">
public < draft < secret
</pre>
<p>Return 0 on success, 1 if no phases were changed or some could not
be changed.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--public</span></kbd></td>
<td>set changeset phase to public</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--draft</span></kbd></td>
<td>set changeset phase to draft</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--secret</span></kbd></td>
<td>set changeset phase to secret</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>allow to move boundary backward</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>target revision</td></tr>
</tbody>
</table>
</div>
<div class="section" id="pull">
<h2>pull</h2>
<pre class="literal-block">
hg pull [-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]
</pre>
<p>Pull changes from a remote repository to a local one.</p>
<p>This finds all changes from the repository at the specified path
or URL and adds them to a local repository (the current one unless
-R is specified). By default, this does not update the copy of the
project in the working directory.</p>
<p>Use <a class="reference external" href="hg.1.html#incoming"><tt class="docutils literal">hg incoming</tt></a> if you want to see what would have been added
by a pull at the time you issued this command. If you then decide
to add those changes to the repository, you should use <a class="reference external" href="hg.1.html#pull"><tt class="docutils literal">hg pull
<span class="pre">-r</span> X</tt></a> where <tt class="docutils literal">X</tt> is the last changeset listed by <a class="reference external" href="hg.1.html#incoming"><tt class="docutils literal">hg incoming</tt></a>.</p>
<p>If SOURCE is omitted, the 'default' path will be used.
See <a class="reference external" href="hg.1.html#urls"><tt class="docutils literal">hg help urls</tt></a> for more information.</p>
<p>Returns 0 on success, 1 if an update had unresolved files.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--update</span></kbd></td>
<td>update to new branch head if changesets were pulled</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>run even when remote repository is unrelated</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>a remote changeset intended to be added</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-B</span>, <span class="option">--bookmark</span></kbd></td>
<td>bookmark to pull</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>a specific branch you would like to pull</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--insecure</span></kbd></td>
<td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
</tbody>
</table>
</div>
<div class="section" id="push">
<h2>push</h2>
<pre class="literal-block">
hg push [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]
</pre>
<p>Push changesets from the local repository to the specified
destination.</p>
<p>This operation is symmetrical to pull: it is identical to a pull
in the destination repository from the current one.</p>
<p>By default, push will not allow creation of new heads at the
destination, since multiple heads would make it unclear which head
to use. In this situation, it is recommended to pull and merge
before pushing.</p>
<p>Use --new-branch if you want to allow push to create a new named
branch that is not present at the destination. This allows you to
only create a new branch without forcing other changes.</p>
<p>Use -f/--force to override the default behavior and push all
changesets on all branches.</p>
<p>If -r/--rev is used, the specified revision and all its ancestors
will be pushed to the remote repository.</p>
<p>Please see <a class="reference external" href="hg.1.html#urls"><tt class="docutils literal">hg help urls</tt></a> for important details about <tt class="docutils literal"><span class="pre">ssh://</span></tt>
URLs. If DESTINATION is omitted, a default path will be used.</p>
<p>Returns 0 if push was successful, 1 if nothing to push.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>force push</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>a changeset intended to be included in the destination</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-B</span>, <span class="option">--bookmark</span></kbd></td>
<td>bookmark to push</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>a specific branch you would like to push</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--new-branch</span></kbd></td>
<td>allow pushing a new branch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--insecure</span></kbd></td>
<td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
</tbody>
</table>
</div>
<div class="section" id="recover">
<h2>recover</h2>
<pre class="literal-block">
hg recover
</pre>
<p>Recover from an interrupted commit or pull.</p>
<p>This command tries to fix the repository status after an
interrupted operation. It should only be necessary when Mercurial
suggests it.</p>
<p>Returns 0 if successful, 1 if nothing to recover or verify fails.</p>
</div>
<div class="section" id="remove">
<h2>remove</h2>
<pre class="literal-block">
hg remove [OPTION]... FILE...
</pre>
<p>Schedule the indicated files for removal from the current branch.</p>
<p>This command schedules the files to be removed at the next commit.
To undo a remove before that, see <a class="reference external" href="hg.1.html#revert"><tt class="docutils literal">hg revert</tt></a>. To undo added
files, see <a class="reference external" href="hg.1.html#forget"><tt class="docutils literal">hg forget</tt></a>.</p>
<div class="verbose container">
<p>-A/--after can be used to remove only files that have already
been deleted, -f/--force can be used to force deletion, and -Af
can be used to remove files from the next revision without
deleting them from the working directory.</p>
<p>The following table details the behavior of remove for different
file states (columns) and option combinations (rows). The file
states are Added [A], Clean [C], Modified [M] and Missing [!]
(as reported by <a class="reference external" href="hg.1.html#status"><tt class="docutils literal">hg status</tt></a>). The actions are Warn, Remove
(from branch) and Delete (from disk):</p>
<table border="1" class="docutils">
<colgroup>
<col width="47%" />
<col width="13%" />
<col width="13%" />
<col width="13%" />
<col width="13%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head"> </th>
<th class="head"> </th>
<th class="head"> </th>
<th class="head"> </th>
<th class="head"> </th>
</tr>
</thead>
<tbody valign="top">
<tr><td>none</td>
<td>W</td>
<td>RD</td>
<td>W</td>
<td>R</td>
</tr>
<tr><td>-f</td>
<td>R</td>
<td>RD</td>
<td>RD</td>
<td>R</td>
</tr>
<tr><td>-A</td>
<td>W</td>
<td>W</td>
<td>W</td>
<td>R</td>
</tr>
<tr><td>-Af</td>
<td>R</td>
<td>R</td>
<td>R</td>
<td>R</td>
</tr>
</tbody>
</table>
<p>Note that remove never deletes files in Added [A] state from the
working directory, not even if option --force is specified.</p>
</div>
<p>Returns 0 on success, 1 if any warnings encountered.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-A</span>, <span class="option">--after</span></kbd></td>
<td>record delete for missing files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>remove (and delete) file even if added or modified</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td><p class="first">exclude names matching the given patterns</p>
<p class="last">aliases: rm</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="rename">
<h2>rename</h2>
<pre class="literal-block">
hg rename [OPTION]... SOURCE... DEST
</pre>
<p>Mark dest as copies of sources; mark sources for deletion. If dest
is a directory, copies are put in that directory. If dest is a
file, there can only be one source.</p>
<p>By default, this command copies the contents of files as they
exist in the working directory. If invoked with -A/--after, the
operation is recorded, but no copying is performed.</p>
<p>This command takes effect at the next commit. To undo a rename
before that, see <a class="reference external" href="hg.1.html#revert"><tt class="docutils literal">hg revert</tt></a>.</p>
<p>Returns 0 on success, 1 if errors are encountered.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-A</span>, <span class="option">--after</span></kbd></td>
<td>record a rename that has already occurred</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>forcibly copy over an existing managed file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td>
<td><p class="first">do not perform actions, just print output</p>
<p class="last">aliases: move mv</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="resolve">
<h2>resolve</h2>
<pre class="literal-block">
hg resolve [OPTION]... [FILE]...
</pre>
<p>Merges with unresolved conflicts are often the result of
non-interactive merging using the <tt class="docutils literal">internal:merge</tt> configuration
setting, or a command-line merge tool like <tt class="docutils literal">diff3</tt>. The resolve
command is used to manage the files involved in a merge, after
<a class="reference external" href="hg.1.html#merge"><tt class="docutils literal">hg merge</tt></a> has been run, and before <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit</tt></a> is run (i.e. the
working directory must have two parents). See <a class="reference external" href="hg.1.html#merge-tools"><tt class="docutils literal">hg help
<span class="pre">merge-tools</span></tt></a> for information on configuring merge tools.</p>
<p>The resolve command can be used in the following ways:</p>
<ul class="simple">
<li><a class="reference external" href="hg.1.html#resolve"><tt class="docutils literal">hg resolve <span class="pre">[--tool</span> TOOL] <span class="pre">FILE...</span></tt></a>: attempt to re-merge the specified
files, discarding any previous merge attempts. Re-merging is not
performed for files already marked as resolved. Use <tt class="docutils literal"><span class="pre">--all/-a</span></tt>
to select all unresolved files. <tt class="docutils literal"><span class="pre">--tool</span></tt> can be used to specify
the merge tool used for the given files. It overrides the HGMERGE
environment variable and your configuration files. Previous file
contents are saved with a <tt class="docutils literal">.orig</tt> suffix.</li>
<li><a class="reference external" href="hg.1.html#resolve"><tt class="docutils literal">hg resolve <span class="pre">-m</span> [FILE]</tt></a>: mark a file as having been resolved
(e.g. after having manually fixed-up the files). The default is
to mark all unresolved files.</li>
<li><a class="reference external" href="hg.1.html#resolve"><tt class="docutils literal">hg resolve <span class="pre">-u</span> <span class="pre">[FILE]...</span></tt></a>: mark a file as unresolved. The
default is to mark all resolved files.</li>
<li><a class="reference external" href="hg.1.html#resolve"><tt class="docutils literal">hg resolve <span class="pre">-l</span></tt></a>: list files which had or still have conflicts.
In the printed list, <tt class="docutils literal">U</tt> = unresolved and <tt class="docutils literal">R</tt> = resolved.</li>
</ul>
<p>Note that Mercurial will not let you commit files with unresolved
merge conflicts. You must use <a class="reference external" href="hg.1.html#resolve"><tt class="docutils literal">hg resolve <span class="pre">-m</span> ...</tt></a> before you can
commit after a conflicting merge.</p>
<p>Returns 0 on success, 1 if any files fail a resolve attempt.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--all</span></kbd></td>
<td>select all unresolved files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--list</span></kbd></td>
<td>list state of files needing merge</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--mark</span></kbd></td>
<td>mark files as resolved</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--unmark</span></kbd></td>
<td>mark files as unresolved</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-n</span>, <span class="option">--no-status</span></kbd></td>
</tr>
<tr><td> </td><td>hide status prefix</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--tool</span></kbd></td>
<td>specify merge tool</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="revert">
<h2>revert</h2>
<pre class="literal-block">
hg revert [OPTION]... [-r REV] [NAME]...
</pre>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">To check out earlier revisions, you should use <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update REV</tt></a>.
To cancel a merge (and lose your changes), use <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update <span class="pre">--clean</span> .</tt></a>.</p>
</div>
<p>With no revision specified, revert the specified files or directories
to the contents they had in the parent of the working directory.
This restores the contents of files to an unmodified
state and unschedules adds, removes, copies, and renames. If the
working directory has two parents, you must explicitly specify a
revision.</p>
<p>Using the -r/--rev or -d/--date options, revert the given files or
directories to their states as of a specific revision. Because
revert does not change the working directory parents, this will
cause these files to appear modified. This can be helpful to "back
out" some or all of an earlier change. See <a class="reference external" href="hg.1.html#backout"><tt class="docutils literal">hg backout</tt></a> for a
related method.</p>
<p>Modified files are saved with a .orig suffix before reverting.
To disable these backups, use --no-backup.</p>
<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--all</span></kbd></td>
<td>revert all changes when no arguments given</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>tipmost revision matching date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revert to the specified revision</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-C</span>, <span class="option">--no-backup</span></kbd></td>
</tr>
<tr><td> </td><td>do not save backup copies of files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td>
<td>do not perform actions, just print output</td></tr>
</tbody>
</table>
</div>
<div class="section" id="rollback">
<h2>rollback</h2>
<pre class="literal-block">
hg rollback
</pre>
<p>This command should be used with care. There is only one level of
rollback, and there is no way to undo a rollback. It will also
restore the dirstate at the time of the last transaction, losing
any dirstate changes since that time. This command does not alter
the working directory.</p>
<p>Transactions are used to encapsulate the effects of all commands
that create new changesets or propagate existing changesets into a
repository. For example, the following commands are transactional,
and their effects can be rolled back:</p>
<ul class="simple">
<li>commit</li>
<li>import</li>
<li>pull</li>
<li>push (with this repository as the destination)</li>
<li>unbundle</li>
</ul>
<p>To avoid permanent data loss, rollback will refuse to rollback a
commit transaction if it isn't checked out. Use --force to
override this protection.</p>
<p>This command is not intended for use on public repositories. Once
changes are visible for pull by other users, rolling a transaction
back locally is ineffective (someone else may already have pulled
the changes). Furthermore, a race is possible with readers of the
repository; for example an in-progress pull from the repository
may fail if a rollback is performed.</p>
<p>Returns 0 on success, 1 if no rollback data is available.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td>
<td>do not perform actions, just print output</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>ignore safety measures</td></tr>
</tbody>
</table>
</div>
<div class="section" id="root">
<h2>root</h2>
<pre class="literal-block">
hg root
</pre>
<p>Print the root directory of the current repository.</p>
<p>Returns 0 on success.</p>
</div>
<div class="section" id="serve">
<h2>serve</h2>
<pre class="literal-block">
hg serve [OPTION]...
</pre>
<p>Start a local HTTP repository browser and pull server. You can use
this for ad-hoc sharing and browsing of repositories. It is
recommended to use a real web server to serve a repository for
longer periods of time.</p>
<p>Please note that the server does not implement access control.
This means that, by default, anybody can read from the server and
nobody can write to it by default. Set the <tt class="docutils literal">web.allow_push</tt>
option to <tt class="docutils literal">*</tt> to allow everybody to push to the server. You
should use a real web server if you need to authenticate users.</p>
<p>By default, the server logs accesses to stdout and errors to
stderr. Use the -A/--accesslog and -E/--errorlog options to log to
files.</p>
<p>To have the server choose a free port number to listen on, specify
a port number of 0; in this case, the server will print the port
number it uses.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-A</span>, <span class="option">--accesslog</span></kbd></td>
</tr>
<tr><td> </td><td>name of access log file to write to</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--daemon</span></kbd></td>
<td>run server in background</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--daemon-pipefds</span></kbd></td>
</tr>
<tr><td> </td><td>used internally by daemon mode</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-E</span>, <span class="option">--errorlog</span></kbd></td>
<td>name of error log file to write to</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--port</span></kbd></td>
<td>port to listen on (default: 8000)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--address</span></kbd></td>
<td>address to listen on (default: all interfaces)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--prefix</span></kbd></td>
<td>prefix path to serve from (default: server root)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--name</span></kbd></td>
<td>name to show in web pages (default: working directory)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--web-conf</span></kbd></td>
<td>name of the hgweb config file (see "hg help hgweb")</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--webdir-conf</span></kbd></td>
<td>name of the hgweb config file (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--pid-file</span></kbd></td>
<td>name of file to write process ID to</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--stdio</span></kbd></td>
<td>for remote clients</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--cmdserver</span></kbd></td>
<td>for remote clients</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-t</span>, <span class="option">--templates</span></kbd></td>
</tr>
<tr><td> </td><td>web templates to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>template style to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-6</span>, <span class="option">--ipv6</span></kbd></td>
<td>use IPv6 in addition to IPv4</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--certificate</span></kbd></td>
<td>SSL certificate file</td></tr>
</tbody>
</table>
</div>
<div class="section" id="showconfig">
<h2>showconfig</h2>
<pre class="literal-block">
hg showconfig [-u] [NAME]...
</pre>
<p>With no arguments, print names and values of all config items.</p>
<p>With one argument of the form section.name, print just the value
of that config item.</p>
<p>With multiple arguments, print names and values of all config
items with matching section names.</p>
<p>With --debug, the source (filename and line number) is printed
for each config item.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-u</span>, <span class="option">--untrusted</span></kbd></td>
</tr>
<tr><td> </td><td><p class="first">show untrusted configuration options</p>
<p class="last">aliases: debugconfig</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="status">
<h2>status</h2>
<pre class="literal-block">
hg status [OPTION]... [FILE]...
</pre>
<p>Show status of files in the repository. If names are given, only
files that match are shown. Files that are clean or ignored or
the source of a copy/move operation, are not listed unless
-c/--clean, -i/--ignored, -C/--copies or -A/--all are given.
Unless options described with "show only ..." are given, the
options -mardu are used.</p>
<p>Option -q/--quiet hides untracked (unknown and ignored) files
unless explicitly requested with -u/--unknown or -i/--ignored.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">status may appear to disagree with diff if permissions have
changed or a merge has occurred. The standard diff format does
not report permission changes and diff only reports changes
relative to one merge parent.</p>
</div>
<p>If one revision is given, it is used as the base revision.
If two revisions are given, the differences between them are
shown. The --change option can also be used as a shortcut to list
the changed files of a revision from its first parent.</p>
<p>The codes used to show the status of files are:</p>
<pre class="literal-block">
M = modified
A = added
R = removed
C = clean
! = missing (deleted by non-hg command, but still tracked)
? = not tracked
I = ignored
= origin of the previous file listed as A (added)
</pre>
<div class="verbose container">
<p>Examples:</p>
<ul>
<li><p class="first">show changes in the working directory relative to a
changeset:</p>
<pre class="literal-block">
hg status --rev 9353
</pre>
</li>
<li><p class="first">show all changes including copies in an existing changeset:</p>
<pre class="literal-block">
hg status --copies --change 9353
</pre>
</li>
<li><p class="first">get a NUL separated list of added files, suitable for xargs:</p>
<pre class="literal-block">
hg status -an0
</pre>
</li>
</ul>
</div>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-A</span>, <span class="option">--all</span></kbd></td>
<td>show status of all files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--modified</span></kbd></td>
<td>show only modified files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--added</span></kbd></td>
<td>show only added files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--removed</span></kbd></td>
<td>show only removed files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--deleted</span></kbd></td>
<td>show only deleted (but tracked) files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--clean</span></kbd></td>
<td>show only files without changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--unknown</span></kbd></td>
<td>show only unknown (not tracked) files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-i</span>, <span class="option">--ignored</span></kbd></td>
<td>show only ignored files</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-n</span>, <span class="option">--no-status</span></kbd></td>
</tr>
<tr><td> </td><td>hide status prefix</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-C</span>, <span class="option">--copies</span></kbd></td>
<td>show source of copied files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-0</span>, <span class="option">--print0</span></kbd></td>
<td>end filenames with NUL, for use with xargs</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--rev</span></kbd></td>
<td>show difference from revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--change</span></kbd></td>
<td>list the changed files of a revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td>
<td><p class="first">recurse into subrepositories</p>
<p class="last">aliases: st</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="summary">
<h2>summary</h2>
<pre class="literal-block">
hg summary [--remote]
</pre>
<p>This generates a brief summary of the working directory state,
including parents, branch, commit status, and available updates.</p>
<p>With the --remote option, this will check the default paths for
incoming and outgoing changes. This can be time-consuming.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">--remote</span></kbd></td>
<td><p class="first">check for push and pull</p>
<p class="last">aliases: sum</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="tag">
<h2>tag</h2>
<pre class="literal-block">
hg tag [-f] [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME...
</pre>
<p>Name a particular revision using <name>.</p>
<p>Tags are used to name particular revisions of the repository and are
very useful to compare different revisions, to go back to significant
earlier versions or to mark branch points as releases, etc. Changing
an existing tag is normally disallowed; use -f/--force to override.</p>
<p>If no revision is given, the parent of the working directory is
used, or tip if no revision is checked out.</p>
<p>To facilitate version control, distribution, and merging of tags,
they are stored as a file named ".hgtags" which is managed similarly
to other project files and can be hand-edited if necessary. This
also means that tagging creates a new commit. The file
".hg/localtags" is used for local tags (not shared among
repositories).</p>
<p>Tag commits are usually made at the head of a branch. If the parent
of the working directory is not a branch head, <a class="reference external" href="hg.1.html#tag"><tt class="docutils literal">hg tag</tt></a> aborts; use
-f/--force to force the tag commit to be based on a non-head
changeset.</p>
<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>Since tag names have priority over branch names during revision
lookup, using an existing branch name as a tag name is discouraged.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>force tag</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--local</span></kbd></td>
<td>make the tag local</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revision to tag</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remove</span></kbd></td>
<td>remove a tag</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
<td>edit commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use <text> as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>record the specified date as commit date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>record the specified user as committer</td></tr>
</tbody>
</table>
</div>
<div class="section" id="tags">
<h2>tags</h2>
<pre class="literal-block">
hg tags
</pre>
<p>This lists both regular and local tags. When the -v/--verbose
switch is used, a third column "local" is printed for local tags.</p>
<p>Returns 0 on success.</p>
</div>
<div class="section" id="tip">
<h2>tip</h2>
<pre class="literal-block">
hg tip [-p] [-g]
</pre>
<p>The tip revision (usually just called the tip) is the changeset
most recently added to the repository (and therefore the most
recently changed head).</p>
<p>If you have just made a commit, that commit will be the tip. If
you have just pulled changes from another repository, the tip of
that repository becomes the current tip. The "tip" tag is special
and cannot be renamed or assigned to a different changeset.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--patch</span></kbd></td>
<td>show patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
</tbody>
</table>
</div>
<div class="section" id="unbundle">
<h2>unbundle</h2>
<pre class="literal-block">
hg unbundle [-u] FILE...
</pre>
<p>Apply one or more compressed changegroup files generated by the
bundle command.</p>
<p>Returns 0 on success, 1 if an update has unresolved files.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--update</span></kbd></td>
<td>update to new branch head if changesets were unbundled</td></tr>
</tbody>
</table>
</div>
<div class="section" id="update">
<h2>update</h2>
<pre class="literal-block">
hg update [-c] [-C] [-d DATE] [[-r] REV]
</pre>
<p>Update the repository's working directory to the specified
changeset. If no changeset is specified, update to the tip of the
current named branch and move the current bookmark (see <a class="reference external" href="hg.1.html#bookmarks"><tt class="docutils literal">hg help
bookmarks</tt></a>).</p>
<p>If the changeset is not a descendant of the working directory's
parent, the update is aborted. With the -c/--check option, the
working directory is checked for uncommitted changes; if none are
found, the working directory is updated to the specified
changeset.</p>
<p>Update sets the working directory's parent revison to the specified
changeset (see <a class="reference external" href="hg.1.html#parents"><tt class="docutils literal">hg help parents</tt></a>).</p>
<p>The following rules apply when the working directory contains
uncommitted changes:</p>
<ol class="arabic simple">
<li>If neither -c/--check nor -C/--clean is specified, and if
the requested changeset is an ancestor or descendant of
the working directory's parent, the uncommitted changes
are merged into the requested changeset and the merged
result is left uncommitted. If the requested changeset is
not an ancestor or descendant (that is, it is on another
branch), the update is aborted and the uncommitted changes
are preserved.</li>
<li>With the -c/--check option, the update is aborted and the
uncommitted changes are preserved.</li>
<li>With the -C/--clean option, uncommitted changes are discarded and
the working directory is updated to the requested changeset.</li>
</ol>
<p>Use null as the changeset to remove the working directory (like
<a class="reference external" href="hg.1.html#clone"><tt class="docutils literal">hg clone <span class="pre">-U</span></tt></a>).</p>
<p>If you want to revert just one file to an older revision, use
<a class="reference external" href="hg.1.html#revert"><tt class="docutils literal">hg revert <span class="pre">[-r</span> REV] NAME</tt></a>.</p>
<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>Returns 0 on success, 1 if there are unresolved files.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-C</span>, <span class="option">--clean</span></kbd></td>
<td>discard uncommitted changes (no backup)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--check</span></kbd></td>
<td>update across branches if no uncommitted changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>tipmost revision matching date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td><p class="first">revision</p>
<p class="last">aliases: up checkout co</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="verify">
<h2>verify</h2>
<pre class="literal-block">
hg verify
</pre>
<p>Verify the integrity of the current repository.</p>
<p>This will perform an extensive check of the repository's
integrity, validating the hashes and checksums of each entry in
the changelog, manifest, and tracked files, as well as the
integrity of their crosslinks and indices.</p>
<p>Returns 0 on success, 1 if errors are encountered.</p>
</div>
<div class="section" id="version">
<h2>version</h2>
<pre class="literal-block">
hg version
</pre>
<p>output version and copyright information</p>
</div>
</div>
<div class="section" id="date-formats">
<span id="dates"></span><h1><a class="toc-backref" href="#contents">Date Formats</a></h1>
<p>Some commands allow the user to specify a date, e.g.:</p>
<ul class="simple">
<li>backout, commit, import, tag: Specify the commit date.</li>
<li>log, revert, update: Select revision(s) by date.</li>
</ul>
<p>Many date formats are valid. Here are some examples:</p>
<ul class="simple">
<li><tt class="docutils literal">Wed Dec 6 13:18:29 2006</tt> (local timezone assumed)</li>
<li><tt class="docutils literal">Dec 6 13:18 <span class="pre">-0600</span></tt> (year assumed, time offset provided)</li>
<li><tt class="docutils literal">Dec 6 13:18 UTC</tt> (UTC and GMT are aliases for +0000)</li>
<li><tt class="docutils literal">Dec 6</tt> (midnight)</li>
<li><tt class="docutils literal">13:18</tt> (today assumed)</li>
<li><tt class="docutils literal">3:39</tt> (3:39AM assumed)</li>
<li><tt class="docutils literal">3:39pm</tt> (15:39)</li>
<li><tt class="docutils literal"><span class="pre">2006-12-06</span> 13:18:29</tt> (ISO 8601 format)</li>
<li><tt class="docutils literal"><span class="pre">2006-12-6</span> 13:18</tt></li>
<li><tt class="docutils literal"><span class="pre">2006-12-6</span></tt></li>
<li><tt class="docutils literal"><span class="pre">12-6</span></tt></li>
<li><tt class="docutils literal">12/6</tt></li>
<li><tt class="docutils literal">12/6/6</tt> (Dec 6 2006)</li>
</ul>
<p>Lastly, there is Mercurial's internal format:</p>
<ul class="simple">
<li><tt class="docutils literal">1165432709 0</tt> (Wed Dec 6 13:18:29 2006 UTC)</li>
</ul>
<p>This is the internal representation format for dates. The first number
is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
second is the offset of the local timezone, in seconds west of UTC
(negative if the timezone is east of UTC).</p>
<p>The log command also accepts date ranges:</p>
<ul class="simple">
<li><tt class="docutils literal"><DATE</tt> - at or before a given date/time</li>
<li><tt class="docutils literal">>DATE</tt> - on or after a given date/time</li>
<li><tt class="docutils literal">DATE to DATE</tt> - a date range, inclusive</li>
<li><tt class="docutils literal"><span class="pre">-DAYS</span></tt> - within a given number of days of today</li>
</ul>
</div>
<div class="section" id="diff-formats">
<span id="diffs"></span><h1><a class="toc-backref" href="#contents">Diff Formats</a></h1>
<p>Mercurial's default format for showing changes between two versions of
a file is compatible with the unified format of GNU diff, which can be
used by GNU patch and many other standard tools.</p>
<p>While this standard format is often enough, it does not encode the
following information:</p>
<ul class="simple">
<li>executable status and other permission bits</li>
<li>copy or rename information</li>
<li>changes in binary files</li>
<li>creation or deletion of empty files</li>
</ul>
<p>Mercurial also supports the extended diff format from the git VCS
which addresses these limitations. The git diff format is not produced
by default because a few widespread tools still do not understand this
format.</p>
<p>This means that when generating diffs from a Mercurial repository
(e.g. with <a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg export</tt></a>), you should be careful about things like file
copies and renames or other things mentioned above, because when
applying a standard diff to a different repository, this extra
information is lost. Mercurial's internal operations (like push and
pull) are not affected by this, because they use an internal binary
format for communicating changes.</p>
<p>To make Mercurial produce the git extended diff format, use the --git
option available for many commands, or set 'git = True' in the [diff]
section of your configuration file. You do not need to set this option
when importing diffs in this format or using them in the mq extension.</p>
</div>
<div class="section" id="environment-variables">
<span id="env"></span><span id="environment"></span><h1><a class="toc-backref" href="#contents">Environment Variables</a></h1>
<dl class="docutils">
<dt>HG</dt>
<dd>Path to the 'hg' executable, automatically passed when running
hooks, extensions or external tools. If unset or empty, this is
the hg executable's name if it's frozen, or an executable named
'hg' (with %PATHEXT% [defaulting to COM/EXE/BAT/CMD] extensions on
Windows) is searched.</dd>
<dt>HGEDITOR</dt>
<dd><p class="first">This is the name of the editor to run when committing. See EDITOR.</p>
<p class="last">(deprecated, use configuration file)</p>
</dd>
<dt>HGENCODING</dt>
<dd>This overrides the default locale setting detected by Mercurial.
This setting is used to convert data including usernames,
changeset descriptions, tag names, and branches. This setting can
be overridden with the --encoding command-line option.</dd>
<dt>HGENCODINGMODE</dt>
<dd>This sets Mercurial's behavior for handling unknown characters
while transcoding user input. The default is "strict", which
causes Mercurial to abort if it can't map a character. Other
settings include "replace", which replaces unknown characters, and
"ignore", which drops them. This setting can be overridden with
the --encodingmode command-line option.</dd>
<dt>HGENCODINGAMBIGUOUS</dt>
<dd>This sets Mercurial's behavior for handling characters with
"ambiguous" widths like accented Latin characters with East Asian
fonts. By default, Mercurial assumes ambiguous characters are
narrow, set this variable to "wide" if such characters cause
formatting problems.</dd>
<dt>HGMERGE</dt>
<dd><p class="first">An executable to use for resolving merge conflicts. The program
will be executed with three arguments: local file, remote file,
ancestor file.</p>
<p class="last">(deprecated, use configuration file)</p>
</dd>
<dt>HGRCPATH</dt>
<dd><p class="first">A list of files or directories to search for configuration
files. Item separator is ":" on Unix, ";" on Windows. If HGRCPATH
is not set, platform default search path is used. If empty, only
the .hg/hgrc from the current repository is read.</p>
<p>For each element in HGRCPATH:</p>
<ul class="last simple">
<li>if it's a directory, all files ending with .rc are added</li>
<li>otherwise, the file itself will be added</li>
</ul>
</dd>
<dt>HGPLAIN</dt>
<dd><p class="first">When set, this disables any configuration settings that might
change Mercurial's default output. This includes encoding,
defaults, verbose mode, debug mode, quiet mode, tracebacks, and
localization. This can be useful when scripting against Mercurial
in the face of existing user configuration.</p>
<p class="last">Equivalent options set via command line flags or environment
variables are not overridden.</p>
</dd>
<dt>HGPLAINEXCEPT</dt>
<dd><p class="first">This is a comma-separated list of features to preserve when
HGPLAIN is enabled. Currently the only value supported is "i18n",
which preserves internationalization in plain mode.</p>
<p class="last">Setting HGPLAINEXCEPT to anything (even an empty string) will
enable plain mode.</p>
</dd>
<dt>HGUSER</dt>
<dd><p class="first">This is the string used as the author of a commit. If not set,
available values will be considered in this order:</p>
<ul class="simple">
<li>HGUSER (deprecated)</li>
<li>configuration files from the HGRCPATH</li>
<li>EMAIL</li>
<li>interactive prompt</li>
<li>LOGNAME (with <tt class="docutils literal">@hostname</tt> appended)</li>
</ul>
<p class="last">(deprecated, use configuration file)</p>
</dd>
<dt>EMAIL</dt>
<dd>May be used as the author of a commit; see HGUSER.</dd>
<dt>LOGNAME</dt>
<dd>May be used as the author of a commit; see HGUSER.</dd>
<dt>VISUAL</dt>
<dd>This is the name of the editor to use when committing. See EDITOR.</dd>
<dt>EDITOR</dt>
<dd>Sometimes Mercurial needs to open a text file in an editor for a
user to modify, for example when writing commit messages. The
editor it uses is determined by looking at the environment
variables HGEDITOR, VISUAL and EDITOR, in that order. The first
non-empty one is chosen. If all of them are empty, the editor
defaults to 'vi'.</dd>
<dt>PYTHONPATH</dt>
<dd>This is used by Python to find imported modules and may need to be
set appropriately if this Mercurial is not installed system-wide.</dd>
</dl>
</div>
<div class="section" id="using-additional-features">
<span id="extensions"></span><h1><a class="toc-backref" href="#contents">Using Additional Features</a></h1>
<p>Mercurial has the ability to add new features through the use of
extensions. Extensions may add new commands, add options to
existing commands, change the default behavior of commands, or
implement hooks.</p>
<p>Extensions are not loaded by default for a variety of reasons:
they can increase startup overhead; they may be meant for advanced
usage only; they may provide potentially dangerous abilities (such
as letting you destroy or modify history); they might not be ready
for prime time; or they may alter some usual behaviors of stock
Mercurial. It is thus up to the user to activate extensions as
needed.</p>
<p>To enable the "foo" extension, either shipped with Mercurial or in the
Python search path, create an entry for it in your configuration file,
like this:</p>
<pre class="literal-block">
[extensions]
foo =
</pre>
<p>You may also specify the full path to an extension:</p>
<pre class="literal-block">
[extensions]
myfeature = ~/.hgext/myfeature.py
</pre>
<p>To explicitly disable an extension enabled in a configuration file of
broader scope, prepend its path with !:</p>
<pre class="literal-block">
[extensions]
# disabling extension bar residing in /path/to/extension/bar.py
bar = !/path/to/extension/bar.py
# ditto, but no path was supplied for extension baz
baz = !
</pre>
<p>disabled extensions:</p>
<blockquote>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">acl:</th><td class="field-body">hooks for controlling repository access</td>
</tr>
<tr class="field"><th class="field-name">bugzilla:</th><td class="field-body">hooks for integrating with the Bugzilla bug tracker</td>
</tr>
<tr class="field"><th class="field-name">children:</th><td class="field-body">command to display child changesets</td>
</tr>
<tr class="field"><th class="field-name">churn:</th><td class="field-body">command to display statistics about repository history</td>
</tr>
<tr class="field"><th class="field-name">color:</th><td class="field-body">colorize output from some commands</td>
</tr>
<tr class="field"><th class="field-name">convert:</th><td class="field-body">import revisions from foreign VCS repositories into Mercurial</td>
</tr>
<tr class="field"><th class="field-name">eol:</th><td class="field-body">automatically manage newlines in repository files</td>
</tr>
<tr class="field"><th class="field-name">extdiff:</th><td class="field-body">command to allow external programs to compare revisions</td>
</tr>
<tr class="field"><th class="field-name">factotum:</th><td class="field-body">http authentication with factotum</td>
</tr>
<tr class="field"><th class="field-name">fetch:</th><td class="field-body">pull, update and merge in one command</td>
</tr>
<tr class="field"><th class="field-name">gpg:</th><td class="field-body">commands to sign and verify changesets</td>
</tr>
<tr class="field"><th class="field-name">graphlog:</th><td class="field-body">command to view revision graphs from a shell</td>
</tr>
<tr class="field"><th class="field-name">hgcia:</th><td class="field-body">hooks for integrating with the CIA.vc notification service</td>
</tr>
<tr class="field"><th class="field-name">hgk:</th><td class="field-body">browse the repository in a graphical way</td>
</tr>
<tr class="field"><th class="field-name">highlight:</th><td class="field-body">syntax highlighting for hgweb (requires Pygments)</td>
</tr>
<tr class="field"><th class="field-name">inotify:</th><td class="field-body">accelerate status report using Linux's inotify service</td>
</tr>
<tr class="field"><th class="field-name">interhg:</th><td class="field-body">expand expressions into changelog and summaries</td>
</tr>
<tr class="field"><th class="field-name">keyword:</th><td class="field-body">expand keywords in tracked files</td>
</tr>
<tr class="field"><th class="field-name">largefiles:</th><td class="field-body">track large binary files</td>
</tr>
<tr class="field"><th class="field-name">mq:</th><td class="field-body">manage a stack of patches</td>
</tr>
<tr class="field"><th class="field-name">notify:</th><td class="field-body">hooks for sending email push notifications</td>
</tr>
<tr class="field"><th class="field-name">pager:</th><td class="field-body">browse command output with an external pager</td>
</tr>
<tr class="field"><th class="field-name">patchbomb:</th><td class="field-body">command to send changesets as (a series of) patch emails</td>
</tr>
<tr class="field"><th class="field-name">progress:</th><td class="field-body">show progress bars for some actions</td>
</tr>
<tr class="field"><th class="field-name">purge:</th><td class="field-body">command to delete untracked files from the working directory</td>
</tr>
<tr class="field"><th class="field-name">rebase:</th><td class="field-body">command to move sets of revisions to a different ancestor</td>
</tr>
<tr class="field"><th class="field-name">record:</th><td class="field-body">commands to interactively select changes for commit/qrefresh</td>
</tr>
<tr class="field"><th class="field-name">relink:</th><td class="field-body">recreates hardlinks between repository clones</td>
</tr>
<tr class="field"><th class="field-name">schemes:</th><td class="field-body">extend schemes with shortcuts to repository swarms</td>
</tr>
<tr class="field"><th class="field-name">share:</th><td class="field-body">share a common history between several working directories</td>
</tr>
<tr class="field"><th class="field-name">transplant:</th><td class="field-body">command to transplant changesets from another branch</td>
</tr>
<tr class="field"><th class="field-name">win32mbcs:</th><td class="field-body">allow the use of MBCS paths with problematic encodings</td>
</tr>
<tr class="field"><th class="field-name">win32text:</th><td class="field-body">perform automatic newline conversion</td>
</tr>
<tr class="field"><th class="field-name">zeroconf:</th><td class="field-body">discover and advertise repositories on the local network</td>
</tr>
</tbody>
</table>
</blockquote>
</div>
<div class="section" id="specifying-file-sets">
<span id="filesets"></span><span id="fileset"></span><h1><a class="toc-backref" href="#contents">Specifying File Sets</a></h1>
<p>Mercurial supports a functional language for selecting a set of
files.</p>
<p>Like other file patterns, this pattern type is indicated by a prefix,
'set:'. The language supports a number of predicates which are joined
by infix operators. Parenthesis can be used for grouping.</p>
<p>Identifiers such as filenames or patterns must be quoted with single
or double quotes if they contain characters outside of
<tt class="docutils literal"><span class="pre">[.*{}[]?/\_a-zA-Z0-9\x80-\xff]</span></tt> or if they match one of the
predefined predicates. This generally applies to file patterns other
than globs and arguments for predicates.</p>
<p>Special characters can be used in quoted identifiers by escaping them,
e.g., <tt class="docutils literal">\n</tt> is interpreted as a newline. To prevent them from being
interpreted, strings can be prefixed with <tt class="docutils literal">r</tt>, e.g. <tt class="docutils literal"><span class="pre">r'...'</span></tt>.</p>
<p>There is a single prefix operator:</p>
<dl class="docutils">
<dt><tt class="docutils literal">not x</tt></dt>
<dd>Files not in x. Short form is <tt class="docutils literal">! x</tt>.</dd>
</dl>
<p>These are the supported infix operators:</p>
<dl class="docutils">
<dt><tt class="docutils literal">x and y</tt></dt>
<dd>The intersection of files in x and y. Short form is <tt class="docutils literal">x & y</tt>.</dd>
<dt><tt class="docutils literal">x or y</tt></dt>
<dd>The union of files in x and y. There are two alternative short
forms: <tt class="docutils literal">x | y</tt> and <tt class="docutils literal">x + y</tt>.</dd>
<dt><tt class="docutils literal">x - y</tt></dt>
<dd>Files in x but not in y.</dd>
</dl>
<p>The following predicates are supported:</p>
<dl class="docutils">
<dt><tt class="docutils literal">added()</tt></dt>
<dd>File that is added according to status.</dd>
<dt><tt class="docutils literal">binary()</tt></dt>
<dd>File that appears to be binary (contains NUL bytes).</dd>
<dt><tt class="docutils literal">clean()</tt></dt>
<dd>File that is clean according to status.</dd>
<dt><tt class="docutils literal">copied()</tt></dt>
<dd>File that is recorded as being copied.</dd>
<dt><tt class="docutils literal">deleted()</tt></dt>
<dd>File that is deleted according to status.</dd>
<dt><tt class="docutils literal">encoding(name)</tt></dt>
<dd>File can be successfully decoded with the given character
encoding. May not be useful for encodings other than ASCII and
UTF-8.</dd>
<dt><tt class="docutils literal">exec()</tt></dt>
<dd>File that is marked as executable.</dd>
<dt><tt class="docutils literal">grep(regex)</tt></dt>
<dd>File contains the given regular expression.</dd>
<dt><tt class="docutils literal">hgignore()</tt></dt>
<dd>File that matches the active .hgignore pattern.</dd>
<dt><tt class="docutils literal">ignored()</tt></dt>
<dd>File that is ignored according to status. These files will only be
considered if this predicate is used.</dd>
<dt><tt class="docutils literal">modified()</tt></dt>
<dd>File that is modified according to status.</dd>
<dt><tt class="docutils literal">removed()</tt></dt>
<dd>File that is removed according to status.</dd>
<dt><tt class="docutils literal">resolved()</tt></dt>
<dd>File that is marked resolved according to the resolve state.</dd>
<dt><tt class="docutils literal">size(expression)</tt></dt>
<dd><p class="first">File size matches the given expression. Examples:</p>
<ul class="last simple">
<li>1k (files from 1024 to 2047 bytes)</li>
<li>< 20k (files less than 20480 bytes)</li>
<li>>= .5MB (files at least 524288 bytes)</li>
<li>4k - 1MB (files from 4096 bytes to 1048576 bytes)</li>
</ul>
</dd>
<dt><tt class="docutils literal"><span class="pre">subrepo([pattern])</span></tt></dt>
<dd>Subrepositories whose paths match the given pattern.</dd>
<dt><tt class="docutils literal">symlink()</tt></dt>
<dd>File that is marked as a symlink.</dd>
<dt><tt class="docutils literal">unknown()</tt></dt>
<dd>File that is unknown according to status. These files will only be
considered if this predicate is used.</dd>
<dt><tt class="docutils literal">unresolved()</tt></dt>
<dd>File that is marked unresolved according to the resolve state.</dd>
</dl>
<p>Some sample queries:</p>
<ul>
<li><p class="first">Show status of files that appear to be binary in the working directory:</p>
<pre class="literal-block">
hg status -A "set:binary()"
</pre>
</li>
<li><p class="first">Forget files that are in .hgignore but are already tracked:</p>
<pre class="literal-block">
hg forget "set:hgignore() and not ignored()"
</pre>
</li>
<li><p class="first">Find text files that contain a string:</p>
<pre class="literal-block">
hg locate "set:grep(magic) and not binary()"
</pre>
</li>
<li><p class="first">Find C files in a non-standard encoding:</p>
<pre class="literal-block">
hg locate "set:**.c and not encoding('UTF-8')"
</pre>
</li>
<li><p class="first">Revert copies of large binary files:</p>
<pre class="literal-block">
hg revert "set:copied() and binary() and size('>1M')"
</pre>
</li>
<li><p class="first">Remove files listed in foo.lst that contain the letter a or b:</p>
<pre class="literal-block">
hg remove "set: 'listfile:foo.lst' and (**a* or **b*)"
</pre>
</li>
</ul>
<p>See also <a class="reference external" href="hg.1.html#patterns"><tt class="docutils literal">hg help patterns</tt></a>.</p>
</div>
<div class="section" id="id1">
<span id="glossary"></span><h1><a class="toc-backref" href="#contents">Glossary</a></h1>
<dl class="docutils">
<dt>Ancestor</dt>
<dd>Any changeset that can be reached by an unbroken chain of parent
changesets from a given changeset. More precisely, the ancestors
of a changeset can be defined by two properties: a parent of a
changeset is an ancestor, and a parent of an ancestor is an
ancestor. See also: 'Descendant'.</dd>
<dt>Bookmark</dt>
<dd><p class="first">Bookmarks are pointers to certain commits that move when
committing. They are similar to tags in that it is possible to use
bookmark names in all places where Mercurial expects a changeset
ID, e.g., with <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a>. Unlike tags, bookmarks move along
when you make a commit.</p>
<p class="last">Bookmarks can be renamed, copied and deleted. Bookmarks are local,
unless they are explicitly pushed or pulled between repositories.
Pushing and pulling bookmarks allow you to collaborate with others
on a branch without creating a named branch.</p>
</dd>
<dt>Branch</dt>
<dd><p class="first">(Noun) A child changeset that has been created from a parent that
is not a head. These are known as topological branches, see
'Branch, topological'. If a topological branch is named, it becomes
a named branch. If a topological branch is not named, it becomes
an anonymous branch. See 'Branch, anonymous' and 'Branch, named'.</p>
<p>Branches may be created when changes are pulled from or pushed to
a remote repository, since new heads may be created by these
operations. Note that the term branch can also be used informally
to describe a development process in which certain development is
done independently of other development. This is sometimes done
explicitly with a named branch, but it can also be done locally,
using bookmarks or clones and anonymous branches.</p>
<p>Example: "The experimental branch".</p>
<p>(Verb) The action of creating a child changeset which results in
its parent having more than one child.</p>
<p class="last">Example: "I'm going to branch at X".</p>
</dd>
<dt>Branch, anonymous</dt>
<dd>Every time a new child changeset is created from a parent that is not
a head and the name of the branch is not changed, a new anonymous
branch is created.</dd>
<dt>Branch, closed</dt>
<dd>A named branch whose branch heads have all been closed.</dd>
<dt>Branch, default</dt>
<dd>The branch assigned to a changeset when no name has previously been
assigned.</dd>
<dt>Branch head</dt>
<dd>See 'Head, branch'.</dd>
<dt>Branch, inactive</dt>
<dd><p class="first">If a named branch has no topological heads, it is considered to be
inactive. As an example, a feature branch becomes inactive when it
is merged into the default branch. The <a class="reference external" href="hg.1.html#branches"><tt class="docutils literal">hg branches</tt></a> command
shows inactive branches by default, though they can be hidden with
<a class="reference external" href="hg.1.html#branches"><tt class="docutils literal">hg branches <span class="pre">--active</span></tt></a>.</p>
<p class="last">NOTE: this concept is deprecated because it is too implicit.
Branches should now be explicitly closed using <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit
<span class="pre">--close-branch</span></tt></a> when they are no longer needed.</p>
</dd>
<dt>Branch, named</dt>
<dd><p class="first">A collection of changesets which have the same branch name. By
default, children of a changeset in a named branch belong to the
same named branch. A child can be explicitly assigned to a
different branch. See <a class="reference external" href="hg.1.html#branch"><tt class="docutils literal">hg help branch</tt></a>, <a class="reference external" href="hg.1.html#branches"><tt class="docutils literal">hg help branches</tt></a> and
<a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit <span class="pre">--close-branch</span></tt></a> for more information on managing
branches.</p>
<p class="last">Named branches can be thought of as a kind of namespace, dividing
the collection of changesets that comprise the repository into a
collection of disjoint subsets. A named branch is not necessarily
a topological branch. If a new named branch is created from the
head of another named branch, or the default branch, but no
further changesets are added to that previous branch, then that
previous branch will be a branch in name only.</p>
</dd>
<dt>Branch tip</dt>
<dd>See 'Tip, branch'.</dd>
<dt>Branch, topological</dt>
<dd>Every time a new child changeset is created from a parent that is
not a head, a new topological branch is created. If a topological
branch is named, it becomes a named branch. If a topological
branch is not named, it becomes an anonymous branch of the
current, possibly default, branch.</dd>
<dt>Changelog</dt>
<dd>A record of the changesets in the order in which they were added
to the repository. This includes details such as changeset id,
author, commit message, date, and list of changed files.</dd>
<dt>Changeset</dt>
<dd>A snapshot of the state of the repository used to record a change.</dd>
<dt>Changeset, child</dt>
<dd>The converse of parent changeset: if P is a parent of C, then C is
a child of P. There is no limit to the number of children that a
changeset may have.</dd>
<dt>Changeset id</dt>
<dd>A SHA-1 hash that uniquely identifies a changeset. It may be
represented as either a "long" 40 hexadecimal digit string, or a
"short" 12 hexadecimal digit string.</dd>
<dt>Changeset, merge</dt>
<dd>A changeset with two parents. This occurs when a merge is
committed.</dd>
<dt>Changeset, parent</dt>
<dd>A revision upon which a child changeset is based. Specifically, a
parent changeset of a changeset C is a changeset whose node
immediately precedes C in the DAG. Changesets have at most two
parents.</dd>
<dt>Checkout</dt>
<dd><p class="first">(Noun) The working directory being updated to a specific
revision. This use should probably be avoided where possible, as
changeset is much more appropriate than checkout in this context.</p>
<p>Example: "I'm using checkout X."</p>
<p>(Verb) Updating the working directory to a specific changeset. See
<a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg help update</tt></a>.</p>
<p class="last">Example: "I'm going to check out changeset X."</p>
</dd>
<dt>Child changeset</dt>
<dd>See 'Changeset, child'.</dd>
<dt>Close changeset</dt>
<dd>See 'Head, closed branch'</dd>
<dt>Closed branch</dt>
<dd>See 'Branch, closed'.</dd>
<dt>Clone</dt>
<dd><p class="first">(Noun) An entire or partial copy of a repository. The partial
clone must be in the form of a revision and its ancestors.</p>
<p>Example: "Is your clone up to date?".</p>
<p>(Verb) The process of creating a clone, using <a class="reference external" href="hg.1.html#clone"><tt class="docutils literal">hg clone</tt></a>.</p>
<p class="last">Example: "I'm going to clone the repository".</p>
</dd>
<dt>Closed branch head</dt>
<dd>See 'Head, closed branch'.</dd>
<dt>Commit</dt>
<dd><p class="first">(Noun) A synonym for changeset.</p>
<p>Example: "Is the bug fixed in your recent commit?"</p>
<p>(Verb) The act of recording changes to a repository. When files
are committed in a working directory, Mercurial finds the
differences between the committed files and their parent
changeset, creating a new changeset in the repository.</p>
<p class="last">Example: "You should commit those changes now."</p>
</dd>
<dt>Cset</dt>
<dd>A common abbreviation of the term changeset.</dd>
<dt>DAG</dt>
<dd>The repository of changesets of a distributed version control
system (DVCS) can be described as a directed acyclic graph (DAG),
consisting of nodes and edges, where nodes correspond to
changesets and edges imply a parent -> child relation. This graph
can be visualized by graphical tools such as <a class="reference external" href="hg.1.html#glog"><tt class="docutils literal">hg glog</tt></a>
(graphlog). In Mercurial, the DAG is limited by the requirement
for children to have at most two parents.</dd>
<dt>Default branch</dt>
<dd>See 'Branch, default'.</dd>
<dt>Descendant</dt>
<dd>Any changeset that can be reached by a chain of child changesets
from a given changeset. More precisely, the descendants of a
changeset can be defined by two properties: the child of a
changeset is a descendant, and the child of a descendant is a
descendant. See also: 'Ancestor'.</dd>
<dt>Diff</dt>
<dd><p class="first">(Noun) The difference between the contents and attributes of files
in two changesets or a changeset and the current working
directory. The difference is usually represented in a standard
form called a "diff" or "patch". The "git diff" format is used
when the changes include copies, renames, or changes to file
attributes, none of which can be represented/handled by classic
"diff" and "patch".</p>
<p>Example: "Did you see my correction in the diff?"</p>
<p>(Verb) Diffing two changesets is the action of creating a diff or
patch.</p>
<p class="last">Example: "If you diff with changeset X, you will see what I mean."</p>
</dd>
<dt>Directory, working</dt>
<dd>The working directory represents the state of the files tracked by
Mercurial, that will be recorded in the next commit. The working
directory initially corresponds to the snapshot at an existing
changeset, known as the parent of the working directory. See
'Parent, working directory'. The state may be modified by changes
to the files introduced manually or by a merge. The repository
metadata exists in the .hg directory inside the working directory.</dd>
<dt>Draft</dt>
<dd>Changesets in the draft phase have not been shared with publishing
repositories and may thus be safely changed by history-modifying
extensions. See <a class="reference external" href="hg.1.html#phases"><tt class="docutils literal">hg help phases</tt></a>.</dd>
<dt>Graph</dt>
<dd>See DAG and <a class="reference external" href="hg.1.html#graphlog"><tt class="docutils literal">hg help graphlog</tt></a>.</dd>
<dt>Head</dt>
<dd><p class="first">The term 'head' may be used to refer to both a branch head or a
repository head, depending on the context. See 'Head, branch' and
'Head, repository' for specific definitions.</p>
<p class="last">Heads are where development generally takes place and are the
usual targets for update and merge operations.</p>
</dd>
<dt>Head, branch</dt>
<dd>A changeset with no descendants on the same named branch.</dd>
<dt>Head, closed branch</dt>
<dd><p class="first">A changeset that marks a head as no longer interesting. The closed
head is no longer listed by <a class="reference external" href="hg.1.html#heads"><tt class="docutils literal">hg heads</tt></a>. A branch is considered
closed when all its heads are closed and consequently is not
listed by <a class="reference external" href="hg.1.html#branches"><tt class="docutils literal">hg branches</tt></a>.</p>
<p class="last">Closed heads can be re-opened by committing new changeset as the
child of the changeset that marks a head as closed.</p>
</dd>
<dt>Head, repository</dt>
<dd>A topological head which has not been closed.</dd>
<dt>Head, topological</dt>
<dd>A changeset with no children in the repository.</dd>
<dt>History, immutable</dt>
<dd>Once committed, changesets cannot be altered. Extensions which
appear to change history actually create new changesets that
replace existing ones, and then destroy the old changesets. Doing
so in public repositories can result in old changesets being
reintroduced to the repository.</dd>
<dt>History, rewriting</dt>
<dd>The changesets in a repository are immutable. However, extensions
to Mercurial can be used to alter the repository, usually in such
a way as to preserve changeset contents.</dd>
<dt>Immutable history</dt>
<dd>See 'History, immutable'.</dd>
<dt>Merge changeset</dt>
<dd>See 'Changeset, merge'.</dd>
<dt>Manifest</dt>
<dd>Each changeset has a manifest, which is the list of files that are
tracked by the changeset.</dd>
<dt>Merge</dt>
<dd>Used to bring together divergent branches of work. When you update
to a changeset and then merge another changeset, you bring the
history of the latter changeset into your working directory. Once
conflicts are resolved (and marked), this merge may be committed
as a merge changeset, bringing two branches together in the DAG.</dd>
<dt>Named branch</dt>
<dd>See 'Branch, named'.</dd>
<dt>Null changeset</dt>
<dd>The empty changeset. It is the parent state of newly-initialized
repositories and repositories with no checked out revision. It is
thus the parent of root changesets and the effective ancestor when
merging unrelated changesets. Can be specified by the alias 'null'
or by the changeset ID '000000000000'.</dd>
<dt>Parent</dt>
<dd>See 'Changeset, parent'.</dd>
<dt>Parent changeset</dt>
<dd>See 'Changeset, parent'.</dd>
<dt>Parent, working directory</dt>
<dd>The working directory parent reflects a virtual revision which is
the child of the changeset (or two changesets with an uncommitted
merge) shown by <a class="reference external" href="hg.1.html#parents"><tt class="docutils literal">hg parents</tt></a>. This is changed with
<a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a>. Other commands to see the working directory parent
are <a class="reference external" href="hg.1.html#summary"><tt class="docutils literal">hg summary</tt></a> and <a class="reference external" href="hg.1.html#id"><tt class="docutils literal">hg id</tt></a>. Can be specified by the alias ".".</dd>
<dt>Patch</dt>
<dd><p class="first">(Noun) The product of a diff operation.</p>
<p>Example: "I've sent you my patch."</p>
<p>(Verb) The process of using a patch file to transform one
changeset into another.</p>
<p class="last">Example: "You will need to patch that revision."</p>
</dd>
<dt>Phase</dt>
<dd>A per-changeset state tracking how the changeset has been or
should be shared. See <a class="reference external" href="hg.1.html#phases"><tt class="docutils literal">hg help phases</tt></a>.</dd>
<dt>Public</dt>
<dd>Changesets in the public phase have been shared with publishing
repositories and are therefore considered immutable. See <a class="reference external" href="hg.1.html#phases"><tt class="docutils literal">hg help
phases</tt></a>.</dd>
<dt>Pull</dt>
<dd>An operation in which changesets in a remote repository which are
not in the local repository are brought into the local
repository. Note that this operation without special arguments
only updates the repository, it does not update the files in the
working directory. See <a class="reference external" href="hg.1.html#pull"><tt class="docutils literal">hg help pull</tt></a>.</dd>
<dt>Push</dt>
<dd>An operation in which changesets in a local repository which are
not in a remote repository are sent to the remote repository. Note
that this operation only adds changesets which have been committed
locally to the remote repository. Uncommitted changes are not
sent. See <a class="reference external" href="hg.1.html#push"><tt class="docutils literal">hg help push</tt></a>.</dd>
<dt>Repository</dt>
<dd>The metadata describing all recorded states of a collection of
files. Each recorded state is represented by a changeset. A
repository is usually (but not always) found in the <tt class="docutils literal">.hg</tt>
subdirectory of a working directory. Any recorded state can be
recreated by "updating" a working directory to a specific
changeset.</dd>
<dt>Repository head</dt>
<dd>See 'Head, repository'.</dd>
<dt>Revision</dt>
<dd>A state of the repository at some point in time. Earlier revisions
can be updated to by using <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a>. See also 'Revision
number'; See also 'Changeset'.</dd>
<dt>Revision number</dt>
<dd>This integer uniquely identifies a changeset in a specific
repository. It represents the order in which changesets were added
to a repository, starting with revision number 0. Note that the
revision number may be different in each clone of a repository. To
identify changesets uniquely between different clones, see
'Changeset id'.</dd>
<dt>Revlog</dt>
<dd>History storage mechanism used by Mercurial. It is a form of delta
encoding, with occasional full revision of data followed by delta
of each successive revision. It includes data and an index
pointing to the data.</dd>
<dt>Rewriting history</dt>
<dd>See 'History, rewriting'.</dd>
<dt>Root</dt>
<dd>A changeset that has only the null changeset as its parent. Most
repositories have only a single root changeset.</dd>
<dt>Secret</dt>
<dd>Changesets in the secret phase may not be shared via push, pull,
or clone. See <a class="reference external" href="hg.1.html#phases"><tt class="docutils literal">hg help phases</tt></a>.</dd>
<dt>Tag</dt>
<dd>An alternative name given to a changeset. Tags can be used in all
places where Mercurial expects a changeset ID, e.g., with
<a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a>. The creation of a tag is stored in the history and
will thus automatically be shared with other using push and pull.</dd>
<dt>Tip</dt>
<dd>The changeset with the highest revision number. It is the changeset
most recently added in a repository.</dd>
<dt>Tip, branch</dt>
<dd>The head of a given branch with the highest revision number. When
a branch name is used as a revision identifier, it refers to the
branch tip. See also 'Branch, head'. Note that because revision
numbers may be different in different repository clones, the
branch tip may be different in different cloned repositories.</dd>
<dt>Update</dt>
<dd><p class="first">(Noun) Another synonym of changeset.</p>
<p>Example: "I've pushed an update".</p>
<p>(Verb) This term is usually used to describe updating the state of
the working directory to that of a specific changeset. See
<a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg help update</tt></a>.</p>
<p class="last">Example: "You should update".</p>
</dd>
<dt>Working directory</dt>
<dd>See 'Directory, working'.</dd>
<dt>Working directory parent</dt>
<dd>See 'Parent, working directory'.</dd>
</dl>
</div>
<div class="section" id="syntax-for-mercurial-ignore-files">
<span id="ignore"></span><span id="hgignore"></span><h1><a class="toc-backref" href="#contents">Syntax for Mercurial Ignore Files</a></h1>
</div>
<div class="section" id="id2">
<h1><a class="toc-backref" href="#contents">Synopsis</a></h1>
<p>The Mercurial system uses a file called <tt class="docutils literal">.hgignore</tt> in the root
directory of a repository to control its behavior when it searches
for files that it is not currently tracking.</p>
</div>
<div class="section" id="id3">
<h1><a class="toc-backref" href="#contents">Description</a></h1>
<p>The working directory of a Mercurial repository will often contain
files that should not be tracked by Mercurial. These include backup
files created by editors and build products created by compilers.
These files can be ignored by listing them in a <tt class="docutils literal">.hgignore</tt> file in
the root of the working directory. The <tt class="docutils literal">.hgignore</tt> file must be
created manually. It is typically put under version control, so that
the settings will propagate to other repositories with push and pull.</p>
<p>An untracked file is ignored if its path relative to the repository
root directory, or any prefix path of that path, is matched against
any pattern in <tt class="docutils literal">.hgignore</tt>.</p>
<p>For example, say we have an untracked file, <tt class="docutils literal">file.c</tt>, at
<tt class="docutils literal">a/b/file.c</tt> inside our repository. Mercurial will ignore <tt class="docutils literal">file.c</tt>
if any pattern in <tt class="docutils literal">.hgignore</tt> matches <tt class="docutils literal">a/b/file.c</tt>, <tt class="docutils literal">a/b</tt> or <tt class="docutils literal">a</tt>.</p>
<p>In addition, a Mercurial configuration file can reference a set of
per-user or global ignore files. See the <tt class="docutils literal">ignore</tt> configuration
key on the <tt class="docutils literal">[ui]</tt> section of <a class="reference external" href="hg.1.html#config"><tt class="docutils literal">hg help config</tt></a> for details of how to
configure these files.</p>
<p>To control Mercurial's handling of files that it manages, many
commands support the <tt class="docutils literal"><span class="pre">-I</span></tt> and <tt class="docutils literal"><span class="pre">-X</span></tt> options; see
<a class="reference external" href="hg.1.html#<command>"><tt class="docutils literal">hg help <command></tt></a> and <a class="reference external" href="hg.1.html#patterns"><tt class="docutils literal">hg help patterns</tt></a> for details.</p>
</div>
<div class="section" id="syntax">
<h1><a class="toc-backref" href="#contents">Syntax</a></h1>
<p>An ignore file is a plain text file consisting of a list of patterns,
with one pattern per line. Empty lines are skipped. The <tt class="docutils literal">#</tt>
character is treated as a comment character, and the <tt class="docutils literal">\</tt> character
is treated as an escape character.</p>
<p>Mercurial supports several pattern syntaxes. The default syntax used
is Python/Perl-style regular expressions.</p>
<p>To change the syntax used, use a line of the following form:</p>
<pre class="literal-block">
syntax: NAME
</pre>
<p>where <tt class="docutils literal">NAME</tt> is one of the following:</p>
<dl class="docutils">
<dt><tt class="docutils literal">regexp</tt></dt>
<dd>Regular expression, Python/Perl syntax.</dd>
<dt><tt class="docutils literal">glob</tt></dt>
<dd>Shell-style glob.</dd>
</dl>
<p>The chosen syntax stays in effect when parsing all patterns that
follow, until another syntax is selected.</p>
<p>Neither glob nor regexp patterns are rooted. A glob-syntax pattern of
the form <tt class="docutils literal">*.c</tt> will match a file ending in <tt class="docutils literal">.c</tt> in any directory,
and a regexp pattern of the form <tt class="docutils literal">\.c$</tt> will do the same. To root a
regexp pattern, start it with <tt class="docutils literal">^</tt>.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">Patterns specified in other than <tt class="docutils literal">.hgignore</tt> are always rooted.
Please see <a class="reference external" href="hg.1.html#patterns"><tt class="docutils literal">hg help patterns</tt></a> for details.</p>
</div>
</div>
<div class="section" id="example">
<h1><a class="toc-backref" href="#contents">Example</a></h1>
<p>Here is an example ignore file.</p>
<pre class="literal-block">
# use glob syntax.
syntax: glob
*.elc
*.pyc
*~
# switch to regexp syntax.
syntax: regexp
^\.pc/
</pre>
</div>
<div class="section" id="configuring-hgweb">
<span id="hgweb"></span><h1><a class="toc-backref" href="#contents">Configuring hgweb</a></h1>
<p>Mercurial's internal web server, hgweb, can serve either a single
repository, or a collection of them. In the latter case, a special
configuration file can be used to specify the repository paths to use
and global web configuration options.</p>
<p>This file uses the same syntax as other Mercurial configuration files,
but only the following sections are recognized:</p>
<blockquote>
<ul class="simple">
<li>web</li>
<li>paths</li>
<li>collections</li>
</ul>
</blockquote>
<p>The <tt class="docutils literal">web</tt> section can specify all the settings described in the web
section of the hgrc(5) documentation. See <a class="reference external" href="hg.1.html#config"><tt class="docutils literal">hg help config</tt></a> for
information on where to find the manual page.</p>
<p>The <tt class="docutils literal">paths</tt> section provides mappings of physical repository
paths to virtual ones. For instance:</p>
<pre class="literal-block">
[paths]
projects/a = /foo/bar
projects/b = /baz/quux
web/root = /real/root/*
/ = /real/root2/*
virtual/root2 = /real/root2/**
</pre>
<ul class="simple">
<li>The first two entries make two repositories in different directories
appear under the same directory in the web interface</li>
<li>The third entry maps every Mercurial repository found in '/real/root'
into 'web/root'. This format is preferred over the [collections] one,
since using absolute paths as configuration keys is not supported on every
platform (especially on Windows).</li>
<li>The fourth entry is a special case mapping all repositories in
'/real/root2' in the root of the virtual directory.</li>
<li>The fifth entry recursively finds all repositories under the real
root, and maps their relative paths under the virtual root.</li>
</ul>
<p>The <tt class="docutils literal">collections</tt> section provides mappings of trees of physical
repositories paths to virtual ones, though the paths syntax is generally
preferred. For instance:</p>
<pre class="literal-block">
[collections]
/foo = /foo
</pre>
<p>Here, the left side will be stripped off all repositories found in the
right side. Thus <tt class="docutils literal">/foo/bar</tt> and <tt class="docutils literal">foo/quux/baz</tt> will be listed as
<tt class="docutils literal">bar</tt> and <tt class="docutils literal">quux/baz</tt> respectively.</p>
</div>
<div class="section" id="id4">
<span id="merge-tools"></span><h1><a class="toc-backref" href="#contents">Merge Tools</a></h1>
<p>To merge files Mercurial uses merge tools.</p>
<p>A merge tool combines two different versions of a file into a merged
file. Merge tools are given the two files and the greatest common
ancestor of the two file versions, so they can determine the changes
made on both branches.</p>
<p>Merge tools are used both for <a class="reference external" href="hg.1.html#resolve"><tt class="docutils literal">hg resolve</tt></a>, <a class="reference external" href="hg.1.html#merge"><tt class="docutils literal">hg merge</tt></a>, <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a>,
<a class="reference external" href="hg.1.html#backout"><tt class="docutils literal">hg backout</tt></a> and in several extensions.</p>
<p>Usually, the merge tool tries to automatically reconcile the files by
combining all non-overlapping changes that occurred separately in
the two different evolutions of the same initial base file. Furthermore, some
interactive merge programs make it easier to manually resolve
conflicting merges, either in a graphical way, or by inserting some
conflict markers. Mercurial does not include any interactive merge
programs but relies on external tools for that.</p>
<div class="section" id="available-merge-tools">
<h2>Available merge tools</h2>
<p>External merge tools and their properties are configured in the
merge-tools configuration section - see hgrc(5) - but they can often just
be named by their executable.</p>
<p>A merge tool is generally usable if its executable can be found on the
system and if it can handle the merge. The executable is found if it
is an absolute or relative executable path or the name of an
application in the executable search path. The tool is assumed to be
able to handle the merge if it can handle symlinks if the file is a
symlink, if it can handle binary files if the file is binary, and if a
GUI is available if the tool requires a GUI.</p>
<p>There are some internal merge tools which can be used. The internal
merge tools are:</p>
<dl class="docutils">
<dt><tt class="docutils literal">internal:dump</tt></dt>
<dd>Creates three versions of the files to merge, containing the
contents of local, other and base. These files can then be used to
perform a merge manually. If the file to be merged is named
<tt class="docutils literal">a.txt</tt>, these files will accordingly be named <tt class="docutils literal">a.txt.local</tt>,
<tt class="docutils literal">a.txt.other</tt> and <tt class="docutils literal">a.txt.base</tt> and they will be placed in the
same directory as <tt class="docutils literal">a.txt</tt>.</dd>
<dt><tt class="docutils literal">internal:fail</tt></dt>
<dd>Rather than attempting to merge files that were modified on both
branches, it marks them as unresolved. The resolve command must be
used to resolve these conflicts.</dd>
<dt><tt class="docutils literal">internal:local</tt></dt>
<dd>Uses the local version of files as the merged version.</dd>
<dt><tt class="docutils literal">internal:merge</tt></dt>
<dd>Uses the internal non-interactive simple merge algorithm for merging
files. It will fail if there are any conflicts and leave markers in
the partially merged file.</dd>
<dt><tt class="docutils literal">internal:other</tt></dt>
<dd>Uses the other version of files as the merged version.</dd>
<dt><tt class="docutils literal">internal:prompt</tt></dt>
<dd>Asks the user which of the local or the other version to keep as
the merged version.</dd>
</dl>
<p>Internal tools are always available and do not require a GUI but will by default
not handle symlinks or binary files.</p>
</div>
<div class="section" id="choosing-a-merge-tool">
<h2>Choosing a merge tool</h2>
<p>Mercurial uses these rules when deciding which merge tool to use:</p>
<ol class="arabic simple">
<li>If a tool has been specified with the --tool option to merge or resolve, it
is used. If it is the name of a tool in the merge-tools configuration, its
configuration is used. Otherwise the specified tool must be executable by
the shell.</li>
<li>If the <tt class="docutils literal">HGMERGE</tt> environment variable is present, its value is used and
must be executable by the shell.</li>
<li>If the filename of the file to be merged matches any of the patterns in the
merge-patterns configuration section, the first usable merge tool
corresponding to a matching pattern is used. Here, binary capabilities of the
merge tool are not considered.</li>
<li>If ui.merge is set it will be considered next. If the value is not the name
of a configured tool, the specified value is used and must be executable by
the shell. Otherwise the named tool is used if it is usable.</li>
<li>If any usable merge tools are present in the merge-tools configuration
section, the one with the highest priority is used.</li>
<li>If a program named <tt class="docutils literal">hgmerge</tt> can be found on the system, it is used - but
it will by default not be used for symlinks and binary files.</li>
<li>If the file to be merged is not binary and is not a symlink, then
<tt class="docutils literal">internal:merge</tt> is used.</li>
<li>The merge of the file fails and must be resolved before commit.</li>
</ol>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">After selecting a merge program, Mercurial will by default attempt
to merge the files using a simple merge algorithm first. Only if it doesn't
succeed because of conflicting changes Mercurial will actually execute the
merge program. Whether to use the simple merge algorithm first can be
controlled by the premerge setting of the merge tool. Premerge is enabled by
default unless the file is binary or a symlink.</p>
</div>
<p>See the merge-tools and ui sections of hgrc(5) for details on the
configuration of merge tools.</p>
</div>
</div>
<div class="section" id="specifying-multiple-revisions">
<span id="multirevs"></span><span id="mrevs"></span><h1><a class="toc-backref" href="#contents">Specifying Multiple Revisions</a></h1>
<p>When Mercurial accepts more than one revision, they may be specified
individually, or provided as a topologically continuous range,
separated by the ":" character.</p>
<p>The syntax of range notation is [BEGIN]:[END], where BEGIN and END are
revision identifiers. Both BEGIN and END are optional. If BEGIN is not
specified, it defaults to revision number 0. If END is not specified,
it defaults to the tip. The range ":" thus means "all revisions".</p>
<p>If BEGIN is greater than END, revisions are treated in reverse order.</p>
<p>A range acts as a closed interval. This means that a range of 3:5
gives 3, 4 and 5. Similarly, a range of 9:6 gives 9, 8, 7, and 6.</p>
</div>
<div class="section" id="file-name-patterns">
<span id="patterns"></span><h1><a class="toc-backref" href="#contents">File Name Patterns</a></h1>
<p>Mercurial accepts several notations for identifying one or more files
at a time.</p>
<p>By default, Mercurial treats filenames as shell-style extended glob
patterns.</p>
<p>Alternate pattern notations must be specified explicitly.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">Patterns specified in <tt class="docutils literal">.hgignore</tt> are not rooted.
Please see <a class="reference external" href="hg.1.html#hgignore"><tt class="docutils literal">hg help hgignore</tt></a> for details.</p>
</div>
<p>To use a plain path name without any pattern matching, start it with
<tt class="docutils literal">path:</tt>. These path names must completely match starting at the
current repository root.</p>
<p>To use an extended glob, start a name with <tt class="docutils literal">glob:</tt>. Globs are rooted
at the current directory; a glob such as <tt class="docutils literal">*.c</tt> will only match files
in the current directory ending with <tt class="docutils literal">.c</tt>.</p>
<p>The supported glob syntax extensions are <tt class="docutils literal">**</tt> to match any string
across path separators and <tt class="docutils literal">{a,b}</tt> to mean "a or b".</p>
<p>To use a Perl/Python regular expression, start a name with <tt class="docutils literal">re:</tt>.
Regexp pattern matching is anchored at the root of the repository.</p>
<p>To read name patterns from a file, use <tt class="docutils literal">listfile:</tt> or <tt class="docutils literal">listfile0:</tt>.
The latter expects null delimited patterns while the former expects line
feeds. Each string read from the file is itself treated as a file
pattern.</p>
<p>Plain examples:</p>
<pre class="literal-block">
path:foo/bar a name bar in a directory named foo in the root
of the repository
path:path:name a file or directory named "path:name"
</pre>
<p>Glob examples:</p>
<pre class="literal-block">
glob:*.c any name ending in ".c" in the current directory
*.c any name ending in ".c" in the current directory
**.c any name ending in ".c" in any subdirectory of the
current directory including itself.
foo/*.c any name ending in ".c" in the directory foo
foo/**.c any name ending in ".c" in any subdirectory of foo
including itself.
</pre>
<p>Regexp examples:</p>
<pre class="literal-block">
re:.*\.c$ any name ending in ".c", anywhere in the repository
</pre>
<p>File examples:</p>
<pre class="literal-block">
listfile:list.txt read list from list.txt with one file pattern per line
listfile0:list.txt read list from list.txt with null byte delimiters
</pre>
<p>See also <a class="reference external" href="hg.1.html#filesets"><tt class="docutils literal">hg help filesets</tt></a>.</p>
</div>
<div class="section" id="working-with-phases">
<span id="phases"></span><h1><a class="toc-backref" href="#contents">Working with Phases</a></h1>
</div>
<div class="section" id="what-are-phases">
<h1><a class="toc-backref" href="#contents">What are phases?</a></h1>
<p>Phases are a system for tracking which changesets have been or should
be shared. This helps prevent common mistakes when modifying history
(for instance, with the mq or rebase extensions).</p>
<p>Each changeset in a repository is in one of the following phases:</p>
<blockquote>
<ul class="simple">
<li>public : changeset is visible on a public server</li>
<li>draft : changeset is not yet published</li>
<li>secret : changeset should not be pushed, pulled, or cloned</li>
</ul>
</blockquote>
<p>These phases are ordered (public < draft < secret) and no changeset
can be in a lower phase than its ancestors. For instance, if a
changeset is public, all its ancestors are also public. Lastly,
changeset phases should only be changed towards the public phase.</p>
</div>
<div class="section" id="how-are-phases-managed">
<h1><a class="toc-backref" href="#contents">How are phases managed?</a></h1>
<p>For the most part, phases should work transparently. By default, a
changeset is created in the draft phase and is moved into the public
phase when it is pushed to another repository.</p>
<p>Once changesets become public, extensions like mq and rebase will
refuse to operate on them to prevent creating duplicate changesets.
Phases can also be manually manipulated with the <a class="reference external" href="hg.1.html#phase"><tt class="docutils literal">hg phase</tt></a> command
if needed. See <a class="reference external" href="hg.1.html#-v"><tt class="docutils literal">hg help <span class="pre">-v</span> phase</tt></a> for examples.</p>
</div>
<div class="section" id="phases-and-servers">
<h1><a class="toc-backref" href="#contents">Phases and servers</a></h1>
<p>Normally, all servers are <tt class="docutils literal">publishing</tt> by default. This means:</p>
<pre class="literal-block">
- all draft changesets that are pulled or cloned appear in phase
public on the client
- all draft changesets that are pushed appear as public on both
client and server
- secret changesets are neither pushed, pulled, or cloned
</pre>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">Pulling a draft changeset from a publishing server does not mark it
as public on the server side due to the read-only nature of pull.</p>
</div>
<p>Sometimes it may be desirable to push and pull changesets in the draft
phase to share unfinished work. This can be done by setting a
repository to disable publishing in its configuration file:</p>
<pre class="literal-block">
[phases]
publish = False
</pre>
<p>See <a class="reference external" href="hg.1.html#config"><tt class="docutils literal">hg help config</tt></a> for more information on config files.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">Servers running older versions of Mercurial are treated as
publishing.</p>
</div>
</div>
<div class="section" id="examples">
<h1><a class="toc-backref" href="#contents">Examples</a></h1>
<blockquote>
<ul>
<li><p class="first">list changesets in draft or secret phase:</p>
<pre class="literal-block">
hg log -r "not public()"
</pre>
</li>
<li><p class="first">change all secret changesets to draft:</p>
<pre class="literal-block">
hg phase --draft "secret()"
</pre>
</li>
<li><p class="first">forcibly move the current changeset and descendants from public to draft:</p>
<pre class="literal-block">
hg phase --force --draft .
</pre>
</li>
<li><p class="first">show a list of changeset revision and phase:</p>
<pre class="literal-block">
hg log --template "{rev} {phase}\n"
</pre>
</li>
<li><p class="first">resynchronize draft changesets relative to a remote repository:</p>
<pre class="literal-block">
hg phase -fd 'outgoing(URL)'
</pre>
</li>
</ul>
</blockquote>
<p>See <a class="reference external" href="hg.1.html#phase"><tt class="docutils literal">hg help phase</tt></a> for more information on manually manipulating phases.</p>
</div>
<div class="section" id="specifying-single-revisions">
<span id="revisions"></span><span id="revs"></span><h1><a class="toc-backref" href="#contents">Specifying Single Revisions</a></h1>
<p>Mercurial supports several ways to specify individual revisions.</p>
<p>A plain integer is treated as a revision number. Negative integers are
treated as sequential offsets from the tip, with -1 denoting the tip,
-2 denoting the revision prior to the tip, and so forth.</p>
<p>A 40-digit hexadecimal string is treated as a unique revision
identifier.</p>
<p>A hexadecimal string less than 40 characters long is treated as a
unique revision identifier and is referred to as a short-form
identifier. A short-form identifier is only valid if it is the prefix
of exactly one full-length identifier.</p>
<p>Any other string is treated as a tag or branch name. A tag name is a
symbolic name associated with a revision identifier. A branch name
denotes the tipmost revision of that branch. Tag and branch names must
not contain the ":" character.</p>
<p>The reserved name "tip" is a special tag that always identifies the
most recent revision.</p>
<p>The reserved name "null" indicates the null revision. This is the
revision of an empty repository, and the parent of revision 0.</p>
<p>The reserved name "." indicates the working directory parent. If no
working directory is checked out, it is equivalent to null. If an
uncommitted merge is in progress, "." is the revision of the first
parent.</p>
</div>
<div class="section" id="specifying-revision-sets">
<span id="revsets"></span><span id="revset"></span><h1><a class="toc-backref" href="#contents">Specifying Revision Sets</a></h1>
<p>Mercurial supports a functional language for selecting a set of
revisions.</p>
<p>The language supports a number of predicates which are joined by infix
operators. Parenthesis can be used for grouping.</p>
<p>Identifiers such as branch names may need quoting with single or
double quotes if they contain characters like <tt class="docutils literal">-</tt> or if they match
one of the predefined predicates.</p>
<p>Special characters can be used in quoted identifiers by escaping them,
e.g., <tt class="docutils literal">\n</tt> is interpreted as a newline. To prevent them from being
interpreted, strings can be prefixed with <tt class="docutils literal">r</tt>, e.g. <tt class="docutils literal"><span class="pre">r'...'</span></tt>.</p>
<p>There is a single prefix operator:</p>
<dl class="docutils">
<dt><tt class="docutils literal">not x</tt></dt>
<dd>Changesets not in x. Short form is <tt class="docutils literal">! x</tt>.</dd>
</dl>
<p>These are the supported infix operators:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">x::y</span></tt></dt>
<dd><p class="first">A DAG range, meaning all changesets that are descendants of x and
ancestors of y, including x and y themselves. If the first endpoint
is left out, this is equivalent to <tt class="docutils literal">ancestors(y)</tt>, if the second
is left out it is equivalent to <tt class="docutils literal">descendants(x)</tt>.</p>
<p class="last">An alternative syntax is <tt class="docutils literal"><span class="pre">x..y</span></tt>.</p>
</dd>
<dt><tt class="docutils literal">x:y</tt></dt>
<dd>All changesets with revision numbers between x and y, both
inclusive. Either endpoint can be left out, they default to 0 and
tip.</dd>
<dt><tt class="docutils literal">x and y</tt></dt>
<dd>The intersection of changesets in x and y. Short form is <tt class="docutils literal">x & y</tt>.</dd>
<dt><tt class="docutils literal">x or y</tt></dt>
<dd>The union of changesets in x and y. There are two alternative short
forms: <tt class="docutils literal">x | y</tt> and <tt class="docutils literal">x + y</tt>.</dd>
<dt><tt class="docutils literal">x - y</tt></dt>
<dd>Changesets in x but not in y.</dd>
<dt><tt class="docutils literal">x^n</tt></dt>
<dd>The nth parent of x, n == 0, 1, or 2.
For n == 0, x; for n == 1, the first parent of each changeset in x;
for n == 2, the second parent of changeset in x.</dd>
<dt><tt class="docutils literal">x~n</tt></dt>
<dd>The nth first ancestor of x; <tt class="docutils literal">x~0</tt> is x; <tt class="docutils literal">x~3</tt> is <tt class="docutils literal"><span class="pre">x^^^</span></tt>.</dd>
</dl>
<p>There is a single postfix operator:</p>
<dl class="docutils">
<dt><tt class="docutils literal">x^</tt></dt>
<dd>Equivalent to <tt class="docutils literal">x^1</tt>, the first parent of each changeset in x.</dd>
</dl>
<p>The following predicates are supported:</p>
<dl class="docutils">
<dt><tt class="docutils literal">adds(pattern)</tt></dt>
<dd>Changesets that add a file matching pattern.</dd>
<dt><tt class="docutils literal">all()</tt></dt>
<dd>All changesets, the same as <tt class="docutils literal">0:tip</tt>.</dd>
<dt><tt class="docutils literal">ancestor(single, single)</tt></dt>
<dd>Greatest common ancestor of the two changesets.</dd>
<dt><tt class="docutils literal">ancestors(set)</tt></dt>
<dd>Changesets that are ancestors of a changeset in set.</dd>
<dt><tt class="docutils literal">author(string)</tt></dt>
<dd>Alias for <tt class="docutils literal">user(string)</tt>.</dd>
<dt><tt class="docutils literal">bisect(string)</tt></dt>
<dd><p class="first">Changesets marked in the specified bisect status:</p>
<ul class="last simple">
<li><tt class="docutils literal">good</tt>, <tt class="docutils literal">bad</tt>, <tt class="docutils literal">skip</tt>: csets explicitly marked as good/bad/skip</li>
<li><tt class="docutils literal">goods</tt>, <tt class="docutils literal">bads</tt> : csets topologicaly good/bad</li>
<li><tt class="docutils literal">range</tt> : csets taking part in the bisection</li>
<li><tt class="docutils literal">pruned</tt> : csets that are goods, bads or skipped</li>
<li><tt class="docutils literal">untested</tt> : csets whose fate is yet unknown</li>
<li><tt class="docutils literal">ignored</tt> : csets ignored due to DAG topology</li>
</ul>
</dd>
<dt><tt class="docutils literal"><span class="pre">bookmark([name])</span></tt></dt>
<dd>The named bookmark or all bookmarks.</dd>
<dt><tt class="docutils literal">branch(string or set)</tt></dt>
<dd>All changesets belonging to the given branch or the branches of the given
changesets.</dd>
<dt><tt class="docutils literal">children(set)</tt></dt>
<dd>Child changesets of changesets in set.</dd>
<dt><tt class="docutils literal">closed()</tt></dt>
<dd>Changeset is closed.</dd>
<dt><tt class="docutils literal">contains(pattern)</tt></dt>
<dd>Revision contains a file matching pattern. See <a class="reference external" href="hg.1.html#patterns"><tt class="docutils literal">hg help patterns</tt></a>
for information about file patterns.</dd>
<dt><tt class="docutils literal">date(interval)</tt></dt>
<dd>Changesets within the interval, see <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a>.</dd>
<dt><tt class="docutils literal">desc(string)</tt></dt>
<dd>Search commit message for string. The match is case-insensitive.</dd>
<dt><tt class="docutils literal">descendants(set)</tt></dt>
<dd>Changesets which are descendants of changesets in set.</dd>
<dt><tt class="docutils literal">draft()</tt></dt>
<dd>Changeset in draft phase.</dd>
<dt><tt class="docutils literal">file(pattern)</tt></dt>
<dd>Changesets affecting files matched by pattern.</dd>
<dt><tt class="docutils literal">filelog(pattern)</tt></dt>
<dd>Changesets connected to the specified filelog.</dd>
<dt><tt class="docutils literal">first(set, [n])</tt></dt>
<dd>An alias for limit().</dd>
<dt><tt class="docutils literal"><span class="pre">follow([file])</span></tt></dt>
<dd>An alias for <tt class="docutils literal">::.</tt> (ancestors of the working copy's first parent).
If a filename is specified, the history of the given file is followed,
including copies.</dd>
<dt><tt class="docutils literal">grep(regex)</tt></dt>
<dd>Like <tt class="docutils literal">keyword(string)</tt> but accepts a regex. Use <tt class="docutils literal"><span class="pre">grep(r'...')</span></tt>
to ensure special escape characters are handled correctly. Unlike
<tt class="docutils literal">keyword(string)</tt>, the match is case-sensitive.</dd>
<dt><tt class="docutils literal">head()</tt></dt>
<dd>Changeset is a named branch head.</dd>
<dt><tt class="docutils literal">heads(set)</tt></dt>
<dd>Members of set with no children in set.</dd>
<dt><tt class="docutils literal">id(string)</tt></dt>
<dd>Revision non-ambiguously specified by the given hex string prefix.</dd>
<dt><tt class="docutils literal">keyword(string)</tt></dt>
<dd>Search commit message, user name, and names of changed files for
string. The match is case-insensitive.</dd>
<dt><tt class="docutils literal">last(set, [n])</tt></dt>
<dd>Last n members of set, defaulting to 1.</dd>
<dt><tt class="docutils literal">limit(set, [n])</tt></dt>
<dd>First n members of set, defaulting to 1.</dd>
<dt><tt class="docutils literal">matching(revision [, field])</tt></dt>
<dd><p class="first">Changesets in which a given set of fields match the set of fields in the
selected revision or set.</p>
<p>To match more than one field pass the list of fields to match separated
by spaces (e.g. <tt class="docutils literal">author description</tt>).</p>
<p>Valid fields are most regular revision fields and some special fields.</p>
<p>Regular revision fields are <tt class="docutils literal">description</tt>, <tt class="docutils literal">author</tt>, <tt class="docutils literal">branch</tt>,
<tt class="docutils literal">date</tt>, <tt class="docutils literal">files</tt>, <tt class="docutils literal">phase</tt>, <tt class="docutils literal">parents</tt>, <tt class="docutils literal">substate</tt> and <tt class="docutils literal">user</tt>.
Note that <tt class="docutils literal">author</tt> and <tt class="docutils literal">user</tt> are synonyms.</p>
<p>Special fields are <tt class="docutils literal">summary</tt> and <tt class="docutils literal">metadata</tt>:
<tt class="docutils literal">summary</tt> matches the first line of the description.
<tt class="docutils literal">metadata</tt> is equivalent to matching <tt class="docutils literal">description user date</tt>
(i.e. it matches the main metadata fields).</p>
<p class="last"><tt class="docutils literal">metadata</tt> is the default field which is used when no fields are
specified. You can match more than one field at a time.</p>
</dd>
<dt><tt class="docutils literal">max(set)</tt></dt>
<dd>Changeset with highest revision number in set.</dd>
<dt><tt class="docutils literal">merge()</tt></dt>
<dd>Changeset is a merge changeset.</dd>
<dt><tt class="docutils literal">min(set)</tt></dt>
<dd>Changeset with lowest revision number in set.</dd>
<dt><tt class="docutils literal">modifies(pattern)</tt></dt>
<dd>Changesets modifying files matched by pattern.</dd>
<dt><tt class="docutils literal"><span class="pre">outgoing([path])</span></tt></dt>
<dd>Changesets not found in the specified destination repository, or the
default push location.</dd>
<dt><tt class="docutils literal"><span class="pre">p1([set])</span></tt></dt>
<dd>First parent of changesets in set, or the working directory.</dd>
<dt><tt class="docutils literal"><span class="pre">p2([set])</span></tt></dt>
<dd>Second parent of changesets in set, or the working directory.</dd>
<dt><tt class="docutils literal"><span class="pre">parents([set])</span></tt></dt>
<dd>The set of all parents for all changesets in set, or the working directory.</dd>
<dt><tt class="docutils literal">present(set)</tt></dt>
<dd><p class="first">An empty set, if any revision in set isn't found; otherwise,
all revisions in set.</p>
<p class="last">If any of specified revisions is not present in the local repository,
the query is normally aborted. But this predicate allows the query
to continue even in such cases.</p>
</dd>
<dt><tt class="docutils literal">public()</tt></dt>
<dd>Changeset in public phase.</dd>
<dt><tt class="docutils literal"><span class="pre">remote([id</span> <span class="pre">[,path]])</span></tt></dt>
<dd>Local revision that corresponds to the given identifier in a
remote repository, if present. Here, the '.' identifier is a
synonym for the current local branch.</dd>
<dt><tt class="docutils literal">removes(pattern)</tt></dt>
<dd>Changesets which remove files matching pattern.</dd>
<dt><tt class="docutils literal">rev(number)</tt></dt>
<dd>Revision with the given numeric identifier.</dd>
<dt><tt class="docutils literal">reverse(set)</tt></dt>
<dd>Reverse order of set.</dd>
<dt><tt class="docutils literal">roots(set)</tt></dt>
<dd>Changesets in set with no parent changeset in set.</dd>
<dt><tt class="docutils literal">secret()</tt></dt>
<dd>Changeset in secret phase.</dd>
<dt><tt class="docutils literal">sort(set[, <span class="pre">[-]key...])</span></tt></dt>
<dd><p class="first">Sort set by keys. The default sort order is ascending, specify a key
as <tt class="docutils literal"><span class="pre">-key</span></tt> to sort in descending order.</p>
<p>The keys can be:</p>
<ul class="last simple">
<li><tt class="docutils literal">rev</tt> for the revision number,</li>
<li><tt class="docutils literal">branch</tt> for the branch name,</li>
<li><tt class="docutils literal">desc</tt> for the commit message (description),</li>
<li><tt class="docutils literal">user</tt> for user name (<tt class="docutils literal">author</tt> can be used as an alias),</li>
<li><tt class="docutils literal">date</tt> for the commit date</li>
</ul>
</dd>
<dt><tt class="docutils literal"><span class="pre">tag([name])</span></tt></dt>
<dd>The specified tag by name, or all tagged revisions if no name is given.</dd>
<dt><tt class="docutils literal">user(string)</tt></dt>
<dd>User name contains string. The match is case-insensitive.</dd>
</dl>
<p>New predicates (known as "aliases") can be defined, using any combination of
existing predicates or other aliases. An alias definition looks like:</p>
<pre class="literal-block">
<alias> = <definition>
</pre>
<p>in the <tt class="docutils literal">revsetalias</tt> section of a Mercurial configuration file. Arguments
of the form <cite>$1</cite>, <cite>$2</cite>, etc. are substituted from the alias into the
definition.</p>
<p>For example,</p>
<pre class="literal-block">
[revsetalias]
h = heads()
d($1) = sort($1, date)
rs($1, $2) = reverse(sort($1, $2))
</pre>
<p>defines three aliases, <tt class="docutils literal">h</tt>, <tt class="docutils literal">d</tt>, and <tt class="docutils literal">rs</tt>. <tt class="docutils literal">rs(0:tip, author)</tt> is
exactly equivalent to <tt class="docutils literal">reverse(sort(0:tip, author))</tt>.</p>
<p>Command line equivalents for <a class="reference external" href="hg.1.html#log"><tt class="docutils literal">hg log</tt></a>:</p>
<pre class="literal-block">
-f -> ::.
-d x -> date(x)
-k x -> keyword(x)
-m -> merge()
-u x -> user(x)
-b x -> branch(x)
-P x -> !::x
-l x -> limit(expr, x)
</pre>
<p>Some sample queries:</p>
<ul>
<li><p class="first">Changesets on the default branch:</p>
<pre class="literal-block">
hg log -r "branch(default)"
</pre>
</li>
<li><p class="first">Changesets on the default branch since tag 1.5 (excluding merges):</p>
<pre class="literal-block">
hg log -r "branch(default) and 1.5:: and not merge()"
</pre>
</li>
<li><p class="first">Open branch heads:</p>
<pre class="literal-block">
hg log -r "head() and not closed()"
</pre>
</li>
<li><p class="first">Changesets between tags 1.3 and 1.5 mentioning "bug" that affect
<tt class="docutils literal">hgext/*</tt>:</p>
<pre class="literal-block">
hg log -r "1.3::1.5 and keyword(bug) and file('hgext/*')"
</pre>
</li>
<li><p class="first">Changesets committed in May 2008, sorted by user:</p>
<pre class="literal-block">
hg log -r "sort(date('May 2008'), user)"
</pre>
</li>
<li><p class="first">Changesets mentioning "bug" or "issue" that are not in a tagged
release:</p>
<pre class="literal-block">
hg log -r "(keyword(bug) or keyword(issue)) and not ancestors(tagged())"
</pre>
</li>
</ul>
</div>
<div class="section" id="subrepositories">
<span id="subrepos"></span><span id="subrepo"></span><h1><a class="toc-backref" href="#contents">Subrepositories</a></h1>
<p>Subrepositories let you nest external repositories or projects into a
parent Mercurial repository, and make commands operate on them as a
group.</p>
<p>Mercurial currently supports Mercurial, Git, and Subversion
subrepositories.</p>
<p>Subrepositories are made of three components:</p>
<ol class="arabic">
<li><p class="first">Nested repository checkouts. They can appear anywhere in the
parent working directory.</p>
</li>
<li><p class="first">Nested repository references. They are defined in <tt class="docutils literal">.hgsub</tt>, which
should be placed in the root of working directory, and
tell where the subrepository checkouts come from. Mercurial
subrepositories are referenced like:</p>
<blockquote>
<p>path/to/nested = <a class="reference external" href="https://example.com/nested/repo/path">https://example.com/nested/repo/path</a></p>
</blockquote>
<p>Git and Subversion subrepos are also supported:</p>
<blockquote>
<p>path/to/nested = [git]git://example.com/nested/repo/path
path/to/nested = [svn]https://example.com/nested/trunk/path</p>
</blockquote>
<p>where <tt class="docutils literal">path/to/nested</tt> is the checkout location relatively to the
parent Mercurial root, and <tt class="docutils literal"><span class="pre">https://example.com/nested/repo/path</span></tt>
is the source repository path. The source can also reference a
filesystem path.</p>
<p>Note that <tt class="docutils literal">.hgsub</tt> does not exist by default in Mercurial
repositories, you have to create and add it to the parent
repository before using subrepositories.</p>
</li>
<li><p class="first">Nested repository states. They are defined in <tt class="docutils literal">.hgsubstate</tt>, which
is placed in the root of working directory, and
capture whatever information is required to restore the
subrepositories to the state they were committed in a parent
repository changeset. Mercurial automatically record the nested
repositories states when committing in the parent repository.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">The <tt class="docutils literal">.hgsubstate</tt> file should not be edited manually.</p>
</div>
</li>
</ol>
</div>
<div class="section" id="adding-a-subrepository">
<h1><a class="toc-backref" href="#contents">Adding a Subrepository</a></h1>
<p>If <tt class="docutils literal">.hgsub</tt> does not exist, create it and add it to the parent
repository. Clone or checkout the external projects where you want it
to live in the parent repository. Edit <tt class="docutils literal">.hgsub</tt> and add the
subrepository entry as described above. At this point, the
subrepository is tracked and the next commit will record its state in
<tt class="docutils literal">.hgsubstate</tt> and bind it to the committed changeset.</p>
</div>
<div class="section" id="synchronizing-a-subrepository">
<h1><a class="toc-backref" href="#contents">Synchronizing a Subrepository</a></h1>
<p>Subrepos do not automatically track the latest changeset of their
sources. Instead, they are updated to the changeset that corresponds
with the changeset checked out in the top-level changeset. This is so
developers always get a consistent set of compatible code and
libraries when they update.</p>
<p>Thus, updating subrepos is a manual process. Simply check out target
subrepo at the desired revision, test in the top-level repo, then
commit in the parent repository to record the new combination.</p>
</div>
<div class="section" id="deleting-a-subrepository">
<h1><a class="toc-backref" href="#contents">Deleting a Subrepository</a></h1>
<p>To remove a subrepository from the parent repository, delete its
reference from <tt class="docutils literal">.hgsub</tt>, then remove its files.</p>
</div>
<div class="section" id="interaction-with-mercurial-commands">
<h1><a class="toc-backref" href="#contents">Interaction with Mercurial Commands</a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">add:</th><td class="field-body">add does not recurse in subrepos unless -S/--subrepos is
specified. However, if you specify the full path of a file in a
subrepo, it will be added even without -S/--subrepos specified.
Git and Subversion subrepositories are currently silently
ignored.</td>
</tr>
<tr class="field"><th class="field-name">archive:</th><td class="field-body">archive does not recurse in subrepositories unless
-S/--subrepos is specified.</td>
</tr>
<tr class="field"><th class="field-name">commit:</th><td class="field-body">commit creates a consistent snapshot of the state of the
entire project and its subrepositories. If any subrepositories
have been modified, Mercurial will abort. Mercurial can be made
to instead commit all modified subrepositories by specifying
-S/--subrepos, or setting "ui.commitsubrepos=True" in a
configuration file (see <a class="reference external" href="hg.1.html#config"><tt class="docutils literal">hg help config</tt></a>). After there are no
longer any modified subrepositories, it records their state and
finally commits it in the parent repository.</td>
</tr>
<tr class="field"><th class="field-name">diff:</th><td class="field-body">diff does not recurse in subrepos unless -S/--subrepos is
specified. Changes are displayed as usual, on the subrepositories
elements. Git and Subversion subrepositories are currently
silently ignored.</td>
</tr>
<tr class="field"><th class="field-name">forget:</th><td class="field-body">forget currently only handles exact file matches in subrepos.
Git and Subversion subrepositories are currently silently ignored.</td>
</tr>
<tr class="field"><th class="field-name">incoming:</th><td class="field-body">incoming does not recurse in subrepos unless -S/--subrepos
is specified. Git and Subversion subrepositories are currently
silently ignored.</td>
</tr>
<tr class="field"><th class="field-name">outgoing:</th><td class="field-body">outgoing does not recurse in subrepos unless -S/--subrepos
is specified. Git and Subversion subrepositories are currently
silently ignored.</td>
</tr>
<tr class="field"><th class="field-name">pull:</th><td class="field-body">pull is not recursive since it is not clear what to pull prior
to running <a class="reference external" href="hg.1.html#update"><tt class="docutils literal">hg update</tt></a>. Listing and retrieving all
subrepositories changes referenced by the parent repository pulled
changesets is expensive at best, impossible in the Subversion
case.</td>
</tr>
<tr class="field"><th class="field-name">push:</th><td class="field-body">Mercurial will automatically push all subrepositories first
when the parent repository is being pushed. This ensures new
subrepository changes are available when referenced by top-level
repositories. Push is a no-op for Subversion subrepositories.</td>
</tr>
<tr class="field"><th class="field-name">status:</th><td class="field-body">status does not recurse into subrepositories unless
-S/--subrepos is specified. Subrepository changes are displayed as
regular Mercurial changes on the subrepository
elements. Subversion subrepositories are currently silently
ignored.</td>
</tr>
<tr class="field"><th class="field-name">update:</th><td class="field-body">update restores the subrepos in the state they were
originally committed in target changeset. If the recorded
changeset is not available in the current subrepository, Mercurial
will pull it in first before updating. This means that updating
can require network access when using subrepositories.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="remapping-subrepositories-sources">
<h1><a class="toc-backref" href="#contents">Remapping Subrepositories Sources</a></h1>
<p>A subrepository source location may change during a project life,
invalidating references stored in the parent repository history. To
fix this, rewriting rules can be defined in parent repository <tt class="docutils literal">hgrc</tt>
file or in Mercurial configuration. See the <tt class="docutils literal">[subpaths]</tt> section in
hgrc(5) for more details.</p>
</div>
<div class="section" id="template-usage">
<span id="style"></span><span id="template"></span><span id="templates"></span><span id="templating"></span><h1><a class="toc-backref" href="#contents">Template Usage</a></h1>
<p>Mercurial allows you to customize output of commands through
templates. You can either pass in a template from the command
line, via the --template option, or select an existing
template-style (--style).</p>
<p>You can customize output for any "log-like" command: log,
outgoing, incoming, tip, parents, heads and glog.</p>
<p>Four styles are packaged with Mercurial: default (the style used
when no explicit preference is passed), compact, changelog,
and xml.
Usage:</p>
<pre class="literal-block">
$ hg log -r1 --style changelog
</pre>
<p>A template is a piece of text, with markup to invoke variable
expansion:</p>
<pre class="literal-block">
$ hg log -r1 --template "{node}\n"
b56ce7b07c52de7d5fd79fb89701ea538af65746
</pre>
<p>Strings in curly braces are called keywords. The availability of
keywords depends on the exact context of the templater. These
keywords are usually available for templating a log-like command:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">author:</th><td class="field-body">String. The unmodified author of the changeset.</td>
</tr>
<tr class="field"><th class="field-name">bisect:</th><td class="field-body">String. The changeset bisection status.</td>
</tr>
<tr class="field"><th class="field-name">bookmarks:</th><td class="field-body">List of strings. Any bookmarks associated with the
changeset.</td>
</tr>
<tr class="field"><th class="field-name">branch:</th><td class="field-body">String. The name of the branch on which the changeset was
committed.</td>
</tr>
<tr class="field"><th class="field-name">branches:</th><td class="field-body">List of strings. The name of the branch on which the
changeset was committed. Will be empty if the branch name was
default.</td>
</tr>
<tr class="field"><th class="field-name">children:</th><td class="field-body">List of strings. The children of the changeset.</td>
</tr>
<tr class="field"><th class="field-name">date:</th><td class="field-body">Date information. The date when the changeset was committed.</td>
</tr>
<tr class="field"><th class="field-name">desc:</th><td class="field-body">String. The text of the changeset description.</td>
</tr>
<tr class="field"><th class="field-name">diffstat:</th><td class="field-body">String. Statistics of changes with the following format:
"modified files: +added/-removed lines"</td>
</tr>
<tr class="field"><th class="field-name">file_adds:</th><td class="field-body">List of strings. Files added by this changeset.</td>
</tr>
<tr class="field"><th class="field-name">file_copies:</th><td class="field-body">List of strings. Files copied in this changeset with
their sources.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">file_copies_switch:</th></tr>
<tr class="field"><td> </td><td class="field-body">List of strings. Like "file_copies" but displayed
only if the --copied switch is set.</td>
</tr>
<tr class="field"><th class="field-name">file_dels:</th><td class="field-body">List of strings. Files removed by this changeset.</td>
</tr>
<tr class="field"><th class="field-name">file_mods:</th><td class="field-body">List of strings. Files modified by this changeset.</td>
</tr>
<tr class="field"><th class="field-name">files:</th><td class="field-body">List of strings. All files modified, added, or removed by this
changeset.</td>
</tr>
<tr class="field"><th class="field-name">latesttag:</th><td class="field-body">String. Most recent global tag in the ancestors of this
changeset.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">latesttagdistance:</th></tr>
<tr class="field"><td> </td><td class="field-body">Integer. Longest path to the latest tag.</td>
</tr>
<tr class="field"><th class="field-name">node:</th><td class="field-body">String. The changeset identification hash, as a 40 hexadecimal
digit string.</td>
</tr>
<tr class="field"><th class="field-name">phase:</th><td class="field-body">String. The changeset phase name.</td>
</tr>
<tr class="field"><th class="field-name">phaseidx:</th><td class="field-body">Integer. The changeset phase index.</td>
</tr>
<tr class="field"><th class="field-name">rev:</th><td class="field-body">Integer. The repository-local changeset revision number.</td>
</tr>
<tr class="field"><th class="field-name">tags:</th><td class="field-body">List of strings. Any tags associated with the changeset.</td>
</tr>
</tbody>
</table>
<p>The "date" keyword does not produce human-readable output. If you
want to use a date in your output, you can use a filter to process
it. Filters are functions which return a string based on the input
variable. Be sure to use the stringify filter first when you're
applying a string-input filter to a list-like input variable.
You can also use a chain of filters to get the desired output:</p>
<pre class="literal-block">
$ hg tip --template "{date|isodate}\n"
2008-08-21 18:22 +0000
</pre>
<p>List of filters:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">addbreaks:</th><td class="field-body">Any text. Add an XHTML "<br />" tag before the end of
every line except the last.</td>
</tr>
<tr class="field"><th class="field-name">age:</th><td class="field-body">Date. Returns a human-readable date/time difference between the
given date/time and the current date/time.</td>
</tr>
<tr class="field"><th class="field-name">basename:</th><td class="field-body">Any text. Treats the text as a path, and returns the last
component of the path after splitting by the path separator
(ignoring trailing separators). For example, "foo/bar/baz" becomes
"baz" and "foo/bar//" becomes "bar".</td>
</tr>
<tr class="field"><th class="field-name">date:</th><td class="field-body">Date. Returns a date in a Unix date format, including the
timezone: "Mon Sep 04 15:13:13 2006 0700".</td>
</tr>
<tr class="field"><th class="field-name">domain:</th><td class="field-body">Any text. Finds the first string that looks like an email
address, and extracts just the domain component. Example: <tt class="docutils literal">User
<user@example.com></tt> becomes <tt class="docutils literal">example.com</tt>.</td>
</tr>
<tr class="field"><th class="field-name">email:</th><td class="field-body">Any text. Extracts the first string that looks like an email
address. Example: <tt class="docutils literal">User <user@example.com></tt> becomes
<tt class="docutils literal">user@example.com</tt>.</td>
</tr>
<tr class="field"><th class="field-name">emailuser:</th><td class="field-body">Any text. Returns the user portion of an email address.</td>
</tr>
<tr class="field"><th class="field-name">escape:</th><td class="field-body">Any text. Replaces the special XML/XHTML characters "&", "<"
and ">" with XML entities.</td>
</tr>
<tr class="field"><th class="field-name">fill68:</th><td class="field-body">Any text. Wraps the text to fit in 68 columns.</td>
</tr>
<tr class="field"><th class="field-name">fill76:</th><td class="field-body">Any text. Wraps the text to fit in 76 columns.</td>
</tr>
<tr class="field"><th class="field-name">firstline:</th><td class="field-body">Any text. Returns the first line of text.</td>
</tr>
<tr class="field"><th class="field-name">hex:</th><td class="field-body">Any text. Convert a binary Mercurial node identifier into
its long hexadecimal representation.</td>
</tr>
<tr class="field"><th class="field-name">hgdate:</th><td class="field-body">Date. Returns the date as a pair of numbers: "1157407993
25200" (Unix timestamp, timezone offset).</td>
</tr>
<tr class="field"><th class="field-name">isodate:</th><td class="field-body">Date. Returns the date in ISO 8601 format: "2009-08-18 13:00
+0200".</td>
</tr>
<tr class="field"><th class="field-name">isodatesec:</th><td class="field-body">Date. Returns the date in ISO 8601 format, including
seconds: "2009-08-18 13:00:13 +0200". See also the rfc3339date
filter.</td>
</tr>
<tr class="field"><th class="field-name">localdate:</th><td class="field-body">Date. Converts a date to local date.</td>
</tr>
<tr class="field"><th class="field-name">nonempty:</th><td class="field-body">Any text. Returns '(none)' if the string is empty.</td>
</tr>
<tr class="field"><th class="field-name">obfuscate:</th><td class="field-body">Any text. Returns the input text rendered as a sequence of
XML entities.</td>
</tr>
<tr class="field"><th class="field-name">person:</th><td class="field-body">Any text. Returns the name before an email address,
interpreting it as per RFC 5322.</td>
</tr>
<tr class="field"><th class="field-name">rfc3339date:</th><td class="field-body">Date. Returns a date using the Internet date format
specified in RFC 3339: "2009-08-18T13:00:13+02:00".</td>
</tr>
<tr class="field"><th class="field-name">rfc822date:</th><td class="field-body">Date. Returns a date using the same format used in email
headers: "Tue, 18 Aug 2009 13:00:13 +0200".</td>
</tr>
<tr class="field"><th class="field-name">short:</th><td class="field-body">Changeset hash. Returns the short form of a changeset hash,
i.e. a 12 hexadecimal digit string.</td>
</tr>
<tr class="field"><th class="field-name">shortbisect:</th><td class="field-body">Any text. Treats <cite>text</cite> as a bisection status, and
returns a single-character representing the status (G: good, B: bad,
S: skipped, U: untested, I: ignored). Returns single space if <cite>text</cite>
is not a valid bisection status.</td>
</tr>
<tr class="field"><th class="field-name">shortdate:</th><td class="field-body">Date. Returns a date like "2006-09-18".</td>
</tr>
<tr class="field"><th class="field-name">stringify:</th><td class="field-body">Any type. Turns the value into text by converting values into
text and concatenating them.</td>
</tr>
<tr class="field"><th class="field-name">strip:</th><td class="field-body">Any text. Strips all leading and trailing whitespace.</td>
</tr>
<tr class="field"><th class="field-name">stripdir:</th><td class="field-body">Treat the text as path and strip a directory level, if
possible. For example, "foo" and "foo/bar" becomes "foo".</td>
</tr>
<tr class="field"><th class="field-name">tabindent:</th><td class="field-body">Any text. Returns the text, with every line except the
first starting with a tab character.</td>
</tr>
<tr class="field"><th class="field-name">urlescape:</th><td class="field-body">Any text. Escapes all "special" characters. For example,
"foo bar" becomes "foo%20bar".</td>
</tr>
<tr class="field"><th class="field-name">user:</th><td class="field-body">Any text. Returns a short representation of a user name or email
address.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="url-paths">
<span id="urls"></span><h1><a class="toc-backref" href="#contents">URL Paths</a></h1>
<p>Valid URLs are of the form:</p>
<pre class="literal-block">
local/filesystem/path[#revision]
file://local/filesystem/path[#revision]
http://[user[:pass]@]host[:port]/[path][#revision]
https://[user[:pass]@]host[:port]/[path][#revision]
ssh://[user@]host[:port]/[path][#revision]
</pre>
<p>Paths in the local filesystem can either point to Mercurial
repositories or to bundle files (as created by <a class="reference external" href="hg.1.html#bundle"><tt class="docutils literal">hg bundle</tt></a> or :hg:`
incoming --bundle`). See also <a class="reference external" href="hg.1.html#paths"><tt class="docutils literal">hg help paths</tt></a>.</p>
<p>An optional identifier after # indicates a particular branch, tag, or
changeset to use from the remote repository. See also <a class="reference external" href="hg.1.html#revisions"><tt class="docutils literal">hg help
revisions</tt></a>.</p>
<p>Some features, such as pushing to <a class="reference external" href="http://">http://</a> and <a class="reference external" href="https://">https://</a> URLs are only
possible if the feature is explicitly enabled on the remote Mercurial
server.</p>
<p>Note that the security of HTTPS URLs depends on proper configuration of
web.cacerts.</p>
<p>Some notes about using SSH with Mercurial:</p>
<ul>
<li><p class="first">SSH requires an accessible shell account on the destination machine
and a copy of hg in the remote path or specified with as remotecmd.</p>
</li>
<li><p class="first">path is relative to the remote user's home directory by default. Use
an extra slash at the start of a path to specify an absolute path:</p>
<pre class="literal-block">
ssh://example.com//tmp/repository
</pre>
</li>
<li><p class="first">Mercurial doesn't use its own compression via SSH; the right thing
to do is to configure it in your ~/.ssh/config, e.g.:</p>
<pre class="literal-block">
Host *.mylocalnetwork.example.com
Compression no
Host *
Compression yes
</pre>
<p>Alternatively specify "ssh -C" as your ssh command in your
configuration file or with the --ssh command line option.</p>
</li>
</ul>
<p>These URLs can all be stored in your configuration file with path
aliases under the [paths] section like so:</p>
<pre class="literal-block">
[paths]
alias1 = URL1
alias2 = URL2
...
</pre>
<p>You can then use the alias for any command that uses a URL (for
example <a class="reference external" href="hg.1.html#pull"><tt class="docutils literal">hg pull alias1</tt></a> will be treated as <a class="reference external" href="hg.1.html#pull"><tt class="docutils literal">hg pull URL1</tt></a>).</p>
<p>Two path aliases are special because they are used as defaults when
you do not provide the URL to a command:</p>
<dl class="docutils">
<dt>default:</dt>
<dd>When you create a repository with hg clone, the clone command saves
the location of the source repository as the new repository's
'default' path. This is then used when you omit path from push- and
pull-like commands (including incoming and outgoing).</dd>
<dt>default-push:</dt>
<dd>The push command will look for a path named 'default-push', and
prefer it over 'default' if both are defined.</dd>
</dl>
</div>
<div class="section" id="id5">
<h1><a class="toc-backref" href="#contents">Extensions</a></h1>
<p>This section contains help for extensions that are distributed together with Mercurial. Help for other extensions is available in the help system.</p>
<div class="contents htmlonly local topic" id="id6">
<ul class="simple">
<li><a class="reference internal" href="#acl" id="id79">acl</a></li>
<li><a class="reference internal" href="#bugzilla" id="id80">bugzilla</a></li>
<li><a class="reference internal" href="#children" id="id81">children</a></li>
<li><a class="reference internal" href="#churn" id="id82">churn</a></li>
<li><a class="reference internal" href="#color" id="id83">color</a></li>
<li><a class="reference internal" href="#convert" id="id84">convert</a></li>
<li><a class="reference internal" href="#eol" id="id85">eol</a></li>
<li><a class="reference internal" href="#extdiff" id="id86">extdiff</a></li>
<li><a class="reference internal" href="#factotum" id="id87">factotum</a></li>
<li><a class="reference internal" href="#fetch" id="id88">fetch</a></li>
<li><a class="reference internal" href="#gpg" id="id89">gpg</a></li>
<li><a class="reference internal" href="#graphlog" id="id90">graphlog</a></li>
<li><a class="reference internal" href="#hgcia" id="id91">hgcia</a></li>
<li><a class="reference internal" href="#hgk" id="id92">hgk</a></li>
<li><a class="reference internal" href="#highlight" id="id93">highlight</a></li>
<li><a class="reference internal" href="#inotify" id="id94">inotify</a></li>
<li><a class="reference internal" href="#interhg" id="id95">interhg</a></li>
<li><a class="reference internal" href="#keyword" id="id96">keyword</a></li>
<li><a class="reference internal" href="#largefiles" id="id97">largefiles</a></li>
<li><a class="reference internal" href="#mq" id="id98">mq</a></li>
<li><a class="reference internal" href="#notify" id="id99">notify</a></li>
<li><a class="reference internal" href="#pager" id="id100">pager</a></li>
<li><a class="reference internal" href="#patchbomb" id="id101">patchbomb</a></li>
<li><a class="reference internal" href="#progress" id="id102">progress</a></li>
<li><a class="reference internal" href="#purge" id="id103">purge</a></li>
<li><a class="reference internal" href="#rebase" id="id104">rebase</a></li>
<li><a class="reference internal" href="#record" id="id105">record</a></li>
<li><a class="reference internal" href="#relink" id="id106">relink</a></li>
<li><a class="reference internal" href="#schemes" id="id107">schemes</a></li>
<li><a class="reference internal" href="#share" id="id108">share</a></li>
<li><a class="reference internal" href="#transplant" id="id109">transplant</a></li>
<li><a class="reference internal" href="#win32mbcs" id="id110">win32mbcs</a></li>
<li><a class="reference internal" href="#win32text" id="id111">win32text</a></li>
<li><a class="reference internal" href="#zeroconf" id="id112">zeroconf</a></li>
</ul>
</div>
<div class="section" id="acl">
<h2><a class="toc-backref" href="#id79">acl</a></h2>
<p>hooks for controlling repository access</p>
<p>This hook makes it possible to allow or deny write access to given
branches and paths of a repository when receiving incoming changesets
via pretxnchangegroup and pretxncommit.</p>
<p>The authorization is matched based on the local user name on the
system where the hook runs, and not the committer of the original
changeset (since the latter is merely informative).</p>
<p>The acl hook is best used along with a restricted shell like hgsh,
preventing authenticating users from doing anything other than pushing
or pulling. The hook is not safe to use if users have interactive
shell access, as they can then disable the hook. Nor is it safe if
remote users share an account, because then there is no way to
distinguish them.</p>
<p>The order in which access checks are performed is:</p>
<ol class="arabic simple">
<li>Deny list for branches (section <tt class="docutils literal">acl.deny.branches</tt>)</li>
<li>Allow list for branches (section <tt class="docutils literal">acl.allow.branches</tt>)</li>
<li>Deny list for paths (section <tt class="docutils literal">acl.deny</tt>)</li>
<li>Allow list for paths (section <tt class="docutils literal">acl.allow</tt>)</li>
</ol>
<p>The allow and deny sections take key-value pairs.</p>
<div class="section" id="branch-based-access-control">
<h3>Branch-based Access Control</h3>
<p>Use the <tt class="docutils literal">acl.deny.branches</tt> and <tt class="docutils literal">acl.allow.branches</tt> sections to
have branch-based access control. Keys in these sections can be
either:</p>
<ul class="simple">
<li>a branch name, or</li>
<li>an asterisk, to match any branch;</li>
</ul>
<p>The corresponding values can be either:</p>
<ul class="simple">
<li>a comma-separated list containing users and groups, or</li>
<li>an asterisk, to match anyone;</li>
</ul>
</div>
<div class="section" id="path-based-access-control">
<h3>Path-based Access Control</h3>
<p>Use the <tt class="docutils literal">acl.deny</tt> and <tt class="docutils literal">acl.allow</tt> sections to have path-based
access control. Keys in these sections accept a subtree pattern (with
a glob syntax by default). The corresponding values follow the same
syntax as the other sections above.</p>
</div>
<div class="section" id="groups">
<h3>Groups</h3>
<p>Group names must be prefixed with an <tt class="docutils literal">@</tt> symbol. Specifying a group
name has the same effect as specifying all the users in that group.</p>
<p>You can define group members in the <tt class="docutils literal">acl.groups</tt> section.
If a group name is not defined there, and Mercurial is running under
a Unix-like system, the list of users will be taken from the OS.
Otherwise, an exception will be raised.</p>
</div>
<div class="section" id="example-configuration">
<h3>Example Configuration</h3>
<pre class="literal-block">
[hooks]
# Use this if you want to check access restrictions at commit time
pretxncommit.acl = python:hgext.acl.hook
# Use this if you want to check access restrictions for pull, push,
# bundle and serve.
pretxnchangegroup.acl = python:hgext.acl.hook
[acl]
# Allow or deny access for incoming changes only if their source is
# listed here, let them pass otherwise. Source is "serve" for all
# remote access (http or ssh), "push", "pull" or "bundle" when the
# related commands are run locally.
# Default: serve
sources = serve
[acl.deny.branches]
# Everyone is denied to the frozen branch:
frozen-branch = *
# A bad user is denied on all branches:
* = bad-user
[acl.allow.branches]
# A few users are allowed on branch-a:
branch-a = user-1, user-2, user-3
# Only one user is allowed on branch-b:
branch-b = user-1
# The super user is allowed on any branch:
* = super-user
# Everyone is allowed on branch-for-tests:
branch-for-tests = *
[acl.deny]
# This list is checked first. If a match is found, acl.allow is not
# checked. All users are granted access if acl.deny is not present.
# Format for both lists: glob pattern = user, ..., @group, ...
# To match everyone, use an asterisk for the user:
# my/glob/pattern = *
# user6 will not have write access to any file:
** = user6
# Group "hg-denied" will not have write access to any file:
** = @hg-denied
# Nobody will be able to change "DONT-TOUCH-THIS.txt", despite
# everyone being able to change all other files. See below.
src/main/resources/DONT-TOUCH-THIS.txt = *
[acl.allow]
# if acl.allow is not present, all users are allowed by default
# empty acl.allow = no users allowed
# User "doc_writer" has write access to any file under the "docs"
# folder:
docs/** = doc_writer
# User "jack" and group "designers" have write access to any file
# under the "images" folder:
images/** = jack, @designers
# Everyone (except for "user6" and "@hg-denied" - see acl.deny above)
# will have write access to any file under the "resources" folder
# (except for 1 file. See acl.deny):
src/main/resources/** = *
.hgtags = release_engineer
</pre>
</div>
</div>
<div class="section" id="bugzilla">
<h2><a class="toc-backref" href="#id80">bugzilla</a></h2>
<p>hooks for integrating with the Bugzilla bug tracker</p>
<p>This hook extension adds comments on bugs in Bugzilla when changesets
that refer to bugs by Bugzilla ID are seen. The comment is formatted using
the Mercurial template mechanism.</p>
<p>The bug references can optionally include an update for Bugzilla of the
hours spent working on the bug. Bugs can also be marked fixed.</p>
<p>Three basic modes of access to Bugzilla are provided:</p>
<ol class="arabic simple">
<li>Access via the Bugzilla XMLRPC interface. Requires Bugzilla 3.4 or later.</li>
<li>Check data via the Bugzilla XMLRPC interface and submit bug change
via email to Bugzilla email interface. Requires Bugzilla 3.4 or later.</li>
<li>Writing directly to the Bugzilla database. Only Bugzilla installations
using MySQL are supported. Requires Python MySQLdb.</li>
</ol>
<p>Writing directly to the database is susceptible to schema changes, and
relies on a Bugzilla contrib script to send out bug change
notification emails. This script runs as the user running Mercurial,
must be run on the host with the Bugzilla install, and requires
permission to read Bugzilla configuration details and the necessary
MySQL user and password to have full access rights to the Bugzilla
database. For these reasons this access mode is now considered
deprecated, and will not be updated for new Bugzilla versions going
forward. Only adding comments is supported in this access mode.</p>
<p>Access via XMLRPC needs a Bugzilla username and password to be specified
in the configuration. Comments are added under that username. Since the
configuration must be readable by all Mercurial users, it is recommended
that the rights of that user are restricted in Bugzilla to the minimum
necessary to add comments. Marking bugs fixed requires Bugzilla 4.0 and later.</p>
<p>Access via XMLRPC/email uses XMLRPC to query Bugzilla, but sends
email to the Bugzilla email interface to submit comments to bugs.
The From: address in the email is set to the email address of the Mercurial
user, so the comment appears to come from the Mercurial user. In the event
that the Mercurial user email is not recognised by Bugzilla as a Bugzilla
user, the email associated with the Bugzilla username used to log into
Bugzilla is used instead as the source of the comment. Marking bugs fixed
works on all supported Bugzilla versions.</p>
<p>Configuration items common to all access modes:</p>
<dl class="docutils">
<dt>bugzilla.version</dt>
<dd><p class="first">This access type to use. Values recognised are:</p>
<table class="last docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name"><tt class="docutils literal">xmlrpc</tt>:</th><td class="field-body">Bugzilla XMLRPC interface.</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">xmlrpc+email</tt>:</th><td class="field-body">Bugzilla XMLRPC and email interfaces.</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">3.0</tt>:</th><td class="field-body">MySQL access, Bugzilla 3.0 and later.</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">2.18</tt>:</th><td class="field-body">MySQL access, Bugzilla 2.18 and up to but not
including 3.0.</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">2.16</tt>:</th><td class="field-body">MySQL access, Bugzilla 2.16 and up to but not
including 2.18.</td>
</tr>
</tbody>
</table>
</dd>
<dt>bugzilla.regexp</dt>
<dd>Regular expression to match bug IDs for update in changeset commit message.
It must contain one "()" named group <tt class="docutils literal"><ids></tt> containing the bug
IDs separated by non-digit characters. It may also contain
a named group <tt class="docutils literal"><hours></tt> with a floating-point number giving the
hours worked on the bug. If no named groups are present, the first
"()" group is assumed to contain the bug IDs, and work time is not
updated. The default expression matches <tt class="docutils literal">Bug 1234</tt>, <tt class="docutils literal">Bug no. 1234</tt>,
<tt class="docutils literal">Bug number 1234</tt>, <tt class="docutils literal">Bugs 1234,5678</tt>, <tt class="docutils literal">Bug 1234 and 5678</tt> and
variations thereof, followed by an hours number prefixed by <tt class="docutils literal">h</tt> or
<tt class="docutils literal">hours</tt>, e.g. <tt class="docutils literal">hours 1.5</tt>. Matching is case insensitive.</dd>
<dt>bugzilla.fixregexp</dt>
<dd>Regular expression to match bug IDs for marking fixed in changeset
commit message. This must contain a "()" named group <tt class="docutils literal"><ids>` containing
the bug IDs separated by <span class="pre">non-digit</span> characters. It may also contain
a named group <span class="pre">``<hours></span></tt> with a floating-point number giving the
hours worked on the bug. If no named groups are present, the first
"()" group is assumed to contain the bug IDs, and work time is not
updated. The default expression matches <tt class="docutils literal">Fixes 1234</tt>, <tt class="docutils literal">Fixes bug 1234</tt>,
<tt class="docutils literal">Fixes bugs 1234,5678</tt>, <tt class="docutils literal">Fixes 1234 and 5678</tt> and
variations thereof, followed by an hours number prefixed by <tt class="docutils literal">h</tt> or
<tt class="docutils literal">hours</tt>, e.g. <tt class="docutils literal">hours 1.5</tt>. Matching is case insensitive.</dd>
<dt>bugzilla.fixstatus</dt>
<dd>The status to set a bug to when marking fixed. Default <tt class="docutils literal">RESOLVED</tt>.</dd>
<dt>bugzilla.fixresolution</dt>
<dd>The resolution to set a bug to when marking fixed. Default <tt class="docutils literal">FIXED</tt>.</dd>
<dt>bugzilla.style</dt>
<dd>The style file to use when formatting comments.</dd>
<dt>bugzilla.template</dt>
<dd><p class="first">Template to use when formatting comments. Overrides style if
specified. In addition to the usual Mercurial keywords, the
extension specifies:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name"><tt class="docutils literal">{bug}</tt>:</th><td class="field-body">The Bugzilla bug ID.</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">{root}</tt>:</th><td class="field-body">The full pathname of the Mercurial repository.</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">{webroot}</tt>:</th><td class="field-body">Stripped pathname of the Mercurial repository.</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">{hgweb}</tt>:</th><td class="field-body">Base URL for browsing Mercurial repositories.</td>
</tr>
</tbody>
</table>
<p class="last">Default <tt class="docutils literal">changeset {node|short} in repo {root} refers to bug
<span class="pre">{bug}.\ndetails:\n\t{desc|tabindent}</span></tt></p>
</dd>
<dt>bugzilla.strip</dt>
<dd>The number of path separator characters to strip from the front of
the Mercurial repository path (<tt class="docutils literal">{root}</tt> in templates) to produce
<tt class="docutils literal">{webroot}</tt>. For example, a repository with <tt class="docutils literal">{root}</tt>
<tt class="docutils literal"><span class="pre">/var/local/my-project</span></tt> with a strip of 2 gives a value for
<tt class="docutils literal">{webroot}</tt> of <tt class="docutils literal"><span class="pre">my-project</span></tt>. Default 0.</dd>
<dt>web.baseurl</dt>
<dd>Base URL for browsing Mercurial repositories. Referenced from
templates as <tt class="docutils literal">{hgweb}</tt>.</dd>
</dl>
<p>Configuration items common to XMLRPC+email and MySQL access modes:</p>
<dl class="docutils">
<dt>bugzilla.usermap</dt>
<dd><p class="first">Path of file containing Mercurial committer email to Bugzilla user email
mappings. If specified, the file should contain one mapping per
line:</p>
<pre class="literal-block">
committer = Bugzilla user
</pre>
<p class="last">See also the <tt class="docutils literal">[usermap]</tt> section.</p>
</dd>
</dl>
<p>The <tt class="docutils literal">[usermap]</tt> section is used to specify mappings of Mercurial
committer email to Bugzilla user email. See also <tt class="docutils literal">bugzilla.usermap</tt>.
Contains entries of the form <tt class="docutils literal">committer = Bugzilla user</tt>.</p>
<p>XMLRPC access mode configuration:</p>
<dl class="docutils">
<dt>bugzilla.bzurl</dt>
<dd>The base URL for the Bugzilla installation.
Default <tt class="docutils literal"><span class="pre">http://localhost/bugzilla</span></tt>.</dd>
<dt>bugzilla.user</dt>
<dd>The username to use to log into Bugzilla via XMLRPC. Default
<tt class="docutils literal">bugs</tt>.</dd>
<dt>bugzilla.password</dt>
<dd>The password for Bugzilla login.</dd>
</dl>
<p>XMLRPC+email access mode uses the XMLRPC access mode configuration items,
and also:</p>
<dl class="docutils">
<dt>bugzilla.bzemail</dt>
<dd>The Bugzilla email address.</dd>
</dl>
<p>In addition, the Mercurial email settings must be configured. See the
documentation in hgrc(5), sections <tt class="docutils literal">[email]</tt> and <tt class="docutils literal">[smtp]</tt>.</p>
<p>MySQL access mode configuration:</p>
<dl class="docutils">
<dt>bugzilla.host</dt>
<dd>Hostname of the MySQL server holding the Bugzilla database.
Default <tt class="docutils literal">localhost</tt>.</dd>
<dt>bugzilla.db</dt>
<dd>Name of the Bugzilla database in MySQL. Default <tt class="docutils literal">bugs</tt>.</dd>
<dt>bugzilla.user</dt>
<dd>Username to use to access MySQL server. Default <tt class="docutils literal">bugs</tt>.</dd>
<dt>bugzilla.password</dt>
<dd>Password to use to access MySQL server.</dd>
<dt>bugzilla.timeout</dt>
<dd>Database connection timeout (seconds). Default 5.</dd>
<dt>bugzilla.bzuser</dt>
<dd>Fallback Bugzilla user name to record comments with, if changeset
committer cannot be found as a Bugzilla user.</dd>
<dt>bugzilla.bzdir</dt>
<dd>Bugzilla install directory. Used by default notify. Default
<tt class="docutils literal">/var/www/html/bugzilla</tt>.</dd>
<dt>bugzilla.notify</dt>
<dd>The command to run to get Bugzilla to send bug change notification
emails. Substitutes from a map with 3 keys, <tt class="docutils literal">bzdir</tt>, <tt class="docutils literal">id</tt> (bug
id) and <tt class="docutils literal">user</tt> (committer bugzilla email). Default depends on
version; from 2.18 it is "cd %(bzdir)s && perl -T
contrib/sendbugmail.pl %(id)s %(user)s".</dd>
</dl>
<p>Activating the extension:</p>
<pre class="literal-block">
[extensions]
bugzilla =
[hooks]
# run bugzilla hook on every change pulled or pushed in here
incoming.bugzilla = python:hgext.bugzilla.hook
</pre>
<p>Example configurations:</p>
<p>XMLRPC example configuration. This uses the Bugzilla at
<tt class="docutils literal"><span class="pre">http://my-project.org/bugzilla</span></tt>, logging in as user
<tt class="docutils literal"><span class="pre">bugmail@my-project.org</span></tt> with password <tt class="docutils literal">plugh</tt>. It is used with a
collection of Mercurial repositories in <tt class="docutils literal">/var/local/hg/repos/</tt>,
with a web interface at <tt class="docutils literal"><span class="pre">http://my-project.org/hg</span></tt>.</p>
<pre class="literal-block">
[bugzilla]
bzurl=http://my-project.org/bugzilla
user=bugmail@my-project.org
password=plugh
version=xmlrpc
template=Changeset {node|short} in {root|basename}.
{hgweb}/{webroot}/rev/{node|short}\n
{desc}\n
strip=5
[web]
baseurl=http://my-project.org/hg
</pre>
<p>XMLRPC+email example configuration. This uses the Bugzilla at
<tt class="docutils literal"><span class="pre">http://my-project.org/bugzilla</span></tt>, logging in as user
<tt class="docutils literal"><span class="pre">bugmail@my-project.org</span></tt> with password <tt class="docutils literal">plugh</tt>. It is used with a
collection of Mercurial repositories in <tt class="docutils literal">/var/local/hg/repos/</tt>,
with a web interface at <tt class="docutils literal"><span class="pre">http://my-project.org/hg</span></tt>. Bug comments
are sent to the Bugzilla email address
<tt class="docutils literal"><span class="pre">bugzilla@my-project.org</span></tt>.</p>
<pre class="literal-block">
[bugzilla]
bzurl=http://my-project.org/bugzilla
user=bugmail@my-project.org
password=plugh
version=xmlrpc
bzemail=bugzilla@my-project.org
template=Changeset {node|short} in {root|basename}.
{hgweb}/{webroot}/rev/{node|short}\n
{desc}\n
strip=5
[web]
baseurl=http://my-project.org/hg
[usermap]
user@emaildomain.com=user.name@bugzilladomain.com
</pre>
<p>MySQL example configuration. This has a local Bugzilla 3.2 installation
in <tt class="docutils literal"><span class="pre">/opt/bugzilla-3.2</span></tt>. The MySQL database is on <tt class="docutils literal">localhost</tt>,
the Bugzilla database name is <tt class="docutils literal">bugs</tt> and MySQL is
accessed with MySQL username <tt class="docutils literal">bugs</tt> password <tt class="docutils literal">XYZZY</tt>. It is used
with a collection of Mercurial repositories in <tt class="docutils literal">/var/local/hg/repos/</tt>,
with a web interface at <tt class="docutils literal"><span class="pre">http://my-project.org/hg</span></tt>.</p>
<pre class="literal-block">
[bugzilla]
host=localhost
password=XYZZY
version=3.0
bzuser=unknown@domain.com
bzdir=/opt/bugzilla-3.2
template=Changeset {node|short} in {root|basename}.
{hgweb}/{webroot}/rev/{node|short}\n
{desc}\n
strip=5
[web]
baseurl=http://my-project.org/hg
[usermap]
user@emaildomain.com=user.name@bugzilladomain.com
</pre>
<p>All the above add a comment to the Bugzilla bug record of the form:</p>
<pre class="literal-block">
Changeset 3b16791d6642 in repository-name.
http://my-project.org/hg/repository-name/rev/3b16791d6642
Changeset commit comment. Bug 1234.
</pre>
</div>
<div class="section" id="children">
<h2><a class="toc-backref" href="#id81">children</a></h2>
<p>command to display child changesets</p>
<div class="section" id="id7">
<h3>Commands</h3>
<div class="section" id="id8">
<h4>children</h4>
<pre class="literal-block">
hg children [-r REV] [FILE]
</pre>
<p>Print the children of the working directory's revisions. If a
revision is given via -r/--rev, the children of that revision will
be printed. If a file argument is given, revision in which the
file was last changed (after the working directory revision or the
argument to --rev if given) is printed.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>show children of the specified revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="churn">
<h2><a class="toc-backref" href="#id82">churn</a></h2>
<p>command to display statistics about repository history</p>
<div class="section" id="id9">
<h3>Commands</h3>
<div class="section" id="id10">
<h4>churn</h4>
<pre class="literal-block">
hg churn [-d DATE] [-r REV] [--aliases FILE] [FILE]
</pre>
<p>This command will display a histogram representing the number
of changed lines or revisions, grouped according to the given
template. The default template will group changes by author.
The --dateformat option may be used to group the results by
date instead.</p>
<p>Statistics are based on the number of changed lines, or
alternatively the number of matching revisions if the
--changesets option is specified.</p>
<p>Examples:</p>
<pre class="literal-block">
# display count of changed lines for every committer
hg churn -t '{author|email}'
# display daily activity graph
hg churn -f '%H' -s -c
# display activity of developers by month
hg churn -f '%Y-%m' -s -c
# display count of lines changed in every year
hg churn -f '%Y' -s
</pre>
<p>It is possible to map alternate email addresses to a main address
by providing a file using the following format:</p>
<pre class="literal-block">
<alias email> = <actual email>
</pre>
<p>Such a file may be specified with the --aliases option, otherwise
a .hgchurn file will be looked for in the working directory root.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>count rate for the specified revision or range</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>count rate for revisions matching date spec</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--template</span></kbd></td>
<td>template to group changesets (default: {author|email})</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-f</span>, <span class="option">--dateformat</span></kbd></td>
</tr>
<tr><td> </td><td>strftime-compatible format for grouping by date</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-c</span>, <span class="option">--changesets</span></kbd></td>
</tr>
<tr><td> </td><td>count rate by number of changesets</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--sort</span></kbd></td>
<td>sort by key (default: sort by count)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--diffstat</span></kbd></td>
<td>display added/removed lines separately</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--aliases</span></kbd></td>
<td>file with email aliases</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="color">
<h2><a class="toc-backref" href="#id83">color</a></h2>
<p>colorize output from some commands</p>
<p>This extension modifies the status and resolve commands to add color
to their output to reflect file status, the qseries command to add
color to reflect patch status (applied, unapplied, missing), and to
diff-related commands to highlight additions, removals, diff headers,
and trailing whitespace.</p>
<p>Other effects in addition to color, like bold and underlined text, are
also available. By default, the terminfo database is used to find the
terminal codes used to change color and effect. If terminfo is not
available, then effects are rendered with the ECMA-48 SGR control
function (aka ANSI escape codes).</p>
<p>Default effects may be overridden from your configuration file:</p>
<pre class="literal-block">
[color]
status.modified = blue bold underline red_background
status.added = green bold
status.removed = red bold blue_background
status.deleted = cyan bold underline
status.unknown = magenta bold underline
status.ignored = black bold
# 'none' turns off all effects
status.clean = none
status.copied = none
qseries.applied = blue bold underline
qseries.unapplied = black bold
qseries.missing = red bold
diff.diffline = bold
diff.extended = cyan bold
diff.file_a = red bold
diff.file_b = green bold
diff.hunk = magenta
diff.deleted = red
diff.inserted = green
diff.changed = white
diff.trailingwhitespace = bold red_background
resolve.unresolved = red bold
resolve.resolved = green bold
bookmarks.current = green
branches.active = none
branches.closed = black bold
branches.current = green
branches.inactive = none
tags.normal = green
tags.local = black bold
</pre>
<p>The available effects in terminfo mode are 'blink', 'bold', 'dim',
'inverse', 'invisible', 'italic', 'standout', and 'underline'; in
ECMA-48 mode, the options are 'bold', 'inverse', 'italic', and
'underline'. How each is rendered depends on the terminal emulator.
Some may not be available for a given terminal type, and will be
silently ignored.</p>
<p>Note that on some systems, terminfo mode may cause problems when using
color with the pager extension and less -R. less with the -R option
will only display ECMA-48 color codes, and terminfo mode may sometimes
emit codes that less doesn't understand. You can work around this by
either using ansi mode (or auto mode), or by using less -r (which will
pass through all terminal control codes, not just color control
codes).</p>
<p>Because there are only eight standard colors, this module allows you
to define color names for other color slots which might be available
for your terminal type, assuming terminfo mode. For instance:</p>
<pre class="literal-block">
color.brightblue = 12
color.pink = 207
color.orange = 202
</pre>
<p>to set 'brightblue' to color slot 12 (useful for 16 color terminals
that have brighter colors defined in the upper eight) and, 'pink' and
'orange' to colors in 256-color xterm's default color cube. These
defined colors may then be used as any of the pre-defined eight,
including appending '_background' to set the background to that color.</p>
<p>By default, the color extension will use ANSI mode (or win32 mode on
Windows) if it detects a terminal. To override auto mode (to enable
terminfo mode, for example), set the following configuration option:</p>
<pre class="literal-block">
[color]
mode = terminfo
</pre>
<p>Any value other than 'ansi', 'win32', 'terminfo', or 'auto' will
disable color.</p>
</div>
<div class="section" id="convert">
<h2><a class="toc-backref" href="#id84">convert</a></h2>
<p>import revisions from foreign VCS repositories into Mercurial</p>
<div class="section" id="id11">
<h3>Commands</h3>
<div class="section" id="id12">
<h4>convert</h4>
<pre class="literal-block">
hg convert [OPTION]... SOURCE [DEST [REVMAP]]
</pre>
<p>Accepted source formats [identifiers]:</p>
<ul class="simple">
<li>Mercurial [hg]</li>
<li>CVS [cvs]</li>
<li>Darcs [darcs]</li>
<li>git [git]</li>
<li>Subversion [svn]</li>
<li>Monotone [mtn]</li>
<li>GNU Arch [gnuarch]</li>
<li>Bazaar [bzr]</li>
<li>Perforce [p4]</li>
</ul>
<p>Accepted destination formats [identifiers]:</p>
<ul class="simple">
<li>Mercurial [hg]</li>
<li>Subversion [svn] (history on branches is not preserved)</li>
</ul>
<p>If no revision is given, all revisions will be converted.
Otherwise, convert will only import up to the named revision
(given in a format understood by the source).</p>
<p>If no destination directory name is specified, it defaults to the
basename of the source with <tt class="docutils literal"><span class="pre">-hg</span></tt> appended. If the destination
repository doesn't exist, it will be created.</p>
<p>By default, all sources except Mercurial will use --branchsort.
Mercurial uses --sourcesort to preserve original revision numbers
order. Sort modes have the following effects:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">--branchsort</span></kbd></td>
<td>convert from parent to child revision when possible,
which means branches are usually converted one after
the other. It generates more compact repositories.</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--datesort</span></kbd></td>
<td>sort revisions by date. Converted repositories have
good-looking changelogs but are often an order of
magnitude larger than the same ones generated by
--branchsort.</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--sourcesort</span></kbd></td>
<td>try to preserve source revisions order, only
supported by Mercurial sources.</td></tr>
</tbody>
</table>
<p>If <tt class="docutils literal">REVMAP</tt> isn't given, it will be put in a default location
(<tt class="docutils literal"><span class="pre"><dest>/.hg/shamap</span></tt> by default). The <tt class="docutils literal">REVMAP</tt> is a simple
text file that maps each source commit ID to the destination ID
for that revision, like so:</p>
<pre class="literal-block">
<source ID> <destination ID>
</pre>
<p>If the file doesn't exist, it's automatically created. It's
updated on each commit copied, so <a class="reference external" href="hg.1.html#convert"><tt class="docutils literal">hg convert</tt></a> can be interrupted
and can be run repeatedly to copy new commits.</p>
<p>The authormap is a simple text file that maps each source commit
author to a destination commit author. It is handy for source SCMs
that use unix logins to identify authors (eg: CVS). One line per
author mapping and the line format is:</p>
<pre class="literal-block">
source author = destination author
</pre>
<p>Empty lines and lines starting with a <tt class="docutils literal">#</tt> are ignored.</p>
<p>The filemap is a file that allows filtering and remapping of files
and directories. Each line can contain one of the following
directives:</p>
<pre class="literal-block">
include path/to/file-or-dir
exclude path/to/file-or-dir
rename path/to/source path/to/destination
</pre>
<p>Comment lines start with <tt class="docutils literal">#</tt>. A specified path matches if it
equals the full relative name of a file or one of its parent
directories. The <tt class="docutils literal">include</tt> or <tt class="docutils literal">exclude</tt> directive with the
longest matching path applies, so line order does not matter.</p>
<p>The <tt class="docutils literal">include</tt> directive causes a file, or all files under a
directory, to be included in the destination repository, and the
exclusion of all other files and directories not explicitly
included. The <tt class="docutils literal">exclude</tt> directive causes files or directories to
be omitted. The <tt class="docutils literal">rename</tt> directive renames a file or directory if
it is converted. To rename from a subdirectory into the root of
the repository, use <tt class="docutils literal">.</tt> as the path to rename to.</p>
<p>The splicemap is a file that allows insertion of synthetic
history, letting you specify the parents of a revision. This is
useful if you want to e.g. give a Subversion merge two parents, or
graft two disconnected series of history together. Each entry
contains a key, followed by a space, followed by one or two
comma-separated values:</p>
<pre class="literal-block">
key parent1, parent2
</pre>
<p>The key is the revision ID in the source
revision control system whose parents should be modified (same
format as a key in .hg/shamap). The values are the revision IDs
(in either the source or destination revision control system) that
should be used as the new parents for that node. For example, if
you have merged "release-1.0" into "trunk", then you should
specify the revision on "trunk" as the first parent and the one on
the "release-1.0" branch as the second.</p>
<p>The branchmap is a file that allows you to rename a branch when it is
being brought in from whatever external repository. When used in
conjunction with a splicemap, it allows for a powerful combination
to help fix even the most badly mismanaged repositories and turn them
into nicely structured Mercurial repositories. The branchmap contains
lines of the form:</p>
<pre class="literal-block">
original_branch_name new_branch_name
</pre>
<p>where "original_branch_name" is the name of the branch in the
source repository, and "new_branch_name" is the name of the branch
is the destination repository. No whitespace is allowed in the
branch names. This can be used to (for instance) move code in one
repository from "default" to a named branch.</p>
<div class="section" id="mercurial-source">
<h5>Mercurial Source</h5>
<p>The Mercurial source recognizes the following configuration
options, which you can set on the command line with <tt class="docutils literal"><span class="pre">--config</span></tt>:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">convert.hg.ignoreerrors:</th></tr>
<tr class="field"><td> </td><td class="field-body">ignore integrity errors when reading.
Use it to fix Mercurial repositories with missing revlogs, by
converting from and to Mercurial. Default is False.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.hg.saverev:</th></tr>
<tr class="field"><td> </td><td class="field-body">store original revision ID in changeset
(forces target IDs to change). It takes a boolean argument and
defaults to False.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.hg.startrev:</th></tr>
<tr class="field"><td> </td><td class="field-body">convert start revision and its descendants.
It takes a hg revision identifier and defaults to 0.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="cvs-source">
<h5>CVS Source</h5>
<p>CVS source will use a sandbox (i.e. a checked-out copy) from CVS
to indicate the starting point of what will be converted. Direct
access to the repository files is not needed, unless of course the
repository is <tt class="docutils literal">:local:</tt>. The conversion uses the top level
directory in the sandbox to find the CVS repository, and then uses
CVS rlog commands to find files to convert. This means that unless
a filemap is given, all files under the starting directory will be
converted, and that any directory reorganization in the CVS
sandbox is ignored.</p>
<p>The following options can be used with <tt class="docutils literal"><span class="pre">--config</span></tt>:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">convert.cvsps.cache:</th></tr>
<tr class="field"><td> </td><td class="field-body">Set to False to disable remote log caching,
for testing and debugging purposes. Default is True.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.cvsps.fuzz:</th></tr>
<tr class="field"><td> </td><td class="field-body">Specify the maximum time (in seconds) that is
allowed between commits with identical user and log message in
a single changeset. When very large files were checked in as
part of a changeset then the default may not be long enough.
The default is 60.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.cvsps.mergeto:</th></tr>
<tr class="field"><td> </td><td class="field-body">Specify a regular expression to which
commit log messages are matched. If a match occurs, then the
conversion process will insert a dummy revision merging the
branch on which this log message occurs to the branch
indicated in the regex. Default is <tt class="docutils literal">{{mergetobranch
<span class="pre">([-\w]+)}}</span></tt></td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.cvsps.mergefrom:</th></tr>
<tr class="field"><td> </td><td class="field-body">Specify a regular expression to which
commit log messages are matched. If a match occurs, then the
conversion process will add the most recent revision on the
branch indicated in the regex as the second parent of the
changeset. Default is <tt class="docutils literal">{{mergefrombranch <span class="pre">([-\w]+)}}</span></tt></td>
</tr>
<tr class="field"><th class="field-name">hook.cvslog:</th><td class="field-body">Specify a Python function to be called at the end of
gathering the CVS log. The function is passed a list with the
log entries, and can modify the entries in-place, or add or
delete them.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">hook.cvschangesets:</th></tr>
<tr class="field"><td> </td><td class="field-body">Specify a Python function to be called after
the changesets are calculated from the the CVS log. The
function is passed a list with the changeset entries, and can
modify the changesets in-place, or add or delete them.</td>
</tr>
</tbody>
</table>
<p>An additional "debugcvsps" Mercurial command allows the builtin
changeset merging code to be run without doing a conversion. Its
parameters and output are similar to that of cvsps 2.1. Please see
the command help for more details.</p>
</div>
<div class="section" id="subversion-source">
<h5>Subversion Source</h5>
<p>Subversion source detects classical trunk/branches/tags layouts.
By default, the supplied <tt class="docutils literal"><span class="pre">svn://repo/path/</span></tt> source URL is
converted as a single branch. If <tt class="docutils literal"><span class="pre">svn://repo/path/trunk</span></tt> exists
it replaces the default branch. If <tt class="docutils literal"><span class="pre">svn://repo/path/branches</span></tt>
exists, its subdirectories are listed as possible branches. If
<tt class="docutils literal"><span class="pre">svn://repo/path/tags</span></tt> exists, it is looked for tags referencing
converted branches. Default <tt class="docutils literal">trunk</tt>, <tt class="docutils literal">branches</tt> and <tt class="docutils literal">tags</tt>
values can be overridden with following options. Set them to paths
relative to the source URL, or leave them blank to disable auto
detection.</p>
<p>The following options can be set with <tt class="docutils literal"><span class="pre">--config</span></tt>:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">convert.svn.branches:</th></tr>
<tr class="field"><td> </td><td class="field-body">specify the directory containing branches.
The default is <tt class="docutils literal">branches</tt>.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.svn.tags:</th></tr>
<tr class="field"><td> </td><td class="field-body">specify the directory containing tags. The
default is <tt class="docutils literal">tags</tt>.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.svn.trunk:</th></tr>
<tr class="field"><td> </td><td class="field-body">specify the name of the trunk branch. The
default is <tt class="docutils literal">trunk</tt>.</td>
</tr>
</tbody>
</table>
<p>Source history can be retrieved starting at a specific revision,
instead of being integrally converted. Only single branch
conversions are supported.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">convert.svn.startrev:</th></tr>
<tr class="field"><td> </td><td class="field-body">specify start Subversion revision number.
The default is 0.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="perforce-source">
<h5>Perforce Source</h5>
<p>The Perforce (P4) importer can be given a p4 depot path or a
client specification as source. It will convert all files in the
source to a flat Mercurial repository, ignoring labels, branches
and integrations. Note that when a depot path is given you then
usually should specify a target directory, because otherwise the
target may be named <tt class="docutils literal"><span class="pre">...-hg</span></tt>.</p>
<p>It is possible to limit the amount of source history to be
converted by specifying an initial Perforce revision:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">convert.p4.startrev:</th></tr>
<tr class="field"><td> </td><td class="field-body">specify initial Perforce revision (a
Perforce changelist number).</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="mercurial-destination">
<h5>Mercurial Destination</h5>
<p>The following options are supported:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">convert.hg.clonebranches:</th></tr>
<tr class="field"><td> </td><td class="field-body">dispatch source branches in separate
clones. The default is False.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.hg.tagsbranch:</th></tr>
<tr class="field"><td> </td><td class="field-body">branch name for tag revisions, defaults to
<tt class="docutils literal">default</tt>.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.hg.usebranchnames:</th></tr>
<tr class="field"><td> </td><td class="field-body">preserve branch names. The default is
True.</td>
</tr>
</tbody>
</table>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">--authors</span></kbd></td>
<td>username mapping filename (DEPRECATED, use --authormap instead)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-s</span>, <span class="option">--source-type</span></kbd></td>
</tr>
<tr><td> </td><td>source repository type</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-d</span>, <span class="option">--dest-type</span></kbd></td>
</tr>
<tr><td> </td><td>destination repository type</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>import up to target revision REV</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-A</span>, <span class="option">--authormap</span></kbd></td>
</tr>
<tr><td> </td><td>remap usernames using this file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--filemap</span></kbd></td>
<td>remap file names using contents of file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--splicemap</span></kbd></td>
<td>splice synthesized history into place</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--branchmap</span></kbd></td>
<td>change branch names while converting</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--branchsort</span></kbd></td>
<td>try to sort changesets by branches</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--datesort</span></kbd></td>
<td>try to sort changesets by date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--sourcesort</span></kbd></td>
<td>preserve source changesets order</td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="section" id="eol">
<h2><a class="toc-backref" href="#id85">eol</a></h2>
<p>automatically manage newlines in repository files</p>
<p>This extension allows you to manage the type of line endings (CRLF or
LF) that are used in the repository and in the local working
directory. That way you can get CRLF line endings on Windows and LF on
Unix/Mac, thereby letting everybody use their OS native line endings.</p>
<p>The extension reads its configuration from a versioned <tt class="docutils literal">.hgeol</tt>
configuration file found in the root of the working copy. The
<tt class="docutils literal">.hgeol</tt> file use the same syntax as all other Mercurial
configuration files. It uses two sections, <tt class="docutils literal">[patterns]</tt> and
<tt class="docutils literal">[repository]</tt>.</p>
<p>The <tt class="docutils literal">[patterns]</tt> section specifies how line endings should be
converted between the working copy and the repository. The format is
specified by a file pattern. The first match is used, so put more
specific patterns first. The available line endings are <tt class="docutils literal">LF</tt>,
<tt class="docutils literal">CRLF</tt>, and <tt class="docutils literal">BIN</tt>.</p>
<p>Files with the declared format of <tt class="docutils literal">CRLF</tt> or <tt class="docutils literal">LF</tt> are always
checked out and stored in the repository in that format and files
declared to be binary (<tt class="docutils literal">BIN</tt>) are left unchanged. Additionally,
<tt class="docutils literal">native</tt> is an alias for checking out in the platform's default line
ending: <tt class="docutils literal">LF</tt> on Unix (including Mac OS X) and <tt class="docutils literal">CRLF</tt> on
Windows. Note that <tt class="docutils literal">BIN</tt> (do nothing to line endings) is Mercurial's
default behaviour; it is only needed if you need to override a later,
more general pattern.</p>
<p>The optional <tt class="docutils literal">[repository]</tt> section specifies the line endings to
use for files stored in the repository. It has a single setting,
<tt class="docutils literal">native</tt>, which determines the storage line endings for files
declared as <tt class="docutils literal">native</tt> in the <tt class="docutils literal">[patterns]</tt> section. It can be set to
<tt class="docutils literal">LF</tt> or <tt class="docutils literal">CRLF</tt>. The default is <tt class="docutils literal">LF</tt>. For example, this means
that on Windows, files configured as <tt class="docutils literal">native</tt> (<tt class="docutils literal">CRLF</tt> by default)
will be converted to <tt class="docutils literal">LF</tt> when stored in the repository. Files
declared as <tt class="docutils literal">LF</tt>, <tt class="docutils literal">CRLF</tt>, or <tt class="docutils literal">BIN</tt> in the <tt class="docutils literal">[patterns]</tt> section
are always stored as-is in the repository.</p>
<p>Example versioned <tt class="docutils literal">.hgeol</tt> file:</p>
<pre class="literal-block">
[patterns]
**.py = native
**.vcproj = CRLF
**.txt = native
Makefile = LF
**.jpg = BIN
[repository]
native = LF
</pre>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">The rules will first apply when files are touched in the working
copy, e.g. by updating to null and back to tip to touch all files.</p>
</div>
<p>The extension uses an optional <tt class="docutils literal">[eol]</tt> section read from both the
normal Mercurial configuration files and the <tt class="docutils literal">.hgeol</tt> file, with the
latter overriding the former. You can use that section to control the
overall behavior. There are three settings:</p>
<ul class="simple">
<li><tt class="docutils literal">eol.native</tt> (default <tt class="docutils literal">os.linesep</tt>) can be set to <tt class="docutils literal">LF</tt> or
<tt class="docutils literal">CRLF</tt> to override the default interpretation of <tt class="docutils literal">native</tt> for
checkout. This can be used with <a class="reference external" href="hg.1.html#archive"><tt class="docutils literal">hg archive</tt></a> on Unix, say, to
generate an archive where files have line endings for Windows.</li>
<li><tt class="docutils literal"><span class="pre">eol.only-consistent</span></tt> (default True) can be set to False to make
the extension convert files with inconsistent EOLs. Inconsistent
means that there is both <tt class="docutils literal">CRLF</tt> and <tt class="docutils literal">LF</tt> present in the file.
Such files are normally not touched under the assumption that they
have mixed EOLs on purpose.</li>
<li><tt class="docutils literal"><span class="pre">eol.fix-trailing-newline</span></tt> (default False) can be set to True to
ensure that converted files end with a EOL character (either <tt class="docutils literal">\n</tt>
or <tt class="docutils literal">\r\n</tt> as per the configured patterns).</li>
</ul>
<p>The extension provides <tt class="docutils literal">cleverencode:</tt> and <tt class="docutils literal">cleverdecode:</tt> filters
like the deprecated win32text extension does. This means that you can
disable win32text and enable eol and your filters will still work. You
only need to these filters until you have prepared a <tt class="docutils literal">.hgeol</tt> file.</p>
<p>The <tt class="docutils literal">win32text.forbid*</tt> hooks provided by the win32text extension
have been unified into a single hook named <tt class="docutils literal">eol.checkheadshook</tt>. The
hook will lookup the expected line endings from the <tt class="docutils literal">.hgeol</tt> file,
which means you must migrate to a <tt class="docutils literal">.hgeol</tt> file first before using
the hook. <tt class="docutils literal">eol.checkheadshook</tt> only checks heads, intermediate
invalid revisions will be pushed. To forbid them completely, use the
<tt class="docutils literal">eol.checkallhook</tt> hook. These hooks are best used as
<tt class="docutils literal">pretxnchangegroup</tt> hooks.</p>
<p>See <a class="reference external" href="hg.1.html#patterns"><tt class="docutils literal">hg help patterns</tt></a> for more information about the glob patterns
used.</p>
</div>
<div class="section" id="extdiff">
<h2><a class="toc-backref" href="#id86">extdiff</a></h2>
<p>command to allow external programs to compare revisions</p>
<p>The extdiff Mercurial extension allows you to use external programs
to compare revisions, or revision with working directory. The external
diff programs are called with a configurable set of options and two
non-option arguments: paths to directories containing snapshots of
files to compare.</p>
<p>The extdiff extension also allows you to configure new diff commands, so
you do not need to type <a class="reference external" href="hg.1.html#extdiff"><tt class="docutils literal">hg extdiff <span class="pre">-p</span> kdiff3</tt></a> always.</p>
<pre class="literal-block">
[extdiff]
# add new command that runs GNU diff(1) in 'context diff' mode
cdiff = gdiff -Nprc5
## or the old way:
#cmd.cdiff = gdiff
#opts.cdiff = -Nprc5
# add new command called vdiff, runs kdiff3
vdiff = kdiff3
# add new command called meld, runs meld (no need to name twice)
meld =
# add new command called vimdiff, runs gvimdiff with DirDiff plugin
# (see http://www.vim.org/scripts/script.php?script_id=102) Non
# English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
# your .vimrc
vimdiff = gvim -f "+next" \
"+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))"
</pre>
<p>Tool arguments can include variables that are expanded at runtime:</p>
<pre class="literal-block">
$parent1, $plabel1 - filename, descriptive label of first parent
$child, $clabel - filename, descriptive label of child revision
$parent2, $plabel2 - filename, descriptive label of second parent
$root - repository root
$parent is an alias for $parent1.
</pre>
<p>The extdiff extension will look in your [diff-tools] and [merge-tools]
sections for diff tool arguments, when none are specified in [extdiff].</p>
<pre class="literal-block">
[extdiff]
kdiff3 =
[diff-tools]
kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
</pre>
<p>You can use -I/-X and list of file or directory names like normal
<a class="reference external" href="hg.1.html#diff"><tt class="docutils literal">hg diff</tt></a> command. The extdiff extension makes snapshots of only
needed files, so running the external diff program will actually be
pretty fast (at least faster than having to compare the entire tree).</p>
<div class="section" id="id13">
<h3>Commands</h3>
<div class="section" id="id14">
<h4>extdiff</h4>
<pre class="literal-block">
hg extdiff [OPT]... [FILE]...
</pre>
<p>Show differences between revisions for the specified files, using
an external program. The default program used is diff, with
default options "-Npru".</p>
<p>To select a different program, use the -p/--program option. The
program will be passed the names of two directories to compare. To
pass additional options to the program, use -o/--option. These
will be passed before the names of the directories to compare.</p>
<p>When two revision arguments are given, then changes are shown
between those revisions. If only one revision is specified then
that revision is compared to the working directory, and, when no
revisions are specified, the working directory files are compared
to its parent.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--program</span></kbd></td>
<td>comparison program to run</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-o</span>, <span class="option">--option</span></kbd></td>
<td>pass option to comparison program</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--change</span></kbd></td>
<td>change made by revision</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="factotum">
<h2><a class="toc-backref" href="#id87">factotum</a></h2>
<p>http authentication with factotum</p>
<p>This extension allows the factotum(4) facility on Plan 9 from Bell Labs
platforms to provide authentication information for HTTP access. Configuration
entries specified in the auth section as well as authentication information
provided in the repository URL are fully supported. If no prefix is specified,
a value of "*" will be assumed.</p>
<p>By default, keys are specified as:</p>
<pre class="literal-block">
proto=pass service=hg prefix=<prefix> user=<username> !password=<password>
</pre>
<p>If the factotum extension is unable to read the required key, one will be
requested interactively.</p>
<p>A configuration section is available to customize runtime behavior. By
default, these entries are:</p>
<pre class="literal-block">
[factotum]
executable = /bin/auth/factotum
mountpoint = /mnt/factotum
service = hg
</pre>
<p>The executable entry defines the full path to the factotum binary. The
mountpoint entry defines the path to the factotum file service. Lastly, the
service entry controls the service name used when reading keys.</p>
</div>
<div class="section" id="fetch">
<h2><a class="toc-backref" href="#id88">fetch</a></h2>
<p>pull, update and merge in one command</p>
<div class="section" id="id15">
<h3>Commands</h3>
<div class="section" id="id16">
<h4>fetch</h4>
<pre class="literal-block">
hg fetch [SOURCE]
</pre>
<p>This finds all changes from the repository at the specified path
or URL and adds them to the local repository.</p>
<p>If the pulled changes add a new branch head, the head is
automatically merged, and the result of the merge is committed.
Otherwise, the working directory is updated to include the new
changes.</p>
<p>When a merge is needed, the working directory is first updated to
the newly pulled changes. Local changes are then merged into the
pulled changes. To switch the merge order, use --switch-parent.</p>
<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>a specific revision you would like to pull</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
<td>edit commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--force-editor</span></kbd></td>
<td>edit commit message (DEPRECATED)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--switch-parent</span></kbd></td>
</tr>
<tr><td> </td><td>switch parents when merging</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>record the specified date as commit date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>record the specified user as committer</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--insecure</span></kbd></td>
<td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="gpg">
<h2><a class="toc-backref" href="#id89">gpg</a></h2>
<p>commands to sign and verify changesets</p>
<div class="section" id="id17">
<h3>Commands</h3>
<div class="section" id="sigcheck">
<h4>sigcheck</h4>
<pre class="literal-block">
hg sigcheck REVISION
</pre>
<p>verify all the signatures there may be for a particular revision</p>
</div>
<div class="section" id="sign">
<h4>sign</h4>
<pre class="literal-block">
hg sign [OPTION]... [REVISION]...
</pre>
<p>If no revision is given, the parent of the working directory is used,
or tip if no revision is checked out.</p>
<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--local</span></kbd></td>
<td>make the signature local</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>sign even if the sigfile is modified</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--no-commit</span></kbd></td>
<td>do not commit the sigfile after signing</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-k</span>, <span class="option">--key</span></kbd></td>
<td>the key id to sign with</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>record the specified date as commit date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>record the specified user as committer</td></tr>
</tbody>
</table>
</div>
<div class="section" id="sigs">
<h4>sigs</h4>
<pre class="literal-block">
hg sigs
</pre>
<p>list signed changesets</p>
</div>
</div>
</div>
<div class="section" id="graphlog">
<h2><a class="toc-backref" href="#id90">graphlog</a></h2>
<p>command to view revision graphs from a shell</p>
<p>This extension adds a --graph option to the incoming, outgoing and log
commands. When this options is given, an ASCII representation of the
revision graph is also shown.</p>
<div class="section" id="id18">
<h3>Commands</h3>
<div class="section" id="glog">
<h4>glog</h4>
<pre class="literal-block">
hg glog [OPTION]... [FILE]
</pre>
<p>Print a revision history alongside a revision graph drawn with
ASCII characters.</p>
<p>Nodes printed as an @ character are parents of the working
directory.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--follow</span></kbd></td>
<td>follow changeset history, or file history across copies and renames</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--follow-first</span></kbd></td>
<td>only follow the first parent of merge changesets (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>show revisions matching date spec</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-C</span>, <span class="option">--copies</span></kbd></td>
<td>show copied files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-k</span>, <span class="option">--keyword</span></kbd></td>
<td>do case-insensitive search for a given text</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>show the specified revision or range</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--removed</span></kbd></td>
<td>include revisions where files were removed</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-m</span>, <span class="option">--only-merges</span></kbd></td>
</tr>
<tr><td> </td><td>show only merges (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>revisions committed by user</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--only-branch</span></kbd></td>
<td>show only changesets within the given named branch (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>show changesets within the given named branch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-P</span>, <span class="option">--prune</span></kbd></td>
<td>do not display revision or any of its ancestors</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--hidden</span></kbd></td>
<td>show hidden changesets (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--patch</span></kbd></td>
<td>show patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--limit</span></kbd></td>
<td>limit number of changes displayed</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-M</span>, <span class="option">--no-merges</span></kbd></td>
</tr>
<tr><td> </td><td>do not show merges</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--stat</span></kbd></td>
<td>output diffstat-style summary of changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="hgcia">
<h2><a class="toc-backref" href="#id91">hgcia</a></h2>
<p>hooks for integrating with the CIA.vc notification service</p>
<p>This is meant to be run as a changegroup or incoming hook. To
configure it, set the following options in your hgrc:</p>
<pre class="literal-block">
[cia]
# your registered CIA user name
user = foo
# the name of the project in CIA
project = foo
# the module (subproject) (optional)
#module = foo
# Append a diffstat to the log message (optional)
#diffstat = False
# Template to use for log messages (optional)
#template = {desc}\n{baseurl}{webroot}/rev/{node}-- {diffstat}
# Style to use (optional)
#style = foo
# The URL of the CIA notification service (optional)
# You can use mailto: URLs to send by email, eg
# mailto:cia@cia.vc
# Make sure to set email.from if you do this.
#url = http://cia.vc/
# print message instead of sending it (optional)
#test = False
# number of slashes to strip for url paths
#strip = 0
[hooks]
# one of these:
changegroup.cia = python:hgcia.hook
#incoming.cia = python:hgcia.hook
[web]
# If you want hyperlinks (optional)
baseurl = http://server/path/to/repo
</pre>
</div>
<div class="section" id="hgk">
<h2><a class="toc-backref" href="#id92">hgk</a></h2>
<p>browse the repository in a graphical way</p>
<p>The hgk extension allows browsing the history of a repository in a
graphical way. It requires Tcl/Tk version 8.4 or later. (Tcl/Tk is not
distributed with Mercurial.)</p>
<p>hgk consists of two parts: a Tcl script that does the displaying and
querying of information, and an extension to Mercurial named hgk.py,
which provides hooks for hgk to get information. hgk can be found in
the contrib directory, and the extension is shipped in the hgext
repository, and needs to be enabled.</p>
<p>The <a class="reference external" href="hg.1.html#view"><tt class="docutils literal">hg view</tt></a> command will launch the hgk Tcl script. For this command
to work, hgk must be in your search path. Alternately, you can specify
the path to hgk in your configuration file:</p>
<pre class="literal-block">
[hgk]
path=/location/of/hgk
</pre>
<p>hgk can make use of the extdiff extension to visualize revisions.
Assuming you had already configured extdiff vdiff command, just add:</p>
<pre class="literal-block">
[hgk]
vdiff=vdiff
</pre>
<p>Revisions context menu will now display additional entries to fire
vdiff on hovered and selected revisions.</p>
<div class="section" id="id19">
<h3>Commands</h3>
<div class="section" id="view">
<h4>view</h4>
<pre class="literal-block">
hg view [-l LIMIT] [REVRANGE]
</pre>
<p>start interactive history viewer</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--limit</span></kbd></td>
<td>limit number of changes displayed</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="highlight">
<h2><a class="toc-backref" href="#id93">highlight</a></h2>
<p>syntax highlighting for hgweb (requires Pygments)</p>
<p>It depends on the Pygments syntax highlighting library:
<a class="reference external" href="http://pygments.org/">http://pygments.org/</a></p>
<p>There is a single configuration option:</p>
<pre class="literal-block">
[web]
pygments_style = <style>
</pre>
<p>The default is 'colorful'.</p>
</div>
<div class="section" id="inotify">
<h2><a class="toc-backref" href="#id94">inotify</a></h2>
<p>accelerate status report using Linux's inotify service</p>
<div class="section" id="id20">
<h3>Commands</h3>
<div class="section" id="inserve">
<h4>inserve</h4>
<pre class="literal-block">
hg inserve [OPTION]...
</pre>
<p>start an inotify server for this repository</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--daemon</span></kbd></td>
<td>run server in background</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--daemon-pipefds</span></kbd></td>
</tr>
<tr><td> </td><td>used internally by daemon mode</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-t</span>, <span class="option">--idle-timeout</span></kbd></td>
</tr>
<tr><td> </td><td>minutes to sit idle before exiting</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--pid-file</span></kbd></td>
<td>name of file to write process ID to</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="interhg">
<h2><a class="toc-backref" href="#id95">interhg</a></h2>
<p>expand expressions into changelog and summaries</p>
<p>This extension allows the use of a special syntax in summaries, which
will be automatically expanded into links or any other arbitrary
expression, much like InterWiki does.</p>
<p>A few example patterns (link to bug tracking, etc.) that may be used
in your hgrc:</p>
<pre class="literal-block">
[interhg]
issues = s!issue(\d+)!<a href="http://bts/issue\1">issue\1</a>!
bugzilla = s!((?:bug|b=|(?=#?\d{4,}))(?:\s*#?)(\d+))!<a..=\2">\1</a>!i
boldify = s!(^|\s)#(\d+)\b! <b>#\2</b>!
</pre>
</div>
<div class="section" id="keyword">
<h2><a class="toc-backref" href="#id96">keyword</a></h2>
<p>expand keywords in tracked files</p>
<p>This extension expands RCS/CVS-like or self-customized $Keywords$ in
tracked text files selected by your configuration.</p>
<p>Keywords are only expanded in local repositories and not stored in the
change history. The mechanism can be regarded as a convenience for the
current user or for archive distribution.</p>
<p>Keywords expand to the changeset data pertaining to the latest change
relative to the working directory parent of each file.</p>
<p>Configuration is done in the [keyword], [keywordset] and [keywordmaps]
sections of hgrc files.</p>
<p>Example:</p>
<pre class="literal-block">
[keyword]
# expand keywords in every python file except those matching "x*"
**.py =
x* = ignore
[keywordset]
# prefer svn- over cvs-like default keywordmaps
svn = True
</pre>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">The more specific you are in your filename patterns the less you
lose speed in huge repositories.</p>
</div>
<p>For [keywordmaps] template mapping and expansion demonstration and
control run <a class="reference external" href="hg.1.html#kwdemo"><tt class="docutils literal">hg kwdemo</tt></a>. See <a class="reference external" href="hg.1.html#templates"><tt class="docutils literal">hg help templates</tt></a> for a list of
available templates and filters.</p>
<p>Three additional date template filters are provided:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name"><tt class="docutils literal">utcdate</tt>:</th><td class="field-body">"2006/09/18 15:13:13"</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">svnutcdate</tt>:</th><td class="field-body">"2006-09-18 15:13:13Z"</td>
</tr>
<tr class="field"><th class="field-name"><tt class="docutils literal">svnisodate</tt>:</th><td class="field-body">"2006-09-18 08:13:13 -700 (Mon, 18 Sep 2006)"</td>
</tr>
</tbody>
</table>
<p>The default template mappings (view with <a class="reference external" href="hg.1.html#kwdemo"><tt class="docutils literal">hg kwdemo <span class="pre">-d</span></tt></a>) can be
replaced with customized keywords and templates. Again, run
<a class="reference external" href="hg.1.html#kwdemo"><tt class="docutils literal">hg kwdemo</tt></a> to control the results of your configuration changes.</p>
<p>Before changing/disabling active keywords, you must run <a class="reference external" href="hg.1.html#kwshrink"><tt class="docutils literal">hg kwshrink</tt></a>
to avoid storing expanded keywords in the change history.</p>
<p>To force expansion after enabling it, or a configuration change, run
<a class="reference external" href="hg.1.html#kwexpand"><tt class="docutils literal">hg kwexpand</tt></a>.</p>
<p>Expansions spanning more than one line and incremental expansions,
like CVS' $Log$, are not supported. A keyword template map "Log =
{desc}" expands to the first line of the changeset description.</p>
<div class="section" id="id21">
<h3>Commands</h3>
<div class="section" id="kwdemo">
<h4>kwdemo</h4>
<pre class="literal-block">
hg kwdemo [-d] [-f RCFILE] [TEMPLATEMAP]...
</pre>
<p>Show current, custom, or default keyword template maps and their
expansions.</p>
<p>Extend the current configuration by specifying maps as arguments
and using -f/--rcfile to source an external hgrc file.</p>
<p>Use -d/--default to disable current configuration.</p>
<p>See <a class="reference external" href="hg.1.html#templates"><tt class="docutils literal">hg help templates</tt></a> for information on templates and filters.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--default</span></kbd></td>
<td>show default keyword template maps</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--rcfile</span></kbd></td>
<td>read maps from rcfile</td></tr>
</tbody>
</table>
</div>
<div class="section" id="kwexpand">
<h4>kwexpand</h4>
<pre class="literal-block">
hg kwexpand [OPTION]... [FILE]...
</pre>
<p>Run after (re)enabling keyword expansion.</p>
<p>kwexpand refuses to run if given files contain local changes.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="kwfiles">
<h4>kwfiles</h4>
<pre class="literal-block">
hg kwfiles [OPTION]... [FILE]...
</pre>
<p>List which files in the working directory are matched by the
[keyword] configuration patterns.</p>
<p>Useful to prevent inadvertent keyword expansion and to speed up
execution by including only files that are actual candidates for
expansion.</p>
<p>See <a class="reference external" href="hg.1.html#keyword"><tt class="docutils literal">hg help keyword</tt></a> on how to construct patterns both for
inclusion and exclusion of files.</p>
<p>With -A/--all and -v/--verbose the codes used to show the status
of files are:</p>
<pre class="literal-block">
K = keyword expansion candidate
k = keyword expansion candidate (not tracked)
I = ignored
i = ignored (not tracked)
</pre>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-A</span>, <span class="option">--all</span></kbd></td>
<td>show keyword status flags of all files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-i</span>, <span class="option">--ignore</span></kbd></td>
<td>show files excluded from expansion</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--unknown</span></kbd></td>
<td>only show unknown (not tracked) files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="kwshrink">
<h4>kwshrink</h4>
<pre class="literal-block">
hg kwshrink [OPTION]... [FILE]...
</pre>
<p>Must be run before changing/disabling active keywords.</p>
<p>kwshrink refuses to run if given files contain local changes.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="largefiles">
<h2><a class="toc-backref" href="#id97">largefiles</a></h2>
<p>track large binary files</p>
<p>Large binary files tend to be not very compressible, not very
diffable, and not at all mergeable. Such files are not handled
efficiently by Mercurial's storage format (revlog), which is based on
compressed binary deltas; storing large binary files as regular
Mercurial files wastes bandwidth and disk space and increases
Mercurial's memory usage. The largefiles extension addresses these
problems by adding a centralized client-server layer on top of
Mercurial: largefiles live in a <em>central store</em> out on the network
somewhere, and you only fetch the revisions that you need when you
need them.</p>
<p>largefiles works by maintaining a "standin file" in .hglf/ for each
largefile. The standins are small (41 bytes: an SHA-1 hash plus
newline) and are tracked by Mercurial. Largefile revisions are
identified by the SHA-1 hash of their contents, which is written to
the standin. largefiles uses that revision ID to get/put largefile
revisions from/to the central store. This saves both disk space and
bandwidth, since you don't need to retrieve all historical revisions
of large files when you clone or pull.</p>
<p>To start a new repository or add new large binary files, just add
--large to your <a class="reference external" href="hg.1.html#add"><tt class="docutils literal">hg add</tt></a> command. For example:</p>
<pre class="literal-block">
$ dd if=/dev/urandom of=randomdata count=2000
$ hg add --large randomdata
$ hg commit -m 'add randomdata as a largefile'
</pre>
<p>When you push a changeset that adds/modifies largefiles to a remote
repository, its largefile revisions will be uploaded along with it.
Note that the remote Mercurial must also have the largefiles extension
enabled for this to work.</p>
<p>When you pull a changeset that affects largefiles from a remote
repository, Mercurial behaves as normal. However, when you update to
such a revision, any largefiles needed by that revision are downloaded
and cached (if they have never been downloaded before). This means
that network access may be required to update to changesets you have
not previously updated to.</p>
<p>If you already have large files tracked by Mercurial without the
largefiles extension, you will need to convert your repository in
order to benefit from largefiles. This is done with the
<a class="reference external" href="hg.1.html#lfconvert"><tt class="docutils literal">hg lfconvert</tt></a> command:</p>
<pre class="literal-block">
$ hg lfconvert --size 10 oldrepo newrepo
</pre>
<p>In repositories that already have largefiles in them, any new file
over 10MB will automatically be added as a largefile. To change this
threshold, set <tt class="docutils literal">largefiles.minsize</tt> in your Mercurial config file
to the minimum size in megabytes to track as a largefile, or use the
--lfsize option to the add command (also in megabytes):</p>
<pre class="literal-block">
[largefiles]
minsize = 2
$ hg add --lfsize 2
</pre>
<p>The <tt class="docutils literal">largefiles.patterns</tt> config option allows you to specify a list
of filename patterns (see <a class="reference external" href="hg.1.html#patterns"><tt class="docutils literal">hg help patterns</tt></a>) that should always be
tracked as largefiles:</p>
<pre class="literal-block">
[largefiles]
patterns =
*.jpg
re:.*\.(png|bmp)$
library.zip
content/audio/*
</pre>
<p>Files that match one of these patterns will be added as largefiles
regardless of their size.</p>
<p>The <tt class="docutils literal">largefiles.minsize</tt> and <tt class="docutils literal">largefiles.patterns</tt> config options
will be ignored for any repositories not already containing a
largefile. To add the first largefile to a repository, you must
explicitly do so with the --large flag passed to the <a class="reference external" href="hg.1.html#add"><tt class="docutils literal">hg add</tt></a>
command.</p>
<div class="section" id="id22">
<h3>Commands</h3>
<div class="section" id="lfconvert">
<h4>lfconvert</h4>
<pre class="literal-block">
hg lfconvert SOURCE DEST [FILE ...]
</pre>
<p>Convert repository SOURCE to a new repository DEST, identical to
SOURCE except that certain files will be converted as largefiles:
specifically, any file that matches any PATTERN <em>or</em> whose size is
above the minimum size threshold is converted as a largefile. The
size used to determine whether or not to track a file as a
largefile is the size of the first version of the file. The
minimum size can be specified either with --size or in
configuration as <tt class="docutils literal">largefiles.size</tt>.</p>
<p>After running this command you will need to make sure that
largefiles is enabled anywhere you intend to push the new
repository.</p>
<p>Use --to-normal to convert largefiles back to normal files; after
this, the DEST repository can be used without largefiles at all.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--size</span></kbd></td>
<td>minimum size (MB) for files to be converted as largefiles</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--to-normal</span></kbd></td>
<td>convert from a largefiles repo to a normal repo</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="mq">
<h2><a class="toc-backref" href="#id98">mq</a></h2>
<p>manage a stack of patches</p>
<p>This extension lets you work with a stack of patches in a Mercurial
repository. It manages two stacks of patches - all known patches, and
applied patches (subset of known patches).</p>
<p>Known patches are represented as patch files in the .hg/patches
directory. Applied patches are both patch files and changesets.</p>
<p>Common tasks (use <a class="reference external" href="hg.1.html#command"><tt class="docutils literal">hg help command</tt></a> for more details):</p>
<pre class="literal-block">
create new patch qnew
import existing patch qimport
print patch series qseries
print applied patches qapplied
add known patch to applied stack qpush
remove patch from applied stack qpop
refresh contents of top applied patch qrefresh
</pre>
<p>By default, mq will automatically use git patches when required to
avoid losing file mode changes, copy records, binary files or empty
files creations or deletions. This behaviour can be configured with:</p>
<pre class="literal-block">
[mq]
git = auto/keep/yes/no
</pre>
<p>If set to 'keep', mq will obey the [diff] section configuration while
preserving existing git patches upon qrefresh. If set to 'yes' or
'no', mq will override the [diff] section and always generate git or
regular patches, possibly losing data in the second case.</p>
<p>It may be desirable for mq changesets to be kept in the secret phase (see
<a class="reference external" href="hg.1.html#phases"><tt class="docutils literal">hg help phases</tt></a>), which can be enabled with the following setting:</p>
<pre class="literal-block">
[mq]
secret = True
</pre>
<p>You will by default be managing a patch queue named "patches". You can
create other, independent patch queues with the <a class="reference external" href="hg.1.html#qqueue"><tt class="docutils literal">hg qqueue</tt></a> command.</p>
<div class="section" id="id23">
<h3>Commands</h3>
<div class="section" id="qapplied">
<h4>qapplied</h4>
<pre class="literal-block">
hg qapplied [-1] [-s] [PATCH]
</pre>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-1</span>, <span class="option">--last</span></kbd></td>
<td>show only the preceding applied patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--summary</span></kbd></td>
<td>print first line of patch header</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qclone">
<h4>qclone</h4>
<pre class="literal-block">
hg qclone [OPTION]... SOURCE [DEST]
</pre>
<p>If source is local, destination will have no patches applied. If
source is remote, this command can not check if patches are
applied in source, so cannot guarantee that patches are not
applied in destination. If you clone remote repository, be sure
before that it has no patches applied.</p>
<p>Source patch repository is looked for in <src>/.hg/patches by
default. Use -p <url> to change.</p>
<p>The patch directory must be a nested Mercurial repository, as
would be created by <a class="reference external" href="hg.1.html#init"><tt class="docutils literal">hg init <span class="pre">--mq</span></tt></a>.</p>
<p>Return 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">--pull</span></kbd></td>
<td>use pull protocol to copy metadata</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-U</span>, <span class="option">--noupdate</span></kbd></td>
<td>do not update the new working directories</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--uncompressed</span></kbd></td>
<td>use uncompressed transfer (fast over LAN)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--patches</span></kbd></td>
<td>location of source patch repository</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--insecure</span></kbd></td>
<td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qcommit">
<h4>qcommit</h4>
<pre class="literal-block">
hg qcommit [OPTION]... [FILE]...
</pre>
<p>This command is deprecated; use <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit <span class="pre">--mq</span></tt></a> instead.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-A</span>, <span class="option">--addremove</span></kbd></td>
</tr>
<tr><td> </td><td>mark new/missing files as added/removed before committing</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--close-branch</span></kbd></td>
<td>mark a branch as closed, hiding it from the branch list</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--amend</span></kbd></td>
<td>amend the parent of the working dir</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>record the specified date as commit date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>record the specified user as committer</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td>
<td><p class="first">recurse into subrepositories</p>
<p class="last">aliases: qci</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qdelete">
<h4>qdelete</h4>
<pre class="literal-block">
hg qdelete [-k] [PATCH]...
</pre>
<p>The patches must not be applied, and at least one patch is required. Exact
patch identifiers must be given. With -k/--keep, the patch files are
preserved in the patch directory.</p>
<p>To stop managing a patch and move it into permanent history,
use the <a class="reference external" href="hg.1.html#qfinish"><tt class="docutils literal">hg qfinish</tt></a> command.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-k</span>, <span class="option">--keep</span></kbd></td>
<td>keep patch file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td><p class="first">stop managing a revision (DEPRECATED)</p>
<p class="last">aliases: qremove qrm</p>
</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qdiff">
<h4>qdiff</h4>
<pre class="literal-block">
hg qdiff [OPTION]... [FILE]...
</pre>
<p>Shows a diff which includes the current patch as well as any
changes which have been made in the working directory since the
last refresh (thus showing what the current patch would become
after a qrefresh).</p>
<p>Use <a class="reference external" href="hg.1.html#diff"><tt class="docutils literal">hg diff</tt></a> if you only want to see the changes made since the
last qrefresh, or <a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg export qtip</tt></a> if you want to see changes
made by the current patch without including changes made since the
qrefresh.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--text</span></kbd></td>
<td>treat all files as text</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--nodates</span></kbd></td>
<td>omit dates from diff headers</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-p</span>, <span class="option">--show-function</span></kbd></td>
</tr>
<tr><td> </td><td>show which function each change is in</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--reverse</span></kbd></td>
<td>produce a diff that undoes the changes</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-w</span>, <span class="option">--ignore-all-space</span></kbd></td>
</tr>
<tr><td> </td><td>ignore white space when comparing lines</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-b</span>, <span class="option">--ignore-space-change</span></kbd></td>
</tr>
<tr><td> </td><td>ignore changes in the amount of white space</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-B</span>, <span class="option">--ignore-blank-lines</span></kbd></td>
</tr>
<tr><td> </td><td>ignore changes whose lines are all blank</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-U</span>, <span class="option">--unified</span></kbd></td>
<td>number of lines of context to show</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--stat</span></kbd></td>
<td>output diffstat-style summary of changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qfinish">
<h4>qfinish</h4>
<pre class="literal-block">
hg qfinish [-a] [REV]...
</pre>
<p>Finishes the specified revisions (corresponding to applied
patches) by moving them out of mq control into regular repository
history.</p>
<p>Accepts a revision range or the -a/--applied option. If --applied
is specified, all applied mq revisions are removed from mq
control. Otherwise, the given revisions must be at the base of the
stack of applied patches.</p>
<p>This can be especially useful if your changes have been applied to
an upstream repository, or if you are about to push your changes
to upstream.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--applied</span></kbd></td>
<td>finish all applied changesets</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qfold">
<h4>qfold</h4>
<pre class="literal-block">
hg qfold [-e] [-k] [-m TEXT] [-l FILE] PATCH...
</pre>
<p>Patches must not yet be applied. Each patch will be successively
applied to the current patch in the order given. If all the
patches apply successfully, the current patch will be refreshed
with the new cumulative patch, and the folded patches will be
deleted. With -k/--keep, the folded patch files will not be
removed afterwards.</p>
<p>The header for each folded patch will be concatenated with the
current patch header, separated by a line of <tt class="docutils literal">* * *</tt>.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
<td>edit patch header</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-k</span>, <span class="option">--keep</span></kbd></td>
<td>keep folded patch files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qgoto">
<h4>qgoto</h4>
<pre class="literal-block">
hg qgoto [OPTION]... PATCH
</pre>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>overwrite any local changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--no-backup</span></kbd></td>
<td>do not save backup copies of files</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qguard">
<h4>qguard</h4>
<pre class="literal-block">
hg qguard [-l] [-n] [PATCH] [-- [+GUARD]... [-GUARD]...]
</pre>
<p>Guards control whether a patch can be pushed. A patch with no
guards is always pushed. A patch with a positive guard ("+foo") is
pushed only if the <a class="reference external" href="hg.1.html#qselect"><tt class="docutils literal">hg qselect</tt></a> command has activated it. A patch with
a negative guard ("-foo") is never pushed if the <a class="reference external" href="hg.1.html#qselect"><tt class="docutils literal">hg qselect</tt></a> command
has activated it.</p>
<p>With no arguments, print the currently active guards.
With arguments, set guards for the named patch.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">Specifying negative guards now requires '--'.</p>
</div>
<p>To set guards on another patch:</p>
<pre class="literal-block">
hg qguard other.patch -- +2.6.17 -stable
</pre>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--list</span></kbd></td>
<td>list all patches and guards</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--none</span></kbd></td>
<td>drop all guards</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qheader">
<h4>qheader</h4>
<pre class="literal-block">
hg qheader [PATCH]
</pre>
<p>Returns 0 on success.</p>
</div>
<div class="section" id="qimport">
<h4>qimport</h4>
<pre class="literal-block">
hg qimport [-e] [-n NAME] [-f] [-g] [-P] [-r REV]... FILE...
</pre>
<p>The patch is inserted into the series after the last applied
patch. If no patches have been applied, qimport prepends the patch
to the series.</p>
<p>The patch will have the same name as its source file unless you
give it a new one with -n/--name.</p>
<p>You can register an existing patch inside the patch directory with
the -e/--existing flag.</p>
<p>With -f/--force, an existing patch of the same name will be
overwritten.</p>
<p>An existing changeset may be placed under mq control with -r/--rev
(e.g. qimport --rev tip -n patch will place tip under mq control).
With -g/--git, patches imported with --rev will use the git diff
format. See the diffs help topic for information on why this is
important for preserving rename/copy information and permission
changes. Use <a class="reference external" href="hg.1.html#qfinish"><tt class="docutils literal">hg qfinish</tt></a> to remove changesets from mq control.</p>
<p>To import a patch from standard input, pass - as the patch file.
When importing from standard input, a patch name must be specified
using the --name flag.</p>
<p>To import an existing patch while renaming it:</p>
<pre class="literal-block">
hg qimport -e existing-patch -n new-name
</pre>
<p>Returns 0 if import succeeded.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--existing</span></kbd></td>
<td>import file in patch directory</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--name</span></kbd></td>
<td>name of patch file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>overwrite existing files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>place existing revisions under mq control</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-P</span>, <span class="option">--push</span></kbd></td>
<td>qpush after importing</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qinit">
<h4>qinit</h4>
<pre class="literal-block">
hg qinit [-c]
</pre>
<p>The queue repository is unversioned by default. If
-c/--create-repo is specified, qinit will create a separate nested
repository for patches (qinit -c may also be run later to convert
an unversioned patch repository into a versioned one). You can use
qcommit to commit changes to this queue repository.</p>
<p>This command is deprecated. Without -c, it's implied by other relevant
commands. With -c, use <a class="reference external" href="hg.1.html#init"><tt class="docutils literal">hg init <span class="pre">--mq</span></tt></a> instead.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-c</span>, <span class="option">--create-repo</span></kbd></td>
</tr>
<tr><td> </td><td>create queue repository</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qnew">
<h4>qnew</h4>
<pre class="literal-block">
hg qnew [-e] [-m TEXT] [-l FILE] PATCH [FILE]...
</pre>
<p>qnew creates a new patch on top of the currently-applied patch (if
any). The patch will be initialized with any outstanding changes
in the working directory. You may also use -I/--include,
-X/--exclude, and/or a list of files after the patch name to add
only changes to matching files to the new patch, leaving the rest
as uncommitted modifications.</p>
<p>-u/--user and -d/--date can be used to set the (given) user and
date, respectively. -U/--currentuser and -D/--currentdate set user
to current user and date to current date.</p>
<p>-e/--edit, -m/--message or -l/--logfile set the patch header as
well as the commit message. If none is specified, the header is
empty and the commit message is '[mq]: PATCH'.</p>
<p>Use the -g/--git option to keep the patch in the git extended diff
format. Read the diffs help topic for more information on why this
is important for preserving permission changes and copy/rename
information.</p>
<p>Returns 0 on successful creation of a new patch.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
<td>edit commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>import uncommitted changes (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-U</span>, <span class="option">--currentuser</span></kbd></td>
</tr>
<tr><td> </td><td>add "From: <current user>" to patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>add "From: <USER>" to patch</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-D</span>, <span class="option">--currentdate</span></kbd></td>
</tr>
<tr><td> </td><td>add "Date: <current date>" to patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>add "Date: <DATE>" to patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qnext">
<h4>qnext</h4>
<pre class="literal-block">
hg qnext [-s]
</pre>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--summary</span></kbd></td>
<td>print first line of patch header</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qpop">
<h4>qpop</h4>
<pre class="literal-block">
hg qpop [-a] [-f] [PATCH | INDEX]
</pre>
<p>By default, pops off the top of the patch stack. If given a patch
name, keeps popping off patches until the named patch is at the
top of the stack.</p>
<p>Return 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--all</span></kbd></td>
<td>pop all patches</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--name</span></kbd></td>
<td>queue name to pop (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>forget any local changes to patched files</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--no-backup</span></kbd></td>
<td>do not save backup copies of files</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qprev">
<h4>qprev</h4>
<pre class="literal-block">
hg qprev [-s]
</pre>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--summary</span></kbd></td>
<td>print first line of patch header</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qpush">
<h4>qpush</h4>
<pre class="literal-block">
hg qpush [-f] [-l] [-a] [--move] [PATCH | INDEX]
</pre>
<p>When -f/--force is applied, all local changes in patched files
will be lost.</p>
<p>Return 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>apply on top of local changes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--exact</span></kbd></td>
<td>apply the target patch to its recorded parent</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--list</span></kbd></td>
<td>list patch name in commit text</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--all</span></kbd></td>
<td>apply all patches</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--merge</span></kbd></td>
<td>merge from another queue (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--name</span></kbd></td>
<td>merge queue name (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--move</span></kbd></td>
<td>reorder patch series and apply only the patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--no-backup</span></kbd></td>
<td>do not save backup copies of files</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qqueue">
<h4>qqueue</h4>
<pre class="literal-block">
hg qqueue [OPTION] [QUEUE]
</pre>
<p>Supports switching between different patch queues, as well as creating
new patch queues and deleting existing ones.</p>
<p>Omitting a queue name or specifying -l/--list will show you the registered
queues - by default the "normal" patches queue is registered. The currently
active queue will be marked with "(active)". Specifying --active will print
only the name of the active queue.</p>
<p>To create a new queue, use -c/--create. The queue is automatically made
active, except in the case where there are applied patches from the
currently active queue in the repository. Then the queue will only be
created and switching will fail.</p>
<p>To delete an existing queue, use --delete. You cannot delete the currently
active queue.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--list</span></kbd></td>
<td>list all available queues</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--active</span></kbd></td>
<td>print name of active queue</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--create</span></kbd></td>
<td>create new queue</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--rename</span></kbd></td>
<td>rename active queue</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--delete</span></kbd></td>
<td>delete reference to queue</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--purge</span></kbd></td>
<td>delete queue, and remove patch dir</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qrefresh">
<h4>qrefresh</h4>
<pre class="literal-block">
hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...
</pre>
<p>If any file patterns are provided, the refreshed patch will
contain only the modifications that match those patterns; the
remaining modifications will remain in the working directory.</p>
<p>If -s/--short is specified, files currently included in the patch
will be refreshed just like matched files and remain in the patch.</p>
<p>If -e/--edit is specified, Mercurial will start your configured editor for
you to enter a message. In case qrefresh fails, you will find a backup of
your message in <tt class="docutils literal"><span class="pre">.hg/last-message.txt</span></tt>.</p>
<p>hg add/remove/copy/rename work as usual, though you might want to
use git-style patches (-g/--git or [diff] git=1) to track copies
and renames. See the diffs help topic for more information on the
git diff format.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
<td>edit commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--short</span></kbd></td>
<td>refresh only files already in the patch and specified files</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-U</span>, <span class="option">--currentuser</span></kbd></td>
</tr>
<tr><td> </td><td>add/update author field in patch with current user</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>add/update author field in patch with given user</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-D</span>, <span class="option">--currentdate</span></kbd></td>
</tr>
<tr><td> </td><td>add/update date field in patch with current date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>add/update date field in patch with given date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qrename">
<h4>qrename</h4>
<pre class="literal-block">
hg qrename PATCH1 [PATCH2]
</pre>
<p>With one argument, renames the current patch to PATCH1.
With two arguments, renames PATCH1 to PATCH2.</p>
<p>Returns 0 on success.</p>
<blockquote>
aliases: qmv</blockquote>
</div>
<div class="section" id="qrestore">
<h4>qrestore</h4>
<pre class="literal-block">
hg qrestore [-d] [-u] REV
</pre>
<p>This command is deprecated, use <a class="reference external" href="hg.1.html#rebase"><tt class="docutils literal">hg rebase</tt></a> instead.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--delete</span></kbd></td>
<td>delete save entry</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--update</span></kbd></td>
<td>update queue working directory</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qsave">
<h4>qsave</h4>
<pre class="literal-block">
hg qsave [-m TEXT] [-l FILE] [-c] [-n NAME] [-e] [-f]
</pre>
<p>This command is deprecated, use <a class="reference external" href="hg.1.html#rebase"><tt class="docutils literal">hg rebase</tt></a> instead.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--copy</span></kbd></td>
<td>copy patch directory</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--name</span></kbd></td>
<td>copy directory name</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--empty</span></kbd></td>
<td>clear queue status file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>force copy</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qselect">
<h4>qselect</h4>
<pre class="literal-block">
hg qselect [OPTION]... [GUARD]...
</pre>
<p>Use the <a class="reference external" href="hg.1.html#qguard"><tt class="docutils literal">hg qguard</tt></a> command to set or print guards on patch, then use
qselect to tell mq which guards to use. A patch will be pushed if
it has no guards or any positive guards match the currently
selected guard, but will not be pushed if any negative guards
match the current guard. For example:</p>
<pre class="literal-block">
qguard foo.patch -- -stable (negative guard)
qguard bar.patch +stable (positive guard)
qselect stable
</pre>
<p>This activates the "stable" guard. mq will skip foo.patch (because
it has a negative match) but push bar.patch (because it has a
positive match).</p>
<p>With no arguments, prints the currently active guards.
With one argument, sets the active guard.</p>
<p>Use -n/--none to deactivate guards (no other arguments needed).
When no guards are active, patches with positive guards are
skipped and patches with negative guards are pushed.</p>
<p>qselect can change the guards on applied patches. It does not pop
guarded patches by default. Use --pop to pop back to the last
applied patch that is not guarded. Use --reapply (which implies
--pop) to push back to the current patch afterwards, but skip
guarded patches.</p>
<p>Use -s/--series to print a list of all guards in the series file
(no other arguments needed). Use -v for more information.</p>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--none</span></kbd></td>
<td>disable all guards</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--series</span></kbd></td>
<td>list all guards in series file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--pop</span></kbd></td>
<td>pop to before first guarded applied patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--reapply</span></kbd></td>
<td>pop, then reapply patches</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qseries">
<h4>qseries</h4>
<pre class="literal-block">
hg qseries [-ms]
</pre>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--missing</span></kbd></td>
<td>print patches not in series</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--summary</span></kbd></td>
<td>print first line of patch header</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qtop">
<h4>qtop</h4>
<pre class="literal-block">
hg qtop [-s]
</pre>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--summary</span></kbd></td>
<td>print first line of patch header</td></tr>
</tbody>
</table>
</div>
<div class="section" id="qunapplied">
<h4>qunapplied</h4>
<pre class="literal-block">
hg qunapplied [-1] [-s] [PATCH]
</pre>
<p>Returns 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-1</span>, <span class="option">--first</span></kbd></td>
<td>show only the first patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--summary</span></kbd></td>
<td>print first line of patch header</td></tr>
</tbody>
</table>
</div>
<div class="section" id="strip">
<h4>strip</h4>
<pre class="literal-block">
hg strip [-k] [-f] [-n] REV...
</pre>
<p>The strip command removes the specified changesets and all their
descendants. If the working directory has uncommitted changes, the
operation is aborted unless the --force flag is supplied, in which
case changes will be discarded.</p>
<p>If a parent of the working directory is stripped, then the working
directory will automatically be updated to the most recent
available ancestor of the stripped parent after the operation
completes.</p>
<p>Any stripped changesets are stored in <tt class="docutils literal"><span class="pre">.hg/strip-backup</span></tt> as a
bundle (see <a class="reference external" href="hg.1.html#bundle"><tt class="docutils literal">hg help bundle</tt></a> and <a class="reference external" href="hg.1.html#unbundle"><tt class="docutils literal">hg help unbundle</tt></a>). They can
be restored by running <a class="reference external" href="hg.1.html#unbundle"><tt class="docutils literal">hg unbundle <span class="pre">.hg/strip-backup/BUNDLE</span></tt></a>,
where BUNDLE is the bundle file created by the strip. Note that
the local revision numbers will in general be different after the
restore.</p>
<p>Use the --no-backup option to discard the backup bundle once the
operation completes.</p>
<p>Return 0 on success.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>strip specified revision (optional, can specify revisions without this option)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--force</span></kbd></td>
<td>force removal of changesets, discard uncommitted changes (no backup)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--backup</span></kbd></td>
<td>bundle only changesets with local revision number greater than REV which are not descendants of REV (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--no-backup</span></kbd></td>
<td>no backups</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--nobackup</span></kbd></td>
<td>no backups (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span></kbd></td>
<td>ignored (DEPRECATED)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-k</span>, <span class="option">--keep</span></kbd></td>
<td>do not modify working copy during strip</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="notify">
<h2><a class="toc-backref" href="#id99">notify</a></h2>
<p>hooks for sending email push notifications</p>
<p>This extension let you run hooks sending email notifications when
changesets are being pushed, from the sending or receiving side.</p>
<p>First, enable the extension as explained in <a class="reference external" href="hg.1.html#extensions"><tt class="docutils literal">hg help extensions</tt></a>, and
register the hook you want to run. <tt class="docutils literal">incoming</tt> and <tt class="docutils literal">changegroup</tt> hooks
are run by the changesets receiver while the <tt class="docutils literal">outgoing</tt> one is for
the sender:</p>
<pre class="literal-block">
[hooks]
# one email for each incoming changeset
incoming.notify = python:hgext.notify.hook
# one email for all incoming changesets
changegroup.notify = python:hgext.notify.hook
# one email for all outgoing changesets
outgoing.notify = python:hgext.notify.hook
</pre>
<p>Now the hooks are running, subscribers must be assigned to
repositories. Use the <tt class="docutils literal">[usersubs]</tt> section to map repositories to a
given email or the <tt class="docutils literal">[reposubs]</tt> section to map emails to a single
repository:</p>
<pre class="literal-block">
[usersubs]
# key is subscriber email, value is a comma-separated list of glob
# patterns
user@host = pattern
[reposubs]
# key is glob pattern, value is a comma-separated list of subscriber
# emails
pattern = user@host
</pre>
<p>Glob patterns are matched against absolute path to repository
root. The subscriptions can be defined in their own file and
referenced with:</p>
<pre class="literal-block">
[notify]
config = /path/to/subscriptionsfile
</pre>
<p>Alternatively, they can be added to Mercurial configuration files by
setting the previous entry to an empty value.</p>
<p>At this point, notifications should be generated but will not be sent until you
set the <tt class="docutils literal">notify.test</tt> entry to <tt class="docutils literal">False</tt>.</p>
<p>Notifications content can be tweaked with the following configuration entries:</p>
<dl class="docutils">
<dt>notify.test</dt>
<dd>If <tt class="docutils literal">True</tt>, print messages to stdout instead of sending them. Default: True.</dd>
<dt>notify.sources</dt>
<dd>Space separated list of change sources. Notifications are sent only
if it includes the incoming or outgoing changes source. Incoming
sources can be <tt class="docutils literal">serve</tt> for changes coming from http or ssh,
<tt class="docutils literal">pull</tt> for pulled changes, <tt class="docutils literal">unbundle</tt> for changes added by
<a class="reference external" href="hg.1.html#unbundle"><tt class="docutils literal">hg unbundle</tt></a> or <tt class="docutils literal">push</tt> for changes being pushed
locally. Outgoing sources are the same except for <tt class="docutils literal">unbundle</tt> which
is replaced by <tt class="docutils literal">bundle</tt>. Default: serve.</dd>
<dt>notify.strip</dt>
<dd>Number of leading slashes to strip from url paths. By default, notifications
references repositories with their absolute path. <tt class="docutils literal">notify.strip</tt> let you
turn them into relative paths. For example, <tt class="docutils literal">notify.strip=3</tt> will change
<tt class="docutils literal">/long/path/repository</tt> into <tt class="docutils literal">repository</tt>. Default: 0.</dd>
<dt>notify.domain</dt>
<dd>If subscribers emails or the from email have no domain set, complete them
with this value.</dd>
<dt>notify.style</dt>
<dd>Style file to use when formatting emails.</dd>
<dt>notify.template</dt>
<dd>Template to use when formatting emails.</dd>
<dt>notify.incoming</dt>
<dd>Template to use when run as incoming hook, override <tt class="docutils literal">notify.template</tt>.</dd>
<dt>notify.outgoing</dt>
<dd>Template to use when run as outgoing hook, override <tt class="docutils literal">notify.template</tt>.</dd>
<dt>notify.changegroup</dt>
<dd>Template to use when running as changegroup hook, override
<tt class="docutils literal">notify.template</tt>.</dd>
<dt>notify.maxdiff</dt>
<dd>Maximum number of diff lines to include in notification email. Set to 0
to disable the diff, -1 to include all of it. Default: 300.</dd>
<dt>notify.maxsubject</dt>
<dd>Maximum number of characters in emails subject line. Default: 67.</dd>
<dt>notify.diffstat</dt>
<dd>Set to True to include a diffstat before diff content. Default: True.</dd>
<dt>notify.merge</dt>
<dd>If True, send notifications for merge changesets. Default: True.</dd>
<dt>notify.mbox</dt>
<dd>If set, append mails to this mbox file instead of sending. Default: None.</dd>
<dt>notify.fromauthor</dt>
<dd>If set, use the first committer of the changegroup for the "From" field of
the notification mail. If not set, take the user from the pushing repo.
Default: False.</dd>
</dl>
<p>If set, the following entries will also be used to customize the notifications:</p>
<dl class="docutils">
<dt>email.from</dt>
<dd>Email <tt class="docutils literal">From</tt> address to use if none can be found in generated email content.</dd>
<dt>web.baseurl</dt>
<dd>Root repository browsing URL to combine with repository paths when making
references. See also <tt class="docutils literal">notify.strip</tt>.</dd>
</dl>
</div>
<div class="section" id="pager">
<h2><a class="toc-backref" href="#id100">pager</a></h2>
<p>browse command output with an external pager</p>
<p>To set the pager that should be used, set the application variable:</p>
<pre class="literal-block">
[pager]
pager = less -FRSX
</pre>
<p>If no pager is set, the pager extensions uses the environment variable
$PAGER. If neither pager.pager, nor $PAGER is set, no pager is used.</p>
<p>You can disable the pager for certain commands by adding them to the
pager.ignore list:</p>
<pre class="literal-block">
[pager]
ignore = version, help, update
</pre>
<p>You can also enable the pager only for certain commands using
pager.attend. Below is the default list of commands to be paged:</p>
<pre class="literal-block">
[pager]
attend = annotate, cat, diff, export, glog, log, qdiff
</pre>
<p>Setting pager.attend to an empty value will cause all commands to be
paged.</p>
<p>If pager.attend is present, pager.ignore will be ignored.</p>
<p>To ignore global commands like <a class="reference external" href="hg.1.html#version"><tt class="docutils literal">hg version</tt></a> or <a class="reference external" href="hg.1.html#help"><tt class="docutils literal">hg help</tt></a>, you have
to specify them in your user configuration file.</p>
<p>The --pager=... option can also be used to control when the pager is
used. Use a boolean value like yes, no, on, off, or use auto for
normal behavior.</p>
</div>
<div class="section" id="patchbomb">
<h2><a class="toc-backref" href="#id101">patchbomb</a></h2>
<p>command to send changesets as (a series of) patch emails</p>
<p>The series is started off with a "[PATCH 0 of N]" introduction, which
describes the series as a whole.</p>
<p>Each patch email has a Subject line of "[PATCH M of N] ...", using the
first line of the changeset description as the subject text. The
message contains two or three body parts:</p>
<ul class="simple">
<li>The changeset description.</li>
<li>[Optional] The result of running diffstat on the patch.</li>
<li>The patch itself, as generated by <a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg export</tt></a>.</li>
</ul>
<p>Each message refers to the first in the series using the In-Reply-To
and References headers, so they will show up as a sequence in threaded
mail and news readers, and in mail archives.</p>
<p>To configure other defaults, add a section like this to your
configuration file:</p>
<pre class="literal-block">
[email]
from = My Name <my@email>
to = recipient1, recipient2, ...
cc = cc1, cc2, ...
bcc = bcc1, bcc2, ...
reply-to = address1, address2, ...
</pre>
<p>Use <tt class="docutils literal">[patchbomb]</tt> as configuration section name if you need to
override global <tt class="docutils literal">[email]</tt> address settings.</p>
<p>Then you can use the <a class="reference external" href="hg.1.html#email"><tt class="docutils literal">hg email</tt></a> command to mail a series of
changesets as a patchbomb.</p>
<p>You can also either configure the method option in the email section
to be a sendmail compatible mailer or fill out the [smtp] section so
that the patchbomb extension can automatically send patchbombs
directly from the commandline. See the [email] and [smtp] sections in
hgrc(5) for details.</p>
<div class="section" id="id24">
<h3>Commands</h3>
<div class="section" id="email">
<h4>email</h4>
<pre class="literal-block">
hg email [OPTION]... [DEST]...
</pre>
<p>By default, diffs are sent in the format generated by
<a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg export</tt></a>, one per message. The series starts with a "[PATCH 0
of N]" introduction, which describes the series as a whole.</p>
<p>Each patch email has a Subject line of "[PATCH M of N] ...", using
the first line of the changeset description as the subject text.
The message contains two or three parts. First, the changeset
description.</p>
<p>With the -d/--diffstat option, if the diffstat program is
installed, the result of running diffstat on the patch is inserted.</p>
<p>Finally, the patch itself, as generated by <a class="reference external" href="hg.1.html#export"><tt class="docutils literal">hg export</tt></a>.</p>
<p>With the -d/--diffstat or -c/--confirm options, you will be presented
with a final summary of all messages and asked for confirmation before
the messages are sent.</p>
<p>By default the patch is included as text in the email body for
easy reviewing. Using the -a/--attach option will instead create
an attachment for the patch. With -i/--inline an inline attachment
will be created. You can include a patch both as text in the email
body and as a regular or an inline attachment by combining the
-a/--attach or -i/--inline with the --body option.</p>
<p>With -o/--outgoing, emails will be generated for patches not found
in the destination repository (or only those which are ancestors
of the specified revisions if any are provided)</p>
<p>With -b/--bundle, changesets are selected as for --outgoing, but a
single email containing a binary Mercurial bundle as an attachment
will be sent.</p>
<p>With -m/--mbox, instead of previewing each patchbomb message in a
pager or sending the messages directly, it will create a UNIX
mailbox file with the patch emails. This mailbox file can be
previewed with any mail user agent which supports UNIX mbox
files.</p>
<p>With -n/--test, all steps will run, but mail will not be sent.
You will be prompted for an email recipient address, a subject and
an introductory message describing the patches of your patchbomb.
Then when all is done, patchbomb messages are displayed. If the
PAGER environment variable is set, your pager will be fired up once
for each patchbomb message, so you can verify everything is alright.</p>
<p>In case email sending fails, you will find a backup of your series
introductory message in <tt class="docutils literal"><span class="pre">.hg/last-email.txt</span></tt>.</p>
<p>Examples:</p>
<pre class="literal-block">
hg email -r 3000 # send patch 3000 only
hg email -r 3000 -r 3001 # send patches 3000 and 3001
hg email -r 3000:3005 # send patches 3000 through 3005
hg email 3000 # send patch 3000 (deprecated)
hg email -o # send all patches not in default
hg email -o DEST # send all patches not in DEST
hg email -o -r 3000 # send all ancestors of 3000 not in default
hg email -o -r 3000 DEST # send all ancestors of 3000 not in DEST
hg email -b # send bundle of all patches not in default
hg email -b DEST # send bundle of all patches not in DEST
hg email -b -r 3000 # bundle of all ancestors of 3000 not in default
hg email -b -r 3000 DEST # bundle of all ancestors of 3000 not in DEST
hg email -o -m mbox && # generate an mbox file...
mutt -R -f mbox # ... and view it with mutt
hg email -o -m mbox && # generate an mbox file ...
formail -s sendmail \ # ... and use formail to send from the mbox
-bm -t < mbox # ... using sendmail
</pre>
<p>Before using this command, you will need to enable email in your
hgrc. See the [email] section in hgrc(5) for details.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-g</span>, <span class="option">--git</span></kbd></td>
<td>use git extended diff format</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--plain</span></kbd></td>
<td>omit hg patch header</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-o</span>, <span class="option">--outgoing</span></kbd></td>
<td>send changes not found in the target repository</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--bundle</span></kbd></td>
<td>send changes not in target as a binary bundle</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--bundlename</span></kbd></td>
<td>name of the bundle attachment file (default: bundle)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>a revision to send</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--force</span></kbd></td>
<td>run even when remote repository is unrelated (with -b/--bundle)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--base</span></kbd></td>
<td>a base changeset to specify instead of a destination (with -b/--bundle)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--intro</span></kbd></td>
<td>send an introduction email for a single patch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--body</span></kbd></td>
<td>send patches as inline message text (default)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--attach</span></kbd></td>
<td>send patches as attachments</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-i</span>, <span class="option">--inline</span></kbd></td>
<td>send patches as inline attachments</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--bcc</span></kbd></td>
<td>email addresses of blind carbon copy recipients</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--cc</span></kbd></td>
<td>email addresses of copy recipients</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--confirm</span></kbd></td>
<td>ask for confirmation before sending</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--diffstat</span></kbd></td>
<td>add diffstat output to messages</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--date</span></kbd></td>
<td>use the given date as the sending date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--desc</span></kbd></td>
<td>use the given file as the series description</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-f</span>, <span class="option">--from</span></kbd></td>
<td>email address of sender</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-n</span>, <span class="option">--test</span></kbd></td>
<td>print messages that would be sent</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--mbox</span></kbd></td>
<td>write messages to mbox file instead of sending them</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--reply-to</span></kbd></td>
<td>email addresses replies should be sent to</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--subject</span></kbd></td>
<td>subject of first message (intro or single patch)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--in-reply-to</span></kbd></td>
<td>message identifier to reply to</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--flag</span></kbd></td>
<td>flags to add in subject prefixes</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--to</span></kbd></td>
<td>email addresses of recipients</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--ssh</span></kbd></td>
<td>specify ssh command to use</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--remotecmd</span></kbd></td>
<td>specify hg command to run on the remote side</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--insecure</span></kbd></td>
<td>do not verify server certificate (ignoring web.cacerts config)</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="progress">
<h2><a class="toc-backref" href="#id102">progress</a></h2>
<p>show progress bars for some actions</p>
<p>This extension uses the progress information logged by hg commands
to draw progress bars that are as informative as possible. Some progress
bars only offer indeterminate information, while others have a definite
end point.</p>
<p>The following settings are available:</p>
<pre class="literal-block">
[progress]
delay = 3 # number of seconds (float) before showing the progress bar
changedelay = 1 # changedelay: minimum delay before showing a new topic.
# If set to less than 3 * refresh, that value will
# be used instead.
refresh = 0.1 # time in seconds between refreshes of the progress bar
format = topic bar number estimate # format of the progress bar
width = <none> # if set, the maximum width of the progress information
# (that is, min(width, term width) will be used)
clear-complete = True # clear the progress bar after it's done
disable = False # if true, don't show a progress bar
assume-tty = False # if true, ALWAYS show a progress bar, unless
# disable is given
</pre>
<p>Valid entries for the format field are topic, bar, number, unit,
estimate, speed, and item. item defaults to the last 20 characters of
the item, but this can be changed by adding either <tt class="docutils literal"><span class="pre">-<num></span></tt> which
would take the last num characters, or <tt class="docutils literal">+<num></tt> for the first num
characters.</p>
</div>
<div class="section" id="purge">
<h2><a class="toc-backref" href="#id103">purge</a></h2>
<p>command to delete untracked files from the working directory</p>
<div class="section" id="id25">
<h3>Commands</h3>
<div class="section" id="id26">
<h4>purge</h4>
<pre class="literal-block">
hg purge [OPTION]... [DIR]...
</pre>
<p>Delete files not known to Mercurial. This is useful to test local
and uncommitted changes in an otherwise-clean source tree.</p>
<p>This means that purge will delete:</p>
<ul class="simple">
<li>Unknown files: files marked with "?" by <a class="reference external" href="hg.1.html#status"><tt class="docutils literal">hg status</tt></a></li>
<li>Empty directories: in fact Mercurial ignores directories unless
they contain files under source control management</li>
</ul>
<p>But it will leave untouched:</p>
<ul class="simple">
<li>Modified and unmodified tracked files</li>
<li>Ignored files (unless --all is specified)</li>
<li>New files added to the repository (with <a class="reference external" href="hg.1.html#add"><tt class="docutils literal">hg add</tt></a>)</li>
</ul>
<p>If directories are given on the command line, only files in these
directories are considered.</p>
<p>Be careful with purge, as you could irreversibly delete some files
you forgot to add to the repository. If you only want to print the
list of files that this program would delete, use the --print
option.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-a</span>, <span class="option">--abort-on-err</span></kbd></td>
</tr>
<tr><td> </td><td>abort if an error occurs</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--all</span></kbd></td>
<td>purge ignored files too</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--print</span></kbd></td>
<td>print filenames instead of deleting them</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-0</span>, <span class="option">--print0</span></kbd></td>
<td>end filenames with NUL, for use with xargs (implies -p/--print)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td><p class="first">exclude names matching the given patterns</p>
<p class="last">aliases: clean</p>
</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="rebase">
<h2><a class="toc-backref" href="#id104">rebase</a></h2>
<p>command to move sets of revisions to a different ancestor</p>
<p>This extension lets you rebase changesets in an existing Mercurial
repository.</p>
<p>For more information:
<a class="reference external" href="http://mercurial.selenic.com/wiki/RebaseExtension">http://mercurial.selenic.com/wiki/RebaseExtension</a></p>
<div class="section" id="id27">
<h3>Commands</h3>
<div class="section" id="id28">
<h4>rebase</h4>
<pre class="literal-block">
hg rebase [-s REV | -b REV] [-d REV] [options]
hg rebase {-a|-c}
</pre>
<p>Rebase uses repeated merging to graft changesets from one part of
history (the source) onto another (the destination). This can be
useful for linearizing <em>local</em> changes relative to a master
development tree.</p>
<p>You should not rebase changesets that have already been shared
with others. Doing so will force everybody else to perform the
same rebase or they will end up with duplicated changesets after
pulling in your rebased changesets.</p>
<p>If you don't specify a destination changeset (<tt class="docutils literal"><span class="pre">-d/--dest</span></tt>),
rebase uses the tipmost head of the current named branch as the
destination. (The destination changeset is not modified by
rebasing, but new changesets are added as its descendants.)</p>
<p>You can specify which changesets to rebase in two ways: as a
"source" changeset or as a "base" changeset. Both are shorthand
for a topologically related set of changesets (the "source
branch"). If you specify source (<tt class="docutils literal"><span class="pre">-s/--source</span></tt>), rebase will
rebase that changeset and all of its descendants onto dest. If you
specify base (<tt class="docutils literal"><span class="pre">-b/--base</span></tt>), rebase will select ancestors of base
back to but not including the common ancestor with dest. Thus,
<tt class="docutils literal"><span class="pre">-b</span></tt> is less precise but more convenient than <tt class="docutils literal"><span class="pre">-s</span></tt>: you can
specify any changeset in the source branch, and rebase will select
the whole branch. If you specify neither <tt class="docutils literal"><span class="pre">-s</span></tt> nor <tt class="docutils literal"><span class="pre">-b</span></tt>, rebase
uses the parent of the working directory as the base.</p>
<p>By default, rebase recreates the changesets in the source branch
as descendants of dest and then destroys the originals. Use
<tt class="docutils literal"><span class="pre">--keep</span></tt> to preserve the original source changesets. Some
changesets in the source branch (e.g. merges from the destination
branch) may be dropped if they no longer contribute any change.</p>
<p>One result of the rules for selecting the destination changeset
and source branch is that, unlike <tt class="docutils literal">merge</tt>, rebase will do
nothing if you are at the latest (tipmost) head of a named branch
with two heads. You need to explicitly specify source and/or
destination (or <tt class="docutils literal">update</tt> to the other head, if it's the head of
the intended source branch).</p>
<p>If a rebase is interrupted to manually resolve a merge, it can be
continued with --continue/-c or aborted with --abort/-a.</p>
<p>Returns 0 on success, 1 if nothing to rebase.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--source</span></kbd></td>
<td>rebase from the specified changeset</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--base</span></kbd></td>
<td>rebase from the base of the specified changeset (up to greatest common ancestor of base and dest)</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-r</span>, <span class="option">--rev</span></kbd></td>
<td>rebase these revisions</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--dest</span></kbd></td>
<td>rebase onto the specified changeset</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--collapse</span></kbd></td>
<td>collapse the rebased changesets</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as collapse commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
<td>invoke editor on commit messages</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read collapse commit message from file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--keep</span></kbd></td>
<td>keep original changesets</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--keepbranches</span></kbd></td>
<td>keep original branch names</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-D</span>, <span class="option">--detach</span></kbd></td>
<td>force detaching of source from its original branch</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-t</span>, <span class="option">--tool</span></kbd></td>
<td>specify merge tool</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--continue</span></kbd></td>
<td>continue an interrupted rebase</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--abort</span></kbd></td>
<td>abort an interrupted rebase</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--style</span></kbd></td>
<td>display using template map file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--template</span></kbd></td>
<td>display with template</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="record">
<h2><a class="toc-backref" href="#id105">record</a></h2>
<p>commands to interactively select changes for commit/qrefresh</p>
<div class="section" id="id29">
<h3>Commands</h3>
<div class="section" id="qrecord">
<h4>qrecord</h4>
<pre class="literal-block">
hg qrecord [OPTION]... PATCH [FILE]...
</pre>
<p>See <a class="reference external" href="hg.1.html#qnew"><tt class="docutils literal">hg help qnew</tt></a> & <a class="reference external" href="hg.1.html#record"><tt class="docutils literal">hg help record</tt></a> for more information and
usage.</p>
</div>
<div class="section" id="id30">
<h4>record</h4>
<pre class="literal-block">
hg record [OPTION]... [FILE]...
</pre>
<p>If a list of files is omitted, all changes reported by <a class="reference external" href="hg.1.html#status"><tt class="docutils literal">hg status</tt></a>
will be candidates for recording.</p>
<p>See <a class="reference external" href="hg.1.html#dates"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>You will be prompted for whether to record changes to each
modified file, and for files with multiple changes, for each
change to use. For each query, the following responses are
possible:</p>
<pre class="literal-block">
y - record this change
n - skip this change
e - edit this change manually
s - skip remaining changes to this file
f - record remaining changes to this file
d - done, skip remaining changes and files
a - record all changes to all remaining files
q - quit, recording no changes
? - display help
</pre>
<p>This command is not available when committing a merge.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-A</span>, <span class="option">--addremove</span></kbd></td>
</tr>
<tr><td> </td><td>mark new/missing files as added/removed before committing</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--close-branch</span></kbd></td>
<td>mark a branch as closed, hiding it from the branch list</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--amend</span></kbd></td>
<td>amend the parent of the working dir</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-I</span>, <span class="option">--include</span></kbd></td>
<td>include names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-X</span>, <span class="option">--exclude</span></kbd></td>
<td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--message</span></kbd></td>
<td>use text as commit message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-l</span>, <span class="option">--logfile</span></kbd></td>
<td>read commit message from file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-d</span>, <span class="option">--date</span></kbd></td>
<td>record the specified date as commit date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-u</span>, <span class="option">--user</span></kbd></td>
<td>record the specified user as committer</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td>
<td>recurse into subrepositories</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-w</span>, <span class="option">--ignore-all-space</span></kbd></td>
</tr>
<tr><td> </td><td>ignore white space when comparing lines</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-b</span>, <span class="option">--ignore-space-change</span></kbd></td>
</tr>
<tr><td> </td><td>ignore changes in the amount of white space</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-B</span>, <span class="option">--ignore-blank-lines</span></kbd></td>
</tr>
<tr><td> </td><td>ignore changes whose lines are all blank</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="relink">
<h2><a class="toc-backref" href="#id106">relink</a></h2>
<p>recreates hardlinks between repository clones</p>
<div class="section" id="id31">
<h3>Commands</h3>
<div class="section" id="id32">
<h4>relink</h4>
<pre class="literal-block">
hg relink [ORIGIN]
</pre>
<p>When repositories are cloned locally, their data files will be
hardlinked so that they only use the space of a single repository.</p>
<p>Unfortunately, subsequent pulls into either repository will break
hardlinks for any files touched by the new changesets, even if
both repositories end up pulling the same changes.</p>
<p>Similarly, passing --rev to "hg clone" will fail to use any
hardlinks, falling back to a complete copy of the source
repository.</p>
<p>This command lets you recreate those hardlinks and reclaim that
wasted space.</p>
<p>This repository will be relinked to share space with ORIGIN, which
must be on the same local disk. If ORIGIN is omitted, looks for
"default-relink", then "default", in [paths].</p>
<p>Do not attempt any read operations on this repository while the
command is running. (Both repositories will be locked against
writes.)</p>
</div>
</div>
</div>
<div class="section" id="schemes">
<h2><a class="toc-backref" href="#id107">schemes</a></h2>
<p>extend schemes with shortcuts to repository swarms</p>
<p>This extension allows you to specify shortcuts for parent URLs with a
lot of repositories to act like a scheme, for example:</p>
<pre class="literal-block">
[schemes]
py = http://code.python.org/hg/
</pre>
<p>After that you can use it like:</p>
<pre class="literal-block">
hg clone py://trunk/
</pre>
<p>Additionally there is support for some more complex schemas, for
example used by Google Code:</p>
<pre class="literal-block">
[schemes]
gcode = http://{1}.googlecode.com/hg/
</pre>
<p>The syntax is taken from Mercurial templates, and you have unlimited
number of variables, starting with <tt class="docutils literal">{1}</tt> and continuing with
<tt class="docutils literal">{2}</tt>, <tt class="docutils literal">{3}</tt> and so on. This variables will receive parts of URL
supplied, split by <tt class="docutils literal">/</tt>. Anything not specified as <tt class="docutils literal">{part}</tt> will be
just appended to an URL.</p>
<p>For convenience, the extension adds these schemes by default:</p>
<pre class="literal-block">
[schemes]
py = http://hg.python.org/
bb = https://bitbucket.org/
bb+ssh = ssh://hg@bitbucket.org/
gcode = https://{1}.googlecode.com/hg/
kiln = https://{1}.kilnhg.com/Repo/
</pre>
<p>You can override a predefined scheme by defining a new scheme with the
same name.</p>
</div>
<div class="section" id="share">
<h2><a class="toc-backref" href="#id108">share</a></h2>
<p>share a common history between several working directories</p>
<div class="section" id="id33">
<h3>Commands</h3>
<div class="section" id="id34">
<h4>share</h4>
<pre class="literal-block">
hg share [-U] SOURCE [DEST]
</pre>
<p>Initialize a new repository and working directory that shares its
history with another repository.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">using rollback or extensions that destroy/modify history (mq,
rebase, etc.) can cause considerable confusion with shared
clones. In particular, if two shared clones are both updated to
the same changeset, and one of them destroys that changeset
with rollback, the other clone will suddenly stop working: all
operations will fail with "abort: working directory has unknown
parent". The only known workaround is to use debugsetparents on
the broken clone to reset it to a changeset that still exists
(e.g. tip).</p>
</div>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-U</span>, <span class="option">--noupdate</span></kbd></td>
<td>do not create a working copy</td></tr>
</tbody>
</table>
</div>
<div class="section" id="unshare">
<h4>unshare</h4>
<pre class="literal-block">
hg unshare
</pre>
<p>Copy the store data to the repo and remove the sharedpath data.</p>
</div>
</div>
</div>
<div class="section" id="transplant">
<h2><a class="toc-backref" href="#id109">transplant</a></h2>
<p>command to transplant changesets from another branch</p>
<p>This extension allows you to transplant patches from another branch.</p>
<p>Transplanted patches are recorded in .hg/transplant/transplants, as a
map from a changeset hash to its hash in the source repository.</p>
<div class="section" id="id35">
<h3>Commands</h3>
<div class="section" id="id36">
<h4>transplant</h4>
<pre class="literal-block">
hg transplant [-s REPO] [-b BRANCH [-a]] [-p REV] [-m REV] [REV]...
</pre>
<p>Selected changesets will be applied on top of the current working
directory with the log of the original changeset. The changesets
are copied and will thus appear twice in the history. Use the
rebase extension instead if you want to move a whole branch of
unpublished changesets.</p>
<p>If --log is specified, log messages will have a comment appended
of the form:</p>
<pre class="literal-block">
(transplanted from CHANGESETHASH)
</pre>
<p>You can rewrite the changelog message with the --filter option.
Its argument will be invoked with the current changelog message as
$1 and the patch as $2.</p>
<p>If --source/-s is specified, selects changesets from the named
repository. If --branch/-b is specified, selects changesets from
the branch holding the named revision, up to that revision. If
--all/-a is specified, all changesets on the branch will be
transplanted, otherwise you will be prompted to select the
changesets you want.</p>
<p><a class="reference external" href="hg.1.html#transplant"><tt class="docutils literal">hg transplant <span class="pre">--branch</span> REVISION <span class="pre">--all</span></tt></a> will transplant the
selected branch (up to the named revision) onto your current
working directory.</p>
<p>You can optionally mark selected transplanted changesets as merge
changesets. You will not be prompted to transplant any ancestors
of a merged transplant, and you can merge descendants of them
normally instead of transplanting them.</p>
<p>Merge changesets may be transplanted directly by specifying the
proper parent changeset by calling <a class="reference external" href="hg.1.html#transplant"><tt class="docutils literal">hg transplant <span class="pre">--parent</span></tt></a>.</p>
<p>If no merges or revisions are provided, <a class="reference external" href="hg.1.html#transplant"><tt class="docutils literal">hg transplant</tt></a> will
start an interactive changeset browser.</p>
<p>If a changeset application fails, you can fix the merge by hand
and then resume where you left off by calling <a class="reference external" href="hg.1.html#transplant"><tt class="docutils literal">hg transplant
<span class="pre">--continue/-c</span></tt></a>.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--source</span></kbd></td>
<td>pull patches from REPO</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-b</span>, <span class="option">--branch</span></kbd></td>
<td>pull patches from branch BRANCH</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-a</span>, <span class="option">--all</span></kbd></td>
<td>pull all changesets up to BRANCH</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-p</span>, <span class="option">--prune</span></kbd></td>
<td>skip over REV</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-m</span>, <span class="option">--merge</span></kbd></td>
<td>merge at REV</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--parent</span></kbd></td>
<td>parent to choose when transplanting merge</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
<td>invoke editor on commit messages</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--log</span></kbd></td>
<td>append transplant info to log message</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-c</span>, <span class="option">--continue</span></kbd></td>
<td>continue last transplant session after repair</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--filter</span></kbd></td>
<td>filter changesets through command</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="win32mbcs">
<h2><a class="toc-backref" href="#id110">win32mbcs</a></h2>
<p>allow the use of MBCS paths with problematic encodings</p>
<p>Some MBCS encodings are not good for some path operations (i.e.
splitting path, case conversion, etc.) with its encoded bytes. We call
such a encoding (i.e. shift_jis and big5) as "problematic encoding".
This extension can be used to fix the issue with those encodings by
wrapping some functions to convert to Unicode string before path
operation.</p>
<p>This extension is useful for:</p>
<ul class="simple">
<li>Japanese Windows users using shift_jis encoding.</li>
<li>Chinese Windows users using big5 encoding.</li>
<li>All users who use a repository with one of problematic encodings on
case-insensitive file system.</li>
</ul>
<p>This extension is not needed for:</p>
<ul class="simple">
<li>Any user who use only ASCII chars in path.</li>
<li>Any user who do not use any of problematic encodings.</li>
</ul>
<p>Note that there are some limitations on using this extension:</p>
<ul class="simple">
<li>You should use single encoding in one repository.</li>
<li>If the repository path ends with 0x5c, .hg/hgrc cannot be read.</li>
<li>win32mbcs is not compatible with fixutf8 extension.</li>
</ul>
<p>By default, win32mbcs uses encoding.encoding decided by Mercurial.
You can specify the encoding by config option:</p>
<pre class="literal-block">
[win32mbcs]
encoding = sjis
</pre>
<p>It is useful for the users who want to commit with UTF-8 log message.</p>
</div>
<div class="section" id="win32text">
<h2><a class="toc-backref" href="#id111">win32text</a></h2>
<p>perform automatic newline conversion</p>
<blockquote>
<p>Deprecation: The win32text extension requires each user to configure
the extension again and again for each clone since the configuration
is not copied when cloning.</p>
<p>We have therefore made the <tt class="docutils literal">eol</tt> as an alternative. The <tt class="docutils literal">eol</tt>
uses a version controlled file for its configuration and each clone
will therefore use the right settings from the start.</p>
</blockquote>
<p>To perform automatic newline conversion, use:</p>
<pre class="literal-block">
[extensions]
win32text =
[encode]
** = cleverencode:
# or ** = macencode:
[decode]
** = cleverdecode:
# or ** = macdecode:
</pre>
<p>If not doing conversion, to make sure you do not commit CRLF/CR by accident:</p>
<pre class="literal-block">
[hooks]
pretxncommit.crlf = python:hgext.win32text.forbidcrlf
# or pretxncommit.cr = python:hgext.win32text.forbidcr
</pre>
<p>To do the same check on a server to prevent CRLF/CR from being
pushed or pulled:</p>
<pre class="literal-block">
[hooks]
pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf
# or pretxnchangegroup.cr = python:hgext.win32text.forbidcr
</pre>
</div>
<div class="section" id="zeroconf">
<h2><a class="toc-backref" href="#id112">zeroconf</a></h2>
<p>discover and advertise repositories on the local network</p>
<p>Zeroconf-enabled repositories will be announced in a network without
the need to configure a server or a service. They can be discovered
without knowing their actual IP address.</p>
<p>To allow other people to discover your repository using run
<a class="reference external" href="hg.1.html#serve"><tt class="docutils literal">hg serve</tt></a> in your repository:</p>
<pre class="literal-block">
$ cd test
$ hg serve
</pre>
<p>You can discover Zeroconf-enabled repositories by running
<a class="reference external" href="hg.1.html#paths"><tt class="docutils literal">hg paths</tt></a>:</p>
<pre class="literal-block">
$ hg paths
zc-test = http://example.com:8000/test
</pre>
</div>
</div>
<div class="section" id="files">
<h1><a class="toc-backref" href="#contents">Files</a></h1>
<dl class="docutils">
<dt><tt class="docutils literal">/etc/mercurial/hgrc</tt>, <tt class="docutils literal"><span class="pre">$HOME/.hgrc</span></tt>, <tt class="docutils literal">.hg/hgrc</tt></dt>
<dd>This file contains defaults and configuration. Values in
<tt class="docutils literal">.hg/hgrc</tt> override those in <tt class="docutils literal"><span class="pre">$HOME/.hgrc</span></tt>, and these override
settings made in the global <tt class="docutils literal">/etc/mercurial/hgrc</tt> configuration.
See <a class="reference external" href="hgrc.5.html"><strong>hgrc</strong>(5)</a> for details of the contents and format of these
files.</dd>
<dt><tt class="docutils literal">.hgignore</tt></dt>
<dd>This file contains regular expressions (one per line) that
describe file names that should be ignored by <strong>hg</strong>. For details,
see <a class="reference external" href="hgignore.5.html"><strong>hgignore</strong>(5)</a>.</dd>
<dt><tt class="docutils literal">.hgsub</tt></dt>
<dd>This file defines the locations of all subrepositories, and
tells where the subrepository checkouts came from. For details, see
<a class="reference external" href="hg.1.html#subrepos"><tt class="docutils literal">hg help subrepos</tt></a>.</dd>
<dt><tt class="docutils literal">.hgsubstate</tt></dt>
<dd>This file is where Mercurial stores all nested repository states. <em>NB: This
file should not be edited manually.</em></dd>
<dt><tt class="docutils literal">.hgtags</tt></dt>
<dd>This file contains changeset hash values and text tag names (one
of each separated by spaces) that correspond to tagged versions of
the repository contents. The file content is encoded using UTF-8.</dd>
<dt><tt class="docutils literal"><span class="pre">.hg/last-message.txt</span></tt></dt>
<dd>This file is used by <a class="reference external" href="hg.1.html#commit"><tt class="docutils literal">hg commit</tt></a> to store a backup of the commit message
in case the commit fails.</dd>
<dt><tt class="docutils literal">.hg/localtags</tt></dt>
<dd>This file can be used to define local tags which are not shared among
repositories. The file format is the same as for <tt class="docutils literal">.hgtags</tt>, but it is
encoded using the local system encoding.</dd>
</dl>
<p>Some commands (e.g. revert) produce backup files ending in <tt class="docutils literal">.orig</tt>,
if the <tt class="docutils literal">.orig</tt> file already exists and is not tracked by Mercurial,
it will be overwritten.</p>
</div>
<div class="section" id="bugs">
<h1><a class="toc-backref" href="#contents">Bugs</a></h1>
<p>Probably lots, please post them to the mailing list (see <a class="reference internal" href="#resources">Resources</a>
below) when you find them.</p>
</div>
<div class="section" id="see-also">
<h1><a class="toc-backref" href="#contents">See Also</a></h1>
<p><a class="reference external" href="hgignore.5.html"><strong>hgignore</strong>(5)</a>, <a class="reference external" href="hgrc.5.html"><strong>hgrc</strong>(5)</a></p>
</div>
<div class="section" id="author">
<h1><a class="toc-backref" href="#contents">Author</a></h1>
<p>Written by Matt Mackall <<a class="reference external" href="mailto:mpm@selenic.com">mpm@selenic.com</a>></p>
</div>
<div class="section" id="resources">
<h1><a class="toc-backref" href="#contents">Resources</a></h1>
<p>Main Web Site: <a class="reference external" href="http://mercurial.selenic.com/">http://mercurial.selenic.com/</a></p>
<p>Source code repository: <a class="reference external" href="http://selenic.com/hg">http://selenic.com/hg</a></p>
<p>Mailing list: <a class="reference external" href="http://selenic.com/mailman/listinfo/mercurial">http://selenic.com/mailman/listinfo/mercurial</a></p>
</div>
<div class="section" id="copying">
<h1><a class="toc-backref" href="#contents">Copying</a></h1>
<p>Copyright (C) 2005-2012 Matt Mackall.
Free use of this software is granted under the terms of the GNU General
Public License version 2 or any later version.</p>
<!-- Common link and substitution definitions. -->
</div>
</div>
</body>
</html>
|