mercurial-4.5.3/0000755015407300116100000000000013261161260013374 5ustar augieeng00000000000000mercurial-4.5.3/PKG-INFO0000644015407300116100000000246013261161260014473 0ustar augieeng00000000000000Metadata-Version: 1.1 Name: mercurial Version: 4.5.3 Summary: Fast scalable distributed SCM (revision control, version control) system Home-page: https://mercurial-scm.org/ Author: Matt Mackall and many others Author-email: mercurial@mercurial-scm.org License: GNU GPLv2 or any later version Download-URL: https://mercurial-scm.org/release/ Description: Mercurial is a distributed SCM tool written in Python. It is used by a number of large projects that require fast, reliable distributed revision control, such as Mozilla. Platform: UNKNOWN Classifier: Development Status :: 6 - Mature Classifier: Environment :: Console Classifier: Intended Audience :: Developers Classifier: Intended Audience :: System Administrators Classifier: License :: OSI Approved :: GNU General Public License (GPL) Classifier: Natural Language :: Danish Classifier: Natural Language :: English Classifier: Natural Language :: German Classifier: Natural Language :: Italian Classifier: Natural Language :: Japanese Classifier: Natural Language :: Portuguese (Brazilian) Classifier: Operating System :: Microsoft :: Windows Classifier: Operating System :: OS Independent Classifier: Operating System :: POSIX Classifier: Programming Language :: C Classifier: Programming Language :: Python Classifier: Topic :: Software Development :: Version Control mercurial-4.5.3/.arcconfig0000644015407300116100000000022413261161234015327 0ustar augieeng00000000000000{ "conduit_uri": "https://phab.mercurial-scm.org/api", "repository.callsign": "HG", "arc.land.onto.default": "@", "base": "hg:.^" } mercurial-4.5.3/hgweb.cgi0000755015407300116100000000125013261161234015156 0ustar augieeng00000000000000#!/usr/bin/env python # # An example hgweb CGI script, edit as necessary # See also https://mercurial-scm.org/wiki/PublishingRepositories # Path to repo or hgweb config to serve (see 'hg help hgweb') config = "/path/to/repo/or/config" # Uncomment and adjust if Mercurial is not installed system-wide # (consult "installed modules" path from 'hg debuginstall'): #import sys; sys.path.insert(0, "/path/to/python/lib") # Uncomment to send python tracebacks to the browser if an error occurs: #import cgitb; cgitb.enable() from mercurial import demandimport; demandimport.enable() from mercurial.hgweb import hgweb, wsgicgi application = hgweb(config) wsgicgi.launch(application) mercurial-4.5.3/.hgsigs0000644015407300116100000022246413261161236014676 0ustar augieeng0000000000000035fb62a3a673d5322f6274a44ba6456e5e4b3b37 0 iD8DBQBEYmO2ywK+sNU5EO8RAnaYAKCO7x15xUn5mnhqWNXqk/ehlhRt2QCfRDfY0LrUq2q4oK/KypuJYPHgq1A= 2be3001847cb18a23c403439d9e7d0ace30804e9 0 iD8DBQBExUbjywK+sNU5EO8RAhzxAKCtyHAQUzcTSZTqlfJ0by6vhREwWQCghaQFHfkfN0l9/40EowNhuMOKnJk= 36a957364b1b89c150f2d0e60a99befe0ee08bd3 0 iD8DBQBFfL2QywK+sNU5EO8RAjYFAKCoGlaWRTeMsjdmxAjUYx6diZxOBwCfY6IpBYsKvPTwB3oktnPt5Rmrlys= 27230c29bfec36d5540fbe1c976810aefecfd1d2 0 iD8DBQBFheweywK+sNU5EO8RAt7VAKCrqJQWT2/uo2RWf0ZI4bLp6v82jACgjrMdsaTbxRsypcmEsdPhlG6/8F4= fb4b6d5fe100b0886f8bc3d6731ec0e5ed5c4694 0 iD8DBQBGgHicywK+sNU5EO8RAgNxAJ0VG8ixAaeudx4sZbhngI1syu49HQCeNUJQfWBgA8bkJ2pvsFpNxwYaX3I= 23889160905a1b09fffe1c07378e9fc1827606eb 0 iD8DBQBHGTzoywK+sNU5EO8RAr/UAJ0Y8s4jQtzgS+G9vM8z6CWBThZ8fwCcCT5XDj2XwxKkz/0s6UELwjsO3LU= bae2e9c838e90a393bae3973a7850280413e091a 0 iD8DBQBH6DO5ywK+sNU5EO8RAsfrAJ0e4r9c9GF/MJsM7Xjd3NesLRC3+ACffj6+6HXdZf8cswAoFPO+DY00oD0= d5cbbe2c49cee22a9fbeb9ea41daa0ac4e26b846 0 iD8DBQBINdwsywK+sNU5EO8RAjIUAKCPmlFJSpsPAAUKF+iNHAwVnwmzeQCdEXrL27CWclXuUKdbQC8De7LICtE= d2375bbee6d47e62ba8e415c86e83a465dc4dce9 0 iD8DBQBIo1wpywK+sNU5EO8RAmRNAJ94x3OFt6blbqu/yBoypm/AJ44fuACfUaldXcV5z9tht97hSp22DVTEPGc= 2a67430f92f15ea5159c26b09ec4839a0c549a26 0 iEYEABECAAYFAkk1hykACgkQywK+sNU5EO85QACeNJNUanjc2tl4wUoPHNuv+lSj0ZMAoIm93wSTc/feyYnO2YCaQ1iyd9Nu 3773e510d433969e277b1863c317b674cbee2065 0 iEYEABECAAYFAklNbbAACgkQywK+sNU5EO8o+gCfeb2/lfIJZMvyDA1m+G1CsBAxfFsAoIa6iAMG8SBY7hW1Q85Yf/LXEvaE 11a4eb81fb4f4742451591489e2797dc47903277 0 iEYEABECAAYFAklcAnsACgkQywK+sNU5EO+uXwCbBVHNNsLy1g7BlAyQJwadYVyHOXoAoKvtAVO71+bv7EbVoukwTzT+P4Sx 11efa41037e280d08cfb07c09ad485df30fb0ea8 0 iEYEABECAAYFAkmvJRQACgkQywK+sNU5EO9XZwCeLMgDgPSMWMm6vgjL4lDs2pEc5+0AnRxfiFbpbBfuEFTqKz9nbzeyoBlx 02981000012e3adf40c4849bd7b3d5618f9ce82d 0 iEYEABECAAYFAknEH3wACgkQywK+sNU5EO+uXwCeI+LbLMmhjU1lKSfU3UWJHjjUC7oAoIZLvYDGOL/tNZFUuatc3RnZ2eje 196d40e7c885fa6e95f89134809b3ec7bdbca34b 0 iEYEABECAAYFAkpL2X4ACgkQywK+sNU5EO9FOwCfXJycjyKJXsvQqKkHrglwOQhEKS4An36GfKzptfN8b1qNc3+ya/5c2WOM 3ef6c14a1e8e83a31226f5881b7fe6095bbfa6f6 0 iEYEABECAAYFAkpopLIACgkQywK+sNU5EO8QSgCfZ0ztsd071rOa2lhmp9Fyue/WoI0AoLTei80/xrhRlB8L/rZEf2KBl8dA 31ec469f9b556f11819937cf68ee53f2be927ebf 0 iEYEABECAAYFAksBuxAACgkQywK+sNU5EO+mBwCfagB+A0txzWZ6dRpug3LEoK7Z1QsAoKpbk8vsLjv6/oRDicSk/qBu33+m 439d7ea6fe3aa4ab9ec274a68846779153789de9 0 iEYEABECAAYFAksVw0kACgkQywK+sNU5EO/oZwCfdfBEkgp38xq6wN2F4nj+SzofrJIAnjmxt04vaJSeOOeHylHvk6lzuQsw 296a0b14a68621f6990c54fdba0083f6f20935bf 0 iEYEABECAAYFAks+jCoACgkQywK+sNU5EO9J8wCeMUGF9E/gS2UBsqIz56WS4HMPRPUAoI5J95mwEIK8Clrl7qFRidNI6APq 4aa619c4c2c09907034d9824ebb1dd0e878206eb 0 iEYEABECAAYFAktm9IsACgkQywK+sNU5EO9XGgCgk4HclRQhexEtooPE5GcUCdB6M8EAn2ptOhMVbIoO+JncA+tNACPFXh0O ff2704a8ded37fbebd8b6eb5ec733731d725da8a 0 iEYEABECAAYFAkuRoSQACgkQywK+sNU5EO//3QCeJDc5r2uFyFCtAlpSA27DEE5rrxAAn2FSwTy9fhrB3QAdDQlwkEZcQzDh 2b01dab594167bc0dd33331dbaa6dca3dca1b3aa 0 iEYEABECAAYFAku1IwIACgkQywK+sNU5EO9MjgCdHLVwkTZlNHxhcznZKBL1rjN+J7cAoLLWi9LTL6f/TgBaPSKOy1ublbaW 39f725929f0c48c5fb3b90c071fc3066012456ca 0 iEYEABECAAYFAkvclvsACgkQywK+sNU5EO9FSwCeL9i5x8ALW/LE5+lCX6MFEAe4MhwAn1ev5o6SX6GrNdDfKweiemfO2VBk fdcf80f26604f233dc4d8f0a5ef9d7470e317e8a 0 iEYEABECAAYFAkvsKTkACgkQywK+sNU5EO9qEACgiSiRGvTG2vXGJ65tUSOIYihTuFAAnRzRIqEVSw8M8/RGeUXRps0IzaCO 24fe2629c6fd0c74c90bd066e77387c2b02e8437 0 iEYEABECAAYFAkwFLRsACgkQywK+sNU5EO+pJACgp13tPI+pbwKZV+LeMjcQ4H6tCZYAoJebzhd6a8yYx6qiwpJxA9BXZNXy f786fc4b8764cd2a5526d259cf2f94d8a66924d9 0 iEYEABECAAYFAkwsyxcACgkQywK+sNU5EO+crACfUpNAF57PmClkSri9nJcBjb2goN4AniPCNaKvnki7TnUsi1u2oxltpKKL bf1774d95bde614af3956d92b20e2a0c68c5fec7 0 iEYEABECAAYFAkxVwccACgkQywK+sNU5EO+oFQCeJzwZ+we1fIIyBGCddHceOUAN++cAnjvT6A8ZWW0zV21NXIFF1qQmjxJd c00f03a4982e467fb6b6bd45908767db6df4771d 0 iEYEABECAAYFAkxXDqsACgkQywK+sNU5EO/GJACfT9Rz4hZOxPQEs91JwtmfjevO84gAmwSmtfo5mmWSm8gtTUebCcdTv0Kf ff5cec76b1c5b6be9c3bb923aae8c3c6d079d6b9 0 iD8DBQBMdo+qywK+sNU5EO8RAqQpAJ975BL2CCAiWMz9SXthNQ9xG181IwCgp4O+KViHPkufZVFn2aTKMNvcr1A= 93d8bff78c96fe7e33237b257558ee97290048a4 0 iD8DBQBMpfvdywK+sNU5EO8RAsxVAJ0UaL1XB51C76JUBhafc9GBefuMxwCdEWkTOzwvE0SarJBe9i008jhbqW4= 333421b9e0f96c7bc788e5667c146a58a9440a55 0 iD8DBQBMz0HOywK+sNU5EO8RAlsEAJ0USh6yOG7OrWkADGunVt9QimBQnwCbBqeMnKgSbwEw8jZwE3Iz1mdrYlo= 4438875ec01bd0fc32be92b0872eb6daeed4d44f 0 iD8DBQBM4WYUywK+sNU5EO8RAhCVAJ0dJswachwFAHALmk1x0RJehxzqPQCbBNskP9n/X689jB+btNTZTyKU/fw= 6aff4f144ad356311318b0011df0bb21f2c97429 0 iD8DBQBM9uxXywK+sNU5EO8RAv+4AKCDj4qKP16GdPaq1tP6BUwpM/M1OACfRyzLPp/qiiN8xJTWoWYSe/XjJug= e3bf16703e2601de99e563cdb3a5d50b64e6d320 0 iD8DBQBNH8WqywK+sNU5EO8RAiQTAJ9sBO+TeiGro4si77VVaQaA6jcRUgCfSA28dBbjj0oFoQwvPoZjANiZBH8= a6c855c32ea081da3c3b8ff628f1847ff271482f 0 iD8DBQBNSJJ+ywK+sNU5EO8RAoJaAKCweDEF70fu+r1Zn7pYDXdlk5RuSgCeO9gK/eit8Lin/1n3pO7aYguFLok= 2b2155623ee2559caf288fd333f30475966c4525 0 iD8DBQBNSJeBywK+sNU5EO8RAm1KAJ4hW9Cm9nHaaGJguchBaPLlAr+O3wCgqgmMok8bdAS06N6PL60PSTM//Gg= 2616325766e3504c8ae7c84bd15ee610901fe91d 0 iD8DBQBNbWy9ywK+sNU5EO8RAlWCAJ4mW8HbzjJj9GpK98muX7k+7EvEHwCfaTLbC/DH3QEsZBhEP+M8tzL6RU4= aa1f3be38ab127280761889d2dca906ca465b5f4 0 iD8DBQBNeQq7ywK+sNU5EO8RAlEOAJ4tlEDdetE9lKfjGgjbkcR8PrC3egCfXCfF3qNVvU/2YYjpgvRwevjvDy0= b032bec2c0a651ca0ddecb65714bfe6770f67d70 0 iD8DBQBNlg5kywK+sNU5EO8RAnGEAJ9gmEx6MfaR4XcG2m/93vwtfyzs3gCgltzx8/YdHPwqDwRX/WbpYgi33is= 3cb1e95676ad089596bd81d0937cad37d6e3b7fb 0 iD8DBQBNvTy4ywK+sNU5EO8RAmp8AJ9QnxK4jTJ7G722MyeBxf0UXEdGwACgtlM7BKtNQfbEH/fOW5y+45W88VI= 733af5d9f6b22387913e1d11350fb8cb7c1487dd 0 iD8DBQBN5q/8ywK+sNU5EO8RArRGAKCNGT94GKIYtSuwZ57z1sQbcw6uLACfffpbMV4NAPMl8womAwg+7ZPKnIU= de9eb6b1da4fc522b1cab16d86ca166204c24f25 0 iD8DBQBODhfhywK+sNU5EO8RAr2+AJ4ugbAj8ae8/K0bYZzx3sascIAg1QCeK3b+zbbVVqd3b7CDpwFnaX8kTd4= 4a43e23b8c55b4566b8200bf69fe2158485a2634 0 iD8DBQBONzIMywK+sNU5EO8RAj5SAJ0aPS3+JHnyI6bHB2Fl0LImbDmagwCdGbDLp1S7TFobxXudOH49bX45Iik= d629f1e89021103f1753addcef6b310e4435b184 0 iD8DBQBOWAsBywK+sNU5EO8RAht4AJwJl9oNFopuGkj5m8aKuf7bqPkoAQCeNrEm7UhFsZKYT5iUOjnMV7s2LaM= 351a9292e430e35766c552066ed3e87c557b803b 0 iD8DBQBOh3zUywK+sNU5EO8RApFMAKCD3Y/u3avDFndznwqfG5UeTHMlvACfUivPIVQZyDZnhZMq0UhC6zhCEQg= 384082750f2c51dc917d85a7145748330fa6ef4d 0 iD8DBQBOmd+OywK+sNU5EO8RAgDgAJ9V/X+G7VLwhTpHrZNiOHabzSyzYQCdE2kKfIevJUYB9QLAWCWP6DPwrwI= 41453d55b481ddfcc1dacb445179649e24ca861d 0 iD8DBQBOsFhpywK+sNU5EO8RAqM6AKCyfxUae3/zLuiLdQz+JR78690eMACfQ6JTBQib4AbE+rUDdkeFYg9K/+4= 195dbd1cef0c2f9f8bcf4ea303238105f716bda3 0 iD8DBQBO1/fWywK+sNU5EO8RAmoPAKCR5lpv1D6JLURHD8KVLSV4GRVEBgCgnd0Sy78ligNfqAMafmACRDvj7vo= 6344043924497cd06d781d9014c66802285072e4 0 iD8DBQBPALgmywK+sNU5EO8RAlfhAJ9nYOdWnhfVDHYtDTJAyJtXBAQS9wCgnefoSQt7QABkbGxM+Q85UYEBuD0= db33555eafeaf9df1e18950e29439eaa706d399b 0 iD8DBQBPGdzxywK+sNU5EO8RAppkAJ9jOXhUVE/97CPgiMA0pMGiIYnesQCfengAszcBiSiKGugiI8Okc9ghU+Y= 2aa5b51f310fb3befd26bed99c02267f5c12c734 0 iD8DBQBPKZ9bywK+sNU5EO8RAt1TAJ45r1eJ0YqSkInzrrayg4TVCh0SnQCgm0GA/Ua74jnnDwVQ60lAwROuz1Q= 53e2cd303ecf8ca7c7eeebd785c34e5ed6b0f4a4 0 iD8DBQBPT/fvywK+sNU5EO8RAnfYAKCn7d0vwqIb100YfWm1F7nFD5B+FACeM02YHpQLSNsztrBCObtqcnfod7Q= b9bd95e61b49c221c4cca24e6da7c946fc02f992 0 iD8DBQBPeLsIywK+sNU5EO8RAvpNAKCtKe2gitz8dYn52IRF0hFOPCR7AQCfRJL/RWCFweu2T1vH/mUOCf8SXXc= d9e2f09d5488c395ae9ddbb320ceacd24757e055 0 iD8DBQBPju/dywK+sNU5EO8RArBYAJ9xtifdbk+hCOJO8OZa4JfHX8OYZQCeKPMBaBWiT8N/WHoOm1XU0q+iono= 00182b3d087909e3c3ae44761efecdde8f319ef3 0 iD8DBQBPoFhIywK+sNU5EO8RAhzhAKCBj1n2jxPTkZNJJ5pSp3soa+XHIgCgsZZpAQxOpXwCp0eCdNGe0+pmxmg= 5983de86462c5a9f42a3ad0f5e90ce5b1d221d25 0 iD8DBQBPovNWywK+sNU5EO8RAhgiAJ980T91FdPTRMmVONDhpkMsZwVIMACgg3bKvoWSeuCW28llUhAJtUjrMv0= 85a358df5bbbe404ca25730c9c459b34263441dc 0 iD8DBQBPyZsWywK+sNU5EO8RAnpLAJ48qrGDJRT+pteS0mSQ11haqHstPwCdG4ccGbk+0JHb7aNy8/NRGAOqn9w= b013baa3898e117959984fc64c29d8c784d2f28b 0 iD8DBQBP8QOPywK+sNU5EO8RAqimAKCFRSx0lvG6y8vne2IhNG062Hn0dACeMLI5/zhpWpHBIVeAAquYfx2XFeA= 7f5094bb3f423fc799e471aac2aee81a7ce57a0b 0 iD8DBQBQGiL8ywK+sNU5EO8RAq5oAJ4rMMCPx6O+OuzNXVOexogedWz/QgCeIiIxLd76I4pXO48tdXhr0hQcBuM= 072209ae4ddb654eb2d5fd35bff358c738414432 0 iD8DBQBQQkq0ywK+sNU5EO8RArDTAJ9nk5CySnNAjAXYvqvx4uWCw9ThZwCgqmFRehH/l+oTwj3f8nw8u8qTCdc= b3f0f9a39c4e1d0250048cd803ab03542d6f140a 0 iD8DBQBQamltywK+sNU5EO8RAlsqAJ4qF/m6aFu4mJCOKTiAP5RvZFK02ACfawYShUZO6OXEFfveU0aAxDR0M1k= d118a4f4fd16d9b558ec3f3e87bfee772861d2b7 0 iD8DBQBQgPV5ywK+sNU5EO8RArylAJ0abcx5NlDjyv3ZDWpAfRIHyRsJtQCgn4TMuEayqgxzrvadQZHdTEU2g38= 195ad823b5d58c68903a6153a25e3fb4ed25239d 0 iD8DBQBQkuT9ywK+sNU5EO8RAhB4AKCeerItoK2Jipm2cVf4euGofAa/WACeJj3TVd4pFILpb+ogj7ebweFLJi0= 0c10cf8191469e7c3c8844922e17e71a176cb7cb 0 iD8DBQBQvQWoywK+sNU5EO8RAnq3AJoCn98u4geFx5YaQaeh99gFhCd7bQCgjoBwBSUyOvGd0yBy60E3Vv3VZhM= a4765077b65e6ae29ba42bab7834717b5072d5ba 0 iD8DBQBQ486sywK+sNU5EO8RAhmJAJ90aLfLKZhmcZN7kqphigQJxiFOQACeJ5IUZxjGKH4xzi3MrgIcx9n+dB0= f5fbe15ca7449f2c9a3cf817c86d0ae68b307214 0 iD8DBQBQ+yuYywK+sNU5EO8RAm9JAJoD/UciWvpGeKBcpGtZJBFJVcL/HACghDXSgQ+xQDjB+6uGrdgAQsRR1Lg= a6088c05e43a8aee0472ca3a4f6f8d7dd914ebbf 0 iD8DBQBRDDROywK+sNU5EO8RAh75AJ9uJCGoCWnP0Lv/+XuYs4hvUl+sAgCcD36QgAnuw8IQXrvv684BAXAnHcA= 7511d4df752e61fe7ae4f3682e0a0008573b0402 0 iD8DBQBRFYaoywK+sNU5EO8RAuErAJoDyhXn+lptU3+AevVdwAIeNFyR2gCdHzPHyWd+JDeWCUR+pSOBi8O2ppM= 5b7175377babacce80a6c1e12366d8032a6d4340 0 iD8DBQBRMCYgywK+sNU5EO8RAq1/AKCWKlt9ysibyQgYwoxxIOZv5J8rpwCcDSHQaaf1fFZUTnQsOePwcM2Y/Sg= 50c922c1b5145dab8baefefb0437d363b6a6c21c 0 iD8DBQBRWnUnywK+sNU5EO8RAuQRAJwM42cJqJPeqJ0jVNdMqKMDqr4dSACeP0cRVGz1gitMuV0x8f3mrZrqc7I= 8a7bd2dccd44ed571afe7424cd7f95594f27c092 0 iD8DBQBRXfBvywK+sNU5EO8RAn+LAKCsMmflbuXjYRxlzFwId5ptm8TZcwCdGkyLbZcASBOkzQUm/WW1qfknJHU= 292cd385856d98bacb2c3086f8897bc660c2beea 0 iD8DBQBRcM0BywK+sNU5EO8RAjp4AKCJBykQbvXhKuvLSMxKx3a2TBiXcACfbr/kLg5GlZTF/XDPmY+PyHgI/GM= 23f785b38af38d2fca6b8f3db56b8007a84cd73a 0 iD8DBQBRgZwNywK+sNU5EO8RAmO4AJ4u2ILGuimRP6MJgE2t65LZ5dAdkACgiENEstIdrlFC80p+sWKD81kKIYI= ddc7a6be20212d18f3e27d9d7e6f079a66d96f21 0 iD8DBQBRkswvywK+sNU5EO8RAiYYAJsHTHyHbJeAgmGvBTmDrfcKu4doUgCeLm7eGBjx7yAPUvEtxef8rAkQmXI= cceaf7af4c9e9e6fa2dbfdcfe9856c5da69c4ffd 0 iD8DBQBRqnFLywK+sNU5EO8RAsWNAJ9RR6t+y1DLFc2HeH0eN9VfZAKF9gCeJ8ezvhtKq/LMs0/nvcgKQc/d5jk= 009794acc6e37a650f0fae37872e733382ac1c0c 0 iD8DBQBR0guxywK+sNU5EO8RArNkAKCq9pMihVzP8Os5kCmgbWpe5C37wgCgqzuPZTHvAsXF5wTyaSTMVa9Ccq4= f0d7721d7322dcfb5af33599c2543f27335334bb 0 iD8DBQBR8taaywK+sNU5EO8RAqeEAJ4idDhhDuEsgsUjeQgWNj498matHACfT67gSF5w0ylsrBx1Hb52HkGXDm0= f37b5a17e6a0ee17afde2cdde5393dd74715fb58 0 iD8DBQBR+ymFywK+sNU5EO8RAuSdAJkBMcd9DAZ3rWE9WGKPm2YZ8LBoXACfXn/wbEsVy7ZgJoUwiWmHSnQaWCI= 335a558f81dc73afeab4d7be63617392b130117f 0 iQIVAwUAUiZrIyBXgaxoKi1yAQK2iw//cquNqqSkc8Re5/TZT9I6NH+lh6DbOKjJP0Xl1Wqq0K+KSIUgZG4G32ovaEb2l5X0uY+3unRPiZ0ebl0YSw4Fb2ZiPIADXLBTOYRrY2Wwd3tpJeGI6wEgZt3SfcITV/g7NJrCjT3FlYoSOIayrExM80InSdcEM0Q3Rx6HKzY2acyxzgZeAtAW5ohFvHilSvY6p5Gcm4+QptMxvw45GPdreUmjeXZxNXNXZ8P+MjMz/QJbai/N7PjmK8lqnhkBsT48Ng/KhhmOkGntNJ2/ImBWLFGcWngSvJ7sfWwnyhndvGhe0Hq1NcCf7I8TjNDxU5TR+m+uW7xjXdLoDbUjBdX4sKXnh8ZjbYiODKBOrrDq25cf8nA/tnpKyE/qsVy60kOk6loY4XKiYmn1V49Ta0emmDx0hqo3HgxHHsHX0NDnGdWGol7cPRET0RzVobKq1A0jnrhPooWidvLh9bPzLonrWDo+ib+DuySoRkuYUK4pgZJ2mbg6daFOBEZygkSyRB8bo1UQUP7EgQDrWe4khb/5GHEfDkrQz3qu/sXvc0Ir1mOUWBFPHC2DjjCn/oMJuUkG1SwM8l2Bfv7h67ssES6YQ2+RjOix4yid7EXS/Ogl45PzCIPSI5+BbNs10JhE0w5uErBHlF53EDTe/TSLc+GU6DB6PP6dH912Njdr3jpNSUQ= e7fa36d2ad3a7944a52dca126458d6f482db3524 0 iQIVAwUAUktg4yBXgaxoKi1yAQLO0g//du/2ypYYUfmM/yZ4zztNKIvgMSGTDVbCCGB2y2/wk2EcolpjpGTkcgnJT413ksYtw78ZU+mvv0RjgrFCm8DQ8kroJaQZ2qHmtSUb42hPBPvtg6kL9YaA4yvp87uUBpFRavGS5uX4hhEIyvZKzhXUBvqtL3TfwR7ld21bj8j00wudqELyyU9IrojIY9jkJ3XL/4shBGgP7u6OK5g8yJ6zTnWgysUetxHBPrYjG25lziiiZQFvZqK1B3PUqAOaFPltQs0PB8ipOCAHQgJsjaREj8VmC3+rskmSSy66NHm6gAB9+E8oAgOcU7FzWbdYgnz4kR3M7TQvHX9U61NinPXC6Q9d1VPhO3E6sIGvqJ4YeQOn65V9ezYuIpFSlgQzCHMmLVnOV96Uv1R/Z39I4w7D3S5qoZcQT/siQwGbsZoPMGFYmqOK1da5TZWrrJWkYzc9xvzT9m3q3Wds5pmCmo4b/dIqDifWwYEcNAZ0/YLHwCN5SEZWuunkEwtU5o7TZAv3bvDDA6WxUrrHI/y9/qvvhXxsJnY8IueNhshdmWZfXKz+lJi2Dvk7DUlEQ1zZWSsozi1E+3biMPJO47jsxjoT/jmE5+GHLCgcnXXDVBeaVal99IOaTRFukiz2EMsry1s8fnwEE5XKDKRlU/dOPfsje0gc7bgE0QD/u3E4NJ99g9A= 1596f2d8f2421314b1ddead8f7d0c91009358994 0 iQIVAwUAUmRq+yBXgaxoKi1yAQLolhAAi+l4ZFdQTu9yJDv22YmkmHH4fI3d5VBYgvfJPufpyaj7pX626QNW18UNcGSw2BBpYHIJzWPkk/4XznLVKr4Ciw2N3/yqloEFV0V2SSrTbMWiR9qXI4KJH+Df3KZnKs3FgiYpXkErL4GWkc1jLVR50xQ5RnkMljjtCd0NTeV2PHZ6gP2qbu6CS+5sm3AFhTDGnx8GicbMw76ZNw5M2G+T48yH9jn5KQi2SBThfi4H9Bpr8FDuR7PzQLgw9SbtYxtdQxNkK55k0nG4oLDxduNakU6SH9t8n8tdCfMt58kTzlQVrPFiTFjKu2n2JioDTz2HEivbZ5H757cu7SvpX8gW3paeBc57e+GOLMisMZABXLICq59c3QnrMwFY4FG+5cpiHVXoaZz/0bYCJx+IhU4QLWqZuzb18KSyHUCqQRzXlzS6QV5O7dY5YNQXFC44j/dS5zdgWMYo2mc6mVP2OaPUn7F6aQh5MCDYorPIOkcNjOg7ytajo7DXbzWt5Al8qt6386BJksyR3GAonc09+l8IFeNxk8HZNP4ETQ8aWj0dC9jgBDPK43T2Bju/i84s+U/bRe4tGSQalZUEv06mkIH/VRJp5w2izYTsdIjA4FT9d36OhaxlfoO1X6tHR9AyA3bF/g/ozvBwuo3kTRUUqo+Ggvx/DmcPQdDiZZQIqDBXch0= d825e4025e39d1c39db943cdc89818abd0a87c27 0 iQIVAwUAUnQlXiBXgaxoKi1yAQJd3BAAi7LjMSpXmdR7B8K98C3/By4YHsCOAocMl3JXiLd7SXwKmlta1zxtkgWwWJnNYE3lVJvGCl+l4YsGKmFu755MGXlyORh1x4ohckoC1a8cqnbNAgD6CSvjSaZfnINLGZQP1wIP4yWj0FftKVANQBjj/xkkxO530mjBYnUvyA4PeDd5A1AOUUu6qHzX6S5LcprEt7iktLI+Ae1dYTkiCpckDtyYUKIk3RK/4AGWwGCPddVWeV5bDxLs8GHyMbqdBwx+2EAMtyZfXT+z6MDRsL/gEBVOXHb/UR0qpYED+qFnbtTlxqQkRE/wBhwDoRzUgcSuukQ9iPn79WNDSdT5b6Jd393uEO5BNF/DB6rrOiWmlpoooWgTY9kcwGB02v0hhLrH5r1wkv8baaPl+qjCjBxf4CNKm/83KN5/umGbZlORqPSN5JVxK6vDNwFFmHLaZbMT1g27GsGOWm84VH+dgolgk4nmRNSO37eTNM5Y1C3Zf2amiqDSRcAxCgseg0Jh10G7i52SSTcZPI2MqrwT9eIyg8PTIxT1D5bPcCzkg5nTTL6S7bet7OSwynRnHslhvVUBly8aIj4eY/5cQqAucUUa5sq6xLD8N27Tl+sQi+kE6KtWu2c0ZhpouflYp55XNMHgU4KeFcVcDtHfJRF6THT6tFcHFNauCHbhfN2F33ANMP4= 209e04a06467e2969c0cc6501335be0406d46ef0 0 iQIVAwUAUpv1oCBXgaxoKi1yAQKOFBAAma2wlsr3w/5NvDwq2rmOrgtNDq1DnNqcXloaOdwegX1z3/N++5uVjLjI0VyguexnwK+7E8rypMZ+4glaiZvIiGPnGMYbG9iOoz5XBhtUHzI5ECYfm5QU81by9VmCIvArDFe5Hlnz4XaXpEGnAwPywD+yzV3/+tyoV7MgsVinCMtbX9OF84/ubWKNzq2810FpQRfYoCOrF8sUed/1TcQrSm1eMB/PnuxjFCFySiR6J7Urd9bJoJIDtdZOQeeHaL5Z8Pcsyzjoe/9oTwJ3L3tl/NMZtRxiQUWtfRA0zvEnQ4QEkZSDMd/JnGiWHPVeP4P92+YN15za9yhneEAtustrTNAmVF2Uh92RIlmkG475HFhvwPJ4DfCx0vU1OOKX/U4c1rifW7H7HaipoaMlsDU2VFsAHcc3YF8ulVt27bH2yUaLGJz7eqpt+3DzZTKp4d/brZA2EkbVgsoYP+XYLbzxfwWlaMwiN3iCnlTFbNogH8MxhfHFWBj6ouikqOz8HlNl6BmSQiUCBnz5fquVpXmW2Md+TDekk+uOW9mvk1QMU62br+Z6PEZupkdTrqKaz+8ZMWvTRct8SiOcu7R11LpfERyrwYGGPei0P2YrEGIWGgXvEobXoPTSl7J+mpOA/rp2Q1zA3ihjgzwtGZZF+ThQXZGIMGaA2YPgzuYRqY8l5oc= ca387377df7a3a67dbb90b6336b781cdadc3ef41 0 iQIVAwUAUsThISBXgaxoKi1yAQJpvRAAkRkCWLjHBZnWxX9Oe6t2HQgkSsmn9wMHvXXGFkcAmrqJ86yfyrxLq2Ns0X7Qwky37kOwKsywM53FQlsx9j//Y+ncnGZoObFTz9YTuSbOHGVsTbAruXWxBrGOf1nFTlg8afcbH0jPfQXwxf3ptfBhgsFCzORcqc8HNopAW+2sgXGhHnbVtq6LF90PWkbKjCCQLiX3da1uETGAElrl4jA5Y2i64S1Q/2X+UFrNslkIIRCGmAJ6BnE6KLJaUftpfbN7Br7a3z9xxWqxRYDOinxDgfAPAucOJPLgMVQ0bJIallaRu7KTmIWKIuSBgg1/hgfoX8I1w49WrTGp0gGY140kl8RWwczAz/SB03Xtbl2+h6PV7rUV2K/5g61DkwdVbWqXM9wmJZmvjEKK0qQbBT0By4QSEDNcKKqtaFFwhFzx4dkXph0igHOtXhSNzMd8PsFx/NRn9NLFIpirxfqVDwakpDNBZw4Q9hUAlTPxSFL3vD9/Zs7lV4/dAvvl+tixJEi2k/iv248b/AI1PrPIQEqDvjrozzzYvrS4HtbkUn+IiHiepQaYnpqKoXvBu6btK/nv0GTxB5OwVJzMA1RPDcxIFfZA2AazHjrXiPAl5uWYEddEvRjaCiF8xkQkfiXzLOoqhKQHdwPGcfMFEs9lNR8BrB2ZOajBJc8RPsFDswhT5h4= 8862469e16f9236208581b20de5f96bd13cc039d 0 iQIVAwUAUt7cLSBXgaxoKi1yAQLOkRAAidp501zafqe+JnDwlf7ORcJc+FgCE6mK1gxDfReCbkMsY7AzspogU7orqfSmr6XXdrDwmk3Y5x3mf44OGzNQjvuNWhqnTgJ7sOcU/lICGQUc8WiGNzHEMFGX9S+K4dpUaBf8Tcl8pU3iArhlthDghW6SZeDFB/FDBaUx9dkdFp6eXrmu4OuGRZEvwUvPtCGxIL7nKNnufI1du/MsWQxvC2ORHbMNtRq6tjA0fLZi4SvbySuYifQRS32BfHkFS5Qu4/40+1k7kd0YFyyQUvIsVa17lrix3zDqMavG8x7oOlqM/axDMBT6DhpdBMAdc5qqf8myz8lwjlFjyDUL6u3Z4/yE0nUrmEudXiXwG0xbVoEN8SCNrDmmvFMt6qdCpdDMkHr2TuSh0Hh4FT5CDkzPI8ZRssv/01j/QvIO3c/xlbpGRPWpsPXEVOz3pmjYN4qyQesnBKWCENsQLy/8s2rey8iQgx2GtsrNw8+wGX6XE4v3QtwUrRe12hWoNrEHWl0xnLv2mvAFqdMAMpFY6EpOKLlE4hoCs2CmTJ2dv6e2tiGTXGU6/frI5iuNRK61OXnH5OjEc8DCGH/GC7NXyDOXOB+7BdBvvf50l2C/vxR2TKgTncLtHeLCrR0GHNHsxqRo1UDwOWur0r7fdfCRvb2tIr5LORCqKYVKd60/BAXjHWc= 3cec5134e9c4bceab6a00c60f52a4f80677a78f2 0 iQIVAwUAUu1lIyBXgaxoKi1yAQIzCBAAizSWvTkWt8+tReM9jUetoSToF+XahLhn381AYdErFCBErX4bNL+vyEj+Jt2DHsAfabkvNBe3k7rtFlXHwpq6POa/ciFGPDhFlplNv6yN1jOKBlMsgdjpn7plZKcLHODOigU7IMlgg70Um8qVrRgQ8FhvbVgR2I5+CD6bucFzqo78wNl9mCIHIQCpGKIUoz56GbwT+rUpEB182Z3u6rf4NWj35RZLGAicVV2A2eAAFh4ZvuC+Z0tXMkp6Gq9cINawZgqfLbzVYJeXBtJC39lHPyp5P3LaEVRhntc9YTwbfkVGjyJZR60iYrieeKpOYRnzgHauPVdgVhkTkBxshmEPY7svKYSQqlj8hLuFa+a3ajbIPrpQAAi1MgtamA991atNqGiSTjdZa9kLQvfdn0k80+gkCxpuO56PhvtdjKsYVRgQMTYmQVQdh3x4WbQOSqTADXXIZUaWxx4RmNSlxY7KD+3lPP09teOD+A3B2cP60bC5NsCfULtQFXQzdC7NvfIyYfYBTZa+Pv6HFkVe10cbnqTt83hBy0D77vdaegPRe56qDNU+GrIG2/rosnlKGFjFoK/pTYkR9uzfkrhEjLwyfkoXlBqY+376W0PC5fP10pJeQBS9DuXpCPlgtyW0Jy1ayCT1YR4QJC4n75vZwTFBFRBhSi0HqFquOgy83+O0Q/k= b96cb15ec9e04d8ac5ee08b34fcbbe4200588965 0 iQIVAwUAUxJPlyBXgaxoKi1yAQLIRA//Qh9qzoYthPAWAUNbzybWXC/oMBI2X89NQC7l1ivKhv7cn9L79D8SWXM18q7LTwLdlwOkV/a0NTE3tkQTLvxJpfnRLCBbMOcGiIn/PxsAae8IhMAUbR7qz+XOynHOs60ZhK9X8seQHJRf1YtOI9gYTL/WYk8Cnpmc6xZQ90TNhoPPkpdfe8Y236V11SbYtN14fmrPaWQ3GXwyrvQaqM1F7BxSnC/sbm9+/wprsTa8gRQo7YQL/T5jJQgFiatG3yayrDdJtoRq3TZKtsxw8gtQdfVCrrBibbysjM8++dnwA92apHNUY8LzyptPy7rSDXRrIpPUWGGTQTD+6HQwkcLFtIuUpw4I75SV3z2r6LyOLKzDJUIunKOOYFS/rEIQGxZHxZOBAvbI+73mHAn3pJqm+UAA7R1n7tk3JyQncg50qJlm9zIUPGpNFcdEqak5iXzGYx292VlcE+fbJYeIPWggpilaVUgdmXtMCG0O0uX6C8MDmzVDCjd6FzDJ4GTZwgmWJaamvls85CkZgyN/UqlisfFXub0A1h7qAzBSVpP1+Ti+UbBjlrGX8BMRYHRGYIeIq16elcWwSpLgshjDwNn2r2EdwX8xKU5mucgTzSLprbOYGdQaqnvf6e8IX5WMBgwVW9YdY9yJKSLF7kE1AlM9nfVcXwOK4mHoMvnNgiX3zsw= 3f83fc5cfe715d292069ee8417c83804f6c6c1e4 0 iQIVAwUAUztENyBXgaxoKi1yAQIpkhAAmJj5JRTSn0Dn/OTAHggalw8KYFbAck1X35Wg9O7ku7sd+cOnNnkYfqAdz2m5ikqWHP7aWMiNkNy7Ree2110NqkQVYG/2AJStXBdIOmewqnjDlNt+rbJQN/JsjeKSCy+ToNvhqX5cTM9DF2pwRjMsTXVff307S6/3pga244i+RFAeG3WCUrzfDu641MGFLjG4atCj8ZFLg9DcW5bsRiOs5ZK5Il+UAb2yyoS2KNQ70VLhYULhGtqq9tuO4nLRGN3DX/eDcYfncPCav1GckW4OZKakcbLtAdW0goSgGWloxcM+j2E6Z1JZ9tOTTkFN77EvX0ZWZLmYM7sUN1meFnKbVxrtGKlMelwKwlT252c65PAKa9zsTaRUKvN7XclyxZAYVCsiCQ/V08NXhNgXJXcoKUAeGNf6wruOyvRU9teia8fAiuHJoY58WC8jC4nYG3iZTnl+zNj2A5xuEUpYHhjUfe3rNJeK7CwUpJKlbxopu5mnW9AE9ITfI490eaapRLTojOBDJNqCORAtbggMD46fLeCOzzB8Gl70U2p5P34F92Sn6mgERFKh/10XwJcj4ZIeexbQK8lqQ2cIanDN9dAmbvavPTY8grbANuq+vXDGxjIjfxapqzsSPqUJ5KnfTQyLq5NWwquR9t38XvHZfktkd140BFKwIUAIlKKaFfYXXtM= 564f55b251224f16508dd1311452db7780dafe2b 0 iQIVAwUAU1BmFSBXgaxoKi1yAQJ2Aw//bjK++xJuZCIdktg/i5FxBwoxdbipfTkKsN/YjUwrEmroYM8IkqIsO+U54OGCYWr3NPJ3VS8wUQeJ+NF3ffcjmjC297R9J+X0c5G90DdQUYX44jG/tP8Tqpev4Q7DLCXT26aRwEMdJQpq0eGaqv55E5Cxnyt3RrLCqe7RjPresZFg7iYrro5nq8TGYwBhessHXnCix9QI0HtXiLpms+0UGz8Sbi9nEYW+M0OZCyO1TvykCpFzEsLNwqqtFvhOMD/AMiWcTKNUpjmOn3V83xjWl+jnDUt7BxJ7n1efUnlwl4IeWlSUb73q/durtaymb97cSdKFmXHv4pdAShQEuEpVVGO1WELsKoXmbj30ItTW2V3KvNbjFsvIdDo7zLCpXyTq1HC56W7QCIMINX2qT+hrAMWC12tPQ05f89Cv1+jpk6eOPFqIHFdi663AjyrnGll8nwN7HJWwtA5wTXisu3bec51FAq4yJTzPMtOE9spz36E+Go2hZ1cAv9oCSceZcM0wB8KiMfaZJKNZNZk1jvsdiio4CcdASOFQPOspz07GqQxVP7W+F1Oz32LgwcNAEAS/f3juwDj45GYfAWJrTh3dnJy5DTD2LVC7KtkxxUVkWkqxivnDB9anj++FN9eyekxzut5eFED+WrCfZMcSPW0ai7wbslhKUhCwSf/v3DgGwsM= 2195ac506c6ababe86985b932f4948837c0891b5 0 iQIVAwUAU2LO/CBXgaxoKi1yAQI/3w/7BT/VRPyxey6tYp7i5cONIlEB3gznebGYwm0SGYNE6lsvS2VLh6ztb+j4eqOadr8Ssna6bslBx+dVsm+VuJ+vrNLMucD5Uc+fhn6dAfVqg+YBzUEaedI5yNsJizcJUDI7hUVsxiPiiYd9hchCWJ+z2tVt2jCyG2lMV2rbW36AM89sgz/wn5/AaAFsgoS6up/uzA3Tmw+qZSO6dZChb4Q8midIUWEbNzVhokgYcw7/HmjmvkvV9RJYiG8aBnMdQmxTE69q2dTjnnDL6wu61WU2FpTN09HRFbemUqzAfoJp8MmXq6jWgfLcm0cI3kRo7ZNpnEkmVKsfKQCXXiaR4alt9IQpQ6Jl7LSYsYI+D4ejpYysIsZyAE8qzltYhBKJWqO27A5V4WdJsoTgA/RwKfPRlci4PY8I4N466S7PBXVz/Cc5EpFkecvrgceTmBafb8JEi+gPiD2Po4vtW3bCeV4xldiEXHeJ77byUz7fZU7jL78SjJVOCCQTJfKZVr36kTz3KlaOz3E700RxzEFDYbK7I41mdANeQBmNNbcvRTy5ma6W6I3McEcAH4wqM5fFQ8YS+QWJxk85Si8KtaDPqoEdC/0dQPavuU/jAVjhV8IbmmkOtO7WvOHQDBtrR15yMxGMnUwMrPHaRNKdHNYRG0LL7lpCtdMi1mzLQgHYY9SRYvI= 269c80ee5b3cb3684fa8edc61501b3506d02eb10 0 iQIVAwUAU4uX5CBXgaxoKi1yAQLpdg/+OxulOKwZN+Nr7xsRhUijYjyAElRf2mGDvMrbAOA2xNf85DOXjOrX5TKETumf1qANA5cHa1twA8wYgxUzhx30H+w5EsLjyeSsOncRnD5WZNqSoIq2XevT0T4c8xdyNftyBqK4h/SC/t2h3vEiSCUaGcfNK8yk4XO45MIk4kk9nlA9jNWdA5ZMLgEFBye2ggz0JjEAPUkVDqlr9sNORDEbnwZxGPV8CK9HaL/I8VWClaFgjKQmjqV3SQsNFe2XPffzXmIipFJ+ODuXVxYpAsvLiGmcfuUfSDHQ4L9QvjBsWe1PgYMr/6CY/lPYmR+xW5mJUE9eIdN4MYcXgicLrmMpdF5pToNccNCMtfa6CDvEasPRqe2bDzL/Q9dQbdOVE/boaYBlgmYLL+/u+dpqip9KkyGgbSo9uJzst1mLTCzJmr5bw+surul28i9HM+4+Lewg4UUdHLz46no1lfTlB5o5EAhiOZBTEVdoBaKfewVpDa/aBRvtWX7UMVRG5qrtA0sXwydN00Jaqkr9m20W0jWjtc1ZC72QCrynVHOyfIb2rN98rnuy2QN4bTvjNpNjHOhhhPTOoVo0YYPdiUupm46vymUTQCmWsglU4Rlaa3vXneP7JenL5TV8WLPs9J28lF0IkOnyBXY7OFcpvYO1euu7iR1VdjfrQukMyaX18usymiA= 2d8cd3d0e83c7336c0cb45a9f88638363f993848 0 iQIVAwUAU7OLTCBXgaxoKi1yAQJ+pw/+M3yOesgf55eo3PUTZw02QZxDyEg9ElrRc6664/QFXaJuYdz8H3LGG/NYs8uEdYihiGpS1Qc70jwd1IoUlrCELsaSSZpzWQ+VpQFX29aooBoetfL+8WgqV8zJHCtY0E1EBg/Z3ZL3n2OS++fVeWlKtp5mwEq8uLTUmhIS7GseP3bIG/CwF2Zz4bzhmPGK8V2s74aUvELZLCfkBE1ULNs7Nou1iPDGnhYOD53eq1KGIPlIg1rnLbyYw5bhS20wy5IxkWf2eCaXfmQBTG61kO5m3nkzfVgtxmZHLqYggISTJXUovfGsWZcp5a71clCSMVal+Mfviw8L/UPHG0Ie1c36djJiFLxM0f2HlwVMjegQOZSAeMGg1YL1xnIys2zMMsKgEeR+JISTal1pJyLcT9x5mr1HCnUczSGXE5zsixN+PORRnZOqcEZTa2mHJ1h5jJeEm36B/eR57BMJG+i0QgZqTpLzYTFrp2eWokGMjFB1MvgAkL2YoRsw9h6TeIwqzK8mFwLi28bf1c90gX9uMbwY/NOqGzfQKBR9bvCjs2k/gmJ+qd5AbC3DvOxHnN6hRZUqNq76Bo4F+CUVcjQ/NXnfnOIVNbILpl5Un5kl+8wLFM+mNxDxduajaUwLhSHZofKmmCSLbuuaGmQTC7a/4wzhQM9e5dX0X/8sOo8CptW7uw4= 6c36dc6cd61a0e1b563f1d51e55bdf4dacf12162 0 iQIVAwUAU8n97yBXgaxoKi1yAQKqcA/+MT0VFoP6N8fHnlxj85maoM2HfZbAzX7oEW1B8F1WH6rHESHDexDWIYWJ2XnEeTD4GCXN0/1p+O/I0IMPNzqoSz8BU0SR4+ejhRkGrKG7mcFiF5G8enxaiISn9nmax6DyRfqtOQBzuXYGObXg9PGvMS6zbR0SorJK61xX7fSsUNN6BAvHJfpwcVkOrrFAIpEhs/Gh9wg0oUKCffO/Abs6oS+P6nGLylpIyXqC7rKZ4uPVc6Ljh9DOcpV4NCU6kQbNE7Ty79E0/JWWLsHOEY4F4WBzI7rVh7dOkRMmfNGaqvKkuNkJOEqTR1o1o73Hhbxn4NU7IPbVP/zFKC+/4QVtcPk2IPlpK1MqA1H2hBNYZhJlNhvAa7LwkIxM0916/zQ8dbFAzp6Ay/t/L0tSEcIrudTz2KTrY0WKw+pkzB/nTwaS3XZre6H2B+gszskmf1Y41clkIy/nH9K7zBuzANWyK3+bm40vmMoBbbnsweUAKkyCwqm4KTyQoYQWzu/ZiZcI+Uuk/ajJ9s7EhJbIlSnYG9ttWL/IZ1h+qPU9mqVO9fcaqkeL/NIRh+IsnzaWo0zmHU1bK+/E29PPGGf3v6+IEJmXg7lvNl5pHiMd2tb7RNO/UaNSv1Y2E9naD4FQwSWo38GRBcnRGuKCLdZNHGUR+6dYo6BJCGG8wtZvNXb3TOo= 3178e49892020336491cdc6945885c4de26ffa8b 0 iQIVAwUAU9whUCBXgaxoKi1yAQJDKxAAoGzdHXV/BvZ598VExEQ8IqkmBVIP1QZDVBr/orMc1eFM4tbGKxumMGbqgJsg+NetI0irkh/YWeJQ13lT4Og72iJ+4UC9eF9pcpUKr/0eBYdU2N/p2MIbVNWh3aF5QkbuQpSri0VbHOWkxqwoqrrwXEjgHaKYP4PKh+Dzukax4yzBUIyzAG38pt4a8hbjnozCl2uAikxk4Ojg+ZufhPoZWgFEuYzSfK5SrwVKOwuxKYFGbbVGTQMIXLvBhOipAmHp4JMEYHfG85kwuyx/DCDbGmXKPQYQfClwjJ4ob/IwG8asyMsPWs+09vrvpVO08HBuph3GjuiWJ1fhEef/ImWmZdQySI9Y4SjwP4dMVfzLCnY+PYPDM9Sq/5Iee13gI2lVM2NtAfQZPXh9l8u6SbCir1UhMNMx0qVMkqMAATmiZ+ETHCO75q4Wdcmnv5fk2PbvaGBVtrHGeiyuz5mK/j4cMbd0R9R0hR1PyC4dOhNqOnbqELNIe0rKNByG1RkpiQYsqZTU6insmnZrv4fVsxfA4JOObPfKNT4oa24MHS73ldLFCfQAuIxVE7RDJJ3bHeh/yO6Smo28FuVRldBl5e+wj2MykS8iVcuSa1smw6gJ14iLBH369nlR3fAAQxI0omVYPDHLr7SsH3vJasTaCD7V3SL4lW6vo/yaAh4ImlTAE+Y= 5dc91146f35369949ea56b40172308158b59063a 0 iQIVAwUAVAUgJyBXgaxoKi1yAQJkEg/9EXFZvPpuvU7AjII1dlIT8F534AXrO30+H6hweg+h2mUCSb/mZnbo3Jr1tATgBWbIKkYmmsiIKNlJMFNPZTWhImGcVA93t6v85tSFiNJRI2QP9ypl5wTt2KhiS/s7GbUYCtPDm6xyNYoSvDo6vXJ5mfGlgFZY5gYLwEHq/lIRWLWD4EWYWbk5yN+B7rHu6A1n3yro73UR8DudEhYYqC23KbWEqFOiNd1IGj3UJlxIHUE4AcDukxbfiMWrKvv1kuT/vXak3X7cLXlO56aUbMopvaUflA3PSr3XAqynDd69cxACo/T36fuwzCQN4ICpdzGTos0rQALSr7CKF5YP9LMhVhCsOn0pCsAkSiw4HxxbcHQLl+t+0rchNysc4dWGwDt6GAfYcdm3fPtGFtA3qsN8lOpCquFH3TAZ3TrIjLFoTOk6s1xX1x5rjP/DAHc/y3KZU0Ffx3TwdQEEEIFaAXaxQG848rdfzV42+dnFnXh1G/MIrKAmv3ZSUkQ3XJfGc7iu82FsYE1NLHriUQDmMRBzCoQ1Rn1Kji119Cxf5rsMcQ6ZISR1f0jDCUS/qxlHvSqETLp8H63NSUfvuKSC7uC6pGvq9XQm1JRNO5UuJfK6tHzy0jv9bt2IRo2xbmvpDu9L5oHHd3JePsAmFmbrFf/7Qem3JyzEvRcpdcdHtefxcxc= f768c888aaa68d12dd7f509dcc7f01c9584357d0 0 iQIVAwUAVCxczSBXgaxoKi1yAQJYiA/9HnqKuU7IsGACgsUGt+YaqZQumg077Anj158kihSytmSts6xDxqVY1UQB38dqAKLJrQc7RbN0YK0NVCKZZrx/4OqgWvjiL5qWUJKqQzsDx4LGTUlbPlZNZawW2urmmYW6c9ZZDs1EVnVeZMDrOdntddtnBgtILDwrZ8o3U7FwSlfnm03vTkqUMj9okA3AsI8+lQIlo4qbqjQJYwvUC1ZezRdQwaT1LyoWUgjmhoZ1XWcWKOs9baikaJr6fMv8vZpwmaOY1+pztxYlROeSPVWt9P6yOf0Hi/2eg8AwSZLaX96xfk9IvXUSItg/wjTWP9BhnNs/ulwTnN8QOgSXpYxH4RXwsYOyU7BvwAekA9xi17wuzPrGEliScplxICIZ7jiiwv/VngMvM9AYw2mNBvZt2ZIGrrLaK6pq/zBm5tbviwqt5/8U5aqO8k1O0e4XYm5WmQ1c2AkXRO+xwvFpondlSF2y0flzf2FRXP82QMfsy7vxIP0KmaQ4ex+J8krZgMjNTwXh2M4tdYNtu5AehJQEP3l6giy2srkMDuFLqoe1yECjVlGdgA86ve3J/84I8KGgsufYMhfQnwHHGXCbONcNsDvO0QOee6CIQVcdKCG7dac3M89SC6Ns2CjuC8BIYDRnxbGQb7Fvn4ZcadyJKKbXQJzMgRV25K6BAwTIdvYAtgU= 7f8d16af8cae246fa5a48e723d48d58b015aed94 0 iQIVAwUAVEL0XyBXgaxoKi1yAQJLkRAAjZhpUju5nnSYtN9S0/vXS/tjuAtBTUdGwc0mz97VrM6Yhc6BjSCZL59tjeqQaoH7Lqf94pRAtZyIB2Vj/VVMDbM+/eaoSr1JixxppU+a4eqScaj82944u4C5YMSMC22PMvEwqKmy87RinZKJlFwSQ699zZ5g6mnNq8xeAiDlYhoF2QKzUXwnKxzpvjGsYhYGDMmVS1QPmky4WGvuTl6KeGkv8LidKf7r6/2RZeMcq+yjJ7R0RTtyjo1cM5dMcn/jRdwZxuV4cmFweCAeoy5guV+X6du022TpVndjOSDoKiRgdk7pTuaToXIy+9bleHpEo9bwKx58wvOMg7sirAYjrA4Xcx762RHiUuidTTPktm8sNsBQmgwJZ8Pzm+8TyHjFGLnBfeiDbQQEdLCXloz0jVOVRflDfMays1WpAYUV8XNOsgxnD2jDU8L0NLkJiX5Y0OerGq9AZ+XbgJFVBFhaOfsm2PEc3jq00GOLzrGzA+4b3CGpFzM3EyK9OnnwbP7SqCGb7PJgjmQ7IO8IWEmVYGaKtWONSm8zRLcKdH8xuk8iN1qCkBXMty/wfTEVTkIlMVEDbslYkVfj0rAPJ8B37bfe0Yz4CEMkCmARIB1rIOpMhnavXGuD50OP2PBBY/8DyC5aY97z9f04na/ffk+l7rWaHihjHufKIApt5OnfJ1w= ced632394371a36953ce4d394f86278ae51a2aae 0 iQIVAwUAVFWpfSBXgaxoKi1yAQLCQw//cvCi/Di3z/2ZEDQt4Ayyxv18gzewqrYyoElgnEzr5uTynD9Mf25hprstKla/Y5C6q+y0K6qCHPimGOkz3H+wZ2GVUgLKAwMABkfSb5IZiLTGaB2DjAJKZRwB6h43wG/DSFggE3dYszWuyHW88c72ZzVF5CSNc4J1ARLjDSgnNYJQ6XdPw3C9KgiLFDXzynPpZbPg0AK5bdPUKJruMeIKPn36Hx/Tv5GXUrbc2/lcnyRDFWisaDl0X/5eLdA+r3ID0cSmyPLYOeCgszRiW++KGw+PPDsWVeM3ZaZ9SgaBWU7MIn9A7yQMnnSzgDbN+9v/VMT3zbk1WJXlQQK8oA+CCdHH9EY33RfZ6ST/lr3pSQbUG1hdK6Sw+H6WMkOnnEk6HtLwa4xZ3HjDpoPkhVV+S0C7D5WWOovbubxuBiW5v8tK4sIOS6bAaKevTBKRbo4Rs6qmS/Ish5Q+z5bKst80cyEdi4QSoPZ/W+6kh1KfOprMxynwPQhtEcDYW2gfLpgPIM7RdXPKukLlkV2qX3eF/tqApGU4KNdP4I3N80Ri0h+6tVU/K4TMYzlRV3ziLBumJ4TnBrTHU3X6AfZUfTgslQzokX8/7a3tbctX6kZuJPggLGisdFSdirHbrUc+y5VKuJtPr+LxxgZKRFbs2VpJRem6FvwGNyndWLv32v0GMtQ= 643c58303fb0ec020907af28b9e486be299ba043 0 iQIVAwUAVGKawCBXgaxoKi1yAQL7zxAAjpXKNvzm/PKVlTfDjuVOYZ9H8w9QKUZ0vfrNJrN6Eo6hULIostbdRc25FcMWocegTqvKbz3IG+L2TKOIdZJS9M9QS4URybUd37URq4Jai8kMiJY31KixNNnjO2G1B39aIXUhY+EPx12aY31/OVy4laXIVtN6qpSncjo9baXSOMZmx6RyA1dbyfwXRjT/aODCGHZXgLJHS/kHlkCsThVlqYQ4rUCDkXIeMqIGF1CR0KjfmKpp1fS14OMgpLgdnt9+pnBZ+qcf1YdpOeQob1zwunjMYOyYC74FyOTdwaynU2iDsuBrmkE8kgEedIn7+WWe9fp/6TQJMVOeTQPZBNSRRSUYCw5Tg/0L/+jLtzjc2mY4444sDPbR7scrtU+/GtvlR5z0Y5pofwEdFME7PZNOp9a4kMiSa7ZERyGdN7U1pDu9JU6BZRz+nPzW217PVnTF7YFV/GGUzMTk9i7EZb5M4T9r9gfxFSMPeT5ct712CdBfyRlsSbSWk8XclTXwW385kLVYNDtOukWrvEiwxpA14Xb/ZUXbIDZVf5rP2HrZHMkghzeUYPjRn/IlgYUt7sDNmqFZNIc9mRFrZC9uFQ/Nul5InZodNODQDM+nHpxaztt4xl4qKep8SDEPAQjNr8biC6T9MtLKbWbSKDlqYYNv0pb2PuGub3y9rvkF1Y05mgM= 902554884335e5ca3661d63be9978eb4aec3f68a 0 iQIVAwUAVH0KMyBXgaxoKi1yAQLUKxAAjgyYpmqD0Ji5OQ3995yX0dmwHOaaSuYpq71VUsOMYBskjH4xE2UgcTrX8RWUf0E+Ya91Nw3veTf+IZlYLaWuOYuJPRzw+zD1sVY8xprwqBOXNaA7n8SsTqZPSh6qgw4S0pUm0xJUOZzUP1l9S7BtIdJP7KwZ7hs9YZev4r9M3G15xOIPn5qJqBAtIeE6f5+ezoyOpSPZFtLFc4qKQ/YWzOT5uuSaYogXgVByXRFaO84+1TD93LR0PyVWxhwU9JrDU5d7P/bUTW1BXdjsxTbBnigWswKHC71EHpgz/HCYxivVL30qNdOm4Fow1Ec2GdUzGunSqTPrq18ScZDYW1x87f3JuqPM+ce/lxRWBBqP1yE30/8l/Us67m6enWXdGER8aL1lYTGOIWAhvJpfzv9KebaUq1gMFLo6j+OfwR3rYPiCHgi20nTNBa+LOceWFjCGzFa3T9UQWHW/MBElfAxK65uecbGRRYY9V1/+wxtTUiS6ixpmzL8S7uUd5n6oMaeeMiD82NLgPIbMyUHQv6eFEcCj0U9NT2uKbFRmclMs5V+8D+RTCsLJ55R9PD5OoRw/6K/coqqPShYmJvgYsFQPzXVpQdCRae31xdfGFmd5KUetqyrT+4GUdJWzSm0giSgovpEJNxXglrvNdvSO7fX3R1oahhwOwtGqMwNilcK+iDw= 6dad422ecc5adb63d9fa649eeb8e05a5f9bc4900 0 iQIVAwUAVJNALCBXgaxoKi1yAQKgmw/+OFbHHOMmN2zs2lI2Y0SoMALPNQBInMBq2E6RMCMbfcS9Cn75iD29DnvBwAYNWaWsYEGyheJ7JjGBiuNKPOrLaHkdjG+5ypbhAfNDyHDiteMsXfH7D1L+cTOAB8yvhimZHOTTVF0zb/uRyVIPNowAyervUVRjDptzdfcvjUS+X+/Ufgwms6Y4CcuzFLFCxpmryJhLtOpwUPLlzIqeNkFOYWkHanCgtZX03PNIWhorH3AWOc9yztwWPQ+kcKl3FMlyuNMPhS/ElxSF6GHGtreRbtP+ZLoSIOMb2QBKpGDpZLgJ3JQEHDcZ0h5CLZWL9dDUJR3M8pg1qglqMFSWMgRPTzxPS4QntPgT/Ewd3+U5oCZUh052fG41OeCZ0CnVCpqi5PjUIDhzQkONxRCN2zbjQ2GZY7glbXoqytissihEIVP9m7RmBVq1rbjOKr+yUetJ9gOZcsMtZiCEq4Uj2cbA1x32MQv7rxwAgQP1kgQ62b0sN08HTjQpI7/IkNALLIDHoQWWr45H97i34qK1dd5uCOnYk7juvhGNX5XispxNnC01/CUVNnqChfDHpgnDjgT+1H618LiTgUAD3zo4IVAhCqF5XWsS4pQEENOB3Msffi62fYowvJx7f/htWeRLZ2OA+B85hhDiD4QBdHCRoz3spVp0asNqDxX4f4ndj8RlzfM= 1265a3a71d75396f5d4cf6935ae7d9ba5407a547 0 iQIVAwUAVKXKYCBXgaxoKi1yAQIfsA/+PFfaWuZ6Jna12Y3MpKMnBCXYLWEJgMNlWHWzwU8lD26SKSlvMyHQsVZlkld2JmFugUCn1OV3OA4YWT6BA7VALq6Zsdcu5Dc8LRbyajBUkzGRpOUyWuFzjkCpGVbrQzbCR/bel/BBXzSqL4ipdtWgJ4y+WpZIhWkNXclBkR52b5hUTjN9vzhyhVVI7eURGwIEf7vVs1fDOcEGtaGY/ynzMTzyxIDsEEygCZau86wpKlYlqhCgxKDyzyGfpH3B1UlNGFt1afW8AWe1eHjdqC7TJZpMqmQ/Ju8vco8Xht6OXw4ZLHj7y39lpccfKTBLiK/cAKSg+xgyaH/BLhzoEkNAwYSFAB4i4IoV0KUC8nFxHfsoswBxJnMqU751ziMrpZ/XHZ1xQoEOdXgz2I04vlRn8xtynOVhcgjoAXwtbia7oNh/qCH/hl5/CdAtaawuCxJBf237F+cwur4PMAAvsGefRfZco/DInpr3qegr8rwInTxlO48ZG+o5xA4TPwT0QQTUjMdNfC146ZSbp65wG7VxJDocMZ8KJN/lqPaOvX+FVYWq4YnJhlldiV9DGgmym1AAaP0D3te2GcfHXpt/f6NYUPpgiBHy0GnOlNcQyGnnONg1A6oKVWB3k7WP28+PQbQEiCIFk2nkf5VZmye7OdHRGKOFfuprYFP1WwTWnVoNX9c= db8e3f7948b1fdeb9ad12d448fc3525759908b9f 0 iQIVAwUAVLsaciBXgaxoKi1yAQKMIA//a90/GvySL9UID+iYvzV2oDaAPDD0T+4Xs43I7DT5NIoDz+3yq2VV54XevQe5lYiURmsb/Q9nX2VR/Qq1J9c/R6Gy+CIfmJ3HzMZ0aAX8ZlZgQPYZKh/2kY5Ojl++k6MTqbqcrICNs4+UE/4IAxPyOfu5gy7TpdJmRZo2J3lWVC2Jbhd02Mzb+tjtfbOM+QcQxPwt9PpqmQszJceyVYOSm3jvD1uJdSOC04tBQrQwrxktQ09Om0LUMMaB5zFXpJtqUzfw7l4U4AaddEmkd3vUfLtHxc21RB01c3cpe2dJnjifDfwseLsI8rS4jmi/91c74TeBatSOhvbqzEkm/p8xZFXE4Uh+EpWjTsVqmfQaRq6NfNCR7I/kvGv8Ps6w8mg8uX8fd8lx+GJbodj+Uy0X3oqHyqPMky/df5i79zADBDuz+yuxFfDD9i22DJPIYcilfGgwpIUuO2lER5nSMVmReuWTVBnT6SEN66Q4KR8zLtIRr+t1qUUCy6wYbgwrdHVCbgMF8RPOVZPjbs17RIqcHjch0Xc7bShKGhQg4WHDjXHK61w4tOa1Yp7jT6COkl01XC9BLcGxJYKFvNCbeDZQGvVgJNoEvHxBxD9rGMVRjfuxeJawc2fGzZJn0ySyLDW0pfd4EJNgTh9bLdPjWz2VlXqn4A6bgaLgTPqjmN0VBXw= fbdd5195528fae4f41feebc1838215c110b25d6a 0 iQIVAwUAVM7fBCBXgaxoKi1yAQKoYw/+LeIGcjQmHIVFQULsiBtPDf+eGAADQoP3mKBy+eX/3Fa0qqUNfES2Q3Y6RRApyZ1maPRMt8BvvhZMgQsu9QIrmf3zsFxZGFwoyrIj4hM3xvAbEZXqmWiR85/Ywd4ImeLaZ0c7mkO1/HGF1n2Mv47bfM4hhNe7VGJSSrTY4srFHDfk4IG9f18DukJVzRD9/dZeBw6eUN1ukuLEgQAD5Sl47bUdKSetglOSR1PjXfZ1hjtz5ywUyBc5P9p3LC4wSvlcJKl22zEvB3L0hkoDcPsdIPEnJAeXxKlR1rQpoA3fEgrstGiSNUW/9Tj0VekAHLO95SExmQyoG/AhbjRRzIj4uQ0aevCJyiAhkv+ffOSf99PMW9L1k3tVjLhpMWEz9BOAWyX7cDFWj5t/iktI046O9HGN9SGVx18e9xM6pEgRcLA2TyjEmtkA4jX0JeN7WeCweMLiSxyGP7pSPSJdpJeXaFtRpSF62p/G0Z5wN9s05LHqDyqNVtCvg4WjkuV5LZSdLbMcYBWGBxQzCG6qowXFXIawmbaFiBZwTfOgNls9ndz5RGupAaxY317prxPFv/pXoesc1P8bdK09ZvjhbmmD66Q/BmS2dOMQ8rXRjuVdlR8j2QBtFZxekMcRD02nBAVnwHg1VWQMIRaGjdgmW4wOkirWVn7me177FnBxrxW1tG4= 5b4ed033390bf6e2879c8f5c28c84e1ee3b87231 0 iQIVAwUAVPQL9CBXgaxoKi1yAQJIXxAAtD2hWhaKa+lABmCOYG92FE/WdqY/91Xv5atTL8Xeko/MkirIKZiOuxNWX+J34TVevINZSWmMfDSc5TkGxktL9jW/pDB/CXn+CVZpxRabPYFH9HM2K3g8VaTV1MFtV2+feOMDIPCmq5ogMF9/kXjmifiEBrJcFsE82fdexJ3OHoOY4iHFxEhh3GzvNqEQygk4VeU6VYziNvSQj9G//PsK3Bmk7zm5ScsZcMVML3SIYFuej1b1PI1v0N8mmCRooVNBGhD/eA0iLtdh/hSb9s/8UgJ4f9HOcx9zqs8V4i14lpd/fo0+yvFuVrVbWGzrDrk5EKLENhVPwvc1KA32PTQ4Z9u7VQIBIxq3K5lL2VlCMIYc1BSaSQBjuiLm8VdN6iDuf5poNZhk1rvtpQgpxJzh362dlGtR/iTJuLCeW7gCqWUAorLTeHy0bLQ/jSOeTAGys8bUHtlRL4QbnhLbUmJmRYVvCJ+Yt1aTgTSNcoFjoLJarR1169BXgdCA38BgReUL6kB224UJSTzB1hJUyB2LvCWrXZMipZmR99Iwdq7MePD3+AoSIXQNUMY9blxuuF5x7W2ikNXmVWuab4Z8rQRtmGqEuIMBSunxAnZSn+i8057dFKlq+/yGy+WW3RQg+RnLnwZs1zCDTfu98/GT5k5hFpjXZeUWWiOVwQJ5HrqncCw= 07a92bbd02e5e3a625e0820389b47786b02b2cea 0 iQIVAwUAVPSP9SBXgaxoKi1yAQLkBQ//dRQExJHFepJfZ0gvGnUoYI4APsLmne5XtfeXJ8OtUyC4a6RylxA5BavDWgXwUh9BGhOX2cBSz1fyvzohrPrvNnlBrYKAvOIJGEAiBTXHYTxHINEKPtDF92Uz23T0Rn/wnSvvlbWF7Pvd+0DMJpFDEyr9n6jvVLR7mgxMaCqZbVaB1W/wTwDjni780WgVx8OPUXkLx3/DyarMcIiPeI5UN+FeHDovTsBWFC95msFLm80PMRPuHOejWp65yyEemGujZEPO2D5VVah7fshM2HTz63+bkEBYoqrftuv3vXKBRG78MIrUrKpqxmnCKNKDUUWJ4yk3+NwuOiHlKdly5kZ7MNFaL73XKo8HH287lDWz0lIazs91dQA9a9JOyTsp8YqGtIJGGCbhrUDtiQJ199oBU84mw3VH/EEzm4mPv4sW5fm7BnnoH/a+9vXySc+498rkdLlzFwxrQkWyJ/pFOx4UA3mCtGQK+OSwLPc+X4SRqA4fiyqKxVAL1kpLTSDL3QA82I7GzBaXsxUXzS4nmteMhUyzTdwAhKVydL0gC3d7NmkAFSyRjdGzutUUXshYxg0ywRgYebe8uzJcTj4nNRgaalYLdg3guuDulD+dJmILsrcLmA6KD/pvfDn8PYt+4ZjNIvN2E9GF6uXDu4Ux+AlOTLk9BChxUF8uBX9ev5cvWtQ= 2e2e9a0750f91a6fe0ad88e4de34f8efefdcab08 0 iQIVAwUAVRw4nyBXgaxoKi1yAQIFExAAkbCPtLjQlJvPaYCL1KhNR+ZVAmn7JrFH3XhvR26RayYbs4NxR3W1BhwhDy9+W+28szEx1kQvmr6t1bXAFywY0tNJOeuLU7uFfmbgAfYgkQ9kpsQNqFYkjbCyftw0S9vX9VOJ9DqUoDWuKfX7VzjkwE9dCfKI5F+dvzxnd6ZFjB85nyHBQuTZlzXl0+csY212RJ2G2j/mzEBVyeZj9l7Rm+1X8AC1xQMWRJGiyd0b7nhYqoOcceeJFAV1t9QO4+gjmkM5kL0orjxTnuVsxPTxcC5ca1BfidPWrZEto3duHWNiATGnCDylxxr52BxCAS+BWePW9J0PROtw1pYaZ9pF4N5X5LSXJzqX7ZiNGckxqIjry09+Tbsa8FS0VkkYBEiGotpuo4Jd05V6qpXfW2JqAfEVo6X6aGvPM2B7ZUtKi30I4J+WprrOP3WgZ/ZWHe1ERYKgjDqisn3t/D40q30WQUeQGltGsOX0Udqma2RjBugO5BHGzJ2yer4GdJXg7q1OMzrjAEuz1IoKvIB/o1pg86quVA4H2gQnL1B8t1M38/DIafyw7mrEY4Z3GL44Reev63XVvDE099Vbhqp7ufwq81Fpq7Xxa5vsr9SJ+8IqqQr8AcYSuK3G3L6BmIuSUAYMRqgl35FWoWkGyZIG5c6K6zI8w5Pb0aGi6Lb2Wfb9zbc= e89f909edffad558b56f4affa8239e4832f88de0 0 iQIVAwUAVTBozCBXgaxoKi1yAQLHeg/+IvfpPmG7OSqCoHvMVETYdrqT7lKCwfCQWMFOC/2faWs1n4R/qQNm6ckE5OY888RK8tVQ7ue03Pg/iyWgQlYfS7Njd3WPjS4JsnEBxIvuGkIu6TPIXAUAH0PFTBh0cZEICDpPEVT2X3bPRwDHA+hUE9RrxM5zJ39Fpk/pTYCjQ9UKfEhXlEfka75YB39g2Y/ssaSbn5w/tAAx8sL72Y4G96D4IV2seLHZhB3VQ7UZKThEWn6UdVOoKj+urIwGaBYMeekGVtHSh6fnHOw3EtDO9mQ5HtAz2Bl4CwRYN8eSN+Dwgr+mdk8MWpQQJ+i1A8jUhUp8gn1Pe5GkIH4CWZ9+AvLLnshe2MkVaTT1g7EQk37tFkkdZDRBsOHIvpF71B9pEA1gMUlX4gKgh5YwukgpQlDmFCfY7XmX6eXw9Ub+EckEwYuGMz7Fbwe9J/Ce4DxvgJgq3/cu/jb3bmbewH6tZmcrlqziqqA8GySIwcURnF1c37e7+e7x1jhFJfCWpHzvCusjKhUp9tZsl9Rt1Bo/y41QY+avY7//ymhbwTMKgqjzCYoA+ipF4JfZlFiZF+JhvOSIFb0ltkfdqKD+qOjlkFaglvQU1bpGKLJ6cz4Xk2Jqt5zhcrpyDMGVv9aiWywCK2ZP34RNaJ6ZFwzwdpXihqgkm5dBGoZ4ztFUfmjXzIg= 8cc6036bca532e06681c5a8fa37efaa812de67b5 0 iQIVAwUAVUP0xCBXgaxoKi1yAQLIChAAme3kg1Z0V8t5PnWKDoIvscIeAsD2s6EhMy1SofmdZ4wvYD1VmGC6TgXMCY7ssvRBhxqwG3GxwYpwELASuw2GYfVot2scN7+b8Hs5jHtkQevKbxarYni+ZI9mw/KldnJixD1yW3j+LoJFh/Fu6GD2yrfGIhimFLozcwUu3EbLk7JzyHSn7/8NFjLJz0foAYfcbowU9/BFwNVLrQPnsUbWcEifsq5bYso9MBO9k+25yLgqHoqMbGpJcgjubNy1cWoKnlKS+lOJl0/waAk+aIjHXMzFpRRuJDjxEZn7V4VdV5d23nrBTcit1BfMzga5df7VrLPVRbom1Bi0kQ0BDeDex3hHNqHS5X+HSrd/njzP1xp8twG8hTE+njv85PWoGBTo1eUGW/esChIJKA5f3/F4B9ErgBNNOKnYmRgxixd562OWAwAQZK0r0roe2H/Mfg2VvgxT0kHd22NQLoAv0YI4jcXcCFrnV/80vHUQ8AsAYAbkLcz1jkfk3YwYDP8jbJCqcwJRt9ialYKJwvXlEe0TMeGdq7EjCO0z/pIpu82k2R/C0FtCFih3bUvJEmWoVVx8UGkDDQEORLbzxQCt0IOiQGFcoCCxgQmL0x9ZoljCWg5vZuuhU4uSOuRTuM+aa4xoLkeOcvgGRSOXrqfkV8JpWKoJB4dmY2qSuxw8LsAAzK0= ed18f4acf435a2824c6f49fba40f42b9df5da7ad 0 iQIVAwUAVWy9mCBXgaxoKi1yAQIm+Q/+I/tV8DC51d4f/6T5OR+motlIx9U5za5p9XUUzfp3tzSY2PutVko/FclajVdFekZsK5pUzlh/GZhfe1jjyEEIr3UC3yWk8hMcvvS+2UDmfy81QxN7Uf0kz4mZOlME6d/fYDzf4cDKkkCXoec3kyZBw7L84mteUcrJoyb5K3fkQBrK5CG/CV7+uZN6b9+quKjtDhDEkAyc6phNanzWNgiHGucEbNgXsKM01HmV1TnN4GXTKx8y2UDalIJOPyes2OWHggibMHbaNnGnwSBAK+k29yaQ5FD0rsA+q0j3TijA1NfqvtluNEPbFOx/wJV4CxonYad93gWyEdgU34LRqqw1bx7PFUvew2/T3TJsxQLoCt67OElE7ScG8evuNEe8/4r3LDnzYFx7QMP5r5+B7PxVpj/DT+buS16BhYS8pXMMqLynFOQkX5uhEM7mNC0JTXQsBMHSDAcizVDrdFCF2OSfQjLpUfFP1VEWX7EInqj7hZrd+GE7TfBD8/rwSBSkkCX2aa9uKyt6Ius1GgQUuEETskAUvvpsNBzZxtvGpMMhqQLGlJYnBbhOmsbOyTSnXU66KJ5e/H3O0KRrF09i74v30DaY4uIH8xG6KpSkfw5s/oiLCtagfc0goUvvojk9pACDR3CKM/jVC63EVp2oUcjT72jUgSLxBgi7siLD8IW86wc= 540cd0ddac49c1125b2e013aa2ff18ecbd4dd954 0 iQIVAwUAVZRtzSBXgaxoKi1yAQJVLhAAtfn+8OzHIp6wRC4NUbkImAJRLsNTRPKeRSWPCF5O5XXQ84hp+86qjhndIE6mcJSAt4cVP8uky6sEa8ULd6b3ACRBvtgZtsecA9S/KtRjyE9CKr8nP+ogBNqJPaYlTz9RuwGedOd+8I9lYgsnRjfaHSByNMX08WEHtWqAWhSkAz/HO32ardS38cN97fckCgQtA8v7c77nBT7vcw4epgxyUQvMUxUhqmCVVhVfz8JXa5hyJxFrOtqgaVuQ1B5Y/EKxcyZT+JNHPtu3V1uc1awS/w16CEPstNBSFHax5MuT9UbY0mV2ZITP99EkM+vdomh82VHdnMo0i7Pz7XF45ychD4cteroO9gGqDDt9j7hd1rubBX1bfkPsd/APJlyeshusyTj+FqsUD/HDlvM9LRjY1HpU7i7yAlLQQ3851XKMLUPNFYu2r3bo8Wt/CCHtJvB4wYuH+7Wo3muudpU01ziJBxQrUWwPbUrG+7LvO1iEEVxB8l+8Vq0mU3Te7lJi1kGetm6xHNbtvQip5P2YUqvv+lLo/K8KoJDxsh63Y01JGwdmUDb8mnFlRx4J7hQJaoNEvz3cgnc4X8gDJD8sUOjGOPnbtz2QwTY+zj/5+FdLxWDCxNrHX5vvkVdJHcCqEfVvQTKfDMOUeKuhjI7GD7t3xRPfUxq19jjoLPe7aqn1Z1s= 96a38d44ba093bd1d1ecfd34119e94056030278b 0 iQIVAwUAVarUUyBXgaxoKi1yAQIfJw/+MG/0736F/9IvzgCTF6omIC+9kS8JH0n/JBGPhpbPAHK4xxjhOOz6m3Ia3c3HNoy+I6calwU6YV7k5dUzlyLhM0Z5oYpdrH+OBNxDEsD5SfhclfR63MK1kmgtD33izijsZ++6a+ZaVfyxpMTksKOktWSIDD63a5b/avb6nKY64KwJcbbeXPdelxvXV7TXYm0GvWc46BgvrHOJpYHCDaXorAn6BMq7EQF8sxdNK4GVMNMVk1njve0HOg3Kz8llPB/7QmddZXYLFGmWqICyUn1IsJDfePxzh8sOYVCbxAgitTJHJJmmH5gzVzw7t7ljtmxSJpcUGQJB2MphejmNFGfgvJPB9c6xOCfUqDjxN5m24V+UYesZntpfgs3lpfvE7785IpVnf6WfKG4PKty01ome/joHlDlrRTekKMlpiBapGMfv8EHvPBrOA+5yAHNfKsmcyCcjD1nvXYZ2/X9qY35AhdcBuNkyp55oPDOdtYIHfnOIxlYMKG1dusDx3Z4eveF0lQTzfRVoE5w+k9A2Ov3Zx0aiSkFFevJjrq5QBfs9dAiT8JYgBmWhaJzCtJm12lQirRMKR/br88Vwt/ry/UVY9cereMNvRYUGOGfC8CGGDCw4WDD+qWvyB3mmrXVuMlXxQRIZRJy5KazaQXsBWuIsx4kgGqC5Uo+yzpiQ1VMuCyI= 21aa1c313b05b1a85f8ffa1120d51579ddf6bf24 0 iQIVAwUAVbuouCBXgaxoKi1yAQL2ng//eI1w51F4YkDiUAhrZuc8RE/chEd2o4F6Jyu9laA03vbim598ntqGjX3+UkOyTQ/zGVeZfW2cNG8zkJjSLk138DHCYl2YPPD/yxqMOJp/a7U34+HrA0aE5Y2pcfx+FofZHRvRtt40UCngicjKivko8au7Ezayidpa/vQbc6dNvGrwwk4KMgOP2HYIfHgCirR5UmaWtNpzlLhf9E7JSNL5ZXij3nt6AgEPyn0OvmmOLyUARO/JTJ6vVyLEtwiXg7B3sF5RpmyFDhrkZ+MbFHgL4k/3y9Lb97WaZl8nXJIaNPOTPJqkApFY/56S12PKYK4js2OgU+QsX1XWvouAhEx6CC6Jk9EHhr6+9qxYFhBJw7RjbswUG6LvJy/kBe+Ei5UbYg9dATf3VxQ6Gqs19lebtzltERH2yNwaHyVeqqakPSonOaUyxGMRRosvNHyrTTor38j8d27KksgpocXzBPZcc1MlS3vJg2nIwZlc9EKM9z5R0J1KAi1Z/+xzBjiGRYg5EZY6ElAw30eCjGta7tXlBssJiKeHut7QTLxCZHQuX1tKxDDs1qlXlGCMbrFqo0EiF9hTssptRG3ZyLwMdzEjnh4ki6gzONZKDI8uayAS3N+CEtWcGUtiA9OwuiFXTwodmles/Mh14LEhiVZoDK3L9TPcY22o2qRuku/6wq6QKsg= 1a45e49a6bed023deb229102a8903234d18054d3 0 iQIVAwUAVeYa2SBXgaxoKi1yAQLWVA//Q7vU0YzngbxIbrTPvfFiNTJcT4bx9u1xMHRZf6QBIE3KtRHKTooJwH9lGR0HHM+8DWWZup3Vzo6JuWHMGoW0v5fzDyk2czwM9BgQQPfEmoJ/ZuBMevTkTZngjgHVwhP3tHFym8Rk9vVxyiZd35EcxP+4F817GCzD+K7XliIBqVggmv9YeQDXfEtvo7UZrMPPec79t8tzt2UadI3KC1jWUriTS1Fg1KxgXW6srD80D10bYyCkkdo/KfF6BGZ9SkF+U3b95cuqSmOfoyyQwUA3JbMXXOnIefnC7lqRC2QTC6mYDx5hIkBiwymXJBe8rpq/S94VVvPGfW6A5upyeCZISLEEnAz0GlykdpIy/NogzhmWpbAMOus05Xnen6xPdNig6c/M5ZleRxVobNrZSd7c5qI3aUUyfMKXlY1j9oiUTjSKH1IizwaI3aL/MM70eErBxXiLs2tpQvZeaVLn3kwCB5YhywO3LK0x+FNx4Gl90deAXMYibGNiLTq9grpB8fuLg9M90JBjFkeYkrSJ2yGYumYyP/WBA3mYEYGDLNstOby4riTU3WCqVl+eah6ss3l+gNDjLxiMtJZ/g0gQACaAvxQ9tYp5eeRMuLRTp79QQPxv97s8IyVwE/TlPlcSFlEXAzsBvqvsolQXRVi9AxA6M2davYabBYAgRf6rRfgujoU= 9a466b9f9792e3ad7ae3fc6c43c3ff2e136b718d 0 iQIVAwUAVg1oMSBXgaxoKi1yAQLPag/+Pv0+pR9b9Y5RflEcERUzVu92q+l/JEiP7PHP9pAZuXoQ0ikYBFo1Ygw8tkIG00dgEaLk/2b7E3OxaU9pjU3thoX//XpTcbkJtVhe7Bkjh9/S3dRpm2FWNL9n0qnywebziB45Xs8XzUwBZTYOkVRInYr/NzSo8KNbQH1B4u2g56veb8u/7GtEvBSGnMGVYKhVUZ3jxyDf371QkdafMOJPpogkZcVhXusvMZPDBYtTIzswyxBJ2jxHzjt8+EKs+FI3FxzvQ9Ze3M5Daa7xfiHI3sOgECO8GMVaJi0F49lttKx08KONw8xLlEof+cJ+qxLxQ42X5XOQglJ2/bv5ES5JiZYAti2XSXbZK96p4wexqL4hnaLVU/2iEUfqB9Sj6itEuhGOknPD9fQo1rZXYIS8CT5nGTNG4rEpLFN6VwWn1btIMNkEHw998zU7N3HAOk6adD6zGcntUfMBvQC3V4VK3o7hp8PGeySrWrOLcC/xLKM+XRonz46woJK5D8w8lCVYAxBWEGKAFtj9hv9R8Ye9gCW0Q8BvJ7MwGpn+7fLQ1BVZdV1LZQTSBUr5u8mNeDsRo4H2hITQRhUeElIwlMsUbbN078a4JPOUgPz1+Fi8oHRccBchN6I40QohL934zhcKXQ+NXYN8BgpCicPztSg8O8Y/qvhFP12Zu4tOH8P/dFY= b66e3ca0b90c3095ea28dfd39aa24247bebf5c20 0 iQIVAwUAViarTyBXgaxoKi1yAQLZgRAAh7c7ebn7kUWI5M/b/T6qHGjFrU5azkjamzy9IG+KIa2hZgSMxyEM7JJUFqKP4TiWa3sW03bjKGSM/SjjDSSyheX+JIVSPNyKrBwneYhPq45Ius8eiHziClkt0CSsl2d9xDRpI0JmHbN0Pf8nh7rnbL+231GDAOT6dP+2S8K1HGa/0BgEcL9gpYs4/2GyjL+hBSUjyrabzvwe48DCN5W0tEJbGFw5YEADxdfbVbNEuXL81tR4PFGiJxPW0QKRLDB74MWmiWC0gi2ZC/IhbNBZ2sLb6694d4Bx4PVwtiARh63HNXVMEaBrFu1S9NcMQyHvAOc6Zw4izF/PCeTcdEnPk8J1t5PTz09Lp0EAKxe7CWIViy350ke5eiaxO3ySrNMX6d83BOHLDqEFMSWm+ad+KEMT4CJrK4X/n/XMgEFAaU5nWlIRqrLRIeU2Ifc625T0Xh4BgTqXPpytQxhgV5b+Fi6duNk4cy+QnHT4ymxI6BPD9HvSQwc+O7h37qjvJVZmpQX6AP8O75Yza8ZbcYKRIIxZzOkwNpzE5A/vpvP5bCRn7AGcT3ORWmAYr/etr3vxUvt2fQz6U/R4S915V+AeWBdcp+uExu6VZ42M0vhhh0lyzx1VRJGVdV+LoxFKkaC42d0yT+O1QEhSB7WL1D3/a/iWubv6ieB/cvNMhFaK9DA= 47dd34f2e7272be9e3b2a5a83cd0d20be44293f4 0 iQIVAwUAVjZiKiBXgaxoKi1yAQKBWQ/+JcE37vprSOA5e0ezs/avC7leR6hTlXy9O5bpFnvMpbVMTUp+KfBE4HxTT0KKXKh9lGtNaQ+lAmHuy1OQE1hBKPIaCUd8/1gunGsXgRM3TJ9LwjFd4qFpOMxvOouc6kW5kmea7V9W2fg6aFNjjc/4/0J3HMOIjmf2fFz87xqR1xX8iezJ57A4pUPNViJlOWXRzfa56cI6VUe5qOMD0NRXcY+JyI5qW25Y/aL5D9loeKflpzd53Ue+Pu3qlhddJd3PVkaAiVDH+DYyRb8sKgwuiEsyaBO18IBgC8eDmTohEJt6707A+WNhwBJwp9aOUhHC7caaKRYhEKuDRQ3op++VqwuxbFRXx22XYR9bEzQIlpsv9GY2k8SShU5MZqUKIhk8vppFI6RaID5bmALnLLmjmXfSPYSJDzDuCP5UTQgI3PKPOATorVrqMdKzfb7FiwtcTvtHAXpOgLaY9P9XIePbnei6Rx9TfoHYDvzFWRqzSjl21xR+ZUrJtG2fx7XLbMjEAZJcnjP++GRvNbHBOi57aX0l2LO1peQqZVMULoIivaoLFP3i16RuXXQ/bvKyHmKjJzGrLc0QCa0yfrvV2m30RRMaYlOv7ToJfdfZLXvSAP0zbAuDaXdjGnq7gpfIlNE3xM+kQ75Akcf4V4fK1p061EGBQvQz6Ov3PkPiWL/bxrQ= 1aa5083cbebbe7575c88f3402ab377539b484897 0 iQIVAwUAVkEdCCBXgaxoKi1yAQKdWg//crTr5gsnHQppuD1p+PPn3/7SMsWJ7bgbuaXgERDLC0zWMfhM2oMmu/4jqXnpangdBVvb0SojejgzxoBo9FfRQiIoKt0vxmmn+S8CrEwb99rpP4M7lgyMAInKPMXQdYxkoDNwL70Afmog6eBtlxjYnu8nmUE/swu6JoVns+tF8UOvIKFYbuCcGujo2pUOQC0xBGiHeHSGRDJOlWmY2d7D/PkQtQE/u/d4QZt7enTHMiV44XVJ8+0U0f1ZQE7V+hNWf+IjwcZtL95dnQzUKs6tXMIln/OwO+eJ3d61BfLvmABvCwUC9IepPssNSFBUfGqBAP5wXOzFIPSYn00IWpmZtCnpUNL99X1IV3RP+p99gnEDTScQFPYt5B0q5I1nFdRh1p48BSF/kjPA7V++UfBwMXrrYLKhUR9BjmrRzYnyXJKwbH6iCNj5hsXUkVrBdBi/FnMczgsVILfFcIXUfnJD3E/dG+1lmuObg6dEynxiGChTuaR4KkLa5ZRkUcUl6fWlSRsqSNbGEEbdwcI+nTCZqJUlLSghumhs0Z89Hs1nltBd1ALX2VLJEHrKMrFQ8NfEBeCB6ENqMJi5qPlq354MCdGOZ9RvisX/HlxE4Q61BW0+EwnyXSch6LFSOS3axOocUazMoK1XiOTJSv/5bAsnwb0ztDWeUj9fZEJL+SWtgB8= 2d437a0f3355834a9485bbbeb30a52a052c98f19 0 iQIVAwUAVl5U9CBXgaxoKi1yAQLocg//a4YFz9UVSIEzVEJMUPJnN2dBvEXRpwpb5CdKPd428+18K6VWZd5Mc6xNNRV5AV/hCYylgqDplIvyOvwCj7uN8nEOrLUQQ0Pp37M5ZIX8ZVCK/wgchJ2ltabUG1NrZ7/JA84U79VGLAECMnD0Z9WvZDESpVXmdXfxrk1eCc3omRB0ofNghEx+xpYworfZsu8aap1GHQuBsjPv4VyUWGpMq/KA01PdxRTELmrJnfSyr0nPKwxlI5KsbA1GOe+Mk3tp5HJ42DZqLtKSGPirf6E+6lRJeB0H7EpotN4wD3yZDsw6AgRb2C/ay/3T3Oz7CN+45mwuujV9Cxx5zs1EeOgZcqgA/hXMcwlQyvQDMrWpO8ytSBm6MhOuFOTB3HnUxfsnfSocLJsbNwGWKceAzACcXSqapveVAz/7h+InFgl/8Qce28UJdnX5wro5gP6UWt+xrvc7vfmVGgI3oxbiOUrfglhkjmrxBjEiDQy4BWH7HWMZUVxnqPQRcxIE10+dv0KtM/PBkbUtnbGJ88opFBGkFweje5vQcZy/duuPEIufRkPr8EV47QjOxlvldEjlLq3+QUdJZEgCIFw1X0y7Pix4dsPFjwOmAyo4El1ePrdFzG3dXSVA3eHvMDRnYnNlue9wHvKhYbBle5xTOZBgGuMzhDVe+54JLql5JYr4WrI1pvA= ea389970c08449440587712117f178d33bab3f1e 0 iQIVAwUAVociGyBXgaxoKi1yAQJx9Q//TzMypcls5CQW3DM9xY1Q+RFeIw1LcDIev6NDBjUYxULb2WIK2qPw4Th5czF622SMd+XO/kiQeWYp9IW90MZOUVT1YGgUPKlKWMjkf0lZEPzprHjHq0+z/no1kBCBQg2uUOLsb6Y7zom4hFCyPsxXOk5nnxcFEK0VDbODa9zoKb/flyQ7rtzs+Z6BljIQ0TJAJsXs+6XgrW1XJ/f6nbeqsQyPklIBJuGKiaU1Pg8wQe6QqFaO1NYgM3hBETku6r3OTpUhu/2FTUZ7yDWGGzBqmifxzdHoj7/B+2qzRpII77PlZqoe6XF+UOObSFnhKvXKLjlGY5cy3SXBMbHkPcYtHua8wYR8LqO2bYYnsDd9qD0DJ+LlqH0ZMUkB2Cdk9q/cp1PGJWGlYYecHP87DLuWKwS+a6LhVI9TGkIUosVtLaIMsUUEz83RJFb4sSGOXtjk5DDznn9QW8ltXXMTdGQwFq1vmuiXATYenhszbvagrnbAnDyNFths4IhS1jG8237SB36nGmO3zQm5V7AMHfSrISB/8VPyY4Si7uvAV2kMWxuMhYuQbBwVx/KxbKrYjowuvJvCKaV101rWxvSeU2wDih20v+dnQKPveRNnO8AAK/ICflVVsISkd7hXcfk+SnhfxcPQTr+HQIJEW9wt5Q8WbgHk9wuR8kgXQEX6tCGpT/w= 158bdc8965720ca4061f8f8d806563cfc7cdb62e 0 iQIVAwUAVqBhFyBXgaxoKi1yAQLJpQ//S8kdgmVlS+CI0d2hQVGYWB/eK+tcntG+bZKLto4bvVy5d0ymlDL0x7VrJMOkwzkU1u/GaYo3L6CVEiM/JGCgB32bllrpx+KwQ0AyHswMZruo/6xrjDIYymLMEJ9yonXBZsG7pf2saYTHm3C5/ZIPkrDZSlssJHJDdeWqd75hUnx3nX8dZ4jIIxYDhtdB5/EmuEGOVlbeBHVpwfDXidSJUHJRwJvDqezUlN003sQdUvOHHtRqBrhsYEhHqPMOxDidAgCvjSfWZQKOTKaPE/gQo/BP3GU++Fg55jBz+SBXpdfQJI2Gd8FZfjLkhFa9vTTTcd10YCd4CZbYLpj/4R2xWj1U4oTVEFa6d+AA5Yyu8xG53XSCCPyzfagyuyfLqsaq5r1qDZO/Mh5KZCTvc9xSF5KXj57mKvzMDpiNeQcamGmsV4yXxymKJKGMQvbnzqp+ItIdbnfk38Nuac8rqNnGmFYwMIPa50680vSZT/NhrlPJ8FVTJlfHtSUZbdjPpsqw7BgjFWaVUdwgCKIGERiK7zfR0innj9rF5oVwT8EbKiaR1uVxOKnTwZzPCbdO1euNg/HutZLVQmugiLAv5Z38L3YZf5bH7zJdUydhiTI4mGn/mgncsKXoSarnnduhoYu9OsQZc9pndhxjAEuAslEIyBsLy81fR2HOhUzw5FGNgdY= 2408645de650d8a29a6ce9e7dce601d8dd0d1474 0 iQIVAwUAVq/xFSBXgaxoKi1yAQLsxhAAg+E6uJCtZZOugrrFi9S6C20SRPBwHwmw22PC5z3Ufp9Vf3vqSL/+zmWI9d/yezIVcTXgM9rKCvq58sZvo4FuO2ngPx7bL9LMJ3qx0IyHUKjwa3AwrzjSzvVhNIrRoimD+lVBI/GLmoszpMICM+Nyg3D41fNJKs6YpnwwsHNJkjMwz0n2SHAShWAgIilyANNVnwnzHE68AIkB/gBkUGtrjf6xB9mXQxAv4GPco/234FAkX9xSWsM0Rx+JLLrSBXoHmIlmu9LPjC0AKn8/DDke+fj7bFaF7hdJBUYOtlYH6f7NIvyZSpw0FHl7jPxoRCtXzIV+1dZEbbIMIXzNtzPFVDYDfMhLqpTgthkZ9x0UaMaHecCUWYYBp8G/IyVS40GJodl8xnRiXUkFejbK/NDdR1f9iZS0dtiFu66cATMdb6d+MG+zW0nDKiQmBt6bwynysqn4g3SIGQFEPyEoRy0bXiefHrlkeHbdfc4zgoejx3ywcRDMGvUbpWs5C43EPu44irKXcqC695vAny3A7nZpt/XP5meDdOF67DNQPvhFdjPPbJBpSsUi2hUlZ+599wUfr3lNVzeEzHT7XApTOf6ysuGtHH3qcVHpFqQSRL1MI0f2xL13UadgTVWYrnHEis7f+ncwlWiR0ucpJB3+dQQh3NVGVo89MfbIZPkA8iil03U= b698abf971e7377d9b7ec7fc8c52df45255b0329 0 iQIVAwUAVrJ4YCBXgaxoKi1yAQJsKw/+JHSR0bIyarO4/VilFwsYxCprOnPxmUdS4qc4yjvpbf7Dqqr/OnOHJA29LrMoqWqsHgREepemjqiNindwNtlZec+KgmbF08ihSBBpls96UTTYTcytKRkkbrB+FhwB0iDl/o8RgGPniyG6M7gOp6p8pXQVRCOToIY1B/G0rtpkcU1N3GbiZntO5Fm/LPAVIE74VaDsamMopQ/wEB8qiERngX/M8SjO1ZSaVNW6KjRUsarLXQB9ziVJBolK/WnQsDwEeuWU2udpjBiOHnFC6h84uBpc8rLGhr419bKMJcjgl+0sl2zHGPY2edQYuJqVjVENzf4zzZA+xPgKw3GrSTpd37PEnGU/fufdJ0X+pp3kvmO1cV3TsvVMTCn7NvS6+w8SGdHdwKQQwelYI6vmJnjuOCATbafJiHMaOQ0GVYYk6PPoGrYcQ081x6dStCMaHIPOV1Wirwd2wq+SN9Ql8H6njftBf5Sa5tVWdW/zrhsltMsdZYZagZ/oFT3t83exL0rgZ96bZFs0j3HO3APELygIVuQ6ybPsFyToMDbURNDvr7ZqPKhQkkdHIUMqEez5ReuVgpbO9CWV/yWpB1/ZCpjNBZyDvw05kG2mOoC7AbHc8aLUS/8DetAmhwyb48LW4qjfUkO7RyxVSxqdnaBOMlsg1wsP2S+SlkZKsDHjcquZJ5U= d493d64757eb45ada99fcb3693e479a51b7782da 0 iQIVAwUAVtYt4SBXgaxoKi1yAQL6TQ/9FzYE/xOSC2LYqPdPjCXNjGuZdN1WMf/8fUMYT83NNOoLEBGx37C0bAxgD4/P03FwYMuP37IjIcX8vN6fWvtG9Oo0o2n/oR3SKjpsheh2zxhAFX3vXhFD4U18wCz/DnM0O1qGJwJ49kk/99WNgDWeW4n9dMzTFpcaeZBCu1REbZQS40Z+ArXTDCr60g5TLN1XR1WKEzQJvF71rvaE6P8d3GLoGobTIJMLi5UnMwGsnsv2/EIPrWHQiAY9ZEnYq6deU/4RMh9c7afZie9I+ycIA/qVH6vXNt3/a2BP3Frmv8IvKPzqwnoWmIUamew9lLf1joD5joBy8Yu+qMW0/s6DYUGQ4Slk9qIfn6wh4ySgT/7FJUMcayx9ONDq7920RjRc+XFpD8B3Zhj2mM+0g9At1FgX2w2Gkf957oz2nlgTVh9sdPvP6UvWzhqszPMpdG5Vt0oc5vuyobW333qSkufCxi5gmH7do1DIzErMcy8b6IpZUDeQ/dakKwLQpZVVPF15IrNa/zsOW55SrGrL8/ErM/mXNQBBAqvRsOLq2njFqK2JaoG6biH21DMjHVZFw2wBRoLQxbOppfz2/e3mNkNy9HjgJTW3+0iHWvRzMSjwRbk9BlbkmH6kG5163ElHq3Ft3uuQyZBL9I5SQxlHi9s/CV0YSTYthpWR3ChKIMoqBQ0= ae279d4a19e9683214cbd1fe8298cf0b50571432 0 iQIVAwUAVvqzViBXgaxoKi1yAQKUCxAAtctMD3ydbe+li3iYjhY5qT0wyHwPr9fcLqsQUJ4ZtD4sK3oxCRZFWFxNBk5bIIyiwusSEJPiPddoQ7NljSZlYDI0HR3R4vns55fmDwPG07Ykf7aSyqr+c2ppCGzn2/2ID476FNtzKqjF+LkVyadgI9vgZk5S4BgdSlfSRBL+1KtB1BlF5etIZnc5U9qs1uqzZJc06xyyF8HlrmMZkAvRUbsx/JzA5LgzZ2WzueaxZgYzYjDk0nPLgyPPBj0DVyWXnW/kdRNmKHNbaZ9aZlWmdPCEoq5iBm71d7Xoa61shmeuVZWvxHNqXdjVMHVeT61cRxjdfxTIkJwvlRGwpy7V17vTgzWFxw6QJpmr7kupRo3idsDydLDPHGUsxP3uMZFsp6+4rEe6qbafjNajkRyiw7kVGCxboOFN0rLVJPZwZGksEIkw58IHcPhZNT1bHHocWOA/uHJTAynfKsAdv/LDdGKcZWUCFOzlokw54xbPvdrBtEOnYNp15OY01IAJd2FCUki5WHvhELUggTjfank1Tc3/Rt1KrGOFhg80CWq6eMiuiWkHGvYq3fjNLbgjl3JJatUFoB+cX1ulDOGsLJEXQ4v5DNHgel0o2H395owNlStksSeW1UBVk0hUK/ADtVUYKAPEIFiboh1iDpEOl40JVnYdsGz3w5FLj2w+16/1vWs= 740156eedf2c450aee58b1a90b0e826f47c5da64 0 iQIVAwUAVxLGMCBXgaxoKi1yAQLhIg/8DDX+sCz7LmqO47/FfTo+OqGR+bTTqpfK3WebitL0Z6hbXPj7s45jijqIFGqKgMPqS5oom1xeuGTPHdYA0NNoc/mxSCuNLfuXYolpNWPN71HeSDRV9SnhMThG5HSxI+P0Ye4rbsCHrVV+ib1rV81QE2kZ9aZsJd0HnGd512xJ+2ML7AXweM/4lcLmMthN+oi/dv1OGLzfckrcr/fEATCLZt55eO7idx11J1Fk4ptQ6dQ/bKznlD4hneyy1HMPsGxw+bCXrMF2C/nUiRLHdKgGqZ+cDq6loQRfFlQoIhfoEnWC424qbjH4rvHgkZHqC59Oi/ti9Hi75oq9Tb79yzlCY/fGsdrlJpEzrTQdHFMHUoO9CC+JYObXHRo3ALnC5350ZBKxlkdpmucrHTgcDabfhRlx9vDxP4RDopm2hAjk2LJH7bdxnGEyZYkTOZ3hXKnVpt2hUQb4jyzzC9Kl47TFpPKNVKI+NLqRRZAIdXXiy24KD7WzzE6L0NNK0/IeqKBENLL8I1PmDQ6XmYTQVhTuad1jjm2PZDyGiXmJFZO1O/NGecVTvVynKsDT6XhEvzyEtjXqD98rrhbeMHTcmNSwwJMDvm9ws0075sLQyq2EYFG6ECWFypdA/jfumTmxOTkMtuy/V1Gyq7YJ8YaksZ7fXNY9VuJFP72grmlXc6Dvpr4= f85de28eae32e7d3064b1a1321309071bbaaa069 0 iQIVAwUAVyZQaiBXgaxoKi1yAQJhCQ//WrRZ55k3VI/OgY+I/HvgFHOC0sbhe207Kedxvy00a3AtXM6wa5E95GNX04QxUfTWUf5ZHDfEgj0/mQywNrH1oJG47iPZSs+qXNLqtgAaXtrih6r4/ruUwFCRFxqK9mkhjG61SKicw3Q7uGva950g6ZUE5BsZ7XJWgoDcJzWKR+AH992G6H//Fhi4zFQAmB34++sm80wV6wMxVKA/qhQzetooTR2x9qrHpvCKMzKllleJe48yzPLJjQoaaVgXCDav0eIePFNw0WvVSldOEp/ADDdTGa65qsC1rO2BB1Cu5+frJ/vUoo0PwIgqgD6p2i41hfIKvkp6130TxmRVxUx+ma8gBYEpPIabV0flLU72gq8lMlGBBSnQ+fcZsfs/Ug0xRN0tzkEScmZFiDxRGk0y7IalXzv6irwOyC2fZCajXGJDzkROQXWMgy9eKkwuFhZBmPVYtrATSq3jHLVmJg5vfdeiVzA6NKxAgGm2z8AsRrijKK8WRqFYiH6xcWKG5u+FroPQdKa0nGCkPSTH3tvC6fAHTVm7JeXch5QE/LiS9Y575pM2PeIP+k+Fr1ugK0AEvYJAXa5UIIcdszPyI+TwPTtWaQ83X99qGAdmRWLvSYjqevOVr7F/fhO3XKFXRCcHA3EzVYnG7nWiVACYF3H2UgN4PWjStbx/Qhhdi9xAuks= a56296f55a5e1038ea5016dace2076b693c28a56 0 iQIVAwUAVyZarCBXgaxoKi1yAQL87g/8D7whM3e08HVGDHHEkVUgqLIfueVy1mx0AkRvelmZmwaocFNGpZTd3AjSwy6qXbRNZFXrWU85JJvQCi3PSo/8bK43kwqLJ4lv+Hv2zVTvz30vbLWTSndH3oVRu38lIA7b5K9J4y50pMCwjKLG9iyp+aQG4RBz76fJMlhXy0gu38A8JZVKEeAnQCbtzxKXBzsC8k0/ku/bEQEoo9D4AAGlVTbl5AsHMp3Z6NWu7kEHAX/52/VKU2I0LxYqRxoL1tjTVGkAQfkOHz1gOhLXUgGSYmA9Fb265AYj9cnGWCfyNonlE0Rrk2kAsrjBTGiLyb8WvK/TZmRo4ZpNukzenS9UuAOKxA22Kf9+oN9kKBu1HnwqusYDH9pto1WInCZKV1al7DMBXbGFcnyTXk2xuiTGhVRG5LzCO2QMByBLXiYl77WqqJnzxK3v5lAc/immJl5qa3ATUlTnVBjAs+6cbsbCoY6sjXCT0ClndA9+iZZ1TjPnmLrSeFh5AoE8WHmnFV6oqGN4caX6wiIW5vO+x5Q2ruSsDrwXosXIYzm+0KYKRq9O+MaTwR44Dvq3/RyeIu/cif/Nc7B8bR5Kf7OiRf2T5u97MYAomwGcQfXqgUfm6y7D3Yg+IdAdAJKitxhRPsqqdxIuteXMvOvwukXNDiWP1zsKoYLI37EcwzvbGLUlZvg= aaabed77791a75968a12b8c43ad263631a23ee81 0 iQIVAwUAVzpH4CBXgaxoKi1yAQLm5A/9GUYv9CeIepjcdWSBAtNhCBJcqgk2cBcV0XaeQomfxqYWfbW2fze6eE+TrXPKTX1ajycgqquMyo3asQolhHXwasv8+5CQxowjGfyVg7N/kyyjgmJljI+rCi74VfnsEhvG/J4GNr8JLVQmSICfALqQjw7XN8doKthYhwOfIY2vY419613v4oeBQXSsItKC/tfKw9lYvlk4qJKDffJQFyAekgv43ovWqHNkl4LaR6ubtjOsxCnxHfr7OtpX3muM9MLT/obBax5I3EsmiDTQBOjbvI6TcLczs5tVCnTa1opQsPUcEmdA4WpUEiTnLl9lk9le/BIImfYfEP33oVYmubRlKhJYnUiu89ao9L+48FBoqCY88HqbjQI1GO6icfRJN/+NLVeE9wubltbWFETH6e2Q+Ex4+lkul1tQMLPcPt10suMHnEo3/FcOTPt6/DKeMpsYgckHSJq5KzTg632xifyySmb9qkpdGGpY9lRal6FHw3rAhRBqucMgxso4BwC51h04RImtCUQPoA3wpb4BvCHba/thpsUFnHefOvsu3ei4JyHXZK84LPwOj31PcucNFdGDTW6jvKrF1vVUIVS9uMJkJXPu0V4i/oEQSUKifJZivROlpvj1eHy3KeMtjq2kjGyXY2KdzxpT8wX/oYJhCtm1XWMui5f24XBjE6xOcjjm8k4= a9764ab80e11bcf6a37255db7dd079011f767c6c 0 iQIVAwUAV09KHyBXgaxoKi1yAQJBWg/+OywRrqU+zvnL1tHJ95PgatsF7S4ZAHZFR098+oCjUDtKpvnm71o2TKiY4D5cckyD2KNwLWg/qW6V+5+2EYU0Y/ViwPVcngib/ZeJP+Nr44TK3YZMRmfFuUEEzA7sZ2r2Gm8eswv//W79I0hXJeFd/o6FgLnn7AbOjcOn3IhWdGAP6jUHv9zyJigQv6K9wgyvAnK1RQE+2CgMcoyeqao/zs23IPXI6XUHOwfrQ7XrQ83+ciMqN7XNRx+TKsUQoYeUew4AanoDSMPAQ4kIudsP5tOgKeLRPmHX9zg6Y5S1nTpLRNdyAxuNuyZtkQxDYcG5Hft/SIx27tZUo3gywHL2U+9RYD2nvXqaWzT3sYB2sPBOiq7kjHRgvothkXemAFsbq2nKFrN0PRua9WG4l3ny0xYmDFPlJ/s0E9XhmQaqy+uXtVbA2XdLEvE6pQ0YWbHEKMniW26w6LJkx4IV6RX/7Kpq7byw/bW65tu/BzgISKau5FYLY4CqZJH7f8QBg3XWpzB91AR494tdsD+ugM45wrY/6awGQx9CY5SAzGqTyFuSFQxgB2rBurb01seZPf8nqG8V13UYXfX/O3/WMOBMr7U/RVqmAA0ZMYOyEwfVUmHqrFjkxpXX+JdNKRiA1GJp5sdRpCxSeXdQ/Ni6AAGZV2IyRb4G4Y++1vP4yPBalas= 26a5d605b8683a292bb89aea11f37a81b06ac016 0 iQIVAwUAV3bOsSBXgaxoKi1yAQLiDg//fxmcNpTUedsXqEwNdGFJsJ2E25OANgyv1saZHNfbYFWXIR8g4nyjNaj2SjtXF0wzOq5aHlMWXjMZPOT6pQBdTnOYDdgv+O8DGpgHs5x/f+uuxtpVkdxR6uRP0/ImlTEtDix8VQiN3nTu5A0N3C7E2y+D1JIIyTp6vyjzxvGQTY0MD/qgB55Dn6khx8c3phDtMkzmVEwL4ItJxVRVNw1m+2FOXHu++hJEruJdeMV0CKOV6LVbXHho+yt3jQDKhlIgJ65EPLKrf+yRalQtSWpu7y/vUMcEUde9XeQ5x05ebCiI4MkJ0ULQro/Bdx9vBHkAstUC7D+L5y45ZnhHjOwxz9c3GQMZQt1HuyORqbBhf9hvOkUQ2GhlDHc5U04nBe0VhEoCw9ra54n+AgUyqWr4CWimSW6pMTdquCzAAbcJWgdNMwDHrMalCYHhJksKFARKq3uSTR1Noz7sOCSIEQvOozawKSQfOwGxn/5bNepKh4uIRelC1uEDoqculqCLgAruzcMNIMndNVYaJ09IohJzA9jVApa+SZVPAeREg71lnS3d8jaWh1Lu5JFlAAKQeKGVJmNm40Y3HBjtHQDrI67TT59oDAhjo420Wf9VFCaj2k0weYBLWSeJhfUZ5x3PVpAHUvP/rnHPwNYyY0wVoQEvM/bnQdcpICmKhqcK+vKjDrM= 519bb4f9d3a47a6e83c2b414d58811ed38f503c2 0 iQIVAwUAV42tNyBXgaxoKi1yAQI/Iw//V0NtxpVD4sClotAwffBVW42Uv+SG+07CJoOuFYnmHZv/plOzXuuJlmm95L00/qyRCCTUyAGxK/eP5cAKP2V99ln6rNhh8gpgvmZlnYjU3gqFv8tCQ+fkwgRiWmgKjRL6/bK9FY5cO7ATLVu3kCkFd8CEgzlAaUqBfkNFxZxLDLvKqRlhXxVXhKjvkKg5DZ6eJqRQY7w3UqqR+sF1rMLtVyt490Wqv7YQKwcvY7MEKTyH4twGLx/RhBpBi+GccVKvWC011ffjSjxqAfQqrrSVt0Ld1Khj2/p1bDDYpTgtdDgCzclSXWEQpmSdFRBF5wYs/pDMUreI/E6mlWkB4hfZZk1NBRPRWYikXwnhU3ziubCGesZDyBYLrK1vT+tf6giseo22YQmDnOftbS999Pcn04cyCafeFuOjkubYaINB25T20GS5Wb4a0nHPRAOOVxzk/m/arwYgF0ZZZDDvJ48TRMDf3XOc1jc5qZ7AN/OQKbvh2B08vObnnPm3lmBY1qOnhwzJxpNiq+Z/ypokGXQkGBfKUo7rWHJy5iXLb3Biv9AhxY9d5pSTjBmTAYJEic3q03ztzlnfMyi+C13+YxFAbSSNGBP8Hejkkz0NvmB1TBuCKpnZA8spxY5rhZ/zMx+cCw8hQvWHHDUURps7SQvZEfrJSCGJFPDHL3vbfK+LNwI= 299546f84e68dbb9bd026f0f3a974ce4bdb93686 0 iQIcBAABCAAGBQJXn3rFAAoJELnJ3IJKpb3VmZoQAK0cdOfi/OURglnN0vYYGwdvSXTPpZauPEYEpwML3dW1j6HRnl5L+H8D8vlYzahK95X4+NNBhqtyyB6wmIVI0NkYfXfd6ACntJE/EnTdLIHIP2NAAoVsggIjiNr26ubRegaD5ya63Ofxz+Yq5iRsUUfHet7o+CyFhExyzdu+Vcz1/E9GztxNfTDVpC/mf+RMLwQTfHOhoTVbaamLCmGAIjw39w72X+vRMJoYNF44te6PvsfI67+6uuC0+9DjMnp5eL/hquSQ1qfks71rnWwxuiPcUDZloIueowVmt0z0sO4loSP1nZ5IP/6ZOoAzSjspqsxeay9sKP0kzSYLGsmCi29otyVSnXiKtyMCW5z5iM6k8XQcMi5mWy9RcpqlNYD7RUTn3g0+a8u7F6UEtske3/qoweJLPhtTmBNOfDNw4JXwOBSZea0QnIIjCeCc4ZGqfojPpbvcA4rkRpxI23YoMrT2v/kp4wgwrqK9fi8ctt8WbXpmGoAQDXWj2bWcuzj94HsAhLduFKv6sxoDz871hqjmjjnjQSU7TSNNnVzdzwqYkMB+BvhcNYxk6lcx3Aif3AayGdrWDubtU/ZRNoLzBwe6gm0udRMXBj4D/60GD6TIkYeL7HjJwfBb6Bf7qvQ6y7g0zbYG9uwBmMeduU7XchErGqQGSEyyJH3DG9OLaFOj ccd436f7db6d5d7b9af89715179b911d031d44f1 0 iQIVAwUAV8h7F0emf/qjRqrOAQjmdhAAgYhom8fzL/YHeVLddm71ZB+pKDviKASKGSrBHY4D5Szrh/pYTedmG9IptYue5vzXpspHAaGvZN5xkwrz1/5nmnCsLA8DFaYT9qCkize6EYzxSBtA/W1S9Mv5tObinr1EX9rCSyI4HEJYE8i1IQM5h07SqUsMKDoasd4e29t6gRWg5pfOYq1kc2MTck35W9ff1Fii8S28dqbO3cLU6g5K0pT0JLCZIq7hyTNQdxHAYfebxkVl7PZrZR383IrnyotXVKFFc44qinv94T50uR4yUNYPQ8Gu0TgoGQQjBjk1Lrxot2xpgPQAy8vx+EOJgpg/yNZnYkmJZMxjDkTGVrwvXtOXZzmy2jti7PniET9hUBCU7aNHnoJJLzIf+Vb1CIRP0ypJl8GYCZx6HIYwOQH6EtcaeUqq3r+WXWv74ijIE7OApotmutM9buTvdOLdZddBzFPIjykc6cXO+W4E0kl6u9/OHtaZ3Nynh0ejBRafRWAVw2yU3T9SgQyICsmYWJCThkj14WqCJr2b7jfGlg9MkQOUG6/3f4xz2R3SgyUD8KiGsq/vdBE53zh0YA9gppLoum6AY+z61G1NhVGlrtps90txZBehuARUUz2dJC0pBMRy8XFwXMewDSIe6ATg25pHZsxHfhcalBpJncBl8pORs7oQl+GKBVxlnV4jm1pCzLU= 149433e68974eb5c63ccb03f794d8b57339a80c4 0 iQIcBAABAgAGBQJX8AfCAAoJELnJ3IJKpb3VnNAP/3umS8tohcZTr4m6DJm9u4XGr2m3FWQmjTEfimGpsOuBC8oCgsq0eAlORYcV68zDax+vQHQu3pqfPXaX+y4ZFDuz0ForNRiPJn+Q+tj1+NrOT1e8h4gH0nSK4rDxEGaa6x01fyC/xQMqN6iNfzbLLB7+WadZlyBRbHaUeZFDlPxPDf1rjDpu1vqwtOrVzSxMasRGEceiUegwsFdFMAefCq0ya/pKe9oV+GgGfR4qNrP7BfpOBcN/Po/ctkFCbLOhHbu6M7HpBSiD57BUy5lfhQQtSjzCKEVTyrWEH0ApjjXKuJzLSyq7xsHKQSOPMgGQprGehyzdCETlZOdauGrC0t9vBCr7kXEhXtycqxBC03vknA2eNeV610VX+HgO9VpCVZWHtENiArhALCcpoEsJvT29xCBYpSii/wnTpYJFT9yW8tjQCxH0zrmEZJvO1/nMINEBQFScB/nzUELn9asnghNf6vMpSGy0fSM27j87VAXCzJ5lqa6WCL/RrKgvYflow/m5AzUfMQhpqpH1vmh4ba1zZ4123lgnW4pNZDV9kmwXrEagGbWe1rnmsMzHugsECiYQyIngjWzHfpHgyEr49Uc5bMM1MlTypeHYYL4kV1jJ8Ou0SC4aV+49p8Onmb2NlVY7JKV7hqDCuZPI164YXMxhPNst4XK0/ENhoOE+8iB6 438173c415874f6ac653efc1099dec9c9150e90f 0 iQIVAwUAWAZ3okemf/qjRqrOAQj89xAAw/6QZ07yqvH+aZHeGQfgJ/X1Nze/hSMzkqbwGkuUOWD5ztN8+c39EXCn8JlqyLUPD7uGzhTV0299k5fGRihLIseXr0hy/cvVW16uqfeKJ/4/qL9zLS3rwSAgWbaHd1s6UQZVfGCb8V6oC1dkJxfrE9h6kugBqV97wStIRxmCpMDjsFv/zdNwsv6eEdxbiMilLn2/IbWXFOVKJzzv9iEY5Pu5McFR+nnrMyUZQhyGtVPLSkoEPsOysorfCZaVLJ6MnVaJunp9XEv94Pqx9+k+shsQvJHWkc0Nnb6uDHZYkLR5v2AbFsbJ9jDHsdr9A7qeQTiZay7PGI0uPoIrkmLya3cYbU1ADhwloAeQ/3gZLaJaKEjrXcFSsz7AZ9yq74rTwiPulF8uqZxJUodk2m/zy83HBrxxp/vgxWJ5JP2WXPtB8qKY+05umAt4rQS+fd2H/xOu2V2d5Mq1WmgknLBLC0ItaNaf91sSHtgEy22GtcvWQE7S6VWU1PoSYmOLITdJKAsmb7Eq+yKDW9nt0lOpUu2wUhBGctlgXgcWOmJP6gL6edIg66czAkVBp/fpKNl8Z/A0hhpuH7nW7GW/mzLVQnc+JW4wqUVkwlur3NRfvSt5ZyTY/SaR++nRf62h7PHIjU+f0kWQRdCcEQ0X38b8iAjeXcsOW8NCOPpm0zcz3i8= eab27446995210c334c3d06f1a659e3b9b5da769 0 iQIcBAABCAAGBQJYGNsXAAoJELnJ3IJKpb3Vf30QAK/dq5vEHEkufLGiYxxkvIyiRaswS+8jamXeHMQrdK8CuokcQYhEv9xiUI6FMIoX4Zc0xfoFCBc+X4qE+Ed9SFYWgQkDs/roJq1C1mTYA+KANMqJkDt00QZq536snFQvjCXAA5fwR/DpgGOOuGMRfvbjh7x8mPyVoPr4HDQCGFXnTYdn193HpTOqUsipzIV5OJqQ9p0sfJjwKP4ZfD0tqqdjTkNwMyJuwuRaReXFvGGCjH2PqkZE/FwQG0NJJjt0xaMUmv5U5tXHC9tEVobVV/qEslqfbH2v1YPF5d8Jmdn7F76FU5J0nTd+3rIVjYGYSt01cR6wtGnzvr/7kw9kbChw4wYhXxnmIALSd48FpA1qWjlPcAdHfUUwObxOxfqmlnBGtAQFK+p5VXCsxDZEIT9MSxscfCjyDQZpkY5S5B3PFIRg6V9bdl5a4rEt27aucuKTHj1Ok2vip4WfaIKk28YMjjzuOQRbr6Pp7mJcCC1/ERHUJdLsaQP+dy18z6XbDjX3O2JDRNYbCBexQyV/Kfrt5EOS5fXiByQUHv+PyR+9Ju6QWkkcFBfgsxq25kFl+eos4V9lxPOY5jDpw2BWu9TyHtTWkjL/YxDUGwUO9WA/WzrcT4skr9FYrFV/oEgi8MkwydC0cFICDfd6tr9upqkkr1W025Im1UBXXJ89bTVj b3b1ae98f6a0e14c1e1ba806a6c18e193b6dae5c 0 iQIVAwUAWECEaEemf/qjRqrOAQjuZw/+IWJKnKOsaUMcB9ly3Fo/eskqDL6A0j69IXTJDeBDGMoyGbQU/gZyX2yc6Sw3EhwTSCXu5vKpzg3a6e8MNrC1iHqli4wJ/jPY7XtmiqTYDixdsBLNk46VfOi73ooFe08wVDSNB65xpZsrtPDSioNmQ2kSJwSHb71UlauS4xGkM74vuDpWvX5OZRSfBqMh6NjG5RwBBnS8mzA0SW2dCI2jSc5SCGIzIZpzM0xUN21xzq0YQbrk9qEsmi7ks0eowdhUjeET2wSWwhOK4jS4IfMyRO7KueUB05yHs4mChj9kNFNWtSzXKwKBQbZzwO/1Y7IJjU+AsbWkiUu+6ipqBPQWzS28gCwGOrv5BcIJS+tzsvLUKWgcixyfy5UAqJ32gCdzKC54FUpT2zL6Ad0vXGM6WkpZA7yworN4RCFPexXbi0x2GSTLG8PyIoZ4Iwgtj5NtsEDHrz0380FxgnKUIC3ny2SVuPlyD+9wepD3QYcxdRk1BIzcFT9ZxNlgil3IXRVPwVejvQ/zr6/ILdhBnZ8ojjvVCy3b86B1OhZj/ZByYo5QaykVqWl0V9vJOZlZfvOpm2HiDhm/2uNrVWxG4O6EwhnekAdaJYmeLq1YbhIfGA6KVOaB9Yi5A5BxK9QGXBZ6sLj+dIUD3QR47r9yAqVQE8Gr/Oh6oQXBQqOQv7WzBBs= e69874dc1f4e142746ff3df91e678a09c6fc208c 0 iQIVAwUAWG0oGUemf/qjRqrOAQh3uhAAu4TN7jkkgH7Hxn8S1cB6Ru0x8MQutzzzpjShhsE/G7nzCxsZ5eWdJ5ItwXmKhunb7T0og54CGcTxfmdPtCI7AhhHh9/TM2Hv1EBcsXCiwjG8E+P6X1UJkijgTGjNWuCvEDOsQAvgywslECBNnXp2QA5I5UdCMeqDdTAb8ujvbD8I4pxUx1xXKY18DgQGJh13mRlfkEVnPxUi2n8emnwPLjbVVkVISkMFUkaOl8a4fOeZC1xzDpoQocoH2Q8DYa9RCPPSHHSYPNMWGCdNGN2CoAurcHWWvc7jNU28/tBhTazfFv8LYh63lLQ8SIIPZHJAOxo45ufMspzUfNgoD6y3vlF5aW7DpdxwYHnueh7S1Fxgtd9cOnxmxQsgiF4LK0a+VXOi/Tli/fivZHDRCGHJvJgsMQm7pzkay9sGohes6jAnsOv2E8DwFC71FO/btrAp07IRFxH9WhUeMsXLMS9oBlubMxMM58M+xzSKApK6bz2MkLsx9cewmfmfbJnRIK1xDv+J+77pWWNGlxCCjl1WU+aA3M7G8HzwAqjL75ASOWtBrJlFXvlLgzobwwetg6cm44Rv1P39i3rDySZvi4BDlOQHWFupgMKiXnZ1PeL7eBDs/aawrE0V2ysNkf9An+XJZkos2JSLPWcoNigfXNUu5c1AqsERvHA246XJzqvCEK8= a1dd2c0c479e0550040542e392e87bc91262517e 0 iQIcBAABCAAGBQJYgBBEAAoJELnJ3IJKpb3VJosP/10rr3onsVbL8E+ri1Q0TJc8uhqIsBVyD/vS1MJtbxRaAdIV92o13YOent0o5ASFF/0yzVKlOWPQRjsYYbYY967k1TruDaWxJAnpeFgMni2Afl/qyWrW4AY2xegZNZCfMmwJA+uSJDdAn+jPV40XbuCZ+OgyZo5S05dfclHFxdc8rPKeUsJtvs5PMmCL3iQl1sulp1ASjuhRtFWZgSFsC6rb2Y7evD66ikL93+0/BPEB4SVX17vB/XEzdmh4ntyt4+d1XAznLHS33IU8UHbTkUmLy+82WnNH7HBB2V7gO47m/HhvaYjEfeW0bqMzN3aOUf30Vy/wB4HHsvkBGDgL5PYVHRRovGcAuCmnYbOkawqbRewW5oDs7UT3HbShNpxCxfsYpo7deHr11zWA3ooWCSlIRRREU4BfwVmn+Ds1hT5HM28Q6zr6GQZegDUbiT9i1zU0EpyfTpH7gc6NTVQrO1z1p70NBnQMqXcHjWJwjSwLER2Qify9MjrGXTL6ofD5zVZKobeRmq94mf3lDq26H7coraM9X5h9xa49VgAcRHzn/WQ6wcFCKDQr6FT67hTUOlF7Jriv8/5h/ziSZr10fCObKeKWN8Skur29VIAHHY4NuUqbM55WohD+jZ2O3d4tze1eWm5MDgWD8RlrfYhQ+cLOwH65AOtts0LNZwlvJuC7 e1526da1e6d84e03146151c9b6e6950fe9a83d7d 0 iQIVAwUAWJIKpUemf/qjRqrOAQjjThAAvl1K/GZBrkanwEPXomewHkWKTEy1s5d5oWmPPGrSb9G4LM/3/abSbQ7fnzkS6IWi4Ao0za68w/MohaVGKoMAslRbelaTqlus0wE3zxb2yQ/j2NeZzFnFEuR/vbUug7uzH+onko2jXrt7VcPNXLOa1/g5CWwaf/YPfJO4zv+atlzBHvuFcQCkdbcOJkccCnBUoR7y0PJoBJX6K7wJQ+hWLdcY4nVaxkGPRmsZJo9qogXZMw1CwJVjofxRI0S/5vMtEqh8srYsg7qlTNv8eYnwdpfuunn2mI7Khx10Tz85PZDnr3SGRiFvdfmT30pI7jL3bhOHALkaoy2VevteJjIyMxANTvjIUBNQUi+7Kj3VIKmkL9NAMAQBbshiQL1wTrXdqOeC8Nm1BfCQEox2yiC6pDFbXVbguwJZ5VKFizTTK6f6BdNYKTVx8lNEdjAsWH8ojgGWwGXBbTkClULHezJ/sODaZzK/+M/IzbGmlF27jJYpdJX8fUoybZNw9lXwIfQQWHmQHEOJYCljD9G1tvYY70+xAFexgBX5Ib48UK4DRITVNecyQZL7bLTzGcM0TAE0EtD4M42wawsYP3Cva9UxShFLICQdPoa4Wmfs6uLbXG1DDLol/j7b6bL+6W8E3AlW+aAPc8GZm51/w3VlYqqciWTc12OJpu8FiD0pZ/iBw+E= 25703b624d27e3917d978af56d6ad59331e0464a 0 iQIcBAABCAAGBQJYuMSwAAoJELnJ3IJKpb3VL3YP/iKWY3+K3cLUBD3Ne5MhfS7N3t6rlk9YD4kmU8JnVeV1oAfg36VCylpbJLBnmQdvC8AfBJOkXi6DHp9RKXXmlsOeoppdWYGX5RMOzuwuGPBii6cA6KFd+WBpBJlRtklz61qGCAtv4q8V1mga0yucihghzt4lD/PPz7mk6yUBL8s3rK+bIHGdEhnK2dfnn/U2G0K/vGgsYZESORISuBclCrrc7M3/v1D+FBMCEYX9FXYU4PhYkKXK1mSqzCB7oENu/WP4ijl1nRnEIyzBV9pKO4ylnXTpbZAr/e4PofzjzPXb0zume1191C3wvgJ4eDautGide/Pxls5s6fJRaIowf5XVYQ5srX/NC9N3K77Hy01t5u8nwcyAhjmajZYuB9j37nmiwFawqS/y2eHovrUjkGdelV8OM7/iAexPRC8i2NcGk0m6XuzWy1Dxr8453VD8Hh3tTeafd6v5uHXSLjwogpu/th5rk/i9/5GBzc1MyJgRTwBhVHi/yFxfyakrSU7HT2cwX/Lb5KgWccogqfvrFYQABIBanxLIeZxTv8OIjC75EYknbxYtvvgb35ZdJytwrTHSZN0S7Ua2dHx2KUnHB6thbLu/v9fYrCgFF76DK4Ogd22Cbvv6NqRoglG26d0bqdwz/l1n3o416YjupteW8LMxHzuwiJy69WP1yi10eNDq ed5b25874d998ababb181a939dd37a16ea644435 0 iQIcBAABCAAGBQJY4r/gAAoJELnJ3IJKpb3VtwYP/RuTmo252ExXQk/n5zGJZvZQnI86vO1+yGuyOlGFFBwf1v3sOLW1HD7fxF6/GdT8CSQrRqtC17Ya3qtayfY/0AEiSuH2bklBXSB1H5wPyguS5iLqyilCJY0SkHYBIDhJ0xftuIjsa805wdMm3OdclnTOkYT+K1WL8Ylbx/Ni2Lsx1rPpYdcQ/HlTkr5ca1ZbNOOSxSNI4+ilGlKbdSYeEsmqB2sDEiSaDEoxGGoSgzAE9+5Q2FfCGXV0bq4vfmEPoT9lhB4kANE+gcFUvsJTu8Z7EdF8y3CJLiy8+KHO/VLKTGJ1pMperbig9nAXl1AOt+izBFGJGTolbR/ShkkDWB/QVcqIF5CysAWMgnHAx7HjnMDBOANcKzhMMfOi3GUvOCNNIqIIoJHKRHaRk0YbMdt7z2mKpTrRQ9Zadz764jXOqqrPgQFM3jkBHzAvZz9yShrHGh42Y+iReAF9pAN0xPjyZ5Y2qp+DSl0bIQqrAet6Zd3QuoJtXczAeRrAvgn7O9MyLnMyE5s7xxI7o8M7zfWtChLF8ytJUzmRo3iVJNOJH+Zls9N30PGw6vubQAnB5ieaVTv8lnNpcAnEQD/i0tmRSxzyyqoOQbnItIPKFOsaYW+eX9sgJmObU3yDc5k3cs+yAFD2CM/uiUsLcTKyxPNcP1JHBYpwhOjIGczSHVS1 77eaf9539499a1b8be259ffe7ada787d07857f80 0 iQIcBAABCAAGBQJY9iz9AAoJELnJ3IJKpb3VYqEQAJNkB09sXgYRLA4kGQv3p4v02q9WZ1lHkAhOlNwIh7Zp+pGvT33nHZffByA0v+xtJNV9TNMIFFjkCg3jl5Z42CCe33ZlezGBAzXU+70QPvOR0ojlYk+FdMfeSyCBzWYokIpImwNmwNGKVrUAfywdikCsUC2aRjKg4Mn7GnqWl9WrBG6JEOOUamdx8qV2f6g/utRiqj4YQ86P0y4K3yakwc1LMM+vRfrwvsf1+DZ9t7QRENNKQ6gRnUdfryqSFIWn1VkBVMwIN5W3yIrTMfgH1wAZxbnYHrN5qDK7mcbP7bOA3XWJuEC+3QRnheRFd/21O1dMFuYjaKApXPHRlTGRMOaz2eydbfBopUS1BtfYEh4/B/1yJb9/HDw6LiAjea7ACHiaNec83z643005AvtUuWhjX3QTPkYlQzWaosanGy1IOGtXCPp1L0A+9gUpqyqycfPjQCbST5KRzYSZn3Ngmed5Bb6jsgvg5e5y0En/SQgK/pTKnxemAmFFVvIIrrWGRKj0AD0IFEHEepmwprPRs97EZPoBPFAGmVRuASBeIhFQxSDIXV0ebHJoUmz5w1rTy7U3Eq0ff6nW14kjWOUplatXz5LpWJ3VkZKrI+4gelto5xpTI6gJl2nmezhXQIlInk17cPuxmiHjeMdlOHZRh/zICLhQNL5fGne0ZL+qlrXY 616e788321cc4ae9975b7f0c54c849f36d82182b 0 iQIVAwUAWPZuQkemf/qjRqrOAQjFlg/9HXEegJMv8FP+uILPoaiA2UCiqWUL2MVJ0K1cvafkwUq+Iwir8sTe4VJ1v6V+ZRiOuzs4HMnoGJrIks4vHRbAxJ3J6xCfvrsbHdl59grv54vuoL5FlZvkdIe8L7/ovKrUmNwPWZX2v+ffFPrsEBeVlVrXpp4wOPhDxCKTmjYVOp87YqXfJsud7EQFPqpV4jX8DEDtJWT95OE9x0srBg0HpSE95d/BM4TuXTVNI8fV41YEqearKeFIhLxu37HxUmGmkAALCi8RJmm4hVpUHgk3tAVzImI8DglUqnC6VEfaYb+PKzIqHelhb66JO/48qN2S/JXihpNHAVUBysBT0b1xEnc6eNsF2fQEB+bEcf8IGj7/ILee1cmwPtoK2OXR2+xWWWjlu2keVcKeI0yAajJw/dP21yvVzVq0ypst7iD+EGHLJWJSmZscbyH5ICr+TJ5yQvIGZJtfsAdAUUTM2xpqSDW4mT5kYyg75URbQ3AKI7lOhJBmkkGQErE4zIQMkaAqcWziVF20xiRWfJoFxT2fK5weaRGIjELH49NLlyvZxYc4LlRo9lIdC7l/6lYDdTx15VuEj1zx/91y/d7OtPm+KCA2Bbdqth8m/fMD8trfQ6jSG/wgsvjZ+S0eoXa92qIR/igsCI+6EwP7duuzL2iyKOPXupQVNN10PKI7EuKv4Lk= bb96d4a497432722623ae60d9bc734a1e360179e 0 iQIVAwUAWQkDfEemf/qjRqrOAQierQ/7BuQ0IW0T0cglgqIgkLuYLx2VXJCTEtRNCWmrH2UMK7fAdpAhN0xf+xedv56zYHrlyHpbskDbWvsKIHJdw/4bQitXaIFTyuMMtSR5vXy4Nly34O/Xs2uGb3Y5qwdubeK2nZr4lSPgiRHb/zI/B1Oy8GX830ljmIOY7B0nUWy4DrXcy/M41SnAMLFyD1K6T/8tkv7M4Fai7dQoF9EmIIkShVPktI3lqp3m7infZ4XnJqcqUB0NSfQZwZaUaoalOdCvEIe3ab5ewgl/CuvlDI4oqMQGjXCtNLbtiZSwo6hvudO6ewT+Zn/VdabkZyRtXUxu56ajjd6h22nU1+vknqDzo5tzw6oh1Ubzf8tzyv3Gmmr+tlOjzfK7tXXnT3vR9aEGli0qri0DzOpsDSY0pDC7EsS4LINPoNdsGQrGQdoX++AISROlNjvyuo4Vrp26tPHCSupkKOXuZaiozycAa2Q+aI1EvkPZSXe8SAXKDVtFn05ZB58YVkFzZKAYAxkE/ven59zb4aIbOgR12tZbJoZZsVHrlf/TcDtiXVfIMEMsCtJ1tPgD1rAsEURWRxK3mJ0Ev6KTHgNz4PeBhq1gIP/Y665aX2+cCjc4+vApPUienh5aOr1bQFpIDyYZsafHGMUFNCwRh8bX98oTGa0hjqz4ypwXE4Wztjdc+48UiHARp/Y= c850f0ed54c1d42f9aa079ad528f8127e5775217 0 iQIVAwUAWTQINUemf/qjRqrOAQjZDw//b4pEgHYfWRVDEmLZtevysfhlJzbSyLAnWgNnRUVdSwl4WRF1r6ds/q7N4Ege5wQHjOpRtx4jC3y/riMbrLUlaeUXzCdqKgm4JcINS1nXy3IfkeDdUKyOR9upjaVhIEzCMRpyzabdYuflh5CoxayO7GFk2iZ8c1oAl4QzuLSspn9w+znqDg0HrMDbRNijStSulNjkqutih9UqT/PYizhE1UjL0NSnpYyD1vDljsHModJc2dhSzuZ1c4VFZHkienk+CNyeLtVKg8aC+Ej/Ppwq6FlE461T/RxOEzf+WFAc9F4iJibSN2kAFB4ySJ43y+OKkvzAwc5XbUx0y6OlWn2Ph+5T54sIwqasG3DjXyVrwVtAvCrcWUmOyS0RfkKoDVepMPIhFXyrhGqUYSq25Gt6tHVtIrlcWARIGGWlsE+PSHi87qcnSjs4xUzZwVvJWz4fuM1AUG/GTpyt4w3kB85XQikIINkmSTmsM/2/ar75T6jBL3kqOCGOL3n7bVZsGXllhkkQ7e/jqPPWnNXm8scDYdT3WENNu34zZp5ZmqdTXPAIIaqGswnU04KfUSEoYtOMri3E2VvrgMkiINm9BOKpgeTsMb3dkYRw2ZY3UAH9QfdX9BZywk6v3kkE5ghLWMUoQ4sqRlTo7mJKA8+EodjmIGRV/kAv1f7pigg6pIWWEyo= 26c49ed51a698ec016d2b4c6b44ca3c3f73cc788 0 iQIcBAABCAAGBQJZXQSmAAoJELnJ3IJKpb3VmTwP/jsxFTlKzWU8EnEhEViiP2YREOD3AXU7685DIMnoyVAsZgxrt0CG6Y92b5sINCeh5B0ORPQ7+xi2Xmz6tX8EeAR+/Dpdx6K623yExf8kq91zgfMvYkatNMu6ZVfywibYZAASq02oKoX7WqSPcQG/OwgtdFiGacCrG5iMH7wRv0N9hPc6D5vAV8/H/Inq8twpSG5SGDpCdKj7KPZiY8DFu/3OXatJtl+byg8zWT4FCYKkBPvmZp8/sRhDKBgwr3RvF1p84uuw/QxXjt+DmGxgtjvObjHr+shCMcKBAuZ4RtZmyEo/0L81uaTElHu1ejsEzsEKxs+8YifnH070PTFoV4VXQyXfTc8AyaqHE6rzX96a/HjQiJnL4dFeTZIrUhGK3AkObFLWJxVTo4J8+oliBQQldIh1H2yb1ZMfwapLnUGIqSieHDGZ6K2ccNJK8Q7IRhTCvYc0cjsnbwTpV4cebGqf3WXZhX0cZN+TNfhh/HGRzR1EeAAavjJqpDam1OBA5TmtJd/lHLIRVR5jyG+r4SK0XDlJ8uSfah7MpVH6aQ6UrycPyFusGXQlIqJ1DYQaBrI/SRJfIvRUmvVz9WgKLe83oC3Ui3aWR9rNjMb2InuQuXjeZaeaYfBAUYACcGfCZpZZvoEkMHCqtTng1rbbFnKMFk5kVy9YWuVgK9Iuh0O5 857876ebaed4e315f63157bd157d6ce553c7ab73 0 iQIVAwUAWW9XW0emf/qjRqrOAQhI7A//cKXIM4l8vrWWsc1Os4knXm/2UaexmAwV70TpviKL9RxCy5zBP/EapCaGRCH8uNPOQTkWGR9Aucm3CtxhggCMzULQxxeH86mEpWf1xILWLySPXW/t2f+2zxrwLSAxxqFJtuYv83Pe8CnS3y4BlgHnBKYXH8XXuW8uvfc0lHKblhrspGBIAinx7vPLoGQcpYrn9USWUKq5d9FaCLQCDT9501FHKf5dlYQajevCUDnewtn5ohelOXjTJQClW3aygv/z+98Kq7ZhayeIiZu+SeP+Ay7lZPklXcy6eyRiQtGCa1yesb9v53jKtgxWewV4o6zyuUesdknZ/IBeNUgw8LepqTIJo6/ckyvBOsSQcda81DuYNUChZLYTSXYPHEUmYiz6CvNoLEgHF/oO5p6CZXOPWbmLWrAFd+0+1Tuq8BSh+PSdEREM3ZLOikkXoVzTKBgu4zpMvmBnjliBg7WhixkcG0v5WunlV9/oHAIpsKdL7AatU+oCPulp+xDpTKzRazEemYiWG9zYKzwSMk9Nc17e2tk+EtFSPsPo4iVCXMgdIZSTNBvynKEFXZQVPWVa+bYRdAmbSY8awiX7exxYL10UcpnN2q/AH/F7rQzAmo8eZ3OtD0+3Nk3JRx0/CMyzKLPYDpdUgwmaPb+s2Bsy7f7TfmA7jTa69YqB1/zVwlWULr0= 5544af8622863796a0027566f6b646e10d522c4c 0 iQIcBAABCAAGBQJZjJflAAoJELnJ3IJKpb3V19kQALCvTdPrpce5+rBNbFtLGNFxTMDol1dUy87EUAWiArnfOzW3rKBdYxvxDL23BpgUfjRm1fAXdayVvlj6VC6Dyb195OLmc/I9z7SjFxsfmxWilF6U0GIa3W0x37i05EjfcccrBIuSLrvR6AWyJhjLOBCcyAqD/HcEom00/L+o2ry9CDQNLEeVuNewJiupcUqsTIG2yS26lWbtLZuoqS2T4Nlg8wjJhiSXlsZSuAF55iUJKlTQP6KyWReiaYuEVfm/Bybp0A2bFcZCYpWPwnwKBdSCHhIalH8PO57gh9J7xJVnyyBg5PU6n4l6PrGOmKhNiU/xyNe36tEAdMW6svcVvt8hiY0dnwWqR6wgnFFDu0lnTMUcjsy5M5FBY6wSw9Fph8zcNRzYyaeUbasNonPvrIrk21nT3ET3RzVR3ri2nJDVF+0GlpogGfk9k7wY3808091BMsyV3448ZPKQeWiK4Yy4UOUwbKV7YAsS5MdDnC1uKjl4GwLn9UCY/+Q2/2R0CBZ13Tox+Nbo6hBRuRGtFIbLK9j7IIUhhZrIZFSh8cDNkC+UMaS52L5z7ECvoYIUpw+MJ7NkMLHIVGZ2Nxn0C7IbGO6uHyR7D6bdNpxilU+WZStHk0ppZItRTm/htar4jifnaCI8F8OQNYmZ3cQhxx6qV2Tyow8arvWb1NYXrocG 943c91326b23954e6e1c6960d0239511f9530258 0 iQIcBAABCAAGBQJZjKKZAAoJELnJ3IJKpb3VGQkP/0iF6Khef0lBaRhbSAPwa7RUBb3iaBeuwmeic/hUjMoU1E5NR36bDDaF3u2di5mIYPBONFIeCPf9/DKyFkidueX1UnlAQa3mjh/QfKTb4/yO2Nrk7eH+QtrYxVUUYYjwgp4rS0Nd/++I1IUOor54vqJzJ7ZnM5O1RsE7VI1esAC/BTlUuO354bbm08B0owsZBwVvcVvpV4zeTvq5qyPxBJ3M0kw83Pgwh3JZB9IYhOabhSUBcA2fIPHgYGYnJVC+bLOeMWI1HJkJeoYfClNUiQUjAmi0cdTC733eQnHkDw7xyyFi+zkKu6JmU1opxkHSuj4Hrjul7Gtw3vVWWUPufz3AK7oymNp2Xr5y1HQLDtNJP3jicTTG1ae2TdX5Az3ze0I8VGbpR81/6ShAvY2cSKttV3I+2k4epxTTTf0xaZS1eUdnFOox6acElG2reNzx7EYYxpHj17K8N2qNzyY78iPgbJ+L39PBFoiGXMZJqWCxxIHoK1MxlXa8WwSnsXAU768dJvEn2N1x3fl+aeaWzeM4/5Qd83YjFuCeycuRnIo3rejSX3rWFAwZE0qQHKI5YWdKDLxIfdHTjdfMP7np+zLcHt0DV/dHmj2hKQgU0OK04fx7BrmdS1tw67Y9bL3H3TDohn7khU1FrqrKVuqSLbLsxnNyWRbZQF+DCoYrHlIW 3fee7f7d2da04226914c2258cc2884dc27384fd7 0 iQIcBAABCAAGBQJZjOJfAAoJELnJ3IJKpb3VvikP/iGjfahwkl2BDZYGq6Ia64a0bhEh0iltoWTCCDKMbHuuO+7h07fHpBl/XX5XPnS7imBUVWLOARhVL7aDPb0tu5NZzMKN57XUC/0FWFyf7lXXAVaOapR4kP8RtQvnoxfNSLRgiZQL88KIRBgFc8pbl8hLA6UbcHPsOk4dXKvmfPfHBHnzdUEDcSXDdyOBhuyOSzRs8egXVi3WeX6OaXG3twkw/uCF3pgOMOSyWVDwD+KvK+IBmSxCTKXzsb+pqpc7pPOFWhSXjpbuYUcI5Qy7mpd0bFL3qNqgvUNq2gX5mT6zH/TsVD10oSUjYYqKMO+gi34OgTVWRRoQfWBwrQwxsC/MxH6ZeOetl2YkS13OxdmYpNAFNQ8ye0vZigJRA+wHoC9dn0h8c5X4VJt/dufHeXc887EGJpLg6GDXi5Emr2ydAUhBJKlpi2yss22AmiQ4G9NE1hAjxqhPvkgBK/hpbr3FurV4hjTG6XKsF8I0WdbYz2CW/FEbp1+4T49ChhrwW0orZdEQX7IEjXr45Hs5sTInT90Hy2XG3Kovi0uVMt15cKsSEYDoFHkR4NgCZX2Y+qS5ryH8yqor3xtel3KsBIy6Ywn8pAo2f8flW3nro/O6x+0NKGV+ZZ0uo/FctuQLBrQVs025T1ai/6MbscQXvFVZVPKrUzlQaNPf/IwNOaRa 920977f72c7b70acfdaf56ab35360584d7845827 0 iQIcBAABCAAGBQJZv+wSAAoJELnJ3IJKpb3VH3kQAJp3OkV6qOPXBnlOSSodbVZveEQ5dGJfG9hk+VokcK6MFnieAFouROoGNlQXQtzj6cMqK+LGCP/NeJEG323gAxpxMzc32g7TqbVEhKNqNK8HvQSt04aCVZXtBmP0cPzc348UPP1X1iPTkyZxaJ0kHulaHVptwGbFZZyhwGefauU4eMafJsYqwgiGmvDpjUFu6P8YJXliYeTo1HX2lNChS1xmvJbop1YHfBYACsi8Eron0vMuhaQ+TKYq8Zd762u2roRYnaQ23ubEaVsjGDUYxXXVmit2gdaEKk+6Rq2I+EgcI5XvFzK8gvoP7siz6FL1jVf715k9/UYoWj9KDNUm8cweiyiUpjHQt0S+Ro9ryKvQy6tQVunRZqBN/kZWVth/FlMbUENbxVyXZcXv+m7OLvk+vyK7UZ7yT+OBzgRr0PyUuafzSVW3e+RZJtGxYGM5ew2bWQ8L6wuBucRYZOSnXXtCw7cKEMlK3BTjfAfpHUdIZIG492R9d6aOECUK/MpNvCiXXaZoh5Kj4a0dARiuWFCZxWwt3bmOg13oQ841zLdzOi/YZe15vCm8OB4Ffg6CkmPKhZhnMwVbFmlaBcoaeMzzpMuog91J1M2zgEUBTYwe/HKiNr/0iilJMPFRpZ+zEb2GvVoc8FMttXi8aomlXf/6LHCC9ndexGC29jIzl41+ 2f427b57bf9019c6dc3750baa539dc22c1be50f6 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlnQtVIQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91TTkD/409sWTM9vUH2qkqNTb1IXyGpqzb9UGOSVDioz6rvgZEBgh9D1oBTWnfBXW8sOWR0A7iCL6qZh2Yi7g7p0mKGXh9LZViLtSwwMSXpNiGBO7RVPW+NQ6DOY5Rhr0i08UBiVEkZXHeIVCd2Bd6mhAiUsm5iUh9Jne10wO8cIxeAUnsx4DBdHBMWLg6AZKWllSgN+r9H+7wnOhDbkvj1Cu6+ugKpEs+xvbTh47OTyM+w9tC1aoZD4HhfR5w5O16FC+TIoE6wmWut6e2pxIMHDB3H08Dky6gNjucY/ntJXvOZW5kYrQA3LHKks8ebpjsIXesOAvReOAsDz0drwzbWZan9Cbj8yWoYz/HCgHCnX3WqKKORSP5pvdrsqYua9DXtJwBeSWY4vbIM2kECAiyw1SrOGudxlyWBlW1f1jhGR2DsBlwoieeAvUVoaNwO7pYirwxR4nFPdLDRCQ4hLK/GFiuyr+lGoc1WUzVRNBYD3udcOZAbqq4JhWLf0Gvd5xP0rn1cJNhHMvrPH4Ki4a5KeeK6gQI7GT9/+PPQzTdpxXj6KwofktJtVNqm5sJmJ+wMIddnobFlNNLZ/F7OMONWajuVhh+vSOV34YLdhqzAR5XItkeJL6qyAJjNH5PjsnhT7nMqjgwriPz6xxYOLJWgtK5ZqcSCx4gWy9KJVVja8wJ7rRUg== 1e2454b60e5936f5e77498cab2648db469504487 0 iQJVBAABCAA/FiEEOoFVFj0OIKUw/LeGR6Z/+qNGqs4FAlnqRBUhHGtidWxsb2NrK21lcmN1cmlhbEByaW5nd29ybGQub3JnAAoJEEemf/qjRqrOAQQP/28EzmTKFL/RxmNYePdzqrmcdJ2tn+s7OYmGdtneN2sESZ4MK0xb5Q8Mkm+41aXS52zzJdz9ynwdun8DG4wZ3sE5MOG+GgK6K0ecOv1XTKS3a2DkUM0fl5hlcXN7Zz7m7m5M6sy6vSxHP7kTyzQWt//z175ZLSQEu1a0nm/BLH+HP9e8DfnJ2Nfcnwp32kV0Nj1xTqjRV1Yo/oCnXfVvsxEJU+CDUGBiLc29ZcoWVbTw9c1VcxihJ6k0pK711KZ+bedSk7yc1OudiJF7idjB0bLQY6ESHNNNjK8uLppok0RsyuhvvDTAoTsl1rMKGmXMM0Ela3/5oxZ/5lUZB73vEJhzEi48ULvstpq82EO39KylkEfQxwMBPhnBIHQaGRkl7QPLXGOYUDMY6gT08Sm3e8/NqEJc/AgckXehpH3gSS2Ji2xg7/E8H5plGsswFidw//oYTTwm0j0halWpB521TD2wmjkjRHXzk1mj0EoFQUMfwHTIZU3E8flUBasD3mZ9XqZJPr66RV7QCrXayH75B/i0CyNqd/Hv5Tkf2TlC3EkEBZwZyAjqw7EyL1LuS936sc7fWuMFsH5k/fwjVwzIc1LmP+nmk2Dd9hIC66vec4w1QZeeAXuDKgOJjvQzj2n+uYRuObl4kKcxvoXqgQN0glGuB1IW7lPllGHR1kplhoub 0ccb43d4cf01d013ae05917ec4f305509f851b2d 0 iQJVBAABCAA/FiEEOoFVFj0OIKUw/LeGR6Z/+qNGqs4FAln6Qp8hHGtidWxsb2NrK21lcmN1cmlhbEByaW5nd29ybGQub3JnAAoJEEemf/qjRqrOJ8MP/2ufm/dbrFoE0F8hewhztG1vS4stus13lZ9lmM9kza8OKeOgY/MDH8GaV3O8GnRiCNUFsVD8JEIexE31c84H2Ie7VQO0GQSUHSyMCRrbED6IvfrWp6EZ6RDNPk4LHBfxCuPmuVHGRoGZtsLKJBPIxIHJKWMlEJlj9BZuUxZp/8kurQ6CXwblVbFzXdOaZQlioOBH27Bk3S0+gXfJ+wA2ed5XOQvT9jwjqC8y/1t8obaoPTpzyAvb9NArG+9RT9vfNN42aWISZNwg6RW5oLJISqoGrAes6EoG7dZfOC0UoKMVYXoNvZzJvVlMHyjugIoid+WI+V8y9bPrRTfbPCmocCzEzCOLEHQta8roNijB0bKcq8hmQPHcMyXlj1Srnqlco49jbhftgJoPTwzb10wQyU0VFvaZDPW/EQUT3M/k4j3sVESjANdyG1iu6EDV080LK1LgAdhjpKMBbf6mcgAe06/07XFMbKNrZMEislOcVFp98BSKjdioUNpy91rCeSmkEsASJ3yMArRnSkuVgpyrtJaGWl79VUcmOwKhUOA/8MXMz/Oqu7hvve/sgv71xlnim460nnLw6YHPyeeCsz6KSoUK3knFXAbTk/0jvU1ixUZbI122aMzX04UgPGeTukCOUw49XfaOdN+x0YXlkl4PsrnRQhIoixY2gosPpK4YO73G cabc840ffdee8a72f3689fb77dd74d04fdc2bc04 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAloB+EYQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91TfwEAC/pYW7TC8mQnqSJzde4yiv2+zgflfJzRlg5rbvlUQl1gSBla3sFADZcic0ebAc+8XUu8eIzyPX+oa4wjsHvL13silUCkUzTEEQLqfKPX1bhA4mwfSDb5A7v2VZ5q8qhRGnlhTsB79ML8uBOhR/Bigdm2ixURPEZ37pWljiMp9XWBMtxPxXn/m0n5CDViibX6QqQCR4k3orcsIGd72YXU6B8NGbBN8qlqMSd0pGvSF4vM2cgVhz7D71+zU4XL/HVP97aU9GsOwN9QWW029DOJu6KG6x51WWtfD/tzyNDu7+lZ5/IKyqHX4tyqCIXEGAsQ3XypeHgCq5hV3E6LJLRqPcLpUNDiQlCg6tNPRaOuMC878MRIlffKqMH+sWo8Z7zHrut+LfRh5/k1aCh4J+FIlE6Hgbvbvv2Z8JxDpUKl0Tr+i0oHNTapbGXIecq1ZFR4kcdchodUHXBC2E6HWR50/ek5YKPddzw8WPGsBtzXMfkhFr3WkvyP2Gbe2XJnkuYptTJA+u2CfhrvgmWsYlvt/myTaMZQEzZ+uir4Xoo5NvzqTL30SFqPrP4Nh0n9G6vpVJl/eZxoYK9jL3VC0vDhnZXitkvDpjXZuJqw/HgExXWKZFfiQ3X2HY48v1gvJiSegZ5rX+uGGJtW2/Mp5FidePEgnFIqZW/yhBfs2Hzj1D2A== a92b9f8e11ba330614cdfd6af0e03b15c1ff3797 0 iQJVBAABCAA/FiEEOoFVFj0OIKUw/LeGR6Z/+qNGqs4FAlohslshHGtidWxsb2NrK21lcmN1cmlhbEByaW5nd29ybGQub3JnAAoJEEemf/qjRqrO7P8P/1qGts96acEdB9BZbK/Eesalb1wUByLXZoP8j+1wWwqh/Kq/q7V4Qe0z1jw/92oZbmnLy2C8sDhWv/XKxACKv69oPrcqQix1E8M+07u88ZXqHJMSxkOmvA2Vimp9EG1qgje+qchgOVgvhEhysA96bRpEnc6V0RnBqI5UdfbKtlfBmX5mUE/qsoBZhly1FTmzV1bhYlGgNLyqtJQpcbA34wyPoywsp8DRBiHWrIzz5XNR+DJFTOe4Kqio1i5r8R4QSIM5vtTbj5pbsmtGcP2CsFC9S3xTSAU6AEJKxGpubPk3ckNj3P9zolvR7krU5Jt8LIgXSVaKLt9rPhmxCbPrLtORgXkUupJcrwzQl+oYz5bkl9kowFa959waIPYoCuuW402mOTDq/L3xwDH9AKK5rELPl3fNo+5OIDKAKRIu6zRSAzBtyGT6kkfb1NSghumP4scR7cgUmLaNibZBa8eJj92gwf+ucSGoB/dF/YHWNe0jY09LFK3nyCoftmyLzxcRk1JLGNngw8MCIuisHTskhxSm/qlX7qjunoZnA3yy9behhy/YaFt4YzYZbMTivt2gszX5ktToaDqfxWDYdIa79kp8G68rYPeybelTS74LwbK3blXPI3I1nddkW52znHYLvW6BYyi+QQ5jPZLkiOC+AF0q+c4gYmPaLVN/mpMZjjmB 27b6df1b5adbdf647cf5c6675b40575e1b197c60 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlpmbwIQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91W4BD/4h+y7QH7FkNcueOBrmdci7w1apkPX7KuknKxf8+FmA1QDGWYATnqD6IcAk3+f4reO4n9qc0y2BGrIz/pyTSIHvJW+ORrbPCKVrXlfUgkUK3TumtRObt8B75BVBBNaJ93r1yOALpo/K8wSwRrBF+Yl6aCoFiibUEbfcfaOAHVqZXKC1ZPtLRwq5NHIw0wWB0qNoAXj+FJV1EHO7SEjj2lXqw/r0HriQMdObWLgAb6QVUq7oVMpAumUeuQtZ169qHdqYfF1OLdCnsVBcwYEz/cBLC43bvYiwFxSkbAFyl656caWiwA3PISFSzP9Co0zWU/Qf8f7dTdAdT/orzCfUq8YoXqryfRSxi+8L8/EMxankzdW73Rx5X+0539pSq+gDDtTOyNuW6+CZwa5D84b31rsd+jTx8zVm3SRHRKsoGF2EEMQkWmDbhIFjX5W1fE84Ul3umypv+lPSvCPlQpIqv2hZmcTR12sgjdBjU8z+Zcq22SHFybqiYNmWpkVUtiMvTlHMoJfi5PI6xF8D2dxV4ErG+NflqdjaXydgnbO6D3/A1FCASig0wL4jMxSeRqnRRqLihN3VaGG2QH6MLJ+Ty6YuoonKtopw9JNOZydr/XN7K5LcjX1T3+31qmnHZyBXRSejWl9XN93IDbQcnMBWHkz/cJLN0kKu4pvnV8UGUcyXfA== d334afc585e29577f271c5eda03378736a16ca6b 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlpzZuUQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91TiDEADDD6Tn04UjgrZ36nAqOcHaG1ZT2Cm1/sbTw+6duAhf3+uKWFqi2bgcdCBkdfRH7KfEU0GNsPpiC6mzWw3PDWmGhnLJAkR+9FTBU0edK01hkNW8RelDTL5J9IzIGwrP4KFfcUue6yrxU8GnSxnf5Vy/N5ZZzLV/P3hdBte5We9PD5KHPAwTzzcZ9Wiog700rFDDChyFq7hNQ3H0GpknF6+Ck5XmJ3DOqt1MFHk9V4Z/ASU59cQXKOeaMChlBpTb1gIIWjOE99v5aY06dc1WlwttuHtCZvZgtAduRAB6XYWyniS/7nXBv0MXD3EWbpH1pkOaWUxw217HpNP4g9Yo3u/i8UW+NkSJOeXtC1CFjWmUNj138IhS1pogaiPPnIs+H6eOJsmnGhN2KbOMjA5Dn9vSTi6s/98TarfUSiwxA4L7fJy5qowFETftuBO0fJpbB8+ZtpnjNp0MMKed27OUSv69i6BmLrP+eqk+MVO6PovvIySlWAP9/REM/I5/mFkqoI+ruT4a9osNGDZ4Jqb382b7EmpEMDdgb7+ezsybgDfizuaTs/LBae7h79o1m30DxZ/EZ5C+2LY8twbGSORvZN4ViMVhIhWBTlOE/iVBOj807Y2OaUURcuLfHRmaCcfF1uIzg0uNB/aM/WSE0+AXh2IX+mipoTS3eh/V2EKldBHcOQ== 369aadf7a3264b03c8b09efce715bc41e6ab4a9b 0 iQJVBAABCAA/FiEEOoFVFj0OIKUw/LeGR6Z/+qNGqs4FAlqe5w8hHGtidWxsb2NrK21lcmN1cmlhbEByaW5nd29ybGQub3JnAAoJEEemf/qjRqrO1lUQAK6+S26rE3AMt6667ClT+ubPl+nNMRkWJXa8EyPplBUGTPdMheViOe+28dCsveJxqUF7A4TMLMA/eIj4cRIwmVbBaivfQKnG5GMZ+9N6j6oqE/OAJujdHzzZ3+o9KJGtRgJP2tzdY/6qkXwL3WN6KULz7pSkrKZLOiNfj4k2bf3bXeB7d3N5erxJYlhddlPBlHXImRkWiPR/bdaAaYJq+EEWCbia6MWXlSAqEjIgQi+ytuh/9Z+QSsJCsECDRqEExZClqHGkCLYhST99NqqdYCGJzAFMgh+xWxZxI0LO08pJxYctHGoHm+vvRVMfmdbxEydEy01H6jX+1e7Yq44bovIiIOkaXCTSuEBol+R5aPKJhgvqgZ5IlcTLoIYQBE3MZMKZ89NWy3TvgcNkQiOPCCkKs1+DukXKqTt62zOTxfa6mIZDCXdGai6vZBJ5b0yeEd3HV96yHb9dFlS5w1cG7prIBRv5BkqEaFbRMGZGV31Ri7BuVu0O68Pfdq+R+4A1YLdJ0H5DySe2dGlwE2DMKhdtVu1bie4UWHK10TphmqhBk6B9Ew2+tASCU7iczAqRzyzMLBTHIfCYO2R+5Yuh0CApt47KV23OcLje9nORyE2yaDTbVUPiXzdOnbRaCQf7eW5/1y/LLjG6OwtuETTcHKh7ruko+u7rFL96a4DNlNdk 8bba684efde7f45add05f737952093bb2aa07155 0 iQJVBAABCAA/FiEEOoFVFj0OIKUw/LeGR6Z/+qNGqs4FAlqe6dkhHGtidWxsb2NrK21lcmN1cmlhbEByaW5nd29ybGQub3JnAAoJEEemf/qjRqrOJmIQALUVCoWUFYYaRxGH4OpmIQ2o1JrMefvarFhaPY1r3+G87sjXgw15uobEQDtoybTUYbcdSxJQT1KE1FOm3wU0VyN6PY9c1PMEAVgJlve0eDiXNNlBsoYMXnpq1HidZknkjpXgUPdE/LElxpJJRlJQZlS29bkGmEDZQBoOvlcZoBRDSYcbM07wn7d+1gmJkcHViDBMAbSrudfO0OYzDC1BjtGyKm7Mes2WB1yFYw+ySa8hF/xPKEDvoZINOE5n3PBJiCvPuTw3PqsHvWgKOA1Obx9fATlxj7EHBLfKBTNfpUwPMRSH1cmA+qUS9mRDrdLvrThwalr6D3r2RJ2ntOipcZpKMmxARRV+VUAI1K6H0/Ws3XAxENqhF7RgRruJFVq8G8EcHJLZEoVHsR+VOnd/pzgkFKS+tIsYYRcMpL0DdMF8pV3xrEFahgRhaEZOh4jsG3Z+sGLVFFl7DdMqeGs6m/TwDrvfuYtGczfGRB0wqu8KOwhR1BjNJKcr4lk35GKwSXmI1vk6Z1gAm0e13995lqbCJwkuOKynQlHWVOR6hu3ypvAgV/zXLF5t8HHtL48sOJ8a33THuJT4whbXSIb9BQXu/NQnNhK8G3Kly5UN88vL4a3sZi/Y86h4R2fKOSib/txJ3ydLbMeS8LlJMqeF/hrBanVF0r15NZ2CdmL1Qxim mercurial-4.5.3/hgdemandimport/0000755015407300116100000000000013261161257016404 5ustar augieeng00000000000000mercurial-4.5.3/hgdemandimport/__init__.py0000644015407300116100000000457313261161234020521 0ustar augieeng00000000000000# hgdemandimport - global demand-loading of modules for Mercurial # # Copyright 2017 Facebook Inc. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '''demandimport - automatic demand-loading of modules''' # This is in a separate package from mercurial because in Python 3, # demand loading is per-package. Keeping demandimport in the mercurial package # would disable demand loading for any modules in mercurial. from __future__ import absolute_import import os import sys if sys.version_info[0] >= 3: from . import demandimportpy3 as demandimport else: from . import demandimportpy2 as demandimport # Extensions can add to this list if necessary. ignore = [ '__future__', '_hashlib', # ImportError during pkg_resources/__init__.py:fixup_namespace_package '_imp', '_xmlplus', 'fcntl', 'nt', # pathlib2 tests the existence of built-in 'nt' module 'win32com.gen_py', 'win32com.shell', # 'appdirs' tries to import win32com.shell '_winreg', # 2.7 mimetypes needs immediate ImportError 'pythoncom', # imported by tarfile, not available under Windows 'pwd', 'grp', # imported by profile, itself imported by hotshot.stats, # not available under Windows 'resource', # this trips up many extension authors 'gtk', # setuptools' pkg_resources.py expects "from __main__ import x" to # raise ImportError if x not defined '__main__', '_ssl', # conditional imports in the stdlib, issue1964 '_sre', # issue4920 'rfc822', 'mimetools', 'sqlalchemy.events', # has import-time side effects (issue5085) # setuptools 8 expects this module to explode early when not on windows 'distutils.msvc9compiler', '__builtin__', 'builtins', 'urwid.command_map', # for pudb ] _pypy = '__pypy__' in sys.builtin_module_names if _pypy: ignore.extend([ # _ctypes.pointer is shadowed by "from ... import pointer" (PyPy 5) '_ctypes.pointer', ]) demandimport.init(ignore) # Re-export. isenabled = demandimport.isenabled disable = demandimport.disable deactivated = demandimport.deactivated def enable(): # chg pre-imports modules so do not enable demandimport for it if ('CHGINTERNALMARK' not in os.environ and os.environ.get('HGDEMANDIMPORT') != 'disable'): demandimport.enable() mercurial-4.5.3/hgdemandimport/demandimportpy3.py0000644015407300116100000000666113261161234022101 0ustar augieeng00000000000000# demandimportpy3 - global demand-loading of modules for Mercurial # # Copyright 2017 Facebook Inc. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. """Lazy loading for Python 3.6 and above. This uses the new importlib finder/loader functionality available in Python 3.5 and up. The code reuses most of the mechanics implemented inside importlib.util, but with a few additions: * Allow excluding certain modules from lazy imports. * Expose an interface that's substantially the same as demandimport for Python 2. This also has some limitations compared to the Python 2 implementation: * Much of the logic is per-package, not per-module, so any packages loaded before demandimport is enabled will not be lazily imported in the future. In practice, we only expect builtins to be loaded before demandimport is enabled. """ # This line is unnecessary, but it satisfies test-check-py3-compat.t. from __future__ import absolute_import import contextlib import importlib.abc import importlib.machinery import importlib.util import sys _deactivated = False class _lazyloaderex(importlib.util.LazyLoader): """This is a LazyLoader except it also follows the _deactivated global and the ignore list. """ def exec_module(self, module): """Make the module load lazily.""" if _deactivated or module.__name__ in ignore: self.loader.exec_module(module) else: super().exec_module(module) # This is 3.6+ because with Python 3.5 it isn't possible to lazily load # extensions. See the discussion in https://bugs.python.org/issue26186 for more. _extensions_loader = _lazyloaderex.factory( importlib.machinery.ExtensionFileLoader) _bytecode_loader = _lazyloaderex.factory( importlib.machinery.SourcelessFileLoader) _source_loader = _lazyloaderex.factory(importlib.machinery.SourceFileLoader) def _makefinder(path): return importlib.machinery.FileFinder( path, # This is the order in which loaders are passed in in core Python. (_extensions_loader, importlib.machinery.EXTENSION_SUFFIXES), (_source_loader, importlib.machinery.SOURCE_SUFFIXES), (_bytecode_loader, importlib.machinery.BYTECODE_SUFFIXES), ) ignore = [] def init(ignorelist): global ignore ignore = ignorelist def isenabled(): return _makefinder in sys.path_hooks and not _deactivated def disable(): try: while True: sys.path_hooks.remove(_makefinder) except ValueError: pass def enable(): sys.path_hooks.insert(0, _makefinder) @contextlib.contextmanager def deactivated(): # This implementation is a bit different from Python 2's. Python 3 # maintains a per-package finder cache in sys.path_importer_cache (see # PEP 302). This means that we can't just call disable + enable. # If we do that, in situations like: # # demandimport.enable() # ... # from foo.bar import mod1 # with demandimport.deactivated(): # from foo.bar import mod2 # # mod2 will be imported lazily. (The converse also holds -- whatever finder # first gets cached will be used.) # # Instead, have a global flag the LazyLoader can use. global _deactivated demandenabled = isenabled() if demandenabled: _deactivated = True try: yield finally: if demandenabled: _deactivated = False mercurial-4.5.3/hgdemandimport/demandimportpy2.py0000644015407300116100000002513213261161234022072 0ustar augieeng00000000000000# demandimport.py - global demand-loading of modules for Mercurial # # Copyright 2006, 2007 Matt Mackall # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. ''' demandimport - automatic demandloading of modules To enable this module, do: import demandimport; demandimport.enable() Imports of the following forms will be demand-loaded: import a, b.c import a.b as c from a import b,c # a will be loaded immediately These imports will not be delayed: from a import * b = __import__(a) ''' from __future__ import absolute_import import __builtin__ as builtins import contextlib import sys contextmanager = contextlib.contextmanager _origimport = __import__ nothing = object() def _hgextimport(importfunc, name, globals, *args, **kwargs): try: return importfunc(name, globals, *args, **kwargs) except ImportError: if not globals: raise # extensions are loaded with "hgext_" prefix hgextname = 'hgext_%s' % name nameroot = hgextname.split('.', 1)[0] contextroot = globals.get('__name__', '').split('.', 1)[0] if nameroot != contextroot: raise # retry to import with "hgext_" prefix return importfunc(hgextname, globals, *args, **kwargs) class _demandmod(object): """module demand-loader and proxy Specify 1 as 'level' argument at construction, to import module relatively. """ def __init__(self, name, globals, locals, level): if '.' in name: head, rest = name.split('.', 1) after = [rest] else: head = name after = [] object.__setattr__(self, r"_data", (head, globals, locals, after, level, set())) object.__setattr__(self, r"_module", None) def _extend(self, name): """add to the list of submodules to load""" self._data[3].append(name) def _addref(self, name): """Record that the named module ``name`` imports this module. References to this proxy class having the name of this module will be replaced at module load time. We assume the symbol inside the importing module is identical to the "head" name of this module. We don't actually know if "as X" syntax is being used to change the symbol name because this information isn't exposed to __import__. """ self._data[5].add(name) def _load(self): if not self._module: head, globals, locals, after, level, modrefs = self._data mod = _hgextimport(_origimport, head, globals, locals, None, level) if mod is self: # In this case, _hgextimport() above should imply # _demandimport(). Otherwise, _hgextimport() never # returns _demandmod. This isn't intentional behavior, # in fact. (see also issue5304 for detail) # # If self._module is already bound at this point, self # should be already _load()-ed while _hgextimport(). # Otherwise, there is no way to import actual module # as expected, because (re-)invoking _hgextimport() # should cause same result. # This is reason why _load() returns without any more # setup but assumes self to be already bound. mod = self._module assert mod and mod is not self, "%s, %s" % (self, mod) return # load submodules def subload(mod, p): h, t = p, None if '.' in p: h, t = p.split('.', 1) if getattr(mod, h, nothing) is nothing: setattr(mod, h, _demandmod(p, mod.__dict__, mod.__dict__, level=1)) elif t: subload(getattr(mod, h), t) for x in after: subload(mod, x) # Replace references to this proxy instance with the actual module. if locals: if locals.get(head) is self: locals[head] = mod elif locals.get(head + r'mod') is self: locals[head + r'mod'] = mod for modname in modrefs: modref = sys.modules.get(modname, None) if modref and getattr(modref, head, None) is self: setattr(modref, head, mod) object.__setattr__(self, r"_module", mod) def __repr__(self): if self._module: return "" % self._data[0] return "" % self._data[0] def __call__(self, *args, **kwargs): raise TypeError("%s object is not callable" % repr(self)) def __getattr__(self, attr): self._load() return getattr(self._module, attr) def __setattr__(self, attr, val): self._load() setattr(self._module, attr, val) @property def __dict__(self): self._load() return self._module.__dict__ @property def __doc__(self): self._load() return self._module.__doc__ _pypy = '__pypy__' in sys.builtin_module_names def _demandimport(name, globals=None, locals=None, fromlist=None, level=-1): if locals is None or name in ignore or fromlist == ('*',): # these cases we can't really delay return _hgextimport(_origimport, name, globals, locals, fromlist, level) elif not fromlist: # import a [as b] if '.' in name: # a.b base, rest = name.split('.', 1) # email.__init__ loading email.mime if globals and globals.get('__name__', None) == base: return _origimport(name, globals, locals, fromlist, level) # if a is already demand-loaded, add b to its submodule list if base in locals: if isinstance(locals[base], _demandmod): locals[base]._extend(rest) return locals[base] return _demandmod(name, globals, locals, level) else: # There is a fromlist. # from a import b,c,d # from . import b,c,d # from .a import b,c,d # level == -1: relative and absolute attempted (Python 2 only). # level >= 0: absolute only (Python 2 w/ absolute_import and Python 3). # The modern Mercurial convention is to use absolute_import everywhere, # so modern Mercurial code will have level >= 0. # The name of the module the import statement is located in. globalname = globals.get('__name__') def processfromitem(mod, attr): """Process an imported symbol in the import statement. If the symbol doesn't exist in the parent module, and if the parent module is a package, it must be a module. We set missing modules up as _demandmod instances. """ symbol = getattr(mod, attr, nothing) nonpkg = getattr(mod, '__path__', nothing) is nothing if symbol is nothing: if nonpkg: # do not try relative import, which would raise ValueError, # and leave unknown attribute as the default __import__() # would do. the missing attribute will be detected later # while processing the import statement. return mn = '%s.%s' % (mod.__name__, attr) if mn in ignore: importfunc = _origimport else: importfunc = _demandmod symbol = importfunc(attr, mod.__dict__, locals, level=1) setattr(mod, attr, symbol) # Record the importing module references this symbol so we can # replace the symbol with the actual module instance at load # time. if globalname and isinstance(symbol, _demandmod): symbol._addref(globalname) def chainmodules(rootmod, modname): # recurse down the module chain, and return the leaf module mod = rootmod for comp in modname.split('.')[1:]: obj = getattr(mod, comp, nothing) if obj is nothing: obj = _demandmod(comp, mod.__dict__, mod.__dict__, level=1) setattr(mod, comp, obj) elif mod.__name__ + '.' + comp in sys.modules: # prefer loaded module over attribute (issue5617) obj = sys.modules[mod.__name__ + '.' + comp] mod = obj return mod if level >= 0: if name: # "from a import b" or "from .a import b" style rootmod = _hgextimport(_origimport, name, globals, locals, level=level) mod = chainmodules(rootmod, name) elif _pypy: # PyPy's __import__ throws an exception if invoked # with an empty name and no fromlist. Recreate the # desired behaviour by hand. mn = globalname mod = sys.modules[mn] if getattr(mod, '__path__', nothing) is nothing: mn = mn.rsplit('.', 1)[0] mod = sys.modules[mn] if level > 1: mn = mn.rsplit('.', level - 1)[0] mod = sys.modules[mn] else: mod = _hgextimport(_origimport, name, globals, locals, level=level) for x in fromlist: processfromitem(mod, x) return mod # But, we still need to support lazy loading of standard library and 3rd # party modules. So handle level == -1. mod = _hgextimport(_origimport, name, globals, locals) mod = chainmodules(mod, name) for x in fromlist: processfromitem(mod, x) return mod ignore = [] def init(ignorelist): global ignore ignore = ignorelist def isenabled(): return builtins.__import__ == _demandimport def enable(): "enable global demand-loading of modules" builtins.__import__ = _demandimport def disable(): "disable global demand-loading of modules" builtins.__import__ = _origimport @contextmanager def deactivated(): "context manager for disabling demandimport in 'with' blocks" demandenabled = isenabled() if demandenabled: disable() try: yield finally: if demandenabled: enable() mercurial-4.5.3/Makefile0000644015407300116100000002521713261161234015044 0ustar augieeng00000000000000# If you want to change PREFIX, do not just edit it below. The changed # value wont get passed on to recursive make calls. You should instead # override the variable on the command like: # # % make PREFIX=/opt/ install export PREFIX=/usr/local PYTHON=python $(eval HGROOT := $(shell pwd)) HGPYTHONS ?= $(HGROOT)/build/pythons PURE= PYFILES:=$(shell find mercurial hgext doc -name '*.py') DOCFILES=mercurial/help/*.txt export LANGUAGE=C export LC_ALL=C TESTFLAGS ?= $(shell echo $$HGTESTFLAGS) OSXVERSIONFLAGS ?= $(shell echo $$OSXVERSIONFLAGS) # Set this to e.g. "mingw32" to use a non-default compiler. COMPILER= COMPILERFLAG_tmp_ = COMPILERFLAG_tmp_${COMPILER} ?= -c $(COMPILER) COMPILERFLAG=${COMPILERFLAG_tmp_${COMPILER}} help: @echo 'Commonly used make targets:' @echo ' all - build program and documentation' @echo ' install - install program and man pages to $$PREFIX ($(PREFIX))' @echo ' install-home - install with setup.py install --home=$$HOME ($(HOME))' @echo ' local - build for inplace usage' @echo ' tests - run all tests in the automatic test suite' @echo ' test-foo - run only specified tests (e.g. test-merge1.t)' @echo ' dist - run all tests and create a source tarball in dist/' @echo ' clean - remove files created by other targets' @echo ' (except installed files or dist source tarball)' @echo ' update-pot - update i18n/hg.pot' @echo @echo 'Example for a system-wide installation under /usr/local:' @echo ' make all && su -c "make install" && hg version' @echo @echo 'Example for a local installation (usable in this directory):' @echo ' make local && ./hg version' all: build doc local: $(PYTHON) setup.py $(PURE) \ build_py -c -d . \ build_ext $(COMPILERFLAG) -i \ build_hgexe $(COMPILERFLAG) -i \ build_mo env HGRCPATH= $(PYTHON) hg version build: $(PYTHON) setup.py $(PURE) build $(COMPILERFLAG) wheel: FORCE_SETUPTOOLS=1 $(PYTHON) setup.py $(PURE) bdist_wheel $(COMPILERFLAG) doc: $(MAKE) -C doc cleanbutpackages: -$(PYTHON) setup.py clean --all # ignore errors from this command find contrib doc hgext hgext3rd i18n mercurial tests hgdemandimport \ \( -name '*.py[cdo]' -o -name '*.so' \) -exec rm -f '{}' ';' rm -f MANIFEST MANIFEST.in hgext/__index__.py tests/*.err rm -f mercurial/__modulepolicy__.py if test -d .hg; then rm -f mercurial/__version__.py; fi rm -rf build mercurial/locale $(MAKE) -C doc clean $(MAKE) -C contrib/chg distclean clean: cleanbutpackages rm -rf packages install: install-bin install-doc install-bin: build $(PYTHON) setup.py $(PURE) install --root="$(DESTDIR)/" --prefix="$(PREFIX)" --force install-doc: doc cd doc && $(MAKE) $(MFLAGS) install install-home: install-home-bin install-home-doc install-home-bin: build $(PYTHON) setup.py $(PURE) install --home="$(HOME)" --prefix="" --force install-home-doc: doc cd doc && $(MAKE) $(MFLAGS) PREFIX="$(HOME)" install MANIFEST-doc: $(MAKE) -C doc MANIFEST MANIFEST.in: MANIFEST-doc hg manifest | sed -e 's/^/include /' > MANIFEST.in echo include mercurial/__version__.py >> MANIFEST.in sed -e 's/^/include /' < doc/MANIFEST >> MANIFEST.in dist: tests dist-notests dist-notests: doc MANIFEST.in TAR_OPTIONS="--owner=root --group=root --mode=u+w,go-w,a+rX-s" $(PYTHON) setup.py -q sdist check: tests tests: cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) test-%: cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@ testpy-%: @echo Looking for Python $* in $(HGPYTHONS) [ -e $(HGPYTHONS)/$*/bin/python ] || ( \ cd $$(mktemp --directory --tmpdir) && \ $(MAKE) -f $(HGROOT)/contrib/Makefile.python PYTHONVER=$* PREFIX=$(HGPYTHONS)/$* python ) cd tests && $(HGPYTHONS)/$*/bin/python run-tests.py $(TESTFLAGS) check-code: hg manifest | xargs python contrib/check-code.py format-c: clang-format --style file -i \ `hg files 'set:(**.c or **.cc or **.h) and not "listfile:contrib/clang-format-blacklist"'` update-pot: i18n/hg.pot i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n/posplit i18n/hggettext $(PYTHON) i18n/hggettext mercurial/commands.py \ hgext/*.py hgext/*/__init__.py \ mercurial/fileset.py mercurial/revset.py \ mercurial/templatefilters.py mercurial/templatekw.py \ mercurial/templater.py \ mercurial/filemerge.py \ mercurial/hgweb/webcommands.py \ mercurial/util.py \ $(DOCFILES) > i18n/hg.pot.tmp # All strings marked for translation in Mercurial contain # ASCII characters only. But some files contain string # literals like this '\037\213'. xgettext thinks it has to # parse them even though they are not marked for translation. # Extracting with an explicit encoding of ISO-8859-1 will make # xgettext "parse" and ignore them. echo $(PYFILES) | xargs \ xgettext --package-name "Mercurial" \ --msgid-bugs-address "" \ --copyright-holder "Matt Mackall and others" \ --from-code ISO-8859-1 --join --sort-by-file --add-comments=i18n: \ -d hg -p i18n -o hg.pot.tmp $(PYTHON) i18n/posplit i18n/hg.pot.tmp # The target file is not created before the last step. So it never is in # an intermediate state. mv -f i18n/hg.pot.tmp i18n/hg.pot %.po: i18n/hg.pot # work on a temporary copy for never having a half completed target cp $@ $@.tmp msgmerge --no-location --update $@.tmp $^ mv -f $@.tmp $@ # Packaging targets osx: rm -rf build/mercurial /usr/bin/python2.7 setup.py install --optimize=1 \ --root=build/mercurial/ --prefix=/usr/local/ \ --install-lib=/Library/Python/2.7/site-packages/ make -C doc all install DESTDIR="$(PWD)/build/mercurial/" # Place a bogon .DS_Store file in the target dir so we can be # sure it doesn't get included in the final package. touch build/mercurial/.DS_Store # install zsh completions - this location appears to be # searched by default as of macOS Sierra. install -d build/mercurial/usr/local/share/zsh/site-functions/ install -m 0644 contrib/zsh_completion build/mercurial/usr/local/share/zsh/site-functions/_hg # install bash completions - there doesn't appear to be a # place that's searched by default for bash, so we'll follow # the lead of Apple's git install and just put it in a # location of our own. install -d build/mercurial/usr/local/hg/contrib/ install -m 0644 contrib/bash_completion build/mercurial/usr/local/hg/contrib/hg-completion.bash make -C contrib/chg \ HGPATH=/usr/local/bin/hg \ PYTHON=/usr/bin/python2.7 \ HGEXTDIR=/Library/Python/2.7/site-packages/hgext \ DESTDIR=../../build/mercurial \ PREFIX=/usr/local \ clean install mkdir -p $${OUTPUTDIR:-dist} HGVER=$$(python contrib/genosxversion.py $(OSXVERSIONFLAGS) build/mercurial/Library/Python/2.7/site-packages/mercurial/__version__.py) && \ OSXVER=$$(sw_vers -productVersion | cut -d. -f1,2) && \ pkgbuild --filter \\.DS_Store --root build/mercurial/ \ --identifier org.mercurial-scm.mercurial \ --version "$${HGVER}" \ build/mercurial.pkg && \ productbuild --distribution contrib/macosx/distribution.xml \ --package-path build/ \ --version "$${HGVER}" \ --resources contrib/macosx/ \ "$${OUTPUTDIR:-dist/}"/Mercurial-"$${HGVER}"-macosx"$${OSXVER}".pkg deb: contrib/builddeb ppa: contrib/builddeb --source-only contrib/docker/debian-%: contrib/docker/debian.template sed "s/__CODENAME__/$*/" $< > $@ docker-debian-jessie: contrib/docker/debian-jessie mkdir -p packages/debian-jessie contrib/dockerdeb debian jessie docker-debian-stretch: contrib/docker/debian-stretch mkdir -p packages/debian-stretch contrib/dockerdeb debian stretch contrib/docker/ubuntu-%: contrib/docker/ubuntu.template sed "s/__CODENAME__/$*/" $< > $@ docker-ubuntu-trusty: contrib/docker/ubuntu-trusty contrib/dockerdeb ubuntu trusty docker-ubuntu-trusty-ppa: contrib/docker/ubuntu-trusty contrib/dockerdeb ubuntu trusty --source-only docker-ubuntu-xenial: contrib/docker/ubuntu-xenial contrib/dockerdeb ubuntu xenial docker-ubuntu-xenial-ppa: contrib/docker/ubuntu-xenial contrib/dockerdeb ubuntu xenial --source-only docker-ubuntu-yakkety: contrib/docker/ubuntu-yakkety contrib/dockerdeb ubuntu yakkety docker-ubuntu-yakkety-ppa: contrib/docker/ubuntu-yakkety contrib/dockerdeb ubuntu yakkety --source-only docker-ubuntu-zesty: contrib/docker/ubuntu-zesty contrib/dockerdeb ubuntu zesty docker-ubuntu-zesty-ppa: contrib/docker/ubuntu-zesty contrib/dockerdeb ubuntu zesty --source-only docker-ubuntu-artful: contrib/docker/ubuntu-artful contrib/dockerdeb ubuntu artful docker-ubuntu-artful-ppa: contrib/docker/ubuntu-artful contrib/dockerdeb ubuntu artful --source-only fedora20: mkdir -p packages/fedora20 contrib/buildrpm cp rpmbuild/RPMS/*/* packages/fedora20 cp rpmbuild/SRPMS/* packages/fedora20 rm -rf rpmbuild docker-fedora20: mkdir -p packages/fedora20 contrib/dockerrpm fedora20 fedora21: mkdir -p packages/fedora21 contrib/buildrpm cp rpmbuild/RPMS/*/* packages/fedora21 cp rpmbuild/SRPMS/* packages/fedora21 rm -rf rpmbuild docker-fedora21: mkdir -p packages/fedora21 contrib/dockerrpm fedora21 centos5: mkdir -p packages/centos5 contrib/buildrpm --withpython cp rpmbuild/RPMS/*/* packages/centos5 cp rpmbuild/SRPMS/* packages/centos5 docker-centos5: mkdir -p packages/centos5 contrib/dockerrpm centos5 --withpython centos6: mkdir -p packages/centos6 contrib/buildrpm --withpython cp rpmbuild/RPMS/*/* packages/centos6 cp rpmbuild/SRPMS/* packages/centos6 docker-centos6: mkdir -p packages/centos6 contrib/dockerrpm centos6 --withpython centos7: mkdir -p packages/centos7 contrib/buildrpm cp rpmbuild/RPMS/*/* packages/centos7 cp rpmbuild/SRPMS/* packages/centos7 docker-centos7: mkdir -p packages/centos7 contrib/dockerrpm centos7 linux-wheels: linux-wheels-x86_64 linux-wheels-i686 linux-wheels-x86_64: docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`:/src quay.io/pypa/manylinux1_x86_64 /src/contrib/build-linux-wheels.sh linux-wheels-i686: docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`:/src quay.io/pypa/manylinux1_i686 linux32 /src/contrib/build-linux-wheels.sh .PHONY: help all local build doc cleanbutpackages clean install install-bin \ install-doc install-home install-home-bin install-home-doc \ dist dist-notests check tests check-code format-c update-pot \ osx deb ppa docker-debian-jessie docker-debian-stretch \ docker-ubuntu-trusty docker-ubuntu-trusty-ppa \ docker-ubuntu-xenial docker-ubuntu-xenial-ppa \ docker-ubuntu-yakkety docker-ubuntu-yakkety-ppa \ docker-ubuntu-zesty docker-ubuntu-zesty-ppa \ docker-ubuntu-artful docker-ubuntu-artful-ppa \ fedora20 docker-fedora20 fedora21 docker-fedora21 \ centos5 docker-centos5 centos6 docker-centos6 centos7 docker-centos7 \ linux-wheels mercurial-4.5.3/CONTRIBUTING0000644015407300116100000000113013261161234015222 0ustar augieeng00000000000000Our full contribution guidelines are in our wiki, please see: https://www.mercurial-scm.org/wiki/ContributingChanges If you just want a checklist to follow, you can go straight to https://www.mercurial-scm.org/wiki/ContributingChanges#Submission_checklist If you can't run the entire testsuite for some reason (it can be difficult on Windows), please at least run `contrib/check-code.py` on any files you've modified and run `python contrib/check-commit` on any commits you've made (for example, `python contrib/check-commit 273ce12ad8f1` will report some style violations on a very old commit). mercurial-4.5.3/.hgignore0000644015407300116100000000153713261161234015206 0ustar augieeng00000000000000syntax: glob *.elc *.tmp *.orig *.rej *~ *.mergebackup *.o *.so *.dll *.exe *.pyd *.pyc *.pyo *$py.class *.swp *.prof *.zip \#*\# .\#* tests/.coverage* tests/.testtimes* tests/.hypothesis tests/hypothesis-generated tests/annotated tests/exceptions tests/*.err tests/htmlcov build contrib/chg/chg contrib/hgsh/hgsh contrib/vagrant/.vagrant contrib/docker/debian-* contrib/docker/ubuntu-* dist packages doc/common.txt doc/*.[0-9] doc/*.[0-9].txt doc/*.[0-9].gendoc.txt doc/*.[0-9].{x,ht}ml MANIFEST MANIFEST.in patches mercurial/__modulepolicy__.py mercurial/__version__.py mercurial/hgpythonlib.h mercurial.egg-info .DS_Store tags cscope.* .idea/* .asv/* i18n/hg.pot locale/*/LC_MESSAGES/hg.mo hgext/__index__.py rust/target/ # Generated wheels wheelhouse/ syntax: regexp ^\.pc/ ^\.(pydev)?project # hackable windows distribution additions ^hg-python ^hg.py$ mercurial-4.5.3/.hgtags0000644015407300116100000001774213261161236014670 0ustar augieeng00000000000000d40cc5aacc31ed673d9b5b24f98bee78c283062c 0.4f 1c590d34bf61e2ea12c71738e5a746cd74586157 0.4e 7eca4cfa8aad5fce9a04f7d8acadcd0452e2f34e 0.4d b4d0c3786ad3e47beacf8412157326a32b6d25a4 0.4c f40273b0ad7b3a6d3012fd37736d0611f41ecf54 0.5 0a28dfe59f8fab54a5118c5be4f40da34a53cdb7 0.5b 12e0fdbc57a0be78f0e817fd1d170a3615cd35da 0.6 4ccf3de52989b14c3d84e1097f59e39a992e00bd 0.6b eac9c8efcd9bd8244e72fb6821f769f450457a32 0.6c 979c049974485125e1f9357f6bbe9c1b548a64c3 0.7 3a56574f329a368d645853e0f9e09472aee62349 0.8 6a03cff2b0f5d30281e6addefe96b993582f2eac 0.8.1 35fb62a3a673d5322f6274a44ba6456e5e4b3b37 0.9 2be3001847cb18a23c403439d9e7d0ace30804e9 0.9.1 36a957364b1b89c150f2d0e60a99befe0ee08bd3 0.9.2 27230c29bfec36d5540fbe1c976810aefecfd1d2 0.9.3 fb4b6d5fe100b0886f8bc3d6731ec0e5ed5c4694 0.9.4 23889160905a1b09fffe1c07378e9fc1827606eb 0.9.5 bae2e9c838e90a393bae3973a7850280413e091a 1.0 d5cbbe2c49cee22a9fbeb9ea41daa0ac4e26b846 1.0.1 d2375bbee6d47e62ba8e415c86e83a465dc4dce9 1.0.2 2a67430f92f15ea5159c26b09ec4839a0c549a26 1.1 3773e510d433969e277b1863c317b674cbee2065 1.1.1 11a4eb81fb4f4742451591489e2797dc47903277 1.1.2 11efa41037e280d08cfb07c09ad485df30fb0ea8 1.2 02981000012e3adf40c4849bd7b3d5618f9ce82d 1.2.1 196d40e7c885fa6e95f89134809b3ec7bdbca34b 1.3 3ef6c14a1e8e83a31226f5881b7fe6095bbfa6f6 1.3.1 31ec469f9b556f11819937cf68ee53f2be927ebf 1.4 439d7ea6fe3aa4ab9ec274a68846779153789de9 1.4.1 296a0b14a68621f6990c54fdba0083f6f20935bf 1.4.2 4aa619c4c2c09907034d9824ebb1dd0e878206eb 1.4.3 ff2704a8ded37fbebd8b6eb5ec733731d725da8a 1.5 2b01dab594167bc0dd33331dbaa6dca3dca1b3aa 1.5.1 39f725929f0c48c5fb3b90c071fc3066012456ca 1.5.2 fdcf80f26604f233dc4d8f0a5ef9d7470e317e8a 1.5.3 24fe2629c6fd0c74c90bd066e77387c2b02e8437 1.5.4 f786fc4b8764cd2a5526d259cf2f94d8a66924d9 1.6 bf1774d95bde614af3956d92b20e2a0c68c5fec7 1.6.1 c00f03a4982e467fb6b6bd45908767db6df4771d 1.6.2 ff5cec76b1c5b6be9c3bb923aae8c3c6d079d6b9 1.6.3 93d8bff78c96fe7e33237b257558ee97290048a4 1.6.4 333421b9e0f96c7bc788e5667c146a58a9440a55 1.7 4438875ec01bd0fc32be92b0872eb6daeed4d44f 1.7.1 6aff4f144ad356311318b0011df0bb21f2c97429 1.7.2 e3bf16703e2601de99e563cdb3a5d50b64e6d320 1.7.3 a6c855c32ea081da3c3b8ff628f1847ff271482f 1.7.4 2b2155623ee2559caf288fd333f30475966c4525 1.7.5 2616325766e3504c8ae7c84bd15ee610901fe91d 1.8 aa1f3be38ab127280761889d2dca906ca465b5f4 1.8.1 b032bec2c0a651ca0ddecb65714bfe6770f67d70 1.8.2 3cb1e95676ad089596bd81d0937cad37d6e3b7fb 1.8.3 733af5d9f6b22387913e1d11350fb8cb7c1487dd 1.8.4 de9eb6b1da4fc522b1cab16d86ca166204c24f25 1.9 4a43e23b8c55b4566b8200bf69fe2158485a2634 1.9.1 d629f1e89021103f1753addcef6b310e4435b184 1.9.2 351a9292e430e35766c552066ed3e87c557b803b 1.9.3 384082750f2c51dc917d85a7145748330fa6ef4d 2.0-rc 41453d55b481ddfcc1dacb445179649e24ca861d 2.0 195dbd1cef0c2f9f8bcf4ea303238105f716bda3 2.0.1 6344043924497cd06d781d9014c66802285072e4 2.0.2 db33555eafeaf9df1e18950e29439eaa706d399b 2.1-rc 2aa5b51f310fb3befd26bed99c02267f5c12c734 2.1 53e2cd303ecf8ca7c7eeebd785c34e5ed6b0f4a4 2.1.1 b9bd95e61b49c221c4cca24e6da7c946fc02f992 2.1.2 d9e2f09d5488c395ae9ddbb320ceacd24757e055 2.2-rc 00182b3d087909e3c3ae44761efecdde8f319ef3 2.2 5983de86462c5a9f42a3ad0f5e90ce5b1d221d25 2.2.1 85a358df5bbbe404ca25730c9c459b34263441dc 2.2.2 b013baa3898e117959984fc64c29d8c784d2f28b 2.2.3 a06e2681dd1786e2354d84a5fa9c1c88dd4fa3e0 2.3-rc 7f5094bb3f423fc799e471aac2aee81a7ce57a0b 2.3 072209ae4ddb654eb2d5fd35bff358c738414432 2.3.1 b3f0f9a39c4e1d0250048cd803ab03542d6f140a 2.3.2 d118a4f4fd16d9b558ec3f3e87bfee772861d2b7 2.4-rc 195ad823b5d58c68903a6153a25e3fb4ed25239d 2.4 0c10cf8191469e7c3c8844922e17e71a176cb7cb 2.4.1 a4765077b65e6ae29ba42bab7834717b5072d5ba 2.4.2 f5fbe15ca7449f2c9a3cf817c86d0ae68b307214 2.5-rc a6088c05e43a8aee0472ca3a4f6f8d7dd914ebbf 2.5 7511d4df752e61fe7ae4f3682e0a0008573b0402 2.5.1 5b7175377babacce80a6c1e12366d8032a6d4340 2.5.2 50c922c1b5145dab8baefefb0437d363b6a6c21c 2.5.3 8a7bd2dccd44ed571afe7424cd7f95594f27c092 2.5.4 292cd385856d98bacb2c3086f8897bc660c2beea 2.6-rc 23f785b38af38d2fca6b8f3db56b8007a84cd73a 2.6 ddc7a6be20212d18f3e27d9d7e6f079a66d96f21 2.6.1 cceaf7af4c9e9e6fa2dbfdcfe9856c5da69c4ffd 2.6.2 009794acc6e37a650f0fae37872e733382ac1c0c 2.6.3 f0d7721d7322dcfb5af33599c2543f27335334bb 2.7-rc f37b5a17e6a0ee17afde2cdde5393dd74715fb58 2.7 335a558f81dc73afeab4d7be63617392b130117f 2.7.1 e7fa36d2ad3a7944a52dca126458d6f482db3524 2.7.2 1596f2d8f2421314b1ddead8f7d0c91009358994 2.8-rc d825e4025e39d1c39db943cdc89818abd0a87c27 2.8 209e04a06467e2969c0cc6501335be0406d46ef0 2.8.1 ca387377df7a3a67dbb90b6336b781cdadc3ef41 2.8.2 8862469e16f9236208581b20de5f96bd13cc039d 2.9-rc 3cec5134e9c4bceab6a00c60f52a4f80677a78f2 2.9 b96cb15ec9e04d8ac5ee08b34fcbbe4200588965 2.9.1 3f83fc5cfe715d292069ee8417c83804f6c6c1e4 2.9.2 564f55b251224f16508dd1311452db7780dafe2b 3.0-rc 2195ac506c6ababe86985b932f4948837c0891b5 3.0 269c80ee5b3cb3684fa8edc61501b3506d02eb10 3.0.1 2d8cd3d0e83c7336c0cb45a9f88638363f993848 3.0.2 6c36dc6cd61a0e1b563f1d51e55bdf4dacf12162 3.1-rc 3178e49892020336491cdc6945885c4de26ffa8b 3.1 5dc91146f35369949ea56b40172308158b59063a 3.1.1 f768c888aaa68d12dd7f509dcc7f01c9584357d0 3.1.2 7f8d16af8cae246fa5a48e723d48d58b015aed94 3.2-rc ced632394371a36953ce4d394f86278ae51a2aae 3.2 643c58303fb0ec020907af28b9e486be299ba043 3.2.1 902554884335e5ca3661d63be9978eb4aec3f68a 3.2.2 6dad422ecc5adb63d9fa649eeb8e05a5f9bc4900 3.2.3 1265a3a71d75396f5d4cf6935ae7d9ba5407a547 3.2.4 db8e3f7948b1fdeb9ad12d448fc3525759908b9f 3.3-rc fbdd5195528fae4f41feebc1838215c110b25d6a 3.3 5b4ed033390bf6e2879c8f5c28c84e1ee3b87231 3.3.1 07a92bbd02e5e3a625e0820389b47786b02b2cea 3.3.2 2e2e9a0750f91a6fe0ad88e4de34f8efefdcab08 3.3.3 e89f909edffad558b56f4affa8239e4832f88de0 3.4-rc 8cc6036bca532e06681c5a8fa37efaa812de67b5 3.4 ed18f4acf435a2824c6f49fba40f42b9df5da7ad 3.4.1 540cd0ddac49c1125b2e013aa2ff18ecbd4dd954 3.4.2 96a38d44ba093bd1d1ecfd34119e94056030278b 3.5-rc 21aa1c313b05b1a85f8ffa1120d51579ddf6bf24 3.5 1a45e49a6bed023deb229102a8903234d18054d3 3.5.1 9a466b9f9792e3ad7ae3fc6c43c3ff2e136b718d 3.5.2 b66e3ca0b90c3095ea28dfd39aa24247bebf5c20 3.6-rc 47dd34f2e7272be9e3b2a5a83cd0d20be44293f4 3.6 1aa5083cbebbe7575c88f3402ab377539b484897 3.6.1 2d437a0f3355834a9485bbbeb30a52a052c98f19 3.6.2 ea389970c08449440587712117f178d33bab3f1e 3.6.3 158bdc8965720ca4061f8f8d806563cfc7cdb62e 3.7-rc 2408645de650d8a29a6ce9e7dce601d8dd0d1474 3.7 b698abf971e7377d9b7ec7fc8c52df45255b0329 3.7.1 d493d64757eb45ada99fcb3693e479a51b7782da 3.7.2 ae279d4a19e9683214cbd1fe8298cf0b50571432 3.7.3 740156eedf2c450aee58b1a90b0e826f47c5da64 3.8-rc f85de28eae32e7d3064b1a1321309071bbaaa069 3.8 a56296f55a5e1038ea5016dace2076b693c28a56 3.8.1 aaabed77791a75968a12b8c43ad263631a23ee81 3.8.2 a9764ab80e11bcf6a37255db7dd079011f767c6c 3.8.3 26a5d605b8683a292bb89aea11f37a81b06ac016 3.8.4 519bb4f9d3a47a6e83c2b414d58811ed38f503c2 3.9-rc 299546f84e68dbb9bd026f0f3a974ce4bdb93686 3.9 ccd436f7db6d5d7b9af89715179b911d031d44f1 3.9.1 149433e68974eb5c63ccb03f794d8b57339a80c4 3.9.2 438173c415874f6ac653efc1099dec9c9150e90f 4.0-rc eab27446995210c334c3d06f1a659e3b9b5da769 4.0 b3b1ae98f6a0e14c1e1ba806a6c18e193b6dae5c 4.0.1 e69874dc1f4e142746ff3df91e678a09c6fc208c 4.0.2 a1dd2c0c479e0550040542e392e87bc91262517e 4.1-rc e1526da1e6d84e03146151c9b6e6950fe9a83d7d 4.1 25703b624d27e3917d978af56d6ad59331e0464a 4.1.1 ed5b25874d998ababb181a939dd37a16ea644435 4.1.2 77eaf9539499a1b8be259ffe7ada787d07857f80 4.1.3 616e788321cc4ae9975b7f0c54c849f36d82182b 4.2-rc bb96d4a497432722623ae60d9bc734a1e360179e 4.2 c850f0ed54c1d42f9aa079ad528f8127e5775217 4.2.1 26c49ed51a698ec016d2b4c6b44ca3c3f73cc788 4.2.2 857876ebaed4e315f63157bd157d6ce553c7ab73 4.3-rc 5544af8622863796a0027566f6b646e10d522c4c 4.3 943c91326b23954e6e1c6960d0239511f9530258 4.2.3 3fee7f7d2da04226914c2258cc2884dc27384fd7 4.3.1 920977f72c7b70acfdaf56ab35360584d7845827 4.3.2 2f427b57bf9019c6dc3750baa539dc22c1be50f6 4.3.3 1e2454b60e5936f5e77498cab2648db469504487 4.4-rc 0ccb43d4cf01d013ae05917ec4f305509f851b2d 4.4 cabc840ffdee8a72f3689fb77dd74d04fdc2bc04 4.4.1 a92b9f8e11ba330614cdfd6af0e03b15c1ff3797 4.4.2 27b6df1b5adbdf647cf5c6675b40575e1b197c60 4.5-rc d334afc585e29577f271c5eda03378736a16ca6b 4.5 369aadf7a3264b03c8b09efce715bc41e6ab4a9b 4.5.1 8bba684efde7f45add05f737952093bb2aa07155 4.5.2 mercurial-4.5.3/hgeditor0000755015407300116100000000231213261161234015126 0ustar augieeng00000000000000#!/bin/sh # # This is an example of using HGEDITOR to create of diff to review the # changes while committing. # If you want to pass your favourite editor some other parameters # only for Mercurial, modify this: case "${EDITOR}" in "") EDITOR="vi" ;; emacs) EDITOR="$EDITOR -nw" ;; gvim|vim) EDITOR="$EDITOR -f -o" ;; esac HGTMP="" cleanup_exit() { rm -rf "$HGTMP" } # Remove temporary files even if we get interrupted trap "cleanup_exit" 0 # normal exit trap "exit 255" HUP INT QUIT ABRT TERM HGTMP=$(mktemp -d ${TMPDIR-/tmp}/hgeditor.XXXXXX) [ x$HGTMP != x -a -d $HGTMP ] || { echo "Could not create temporary directory! Exiting." 1>&2 exit 1 } ( grep '^HG: changed' "$1" | cut -b 13- | while read changed; do "$HG" diff "$changed" >> "$HGTMP/diff" done ) cat "$1" > "$HGTMP/msg" MD5=$(which md5sum 2>/dev/null) || \ MD5=$(which md5 2>/dev/null) [ -x "${MD5}" ] && CHECKSUM=`${MD5} "$HGTMP/msg"` if [ -s "$HGTMP/diff" ]; then $EDITOR "$HGTMP/msg" "$HGTMP/diff" || exit $? else $EDITOR "$HGTMP/msg" || exit $? fi [ -x "${MD5}" ] && (echo "$CHECKSUM" | ${MD5} -c >/dev/null 2>&1 && exit 13) mv "$HGTMP/msg" "$1" exit $? mercurial-4.5.3/rust/0000755015407300116100000000000013261161260014371 5ustar augieeng00000000000000mercurial-4.5.3/rust/Cargo.toml0000644015407300116100000000004013261161234016314 0ustar augieeng00000000000000[workspace] members = ["hgcli"] mercurial-4.5.3/rust/Cargo.lock0000644015407300116100000001315513261161234016304 0ustar augieeng00000000000000[[package]] name = "aho-corasick" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cpython" version = "0.1.0" source = "git+https://github.com/indygreg/rust-cpython.git?rev=c90d65cf84abfffce7ef54476bbfed56017a2f52#c90d65cf84abfffce7ef54476bbfed56017a2f52" dependencies = [ "libc 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", "python27-sys 0.1.2 (git+https://github.com/indygreg/rust-cpython.git?rev=c90d65cf84abfffce7ef54476bbfed56017a2f52)", ] [[package]] name = "hgcli" version = "0.1.0" dependencies = [ "cpython 0.1.0 (git+https://github.com/indygreg/rust-cpython.git?rev=c90d65cf84abfffce7ef54476bbfed56017a2f52)", "libc 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)", "python27-sys 0.1.2 (git+https://github.com/indygreg/rust-cpython.git?rev=c90d65cf84abfffce7ef54476bbfed56017a2f52)", ] [[package]] name = "kernel32-sys" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libc" version = "0.2.35" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "memchr" version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "python27-sys" version = "0.1.2" source = "git+https://github.com/indygreg/rust-cpython.git?rev=c90d65cf84abfffce7ef54476bbfed56017a2f52#c90d65cf84abfffce7ef54476bbfed56017a2f52" dependencies = [ "libc 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex" version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "thread-id" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "thread_local" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "utf8-ranges" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi-build" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] "checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" "checksum cpython 0.1.0 (git+https://github.com/indygreg/rust-cpython.git?rev=c90d65cf84abfffce7ef54476bbfed56017a2f52)" = "" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum libc 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)" = "96264e9b293e95d25bfcbbf8a88ffd1aedc85b754eba8b7d78012f638ba220eb" "checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" "checksum num-traits 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "cacfcab5eb48250ee7d0c7896b51a2c5eec99c1feea5f32025635f5ae4b00070" "checksum python27-sys 0.1.2 (git+https://github.com/indygreg/rust-cpython.git?rev=c90d65cf84abfffce7ef54476bbfed56017a2f52)" = "" "checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" "checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" "checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" "checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" "checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" mercurial-4.5.3/rust/.cargo/0000755015407300116100000000000013261161260015542 5ustar augieeng00000000000000mercurial-4.5.3/rust/.cargo/config0000644015407300116100000000061713261161234016737 0ustar augieeng00000000000000# Rust builds with a modern MSVC and uses a newer CRT. # Python 2.7 has a shared library dependency on an older CRT (msvcr90.dll). # We statically link the modern CRT to avoid multiple msvcr*.dll libraries # being loaded and Python possibly picking up symbols from the newer runtime # (which would be loaded first). [target.'cfg(target_os = "windows")'] rustflags = ["-Ctarget-feature=+crt-static"] mercurial-4.5.3/rust/README.rst0000644015407300116100000000424213261161234016063 0ustar augieeng00000000000000=================== Mercurial Rust Code =================== This directory contains various Rust code for the Mercurial project. The top-level ``Cargo.toml`` file defines a workspace containing all primary Mercurial crates. Building ======== To build the Rust components:: $ cargo build If you prefer a non-debug / release configuration:: $ cargo build --release Features -------- The following Cargo features are available: localdev (default) Produce files that work with an in-source-tree build. In this mode, the build finds and uses a ``python2.7`` binary from ``PATH``. The ``hg`` binary assumes it runs from ``rust/target/hg`` and it finds Mercurial files at ``dirname($0)/../../../``. Build Mechanism --------------- The produced ``hg`` binary is *bound* to a CPython installation. The binary links against and loads a CPython library that is discovered at build time (by a ``build.rs`` Cargo build script). The Python standard library defined by this CPython installation is also used. Finding the appropriate CPython installation to use is done by the ``python27-sys`` crate's ``build.rs``. Its search order is:: 1. ``PYTHON_SYS_EXECUTABLE`` environment variable. 2. ``python`` executable on ``PATH`` 3. ``python2`` executable on ``PATH`` 4. ``python2.7`` executable on ``PATH`` Additional verification of the found Python will be performed by our ``build.rs`` to ensure it meets Mercurial's requirements. Details about the build-time configured Python are built into the produced ``hg`` binary. This means that a built ``hg`` binary is only suitable for a specific, well-defined role. These roles are controlled by Cargo features (see above). Running ======= The ``hgcli`` crate produces an ``hg`` binary. You can run this binary via ``cargo run``:: $ cargo run --manifest-path hgcli/Cargo.toml Or directly:: $ target/debug/hg $ target/release/hg You can also run the test harness with this binary:: $ ./run-tests.py --with-hg ../rust/target/debug/hg .. note:: Integration with the test harness is still preliminary. Remember to ``cargo build`` after changes because the test harness doesn't yet automatically build Rust code. mercurial-4.5.3/rust/hgcli/0000755015407300116100000000000013261161260015457 5ustar augieeng00000000000000mercurial-4.5.3/rust/hgcli/Cargo.toml0000644015407300116100000000160213261161234017407 0ustar augieeng00000000000000[package] name = "hgcli" version = "0.1.0" authors = ["Gregory Szorc "] license = "GPL-2.0" build = "build.rs" [[bin]] name = "hg" path = "src/main.rs" [features] # localdev: detect Python in PATH and use files from source checkout. default = ["localdev"] localdev = [] [dependencies] libc = "0.2.34" # We currently use a custom build of cpython and python27-sys with the # following changes: # * GILGuard call of prepare_freethreaded_python() is removed. # TODO switch to official release when our changes are incorporated. [dependencies.cpython] version = "0.1" default-features = false features = ["python27-sys"] git = "https://github.com/indygreg/rust-cpython.git" rev = "c90d65cf84abfffce7ef54476bbfed56017a2f52" [dependencies.python27-sys] version = "0.1.2" git = "https://github.com/indygreg/rust-cpython.git" rev = "c90d65cf84abfffce7ef54476bbfed56017a2f52" mercurial-4.5.3/rust/hgcli/build.rs0000644015407300116100000000664513261161234017140 0ustar augieeng00000000000000// build.rs -- Configure build environment for `hgcli` Rust package. // // Copyright 2017 Gregory Szorc // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. use std::collections::HashMap; use std::env; use std::path::Path; use std::process::Command; struct PythonConfig { python: String, config: HashMap, } fn get_python_config() -> PythonConfig { // The python27-sys crate exports a Cargo variable defining the full // path to the interpreter being used. let python = env::var("DEP_PYTHON27_PYTHON_INTERPRETER").expect( "Missing DEP_PYTHON27_PYTHON_INTERPRETER; bad python27-sys crate?", ); if !Path::new(&python).exists() { panic!( "Python interpreter {} does not exist; this should never happen", python ); } // This is a bit hacky but it gets the job done. let separator = "SEPARATOR STRING"; let script = "import sysconfig; \ c = sysconfig.get_config_vars(); \ print('SEPARATOR STRING'.join('%s=%s' % i for i in c.items()))"; let mut command = Command::new(&python); command.arg("-c").arg(script); let out = command.output().unwrap(); if !out.status.success() { panic!( "python script failed: {}", String::from_utf8_lossy(&out.stderr) ); } let stdout = String::from_utf8_lossy(&out.stdout); let mut m = HashMap::new(); for entry in stdout.split(separator) { let mut parts = entry.splitn(2, "="); let key = parts.next().unwrap(); let value = parts.next().unwrap(); m.insert(String::from(key), String::from(value)); } PythonConfig { python: python, config: m, } } #[cfg(not(target_os = "windows"))] fn have_shared(config: &PythonConfig) -> bool { match config.config.get("Py_ENABLE_SHARED") { Some(value) => value == "1", None => false, } } #[cfg(target_os = "windows")] fn have_shared(config: &PythonConfig) -> bool { use std::path::PathBuf; // python27.dll should exist next to python2.7.exe. let mut dll = PathBuf::from(&config.python); dll.pop(); dll.push("python27.dll"); return dll.exists(); } const REQUIRED_CONFIG_FLAGS: [&str; 2] = ["Py_USING_UNICODE", "WITH_THREAD"]; fn main() { let config = get_python_config(); println!("Using Python: {}", config.python); println!("cargo:rustc-env=PYTHON_INTERPRETER={}", config.python); let prefix = config.config.get("prefix").unwrap(); println!("Prefix: {}", prefix); // TODO Windows builds don't expose these config flags. Figure out another // way. #[cfg(not(target_os = "windows"))] for key in REQUIRED_CONFIG_FLAGS.iter() { let result = match config.config.get(*key) { Some(value) => value == "1", None => false, }; if !result { panic!("Detected Python requires feature {}", key); } } // We need a Python shared library. if !have_shared(&config) { panic!("Detected Python lacks a shared library, which is required"); } let ucs4 = match config.config.get("Py_UNICODE_SIZE") { Some(value) => value == "4", None => false, }; if !ucs4 { #[cfg(not(target_os = "windows"))] panic!("Detected Python doesn't support UCS-4 code points"); } } mercurial-4.5.3/rust/hgcli/src/0000755015407300116100000000000013261161260016246 5ustar augieeng00000000000000mercurial-4.5.3/rust/hgcli/src/main.rs0000644015407300116100000001715513261161234017552 0ustar augieeng00000000000000// main.rs -- Main routines for `hg` program // // Copyright 2017 Gregory Szorc // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. extern crate libc; extern crate cpython; extern crate python27_sys; use cpython::{NoArgs, ObjectProtocol, PyModule, PyResult, Python}; use libc::{c_char, c_int}; use std::env; use std::path::PathBuf; use std::ffi::{CString, OsStr}; #[cfg(target_family = "unix")] use std::os::unix::ffi::{OsStrExt, OsStringExt}; #[derive(Debug)] struct Environment { _exe: PathBuf, python_exe: PathBuf, python_home: PathBuf, mercurial_modules: PathBuf, } /// Run Mercurial locally from a source distribution or checkout. /// /// hg is /rust/target//hg /// Python interpreter is detected by build script. /// Python home is relative to Python interpreter. /// Mercurial files are relative to hg binary, which is relative to source root. #[cfg(feature = "localdev")] fn get_environment() -> Environment { let exe = env::current_exe().unwrap(); let mut mercurial_modules = exe.clone(); mercurial_modules.pop(); // /rust/target/ mercurial_modules.pop(); // /rust/target mercurial_modules.pop(); // /rust mercurial_modules.pop(); // / let python_exe: &'static str = env!("PYTHON_INTERPRETER"); let python_exe = PathBuf::from(python_exe); let mut python_home = python_exe.clone(); python_home.pop(); // On Windows, python2.7.exe exists at the root directory of the Python // install. Everywhere else, the Python install root is one level up. if !python_exe.ends_with("python2.7.exe") { python_home.pop(); } Environment { _exe: exe.clone(), python_exe: python_exe, python_home: python_home, mercurial_modules: mercurial_modules.to_path_buf(), } } // On UNIX, platform string is just bytes and should not contain NUL. #[cfg(target_family = "unix")] fn cstring_from_os>(s: T) -> CString { CString::new(s.as_ref().as_bytes()).unwrap() } // TODO convert to ANSI characters? #[cfg(target_family = "windows")] fn cstring_from_os>(s: T) -> CString { CString::new(s.as_ref().to_str().unwrap()).unwrap() } // On UNIX, argv starts as an array of char*. So it is easy to convert // to C strings. #[cfg(target_family = "unix")] fn args_to_cstrings() -> Vec { env::args_os() .map(|a| CString::new(a.into_vec()).unwrap()) .collect() } // TODO Windows support is incomplete. We should either use env::args_os() // (or call into GetCommandLineW() + CommandLinetoArgvW()), convert these to // PyUnicode instances, and pass these into Python/Mercurial outside the // standard PySys_SetArgvEx() mechanism. This will allow us to preserve the // raw bytes (since PySys_SetArgvEx() is based on char* and can drop wchar // data. // // For now, we use env::args(). This will choke on invalid UTF-8 arguments. // But it is better than nothing. #[cfg(target_family = "windows")] fn args_to_cstrings() -> Vec { env::args().map(|a| CString::new(a).unwrap()).collect() } fn set_python_home(env: &Environment) { let raw = cstring_from_os(&env.python_home).into_raw(); unsafe { python27_sys::Py_SetPythonHome(raw); } } fn update_encoding(_py: Python, _sys_mod: &PyModule) { // Call sys.setdefaultencoding("undefined") if HGUNICODEPEDANTRY is set. let pedantry = env::var("HGUNICODEPEDANTRY").is_ok(); if pedantry { // site.py removes the sys.setdefaultencoding attribute. So we need // to reload the module to get a handle on it. This is a lesser // used feature and we'll support this later. // TODO support this panic!("HGUNICODEPEDANTRY is not yet supported"); } } fn update_modules_path(env: &Environment, py: Python, sys_mod: &PyModule) { let sys_path = sys_mod.get(py, "path").unwrap(); sys_path .call_method(py, "insert", (0, env.mercurial_modules.to_str()), None) .expect("failed to update sys.path to location of Mercurial modules"); } fn run() -> Result<(), i32> { let env = get_environment(); //println!("{:?}", env); // Tell Python where it is installed. set_python_home(&env); // Set program name. The backing memory needs to live for the duration of the // interpreter. // // TODO consider storing this in a static or associating with lifetime of // the Python interpreter. // // Yes, we use the path to the Python interpreter not argv[0] here. The // reason is because Python uses the given path to find the location of // Python files. Apparently we could define our own ``Py_GetPath()`` // implementation. But this may require statically linking Python, which is // not desirable. let program_name = cstring_from_os(&env.python_exe).as_ptr(); unsafe { python27_sys::Py_SetProgramName(program_name as *mut i8); } unsafe { python27_sys::Py_Initialize(); } // https://docs.python.org/2/c-api/init.html#c.PySys_SetArgvEx has important // usage information about PySys_SetArgvEx: // // * It says the first argument should be the script that is being executed. // If not a script, it can be empty. We are definitely not a script. // However, parts of Mercurial do look at sys.argv[0]. So we need to set // something here. // // * When embedding Python, we should use ``PySys_SetArgvEx()`` and set // ``updatepath=0`` for security reasons. Essentially, Python's default // logic will treat an empty argv[0] in a manner that could result in // sys.path picking up directories it shouldn't and this could lead to // loading untrusted modules. // env::args() will panic if it sees a non-UTF-8 byte sequence. And // Mercurial supports arbitrary encodings of input data. So we need to // use OS-specific mechanisms to get the raw bytes without UTF-8 // interference. let args = args_to_cstrings(); let argv: Vec<*const c_char> = args.iter().map(|a| a.as_ptr()).collect(); unsafe { python27_sys::PySys_SetArgvEx(args.len() as c_int, argv.as_ptr() as *mut *mut i8, 0); } let result; { // These need to be dropped before we call Py_Finalize(). Hence the // block. let gil = Python::acquire_gil(); let py = gil.python(); // Mercurial code could call sys.exit(), which will call exit() // itself. So this may not return. // TODO this may cause issues on Windows due to the CRT mismatch. // Investigate if we can intercept sys.exit() or SystemExit() to // ensure we handle process exit. result = match run_py(&env, py) { // Print unhandled exceptions and exit code 255, as this is what // `python` does. Err(err) => { err.print(py); Err(255) } Ok(()) => Ok(()), }; } unsafe { python27_sys::Py_Finalize(); } result } fn run_py(env: &Environment, py: Python) -> PyResult<()> { let sys_mod = py.import("sys").unwrap(); update_encoding(py, &sys_mod); update_modules_path(&env, py, &sys_mod); // TODO consider a better error message on failure to import. let demand_mod = py.import("hgdemandimport")?; demand_mod.call(py, "enable", NoArgs, None)?; let dispatch_mod = py.import("mercurial.dispatch")?; dispatch_mod.call(py, "run", NoArgs, None)?; Ok(()) } fn main() { let exit_code = match run() { Err(err) => err, Ok(()) => 0, }; std::process::exit(exit_code); } mercurial-4.5.3/hgext3rd/0000755015407300116100000000000013261161257015132 5ustar augieeng00000000000000mercurial-4.5.3/hgext3rd/__init__.py0000644015407300116100000000023513261161234017236 0ustar augieeng00000000000000# name space package to host third party extensions from __future__ import absolute_import import pkgutil __path__ = pkgutil.extend_path(__path__, __name__) mercurial-4.5.3/tests/0000755015407300116100000000000013261161260014536 5ustar augieeng00000000000000mercurial-4.5.3/tests/test-trusted.py0000644015407300116100000001756413261161234017575 0ustar augieeng00000000000000# Since it's not easy to write a test that portably deals # with files from different users/groups, we cheat a bit by # monkey-patching some functions in the util module from __future__ import absolute_import, print_function import os from mercurial import ( error, ui as uimod, util, ) hgrc = os.environ['HGRCPATH'] f = open(hgrc) basehgrc = f.read() f.close() def testui(user='foo', group='bar', tusers=(), tgroups=(), cuser='foo', cgroup='bar', debug=False, silent=False, report=True): # user, group => owners of the file # tusers, tgroups => trusted users/groups # cuser, cgroup => user/group of the current process # write a global hgrc with the list of trusted users/groups and # some setting so that we can be sure it was read f = open(hgrc, 'w') f.write(basehgrc) f.write('\n[paths]\n') f.write('global = /some/path\n\n') if tusers or tgroups: f.write('[trusted]\n') if tusers: f.write('users = %s\n' % ', '.join(tusers)) if tgroups: f.write('groups = %s\n' % ', '.join(tgroups)) f.close() # override the functions that give names to uids and gids def username(uid=None): if uid is None: return cuser return user util.username = username def groupname(gid=None): if gid is None: return 'bar' return group util.groupname = groupname def isowner(st): return user == cuser util.isowner = isowner # try to read everything #print '# File belongs to user %s, group %s' % (user, group) #print '# trusted users = %s; trusted groups = %s' % (tusers, tgroups) kind = ('different', 'same') who = ('', 'user', 'group', 'user and the group') trusted = who[(user in tusers) + 2*(group in tgroups)] if trusted: trusted = ', but we trust the ' + trusted print('# %s user, %s group%s' % (kind[user == cuser], kind[group == cgroup], trusted)) u = uimod.ui.load() # disable the configuration registration warning # # the purpose of this test is to check the old behavior, not to validate the # behavior from registered item. so we silent warning related to unregisted # config. u.setconfig('devel', 'warn-config-unknown', False, 'test') u.setconfig('devel', 'all-warnings', False, 'test') u.setconfig('ui', 'debug', str(bool(debug))) u.setconfig('ui', 'report_untrusted', str(bool(report))) u.readconfig('.hg/hgrc') if silent: return u print('trusted') for name, path in u.configitems('paths'): print(' ', name, '=', util.pconvert(path)) print('untrusted') for name, path in u.configitems('paths', untrusted=True): print('.', end=' ') u.config('paths', name) # warning with debug=True print('.', end=' ') u.config('paths', name, untrusted=True) # no warnings print(name, '=', util.pconvert(path)) print() return u os.mkdir('repo') os.chdir('repo') os.mkdir('.hg') f = open('.hg/hgrc', 'w') f.write('[paths]\n') f.write('local = /another/path\n\n') f.close() #print '# Everything is run by user foo, group bar\n' # same user, same group testui() # same user, different group testui(group='def') # different user, same group testui(user='abc') # ... but we trust the group testui(user='abc', tgroups=['bar']) # different user, different group testui(user='abc', group='def') # ... but we trust the user testui(user='abc', group='def', tusers=['abc']) # ... but we trust the group testui(user='abc', group='def', tgroups=['def']) # ... but we trust the user and the group testui(user='abc', group='def', tusers=['abc'], tgroups=['def']) # ... but we trust all users print('# we trust all users') testui(user='abc', group='def', tusers=['*']) # ... but we trust all groups print('# we trust all groups') testui(user='abc', group='def', tgroups=['*']) # ... but we trust the whole universe print('# we trust all users and groups') testui(user='abc', group='def', tusers=['*'], tgroups=['*']) # ... check that users and groups are in different namespaces print("# we don't get confused by users and groups with the same name") testui(user='abc', group='def', tusers=['def'], tgroups=['abc']) # ... lists of user names work print("# list of user names") testui(user='abc', group='def', tusers=['foo', 'xyz', 'abc', 'bleh'], tgroups=['bar', 'baz', 'qux']) # ... lists of group names work print("# list of group names") testui(user='abc', group='def', tusers=['foo', 'xyz', 'bleh'], tgroups=['bar', 'def', 'baz', 'qux']) print("# Can't figure out the name of the user running this process") testui(user='abc', group='def', cuser=None) print("# prints debug warnings") u = testui(user='abc', group='def', cuser='foo', debug=True) print("# report_untrusted enabled without debug hides warnings") u = testui(user='abc', group='def', cuser='foo', report=False) print("# report_untrusted enabled with debug shows warnings") u = testui(user='abc', group='def', cuser='foo', debug=True, report=False) print("# ui.readconfig sections") filename = 'foobar' f = open(filename, 'w') f.write('[foobar]\n') f.write('baz = quux\n') f.close() u.readconfig(filename, sections=['foobar']) print(u.config('foobar', 'baz')) print() print("# read trusted, untrusted, new ui, trusted") u = uimod.ui.load() # disable the configuration registration warning # # the purpose of this test is to check the old behavior, not to validate the # behavior from registered item. so we silent warning related to unregisted # config. u.setconfig('devel', 'warn-config-unknown', False, 'test') u.setconfig('devel', 'all-warnings', False, 'test') u.setconfig('ui', 'debug', 'on') u.readconfig(filename) u2 = u.copy() def username(uid=None): return 'foo' util.username = username u2.readconfig('.hg/hgrc') print('trusted:') print(u2.config('foobar', 'baz')) print('untrusted:') print(u2.config('foobar', 'baz', untrusted=True)) print() print("# error handling") def assertraises(f, exc=error.Abort): try: f() except exc as inst: print('raised', inst.__class__.__name__) else: print('no exception?!') print("# file doesn't exist") os.unlink('.hg/hgrc') assert not os.path.exists('.hg/hgrc') testui(debug=True, silent=True) testui(user='abc', group='def', debug=True, silent=True) print() print("# parse error") f = open('.hg/hgrc', 'w') f.write('foo') f.close() try: testui(user='abc', group='def', silent=True) except error.ParseError as inst: print(inst) try: testui(debug=True, silent=True) except error.ParseError as inst: print(inst) print() print('# access typed information') with open('.hg/hgrc', 'w') as f: f.write('''\ [foo] sub=main sub:one=one sub:two=two path=monty/python bool=true int=42 bytes=81mb list=spam,ham,eggs ''') u = testui(user='abc', group='def', cuser='foo', silent=True) def configpath(section, name, default=None, untrusted=False): path = u.configpath(section, name, default, untrusted) if path is None: return None return util.pconvert(path) print('# suboptions, trusted and untrusted') trusted = u.configsuboptions('foo', 'sub') untrusted = u.configsuboptions('foo', 'sub', untrusted=True) print( (trusted[0], sorted(trusted[1].items())), (untrusted[0], sorted(untrusted[1].items()))) print('# path, trusted and untrusted') print(configpath('foo', 'path'), configpath('foo', 'path', untrusted=True)) print('# bool, trusted and untrusted') print(u.configbool('foo', 'bool'), u.configbool('foo', 'bool', untrusted=True)) print('# int, trusted and untrusted') print( u.configint('foo', 'int', 0), u.configint('foo', 'int', 0, untrusted=True)) print('# bytes, trusted and untrusted') print( u.configbytes('foo', 'bytes', 0), u.configbytes('foo', 'bytes', 0, untrusted=True)) print('# list, trusted and untrusted') print( u.configlist('foo', 'list', []), u.configlist('foo', 'list', [], untrusted=True)) mercurial-4.5.3/tests/test-imports-checker.t0000644015407300116100000001212613261161234021002 0ustar augieeng00000000000000#require test-repo $ . "$TESTDIR/helpers-testrepo.sh" $ testrepohgenv $ import_checker="$TESTDIR"/../contrib/import-checker.py Run the doctests from the import checker, and make sure it's working correctly. $ TERM=dumb $ export TERM $ $PYTHON -m doctest $import_checker Run additional tests for the import checker $ mkdir testpackage $ touch testpackage/__init__.py $ cat > testpackage/multiple.py << EOF > from __future__ import absolute_import > import os, sys > EOF $ cat > testpackage/unsorted.py << EOF > from __future__ import absolute_import > import sys > import os > EOF $ cat > testpackage/stdafterlocal.py << EOF > from __future__ import absolute_import > from . import unsorted > import os > EOF $ cat > testpackage/requirerelative.py << EOF > from __future__ import absolute_import > import testpackage.unsorted > EOF $ cat > testpackage/importalias.py << EOF > from __future__ import absolute_import > import ui > EOF $ cat > testpackage/relativestdlib.py << EOF > from __future__ import absolute_import > from .. import os > EOF $ cat > testpackage/symbolimport.py << EOF > from __future__ import absolute_import > from .unsorted import foo > EOF $ cat > testpackage/latesymbolimport.py << EOF > from __future__ import absolute_import > from . import unsorted > from mercurial.node import hex > EOF $ cat > testpackage/multiplegroups.py << EOF > from __future__ import absolute_import > from . import unsorted > from . import more > EOF $ mkdir testpackage/subpackage $ cat > testpackage/subpackage/levelpriority.py << EOF > from __future__ import absolute_import > from . import foo > from .. import parent > EOF $ touch testpackage/subpackage/foo.py $ cat > testpackage/subpackage/__init__.py << EOF > from __future__ import absolute_import > from . import levelpriority # should not cause cycle > EOF $ cat > testpackage/subpackage/localimport.py << EOF > from __future__ import absolute_import > from . import foo > def bar(): > # should not cause "higher-level import should come first" > from .. import unsorted > # but other errors should be detected > from .. import more > import testpackage.subpackage.levelpriority > EOF $ cat > testpackage/importmodulefromsub.py << EOF > from __future__ import absolute_import > from .subpackage import foo # not a "direct symbol import" > EOF $ cat > testpackage/importsymbolfromsub.py << EOF > from __future__ import absolute_import > from .subpackage import foo, nonmodule > EOF $ cat > testpackage/sortedentries.py << EOF > from __future__ import absolute_import > from . import ( > foo, > bar, > ) > EOF $ cat > testpackage/importfromalias.py << EOF > from __future__ import absolute_import > from . import ui > EOF $ cat > testpackage/importfromrelative.py << EOF > from __future__ import absolute_import > from testpackage.unsorted import foo > EOF $ mkdir testpackage2 $ touch testpackage2/__init__.py $ cat > testpackage2/latesymbolimport.py << EOF > from __future__ import absolute_import > from testpackage import unsorted > from mercurial.node import hex > EOF # Shadowing a stdlib module to test "relative import of stdlib module" is # allowed if the module is also being checked $ mkdir email $ touch email/__init__.py $ touch email/errors.py $ cat > email/utils.py << EOF > from __future__ import absolute_import > from . import errors > EOF $ $PYTHON "$import_checker" testpackage*/*.py testpackage/subpackage/*.py \ > email/*.py testpackage/importalias.py:2: ui module must be "as" aliased to uimod testpackage/importfromalias.py:2: ui from testpackage must be "as" aliased to uimod testpackage/importfromrelative.py:2: import should be relative: testpackage.unsorted testpackage/importfromrelative.py:2: direct symbol import foo from testpackage.unsorted testpackage/importsymbolfromsub.py:2: direct symbol import nonmodule from testpackage.subpackage testpackage/latesymbolimport.py:3: symbol import follows non-symbol import: mercurial.node testpackage/multiple.py:2: multiple imported names: os, sys testpackage/multiplegroups.py:3: multiple "from . import" statements testpackage/relativestdlib.py:2: relative import of stdlib module testpackage/requirerelative.py:2: import should be relative: testpackage.unsorted testpackage/sortedentries.py:2: imports from testpackage not lexically sorted: bar < foo testpackage/stdafterlocal.py:3: stdlib import "os" follows local import: testpackage testpackage/subpackage/levelpriority.py:3: higher-level import should come first: testpackage testpackage/subpackage/localimport.py:7: multiple "from .. import" statements testpackage/subpackage/localimport.py:8: import should be relative: testpackage.subpackage.levelpriority testpackage/symbolimport.py:2: direct symbol import foo from testpackage.unsorted testpackage/unsorted.py:3: imports not lexically sorted: os < sys testpackage2/latesymbolimport.py:3: symbol import follows non-symbol import: mercurial.node [1] mercurial-4.5.3/tests/test-lrucachedict.py.out0000644015407300116100000000162113261161234021326 0ustar augieeng00000000000000'a' in d: True d['a']: va 'b' in d: True d['b']: vb 'c' in d: True d['c']: vc 'd' in d: True d['d']: vd 'a' in d: False 'b' in d: True d['b']: vb 'c' in d: True d['c']: vc 'd' in d: True d['d']: vd 'e' in d: True d['e']: ve 'b' in d: True d['b']: vb2 'c' in d: True d['c']: vc2 'd' in d: True d['d']: vd 'e' in d: False 'f' in d: True d['f']: vf 'b' in d: False 'c' in d: False 'd' in d: False 'e' in d: False 'f' in d: False 'a' in d: True d['a']: 1 'b' in d: True d['b']: 2 All of these should be present: 'a' in dc: True dc['a']: va3 'b' in dc: True dc['b']: vb3 'c' in dc: True dc['c']: vc3 'd' in dc: True dc['d']: vd3 All of these except 'a' should be present: 'a' in dc: False 'b' in dc: True dc['b']: vb3 'c' in dc: True dc['c']: vc3 'd' in dc: True dc['d']: vd3 'e' in dc: True dc['e']: ve3 These should be in reverse alphabetical order and read 'v?3': d['d']: vd3 d['c']: vc3 d['b']: vb3 d['a']: va3 mercurial-4.5.3/tests/get-with-headers.py0000755015407300116100000000602713261161234020262 0ustar augieeng00000000000000#!/usr/bin/env python """This does HTTP GET requests given a host:port and path and returns a subset of the headers plus the body of the result.""" from __future__ import absolute_import, print_function import argparse import json import os import sys from mercurial import ( util, ) httplib = util.httplib try: import msvcrt msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) except ImportError: pass parser = argparse.ArgumentParser() parser.add_argument('--twice', action='store_true') parser.add_argument('--headeronly', action='store_true') parser.add_argument('--json', action='store_true') parser.add_argument('--hgproto') parser.add_argument('--requestheader', nargs='*', default=[], help='Send an additional HTTP request header. Argument ' 'value is
=') parser.add_argument('--bodyfile', help='Write HTTP response body to a file') parser.add_argument('host') parser.add_argument('path') parser.add_argument('show', nargs='*') args = parser.parse_args() twice = args.twice headeronly = args.headeronly formatjson = args.json hgproto = args.hgproto requestheaders = args.requestheader tag = None def request(host, path, show): assert not path.startswith('/'), path global tag headers = {} if tag: headers['If-None-Match'] = tag if hgproto: headers['X-HgProto-1'] = hgproto for header in requestheaders: key, value = header.split('=', 1) headers[key] = value conn = httplib.HTTPConnection(host) conn.request("GET", '/' + path, None, headers) response = conn.getresponse() print(response.status, response.reason) if show[:1] == ['-']: show = sorted(h for h, v in response.getheaders() if h.lower() not in show) for h in [h.lower() for h in show]: if response.getheader(h, None) is not None: print("%s: %s" % (h, response.getheader(h))) if not headeronly: print() data = response.read() if args.bodyfile: bodyfh = open(args.bodyfile, 'wb') else: bodyfh = sys.stdout # Pretty print JSON. This also has the beneficial side-effect # of verifying emitted JSON is well-formed. if formatjson: # json.dumps() will print trailing newlines. Eliminate them # to make tests easier to write. data = json.loads(data) lines = json.dumps(data, sort_keys=True, indent=2).splitlines() for line in lines: bodyfh.write(line.rstrip()) bodyfh.write(b'\n') else: bodyfh.write(data) if args.bodyfile: bodyfh.close() if twice and response.getheader('ETag', None): tag = response.getheader('ETag') return response.status status = request(args.host, args.path, args.show) if twice: status = request(args.host, args.path, args.show) if 200 <= status <= 305: sys.exit(0) sys.exit(1) mercurial-4.5.3/tests/test-copy.t0000644015407300116100000001407513261161234016662 0ustar augieeng00000000000000# enable bundle2 in advance $ cat << EOF >> $HGRCPATH > [format] > usegeneraldelta=yes > EOF $ mkdir part1 $ cd part1 $ hg init $ echo a > a $ hg add a $ hg commit -m "1" $ hg status $ hg copy a b $ hg --config ui.portablefilenames=abort copy a con.xml abort: filename contains 'con', which is reserved on Windows: con.xml [255] $ hg status A b $ hg sum parent: 0:c19d34741b0a tip 1 branch: default commit: 1 copied update: (current) phases: 1 draft $ hg --debug commit -m "2" committing files: b b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 committing manifest committing changelog updating the branch cache committed changeset 1:93580a2c28a50a56f63526fb305067e6fbf739c4 we should see two history entries $ hg history -v changeset: 1:93580a2c28a5 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 files: b description: 2 changeset: 0:c19d34741b0a user: test date: Thu Jan 01 00:00:00 1970 +0000 files: a description: 1 we should see one log entry for a $ hg log a changeset: 0:c19d34741b0a user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 1 this should show a revision linked to changeset 0 $ hg debugindex a rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 3 ..... 0 b789fdd96dc2 000000000000 000000000000 (re) we should see one log entry for b $ hg log b changeset: 1:93580a2c28a5 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 2 this should show a revision linked to changeset 1 $ hg debugindex b rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 65 ..... 1 37d9b5d994ea 000000000000 000000000000 (re) this should show the rename information in the metadata $ hg debugdata b 0 | head -3 | tail -2 copy: a copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 $ md5sum.py .hg/store/data/b.i 44913824c8f5890ae218f9829535922e .hg/store/data/b.i $ hg cat b > bsum $ md5sum.py bsum 60b725f10c9c85c70d97880dfe8191b3 bsum $ hg cat a > asum $ md5sum.py asum 60b725f10c9c85c70d97880dfe8191b3 asum $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 2 changesets, 2 total revisions $ cd .. $ mkdir part2 $ cd part2 $ hg init $ echo foo > foo should fail - foo is not managed $ hg mv foo bar foo: not copying - file is not managed abort: no files to copy [255] $ hg st -A ? foo $ hg add foo dry-run; print a warning that this is not a real copy; foo is added $ hg mv --dry-run foo bar foo has not been committed yet, so no copy data will be stored for bar. $ hg st -A A foo should print a warning that this is not a real copy; bar is added $ hg mv foo bar foo has not been committed yet, so no copy data will be stored for bar. $ hg st -A A bar should print a warning that this is not a real copy; foo is added $ hg cp bar foo bar has not been committed yet, so no copy data will be stored for foo. $ hg rm -f bar $ rm bar $ hg st -A A foo $ hg commit -m1 moving a missing file $ rm foo $ hg mv foo foo3 foo: deleted in working directory foo3 does not exist! $ hg up -qC . copy --after to a nonexistent target filename $ hg cp -A foo dummy foo: not recording copy - dummy does not exist dry-run; should show that foo is clean $ hg copy --dry-run foo bar $ hg st -A C foo should show copy $ hg copy foo bar $ hg st -C A bar foo shouldn't show copy $ hg commit -m2 $ hg st -C should match $ hg debugindex foo rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 5 ..... 0 2ed2a3912a0b 000000000000 000000000000 (re) $ hg debugrename bar bar renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd $ echo bleah > foo $ echo quux > bar $ hg commit -m3 should not be renamed $ hg debugrename bar bar not renamed $ hg copy -f foo bar should show copy $ hg st -C M bar foo XXX: filtering lfilesrepo.status() in 3.3-rc causes the copy source to not be displayed. $ hg st -C --config extensions.largefiles= The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) M bar foo $ hg commit -m3 should show no parents for tip $ hg debugindex bar rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 69 ..... 1 7711d36246cc 000000000000 000000000000 (re) 1 69 6 ..... 2 bdf70a2b8d03 7711d36246cc 000000000000 (re) 2 75 71 ..... 3 b2558327ea8d 000000000000 000000000000 (re) should match $ hg debugindex foo rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 5 ..... 0 2ed2a3912a0b 000000000000 000000000000 (re) 1 5 7 ..... 2 dd12c926cf16 2ed2a3912a0b 000000000000 (re) $ hg debugrename bar bar renamed from foo:dd12c926cf165e3eb4cf87b084955cb617221c17 should show no copies $ hg st -C copy --after on an added file $ cp bar baz $ hg add baz $ hg cp -A bar baz $ hg st -C A baz bar foo was clean: $ hg st -AC foo C foo Trying to copy on top of an existing file fails, $ hg copy -A bar foo foo: not overwriting - file already committed (hg copy --after --force to replace the file by recording a copy) same error without the --after, so the user doesn't have to go through two hints: $ hg copy bar foo foo: not overwriting - file already committed (hg copy --force to replace the file by recording a copy) but it's considered modified after a copy --after --force $ hg copy -Af bar foo $ hg st -AC foo M foo bar The hint for a file that exists but is not in file history doesn't mention --force: $ touch xyzzy $ hg cp bar xyzzy xyzzy: not overwriting - file exists (hg copy --after to record the copy) $ cd .. mercurial-4.5.3/tests/test-largefiles-small-disk.t0000644015407300116100000000402613261161234022056 0ustar augieeng00000000000000Test how largefiles abort in case the disk runs full $ cat > criple.py < from __future__ import absolute_import > import errno > import os > import shutil > from mercurial import util > # > # this makes the original largefiles code abort: > _origcopyfileobj = shutil.copyfileobj > def copyfileobj(fsrc, fdst, length=16*1024): > # allow journal files (used by transaction) to be written > if 'journal.' in fdst.name: > return _origcopyfileobj(fsrc, fdst, length) > fdst.write(fsrc.read(4)) > raise IOError(errno.ENOSPC, os.strerror(errno.ENOSPC)) > shutil.copyfileobj = copyfileobj > # > # this makes the rewritten code abort: > def filechunkiter(f, size=131072, limit=None): > yield f.read(4) > raise IOError(errno.ENOSPC, os.strerror(errno.ENOSPC)) > util.filechunkiter = filechunkiter > # > def oslink(src, dest): > raise OSError("no hardlinks, try copying instead") > util.oslink = oslink > EOF $ echo "[extensions]" >> $HGRCPATH $ echo "largefiles =" >> $HGRCPATH $ hg init alice $ cd alice $ echo "this is a very big file" > big $ hg add --large big $ hg commit --config extensions.criple=$TESTTMP/criple.py -m big abort: No space left on device [255] The largefile is not created in .hg/largefiles: $ ls .hg/largefiles dirstate The user cache is not even created: >>> import os; os.path.exists("$HOME/.cache/largefiles/") False Make the commit with space on the device: $ hg commit -m big Now make a clone with a full disk, and make sure lfutil.link function makes copies instead of hardlinks: $ cd .. $ hg --config extensions.criple=$TESTTMP/criple.py clone --pull alice bob requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 390cf214e9ac updating to branch default getting changed largefiles abort: No space left on device [255] The largefile is not created in .hg/largefiles: $ ls bob/.hg/largefiles dirstate mercurial-4.5.3/tests/test-rebase-parameters.t0000644015407300116100000002371513261161234021313 0ustar augieeng00000000000000 $ cat >> $HGRCPATH < [extensions] > rebase= > > [phases] > publish=False > > [alias] > tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n" > EOF $ hg init a $ cd a $ hg unbundle "$TESTDIR/bundles/rebase.hg" adding changesets adding manifests adding file changes added 8 changesets with 7 changes to 7 files (+2 heads) new changesets cd010b8cd998:02de42196ebe (run 'hg heads' to see heads, 'hg merge' to merge) $ hg up tip 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo I > I $ hg ci -AmI adding I $ hg tglog @ 8: e7ec4e813ba6 'I' | o 7: 02de42196ebe 'H' | | o 6: eea13746799a 'G' |/| o | 5: 24b6387c8c8c 'F' | | | o 4: 9520eea781bc 'E' |/ | o 3: 32af7686d403 'D' | | | o 2: 5fddd98957c8 'C' | | | o 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' $ cd .. Version with only two heads (to allow default destination to work) $ hg clone -q -u . a a2heads -r 3 -r 8 These fail: $ hg clone -q -u . a a0 $ cd a0 $ hg rebase -s 8 -d 7 nothing to rebase [1] $ hg rebase --continue --abort abort: cannot use both abort and continue [255] $ hg rebase --continue --collapse abort: cannot use collapse with continue or abort [255] $ hg rebase --continue --dest 4 abort: abort and continue do not allow specifying revisions [255] $ hg rebase --base 5 --source 4 abort: cannot specify both a source and a base [255] $ hg rebase --rev 5 --source 4 abort: cannot specify both a revision and a source [255] $ hg rebase --base 5 --rev 4 abort: cannot specify both a revision and a base [255] $ hg rebase --base 6 abort: branch 'default' has 3 heads - please rebase to an explicit rev (run 'hg heads .' to see heads) [255] $ hg rebase --rev '1 & !1' --dest 8 empty "rev" revision set - nothing to rebase [1] $ hg rebase --source '1 & !1' --dest 8 empty "source" revision set - nothing to rebase [1] $ hg rebase --base '1 & !1' --dest 8 empty "base" revision set - can't compute rebase set [1] $ hg rebase --dest 8 nothing to rebase - working directory parent is also destination [1] $ hg rebase -b . --dest 8 nothing to rebase - e7ec4e813ba6 is both "base" and destination [1] $ hg up -q 7 $ hg rebase --dest 8 --traceback nothing to rebase - working directory parent is already an ancestor of destination e7ec4e813ba6 [1] $ hg rebase --dest 8 -b. nothing to rebase - "base" 02de42196ebe is already an ancestor of destination e7ec4e813ba6 [1] $ hg rebase --dest '1 & !1' abort: empty revision set [255] These work: Rebase with no arguments (from 3 onto 8): $ cd .. $ hg clone -q -u . a2heads a1 $ cd a1 $ hg up -q -C 3 $ hg rebase rebasing 1:42ccdea3bb16 "B" rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg $ hg tglog @ 6: ed65089c18f8 'D' | o 5: 7621bf1a2f17 'C' | o 4: 9430a62369c6 'B' | o 3: e7ec4e813ba6 'I' | o 2: 02de42196ebe 'H' | o 1: 24b6387c8c8c 'F' | o 0: cd010b8cd998 'A' Try to rollback after a rebase (fail): $ hg rollback no rollback information available [1] $ cd .. Rebase with base == '.' => same as no arguments (from 3 onto 8): $ hg clone -q -u 3 a2heads a2 $ cd a2 $ hg rebase --base . rebasing 1:42ccdea3bb16 "B" rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" saved backup bundle to $TESTTMP/a2/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg $ hg tglog @ 6: ed65089c18f8 'D' | o 5: 7621bf1a2f17 'C' | o 4: 9430a62369c6 'B' | o 3: e7ec4e813ba6 'I' | o 2: 02de42196ebe 'H' | o 1: 24b6387c8c8c 'F' | o 0: cd010b8cd998 'A' $ cd .. Rebase with dest == branch(.) => same as no arguments (from 3 onto 8): $ hg clone -q -u 3 a a3 $ cd a3 $ hg rebase --dest 'branch(.)' rebasing 1:42ccdea3bb16 "B" rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" saved backup bundle to $TESTTMP/a3/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg $ hg tglog @ 8: ed65089c18f8 'D' | o 7: 7621bf1a2f17 'C' | o 6: 9430a62369c6 'B' | o 5: e7ec4e813ba6 'I' | o 4: 02de42196ebe 'H' | | o 3: eea13746799a 'G' |/| o | 2: 24b6387c8c8c 'F' | | | o 1: 9520eea781bc 'E' |/ o 0: cd010b8cd998 'A' $ cd .. Specify only source (from 2 onto 8): $ hg clone -q -u . a2heads a4 $ cd a4 $ hg rebase --source 'desc("C")' rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" saved backup bundle to $TESTTMP/a4/.hg/strip-backup/5fddd98957c8-f9244fa1-rebase.hg $ hg tglog o 6: 7726e9fd58f7 'D' | o 5: 72c8333623d0 'C' | @ 4: e7ec4e813ba6 'I' | o 3: 02de42196ebe 'H' | o 2: 24b6387c8c8c 'F' | | o 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' $ cd .. Specify only dest (from 3 onto 6): $ hg clone -q -u 3 a a5 $ cd a5 $ hg rebase --dest 6 rebasing 1:42ccdea3bb16 "B" rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" saved backup bundle to $TESTTMP/a5/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg $ hg tglog @ 8: 8eeb3c33ad33 'D' | o 7: 2327fea05063 'C' | o 6: e4e5be0395b2 'B' | | o 5: e7ec4e813ba6 'I' | | | o 4: 02de42196ebe 'H' | | o | 3: eea13746799a 'G' |\| | o 2: 24b6387c8c8c 'F' | | o | 1: 9520eea781bc 'E' |/ o 0: cd010b8cd998 'A' $ cd .. Specify only base (from 1 onto 8): $ hg clone -q -u . a2heads a6 $ cd a6 $ hg rebase --base 'desc("D")' rebasing 1:42ccdea3bb16 "B" rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" saved backup bundle to $TESTTMP/a6/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg $ hg tglog o 6: ed65089c18f8 'D' | o 5: 7621bf1a2f17 'C' | o 4: 9430a62369c6 'B' | @ 3: e7ec4e813ba6 'I' | o 2: 02de42196ebe 'H' | o 1: 24b6387c8c8c 'F' | o 0: cd010b8cd998 'A' $ cd .. Specify source and dest (from 2 onto 7): $ hg clone -q -u . a a7 $ cd a7 $ hg rebase --source 2 --dest 7 rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-f9244fa1-rebase.hg $ hg tglog o 8: 668acadedd30 'D' | o 7: 09eb682ba906 'C' | | @ 6: e7ec4e813ba6 'I' |/ o 5: 02de42196ebe 'H' | | o 4: eea13746799a 'G' |/| o | 3: 24b6387c8c8c 'F' | | | o 2: 9520eea781bc 'E' |/ | o 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' $ cd .. Specify base and dest (from 1 onto 7): $ hg clone -q -u . a a8 $ cd a8 $ hg rebase --base 3 --dest 7 rebasing 1:42ccdea3bb16 "B" rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" saved backup bundle to $TESTTMP/a8/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg $ hg tglog o 8: 287cc92ba5a4 'D' | o 7: 6824f610a250 'C' | o 6: 7c6027df6a99 'B' | | @ 5: e7ec4e813ba6 'I' |/ o 4: 02de42196ebe 'H' | | o 3: eea13746799a 'G' |/| o | 2: 24b6387c8c8c 'F' | | | o 1: 9520eea781bc 'E' |/ o 0: cd010b8cd998 'A' $ cd .. Specify only revs (from 2 onto 8) $ hg clone -q -u . a2heads a9 $ cd a9 $ hg rebase --rev 'desc("C")::' rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" saved backup bundle to $TESTTMP/a9/.hg/strip-backup/5fddd98957c8-f9244fa1-rebase.hg $ hg tglog o 6: 7726e9fd58f7 'D' | o 5: 72c8333623d0 'C' | @ 4: e7ec4e813ba6 'I' | o 3: 02de42196ebe 'H' | o 2: 24b6387c8c8c 'F' | | o 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' $ cd .. Rebasing both a single revision and a merge in one command $ hg clone -q -u . a aX $ cd aX $ hg rebase -r 3 -r 6 --dest 8 rebasing 3:32af7686d403 "D" rebasing 6:eea13746799a "G" saved backup bundle to $TESTTMP/aX/.hg/strip-backup/eea13746799a-ad273fd6-rebase.hg $ cd .. Test --tool parameter: $ hg init b $ cd b $ echo c1 > c1 $ hg ci -Am c1 adding c1 $ echo c2 > c2 $ hg ci -Am c2 adding c2 $ hg up -q 0 $ echo c2b > c2 $ hg ci -Am c2b adding c2 created new head $ cd .. $ hg clone -q -u . b b1 $ cd b1 $ hg rebase -s 2 -d 1 --tool internal:local rebasing 2:e4e3f3546619 "c2b" (tip) note: rebase of 2:e4e3f3546619 created no changes to commit saved backup bundle to $TESTTMP/b1/.hg/strip-backup/e4e3f3546619-b0841178-rebase.hg $ hg cat c2 c2 $ cd .. $ hg clone -q -u . b b2 $ cd b2 $ hg rebase -s 2 -d 1 --tool internal:other rebasing 2:e4e3f3546619 "c2b" (tip) saved backup bundle to $TESTTMP/b2/.hg/strip-backup/e4e3f3546619-b0841178-rebase.hg $ hg cat c2 c2b $ cd .. $ hg clone -q -u . b b3 $ cd b3 $ hg rebase -s 2 -d 1 --tool internal:fail rebasing 2:e4e3f3546619 "c2b" (tip) unresolved conflicts (see hg resolve, then hg rebase --continue) [1] $ hg summary parent: 1:56daeba07f4b c2 parent: 2:e4e3f3546619 tip c2b branch: default commit: 1 modified, 1 unresolved (merge) update: (current) phases: 3 draft rebase: 0 rebased, 1 remaining (rebase --continue) $ hg resolve -l U c2 $ hg resolve -m c2 (no more unresolved files) continue: hg rebase --continue $ hg graft --continue abort: no graft in progress (continue: hg rebase --continue) [255] $ hg rebase -c --tool internal:fail rebasing 2:e4e3f3546619 "c2b" (tip) note: rebase of 2:e4e3f3546619 created no changes to commit saved backup bundle to $TESTTMP/b3/.hg/strip-backup/e4e3f3546619-b0841178-rebase.hg $ hg rebase -i abort: interactive history editing is supported by the 'histedit' extension (see "hg --config extensions.histedit= help -e histedit") [255] $ hg rebase --interactive abort: interactive history editing is supported by the 'histedit' extension (see "hg --config extensions.histedit= help -e histedit") [255] $ cd .. No common ancestor $ hg init separaterepo $ cd separaterepo $ touch a $ hg commit -Aqm a $ hg up -q null $ touch b $ hg commit -Aqm b $ hg rebase -d 0 nothing to rebase from d7486e00c6f1 to 3903775176ed [1] $ cd .. mercurial-4.5.3/tests/test-newcgi.t0000644015407300116100000000321113261161234017152 0ustar augieeng00000000000000#require no-msys # MSYS will translate web paths as if they were file paths This tests if CGI files from after d0db3462d568 but before d74fc8dec2b4 still work. $ hg init test $ cat >hgweb.cgi < #!$PYTHON > # > # An example CGI script to use hgweb, edit as necessary > > import cgitb > cgitb.enable() > > from mercurial import demandimport; demandimport.enable() > from mercurial.hgweb import hgweb > from mercurial.hgweb import wsgicgi > from mercurial.hgweb.request import wsgiapplication > > def make_web_app(): > return hgweb("test", "Empty test repository") > > wsgicgi.launch(wsgiapplication(make_web_app)) > HGWEB $ chmod 755 hgweb.cgi $ cat >hgweb.config < [paths] > test = test > HGWEBDIRCONF $ cat >hgwebdir.cgi < #!$PYTHON > # > # An example CGI script to export multiple hgweb repos, edit as necessary > > import cgitb > cgitb.enable() > > from mercurial import demandimport; demandimport.enable() > from mercurial.hgweb import hgwebdir > from mercurial.hgweb import wsgicgi > from mercurial.hgweb.request import wsgiapplication > > def make_web_app(): > return hgwebdir("hgweb.config") > > wsgicgi.launch(wsgiapplication(make_web_app)) > HGWEBDIR $ chmod 755 hgwebdir.cgi $ . "$TESTDIR/cgienv" $ $PYTHON hgweb.cgi > page1 $ $PYTHON hgwebdir.cgi > page2 $ PATH_INFO="/test/" $ PATH_TRANSLATED="/var/something/test.cgi" $ REQUEST_URI="/test/test/" $ SCRIPT_URI="http://hg.omnifarious.org/test/test/" $ SCRIPT_URL="/test/test/" $ $PYTHON hgwebdir.cgi > page3 $ grep -i error page1 page2 page3 [1] mercurial-4.5.3/tests/test-gendoc-ja.t0000644015407300116100000000262213261161234017532 0ustar augieeng00000000000000#require docutils gettext $ $TESTDIR/check-gendoc ja checking for parse errors \xe8\xa4\x87\xe8\xa3\xbd\xef\xbc\x8f\xe6\x94\xb9\xe5\x90\x8d\xe3\x81\xab\xe9\x96\xa2\xe3\x81\x99\xe3\x82\x8b\xe5\xb1\xa5\xe6\xad\xb4\xe4\xbf\x9d\xe5\xad\x98\xe3\x81\xae\xe3\x81\x9f\xe3\x82\x81\xe3\x81\xab git \xe5\xb7\xae\xe5\x88\x86\xe5\xbd\xa2\xe5\xbc\x8f\xe3\x82\x92\xe4\xbd\xbf\xe7\x94\xa8(-g/--git \xe6\x8c\x87\xe5\xae\x9a\xe3\x82\x84 \xe8\xa8\xad\xe5\xae\x9a\xe3\x83\x95\xe3\x82\xa1\xe3\x82\xa4\xe3\x83\xab\xe3\x81\xa7\xe3\x81\xae [diff] git=1 \xe8\xa8\x98\xe8\xbf\xb0)\xe3\x81\x99\xe3\x82\x8b\xe3\x81\xae\xe3\x81\xa7\xe3\x81\x82\xe3\x82\x8c\xe3\x81\xb0\xe3\x80\x81 add/remove/copy/rename \xe3\x81\xa8\xe3\x81\x84\xe3\x81\xa3\xe3\x81\x9f hg \xe3\x81\xae\xe3\x82\xb3\xe3\x83\x9e\xe3\x83\xb3\xe3\x83\x89\xe3\x81\xab\xe3\x82\x88\xe3\x82\x8b\xe5\xb1\xa5\xe6\xad\xb4\xe8\xa8\x98\xe9\x8c\xb2\xe3\x82\x82\xe3\x80\x81 \xe9\x80\x9a\xe5\xb8\xb8\xe3\x81\xa8\xe5\xa4\x89\xe3\x82\x8f\xe3\x82\x8a\xe3\x81\xaa\xe3\x81\x8f\xe6\xa9\x9f\xe8\x83\xbd\xe3\x81\x97\xe3\x81\xbe\xe3\x81\x99\xe3\x80\x82 git \xe5\xb7\xae\xe5\x88\x86\xe5\xbd\xa2\xe5\xbc\x8f\xe3\x81\xae\xe8\xa9\xb3\xe7\xb4\xb0\xe3\x81\xab\xe9\x96\xa2\xe3\x81\x97\xe3\x81\xa6\xe3\x81\xaf\xe3\x80\x81 'help diffs' \xe3\x82\x92\xe5\x8f\x82\xe7\x85\xa7\xe3\x81\x97\xe3\x81\xa6\xe3\x81\x8f\xe3\x81\xa0\xe3\x81\x95\xe3\x81\x84\xe3\x80\x82 (esc) warning: please use " instead of ' for hg ... "..." mercurial-4.5.3/tests/test-merge6.t0000644015407300116100000000356513261161234017077 0ustar augieeng00000000000000 $ cat < merge > import sys, os > print("merging for", os.path.basename(sys.argv[1])) > EOF $ HGMERGE="$PYTHON ../merge"; export HGMERGE $ hg init A1 $ cd A1 $ echo This is file foo1 > foo $ echo This is file bar1 > bar $ hg add foo bar $ hg commit -m "commit text" $ cd .. $ hg clone A1 B1 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd A1 $ rm bar $ hg remove bar $ hg commit -m "commit test" $ cd ../B1 $ echo This is file foo22 > foo $ hg commit -m "commit test" $ cd .. $ hg clone A1 A2 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg clone B1 B2 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd A1 $ hg pull ../B1 pulling from ../B1 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets b90e70beeb58 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg commit -m "commit test" bar should remain deleted. $ hg manifest --debug f9b0e817f6a48de3564c6b2957687c5e7297c5a0 644 foo $ cd ../B2 $ hg pull ../A2 pulling from ../A2 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 0 changes to 0 files (+1 heads) new changesets e1adc944e717 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg merge 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg commit -m "commit test" bar should remain deleted. $ hg manifest --debug f9b0e817f6a48de3564c6b2957687c5e7297c5a0 644 foo $ cd .. mercurial-4.5.3/tests/test-bundle-type.t0000644015407300116100000001176413261161234020142 0ustar augieeng00000000000000 $ cat << EOF >> $HGRCPATH > [format] > usegeneraldelta=yes > EOF bundle w/o type option $ hg init t1 $ hg init t2 $ cd t1 $ echo blablablablabla > file.txt $ hg ci -Ama adding file.txt $ hg log | grep summary summary: a $ hg bundle ../b1 ../t2 searching for changes 1 changesets found $ cd ../t2 $ hg pull ../b1 pulling from ../b1 requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets c35a0f9217e6 (run 'hg update' to get a working copy) $ hg up 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg log | grep summary summary: a $ cd .. Unknown compression type is rejected $ hg init t3 $ cd t3 $ hg -q pull ../b1 $ hg bundle -a -t unknown out.hg abort: unknown is not a recognized bundle specification (see 'hg help bundlespec' for supported values for --type) [255] $ hg bundle -a -t unknown-v2 out.hg abort: unknown compression is not supported (see 'hg help bundlespec' for supported values for --type) [255] $ cd .. test bundle types $ testbundle() { > echo % test bundle type $1 > hg init t$1 > cd t1 > hg bundle -t $1 ../b$1 ../t$1 > f -q -B6 -D ../b$1; echo > cd ../t$1 > hg debugbundle ../b$1 > hg debugbundle --spec ../b$1 > echo > cd .. > } $ for t in "None" "bzip2" "gzip" "none-v2" "v2" "v1" "gzip-v1"; do > testbundle $t > done % test bundle type None searching for changes 1 changesets found HG20\x00\x00 (esc) Stream params: {} changegroup -- {nbchanges: 1, version: 02} c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf none-v2 % test bundle type bzip2 searching for changes 1 changesets found HG20\x00\x00 (esc) Stream params: {Compression: BZ} changegroup -- {nbchanges: 1, version: 02} c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf bzip2-v2 % test bundle type gzip searching for changes 1 changesets found HG20\x00\x00 (esc) Stream params: {Compression: GZ} changegroup -- {nbchanges: 1, version: 02} c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf gzip-v2 % test bundle type none-v2 searching for changes 1 changesets found HG20\x00\x00 (esc) Stream params: {} changegroup -- {nbchanges: 1, version: 02} c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf none-v2 % test bundle type v2 searching for changes 1 changesets found HG20\x00\x00 (esc) Stream params: {Compression: BZ} changegroup -- {nbchanges: 1, version: 02} c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf bzip2-v2 % test bundle type v1 searching for changes 1 changesets found HG10BZ c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf bzip2-v1 % test bundle type gzip-v1 searching for changes 1 changesets found HG10GZ c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf gzip-v1 Compression level can be adjusted for bundle2 bundles $ hg init test-complevel $ cd test-complevel $ cat > file0 << EOF > this is a file > with some text > and some more text > and other content > EOF $ cat > file1 << EOF > this is another file > with some other content > and repeated, repeated, repeated, repeated content > EOF $ hg -q commit -A -m initial $ hg bundle -a -t gzip-v2 gzip-v2.hg 1 changesets found $ f --size gzip-v2.hg gzip-v2.hg: size=427 $ hg --config experimental.bundlecomplevel=1 bundle -a -t gzip-v2 gzip-v2-level1.hg 1 changesets found $ f --size gzip-v2-level1.hg gzip-v2-level1.hg: size=435 $ cd .. #if zstd $ for t in "zstd" "zstd-v2"; do > testbundle $t > done % test bundle type zstd searching for changes 1 changesets found HG20\x00\x00 (esc) Stream params: {Compression: ZS} changegroup -- {nbchanges: 1, version: 02} c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf zstd-v2 % test bundle type zstd-v2 searching for changes 1 changesets found HG20\x00\x00 (esc) Stream params: {Compression: ZS} changegroup -- {nbchanges: 1, version: 02} c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf zstd-v2 Explicit request for zstd on non-generaldelta repos $ hg --config format.usegeneraldelta=false init nogd $ hg -q -R nogd pull t1 $ hg -R nogd bundle -a -t zstd nogd-zstd 1 changesets found zstd-v1 always fails $ hg -R tzstd bundle -a -t zstd-v1 zstd-v1 abort: compression engine zstd is not supported on v1 bundles (see 'hg help bundlespec' for supported values for --type) [255] #else zstd is a valid engine but isn't available $ hg -R t1 bundle -a -t zstd irrelevant.hg abort: compression engine zstd could not be loaded [255] #endif test garbage file $ echo garbage > bgarbage $ hg init tgarbage $ cd tgarbage $ hg pull ../bgarbage pulling from ../bgarbage abort: ../bgarbage: not a Mercurial bundle [255] $ cd .. test invalid bundle type $ cd t1 $ hg bundle -a -t garbage ../bgarbage abort: garbage is not a recognized bundle specification (see 'hg help bundlespec' for supported values for --type) [255] $ cd .. mercurial-4.5.3/tests/test-exchange-obsmarkers-case-A4.t0000644015407300116100000001031613261161234023005 0ustar augieeng00000000000000============================================ Testing obsolescence markers push: Cases A.4 ============================================ Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of all changesets that requested to be "in sync" after the push (even if they are already on both side). This test belongs to a series of tests checking such set is properly computed and applied. this does not tests "obsmarkers" discovery capabilities. Category A: simple cases Testcase 4: Push in the middle of the obsolescence chain A.4 Push in the middle of the obsolescence chain ================================================ .. (Where we show that we should not push the marker without the successors) .. .. {{{ .. B â—” .. | .. A⇠ø⇠○ A' .. |/ .. â— O .. }}} .. .. Markers exist from: .. .. * `A ø⇠○ A'` .. * chain from A .. .. Command runs: .. .. * hg push -r B .. .. Expected exchange: .. .. * Chain from A .. .. Expected Exclude: .. .. * `Ai ø⇠○ A'` Setup ----- $ . $TESTDIR/testlib/exchange-obsmarker-util.sh initial $ setuprepos A.4 creating test repo for test case A.4 - pulldest - main - pushdest cd into `main` and proceed with env setup $ cd main $ mkcommit A0 $ mkcommit B $ hg update 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ mkcommit A1 created new head $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid 'desc(A0)'` $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'` obsoleted 1 changesets 1 new orphan changesets $ hg log -G --hidden @ e5ea8f9c7314 (draft): A1 | | * 06055a7959d4 (draft): B | | | x 28b51eb45704 (draft): A0 |/ o a9bdc8b26820 (public): O $ inspect_obsmarkers obsstore content ================ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ cd .. $ cd .. Actual Test for first version ----------------------------- $ dotest A.4 B -f ## Running testcase A.4 # testing echange of "B" (06055a7959d4) ## initial state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest ## pushing "B" from main to pushdest pushing to pushdest searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 2 changesets with 2 changes to 2 files remote: 1 new obsolescence markers ## post push state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest ## pulling "06055a7959d4" from main into pulldest pulling from main searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files 1 new obsolescence markers new changesets 28b51eb45704:06055a7959d4 (run 'hg update' to get a working copy) ## post pull state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} mercurial-4.5.3/tests/test-no-symlinks.t0000644015407300116100000000234013261161234020163 0ustar augieeng00000000000000#require no-symlink # The following script was used to create the bundle: # # hg init symlinks # cd symlinks # echo a > a # mkdir d # echo b > d/b # ln -s a a.lnk # ln -s d/b d/b.lnk # hg ci -Am t # hg bundle --base null ../test-no-symlinks.hg Extract a symlink on a platform not supporting them $ hg init t $ cd t $ hg pull -q "$TESTDIR/bundles/test-no-symlinks.hg" $ hg update 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat a.lnk && echo a $ cat d/b.lnk && echo d/b Copy a symlink and move another $ hg copy a.lnk d/a2.lnk $ hg mv d/b.lnk b2.lnk $ hg ci -Am copy $ cat d/a2.lnk && echo a $ cat b2.lnk && echo d/b Bundle and extract again $ hg bundle --base null ../symlinks.hg 2 changesets found $ cd .. $ hg init t2 $ cd t2 $ hg pull ../symlinks.hg pulling from ../symlinks.hg requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 6 changes to 6 files new changesets d326ae2d01ee:71d85cf3ba90 (run 'hg update' to get a working copy) $ hg update 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat a.lnk && echo a $ cat d/a2.lnk && echo a $ cat b2.lnk && echo d/b mercurial-4.5.3/tests/test-parseindex2.py.out0000644015407300116100000000000513261161234021113 0ustar augieeng00000000000000done mercurial-4.5.3/tests/test-hgweb-bundle.t0000644015407300116100000000140513261161234020244 0ustar augieeng00000000000000#require serve $ hg init server $ cd server $ cat >> .hg/hgrc << EOF > [extensions] > strip= > EOF $ echo 1 > foo $ hg commit -A -m 'first' adding foo $ echo 2 > bar $ hg commit -A -m 'second' adding bar Produce a bundle to use $ hg strip -r 1 0 files updated, 0 files merged, 1 files removed, 0 files unresolved saved backup bundle to $TESTTMP/server/.hg/strip-backup/ed602e697e0f-cc9fff6a-backup.hg Serve from a bundle file $ hg serve -R .hg/strip-backup/ed602e697e0f-cc9fff6a-backup.hg -d -p $HGPORT --pid-file=hg.pid $ cat hg.pid >> $DAEMON_PIDS Ensure we're serving from the bundle $ (get-with-headers.py localhost:$HGPORT 'file/tip/?style=raw') 200 Script output follows -rw-r--r-- 2 bar -rw-r--r-- 2 foo mercurial-4.5.3/tests/svn/0000755015407300116100000000000013261161260015344 5ustar augieeng00000000000000mercurial-4.5.3/tests/svn/svndump-startrev.sh0000755015407300116100000000133413261161234021251 0ustar augieeng00000000000000#!/bin/sh # # Use this script to generate startrev.svndump # mkdir temp cd temp mkdir project-orig cd project-orig mkdir trunk mkdir branches mkdir tags cd .. svnadmin create svn-repo svnurl=file://`pwd`/svn-repo svn import project-orig $svnurl -m "init projA" svn co $svnurl project cd project echo a > trunk/a echo b > trunk/b svn add trunk/a trunk/b svn ci -m createab svn rm trunk/b svn ci -m removeb svn up echo a >> trunk/a svn ci -m changeaa # Branch svn up svn copy trunk branches/branch1 echo a >> branches/branch1/a svn ci -m "branch, changeaaa" echo a >> branches/branch1/a echo c > branches/branch1/c svn add branches/branch1/c svn ci -m "addc,changeaaaa" svn up cd .. svnadmin dump svn-repo > ../startrev.svndumpmercurial-4.5.3/tests/svn/svndump-tags.sh0000755015407300116100000000225413261161234020337 0ustar augieeng00000000000000#!/bin/sh # # Use this script to generate tags.svndump # mkdir temp cd temp mkdir project-orig cd project-orig mkdir trunk mkdir branches mkdir tags mkdir unrelated cd .. svnadmin create svn-repo svnurl=file://`pwd`/svn-repo svn import project-orig $svnurl -m "init projA" svn co $svnurl project cd project echo a > trunk/a svn add trunk/a svn ci -m adda echo a >> trunk/a svn ci -m changea echo a >> trunk/a svn ci -m changea2 # Add an unrelated commit to test that tags are bound to the # correct "from" revision and not a dummy one echo a >> unrelated/dummy svn add unrelated/dummy svn ci -m unrelatedchange # Tag current revision svn up svn copy trunk tags/trunk.v1 svn copy trunk tags/trunk.badtag svn ci -m "tagging trunk.v1 trunk.badtag" echo a >> trunk/a svn ci -m changea3 # Fix the bad tag # trunk.badtag should not show in converted tags svn up svn mv tags/trunk.badtag tags/trunk.goodtag svn ci -m "fix trunk.badtag" echo a >> trunk/a svn ci -m changea # Delete goodtag and recreate it, to test we pick the good one svn rm tags/trunk.goodtag svn ci -m removegoodtag svn up svn copy trunk tags/trunk.goodtag svn ci -m recreategoodtag cd .. svnadmin dump svn-repo > ../tags.svndumpmercurial-4.5.3/tests/svn/branches.svndump0000644015407300116100000001306613261161234020556 0ustar augieeng00000000000000SVN-fs-dump-format-version: 2 UUID: 644ede6c-2b81-4367-9dc8-d786514f2cde Revision-number: 0 Prop-content-length: 56 Content-length: 56 K 8 svn:date V 27 2010-05-19T20:16:07.429098Z PROPS-END Revision-number: 1 Prop-content-length: 112 Content-length: 112 K 7 svn:log V 10 init projA K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-19T20:16:07.461283Z PROPS-END Node-path: branches Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: trunk Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Revision-number: 2 Prop-content-length: 106 Content-length: 106 K 7 svn:log V 5 hello K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-19T20:16:08.121436Z PROPS-END Node-path: branches/notinbranch Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: e29311f6f1bf1af907f9ef9f44b8328b Text-content-sha1: e983f374794de9c64e3d1c1de1d490c0756eeeff Content-length: 12 PROPS-END d Node-path: trunk/a Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3 Text-content-sha1: 3f786850e387550fdab836ed7e6dc881de23001b Content-length: 12 PROPS-END a Node-path: trunk/b Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 3b5d5c3712955042212316173ccf37be Text-content-sha1: 89e6c98d92887913cadf06b2adb97f26cde4849b Content-length: 12 PROPS-END b Node-path: trunk/c Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 2cd6ee2c70b0bde53fbe6cac3c8b8bb1 Text-content-sha1: 2b66fd261ee5c6cfc8de7fa466bab600bcfe4f69 Content-length: 12 PROPS-END c Node-path: trunk/dir Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: trunk/dir/e Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 9ffbf43126e33be52cd2bf7e01d627f9 Text-content-sha1: 094e3afb2fe8dfe82f63731cdcd3b999f4856cff Content-length: 12 PROPS-END e Revision-number: 3 Prop-content-length: 132 Content-length: 132 K 7 svn:log V 30 branch trunk, remove c and dir K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-19T20:16:11.113124Z PROPS-END Node-path: branches/old Node-kind: dir Node-action: add Node-copyfrom-rev: 2 Node-copyfrom-path: trunk Node-path: branches/old/dir Node-action: delete Node-path: branches/old/c Node-action: delete Revision-number: 4 Prop-content-length: 109 Content-length: 109 K 7 svn:log V 8 change a K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-19T20:16:13.060877Z PROPS-END Node-path: trunk/a Node-kind: file Node-action: change Text-content-length: 4 Text-content-md5: 0d227f1abf8c2932d342e9b99cc957eb Text-content-sha1: d7c8127a20a396cff08af086a1c695b0636f0c29 Content-length: 4 a a Revision-number: 5 Prop-content-length: 109 Content-length: 109 K 7 svn:log V 8 change b K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-19T20:16:14.066212Z PROPS-END Node-path: branches/old/b Node-kind: file Node-action: change Text-content-length: 4 Text-content-md5: 06ac26ed8b614fc0b141e4542aa067c2 Text-content-sha1: f6980469e74f7125178e88ec571e06fe6ce86e95 Content-length: 4 b b Revision-number: 6 Prop-content-length: 119 Content-length: 119 K 7 svn:log V 17 move and update c K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-19T20:16:16.069449Z PROPS-END Node-path: branches/old/c Node-kind: file Node-action: add Node-copyfrom-rev: 3 Node-copyfrom-path: trunk/b Text-copy-source-md5: 3b5d5c3712955042212316173ccf37be Text-copy-source-sha1: 89e6c98d92887913cadf06b2adb97f26cde4849b Text-content-length: 4 Text-content-md5: 33cb6785d50937d8d307ebb66d6259a7 Text-content-sha1: 7a6478264aa11a0f4befef356c03e83f2b1f6eba Content-length: 4 b c Node-path: trunk/b Node-action: delete Revision-number: 7 Prop-content-length: 116 Content-length: 116 K 7 svn:log V 14 change b again K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-19T20:16:17.070868Z PROPS-END Node-path: branches/old/b Node-kind: file Node-action: change Text-content-length: 6 Text-content-md5: cdcfb41554e2d092c13f5e6839e63577 Text-content-sha1: 17ac58cabedebea235d1b5605531d5b1559797e9 Content-length: 6 b b b Revision-number: 8 Prop-content-length: 114 Content-length: 114 K 7 svn:log V 12 move to old2 K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-19T20:16:20.063098Z PROPS-END Node-path: branches/old2 Node-kind: dir Node-action: add Node-copyfrom-rev: 7 Node-copyfrom-path: branches/old Node-path: branches/old Node-action: delete Revision-number: 9 Prop-content-length: 118 Content-length: 118 K 7 svn:log V 16 move back to old K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-19T20:16:22.062931Z PROPS-END Node-path: branches/old Node-kind: dir Node-action: add Node-copyfrom-rev: 8 Node-copyfrom-path: branches/old2 Node-path: branches/old2 Node-action: delete Revision-number: 10 Prop-content-length: 118 Content-length: 118 K 7 svn:log V 16 last change to a K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-19T20:16:23.075562Z PROPS-END Node-path: trunk/a Node-kind: file Node-action: change Text-content-length: 2 Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3 Text-content-sha1: 3f786850e387550fdab836ed7e6dc881de23001b Content-length: 2 a Revision-number: 11 Prop-content-length: 126 Content-length: 126 K 7 svn:log V 24 branch trunk@1 into old3 K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-19T20:16:25.107655Z PROPS-END Node-path: branches/old3 Node-kind: dir Node-action: add Node-copyfrom-rev: 1 Node-copyfrom-path: trunk mercurial-4.5.3/tests/svn/encoding.svndump0000644015407300116100000000666213261161234020563 0ustar augieeng00000000000000SVN-fs-dump-format-version: 2 UUID: afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af Revision-number: 0 Prop-content-length: 56 Content-length: 56 K 8 svn:date V 27 2009-06-21T16:34:55.835945Z PROPS-END Revision-number: 1 Prop-content-length: 112 Content-length: 112 K 7 svn:log V 10 init projA K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-06-21T16:34:55.909545Z PROPS-END Node-path: branches Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: tags Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: trunk Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Revision-number: 2 Prop-content-length: 106 Content-length: 106 K 7 svn:log V 5 hello K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-06-21T16:34:56.150049Z PROPS-END Node-path: trunk/à Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: trunk/à/eÌ Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: e29311f6f1bf1af907f9ef9f44b8328b Text-content-sha1: e983f374794de9c64e3d1c1de1d490c0756eeeff Content-length: 12 PROPS-END d Node-path: trunk/é Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 9ffbf43126e33be52cd2bf7e01d627f9 Text-content-sha1: 094e3afb2fe8dfe82f63731cdcd3b999f4856cff Content-length: 12 PROPS-END e Revision-number: 3 Prop-content-length: 112 Content-length: 112 K 7 svn:log V 10 copy files K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-06-21T16:34:59.089402Z PROPS-END Node-path: trunk/è Node-kind: file Node-action: add Node-copyfrom-rev: 2 Node-copyfrom-path: trunk/é Text-copy-source-md5: 9ffbf43126e33be52cd2bf7e01d627f9 Text-copy-source-sha1: 094e3afb2fe8dfe82f63731cdcd3b999f4856cff Node-path: trunk/ù Node-kind: dir Node-action: add Node-copyfrom-rev: 2 Node-copyfrom-path: trunk/à Node-path: trunk/à Node-action: delete Node-path: trunk/é Node-action: delete Revision-number: 4 Prop-content-length: 114 Content-length: 114 K 7 svn:log V 12 remove files K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-06-21T16:35:00.165121Z PROPS-END Node-path: trunk/è Node-action: delete Node-path: trunk/ù Node-action: delete Revision-number: 5 Prop-content-length: 120 Content-length: 120 K 7 svn:log V 18 branch to branché K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-06-21T16:35:03.079138Z PROPS-END Node-path: branches/branché Node-kind: dir Node-action: add Node-copyfrom-rev: 4 Node-copyfrom-path: trunk Revision-number: 6 Prop-content-length: 121 Content-length: 121 K 7 svn:log V 19 branch to branchée K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-06-21T16:35:06.060801Z PROPS-END Node-path: branches/branchée Node-kind: dir Node-action: add Node-copyfrom-rev: 5 Node-copyfrom-path: branches/branché Revision-number: 7 Prop-content-length: 110 Content-length: 110 K 7 svn:log V 9 tag trunk K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-06-21T16:35:09.061530Z PROPS-END Node-path: tags/branché Node-kind: dir Node-action: add Node-copyfrom-rev: 6 Node-copyfrom-path: trunk Revision-number: 8 Prop-content-length: 114 Content-length: 114 K 7 svn:log V 12 tag branché K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-06-21T16:35:11.068562Z PROPS-END Node-path: tags/branchée Node-kind: dir Node-action: add Node-copyfrom-rev: 6 Node-copyfrom-path: branches/branchée mercurial-4.5.3/tests/svn/startrev.svndump0000644015407300116100000000545713261161234020650 0ustar augieeng00000000000000SVN-fs-dump-format-version: 2 UUID: c731c652-65e9-4325-a17e-fed96a319f22 Revision-number: 0 Prop-content-length: 56 Content-length: 56 K 8 svn:date V 27 2008-12-06T13:44:21.642421Z PROPS-END Revision-number: 1 Prop-content-length: 112 Content-length: 112 K 7 svn:log V 10 init projA K 10 svn:author V 7 pmezard K 8 svn:date V 27 2008-12-06T13:44:21.759281Z PROPS-END Node-path: branches Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: tags Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: trunk Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Revision-number: 2 Prop-content-length: 109 Content-length: 109 K 7 svn:log V 8 createab K 10 svn:author V 7 pmezard K 8 svn:date V 27 2008-12-06T13:44:22.179257Z PROPS-END Node-path: trunk/a Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3 Content-length: 12 PROPS-END a Node-path: trunk/b Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 3b5d5c3712955042212316173ccf37be Content-length: 12 PROPS-END b Revision-number: 3 Prop-content-length: 108 Content-length: 108 K 7 svn:log V 7 removeb K 10 svn:author V 7 pmezard K 8 svn:date V 27 2008-12-06T13:44:23.176546Z PROPS-END Node-path: trunk/b Node-action: delete Revision-number: 4 Prop-content-length: 109 Content-length: 109 K 7 svn:log V 8 changeaa K 10 svn:author V 7 pmezard K 8 svn:date V 27 2008-12-06T13:44:25.147151Z PROPS-END Node-path: trunk/a Node-kind: file Node-action: change Text-content-length: 4 Text-content-md5: 0d227f1abf8c2932d342e9b99cc957eb Content-length: 4 a a Revision-number: 5 Prop-content-length: 119 Content-length: 119 K 7 svn:log V 17 branch, changeaaa K 10 svn:author V 7 pmezard K 8 svn:date V 27 2008-12-06T13:44:28.158475Z PROPS-END Node-path: branches/branch1 Node-kind: dir Node-action: add Node-copyfrom-rev: 4 Node-copyfrom-path: trunk Prop-content-length: 34 Content-length: 34 K 13 svn:mergeinfo V 0 PROPS-END Node-path: branches/branch1/a Node-kind: file Node-action: change Text-content-length: 6 Text-content-md5: 7d4ebf8f298d22fc349a91725b00af1c Content-length: 6 a a a Revision-number: 6 Prop-content-length: 117 Content-length: 117 K 7 svn:log V 15 addc,changeaaaa K 10 svn:author V 7 pmezard K 8 svn:date V 27 2008-12-06T13:44:29.180655Z PROPS-END Node-path: branches/branch1/a Node-kind: file Node-action: change Text-content-length: 8 Text-content-md5: d12178e74d8774e34361e0a08d1fd2b7 Content-length: 8 a a a a Node-path: branches/branch1/c Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 2cd6ee2c70b0bde53fbe6cac3c8b8bb1 Content-length: 12 PROPS-END c mercurial-4.5.3/tests/svn/svndump-branches.sh0000755015407300116100000000272113261161234021165 0ustar augieeng00000000000000#!/bin/sh # # Use this script to generate branches.svndump # mkdir temp cd temp mkdir project-orig cd project-orig mkdir trunk mkdir branches cd .. svnadmin create svn-repo svnurl=file://`pwd`/svn-repo svn import project-orig $svnurl -m "init projA" svn co $svnurl project cd project echo a > trunk/a echo b > trunk/b echo c > trunk/c mkdir trunk/dir echo e > trunk/dir/e # Add a file within branches, used to confuse branch detection echo d > branches/notinbranch svn add trunk/a trunk/b trunk/c trunk/dir branches/notinbranch svn ci -m hello svn up # Branch to old svn copy trunk branches/old svn rm branches/old/c svn rm branches/old/dir svn ci -m "branch trunk, remove c and dir" svn up # Update trunk echo a >> trunk/a svn ci -m "change a" # Update old branch echo b >> branches/old/b svn ci -m "change b" # Create a cross-branch revision svn move trunk/b branches/old/c echo c >> branches/old/c svn ci -m "move and update c" # Update old branch again echo b >> branches/old/b svn ci -m "change b again" # Move back and forth between branch of similar names # This used to generate fake copy records svn up svn move branches/old branches/old2 svn ci -m "move to old2" svn move branches/old2 branches/old svn ci -m "move back to old" # Update trunk again echo a > trunk/a svn ci -m "last change to a" # Branch again from a converted revision svn copy -r 1 $svnurl/trunk branches/old3 svn ci -m "branch trunk@1 into old3" cd .. svnadmin dump svn-repo > ../branches.svndump mercurial-4.5.3/tests/svn/svndump-encoding.sh0000755015407300116100000000203713261161234021166 0ustar augieeng00000000000000#!/bin/sh # -*- coding: utf-8 -*- # # Use this script to generate encoding.svndump # mkdir temp cd temp mkdir project-orig cd project-orig mkdir trunk mkdir branches mkdir tags cd .. svnadmin create svn-repo svnurl=file://`pwd`/svn-repo svn import project-orig $svnurl -m "init projA" svn co $svnurl project cd project echo e > trunk/é mkdir trunk/à echo d > trunk/à/é svn add trunk/é trunk/à svn ci -m hello # Copy files and directories svn mv trunk/é trunk/è svn mv trunk/à trunk/ù svn ci -m "copy files" # Remove files svn rm trunk/è svn rm trunk/ù svn ci -m 'remove files' # Create branches with and from weird names svn up svn cp trunk branches/branché echo a > branches/branché/a svn ci -m 'branch to branché' svn up svn cp branches/branché branches/branchée echo a >> branches/branché/a svn ci -m 'branch to branchée' # Create tag with weird name svn up svn cp trunk tags/branché svn ci -m 'tag trunk' svn cp branches/branchée tags/branchée svn ci -m 'tag branché' cd .. svnadmin dump svn-repo > ../encoding.svndump mercurial-4.5.3/tests/svn/empty.svndump0000644015407300116100000000302413261161234020120 0ustar augieeng00000000000000SVN-fs-dump-format-version: 2 UUID: b70c45d5-2b76-4722-a373-d9babae61626 Revision-number: 0 Prop-content-length: 260 Content-length: 260 K 8 svn:date V 27 2012-04-18T11:35:14.752409Z K 17 svn:sync-from-url V 73 file:///Users/pmezard/dev/hg/hg-pmezard/tests/svn/temp/svn-repo/trunk/dir K 18 svn:sync-from-uuid V 36 56625b9e-e7e9-45be-ab61-052d41f0e1dd K 24 svn:sync-last-merged-rev V 1 4 PROPS-END Revision-number: 1 Prop-content-length: 112 Content-length: 112 K 10 svn:author V 7 pmezard K 8 svn:date V 27 2012-04-18T11:35:14.769622Z K 7 svn:log V 10 init projA PROPS-END Node-path: trunk Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Revision-number: 2 Prop-content-length: 107 Content-length: 107 K 10 svn:author V 7 pmezard K 8 svn:date V 27 2012-04-18T11:35:15.052989Z K 7 svn:log V 6 adddir PROPS-END Node-path: trunk/dir Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: trunk/dir/a Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3 Text-content-sha1: 3f786850e387550fdab836ed7e6dc881de23001b Content-length: 12 PROPS-END a Revision-number: 3 Prop-content-length: 105 Content-length: 105 K 10 svn:author V 7 pmezard K 8 svn:date V 27 2012-04-18T11:35:16.050353Z K 7 svn:log V 4 addb PROPS-END Revision-number: 4 Prop-content-length: 105 Content-length: 105 K 10 svn:author V 7 pmezard K 8 svn:date V 27 2012-04-18T11:35:17.050768Z K 7 svn:log V 4 addc PROPS-END mercurial-4.5.3/tests/svn/svndump-replace.sh0000755015407300116100000000273013261161234021013 0ustar augieeng00000000000000#!/bin/sh RSVN="`pwd`/rsvn.py" export PATH=/bin:/usr/bin mkdir temp cd temp svnadmin create repo svn co file://`pwd`/repo wc cd wc mkdir trunk branches cd trunk echo a > a mkdir d echo b > d/b ln -s d dlink ln -s d dlink2 ln -s d dlink3 mkdir d2 echo a > d2/a cd .. svn add * svn ci -m 'initial' # Clobber symlink with file with similar content cd trunk ls -Alh readlink dlink3 > dlink3tmp rm dlink3 mv dlink3tmp dlink3 svn propdel svn:special dlink3 svn ci -m 'clobber symlink' cd .. svn up # Clobber files and symlink with directories cd .. cat > clobber.rsvn < clobber.rsvn < d2/b svn add d2/b svn ci -m adddb cd .. svn up svn cp trunk branches/branch cd branches/branch svn rm d2/b echo c > d2/c svn add d2/c cd ../.. svn ci -m branch svn up cd .. cat > clobber.rsvn < ../replace.svndump mercurial-4.5.3/tests/svn/move.svndump0000644015407300116100000001704313261161234017736 0ustar augieeng00000000000000SVN-fs-dump-format-version: 2 UUID: 7d15f7c2-5863-4c16-aa2a-3418b1721d3a Revision-number: 0 Prop-content-length: 56 Content-length: 56 K 8 svn:date V 27 2010-05-09T13:02:37.336239Z PROPS-END Revision-number: 1 Prop-content-length: 112 Content-length: 112 K 7 svn:log V 10 init projA K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-09T13:02:37.372834Z PROPS-END Node-path: trunk Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: trunk/a Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3 Text-content-sha1: 3f786850e387550fdab836ed7e6dc881de23001b Content-length: 12 PROPS-END a Node-path: trunk/d1 Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: trunk/d1/b Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 3b5d5c3712955042212316173ccf37be Text-content-sha1: 89e6c98d92887913cadf06b2adb97f26cde4849b Content-length: 12 PROPS-END b Node-path: trunk/d1/c Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 2cd6ee2c70b0bde53fbe6cac3c8b8bb1 Text-content-sha1: 2b66fd261ee5c6cfc8de7fa466bab600bcfe4f69 Content-length: 12 PROPS-END c Node-path: trunk/d2 Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: trunk/d2/d Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: e29311f6f1bf1af907f9ef9f44b8328b Text-content-sha1: e983f374794de9c64e3d1c1de1d490c0756eeeff Content-length: 12 PROPS-END d Revision-number: 2 Prop-content-length: 118 Content-length: 118 K 7 svn:log V 16 commitbeforemove K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-09T13:02:38.049068Z PROPS-END Node-path: trunk/a Node-kind: file Node-action: change Text-content-length: 4 Text-content-md5: 0d227f1abf8c2932d342e9b99cc957eb Text-content-sha1: d7c8127a20a396cff08af086a1c695b0636f0c29 Content-length: 4 a a Node-path: trunk/d1/c Node-kind: file Node-action: change Text-content-length: 4 Text-content-md5: 63fad9092ad37713ebe26b3193f89c41 Text-content-sha1: ccfb93b7bac6f1520f0adc0eebc2cafe9da80f42 Content-length: 4 c c Revision-number: 3 Prop-content-length: 112 Content-length: 112 K 7 svn:log V 10 movedtrunk K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-09T13:02:39.044479Z PROPS-END Node-path: subproject Node-kind: dir Node-action: add Node-copyfrom-rev: 2 Node-copyfrom-path: trunk Node-path: trunk Node-action: delete Revision-number: 4 Prop-content-length: 113 Content-length: 113 K 7 svn:log V 11 createtrunk K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-09T13:02:40.057804Z PROPS-END Node-path: subproject/trunk Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Revision-number: 5 Prop-content-length: 116 Content-length: 116 K 7 svn:log V 14 createbranches K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-09T13:02:41.058871Z PROPS-END Node-path: subproject/branches Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Revision-number: 6 Prop-content-length: 107 Content-length: 107 K 7 svn:log V 6 moved1 K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-09T13:02:42.046689Z PROPS-END Node-path: subproject/trunk/d1 Node-kind: dir Node-action: add Node-copyfrom-rev: 5 Node-copyfrom-path: subproject/d1 Node-path: subproject/d1 Node-action: delete Revision-number: 7 Prop-content-length: 107 Content-length: 107 K 7 svn:log V 6 moved2 K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-09T13:02:42.071413Z PROPS-END Node-path: subproject/trunk/d2 Node-kind: dir Node-action: add Node-copyfrom-rev: 6 Node-copyfrom-path: subproject/d2 Node-path: subproject/d2 Node-action: delete Revision-number: 8 Prop-content-length: 119 Content-length: 119 K 7 svn:log V 17 changeb and rm d2 K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-09T13:02:43.062018Z PROPS-END Node-path: subproject/trunk/d1/b Node-kind: file Node-action: change Text-content-length: 4 Text-content-md5: 06ac26ed8b614fc0b141e4542aa067c2 Text-content-sha1: f6980469e74f7125178e88ec571e06fe6ce86e95 Content-length: 4 b b Node-path: subproject/trunk/d2 Node-action: delete Revision-number: 9 Prop-content-length: 113 Content-length: 113 K 7 svn:log V 11 moved1again K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-09T13:02:44.047997Z PROPS-END Node-path: subproject/branches/d1 Node-kind: dir Node-action: add Node-copyfrom-rev: 8 Node-copyfrom-path: subproject/trunk/d1 Node-path: subproject/trunk/d1 Node-action: delete Revision-number: 10 Prop-content-length: 118 Content-length: 118 K 7 svn:log V 16 copyfilefrompast K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-09T13:02:44.086619Z PROPS-END Node-path: subproject/trunk/d Node-kind: file Node-action: add Node-copyfrom-rev: 7 Node-copyfrom-path: subproject/trunk/d2/d Text-copy-source-md5: e29311f6f1bf1af907f9ef9f44b8328b Text-copy-source-sha1: e983f374794de9c64e3d1c1de1d490c0756eeeff Revision-number: 11 Prop-content-length: 117 Content-length: 117 K 7 svn:log V 15 copydirfrompast K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-09T13:02:44.111550Z PROPS-END Node-path: subproject/trunk/d2 Node-kind: dir Node-action: add Node-copyfrom-rev: 7 Node-copyfrom-path: subproject/trunk/d2 Revision-number: 12 Prop-content-length: 107 Content-length: 107 K 7 svn:log V 6 add d3 K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-09T13:02:45.067982Z PROPS-END Node-path: subproject/trunk/d3 Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: subproject/trunk/d3/d31 Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: subproject/trunk/d3/d31/e Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 9ffbf43126e33be52cd2bf7e01d627f9 Text-content-sha1: 094e3afb2fe8dfe82f63731cdcd3b999f4856cff Content-length: 12 PROPS-END e Node-path: subproject/trunk/d3/f Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 9a8ad92c50cae39aa2c5604fd0ab6d8c Text-content-sha1: a9fcd54b25e7e863d72cd47c08af46e61b74b561 Content-length: 12 PROPS-END f Revision-number: 13 Prop-content-length: 128 Content-length: 128 K 7 svn:log V 26 copy dir and remove subdir K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-09T13:02:47.061259Z PROPS-END Node-path: subproject/trunk/d3/d31 Node-action: delete Node-path: subproject/trunk/d4 Node-kind: dir Node-action: add Node-copyfrom-rev: 12 Node-copyfrom-path: subproject/trunk/d3 Revision-number: 14 Prop-content-length: 110 Content-length: 110 K 7 svn:log V 9 add d4old K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-09T13:02:49.063363Z PROPS-END Node-path: subproject/trunk/d4old Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: subproject/trunk/d4old/g Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: f5302386464f953ed581edac03556e55 Text-content-sha1: a5938ace3f424be1a26904781cdb06d55b614e6b Content-length: 12 PROPS-END g Revision-number: 15 Prop-content-length: 125 Content-length: 125 K 7 svn:log V 23 rename d4old into d4new K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-05-09T13:02:51.047304Z PROPS-END Node-path: subproject/trunk/d4new Node-kind: dir Node-action: add Node-copyfrom-rev: 14 Node-copyfrom-path: subproject/trunk/d4old Node-path: subproject/trunk/d4old Node-action: delete mercurial-4.5.3/tests/svn/tags.svndump0000644015407300116100000001064613261161234017730 0ustar augieeng00000000000000SVN-fs-dump-format-version: 2 UUID: a9c3b03d-cffa-4248-8023-ecf4b2bdf5d5 Revision-number: 0 Prop-content-length: 56 Content-length: 56 K 8 svn:date V 27 2009-04-29T19:26:51.708679Z PROPS-END Revision-number: 1 Prop-content-length: 112 Content-length: 112 K 7 svn:log V 10 init projA K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-04-29T19:26:52.115023Z PROPS-END Node-path: branches Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: tags Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: trunk Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: unrelated Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Revision-number: 2 Prop-content-length: 105 Content-length: 105 K 7 svn:log V 4 adda K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-04-29T19:26:53.109819Z PROPS-END Node-path: trunk/a Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3 Text-content-sha1: 3f786850e387550fdab836ed7e6dc881de23001b Content-length: 12 PROPS-END a Revision-number: 3 Prop-content-length: 108 Content-length: 108 K 7 svn:log V 7 changea K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-04-29T19:26:54.073017Z PROPS-END Node-path: trunk/a Node-kind: file Node-action: change Text-content-length: 4 Text-content-md5: 0d227f1abf8c2932d342e9b99cc957eb Text-content-sha1: d7c8127a20a396cff08af086a1c695b0636f0c29 Content-length: 4 a a Revision-number: 4 Prop-content-length: 109 Content-length: 109 K 7 svn:log V 8 changea2 K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-04-29T19:26:55.076032Z PROPS-END Node-path: trunk/a Node-kind: file Node-action: change Text-content-length: 6 Text-content-md5: 7d4ebf8f298d22fc349a91725b00af1c Text-content-sha1: 92f31bc48f52339253fce6cad9f2f0c95b302f7e Content-length: 6 a a a Revision-number: 5 Prop-content-length: 117 Content-length: 117 K 7 svn:log V 15 unrelatedchange K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-04-29T19:26:56.095784Z PROPS-END Node-path: unrelated/dummy Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3 Text-content-sha1: 3f786850e387550fdab836ed7e6dc881de23001b Content-length: 12 PROPS-END a Revision-number: 6 Prop-content-length: 131 Content-length: 131 K 7 svn:log V 29 tagging trunk.v1 trunk.badtag K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-04-29T19:27:00.074864Z PROPS-END Node-path: tags/trunk.badtag Node-kind: dir Node-action: add Node-copyfrom-rev: 5 Node-copyfrom-path: trunk Node-path: tags/trunk.v1 Node-kind: dir Node-action: add Node-copyfrom-rev: 5 Node-copyfrom-path: trunk Revision-number: 7 Prop-content-length: 109 Content-length: 109 K 7 svn:log V 8 changea3 K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-04-29T19:27:01.073910Z PROPS-END Node-path: trunk/a Node-kind: file Node-action: change Text-content-length: 8 Text-content-md5: d12178e74d8774e34361e0a08d1fd2b7 Text-content-sha1: cce0b2a263066e26610df9082b7b3c810f71262e Content-length: 8 a a a a Revision-number: 8 Prop-content-length: 118 Content-length: 118 K 7 svn:log V 16 fix trunk.badtag K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-04-29T19:27:04.073542Z PROPS-END Node-path: tags/trunk.goodtag Node-kind: dir Node-action: add Node-copyfrom-rev: 7 Node-copyfrom-path: tags/trunk.badtag Node-path: tags/trunk.badtag Node-action: delete Revision-number: 9 Prop-content-length: 108 Content-length: 108 K 7 svn:log V 7 changea K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-04-29T19:27:05.095204Z PROPS-END Node-path: trunk/a Node-kind: file Node-action: change Text-content-length: 10 Text-content-md5: 3f65cbdca1b64c2f8f574fccae24f3a4 Text-content-sha1: 5c077263421de2abff9dbe867921bc6810811aa2 Content-length: 10 a a a a a Revision-number: 10 Prop-content-length: 115 Content-length: 115 K 7 svn:log V 13 removegoodtag K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-04-29T19:27:06.089193Z PROPS-END Node-path: tags/trunk.goodtag Node-action: delete Revision-number: 11 Prop-content-length: 117 Content-length: 117 K 7 svn:log V 15 recreategoodtag K 10 svn:author V 7 pmezard K 8 svn:date V 27 2009-04-29T19:27:09.070471Z PROPS-END Node-path: tags/trunk.goodtag Node-kind: dir Node-action: add Node-copyfrom-rev: 10 Node-copyfrom-path: trunk mercurial-4.5.3/tests/svn/svndump-move.sh0000755015407300116100000000441413261161234020347 0ustar augieeng00000000000000#!/bin/sh # # Use this script to generate move.svndump # mkdir temp cd temp mkdir project-orig cd project-orig mkdir trunk echo a > trunk/a mkdir trunk/d1 mkdir trunk/d2 echo b > trunk/d1/b echo c > trunk/d1/c echo d > trunk/d2/d cd .. svnadmin create svn-repo svnurl=file://`pwd`/svn-repo svn import project-orig $svnurl -m "init projA" svn co $svnurl project cd project # Build a module renaming chain which used to confuse the converter. # Update svn repository echo a >> trunk/a echo c >> trunk/d1/c svn ci -m commitbeforemove svn mv $svnurl/trunk $svnurl/subproject -m movedtrunk svn up mkdir subproject/trunk svn add subproject/trunk svn ci -m createtrunk mkdir subproject/branches svn add subproject/branches svn ci -m createbranches svn mv $svnurl/subproject/d1 $svnurl/subproject/trunk/d1 -m moved1 svn mv $svnurl/subproject/d2 $svnurl/subproject/trunk/d2 -m moved2 svn up echo b >> subproject/trunk/d1/b svn rm subproject/trunk/d2 svn ci -m "changeb and rm d2" svn mv $svnurl/subproject/trunk/d1 $svnurl/subproject/branches/d1 -m moved1again if svn help copy | grep 'SRC\[@REV\]' > /dev/null 2>&1; then # SVN >= 1.5 replaced the -r REV syntax with @REV # Copy a file from a past revision svn copy $svnurl/subproject/trunk/d2/d@7 $svnurl/subproject/trunk -m copyfilefrompast # Copy a directory from a past revision svn copy $svnurl/subproject/trunk/d2@7 $svnurl/subproject/trunk -m copydirfrompast else # Copy a file from a past revision svn copy -r 7 $svnurl/subproject/trunk/d2/d $svnurl/subproject/trunk -m copyfilefrompast # Copy a directory from a past revision svn copy -r 7 $svnurl/subproject/trunk/d2 $svnurl/subproject/trunk -m copydirfrompast fi # Copy a directory while removing a subdirectory svn up mkdir -p subproject/trunk/d3/d31 echo e > subproject/trunk/d3/d31/e echo f > subproject/trunk/d3/f svn add subproject/trunk/d3 svn ci -m "add d3" svn copy subproject/trunk/d3 subproject/trunk/d4 svn rm subproject/trunk/d3/d31 svn ci -m "copy dir and remove subdir" # Test directory moves svn up mkdir -p subproject/trunk/d4old echo g > subproject/trunk/d4old/g svn add subproject/trunk/d4old svn ci -m "add d4old" svn mv subproject/trunk/d4old subproject/trunk/d4new svn ci -m "rename d4old into d4new" cd .. svnadmin dump svn-repo > ../move.svndumpmercurial-4.5.3/tests/svn/replace.svndump0000644015407300116100000001177713261161234020413 0ustar augieeng00000000000000SVN-fs-dump-format-version: 2 UUID: 97a955ef-0269-44f2-a58f-abd4ad400b2b Revision-number: 0 Prop-content-length: 56 Content-length: 56 K 8 svn:date V 27 2010-11-26T18:01:12.912988Z PROPS-END Revision-number: 1 Prop-content-length: 108 Content-length: 108 K 7 svn:log V 7 initial K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-11-26T18:01:13.106933Z PROPS-END Node-path: branches Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: trunk Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: trunk/a Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3 Text-content-sha1: 3f786850e387550fdab836ed7e6dc881de23001b Content-length: 12 PROPS-END a Node-path: trunk/d Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: trunk/d/b Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 3b5d5c3712955042212316173ccf37be Text-content-sha1: 89e6c98d92887913cadf06b2adb97f26cde4849b Content-length: 12 PROPS-END b Node-path: trunk/d2 Node-kind: dir Node-action: add Prop-content-length: 10 Content-length: 10 PROPS-END Node-path: trunk/d2/a Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 60b725f10c9c85c70d97880dfe8191b3 Text-content-sha1: 3f786850e387550fdab836ed7e6dc881de23001b Content-length: 12 PROPS-END a Node-path: trunk/dlink Node-kind: file Node-action: add Prop-content-length: 33 Text-content-length: 6 Text-content-md5: cca56829f18345718a4980bb02b6d8c3 Text-content-sha1: 7c54cc5d472b78c94a04382df34b0f4f0f4f2d49 Content-length: 39 K 11 svn:special V 1 * PROPS-END link d Node-path: trunk/dlink2 Node-kind: file Node-action: add Prop-content-length: 33 Text-content-length: 6 Text-content-md5: cca56829f18345718a4980bb02b6d8c3 Text-content-sha1: 7c54cc5d472b78c94a04382df34b0f4f0f4f2d49 Content-length: 39 K 11 svn:special V 1 * PROPS-END link d Node-path: trunk/dlink3 Node-kind: file Node-action: add Prop-content-length: 33 Text-content-length: 6 Text-content-md5: cca56829f18345718a4980bb02b6d8c3 Text-content-sha1: 7c54cc5d472b78c94a04382df34b0f4f0f4f2d49 Content-length: 39 K 11 svn:special V 1 * PROPS-END link d Revision-number: 2 Prop-content-length: 117 Content-length: 117 K 7 svn:log V 15 clobber symlink K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-11-26T18:01:14.073483Z PROPS-END Node-path: trunk/dlink3 Node-kind: file Node-action: change Prop-content-length: 10 Text-content-length: 2 Text-content-md5: e29311f6f1bf1af907f9ef9f44b8328b Text-content-sha1: e983f374794de9c64e3d1c1de1d490c0756eeeff Content-length: 12 PROPS-END d Revision-number: 3 Prop-content-length: 106 Content-length: 106 K 7 svn:log V 8 clobber1 K 10 svn:author V 4 evil K 8 svn:date V 27 2010-11-26T18:01:16.205184Z PROPS-END Node-path: trunk/a Node-kind: dir Node-action: delete Node-path: trunk/a Node-kind: dir Node-action: add Node-copyfrom-rev: 2 Node-copyfrom-path: trunk/d Node-path: trunk/dlink Node-kind: dir Node-action: delete Node-path: trunk/dlink Node-kind: dir Node-action: add Node-copyfrom-rev: 2 Node-copyfrom-path: trunk/d Revision-number: 4 Prop-content-length: 106 Content-length: 106 K 7 svn:log V 8 clobber2 K 10 svn:author V 4 evil K 8 svn:date V 27 2010-11-26T18:01:16.395962Z PROPS-END Node-path: trunk/dlink3 Node-kind: file Node-action: delete Node-path: trunk/dlink3 Node-kind: file Node-action: add Node-copyfrom-rev: 3 Node-copyfrom-path: trunk/dlink2 Text-copy-source-md5: cca56829f18345718a4980bb02b6d8c3 Text-copy-source-sha1: 7c54cc5d472b78c94a04382df34b0f4f0f4f2d49 Revision-number: 5 Prop-content-length: 106 Content-length: 106 K 7 svn:log V 5 adddb K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-11-26T18:01:16.445072Z PROPS-END Node-path: trunk/d2/b Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 3b5d5c3712955042212316173ccf37be Text-content-sha1: 89e6c98d92887913cadf06b2adb97f26cde4849b Content-length: 12 PROPS-END b Revision-number: 6 Prop-content-length: 107 Content-length: 107 K 7 svn:log V 6 branch K 10 svn:author V 7 pmezard K 8 svn:date V 27 2010-11-26T18:01:19.075874Z PROPS-END Node-path: branches/branch Node-kind: dir Node-action: add Node-copyfrom-rev: 5 Node-copyfrom-path: trunk Node-path: branches/branch/d2/c Node-kind: file Node-action: add Prop-content-length: 10 Text-content-length: 2 Text-content-md5: 2cd6ee2c70b0bde53fbe6cac3c8b8bb1 Text-content-sha1: 2b66fd261ee5c6cfc8de7fa466bab600bcfe4f69 Content-length: 12 PROPS-END c Node-path: branches/branch/d2/b Node-action: delete Revision-number: 7 Prop-content-length: 109 Content-length: 109 K 7 svn:log V 10 clobberdir K 10 svn:author V 4 evil K 8 svn:date V 27 2010-11-26T18:01:21.202158Z PROPS-END Node-path: trunk/d2 Node-kind: dir Node-action: delete Node-path: trunk/d2 Node-kind: dir Node-action: add Node-copyfrom-rev: 6 Node-copyfrom-path: branches/branch/d2 mercurial-4.5.3/tests/svn/svndump-empty.sh0000755015407300116100000000154213261161234020536 0ustar augieeng00000000000000#!/bin/sh # # Use this script to generate empty.svndump # mkdir temp cd temp mkdir project-orig cd project-orig mkdir trunk mkdir branches mkdir tags cd .. svnadmin create svn-repo svnurl=file://`pwd`/svn-repo svn import project-orig $svnurl -m "init projA" svn co $svnurl project cd project mkdir trunk/dir echo a > trunk/dir/a svn add trunk/dir svn ci -m adddir echo b > trunk/b svn add trunk/b svn ci -m addb echo c > c svn add c svn ci -m addc cd .. # svnsync repo/trunk/dir only so the last two revisions are empty svnadmin create svn-empty cat > svn-empty/hooks/pre-revprop-change < ../empty.svndump mercurial-4.5.3/tests/test-largefiles.t0000644015407300116100000014564313261161234020033 0ustar augieeng00000000000000This file used to contains all largefile tests. Do not add any new tests in this file as it his already far too long to run. It contains all the testing of the basic concepts of large file in a single block. $ USERCACHE="$TESTTMP/cache"; export USERCACHE $ mkdir "${USERCACHE}" $ cat >> $HGRCPATH < [extensions] > largefiles= > purge= > rebase= > transplant= > [phases] > publish=False > [largefiles] > minsize=2 > patterns=glob:**.dat > usercache=${USERCACHE} > [hooks] > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status" > EOF Create the repo with a couple of revisions of both large and normal files. Test status and dirstate of largefiles and that summary output is correct. $ hg init a $ cd a $ mkdir sub $ echo normal1 > normal1 $ echo normal2 > sub/normal2 $ echo large1 > large1 $ echo large2 > sub/large2 $ hg add normal1 sub/normal2 $ hg add --large large1 sub/large2 $ hg commit -m "add files" Invoking status precommit hook A large1 A normal1 A sub/large2 A sub/normal2 $ touch large1 sub/large2 $ sleep 1 $ hg st $ hg debugstate --nodates n 644 41 set .hglf/large1 n 644 41 set .hglf/sub/large2 n 644 8 set normal1 n 644 8 set sub/normal2 $ hg debugstate --large --nodates n 644 7 set large1 n 644 7 set sub/large2 $ echo normal11 > normal1 $ echo normal22 > sub/normal2 $ echo large11 > large1 $ echo large22 > sub/large2 $ hg commit -m "edit files" Invoking status precommit hook M large1 M normal1 M sub/large2 M sub/normal2 $ hg sum --large parent: 1:ce8896473775 tip edit files branch: default commit: (clean) update: (current) phases: 2 draft largefiles: (no remote repo) Commit preserved largefile contents. $ cat normal1 normal11 $ cat large1 large11 $ cat sub/normal2 normal22 $ cat sub/large2 large22 Test status, subdir and unknown files $ echo unknown > sub/unknown $ hg st --all ? sub/unknown C large1 C normal1 C sub/large2 C sub/normal2 $ hg st --all sub ? sub/unknown C sub/large2 C sub/normal2 $ rm sub/unknown Test messages and exit codes for remove warning cases $ hg remove -A large1 not removing large1: file still exists [1] $ echo 'modified' > large1 $ hg remove large1 not removing large1: file is modified (use -f to force removal) [1] $ echo 'new' > normalnew $ hg add normalnew $ echo 'new' > largenew $ hg add --large normalnew normalnew already tracked! $ hg remove normalnew largenew not removing largenew: file is untracked not removing normalnew: file has been marked for add (use 'hg forget' to undo add) [1] $ rm normalnew largenew $ hg up -Cq Remove both largefiles and normal files. $ hg remove normal1 large1 $ hg status large1 R large1 $ hg commit -m "remove files" Invoking status precommit hook R large1 R normal1 $ ls sub $ echo "testlargefile" > large1-test $ hg add --large large1-test $ hg st A large1-test $ hg rm large1-test not removing large1-test: file has been marked for add (use forget to undo) [1] $ hg st A large1-test $ hg forget large1-test $ hg st ? large1-test $ hg remove large1-test not removing large1-test: file is untracked [1] $ hg forget large1-test not removing large1-test: file is already untracked [1] $ rm large1-test Copy both largefiles and normal files (testing that status output is correct). $ hg cp sub/normal2 normal1 $ hg cp sub/large2 large1 $ hg commit -m "copy files" Invoking status precommit hook A large1 A normal1 $ cat normal1 normal22 $ cat large1 large22 Test moving largefiles and verify that normal files are also unaffected. $ hg mv normal1 normal3 $ hg mv large1 large3 $ hg mv sub/normal2 sub/normal4 $ hg mv sub/large2 sub/large4 $ hg commit -m "move files" Invoking status precommit hook A large3 A normal3 A sub/large4 A sub/normal4 R large1 R normal1 R sub/large2 R sub/normal2 $ cat normal3 normal22 $ cat large3 large22 $ cat sub/normal4 normal22 $ cat sub/large4 large22 #if serve Test display of largefiles in hgweb $ hg serve -d -p $HGPORT --pid-file ../hg.pid $ cat ../hg.pid >> $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/?style=raw' 200 Script output follows drwxr-xr-x sub -rw-r--r-- 41 large3 -rw-r--r-- 9 normal3 $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/sub/?style=raw' 200 Script output follows -rw-r--r-- 41 large4 -rw-r--r-- 9 normal4 $ killdaemons.py #endif Test largefiles can be loaded in hgweb (wrapcommand() shouldn't fail) $ cat < "$TESTTMP/hgweb.cgi" > #!$PYTHON > from mercurial import demandimport; demandimport.enable() > from mercurial.hgweb import hgweb > from mercurial.hgweb import wsgicgi > application = hgweb('.', 'test repo') > wsgicgi.launch(application) > EOF $ . "$TESTDIR/cgienv" $ SCRIPT_NAME='' \ > $PYTHON "$TESTTMP/hgweb.cgi" > /dev/null Test archiving the various revisions. These hit corner cases known with archiving. $ hg archive -r 0 ../archive0 $ hg archive -r 1 ../archive1 $ hg archive -r 2 ../archive2 $ hg archive -r 3 ../archive3 $ hg archive -r 4 ../archive4 $ cd ../archive0 $ cat normal1 normal1 $ cat large1 large1 $ cat sub/normal2 normal2 $ cat sub/large2 large2 $ cd ../archive1 $ cat normal1 normal11 $ cat large1 large11 $ cat sub/normal2 normal22 $ cat sub/large2 large22 $ cd ../archive2 $ ls sub $ cat sub/normal2 normal22 $ cat sub/large2 large22 $ cd ../archive3 $ cat normal1 normal22 $ cat large1 large22 $ cat sub/normal2 normal22 $ cat sub/large2 large22 $ cd ../archive4 $ cat normal3 normal22 $ cat large3 large22 $ cat sub/normal4 normal22 $ cat sub/large4 large22 Commit corner case: specify files to commit. $ cd ../a $ echo normal3 > normal3 $ echo large3 > large3 $ echo normal4 > sub/normal4 $ echo large4 > sub/large4 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again" Invoking status precommit hook M large3 M normal3 M sub/large4 M sub/normal4 $ cat normal3 normal3 $ cat large3 large3 $ cat sub/normal4 normal4 $ cat sub/large4 large4 One more commit corner case: commit from a subdirectory. $ cd ../a $ echo normal33 > normal3 $ echo large33 > large3 $ echo normal44 > sub/normal4 $ echo large44 > sub/large4 $ cd sub $ hg commit -m "edit files yet again" Invoking status precommit hook M large3 M normal3 M sub/large4 M sub/normal4 $ cat ../normal3 normal33 $ cat ../large3 large33 $ cat normal4 normal44 $ cat large4 large44 Committing standins is not allowed. $ cd .. $ echo large3 > large3 $ hg commit .hglf/large3 -m "try to commit standin" abort: file ".hglf/large3" is a largefile standin (commit the largefile itself instead) [255] Corner cases for adding largefiles. $ echo large5 > large5 $ hg add --large large5 $ hg add --large large5 large5 already a largefile $ mkdir sub2 $ echo large6 > sub2/large6 $ echo large7 > sub2/large7 $ hg add --large sub2 adding sub2/large6 as a largefile adding sub2/large7 as a largefile $ hg st M large3 A large5 A sub2/large6 A sub2/large7 Committing directories containing only largefiles. $ mkdir -p z/y/x/m $ touch z/y/x/m/large1 $ touch z/y/x/large2 $ hg add --large z/y/x/m/large1 z/y/x/large2 $ hg commit -m "Subdir with directory only containing largefiles" z Invoking status precommit hook M large3 A large5 A sub2/large6 A sub2/large7 A z/y/x/large2 A z/y/x/m/large1 (and a bit of log testing) $ hg log -T '{rev}\n' z/y/x/m/large1 7 $ hg log -T '{rev}\n' z/y/x/m # with only a largefile 7 $ hg rollback --quiet $ touch z/y/x/m/normal $ hg add z/y/x/m/normal $ hg commit -m "Subdir with mixed contents" z Invoking status precommit hook M large3 A large5 A sub2/large6 A sub2/large7 A z/y/x/large2 A z/y/x/m/large1 A z/y/x/m/normal $ hg st M large3 A large5 A sub2/large6 A sub2/large7 $ hg rollback --quiet $ hg revert z/y/x/large2 z/y/x/m/large1 $ rm z/y/x/large2 z/y/x/m/large1 $ hg commit -m "Subdir with normal contents" z Invoking status precommit hook M large3 A large5 A sub2/large6 A sub2/large7 A z/y/x/m/normal $ hg st M large3 A large5 A sub2/large6 A sub2/large7 $ hg rollback --quiet $ hg revert --quiet z $ hg commit -m "Empty subdir" z abort: z: no match under directory! [255] $ rm -rf z $ hg ci -m "standin" .hglf abort: file ".hglf" is a largefile standin (commit the largefile itself instead) [255] Test "hg status" with combination of 'file pattern' and 'directory pattern' for largefiles: $ hg status sub2/large6 sub2 A sub2/large6 A sub2/large7 Config settings (pattern **.dat, minsize 2 MB) are respected. $ echo testdata > test.dat $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null $ hg add adding reallylarge as a largefile adding test.dat as a largefile Test that minsize and --lfsize handle float values; also tests that --lfsize overrides largefiles.minsize. (0.250 MB = 256 kB = 262144 B) $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null $ hg --config largefiles.minsize=.25 add adding ratherlarge as a largefile adding medium $ hg forget medium $ hg --config largefiles.minsize=.25 add --lfsize=.125 adding medium as a largefile $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null $ hg --config largefiles.minsize=.25 add --lfsize=.125 adding notlarge $ hg forget notlarge Test forget on largefiles. $ hg forget large3 large5 test.dat reallylarge ratherlarge medium $ hg commit -m "add/edit more largefiles" Invoking status precommit hook A sub2/large6 A sub2/large7 R large3 ? large5 ? medium ? notlarge ? ratherlarge ? reallylarge ? test.dat $ hg st ? large3 ? large5 ? medium ? notlarge ? ratherlarge ? reallylarge ? test.dat Purge with largefiles: verify that largefiles are still in the working dir after a purge. $ hg purge --all $ cat sub/large4 large44 $ cat sub2/large6 large6 $ cat sub2/large7 large7 Test addremove: verify that files that should be added as largefiles are added as such and that already-existing largefiles are not added as normal files by accident. $ rm normal3 $ rm sub/large4 $ echo "testing addremove with patterns" > testaddremove.dat $ echo "normaladdremove" > normaladdremove $ hg addremove removing sub/large4 adding testaddremove.dat as a largefile removing normal3 adding normaladdremove Test addremove with -R $ hg up -C getting changed largefiles 1 largefiles updated, 0 removed 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm normal3 $ rm sub/large4 $ echo "testing addremove with patterns" > testaddremove.dat $ echo "normaladdremove" > normaladdremove $ cd .. $ hg -R a -v addremove removing sub/large4 adding testaddremove.dat as a largefile removing normal3 adding normaladdremove $ cd a Test 3364 $ hg clone . ../addrm updating to branch default getting changed largefiles 3 largefiles updated, 0 removed 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ../addrm $ cat >> .hg/hgrc < [hooks] > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A" > EOF $ touch foo $ hg add --large foo $ hg ci -m "add foo" Invoking status precommit hook A foo Invoking status postcommit hook C foo C normal3 C sub/large4 C sub/normal4 C sub2/large6 C sub2/large7 $ rm foo $ hg st ! foo hmm.. no precommit invoked, but there is a postcommit?? $ hg ci -m "will not checkin" nothing changed (1 missing files, see 'hg status') Invoking status postcommit hook ! foo C normal3 C sub/large4 C sub/normal4 C sub2/large6 C sub2/large7 [1] $ hg addremove removing foo $ hg st R foo $ hg ci -m "used to say nothing changed" Invoking status precommit hook R foo Invoking status postcommit hook C normal3 C sub/large4 C sub/normal4 C sub2/large6 C sub2/large7 $ hg st Test 3507 (both normal files and largefiles were a problem) $ touch normal $ touch large $ hg add normal $ hg add --large large $ hg ci -m "added" Invoking status precommit hook A large A normal Invoking status postcommit hook C large C normal C normal3 C sub/large4 C sub/normal4 C sub2/large6 C sub2/large7 $ hg remove normal $ hg addremove --traceback $ hg ci -m "addremoved normal" Invoking status precommit hook R normal Invoking status postcommit hook C large C normal3 C sub/large4 C sub/normal4 C sub2/large6 C sub2/large7 $ hg up -C '.^' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg remove large $ hg addremove --traceback $ hg ci -m "removed large" Invoking status precommit hook R large created new head Invoking status postcommit hook C normal C normal3 C sub/large4 C sub/normal4 C sub2/large6 C sub2/large7 Test commit -A (issue3542) $ echo large8 > large8 $ hg add --large large8 $ hg ci -Am 'this used to add large8 as normal and commit both' Invoking status precommit hook A large8 Invoking status postcommit hook C large8 C normal C normal3 C sub/large4 C sub/normal4 C sub2/large6 C sub2/large7 $ rm large8 $ hg ci -Am 'this used to not notice the rm' removing large8 Invoking status precommit hook R large8 Invoking status postcommit hook C normal C normal3 C sub/large4 C sub/normal4 C sub2/large6 C sub2/large7 Test that a standin can't be added as a large file $ touch large $ hg add --large large $ hg ci -m "add" Invoking status precommit hook A large Invoking status postcommit hook C large C normal C normal3 C sub/large4 C sub/normal4 C sub2/large6 C sub2/large7 $ hg remove large $ touch large $ hg addremove --config largefiles.patterns=**large --traceback adding large as a largefile Test that outgoing --large works (with revsets too) $ hg outgoing --rev '.^' --large comparing with $TESTTMP/a searching for changes changeset: 8:c02fd3b77ec4 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add foo changeset: 9:289dd08c9bbb user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: used to say nothing changed changeset: 10:34f23ac6ac12 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: added changeset: 12:710c1b2f523c parent: 10:34f23ac6ac12 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: removed large changeset: 13:0a3e75774479 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: this used to add large8 as normal and commit both changeset: 14:84f3d378175c user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: this used to not notice the rm largefiles to upload (1 entities): large8 $ cd ../a Clone a largefiles repo. $ hg clone . ../b updating to branch default getting changed largefiles 3 largefiles updated, 0 removed 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ../b $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 7:daea875e9014 add/edit more largefiles 6:4355d653f84f edit files yet again 5:9d5af5072dbd edit files again 4:74c02385b94c move files 3:9e8fbc4bce62 copy files 2:51a0ae4d5864 remove files 1:ce8896473775 edit files 0:30d30fe6a5be add files $ cat normal3 normal33 Test graph log $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' @ 7:daea875e9014 add/edit more largefiles | o 6:4355d653f84f edit files yet again | o 5:9d5af5072dbd edit files again | o 4:74c02385b94c move files | o 3:9e8fbc4bce62 copy files | o 2:51a0ae4d5864 remove files | o 1:ce8896473775 edit files | o 0:30d30fe6a5be add files Test log with --patch $ hg log --patch -r 6::7 changeset: 6:4355d653f84f user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: edit files yet again diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -baaf12afde9d8d67f25dab6dced0d2bf77dba47c +7838695e10da2bb75ac1156565f40a2595fa2fa0 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -aeb2210d19f02886dde00dac279729a48471e2f9 +971fb41e78fea4f8e0ba5244784239371cb00591 diff -r 9d5af5072dbd -r 4355d653f84f normal3 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -normal3 +normal33 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -normal4 +normal44 changeset: 7:daea875e9014 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add/edit more largefiles diff -r 4355d653f84f -r daea875e9014 .hglf/large3 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -7838695e10da2bb75ac1156565f40a2595fa2fa0 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +bb3151689acb10f0c3125c560d5e63df914bc1af $ hg log --patch -r 6::7 sub/ changeset: 6:4355d653f84f user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: edit files yet again diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -aeb2210d19f02886dde00dac279729a48471e2f9 +971fb41e78fea4f8e0ba5244784239371cb00591 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -normal4 +normal44 log with both --follow and --patch $ hg log --follow --patch --limit 2 changeset: 7:daea875e9014 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add/edit more largefiles diff -r 4355d653f84f -r daea875e9014 .hglf/large3 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -7838695e10da2bb75ac1156565f40a2595fa2fa0 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +bb3151689acb10f0c3125c560d5e63df914bc1af changeset: 6:4355d653f84f user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: edit files yet again diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -baaf12afde9d8d67f25dab6dced0d2bf77dba47c +7838695e10da2bb75ac1156565f40a2595fa2fa0 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -aeb2210d19f02886dde00dac279729a48471e2f9 +971fb41e78fea4f8e0ba5244784239371cb00591 diff -r 9d5af5072dbd -r 4355d653f84f normal3 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -normal3 +normal33 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -normal4 +normal44 $ hg log --follow --patch sub/large4 changeset: 6:4355d653f84f user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: edit files yet again diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -aeb2210d19f02886dde00dac279729a48471e2f9 +971fb41e78fea4f8e0ba5244784239371cb00591 changeset: 5:9d5af5072dbd user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: edit files again diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 +aeb2210d19f02886dde00dac279729a48471e2f9 changeset: 4:74c02385b94c user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: move files diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 changeset: 1:ce8896473775 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: edit files diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2 --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -1deebade43c8c498a3c8daddac0244dc55d1331d +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 changeset: 0:30d30fe6a5be user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add files diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +1deebade43c8c498a3c8daddac0244dc55d1331d $ cat sub/normal4 normal44 $ cat sub/large4 large44 $ cat sub2/large6 large6 $ cat sub2/large7 large7 $ hg log -qf sub2/large7 7:daea875e9014 $ hg log -Gqf sub2/large7 @ 7:daea875e9014 | ~ $ cd .. Test log from outside repo $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n' 6:4355d653f84f edit files yet again 5:9d5af5072dbd edit files again 4:74c02385b94c move files 1:ce8896473775 edit files 0:30d30fe6a5be add files Test clone at revision $ hg clone a -r 3 c adding changesets adding manifests adding file changes added 4 changesets with 10 changes to 4 files new changesets 30d30fe6a5be:9e8fbc4bce62 updating to branch default getting changed largefiles 2 largefiles updated, 0 removed 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd c $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 3:9e8fbc4bce62 copy files 2:51a0ae4d5864 remove files 1:ce8896473775 edit files 0:30d30fe6a5be add files $ cat normal1 normal22 $ cat large1 large22 $ cat sub/normal2 normal22 $ cat sub/large2 large22 Old revisions of a clone have correct largefiles content (this also tests update). $ hg update -r 1 getting changed largefiles 1 largefiles updated, 0 removed 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat large1 large11 $ cat sub/large2 large22 $ cd .. Test cloning with --all-largefiles flag $ rm "${USERCACHE}"/* $ hg clone --all-largefiles a a-backup updating to branch default getting changed largefiles 3 largefiles updated, 0 removed 5 files updated, 0 files merged, 0 files removed, 0 files unresolved 8 additional largefiles cached $ rm "${USERCACHE}"/* $ hg clone --all-largefiles -u 0 a a-clone0 updating to branch default getting changed largefiles 2 largefiles updated, 0 removed 4 files updated, 0 files merged, 0 files removed, 0 files unresolved 9 additional largefiles cached $ hg -R a-clone0 sum parent: 0:30d30fe6a5be add files branch: default commit: (clean) update: 7 new changesets (update) phases: 8 draft $ rm "${USERCACHE}"/* $ hg clone --all-largefiles -u 1 a a-clone1 updating to branch default getting changed largefiles 2 largefiles updated, 0 removed 4 files updated, 0 files merged, 0 files removed, 0 files unresolved 8 additional largefiles cached $ hg -R a-clone1 verify --large --lfa --lfc checking changesets checking manifests crosschecking files in changesets and manifests checking files 10 files, 8 changesets, 24 total revisions searching 8 changesets for largefiles verified contents of 13 revisions of 6 largefiles $ hg -R a-clone1 sum parent: 1:ce8896473775 edit files branch: default commit: (clean) update: 6 new changesets (update) phases: 8 draft $ rm "${USERCACHE}"/* $ hg clone --all-largefiles -U a a-clone-u 11 additional largefiles cached $ hg -R a-clone-u sum parent: -1:000000000000 (no revision checked out) branch: default commit: (clean) update: 8 new changesets (update) phases: 8 draft Show computed destination directory: $ mkdir xyz $ cd xyz $ hg clone ../a destination directory: a updating to branch default getting changed largefiles 3 largefiles updated, 0 removed 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd .. Clone URL without path: $ hg clone file:// abort: repository / not found! [255] Ensure base clone command argument validation $ hg clone -U -u 0 a a-clone-failure abort: cannot specify both --noupdate and --updaterev [255] $ hg clone --all-largefiles a ssh://localhost/a abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a [255] Test pulling with --all-largefiles flag. Also test that the largefiles are downloaded from 'default' instead of 'default-push' when no source is specified (issue3584) $ rm -Rf a-backup $ hg clone -r 1 a a-backup adding changesets adding manifests adding file changes added 2 changesets with 8 changes to 4 files new changesets 30d30fe6a5be:ce8896473775 updating to branch default getting changed largefiles 2 largefiles updated, 0 removed 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm "${USERCACHE}"/* $ cd a-backup $ hg pull --all-largefiles --config paths.default-push=bogus/path pulling from $TESTTMP/a searching for changes adding changesets adding manifests adding file changes added 6 changesets with 16 changes to 8 files new changesets 51a0ae4d5864:daea875e9014 (run 'hg update' to get a working copy) 6 largefiles cached redo pull with --lfrev and check it pulls largefiles for the right revs $ hg rollback repository tip rolled back to revision 1 (undo pull) $ hg pull -v --lfrev 'heads(pulled())+min(pulled())' pulling from $TESTTMP/a searching for changes all local heads known remotely 6 changesets found uncompressed size of bundle content: 1389 (changelog) 1599 (manifests) 254 .hglf/large1 564 .hglf/large3 572 .hglf/sub/large4 182 .hglf/sub2/large6 182 .hglf/sub2/large7 212 normal1 457 normal3 465 sub/normal4 adding changesets adding manifests adding file changes added 6 changesets with 16 changes to 8 files new changesets 51a0ae4d5864:daea875e9014 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles (run 'hg update' to get a working copy) pulling largefiles for revision 7 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store found bb3151689acb10f0c3125c560d5e63df914bc1af in store pulling largefiles for revision 2 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store 0 largefiles cached lfpull $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull 2 largefiles cached $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull pulling largefiles for revision 4 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store pulling largefiles for revision 2 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store 0 largefiles cached $ ls usercache-lfpull/* | sort usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64 $ cd .. Rebasing between two repositories does not revert largefiles to old revisions (this was a very bad bug that took a lot of work to fix). $ hg clone a d updating to branch default getting changed largefiles 3 largefiles updated, 0 removed 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd b $ echo large4-modified > sub/large4 $ echo normal3-modified > normal3 $ hg commit -m "modify normal file and largefile in repo b" Invoking status precommit hook M normal3 M sub/large4 $ cd ../d $ echo large6-modified > sub2/large6 $ echo normal4-modified > sub/normal4 $ hg commit -m "modify normal file largefile in repo d" Invoking status precommit hook M sub/normal4 M sub2/large6 $ cd .. $ hg clone d e updating to branch default getting changed largefiles 3 largefiles updated, 0 removed 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd d More rebase testing, but also test that the largefiles are downloaded from 'default-push' when no source is specified (issue3584). (The largefile from the pulled revision is however not downloaded but found in the local cache.) Largefiles are fetched for the new pulled revision, not for existing revisions, rebased or not. $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ] $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b pulling from $TESTTMP/b searching for changes adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files (+1 heads) new changesets a381d2c8c80e rebasing 8:f574fb32bb45 "modify normal file largefile in repo d" Invoking status precommit hook M sub/normal4 M sub2/large6 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg 0 largefiles cached $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ] $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 9:598410d3eb9a modify normal file largefile in repo d 8:a381d2c8c80e modify normal file and largefile in repo b 7:daea875e9014 add/edit more largefiles 6:4355d653f84f edit files yet again 5:9d5af5072dbd edit files again 4:74c02385b94c move files 3:9e8fbc4bce62 copy files 2:51a0ae4d5864 remove files 1:ce8896473775 edit files 0:30d30fe6a5be add files $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' @ 9:598410d3eb9a modify normal file largefile in repo d | o 8:a381d2c8c80e modify normal file and largefile in repo b | o 7:daea875e9014 add/edit more largefiles | o 6:4355d653f84f edit files yet again | o 5:9d5af5072dbd edit files again | o 4:74c02385b94c move files | o 3:9e8fbc4bce62 copy files | o 2:51a0ae4d5864 remove files | o 1:ce8896473775 edit files | o 0:30d30fe6a5be add files $ cat normal3 normal3-modified $ cat sub/normal4 normal4-modified $ cat sub/large4 large4-modified $ cat sub2/large6 large6-modified $ cat sub2/large7 large7 $ cd ../e $ hg pull ../b pulling from ../b searching for changes adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files (+1 heads) new changesets a381d2c8c80e (run 'hg heads' to see heads, 'hg merge' to merge) $ hg rebase rebasing 8:f574fb32bb45 "modify normal file largefile in repo d" Invoking status precommit hook M sub/normal4 M sub2/large6 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 9:598410d3eb9a modify normal file largefile in repo d 8:a381d2c8c80e modify normal file and largefile in repo b 7:daea875e9014 add/edit more largefiles 6:4355d653f84f edit files yet again 5:9d5af5072dbd edit files again 4:74c02385b94c move files 3:9e8fbc4bce62 copy files 2:51a0ae4d5864 remove files 1:ce8896473775 edit files 0:30d30fe6a5be add files $ cat normal3 normal3-modified $ cat sub/normal4 normal4-modified $ cat sub/large4 large4-modified $ cat sub2/large6 large6-modified $ cat sub2/large7 large7 Log on largefiles - same output $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4 8:a381d2c8c80e modify normal file and largefile in repo b 6:4355d653f84f edit files yet again 5:9d5af5072dbd edit files again 4:74c02385b94c move files $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4 o 8:a381d2c8c80e modify normal file and largefile in repo b : o 6:4355d653f84f edit files yet again | o 5:9d5af5072dbd edit files again | o 4:74c02385b94c move files | ~ $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4 8:a381d2c8c80e modify normal file and largefile in repo b 6:4355d653f84f edit files yet again 5:9d5af5072dbd edit files again 4:74c02385b94c move files $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4 o 8:a381d2c8c80e modify normal file and largefile in repo b : o 6:4355d653f84f edit files yet again | o 5:9d5af5072dbd edit files again | o 4:74c02385b94c move files | ~ - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub 8:a381d2c8c80e modify normal file and largefile in repo b 6:4355d653f84f edit files yet again 5:9d5af5072dbd edit files again 4:74c02385b94c move files 1:ce8896473775 edit files 0:30d30fe6a5be add files $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub o 8:a381d2c8c80e modify normal file and largefile in repo b : o 6:4355d653f84f edit files yet again | o 5:9d5af5072dbd edit files again | o 4:74c02385b94c move files : o 1:ce8896473775 edit files | o 0:30d30fe6a5be add files $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub 9:598410d3eb9a modify normal file largefile in repo d 8:a381d2c8c80e modify normal file and largefile in repo b 6:4355d653f84f edit files yet again 5:9d5af5072dbd edit files again 4:74c02385b94c move files 1:ce8896473775 edit files 0:30d30fe6a5be add files $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub @ 9:598410d3eb9a modify normal file largefile in repo d | o 8:a381d2c8c80e modify normal file and largefile in repo b : o 6:4355d653f84f edit files yet again | o 5:9d5af5072dbd edit files again | o 4:74c02385b94c move files : o 1:ce8896473775 edit files | o 0:30d30fe6a5be add files - globbing gives same result $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*' 9:598410d3eb9a modify normal file largefile in repo d 8:a381d2c8c80e modify normal file and largefile in repo b 6:4355d653f84f edit files yet again 5:9d5af5072dbd edit files again 4:74c02385b94c move files 1:ce8896473775 edit files 0:30d30fe6a5be add files $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*' @ 9:598410d3eb9a modify normal file largefile in repo d | o 8:a381d2c8c80e modify normal file and largefile in repo b : o 6:4355d653f84f edit files yet again | o 5:9d5af5072dbd edit files again | o 4:74c02385b94c move files : o 1:ce8896473775 edit files | o 0:30d30fe6a5be add files Rollback on largefiles. $ echo large4-modified-again > sub/large4 $ hg commit -m "Modify large4 again" Invoking status precommit hook M sub/large4 $ hg rollback repository tip rolled back to revision 9 (undo commit) working directory now based on revision 9 $ hg st M sub/large4 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 9:598410d3eb9a modify normal file largefile in repo d 8:a381d2c8c80e modify normal file and largefile in repo b 7:daea875e9014 add/edit more largefiles 6:4355d653f84f edit files yet again 5:9d5af5072dbd edit files again 4:74c02385b94c move files 3:9e8fbc4bce62 copy files 2:51a0ae4d5864 remove files 1:ce8896473775 edit files 0:30d30fe6a5be add files $ cat sub/large4 large4-modified-again "update --check" refuses to update with uncommitted changes. $ hg update --check 8 abort: uncommitted changes [255] "update --clean" leaves correct largefiles in working copy, even when there is .orig files from revert in .hglf. $ echo mistake > sub2/large7 $ hg revert sub2/large7 $ cat sub2/large7 large7 $ cat sub2/large7.orig mistake $ test ! -f .hglf/sub2/large7.orig $ hg -q update --clean -r null $ hg update --clean getting changed largefiles 3 largefiles updated, 0 removed 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat normal3 normal3-modified $ cat sub/normal4 normal4-modified $ cat sub/large4 large4-modified $ cat sub2/large6 large6-modified $ cat sub2/large7 large7 $ cat sub2/large7.orig mistake $ test ! -f .hglf/sub2/large7.orig verify that largefile .orig file no longer is overwritten on every update -C: $ hg update --clean 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat sub2/large7.orig mistake $ rm sub2/large7.orig Now "update check" is happy. $ hg update --check 8 getting changed largefiles 1 largefiles updated, 0 removed 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg update --check getting changed largefiles 1 largefiles updated, 0 removed 2 files updated, 0 files merged, 0 files removed, 0 files unresolved Test removing empty largefiles directories on update $ test -d sub2 && echo "sub2 exists" sub2 exists $ hg update -q null $ test -d sub2 && echo "error: sub2 should not exist anymore" [1] $ hg update -q Test hg remove removes empty largefiles directories $ test -d sub2 && echo "sub2 exists" sub2 exists $ hg remove sub2/* $ test -d sub2 && echo "error: sub2 should not exist anymore" [1] $ hg revert sub2/large6 sub2/large7 "revert" works on largefiles (and normal files too). $ echo hack3 >> normal3 $ echo hack4 >> sub/normal4 $ echo hack4 >> sub/large4 $ rm sub2/large6 $ hg revert sub2/large6 $ hg rm sub2/large6 $ echo new >> sub2/large8 $ hg add --large sub2/large8 # XXX we don't really want to report that we're reverting the standin; # that's just an implementation detail. But I don't see an obvious fix. ;-( $ hg revert sub reverting .hglf/sub/large4 reverting sub/normal4 $ hg status M normal3 A sub2/large8 R sub2/large6 ? sub/large4.orig ? sub/normal4.orig $ cat sub/normal4 normal4-modified $ cat sub/large4 large4-modified $ hg revert -a --no-backup undeleting .hglf/sub2/large6 forgetting .hglf/sub2/large8 reverting normal3 $ hg status ? sub/large4.orig ? sub/normal4.orig ? sub2/large8 $ cat normal3 normal3-modified $ cat sub2/large6 large6-modified $ rm sub/*.orig sub2/large8 revert some files to an older revision $ hg revert --no-backup -r 8 sub2 reverting .hglf/sub2/large6 $ cat sub2/large6 large6 $ hg revert --no-backup -C -r '.^' sub2 $ hg revert --no-backup sub2 reverting .hglf/sub2/large6 $ hg status "verify --large" actually verifies largefiles - Where Do We Come From? What Are We? Where Are We Going? $ pwd $TESTTMP/e $ hg paths default = $TESTTMP/d $ hg verify --large checking changesets checking manifests crosschecking files in changesets and manifests checking files 10 files, 10 changesets, 28 total revisions searching 1 changesets for largefiles verified existence of 3 revisions of 3 largefiles - introduce missing blob in local store repo and remote store and make sure that this is caught: $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 . $ rm .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 $ hg verify --large checking changesets checking manifests crosschecking files in changesets and manifests checking files 10 files, 10 changesets, 28 total revisions searching 1 changesets for largefiles changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 verified existence of 3 revisions of 3 largefiles [1] - introduce corruption and make sure that it is caught when checking content: $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 $ hg verify -q --large --lfc changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 [1] - cleanup $ cp e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/ $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 .hg/largefiles/ - verifying all revisions will fail because we didn't clone all largefiles to d: $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 $ hg verify -q --lfa --lfc changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 [1] - cleanup $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 $ rm -f .hglf/sub/*.orig Update to revision with missing largefile - and make sure it really is missing $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0 $ hg up -r 6 getting changed largefiles large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob) 1 largefiles updated, 2 removed 4 files updated, 0 files merged, 2 files removed, 0 files unresolved $ rm normal3 $ echo >> sub/normal4 $ hg ci -m 'commit with missing files' Invoking status precommit hook M sub/normal4 ! large3 ! normal3 created new head $ hg st ! large3 ! normal3 $ hg up -r. 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg st ! large3 ! normal3 $ hg up -Cr. getting changed largefiles large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob) 0 largefiles updated, 0 removed 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg st ! large3 $ hg rollback repository tip rolled back to revision 9 (undo commit) working directory now based on revision 6 Merge with revision with missing largefile - and make sure it tries to fetch it. $ hg up -Cqr null $ echo f > f $ hg ci -Am branch adding f Invoking status precommit hook A f created new head $ hg merge -r 6 getting changed largefiles large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob) 1 largefiles updated, 0 removed 4 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg rollback -q $ hg up -Cq Pulling 0 revisions with --all-largefiles should not fetch for all revisions $ hg pull --all-largefiles pulling from $TESTTMP/d searching for changes no changes found Merging does not revert to old versions of largefiles and also check that merging after having pulled from a non-default remote works correctly. $ cd .. $ hg clone -r 7 e temp adding changesets adding manifests adding file changes added 8 changesets with 24 changes to 10 files new changesets 30d30fe6a5be:daea875e9014 updating to branch default getting changed largefiles 3 largefiles updated, 0 removed 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg clone temp f updating to branch default getting changed largefiles 3 largefiles updated, 0 removed 5 files updated, 0 files merged, 0 files removed, 0 files unresolved # Delete the largefiles in the largefiles system cache so that we have an # opportunity to test that caching after a pull works. $ rm "${USERCACHE}"/* $ cd f $ echo "large4-merge-test" > sub/large4 $ hg commit -m "Modify large4 to test merge" Invoking status precommit hook M sub/large4 # Test --cache-largefiles flag $ hg pull --lfrev 'heads(pulled())' ../e pulling from ../e searching for changes adding changesets adding manifests adding file changes added 2 changesets with 4 changes to 4 files (+1 heads) new changesets a381d2c8c80e:598410d3eb9a (run 'hg heads' to see heads, 'hg merge' to merge) 2 largefiles cached $ hg merge largefile sub/large4 has a merge conflict ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591 keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l getting changed largefiles 1 largefiles updated, 0 removed 3 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg commit -m "Merge repos e and f" Invoking status precommit hook M normal3 M sub/normal4 M sub2/large6 $ cat normal3 normal3-modified $ cat sub/normal4 normal4-modified $ cat sub/large4 large4-merge-test $ cat sub2/large6 large6-modified $ cat sub2/large7 large7 Test status after merging with a branch that introduces a new largefile: $ echo large > large $ hg add --large large $ hg commit -m 'add largefile' Invoking status precommit hook A large $ hg update -q ".^" $ echo change >> normal3 $ hg commit -m 'some change' Invoking status precommit hook M normal3 created new head $ hg merge getting changed largefiles 1 largefiles updated, 0 removed 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg status M large - make sure update of merge with removed largefiles fails as expected $ hg rm sub2/large6 $ hg up -r. abort: outstanding uncommitted merge [255] - revert should be able to revert files introduced in a pending merge $ hg revert --all -r . removing .hglf/large undeleting .hglf/sub2/large6 Test that a normal file and a largefile with the same name and path cannot coexist. $ rm sub2/large7 $ echo "largeasnormal" > sub2/large7 $ hg add sub2/large7 sub2/large7 already a largefile Test that transplanting a largefile change works correctly. $ cd .. $ hg clone -r 8 d g adding changesets adding manifests adding file changes added 9 changesets with 26 changes to 10 files new changesets 30d30fe6a5be:a381d2c8c80e updating to branch default getting changed largefiles 3 largefiles updated, 0 removed 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd g $ hg transplant -s ../d 598410d3eb9a searching for changes searching for changes adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files new changesets 598410d3eb9a $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 9:598410d3eb9a modify normal file largefile in repo d 8:a381d2c8c80e modify normal file and largefile in repo b 7:daea875e9014 add/edit more largefiles 6:4355d653f84f edit files yet again 5:9d5af5072dbd edit files again 4:74c02385b94c move files 3:9e8fbc4bce62 copy files 2:51a0ae4d5864 remove files 1:ce8896473775 edit files 0:30d30fe6a5be add files $ cat normal3 normal3-modified $ cat sub/normal4 normal4-modified $ cat sub/large4 large4-modified $ cat sub2/large6 large6-modified $ cat sub2/large7 large7 Cat a largefile $ hg cat normal3 normal3-modified $ hg cat sub/large4 large4-modified $ rm "${USERCACHE}"/* $ hg cat -r a381d2c8c80e -o cat.out sub/large4 $ cat cat.out large4-modified $ rm cat.out $ hg cat -r a381d2c8c80e normal3 normal3-modified $ hg cat -r '.^' normal3 normal3-modified $ hg cat -r '.^' sub/large4 doesntexist large4-modified doesntexist: no such file in rev a381d2c8c80e $ hg --cwd sub cat -r '.^' large4 large4-modified $ hg --cwd sub cat -r '.^' ../normal3 normal3-modified Cat a standin $ hg cat .hglf/sub/large4 e166e74c7303192238d60af5a9c4ce9bef0b7928 $ hg cat .hglf/normal3 .hglf/normal3: no such file in rev 598410d3eb9a [1] Test that renaming a largefile results in correct output for status $ hg rename sub/large4 large4-renamed $ hg commit -m "test rename output" Invoking status precommit hook A large4-renamed R sub/large4 $ cat large4-renamed large4-modified $ cd sub2 $ hg rename large6 large6-renamed $ hg st A sub2/large6-renamed R sub2/large6 $ cd .. Test --normal flag $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null $ hg add --normal --large new-largefile abort: --normal cannot be used with --large [255] $ hg add --normal new-largefile new-largefile: up to 69 MB of RAM may be required to manage this file (use 'hg revert new-largefile' to cancel the pending addition) Test explicit commit of switch between normal and largefile - make sure both the add and the remove is committed. $ hg up -qC $ hg forget normal3 large4-renamed $ hg add --large normal3 $ hg add large4-renamed $ hg commit -m 'swap' normal3 large4-renamed Invoking status precommit hook A large4-renamed A normal3 ? new-largefile ? sub2/large6-renamed $ hg mani .hglf/normal3 .hglf/sub2/large6 .hglf/sub2/large7 large4-renamed sub/normal4 $ cd .. mercurial-4.5.3/tests/test-commit-interactive.t0000644015407300116100000011045713261161234021514 0ustar augieeng00000000000000Set up a repo $ cat <> $HGRCPATH > [ui] > interactive = true > [extensions] > record = > EOF $ hg init a $ cd a Select no files $ touch empty-rw $ hg add empty-rw $ hg record --config ui.interactive=false abort: running non-interactively, use commit instead [255] $ hg commit -i --config ui.interactive=false abort: running non-interactively [255] $ hg commit -i empty-rw< n > EOF diff --git a/empty-rw b/empty-rw new file mode 100644 examine changes to 'empty-rw'? [Ynesfdaq?] n no changes to record [1] $ hg tip -p changeset: -1:000000000000 tag: tip user: date: Thu Jan 01 00:00:00 1970 +0000 Select files but no hunks $ hg commit -i empty-rw< y > n > EOF diff --git a/empty-rw b/empty-rw new file mode 100644 examine changes to 'empty-rw'? [Ynesfdaq?] y abort: empty commit message [255] $ hg tip -p changeset: -1:000000000000 tag: tip user: date: Thu Jan 01 00:00:00 1970 +0000 Abort for untracked $ touch untracked $ hg commit -i -m should-fail empty-rw untracked abort: untracked: file not tracked! [255] $ rm untracked Record empty file $ hg commit -i -d '0 0' -m empty empty-rw< y > y > EOF diff --git a/empty-rw b/empty-rw new file mode 100644 examine changes to 'empty-rw'? [Ynesfdaq?] y $ hg tip -p changeset: 0:c0708cf4e46e tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: empty Summary shows we updated to the new cset $ hg summary parent: 0:c0708cf4e46e tip empty branch: default commit: (clean) update: (current) phases: 1 draft Rename empty file $ hg mv empty-rw empty-rename $ hg commit -i -d '1 0' -m rename< y > EOF diff --git a/empty-rw b/empty-rename rename from empty-rw rename to empty-rename examine changes to 'empty-rw' and 'empty-rename'? [Ynesfdaq?] y $ hg tip -p changeset: 1:d695e8dcb197 tag: tip user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: rename Copy empty file $ hg cp empty-rename empty-copy $ hg commit -i -d '2 0' -m copy< y > EOF diff --git a/empty-rename b/empty-copy copy from empty-rename copy to empty-copy examine changes to 'empty-rename' and 'empty-copy'? [Ynesfdaq?] y $ hg tip -p changeset: 2:1d4b90bea524 tag: tip user: test date: Thu Jan 01 00:00:02 1970 +0000 summary: copy Delete empty file $ hg rm empty-copy $ hg commit -i -d '3 0' -m delete< y > EOF diff --git a/empty-copy b/empty-copy deleted file mode 100644 examine changes to 'empty-copy'? [Ynesfdaq?] y $ hg tip -p changeset: 3:b39a238f01a1 tag: tip user: test date: Thu Jan 01 00:00:03 1970 +0000 summary: delete Add binary file $ hg bundle --type v1 --base -2 tip.bundle 1 changesets found $ hg add tip.bundle $ hg commit -i -d '4 0' -m binary< y > EOF diff --git a/tip.bundle b/tip.bundle new file mode 100644 this is a binary file examine changes to 'tip.bundle'? [Ynesfdaq?] y $ hg tip -p changeset: 4:ad816da3711e tag: tip user: test date: Thu Jan 01 00:00:04 1970 +0000 summary: binary diff -r b39a238f01a1 -r ad816da3711e tip.bundle Binary file tip.bundle has changed Change binary file $ hg bundle --base -2 --type v1 tip.bundle 1 changesets found $ hg commit -i -d '5 0' -m binary-change< y > EOF diff --git a/tip.bundle b/tip.bundle this modifies a binary file (all or nothing) examine changes to 'tip.bundle'? [Ynesfdaq?] y $ hg tip -p changeset: 5:dccd6f3eb485 tag: tip user: test date: Thu Jan 01 00:00:05 1970 +0000 summary: binary-change diff -r ad816da3711e -r dccd6f3eb485 tip.bundle Binary file tip.bundle has changed Rename and change binary file $ hg mv tip.bundle top.bundle $ hg bundle --base -2 --type v1 top.bundle 1 changesets found $ hg commit -i -d '6 0' -m binary-change-rename< y > EOF diff --git a/tip.bundle b/top.bundle rename from tip.bundle rename to top.bundle this modifies a binary file (all or nothing) examine changes to 'tip.bundle' and 'top.bundle'? [Ynesfdaq?] y $ hg tip -p changeset: 6:7fa44105f5b3 tag: tip user: test date: Thu Jan 01 00:00:06 1970 +0000 summary: binary-change-rename diff -r dccd6f3eb485 -r 7fa44105f5b3 tip.bundle Binary file tip.bundle has changed diff -r dccd6f3eb485 -r 7fa44105f5b3 top.bundle Binary file top.bundle has changed Add plain file $ for i in 1 2 3 4 5 6 7 8 9 10; do > echo $i >> plain > done $ hg add plain $ hg commit -i -d '7 0' -m plain plain< y > y > EOF diff --git a/plain b/plain new file mode 100644 examine changes to 'plain'? [Ynesfdaq?] y @@ -0,0 +1,10 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 record this change to 'plain'? [Ynesfdaq?] y $ hg tip -p changeset: 7:11fb457c1be4 tag: tip user: test date: Thu Jan 01 00:00:07 1970 +0000 summary: plain diff -r 7fa44105f5b3 -r 11fb457c1be4 plain --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plain Thu Jan 01 00:00:07 1970 +0000 @@ -0,0 +1,10 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 Modify end of plain file with username unset $ echo 11 >> plain $ unset HGUSER $ hg commit -i --config ui.username= -d '8 0' -m end plain abort: no username supplied (use 'hg config --edit' to set your username) [255] Modify end of plain file, also test that diffopts are accounted for $ HGUSER="test" $ export HGUSER $ hg commit -i --config diff.showfunc=true -d '8 0' -m end plain < y > y > EOF diff --git a/plain b/plain 1 hunks, 1 lines changed examine changes to 'plain'? [Ynesfdaq?] y @@ -8,3 +8,4 @@ 7 8 9 10 +11 record this change to 'plain'? [Ynesfdaq?] y Modify end of plain file, no EOL $ hg tip --template '{node}' >> plain $ hg commit -i -d '9 0' -m noeol plain < y > y > EOF diff --git a/plain b/plain 1 hunks, 1 lines changed examine changes to 'plain'? [Ynesfdaq?] y @@ -9,3 +9,4 @@ 8 9 10 11 +7264f99c5f5ff3261504828afa4fb4d406c3af54 \ No newline at end of file record this change to 'plain'? [Ynesfdaq?] y Record showfunc should preserve function across sections $ cat > f1.py < def annotate(ui, repo, *pats, **opts): > """show changeset information by line for each file > > List changes in files, showing the revision id responsible for > each line. > > This command is useful for discovering when a change was made and > by whom. > > If you include -f/-u/-d, the revision number is suppressed unless > you also include -the revision number is suppressed unless > you also include -n. > > 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. > > Returns 0 on success. > """ > return 0 > def archive(ui, repo, dest, **opts): > '''create an unversioned archive of a repository revision > > By default, the revision used is the parent of the working > directory; use -r/--rev to specify a different revision. > > The archive type is automatically detected based on file > extension (to override, use -t/--type). > > .. container:: verbose > > Valid types are: > EOF $ hg add f1.py $ hg commit -m funcs $ cat > f1.py < def annotate(ui, repo, *pats, **opts): > """show changeset information by line for each file > > List changes in files, showing the revision id responsible for > each line > > This command is useful for discovering when a change was made and > by whom. > > 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. > > Returns 0 on success. > """ > return 0 > def archive(ui, repo, dest, **opts): > '''create an unversioned archive of a repository revision > > By default, the revision used is the parent of the working > directory; use -r/--rev to specify a different revision. > > The archive type is automatically detected based on file > extension (or override using -t/--type). > > .. container:: verbose > > Valid types are: > EOF $ hg commit -i -m interactive < y > y > y > y > EOF diff --git a/f1.py b/f1.py 3 hunks, 6 lines changed examine changes to 'f1.py'? [Ynesfdaq?] y @@ -2,8 +2,8 @@ def annotate(ui, repo, *pats, **opts): """show changeset information by line for each file List changes in files, showing the revision id responsible for - each line. + each line This command is useful for discovering when a change was made and by whom. record change 1/3 to 'f1.py'? [Ynesfdaq?] y @@ -6,11 +6,7 @@ def annotate(ui, repo, *pats, **opts): This command is useful for discovering when a change was made and by whom. - If you include -f/-u/-d, the revision number is suppressed unless - you also include -the revision number is suppressed unless - you also include -n. - 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 record change 2/3 to 'f1.py'? [Ynesfdaq?] y @@ -26,7 +22,7 @@ def archive(ui, repo, dest, **opts): directory; use -r/--rev to specify a different revision. The archive type is automatically detected based on file - extension (to override, use -t/--type). + extension (or override using -t/--type). .. container:: verbose record change 3/3 to 'f1.py'? [Ynesfdaq?] y Modify end of plain file, add EOL $ echo >> plain $ echo 1 > plain2 $ hg add plain2 $ hg commit -i -d '10 0' -m eol plain plain2 < y > y > y > y > EOF diff --git a/plain b/plain 1 hunks, 1 lines changed examine changes to 'plain'? [Ynesfdaq?] y @@ -9,4 +9,4 @@ 8 9 10 11 -7264f99c5f5ff3261504828afa4fb4d406c3af54 \ No newline at end of file +7264f99c5f5ff3261504828afa4fb4d406c3af54 record change 1/2 to 'plain'? [Ynesfdaq?] y diff --git a/plain2 b/plain2 new file mode 100644 examine changes to 'plain2'? [Ynesfdaq?] y @@ -0,0 +1,1 @@ +1 record change 2/2 to 'plain2'? [Ynesfdaq?] y Modify beginning, trim end, record both, add another file to test changes numbering $ rm plain $ for i in 2 2 3 4 5 6 7 8 9 10; do > echo $i >> plain > done $ echo 2 >> plain2 $ hg commit -i -d '10 0' -m begin-and-end plain plain2 < y > y > y > y > y > EOF diff --git a/plain b/plain 2 hunks, 3 lines changed examine changes to 'plain'? [Ynesfdaq?] y @@ -1,4 +1,4 @@ -1 +2 2 3 4 record change 1/3 to 'plain'? [Ynesfdaq?] y @@ -8,5 +8,3 @@ 7 8 9 10 -11 -7264f99c5f5ff3261504828afa4fb4d406c3af54 record change 2/3 to 'plain'? [Ynesfdaq?] y diff --git a/plain2 b/plain2 1 hunks, 1 lines changed examine changes to 'plain2'? [Ynesfdaq?] y @@ -1,1 +1,2 @@ 1 +2 record change 3/3 to 'plain2'? [Ynesfdaq?] y $ hg tip -p changeset: 13:f941910cff62 tag: tip user: test date: Thu Jan 01 00:00:10 1970 +0000 summary: begin-and-end diff -r 33abe24d946c -r f941910cff62 plain --- a/plain Thu Jan 01 00:00:10 1970 +0000 +++ b/plain Thu Jan 01 00:00:10 1970 +0000 @@ -1,4 +1,4 @@ -1 +2 2 3 4 @@ -8,5 +8,3 @@ 8 9 10 -11 -7264f99c5f5ff3261504828afa4fb4d406c3af54 diff -r 33abe24d946c -r f941910cff62 plain2 --- a/plain2 Thu Jan 01 00:00:10 1970 +0000 +++ b/plain2 Thu Jan 01 00:00:10 1970 +0000 @@ -1,1 +1,2 @@ 1 +2 Trim beginning, modify end $ rm plain > for i in 4 5 6 7 8 9 10.new; do > echo $i >> plain > done Record end $ hg commit -i -d '11 0' -m end-only plain < y > n > y > EOF diff --git a/plain b/plain 2 hunks, 4 lines changed examine changes to 'plain'? [Ynesfdaq?] y @@ -1,9 +1,6 @@ -2 -2 -3 4 5 6 7 8 9 record change 1/2 to 'plain'? [Ynesfdaq?] n @@ -4,7 +1,7 @@ 4 5 6 7 8 9 -10 +10.new record change 2/2 to 'plain'? [Ynesfdaq?] y $ hg tip -p changeset: 14:4915f538659b tag: tip user: test date: Thu Jan 01 00:00:11 1970 +0000 summary: end-only diff -r f941910cff62 -r 4915f538659b plain --- a/plain Thu Jan 01 00:00:10 1970 +0000 +++ b/plain Thu Jan 01 00:00:11 1970 +0000 @@ -7,4 +7,4 @@ 7 8 9 -10 +10.new Record beginning $ hg commit -i -d '12 0' -m begin-only plain < y > y > EOF diff --git a/plain b/plain 1 hunks, 3 lines changed examine changes to 'plain'? [Ynesfdaq?] y @@ -1,6 +1,3 @@ -2 -2 -3 4 5 6 record this change to 'plain'? [Ynesfdaq?] y $ hg tip -p changeset: 15:1b1f93d4b94b tag: tip user: test date: Thu Jan 01 00:00:12 1970 +0000 summary: begin-only diff -r 4915f538659b -r 1b1f93d4b94b plain --- a/plain Thu Jan 01 00:00:11 1970 +0000 +++ b/plain Thu Jan 01 00:00:12 1970 +0000 @@ -1,6 +1,3 @@ -2 -2 -3 4 5 6 Add to beginning, trim from end $ rm plain $ for i in 1 2 3 4 5 6 7 8 9; do > echo $i >> plain > done Record end $ hg commit -i --traceback -d '13 0' -m end-again plain< y > n > y > EOF diff --git a/plain b/plain 2 hunks, 4 lines changed examine changes to 'plain'? [Ynesfdaq?] y @@ -1,6 +1,9 @@ +1 +2 +3 4 5 6 7 8 9 record change 1/2 to 'plain'? [Ynesfdaq?] n @@ -1,7 +4,6 @@ 4 5 6 7 8 9 -10.new record change 2/2 to 'plain'? [Ynesfdaq?] y Add to beginning, middle, end $ rm plain $ for i in 1 2 3 4 5 5.new 5.reallynew 6 7 8 9 10 11; do > echo $i >> plain > done Record beginning, middle, and test that format-breaking diffopts are ignored $ hg commit -i --config diff.noprefix=True -d '14 0' -m middle-only plain < y > y > y > n > EOF diff --git a/plain b/plain 3 hunks, 7 lines changed examine changes to 'plain'? [Ynesfdaq?] y @@ -1,2 +1,5 @@ +1 +2 +3 4 5 record change 1/3 to 'plain'? [Ynesfdaq?] y @@ -1,6 +4,8 @@ 4 5 +5.new +5.reallynew 6 7 8 9 record change 2/3 to 'plain'? [Ynesfdaq?] y @@ -3,4 +8,6 @@ 6 7 8 9 +10 +11 record change 3/3 to 'plain'? [Ynesfdaq?] n $ hg tip -p changeset: 17:41cf3f5c55ae tag: tip user: test date: Thu Jan 01 00:00:14 1970 +0000 summary: middle-only diff -r a69d252246e1 -r 41cf3f5c55ae plain --- a/plain Thu Jan 01 00:00:13 1970 +0000 +++ b/plain Thu Jan 01 00:00:14 1970 +0000 @@ -1,5 +1,10 @@ +1 +2 +3 4 5 +5.new +5.reallynew 6 7 8 Record end $ hg commit -i -d '15 0' -m end-only plain < y > y > EOF diff --git a/plain b/plain 1 hunks, 2 lines changed examine changes to 'plain'? [Ynesfdaq?] y @@ -9,3 +9,5 @@ 6 7 8 9 +10 +11 record this change to 'plain'? [Ynesfdaq?] y $ hg tip -p changeset: 18:58a72f46bc24 tag: tip user: test date: Thu Jan 01 00:00:15 1970 +0000 summary: end-only diff -r 41cf3f5c55ae -r 58a72f46bc24 plain --- a/plain Thu Jan 01 00:00:14 1970 +0000 +++ b/plain Thu Jan 01 00:00:15 1970 +0000 @@ -9,3 +9,5 @@ 7 8 9 +10 +11 $ mkdir subdir $ cd subdir $ echo a > a $ hg ci -d '16 0' -Amsubdir adding subdir/a $ echo a >> a $ hg commit -i -d '16 0' -m subdir-change a < y > y > EOF diff --git a/subdir/a b/subdir/a 1 hunks, 1 lines changed examine changes to 'subdir/a'? [Ynesfdaq?] y @@ -1,1 +1,2 @@ a +a record this change to 'subdir/a'? [Ynesfdaq?] y $ hg tip -p changeset: 20:e0f6b99f6c49 tag: tip user: test date: Thu Jan 01 00:00:16 1970 +0000 summary: subdir-change diff -r abd26b51de37 -r e0f6b99f6c49 subdir/a --- a/subdir/a Thu Jan 01 00:00:16 1970 +0000 +++ b/subdir/a Thu Jan 01 00:00:16 1970 +0000 @@ -1,1 +1,2 @@ a +a $ echo a > f1 $ echo b > f2 $ hg add f1 f2 $ hg ci -mz -d '17 0' $ echo a >> f1 $ echo b >> f2 Help, quit $ hg commit -i < ? > q > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed examine changes to 'subdir/f1'? [Ynesfdaq?] ? y - yes, record this change n - no, 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) examine changes to 'subdir/f1'? [Ynesfdaq?] q abort: user quit [255] #if gettext Test translated help message str.lower() instead of encoding.lower(str) on translated message might make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z) as the second or later byte of multi-byte character. For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932) contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this replacement makes message meaningless. This tests that translated help message is lower()-ed correctly. $ LANGUAGE=ja $ export LANGUAGE $ cat > $TESTTMP/escape.py < from __future__ import absolute_import > import sys > def escape(c): > o = ord(c) > if o < 0x80: > return c > else: > return r'\x%02x' % o # escape char setting MSB > for l in sys.stdin: > sys.stdout.write(''.join(escape(c) for c in l)) > EOF $ hg commit -i --encoding cp932 2>&1 < ? > q > EOF y - \x82\xb1\x82\xcc\x95\xcf\x8dX\x82\xf0\x8bL\x98^(yes) $ LANGUAGE= #endif Skip $ hg commit -i < s > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed examine changes to 'subdir/f1'? [Ynesfdaq?] s diff --git a/subdir/f2 b/subdir/f2 1 hunks, 1 lines changed examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected [255] No $ hg commit -i < n > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed examine changes to 'subdir/f1'? [Ynesfdaq?] n diff --git a/subdir/f2 b/subdir/f2 1 hunks, 1 lines changed examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected [255] f, quit $ hg commit -i < f > q > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed examine changes to 'subdir/f1'? [Ynesfdaq?] f diff --git a/subdir/f2 b/subdir/f2 1 hunks, 1 lines changed examine changes to 'subdir/f2'? [Ynesfdaq?] q abort: user quit [255] s, all $ hg commit -i -d '18 0' -mx < s > a > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed examine changes to 'subdir/f1'? [Ynesfdaq?] s diff --git a/subdir/f2 b/subdir/f2 1 hunks, 1 lines changed examine changes to 'subdir/f2'? [Ynesfdaq?] a $ hg tip -p changeset: 22:6afbbefacf35 tag: tip user: test date: Thu Jan 01 00:00:18 1970 +0000 summary: x diff -r b73c401c693c -r 6afbbefacf35 subdir/f2 --- a/subdir/f2 Thu Jan 01 00:00:17 1970 +0000 +++ b/subdir/f2 Thu Jan 01 00:00:18 1970 +0000 @@ -1,1 +1,2 @@ b +b f $ hg commit -i -d '19 0' -my < f > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed examine changes to 'subdir/f1'? [Ynesfdaq?] f $ hg tip -p changeset: 23:715028a33949 tag: tip user: test date: Thu Jan 01 00:00:19 1970 +0000 summary: y diff -r 6afbbefacf35 -r 715028a33949 subdir/f1 --- a/subdir/f1 Thu Jan 01 00:00:18 1970 +0000 +++ b/subdir/f1 Thu Jan 01 00:00:19 1970 +0000 @@ -1,1 +1,2 @@ a +a #if execbit Preserve chmod +x $ chmod +x f1 $ echo a >> f1 $ hg commit -i -d '20 0' -mz < y > y > y > EOF diff --git a/subdir/f1 b/subdir/f1 old mode 100644 new mode 100755 1 hunks, 1 lines changed examine changes to 'subdir/f1'? [Ynesfdaq?] y @@ -1,2 +1,3 @@ a a +a record this change to 'subdir/f1'? [Ynesfdaq?] y $ hg tip --config diff.git=True -p changeset: 24:db967c1e5884 tag: tip user: test date: Thu Jan 01 00:00:20 1970 +0000 summary: z diff --git a/subdir/f1 b/subdir/f1 old mode 100644 new mode 100755 --- a/subdir/f1 +++ b/subdir/f1 @@ -1,2 +1,3 @@ a a +a Preserve execute permission on original $ echo b >> f1 $ hg commit -i -d '21 0' -maa < y > y > y > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed examine changes to 'subdir/f1'? [Ynesfdaq?] y @@ -1,3 +1,4 @@ a a a +b record this change to 'subdir/f1'? [Ynesfdaq?] y $ hg tip --config diff.git=True -p changeset: 25:88903aef81c3 tag: tip user: test date: Thu Jan 01 00:00:21 1970 +0000 summary: aa diff --git a/subdir/f1 b/subdir/f1 --- a/subdir/f1 +++ b/subdir/f1 @@ -1,3 +1,4 @@ a a a +b Preserve chmod -x $ chmod -x f1 $ echo c >> f1 $ hg commit -i -d '22 0' -mab < y > y > y > EOF diff --git a/subdir/f1 b/subdir/f1 old mode 100755 new mode 100644 1 hunks, 1 lines changed examine changes to 'subdir/f1'? [Ynesfdaq?] y @@ -2,3 +2,4 @@ a a a b +c record this change to 'subdir/f1'? [Ynesfdaq?] y $ hg tip --config diff.git=True -p changeset: 26:7af84b6cf560 tag: tip user: test date: Thu Jan 01 00:00:22 1970 +0000 summary: ab diff --git a/subdir/f1 b/subdir/f1 old mode 100755 new mode 100644 --- a/subdir/f1 +++ b/subdir/f1 @@ -2,3 +2,4 @@ a a b +c #else Slightly bogus tests to get almost same repo structure as when x bit is used - but with different hashes. Mock "Preserve chmod +x" $ echo a >> f1 $ hg commit -i -d '20 0' -mz < y > y > y > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed examine changes to 'subdir/f1'? [Ynesfdaq?] y @@ -1,2 +1,3 @@ a a +a record this change to 'subdir/f1'? [Ynesfdaq?] y $ hg tip --config diff.git=True -p changeset: 24:c26cfe2c4eb0 tag: tip user: test date: Thu Jan 01 00:00:20 1970 +0000 summary: z diff --git a/subdir/f1 b/subdir/f1 --- a/subdir/f1 +++ b/subdir/f1 @@ -1,2 +1,3 @@ a a +a Mock "Preserve execute permission on original" $ echo b >> f1 $ hg commit -i -d '21 0' -maa < y > y > y > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed examine changes to 'subdir/f1'? [Ynesfdaq?] y @@ -1,3 +1,4 @@ a a a +b record this change to 'subdir/f1'? [Ynesfdaq?] y $ hg tip --config diff.git=True -p changeset: 25:a48d2d60adde tag: tip user: test date: Thu Jan 01 00:00:21 1970 +0000 summary: aa diff --git a/subdir/f1 b/subdir/f1 --- a/subdir/f1 +++ b/subdir/f1 @@ -1,3 +1,4 @@ a a a +b Mock "Preserve chmod -x" $ chmod -x f1 $ echo c >> f1 $ hg commit -i -d '22 0' -mab < y > y > y > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed examine changes to 'subdir/f1'? [Ynesfdaq?] y @@ -2,3 +2,4 @@ a a a b +c record this change to 'subdir/f1'? [Ynesfdaq?] y $ hg tip --config diff.git=True -p changeset: 26:5cc89ae210fa tag: tip user: test date: Thu Jan 01 00:00:22 1970 +0000 summary: ab diff --git a/subdir/f1 b/subdir/f1 --- a/subdir/f1 +++ b/subdir/f1 @@ -2,3 +2,4 @@ a a b +c #endif $ cd .. Abort early when a merge is in progress $ hg up 4 1 files updated, 0 files merged, 7 files removed, 0 files unresolved $ touch iwillmergethat $ hg add iwillmergethat $ hg branch thatbranch marked working directory as branch thatbranch (branches are permanent and global, did you want a bookmark?) $ hg ci -m'new head' $ hg up default 7 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg merge thatbranch 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg commit -i -m'will abort' abort: cannot partially commit a merge (use "hg commit" instead) [255] $ hg up -C 0 files updated, 0 files merged, 1 files removed, 0 files unresolved Editing patch (and ignoring trailing text) $ cat > editor.sh << '__EOF__' > sed -e 7d -e '5s/^-/ /' -e '/^# ---/i\ > trailing\nditto' "$1" > tmp > mv tmp "$1" > __EOF__ $ cat > editedfile << '__EOF__' > This is the first line > This is the second line > This is the third line > __EOF__ $ hg add editedfile $ hg commit -medit-patch-1 $ cat > editedfile << '__EOF__' > This line has changed > This change will be committed > This is the third line > __EOF__ $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-2 < y > e > EOF diff --git a/editedfile b/editedfile 1 hunks, 2 lines changed examine changes to 'editedfile'? [Ynesfdaq?] y @@ -1,3 +1,3 @@ -This is the first line -This is the second line +This line has changed +This change will be committed This is the third line record this change to 'editedfile'? [Ynesfdaq?] e $ cat editedfile This line has changed This change will be committed This is the third line $ hg cat -r tip editedfile This is the first line This change will be committed This is the third line $ hg revert editedfile Trying to edit patch for whole file $ echo "This is the fourth line" >> editedfile $ hg commit -i < e > q > EOF diff --git a/editedfile b/editedfile 1 hunks, 1 lines changed examine changes to 'editedfile'? [Ynesfdaq?] e cannot edit patch for whole file examine changes to 'editedfile'? [Ynesfdaq?] q abort: user quit [255] $ hg revert editedfile Removing changes from patch $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp $ mv tmp editedfile $ echo "This line has been added" >> editedfile $ cat > editor.sh << '__EOF__' > sed -e 's/^[-+]/ /' "$1" > tmp > mv tmp "$1" > __EOF__ $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i < y > e > EOF diff --git a/editedfile b/editedfile 1 hunks, 3 lines changed examine changes to 'editedfile'? [Ynesfdaq?] y @@ -1,3 +1,3 @@ -This is the first line -This change will be committed -This is the third line +This change will not be committed +This is the second line +This line has been added record this change to 'editedfile'? [Ynesfdaq?] e no changes to record [1] $ cat editedfile This change will not be committed This is the second line This line has been added $ hg cat -r tip editedfile This is the first line This change will be committed This is the third line $ hg revert editedfile Invalid patch $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp $ mv tmp editedfile $ echo "This line has been added" >> editedfile $ cat > editor.sh << '__EOF__' > sed s/This/That/ "$1" > tmp > mv tmp "$1" > __EOF__ $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i < y > e > EOF diff --git a/editedfile b/editedfile 1 hunks, 3 lines changed examine changes to 'editedfile'? [Ynesfdaq?] y @@ -1,3 +1,3 @@ -This is the first line -This change will be committed -This is the third line +This change will not be committed +This is the second line +This line has been added record this change to 'editedfile'? [Ynesfdaq?] e patching file editedfile Hunk #1 FAILED at 0 1 out of 1 hunks FAILED -- saving rejects to file editedfile.rej abort: patch failed to apply [255] $ cat editedfile This change will not be committed This is the second line This line has been added $ hg cat -r tip editedfile This is the first line This change will be committed This is the third line $ cat editedfile.rej --- editedfile +++ editedfile @@ -1,3 +1,3 @@ -That is the first line -That change will be committed -That is the third line +That change will not be committed +That is the second line +That line has been added Malformed patch - error handling $ cat > editor.sh << '__EOF__' > sed -e '/^@/p' "$1" > tmp > mv tmp "$1" > __EOF__ $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i < y > e > EOF diff --git a/editedfile b/editedfile 1 hunks, 3 lines changed examine changes to 'editedfile'? [Ynesfdaq?] y @@ -1,3 +1,3 @@ -This is the first line -This change will be committed -This is the third line +This change will not be committed +This is the second line +This line has been added record this change to 'editedfile'? [Ynesfdaq?] e abort: error parsing patch: unhandled transition: range -> range [255] Exiting editor with status 1, ignores the edit but does not stop the recording session $ HGEDITOR=false hg commit -i < y > e > n > EOF diff --git a/editedfile b/editedfile 1 hunks, 3 lines changed examine changes to 'editedfile'? [Ynesfdaq?] y @@ -1,3 +1,3 @@ -This is the first line -This change will be committed -This is the third line +This change will not be committed +This is the second line +This line has been added record this change to 'editedfile'? [Ynesfdaq?] e editor exited with exit code 1 record this change to 'editedfile'? [Ynesfdaq?] n no changes to record [1] random text in random positions is still an error $ cat > editor.sh << '__EOF__' > sed -e '/^@/i\ > other' "$1" > tmp > mv tmp "$1" > __EOF__ $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i < y > e > EOF diff --git a/editedfile b/editedfile 1 hunks, 3 lines changed examine changes to 'editedfile'? [Ynesfdaq?] y @@ -1,3 +1,3 @@ -This is the first line -This change will be committed -This is the third line +This change will not be committed +This is the second line +This line has been added record this change to 'editedfile'? [Ynesfdaq?] e abort: error parsing patch: unhandled transition: file -> other [255] $ hg up -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved With win32text $ echo '[extensions]' >> .hg/hgrc $ echo 'win32text = ' >> .hg/hgrc $ echo '[decode]' >> .hg/hgrc $ echo '** = cleverdecode:' >> .hg/hgrc $ echo '[encode]' >> .hg/hgrc $ echo '** = cleverencode:' >> .hg/hgrc $ echo '[patch]' >> .hg/hgrc $ echo 'eol = crlf' >> .hg/hgrc Ignore win32text deprecation warning for now: $ echo '[win32text]' >> .hg/hgrc $ echo 'warn = no' >> .hg/hgrc $ echo d >> subdir/f1 $ hg commit -i -d '24 0' -mw1 < y > y > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed examine changes to 'subdir/f1'? [Ynesfdaq?] y @@ -3,3 +3,4 @@ a a b c +d record this change to 'subdir/f1'? [Ynesfdaq?] y $ hg status -A subdir/f1 C subdir/f1 $ hg tip -p changeset: 30:* (glob) tag: tip user: test date: Thu Jan 01 00:00:24 1970 +0000 summary: w1 diff -r ???????????? -r ???????????? subdir/f1 (glob) --- a/subdir/f1 Thu Jan 01 00:00:23 1970 +0000 +++ b/subdir/f1 Thu Jan 01 00:00:24 1970 +0000 @@ -3,3 +3,4 @@ a b c +d Test --user when ui.username not set $ unset HGUSER $ echo e >> subdir/f1 $ hg commit -i --config ui.username= -d '8 0' --user xyz -m "user flag" < y > y > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed examine changes to 'subdir/f1'? [Ynesfdaq?] y @@ -4,3 +4,4 @@ a b c d +e record this change to 'subdir/f1'? [Ynesfdaq?] y $ hg status -A subdir/f1 C subdir/f1 $ hg log --template '{author}\n' -l 1 xyz $ HGUSER="test" $ export HGUSER Moving files $ hg update -C . 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg mv plain plain3 $ echo somechange >> plain3 $ hg commit -i -d '23 0' -mmoving_files << EOF > y > y > EOF diff --git a/plain b/plain3 rename from plain rename to plain3 1 hunks, 1 lines changed examine changes to 'plain' and 'plain3'? [Ynesfdaq?] y @@ -11,3 +11,4 @@ 8 9 10 11 +somechange record this change to 'plain3'? [Ynesfdaq?] y The #if execbit block above changes the hash here on some systems $ hg status -A plain3 C plain3 $ hg tip changeset: 32:* (glob) tag: tip user: test date: Thu Jan 01 00:00:23 1970 +0000 summary: moving_files Editing patch of newly added file $ hg update -C . 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat > editor.sh << '__EOF__' > cat "$1" | sed "s/first/very/g" > tt > mv tt "$1" > __EOF__ $ cat > newfile << '__EOF__' > This is the first line > This is the second line > This is the third line > __EOF__ $ hg add newfile $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-new < y > e > EOF diff --git a/newfile b/newfile new file mode 100644 examine changes to 'newfile'? [Ynesfdaq?] y @@ -0,0 +1,3 @@ +This is the first line +This is the second line +This is the third line record this change to 'newfile'? [Ynesfdaq?] e $ hg cat -r tip newfile This is the very line This is the second line This is the third line $ cat newfile This is the first line This is the second line This is the third line Add new file from within a subdirectory $ hg update -C . 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ mkdir folder $ cd folder $ echo "foo" > bar $ hg add bar $ hg commit -i -d '23 0' -mnewfilesubdir < y > y > EOF diff --git a/folder/bar b/folder/bar new file mode 100644 examine changes to 'folder/bar'? [Ynesfdaq?] y @@ -0,0 +1,1 @@ +foo record this change to 'folder/bar'? [Ynesfdaq?] y The #if execbit block above changes the hashes here on some systems $ hg tip -p changeset: 34:* (glob) tag: tip user: test date: Thu Jan 01 00:00:23 1970 +0000 summary: newfilesubdir diff -r * -r * folder/bar (glob) --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/folder/bar Thu Jan 01 00:00:23 1970 +0000 @@ -0,0 +1,1 @@ +foo $ cd .. $ hg status -A folder/bar C folder/bar Clear win32text configuration before size/timestamp sensitive test $ cat >> .hg/hgrc < [extensions] > win32text = ! > [decode] > ** = ! > [encode] > ** = ! > [patch] > eol = strict > EOF $ hg update -q -C null $ hg update -q -C tip Test that partially committed file is still treated as "modified", even if none of mode, size and timestamp is changed on the filesystem (see also issue4583). $ cat > subdir/f1 < A > a > a > b > c > d > E > EOF $ hg diff --git subdir/f1 diff --git a/subdir/f1 b/subdir/f1 --- a/subdir/f1 +++ b/subdir/f1 @@ -1,7 +1,7 @@ -a +A a a b c d -e +E $ touch -t 200001010000 subdir/f1 $ cat >> .hg/hgrc < # emulate invoking patch.internalpatch() at 2000-01-01 00:00 > [fakepatchtime] > fakenow = 200001010000 > > [extensions] > fakepatchtime = $TESTDIR/fakepatchtime.py > EOF $ hg commit -i -m 'commit subdir/f1 partially' < y > y > n > EOF diff --git a/subdir/f1 b/subdir/f1 2 hunks, 2 lines changed examine changes to 'subdir/f1'? [Ynesfdaq?] y @@ -1,6 +1,6 @@ -a +A a a b c d record change 1/2 to 'subdir/f1'? [Ynesfdaq?] y @@ -2,6 +2,6 @@ a a b c d -e +E record change 2/2 to 'subdir/f1'? [Ynesfdaq?] n $ cat >> .hg/hgrc < [extensions] > fakepatchtime = ! > EOF $ hg debugstate | grep ' subdir/f1$' n 0 -1 unset subdir/f1 $ hg status -A subdir/f1 M subdir/f1 mercurial-4.5.3/tests/test-subrepo-recursion.t0000644015407300116100000005615713261161234021405 0ustar augieeng00000000000000Create test repository: $ hg init repo $ cd repo $ echo x1 > x.txt $ hg init foo $ cd foo $ echo y1 > y.txt $ hg init bar $ cd bar $ echo z1 > z.txt $ cd .. $ echo 'bar = bar' > .hgsub $ cd .. $ echo 'foo = foo' > .hgsub Add files --- .hgsub files must go first to trigger subrepos: $ hg add -S .hgsub $ hg add -S foo/.hgsub $ hg add -S foo/bar adding foo/bar/z.txt $ hg add -S adding x.txt adding foo/y.txt Test recursive status without committing anything: $ hg status -S A .hgsub A foo/.hgsub A foo/bar/z.txt A foo/y.txt A x.txt Test recursive diff without committing anything: $ hg diff --nodates -S foo diff -r 000000000000 foo/.hgsub --- /dev/null +++ b/foo/.hgsub @@ -0,0 +1,1 @@ +bar = bar diff -r 000000000000 foo/y.txt --- /dev/null +++ b/foo/y.txt @@ -0,0 +1,1 @@ +y1 diff -r 000000000000 foo/bar/z.txt --- /dev/null +++ b/foo/bar/z.txt @@ -0,0 +1,1 @@ +z1 Commits: $ hg commit -m fails abort: uncommitted changes in subrepository "foo" (use --subrepos for recursive commit) [255] The --subrepos flag overwrite the config setting: $ hg commit -m 0-0-0 --config ui.commitsubrepos=No --subrepos committing subrepository foo committing subrepository foo/bar $ cd foo $ echo y2 >> y.txt $ hg commit -m 0-1-0 $ cd bar $ echo z2 >> z.txt $ hg commit -m 0-1-1 $ cd .. $ hg commit -m 0-2-1 $ cd .. $ hg commit -m 1-2-1 Change working directory: $ echo y3 >> foo/y.txt $ echo z3 >> foo/bar/z.txt $ hg status -S M foo/bar/z.txt M foo/y.txt $ hg diff --nodates -S diff -r d254738c5f5e foo/y.txt --- a/foo/y.txt +++ b/foo/y.txt @@ -1,2 +1,3 @@ y1 y2 +y3 diff -r 9647f22de499 foo/bar/z.txt --- a/foo/bar/z.txt +++ b/foo/bar/z.txt @@ -1,2 +1,3 @@ z1 z2 +z3 Status call crossing repository boundaries: $ hg status -S foo/bar/z.txt M foo/bar/z.txt $ hg status -S -I 'foo/?.txt' M foo/y.txt $ hg status -S -I '**/?.txt' M foo/bar/z.txt M foo/y.txt $ hg diff --nodates -S -I '**/?.txt' diff -r d254738c5f5e foo/y.txt --- a/foo/y.txt +++ b/foo/y.txt @@ -1,2 +1,3 @@ y1 y2 +y3 diff -r 9647f22de499 foo/bar/z.txt --- a/foo/bar/z.txt +++ b/foo/bar/z.txt @@ -1,2 +1,3 @@ z1 z2 +z3 Status from within a subdirectory: $ mkdir dir $ cd dir $ echo a1 > a.txt $ hg status -S M foo/bar/z.txt M foo/y.txt ? dir/a.txt $ hg diff --nodates -S diff -r d254738c5f5e foo/y.txt --- a/foo/y.txt +++ b/foo/y.txt @@ -1,2 +1,3 @@ y1 y2 +y3 diff -r 9647f22de499 foo/bar/z.txt --- a/foo/bar/z.txt +++ b/foo/bar/z.txt @@ -1,2 +1,3 @@ z1 z2 +z3 Status with relative path: $ hg status -S .. M ../foo/bar/z.txt M ../foo/y.txt ? a.txt XXX: filtering lfilesrepo.status() in 3.3-rc causes these files to be listed as added instead of modified. $ hg status -S .. --config extensions.largefiles= M ../foo/bar/z.txt M ../foo/y.txt ? a.txt $ hg diff --nodates -S .. diff -r d254738c5f5e foo/y.txt --- a/foo/y.txt +++ b/foo/y.txt @@ -1,2 +1,3 @@ y1 y2 +y3 diff -r 9647f22de499 foo/bar/z.txt --- a/foo/bar/z.txt +++ b/foo/bar/z.txt @@ -1,2 +1,3 @@ z1 z2 +z3 $ cd .. Cleanup and final commit: $ rm -r dir $ hg commit --subrepos -m 2-3-2 committing subrepository foo committing subrepository foo/bar Test explicit path commands within subrepos: add/forget $ echo z1 > foo/bar/z2.txt $ hg status -S ? foo/bar/z2.txt $ hg add foo/bar/z2.txt $ hg status -S A foo/bar/z2.txt $ hg forget foo/bar/z2.txt $ hg status -S ? foo/bar/z2.txt $ hg forget foo/bar/z2.txt not removing foo/bar/z2.txt: file is already untracked [1] $ hg status -S ? foo/bar/z2.txt $ rm foo/bar/z2.txt Log with the relationships between repo and its subrepo: $ hg log --template '{rev}:{node|short} {desc}\n' 2:1326fa26d0c0 2-3-2 1:4b3c9ff4f66b 1-2-1 0:23376cbba0d8 0-0-0 $ hg -R foo log --template '{rev}:{node|short} {desc}\n' 3:65903cebad86 2-3-2 2:d254738c5f5e 0-2-1 1:8629ce7dcc39 0-1-0 0:af048e97ade2 0-0-0 $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n' 2:31ecbdafd357 2-3-2 1:9647f22de499 0-1-1 0:4904098473f9 0-0-0 Status between revisions: $ hg status -S $ hg status -S --rev 0:1 M .hgsubstate M foo/.hgsubstate M foo/bar/z.txt M foo/y.txt $ hg diff --nodates -S -I '**/?.txt' --rev 0:1 diff -r af048e97ade2 -r d254738c5f5e foo/y.txt --- a/foo/y.txt +++ b/foo/y.txt @@ -1,1 +1,2 @@ y1 +y2 diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt --- a/foo/bar/z.txt +++ b/foo/bar/z.txt @@ -1,1 +1,2 @@ z1 +z2 #if serve $ cd .. $ hg serve -R repo --debug -S -p $HGPORT -d --pid-file=hg1.pid -E error.log -A access.log adding = $TESTTMP/repo adding foo = $TESTTMP/repo/foo adding foo/bar = $TESTTMP/repo/foo/bar listening at http://*:$HGPORT/ (bound to *:$HGPORT) (glob) (?) adding = $TESTTMP/repo (?) adding foo = $TESTTMP/repo/foo (?) adding foo/bar = $TESTTMP/repo/foo/bar (?) $ cat hg1.pid >> $DAEMON_PIDS $ hg clone http://localhost:$HGPORT clone --config progress.disable=True requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 5 changes to 3 files new changesets 23376cbba0d8:1326fa26d0c0 updating to branch default cloning subrepo foo from http://localhost:$HGPORT/foo requesting all changes adding changesets adding manifests adding file changes added 4 changesets with 7 changes to 3 files new changesets af048e97ade2:65903cebad86 cloning subrepo foo/bar from http://localhost:$HGPORT/foo/bar requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 1 files new changesets 4904098473f9:31ecbdafd357 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat clone/foo/bar/z.txt z1 z2 z3 Clone pooling from a remote URL will share the top level repo and the subrepos, even if they are referenced by remote URL. $ hg --config extensions.share= --config share.pool=$TESTTMP/pool \ > clone http://localhost:$HGPORT shared (sharing from new pooled repository 23376cbba0d87c15906bb3652584927c140907bf) requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 5 changes to 3 files new changesets 23376cbba0d8:1326fa26d0c0 searching for changes no changes found updating working directory cloning subrepo foo from http://localhost:$HGPORT/foo (sharing from new pooled repository af048e97ade2e236f754f05d07013e586af0f8bf) requesting all changes adding changesets adding manifests adding file changes added 4 changesets with 7 changes to 3 files new changesets af048e97ade2:65903cebad86 searching for changes no changes found cloning subrepo foo/bar from http://localhost:$HGPORT/foo/bar (sharing from new pooled repository 4904098473f96c900fec436dad267edd4da59fad) requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 1 files new changesets 4904098473f9:31ecbdafd357 searching for changes no changes found 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat access.log * "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) * "GET /?cmd=batch HTTP/1.1" 200 - * (glob) * "GET /?cmd=getbundle HTTP/1.1" 200 - * (glob) * "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob) * "GET /foo?cmd=batch HTTP/1.1" 200 - * (glob) * "GET /foo?cmd=getbundle HTTP/1.1" 200 - * (glob) * "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob) * "GET /foo/bar?cmd=batch HTTP/1.1" 200 - * (glob) * "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - * (glob) $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=1326fa26d0c00d2146c63b56bb6a45149d7325ac&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D1326fa26d0c00d2146c63b56bb6a45149d7325ac x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=1326fa26d0c00d2146c63b56bb6a45149d7325ac&heads=1326fa26d0c00d2146c63b56bb6a45149d7325ac&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D65903cebad86f1a84bd4f1134f62fa7dcb7a1c98 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&heads=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=31ecbdafd357f54b281c9bd1d681bb90de219e22&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D31ecbdafd357f54b281c9bd1d681bb90de219e22 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=31ecbdafd357f54b281c9bd1d681bb90de219e22&heads=31ecbdafd357f54b281c9bd1d681bb90de219e22&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $ killdaemons.py $ rm hg1.pid error.log access.log $ cd repo #endif Enable progress extension for archive tests: $ cp $HGRCPATH $HGRCPATH.no-progress $ cat >> $HGRCPATH < [progress] > disable=False > assume-tty = 1 > delay = 0 > # set changedelay really large so we don't see nested topics > changedelay = 30000 > format = topic bar number > refresh = 0 > width = 60 > EOF Test archiving to a directory tree (the doubled lines in the output only show up in the test output, not in real usage): $ hg archive --subrepos ../archive \r (no-eol) (esc) archiving [ ] 0/3\r (no-eol) (esc) archiving [=============> ] 1/3\r (no-eol) (esc) archiving [===========================> ] 2/3\r (no-eol) (esc) archiving [==========================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (foo) [ ] 0/3\r (no-eol) (esc) archiving (foo) [===========> ] 1/3\r (no-eol) (esc) archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) archiving (foo) [====================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (foo/bar) [ ] 0/1\r (no-eol) (esc) archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) $ find ../archive | sort ../archive ../archive/.hg_archival.txt ../archive/.hgsub ../archive/.hgsubstate ../archive/foo ../archive/foo/.hgsub ../archive/foo/.hgsubstate ../archive/foo/bar ../archive/foo/bar/z.txt ../archive/foo/y.txt ../archive/x.txt Test archiving to zip file (unzip output is unstable): $ hg archive --subrepos --prefix '.' ../archive.zip \r (no-eol) (esc) archiving [ ] 0/3\r (no-eol) (esc) archiving [=============> ] 1/3\r (no-eol) (esc) archiving [===========================> ] 2/3\r (no-eol) (esc) archiving [==========================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (foo) [ ] 0/3\r (no-eol) (esc) archiving (foo) [===========> ] 1/3\r (no-eol) (esc) archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) archiving (foo) [====================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (foo/bar) [ ] 0/1\r (no-eol) (esc) archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) (unzip date formating is unstable, we do not care about it and glob it out) $ unzip -l ../archive.zip | grep -v -- ----- | egrep -v files$ Archive: ../archive.zip Length [ ]* Date [ ]* Time [ ]* Name (re) 172 [0-9:\- ]* .hg_archival.txt (re) 10 [0-9:\- ]* .hgsub (re) 45 [0-9:\- ]* .hgsubstate (re) 3 [0-9:\- ]* x.txt (re) 10 [0-9:\- ]* foo/.hgsub (re) 45 [0-9:\- ]* foo/.hgsubstate (re) 9 [0-9:\- ]* foo/y.txt (re) 9 [0-9:\- ]* foo/bar/z.txt (re) Test archiving a revision that references a subrepo that is not yet cloned: #if hardlink $ hg clone -U . ../empty \r (no-eol) (esc) linking [ <=> ] 1\r (no-eol) (esc) linking [ <=> ] 2\r (no-eol) (esc) linking [ <=> ] 3\r (no-eol) (esc) linking [ <=> ] 4\r (no-eol) (esc) linking [ <=> ] 5\r (no-eol) (esc) linking [ <=> ] 6\r (no-eol) (esc) linking [ <=> ] 7\r (no-eol) (esc) linking [ <=> ] 8\r (no-eol) (esc) \r (no-eol) (esc) #else $ hg clone -U . ../empty \r (no-eol) (esc) linking [ <=> ] 1 (no-eol) #endif $ cd ../empty #if hardlink $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz \r (no-eol) (esc) archiving [ ] 0/3\r (no-eol) (esc) archiving [=============> ] 1/3\r (no-eol) (esc) archiving [===========================> ] 2/3\r (no-eol) (esc) archiving [==========================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) linking [ <=> ] 1\r (no-eol) (esc) linking [ <=> ] 2\r (no-eol) (esc) linking [ <=> ] 3\r (no-eol) (esc) linking [ <=> ] 4\r (no-eol) (esc) linking [ <=> ] 5\r (no-eol) (esc) linking [ <=> ] 6\r (no-eol) (esc) linking [ <=> ] 7\r (no-eol) (esc) linking [ <=> ] 8\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (foo) [ ] 0/3\r (no-eol) (esc) archiving (foo) [===========> ] 1/3\r (no-eol) (esc) archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) archiving (foo) [====================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) linking [ <=> ] 1\r (no-eol) (esc) linking [ <=> ] 2\r (no-eol) (esc) linking [ <=> ] 3\r (no-eol) (esc) linking [ <=> ] 4\r (no-eol) (esc) linking [ <=> ] 5\r (no-eol) (esc) linking [ <=> ] 6\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (foo/bar) [ ] 0/1\r (no-eol) (esc) archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) cloning subrepo foo from $TESTTMP/repo/foo cloning subrepo foo/bar from $TESTTMP/repo/foo/bar #else Note there's a slight output glitch on non-hardlink systems: the last "linking" progress topic never gets closed, leading to slight output corruption on that platform. $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz \r (no-eol) (esc) archiving [ ] 0/3\r (no-eol) (esc) archiving [=============> ] 1/3\r (no-eol) (esc) archiving [===========================> ] 2/3\r (no-eol) (esc) archiving [==========================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) linking [ <=> ] 1\r (no-eol) (esc) cloning subrepo foo/bar from $TESTTMP/repo/foo/bar #endif Archive + subrepos uses '/' for all component separators $ tar -tzf ../archive.tar.gz | sort .hg_archival.txt .hgsub .hgsubstate foo/.hgsub foo/.hgsubstate foo/bar/z.txt foo/y.txt x.txt The newly cloned subrepos contain no working copy: $ hg -R foo summary parent: -1:000000000000 (no revision checked out) branch: default commit: (clean) update: 4 new changesets (update) Sharing a local repo without the locally referenced subrepo (i.e. it was never updated from null), fails the same as a clone operation. $ hg --config progress.disable=True clone -U ../empty ../empty2 $ hg --config extensions.share= --config progress.disable=True \ > share ../empty2 ../empty_share updating working directory abort: repository $TESTTMP/empty2/foo not found! [255] $ hg --config progress.disable=True clone ../empty2 ../empty_clone updating to branch default abort: repository $TESTTMP/empty2/foo not found! [255] Disable progress extension and cleanup: $ mv $HGRCPATH.no-progress $HGRCPATH Test archiving when there is a directory in the way for a subrepo created by archive: $ hg clone -U . ../almost-empty $ cd ../almost-empty $ mkdir foo $ echo f > foo/f $ hg archive --subrepos -r tip archive cloning subrepo foo from $TESTTMP/empty/foo abort: destination '$TESTTMP/almost-empty/foo' is not empty (in subrepository "foo") [255] Clone and test outgoing: $ cd .. $ hg clone repo repo2 updating to branch default cloning subrepo foo from $TESTTMP/repo/foo cloning subrepo foo/bar from $TESTTMP/repo/foo/bar 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd repo2 $ hg outgoing -S comparing with $TESTTMP/repo searching for changes no changes found comparing with $TESTTMP/repo/foo searching for changes no changes found comparing with $TESTTMP/repo/foo/bar searching for changes no changes found [1] Make nested change: $ echo y4 >> foo/y.txt $ hg diff --nodates -S diff -r 65903cebad86 foo/y.txt --- a/foo/y.txt +++ b/foo/y.txt @@ -1,3 +1,4 @@ y1 y2 y3 +y4 $ hg commit --subrepos -m 3-4-2 committing subrepository foo $ hg outgoing -S comparing with $TESTTMP/repo searching for changes changeset: 3:2655b8ecc4ee tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 3-4-2 comparing with $TESTTMP/repo/foo searching for changes changeset: 4:e96193d6cb36 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 3-4-2 comparing with $TESTTMP/repo/foo/bar searching for changes no changes found Switch to original repo and setup default path: $ cd ../repo $ echo '[paths]' >> .hg/hgrc $ echo 'default = ../repo2' >> .hg/hgrc Test incoming: $ hg incoming -S comparing with $TESTTMP/repo2 searching for changes changeset: 3:2655b8ecc4ee tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 3-4-2 comparing with $TESTTMP/repo2/foo searching for changes changeset: 4:e96193d6cb36 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 3-4-2 comparing with $TESTTMP/repo2/foo/bar searching for changes no changes found $ hg incoming -S --bundle incoming.hg abort: cannot combine --bundle and --subrepos [255] Test missing subrepo: $ rm -r foo $ hg status -S warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo" Issue2619: IndexError: list index out of range on hg add with subrepos The subrepo must sorts after the explicit filename. $ cd .. $ hg init test $ cd test $ hg init x $ echo abc > abc.txt $ hg ci -Am "abc" adding abc.txt $ echo "x = x" >> .hgsub $ hg add .hgsub $ touch a x/a $ hg add a x/a $ hg ci -Sm "added x" committing subrepository x $ echo abc > x/a $ hg revert --rev '.^' "set:subrepo('glob:x*')" abort: subrepository 'x' does not exist in 25ac2c9b3180! [255] $ cd .. mercurial-4.5.3/tests/test-push-checkheads-unpushed-D5.t0000644015407300116100000000572213261161234023045 0ustar augieeng00000000000000==================================== Testing head checking code: Case D-5 ==================================== Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This case is part of a series of tests checking this behavior. Category D: remote head is "obs-affected" locally, but result is not part of the push TestCase 5: multi-changeset branch, split on multiple other, (head on its own new branch) .. old-state: .. .. * 2 branch (1 changeset, and 2 changesets) .. .. new-state: .. .. * 1 new branch superceeding the head of the old-2-changesets-branch, .. * 1 new changesets on the old-1-changeset-branch superceeding the base of the other .. .. expected-result: .. .. * push the new branch only -> push denied .. * push the existing branch only -> push allowed .. /!\ This push create unstability/orphaning on the other hand and we should .. probably detect/warn agains that. .. .. graph-summary: .. .. B ø⇠◔ B' .. | | .. A'◔⇢ø | .. | |/ .. C â— | .. \| .. â— $ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir D5 $ cd D5 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd server $ mkcommit B0 $ hg up 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ mkcommit C0 created new head $ cd ../client $ hg pull pulling from $TESTTMP/D5/server searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files (+1 heads) new changesets d73caddc5533:0f88766e02d6 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg up 'desc(C0)' 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit A1 $ hg up 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ mkcommit B1 created new head $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` obsoleted 1 changesets $ hg log -G --hidden @ 25c56d33e4c4 (draft): B1 | | o a0802eb7fc1b (draft): A1 | | | o 0f88766e02d6 (draft): C0 |/ | x d73caddc5533 (draft): B0 | | | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): root Actual testing -------------- $ hg push --rev 'desc(B1)' pushing to $TESTTMP/D5/server searching for changes abort: push creates new remote head 25c56d33e4c4! (merge or see 'hg help push' for details about pushing new heads) [255] $ hg push --rev 'desc(A1)' pushing to $TESTTMP/D5/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files 1 new obsolescence markers obsoleted 1 changesets 1 new orphan changesets $ cd ../.. mercurial-4.5.3/tests/test-issue586.t0000644015407300116100000000374713261161234017307 0ustar augieeng00000000000000Issue586: removing remote files after merge appears to corrupt the dirstate $ hg init a $ cd a $ echo a > a $ hg ci -Ama adding a $ hg init ../b $ cd ../b $ echo b > b $ hg ci -Amb adding b $ hg pull -f ../a pulling from ../a searching for changes warning: repository is unrelated requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets cb9a9f314b8b (run 'hg heads' to see heads, 'hg merge' to merge) $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg rm -f a $ hg ci -Amc $ hg st -A C b $ cd .. Issue1433: Traceback after two unrelated pull, two move, a merge and a commit (related to issue586) create test repos $ hg init repoa $ touch repoa/a $ hg -R repoa ci -Am adda adding a $ hg init repob $ touch repob/b $ hg -R repob ci -Am addb adding b $ hg init repoc $ cd repoc $ hg pull ../repoa pulling from ../repoa requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 7132ab4568ac (run 'hg update' to get a working copy) $ hg update 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ mkdir tst $ hg mv * tst $ hg ci -m "import a in tst" $ hg pull -f ../repob pulling from ../repob searching for changes warning: repository is unrelated requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 5ddceb349652 (run 'hg heads' to see heads, 'hg merge' to merge) merge both repos $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ mkdir src move b content $ hg mv b src $ hg ci -m "import b in src" $ hg manifest src/b tst/a $ cd .. mercurial-4.5.3/tests/test-http-permissions.t0000644015407300116100000010723013261161234021234 0ustar augieeng00000000000000#require killdaemons $ cat > fakeremoteuser.py << EOF > import os > from mercurial.hgweb import hgweb_mod > from mercurial import wireproto > class testenvhgweb(hgweb_mod.hgweb): > def __call__(self, env, respond): > # Allow REMOTE_USER to define authenticated user. > if r'REMOTE_USER' in os.environ: > env[r'REMOTE_USER'] = os.environ[r'REMOTE_USER'] > # Allow REQUEST_METHOD to override HTTP method > if r'REQUEST_METHOD' in os.environ: > env[r'REQUEST_METHOD'] = os.environ[r'REQUEST_METHOD'] > return super(testenvhgweb, self).__call__(env, respond) > hgweb_mod.hgweb = testenvhgweb > > @wireproto.wireprotocommand('customreadnoperm') > def customread(repo, proto): > return b'read-only command no defined permissions\n' > @wireproto.wireprotocommand('customwritenoperm') > def customwritenoperm(repo, proto): > return b'write command no defined permissions\n' > wireproto.permissions['customreadwithperm'] = 'pull' > @wireproto.wireprotocommand('customreadwithperm') > def customreadwithperm(repo, proto): > return b'read-only command w/ defined permissions\n' > wireproto.permissions['customwritewithperm'] = 'push' > @wireproto.wireprotocommand('customwritewithperm') > def customwritewithperm(repo, proto): > return b'write command w/ defined permissions\n' > EOF $ cat >> $HGRCPATH << EOF > [extensions] > fakeremoteuser = $TESTTMP/fakeremoteuser.py > strip = > EOF $ hg init test $ cd test $ echo a > a $ hg ci -Ama adding a $ cd .. $ hg clone test test2 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd test2 $ echo a >> a $ hg ci -mb $ hg book bm -r 0 $ cd ../test web.deny_read=* prevents access to wire protocol for all users $ cat > .hg/hgrc < [web] > deny_read = * > EOF $ hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 401 read not authorized 0 read not authorized [1] $ hg --cwd ../test2 pull http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ abort: authorization failed [255] $ killdaemons.py web.deny_read=* with REMOTE_USER set still locks out clients $ REMOTE_USER=authed_user hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 401 read not authorized 0 read not authorized [1] $ hg --cwd ../test2 pull http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ abort: authorization failed [255] $ killdaemons.py web.deny_read= denies access to unauthenticated user $ cat > .hg/hgrc < [web] > deny_read = baduser1,baduser2 > EOF $ hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 401 read not authorized 0 read not authorized [1] $ hg --cwd ../test2 pull http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ abort: authorization failed [255] $ killdaemons.py web.deny_read= denies access to users in deny list $ REMOTE_USER=baduser2 hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 401 read not authorized 0 read not authorized [1] $ hg --cwd ../test2 pull http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ abort: authorization failed [255] $ killdaemons.py web.deny_read= allows access to authenticated users not in list $ REMOTE_USER=gooduser hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases' 200 Script output follows cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 1 publishing True (no-eol) $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases' 200 Script output follows cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 1 publishing True (no-eol) $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm' 405 push requires POST request 0 push requires POST request [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm' 200 Script output follows read-only command w/ defined permissions $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 405 push requires POST request 0 push requires POST request [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 405 push requires POST request 0 push requires POST request [1] $ hg --cwd ../test2 pull http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ searching for changes no changes found $ killdaemons.py web.allow_read=* allows reads for unauthenticated users $ cat > .hg/hgrc < [web] > allow_read = * > EOF $ hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases' 200 Script output follows cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 1 publishing True (no-eol) $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases' 200 Script output follows cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 1 publishing True (no-eol) $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm' 405 push requires POST request 0 push requires POST request [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm' 200 Script output follows read-only command w/ defined permissions $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 405 push requires POST request 0 push requires POST request [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 405 push requires POST request 0 push requires POST request [1] $ hg --cwd ../test2 pull http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ searching for changes no changes found $ killdaemons.py web.allow_read=* allows read for authenticated user $ REMOTE_USER=authed_user hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases' 200 Script output follows cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 1 publishing True (no-eol) $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases' 200 Script output follows cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 1 publishing True (no-eol) $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm' 405 push requires POST request 0 push requires POST request [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm' 200 Script output follows read-only command w/ defined permissions $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 405 push requires POST request 0 push requires POST request [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 405 push requires POST request 0 push requires POST request [1] $ hg --cwd ../test2 pull http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ searching for changes no changes found $ killdaemons.py web.allow_read= does not allow unauthenticated users to read $ cat > .hg/hgrc < [web] > allow_read = gooduser > EOF $ hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 401 read not authorized 0 read not authorized [1] $ hg --cwd ../test2 pull http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ abort: authorization failed [255] $ killdaemons.py web.allow_read= does not allow user not in list to read $ REMOTE_USER=baduser hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 401 read not authorized 0 read not authorized [1] $ hg --cwd ../test2 pull http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ abort: authorization failed [255] $ killdaemons.py web.allow_read= allows read from user in list $ REMOTE_USER=gooduser hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases' 200 Script output follows cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 1 publishing True (no-eol) $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases' 200 Script output follows cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 1 publishing True (no-eol) $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm' 405 push requires POST request 0 push requires POST request [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm' 200 Script output follows read-only command w/ defined permissions $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 405 push requires POST request 0 push requires POST request [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 405 push requires POST request 0 push requires POST request [1] $ hg --cwd ../test2 pull http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ searching for changes no changes found $ killdaemons.py web.deny_read takes precedence over web.allow_read $ cat > .hg/hgrc < [web] > allow_read = baduser > deny_read = baduser > EOF $ REMOTE_USER=baduser hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 401 read not authorized 0 read not authorized [1] $ hg --cwd ../test2 pull http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ abort: authorization failed [255] $ killdaemons.py web.allow-pull=false denies read access to repo $ cat > .hg/hgrc < [web] > allow-pull = false > EOF $ hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' 401 pull not authorized 0 pull not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=listkeys' --requestheader 'x-hgarg-1=namespace=phases' 401 pull not authorized 0 pull not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=listkeys+namespace%3Dphases' 401 pull not authorized 0 pull not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm' 405 push requires POST request 0 push requires POST request [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm' 401 pull not authorized 0 pull not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 405 push requires POST request 0 push requires POST request [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 405 push requires POST request 0 push requires POST request [1] $ hg --cwd ../test2 pull http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ abort: authorization failed [255] $ killdaemons.py Attempting a write command with HTTP GET fails $ cat > .hg/hgrc < EOF $ REQUEST_METHOD=GET hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 405 push requires POST request 0 push requires POST request [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 405 push requires POST request 0 push requires POST request [1] $ hg bookmarks no bookmarks set $ hg bookmark -d bm abort: bookmark 'bm' does not exist [255] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 405 push requires POST request 0 push requires POST request [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 405 push requires POST request 0 push requires POST request [1] $ killdaemons.py Attempting a write command with an unknown HTTP verb fails $ REQUEST_METHOD=someverb hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 405 push requires POST request 0 push requires POST request [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 405 push requires POST request 0 push requires POST request [1] $ hg bookmarks no bookmarks set $ hg bookmark -d bm abort: bookmark 'bm' does not exist [255] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 405 push requires POST request 0 push requires POST request [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 405 push requires POST request 0 push requires POST request [1] $ killdaemons.py Pushing on a plaintext channel is disabled by default $ cat > .hg/hgrc < EOF $ REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 403 ssl required 0 ssl required [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 403 ssl required 0 ssl required [1] $ hg bookmarks no bookmarks set $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 403 ssl required 0 ssl required [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 403 ssl required 0 ssl required [1] Reset server to remove REQUEST_METHOD hack to test hg client $ killdaemons.py $ hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes no changes found abort: HTTP Error 403: ssl required [255] $ hg --cwd ../test2 push http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes abort: HTTP Error 403: ssl required [255] $ killdaemons.py web.deny_push=* denies pushing to unauthenticated users $ cat > .hg/hgrc < [web] > push_ssl = false > deny_push = * > EOF $ REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 401 push not authorized 0 push not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 401 push not authorized 0 push not authorized [1] $ hg bookmarks no bookmarks set $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 401 push not authorized 0 push not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 401 push not authorized 0 push not authorized [1] Reset server to remove REQUEST_METHOD hack to test hg client $ killdaemons.py $ hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes no changes found abort: authorization failed [255] $ hg --cwd ../test2 push http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes abort: authorization failed [255] $ killdaemons.py web.deny_push=* denies pushing to authenticated users $ REMOTE_USER=someuser REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 401 push not authorized 0 push not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 401 push not authorized 0 push not authorized [1] $ hg bookmarks no bookmarks set $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 401 push not authorized 0 push not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 401 push not authorized 0 push not authorized [1] Reset server to remove REQUEST_METHOD hack to test hg client $ killdaemons.py $ REMOTE_USER=someuser hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes no changes found abort: authorization failed [255] $ hg --cwd ../test2 push http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes abort: authorization failed [255] $ killdaemons.py web.deny_push= denies pushing to user in list $ cat > .hg/hgrc < [web] > push_ssl = false > deny_push = baduser > EOF $ REMOTE_USER=baduser REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 401 push not authorized 0 push not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 401 push not authorized 0 push not authorized [1] $ hg bookmarks no bookmarks set $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 401 push not authorized 0 push not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 401 push not authorized 0 push not authorized [1] Reset server to remove REQUEST_METHOD hack to test hg client $ killdaemons.py $ REMOTE_USER=baduser hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes no changes found abort: authorization failed [255] $ hg --cwd ../test2 push http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes abort: authorization failed [255] $ killdaemons.py web.deny_push= denies pushing to user not in list because allow-push isn't set $ REMOTE_USER=gooduser REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 401 push not authorized 0 push not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 401 push not authorized 0 push not authorized [1] $ hg bookmarks no bookmarks set $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 401 push not authorized 0 push not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 401 push not authorized 0 push not authorized [1] Reset server to remove REQUEST_METHOD hack to test hg client $ killdaemons.py $ REMOTE_USER=gooduser hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes no changes found abort: authorization failed [255] $ hg --cwd ../test2 push http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes abort: authorization failed [255] $ killdaemons.py web.allow-push=* allows pushes from unauthenticated users $ cat > .hg/hgrc < [web] > push_ssl = false > allow-push = * > EOF $ REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 200 Script output follows 1 $ hg bookmarks bm 0:cb9a9f314b8b $ hg book -d bm $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 200 Script output follows write command no defined permissions $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 200 Script output follows write command w/ defined permissions Reset server to remove REQUEST_METHOD hack to test hg client $ killdaemons.py $ hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes no changes found exporting bookmark bm [1] $ hg book -d bm $ hg --cwd ../test2 push http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files $ hg strip -r 1: saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg $ killdaemons.py web.allow-push=* allows pushes from authenticated users $ REMOTE_USER=someuser REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 200 Script output follows 1 $ hg bookmarks bm 0:cb9a9f314b8b $ hg book -d bm $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 200 Script output follows write command no defined permissions $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 200 Script output follows write command w/ defined permissions Reset server to remove REQUEST_METHOD hack to test hg client $ killdaemons.py $ REMOTE_USER=someuser hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes no changes found exporting bookmark bm [1] $ hg book -d bm $ hg --cwd ../test2 push http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files $ hg strip -r 1: saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg $ killdaemons.py web.allow-push= denies push to user not in list $ cat > .hg/hgrc < [web] > push_ssl = false > allow-push = gooduser > EOF $ REMOTE_USER=baduser REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 401 push not authorized 0 push not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 401 push not authorized 0 push not authorized [1] $ hg bookmarks no bookmarks set $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 401 push not authorized 0 push not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 401 push not authorized 0 push not authorized [1] Reset server to remove REQUEST_METHOD hack to test hg client $ killdaemons.py $ REMOTE_USER=baduser hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes no changes found abort: authorization failed [255] $ hg --cwd ../test2 push http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes abort: authorization failed [255] $ killdaemons.py web.allow-push= allows push from user in list $ REMOTE_USER=gooduser REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 200 Script output follows 1 $ hg bookmarks bm 0:cb9a9f314b8b $ hg book -d bm $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 200 Script output follows 1 $ hg bookmarks bm 0:cb9a9f314b8b $ hg book -d bm $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 200 Script output follows write command no defined permissions $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 200 Script output follows write command w/ defined permissions Reset server to remove REQUEST_METHOD hack to test hg client $ killdaemons.py $ REMOTE_USER=gooduser hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes no changes found exporting bookmark bm [1] $ hg book -d bm $ hg --cwd ../test2 push http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files $ hg strip -r 1: saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg $ killdaemons.py web.deny_push takes precedence over web.allow_push $ cat > .hg/hgrc < [web] > push_ssl = false > allow-push = someuser > deny_push = someuser > EOF $ REMOTE_USER=someuser REQUEST_METHOD=POST hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 401 push not authorized 0 push not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 401 push not authorized 0 push not authorized [1] $ hg bookmarks no bookmarks set $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 401 push not authorized 0 push not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 401 push not authorized 0 push not authorized [1] Reset server to remove REQUEST_METHOD hack to test hg client $ killdaemons.py $ REMOTE_USER=someuser hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes no changes found abort: authorization failed [255] $ hg --cwd ../test2 push http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ searching for changes abort: authorization failed [255] $ killdaemons.py web.allow-push has no effect if web.deny_read is set $ cat > .hg/hgrc < [web] > push_ssl = false > allow-push = * > deny_read = * > EOF $ REQUEST_METHOD=POST REMOTE_USER=someuser hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=pushkey' --requestheader 'x-hgarg-1=namespace=bookmarks&key=bm&old=&new=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=batch' --requestheader 'x-hgarg-1=cmds=pushkey+namespace%3Dbookmarks%2Ckey%3Dbm%2Cold%3D%2Cnew%3Dcb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b' 401 read not authorized 0 read not authorized [1] $ hg bookmarks no bookmarks set $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadnoperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customreadwithperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritenoperm' 401 read not authorized 0 read not authorized [1] $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=customwritewithperm' 401 read not authorized 0 read not authorized [1] Reset server to remove REQUEST_METHOD hack to test hg client $ killdaemons.py $ REMOTE_USER=someuser hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ hg --cwd ../test2 push -B bm http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ abort: authorization failed [255] $ hg --cwd ../test2 push http://localhost:$HGPORT/ pushing to http://localhost:$HGPORT/ abort: authorization failed [255] $ killdaemons.py mercurial-4.5.3/tests/test-hgweb-removed.t0000644015407300116100000001610713261161234020441 0ustar augieeng00000000000000#require serve setting up repo $ hg init test $ cd test $ echo a > a $ hg ci -Ama adding a $ hg rm a $ hg ci -mdel set up hgweb $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS revision $ get-with-headers.py localhost:$HGPORT 'rev/tip' 200 Script output follows test: c78f6c5cbea9

changeset 1:c78f6c5cbea9 draft default tip

del
author test
date Thu, 01 Jan 1970 00:00:00 +0000
parents cb9a9f314b8b
children
files a
diffstat 1 files changed, 0 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
  --- a/a	Thu Jan 01 00:00:00 1970 +0000
  +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  @@ -1,1 +0,0 @@
  -a
diff removed file $ get-with-headers.py localhost:$HGPORT 'diff/tip/a' 200 Script output follows test: a diff

diff a @ 1:c78f6c5cbea9 draft default tip

del
author test
date Thu, 01 Jan 1970 00:00:00 +0000
parents cb9a9f314b8b
children
line wrap: on
line diff
  --- a/a	Thu Jan 01 00:00:00 1970 +0000
  +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  @@ -1,1 +0,0 @@
  -a
$ cd .. mercurial-4.5.3/tests/test-merge-default.t0000644015407300116100000000770713261161234020435 0ustar augieeng00000000000000 $ hg init $ echo a > a $ hg commit -A -ma adding a $ echo b >> a $ hg commit -mb $ echo c >> a $ hg commit -mc $ hg up 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo d >> a $ hg commit -md created new head $ hg up 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo e >> a $ hg commit -me created new head $ hg up 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Should fail because not at a head: $ hg merge abort: working directory not at a head revision (use 'hg update' or merge with an explicit revision) [255] $ hg up 1 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to "f25cbe84d8b3: e" 2 other heads for branch "default" Should fail because > 2 heads: $ HGMERGE=internal:other; export HGMERGE $ hg merge abort: branch 'default' has 3 heads - please merge with an explicit rev (run 'hg heads .' to see heads) [255] Should succeed: $ hg merge 2 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg id -Tjson [ { "bookmarks": [], "branch": "default", "dirty": "+", "id": "f25cbe84d8b3+2d95304fed5d+", "node": "ffffffffffffffffffffffffffffffffffffffff", "parents": [{"node": "f25cbe84d8b320e298e7703f18a25a3959518c23", "rev": 4}, {"node": "2d95304fed5d89bc9d70b2a0d02f0d567469c3ab", "rev": 2}], "tags": ["tip"] } ] $ hg commit -mm1 Should succeed - 2 heads: $ hg merge -P changeset: 3:ea9ff125ff88 parent: 1:1846eede8b68 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: d $ hg merge 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg commit -mm2 $ hg id -r 1 -Tjson [ { "bookmarks": [], "branch": "default", "id": "1846eede8b68", "node": "1846eede8b6886d8cc8a88c96a687b7fe8f3b9d1", "tags": [] } ] Should fail because at tip: $ hg merge abort: nothing to merge [255] $ hg up 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Should fail because there is only one head: $ hg merge abort: nothing to merge (use 'hg update' instead) [255] $ hg up 3 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo f >> a $ hg branch foobranch marked working directory as branch foobranch (branches are permanent and global, did you want a bookmark?) $ hg commit -mf Should fail because merge with other branch: $ hg merge abort: branch 'foobranch' has one head - please merge with an explicit rev (run 'hg heads' to see all heads) [255] Test for issue2043: ensure that 'merge -P' shows ancestors of 6 that are not ancestors of 7, regardless of where their common ancestors are. Merge preview not affected by common ancestor: $ hg up -q 7 $ hg merge -q -P 6 2:2d95304fed5d 4:f25cbe84d8b3 5:a431fabd6039 6:e88e33f3bf62 Test experimental destination revset $ hg log -r '_destmerge()' abort: branch 'foobranch' has one head - please merge with an explicit rev (run 'hg heads' to see all heads) [255] (on a branch with a two heads) $ hg up 5 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo f >> a $ hg commit -mf created new head $ hg log -r '_destmerge()' changeset: 6:e88e33f3bf62 parent: 5:a431fabd6039 parent: 3:ea9ff125ff88 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: m2 (from the other head) $ hg log -r '_destmerge(e88e33f3bf62)' changeset: 8:b613918999e2 tag: tip parent: 5:a431fabd6039 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: f (from unrelated branch) $ hg log -r '_destmerge(foobranch)' abort: branch 'foobranch' has one head - please merge with an explicit rev (run 'hg heads' to see all heads) [255] mercurial-4.5.3/tests/test-subrepo-relative-path.t0000644015407300116100000001350313261161234022125 0ustar augieeng00000000000000#require killdaemons Preparing the subrepository 'sub' $ hg init sub $ echo sub > sub/sub $ hg add -R sub adding sub/sub $ hg commit -R sub -m "sub import" Preparing the 'main' repo which depends on the subrepo 'sub' $ hg init main $ echo main > main/main $ echo "sub = ../sub" > main/.hgsub $ hg clone sub main/sub updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg add -R main adding main/.hgsub adding main/main $ hg commit -R main -m "main import" Cleaning both repositories, just as a clone -U $ hg up -C -R sub null 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg up -C -R main null 0 files updated, 0 files merged, 3 files removed, 0 files unresolved $ rm -rf main/sub hide outer repo $ hg init Serving them both using hgweb $ printf '[paths]\n/main = main\nsub = sub\n' > webdir.conf $ hg serve --webdir-conf webdir.conf -a localhost -p $HGPORT \ > -A /dev/null -E /dev/null --pid-file hg.pid -d $ cat hg.pid >> $DAEMON_PIDS Clone main from hgweb $ hg clone "http://localhost:$HGPORT/main" cloned requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 3 changes to 3 files new changesets fdfeeb3e979e updating to branch default cloning subrepo sub from http://localhost:$HGPORT/sub requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 863c1745b441 3 files updated, 0 files merged, 0 files removed, 0 files unresolved Checking cloned repo ids $ hg id -R cloned fdfeeb3e979e tip $ hg id -R cloned/sub 863c1745b441 tip subrepo debug for 'main' clone $ hg debugsub -R cloned path sub source ../sub revision 863c1745b441bd97a8c4a096e87793073f4fb215 Test sharing with a remote URL reference $ hg init absolute_subrepo $ cd absolute_subrepo $ echo foo > foo.txt $ hg ci -Am 'initial commit' adding foo.txt $ echo "sub = http://localhost:$HGPORT/sub" > .hgsub $ hg ci -Am 'add absolute subrepo' adding .hgsub $ cd .. Clone pooling works for local clones with a remote subrepo reference. The subrepo is cloned to the pool and shared from there, so that all clones will share the same subrepo. $ hg --config extensions.share= --config share.pool=$TESTTMP/pool \ > clone absolute_subrepo cloned_from_abs (sharing from new pooled repository 8d6a2f1e993b34b6557de0042cfe825ae12a8dae) requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 3 changes to 3 files new changesets 8d6a2f1e993b:* (glob) searching for changes no changes found updating working directory cloning subrepo sub from http://localhost:$HGPORT/sub (sharing from new pooled repository 863c1745b441bd97a8c4a096e87793073f4fb215) requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 863c1745b441 searching for changes no changes found 3 files updated, 0 files merged, 0 files removed, 0 files unresolved Vanilla sharing with a subrepo remote path reference will clone the subrepo. Each share of these top level repos will end up with independent subrepo copies (potentially leaving the shared parent with dangling cset references). $ hg --config extensions.share= share absolute_subrepo shared_from_abs updating working directory cloning subrepo sub from http://localhost:$HGPORT/sub requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 863c1745b441 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg --config extensions.share= share -U absolute_subrepo shared_from_abs2 $ hg -R shared_from_abs2 update -r tip cloning subrepo sub from http://localhost:$HGPORT/sub requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 863c1745b441 3 files updated, 0 files merged, 0 files removed, 0 files unresolved A parent repo without its subrepo available locally can be shared if the subrepo is referenced by absolute path. $ hg clone -U absolute_subrepo cloned_null_from_abs $ hg --config extensions.share= share cloned_null_from_abs shared_from_null_abs updating working directory cloning subrepo sub from http://localhost:$HGPORT/sub requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 863c1745b441 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ killdaemons.py subrepo paths with ssh urls $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/cloned sshclone requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 3 changes to 3 files new changesets fdfeeb3e979e updating to branch default cloning subrepo sub from ssh://user@dummy/sub requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 863c1745b441 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R sshclone push -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/cloned pushing to ssh://user@dummy/$TESTTMP/cloned pushing subrepo sub to ssh://user@dummy/$TESTTMP/sub searching for changes no changes found searching for changes no changes found [1] $ cat dummylog Got arguments 1:user@dummy 2:hg -R cloned serve --stdio Got arguments 1:user@dummy 2:hg -R sub serve --stdio Got arguments 1:user@dummy 2:hg -R $TESTTMP/cloned serve --stdio Got arguments 1:user@dummy 2:hg -R $TESTTMP/sub serve --stdio mercurial-4.5.3/tests/test-rebase-bookmarks.t0000644015407300116100000001262013261161234021131 0ustar augieeng00000000000000 $ cat >> $HGRCPATH < [extensions] > rebase= > drawdag=$TESTDIR/drawdag.py > > [phases] > publish=False > > [alias] > tglog = log -G --template "{rev}: {node|short} '{desc}' bookmarks: {bookmarks}\n" > EOF Create a repo with several bookmarks $ hg init a $ cd a $ echo a > a $ hg ci -Am A adding a $ echo b > b $ hg ci -Am B adding b $ hg book 'X' $ hg book 'Y' $ echo c > c $ hg ci -Am C adding c $ hg book 'Z' $ hg up -q 0 $ echo d > d $ hg ci -Am D adding d created new head $ hg book W $ hg tglog @ 3: 41acb9dca9eb 'D' bookmarks: W | | o 2: 49cb3485fa0c 'C' bookmarks: Y Z | | | o 1: 6c81ed0049f8 'B' bookmarks: X |/ o 0: 1994f17a630e 'A' bookmarks: Move only rebased bookmarks $ cd .. $ hg clone -q a a1 $ cd a1 $ hg up -q Z Test deleting divergent bookmarks from dest (issue3685) $ hg book -r 3 Z@diverge ... and also test that bookmarks not on dest or not being moved aren't deleted $ hg book -r 3 X@diverge $ hg book -r 0 Y@diverge $ hg tglog o 3: 41acb9dca9eb 'D' bookmarks: W X@diverge Z@diverge | | @ 2: 49cb3485fa0c 'C' bookmarks: Y Z | | | o 1: 6c81ed0049f8 'B' bookmarks: X |/ o 0: 1994f17a630e 'A' bookmarks: Y@diverge $ hg rebase -s Y -d 3 rebasing 2:49cb3485fa0c "C" (Y Z) saved backup bundle to $TESTTMP/a1/.hg/strip-backup/49cb3485fa0c-126f3e97-rebase.hg $ hg tglog @ 3: 17fb3faba63c 'C' bookmarks: Y Z | o 2: 41acb9dca9eb 'D' bookmarks: W X@diverge | | o 1: 6c81ed0049f8 'B' bookmarks: X |/ o 0: 1994f17a630e 'A' bookmarks: Y@diverge Do not try to keep active but deleted divergent bookmark $ cd .. $ hg clone -q a a4 $ cd a4 $ hg up -q 2 $ hg book W@diverge $ hg rebase -s W -d . rebasing 3:41acb9dca9eb "D" (W tip) saved backup bundle to $TESTTMP/a4/.hg/strip-backup/41acb9dca9eb-b35a6a63-rebase.hg $ hg bookmarks W 3:0d3554f74897 X 1:6c81ed0049f8 Y 2:49cb3485fa0c Z 2:49cb3485fa0c Keep bookmarks to the correct rebased changeset $ cd .. $ hg clone -q a a2 $ cd a2 $ hg up -q Z $ hg rebase -s 1 -d 3 rebasing 1:6c81ed0049f8 "B" (X) rebasing 2:49cb3485fa0c "C" (Y Z) saved backup bundle to $TESTTMP/a2/.hg/strip-backup/6c81ed0049f8-a687065f-rebase.hg $ hg tglog @ 3: 3d5fa227f4b5 'C' bookmarks: Y Z | o 2: e926fccfa8ec 'B' bookmarks: X | o 1: 41acb9dca9eb 'D' bookmarks: W | o 0: 1994f17a630e 'A' bookmarks: Keep active bookmark on the correct changeset $ cd .. $ hg clone -q a a3 $ cd a3 $ hg up -q X $ hg rebase -d W rebasing 1:6c81ed0049f8 "B" (X) rebasing 2:49cb3485fa0c "C" (Y Z) saved backup bundle to $TESTTMP/a3/.hg/strip-backup/6c81ed0049f8-a687065f-rebase.hg $ hg tglog o 3: 3d5fa227f4b5 'C' bookmarks: Y Z | @ 2: e926fccfa8ec 'B' bookmarks: X | o 1: 41acb9dca9eb 'D' bookmarks: W | o 0: 1994f17a630e 'A' bookmarks: $ hg bookmarks W 1:41acb9dca9eb * X 2:e926fccfa8ec Y 3:3d5fa227f4b5 Z 3:3d5fa227f4b5 rebase --continue with bookmarks present (issue3802) $ hg up 2 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (leaving bookmark X) $ echo 'C' > c $ hg add c $ hg ci -m 'other C' created new head $ hg up 3 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg rebase --dest 4 rebasing 3:3d5fa227f4b5 "C" (Y Z) merging c warning: conflicts while merging c! (edit, then use 'hg resolve --mark') unresolved conflicts (see hg resolve, then hg rebase --continue) [1] $ echo 'c' > c $ hg resolve --mark c (no more unresolved files) continue: hg rebase --continue $ hg rebase --continue rebasing 3:3d5fa227f4b5 "C" (Y Z) saved backup bundle to $TESTTMP/a3/.hg/strip-backup/3d5fa227f4b5-c6ea2371-rebase.hg $ hg tglog @ 4: 45c0f0ec1203 'C' bookmarks: Y Z | o 3: b0e10b7175fd 'other C' bookmarks: | o 2: e926fccfa8ec 'B' bookmarks: X | o 1: 41acb9dca9eb 'D' bookmarks: W | o 0: 1994f17a630e 'A' bookmarks: ensure that bookmarks given the names of revset functions can be used as --rev arguments (issue3950) $ hg update -q 3 $ echo bimble > bimble $ hg add bimble $ hg commit -q -m 'bisect' $ echo e >> bimble $ hg ci -m bisect2 $ echo e >> bimble $ hg ci -m bisect3 $ hg book bisect $ hg update -q Y $ hg rebase -r '"bisect"^^::"bisect"^' -r bisect -d Z rebasing 5:345c90f326a4 "bisect" rebasing 6:f677a2907404 "bisect2" rebasing 7:325c16001345 "bisect3" (bisect tip) saved backup bundle to $TESTTMP/a3/.hg/strip-backup/345c90f326a4-b4840586-rebase.hg Bookmark and working parent get moved even if --keep is set (issue5682) $ hg init $TESTTMP/book-keep $ cd $TESTTMP/book-keep $ hg debugdrawdag <<'EOS' > B C > |/ > A > EOS $ eval `hg tags -T 'hg bookmark -ir {node} {tag};\n' | grep -v tip` $ rm .hg/localtags $ hg up -q B $ hg tglog o 2: dc0947a82db8 'C' bookmarks: C | | @ 1: 112478962961 'B' bookmarks: B |/ o 0: 426bada5c675 'A' bookmarks: A $ hg rebase -r B -d C --keep rebasing 1:112478962961 "B" (B) $ hg tglog @ 3: 9769fc65c4c5 'B' bookmarks: B | o 2: dc0947a82db8 'C' bookmarks: C | | o 1: 112478962961 'B' bookmarks: |/ o 0: 426bada5c675 'A' bookmarks: A mercurial-4.5.3/tests/revnamesext.py0000644015407300116100000000114613261161234017454 0ustar augieeng00000000000000# Dummy extension to define a namespace containing revision names from __future__ import absolute_import from mercurial import ( namespaces, ) def reposetup(ui, repo): names = {'r%d' % rev: repo[rev].node() for rev in repo} namemap = lambda r, name: names.get(name) nodemap = lambda r, node: ['r%d' % repo[node].rev()] ns = namespaces.namespace('revnames', templatename='revname', logname='revname', listnames=lambda r: names.keys(), namemap=namemap, nodemap=nodemap) repo.names.addnamespace(ns) mercurial-4.5.3/tests/test-schemes.t0000644015407300116100000000260113261161234017327 0ustar augieeng00000000000000#require serve $ cat <> $HGRCPATH > [extensions] > schemes= > > [schemes] > l = http://localhost:$HGPORT/ > parts = http://{1}:$HGPORT/ > z = file:\$PWD/ > EOF $ hg init test $ cd test $ echo a > a $ hg ci -Am initial adding a invalid scheme $ hg log -R z:z abort: no '://' in scheme url 'z:z' [255] http scheme $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS $ hg incoming l:// comparing with l:// searching for changes no changes found [1] check that {1} syntax works $ hg incoming --debug parts://localhost using http://localhost:$HGPORT/ sending capabilities command comparing with parts://localhost/ query 1; heads sending batch command searching for changes all remote heads known locally no changes found [1] check that paths are expanded $ PWD=`pwd` hg incoming z:// comparing with z:// searching for changes no changes found [1] check that debugexpandscheme outputs the canonical form $ hg debugexpandscheme bb://user/repo https://bitbucket.org/user/repo expanding an unknown scheme emits the input $ hg debugexpandscheme foobar://this/that foobar://this/that expanding a canonical URL emits the input $ hg debugexpandscheme https://bitbucket.org/user/repo https://bitbucket.org/user/repo errors $ cat errors.log $ cd .. mercurial-4.5.3/tests/common-pattern.py0000644015407300116100000001221113261161234020051 0ustar augieeng00000000000000# common patterns in test at can safely be replaced from __future__ import absolute_import import os substitutions = [ # list of possible compressions (br'(zstd,)?zlib,none,bzip2', br'$USUAL_COMPRESSIONS$' ), (br'=(zstd,)?zlib', br'=$BUNDLE2_COMPRESSIONS$' ), # capabilities sent through http (br'bundlecaps=HG20%2Cbundle2%3DHG20%250A' br'bookmarks%250A' br'changegroup%253D01%252C02%250A' br'digests%253Dmd5%252Csha1%252Csha512%250A' br'error%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250A' br'hgtagsfnodes%250A' br'listkeys%250A' br'phases%253Dheads%250A' br'pushkey%250A' br'remote-changegroup%253Dhttp%252Chttps%250A' br'stream%253Dv2', # (the replacement patterns) br'$USUAL_BUNDLE_CAPS$' ), (br'bundlecaps=HG20%2Cbundle2%3DHG20%250A' br'bookmarks%250A' br'changegroup%253D01%252C02%250A' br'digests%253Dmd5%252Csha1%252Csha512%250A' br'error%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250A' br'hgtagsfnodes%250A' br'listkeys%250A' br'phases%253Dheads%250A' br'pushkey%250A' br'remote-changegroup%253Dhttp%252Chttps', # (the replacement patterns) br'$USUAL_BUNDLE_CAPS_SERVER$' ), # bundle2 capabilities sent through ssh (br'bundle2=HG20%0A' br'bookmarks%0A' br'changegroup%3D01%2C02%0A' br'digests%3Dmd5%2Csha1%2Csha512%0A' br'error%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0A' br'hgtagsfnodes%0A' br'listkeys%0A' br'phases%3Dheads%0A' br'pushkey%0A' br'remote-changegroup%3Dhttp%2Chttps%0A' br'stream%3Dv2', # (replacement patterns) br'$USUAL_BUNDLE2_CAPS$' ), # bundle2 capabilities advertised by the server (br'bundle2=HG20%0A' br'bookmarks%0A' br'changegroup%3D01%2C02%0A' br'digests%3Dmd5%2Csha1%2Csha512%0A' br'error%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0A' br'hgtagsfnodes%0A' br'listkeys%0A' br'phases%3Dheads%0A' br'pushkey%0A' br'remote-changegroup%3Dhttp%2Chttps', # (replacement patterns) br'$USUAL_BUNDLE2_CAPS_SERVER$' ), # HTTP log dates (br' - - \[\d\d/.../2\d\d\d \d\d:\d\d:\d\d] "GET', br' - - [$LOGDATE$] "GET' ), # Windows has an extra '/' in the following lines that get globbed away: # pushing to file:/*/$TESTTMP/r2 (glob) # comparing with file:/*/$TESTTMP/r2 (glob) # sub/maybelarge.dat: largefile 34..9c not available from # file:/*/$TESTTMP/largefiles-repo (glob) (br'(.*file:/)/?(/\$TESTTMP.*)', lambda m: m.group(1) + b'*' + m.group(2) + b' (glob)' ), ] # Various platform error strings, keyed on a common replacement string _errors = { br'$ENOENT$': ( # strerror() br'No such file or directory', # FormatMessage(ERROR_FILE_NOT_FOUND) br'The system cannot find the file specified', ), br'$ENOTDIR$': ( # strerror() br'Not a directory', # FormatMessage(ERROR_PATH_NOT_FOUND) br'The system cannot find the path specified', ), br'$ECONNRESET$': ( # strerror() br'Connection reset by peer', # FormatMessage(WSAECONNRESET) br'An existing connection was forcibly closed by the remote host', ), br'$EADDRINUSE$': ( # strerror() br'Address already in use', # FormatMessage(WSAEADDRINUSE) br'Only one usage of each socket address' br' \(protocol/network address/port\) is normally permitted', ), } for replace, msgs in _errors.items(): substitutions.extend((m, replace) for m in msgs) # Output lines on Windows that can be autocorrected for '\' vs '/' path # differences. _winpathfixes = [ # cloning subrepo s\ss from $TESTTMP/t/s/ss # cloning subrepo foo\bar from http://localhost:$HGPORT/foo/bar br'(?m)^cloning subrepo \S+\\.*', # pulling from $TESTTMP\issue1852a br'(?m)^pulling from \$TESTTMP\\.*', # pushing to $TESTTMP\a br'(?m)^pushing to \$TESTTMP\\.*', # pushing subrepo s\ss to $TESTTMP/t/s/ss br'(?m)^pushing subrepo \S+\\\S+ to.*', # moving d1\d11\a1 to d3/d11/a1 br'(?m)^moving \S+\\.*', # d1\a: not recording move - dummy does not exist br'\S+\\\S+: not recording move .+', # reverting s\a br'(?m)^reverting (?!subrepo ).*\\.*', # saved backup bundle to # $TESTTMP\test\.hg\strip-backup/443431ffac4f-2fc5398a-backup.hg br'(?m)^saved backup bundle to \$TESTTMP.*\.hg', # no changes made to subrepo s\ss since last push to ../tcc/s/ss br'(?m)^no changes made to subrepo \S+\\\S+ since.*', # changeset 5:9cc5aa7204f0: stuff/maybelarge.dat references missing # $TESTTMP\largefiles-repo-hg\.hg\largefiles\76..38 br'(?m)^changeset .* references (corrupted|missing) \$TESTTMP\\.*', # stuff/maybelarge.dat: largefile 76..38 not available from # file:/*/$TESTTMP\largefiles-repo (glob) br'.*: largefile \S+ not available from file:/\*/.+', ] if os.name == 'nt': substitutions.extend([(s, lambda match: match.group().replace(b'\\', b'/')) for s in _winpathfixes]) mercurial-4.5.3/tests/test-import-merge.t0000644015407300116100000001055413261161234020315 0ustar augieeng00000000000000 $ echo "[extensions]" >> $HGRCPATH $ echo "mq=" >> $HGRCPATH $ tipparents() { > hg parents --template "{rev}:{node|short} {desc|firstline}\n" -r tip > } Test import and merge diffs $ hg init repo $ cd repo $ echo a > a $ hg ci -Am adda adding a $ echo a >> a $ hg ci -m changea $ echo c > c $ hg ci -Am addc adding c $ hg up 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo b > b $ hg ci -Am addb adding b created new head $ hg up 1 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg merge 3 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m merge $ hg export . > ../merge.diff $ grep -v '^merge$' ../merge.diff > ../merge.nomsg.diff $ cd .. $ hg clone -r2 repo repo2 adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 2 files new changesets 07f494440405:890ecaa90481 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd repo2 $ hg pull -r3 ../repo pulling from ../repo searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 102a90ea7b4a (run 'hg heads' to see heads, 'hg merge' to merge) Test without --exact and diff.p1 == workingdir.p1 $ hg up 1 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ cat > $TESTTMP/editor.sh < env | grep HGEDITFORM > echo merge > \$1 > EOF $ HGEDITOR="sh $TESTTMP/editor.sh" hg import --edit ../merge.nomsg.diff applying ../merge.nomsg.diff HGEDITFORM=import.normal.merge $ tipparents 1:540395c44225 changea 3:102a90ea7b4a addb $ hg strip --no-backup tip 0 files updated, 0 files merged, 1 files removed, 0 files unresolved Test without --exact and diff.p1 != workingdir.p1 $ hg up 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg import ../merge.diff applying ../merge.diff warning: import the patch as a normal revision (use --exact to import the patch as a merge) $ tipparents 2:890ecaa90481 addc $ hg strip --no-backup tip 0 files updated, 0 files merged, 1 files removed, 0 files unresolved Test with --exact $ hg import --exact ../merge.diff applying ../merge.diff 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ tipparents 1:540395c44225 changea 3:102a90ea7b4a addb $ hg strip --no-backup tip 0 files updated, 0 files merged, 1 files removed, 0 files unresolved Test with --bypass and diff.p1 == workingdir.p1 $ hg up 1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg import --bypass ../merge.diff applying ../merge.diff $ tipparents 1:540395c44225 changea 3:102a90ea7b4a addb $ hg strip --no-backup tip Test with --bypass and diff.p1 != workingdir.p1 $ hg up 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg import --bypass ../merge.diff applying ../merge.diff warning: import the patch as a normal revision (use --exact to import the patch as a merge) $ tipparents 2:890ecaa90481 addc $ hg strip --no-backup tip Test with --bypass and --exact $ hg import --bypass --exact ../merge.diff applying ../merge.diff $ tipparents 1:540395c44225 changea 3:102a90ea7b4a addb $ hg strip --no-backup tip $ cd .. Test that --exact on a bad header doesn't corrupt the repo (issue3616) $ hg init repo3 $ cd repo3 $ echo a>a $ hg ci -Aqm0 $ echo a>>a $ hg ci -m1 $ echo a>>a $ hg ci -m2 $ echo a>a $ echo b>>a $ echo a>>a $ hg ci -m3 $ hg export 2 | head -7 > ../a.patch $ hg export tip > out >>> apatch = open("../a.patch", "ab") >>> apatch.write("".join(open("out").readlines()[7:])) $ cd .. $ hg clone -qr0 repo3 repo3-clone $ cd repo3-clone $ hg pull -qr1 ../repo3 $ hg import --exact ../a.patch applying ../a.patch 1 files updated, 0 files merged, 0 files removed, 0 files unresolved patching file a Hunk #1 succeeded at 1 with fuzz 1 (offset -1 lines). transaction abort! rollback completed abort: patch is damaged or loses information [255] $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 2 changesets, 2 total revisions mercurial-4.5.3/tests/test-convert-bzr-directories.t0000644015407300116100000001034613261161234022472 0ustar augieeng00000000000000#require bzr $ . "$TESTDIR/bzr-definitions" empty directory $ mkdir test-empty $ cd test-empty $ bzr init -q source $ cd source $ echo content > a $ bzr add -q a $ bzr commit -q -m 'Initial add' $ mkdir empty $ bzr add -q empty $ bzr commit -q -m 'Empty directory added' $ echo content > empty/something $ bzr add -q empty/something $ bzr commit -q -m 'Added file into directory' $ cd .. $ hg convert source source-hg initializing destination source-hg repository scanning source... sorting... converting... 2 Initial add 1 Empty directory added 0 Added file into directory $ manifest source-hg 1 % manifest of 1 644 a $ manifest source-hg tip % manifest of tip 644 a 644 empty/something $ cd .. directory renames $ mkdir test-dir-rename $ cd test-dir-rename $ bzr init -q source $ cd source $ mkdir tpyo $ echo content > tpyo/something $ bzr add -q tpyo $ bzr commit -q -m 'Added directory' $ bzr mv tpyo typo tpyo => typo $ bzr commit -q -m 'Oops, typo' $ cd .. $ hg convert source source-hg initializing destination source-hg repository scanning source... sorting... converting... 1 Added directory 0 Oops, typo $ manifest source-hg 0 % manifest of 0 644 tpyo/something $ manifest source-hg tip % manifest of tip 644 typo/something $ cd .. nested directory renames $ mkdir test-nested-dir-rename $ cd test-nested-dir-rename $ bzr init -q source $ cd source $ mkdir -p firstlevel/secondlevel/thirdlevel $ echo content > firstlevel/secondlevel/file $ echo this_needs_to_be_there_too > firstlevel/secondlevel/thirdlevel/stuff $ bzr add -q firstlevel $ bzr commit -q -m 'Added nested directories' $ bzr mv firstlevel/secondlevel secondlevel firstlevel/secondlevel => secondlevel $ bzr commit -q -m 'Moved secondlevel one level up' $ cd .. $ hg convert source source-hg initializing destination source-hg repository scanning source... sorting... converting... 1 Added nested directories 0 Moved secondlevel one level up $ manifest source-hg tip % manifest of tip 644 secondlevel/file 644 secondlevel/thirdlevel/stuff $ cd .. directory remove $ mkdir test-dir-remove $ cd test-dir-remove $ bzr init -q source $ cd source $ mkdir src $ echo content > src/sourcecode $ bzr add -q src $ bzr commit -q -m 'Added directory' $ bzr rm -q src $ bzr commit -q -m 'Removed directory' $ cd .. $ hg convert source source-hg initializing destination source-hg repository scanning source... sorting... converting... 1 Added directory 0 Removed directory $ manifest source-hg 0 % manifest of 0 644 src/sourcecode $ manifest source-hg tip % manifest of tip $ cd .. directory replace $ mkdir test-dir-replace $ cd test-dir-replace $ bzr init -q source $ cd source $ mkdir first second $ echo content > first/file $ echo morecontent > first/dummy $ echo othercontent > second/something $ bzr add -q first second $ bzr commit -q -m 'Initial layout' $ bzr mv first/file second/file first/file => second/file $ bzr mv first third first => third $ bzr commit -q -m 'Some conflicting moves' $ cd .. $ hg convert source source-hg initializing destination source-hg repository scanning source... sorting... converting... 1 Initial layout 0 Some conflicting moves $ manifest source-hg tip % manifest of tip 644 second/file 644 second/something 644 third/dummy $ cd .. divergent nested renames (issue3089) $ mkdir test-divergent-renames $ cd test-divergent-renames $ bzr init -q source $ cd source $ mkdir -p a/c $ echo a > a/fa $ echo c > a/c/fc $ bzr add -q a $ bzr commit -q -m 'Initial layout' $ bzr mv a b a => b $ mkdir a $ bzr add a add(ed|ing) a (re) $ bzr mv b/c a/c b/c => a/c $ bzr status added: a/ renamed: a/? => b/? (re) a/c/? => a/c/? (re) $ bzr commit -q -m 'Divergent renames' $ cd .. $ hg convert source source-hg initializing destination source-hg repository scanning source... sorting... converting... 1 Initial layout 0 Divergent renames $ hg -R source-hg st -C --change 1 A b/fa a/fa R a/fa $ hg -R source-hg manifest -r 1 a/c/fc b/fa $ cd .. mercurial-4.5.3/tests/test-eol-add.t0000644015407300116100000000462713261161234017217 0ustar augieeng00000000000000Test adding .hgeol $ cat >> $HGRCPATH < [diff] > git = 1 > EOF $ seteol () { > if [ $1 = "LF" ]; then > EOL='\n' > else > EOL='\r\n' > fi > } $ makerepo () { > echo > echo "# ==== setup repository ====" > echo '% hg init' > hg init repo > cd repo > printf "first\nsecond\nthird\n" > a.txt > hg commit -d '100 0' --addremove -m 'LF commit' > cd .. > } $ dotest () { > seteol $1 > echo > echo "% hg clone repo repo-$1" > hg clone repo repo-$1 > cd repo-$1 > cat > .hg/hgrc < [extensions] > eol = > [eol] > native = LF > EOF > cat > .hgeol < [patterns] > **.txt = native > [repository] > native = $1 > EOF > echo '% hg add .hgeol' > hg add .hgeol > echo '% hg status' > hg status > echo '% hg commit' > hg commit -d '200 0' -m 'Added .hgeol file' > echo '% hg status' > hg status > echo '% hg tip -p' > hg tip -p > cd .. > rm -r repo-$1 > } $ makerepo # ==== setup repository ==== % hg init adding a.txt $ dotest LF % hg clone repo repo-LF updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved % hg add .hgeol % hg status A .hgeol % hg commit % hg status % hg tip -p changeset: 1:33503edb53b0 tag: tip user: test date: Thu Jan 01 00:03:20 1970 +0000 summary: Added .hgeol file diff --git a/.hgeol b/.hgeol new file mode 100644 --- /dev/null +++ b/.hgeol @@ -0,0 +1,4 @@ +[patterns] +**.txt = native +[repository] +native = LF $ dotest CRLF % hg clone repo repo-CRLF updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved % hg add .hgeol % hg status M a.txt A .hgeol % hg commit % hg status % hg tip -p changeset: 1:6e64eaa9eb23 tag: tip user: test date: Thu Jan 01 00:03:20 1970 +0000 summary: Added .hgeol file diff --git a/.hgeol b/.hgeol new file mode 100644 --- /dev/null +++ b/.hgeol @@ -0,0 +1,4 @@ +[patterns] +**.txt = native +[repository] +native = CRLF diff --git a/a.txt b/a.txt --- a/a.txt +++ b/a.txt @@ -1,3 +1,3 @@ -first -second -third +first\r (esc) +second\r (esc) +third\r (esc) $ rm -r repo mercurial-4.5.3/tests/test-convert-bzr-merges.t0000644015407300116100000000343513261161234021441 0ustar augieeng00000000000000#require bzr N.B. bzr 1.13 has a bug that breaks this test. If you see this test fail, check your bzr version. Upgrading to bzr 1.13.1 should fix it. $ . "$TESTDIR/bzr-definitions" test multiple merges at once $ mkdir test-multimerge $ cd test-multimerge $ bzr init -q source $ cd source $ echo content > file $ bzr add -q file $ bzr commit -q -m 'Initial add' $ cd .. $ bzr branch -q source source-branch1 $ cd source-branch1 $ echo morecontent >> file $ echo evenmorecontent > file-branch1 $ bzr add -q file-branch1 $ bzr commit -q -m 'Added branch1 file' $ cd ../source $ sleep 1 $ echo content > file-parent $ bzr add -q file-parent $ bzr commit -q -m 'Added parent file' $ cd .. $ bzr branch -q source source-branch2 $ cd source-branch2 $ echo somecontent > file-branch2 $ bzr add -q file-branch2 $ bzr commit -q -m 'Added brach2 file' $ sleep 1 $ cd ../source $ bzr merge -q ../source-branch1 $ bzr merge -q --force ../source-branch2 $ bzr commit -q -m 'Merged branches' $ cd .. $ hg convert --datesort source source-hg initializing destination source-hg repository scanning source... sorting... converting... 4 Initial add 3 Added branch1 file 2 Added parent file 1 Added brach2 file 0 Merged branches $ glog -R source-hg o 5@source "(octopus merge fixup)" files: |\ | o 4@source "Merged branches" files: file-branch2 | |\ o---+ 3@source-branch2 "Added brach2 file" files: file-branch2 / / | o 2@source "Added parent file" files: file-parent | | o | 1@source-branch1 "Added branch1 file" files: file file-branch1 |/ o 0@source "Initial add" files: file $ manifest source-hg tip % manifest of tip 644 file 644 file-branch1 644 file-branch2 644 file-parent $ cd .. mercurial-4.5.3/tests/test-flags.t0000644015407300116100000000762113261161234017003 0ustar augieeng00000000000000#require execbit $ umask 027 $ hg init test1 $ cd test1 $ touch a b $ hg add a b $ hg ci -m "added a b" $ cd .. $ hg clone test1 test3 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg init test2 $ cd test2 $ hg pull ../test1 pulling from ../test1 requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files new changesets 22a449e20da5 (run 'hg update' to get a working copy) $ hg co 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ chmod +x a $ hg ci -m "chmod +x a" the changelog should mention file a: $ hg tip --template '{files}\n' a $ cd ../test1 $ echo 123 >>a $ hg ci -m "a updated" $ hg pull ../test2 pulling from ../test2 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 0 changes to 0 files (+1 heads) new changesets 7f4313b42a34 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg heads changeset: 2:7f4313b42a34 tag: tip parent: 0:22a449e20da5 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: chmod +x a changeset: 1:c6ecefc45368 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a updated $ hg history changeset: 2:7f4313b42a34 tag: tip parent: 0:22a449e20da5 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: chmod +x a changeset: 1:c6ecefc45368 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a updated changeset: 0:22a449e20da5 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: added a b $ hg -v merge resolving manifests 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat a 123 $ [ -x a ] $ cd ../test3 $ echo 123 >>b $ hg ci -m "b updated" $ hg pull ../test2 pulling from ../test2 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 0 changes to 0 files (+1 heads) new changesets 7f4313b42a34 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg heads changeset: 2:7f4313b42a34 tag: tip parent: 0:22a449e20da5 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: chmod +x a changeset: 1:dc57ead75f79 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: b updated $ hg history changeset: 2:7f4313b42a34 tag: tip parent: 0:22a449e20da5 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: chmod +x a changeset: 1:dc57ead75f79 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: b updated changeset: 0:22a449e20da5 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: added a b $ hg -v merge resolving manifests 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ ls -l ../test[123]/a > foo $ cut -b 1-10 < foo -rwxr-x--- -rwxr-x--- -rwxr-x--- $ hg debugindex a rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 0 ..... 0 b80de5d13875 000000000000 000000000000 (re) $ hg debugindex -R ../test2 a rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 0 ..... 0 b80de5d13875 000000000000 000000000000 (re) $ hg debugindex -R ../test1 a rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 0 ..... 0 b80de5d13875 000000000000 000000000000 (re) 1 0 5 ..... 1 7fe919cc0336 b80de5d13875 000000000000 (re) $ cd .. mercurial-4.5.3/tests/test-check-pyflakes.t0000644015407300116100000000115313261161234020572 0ustar augieeng00000000000000#require test-repo pyflakes hg10 $ . "$TESTDIR/helpers-testrepo.sh" run pyflakes on all tracked files ending in .py or without a file ending (skipping binary file random-seed) $ cat > test.py < print(undefinedname) > EOF $ pyflakes test.py 2>/dev/null | "$TESTDIR/filterpyflakes.py" test.py:1: undefined name 'undefinedname' $ cd "`dirname "$TESTDIR"`" $ testrepohg locate 'set:**.py or grep("^#!.*python")' \ > -X hgext/fsmonitor/pywatchman \ > -X mercurial/pycompat.py -X contrib/python-zstandard \ > 2>/dev/null \ > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py" mercurial-4.5.3/tests/crashgetbundler.py0000644015407300116100000000047513261161234020273 0ustar augieeng00000000000000from __future__ import absolute_import from mercurial.i18n import _ from mercurial import ( changegroup, error, extensions ) def abort(orig, *args, **kwargs): raise error.Abort(_('this is an exercise')) def uisetup(ui): extensions.wrapfunction(changegroup, 'getbundler', abort) mercurial-4.5.3/tests/test-hgweb-no-path-info.t0000644015407300116100000000743413261161234021302 0ustar augieeng00000000000000This tests if hgweb and hgwebdir still work if the REQUEST_URI variable is no longer passed with the request. Instead, SCRIPT_NAME and PATH_INFO should be used from d74fc8dec2b4 onward to route the request. $ hg init repo $ cd repo $ echo foo > bar $ hg add bar $ hg commit -m "test" $ hg tip changeset: 0:61c9426e69fe tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: test $ cat > request.py < from __future__ import absolute_import > import os > import sys > from mercurial.hgweb import ( > hgweb, > hgwebdir, > ) > from mercurial import ( > util, > ) > stringio = util.stringio > > errors = stringio() > input = stringio() > > def startrsp(status, headers): > print('---- STATUS') > print(status) > print('---- HEADERS') > print([i for i in headers if i[0] != 'ETag']) > print('---- DATA') > return output.write > > env = { > 'wsgi.version': (1, 0), > 'wsgi.url_scheme': 'http', > 'wsgi.errors': errors, > 'wsgi.input': input, > 'wsgi.multithread': False, > 'wsgi.multiprocess': False, > 'wsgi.run_once': False, > 'REQUEST_METHOD': 'GET', > 'PATH_INFO': '/', > 'SCRIPT_NAME': '', > 'SERVER_NAME': '$LOCALIP', > 'SERVER_PORT': os.environ['HGPORT'], > 'SERVER_PROTOCOL': 'HTTP/1.0' > } > > def process(app): > content = app(env, startrsp) > sys.stdout.write(output.getvalue()) > sys.stdout.write(''.join(content)) > getattr(content, 'close', lambda : None)() > print('---- ERRORS') > print(errors.getvalue()) > > output = stringio() > env['QUERY_STRING'] = 'style=atom' > process(hgweb('.', name='repo')) > > output = stringio() > env['QUERY_STRING'] = 'style=raw' > process(hgwebdir({'repo': '.'})) > EOF $ $PYTHON request.py ---- STATUS 200 Script output follows ---- HEADERS [('Content-Type', 'application/atom+xml; charset=ascii')] ---- DATA http://$LOCALIP:$HGPORT/ (glob) (glob) (glob) repo Changelog 1970-01-01T00:00:00+00:00 [default] test http://$LOCALIP:$HGPORT/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c (glob) (glob) test test 1970-01-01T00:00:00+00:00 1970-01-01T00:00:00+00:00
changeset 61c9426e69fe
branch default
bookmark
tag tip
user test
description test
files bar
---- ERRORS ---- STATUS 200 Script output follows ---- HEADERS [('Content-Type', 'text/plain; charset=ascii')] ---- DATA /repo/ ---- ERRORS $ cd .. mercurial-4.5.3/tests/test-sshserver.py0000644015407300116100000000234513261161234020116 0ustar augieeng00000000000000from __future__ import absolute_import, print_function import io import unittest import silenttestrunner from mercurial import ( sshserver, util, wireproto, ) class SSHServerGetArgsTests(unittest.TestCase): def testparseknown(self): tests = [ ('* 0\nnodes 0\n', ['', {}]), ('* 0\nnodes 40\n1111111111111111111111111111111111111111\n', ['1111111111111111111111111111111111111111', {}]), ] for input, expected in tests: self.assertparse('known', input, expected) def assertparse(self, cmd, input, expected): server = mockserver(input) _func, spec = wireproto.commands[cmd] self.assertEqual(server.getargs(spec), expected) def mockserver(inbytes): ui = mockui(inbytes) repo = mockrepo(ui) return sshserver.sshserver(ui, repo) class mockrepo(object): def __init__(self, ui): self.ui = ui class mockui(object): def __init__(self, inbytes): self.fin = io.BytesIO(inbytes) self.fout = io.BytesIO() self.ferr = io.BytesIO() if __name__ == '__main__': # Don't call into msvcrt to set BytesIO to binary mode util.setbinary = lambda fp: True silenttestrunner.main(__name__) mercurial-4.5.3/tests/test-merge-symlinks.t0000644015407300116100000000310113261161234020642 0ustar augieeng00000000000000 $ cat > echo.py < #!$PYTHON > from __future__ import absolute_import, print_function > import os > import sys > try: > import msvcrt > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) > except ImportError: > pass > > for k in ('HG_FILE', 'HG_MY_ISLINK', 'HG_OTHER_ISLINK', 'HG_BASE_ISLINK'): > print(k, os.environ[k]) > EOF Create 2 heads containing the same file, once as a file, once as a link. Bundle was generated with: # hg init t # cd t # echo a > a # hg ci -qAm t0 -d '0 0' # echo l > l # hg ci -qAm t1 -d '1 0' # hg up -C 0 # ln -s a l # hg ci -qAm t2 -d '2 0' # echo l2 > l2 # hg ci -qAm t3 -d '3 0' $ hg init t $ cd t $ hg -q pull "$TESTDIR/bundles/test-merge-symlinks.hg" $ hg up -C 3 3 files updated, 0 files merged, 0 files removed, 0 files unresolved Merge them and display *_ISLINK vars merge heads $ hg merge --tool="$PYTHON ../echo.py" merging l HG_FILE l HG_MY_ISLINK 1 HG_OTHER_ISLINK 0 HG_BASE_ISLINK 0 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) Test working directory symlink bit calculation wrt copies, especially on non-supporting systems. merge working directory $ hg up -C 2 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg copy l l2 $ HGMERGE="$PYTHON ../echo.py" hg up 3 merging l2 HG_FILE l2 HG_MY_ISLINK 1 HG_OTHER_ISLINK 0 HG_BASE_ISLINK 0 0 files updated, 1 files merged, 0 files removed, 0 files unresolved $ cd .. mercurial-4.5.3/tests/test-revert-interactive.t0000644015407300116100000001636713261161234021540 0ustar augieeng00000000000000Revert interactive tests 1 add and commit file f 2 add commit file folder1/g 3 add and commit file folder2/h 4 add and commit file folder1/i 5 commit change to file f 6 commit changes to files folder1/g folder2/h 7 commit changes to files folder1/g folder2/h 8 revert interactive to commit id 2 (line 3 above), check that folder1/i is removed and 9 make workdir match 7 10 run the same test than 8 from within folder1 and check same expectations $ cat <> $HGRCPATH > [ui] > interactive = true > [extensions] > record = > purge = > EOF $ mkdir -p a/folder1 a/folder2 $ cd a $ hg init >>> open('f', 'wb').write("1\n2\n3\n4\n5\n") $ hg add f ; hg commit -m "adding f" $ cat f > folder1/g ; hg add folder1/g ; hg commit -m "adding folder1/g" $ cat f > folder2/h ; hg add folder2/h ; hg commit -m "adding folder2/h" $ cat f > folder1/i ; hg add folder1/i ; hg commit -m "adding folder1/i" >>> open('f', 'wb').write("a\n1\n2\n3\n4\n5\nb\n") $ hg commit -m "modifying f" >>> open('folder1/g', 'wb').write("c\n1\n2\n3\n4\n5\nd\n") $ hg commit -m "modifying folder1/g" >>> open('folder2/h', 'wb').write("e\n1\n2\n3\n4\n5\nf\n") $ hg commit -m "modifying folder2/h" $ hg tip changeset: 6:59dd6e4ab63a tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modifying folder2/h $ hg revert -i -r 2 --all -- << EOF > y > y > y > y > y > ? > y > n > n > EOF reverting f reverting folder1/g removing folder1/i reverting folder2/h remove added file folder1/i (Yn)? y diff --git a/f b/f 2 hunks, 2 lines changed examine changes to 'f'? [Ynesfdaq?] y @@ -1,6 +1,5 @@ -a 1 2 3 4 5 apply change 1/6 to 'f'? [Ynesfdaq?] y @@ -2,6 +1,5 @@ 1 2 3 4 5 -b apply change 2/6 to 'f'? [Ynesfdaq?] y diff --git a/folder1/g b/folder1/g 2 hunks, 2 lines changed examine changes to 'folder1/g'? [Ynesfdaq?] y @@ -1,6 +1,5 @@ -c 1 2 3 4 5 apply change 3/6 to 'folder1/g'? [Ynesfdaq?] ? y - yes, apply this change n - no, skip this change e - edit this change manually s - skip remaining changes to this file f - apply remaining changes to this file d - done, skip remaining changes and files a - apply all changes to all remaining files q - quit, applying no changes ? - ? (display help) apply change 3/6 to 'folder1/g'? [Ynesfdaq?] y @@ -2,6 +1,5 @@ 1 2 3 4 5 -d apply change 4/6 to 'folder1/g'? [Ynesfdaq?] n diff --git a/folder2/h b/folder2/h 2 hunks, 2 lines changed examine changes to 'folder2/h'? [Ynesfdaq?] n $ cat f 1 2 3 4 5 $ cat folder1/g 1 2 3 4 5 d $ cat folder2/h e 1 2 3 4 5 f Test that --interactive lift the need for --all $ echo q | hg revert -i -r 2 reverting folder1/g reverting folder2/h diff --git a/folder1/g b/folder1/g 1 hunks, 1 lines changed examine changes to 'folder1/g'? [Ynesfdaq?] q abort: user quit [255] $ ls folder1/ g Test that a noop revert doesn't do an unnecessary backup $ (echo y; echo n) | hg revert -i -r 2 folder1/g diff --git a/folder1/g b/folder1/g 1 hunks, 1 lines changed examine changes to 'folder1/g'? [Ynesfdaq?] y @@ -3,4 +3,3 @@ 3 4 5 -d apply this change to 'folder1/g'? [Ynesfdaq?] n $ ls folder1/ g Test --no-backup $ (echo y; echo y) | hg revert -i -C -r 2 folder1/g diff --git a/folder1/g b/folder1/g 1 hunks, 1 lines changed examine changes to 'folder1/g'? [Ynesfdaq?] y @@ -3,4 +3,3 @@ 3 4 5 -d apply this change to 'folder1/g'? [Ynesfdaq?] y $ ls folder1/ g >>> open('folder1/g', 'wb').write("1\n2\n3\n4\n5\nd\n") $ hg update -C 6 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg revert -i -r 2 --all -- << EOF > n > y > y > y > y > y > n > n > EOF reverting f reverting folder1/g removing folder1/i reverting folder2/h remove added file folder1/i (Yn)? n diff --git a/f b/f 2 hunks, 2 lines changed examine changes to 'f'? [Ynesfdaq?] y @@ -1,6 +1,5 @@ -a 1 2 3 4 5 apply change 1/6 to 'f'? [Ynesfdaq?] y @@ -2,6 +1,5 @@ 1 2 3 4 5 -b apply change 2/6 to 'f'? [Ynesfdaq?] y diff --git a/folder1/g b/folder1/g 2 hunks, 2 lines changed examine changes to 'folder1/g'? [Ynesfdaq?] y @@ -1,6 +1,5 @@ -c 1 2 3 4 5 apply change 3/6 to 'folder1/g'? [Ynesfdaq?] y @@ -2,6 +1,5 @@ 1 2 3 4 5 -d apply change 4/6 to 'folder1/g'? [Ynesfdaq?] n diff --git a/folder2/h b/folder2/h 2 hunks, 2 lines changed examine changes to 'folder2/h'? [Ynesfdaq?] n $ cat f 1 2 3 4 5 $ cat folder1/g 1 2 3 4 5 d $ cat folder2/h e 1 2 3 4 5 f $ hg st M f M folder1/g $ hg revert --interactive f << EOF > y > ? > y > n > n > EOF diff --git a/f b/f 2 hunks, 2 lines changed examine changes to 'f'? [Ynesfdaq?] y @@ -1,6 +1,5 @@ -a 1 2 3 4 5 discard change 1/2 to 'f'? [Ynesfdaq?] ? y - yes, discard this change n - no, skip this change e - edit this change manually s - skip remaining changes to this file f - discard remaining changes to this file d - done, skip remaining changes and files a - discard all changes to all remaining files q - quit, discarding no changes ? - ? (display help) discard change 1/2 to 'f'? [Ynesfdaq?] y @@ -2,6 +1,5 @@ 1 2 3 4 5 -b discard change 2/2 to 'f'? [Ynesfdaq?] n $ hg st M f M folder1/g ? f.orig $ cat f a 1 2 3 4 5 $ cat f.orig 1 2 3 4 5 $ rm f.orig $ hg update -C . 2 files updated, 0 files merged, 0 files removed, 0 files unresolved Check editing files newly added by a revert 1) Create a dummy editor changing 1 to 42 $ cat > $TESTTMP/editor.sh << '__EOF__' > cat "$1" | sed "s/1/42/g" > tt > mv tt "$1" > __EOF__ 2) Add k $ printf "1\n" > k $ hg add k $ hg commit -m "add k" 3) Use interactive revert with editing (replacing +1 with +42): $ printf "0\n2\n" > k $ HGEDITOR="\"sh\" \"${TESTTMP}/editor.sh\"" hg revert -i < y > e > EOF reverting k diff --git a/k b/k 1 hunks, 2 lines changed examine changes to 'k'? [Ynesfdaq?] y @@ -1,1 +1,2 @@ -1 +0 +2 discard this change to 'k'? [Ynesfdaq?] e $ cat k 42 $ hg update -C . 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg purge $ touch newfile $ hg add newfile $ hg status A newfile $ hg revert -i < n > EOF forgetting newfile forget added file newfile (Yn)? n $ hg status A newfile $ hg revert -i < y > EOF forgetting newfile forget added file newfile (Yn)? y $ hg status ? newfile When a line without EOL is selected during "revert -i" (issue5651) $ hg init $TESTTMP/revert-i-eol $ cd $TESTTMP/revert-i-eol $ echo 0 > a $ hg ci -qAm 0 $ printf 1 >> a $ hg ci -qAm 1 $ cat a 0 1 (no-eol) $ hg revert -ir'.^' < y > y > EOF reverting a diff --git a/a b/a 1 hunks, 1 lines changed examine changes to 'a'? [Ynesfdaq?] y @@ -1,2 +1,1 @@ 0 -1 \ No newline at end of file apply this change to 'a'? [Ynesfdaq?] y $ cat a 0 $ cd .. mercurial-4.5.3/tests/test-largefiles-update.t0000644015407300116100000005654513261161234021315 0ustar augieeng00000000000000This file focuses mainly on updating largefiles in the working directory (and ".hg/largefiles/dirstate") $ cat >> $HGRCPATH < [ui] > merge = internal:fail > [extensions] > largefiles = > [extdiff] > # for portability: > pdiff = sh "$RUNTESTDIR/pdiff" > EOF $ hg init repo $ cd repo $ echo large1 > large1 $ echo large2 > large2 $ hg add --large large1 large2 $ echo normal1 > normal1 $ hg add normal1 $ hg commit -m '#0' $ echo 'large1 in #1' > large1 $ echo 'normal1 in #1' > normal1 $ hg commit -m '#1' $ hg pdiff -r '.^' --config extensions.extdiff= diff -Nru repo.0d9d9b8dc9a3/.hglf/large1 repo/.hglf/large1 --- repo.0d9d9b8dc9a3/.hglf/large1 * (glob) +++ repo/.hglf/large1 * (glob) @@ -1* +1* @@ (glob) -4669e532d5b2c093a78eca010077e708a071bb64 +58e24f733a964da346e2407a2bee99d9001184f5 diff -Nru repo.0d9d9b8dc9a3/normal1 repo/normal1 --- repo.0d9d9b8dc9a3/normal1 * (glob) +++ repo/normal1 * (glob) @@ -1* +1* @@ (glob) -normal1 +normal1 in #1 [1] $ hg update -q -C 0 $ echo 'large2 in #2' > large2 $ hg commit -m '#2' created new head Test that update also updates the lfdirstate of 'unsure' largefiles after hashing them: The previous operations will usually have left us with largefiles with a mtime within the same second as the dirstate was written. The lfdirstate entries will thus have been written with an invalidated/unset mtime to make sure further changes within the same second is detected. We will however occasionally be "lucky" and get a tick between writing largefiles and writing dirstate so we get valid lfdirstate timestamps. The following verification is thus disabled but can be verified manually. #if false $ hg debugdirstate --large --nodate n 644 7 unset large1 n 644 13 unset large2 #endif Wait to make sure we get a tick so the mtime of the largefiles become valid. $ sleep 1 A linear merge will update standins before performing the actual merge. It will do a lfdirstate status walk and find 'unset'/'unsure' files, hash them, and update the corresponding standins. Verify that it actually marks the clean files as clean in lfdirstate so we don't have to hash them again next time we update. $ hg up 0 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to "f74e50bd9e55: #2" 1 other heads for branch "default" $ hg debugdirstate --large --nodate n 644 7 set large1 n 644 13 set large2 Test that lfdirstate keeps track of last modification of largefiles and prevents unnecessary hashing of content - also after linear/noop update $ sleep 1 $ hg st $ hg debugdirstate --large --nodate n 644 7 set large1 n 644 13 set large2 $ hg up 0 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to "f74e50bd9e55: #2" 1 other heads for branch "default" $ hg debugdirstate --large --nodate n 644 7 set large1 n 644 13 set large2 Test that "hg merge" updates largefiles from "other" correctly (getting largefiles from "other" normally) $ hg status -A large1 C large1 $ cat large1 large1 $ cat .hglf/large1 4669e532d5b2c093a78eca010077e708a071bb64 $ hg merge --config debug.dirstate.delaywrite=2 getting changed largefiles 1 largefiles updated, 0 removed 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg status -A large1 M large1 $ cat large1 large1 in #1 $ cat .hglf/large1 58e24f733a964da346e2407a2bee99d9001184f5 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]' -4669e532d5b2c093a78eca010077e708a071bb64 +58e24f733a964da346e2407a2bee99d9001184f5 (getting largefiles from "other" via conflict prompt) $ hg update -q -C 2 $ echo 'large1 in #3' > large1 $ echo 'normal1 in #3' > normal1 $ hg commit -m '#3' $ cat .hglf/large1 e5bb990443d6a92aaf7223813720f7566c9dd05b $ hg merge --config debug.dirstate.delaywrite=2 --config ui.interactive=True < o > EOF largefile large1 has a merge conflict ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o merging normal1 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark') getting changed largefiles 1 largefiles updated, 0 removed 0 files updated, 1 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ hg status -A large1 M large1 $ cat large1 large1 in #1 $ cat .hglf/large1 58e24f733a964da346e2407a2bee99d9001184f5 $ rm normal1.orig (merge non-existing largefiles from "other" via conflict prompt - make sure the following commit doesn't abort in a confusing way when trying to mark the non-existing file as normal in lfdirstate) $ mv .hg/largefiles/58e24f733a964da346e2407a2bee99d9001184f5 . $ hg update -q -C 3 $ hg merge --config largefiles.usercache=not --config debug.dirstate.delaywrite=2 --tool :local --config ui.interactive=True < o > EOF largefile large1 has a merge conflict ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o getting changed largefiles large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob) 0 largefiles updated, 0 removed 0 files updated, 2 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg commit -m '1-2-3 testing' --config largefiles.usercache=not large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from local store $ hg up -C . --config largefiles.usercache=not getting changed largefiles large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob) 0 largefiles updated, 0 removed 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg st large1 ! large1 $ hg rollback -q $ mv 58e24f733a964da346e2407a2bee99d9001184f5 .hg/largefiles/ Test that "hg revert -r REV" updates largefiles from "REV" correctly $ hg update -q -C 3 $ hg status -A large1 C large1 $ cat large1 large1 in #3 $ cat .hglf/large1 e5bb990443d6a92aaf7223813720f7566c9dd05b $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]' -4669e532d5b2c093a78eca010077e708a071bb64 +58e24f733a964da346e2407a2bee99d9001184f5 $ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1 $ hg status -A large1 M large1 $ cat large1 large1 in #1 $ cat .hglf/large1 58e24f733a964da346e2407a2bee99d9001184f5 Test that "hg rollback" restores status of largefiles correctly $ hg update -C -q $ hg remove large1 $ test -f .hglf/large1 [1] $ hg forget large2 $ test -f .hglf/large2 [1] $ echo largeX > largeX $ hg add --large largeX $ cat .hglf/largeX $ hg commit -m 'will be rollback-ed soon' $ echo largeY > largeY $ hg add --large largeY $ hg status -A large1 large1: $ENOENT$ $ hg status -A large2 ? large2 $ hg status -A largeX C largeX $ hg status -A largeY A largeY $ hg rollback repository tip rolled back to revision 3 (undo commit) working directory now based on revision 3 $ hg status -A large1 R large1 $ test -f .hglf/large1 [1] $ hg status -A large2 R large2 $ test -f .hglf/large2 [1] $ hg status -A largeX A largeX $ cat .hglf/largeX $ hg status -A largeY ? largeY $ test -f .hglf/largeY [1] $ rm largeY Test that "hg rollback" restores standins correctly $ hg commit -m 'will be rollback-ed soon' $ hg update -q -C 2 $ cat large1 large1 $ cat .hglf/large1 4669e532d5b2c093a78eca010077e708a071bb64 $ cat large2 large2 in #2 $ cat .hglf/large2 3cfce6277e7668985707b6887ce56f9f62f6ccd9 $ hg rollback -q -f $ cat large1 large1 $ cat .hglf/large1 4669e532d5b2c093a78eca010077e708a071bb64 $ cat large2 large2 in #2 $ cat .hglf/large2 3cfce6277e7668985707b6887ce56f9f62f6ccd9 (rollback the parent of the working directory, when the parent of it is not branch-tip) $ hg update -q -C 1 $ cat .hglf/large1 58e24f733a964da346e2407a2bee99d9001184f5 $ cat .hglf/large2 1deebade43c8c498a3c8daddac0244dc55d1331d $ echo normalX > normalX $ hg add normalX $ hg commit -m 'will be rollback-ed soon' $ hg rollback -q $ cat .hglf/large1 58e24f733a964da346e2407a2bee99d9001184f5 $ cat .hglf/large2 1deebade43c8c498a3c8daddac0244dc55d1331d $ rm normalX Test that "hg status" shows status of largefiles correctly just after automated commit like rebase/transplant $ cat >> .hg/hgrc < [extensions] > rebase = > strip = > transplant = > EOF $ hg update -q -C 1 $ hg remove large1 $ echo largeX > largeX $ hg add --large largeX $ hg commit -m '#4' $ hg rebase -s 1 -d 2 --keep rebasing 1:72518492caa6 "#1" rebasing 4:07d6153b5c04 "#4" (tip) $ hg status -A large1 large1: $ENOENT$ $ hg status -A largeX C largeX $ hg strip -q 5 $ hg update -q -C 2 $ hg transplant -q 1 4 $ hg status -A large1 large1: $ENOENT$ $ hg status -A largeX C largeX $ hg strip -q 5 $ hg update -q -C 2 $ hg transplant -q --merge 1 --merge 4 $ hg status -A large1 large1: $ENOENT$ $ hg status -A largeX C largeX $ hg strip -q 5 Test that linear merge can detect modification (and conflict) correctly (linear merge without conflict) $ echo 'large2 for linear merge (no conflict)' > large2 $ hg update 3 --config debug.dirstate.delaywrite=2 getting changed largefiles 1 largefiles updated, 0 removed 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg status -A large2 M large2 $ cat large2 large2 for linear merge (no conflict) $ cat .hglf/large2 9c4bf8f1b33536d6e5f89447e10620cfe52ea710 (linear merge with conflict, choosing "other") $ hg update -q -C 2 $ echo 'large1 for linear merge (conflict)' > large1 $ hg update 3 --config ui.interactive=True < o > EOF largefile large1 has a merge conflict ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? o getting changed largefiles 1 largefiles updated, 0 removed 1 files updated, 1 files merged, 0 files removed, 0 files unresolved $ hg status -A large1 C large1 $ cat large1 large1 in #3 $ cat .hglf/large1 e5bb990443d6a92aaf7223813720f7566c9dd05b (linear merge with conflict, choosing "local") $ hg update -q -C 2 $ echo 'large1 for linear merge (conflict)' > large1 $ hg update 3 --config debug.dirstate.delaywrite=2 largefile large1 has a merge conflict ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l 1 files updated, 1 files merged, 0 files removed, 0 files unresolved $ hg status -A large1 M large1 $ cat large1 large1 for linear merge (conflict) $ cat .hglf/large1 ba94c2efe5b7c5e0af8d189295ce00553b0612b7 Test a linear merge to a revision containing same-name normal file $ hg update -q -C 3 $ hg remove large2 $ echo 'large2 as normal file' > large2 $ hg add large2 $ echo 'large3 as normal file' > large3 $ hg add large3 $ hg commit -m '#5' $ hg manifest .hglf/large1 large2 large3 normal1 (modified largefile is already switched to normal) $ hg update -q -C 2 $ echo 'modified large2 for linear merge' > large2 $ hg update -q 5 remote turned local largefile large2 into a normal file keep (l)argefile or use (n)ormal file? l $ hg debugdirstate --nodates | grep large2 a 0 -1 unset .hglf/large2 r 0 0 set large2 $ hg status -A large2 A large2 $ cat large2 modified large2 for linear merge (added largefile is already committed as normal) $ hg update -q -C 2 $ echo 'large3 as large file for linear merge' > large3 $ hg add --large large3 $ hg update -q 5 remote turned local largefile large3 into a normal file keep (l)argefile or use (n)ormal file? l $ hg debugdirstate --nodates | grep large3 a 0 -1 unset .hglf/large3 r 0 0 set large3 $ hg status -A large3 A large3 $ cat large3 large3 as large file for linear merge $ rm -f large3 .hglf/large3 Test that the internal linear merging works correctly (both heads are stripped to keep pairing of revision number and commit log) $ hg update -q -C 2 $ hg strip 3 4 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-2e7b195d-backup.hg $ mv .hg/strip-backup/9530e27857f7-2e7b195d-backup.hg $TESTTMP (internal linear merging at "hg pull --update") $ echo 'large1 for linear merge (conflict)' > large1 $ echo 'large2 for linear merge (conflict with normal file)' > large2 $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg pulling from $TESTTMP/9530e27857f7-2e7b195d-backup.hg searching for changes adding changesets adding manifests adding file changes added 3 changesets with 5 changes to 5 files new changesets 9530e27857f7:d65e59e952a9 remote turned local largefile large2 into a normal file keep (l)argefile or use (n)ormal file? l largefile large1 has a merge conflict ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l 2 files updated, 1 files merged, 0 files removed, 0 files unresolved updated to "d65e59e952a9: #5" 1 other heads for branch "default" $ hg status -A large1 M large1 $ cat large1 large1 for linear merge (conflict) $ cat .hglf/large1 ba94c2efe5b7c5e0af8d189295ce00553b0612b7 $ hg status -A large2 A large2 $ cat large2 large2 for linear merge (conflict with normal file) $ cat .hglf/large2 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544 (internal linear merging at "hg unbundle --update") $ hg update -q -C 2 $ hg rollback -q $ echo 'large1 for linear merge (conflict)' > large1 $ echo 'large2 for linear merge (conflict with normal file)' > large2 $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg adding changesets adding manifests adding file changes added 3 changesets with 5 changes to 5 files new changesets 9530e27857f7:d65e59e952a9 remote turned local largefile large2 into a normal file keep (l)argefile or use (n)ormal file? l largefile large1 has a merge conflict ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l 2 files updated, 1 files merged, 0 files removed, 0 files unresolved updated to "d65e59e952a9: #5" 1 other heads for branch "default" $ hg status -A large1 M large1 $ cat large1 large1 for linear merge (conflict) $ cat .hglf/large1 ba94c2efe5b7c5e0af8d189295ce00553b0612b7 $ hg status -A large2 A large2 $ cat large2 large2 for linear merge (conflict with normal file) $ cat .hglf/large2 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544 (internal linear merging in subrepo at "hg update") $ cd .. $ hg init subparent $ cd subparent $ hg clone -q -u 2 ../repo sub $ cat > .hgsub < sub = sub > EOF $ hg add .hgsub $ hg commit -m '#0@parent' $ cat .hgsubstate f74e50bd9e5594b7cf1e6c5cbab86ddd25f3ca2f sub $ hg -R sub update -q $ hg commit -m '#1@parent' $ cat .hgsubstate d65e59e952a9638e2ce863b41a420ca723dd3e8d sub $ hg update -q 0 $ echo 'large1 for linear merge (conflict)' > sub/large1 $ echo 'large2 for linear merge (conflict with normal file)' > sub/large2 $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 < m > r > l > l > EOF subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9) (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m subrepository sources for sub differ (in checked out version) use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r remote turned local largefile large2 into a normal file keep (l)argefile or use (n)ormal file? l largefile large1 has a merge conflict ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l 2 files updated, 1 files merged, 0 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R sub status -A sub/large1 M sub/large1 $ cat sub/large1 large1 for linear merge (conflict) $ cat sub/.hglf/large1 ba94c2efe5b7c5e0af8d189295ce00553b0612b7 $ hg -R sub status -A sub/large2 A sub/large2 $ cat sub/large2 large2 for linear merge (conflict with normal file) $ cat sub/.hglf/large2 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544 $ cd .. $ cd repo Test that rebase updates largefiles in the working directory even if it is aborted by conflict. $ hg update -q -C 3 $ cat .hglf/large1 e5bb990443d6a92aaf7223813720f7566c9dd05b $ cat large1 large1 in #3 $ hg rebase -s 1 -d 3 --keep --config ui.interactive=True < o > EOF rebasing 1:72518492caa6 "#1" largefile large1 has a merge conflict ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o merging normal1 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark') unresolved conflicts (see hg resolve, then hg rebase --continue) [1] $ cat .hglf/large1 58e24f733a964da346e2407a2bee99d9001184f5 $ cat large1 large1 in #1 $ rm normal1.orig Test that rebase updates standins for manually modified largefiles at the 1st commit of resuming. $ echo "manually modified before 'hg rebase --continue'" > large1 $ hg resolve -m normal1 (no more unresolved files) continue: hg rebase --continue $ hg rebase --continue --config ui.interactive=True < c > EOF rebasing 1:72518492caa6 "#1" rebasing 4:07d6153b5c04 "#4" local [dest] changed .hglf/large1 which other [source] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? c $ hg diff -c "tip~1" --nodates .hglf/large1 | grep '^[+-][0-9a-z]' -e5bb990443d6a92aaf7223813720f7566c9dd05b +8a4f783556e7dea21139ca0466eafce954c75c13 $ rm -f large1 $ hg update -q -C tip $ cat large1 manually modified before 'hg rebase --continue' Test that transplant updates largefiles, of which standins are safely changed, even if it is aborted by conflict of other. $ hg update -q -C 5 $ cat .hglf/large1 e5bb990443d6a92aaf7223813720f7566c9dd05b $ cat large1 large1 in #3 $ hg diff -c 4 .hglf/largeX | grep '^[+-][0-9a-z]' +fa44618ea25181aff4f48b70428294790cec9f61 $ hg transplant 4 applying 07d6153b5c04 patching file .hglf/large1 Hunk #1 FAILED at 0 1 out of 1 hunks FAILED -- saving rejects to file .hglf/large1.rej patch failed to apply abort: fix up the working directory and run hg transplant --continue [255] $ hg status -A large1 C large1 $ cat .hglf/large1 e5bb990443d6a92aaf7223813720f7566c9dd05b $ cat large1 large1 in #3 $ hg status -A largeX A largeX $ cat .hglf/largeX fa44618ea25181aff4f48b70428294790cec9f61 $ cat largeX largeX Test that transplant updates standins for manually modified largefiles at the 1st commit of resuming. $ echo "manually modified before 'hg transplant --continue'" > large1 $ hg transplant --continue 07d6153b5c04 transplanted as f1bf30eb88cc $ hg diff -c tip .hglf/large1 | grep '^[+-][0-9a-z]' -e5bb990443d6a92aaf7223813720f7566c9dd05b +6a4f36d4075fbe0f30ec1d26ca44e63c05903671 $ rm -f large1 $ hg update -q -C tip $ cat large1 manually modified before 'hg transplant --continue' Test that "hg status" doesn't show removal of largefiles not managed in the target context. $ hg update -q -C 4 $ hg remove largeX $ hg status -A largeX R largeX $ hg status -A --rev '.^1' largeX #if execbit Test that "hg status" against revisions other than parent notices exec bit changes of largefiles. $ hg update -q -C 4 (the case that large2 doesn't have exec bit in the target context but in the working context) $ chmod +x large2 $ hg status -A --rev 0 large2 M large2 $ hg commit -m 'chmod +x large2' (the case that large2 has exec bit in the target context but not in the working context) $ echo dummy > dummy $ hg add dummy $ hg commit -m 'revision for separation' $ chmod -x large2 $ hg status -A --rev '.^1' large2 M large2 #else Test that "hg status" against revisions other than parent ignores exec bit correctly on the platform being unaware of it. $ hg update -q -C 4 $ cat > ../exec-bit.patch < # HG changeset patch > # User test > # Date 0 0 > # Thu Jan 01 00:00:00 1970 +0000 > # Node ID be1b433a65b12b27b5519d92213e14f7e1769b90 > # Parent 07d6153b5c04313efb75deec9ba577de7faeb727 > chmod +x large2 > > diff --git a/.hglf/large2 b/.hglf/large2 > old mode 100644 > new mode 100755 > EOF $ hg import --exact --bypass ../exec-bit.patch applying ../exec-bit.patch $ hg status -A --rev tip large2 C large2 #endif The fileset revset is evaluated for each revision, instead of once on wdir(), and then patterns matched on each revision. Here, no exec bits are set in wdir(), but a matching revision is detected. (Teach large2 is not an executable. Maybe this is a bug of largefiles.) #if execbit $ chmod -x .hglf/large2 #endif $ hg files 'set:exec()' [1] $ hg log -qr 'file("set:exec()")' 9:be1b433a65b1 Test a fatal error interrupting an update. Verify that status report dirty files correctly after an interrupted update. Also verify that checking all hashes reveals it isn't clean. Start with clean dirstates: $ hg up --quiet --clean --rev "8^" $ sleep 1 $ hg st Update standins without updating largefiles - large1 is modified and largeX is added: $ cat << EOF > ../crashupdatelfiles.py > import hgext.largefiles.lfutil > def getlfilestoupdate(oldstandins, newstandins): > raise SystemExit(7) > hgext.largefiles.lfutil.getlfilestoupdate = getlfilestoupdate > EOF $ hg up -Cr "8" --config extensions.crashupdatelfiles=../crashupdatelfiles.py [7] Check large1 content and status ... and that update will undo modifications: $ cat large1 large1 in #3 $ hg st M large1 ! largeX $ hg up -Cr . getting changed largefiles 2 largefiles updated, 0 removed 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat large1 manually modified before 'hg transplant --continue' $ hg st Force largefiles rehashing and check that all changes have been caught by status and update: $ rm .hg/largefiles/dirstate $ hg st $ cd .. Test that "hg convert" avoids copying largefiles from the working directory into store, because "hg convert" doesn't update largefiles in the working directory (removing files under ".cache/largefiles" forces "hg convert" to copy corresponding largefiles) $ cat >> $HGRCPATH < [extensions] > convert = > EOF $ rm $TESTTMP/.cache/largefiles/6a4f36d4075fbe0f30ec1d26ca44e63c05903671 $ hg convert -q repo repo.converted mercurial-4.5.3/tests/test-drawdag.t0000644015407300116100000001057513261161234017322 0ustar augieeng00000000000000 $ cat >> $HGRCPATH< [extensions] > drawdag=$TESTDIR/drawdag.py > [experimental] > evolution=true > EOF $ reinit () { > rm -rf .hg && hg init > } $ hg init Test what said in drawdag.py docstring $ hg debugdrawdag <<'EOS' > c d > |/ > b > | > a > EOS $ hg log -G -T '{rev} {desc} ({tags})' o 3 d (d tip) | | o 2 c (c) |/ o 1 b (b) | o 0 a (a) $ hg debugdrawdag <<'EOS' > foo bar bar foo > | / | | > ancestor(c,d) a baz > EOS $ hg log -G -T '{desc}' o foo |\ +---o bar | | | | o | baz | / +---o d | | +---o c | | o | b |/ o a $ reinit $ hg debugdrawdag <<'EOS' > o foo > |\ > +---o bar > | | | > | o | baz > | / > +---o d > | | > +---o c > | | > o | b > |/ > o a > EOS $ hg log -G -T '{desc}' o foo |\ | | o d | |/ | | o c | |/ | | o bar | |/| | o | b | |/ o / baz / o a $ reinit $ hg debugdrawdag <<'EOS' > o foo > |\ > | | o d > | |/ > | | o c > | |/ > | | o bar > | |/| > | o | b > | |/ > o / baz > / > o a > EOS $ hg log -G -T '{desc}' o foo |\ | | o d | |/ | | o c | |/ | | o bar | |/| | o | b | |/ o / baz / o a $ hg manifest -r a a $ hg manifest -r b a b $ hg manifest -r bar a b $ hg manifest -r foo a b baz Edges existed in repo are no-ops $ reinit $ hg debugdrawdag <<'EOS' > B C C > | | | > A A B > EOS $ hg log -G -T '{desc}' o C |\ | o B |/ o A $ hg debugdrawdag <<'EOS' > C D C > | | | > B B A > EOS $ hg log -G -T '{desc}' o D | | o C |/| o | B |/ o A Node with more than 2 parents are disallowed $ hg debugdrawdag <<'EOS' > A > /|\ > D B C > EOS abort: A: too many parents: C D B [255] Cycles are disallowed $ hg debugdrawdag <<'EOS' > A > | > A > EOS abort: the graph has cycles [255] $ hg debugdrawdag <<'EOS' > A > | > B > | > A > EOS abort: the graph has cycles [255] Create obsmarkers via comments $ reinit $ hg debugdrawdag <<'EOS' > G > | > I D C F # split: B -> E, F, G > \ \| | # replace: C -> D -> H > H B E # prune: F, I > \|/ > A > EOS 1 new orphan changesets $ hg log -r 'sort(all(), topo)' -G --hidden -T '{desc} {node}' * G 711f53bbef0bebd12eb6f0511d5e2e998b984846 | x F 64a8289d249234b9886244d379f15e6b650b28e3 | o E 7fb047a69f220c21711122dfd94305a9efb60cba | | x D be0ef73c17ade3fc89dc41701eb9fc3a91b58282 | | | | x C 26805aba1e600a82e93661149f2313866a221a7b | |/ | x B 112478962961147124edd43549aedd1a335e44bf |/ | x I 58e6b987bf7045fcd9c54f496396ca1d1fc81047 | | | o H 575c4b5ec114d64b681d33f8792853568bfb2b2c |/ o A 426bada5c67598ca65036d57d9e4b64b0c1ce7a0 $ hg debugobsolete 112478962961147124edd43549aedd1a335e44bf 7fb047a69f220c21711122dfd94305a9efb60cba 64a8289d249234b9886244d379f15e6b650b28e3 711f53bbef0bebd12eb6f0511d5e2e998b984846 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'split', 'user': 'test'} 26805aba1e600a82e93661149f2313866a221a7b be0ef73c17ade3fc89dc41701eb9fc3a91b58282 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'replace', 'user': 'test'} be0ef73c17ade3fc89dc41701eb9fc3a91b58282 575c4b5ec114d64b681d33f8792853568bfb2b2c 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'replace', 'user': 'test'} 64a8289d249234b9886244d379f15e6b650b28e3 0 {7fb047a69f220c21711122dfd94305a9efb60cba} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'test'} 58e6b987bf7045fcd9c54f496396ca1d1fc81047 0 {575c4b5ec114d64b681d33f8792853568bfb2b2c} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'prune', 'user': 'test'} Change file contents via comments $ reinit $ hg debugdrawdag <<'EOS' > C # A/dir1/a = 1\n2 > |\ # B/dir2/b = 34 > A B # C/dir1/c = 5 > # C/dir2/c = 6 > # C/A = a > # C/B = b > EOS $ hg log -G -T '{desc} {files}' o C A B dir1/c dir2/c |\ | o B B dir2/b | o A A dir1/a $ for f in `hg files -r C`; do > echo FILE "$f" > hg cat -r C "$f" > echo > done FILE A a FILE B b FILE dir1/a 1 2 FILE dir1/c 5 FILE dir2/b 34 FILE dir2/c 6 mercurial-4.5.3/tests/test-exchange-obsmarkers-case-C1.t0000644015407300116100000001433613261161234023012 0ustar augieeng00000000000000============================================ Testing obsolescence markers push: Cases C.1 ============================================ Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of all changesets that requested to be "in sync" after the push (even if they are already on both side). This test belongs to a series of tests checking such set is properly computed and applied. This does not tests "obsmarkers" discovery capabilities. Category C: advanced case TestCase 1: Multiple pruned changeset atop each other Variants: # a: explicite push # b: bare push C.1 Multiple pruned changeset atop each other ============================================= .. {{{ .. ⊗ B .. | .. ⊗ A .. | .. ◠O .. }}} .. .. Marker exist from: .. .. * A (prune) .. * B (prune) .. .. Commands run: .. .. * hg push -r O .. * hg push .. .. Expected exchange: .. .. * A (prune) .. * B (prune) Setup ----- $ . $TESTDIR/testlib/exchange-obsmarker-util.sh Initial $ setuprepos C.1 creating test repo for test case C.1 - pulldest - main - pushdest cd into `main` and proceed with env setup $ cd main $ mkcommit A $ mkcommit B $ hg prune -qd '0 0' '.~1' 1 new orphan changesets $ hg prune -qd '0 0' . $ hg log -G --hidden x f6fbb35d8ac9 (draft): B | x f5bc6836db60 (draft): A | @ a9bdc8b26820 (public): O $ inspect_obsmarkers obsstore content ================ f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ cd .. $ cd .. $ cp -R C.1 C.1.a $ cp -R C.1 C.1.b Actual Test (explicit push) --------------------------- $ dotest C.1.a O ## Running testcase C.1.a # testing echange of "O" (a9bdc8b26820) ## initial state # obstore: main f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest ## pushing "O" from main to pushdest pushing to pushdest searching for changes no changes found remote: 2 new obsolescence markers ## post push state # obstore: main f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest ## pulling "a9bdc8b26820" from main into pulldest pulling from main no changes found 2 new obsolescence markers ## post pull state # obstore: main f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} Actual Test (bare push) ------------------------------------- $ dotest C.1.b ## Running testcase C.1.b ## initial state # obstore: main f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest ## pushing from main to pushdest pushing to pushdest searching for changes no changes found remote: 2 new obsolescence markers ## post push state # obstore: main f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest ## pulling from main into pulldest pulling from main searching for changes no changes found 2 new obsolescence markers ## post pull state # obstore: main f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} mercurial-4.5.3/tests/test-debugbuilddag.t0000644015407300116100000001254013261161234020465 0ustar augieeng00000000000000 plain $ hg init $ hg debugbuilddag '+2:f +3:p2 @temp --config extensions.progress= --config progress.assume-tty=1 \ > --config progress.delay=0 --config progress.refresh=0 \ > --config progress.format=topic,bar,number \ > --config progress.width=60 \r (no-eol) (esc) building [ ] 0/12\r (no-eol) (esc) building [ ] 0/12\r (no-eol) (esc) building [==> ] 1/12\r (no-eol) (esc) building [==> ] 1/12\r (no-eol) (esc) building [======> ] 2/12\r (no-eol) (esc) building [=========> ] 3/12\r (no-eol) (esc) building [=============> ] 4/12\r (no-eol) (esc) building [=============> ] 4/12\r (no-eol) (esc) building [=============> ] 4/12\r (no-eol) (esc) building [================> ] 5/12\r (no-eol) (esc) building [====================> ] 6/12\r (no-eol) (esc) building [=======================> ] 7/12\r (no-eol) (esc) building [===========================> ] 8/12\r (no-eol) (esc) building [===========================> ] 8/12\r (no-eol) (esc) building [==============================> ] 9/12\r (no-eol) (esc) building [==================================> ] 10/12\r (no-eol) (esc) building [=====================================> ] 11/12\r (no-eol) (esc) \r (no-eol) (esc) tags $ cat .hg/localtags 66f7d451a68b85ed82ff5fcc254daf50c74144bd f bebd167eb94d257ace0e814aeb98e6972ed2970d p2 dag $ hg debugdag -t -b +2:f +3:p2 @temp*f+3 @default*/p2+2:tip tip $ hg id 000000000000 glog $ hg log -G --template '{rev}: {desc} [{branches}] @ {date}\n' o 11: r11 [] @ 11.00 | o 10: r10 [] @ 10.00 | o 9: r9 [] @ 9.00 |\ | o 8: r8 [temp] @ 8.00 | | | o 7: r7 [temp] @ 7.00 | | | o 6: r6 [temp] @ 6.00 | | | o 5: r5 [temp] @ 5.00 | | o | 4: r4 [] @ 4.00 | | o | 3: r3 [] @ 3.00 | | o | 2: r2 [] @ 2.00 |/ o 1: r1 [] @ 1.00 | o 0: r0 [] @ 0.00 overwritten files, starting on a non-default branch $ rm -r .hg $ hg init $ hg debugbuilddag '@start.@default.:f +3:p2 @temp a $ hg add a $ hg ci -m 'a' $ echo b > a $ hg ci -m'b' $ hg up 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg book main $ hg book * main 0:cb9a9f314b8b $ echo c > c $ hg add c $ hg ci -m'c' created new head $ hg book * main 2:d36c0562f908 $ hg heads changeset: 2:d36c0562f908 bookmark: main tag: tip parent: 0:cb9a9f314b8b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: c changeset: 1:1e6c11564562 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: b $ hg up 1e6c11564562 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (leaving bookmark main) $ hg merge main 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg book main 2:d36c0562f908 $ hg ci -m'merge' $ hg book main 2:d36c0562f908 $ cd .. mercurial-4.5.3/tests/test-convert-splicemap.t0000644015407300116100000001462713261161234021346 0ustar augieeng00000000000000 $ echo "[extensions]" >> $HGRCPATH $ echo "convert=" >> $HGRCPATH $ glog() > { > hg log -G --template '{rev}:{node|short} "{desc|firstline}"\ > files: {files}\n' "$@" > } $ hg init repo1 $ cd repo1 $ echo a > a $ hg ci -Am adda adding a $ echo b > b $ echo a >> a $ hg ci -Am addb adding b $ PARENTID1=`hg id --debug -i` $ echo c > c $ hg ci -Am addc adding c $ PARENTID2=`hg id --debug -i` $ cd .. $ glog -R repo1 @ 2:e55c719b85b6 "addc" files: c | o 1:6d4c2037ddc2 "addb" files: a b | o 0:07f494440405 "adda" files: a $ hg init repo2 $ cd repo2 $ echo b > a $ echo d > d $ hg ci -Am addaandd adding a adding d $ INVALIDID1=afd12345af $ INVALIDID2=28173x36ddd1e67bf7098d541130558ef5534a86 $ CHILDID1=`hg id --debug -i` $ echo d >> d $ hg ci -Am changed $ CHILDID2=`hg id --debug -i` $ echo e > e $ hg ci -Am adde adding e $ cd .. $ glog -R repo2 @ 2:a39b65753b0a "adde" files: e | o 1:e4ea00df9189 "changed" files: d | o 0:527cdedf31fb "addaandd" files: a d test invalid splicemap1 $ cat > splicemap < $CHILDID2 > EOF $ hg convert --splicemap splicemap repo2 repo1 abort: syntax error in splicemap(1): child parent1[,parent2] expected [255] test invalid splicemap2 $ cat > splicemap < $CHILDID2 $PARENTID1, $PARENTID2, $PARENTID2 > EOF $ hg convert --splicemap splicemap repo2 repo1 abort: syntax error in splicemap(1): child parent1[,parent2] expected [255] test invalid splicemap3 $ cat > splicemap < $INVALIDID1 $INVALIDID2 > EOF $ hg convert --splicemap splicemap repo2 repo1 abort: splicemap entry afd12345af is not a valid revision identifier [255] splice repo2 on repo1 $ cat > splicemap < $CHILDID1 $PARENTID1 > $CHILDID2 $PARENTID2,$CHILDID1 > > EOF $ cat splicemap 527cdedf31fbd5ea708aa14eeecf53d4676f38db 6d4c2037ddc2cb2627ac3a244ecce35283268f8e e4ea00df91897da3079a10fab658c1eddba6617b e55c719b85b60e5102fac26110ba626e7cb6b7dc,527cdedf31fbd5ea708aa14eeecf53d4676f38db $ hg clone repo1 target1 updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg convert --splicemap splicemap repo2 target1 scanning source... sorting... converting... 2 addaandd spliced in 6d4c2037ddc2cb2627ac3a244ecce35283268f8e as parents of 527cdedf31fbd5ea708aa14eeecf53d4676f38db 1 changed spliced in e55c719b85b60e5102fac26110ba626e7cb6b7dc and 527cdedf31fbd5ea708aa14eeecf53d4676f38db as parents of e4ea00df91897da3079a10fab658c1eddba6617b 0 adde $ glog -R target1 o 5:16bc847b02aa "adde" files: e | o 4:e30e4fee3418 "changed" files: d |\ | o 3:e673348c3a3c "addaandd" files: a d | | @ | 2:e55c719b85b6 "addc" files: c |/ o 1:6d4c2037ddc2 "addb" files: a b | o 0:07f494440405 "adda" files: a Test splicemap and conversion order $ hg init ordered $ cd ordered $ echo a > a $ hg ci -Am adda adding a $ hg branch branch marked working directory as branch branch (branches are permanent and global, did you want a bookmark?) $ echo a >> a $ hg ci -Am changea $ echo a >> a $ hg ci -Am changeaagain $ hg up 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo b > b $ hg ci -Am addb adding b We want 2 to depend on 1 and 3. Since 3 is always converted after 2, the bug should be exhibited with all conversion orders. $ cat > ../splicemap < `(hg id -r 2 -i --debug)` `(hg id -r 1 -i --debug)`, `(hg id -r 3 -i --debug)` > EOF $ cd .. $ cat splicemap 7c364e7fa7d70ae525610c016317ed717b519d97 717d54d67e6c31fd75ffef2ff3042bdd98418437, 102a90ea7b4a3361e4082ed620918c261189a36a Test regular conversion $ hg convert --splicemap splicemap ordered ordered-hg1 initializing destination ordered-hg1 repository scanning source... sorting... converting... 3 adda 2 changea 1 addb 0 changeaagain spliced in 717d54d67e6c31fd75ffef2ff3042bdd98418437 and 102a90ea7b4a3361e4082ed620918c261189a36a as parents of 7c364e7fa7d70ae525610c016317ed717b519d97 $ glog -R ordered-hg1 o 3:4cb04b9afbf2 "changeaagain" files: a |\ | o 2:102a90ea7b4a "addb" files: b | | o | 1:717d54d67e6c "changea" files: a |/ o 0:07f494440405 "adda" files: a Test conversion with parent revisions already in dest, using source and destination identifiers. Test unknown splicemap target. $ hg convert -r1 ordered ordered-hg2 initializing destination ordered-hg2 repository scanning source... sorting... converting... 1 adda 0 changea $ hg convert -r3 ordered ordered-hg2 scanning source... sorting... converting... 0 addb $ cat > splicemap < `(hg -R ordered id -r 2 -i --debug)` \ > `(hg -R ordered-hg2 id -r 1 -i --debug)`,\ > `(hg -R ordered-hg2 id -r 2 -i --debug)` > deadbeef102a90ea7b4a3361e4082ed620918c26 deadbeef102a90ea7b4a3361e4082ed620918c27 > EOF $ hg convert --splicemap splicemap ordered ordered-hg2 scanning source... splice map revision deadbeef102a90ea7b4a3361e4082ed620918c26 is not being converted, ignoring sorting... converting... 0 changeaagain spliced in 717d54d67e6c31fd75ffef2ff3042bdd98418437 and 102a90ea7b4a3361e4082ed620918c261189a36a as parents of 7c364e7fa7d70ae525610c016317ed717b519d97 $ glog -R ordered-hg2 o 3:4cb04b9afbf2 "changeaagain" files: a |\ | o 2:102a90ea7b4a "addb" files: b | | o | 1:717d54d67e6c "changea" files: a |/ o 0:07f494440405 "adda" files: a Test empty conversion $ hg convert --splicemap splicemap ordered ordered-hg2 scanning source... splice map revision deadbeef102a90ea7b4a3361e4082ed620918c26 is not being converted, ignoring sorting... converting... Test clonebranches $ hg --config convert.hg.clonebranches=true convert \ > --splicemap splicemap ordered ordered-hg3 initializing destination ordered-hg3 repository scanning source... abort: revision 717d54d67e6c31fd75ffef2ff3042bdd98418437 not found in destination repository (lookups with clonebranches=true are not implemented) [255] Test invalid dependency $ cat > splicemap < `(hg -R ordered id -r 2 -i --debug)` \ > deadbeef102a90ea7b4a3361e4082ed620918c26,\ > `(hg -R ordered-hg2 id -r 2 -i --debug)` > EOF $ hg convert --splicemap splicemap ordered ordered-hg4 initializing destination ordered-hg4 repository scanning source... abort: unknown splice map parent: deadbeef102a90ea7b4a3361e4082ed620918c26 [255] mercurial-4.5.3/tests/test-rebase-obsolete.t0000644015407300116100000012311613261161234020760 0ustar augieeng00000000000000========================== Test rebase with obsolete ========================== Enable obsolete $ cat >> $HGRCPATH << EOF > [ui] > logtemplate= {rev}:{node|short} {desc|firstline}{if(obsolete,' ({obsfate})')} > [experimental] > evolution.createmarkers=True > evolution.allowunstable=True > [phases] > publish=False > [extensions] > rebase= > drawdag=$TESTDIR/drawdag.py > EOF Setup rebase canonical repo $ hg init base $ cd base $ hg unbundle "$TESTDIR/bundles/rebase.hg" adding changesets adding manifests adding file changes added 8 changesets with 7 changes to 7 files (+2 heads) new changesets cd010b8cd998:02de42196ebe (run 'hg heads' to see heads, 'hg merge' to merge) $ hg up tip 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg log -G @ 7:02de42196ebe H | | o 6:eea13746799a G |/| o | 5:24b6387c8c8c F | | | o 4:9520eea781bc E |/ | o 3:32af7686d403 D | | | o 2:5fddd98957c8 C | | | o 1:42ccdea3bb16 B |/ o 0:cd010b8cd998 A $ cd .. simple rebase --------------------------------- $ hg clone base simple updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd simple $ hg up 32af7686d403 3 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg rebase -d eea13746799a rebasing 1:42ccdea3bb16 "B" rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" $ hg log -G @ 10:8eeb3c33ad33 D | o 9:2327fea05063 C | o 8:e4e5be0395b2 B | | o 7:02de42196ebe H | | o | 6:eea13746799a G |\| | o 5:24b6387c8c8c F | | o | 4:9520eea781bc E |/ o 0:cd010b8cd998 A $ hg log --hidden -G @ 10:8eeb3c33ad33 D | o 9:2327fea05063 C | o 8:e4e5be0395b2 B | | o 7:02de42196ebe H | | o | 6:eea13746799a G |\| | o 5:24b6387c8c8c F | | o | 4:9520eea781bc E |/ | x 3:32af7686d403 D (rewritten using rebase as 10:8eeb3c33ad33) | | | x 2:5fddd98957c8 C (rewritten using rebase as 9:2327fea05063) | | | x 1:42ccdea3bb16 B (rewritten using rebase as 8:e4e5be0395b2) |/ o 0:cd010b8cd998 A $ hg debugobsolete 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 e4e5be0395b2cbd471ed22a26b1b6a1a0658a794 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 2327fea05063f39961b14cb69435a9898dc9a245 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} 32af7686d403cf45b5d95f2d70cebea587ac806a 8eeb3c33ad33d452c89e5dcf611c347f978fb42b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} $ cd .. empty changeset --------------------------------- $ hg clone base empty updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd empty $ hg up eea13746799a 1 files updated, 0 files merged, 1 files removed, 0 files unresolved We make a copy of both the first changeset in the rebased and some other in the set. $ hg graft 42ccdea3bb16 32af7686d403 grafting 1:42ccdea3bb16 "B" grafting 3:32af7686d403 "D" $ hg rebase -s 42ccdea3bb16 -d . rebasing 1:42ccdea3bb16 "B" note: rebase of 1:42ccdea3bb16 created no changes to commit rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" note: rebase of 3:32af7686d403 created no changes to commit $ hg log -G o 10:5ae4c968c6ac C | @ 9:08483444fef9 D | o 8:8877864f1edb B | | o 7:02de42196ebe H | | o | 6:eea13746799a G |\| | o 5:24b6387c8c8c F | | o | 4:9520eea781bc E |/ o 0:cd010b8cd998 A $ hg log --hidden -G o 10:5ae4c968c6ac C | @ 9:08483444fef9 D | o 8:8877864f1edb B | | o 7:02de42196ebe H | | o | 6:eea13746799a G |\| | o 5:24b6387c8c8c F | | o | 4:9520eea781bc E |/ | x 3:32af7686d403 D (pruned using rebase) | | | x 2:5fddd98957c8 C (rewritten using rebase as 10:5ae4c968c6ac) | | | x 1:42ccdea3bb16 B (pruned using rebase) |/ o 0:cd010b8cd998 A $ hg debugobsolete 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'} 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'} More complex case where part of the rebase set were already rebased $ hg rebase --rev 'desc(D)' --dest 'desc(H)' rebasing 9:08483444fef9 "D" 1 new orphan changesets $ hg debugobsolete 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'} 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'} 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} $ hg log -G @ 11:4596109a6a43 D | | * 10:5ae4c968c6ac C | | | x 9:08483444fef9 D (rewritten using rebase as 11:4596109a6a43) | | | o 8:8877864f1edb B | | o | 7:02de42196ebe H | | | o 6:eea13746799a G |/| o | 5:24b6387c8c8c F | | | o 4:9520eea781bc E |/ o 0:cd010b8cd998 A $ hg rebase --source 'desc(B)' --dest 'tip' --config experimental.rebaseskipobsolete=True rebasing 8:8877864f1edb "B" note: not rebasing 9:08483444fef9 "D", already in destination as 11:4596109a6a43 "D" (tip) rebasing 10:5ae4c968c6ac "C" $ hg debugobsolete 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'} 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'} 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} 8877864f1edb05d0e07dc4ba77b67a80a7b86672 462a34d07e599b87ea08676a449373fe4e2e1347 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} 5ae4c968c6aca831df823664e706c9d4aa34473d 98f6af4ee9539e14da4465128f894c274900b6e5 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} $ hg log --rev 'contentdivergent()' $ hg log -G o 13:98f6af4ee953 C | o 12:462a34d07e59 B | @ 11:4596109a6a43 D | o 7:02de42196ebe H | | o 6:eea13746799a G |/| o | 5:24b6387c8c8c F | | | o 4:9520eea781bc E |/ o 0:cd010b8cd998 A $ hg log --style default --debug -r 4596109a6a4328c398bde3a4a3b6737cfade3003 changeset: 11:4596109a6a4328c398bde3a4a3b6737cfade3003 phase: draft parent: 7:02de42196ebee42ef284b6780a87cdc96e8eaab6 parent: -1:0000000000000000000000000000000000000000 manifest: 11:a91006e3a02f1edf631f7018e6e5684cf27dd905 user: Nicolas Dumazet date: Sat Apr 30 15:24:48 2011 +0200 files+: D extra: branch=default extra: rebase_source=08483444fef91d6224f6655ee586a65d263ad34c extra: source=32af7686d403cf45b5d95f2d70cebea587ac806a description: D $ hg up -qr 'desc(G)' $ hg graft 4596109a6a4328c398bde3a4a3b6737cfade3003 grafting 11:4596109a6a43 "D" $ hg up -qr 'desc(E)' $ hg rebase -s tip -d . rebasing 14:9e36056a46e3 "D" (tip) $ hg log --style default --debug -r tip changeset: 15:627d4614809036ba22b9e7cb31638ddc06ab99ab tag: tip phase: draft parent: 4:9520eea781bcca16c1e15acc0ba14335a0e8e5ba parent: -1:0000000000000000000000000000000000000000 manifest: 15:648e8ede73ae3e497d093d3a4c8fcc2daa864f42 user: Nicolas Dumazet date: Sat Apr 30 15:24:48 2011 +0200 files+: D extra: branch=default extra: intermediate-source=4596109a6a4328c398bde3a4a3b6737cfade3003 extra: rebase_source=9e36056a46e37c9776168c7375734eebc70e294f extra: source=32af7686d403cf45b5d95f2d70cebea587ac806a description: D Start rebase from a commit that is obsolete but not hidden only because it's a working copy parent. We should be moved back to the starting commit as usual even though it is hidden (until we're moved there). $ hg --hidden up -qr 'first(hidden())' updating to a hidden changeset 42ccdea3bb16 (hidden revision '42ccdea3bb16' is pruned) $ hg rebase --rev 13 --dest 15 rebasing 13:98f6af4ee953 "C" $ hg log -G o 16:294a2b93eb4d C | o 15:627d46148090 D | | o 12:462a34d07e59 B | | | o 11:4596109a6a43 D | | | o 7:02de42196ebe H | | +---o 6:eea13746799a G | |/ | o 5:24b6387c8c8c F | | o | 4:9520eea781bc E |/ | @ 1:42ccdea3bb16 B (pruned using rebase) |/ o 0:cd010b8cd998 A $ cd .. collapse rebase --------------------------------- $ hg clone base collapse updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd collapse $ hg rebase -s 42ccdea3bb16 -d eea13746799a --collapse rebasing 1:42ccdea3bb16 "B" rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" $ hg log -G o 8:4dc2197e807b Collapsed revision | | @ 7:02de42196ebe H | | o | 6:eea13746799a G |\| | o 5:24b6387c8c8c F | | o | 4:9520eea781bc E |/ o 0:cd010b8cd998 A $ hg log --hidden -G o 8:4dc2197e807b Collapsed revision | | @ 7:02de42196ebe H | | o | 6:eea13746799a G |\| | o 5:24b6387c8c8c F | | o | 4:9520eea781bc E |/ | x 3:32af7686d403 D (rewritten using rebase as 8:4dc2197e807b) | | | x 2:5fddd98957c8 C (rewritten using rebase as 8:4dc2197e807b) | | | x 1:42ccdea3bb16 B (rewritten using rebase as 8:4dc2197e807b) |/ o 0:cd010b8cd998 A $ hg id --debug -r tip 4dc2197e807bae9817f09905b50ab288be2dbbcf tip $ hg debugobsolete 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'rebase', 'user': 'test'} 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'rebase', 'user': 'test'} 32af7686d403cf45b5d95f2d70cebea587ac806a 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'rebase', 'user': 'test'} $ cd .. Rebase set has hidden descendants --------------------------------- We rebase a changeset which has hidden descendants. Hidden changesets must not be rebased. $ hg clone base hidden updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd hidden $ hg log -G @ 7:02de42196ebe H | | o 6:eea13746799a G |/| o | 5:24b6387c8c8c F | | | o 4:9520eea781bc E |/ | o 3:32af7686d403 D | | | o 2:5fddd98957c8 C | | | o 1:42ccdea3bb16 B |/ o 0:cd010b8cd998 A $ hg rebase -s 5fddd98957c8 -d eea13746799a rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" $ hg log -G o 9:cf44d2f5a9f4 D | o 8:e273c5e7d2d2 C | | @ 7:02de42196ebe H | | o | 6:eea13746799a G |\| | o 5:24b6387c8c8c F | | o | 4:9520eea781bc E |/ | o 1:42ccdea3bb16 B |/ o 0:cd010b8cd998 A $ hg rebase -s 42ccdea3bb16 -d 02de42196ebe rebasing 1:42ccdea3bb16 "B" $ hg log -G o 10:7c6027df6a99 B | | o 9:cf44d2f5a9f4 D | | | o 8:e273c5e7d2d2 C | | @ | 7:02de42196ebe H | | | o 6:eea13746799a G |/| o | 5:24b6387c8c8c F | | | o 4:9520eea781bc E |/ o 0:cd010b8cd998 A $ hg log --hidden -G o 10:7c6027df6a99 B | | o 9:cf44d2f5a9f4 D | | | o 8:e273c5e7d2d2 C | | @ | 7:02de42196ebe H | | | o 6:eea13746799a G |/| o | 5:24b6387c8c8c F | | | o 4:9520eea781bc E |/ | x 3:32af7686d403 D (rewritten using rebase as 9:cf44d2f5a9f4) | | | x 2:5fddd98957c8 C (rewritten using rebase as 8:e273c5e7d2d2) | | | x 1:42ccdea3bb16 B (rewritten using rebase as 10:7c6027df6a99) |/ o 0:cd010b8cd998 A $ hg debugobsolete 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b e273c5e7d2d29df783dce9f9eaa3ac4adc69c15d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} 32af7686d403cf45b5d95f2d70cebea587ac806a cf44d2f5a9f4297a62be94cbdd3dff7c7dc54258 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 7c6027df6a99d93f461868e5433f63bde20b6dfb 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} Test that rewriting leaving instability behind is allowed --------------------------------------------------------------------- $ hg log -r 'children(8)' 9:cf44d2f5a9f4 D (no-eol) $ hg rebase -r 8 rebasing 8:e273c5e7d2d2 "C" 1 new orphan changesets $ hg log -G o 11:0d8f238b634c C | o 10:7c6027df6a99 B | | * 9:cf44d2f5a9f4 D | | | x 8:e273c5e7d2d2 C (rewritten using rebase as 11:0d8f238b634c) | | @ | 7:02de42196ebe H | | | o 6:eea13746799a G |/| o | 5:24b6387c8c8c F | | | o 4:9520eea781bc E |/ o 0:cd010b8cd998 A Test multiple root handling ------------------------------------ $ hg rebase --dest 4 --rev '7+11+9' rebasing 9:cf44d2f5a9f4 "D" rebasing 7:02de42196ebe "H" rebasing 11:0d8f238b634c "C" (tip) $ hg log -G o 14:1e8370e38cca C | @ 13:bfe264faf697 H | | o 12:102b4c1d889b D |/ | * 10:7c6027df6a99 B | | | x 7:02de42196ebe H (rewritten using rebase as 13:bfe264faf697) | | +---o 6:eea13746799a G | |/ | o 5:24b6387c8c8c F | | o | 4:9520eea781bc E |/ o 0:cd010b8cd998 A $ cd .. Detach both parents $ hg init double-detach $ cd double-detach $ hg debugdrawdag < F > /| > C E > | | > B D G > \|/ > A > EOF $ hg rebase -d G -r 'B + D + F' rebasing 1:112478962961 "B" (B) rebasing 2:b18e25de2cf5 "D" (D) rebasing 6:f15c3adaf214 "F" (F tip) abort: cannot rebase 6:f15c3adaf214 without moving at least one of its parents [255] $ cd .. test on rebase dropping a merge (setup) $ hg init dropmerge $ cd dropmerge $ hg unbundle "$TESTDIR/bundles/rebase.hg" adding changesets adding manifests adding file changes added 8 changesets with 7 changes to 7 files (+2 heads) new changesets cd010b8cd998:02de42196ebe (run 'hg heads' to see heads, 'hg merge' to merge) $ hg up 3 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge 7 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m 'M' $ echo I > I $ hg add I $ hg ci -m I $ hg log -G @ 9:4bde274eefcf I | o 8:53a6a128b2b7 M |\ | o 7:02de42196ebe H | | | | o 6:eea13746799a G | |/| | o | 5:24b6387c8c8c F | | | | | o 4:9520eea781bc E | |/ o | 3:32af7686d403 D | | o | 2:5fddd98957c8 C | | o | 1:42ccdea3bb16 B |/ o 0:cd010b8cd998 A (actual test) $ hg rebase --dest 6 --rev '((desc(H) + desc(D))::) - desc(M)' rebasing 3:32af7686d403 "D" rebasing 7:02de42196ebe "H" rebasing 9:4bde274eefcf "I" (tip) 1 new orphan changesets $ hg log -G @ 12:acd174b7ab39 I | o 11:6c11a6218c97 H | | o 10:b5313c85b22e D |/ | * 8:53a6a128b2b7 M | |\ | | x 7:02de42196ebe H (rewritten using rebase as 11:6c11a6218c97) | | | o---+ 6:eea13746799a G | | | | | o 5:24b6387c8c8c F | | | o---+ 4:9520eea781bc E / / x | 3:32af7686d403 D (rewritten using rebase as 10:b5313c85b22e) | | o | 2:5fddd98957c8 C | | o | 1:42ccdea3bb16 B |/ o 0:cd010b8cd998 A Test hidden changesets in the rebase set (issue4504) $ hg up --hidden 9 updating to a hidden changeset 4bde274eefcf (hidden revision '4bde274eefcf' was rewritten as: acd174b7ab39) 3 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo J > J $ hg add J $ hg commit -m J 1 new orphan changesets $ hg debugobsolete `hg log --rev . -T '{node}'` obsoleted 1 changesets $ hg rebase --rev .~1::. --dest 'max(desc(D))' --traceback --config experimental.rebaseskipobsolete=off rebasing 9:4bde274eefcf "I" rebasing 13:06edfc82198f "J" (tip) 2 new content-divergent changesets $ hg log -G @ 15:5ae8a643467b J | * 14:9ad579b4a5de I | | * 12:acd174b7ab39 I | | | o 11:6c11a6218c97 H | | o | 10:b5313c85b22e D |/ | * 8:53a6a128b2b7 M | |\ | | x 7:02de42196ebe H (rewritten using rebase as 11:6c11a6218c97) | | | o---+ 6:eea13746799a G | | | | | o 5:24b6387c8c8c F | | | o---+ 4:9520eea781bc E / / x | 3:32af7686d403 D (rewritten using rebase as 10:b5313c85b22e) | | o | 2:5fddd98957c8 C | | o | 1:42ccdea3bb16 B |/ o 0:cd010b8cd998 A $ hg up 14 -C 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo "K" > K $ hg add K $ hg commit --amend -m "K" 1 new orphan changesets $ echo "L" > L $ hg add L $ hg commit -m "L" $ hg up '.^' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo "M" > M $ hg add M $ hg commit --amend -m "M" 1 new orphan changesets $ hg log -G @ 18:bfaedf8eb73b M | | * 17:97219452e4bd L | | | x 16:fc37a630c901 K (rewritten using amend as 18:bfaedf8eb73b) |/ | * 15:5ae8a643467b J | | | x 14:9ad579b4a5de I (rewritten using amend as 16:fc37a630c901) |/ | * 12:acd174b7ab39 I | | | o 11:6c11a6218c97 H | | o | 10:b5313c85b22e D |/ | * 8:53a6a128b2b7 M | |\ | | x 7:02de42196ebe H (rewritten using rebase as 11:6c11a6218c97) | | | o---+ 6:eea13746799a G | | | | | o 5:24b6387c8c8c F | | | o---+ 4:9520eea781bc E / / x | 3:32af7686d403 D (rewritten using rebase as 10:b5313c85b22e) | | o | 2:5fddd98957c8 C | | o | 1:42ccdea3bb16 B |/ o 0:cd010b8cd998 A $ hg rebase -s 14 -d 17 --config experimental.rebaseskipobsolete=True note: not rebasing 14:9ad579b4a5de "I", already in destination as 16:fc37a630c901 "K" rebasing 15:5ae8a643467b "J" 1 new orphan changesets $ cd .. Skip obsolete changeset even with multiple hops ----------------------------------------------- setup $ hg init obsskip $ cd obsskip $ cat << EOF >> .hg/hgrc > [experimental] > rebaseskipobsolete = True > [extensions] > strip = > EOF $ echo A > A $ hg add A $ hg commit -m A $ echo B > B $ hg add B $ hg commit -m B0 $ hg commit --amend -m B1 $ hg commit --amend -m B2 $ hg up --hidden 'desc(B0)' updating to a hidden changeset a8b11f55fb19 (hidden revision 'a8b11f55fb19' was rewritten as: 261e70097290) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo C > C $ hg add C $ hg commit -m C 1 new orphan changesets $ hg log -G @ 4:212cb178bcbb C | | o 3:261e70097290 B2 | | x | 1:a8b11f55fb19 B0 (rewritten using amend as 3:261e70097290) |/ o 0:4a2df7238c3b A Rebase finds its way in a chain of marker $ hg rebase -d 'desc(B2)' note: not rebasing 1:a8b11f55fb19 "B0", already in destination as 3:261e70097290 "B2" rebasing 4:212cb178bcbb "C" (tip) Even when the chain include missing node $ hg up --hidden 'desc(B0)' updating to a hidden changeset a8b11f55fb19 (hidden revision 'a8b11f55fb19' was rewritten as: 261e70097290) 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo D > D $ hg add D $ hg commit -m D 1 new orphan changesets $ hg --hidden strip -r 'desc(B1)' saved backup bundle to $TESTTMP/obsskip/.hg/strip-backup/86f6414ccda7-b1c452ee-backup.hg 1 new orphan changesets $ hg log -G @ 5:1a79b7535141 D | | o 4:ff2c4d47b71d C | | | o 2:261e70097290 B2 | | x | 1:a8b11f55fb19 B0 (rewritten using amend as 2:261e70097290) |/ o 0:4a2df7238c3b A $ hg rebase -d 'desc(B2)' note: not rebasing 1:a8b11f55fb19 "B0", already in destination as 2:261e70097290 "B2" rebasing 5:1a79b7535141 "D" (tip) $ hg up 4 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo "O" > O $ hg add O $ hg commit -m O $ echo "P" > P $ hg add P $ hg commit -m P $ hg log -G @ 8:8d47583e023f P | o 7:360bbaa7d3ce O | | o 6:9c48361117de D | | o | 4:ff2c4d47b71d C |/ o 2:261e70097290 B2 | o 0:4a2df7238c3b A $ hg debugobsolete `hg log -r 7 -T '{node}\n'` --config experimental.evolution=true obsoleted 1 changesets 1 new orphan changesets $ hg rebase -d 6 -r "4::" rebasing 4:ff2c4d47b71d "C" note: not rebasing 7:360bbaa7d3ce "O", it has no successor rebasing 8:8d47583e023f "P" (tip) If all the changeset to be rebased are obsolete and present in the destination, we should display a friendly error message $ hg log -G @ 10:121d9e3bc4c6 P | o 9:4be60e099a77 C | o 6:9c48361117de D | o 2:261e70097290 B2 | o 0:4a2df7238c3b A $ hg up 9 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo "non-relevant change" > nonrelevant $ hg add nonrelevant $ hg commit -m nonrelevant created new head $ hg debugobsolete `hg log -r 11 -T '{node}\n'` --config experimental.evolution=true obsoleted 1 changesets $ hg log -G @ 11:f44da1f4954c nonrelevant (pruned) | | o 10:121d9e3bc4c6 P |/ o 9:4be60e099a77 C | o 6:9c48361117de D | o 2:261e70097290 B2 | o 0:4a2df7238c3b A $ hg rebase -r . -d 10 note: not rebasing 11:f44da1f4954c "nonrelevant" (tip), it has no successor If a rebase is going to create divergence, it should abort $ hg log -G @ 10:121d9e3bc4c6 P | o 9:4be60e099a77 C | o 6:9c48361117de D | o 2:261e70097290 B2 | o 0:4a2df7238c3b A $ hg up 9 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo "john" > doe $ hg add doe $ hg commit -m "john doe" created new head $ hg up 10 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo "foo" > bar $ hg add bar $ hg commit --amend -m "10'" $ hg up 10 --hidden updating to a hidden changeset 121d9e3bc4c6 (hidden revision '121d9e3bc4c6' was rewritten as: 77d874d096a2) 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo "bar" > foo $ hg add foo $ hg commit -m "bar foo" 1 new orphan changesets $ hg log -G @ 14:73568ab6879d bar foo | | o 13:77d874d096a2 10' | | | | o 12:3eb461388009 john doe | |/ x | 10:121d9e3bc4c6 P (rewritten using amend as 13:77d874d096a2) |/ o 9:4be60e099a77 C | o 6:9c48361117de D | o 2:261e70097290 B2 | o 0:4a2df7238c3b A $ hg summary parent: 14:73568ab6879d tip (orphan) bar foo branch: default commit: (clean) update: 2 new changesets, 3 branch heads (merge) phases: 8 draft orphan: 1 changesets $ hg rebase -s 10 -d 12 abort: this rebase will cause divergences from: 121d9e3bc4c6 (to force the rebase please set experimental.evolution.allowdivergence=True) [255] $ hg log -G @ 14:73568ab6879d bar foo | | o 13:77d874d096a2 10' | | | | o 12:3eb461388009 john doe | |/ x | 10:121d9e3bc4c6 P (rewritten using amend as 13:77d874d096a2) |/ o 9:4be60e099a77 C | o 6:9c48361117de D | o 2:261e70097290 B2 | o 0:4a2df7238c3b A With experimental.evolution.allowdivergence=True, rebase can create divergence $ hg rebase -s 10 -d 12 --config experimental.evolution.allowdivergence=True rebasing 10:121d9e3bc4c6 "P" rebasing 14:73568ab6879d "bar foo" (tip) 2 new content-divergent changesets $ hg summary parent: 16:61bd55f69bc4 tip bar foo branch: default commit: (clean) update: 1 new changesets, 2 branch heads (merge) phases: 8 draft content-divergent: 2 changesets rebase --continue + skipped rev because their successors are in destination we make a change in trunk and work on conflicting changes to make rebase abort. $ hg log -G -r 16:: @ 16:61bd55f69bc4 bar foo | ~ Create the two changes in trunk $ printf "a" > willconflict $ hg add willconflict $ hg commit -m "willconflict first version" $ printf "dummy" > C $ hg commit -m "dummy change successor" Create the changes that we will rebase $ hg update -C 16 -q $ printf "b" > willconflict $ hg add willconflict $ hg commit -m "willconflict second version" created new head $ printf "dummy" > K $ hg add K $ hg commit -m "dummy change" $ printf "dummy" > L $ hg add L $ hg commit -m "dummy change" $ hg debugobsolete `hg log -r ".^" -T '{node}'` `hg log -r 18 -T '{node}'` --config experimental.evolution=true obsoleted 1 changesets 1 new orphan changesets $ hg log -G -r 16:: @ 21:7bdc8a87673d dummy change | x 20:8b31da3c4919 dummy change (rewritten as 18:601db7a18f51) | o 19:b82fb57ea638 willconflict second version | | o 18:601db7a18f51 dummy change successor | | | o 17:357ddf1602d5 willconflict first version |/ o 16:61bd55f69bc4 bar foo | ~ $ hg rebase -r ".^^ + .^ + ." -d 18 rebasing 19:b82fb57ea638 "willconflict second version" merging willconflict warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark') unresolved conflicts (see hg resolve, then hg rebase --continue) [1] $ hg resolve --mark willconflict (no more unresolved files) continue: hg rebase --continue $ hg rebase --continue rebasing 19:b82fb57ea638 "willconflict second version" note: not rebasing 20:8b31da3c4919 "dummy change", already in destination as 18:601db7a18f51 "dummy change successor" rebasing 21:7bdc8a87673d "dummy change" (tip) $ cd .. Divergence cases due to obsolete changesets ------------------------------------------- We should ignore branches with unstable changesets when they are based on an obsolete changeset which successor is in rebase set. $ hg init divergence $ cd divergence $ cat >> .hg/hgrc << EOF > [extensions] > strip = > [alias] > strip = strip --no-backup --quiet > [templates] > instabilities = '{rev}:{node|short} {desc|firstline}{if(instabilities," ({instabilities})")}\n' > EOF $ hg debugdrawdag < e f > | | > d' d # replace: d -> d' > \ / > c > | > x b > \| > a > EOF 1 new orphan changesets $ hg log -G -r 'a':: * 7:1143e9adc121 f | | o 6:d60ebfa0f1cb e | | | o 5:027ad6c5830d d' | | x | 4:76be324c128b d (rewritten using replace as 5:027ad6c5830d) |/ o 3:a82ac2b38757 c | | o 2:630d7c95eff7 x | | o | 1:488e1b7e7341 b |/ o 0:b173517d0057 a Changeset d and its descendants are excluded to avoid divergence of d, which would occur because the successor of d (d') is also in rebaseset. As a consequence f (descendant of d) is left behind. $ hg rebase -b 'e' -d 'x' rebasing 1:488e1b7e7341 "b" (b) rebasing 3:a82ac2b38757 "c" (c) rebasing 5:027ad6c5830d "d'" (d') rebasing 6:d60ebfa0f1cb "e" (e) note: not rebasing 4:76be324c128b "d" (d) and its descendants as this would cause divergence $ hg log -G -r 'a':: o 11:eb6d63fc4ed5 e | o 10:44d8c724a70c d' | o 9:d008e6b4d3fd c | o 8:67e8f4a16c49 b | | * 7:1143e9adc121 f | | | | x 6:d60ebfa0f1cb e (rewritten using rebase as 11:eb6d63fc4ed5) | | | | | x 5:027ad6c5830d d' (rewritten using rebase as 10:44d8c724a70c) | | | | x | 4:76be324c128b d (rewritten using replace as 5:027ad6c5830d) | |/ | x 3:a82ac2b38757 c (rewritten using rebase as 9:d008e6b4d3fd) | | o | 2:630d7c95eff7 x | | | x 1:488e1b7e7341 b (rewritten using rebase as 8:67e8f4a16c49) |/ o 0:b173517d0057 a $ hg strip -r 8: If the rebase set has an obsolete (d) with a successor (d') outside the rebase set and none in destination, we still get the divergence warning. By allowing divergence, we can perform the rebase. $ hg rebase -r 'c'::'f' -d 'x' abort: this rebase will cause divergences from: 76be324c128b (to force the rebase please set experimental.evolution.allowdivergence=True) [255] $ hg rebase --config experimental.evolution.allowdivergence=true -r 'c'::'f' -d 'x' rebasing 3:a82ac2b38757 "c" (c) rebasing 4:76be324c128b "d" (d) rebasing 7:1143e9adc121 "f" (f tip) 1 new orphan changesets 2 new content-divergent changesets $ hg log -G -r 'a':: -T instabilities o 10:e1744ea07510 f | * 9:e2b36ea9a0a0 d (content-divergent) | o 8:6a0376de376e c | | x 7:1143e9adc121 f | | | | * 6:d60ebfa0f1cb e (orphan) | | | | | * 5:027ad6c5830d d' (orphan content-divergent) | | | | x | 4:76be324c128b d | |/ | x 3:a82ac2b38757 c | | o | 2:630d7c95eff7 x | | | o 1:488e1b7e7341 b |/ o 0:b173517d0057 a $ hg strip -r 8: (Not skipping obsoletes means that divergence is allowed.) $ hg rebase --config experimental.rebaseskipobsolete=false -r 'c'::'f' -d 'x' rebasing 3:a82ac2b38757 "c" (c) rebasing 4:76be324c128b "d" (d) rebasing 7:1143e9adc121 "f" (f tip) 1 new orphan changesets 2 new content-divergent changesets $ hg strip -r 0: Similar test on a more complex graph $ hg debugdrawdag < g > | > f e > | | > e' d # replace: e -> e' > \ / > c > | > x b > \| > a > EOF 1 new orphan changesets $ hg log -G -r 'a': * 8:2876ce66c6eb g | | o 7:3ffec603ab53 f | | x | 6:e36fae928aec e (rewritten using replace as 5:63324dc512ea) | | | o 5:63324dc512ea e' | | o | 4:76be324c128b d |/ o 3:a82ac2b38757 c | | o 2:630d7c95eff7 x | | o | 1:488e1b7e7341 b |/ o 0:b173517d0057 a $ hg rebase -b 'f' -d 'x' rebasing 1:488e1b7e7341 "b" (b) rebasing 3:a82ac2b38757 "c" (c) rebasing 5:63324dc512ea "e'" (e') rebasing 7:3ffec603ab53 "f" (f) rebasing 4:76be324c128b "d" (d) note: not rebasing 6:e36fae928aec "e" (e) and its descendants as this would cause divergence $ hg log -G -r 'a': o 13:a1707a5b7c2c d | | o 12:ef6251596616 f | | | o 11:b6f172e64af9 e' |/ o 10:d008e6b4d3fd c | o 9:67e8f4a16c49 b | | * 8:2876ce66c6eb g | | | | x 7:3ffec603ab53 f (rewritten using rebase as 12:ef6251596616) | | | | x | 6:e36fae928aec e (rewritten using replace as 5:63324dc512ea) | | | | | x 5:63324dc512ea e' (rewritten using rebase as 11:b6f172e64af9) | | | | x | 4:76be324c128b d (rewritten using rebase as 13:a1707a5b7c2c) | |/ | x 3:a82ac2b38757 c (rewritten using rebase as 10:d008e6b4d3fd) | | o | 2:630d7c95eff7 x | | | x 1:488e1b7e7341 b (rewritten using rebase as 9:67e8f4a16c49) |/ o 0:b173517d0057 a $ cd .. Rebase merge where successor of one parent is equal to destination (issue5198) $ hg init p1-succ-is-dest $ cd p1-succ-is-dest $ hg debugdrawdag < F > /| > E D B # replace: D -> B > \|/ > A > EOF 1 new orphan changesets $ hg rebase -d B -s D note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B" (B) rebasing 4:66f1a38021c9 "F" (F tip) $ hg log -G o 5:50e9d60b99c6 F |\ | | x 4:66f1a38021c9 F (rewritten using rebase as 5:50e9d60b99c6) | |/| | o | 3:7fb047a69f22 E | | | | | x 2:b18e25de2cf5 D (rewritten using replace as 1:112478962961) | |/ o | 1:112478962961 B |/ o 0:426bada5c675 A $ cd .. Rebase merge where successor of other parent is equal to destination $ hg init p2-succ-is-dest $ cd p2-succ-is-dest $ hg debugdrawdag < F > /| > E D B # replace: E -> B > \|/ > A > EOF 1 new orphan changesets $ hg rebase -d B -s E note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" (B) rebasing 4:66f1a38021c9 "F" (F tip) $ hg log -G o 5:aae1787dacee F |\ | | x 4:66f1a38021c9 F (rewritten using rebase as 5:aae1787dacee) | |/| | | x 3:7fb047a69f22 E (rewritten using replace as 1:112478962961) | | | | o | 2:b18e25de2cf5 D | |/ o / 1:112478962961 B |/ o 0:426bada5c675 A $ cd .. Rebase merge where successor of one parent is ancestor of destination $ hg init p1-succ-in-dest $ cd p1-succ-in-dest $ hg debugdrawdag < F C > /| | > E D B # replace: D -> B > \|/ > A > EOF 1 new orphan changesets $ hg rebase -d C -s D note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B" (B) rebasing 5:66f1a38021c9 "F" (F tip) $ hg log -G o 6:0913febf6439 F |\ +---x 5:66f1a38021c9 F (rewritten using rebase as 6:0913febf6439) | | | | o | 4:26805aba1e60 C | | | o | | 3:7fb047a69f22 E | | | +---x 2:b18e25de2cf5 D (rewritten using replace as 1:112478962961) | | | o 1:112478962961 B |/ o 0:426bada5c675 A $ cd .. Rebase merge where successor of other parent is ancestor of destination $ hg init p2-succ-in-dest $ cd p2-succ-in-dest $ hg debugdrawdag < F C > /| | > E D B # replace: E -> B > \|/ > A > EOF 1 new orphan changesets $ hg rebase -d C -s E note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" (B) rebasing 5:66f1a38021c9 "F" (F tip) $ hg log -G o 6:c6ab0cc6d220 F |\ +---x 5:66f1a38021c9 F (rewritten using rebase as 6:c6ab0cc6d220) | | | | o | 4:26805aba1e60 C | | | | | x 3:7fb047a69f22 E (rewritten using replace as 1:112478962961) | | | o---+ 2:b18e25de2cf5 D / / o / 1:112478962961 B |/ o 0:426bada5c675 A $ cd .. Rebase merge where successor of one parent is ancestor of destination $ hg init p1-succ-in-dest-b $ cd p1-succ-in-dest-b $ hg debugdrawdag < F C > /| | > E D B # replace: E -> B > \|/ > A > EOF 1 new orphan changesets $ hg rebase -d C -b F rebasing 2:b18e25de2cf5 "D" (D) note: not rebasing 3:7fb047a69f22 "E" (E), already in destination as 1:112478962961 "B" (B) rebasing 5:66f1a38021c9 "F" (F tip) note: rebase of 5:66f1a38021c9 created no changes to commit $ hg log -G o 6:8f47515dda15 D | | x 5:66f1a38021c9 F (pruned using rebase) | |\ o | | 4:26805aba1e60 C | | | | | x 3:7fb047a69f22 E (rewritten using replace as 1:112478962961) | | | | x | 2:b18e25de2cf5 D (rewritten using rebase as 6:8f47515dda15) | |/ o / 1:112478962961 B |/ o 0:426bada5c675 A $ cd .. Rebase merge where successor of other parent is ancestor of destination $ hg init p2-succ-in-dest-b $ cd p2-succ-in-dest-b $ hg debugdrawdag < F C > /| | > E D B # replace: D -> B > \|/ > A > EOF 1 new orphan changesets $ hg rebase -d C -b F note: not rebasing 2:b18e25de2cf5 "D" (D), already in destination as 1:112478962961 "B" (B) rebasing 3:7fb047a69f22 "E" (E) rebasing 5:66f1a38021c9 "F" (F tip) note: rebase of 5:66f1a38021c9 created no changes to commit $ hg log -G o 6:533690786a86 E | | x 5:66f1a38021c9 F (pruned using rebase) | |\ o | | 4:26805aba1e60 C | | | | | x 3:7fb047a69f22 E (rewritten using rebase as 6:533690786a86) | | | | x | 2:b18e25de2cf5 D (rewritten using replace as 1:112478962961) | |/ o / 1:112478962961 B |/ o 0:426bada5c675 A $ cd .. Rebase merge where both parents have successors in destination $ hg init p12-succ-in-dest $ cd p12-succ-in-dest $ hg debugdrawdag <<'EOS' > E F > /| /| # replace: A -> C > A B C D # replace: B -> D > | | > X Y > EOS 1 new orphan changesets $ hg rebase -r A+B+E -d F note: not rebasing 4:a3d17304151f "A" (A), already in destination as 0:96cc3511f894 "C" (C) note: not rebasing 5:b23a2cc00842 "B" (B), already in destination as 1:058c1e1fb10a "D" (D) rebasing 7:dac5d11c5a7d "E" (E tip) abort: rebasing 7:dac5d11c5a7d will include unwanted changes from 3:59c792af609c, 5:b23a2cc00842 or 2:ba2b7fa7166d, 4:a3d17304151f [255] $ cd .. Rebase a non-clean merge. One parent has successor in destination, the other parent moves as requested. $ hg init p1-succ-p2-move $ cd p1-succ-p2-move $ hg debugdrawdag <<'EOS' > D Z > /| | # replace: A -> C > A B C # D/D = D > EOS 1 new orphan changesets $ hg rebase -r A+B+D -d Z note: not rebasing 0:426bada5c675 "A" (A), already in destination as 2:96cc3511f894 "C" (C) rebasing 1:fc2b737bb2e5 "B" (B) rebasing 3:b8ed089c80ad "D" (D) $ rm .hg/localtags $ hg log -G o 6:e4f78693cc88 D | o 5:76840d832e98 B | o 4:50e41c1f3950 Z | o 2:96cc3511f894 C $ hg files -r tip B C D Z $ cd .. $ hg init p1-move-p2-succ $ cd p1-move-p2-succ $ hg debugdrawdag <<'EOS' > D Z > /| | # replace: B -> C > A B C # D/D = D > EOS 1 new orphan changesets $ hg rebase -r B+A+D -d Z rebasing 0:426bada5c675 "A" (A) note: not rebasing 1:fc2b737bb2e5 "B" (B), already in destination as 2:96cc3511f894 "C" (C) rebasing 3:b8ed089c80ad "D" (D) $ rm .hg/localtags $ hg log -G o 6:1b355ed94d82 D | o 5:a81a74d764a6 A | o 4:50e41c1f3950 Z | o 2:96cc3511f894 C $ hg files -r tip A C D Z $ cd .. Test that bookmark is moved and working dir is updated when all changesets have equivalents in destination $ hg init rbsrepo && cd rbsrepo $ echo "[experimental]" > .hg/hgrc $ echo "evolution=true" >> .hg/hgrc $ echo "rebaseskipobsolete=on" >> .hg/hgrc $ echo root > root && hg ci -Am root adding root $ echo a > a && hg ci -Am a adding a $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo b > b && hg ci -Am b adding b created new head $ hg rebase -r 2 -d 1 rebasing 2:1e9a3c00cbe9 "b" (tip) $ hg log -r . # working dir is at rev 3 (successor of 2) 3:be1832deae9a b (no-eol) $ hg book -r 2 mybook --hidden # rev 2 has a bookmark on it now bookmarking hidden changeset 1e9a3c00cbe9 (hidden revision '1e9a3c00cbe9' was rewritten as: be1832deae9a) $ hg up 2 && hg log -r . # working dir is at rev 2 again 0 files updated, 0 files merged, 1 files removed, 0 files unresolved 2:1e9a3c00cbe9 b (rewritten using rebase as 3:be1832deae9a) (no-eol) $ hg rebase -r 2 -d 3 --config experimental.evolution.track-operation=1 note: not rebasing 2:1e9a3c00cbe9 "b" (mybook), already in destination as 3:be1832deae9a "b" (tip) Check that working directory and bookmark was updated to rev 3 although rev 2 was skipped $ hg log -r . 3:be1832deae9a b (no-eol) $ hg bookmarks mybook 3:be1832deae9a $ hg debugobsolete --rev tip 1e9a3c00cbe90d236ac05ef61efcc5e40b7412bc be1832deae9ac531caa7438b8dcf6055a122cd8e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} Obsoleted working parent and bookmark could be moved if an ancestor of working parent gets moved: $ hg init $TESTTMP/ancestor-wd-move $ cd $TESTTMP/ancestor-wd-move $ hg debugdrawdag <<'EOS' > E D1 # rebase: D1 -> D2 > | | > | C > D2 | > | B > |/ > A > EOS $ hg update D1 -q $ hg bookmark book -i $ hg rebase -r B+D1 -d E rebasing 1:112478962961 "B" (B) note: not rebasing 5:15ecf15e0114 "D1" (book D1 tip), already in destination as 2:0807738e0be9 "D2" (D2) 1 new orphan changesets $ hg log -G -T '{desc} {bookmarks}' @ B book | | x D1 | | o | E | | | * C | | o | D2 | | | x B |/ o A Rebasing a merge with one of its parent having a hidden successor $ hg init $TESTTMP/merge-p1-hidden-successor $ cd $TESTTMP/merge-p1-hidden-successor $ hg debugdrawdag <<'EOS' > E > | > B3 B2 # amend: B1 -> B2 -> B3 > |/ # B2 is hidden > | D > | |\ > | B1 C > |/ > A > EOS 1 new orphan changesets $ eval `hg tags -T '{tag}={node}\n'` $ rm .hg/localtags $ hg rebase -r $D -d $E rebasing 5:9e62094e4d94 "D" $ hg log -G o 7:a699d059adcf D |\ | o 6:ecc93090a95c E | | | o 4:0dc878468a23 B3 | | o | 1:96cc3511f894 C / o 0:426bada5c675 A For some reasons (--hidden, rebaseskipobsolete=0, directaccess, etc.), rebasestate may contain hidden hashes. "rebase --abort" should work regardless. $ hg init $TESTTMP/hidden-state1 $ cd $TESTTMP/hidden-state1 $ cat >> .hg/hgrc < [experimental] > rebaseskipobsolete=0 > EOF $ hg debugdrawdag <<'EOS' > C > | > D B # prune: B, C > |/ # B/D=B > A > EOS $ eval `hg tags -T '{tag}={node}\n'` $ rm .hg/localtags $ hg update -q $C --hidden updating to a hidden changeset 7829726be4dc (hidden revision '7829726be4dc' is pruned) $ hg rebase -s $B -d $D rebasing 1:2ec65233581b "B" merging D warning: conflicts while merging D! (edit, then use 'hg resolve --mark') unresolved conflicts (see hg resolve, then hg rebase --continue) [1] $ cp -R . $TESTTMP/hidden-state2 $ hg log -G @ 2:b18e25de2cf5 D | | @ 1:2ec65233581b B (pruned using prune) |/ o 0:426bada5c675 A $ hg summary parent: 2:b18e25de2cf5 tip D parent: 1:2ec65233581b (obsolete) B branch: default commit: 2 modified, 1 unknown, 1 unresolved (merge) update: (current) phases: 3 draft rebase: 0 rebased, 2 remaining (rebase --continue) $ hg rebase --abort rebase aborted Also test --continue for the above case $ cd $TESTTMP/hidden-state2 $ hg resolve -m (no more unresolved files) continue: hg rebase --continue $ hg rebase --continue rebasing 1:2ec65233581b "B" rebasing 3:7829726be4dc "C" (tip) $ hg log -G @ 5:1964d5d5b547 C | o 4:68deb90c12a2 B | o 2:b18e25de2cf5 D | o 0:426bada5c675 A mercurial-4.5.3/tests/test-archive-symlinks.t0000644015407300116100000000123113261161234021166 0ustar augieeng00000000000000#require symlink $ origdir=`pwd` $ hg init repo $ cd repo $ ln -s nothing dangling avoid tar warnings about old timestamp $ hg ci -d '2000-01-01 00:00:00 +0000' -qAm 'add symlink' $ hg archive -t files ../archive $ hg archive -t tar -p tar ../archive.tar $ hg archive -t zip -p zip ../archive.zip files $ cd "$origdir" $ cd archive $ readlink.py dangling dangling -> nothing tar $ cd "$origdir" $ tar xf archive.tar $ cd tar $ readlink.py dangling dangling -> nothing #if unziplinks zip $ cd "$origdir" $ unzip archive.zip > /dev/null 2>&1 $ cd zip $ readlink.py dangling dangling -> nothing #endif $ cd .. mercurial-4.5.3/tests/test-gendoc-pt_BR.t0000644015407300116100000000012713261161234020144 0ustar augieeng00000000000000#require docutils gettext $ $TESTDIR/check-gendoc pt_BR checking for parse errors mercurial-4.5.3/tests/test-rebase-rename.t0000644015407300116100000001736113261161234020417 0ustar augieeng00000000000000 $ cat >> $HGRCPATH < [extensions] > rebase= > > [alias] > tlog = log --template "{rev}: {node|short} '{desc}' {branches}\n" > tglog = tlog --graph > EOF $ hg init a $ cd a $ mkdir d $ echo a > a $ hg ci -Am A adding a $ echo b > d/b $ hg ci -Am B adding d/b $ hg mv d d-renamed moving d/b to d-renamed/b $ hg ci -m 'rename B' $ hg up -q -C 1 $ hg mv a a-renamed $ echo x > d/x $ hg add d/x $ hg ci -m 'rename A' created new head $ hg tglog @ 3: 73a3ee40125d 'rename A' | | o 2: 220d0626d185 'rename B' |/ o 1: 3ab5da9a5c01 'B' | o 0: 1994f17a630e 'A' Rename is tracked: $ hg tlog -p --git -r tip 3: 73a3ee40125d 'rename A' diff --git a/a b/a-renamed rename from a rename to a-renamed diff --git a/d/x b/d/x new file mode 100644 --- /dev/null +++ b/d/x @@ -0,0 +1,1 @@ +x Rebase the revision containing the rename: $ hg rebase -s 3 -d 2 rebasing 3:73a3ee40125d "rename A" (tip) saved backup bundle to $TESTTMP/a/.hg/strip-backup/73a3ee40125d-1d78ebcf-rebase.hg $ hg tglog @ 3: 032a9b75e83b 'rename A' | o 2: 220d0626d185 'rename B' | o 1: 3ab5da9a5c01 'B' | o 0: 1994f17a630e 'A' Rename is not lost: $ hg tlog -p --git -r tip 3: 032a9b75e83b 'rename A' diff --git a/a b/a-renamed rename from a rename to a-renamed diff --git a/d-renamed/x b/d-renamed/x new file mode 100644 --- /dev/null +++ b/d-renamed/x @@ -0,0 +1,1 @@ +x Rebased revision does not contain information about b (issue3739) $ hg log -r 3 --debug changeset: 3:032a9b75e83bff1dcfb6cbfa4ef50a704bf1b569 tag: tip phase: draft parent: 2:220d0626d185f372d9d8f69d9c73b0811d7725f7 parent: -1:0000000000000000000000000000000000000000 manifest: 3:035d66b27a1b06b2d12b46d41a39adb7a200c370 user: test date: Thu Jan 01 00:00:00 1970 +0000 files+: a-renamed d-renamed/x files-: a extra: branch=default extra: rebase_source=73a3ee40125d6f0f347082e5831ceccb3f005f8a description: rename A $ cd .. $ hg init b $ cd b $ echo a > a $ hg ci -Am A adding a $ echo b > b $ hg ci -Am B adding b $ hg cp b b-copied $ hg ci -Am 'copy B' $ hg up -q -C 1 $ hg cp a a-copied $ hg ci -m 'copy A' created new head $ hg tglog @ 3: 0a8162ff18a8 'copy A' | | o 2: 39e588434882 'copy B' |/ o 1: 6c81ed0049f8 'B' | o 0: 1994f17a630e 'A' Copy is tracked: $ hg tlog -p --git -r tip 3: 0a8162ff18a8 'copy A' diff --git a/a b/a-copied copy from a copy to a-copied Rebase the revision containing the copy: $ hg rebase -s 3 -d 2 rebasing 3:0a8162ff18a8 "copy A" (tip) saved backup bundle to $TESTTMP/b/.hg/strip-backup/0a8162ff18a8-dd06302a-rebase.hg $ hg tglog @ 3: 98f6e6dbf45a 'copy A' | o 2: 39e588434882 'copy B' | o 1: 6c81ed0049f8 'B' | o 0: 1994f17a630e 'A' Copy is not lost: $ hg tlog -p --git -r tip 3: 98f6e6dbf45a 'copy A' diff --git a/a b/a-copied copy from a copy to a-copied Rebased revision does not contain information about b (issue3739) $ hg log -r 3 --debug changeset: 3:98f6e6dbf45ab54079c2237fbd11066a5c41a11d tag: tip phase: draft parent: 2:39e588434882ff77d01229d169cdc77f29e8855e parent: -1:0000000000000000000000000000000000000000 manifest: 3:2232f329d66fffe3930d43479ae624f66322b04d user: test date: Thu Jan 01 00:00:00 1970 +0000 files+: a-copied extra: branch=default extra: rebase_source=0a8162ff18a8900df8df8ef7ac0046955205613e description: copy A $ cd .. Test rebase across repeating renames: $ hg init repo $ cd repo $ echo testing > file1.txt $ hg add file1.txt $ hg ci -m "Adding file1" $ hg rename file1.txt file2.txt $ hg ci -m "Rename file1 to file2" $ echo Unrelated change > unrelated.txt $ hg add unrelated.txt $ hg ci -m "Unrelated change" $ hg rename file2.txt file1.txt $ hg ci -m "Rename file2 back to file1" $ hg update -r -2 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo Another unrelated change >> unrelated.txt $ hg ci -m "Another unrelated change" created new head $ hg tglog @ 4: b918d683b091 'Another unrelated change' | | o 3: 1ac17e43d8aa 'Rename file2 back to file1' |/ o 2: 480101d66d8d 'Unrelated change' | o 1: be44c61debd2 'Rename file1 to file2' | o 0: 8ce9a346991d 'Adding file1' $ hg rebase -s 4 -d 3 rebasing 4:b918d683b091 "Another unrelated change" (tip) saved backup bundle to $TESTTMP/repo/.hg/strip-backup/b918d683b091-3024bc57-rebase.hg $ hg diff --stat -c . unrelated.txt | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) $ cd .. Verify that copies get preserved (issue4192). $ hg init copy-gets-preserved $ cd copy-gets-preserved $ echo a > a $ hg add a $ hg commit --message "File a created" $ hg copy a b $ echo b > b $ hg commit --message "File b created as copy of a and modified" $ hg copy b c $ echo c > c $ hg commit --message "File c created as copy of b and modified" $ hg copy c d $ echo d > d $ hg commit --message "File d created as copy of c and modified" Note that there are four entries in the log for d $ hg tglog --follow d @ 3: 421b7e82bb85 'File d created as copy of c and modified' | o 2: 327f772bc074 'File c created as copy of b and modified' | o 1: 79d255d24ad2 'File b created as copy of a and modified' | o 0: b220cd6d2326 'File a created' Update back to before we performed copies, and inject an unrelated change. $ hg update 0 0 files updated, 0 files merged, 3 files removed, 0 files unresolved $ echo unrelated > unrelated $ hg add unrelated $ hg commit --message "Unrelated file created" created new head $ hg update 4 0 files updated, 0 files merged, 0 files removed, 0 files unresolved Rebase the copies on top of the unrelated change. $ hg rebase --source 1 --dest 4 rebasing 1:79d255d24ad2 "File b created as copy of a and modified" rebasing 2:327f772bc074 "File c created as copy of b and modified" rebasing 3:421b7e82bb85 "File d created as copy of c and modified" saved backup bundle to $TESTTMP/copy-gets-preserved/.hg/strip-backup/79d255d24ad2-a2265555-rebase.hg $ hg update 4 3 files updated, 0 files merged, 0 files removed, 0 files unresolved There should still be four entries in the log for d $ hg tglog --follow d @ 4: dbb9ba033561 'File d created as copy of c and modified' | o 3: af74b229bc02 'File c created as copy of b and modified' | o 2: 68bf06433839 'File b created as copy of a and modified' : o 0: b220cd6d2326 'File a created' Same steps as above, but with --collapse on rebase to make sure the copy records collapse correctly. $ hg co 1 0 files updated, 0 files merged, 3 files removed, 0 files unresolved $ echo more >> unrelated $ hg ci -m 'unrelated commit is unrelated' created new head $ hg rebase -s 2 --dest 5 --collapse rebasing 2:68bf06433839 "File b created as copy of a and modified" rebasing 3:af74b229bc02 "File c created as copy of b and modified" merging b and c to c rebasing 4:dbb9ba033561 "File d created as copy of c and modified" merging c and d to d saved backup bundle to $TESTTMP/copy-gets-preserved/.hg/strip-backup/68bf06433839-dde37595-rebase.hg $ hg co tip 3 files updated, 0 files merged, 0 files removed, 0 files unresolved This should show both revision 3 and 0 since 'd' was transitively a copy of 'a'. $ hg tglog --follow d @ 3: 5a46b94210e5 'Collapsed revision : * File b created as copy of a and modified : * File c created as copy of b and modified : * File d created as copy of c and modified' o 0: b220cd6d2326 'File a created' $ cd .. mercurial-4.5.3/tests/test-check-pylint.t0000644015407300116100000000106113261161234020271 0ustar augieeng00000000000000#require test-repo pylint hg10 Run pylint for known rules we care about. ----------------------------------------- There should be no recorded failures; fix the codebase before introducing a new check. Current checks: - W0102: no mutable default argument $ touch $TESTTMP/fakerc $ pylint --rcfile=$TESTTMP/fakerc --disable=all \ > --enable=W0102,C0321 \ > --reports=no \ > --ignore=thirdparty \ > mercurial hgdemandimport hgext hgext3rd (?) ------------------------------------ (?) Your code has been rated at 10.00/10 (?) (?) mercurial-4.5.3/tests/test-filecache.py.out0000644015407300116100000000212413261161234020576 0ustar augieeng00000000000000basic: * neither file exists creating * neither file still exists * empty file x created creating * file x changed size creating * nothing changed with either file * file x changed inode creating * empty file y created creating * file y changed size creating * file y changed inode creating * both files changed inode creating fakeuncacheable: * neither file exists creating * neither file still exists creating * empty file x created creating * file x changed size creating * nothing changed with either file creating * file x changed inode creating * empty file y created creating * file y changed size creating * file y changed inode creating * both files changed inode creating repository tip rolled back to revision -1 (undo commit) working directory now based on revision -1 repository tip rolled back to revision -1 (undo commit) working directory now based on revision -1 setbeforeget: * neither file exists string set externally * file x created creating string from function * string set externally again string 2 set externally * file y created creating string from function antiambiguity: mercurial-4.5.3/tests/heredoctest.py0000644015407300116100000000101613261161234017420 0ustar augieeng00000000000000from __future__ import absolute_import, print_function import sys globalvars = {} lines = sys.stdin.readlines() while lines: l = lines.pop(0) if l.startswith('SALT'): print(l[:-1]) elif l.startswith('>>> '): snippet = l[4:] while lines and lines[0].startswith('... '): l = lines.pop(0) snippet += l[4:] c = compile(snippet, '', 'single') try: exec(c, globalvars) except Exception as inst: print(repr(inst)) mercurial-4.5.3/tests/test-extension.t0000644015407300116100000015742213261161234017730 0ustar augieeng00000000000000Test basic extension support $ cat > foobar.py < import os > from mercurial import commands, registrar > cmdtable = {} > command = registrar.command(cmdtable) > configtable = {} > configitem = registrar.configitem(configtable) > configitem('tests', 'foo', default="Foo") > def uisetup(ui): > ui.write("uisetup called\\n") > ui.flush() > def reposetup(ui, repo): > ui.write("reposetup called for %s\\n" % os.path.basename(repo.root)) > ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!")) > ui.flush() > @command(b'foo', [], 'hg foo') > def foo(ui, *args, **kwargs): > foo = ui.config('tests', 'foo') > ui.write(foo) > ui.write("\\n") > @command(b'bar', [], 'hg bar', norepo=True) > def bar(ui, *args, **kwargs): > ui.write("Bar\\n") > EOF $ abspath=`pwd`/foobar.py $ mkdir barfoo $ cp foobar.py barfoo/__init__.py $ barfoopath=`pwd`/barfoo $ hg init a $ cd a $ echo foo > file $ hg add file $ hg commit -m 'add file' $ echo '[extensions]' >> $HGRCPATH $ echo "foobar = $abspath" >> $HGRCPATH $ hg foo uisetup called reposetup called for a ui == repo.ui reposetup called for a (chg !) ui == repo.ui (chg !) Foo $ cd .. $ hg clone a b uisetup called (no-chg !) reposetup called for a ui == repo.ui reposetup called for b ui == repo.ui updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bar uisetup called (no-chg !) Bar $ echo 'foobar = !' >> $HGRCPATH module/__init__.py-style $ echo "barfoo = $barfoopath" >> $HGRCPATH $ cd a $ hg foo uisetup called reposetup called for a ui == repo.ui reposetup called for a (chg !) ui == repo.ui (chg !) Foo $ echo 'barfoo = !' >> $HGRCPATH Check that extensions are loaded in phases: $ cat > foo.py < import os > name = os.path.basename(__file__).rsplit('.', 1)[0] > print("1) %s imported" % name) > def uisetup(ui): > print("2) %s uisetup" % name) > def extsetup(): > print("3) %s extsetup" % name) > def reposetup(ui, repo): > print("4) %s reposetup" % name) > > # custom predicate to check registration of functions at loading > from mercurial import ( > registrar, > smartset, > ) > revsetpredicate = registrar.revsetpredicate() > @revsetpredicate(name, safe=True) # safe=True for query via hgweb > def custompredicate(repo, subset, x): > return smartset.baseset([r for r in subset if r in {0}]) > EOF $ cp foo.py bar.py $ echo 'foo = foo.py' >> $HGRCPATH $ echo 'bar = bar.py' >> $HGRCPATH Check normal command's load order of extensions and registration of functions $ hg log -r "foo() and bar()" -q 1) foo imported 1) bar imported 2) foo uisetup 2) bar uisetup 3) foo extsetup 3) bar extsetup 4) foo reposetup 4) bar reposetup 0:c24b9ac61126 Check hgweb's load order of extensions and registration of functions $ cat > hgweb.cgi < #!$PYTHON > from mercurial import demandimport; demandimport.enable() > from mercurial.hgweb import hgweb > from mercurial.hgweb import wsgicgi > application = hgweb('.', 'test repo') > wsgicgi.launch(application) > EOF $ . "$TESTDIR/cgienv" $ PATH_INFO='/' SCRIPT_NAME='' $PYTHON hgweb.cgi \ > | grep '^[0-9]) ' # ignores HTML output 1) foo imported 1) bar imported 2) foo uisetup 2) bar uisetup 3) foo extsetup 3) bar extsetup 4) foo reposetup 4) bar reposetup (check that revset predicate foo() and bar() are available) #if msys $ PATH_INFO='//shortlog' #else $ PATH_INFO='/shortlog' #endif $ export PATH_INFO $ SCRIPT_NAME='' QUERY_STRING='rev=foo() and bar()' $PYTHON hgweb.cgi \ > | grep '' add file $ echo 'foo = !' >> $HGRCPATH $ echo 'bar = !' >> $HGRCPATH Check "from __future__ import absolute_import" support for external libraries #if windows $ PATHSEP=";" #else $ PATHSEP=":" #endif $ export PATHSEP $ mkdir $TESTTMP/libroot $ echo "s = 'libroot/ambig.py'" > $TESTTMP/libroot/ambig.py $ mkdir $TESTTMP/libroot/mod $ touch $TESTTMP/libroot/mod/__init__.py $ echo "s = 'libroot/mod/ambig.py'" > $TESTTMP/libroot/mod/ambig.py $ cat > $TESTTMP/libroot/mod/ambigabs.py < from __future__ import absolute_import > import ambig # should load "libroot/ambig.py" > s = ambig.s > EOF $ cat > loadabs.py < import mod.ambigabs as ambigabs > def extsetup(): > print('ambigabs.s=%s' % ambigabs.s) > EOF $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root) ambigabs.s=libroot/ambig.py $TESTTMP/a #if no-py3k $ cat > $TESTTMP/libroot/mod/ambigrel.py < import ambig # should load "libroot/mod/ambig.py" > s = ambig.s > EOF $ cat > loadrel.py < import mod.ambigrel as ambigrel > def extsetup(): > print('ambigrel.s=%s' % ambigrel.s) > EOF $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root) ambigrel.s=libroot/mod/ambig.py $TESTTMP/a #endif Check absolute/relative import of extension specific modules $ mkdir $TESTTMP/extroot $ cat > $TESTTMP/extroot/bar.py < s = 'this is extroot.bar' > EOF $ mkdir $TESTTMP/extroot/sub1 $ cat > $TESTTMP/extroot/sub1/__init__.py < s = 'this is extroot.sub1.__init__' > EOF $ cat > $TESTTMP/extroot/sub1/baz.py < s = 'this is extroot.sub1.baz' > EOF $ cat > $TESTTMP/extroot/__init__.py < s = 'this is extroot.__init__' > import foo > def extsetup(ui): > ui.write('(extroot) ', foo.func(), '\n') > ui.flush() > EOF $ cat > $TESTTMP/extroot/foo.py < # test absolute import > buf = [] > def func(): > # "not locals" case > import extroot.bar > buf.append('import extroot.bar in func(): %s' % extroot.bar.s) > return '\n(extroot) '.join(buf) > # "fromlist == ('*',)" case > from extroot.bar import * > buf.append('from extroot.bar import *: %s' % s) > # "not fromlist" and "if '.' in name" case > import extroot.sub1.baz > buf.append('import extroot.sub1.baz: %s' % extroot.sub1.baz.s) > # "not fromlist" and NOT "if '.' in name" case > import extroot > buf.append('import extroot: %s' % extroot.s) > # NOT "not fromlist" and NOT "level != -1" case > from extroot.bar import s > buf.append('from extroot.bar import s: %s' % s) > EOF $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.extroot=$TESTTMP/extroot root) (extroot) from extroot.bar import *: this is extroot.bar (extroot) import extroot.sub1.baz: this is extroot.sub1.baz (extroot) import extroot: this is extroot.__init__ (extroot) from extroot.bar import s: this is extroot.bar (extroot) import extroot.bar in func(): this is extroot.bar $TESTTMP/a #if no-py3k $ rm "$TESTTMP"/extroot/foo.* $ rm -Rf "$TESTTMP/extroot/__pycache__" $ cat > $TESTTMP/extroot/foo.py < # test relative import > buf = [] > def func(): > # "not locals" case > import bar > buf.append('import bar in func(): %s' % bar.s) > return '\n(extroot) '.join(buf) > # "fromlist == ('*',)" case > from bar import * > buf.append('from bar import *: %s' % s) > # "not fromlist" and "if '.' in name" case > import sub1.baz > buf.append('import sub1.baz: %s' % sub1.baz.s) > # "not fromlist" and NOT "if '.' in name" case > import sub1 > buf.append('import sub1: %s' % sub1.s) > # NOT "not fromlist" and NOT "level != -1" case > from bar import s > buf.append('from bar import s: %s' % s) > EOF $ hg --config extensions.extroot=$TESTTMP/extroot root (extroot) from bar import *: this is extroot.bar (extroot) import sub1.baz: this is extroot.sub1.baz (extroot) import sub1: this is extroot.sub1.__init__ (extroot) from bar import s: this is extroot.bar (extroot) import bar in func(): this is extroot.bar $TESTTMP/a #endif #if demandimport Examine whether module loading is delayed until actual referring, even though module is imported with "absolute_import" feature. Files below in each packages are used for described purpose: - "called": examine whether "from MODULE import ATTR" works correctly - "unused": examine whether loading is delayed correctly - "used": examine whether "from PACKAGE import MODULE" works correctly Package hierarchy is needed to examine whether demand importing works as expected for "from SUB.PACK.AGE import MODULE". Setup "external library" to be imported with "absolute_import" feature. $ mkdir -p $TESTTMP/extlibroot/lsub1/lsub2 $ touch $TESTTMP/extlibroot/__init__.py $ touch $TESTTMP/extlibroot/lsub1/__init__.py $ touch $TESTTMP/extlibroot/lsub1/lsub2/__init__.py $ cat > $TESTTMP/extlibroot/lsub1/lsub2/called.py < def func(): > return "this is extlibroot.lsub1.lsub2.called.func()" > EOF $ cat > $TESTTMP/extlibroot/lsub1/lsub2/unused.py < raise Exception("extlibroot.lsub1.lsub2.unused is loaded unintentionally") > EOF $ cat > $TESTTMP/extlibroot/lsub1/lsub2/used.py < detail = "this is extlibroot.lsub1.lsub2.used" > EOF Setup sub-package of "external library", which causes instantiation of demandmod in "recurse down the module chain" code path. Relative importing with "absolute_import" feature isn't tested, because "level >=1 " doesn't cause instantiation of demandmod. $ mkdir -p $TESTTMP/extlibroot/recursedown/abs $ cat > $TESTTMP/extlibroot/recursedown/abs/used.py < detail = "this is extlibroot.recursedown.abs.used" > EOF $ cat > $TESTTMP/extlibroot/recursedown/abs/__init__.py < from __future__ import absolute_import > from extlibroot.recursedown.abs.used import detail > EOF $ mkdir -p $TESTTMP/extlibroot/recursedown/legacy $ cat > $TESTTMP/extlibroot/recursedown/legacy/used.py < detail = "this is extlibroot.recursedown.legacy.used" > EOF $ cat > $TESTTMP/extlibroot/recursedown/legacy/__init__.py < # legacy style (level == -1) import > from extlibroot.recursedown.legacy.used import detail > EOF $ cat > $TESTTMP/extlibroot/recursedown/__init__.py < from __future__ import absolute_import > from extlibroot.recursedown.abs import detail as absdetail > from .legacy import detail as legacydetail > EOF Setup package that re-exports an attribute of its submodule as the same name. This leaves 'shadowing.used' pointing to 'used.detail', but still the submodule 'used' should be somehow accessible. (issue5617) $ mkdir -p $TESTTMP/extlibroot/shadowing $ cat > $TESTTMP/extlibroot/shadowing/used.py < detail = "this is extlibroot.shadowing.used" > EOF $ cat > $TESTTMP/extlibroot/shadowing/proxied.py < from __future__ import absolute_import > from extlibroot.shadowing.used import detail > EOF $ cat > $TESTTMP/extlibroot/shadowing/__init__.py < from __future__ import absolute_import > from .used import detail as used > EOF Setup extension local modules to be imported with "absolute_import" feature. $ mkdir -p $TESTTMP/absextroot/xsub1/xsub2 $ touch $TESTTMP/absextroot/xsub1/__init__.py $ touch $TESTTMP/absextroot/xsub1/xsub2/__init__.py $ cat > $TESTTMP/absextroot/xsub1/xsub2/called.py < def func(): > return "this is absextroot.xsub1.xsub2.called.func()" > EOF $ cat > $TESTTMP/absextroot/xsub1/xsub2/unused.py < raise Exception("absextroot.xsub1.xsub2.unused is loaded unintentionally") > EOF $ cat > $TESTTMP/absextroot/xsub1/xsub2/used.py < detail = "this is absextroot.xsub1.xsub2.used" > EOF Setup extension local modules to examine whether demand importing works as expected in "level > 1" case. $ cat > $TESTTMP/absextroot/relimportee.py < detail = "this is absextroot.relimportee" > EOF $ cat > $TESTTMP/absextroot/xsub1/xsub2/relimporter.py < from __future__ import absolute_import > from ... import relimportee > detail = "this relimporter imports %r" % (relimportee.detail) > EOF Setup modules, which actually import extension local modules at runtime. $ cat > $TESTTMP/absextroot/absolute.py << EOF > from __future__ import absolute_import > > # import extension local modules absolutely (level = 0) > from absextroot.xsub1.xsub2 import used, unused > from absextroot.xsub1.xsub2.called import func > > def getresult(): > result = [] > result.append(used.detail) > result.append(func()) > return result > EOF $ cat > $TESTTMP/absextroot/relative.py << EOF > from __future__ import absolute_import > > # import extension local modules relatively (level == 1) > from .xsub1.xsub2 import used, unused > from .xsub1.xsub2.called import func > > # import a module, which implies "importing with level > 1" > from .xsub1.xsub2 import relimporter > > def getresult(): > result = [] > result.append(used.detail) > result.append(func()) > result.append(relimporter.detail) > return result > EOF Setup main procedure of extension. $ cat > $TESTTMP/absextroot/__init__.py < from __future__ import absolute_import > from mercurial import registrar > cmdtable = {} > command = registrar.command(cmdtable) > > # "absolute" and "relative" shouldn't be imported before actual > # command execution, because (1) they import same modules, and (2) > # preceding import (= instantiate "demandmod" object instead of > # real "module" object) might hide problem of succeeding import. > > @command(b'showabsolute', [], norepo=True) > def showabsolute(ui, *args, **opts): > from absextroot import absolute > ui.write('ABS: %s\n' % '\nABS: '.join(absolute.getresult())) > > @command(b'showrelative', [], norepo=True) > def showrelative(ui, *args, **opts): > from . import relative > ui.write('REL: %s\n' % '\nREL: '.join(relative.getresult())) > > # import modules from external library > from extlibroot.lsub1.lsub2 import used as lused, unused as lunused > from extlibroot.lsub1.lsub2.called import func as lfunc > from extlibroot.recursedown import absdetail, legacydetail > from extlibroot.shadowing import proxied > > def uisetup(ui): > result = [] > result.append(lused.detail) > result.append(lfunc()) > result.append(absdetail) > result.append(legacydetail) > result.append(proxied.detail) > ui.write('LIB: %s\n' % '\nLIB: '.join(result)) > EOF Examine module importing. $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showabsolute) LIB: this is extlibroot.lsub1.lsub2.used LIB: this is extlibroot.lsub1.lsub2.called.func() LIB: this is extlibroot.recursedown.abs.used LIB: this is extlibroot.recursedown.legacy.used LIB: this is extlibroot.shadowing.used ABS: this is absextroot.xsub1.xsub2.used ABS: this is absextroot.xsub1.xsub2.called.func() $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showrelative) LIB: this is extlibroot.lsub1.lsub2.used LIB: this is extlibroot.lsub1.lsub2.called.func() LIB: this is extlibroot.recursedown.abs.used LIB: this is extlibroot.recursedown.legacy.used LIB: this is extlibroot.shadowing.used REL: this is absextroot.xsub1.xsub2.used REL: this is absextroot.xsub1.xsub2.called.func() REL: this relimporter imports 'this is absextroot.relimportee' Examine whether sub-module is imported relatively as expected. See also issue5208 for detail about example case on Python 3.x. $ f -q $TESTTMP/extlibroot/lsub1/lsub2/notexist.py $TESTTMP/extlibroot/lsub1/lsub2/notexist.py: file not found $ cat > $TESTTMP/notexist.py < text = 'notexist.py at root is loaded unintentionally\n' > EOF $ cat > $TESTTMP/checkrelativity.py < from mercurial import registrar > cmdtable = {} > command = registrar.command(cmdtable) > > # demand import avoids failure of importing notexist here > import extlibroot.lsub1.lsub2.notexist > > @command(b'checkrelativity', [], norepo=True) > def checkrelativity(ui, *args, **opts): > try: > ui.write(extlibroot.lsub1.lsub2.notexist.text) > return 1 # unintentional success > except ImportError: > pass # intentional failure > EOF $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.checkrelativity=$TESTTMP/checkrelativity.py checkrelativity) #endif Make sure a broken uisetup doesn't globally break hg: $ cat > $TESTTMP/baduisetup.py < def uisetup(ui): > 1/0 > EOF Even though the extension fails during uisetup, hg is still basically usable: $ hg --config extensions.baduisetup=$TESTTMP/baduisetup.py version Traceback (most recent call last): File "*/mercurial/extensions.py", line *, in _runuisetup (glob) uisetup(ui) File "$TESTTMP/baduisetup.py", line 2, in uisetup 1/0 ZeroDivisionError: integer division or modulo by zero *** failed to set up extension baduisetup: integer division or modulo by zero Mercurial Distributed SCM (version *) (glob) (see https://mercurial-scm.org for more information) Copyright (C) 2005-* Matt Mackall and others (glob) This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ cd .. hide outer repo $ hg init $ cat > empty.py < '''empty cmdtable > ''' > cmdtable = {} > EOF $ emptypath=`pwd`/empty.py $ echo "empty = $emptypath" >> $HGRCPATH $ hg help empty empty extension - empty cmdtable no commands defined $ echo 'empty = !' >> $HGRCPATH $ cat > debugextension.py < '''only debugcommands > ''' > from mercurial import registrar > cmdtable = {} > command = registrar.command(cmdtable) > @command(b'debugfoobar', [], 'hg debugfoobar') > def debugfoobar(ui, repo, *args, **opts): > "yet another debug command" > pass > @command(b'foo', [], 'hg foo') > def foo(ui, repo, *args, **opts): > """yet another foo command > This command has been DEPRECATED since forever. > """ > pass > EOF $ debugpath=`pwd`/debugextension.py $ echo "debugextension = $debugpath" >> $HGRCPATH $ hg help debugextension hg debugextensions show information about active extensions options: (some details hidden, use --verbose to show complete help) $ hg --verbose help debugextension hg debugextensions show information about active extensions options: -T --template TEMPLATE display with template (EXPERIMENTAL) global options ([+] can be repeated): -R --repository REPO repository root directory or name of overlay bundle file --cwd DIR change working directory -y --noninteractive do not prompt, automatically pick the first choice for all prompts -q --quiet suppress output -v --verbose enable additional output --color TYPE when to colorize (boolean, always, auto, never, or debug) --config CONFIG [+] set/override config option (use 'section.name=value') --debug enable debugging output --debugger start debugger --encoding ENCODE set the charset encoding (default: ascii) --encodingmode MODE set the charset encoding mode (default: strict) --traceback always print a traceback on exception --time time how long the command takes --profile print command execution profile --version output version information and exit -h --help display help and exit --hidden consider hidden changesets --pager TYPE when to paginate (boolean, always, auto, or never) (default: auto) $ hg --debug help debugextension hg debugextensions show information about active extensions options: -T --template TEMPLATE display with template (EXPERIMENTAL) global options ([+] can be repeated): -R --repository REPO repository root directory or name of overlay bundle file --cwd DIR change working directory -y --noninteractive do not prompt, automatically pick the first choice for all prompts -q --quiet suppress output -v --verbose enable additional output --color TYPE when to colorize (boolean, always, auto, never, or debug) --config CONFIG [+] set/override config option (use 'section.name=value') --debug enable debugging output --debugger start debugger --encoding ENCODE set the charset encoding (default: ascii) --encodingmode MODE set the charset encoding mode (default: strict) --traceback always print a traceback on exception --time time how long the command takes --profile print command execution profile --version output version information and exit -h --help display help and exit --hidden consider hidden changesets --pager TYPE when to paginate (boolean, always, auto, or never) (default: auto) $ echo 'debugextension = !' >> $HGRCPATH Asking for help about a deprecated extension should do something useful: $ hg help glog 'glog' is provided by the following extension: graphlog command to view revision graphs from a shell (DEPRECATED) (use 'hg help extensions' for information on enabling extensions) Extension module help vs command help: $ echo 'extdiff =' >> $HGRCPATH $ hg help extdiff hg extdiff [OPT]... [FILE]... use external program to diff repository (or selected files) Show differences between revisions for the specified files, using an external program. The default program used is diff, with default options "-Npru". 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. 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. (use 'hg help -e extdiff' to show help for the extdiff extension) options ([+] can be repeated): -p --program CMD comparison program to run -o --option OPT [+] pass option to comparison program -r --rev REV [+] revision -c --change REV change made by revision --patch compare patches for two revisions -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -S --subrepos recurse into subrepositories (some details hidden, use --verbose to show complete help) $ hg help --extension extdiff extdiff extension - command to allow external programs to compare revisions 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. The extdiff extension also allows you to configure new diff commands, so you do not need to type 'hg extdiff -p kdiff3' always. [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 meld, runs meld (no need to name twice). If # the meld executable is not available, the meld tool in [merge-tools] # will be used, if available 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))" Tool arguments can include variables that are expanded at runtime: $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. The extdiff extension will look in your [diff-tools] and [merge-tools] sections for diff tool arguments, when none are specified in [extdiff]. [extdiff] kdiff3 = [diff-tools] kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child You can use -I/-X and list of file or directory names like normal 'hg diff' 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). list of commands: extdiff use external program to diff repository (or selected files) (use 'hg help -v -e extdiff' to show built-in aliases and global options) $ echo 'extdiff = !' >> $HGRCPATH Test help topic with same name as extension $ cat > multirevs.py < from mercurial import commands, registrar > cmdtable = {} > command = registrar.command(cmdtable) > """multirevs extension > Big multi-line module docstring.""" > @command(b'multirevs', [], 'ARG', norepo=True) > def multirevs(ui, repo, arg, *args, **opts): > """multirevs command""" > pass > EOF $ echo "multirevs = multirevs.py" >> $HGRCPATH $ hg help multirevs | tail used): hg update :@ - Show diff between tags 1.3 and 1.5 (this works because the first and the last revisions of the revset are used): hg diff -r 1.3::1.5 use 'hg help -c multirevs' to see help for the multirevs command $ hg help -c multirevs hg multirevs ARG multirevs command (some details hidden, use --verbose to show complete help) $ hg multirevs hg multirevs: invalid arguments hg multirevs ARG multirevs command (use 'hg multirevs -h' to show more help) [255] $ echo "multirevs = !" >> $HGRCPATH Issue811: Problem loading extensions twice (by site and by user) $ cat <> $HGRCPATH > mq = > strip = > hgext.mq = > hgext/mq = > EOF Show extensions: (note that mq force load strip, also checking it's not loaded twice) $ hg debugextensions mq strip For extensions, which name matches one of its commands, help message should ask '-v -e' to get list of built-in aliases along with extension help itself $ mkdir $TESTTMP/d $ cat > $TESTTMP/d/dodo.py < """ > This is an awesome 'dodo' extension. It does nothing and > writes 'Foo foo' > """ > from mercurial import commands, registrar > cmdtable = {} > command = registrar.command(cmdtable) > @command(b'dodo', [], 'hg dodo') > def dodo(ui, *args, **kwargs): > """Does nothing""" > ui.write("I do nothing. Yay\\n") > @command(b'foofoo', [], 'hg foofoo') > def foofoo(ui, *args, **kwargs): > """Writes 'Foo foo'""" > ui.write("Foo foo\\n") > EOF $ dodopath=$TESTTMP/d/dodo.py $ echo "dodo = $dodopath" >> $HGRCPATH Make sure that user is asked to enter '-v -e' to get list of built-in aliases $ hg help -e dodo dodo extension - This is an awesome 'dodo' extension. It does nothing and writes 'Foo foo' list of commands: dodo Does nothing foofoo Writes 'Foo foo' (use 'hg help -v -e dodo' to show built-in aliases and global options) Make sure that '-v -e' prints list of built-in aliases along with extension help itself $ hg help -v -e dodo dodo extension - This is an awesome 'dodo' extension. It does nothing and writes 'Foo foo' list of commands: dodo Does nothing foofoo Writes 'Foo foo' global options ([+] can be repeated): -R --repository REPO repository root directory or name of overlay bundle file --cwd DIR change working directory -y --noninteractive do not prompt, automatically pick the first choice for all prompts -q --quiet suppress output -v --verbose enable additional output --color TYPE when to colorize (boolean, always, auto, never, or debug) --config CONFIG [+] set/override config option (use 'section.name=value') --debug enable debugging output --debugger start debugger --encoding ENCODE set the charset encoding (default: ascii) --encodingmode MODE set the charset encoding mode (default: strict) --traceback always print a traceback on exception --time time how long the command takes --profile print command execution profile --version output version information and exit -h --help display help and exit --hidden consider hidden changesets --pager TYPE when to paginate (boolean, always, auto, or never) (default: auto) Make sure that single '-v' option shows help and built-ins only for 'dodo' command $ hg help -v dodo hg dodo Does nothing (use 'hg help -e dodo' to show help for the dodo extension) options: --mq operate on patch repository global options ([+] can be repeated): -R --repository REPO repository root directory or name of overlay bundle file --cwd DIR change working directory -y --noninteractive do not prompt, automatically pick the first choice for all prompts -q --quiet suppress output -v --verbose enable additional output --color TYPE when to colorize (boolean, always, auto, never, or debug) --config CONFIG [+] set/override config option (use 'section.name=value') --debug enable debugging output --debugger start debugger --encoding ENCODE set the charset encoding (default: ascii) --encodingmode MODE set the charset encoding mode (default: strict) --traceback always print a traceback on exception --time time how long the command takes --profile print command execution profile --version output version information and exit -h --help display help and exit --hidden consider hidden changesets --pager TYPE when to paginate (boolean, always, auto, or never) (default: auto) In case when extension name doesn't match any of its commands, help message should ask for '-v' to get list of built-in aliases along with extension help $ cat > $TESTTMP/d/dudu.py < """ > This is an awesome 'dudu' extension. It does something and > also writes 'Beep beep' > """ > from mercurial import commands, registrar > cmdtable = {} > command = registrar.command(cmdtable) > @command(b'something', [], 'hg something') > def something(ui, *args, **kwargs): > """Does something""" > ui.write("I do something. Yaaay\\n") > @command(b'beep', [], 'hg beep') > def beep(ui, *args, **kwargs): > """Writes 'Beep beep'""" > ui.write("Beep beep\\n") > EOF $ dudupath=$TESTTMP/d/dudu.py $ echo "dudu = $dudupath" >> $HGRCPATH $ hg help -e dudu dudu extension - This is an awesome 'dudu' extension. It does something and also writes 'Beep beep' list of commands: beep Writes 'Beep beep' something Does something (use 'hg help -v dudu' to show built-in aliases and global options) In case when extension name doesn't match any of its commands, help options '-v' and '-v -e' should be equivalent $ hg help -v dudu dudu extension - This is an awesome 'dudu' extension. It does something and also writes 'Beep beep' list of commands: beep Writes 'Beep beep' something Does something global options ([+] can be repeated): -R --repository REPO repository root directory or name of overlay bundle file --cwd DIR change working directory -y --noninteractive do not prompt, automatically pick the first choice for all prompts -q --quiet suppress output -v --verbose enable additional output --color TYPE when to colorize (boolean, always, auto, never, or debug) --config CONFIG [+] set/override config option (use 'section.name=value') --debug enable debugging output --debugger start debugger --encoding ENCODE set the charset encoding (default: ascii) --encodingmode MODE set the charset encoding mode (default: strict) --traceback always print a traceback on exception --time time how long the command takes --profile print command execution profile --version output version information and exit -h --help display help and exit --hidden consider hidden changesets --pager TYPE when to paginate (boolean, always, auto, or never) (default: auto) $ hg help -v -e dudu dudu extension - This is an awesome 'dudu' extension. It does something and also writes 'Beep beep' list of commands: beep Writes 'Beep beep' something Does something global options ([+] can be repeated): -R --repository REPO repository root directory or name of overlay bundle file --cwd DIR change working directory -y --noninteractive do not prompt, automatically pick the first choice for all prompts -q --quiet suppress output -v --verbose enable additional output --color TYPE when to colorize (boolean, always, auto, never, or debug) --config CONFIG [+] set/override config option (use 'section.name=value') --debug enable debugging output --debugger start debugger --encoding ENCODE set the charset encoding (default: ascii) --encodingmode MODE set the charset encoding mode (default: strict) --traceback always print a traceback on exception --time time how long the command takes --profile print command execution profile --version output version information and exit -h --help display help and exit --hidden consider hidden changesets --pager TYPE when to paginate (boolean, always, auto, or never) (default: auto) Disabled extension commands: $ ORGHGRCPATH=$HGRCPATH $ HGRCPATH= $ export HGRCPATH $ hg help email 'email' is provided by the following extension: patchbomb command to send changesets as (a series of) patch emails (use 'hg help extensions' for information on enabling extensions) $ hg qdel hg: unknown command 'qdel' 'qdelete' is provided by the following extension: mq manage a stack of patches (use 'hg help extensions' for information on enabling extensions) [255] $ hg churn hg: unknown command 'churn' 'churn' is provided by the following extension: churn command to display statistics about repository history (use 'hg help extensions' for information on enabling extensions) [255] Disabled extensions: $ hg help churn churn extension - command to display statistics about repository history (use 'hg help extensions' for information on enabling extensions) $ hg help patchbomb patchbomb extension - command to send changesets as (a series of) patch emails The series is started off with a "[PATCH 0 of N]" introduction, which describes the series as a whole. 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: - The changeset description. - [Optional] The result of running diffstat on the patch. - The patch itself, as generated by 'hg export'. 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. To configure other defaults, add a section like this to your configuration file: [email] from = My Name to = recipient1, recipient2, ... cc = cc1, cc2, ... bcc = bcc1, bcc2, ... reply-to = address1, address2, ... Use "[patchbomb]" as configuration section name if you need to override global "[email]" address settings. Then you can use the 'hg email' command to mail a series of changesets as a patchbomb. 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. By default, 'hg email' will prompt for a "To" or "CC" header if you do not supply one via configuration or the command line. You can override this to never prompt by configuring an empty value: [email] cc = You can control the default inclusion of an introduction message with the "patchbomb.intro" configuration option. The configuration is always overwritten by command line flags like --intro and --desc: [patchbomb] intro=auto # include introduction message if more than 1 patch (default) intro=never # never include an introduction message intro=always # always include an introduction message You can specify a template for flags to be added in subject prefixes. Flags specified by --flag option are exported as "{flags}" keyword: [patchbomb] flagtemplate = "{separate(' ', ifeq(branch, 'default', '', branch|upper), flags)}" You can set patchbomb to always ask for confirmation by setting "patchbomb.confirm" to true. (use 'hg help extensions' for information on enabling extensions) Broken disabled extension and command: $ mkdir hgext $ echo > hgext/__init__.py $ cat > hgext/broken.py < "broken extension' > EOF $ cat > path.py < import os, sys > sys.path.insert(0, os.environ['HGEXTPATH']) > EOF $ HGEXTPATH=`pwd` $ export HGEXTPATH $ hg --config extensions.path=./path.py help broken broken extension - (no help text available) (use 'hg help extensions' for information on enabling extensions) $ cat > hgext/forest.py < cmdtable = None > EOF $ hg --config extensions.path=./path.py help foo > /dev/null warning: error finding commands in $TESTTMP/hgext/forest.py abort: no such help topic: foo (try 'hg help --keyword foo') [255] $ cat > throw.py < from mercurial import commands, registrar, util > cmdtable = {} > command = registrar.command(cmdtable) > class Bogon(Exception): pass > @command(b'throw', [], 'hg throw', norepo=True) > def throw(ui, **opts): > """throws an exception""" > raise Bogon() > EOF No declared supported version, extension complains: $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*' ** Unknown exception encountered with possibly-broken third-party extension throw ** which supports versions unknown of Mercurial. ** Please disable throw and try your action again. ** If that fixes the bug please report it to the extension author. ** Python * (glob) ** Mercurial Distributed SCM * (glob) ** Extensions loaded: throw empty declaration of supported version, extension complains: $ echo "testedwith = ''" >> throw.py $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*' ** Unknown exception encountered with possibly-broken third-party extension throw ** which supports versions unknown of Mercurial. ** Please disable throw and try your action again. ** If that fixes the bug please report it to the extension author. ** Python * (glob) ** Mercurial Distributed SCM (*) (glob) ** Extensions loaded: throw If the extension specifies a buglink, show that: $ echo 'buglink = "http://example.com/bts"' >> throw.py $ rm -f throw.pyc throw.pyo $ rm -Rf __pycache__ $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*' ** Unknown exception encountered with possibly-broken third-party extension throw ** which supports versions unknown of Mercurial. ** Please disable throw and try your action again. ** If that fixes the bug please report it to http://example.com/bts ** Python * (glob) ** Mercurial Distributed SCM (*) (glob) ** Extensions loaded: throw If the extensions declare outdated versions, accuse the older extension first: $ echo "from mercurial import util" >> older.py $ echo "util.version = lambda:'2.2'" >> older.py $ echo "testedwith = '1.9.3'" >> older.py $ echo "testedwith = '2.1.1'" >> throw.py $ rm -f throw.pyc throw.pyo $ rm -Rf __pycache__ $ hg --config extensions.throw=throw.py --config extensions.older=older.py \ > throw 2>&1 | egrep '^\*\*' ** Unknown exception encountered with possibly-broken third-party extension older ** which supports versions 1.9 of Mercurial. ** Please disable older and try your action again. ** If that fixes the bug please report it to the extension author. ** Python * (glob) ** Mercurial Distributed SCM (version 2.2) ** Extensions loaded: throw, older One extension only tested with older, one only with newer versions: $ echo "util.version = lambda:'2.1'" >> older.py $ rm -f older.pyc older.pyo $ rm -Rf __pycache__ $ hg --config extensions.throw=throw.py --config extensions.older=older.py \ > throw 2>&1 | egrep '^\*\*' ** Unknown exception encountered with possibly-broken third-party extension older ** which supports versions 1.9 of Mercurial. ** Please disable older and try your action again. ** If that fixes the bug please report it to the extension author. ** Python * (glob) ** Mercurial Distributed SCM (version 2.1) ** Extensions loaded: throw, older Older extension is tested with current version, the other only with newer: $ echo "util.version = lambda:'1.9.3'" >> older.py $ rm -f older.pyc older.pyo $ rm -Rf __pycache__ $ hg --config extensions.throw=throw.py --config extensions.older=older.py \ > throw 2>&1 | egrep '^\*\*' ** Unknown exception encountered with possibly-broken third-party extension throw ** which supports versions 2.1 of Mercurial. ** Please disable throw and try your action again. ** If that fixes the bug please report it to http://example.com/bts ** Python * (glob) ** Mercurial Distributed SCM (version 1.9.3) ** Extensions loaded: throw, older Ability to point to a different point $ hg --config extensions.throw=throw.py --config extensions.older=older.py \ > --config ui.supportcontact='Your Local Goat Lenders' throw 2>&1 | egrep '^\*\*' ** unknown exception encountered, please report by visiting ** Your Local Goat Lenders ** Python * (glob) ** Mercurial Distributed SCM (*) (glob) ** Extensions loaded: throw, older Declare the version as supporting this hg version, show regular bts link: $ hgver=`hg debuginstall -T '{hgver}'` $ echo 'testedwith = """'"$hgver"'"""' >> throw.py $ if [ -z "$hgver" ]; then > echo "unable to fetch a mercurial version. Make sure __version__ is correct"; > fi $ rm -f throw.pyc throw.pyo $ rm -Rf __pycache__ $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*' ** unknown exception encountered, please report by visiting ** https://mercurial-scm.org/wiki/BugTracker ** Python * (glob) ** Mercurial Distributed SCM (*) (glob) ** Extensions loaded: throw Patch version is ignored during compatibility check $ echo "testedwith = '3.2'" >> throw.py $ echo "util.version = lambda:'3.2.2'" >> throw.py $ rm -f throw.pyc throw.pyo $ rm -Rf __pycache__ $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*' ** unknown exception encountered, please report by visiting ** https://mercurial-scm.org/wiki/BugTracker ** Python * (glob) ** Mercurial Distributed SCM (*) (glob) ** Extensions loaded: throw Test version number support in 'hg version': $ echo '__version__ = (1, 2, 3)' >> throw.py $ rm -f throw.pyc throw.pyo $ rm -Rf __pycache__ $ hg version -v Mercurial Distributed SCM (version *) (glob) (see https://mercurial-scm.org for more information) Copyright (C) 2005-* Matt Mackall and others (glob) This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Enabled extensions: $ hg version -v --config extensions.throw=throw.py Mercurial Distributed SCM (version *) (glob) (see https://mercurial-scm.org for more information) Copyright (C) 2005-* Matt Mackall and others (glob) This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Enabled extensions: throw external 1.2.3 $ echo 'getversion = lambda: "1.twentythree"' >> throw.py $ rm -f throw.pyc throw.pyo $ rm -Rf __pycache__ $ hg version -v --config extensions.throw=throw.py --config extensions.strip= Mercurial Distributed SCM (version *) (glob) (see https://mercurial-scm.org for more information) Copyright (C) 2005-* Matt Mackall and others (glob) This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Enabled extensions: throw external 1.twentythree strip internal $ hg version -q --config extensions.throw=throw.py Mercurial Distributed SCM (version *) (glob) Test JSON output of version: $ hg version -Tjson [ { "extensions": [], "ver": "*" (glob) } ] $ hg version --config extensions.throw=throw.py -Tjson [ { "extensions": [{"bundled": false, "name": "throw", "ver": "1.twentythree"}], "ver": "3.2.2" } ] $ hg version --config extensions.strip= -Tjson [ { "extensions": [{"bundled": true, "name": "strip", "ver": null}], "ver": "*" (glob) } ] Test template output of version: $ hg version --config extensions.throw=throw.py --config extensions.strip= \ > -T'{extensions % "{name} {pad(ver, 16)} ({if(bundled, "internal", "external")})\n"}' throw 1.twentythree (external) strip (internal) Refuse to load extensions with minimum version requirements $ cat > minversion1.py << EOF > from mercurial import util > util.version = lambda: '3.5.2' > minimumhgversion = '3.6' > EOF $ hg --config extensions.minversion=minversion1.py version (third party extension minversion requires version 3.6 or newer of Mercurial; disabling) Mercurial Distributed SCM (version 3.5.2) (see https://mercurial-scm.org for more information) Copyright (C) 2005-* Matt Mackall and others (glob) This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ cat > minversion2.py << EOF > from mercurial import util > util.version = lambda: '3.6' > minimumhgversion = '3.7' > EOF $ hg --config extensions.minversion=minversion2.py version 2>&1 | egrep '\(third' (third party extension minversion requires version 3.7 or newer of Mercurial; disabling) Can load version that is only off by point release $ cat > minversion2.py << EOF > from mercurial import util > util.version = lambda: '3.6.1' > minimumhgversion = '3.6' > EOF $ hg --config extensions.minversion=minversion3.py version 2>&1 | egrep '\(third' [1] Can load minimum version identical to current $ cat > minversion3.py << EOF > from mercurial import util > util.version = lambda: '3.5' > minimumhgversion = '3.5' > EOF $ hg --config extensions.minversion=minversion3.py version 2>&1 | egrep '\(third' [1] Restore HGRCPATH $ HGRCPATH=$ORGHGRCPATH $ export HGRCPATH Commands handling multiple repositories at a time should invoke only "reposetup()" of extensions enabling in the target repository. $ mkdir reposetup-test $ cd reposetup-test $ cat > $TESTTMP/reposetuptest.py < from mercurial import extensions > def reposetup(ui, repo): > ui.write('reposetup() for %s\n' % (repo.root)) > ui.flush() > EOF $ hg init src $ echo a > src/a $ hg -R src commit -Am '#0 at src/a' adding a $ echo '[extensions]' >> src/.hg/hgrc $ echo '# enable extension locally' >> src/.hg/hgrc $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> src/.hg/hgrc $ hg -R src status reposetup() for $TESTTMP/reposetup-test/src reposetup() for $TESTTMP/reposetup-test/src (chg !) $ hg clone -U src clone-dst1 reposetup() for $TESTTMP/reposetup-test/src $ hg init push-dst1 $ hg -q -R src push push-dst1 reposetup() for $TESTTMP/reposetup-test/src $ hg init pull-src1 $ hg -q -R pull-src1 pull src reposetup() for $TESTTMP/reposetup-test/src $ cat <> $HGRCPATH > [extensions] > # disable extension globally and explicitly > reposetuptest = ! > EOF $ hg clone -U src clone-dst2 reposetup() for $TESTTMP/reposetup-test/src $ hg init push-dst2 $ hg -q -R src push push-dst2 reposetup() for $TESTTMP/reposetup-test/src $ hg init pull-src2 $ hg -q -R pull-src2 pull src reposetup() for $TESTTMP/reposetup-test/src $ cat <> $HGRCPATH > [extensions] > # enable extension globally > reposetuptest = $TESTTMP/reposetuptest.py > EOF $ hg clone -U src clone-dst3 reposetup() for $TESTTMP/reposetup-test/src reposetup() for $TESTTMP/reposetup-test/clone-dst3 $ hg init push-dst3 reposetup() for $TESTTMP/reposetup-test/push-dst3 $ hg -q -R src push push-dst3 reposetup() for $TESTTMP/reposetup-test/src reposetup() for $TESTTMP/reposetup-test/push-dst3 $ hg init pull-src3 reposetup() for $TESTTMP/reposetup-test/pull-src3 $ hg -q -R pull-src3 pull src reposetup() for $TESTTMP/reposetup-test/pull-src3 reposetup() for $TESTTMP/reposetup-test/src $ echo '[extensions]' >> src/.hg/hgrc $ echo '# disable extension locally' >> src/.hg/hgrc $ echo 'reposetuptest = !' >> src/.hg/hgrc $ hg clone -U src clone-dst4 reposetup() for $TESTTMP/reposetup-test/clone-dst4 $ hg init push-dst4 reposetup() for $TESTTMP/reposetup-test/push-dst4 $ hg -q -R src push push-dst4 reposetup() for $TESTTMP/reposetup-test/push-dst4 $ hg init pull-src4 reposetup() for $TESTTMP/reposetup-test/pull-src4 $ hg -q -R pull-src4 pull src reposetup() for $TESTTMP/reposetup-test/pull-src4 disabling in command line overlays with all configuration $ hg --config extensions.reposetuptest=! clone -U src clone-dst5 $ hg --config extensions.reposetuptest=! init push-dst5 $ hg --config extensions.reposetuptest=! -q -R src push push-dst5 $ hg --config extensions.reposetuptest=! init pull-src5 $ hg --config extensions.reposetuptest=! -q -R pull-src5 pull src $ cat <> $HGRCPATH > [extensions] > # disable extension globally and explicitly > reposetuptest = ! > EOF $ hg init parent $ hg init parent/sub1 $ echo 1 > parent/sub1/1 $ hg -R parent/sub1 commit -Am '#0 at parent/sub1' adding 1 $ hg init parent/sub2 $ hg init parent/sub2/sub21 $ echo 21 > parent/sub2/sub21/21 $ hg -R parent/sub2/sub21 commit -Am '#0 at parent/sub2/sub21' adding 21 $ cat > parent/sub2/.hgsub < sub21 = sub21 > EOF $ hg -R parent/sub2 commit -Am '#0 at parent/sub2' adding .hgsub $ hg init parent/sub3 $ echo 3 > parent/sub3/3 $ hg -R parent/sub3 commit -Am '#0 at parent/sub3' adding 3 $ cat > parent/.hgsub < sub1 = sub1 > sub2 = sub2 > sub3 = sub3 > EOF $ hg -R parent commit -Am '#0 at parent' adding .hgsub $ echo '[extensions]' >> parent/.hg/hgrc $ echo '# enable extension locally' >> parent/.hg/hgrc $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> parent/.hg/hgrc $ cp parent/.hg/hgrc parent/sub2/.hg/hgrc $ hg -R parent status -S -A reposetup() for $TESTTMP/reposetup-test/parent reposetup() for $TESTTMP/reposetup-test/parent/sub2 C .hgsub C .hgsubstate C sub1/1 C sub2/.hgsub C sub2/.hgsubstate C sub2/sub21/21 C sub3/3 $ cd .. Prohibit registration of commands that don't use @command (issue5137) $ hg init deprecated $ cd deprecated $ cat < deprecatedcmd.py > def deprecatedcmd(repo, ui): > pass > cmdtable = { > 'deprecatedcmd': (deprecatedcmd, [], ''), > } > EOF $ cat < .hg/hgrc > [extensions] > deprecatedcmd = `pwd`/deprecatedcmd.py > mq = ! > hgext.mq = ! > hgext/mq = ! > EOF $ hg deprecatedcmd > /dev/null *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo *** (use @command decorator to register 'deprecatedcmd') hg: unknown command 'deprecatedcmd' [255] the extension shouldn't be loaded at all so the mq works: $ hg qseries --config extensions.mq= > /dev/null *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo *** (use @command decorator to register 'deprecatedcmd') $ cd .. Test synopsis and docstring extending $ hg init exthelp $ cat > exthelp.py < from mercurial import commands, extensions > def exbookmarks(orig, *args, **opts): > return orig(*args, **opts) > def uisetup(ui): > synopsis = ' GREPME [--foo] [-x]' > docstring = ''' > GREPME make sure that this is in the help! > ''' > extensions.wrapcommand(commands.table, 'bookmarks', exbookmarks, > synopsis, docstring) > EOF $ abspath=`pwd`/exthelp.py $ echo '[extensions]' >> $HGRCPATH $ echo "exthelp = $abspath" >> $HGRCPATH $ cd exthelp $ hg help bookmarks | grep GREPME hg bookmarks [OPTIONS]... [NAME]... GREPME [--foo] [-x] GREPME make sure that this is in the help! $ cd .. Show deprecation warning for the use of cmdutil.command $ cat > nonregistrar.py < from mercurial import cmdutil > cmdtable = {} > command = cmdutil.command(cmdtable) > @command(b'foo', [], norepo=True) > def foo(ui): > pass > EOF $ hg --config extensions.nonregistrar=`pwd`/nonregistrar.py version > /dev/null devel-warn: cmdutil.command is deprecated, use registrar.command to register 'foo' (compatibility will be dropped after Mercurial-4.6, update your code.) * (glob) Prohibit the use of unicode strings as the default value of options $ hg init $TESTTMP/opt-unicode-default $ cat > $TESTTMP/test_unicode_default_value.py << EOF > from mercurial import registrar > cmdtable = {} > command = registrar.command(cmdtable) > @command('dummy', [('', 'opt', u'value', u'help')], 'ext [OPTIONS]') > def ext(*args, **opts): > print(opts['opt']) > EOF $ cat > $TESTTMP/opt-unicode-default/.hg/hgrc << EOF > [extensions] > test_unicode_default_value = $TESTTMP/test_unicode_default_value.py > EOF $ hg -R $TESTTMP/opt-unicode-default dummy *** failed to import extension test_unicode_default_value from $TESTTMP/test_unicode_default_value.py: option 'dummy.opt' has a unicode default value *** (change the dummy.opt default value to a non-unicode string) hg: unknown command 'dummy' (did you mean summary?) [255] mercurial-4.5.3/tests/test-rebase-inmemory.t0000644015407300116100000000560313261161234021003 0ustar augieeng00000000000000#require symlink execbit $ cat << EOF >> $HGRCPATH > [extensions] > amend= > rebase= > debugdrawdag=$TESTDIR/drawdag.py > [rebase] > experimental.inmemory=1 > [diff] > git=1 > [alias] > tglog = log -G --template "{rev}: {node|short} '{desc}'\n" > EOF Rebase a simple DAG: $ hg init repo1 $ cd repo1 $ hg debugdrawdag <<'EOS' > c b > |/ > d > | > a > EOS $ hg up -C a 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg tglog o 3: 814f6bd05178 'c' | | o 2: db0e82a16a62 'b' |/ o 1: 02952614a83d 'd' | @ 0: b173517d0057 'a' $ hg cat -r 3 c c (no-eol) $ hg cat -r 2 b b (no-eol) $ hg rebase --debug -r b -d c | grep rebasing rebasing in-memory rebasing 2:db0e82a16a62 "b" (b) $ hg tglog o 3: ca58782ad1e4 'b' | o 2: 814f6bd05178 'c' | o 1: 02952614a83d 'd' | @ 0: b173517d0057 'a' $ hg cat -r 3 b b (no-eol) $ hg cat -r 2 c c (no-eol) Case 2: $ hg init repo2 $ cd repo2 $ hg debugdrawdag <<'EOS' > c b > |/ > d > | > a > EOS Add a symlink and executable file: $ hg up -C c 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ ln -s somefile e $ echo f > f $ chmod +x f $ hg add e f $ hg amend -q $ hg up -Cq a Write files to the working copy, and ensure they're still there after the rebase $ echo "abc" > a $ ln -s def b $ echo "ghi" > c $ echo "jkl" > d $ echo "mno" > e $ hg tglog o 3: f56b71190a8f 'c' | | o 2: db0e82a16a62 'b' |/ o 1: 02952614a83d 'd' | @ 0: b173517d0057 'a' $ hg cat -r 3 c c (no-eol) $ hg cat -r 2 b b (no-eol) $ hg cat -r 3 e somefile (no-eol) $ hg rebase --debug -s b -d a | grep rebasing rebasing in-memory rebasing 2:db0e82a16a62 "b" (b) $ hg tglog o 3: fc055c3b4d33 'b' | | o 2: f56b71190a8f 'c' | | | o 1: 02952614a83d 'd' |/ @ 0: b173517d0057 'a' $ hg cat -r 2 c c (no-eol) $ hg cat -r 3 b b (no-eol) $ hg rebase --debug -s 1 -d 3 | grep rebasing rebasing in-memory rebasing 1:02952614a83d "d" (d) rebasing 2:f56b71190a8f "c" $ hg tglog o 3: 753feb6fd12a 'c' | o 2: 09c044d2cb43 'd' | o 1: fc055c3b4d33 'b' | @ 0: b173517d0057 'a' Ensure working copy files are still there: $ cat a abc $ readlink.py b b -> def $ cat e mno Ensure symlink and executable files were rebased properly: $ hg up -Cq 3 $ readlink.py e e -> somefile $ ls -l f | cut -c -10 -rwxr-xr-x Rebase the working copy parent, which should default to an on-disk merge even if we requested in-memory. $ hg up -C 3 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg rebase -r 3 -d 0 --debug | grep rebasing rebasing on disk rebasing 3:753feb6fd12a "c" (tip) $ hg tglog @ 3: 844a7de3e617 'c' | | o 2: 09c044d2cb43 'd' | | | o 1: fc055c3b4d33 'b' |/ o 0: b173517d0057 'a' mercurial-4.5.3/tests/test-hgweb-non-interactive.t0000644015407300116100000000476113261161234022110 0ustar augieeng00000000000000Tests if hgweb can run without touching sys.stdin, as is required by the WSGI standard and strictly implemented by mod_wsgi. $ hg init repo $ cd repo $ echo foo > bar $ hg add bar $ hg commit -m "test" $ cat > request.py < from __future__ import absolute_import > import os > import sys > from mercurial import ( > dispatch, > hg, > ui as uimod, > util, > ) > ui = uimod.ui > from mercurial.hgweb.hgweb_mod import ( > hgweb, > ) > stringio = util.stringio > > class FileLike(object): > def __init__(self, real): > self.real = real > def fileno(self): > print >> sys.__stdout__, 'FILENO' > return self.real.fileno() > def read(self): > print >> sys.__stdout__, 'READ' > return self.real.read() > def readline(self): > print >> sys.__stdout__, 'READLINE' > return self.real.readline() > > sys.stdin = FileLike(sys.stdin) > errors = stringio() > input = stringio() > output = stringio() > > def startrsp(status, headers): > print('---- STATUS') > print(status) > print('---- HEADERS') > print([i for i in headers if i[0] != 'ETag']) > print('---- DATA') > return output.write > > env = { > 'wsgi.version': (1, 0), > 'wsgi.url_scheme': 'http', > 'wsgi.errors': errors, > 'wsgi.input': input, > 'wsgi.multithread': False, > 'wsgi.multiprocess': False, > 'wsgi.run_once': False, > 'REQUEST_METHOD': 'GET', > 'SCRIPT_NAME': '', > 'PATH_INFO': '', > 'QUERY_STRING': '', > 'SERVER_NAME': '$LOCALIP', > 'SERVER_PORT': os.environ['HGPORT'], > 'SERVER_PROTOCOL': 'HTTP/1.0' > } > > i = hgweb('.') > for c in i(env, startrsp): > pass > print('---- ERRORS') > print(errors.getvalue()) > print('---- OS.ENVIRON wsgi variables') > print(sorted([x for x in os.environ if x.startswith('wsgi')])) > print('---- request.ENVIRON wsgi variables') > with i._obtainrepo() as repo: > print(sorted([x for x in repo.ui.environ if x.startswith('wsgi')])) > EOF $ $PYTHON request.py ---- STATUS 200 Script output follows ---- HEADERS [('Content-Type', 'text/html; charset=ascii')] ---- DATA ---- ERRORS ---- OS.ENVIRON wsgi variables [] ---- request.ENVIRON wsgi variables ['wsgi.errors', 'wsgi.input', 'wsgi.multiprocess', 'wsgi.multithread', 'wsgi.run_once', 'wsgi.url_scheme', 'wsgi.version'] $ cd .. mercurial-4.5.3/tests/test-convert-baz.t0000644015407300116100000001240313261161234020133 0ustar augieeng00000000000000#require baz symlink $ baz my-id "mercurial " $ echo "[extensions]" >> $HGRCPATH $ echo "convert=" >> $HGRCPATH create baz archive $ baz make-archive baz@mercurial--convert hg-test-convert-baz initialize baz repo $ mkdir baz-repo $ cd baz-repo/ $ baz init-tree baz@mercurial--convert/baz--test--0 $ baz import * creating version baz@mercurial--convert/baz--test--0 * imported baz@mercurial--convert/baz--test--0 create initial files $ echo 'this is a file' > a $ baz add a $ mkdir src $ baz add src $ cd src $ dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null $ baz add b HACK: hide GNU tar-1.22 "tar: The --preserve option is deprecated, use --preserve-permissions --preserve-order instead" $ baz commit -s "added a file, src and src/b (binary)" 2>&1 | grep -v '^tar' * build pristine tree for baz@mercurial--convert/baz--test--0--base-0 * Scanning for full-tree revision: . * from import revision: baz@mercurial--convert/baz--test--0--base-0 A/ .arch-ids A/ src A/ src/.arch-ids A .arch-ids/a.id A a A src/.arch-ids/=id A src/.arch-ids/b.id A src/b * update pristine tree (baz@mercurial--convert/baz--test--0--base-0 => baz--test--0--patch-1) * committed baz@mercurial--convert/baz--test--0--patch-1 create link file and modify a $ ln -s ../a a-link $ baz add a-link $ echo 'this a modification to a' >> ../a $ baz commit -s "added link to a and modify a" A src/.arch-ids/a-link.id A src/a-link M a * update pristine tree (baz@mercurial--convert/baz--test--0--patch-1 => baz--test--0--patch-2) * committed baz@mercurial--convert/baz--test--0--patch-2 create second link and modify b $ ln -s ../a a-link-2 $ baz add a-link-2 $ dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null $ baz commit -s "added second link and modify b" A src/.arch-ids/a-link-2.id A src/a-link-2 Mb src/b * update pristine tree (baz@mercurial--convert/baz--test--0--patch-2 => baz--test--0--patch-3) * committed baz@mercurial--convert/baz--test--0--patch-3 b file to link and a-link-2 to regular file $ rm -f a-link-2 $ echo 'this is now a regular file' > a-link-2 $ ln -sf ../a b $ baz commit -s "file to link and link to file test" fl src/b lf src/a-link-2 * update pristine tree (baz@mercurial--convert/baz--test--0--patch-3 => baz--test--0--patch-4) * committed baz@mercurial--convert/baz--test--0--patch-4 move a-link-2 file and src directory $ cd .. $ baz mv src/a-link-2 c $ baz mv src test $ baz commit -s "move and rename a-link-2 file and src directory" D/ src/.arch-ids A/ test/.arch-ids /> src test => src/.arch-ids/a-link-2.id .arch-ids/c.id => src/a-link-2 c => src/.arch-ids/=id test/.arch-ids/=id => src/.arch-ids/a-link.id test/.arch-ids/a-link.id => src/.arch-ids/b.id test/.arch-ids/b.id * update pristine tree (baz@mercurial--convert/baz--test--0--patch-4 => baz--test--0--patch-5) * committed baz@mercurial--convert/baz--test--0--patch-5 move and add the moved file again $ echo e > e $ baz add e $ baz commit -s "add e" A .arch-ids/e.id A e * update pristine tree (baz@mercurial--convert/baz--test--0--patch-5 => baz--test--0--patch-6) * committed baz@mercurial--convert/baz--test--0--patch-6 $ baz mv e f $ echo ee > e $ baz add e $ baz commit -s "move e and recreate it again" A .arch-ids/e.id A e => .arch-ids/e.id .arch-ids/f.id => e f * update pristine tree (baz@mercurial--convert/baz--test--0--patch-6 => baz--test--0--patch-7) * committed baz@mercurial--convert/baz--test--0--patch-7 $ cd .. converting baz repo to Mercurial $ hg convert baz-repo baz-repo-hg initializing destination baz-repo-hg repository analyzing tree version baz@mercurial--convert/baz--test--0... scanning source... sorting... converting... 7 initial import 6 added a file, src and src/b (binary) 5 added link to a and modify a 4 added second link and modify b 3 file to link and link to file test 2 move and rename a-link-2 file and src directory 1 add e 0 move e and recreate it again $ baz register-archive -d baz@mercurial--convert $ glog() > { > hg log -G --template '{rev} "{desc|firstline}" files: {files}\n' "$@" > } show graph log $ glog -R baz-repo-hg o 7 "move e and recreate it again" files: e f | o 6 "add e" files: e | o 5 "move and rename a-link-2 file and src directory" files: c src/a-link src/a-link-2 src/b test/a-link test/b | o 4 "file to link and link to file test" files: src/a-link-2 src/b | o 3 "added second link and modify b" files: src/a-link-2 src/b | o 2 "added link to a and modify a" files: a src/a-link | o 1 "added a file, src and src/b (binary)" files: a src/b | o 0 "initial import" files: $ hg up -q -R baz-repo-hg $ hg -R baz-repo-hg manifest --debug c4072c4b72e1cabace081888efa148ee80ca3cbb 644 a 0201ac32a3a8e86e303dff60366382a54b48a72e 644 c 1a4a864db0073705a11b1439f563bfa4b46d9246 644 e 09e0222742fc3f75777fa9d68a5d8af7294cb5e7 644 f c0067ba5ff0b7c9a3eb17270839d04614c435623 644 @ test/a-link 375f4263d86feacdea7e3c27100abd1560f2a973 644 @ test/b $ hg -R baz-repo-hg log -r 5 -r 7 -C --debug | grep copies copies: c (src/a-link-2) test/a-link (src/a-link) test/b (src/b) copies: f (e) mercurial-4.5.3/tests/test-diff-hashes.t0000644015407300116100000000176513261161234020073 0ustar augieeng00000000000000 $ hg init a $ cd a $ hg diff inexistent1 inexistent2 inexistent1: * (glob) inexistent2: * (glob) $ echo bar > foo $ hg add foo $ hg ci -m 'add foo' $ echo foobar > foo $ hg ci -m 'change foo' $ hg --quiet diff -r 0 -r 1 --- a/foo Thu Jan 01 00:00:00 1970 +0000 +++ b/foo Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -bar +foobar $ hg diff -r 0 -r 1 diff -r a99fb63adac3 -r 9b8568d3af2f foo --- a/foo Thu Jan 01 00:00:00 1970 +0000 +++ b/foo Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -bar +foobar $ hg --verbose diff -r 0 -r 1 diff -r a99fb63adac3 -r 9b8568d3af2f foo --- a/foo Thu Jan 01 00:00:00 1970 +0000 +++ b/foo Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -bar +foobar $ hg --debug diff -r 0 -r 1 diff -r a99fb63adac3f31816a22f665bc3b7a7655b30f4 -r 9b8568d3af2f1749445eef03aede868a6f39f210 foo --- a/foo Thu Jan 01 00:00:00 1970 +0000 +++ b/foo Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -bar +foobar $ cd .. mercurial-4.5.3/tests/test-mv-cp-st-diff.t0000644015407300116100000005214613261161234020265 0ustar augieeng00000000000000 $ add() > { > echo $2 >> $1 > } $ hg init t $ cd t set up a boring main branch $ add a a $ hg add a $ mkdir x $ add x/x x $ hg add x/x $ hg ci -m0 $ add a m1 $ hg ci -m1 $ add a m2 $ add x/y y1 $ hg add x/y $ hg ci -m2 $ cd .. $ show() > { > echo "# $2:" > echo > echo "% hg st -C $1" > hg st -C $1 > echo > echo "% hg diff --git $1" > hg diff --git $1 > echo > } $ count=0 make a new branch and get diff/status output $1 - first commit $2 - second commit $3 - working dir action $ tb() > { > hg clone -q t t2 ; cd t2 > hg co -q -C 0 > > echo % add a $count > add a $count > count=`expr $count + 1` > echo % hg ci -m "t0" > hg ci -m "t0" > echo % $1 > $1 > echo % hg ci -m "t1" > hg ci -m "t1" > echo % $2 > $2 > echo % hg ci -m "t2" > hg ci -m "t2" > echo % $3 > $3 > echo > show "" "working to parent" > show "--rev 0" "working to root" > show "--rev 2" "working to branch" > show "--rev 0 --rev ." "root to parent" > show "--rev . --rev 0" "parent to root" > show "--rev 2 --rev ." "branch to parent" > show "--rev . --rev 2" "parent to branch" > echo > cd .. > rm -rf t2 > } rename in working dir $ tb "add a a1" "add a a2" "hg mv a b" % add a 0 % hg ci -m t0 created new head % add a a1 % hg ci -m t1 % add a a2 % hg ci -m t2 % hg mv a b # working to parent: % hg st -C A b a R a % hg diff --git diff --git a/a b/b rename from a rename to b # working to root: % hg st -C --rev 0 A b a R a % hg diff --git --rev 0 diff --git a/a b/b rename from a rename to b --- a/a +++ b/b @@ -1,1 +1,4 @@ a +0 +a1 +a2 # working to branch: % hg st -C --rev 2 A b a R a R x/y % hg diff --git --rev 2 diff --git a/a b/b rename from a rename to b --- a/a +++ b/b @@ -1,3 +1,4 @@ a -m1 -m2 +0 +a1 +a2 diff --git a/x/y b/x/y deleted file mode 100644 --- a/x/y +++ /dev/null @@ -1,1 +0,0 @@ -y1 # root to parent: % hg st -C --rev 0 --rev . M a % hg diff --git --rev 0 --rev . diff --git a/a b/a --- a/a +++ b/a @@ -1,1 +1,4 @@ a +0 +a1 +a2 # parent to root: % hg st -C --rev . --rev 0 M a % hg diff --git --rev . --rev 0 diff --git a/a b/a --- a/a +++ b/a @@ -1,4 +1,1 @@ a -0 -a1 -a2 # branch to parent: % hg st -C --rev 2 --rev . M a R x/y % hg diff --git --rev 2 --rev . diff --git a/a b/a --- a/a +++ b/a @@ -1,3 +1,4 @@ a -m1 -m2 +0 +a1 +a2 diff --git a/x/y b/x/y deleted file mode 100644 --- a/x/y +++ /dev/null @@ -1,1 +0,0 @@ -y1 # parent to branch: % hg st -C --rev . --rev 2 M a A x/y % hg diff --git --rev . --rev 2 diff --git a/a b/a --- a/a +++ b/a @@ -1,4 +1,3 @@ a -0 -a1 -a2 +m1 +m2 diff --git a/x/y b/x/y new file mode 100644 --- /dev/null +++ b/x/y @@ -0,0 +1,1 @@ +y1 copy in working dir $ tb "add a a1" "add a a2" "hg cp a b" % add a 1 % hg ci -m t0 created new head % add a a1 % hg ci -m t1 % add a a2 % hg ci -m t2 % hg cp a b # working to parent: % hg st -C A b a % hg diff --git diff --git a/a b/b copy from a copy to b # working to root: % hg st -C --rev 0 M a A b a % hg diff --git --rev 0 diff --git a/a b/a --- a/a +++ b/a @@ -1,1 +1,4 @@ a +1 +a1 +a2 diff --git a/a b/b copy from a copy to b --- a/a +++ b/b @@ -1,1 +1,4 @@ a +1 +a1 +a2 # working to branch: % hg st -C --rev 2 M a A b a R x/y % hg diff --git --rev 2 diff --git a/a b/a --- a/a +++ b/a @@ -1,3 +1,4 @@ a -m1 -m2 +1 +a1 +a2 diff --git a/a b/b copy from a copy to b --- a/a +++ b/b @@ -1,3 +1,4 @@ a -m1 -m2 +1 +a1 +a2 diff --git a/x/y b/x/y deleted file mode 100644 --- a/x/y +++ /dev/null @@ -1,1 +0,0 @@ -y1 # root to parent: % hg st -C --rev 0 --rev . M a % hg diff --git --rev 0 --rev . diff --git a/a b/a --- a/a +++ b/a @@ -1,1 +1,4 @@ a +1 +a1 +a2 # parent to root: % hg st -C --rev . --rev 0 M a % hg diff --git --rev . --rev 0 diff --git a/a b/a --- a/a +++ b/a @@ -1,4 +1,1 @@ a -1 -a1 -a2 # branch to parent: % hg st -C --rev 2 --rev . M a R x/y % hg diff --git --rev 2 --rev . diff --git a/a b/a --- a/a +++ b/a @@ -1,3 +1,4 @@ a -m1 -m2 +1 +a1 +a2 diff --git a/x/y b/x/y deleted file mode 100644 --- a/x/y +++ /dev/null @@ -1,1 +0,0 @@ -y1 # parent to branch: % hg st -C --rev . --rev 2 M a A x/y % hg diff --git --rev . --rev 2 diff --git a/a b/a --- a/a +++ b/a @@ -1,4 +1,3 @@ a -1 -a1 -a2 +m1 +m2 diff --git a/x/y b/x/y new file mode 100644 --- /dev/null +++ b/x/y @@ -0,0 +1,1 @@ +y1 single rename $ tb "hg mv a b" "add b b1" "add b w" % add a 2 % hg ci -m t0 created new head % hg mv a b % hg ci -m t1 % add b b1 % hg ci -m t2 % add b w # working to parent: % hg st -C M b % hg diff --git diff --git a/b b/b --- a/b +++ b/b @@ -1,3 +1,4 @@ a 2 b1 +w # working to root: % hg st -C --rev 0 A b a R a % hg diff --git --rev 0 diff --git a/a b/b rename from a rename to b --- a/a +++ b/b @@ -1,1 +1,4 @@ a +2 +b1 +w # working to branch: % hg st -C --rev 2 A b a R a R x/y % hg diff --git --rev 2 diff --git a/a b/b rename from a rename to b --- a/a +++ b/b @@ -1,3 +1,4 @@ a -m1 -m2 +2 +b1 +w diff --git a/x/y b/x/y deleted file mode 100644 --- a/x/y +++ /dev/null @@ -1,1 +0,0 @@ -y1 # root to parent: % hg st -C --rev 0 --rev . A b a R a % hg diff --git --rev 0 --rev . diff --git a/a b/b rename from a rename to b --- a/a +++ b/b @@ -1,1 +1,3 @@ a +2 +b1 # parent to root: % hg st -C --rev . --rev 0 A a b R b % hg diff --git --rev . --rev 0 diff --git a/b b/a rename from b rename to a --- a/b +++ b/a @@ -1,3 +1,1 @@ a -2 -b1 # branch to parent: % hg st -C --rev 2 --rev . A b a R a R x/y % hg diff --git --rev 2 --rev . diff --git a/a b/b rename from a rename to b --- a/a +++ b/b @@ -1,3 +1,3 @@ a -m1 -m2 +2 +b1 diff --git a/x/y b/x/y deleted file mode 100644 --- a/x/y +++ /dev/null @@ -1,1 +0,0 @@ -y1 # parent to branch: % hg st -C --rev . --rev 2 A a b A x/y R b % hg diff --git --rev . --rev 2 diff --git a/b b/a rename from b rename to a --- a/b +++ b/a @@ -1,3 +1,3 @@ a -2 -b1 +m1 +m2 diff --git a/x/y b/x/y new file mode 100644 --- /dev/null +++ b/x/y @@ -0,0 +1,1 @@ +y1 single copy $ tb "hg cp a b" "add b b1" "add a w" % add a 3 % hg ci -m t0 created new head % hg cp a b % hg ci -m t1 % add b b1 % hg ci -m t2 % add a w # working to parent: % hg st -C M a % hg diff --git diff --git a/a b/a --- a/a +++ b/a @@ -1,2 +1,3 @@ a 3 +w # working to root: % hg st -C --rev 0 M a A b a % hg diff --git --rev 0 diff --git a/a b/a --- a/a +++ b/a @@ -1,1 +1,3 @@ a +3 +w diff --git a/a b/b copy from a copy to b --- a/a +++ b/b @@ -1,1 +1,3 @@ a +3 +b1 # working to branch: % hg st -C --rev 2 M a A b a R x/y % hg diff --git --rev 2 diff --git a/a b/a --- a/a +++ b/a @@ -1,3 +1,3 @@ a -m1 -m2 +3 +w diff --git a/a b/b copy from a copy to b --- a/a +++ b/b @@ -1,3 +1,3 @@ a -m1 -m2 +3 +b1 diff --git a/x/y b/x/y deleted file mode 100644 --- a/x/y +++ /dev/null @@ -1,1 +0,0 @@ -y1 # root to parent: % hg st -C --rev 0 --rev . M a A b a % hg diff --git --rev 0 --rev . diff --git a/a b/a --- a/a +++ b/a @@ -1,1 +1,2 @@ a +3 diff --git a/a b/b copy from a copy to b --- a/a +++ b/b @@ -1,1 +1,3 @@ a +3 +b1 # parent to root: % hg st -C --rev . --rev 0 M a R b % hg diff --git --rev . --rev 0 diff --git a/a b/a --- a/a +++ b/a @@ -1,2 +1,1 @@ a -3 diff --git a/b b/b deleted file mode 100644 --- a/b +++ /dev/null @@ -1,3 +0,0 @@ -a -3 -b1 # branch to parent: % hg st -C --rev 2 --rev . M a A b a R x/y % hg diff --git --rev 2 --rev . diff --git a/a b/a --- a/a +++ b/a @@ -1,3 +1,2 @@ a -m1 -m2 +3 diff --git a/a b/b copy from a copy to b --- a/a +++ b/b @@ -1,3 +1,3 @@ a -m1 -m2 +3 +b1 diff --git a/x/y b/x/y deleted file mode 100644 --- a/x/y +++ /dev/null @@ -1,1 +0,0 @@ -y1 # parent to branch: % hg st -C --rev . --rev 2 M a A x/y R b % hg diff --git --rev . --rev 2 diff --git a/a b/a --- a/a +++ b/a @@ -1,2 +1,3 @@ a -3 +m1 +m2 diff --git a/b b/b deleted file mode 100644 --- a/b +++ /dev/null @@ -1,3 +0,0 @@ -a -3 -b1 diff --git a/x/y b/x/y new file mode 100644 --- /dev/null +++ b/x/y @@ -0,0 +1,1 @@ +y1 rename chain $ tb "hg mv a b" "hg mv b c" "hg mv c d" % add a 4 % hg ci -m t0 created new head % hg mv a b % hg ci -m t1 % hg mv b c % hg ci -m t2 % hg mv c d # working to parent: % hg st -C A d c R c % hg diff --git diff --git a/c b/d rename from c rename to d # working to root: % hg st -C --rev 0 A d a R a % hg diff --git --rev 0 diff --git a/a b/d rename from a rename to d --- a/a +++ b/d @@ -1,1 +1,2 @@ a +4 # working to branch: % hg st -C --rev 2 A d a R a R x/y % hg diff --git --rev 2 diff --git a/a b/d rename from a rename to d --- a/a +++ b/d @@ -1,3 +1,2 @@ a -m1 -m2 +4 diff --git a/x/y b/x/y deleted file mode 100644 --- a/x/y +++ /dev/null @@ -1,1 +0,0 @@ -y1 # root to parent: % hg st -C --rev 0 --rev . A c a R a % hg diff --git --rev 0 --rev . diff --git a/a b/c rename from a rename to c --- a/a +++ b/c @@ -1,1 +1,2 @@ a +4 # parent to root: % hg st -C --rev . --rev 0 A a c R c % hg diff --git --rev . --rev 0 diff --git a/c b/a rename from c rename to a --- a/c +++ b/a @@ -1,2 +1,1 @@ a -4 # branch to parent: % hg st -C --rev 2 --rev . A c a R a R x/y % hg diff --git --rev 2 --rev . diff --git a/a b/c rename from a rename to c --- a/a +++ b/c @@ -1,3 +1,2 @@ a -m1 -m2 +4 diff --git a/x/y b/x/y deleted file mode 100644 --- a/x/y +++ /dev/null @@ -1,1 +0,0 @@ -y1 # parent to branch: % hg st -C --rev . --rev 2 A a c A x/y R c % hg diff --git --rev . --rev 2 diff --git a/c b/a rename from c rename to a --- a/c +++ b/a @@ -1,2 +1,3 @@ a -4 +m1 +m2 diff --git a/x/y b/x/y new file mode 100644 --- /dev/null +++ b/x/y @@ -0,0 +1,1 @@ +y1 copy chain $ tb "hg cp a b" "hg cp b c" "hg cp c d" % add a 5 % hg ci -m t0 created new head % hg cp a b % hg ci -m t1 % hg cp b c % hg ci -m t2 % hg cp c d # working to parent: % hg st -C A d c % hg diff --git diff --git a/c b/d copy from c copy to d # working to root: % hg st -C --rev 0 M a A b a A c a A d a % hg diff --git --rev 0 diff --git a/a b/a --- a/a +++ b/a @@ -1,1 +1,2 @@ a +5 diff --git a/a b/b copy from a copy to b --- a/a +++ b/b @@ -1,1 +1,2 @@ a +5 diff --git a/a b/c copy from a copy to c --- a/a +++ b/c @@ -1,1 +1,2 @@ a +5 diff --git a/a b/d copy from a copy to d --- a/a +++ b/d @@ -1,1 +1,2 @@ a +5 # working to branch: % hg st -C --rev 2 M a A b a A c a A d a R x/y % hg diff --git --rev 2 diff --git a/a b/a --- a/a +++ b/a @@ -1,3 +1,2 @@ a -m1 -m2 +5 diff --git a/a b/b copy from a copy to b --- a/a +++ b/b @@ -1,3 +1,2 @@ a -m1 -m2 +5 diff --git a/a b/c copy from a copy to c --- a/a +++ b/c @@ -1,3 +1,2 @@ a -m1 -m2 +5 diff --git a/a b/d copy from a copy to d --- a/a +++ b/d @@ -1,3 +1,2 @@ a -m1 -m2 +5 diff --git a/x/y b/x/y deleted file mode 100644 --- a/x/y +++ /dev/null @@ -1,1 +0,0 @@ -y1 # root to parent: % hg st -C --rev 0 --rev . M a A b a A c a % hg diff --git --rev 0 --rev . diff --git a/a b/a --- a/a +++ b/a @@ -1,1 +1,2 @@ a +5 diff --git a/a b/b copy from a copy to b --- a/a +++ b/b @@ -1,1 +1,2 @@ a +5 diff --git a/a b/c copy from a copy to c --- a/a +++ b/c @@ -1,1 +1,2 @@ a +5 # parent to root: % hg st -C --rev . --rev 0 M a R b R c % hg diff --git --rev . --rev 0 diff --git a/a b/a --- a/a +++ b/a @@ -1,2 +1,1 @@ a -5 diff --git a/b b/b deleted file mode 100644 --- a/b +++ /dev/null @@ -1,2 +0,0 @@ -a -5 diff --git a/c b/c deleted file mode 100644 --- a/c +++ /dev/null @@ -1,2 +0,0 @@ -a -5 # branch to parent: % hg st -C --rev 2 --rev . M a A b a A c a R x/y % hg diff --git --rev 2 --rev . diff --git a/a b/a --- a/a +++ b/a @@ -1,3 +1,2 @@ a -m1 -m2 +5 diff --git a/a b/b copy from a copy to b --- a/a +++ b/b @@ -1,3 +1,2 @@ a -m1 -m2 +5 diff --git a/a b/c copy from a copy to c --- a/a +++ b/c @@ -1,3 +1,2 @@ a -m1 -m2 +5 diff --git a/x/y b/x/y deleted file mode 100644 --- a/x/y +++ /dev/null @@ -1,1 +0,0 @@ -y1 # parent to branch: % hg st -C --rev . --rev 2 M a A x/y R b R c % hg diff --git --rev . --rev 2 diff --git a/a b/a --- a/a +++ b/a @@ -1,2 +1,3 @@ a -5 +m1 +m2 diff --git a/b b/b deleted file mode 100644 --- a/b +++ /dev/null @@ -1,2 +0,0 @@ -a -5 diff --git a/c b/c deleted file mode 100644 --- a/c +++ /dev/null @@ -1,2 +0,0 @@ -a -5 diff --git a/x/y b/x/y new file mode 100644 --- /dev/null +++ b/x/y @@ -0,0 +1,1 @@ +y1 circular rename $ tb "add a a1" "hg mv a b" "hg mv b a" % add a 6 % hg ci -m t0 created new head % add a a1 % hg ci -m t1 % hg mv a b % hg ci -m t2 % hg mv b a # working to parent: % hg st -C A a b R b % hg diff --git diff --git a/b b/a rename from b rename to a # working to root: % hg st -C --rev 0 M a % hg diff --git --rev 0 diff --git a/a b/a --- a/a +++ b/a @@ -1,1 +1,3 @@ a +6 +a1 # working to branch: % hg st -C --rev 2 M a R x/y % hg diff --git --rev 2 diff --git a/a b/a --- a/a +++ b/a @@ -1,3 +1,3 @@ a -m1 -m2 +6 +a1 diff --git a/x/y b/x/y deleted file mode 100644 --- a/x/y +++ /dev/null @@ -1,1 +0,0 @@ -y1 # root to parent: % hg st -C --rev 0 --rev . A b a R a % hg diff --git --rev 0 --rev . diff --git a/a b/b rename from a rename to b --- a/a +++ b/b @@ -1,1 +1,3 @@ a +6 +a1 # parent to root: % hg st -C --rev . --rev 0 A a b R b % hg diff --git --rev . --rev 0 diff --git a/b b/a rename from b rename to a --- a/b +++ b/a @@ -1,3 +1,1 @@ a -6 -a1 # branch to parent: % hg st -C --rev 2 --rev . A b a R a R x/y % hg diff --git --rev 2 --rev . diff --git a/a b/b rename from a rename to b --- a/a +++ b/b @@ -1,3 +1,3 @@ a -m1 -m2 +6 +a1 diff --git a/x/y b/x/y deleted file mode 100644 --- a/x/y +++ /dev/null @@ -1,1 +0,0 @@ -y1 # parent to branch: % hg st -C --rev . --rev 2 A a b A x/y R b % hg diff --git --rev . --rev 2 diff --git a/b b/a rename from b rename to a --- a/b +++ b/a @@ -1,3 +1,3 @@ a -6 -a1 +m1 +m2 diff --git a/x/y b/x/y new file mode 100644 --- /dev/null +++ b/x/y @@ -0,0 +1,1 @@ +y1 directory move $ tb "hg mv x y" "add y/x x1" "add y/x x2" % add a 7 % hg ci -m t0 created new head % hg mv x y moving x/x to y/x % hg ci -m t1 % add y/x x1 % hg ci -m t2 % add y/x x2 # working to parent: % hg st -C M y/x % hg diff --git diff --git a/y/x b/y/x --- a/y/x +++ b/y/x @@ -1,2 +1,3 @@ x x1 +x2 # working to root: % hg st -C --rev 0 M a A y/x x/x R x/x % hg diff --git --rev 0 diff --git a/a b/a --- a/a +++ b/a @@ -1,1 +1,2 @@ a +7 diff --git a/x/x b/y/x rename from x/x rename to y/x --- a/x/x +++ b/y/x @@ -1,1 +1,3 @@ x +x1 +x2 # working to branch: % hg st -C --rev 2 M a A y/x x/x R x/x R x/y % hg diff --git --rev 2 diff --git a/a b/a --- a/a +++ b/a @@ -1,3 +1,2 @@ a -m1 -m2 +7 diff --git a/x/y b/x/y deleted file mode 100644 --- a/x/y +++ /dev/null @@ -1,1 +0,0 @@ -y1 diff --git a/x/x b/y/x rename from x/x rename to y/x --- a/x/x +++ b/y/x @@ -1,1 +1,3 @@ x +x1 +x2 # root to parent: % hg st -C --rev 0 --rev . M a A y/x x/x R x/x % hg diff --git --rev 0 --rev . diff --git a/a b/a --- a/a +++ b/a @@ -1,1 +1,2 @@ a +7 diff --git a/x/x b/y/x rename from x/x rename to y/x --- a/x/x +++ b/y/x @@ -1,1 +1,2 @@ x +x1 # parent to root: % hg st -C --rev . --rev 0 M a A x/x y/x R y/x % hg diff --git --rev . --rev 0 diff --git a/a b/a --- a/a +++ b/a @@ -1,2 +1,1 @@ a -7 diff --git a/y/x b/x/x rename from y/x rename to x/x --- a/y/x +++ b/x/x @@ -1,2 +1,1 @@ x -x1 # branch to parent: % hg st -C --rev 2 --rev . M a A y/x x/x R x/x R x/y % hg diff --git --rev 2 --rev . diff --git a/a b/a --- a/a +++ b/a @@ -1,3 +1,2 @@ a -m1 -m2 +7 diff --git a/x/y b/x/y deleted file mode 100644 --- a/x/y +++ /dev/null @@ -1,1 +0,0 @@ -y1 diff --git a/x/x b/y/x rename from x/x rename to y/x --- a/x/x +++ b/y/x @@ -1,1 +1,2 @@ x +x1 # parent to branch: % hg st -C --rev . --rev 2 M a A x/x y/x A x/y R y/x % hg diff --git --rev . --rev 2 diff --git a/a b/a --- a/a +++ b/a @@ -1,2 +1,3 @@ a -7 +m1 +m2 diff --git a/y/x b/x/x rename from y/x rename to x/x --- a/y/x +++ b/x/x @@ -1,2 +1,1 @@ x -x1 diff --git a/x/y b/x/y new file mode 100644 --- /dev/null +++ b/x/y @@ -0,0 +1,1 @@ +y1 Cannot implement unrelated branch with tb testing copies with unrelated branch $ hg init unrelated $ cd unrelated $ echo a >> a $ hg ci -Am adda adding a $ hg mv a b $ hg ci -m movea $ hg up -C null 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo a >> a $ hg ci -Am addunrelateda adding a created new head unrelated branch diff $ hg diff --git -r 2 -r 1 diff --git a/a b/a deleted file mode 100644 --- a/a +++ /dev/null @@ -1,1 +0,0 @@ -a diff --git a/b b/b new file mode 100644 --- /dev/null +++ b/b @@ -0,0 +1,1 @@ +a $ cd .. test for case where we didn't look sufficiently far back to find rename ancestor $ hg init diffstop $ cd diffstop $ echo > f $ hg ci -qAmf $ hg mv f g $ hg ci -m'f->g' $ hg up -qr0 $ touch x $ hg ci -qAmx $ echo f > f $ hg ci -qmf=f $ hg merge -q $ hg ci -mmerge $ hg log -G --template '{rev} {desc}' @ 4 merge |\ | o 3 f=f | | | o 2 x | | o | 1 f->g |/ o 0 f $ hg diff --git -r 2 diff --git a/f b/g rename from f rename to g --- a/f +++ b/g @@ -1,1 +1,1 @@ - +f $ cd .. Additional tricky linkrev case ------------------------------ If the first file revision after the diff base has a linkrev pointing to a changeset on another branch with a revision lower that the diff base, we can jump past the copy detection limit and fail to detect the rename. $ hg init diffstoplinkrev $ cd diffstoplinkrev $ touch f $ hg ci -Aqm 'empty f' Make a simple change $ echo change > f $ hg ci -m 'change f' Make a second branch, we use a named branch to create a simple commit that does not touch f. $ hg up -qr 'desc(empty)' $ hg branch -q dev $ hg ci -Aqm dev Graft the initial change, as f was untouched, we reuse the same entry and the linkrev point to the older branch. $ hg graft -q 'desc(change)' Make a rename because we want to track renames. It is also important that the faulty linkrev is not the "start" commit to ensure the linkrev will be used. $ hg mv f renamed $ hg ci -m renamed $ hg log -G -T '{rev} {desc}' @ 4 renamed | o 3 change f | o 2 dev | | o 1 change f |/ o 0 empty f The copy tracking should still reach rev 2 (branch creation). accessing the parent of 4 (renamed) should not jump use to revision 1. $ hg diff --git -r 'desc(dev)' -r . diff --git a/f b/renamed rename from f rename to renamed --- a/f +++ b/renamed @@ -0,0 +1,1 @@ +change $ cd .. mercurial-4.5.3/tests/test-manifest-merging.t0000644015407300116100000000136013261161234021135 0ustar augieeng00000000000000 $ hg init base $ cd base $ echo 'alpha' > alpha $ hg ci -A -m 'add alpha' adding alpha $ cd .. $ hg clone base work updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd work $ echo 'beta' > beta $ hg ci -A -m 'add beta' adding beta $ cd .. $ cd base $ echo 'gamma' > gamma $ hg ci -A -m 'add gamma' adding gamma $ cd .. $ cd work $ hg pull -q $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) Update --clean to revision 1 to simulate a failed merge: $ rm alpha beta gamma $ hg update --clean 1 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd .. mercurial-4.5.3/tests/test-update-dest.t0000644015407300116100000000240713261161234020123 0ustar augieeng00000000000000Test update.requiredest $ cd $TESTTMP $ cat >> $HGRCPATH < [commands] > update.requiredest = True > EOF $ hg init repo $ cd repo $ echo a >> a $ hg commit -qAm aa $ hg up abort: you must specify a destination (for example: hg update ".::") [255] $ hg up . 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ HGPLAIN=1 hg up 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg --config commands.update.requiredest=False up 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd .. Check update.requiredest interaction with pull --update $ hg clone repo clone updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd repo $ echo a >> a $ hg commit -qAm aa $ cd ../clone $ hg pull --update abort: update destination required by configuration (use hg pull followed by hg update DEST) [255] $ cd .. update.requiredest should silent the "hg update" text after pull $ hg init repo1 $ cd repo1 $ hg pull ../repo pulling from ../repo requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files new changesets 8f0162e483d0:048c2cb95949 mercurial-4.5.3/tests/test-push-checkheads-unpushed-D1.t0000644015407300116100000000345113261161234023036 0ustar augieeng00000000000000==================================== Testing head checking code: Case D-1 ==================================== Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This case is part of a series of tests checking this behavior. Category D: remote head is "obs-affected" locally, but result is not part of the push TestCase 1: remote head is rewritten, but successors is not part of the push .. old-state: .. .. * 1 changeset branch .. .. new-state: .. .. * 1 changeset branch succeeding the old branch .. * 1 new unrelated branch .. .. expected-result: .. .. * pushing only the unrelated branch: denied .. .. graph-summary: .. .. A ø⇠○ A' .. |/ .. | ◔ B .. |/ .. ◠$ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir D1 $ cd D1 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd client $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit A1 created new head $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` obsoleted 1 changesets $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit B0 created new head $ hg log -G --hidden @ 74ff5441d343 (draft): B0 | | o f6082bc4ffef (draft): A1 |/ | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): root Actual testing -------------- $ hg push -r 'desc(B0)' pushing to $TESTTMP/D1/server searching for changes abort: push creates new remote head 74ff5441d343! (merge or see 'hg help push' for details about pushing new heads) [255] $ cd ../.. mercurial-4.5.3/tests/test-http-branchmap.t0000644015407300116100000000570613261161234020621 0ustar augieeng00000000000000#require killdaemons $ hgserve() { > hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid \ > -E errors.log -v $@ > startup.log > # Grepping hg serve stdout would hang on Windows > grep -v 'listening at' startup.log > cat hg.pid >> "$DAEMON_PIDS" > } $ hg init a $ hg --encoding utf-8 -R a branch æ marked working directory as branch \xc3\xa6 (esc) (branches are permanent and global, did you want a bookmark?) $ echo foo > a/foo $ hg -R a ci -Am foo adding foo $ hgserve -R a --config web.push_ssl=False --config web.allow_push=* --encoding latin1 $ hg --encoding utf-8 clone http://localhost:$HGPORT1 b requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 867c11ce77b8 updating to branch \xc3\xa6 (esc) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg --encoding utf-8 -R b log changeset: 0:867c11ce77b8 branch: \xc3\xa6 (esc) tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: foo $ echo bar >> b/foo $ hg -R b ci -m bar $ hg --encoding utf-8 -R b push pushing to http://localhost:$HGPORT1/ searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files $ hg -R a --encoding utf-8 log changeset: 1:58e7c90d67cb branch: \xc3\xa6 (esc) tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: bar changeset: 0:867c11ce77b8 branch: \xc3\xa6 (esc) user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: foo $ killdaemons.py hg.pid verify 7e7d56fe4833 (encoding fallback in branchmap to maintain compatibility with 1.3.x) $ cat < oldhg > import sys > from mercurial import ui, hg, commands > > class StdoutWrapper(object): > def __init__(self, stdout): > self._file = stdout > > def write(self, data): > if data == '47\n': > # latin1 encoding is one %xx (3 bytes) shorter > data = '44\n' > elif data.startswith('%C3%A6 '): > # translate to latin1 encoding > data = '%%E6 %s' % data[7:] > self._file.write(data) > > def __getattr__(self, name): > return getattr(self._file, name) > > sys.stdout = StdoutWrapper(sys.stdout) > sys.stderr = StdoutWrapper(sys.stderr) > > myui = ui.ui.load() > repo = hg.repository(myui, 'a') > commands.serve(myui, repo, stdio=True, cmdserver=False) > EOF $ echo baz >> b/foo $ hg -R b ci -m baz $ hg push -R b -e "\"$PYTHON\" oldhg" ssh://dummy/ --encoding latin1 pushing to ssh://dummy/ searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files mercurial-4.5.3/tests/test-walkrepo.py0000644015407300116100000000366313261161234017722 0ustar augieeng00000000000000from __future__ import absolute_import, print_function import os from mercurial import ( hg, scmutil, ui as uimod, util, ) chdir = os.chdir mkdir = os.mkdir pjoin = os.path.join walkrepos = scmutil.walkrepos checklink = util.checklink u = uimod.ui.load() sym = checklink('.') hg.repository(u, 'top1', create=1) mkdir('subdir') chdir('subdir') hg.repository(u, 'sub1', create=1) mkdir('subsubdir') chdir('subsubdir') hg.repository(u, 'subsub1', create=1) chdir(os.path.pardir) if sym: os.symlink(os.path.pardir, 'circle') os.symlink(pjoin('subsubdir', 'subsub1'), 'subsub1') def runtest(): reposet = frozenset(walkrepos('.', followsym=True)) if sym and (len(reposet) != 3): print("reposet = %r" % (reposet,)) print(("Found %d repositories when I should have found 3" % (len(reposet),))) if (not sym) and (len(reposet) != 2): print("reposet = %r" % (reposet,)) print(("Found %d repositories when I should have found 2" % (len(reposet),))) sub1set = frozenset((pjoin('.', 'sub1'), pjoin('.', 'circle', 'subdir', 'sub1'))) if len(sub1set & reposet) != 1: print("sub1set = %r" % (sub1set,)) print("reposet = %r" % (reposet,)) print("sub1set and reposet should have exactly one path in common.") sub2set = frozenset((pjoin('.', 'subsub1'), pjoin('.', 'subsubdir', 'subsub1'))) if len(sub2set & reposet) != 1: print("sub2set = %r" % (sub2set,)) print("reposet = %r" % (reposet,)) print("sub2set and reposet should have exactly one path in common.") sub3 = pjoin('.', 'circle', 'top1') if sym and sub3 not in reposet: print("reposet = %r" % (reposet,)) print("Symbolic links are supported and %s is not in reposet" % (sub3,)) runtest() if sym: # Simulate not having symlinks. del os.path.samestat sym = False runtest() mercurial-4.5.3/tests/test-hgweb-auth.py.out0000644015407300116100000001130013261161234020722 0ustar augieeng00000000000000 *** Test in-uri schemes CFG: {x.prefix: http://example.org} URI: http://example.org/foo ('x', 'x') URI: http://example.org/foo/bar ('x', 'x') URI: http://example.org/bar ('x', 'x') URI: https://example.org/foo abort URI: https://example.org/foo/bar abort URI: https://example.org/bar abort URI: https://x@example.org/bar abort URI: https://y@example.org/bar abort CFG: {x.prefix: https://example.org} URI: http://example.org/foo abort URI: http://example.org/foo/bar abort URI: http://example.org/bar abort URI: https://example.org/foo ('x', 'x') URI: https://example.org/foo/bar ('x', 'x') URI: https://example.org/bar ('x', 'x') URI: https://x@example.org/bar ('x', 'x') URI: https://y@example.org/bar abort CFG: {x.prefix: http://example.org, x.schemes: https} URI: http://example.org/foo ('x', 'x') URI: http://example.org/foo/bar ('x', 'x') URI: http://example.org/bar ('x', 'x') URI: https://example.org/foo abort URI: https://example.org/foo/bar abort URI: https://example.org/bar abort URI: https://x@example.org/bar abort URI: https://y@example.org/bar abort CFG: {x.prefix: https://example.org, x.schemes: http} URI: http://example.org/foo abort URI: http://example.org/foo/bar abort URI: http://example.org/bar abort URI: https://example.org/foo ('x', 'x') URI: https://example.org/foo/bar ('x', 'x') URI: https://example.org/bar ('x', 'x') URI: https://x@example.org/bar ('x', 'x') URI: https://y@example.org/bar abort *** Test separately configured schemes CFG: {x.prefix: example.org, x.schemes: http} URI: http://example.org/foo ('x', 'x') URI: http://example.org/foo/bar ('x', 'x') URI: http://example.org/bar ('x', 'x') URI: https://example.org/foo abort URI: https://example.org/foo/bar abort URI: https://example.org/bar abort URI: https://x@example.org/bar abort URI: https://y@example.org/bar abort CFG: {x.prefix: example.org, x.schemes: https} URI: http://example.org/foo abort URI: http://example.org/foo/bar abort URI: http://example.org/bar abort URI: https://example.org/foo ('x', 'x') URI: https://example.org/foo/bar ('x', 'x') URI: https://example.org/bar ('x', 'x') URI: https://x@example.org/bar ('x', 'x') URI: https://y@example.org/bar abort CFG: {x.prefix: example.org, x.schemes: http https} URI: http://example.org/foo ('x', 'x') URI: http://example.org/foo/bar ('x', 'x') URI: http://example.org/bar ('x', 'x') URI: https://example.org/foo ('x', 'x') URI: https://example.org/foo/bar ('x', 'x') URI: https://example.org/bar ('x', 'x') URI: https://x@example.org/bar ('x', 'x') URI: https://y@example.org/bar abort *** Test prefix matching CFG: {x.prefix: http://example.org/foo, y.prefix: http://example.org/bar} URI: http://example.org/foo ('x', 'x') URI: http://example.org/foo/bar ('x', 'x') URI: http://example.org/bar ('y', 'y') URI: https://example.org/foo abort URI: https://example.org/foo/bar abort URI: https://example.org/bar abort URI: https://x@example.org/bar abort URI: https://y@example.org/bar abort CFG: {x.prefix: http://example.org/foo, y.prefix: http://example.org/foo/bar} URI: http://example.org/foo ('x', 'x') URI: http://example.org/foo/bar ('y', 'y') URI: http://example.org/bar abort URI: https://example.org/foo abort URI: https://example.org/foo/bar abort URI: https://example.org/bar abort URI: https://x@example.org/bar abort URI: https://y@example.org/bar abort CFG: {x.prefix: *, y.prefix: https://example.org/bar} URI: http://example.org/foo abort URI: http://example.org/foo/bar abort URI: http://example.org/bar abort URI: https://example.org/foo ('x', 'x') URI: https://example.org/foo/bar ('x', 'x') URI: https://example.org/bar ('y', 'y') URI: https://x@example.org/bar ('x', 'x') URI: https://y@example.org/bar ('y', 'y') *** Test user matching CFG: {x.password: xpassword, x.prefix: http://example.org/foo, x.username: None} URI: http://y@example.org/foo ('y', 'xpassword') CFG: {x.password: xpassword, x.prefix: http://example.org/foo, x.username: None, y.password: ypassword, y.prefix: http://example.org/foo, y.username: y} URI: http://y@example.org/foo ('y', 'ypassword') CFG: {x.password: xpassword, x.prefix: http://example.org/foo/bar, x.username: None, y.password: ypassword, y.prefix: http://example.org/foo, y.username: y} URI: http://y@example.org/foo/bar ('y', 'xpassword') *** Test urllib2 and util.url URIs: http://user@example.com:8080/foo http://example.com:8080/foo ('user', '') mercurial-4.5.3/tests/test-releasenotes-merging.t0000644015407300116100000001220713261161234022022 0ustar augieeng00000000000000#require fuzzywuzzy $ cat >> $HGRCPATH << EOF > [extensions] > releasenotes= > EOF $ hg init simple-repo $ cd simple-repo A fix directive from commit message is added to release notes $ touch fix1 $ hg -q commit -A -l - << EOF > commit 1 > > .. fix:: > > Fix from commit message. > EOF $ cat >> $TESTTMP/single-fix-bullet << EOF > Bug Fixes > ========= > > * Fix from release notes. > EOF $ hg releasenotes -r . $TESTTMP/single-fix-bullet $ cat $TESTTMP/single-fix-bullet Bug Fixes ========= * Fix from release notes. * Fix from commit message. Processing again ignores the already added bullet. $ hg releasenotes -r . $TESTTMP/single-fix-bullet $ cat $TESTTMP/single-fix-bullet Bug Fixes ========= * Fix from release notes. * Fix from commit message. $ cd .. Sections are unioned $ hg init subsections $ cd subsections $ touch fix1 $ hg -q commit -A -l - << EOF > Commit 1 > > .. feature:: Commit Message Feature > > This describes a feature from a commit message. > EOF $ cat >> $TESTTMP/single-feature-section << EOF > New Features > ============ > > Notes Feature > ------------- > > This describes a feature from a release notes file. > EOF $ hg releasenotes -r . $TESTTMP/single-feature-section $ cat $TESTTMP/single-feature-section New Features ============ Notes Feature ------------- This describes a feature from a release notes file. Commit Message Feature ---------------------- This describes a feature from a commit message. Doing it again won't add another section $ hg releasenotes -r . $TESTTMP/single-feature-section Commit Message Feature already exists in feature section; ignoring $ cat $TESTTMP/single-feature-section New Features ============ Notes Feature ------------- This describes a feature from a release notes file. Commit Message Feature ---------------------- This describes a feature from a commit message. $ cd .. Bullets from rev merge with those from notes file. $ hg init bullets $ cd bullets $ touch fix1 $ hg -q commit -A -l - << EOF > commit 1 > > .. fix:: > > this is fix1. > EOF $ touch fix2 $ hg -q commit -A -l - << EOF > commit 2 > > .. fix:: > > this is fix2. > EOF $ hg releasenotes -r 'all()' $TESTTMP/relnotes-bullet-problem $ cat $TESTTMP/relnotes-bullet-problem Bug Fixes ========= * this is fix1. * this is fix2. $ touch fix3 $ hg -q commit -A -l - << EOF > commit 3 > > .. fix:: > > this is fix3. > EOF $ hg releasenotes -r . $TESTTMP/relnotes-bullet-problem $ cat $TESTTMP/relnotes-bullet-problem Bug Fixes ========= * this is fix1. * this is fix2. * this is fix3. $ cd .. Ignores commit messages containing issueNNNN based on issue number. $ hg init simple-fuzzrepo $ cd simple-fuzzrepo $ touch fix1 $ hg -q commit -A -l - << EOF > commit 1 > > .. fix:: > > Resolved issue4567. > EOF $ cat >> $TESTTMP/issue-number-notes << EOF > Bug Fixes > ========= > > * Fixed issue1234 related to XYZ. > > * Fixed issue4567 related to ABC. > > * Fixed issue3986 related to PQR. > EOF $ hg releasenotes -r . $TESTTMP/issue-number-notes "issue4567" already exists in notes; ignoring $ cat $TESTTMP/issue-number-notes Bug Fixes ========= * Fixed issue1234 related to XYZ. * Fixed issue4567 related to ABC. * Fixed issue3986 related to PQR. $ cd .. Adds short commit messages (words < 10) without comparison unless there is an exact match. $ hg init tempdir $ cd tempdir $ touch feature1 $ hg -q commit -A -l - << EOF > commit 1 > > .. feature:: > > Adds a new feature 1. > EOF $ hg releasenotes -r . $TESTTMP/short-sentence-notes $ touch feature2 $ hg -q commit -A -l - << EOF > commit 2 > > .. feature:: > > Adds a new feature 2. > EOF $ hg releasenotes -r . $TESTTMP/short-sentence-notes $ cat $TESTTMP/short-sentence-notes New Features ============ * Adds a new feature 1. * Adds a new feature 2. $ cd .. Ignores commit messages based on fuzzy comparison. $ hg init fuzznotes $ cd fuzznotes $ touch fix1 $ hg -q commit -A -l - << EOF > commit 1 > > .. fix:: > > This is a fix with another line. > And it is a big one. > EOF $ cat >> $TESTTMP/fuzz-ignore-notes << EOF > Bug Fixes > ========= > > * Fixed issue4567 by improving X. > > * This is the first line. This is next line with one newline. > > This is another line written after two newlines. This is going to be a big one. > > * This fixes another problem. > EOF $ hg releasenotes -r . $TESTTMP/fuzz-ignore-notes "This is a fix with another line. And it is a big one." already exists in notes file; ignoring $ cat $TESTTMP/fuzz-ignore-notes Bug Fixes ========= * Fixed issue4567 by improving X. * This is the first line. This is next line with one newline. This is another line written after two newlines. This is going to be a big one. * This fixes another problem. mercurial-4.5.3/tests/test-histedit-non-commute-abort.t0000644015407300116100000001100613261161234023060 0ustar augieeng00000000000000 $ . "$TESTDIR/histedit-helpers.sh" $ cat >> $HGRCPATH < [extensions] > histedit= > EOF $ initrepo () > { > hg init r > cd r > for x in a b c d e f ; do > echo $x > $x > hg add $x > hg ci -m $x > done > echo a >> e > hg ci -m 'does not commute with e' > cd .. > } $ initrepo $ cd r log before edit $ hg log --graph @ changeset: 6:bfa474341cc9 | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: does not commute with e | o changeset: 5:652413bf663e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: f | o changeset: 4:e860deea161a | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: e | o changeset: 3:055a42cdd887 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: d | o changeset: 2:177f92b77385 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: c | o changeset: 1:d2ae7f538514 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: b | o changeset: 0:cb9a9f314b8b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a edit the history $ hg histedit 177f92b77385 --commands - 2>&1 < pick 177f92b77385 c > pick 055a42cdd887 d > pick bfa474341cc9 does not commute with e > pick e860deea161a e > pick 652413bf663e f > EOF merging e warning: conflicts while merging e! (edit, then use 'hg resolve --mark') Fix up the change (pick e860deea161a) (hg histedit --continue to resume) insert unsupported advisory merge record $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -x $ hg debugmergestate * version 2 records local: 8f7551c7e4a2f2efe0bc8c741baf7f227d65d758 other: e860deea161a2f77de56603b340ebbb4536308ae labels: local: local other: histedit unrecognized entry: x advisory record file extras: e (ancestorlinknode = 0000000000000000000000000000000000000000) file: e (record type "F", state "u", hash 58e6b3a414a1e090dfc6029add0f3555ccba127f) local path: e (flags "") ancestor path: e (node null) other path: e (node 6b67ccefd5ce6de77e7ead4f5292843a0255329f) $ hg resolve -l U e insert unsupported mandatory merge record $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -X $ hg debugmergestate * version 2 records local: 8f7551c7e4a2f2efe0bc8c741baf7f227d65d758 other: e860deea161a2f77de56603b340ebbb4536308ae labels: local: local other: histedit file extras: e (ancestorlinknode = 0000000000000000000000000000000000000000) file: e (record type "F", state "u", hash 58e6b3a414a1e090dfc6029add0f3555ccba127f) local path: e (flags "") ancestor path: e (node null) other path: e (node 6b67ccefd5ce6de77e7ead4f5292843a0255329f) unrecognized entry: X mandatory record $ hg resolve -l abort: unsupported merge state records: X (see https://mercurial-scm.org/wiki/MergeStateRecords for more information) [255] $ hg resolve -ma abort: unsupported merge state records: X (see https://mercurial-scm.org/wiki/MergeStateRecords for more information) [255] abort the edit (should clear out merge state) $ hg histedit --abort 2>&1 | fixbundle 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg debugmergestate no merge state found log after abort $ hg resolve -l $ hg log --graph @ changeset: 6:bfa474341cc9 | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: does not commute with e | o changeset: 5:652413bf663e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: f | o changeset: 4:e860deea161a | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: e | o changeset: 3:055a42cdd887 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: d | o changeset: 2:177f92b77385 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: c | o changeset: 1:d2ae7f538514 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: b | o changeset: 0:cb9a9f314b8b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a $ cd .. mercurial-4.5.3/tests/fakemergerecord.py0000644015407300116100000000134513261161234020241 0ustar augieeng00000000000000# Extension to write out fake unsupported records into the merge state # # from __future__ import absolute_import from mercurial import ( merge, registrar, ) cmdtable = {} command = registrar.command(cmdtable) @command('fakemergerecord', [('X', 'mandatory', None, 'add a fake mandatory record'), ('x', 'advisory', None, 'add a fake advisory record')], '') def fakemergerecord(ui, repo, *pats, **opts): with repo.wlock(): ms = merge.mergestate.read(repo) records = ms._makerecords() if opts.get('mandatory'): records.append(('X', 'mandatory record')) if opts.get('advisory'): records.append(('x', 'advisory record')) ms._writerecords(records) mercurial-4.5.3/tests/test-addremove-similar.t0000644015407300116100000000743513261161234021316 0ustar augieeng00000000000000 $ hg init rep; cd rep $ touch empty-file $ $PYTHON -c 'for x in range(10000): print(x)' > large-file $ hg addremove adding empty-file adding large-file $ hg commit -m A $ rm large-file empty-file $ $PYTHON -c 'for x in range(10,10000): print(x)' > another-file $ hg addremove -s50 adding another-file removing empty-file removing large-file recording removal of large-file as rename to another-file (99% similar) $ hg commit -m B comparing two empty files caused ZeroDivisionError in the past $ hg update -C 0 2 files updated, 0 files merged, 1 files removed, 0 files unresolved $ rm empty-file $ touch another-empty-file $ hg addremove -s50 adding another-empty-file removing empty-file $ cd .. $ hg init rep2; cd rep2 $ $PYTHON -c 'for x in range(10000): print(x)' > large-file $ $PYTHON -c 'for x in range(50): print(x)' > tiny-file $ hg addremove adding large-file adding tiny-file $ hg commit -m A $ $PYTHON -c 'for x in range(70): print(x)' > small-file $ rm tiny-file $ rm large-file $ hg addremove -s50 removing large-file adding small-file removing tiny-file recording removal of tiny-file as rename to small-file (82% similar) $ hg commit -m B should be sorted by path for stable result $ for i in `$PYTHON $TESTDIR/seq.py 0 9`; do > cp small-file $i > done $ rm small-file $ hg addremove adding 0 adding 1 adding 2 adding 3 adding 4 adding 5 adding 6 adding 7 adding 8 adding 9 removing small-file recording removal of small-file as rename to 0 (100% similar) recording removal of small-file as rename to 1 (100% similar) recording removal of small-file as rename to 2 (100% similar) recording removal of small-file as rename to 3 (100% similar) recording removal of small-file as rename to 4 (100% similar) recording removal of small-file as rename to 5 (100% similar) recording removal of small-file as rename to 6 (100% similar) recording removal of small-file as rename to 7 (100% similar) recording removal of small-file as rename to 8 (100% similar) recording removal of small-file as rename to 9 (100% similar) $ hg commit -m '10 same files' pick one from many identical files $ cp 0 a $ rm `$PYTHON $TESTDIR/seq.py 0 9` $ hg addremove removing 0 removing 1 removing 2 removing 3 removing 4 removing 5 removing 6 removing 7 removing 8 removing 9 adding a recording removal of 0 as rename to a (100% similar) $ hg revert -aq pick one from many similar files $ cp 0 a $ for i in `$PYTHON $TESTDIR/seq.py 0 9`; do > echo $i >> $i > done $ hg commit -m 'make them slightly different' $ rm `$PYTHON $TESTDIR/seq.py 0 9` $ hg addremove -s50 removing 0 removing 1 removing 2 removing 3 removing 4 removing 5 removing 6 removing 7 removing 8 removing 9 adding a recording removal of 0 as rename to a (99% similar) $ hg commit -m 'always the same file should be selected' should all fail $ hg addremove -s foo abort: similarity must be a number [255] $ hg addremove -s -1 abort: similarity must be between 0 and 100 [255] $ hg addremove -s 1e6 abort: similarity must be between 0 and 100 [255] $ cd .. Issue1527: repeated addremove causes Abort $ hg init rep3; cd rep3 $ mkdir d $ echo a > d/a $ hg add d/a $ hg commit -m 1 $ mv d/a d/b $ hg addremove -s80 removing d/a adding d/b recording removal of d/a as rename to d/b (100% similar) $ hg debugstate r 0 0 1970-01-01 00:00:00 d/a a 0 -1 unset d/b copy: d/a -> d/b $ mv d/b c no copies found here (since the target isn't in d $ hg addremove -s80 d removing d/b copies here $ hg addremove -s80 adding c recording removal of d/a as rename to c (100% similar) $ cd .. mercurial-4.5.3/tests/bzr-definitions0000644015407300116100000000050713261161234017572 0ustar augieeng00000000000000# this file holds the definitions that are used in various bzr tests TERM=dumb; export TERM echo '[extensions]' >> $HGRCPATH echo 'convert = ' >> $HGRCPATH glog() { hg log -G --template '{rev}@{branch} "{desc|firstline}" files: {files}\n' "$@" } manifest() { echo "% manifest of $2" hg -R $1 manifest -v -r $2 } mercurial-4.5.3/tests/test-propertycache.py0000644015407300116100000001455113261161234020744 0ustar augieeng00000000000000"""test behavior of propertycache and unfiltered propertycache The repoview overlay is quite complex. We test the behavior of property cache of both localrepo and repoview to prevent regression.""" from __future__ import absolute_import, print_function import os import subprocess from mercurial import ( hg, localrepo, ui as uimod, util, ) # create some special property cache that trace they call calllog = [] @util.propertycache def testcachedfoobar(repo): name = repo.filtername if name is None: name = '' val = len(name) calllog.append(val) return val unficalllog = [] @localrepo.unfilteredpropertycache def testcachedunfifoobar(repo): name = repo.filtername if name is None: name = '' val = 100 + len(name) unficalllog.append(val) return val #plug them on repo localrepo.localrepository.testcachedfoobar = testcachedfoobar localrepo.localrepository.testcachedunfifoobar = testcachedunfifoobar # Create an empty repo and instantiate it. It is important to run # these tests on the real object to detect regression. repopath = os.path.join(os.environ['TESTTMP'], 'repo') assert subprocess.call(['hg', 'init', repopath]) == 0 ui = uimod.ui.load() repo = hg.repository(ui, path=repopath).unfiltered() print('') print('=== property cache ===') print('') print('calllog:', calllog) print('cached value (unfiltered):', vars(repo).get('testcachedfoobar', 'NOCACHE')) print('') print('= first access on unfiltered, should do a call') print('access:', repo.testcachedfoobar) print('calllog:', calllog) print('cached value (unfiltered):', vars(repo).get('testcachedfoobar', 'NOCACHE')) print('') print('= second access on unfiltered, should not do call') print('access', repo.testcachedfoobar) print('calllog:', calllog) print('cached value (unfiltered):', vars(repo).get('testcachedfoobar', 'NOCACHE')) print('') print('= first access on "visible" view, should do a call') visibleview = repo.filtered('visible') print('cached value ("visible" view):', vars(visibleview).get('testcachedfoobar', 'NOCACHE')) print('access:', visibleview.testcachedfoobar) print('calllog:', calllog) print('cached value (unfiltered):', vars(repo).get('testcachedfoobar', 'NOCACHE')) print('cached value ("visible" view):', vars(visibleview).get('testcachedfoobar', 'NOCACHE')) print('') print('= second access on "visible view", should not do call') print('access:', visibleview.testcachedfoobar) print('calllog:', calllog) print('cached value (unfiltered):', vars(repo).get('testcachedfoobar', 'NOCACHE')) print('cached value ("visible" view):', vars(visibleview).get('testcachedfoobar', 'NOCACHE')) print('') print('= no effect on other view') immutableview = repo.filtered('immutable') print('cached value ("immutable" view):', vars(immutableview).get('testcachedfoobar', 'NOCACHE')) print('access:', immutableview.testcachedfoobar) print('calllog:', calllog) print('cached value (unfiltered):', vars(repo).get('testcachedfoobar', 'NOCACHE')) print('cached value ("visible" view):', vars(visibleview).get('testcachedfoobar', 'NOCACHE')) print('cached value ("immutable" view):', vars(immutableview).get('testcachedfoobar', 'NOCACHE')) # unfiltered property cache test print('') print('') print('=== unfiltered property cache ===') print('') print('unficalllog:', unficalllog) print('cached value (unfiltered): ', vars(repo).get('testcachedunfifoobar', 'NOCACHE')) print('cached value ("visible" view): ', vars(visibleview).get('testcachedunfifoobar', 'NOCACHE')) print('cached value ("immutable" view):', vars(immutableview).get('testcachedunfifoobar', 'NOCACHE')) print('') print('= first access on unfiltered, should do a call') print('access (unfiltered):', repo.testcachedunfifoobar) print('unficalllog:', unficalllog) print('cached value (unfiltered): ', vars(repo).get('testcachedunfifoobar', 'NOCACHE')) print('') print('= second access on unfiltered, should not do call') print('access (unfiltered):', repo.testcachedunfifoobar) print('unficalllog:', unficalllog) print('cached value (unfiltered): ', vars(repo).get('testcachedunfifoobar', 'NOCACHE')) print('') print('= access on view should use the unfiltered cache') print('access (unfiltered): ', repo.testcachedunfifoobar) print('access ("visible" view): ', visibleview.testcachedunfifoobar) print('access ("immutable" view):', immutableview.testcachedunfifoobar) print('unficalllog:', unficalllog) print('cached value (unfiltered): ', vars(repo).get('testcachedunfifoobar', 'NOCACHE')) print('cached value ("visible" view): ', vars(visibleview).get('testcachedunfifoobar', 'NOCACHE')) print('cached value ("immutable" view):', vars(immutableview).get('testcachedunfifoobar', 'NOCACHE')) print('') print('= even if we clear the unfiltered cache') del repo.__dict__['testcachedunfifoobar'] print('cached value (unfiltered): ', vars(repo).get('testcachedunfifoobar', 'NOCACHE')) print('cached value ("visible" view): ', vars(visibleview).get('testcachedunfifoobar', 'NOCACHE')) print('cached value ("immutable" view):', vars(immutableview).get('testcachedunfifoobar', 'NOCACHE')) print('unficalllog:', unficalllog) print('access ("visible" view): ', visibleview.testcachedunfifoobar) print('unficalllog:', unficalllog) print('cached value (unfiltered): ', vars(repo).get('testcachedunfifoobar', 'NOCACHE')) print('cached value ("visible" view): ', vars(visibleview).get('testcachedunfifoobar', 'NOCACHE')) print('cached value ("immutable" view):', vars(immutableview).get('testcachedunfifoobar', 'NOCACHE')) print('access ("immutable" view):', immutableview.testcachedunfifoobar) print('unficalllog:', unficalllog) print('cached value (unfiltered): ', vars(repo).get('testcachedunfifoobar', 'NOCACHE')) print('cached value ("visible" view): ', vars(visibleview).get('testcachedunfifoobar', 'NOCACHE')) print('cached value ("immutable" view):', vars(immutableview).get('testcachedunfifoobar', 'NOCACHE')) print('access (unfiltered): ', repo.testcachedunfifoobar) print('unficalllog:', unficalllog) print('cached value (unfiltered): ', vars(repo).get('testcachedunfifoobar', 'NOCACHE')) print('cached value ("visible" view): ', vars(visibleview).get('testcachedunfifoobar', 'NOCACHE')) print('cached value ("immutable" view):', vars(immutableview).get('testcachedunfifoobar', 'NOCACHE')) mercurial-4.5.3/tests/test-single-head.t0000644015407300116100000001271613261161234020070 0ustar augieeng00000000000000===================== Test workflow options ===================== $ . "$TESTDIR/testlib/obsmarker-common.sh" Test single head enforcing - Setup ============================================= $ cat << EOF >> $HGRCPATH > [experimental] > evolution = all > EOF $ hg init single-head-server $ cd single-head-server $ cat <> .hg/hgrc > [phases] > publish = no > [experimental] > single-head-per-branch = yes > EOF $ mkcommit ROOT $ mkcommit c_dA0 $ cd .. $ hg clone single-head-server client updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved Test single head enforcing - with branch only --------------------------------------------- $ cd client continuing the current defaultbranch $ mkcommit c_dB0 $ hg push pushing to $TESTTMP/single-head-server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files creating a new branch $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg branch branch_A marked working directory as branch branch_A (branches are permanent and global, did you want a bookmark?) $ mkcommit c_aC0 $ hg push --new-branch pushing to $TESTTMP/single-head-server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) Create a new head on the default branch $ hg up 'desc("c_dA0")' 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit c_dD0 created new head $ hg push -f pushing to $TESTTMP/single-head-server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) transaction abort! rollback completed abort: rejecting multiple heads on branch "default" (2 heads: 286d02a6e2a2 9bf953aa81f6) [255] remerge them $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ mkcommit c_dE0 $ hg push pushing to $TESTTMP/single-head-server searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files Test single head enforcing - after rewrite ------------------------------------------ $ mkcommit c_dF0 $ hg push pushing to $TESTTMP/single-head-server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files $ hg commit --amend -m c_dF1 $ hg push pushing to $TESTTMP/single-head-server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 0 changes to 1 files (+1 heads) 1 new obsolescence markers obsoleted 1 changesets Check it does to interfer with strip ------------------------------------ setup $ hg branch branch_A --force marked working directory as branch branch_A $ mkcommit c_aG0 created new head $ hg update 'desc("c_dF1")' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit c_dH0 $ hg update 'desc("c_aG0")' 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ mkcommit c_aI0 $ hg log -G @ changeset: 10:49003e504178 |\ branch: branch_A | | tag: tip | | parent: 8:a33fb808fb4b | | parent: 3:840af1c6bc88 | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | summary: c_aI0 | | | | o changeset: 9:fe47ea669cea | | | parent: 7:99a2dc242c5d | | | user: test | | | date: Thu Jan 01 00:00:00 1970 +0000 | | | summary: c_dH0 | | | | o | changeset: 8:a33fb808fb4b | |/ branch: branch_A | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | summary: c_aG0 | | | o changeset: 7:99a2dc242c5d | | parent: 5:6ed1df20edb1 | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | summary: c_dF1 | | | o changeset: 5:6ed1df20edb1 | |\ parent: 4:9bf953aa81f6 | | | parent: 2:286d02a6e2a2 | | | user: test | | | date: Thu Jan 01 00:00:00 1970 +0000 | | | summary: c_dE0 | | | | | o changeset: 4:9bf953aa81f6 | | | parent: 1:134bc3852ad2 | | | user: test | | | date: Thu Jan 01 00:00:00 1970 +0000 | | | summary: c_dD0 | | | o | | changeset: 3:840af1c6bc88 | | | branch: branch_A | | | parent: 0:ea207398892e | | | user: test | | | date: Thu Jan 01 00:00:00 1970 +0000 | | | summary: c_aC0 | | | | o | changeset: 2:286d02a6e2a2 | |/ user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | summary: c_dB0 | | | o changeset: 1:134bc3852ad2 |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: c_dA0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT actual stripping $ hg strip --config extensions.strip= --rev 'desc("c_dH0")' saved backup bundle to $TESTTMP/client/.hg/strip-backup/fe47ea669cea-a41bf5a9-backup.hg warning: ignoring unknown working parent 49003e504178! mercurial-4.5.3/tests/test-gendoc-ro.t0000644015407300116100000000072713261161234017564 0ustar augieeng00000000000000#require docutils gettext Error: the current ro localization has some rst defects exposed by moving pager to core. These two warnings about references are expected until the localization is corrected. $ $TESTDIR/check-gendoc ro checking for parse errors gendoc.txt:58: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string. gendoc.txt:58: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string. mercurial-4.5.3/tests/test-extdiff.t0000644015407300116100000003017113261161234017334 0ustar augieeng00000000000000 $ echo "[extensions]" >> $HGRCPATH $ echo "extdiff=" >> $HGRCPATH $ hg init a $ cd a $ echo a > a $ echo b > b $ hg add adding a adding b Should diff cloned directories: $ hg extdiff -o -r $opt Only in a: a Only in a: b [1] $ cat <> $HGRCPATH > [extdiff] > cmd.falabala = echo > opts.falabala = diffing > cmd.edspace = echo > opts.edspace = "name " > EOF $ hg falabala diffing a.000000000000 a [1] $ hg help falabala hg falabala [OPTION]... [FILE]... use external program to diff repository (or selected files) Show differences between revisions for the specified files, using the following program: 'echo' 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. options ([+] can be repeated): -o --option OPT [+] pass option to comparison program -r --rev REV [+] revision -c --change REV change made by revision --patch compare patches for two revisions -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -S --subrepos recurse into subrepositories (some details hidden, use --verbose to show complete help) $ hg ci -d '0 0' -mtest1 $ echo b >> a $ hg ci -d '1 0' -mtest2 Should diff cloned files directly: $ hg falabala -r 0:1 diffing "*\\extdiff.*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) [1] Specifying an empty revision should abort. $ hg extdiff -p diff --patch --rev 'ancestor()' --rev 1 abort: empty revision on one side of range [255] Test diff during merge: $ hg update -C 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo c >> c $ hg add c $ hg ci -m "new branch" -d '1 0' created new head $ hg merge 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) Should diff cloned file against wc file: $ hg falabala diffing "*\\extdiff.*\\a.2a13a4d2da36\\a" "*\\a\\a" (glob) (windows !) diffing */extdiff.*/a.2a13a4d2da36/a */a/a (glob) (no-windows !) [1] Test --change option: $ hg ci -d '2 0' -mtest3 $ hg falabala -c 1 diffing "*\\extdiff.*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) [1] Check diff are made from the first parent: $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code" diffing "*\\extdiff.*\\a.2a13a4d2da36\\a" "a.46c0e4daeb72\\a" (glob) (windows !) diffing */extdiff.*/a.2a13a4d2da36/a a.46c0e4daeb72/a (glob) (no-windows !) diff-like tools yield a non-zero exit code issue3153: ensure using extdiff with removed subrepos doesn't crash: $ hg init suba $ cd suba $ echo suba > suba $ hg add adding suba $ hg ci -m "adding suba file" $ cd .. $ echo suba=suba > .hgsub $ hg add adding .hgsub $ hg ci -Sm "adding subrepo" $ echo > .hgsub $ hg ci -m "removing subrepo" $ hg falabala -r 4 -r 5 -S diffing a.398e36faf9c6 a.5ab95fb166c4 [1] issue4463: usage of command line configuration without additional quoting $ cat <> $HGRCPATH > [extdiff] > cmd.4463a = echo > opts.4463a = a-naked 'single quoted' "double quoted" > 4463b = echo b-naked 'single quoted' "double quoted" > echo = > EOF $ hg update -q -C 0 $ echo a >> a $ hg --debug 4463a | grep '^running' running 'echo a-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) running 'echo a-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) $ hg --debug 4463b | grep '^running' running 'echo b-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) running 'echo b-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) $ hg --debug echo | grep '^running' running '*echo* "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) running '*echo */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) (getting options from other than extdiff section) $ cat <> $HGRCPATH > [extdiff] > # using diff-tools diffargs > 4463b2 = echo > # using merge-tools diffargs > 4463b3 = echo > # no diffargs > 4463b4 = echo > [diff-tools] > 4463b2.diffargs = b2-naked 'single quoted' "double quoted" > [merge-tools] > 4463b3.diffargs = b3-naked 'single quoted' "double quoted" > EOF $ hg --debug 4463b2 | grep '^running' running 'echo b2-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) running 'echo b2-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) $ hg --debug 4463b3 | grep '^running' running 'echo b3-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) running 'echo b3-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) $ hg --debug 4463b4 | grep '^running' running 'echo "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) running 'echo */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) $ hg --debug 4463b4 --option b4-naked --option 'being quoted' | grep '^running' running 'echo b4-naked "being quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) running "echo b4-naked 'being quoted' */a $TESTTMP/a/a" in */extdiff.* (glob) (no-windows !) $ hg --debug extdiff -p echo --option echo-naked --option 'being quoted' | grep '^running' running 'echo echo-naked "being quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) running "echo echo-naked 'being quoted' */a $TESTTMP/a/a" in */extdiff.* (glob) (no-windows !) $ touch 'sp ace' $ hg add 'sp ace' $ hg ci -m 'sp ace' created new head $ echo > 'sp ace' Test pre-72a89cf86fcd backward compatibility with half-baked manual quoting $ cat <> $HGRCPATH > [extdiff] > odd = > [merge-tools] > odd.diffargs = --foo='\$clabel' '\$clabel' "--bar=\$clabel" "\$clabel" > odd.executable = echo > EOF $ hg --debug odd | grep '^running' running '"*\\echo.exe" --foo="sp ace" "sp ace" --bar="sp ace" "sp ace"' in * (glob) (windows !) running "*/echo --foo='sp ace' 'sp ace' --bar='sp ace' 'sp ace'" in * (glob) (no-windows !) Empty argument must be quoted $ cat <> $HGRCPATH > [extdiff] > kdiff3 = echo > [merge-tools] > kdiff3.diffargs=--L1 \$plabel1 --L2 \$clabel \$parent \$child > EOF $ hg --debug kdiff3 -r0 | grep '^running' running 'echo --L1 "@0" --L2 "" a.8a5febb7f867 a' in * (glob) (windows !) running "echo --L1 '@0' --L2 '' a.8a5febb7f867 a" in * (glob) (no-windows !) Test extdiff of multiple files in tmp dir: $ hg update -C 0 > /dev/null $ echo changed > a $ echo changed > b #if execbit $ chmod +x b #endif Diff in working directory, before: $ hg diff --git diff --git a/a b/a --- a/a +++ b/a @@ -1,1 +1,1 @@ -a +changed diff --git a/b b/b old mode 100644 (execbit !) new mode 100755 (execbit !) --- a/b +++ b/b @@ -1,1 +1,1 @@ -b +changed Edit with extdiff -p: Prepare custom diff/edit tool: $ cat > 'diff tool.py' << EOT > #!$PYTHON > import time > time.sleep(1) # avoid unchanged-timestamp problems > file('a/a', 'ab').write('edited\n') > file('a/b', 'ab').write('edited\n') > EOT #if execbit $ chmod +x 'diff tool.py' #endif will change to /tmp/extdiff.TMP and populate directories a.TMP and a and start tool #if windows $ cat > 'diff tool.bat' << EOF > @$PYTHON "`pwd`/diff tool.py" > EOF $ hg extdiff -p "`pwd`/diff tool.bat" [1] #else $ hg extdiff -p "`pwd`/diff tool.py" [1] #endif Diff in working directory, after: $ hg diff --git diff --git a/a b/a --- a/a +++ b/a @@ -1,1 +1,2 @@ -a +changed +edited diff --git a/b b/b old mode 100644 (execbit !) new mode 100755 (execbit !) --- a/b +++ b/b @@ -1,1 +1,2 @@ -b +changed +edited Test extdiff with --option: $ hg extdiff -p echo -o this -c 1 this "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) [1] $ hg falabala -o this -c 1 diffing this "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) [1] Test extdiff's handling of options with spaces in them: $ hg edspace -c 1 "name " "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) name */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) [1] $ hg extdiff -p echo -o "name " -c 1 "name " "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) name */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) [1] Test with revsets: $ hg extdif -p echo -c "rev(1)" "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) [1] $ hg extdif -p echo -r "0::1" "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) [1] Fallback to merge-tools.tool.executable|regkey $ mkdir dir $ cat > 'dir/tool.sh' << 'EOF' > #!/bin/sh > # Mimic a tool that syncs all attrs, including mtime > cp $1/a $2/a > touch -r $1/a $2/a > chmod +x $2/a > echo "** custom diff **" > EOF #if execbit $ chmod +x dir/tool.sh #endif Windows can't run *.sh directly, so create a shim executable that can be. Without something executable, the next hg command will try to run `tl` instead of $tool (and fail). #if windows $ cat > dir/tool.bat < @sh -c "`pwd`/dir/tool.sh %1 %2" > EOF $ tool=`pwd`/dir/tool.bat #else $ tool=`pwd`/dir/tool.sh #endif $ cat a changed edited $ hg --debug tl --config extdiff.tl= --config merge-tools.tl.executable=$tool making snapshot of 2 files from rev * (glob) a b making snapshot of 2 files from working directory a b running '$TESTTMP/a/dir/tool.bat a.* a' in */extdiff.* (glob) (windows !) running '$TESTTMP/a/dir/tool.sh a.* a' in */extdiff.* (glob) (no-windows !) ** custom diff ** file changed while diffing. Overwriting: $TESTTMP/a/a (src: */extdiff.*/a/a) (glob) cleaning up temp directory [1] $ cat a a #if execbit $ [ -x a ] $ cat > 'dir/tool.sh' << 'EOF' > #!/bin/sh > chmod -x $2/a > echo "** custom diff **" > EOF $ hg --debug tl --config extdiff.tl= --config merge-tools.tl.executable=$tool making snapshot of 2 files from rev * (glob) a b making snapshot of 2 files from working directory a b running '$TESTTMP/a/dir/tool.sh a.* a' in */extdiff.* (glob) ** custom diff ** file changed while diffing. Overwriting: $TESTTMP/a/a (src: */extdiff.*/a/a) (glob) cleaning up temp directory [1] $ [ -x a ] [1] #endif $ cd .. #if symlink Test symlinks handling (issue1909) $ hg init testsymlinks $ cd testsymlinks $ echo a > a $ hg ci -Am adda adding a $ echo a >> a $ ln -s missing linka $ hg add linka $ hg falabala -r 0 --traceback diffing testsymlinks.07f494440405 testsymlinks [1] $ cd .. #endif Test handling of non-ASCII paths in generated docstrings (issue5301) >>> open("u", "w").write("\xa5\xa5") $ U=`cat u` $ HGPLAIN=1 hg --config hgext.extdiff= --config extdiff.cmd.td=hi help -k xyzzy abort: no matches (try 'hg help' for a list of topics) [255] $ HGPLAIN=1 hg --config hgext.extdiff= --config extdiff.cmd.td=hi help td > /dev/null $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help -k xyzzy abort: no matches (try 'hg help' for a list of topics) [255] $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help td \ > | grep "^ '" '\xa5\xa5' mercurial-4.5.3/tests/test-unrelated-pull.t0000644015407300116100000000160413261161234020637 0ustar augieeng00000000000000 $ hg init a $ cd a $ echo 123 > a $ hg add a $ hg commit -m "a" -u a $ cd .. $ hg init b $ cd b $ echo 321 > b $ hg add b $ hg commit -m "b" -u b $ hg pull ../a pulling from ../a searching for changes abort: repository is unrelated [255] $ hg pull -f ../a pulling from ../a searching for changes warning: repository is unrelated requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 9a79c33a9db3 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg heads changeset: 1:9a79c33a9db3 tag: tip parent: -1:000000000000 user: a date: Thu Jan 01 00:00:00 1970 +0000 summary: a changeset: 0:01f8062b2de5 user: b date: Thu Jan 01 00:00:00 1970 +0000 summary: b $ cd .. mercurial-4.5.3/tests/test-obsmarkers-effectflag.t0000644015407300116100000001033213261161234022134 0ustar augieeng00000000000000Test the 'effect-flags' feature Global setup ============ $ . $TESTDIR/testlib/obsmarker-common.sh $ cat >> $HGRCPATH < [ui] > interactive = true > [phases] > publish=False > [extensions] > rebase = > [experimental] > evolution = all > evolution.effect-flags = 1 > EOF $ hg init $TESTTMP/effect-flags $ cd $TESTTMP/effect-flags $ mkcommit ROOT amend touching the description only ----------------------------------- $ mkcommit A0 $ hg commit --amend -m "A1" check result $ hg debugobsolete --rev . 471f378eab4c5e25f6c77f785b27c936efb22874 fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'} amend touching the user only ---------------------------- $ mkcommit B0 $ hg commit --amend -u "bob " check result $ hg debugobsolete --rev . ef4a313b1e0ade55718395d80e6b88c5ccd875eb 5485c92d34330dac9d7a63dc07e1e3373835b964 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '16', 'operation': 'amend', 'user': 'test'} amend touching the date only ---------------------------- $ mkcommit B1 $ hg commit --amend -d "42 0" check result $ hg debugobsolete --rev . 2ef0680ff45038ac28c9f1ff3644341f54487280 4dd84345082e9e5291c2e6b3f335bbf8bf389378 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '32', 'operation': 'amend', 'user': 'test'} amend touching the branch only ---------------------------- $ mkcommit B2 $ hg branch my-branch marked working directory as branch my-branch (branches are permanent and global, did you want a bookmark?) $ hg commit --amend check result $ hg debugobsolete --rev . bd3db8264ceebf1966319f5df3be7aac6acd1a8e 14a01456e0574f0e0a0b15b2345486a6364a8d79 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '64', 'operation': 'amend', 'user': 'test'} $ hg up default 0 files updated, 0 files merged, 1 files removed, 0 files unresolved rebase (parents change) ----------------------- $ mkcommit C0 $ mkcommit D0 $ hg rebase -r . -d 'desc(B0)' rebasing 10:c85eff83a034 "D0" (tip) check result $ hg debugobsolete --rev . c85eff83a0340efd9da52b806a94c350222f3371 da86aa2f19a30d6686b15cae15c7b6c908ec9699 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} amend touching the diff ----------------------- $ mkcommit E0 $ echo 42 >> E0 $ hg commit --amend check result $ hg debugobsolete --rev . ebfe0333e0d96f68a917afd97c0a0af87f1c3b5f 75781fdbdbf58a987516b00c980bccda1e9ae588 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'} amend with multiple effect (desc and meta) ------------------------------------------- $ mkcommit F0 $ hg branch my-other-branch marked working directory as branch my-other-branch $ hg commit --amend -m F1 -u "bob " -d "42 0" check result $ hg debugobsolete --rev . fad47e5bd78e6aa4db1b5a0a1751bc12563655ff a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '113', 'operation': 'amend', 'user': 'test'} rebase not touching the diff ---------------------------- $ cat << EOF > H0 > 0 > 1 > 2 > 3 > 4 > 5 > 6 > 7 > 8 > 9 > 10 > EOF $ hg add H0 $ hg commit -m 'H0' $ echo "H1" >> H0 $ hg commit -m "H1" $ hg up -r "desc(H0)" 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat << EOF > H0 > H2 > 0 > 1 > 2 > 3 > 4 > 5 > 6 > 7 > 8 > 9 > 10 > EOF $ hg commit -m "H2" created new head $ hg rebase -s "desc(H1)" -d "desc(H2)" -t :merge3 rebasing 17:b57fed8d8322 "H1" merging H0 $ hg debugobsolete -r tip b57fed8d83228a8ae3748d8c3760a77638dd4f8c e509e2eb3df5d131ff7c02350bf2a9edd0c09478 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'} amend closing the branch should be detected as meta change ---------------------------------------------------------- $ hg branch closedbranch marked working directory as branch closedbranch $ mkcommit G0 $ mkcommit I0 $ hg commit --amend --close-branch check result $ hg debugobsolete -r . 2f599e54c1c6974299065cdf54e1ad640bfb7b5d 12c6238b5e371eea00fd2013b12edce3f070928b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '2', 'operation': 'amend', 'user': 'test'} mercurial-4.5.3/tests/test-excessive-merge.t0000644015407300116100000000577013261161234021005 0ustar augieeng00000000000000 $ hg init $ echo foo > a $ echo foo > b $ hg add a b $ hg ci -m "test" $ echo blah > a $ hg ci -m "branch a" $ hg co 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo blah > b $ hg ci -m "branch b" created new head $ HGMERGE=true hg merge 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m "merge b/a -> blah" $ hg co 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ HGMERGE=true hg merge 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m "merge a/b -> blah" created new head $ hg log changeset: 4:2ee31f665a86 tag: tip parent: 1:96155394af80 parent: 2:92cc4c306b19 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: merge a/b -> blah changeset: 3:e16a66a37edd parent: 2:92cc4c306b19 parent: 1:96155394af80 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: merge b/a -> blah changeset: 2:92cc4c306b19 parent: 0:5e0375449e74 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: branch b changeset: 1:96155394af80 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: branch a changeset: 0:5e0375449e74 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: test $ hg debugindex --changelog rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 60 ..... 0 5e0375449e74 000000000000 000000000000 (re) 1 60 62 ..... 1 96155394af80 5e0375449e74 000000000000 (re) 2 122 62 ..... 2 92cc4c306b19 5e0375449e74 000000000000 (re) 3 184 69 ..... 3 e16a66a37edd 92cc4c306b19 96155394af80 (re) 4 253 69 ..... 4 2ee31f665a86 96155394af80 92cc4c306b19 (re) revision 1 $ hg manifest --debug 1 79d7492df40aa0fa093ec4209be78043c181f094 644 a 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 b revision 2 $ hg manifest --debug 2 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 a 79d7492df40aa0fa093ec4209be78043c181f094 644 b revision 3 $ hg manifest --debug 3 79d7492df40aa0fa093ec4209be78043c181f094 644 a 79d7492df40aa0fa093ec4209be78043c181f094 644 b revision 4 $ hg manifest --debug 4 79d7492df40aa0fa093ec4209be78043c181f094 644 a 79d7492df40aa0fa093ec4209be78043c181f094 644 b $ hg debugindex a rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 5 ..... 0 2ed2a3912a0b 000000000000 000000000000 (re) 1 5 6 ..... 1 79d7492df40a 2ed2a3912a0b 000000000000 (re) $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 5 changesets, 4 total revisions mercurial-4.5.3/tests/test-diff-ignore-whitespace.t0000644015407300116100000001776113261161234022240 0ustar augieeng00000000000000GNU diff is the reference for all of these results. Prepare tests: $ echo '[alias]' >> $HGRCPATH $ echo 'ndiff = diff --nodates' >> $HGRCPATH $ hg init $ printf 'hello world\ngoodbye world\n' >foo $ hg ci -Amfoo -ufoo adding foo Test added blank lines: $ printf '\nhello world\n\ngoodbye world\n\n' >foo >>> two diffs showing three added lines <<< $ hg ndiff diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,5 @@ + hello world + goodbye world + $ hg ndiff -b diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,5 @@ + hello world + goodbye world + >>> no diffs <<< $ hg ndiff -B $ hg ndiff -Bb Test added horizontal space first on a line(): $ printf '\t hello world\ngoodbye world\n' >foo >>> four diffs showing added space first on the first line <<< $ hg ndiff diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,2 @@ -hello world + hello world goodbye world $ hg ndiff -b diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,2 @@ -hello world + hello world goodbye world $ hg ndiff -B diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,2 @@ -hello world + hello world goodbye world $ hg ndiff -Bb diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,2 @@ -hello world + hello world goodbye world Test added horizontal space last on a line: $ printf 'hello world\t \ngoodbye world\n' >foo >>> two diffs showing space appended to the first line <<< $ hg ndiff diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,2 @@ -hello world +hello world goodbye world $ hg ndiff -B diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,2 @@ -hello world +hello world goodbye world >>> no diffs <<< $ hg ndiff -b $ hg ndiff -Bb Test added horizontal space in the middle of a word: $ printf 'hello world\ngood bye world\n' >foo >>> four diffs showing space inserted into "goodbye" <<< $ hg ndiff diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,2 @@ hello world -goodbye world +good bye world $ hg ndiff -B diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,2 @@ hello world -goodbye world +good bye world $ hg ndiff -b diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,2 @@ hello world -goodbye world +good bye world $ hg ndiff -Bb diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,2 @@ hello world -goodbye world +good bye world Test increased horizontal whitespace amount: $ printf 'hello world\ngoodbye\t\t \tworld\n' >foo >>> two diffs showing changed whitespace amount in the last line <<< $ hg ndiff diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,2 @@ hello world -goodbye world +goodbye world $ hg ndiff -B diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,2 @@ hello world -goodbye world +goodbye world >>> no diffs <<< $ hg ndiff -b $ hg ndiff -Bb Test added blank line with horizontal whitespace: $ printf 'hello world\n \t\ngoodbye world\n' >foo >>> three diffs showing added blank line with horizontal space <<< $ hg ndiff diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,3 @@ hello world + goodbye world $ hg ndiff -B diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,3 @@ hello world + goodbye world $ hg ndiff -b diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,3 @@ hello world + goodbye world >>> no diffs <<< $ hg ndiff -Bb Test added blank line with other whitespace: $ printf 'hello world\n \t\ngoodbye world \n' >foo >>> three diffs showing added blank line with other space <<< $ hg ndiff diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,3 @@ -hello world -goodbye world +hello world + +goodbye world $ hg ndiff -B diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,3 @@ -hello world -goodbye world +hello world + +goodbye world $ hg ndiff -b diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,3 @@ hello world + goodbye world >>> no diffs <<< $ hg ndiff -Bb Test whitespace changes: $ printf 'helloworld\ngoodbye\tworld \n' >foo >>> four diffs showing changed whitespace <<< $ hg ndiff diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,2 @@ -hello world -goodbye world +helloworld +goodbye world $ hg ndiff -B diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,2 @@ -hello world -goodbye world +helloworld +goodbye world $ hg ndiff -b diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,2 @@ -hello world +helloworld goodbye world $ hg ndiff -Bb diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,2 @@ -hello world +helloworld goodbye world >>> no diffs <<< $ hg ndiff -w Test whitespace changes and blank lines: $ printf 'helloworld\n\n\n\ngoodbye\tworld \n' >foo >>> five diffs showing changed whitespace <<< $ hg ndiff diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,5 @@ -hello world -goodbye world +helloworld + + + +goodbye world $ hg ndiff -B diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,5 @@ -hello world -goodbye world +helloworld + + + +goodbye world $ hg ndiff -b diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,5 @@ -hello world +helloworld + + + goodbye world $ hg ndiff -Bb diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,5 @@ -hello world +helloworld + + + goodbye world $ hg ndiff -w diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,5 @@ hello world + + + goodbye world >>> no diffs <<< $ hg ndiff -wB Test \r (carriage return) as used in "DOS" line endings: $ printf 'hello world\r\n\r\ngoodbye\rworld\n' >foo $ hg ndiff diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,3 @@ -hello world -goodbye world +hello world\r (esc) +\r (esc) +goodbye\r (no-eol) (esc) world Test \r (carriage return) as used in "DOS" line endings: $ printf 'hello world \r\n\t\ngoodbye world\n' >foo $ hg ndiff --ignore-space-at-eol diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,3 @@ hello world +\t (esc) goodbye world No completely blank lines to ignore: $ printf 'hello world\r\n\r\ngoodbye\rworld\n' >foo $ hg ndiff --ignore-blank-lines diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,3 @@ -hello world -goodbye world +hello world\r (esc) +\r (esc) +goodbye\r (no-eol) (esc) world Only new line noticed: $ hg ndiff --ignore-space-change diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,3 @@ hello world +\r (esc) goodbye world $ hg ndiff --ignore-all-space diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,3 @@ hello world +\r (esc) goodbye world New line not noticed when space change ignored: $ hg ndiff --ignore-blank-lines --ignore-all-space Do not ignore all newlines, only blank lines $ printf 'hello \nworld\ngoodbye world\n' > foo $ hg ndiff --ignore-blank-lines diff -r 540c40a65b78 foo --- a/foo +++ b/foo @@ -1,2 +1,3 @@ -hello world +hello +world goodbye world Test hunk offsets adjustments with --ignore-blank-lines $ hg revert -aC reverting foo $ printf '\nb\nx\nd\n' > a $ printf 'b\ny\nd\n' > b $ hg add a b $ hg ci -m add $ hg cat -r . a > b $ hg cat -r . b > a $ hg diff -B --nodates a > ../diffa $ cat ../diffa diff -r 0e66aa54f318 a --- a/a +++ b/a @@ -1,4 +1,4 @@ b -x +y d $ hg diff -B --nodates b > ../diffb $ cat ../diffb diff -r 0e66aa54f318 b --- a/b +++ b/b @@ -1,3 +1,3 @@ b -y +x d $ hg revert -aC reverting a reverting b $ hg import --no-commit ../diffa applying ../diffa $ hg revert -aC reverting a $ hg import --no-commit ../diffb applying ../diffb $ hg revert -aC reverting b mercurial-4.5.3/tests/test-merge2.t0000644015407300116100000000215413261161234017064 0ustar augieeng00000000000000 $ hg init t $ cd t $ echo This is file a1 > a $ hg add a $ hg commit -m "commit #0" $ echo This is file b1 > b $ hg add b $ hg commit -m "commit #1" $ rm b $ hg update 0 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo This is file b2 > b $ hg add b $ hg commit -m "commit #2" created new head $ cd ..; rm -r t $ mkdir t $ cd t $ hg init $ echo This is file a1 > a $ hg add a $ hg commit -m "commit #0" $ echo This is file b1 > b $ hg add b $ hg commit -m "commit #1" $ rm b $ hg update 0 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo This is file b2 > b $ hg commit -A -m "commit #2" adding b created new head $ cd ..; rm -r t $ hg init t $ cd t $ echo This is file a1 > a $ hg add a $ hg commit -m "commit #0" $ echo This is file b1 > b $ hg add b $ hg commit -m "commit #1" $ rm b $ hg remove b $ hg update 0 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo This is file b2 > b $ hg commit -A -m "commit #2" adding b created new head $ cd .. mercurial-4.5.3/tests/test-clone.t0000644015407300116100000010022313261161234016777 0ustar augieeng00000000000000Prepare repo a: $ hg init a $ cd a $ echo a > a $ hg add a $ hg commit -m test $ echo first line > b $ hg add b Create a non-inlined filelog: $ $PYTHON -c 'file("data1", "wb").write("".join("%s\n" % x for x in range(10000)))' $ for j in 0 1 2 3 4 5 6 7 8 9; do > cat data1 >> b > hg commit -m test > done List files in store/data (should show a 'b.d'): $ for i in .hg/store/data/*; do > echo $i > done .hg/store/data/a.i .hg/store/data/b.d .hg/store/data/b.i Trigger branchcache creation: $ hg branches default 10:a7949464abda $ ls .hg/cache branch2-served checkisexec (execbit !) checklink (symlink !) checklink-target (symlink !) checknoexec (execbit !) rbc-names-v1 rbc-revs-v1 Default operation: $ hg clone . ../b updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ../b Ensure branchcache got copied over: $ ls .hg/cache branch2-served checkisexec (execbit !) checklink (symlink !) checklink-target (symlink !) rbc-names-v1 rbc-revs-v1 $ cat a a $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 11 changesets, 11 total revisions Invalid dest '' must abort: $ hg clone . '' abort: empty destination path is not valid [255] No update, with debug option: #if hardlink $ hg --debug clone -U . ../c --config progress.debug=true linking: 1 linking: 2 linking: 3 linking: 4 linking: 5 linking: 6 linking: 7 linking: 8 linked 8 files #else $ hg --debug clone -U . ../c --config progress.debug=true linking: 1 copying: 2 copying: 3 copying: 4 copying: 5 copying: 6 copying: 7 copying: 8 copied 8 files #endif $ cd ../c Ensure branchcache got copied over: $ ls .hg/cache branch2-served rbc-names-v1 rbc-revs-v1 $ cat a 2>/dev/null || echo "a not present" a not present $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 11 changesets, 11 total revisions Default destination: $ mkdir ../d $ cd ../d $ hg clone ../a destination directory: a updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd a $ hg cat a a $ cd ../.. Check that we drop the 'file:' from the path before writing the .hgrc: $ hg clone file:a e updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ grep 'file:' e/.hg/hgrc [1] Check that path aliases are expanded: $ hg clone -q -U --config 'paths.foobar=a#0' foobar f $ hg -R f showconfig paths.default $TESTTMP/a#0 Use --pull: $ hg clone --pull a g requesting all changes adding changesets adding manifests adding file changes added 11 changesets with 11 changes to 2 files new changesets acb14030fe0a:a7949464abda updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R g verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 11 changesets, 11 total revisions Invalid dest '' with --pull must abort (issue2528): $ hg clone --pull a '' abort: empty destination path is not valid [255] Clone to '.': $ mkdir h $ cd h $ hg clone ../a . updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd .. *** Tests for option -u *** Adding some more history to repo a: $ cd a $ hg tag ref1 $ echo the quick brown fox >a $ hg ci -m "hacked default" $ hg up ref1 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg branch stable marked working directory as branch stable (branches are permanent and global, did you want a bookmark?) $ echo some text >a $ hg ci -m "starting branch stable" $ hg tag ref2 $ echo some more text >a $ hg ci -m "another change for branch stable" $ hg up ref2 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg parents changeset: 13:e8ece76546a6 branch: stable tag: ref2 parent: 10:a7949464abda user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: starting branch stable Repo a has two heads: $ hg heads changeset: 15:0aae7cf88f0d branch: stable tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: another change for branch stable changeset: 12:f21241060d6a user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: hacked default $ cd .. Testing --noupdate with --updaterev (must abort): $ hg clone --noupdate --updaterev 1 a ua abort: cannot specify both --noupdate and --updaterev [255] Testing clone -u: $ hg clone -u . a ua updating to branch stable 2 files updated, 0 files merged, 0 files removed, 0 files unresolved Repo ua has both heads: $ hg -R ua heads changeset: 15:0aae7cf88f0d branch: stable tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: another change for branch stable changeset: 12:f21241060d6a user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: hacked default Same revision checked out in repo a and ua: $ hg -R a parents --template "{node|short}\n" e8ece76546a6 $ hg -R ua parents --template "{node|short}\n" e8ece76546a6 $ rm -r ua Testing clone --pull -u: $ hg clone --pull -u . a ua requesting all changes adding changesets adding manifests adding file changes added 16 changesets with 16 changes to 3 files (+1 heads) new changesets acb14030fe0a:0aae7cf88f0d updating to branch stable 2 files updated, 0 files merged, 0 files removed, 0 files unresolved Repo ua has both heads: $ hg -R ua heads changeset: 15:0aae7cf88f0d branch: stable tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: another change for branch stable changeset: 12:f21241060d6a user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: hacked default Same revision checked out in repo a and ua: $ hg -R a parents --template "{node|short}\n" e8ece76546a6 $ hg -R ua parents --template "{node|short}\n" e8ece76546a6 $ rm -r ua Testing clone -u : $ hg clone -u stable a ua updating to branch stable 3 files updated, 0 files merged, 0 files removed, 0 files unresolved Repo ua has both heads: $ hg -R ua heads changeset: 15:0aae7cf88f0d branch: stable tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: another change for branch stable changeset: 12:f21241060d6a user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: hacked default Branch 'stable' is checked out: $ hg -R ua parents changeset: 15:0aae7cf88f0d branch: stable tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: another change for branch stable $ rm -r ua Testing default checkout: $ hg clone a ua updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved Repo ua has both heads: $ hg -R ua heads changeset: 15:0aae7cf88f0d branch: stable tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: another change for branch stable changeset: 12:f21241060d6a user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: hacked default Branch 'default' is checked out: $ hg -R ua parents changeset: 12:f21241060d6a user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: hacked default Test clone with a branch named "@" (issue3677) $ hg -R ua branch @ marked working directory as branch @ $ hg -R ua commit -m 'created branch @' $ hg clone ua atbranch updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R atbranch heads changeset: 16:798b6d97153e branch: @ tag: tip parent: 12:f21241060d6a user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: created branch @ changeset: 15:0aae7cf88f0d branch: stable user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: another change for branch stable changeset: 12:f21241060d6a user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: hacked default $ hg -R atbranch parents changeset: 12:f21241060d6a user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: hacked default $ rm -r ua atbranch Testing #: $ hg clone -u . a#stable ua adding changesets adding manifests adding file changes added 14 changesets with 14 changes to 3 files new changesets acb14030fe0a:0aae7cf88f0d updating to branch stable 2 files updated, 0 files merged, 0 files removed, 0 files unresolved Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): $ hg -R ua heads changeset: 13:0aae7cf88f0d branch: stable tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: another change for branch stable changeset: 10:a7949464abda user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: test Same revision checked out in repo a and ua: $ hg -R a parents --template "{node|short}\n" e8ece76546a6 $ hg -R ua parents --template "{node|short}\n" e8ece76546a6 $ rm -r ua Testing -u -r : $ hg clone -u . -r stable a ua adding changesets adding manifests adding file changes added 14 changesets with 14 changes to 3 files new changesets acb14030fe0a:0aae7cf88f0d updating to branch stable 2 files updated, 0 files merged, 0 files removed, 0 files unresolved Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): $ hg -R ua heads changeset: 13:0aae7cf88f0d branch: stable tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: another change for branch stable changeset: 10:a7949464abda user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: test Same revision checked out in repo a and ua: $ hg -R a parents --template "{node|short}\n" e8ece76546a6 $ hg -R ua parents --template "{node|short}\n" e8ece76546a6 $ rm -r ua Testing -r : $ hg clone -r stable a ua adding changesets adding manifests adding file changes added 14 changesets with 14 changes to 3 files new changesets acb14030fe0a:0aae7cf88f0d updating to branch stable 3 files updated, 0 files merged, 0 files removed, 0 files unresolved Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): $ hg -R ua heads changeset: 13:0aae7cf88f0d branch: stable tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: another change for branch stable changeset: 10:a7949464abda user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: test Branch 'stable' is checked out: $ hg -R ua parents changeset: 13:0aae7cf88f0d branch: stable tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: another change for branch stable $ rm -r ua Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not iterable in addbranchrevs() $ cat < simpleclone.py > from mercurial import ui, hg > myui = ui.ui.load() > repo = hg.repository(myui, 'a') > hg.clone(myui, {}, repo, dest="ua") > EOF $ $PYTHON simpleclone.py updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -r ua $ cat < branchclone.py > from mercurial import ui, hg, extensions > myui = ui.ui.load() > extensions.loadall(myui) > repo = hg.repository(myui, 'a') > hg.clone(myui, {}, repo, dest="ua", branch=["stable",]) > EOF $ $PYTHON branchclone.py adding changesets adding manifests adding file changes added 14 changesets with 14 changes to 3 files new changesets acb14030fe0a:0aae7cf88f0d updating to branch stable 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -r ua Test clone with special '@' bookmark: $ cd a $ hg bookmark -r a7949464abda @ # branch point of stable from default $ hg clone . ../i updating to bookmark @ 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id -i ../i a7949464abda $ rm -r ../i $ hg bookmark -f -r stable @ $ hg bookmarks @ 15:0aae7cf88f0d $ hg clone . ../i updating to bookmark @ on branch stable 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id -i ../i 0aae7cf88f0d $ cd "$TESTTMP" Testing failures: $ mkdir fail $ cd fail No local source $ hg clone a b abort: repository a not found! [255] No remote source #if windows $ hg clone http://$LOCALIP:3121/a b abort: error: * (glob) [255] #else $ hg clone http://$LOCALIP:3121/a b abort: error: *refused* (glob) [255] #endif $ rm -rf b # work around bug with http clone #if unix-permissions no-root Inaccessible source $ mkdir a $ chmod 000 a $ hg clone a b abort: repository a not found! [255] Inaccessible destination $ hg init b $ cd b $ hg clone . ../a abort: Permission denied: '../a' [255] $ cd .. $ chmod 700 a $ rm -r a b #endif #if fifo Source of wrong type $ mkfifo a $ hg clone a b abort: repository a not found! [255] $ rm a #endif Default destination, same directory $ hg init q $ hg clone q destination directory: q abort: destination 'q' is not empty [255] destination directory not empty $ mkdir a $ echo stuff > a/a $ hg clone q a abort: destination 'a' is not empty [255] #if unix-permissions no-root leave existing directory in place after clone failure $ hg init c $ cd c $ echo c > c $ hg commit -A -m test adding c $ chmod -rx .hg/store/data $ cd .. $ mkdir d $ hg clone c d 2> err [255] $ test -d d $ test -d d/.hg [1] re-enable perm to allow deletion $ chmod +rx c/.hg/store/data #endif $ cd .. Test clone from the repository in (emulated) revlog format 0 (issue4203): $ mkdir issue4203 $ mkdir -p src/.hg $ echo foo > src/foo $ hg -R src add src/foo $ hg -R src commit -m '#0' $ hg -R src log -q 0:e1bab28bca43 $ hg clone -U -q src dst $ hg -R dst log -q 0:e1bab28bca43 Create repositories to test auto sharing functionality $ cat >> $HGRCPATH << EOF > [extensions] > share= > EOF $ hg init empty $ hg init source1a $ cd source1a $ echo initial1 > foo $ hg -q commit -A -m initial $ echo second > foo $ hg commit -m second $ cd .. $ hg init filteredrev0 $ cd filteredrev0 $ cat >> .hg/hgrc << EOF > [experimental] > evolution.createmarkers=True > EOF $ echo initial1 > foo $ hg -q commit -A -m initial0 $ hg -q up -r null $ echo initial2 > foo $ hg -q commit -A -m initial1 $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8 obsoleted 1 changesets $ cd .. $ hg -q clone --pull source1a source1b $ cd source1a $ hg bookmark bookA $ echo 1a > foo $ hg commit -m 1a $ cd ../source1b $ hg -q up -r 0 $ echo head1 > foo $ hg commit -m head1 created new head $ hg bookmark head1 $ hg -q up -r 0 $ echo head2 > foo $ hg commit -m head2 created new head $ hg bookmark head2 $ hg -q up -r 0 $ hg branch branch1 marked working directory as branch branch1 (branches are permanent and global, did you want a bookmark?) $ echo branch1 > foo $ hg commit -m branch1 $ hg -q up -r 0 $ hg branch branch2 marked working directory as branch branch2 $ echo branch2 > foo $ hg commit -m branch2 $ cd .. $ hg init source2 $ cd source2 $ echo initial2 > foo $ hg -q commit -A -m initial2 $ echo second > foo $ hg commit -m second $ cd .. Clone with auto share from an empty repo should not result in share $ mkdir share $ hg --config share.pool=share clone empty share-empty (not using pooled storage: remote appears to be empty) updating to branch default 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ ls share $ test -d share-empty/.hg/store $ test -f share-empty/.hg/sharedpath [1] Clone with auto share from a repo with filtered revision 0 should not result in share $ hg --config share.pool=share clone filteredrev0 share-filtered (not using pooled storage: unable to resolve identity of remote) requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets e082c1832e09 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Clone from repo with content should result in shared store being created $ hg --config share.pool=share clone source1a share-dest1a (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 1 files new changesets b5f04eac9d8f:e5bfe23c0b47 searching for changes no changes found adding remote bookmark bookA updating working directory 1 files updated, 0 files merged, 0 files removed, 0 files unresolved The shared repo should have been created $ ls share b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1 The destination should point to it $ cat share-dest1a/.hg/sharedpath; echo $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg The destination should have bookmarks $ hg -R share-dest1a bookmarks bookA 2:e5bfe23c0b47 The default path should be the remote, not the share $ hg -R share-dest1a config paths.default $TESTTMP/source1a Clone with existing share dir should result in pull + share $ hg --config share.pool=share clone source1b share-dest1b (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) searching for changes adding changesets adding manifests adding file changes added 4 changesets with 4 changes to 1 files (+4 heads) adding remote bookmark head1 adding remote bookmark head2 new changesets 4a8dc1ab4c13:6bacf4683960 updating working directory 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ ls share b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1 $ cat share-dest1b/.hg/sharedpath; echo $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg We only get bookmarks from the remote, not everything in the share $ hg -R share-dest1b bookmarks head1 3:4a8dc1ab4c13 head2 4:99f71071f117 Default path should be source, not share. $ hg -R share-dest1b config paths.default $TESTTMP/source1b Checked out revision should be head of default branch $ hg -R share-dest1b log -r . changeset: 4:99f71071f117 bookmark: head2 parent: 0:b5f04eac9d8f user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: head2 Clone from unrelated repo should result in new share $ hg --config share.pool=share clone source2 share-dest2 (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e) requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files new changesets 22aeff664783:63cf6c3dba4a searching for changes no changes found updating working directory 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ ls share 22aeff664783fd44c6d9b435618173c118c3448e b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1 remote naming mode works as advertised $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde) requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 1 files new changesets b5f04eac9d8f:e5bfe23c0b47 searching for changes no changes found adding remote bookmark bookA updating working directory 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ ls shareremote 195bb1fcdb595c14a6c13e0269129ed78f6debde $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46) requesting all changes adding changesets adding manifests adding file changes added 6 changesets with 6 changes to 1 files (+4 heads) new changesets b5f04eac9d8f:6bacf4683960 searching for changes no changes found adding remote bookmark head1 adding remote bookmark head2 updating working directory 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ ls shareremote 195bb1fcdb595c14a6c13e0269129ed78f6debde c0d4f83847ca2a873741feb7048a45085fd47c46 request to clone a single revision is respected in sharing mode $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files new changesets b5f04eac9d8f:4a8dc1ab4c13 no changes found adding remote bookmark head1 updating working directory 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R share-1arev log -G @ changeset: 1:4a8dc1ab4c13 | bookmark: head1 | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: head1 | o changeset: 0:b5f04eac9d8f user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: initial making another clone should only pull down requested rev $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) adding remote bookmark head1 adding remote bookmark head2 new changesets 99f71071f117 updating working directory 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R share-1brev log -G @ changeset: 2:99f71071f117 | bookmark: head2 | tag: tip | parent: 0:b5f04eac9d8f | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: head2 | | o changeset: 1:4a8dc1ab4c13 |/ bookmark: head1 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: head1 | o changeset: 0:b5f04eac9d8f user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: initial Request to clone a single branch is respected in sharing mode $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files new changesets b5f04eac9d8f:5f92a6c1a1b1 no changes found updating working directory 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R share-1bbranch1 log -G o changeset: 1:5f92a6c1a1b1 | branch: branch1 | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: branch1 | @ changeset: 0:b5f04eac9d8f user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: initial $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 6bacf4683960 updating working directory 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R share-1bbranch2 log -G o changeset: 2:6bacf4683960 | branch: branch2 | tag: tip | parent: 0:b5f04eac9d8f | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: branch2 | | o changeset: 1:5f92a6c1a1b1 |/ branch: branch1 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: branch1 | @ changeset: 0:b5f04eac9d8f user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: initial -U is respected in share clone mode $ hg --config share.pool=share clone -U source1a share-1anowc (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) searching for changes no changes found adding remote bookmark bookA $ ls share-1anowc Test that auto sharing doesn't cause failure of "hg clone local remote" $ cd $TESTTMP $ hg -R a id -r 0 acb14030fe0a $ hg id -R remote -r 0 abort: repository remote not found! [255] $ hg --config share.pool=share -q clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" a ssh://user@dummy/remote $ hg -R remote id -r 0 acb14030fe0a Cloning into pooled storage doesn't race (issue5104) $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 & $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1 $ wait $ hg -R share-destrace1 log -r tip changeset: 2:e5bfe23c0b47 bookmark: bookA tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 1a $ hg -R share-destrace2 log -r tip changeset: 2:e5bfe23c0b47 bookmark: bookA tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 1a One repo should be new, the other should be shared from the pool. We don't care which is which, so we just make sure we always print the one containing "new pooled" first, then one one containing "existing pooled". $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 1 files new changesets b5f04eac9d8f:e5bfe23c0b47 searching for changes no changes found adding remote bookmark bookA updating working directory 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) searching for changes no changes found adding remote bookmark bookA updating working directory 1 files updated, 0 files merged, 0 files removed, 0 files unresolved SEC: check for unsafe ssh url $ cat >> $HGRCPATH << EOF > [ui] > ssh = sh -c "read l; read l; read l" > EOF $ hg clone 'ssh://-oProxyCommand=touch${IFS}owned/path' abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' [255] $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path' abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' [255] $ hg clone 'ssh://fakehost|touch%20owned/path' abort: no suitable response from remote hg! [255] $ hg clone 'ssh://fakehost%7Ctouch%20owned/path' abort: no suitable response from remote hg! [255] $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path' abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path' [255] #if windows $ hg clone "ssh://%26touch%20owned%20/" --debug running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio" sending hello command sending between command abort: no suitable response from remote hg! [255] $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio" sending hello command sending between command abort: no suitable response from remote hg! [255] #else $ hg clone "ssh://%3btouch%20owned%20/" --debug running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio' sending hello command sending between command abort: no suitable response from remote hg! [255] $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio' sending hello command sending between command abort: no suitable response from remote hg! [255] #endif $ hg clone "ssh://v-alid.example.com/" --debug running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re) sending hello command sending between command abort: no suitable response from remote hg! [255] We should not have created a file named owned - if it exists, the attack succeeded. $ if test -f owned; then echo 'you got owned'; fi Cloning without fsmonitor enabled does not print a warning for small repos $ hg clone a fsmonitor-default updating to bookmark @ on branch stable 3 files updated, 0 files merged, 0 files removed, 0 files unresolved Lower the warning threshold to simulate a large repo $ cat >> $HGRCPATH << EOF > [fsmonitor] > warn_update_file_count = 2 > EOF We should see a warning about no fsmonitor on supported platforms #if linuxormacos no-fsmonitor $ hg clone a nofsmonitor updating to bookmark @ on branch stable (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") 3 files updated, 0 files merged, 0 files removed, 0 files unresolved #else $ hg clone a nofsmonitor updating to bookmark @ on branch stable 3 files updated, 0 files merged, 0 files removed, 0 files unresolved #endif We should not see warning about fsmonitor when it is enabled #if fsmonitor $ hg clone a fsmonitor-enabled updating to bookmark @ on branch stable 3 files updated, 0 files merged, 0 files removed, 0 files unresolved #endif We can disable the fsmonitor warning $ hg --config fsmonitor.warn_when_unused=false clone a fsmonitor-disable-warning updating to bookmark @ on branch stable 3 files updated, 0 files merged, 0 files removed, 0 files unresolved Loaded fsmonitor but disabled in config should still print warning #if linuxormacos fsmonitor $ hg --config fsmonitor.mode=off clone a fsmonitor-mode-off updating to bookmark @ on branch stable (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (fsmonitor !) 3 files updated, 0 files merged, 0 files removed, 0 files unresolved #endif Warning not printed if working directory isn't empty $ hg -q clone a fsmonitor-update (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (?) $ cd fsmonitor-update $ hg up acb14030fe0a 1 files updated, 0 files merged, 2 files removed, 0 files unresolved (leaving bookmark @) $ hg up cf0fe1914066 1 files updated, 0 files merged, 0 files removed, 0 files unresolved `hg update` from null revision also prints $ hg up null 0 files updated, 0 files merged, 2 files removed, 0 files unresolved #if linuxormacos no-fsmonitor $ hg up cf0fe1914066 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") 2 files updated, 0 files merged, 0 files removed, 0 files unresolved #else $ hg up cf0fe1914066 2 files updated, 0 files merged, 0 files removed, 0 files unresolved #endif $ cd .. mercurial-4.5.3/tests/test-automv.t0000644015407300116100000001574113261161234017224 0ustar augieeng00000000000000Tests for the automv extension; detect moved files at commit time. $ cat >> $HGRCPATH << EOF > [extensions] > automv= > rebase= > EOF Setup repo $ hg init repo $ cd repo Test automv command for commit $ printf 'foo\nbar\nbaz\n' > a.txt $ hg add a.txt $ hg commit -m 'init repo with a' mv/rm/add $ mv a.txt b.txt $ hg rm a.txt $ hg add b.txt $ hg status -C A b.txt R a.txt $ hg commit -m 'msg' detected move of 1 files $ hg status --change . -C A b.txt a.txt R a.txt $ hg up -r 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved mv/rm/add/modif $ mv a.txt b.txt $ hg rm a.txt $ hg add b.txt $ printf '\n' >> b.txt $ hg status -C A b.txt R a.txt $ hg commit -m 'msg' detected move of 1 files created new head $ hg status --change . -C A b.txt a.txt R a.txt $ hg up -r 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved mv/rm/add/modif $ mv a.txt b.txt $ hg rm a.txt $ hg add b.txt $ printf '\nfoo\n' >> b.txt $ hg status -C A b.txt R a.txt $ hg commit -m 'msg' created new head $ hg status --change . -C A b.txt R a.txt $ hg up -r 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved mv/rm/add/modif/changethreshold $ mv a.txt b.txt $ hg rm a.txt $ hg add b.txt $ printf '\nfoo\n' >> b.txt $ hg status -C A b.txt R a.txt $ hg commit --config automv.similarity='60' -m 'msg' detected move of 1 files created new head $ hg status --change . -C A b.txt a.txt R a.txt $ hg up -r 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved mv $ mv a.txt b.txt $ hg status -C ! a.txt ? b.txt $ hg commit -m 'msg' nothing changed (1 missing files, see 'hg status') [1] $ hg status -C ! a.txt ? b.txt $ hg revert -aqC $ rm b.txt mv/rm/add/notincommitfiles $ mv a.txt b.txt $ hg rm a.txt $ hg add b.txt $ echo 'bar' > c.txt $ hg add c.txt $ hg status -C A b.txt A c.txt R a.txt $ hg commit c.txt -m 'msg' created new head $ hg status --change . -C A c.txt $ hg status -C A b.txt R a.txt $ hg up -r 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg rm a.txt $ echo 'bar' > c.txt $ hg add c.txt $ hg commit -m 'msg' detected move of 1 files created new head $ hg status --change . -C A b.txt a.txt A c.txt R a.txt $ hg up -r 0 1 files updated, 0 files merged, 2 files removed, 0 files unresolved mv/rm/add/--no-automv $ mv a.txt b.txt $ hg rm a.txt $ hg add b.txt $ hg status -C A b.txt R a.txt $ hg commit --no-automv -m 'msg' created new head $ hg status --change . -C A b.txt R a.txt $ hg up -r 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved Test automv command for commit --amend mv/rm/add $ echo 'c' > c.txt $ hg add c.txt $ hg commit -m 'revision to amend to' created new head $ mv a.txt b.txt $ hg rm a.txt $ hg add b.txt $ hg status -C A b.txt R a.txt $ hg commit --amend -m 'amended' detected move of 1 files saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend.hg (glob) $ hg status --change . -C A b.txt a.txt A c.txt R a.txt $ hg up -r 0 1 files updated, 0 files merged, 2 files removed, 0 files unresolved mv/rm/add/modif $ echo 'c' > c.txt $ hg add c.txt $ hg commit -m 'revision to amend to' created new head $ mv a.txt b.txt $ hg rm a.txt $ hg add b.txt $ printf '\n' >> b.txt $ hg status -C A b.txt R a.txt $ hg commit --amend -m 'amended' detected move of 1 files saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend.hg (glob) $ hg status --change . -C A b.txt a.txt A c.txt R a.txt $ hg up -r 0 1 files updated, 0 files merged, 2 files removed, 0 files unresolved mv/rm/add/modif $ echo 'c' > c.txt $ hg add c.txt $ hg commit -m 'revision to amend to' created new head $ mv a.txt b.txt $ hg rm a.txt $ hg add b.txt $ printf '\nfoo\n' >> b.txt $ hg status -C A b.txt R a.txt $ hg commit --amend -m 'amended' saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend.hg (glob) $ hg status --change . -C A b.txt A c.txt R a.txt $ hg up -r 0 1 files updated, 0 files merged, 2 files removed, 0 files unresolved mv/rm/add/modif/changethreshold $ echo 'c' > c.txt $ hg add c.txt $ hg commit -m 'revision to amend to' created new head $ mv a.txt b.txt $ hg rm a.txt $ hg add b.txt $ printf '\nfoo\n' >> b.txt $ hg status -C A b.txt R a.txt $ hg commit --amend --config automv.similarity='60' -m 'amended' detected move of 1 files saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend.hg (glob) $ hg status --change . -C A b.txt a.txt A c.txt R a.txt $ hg up -r 0 1 files updated, 0 files merged, 2 files removed, 0 files unresolved mv $ echo 'c' > c.txt $ hg add c.txt $ hg commit -m 'revision to amend to' created new head $ mv a.txt b.txt $ hg status -C ! a.txt ? b.txt $ hg commit --amend -m 'amended' saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend.hg (glob) $ hg status -C ! a.txt ? b.txt $ hg up -Cr 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved mv/rm/add/notincommitfiles $ echo 'c' > c.txt $ hg add c.txt $ hg commit -m 'revision to amend to' created new head $ mv a.txt b.txt $ hg rm a.txt $ hg add b.txt $ echo 'bar' > d.txt $ hg add d.txt $ hg status -C A b.txt A d.txt R a.txt $ hg commit --amend -m 'amended' d.txt saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend.hg (glob) $ hg status --change . -C A c.txt A d.txt $ hg status -C A b.txt R a.txt $ hg commit --amend -m 'amended' detected move of 1 files saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend.hg (glob) $ hg status --change . -C A b.txt a.txt A c.txt A d.txt R a.txt $ hg up -r 0 1 files updated, 0 files merged, 3 files removed, 0 files unresolved mv/rm/add/--no-automv $ echo 'c' > c.txt $ hg add c.txt $ hg commit -m 'revision to amend to' created new head $ mv a.txt b.txt $ hg rm a.txt $ hg add b.txt $ hg status -C A b.txt R a.txt $ hg commit --amend -m 'amended' --no-automv saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend.hg (glob) $ hg status --change . -C A b.txt A c.txt R a.txt $ hg up -r 0 1 files updated, 0 files merged, 2 files removed, 0 files unresolved mv/rm/commit/add/amend $ echo 'c' > c.txt $ hg add c.txt $ hg commit -m 'revision to amend to' created new head $ mv a.txt b.txt $ hg rm a.txt $ hg status -C R a.txt ? b.txt $ hg commit -m "removed a" $ hg add b.txt $ hg commit --amend -m 'amended' saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-amend.hg (glob) $ hg status --change . -C A b.txt R a.txt error conditions $ cat >> $HGRCPATH << EOF > [automv] > similarity=110 > EOF $ hg commit -m 'revision to amend to' abort: automv.similarity must be between 0 and 100 [255] mercurial-4.5.3/tests/test-sparse-merges.t0000644015407300116100000000265213261161234020463 0ustar augieeng00000000000000test merging things outside of the sparse checkout $ hg init myrepo $ cd myrepo $ cat > .hg/hgrc < [extensions] > sparse= > EOF $ echo foo > foo $ echo bar > bar $ hg add foo bar $ hg commit -m initial $ hg branch feature marked working directory as branch feature (branches are permanent and global, did you want a bookmark?) $ echo bar2 >> bar $ hg commit -m 'feature - bar2' $ hg update -q default $ hg debugsparse --exclude 'bar**' $ hg merge feature temporarily included 1 file(s) in the sparse checkout for merging 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) Verify bar was merged temporarily $ ls bar foo $ hg status M bar Verify bar disappears automatically when the working copy becomes clean $ hg commit -m "merged" cleaned up 1 temporarily added file(s) from the sparse checkout $ hg status $ ls foo $ hg cat -r . bar bar bar2 Test merging things outside of the sparse checkout that are not in the working copy $ hg strip -q -r . --config extensions.strip= $ hg up -q feature $ touch branchonly $ hg ci -Aqm 'add branchonly' $ hg up -q default $ hg debugsparse -X branchonly $ hg merge feature temporarily included 2 file(s) in the sparse checkout for merging 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) mercurial-4.5.3/tests/test-arbitraryfilectx.t0000644015407300116100000000506313261161234021263 0ustar augieeng00000000000000Setup: $ cat > eval.py < from __future__ import absolute_import > import filecmp > from mercurial import commands, context, registrar > cmdtable = {} > command = registrar.command(cmdtable) > @command(b'eval', [], 'hg eval CMD') > def eval_(ui, repo, *cmds, **opts): > cmd = " ".join(cmds) > res = str(eval(cmd, globals(), locals())) > ui.warn("%s" % res) > EOF $ echo "[extensions]" >> $HGRCPATH $ echo "eval=`pwd`/eval.py" >> $HGRCPATH Arbitraryfilectx.cmp does not follow symlinks: $ mkdir case1 $ cd case1 $ hg init #if symlink $ printf "A" > real_A $ printf "foo" > A $ printf "foo" > B $ ln -s A sym_A $ hg add . adding A adding B adding real_A adding sym_A $ hg commit -m "base" #else $ hg import -q --bypass - < # HG changeset patch > # User test > # Date 0 0 > base > > diff --git a/A b/A > new file mode 100644 > --- /dev/null > +++ b/A > @@ -0,0 +1,1 @@ > +foo > \ No newline at end of file > diff --git a/B b/B > new file mode 100644 > --- /dev/null > +++ b/B > @@ -0,0 +1,1 @@ > +foo > \ No newline at end of file > diff --git a/real_A b/real_A > new file mode 100644 > --- /dev/null > +++ b/real_A > @@ -0,0 +1,1 @@ > +A > \ No newline at end of file > diff --git a/sym_A b/sym_A > new file mode 120000 > --- /dev/null > +++ b/sym_A > @@ -0,0 +1,1 @@ > +A > \ No newline at end of file > EOF $ hg up -q #endif These files are different and should return True (different): (Note that filecmp.cmp's return semantics are inverted from ours, so we invert for simplicity): $ hg eval "context.arbitraryfilectx('A', repo).cmp(repo[None]['real_A'])" True (no-eol) $ hg eval "not filecmp.cmp('A', 'real_A')" True (no-eol) These files are identical and should return False (same): $ hg eval "context.arbitraryfilectx('A', repo).cmp(repo[None]['A'])" False (no-eol) $ hg eval "context.arbitraryfilectx('A', repo).cmp(repo[None]['B'])" False (no-eol) $ hg eval "not filecmp.cmp('A', 'B')" False (no-eol) This comparison should also return False, since A and sym_A are substantially the same in the eyes of ``filectx.cmp``, which looks at data only. $ hg eval "context.arbitraryfilectx('real_A', repo).cmp(repo[None]['sym_A'])" False (no-eol) A naive use of filecmp on those two would wrongly return True, since it follows the symlink to "A", which has different contents. #if symlink $ hg eval "not filecmp.cmp('real_A', 'sym_A')" True (no-eol) #else $ hg eval "not filecmp.cmp('real_A', 'sym_A')" False (no-eol) #endif mercurial-4.5.3/tests/test-convert-datesort.t0000644015407300116100000000675113261161234021215 0ustar augieeng00000000000000 $ cat >> $HGRCPATH < [extensions] > convert= > EOF $ hg init t $ cd t $ echo a >> a $ hg ci -Am a0 -d '1 0' adding a $ hg branch brancha marked working directory as branch brancha (branches are permanent and global, did you want a bookmark?) $ echo a >> a $ hg ci -m a1 -d '2 0' $ echo a >> a $ hg ci -m a2 -d '3 0' $ echo a >> a $ hg ci -m a3 -d '4 0' $ hg up -C 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg branch branchb marked working directory as branch branchb $ echo b >> b $ hg ci -Am b0 -d '6 0' adding b $ hg up -C brancha 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo a >> a $ hg ci -m a4 -d '5 0' $ echo a >> a $ hg ci -m a5 -d '7 0' $ echo a >> a $ hg ci -m a6 -d '8 0' $ hg up -C branchb 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo b >> b $ hg ci -m b1 -d '9 0' $ hg up -C 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo c >> c $ hg branch branchc marked working directory as branch branchc $ hg ci -Am c0 -d '10 0' adding c $ hg up -C brancha 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg ci --close-branch -m a7x -d '11 0' $ hg up -C branchb 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg ci --close-branch -m b2x -d '12 0' $ hg up -C branchc 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg merge branchb 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m c1 -d '13 0' $ cd .. convert with datesort $ hg convert --datesort t t-datesort initializing destination t-datesort repository scanning source... sorting... converting... 12 a0 11 a1 10 a2 9 a3 8 a4 7 b0 6 a5 5 a6 4 b1 3 c0 2 a7x 1 b2x 0 c1 graph converted repo $ hg -R t-datesort log -G --template '{rev} "{desc}"\n' o 12 "c1" |\ | _ 11 "b2x" | | | | _ 10 "a7x" | | | o | | 9 "c0" | | | | o | 8 "b1" | | | | | o 7 "a6" | | | | | o 6 "a5" | | | | o | 5 "b0" |/ / | o 4 "a4" | | | o 3 "a3" | | | o 2 "a2" | | | o 1 "a1" |/ o 0 "a0" convert with datesort (default mode) $ hg convert t t-sourcesort initializing destination t-sourcesort repository scanning source... sorting... converting... 12 a0 11 a1 10 a2 9 a3 8 b0 7 a4 6 a5 5 a6 4 b1 3 c0 2 a7x 1 b2x 0 c1 graph converted repo $ hg -R t-sourcesort log -G --template '{rev} "{desc}"\n' o 12 "c1" |\ | _ 11 "b2x" | | | | _ 10 "a7x" | | | o | | 9 "c0" | | | | o | 8 "b1" | | | | | o 7 "a6" | | | | | o 6 "a5" | | | | | o 5 "a4" | | | | o | 4 "b0" |/ / | o 3 "a3" | | | o 2 "a2" | | | o 1 "a1" |/ o 0 "a0" convert with closesort $ hg convert --closesort t t-closesort initializing destination t-closesort repository scanning source... sorting... converting... 12 a0 11 a1 10 a2 9 a3 8 b0 7 a4 6 a5 5 a6 4 a7x 3 b1 2 b2x 1 c0 0 c1 graph converted repo $ hg -R t-closesort log -G --template '{rev} "{desc}"\n' o 12 "c1" |\ | o 11 "c0" | | _ | 10 "b2x" | | o | 9 "b1" | | | | _ 8 "a7x" | | | | | o 7 "a6" | | | | | o 6 "a5" | | | | | o 5 "a4" | | | o | | 4 "b0" |/ / | o 3 "a3" | | | o 2 "a2" | | | o 1 "a1" |/ o 0 "a0" mercurial-4.5.3/tests/test-merge8.t0000644015407300116100000000132713261161234017073 0ustar augieeng00000000000000Test for changeset ba7c74081861 (update dirstate correctly for non-branchmerge updates) $ hg init a $ cd a $ echo a > a $ hg add a $ hg commit -m a $ cd .. $ hg clone a b updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd a $ hg mv a b $ hg commit -m move $ echo b >> b $ hg commit -m b $ cd ../b $ hg pull ../a pulling from ../a searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files new changesets e3c9b40284e1:772b37f1ca37 (run 'hg update' to get a working copy) $ hg update 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ cd .. mercurial-4.5.3/tests/test-mq-header-from.t0000644015407300116100000004737013261161234020520 0ustar augieeng00000000000000 $ echo "[extensions]" >> $HGRCPATH $ echo "mq=" >> $HGRCPATH $ echo "[diff]" >> $HGRCPATH $ echo "nodates=true" >> $HGRCPATH $ catlog() { > cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \ > -e "s/^\(# Parent \).*/\1/" > hg log --template "{rev}: {node|short} {desc} - {author}\n" > } $ runtest() { > echo ==== init > hg init a > cd a > hg qinit > > > echo ==== qnew -U > hg qnew -U 1.patch > catlog 1 > > echo ==== qref > echo "1" >1 > hg add > hg qref > catlog 1 > > echo ==== qref -u > hg qref -u mary > catlog 1 > > echo ==== qnew > hg qnew 2.patch > echo "2" >2 > hg add > hg qref > catlog 2 > > echo ==== qref -u > hg qref -u jane > catlog 2 > > > echo ==== qnew -U -m > hg qnew -U -m "Three" 3.patch > catlog 3 > > echo ==== qref > echo "3" >3 > hg add > hg qref > catlog 3 > > echo ==== qref -m > hg qref -m "Drei" > catlog 3 > > echo ==== qref -u > hg qref -u mary > catlog 3 > > echo ==== qref -u -m > hg qref -u maria -m "Three (again)" > catlog 3 > > echo ==== qnew -m > hg qnew -m "Four" 4.patch > echo "4" >4of t > hg add > hg qref > catlog 4 > > echo ==== qref -u > hg qref -u jane > catlog 4 > > > echo ==== qnew with HG header > hg qnew --config 'mq.plain=true' 5.patch > hg qpop > echo "# HG changeset patch" >>.hg/patches/5.patch > echo "# User johndoe" >>.hg/patches/5.patch > hg qpush 2>&1 | grep 'now at' > catlog 5 > > echo ==== hg qref > echo "5" >5 > hg add > hg qref > catlog 5 > > echo ==== hg qref -U > hg qref -U > catlog 5 > > echo ==== hg qref -u > hg qref -u johndeere > catlog 5 > > > echo ==== qnew with plain header > hg qnew --config 'mq.plain=true' -U 6.patch > hg qpop > hg qpush 2>&1 | grep 'now at' > catlog 6 > > echo ==== hg qref > echo "6" >6 > hg add > hg qref > catlog 6 > > echo ==== hg qref -U > hg qref -U > catlog 6 > > echo ==== hg qref -u > hg qref -u johndeere > catlog 6 > > > echo ==== "qpop -a / qpush -a" > hg qpop -a > hg qpush -a > hg log --template "{rev}: {node|short} {desc} - {author}\n" > } ======= plain headers $ echo "[mq]" >> $HGRCPATH $ echo "plain=true" >> $HGRCPATH $ mkdir sandbox $ (cd sandbox ; runtest) ==== init ==== qnew -U From: test 0: a054644889e5 [mq]: 1.patch - test ==== qref adding 1 From: test diff -r ... 1 --- /dev/null +++ b/1 @@ -0,0 +1,1 @@ +1 0: 2905f1e46ee0 [mq]: 1.patch - test ==== qref -u From: mary diff -r ... 1 --- /dev/null +++ b/1 @@ -0,0 +1,1 @@ +1 0: 3682f830e656 [mq]: 1.patch - mary ==== qnew adding 2 diff -r ... 2 --- /dev/null +++ b/2 @@ -0,0 +1,1 @@ +2 1: 527f98a12a7a [mq]: 2.patch - test 0: 3682f830e656 [mq]: 1.patch - mary ==== qref -u From: jane diff -r ... 2 --- /dev/null +++ b/2 @@ -0,0 +1,1 @@ +2 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qnew -U -m From: test Three 2: 0ffa16a9088e Three - test 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qref adding 3 From: test Three diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 2: 83f1290c6086 Three - test 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qref -m From: test Drei diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 2: b0d856328d4d Drei - test 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qref -u From: mary Drei diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 2: bb9d4b28e6a6 Drei - mary 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qref -u -m From: maria Three (again) diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qnew -m adding 4of Four diff -r ... 4of --- /dev/null +++ b/4of @@ -0,0 +1,1 @@ +4 t 3: b9f922d0da40 Four - test 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qref -u From: jane Four diff -r ... 4of --- /dev/null +++ b/4of @@ -0,0 +1,1 @@ +4 t 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qnew with HG header popping 5.patch now at: 4.patch now at: 5.patch # HG changeset patch # User johndoe 4: 72bc4a0467ef imported patch 5.patch - johndoe 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref adding 5 # HG changeset patch # User johndoe # Parent diff -r ... 5 --- /dev/null +++ b/5 @@ -0,0 +1,1 @@ +5 4: ff5c06112e5a [mq]: 5.patch - johndoe 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref -U # HG changeset patch # User test # Parent diff -r ... 5 --- /dev/null +++ b/5 @@ -0,0 +1,1 @@ +5 4: c947416c22b1 [mq]: 5.patch - test 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref -u # HG changeset patch # User johndeere # Parent diff -r ... 5 --- /dev/null +++ b/5 @@ -0,0 +1,1 @@ +5 4: 1d898e201a22 [mq]: 5.patch - johndeere 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qnew with plain header popping 6.patch now at: 5.patch now at: 6.patch From: test 5: 7825a18ec839 imported patch 6.patch - test 4: 1d898e201a22 [mq]: 5.patch - johndeere 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref adding 6 From: test diff -r ... 6 --- /dev/null +++ b/6 @@ -0,0 +1,1 @@ +6 5: 09d19592680d [mq]: 6.patch - test 4: 1d898e201a22 [mq]: 5.patch - johndeere 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref -U From: test diff -r ... 6 --- /dev/null +++ b/6 @@ -0,0 +1,1 @@ +6 5: 09d19592680d [mq]: 6.patch - test 4: 1d898e201a22 [mq]: 5.patch - johndeere 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref -u From: johndeere diff -r ... 6 --- /dev/null +++ b/6 @@ -0,0 +1,1 @@ +6 5: 32641ee07196 [mq]: 6.patch - johndeere 4: 1d898e201a22 [mq]: 5.patch - johndeere 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qpop -a / qpush -a popping 6.patch popping 5.patch popping 4.patch popping 3.patch popping 2.patch popping 1.patch patch queue now empty applying 1.patch applying 2.patch applying 3.patch applying 4.patch applying 5.patch applying 6.patch now at: 6.patch 5: 1fb083c80457 imported patch 6.patch - johndeere 4: 7e96e969691d imported patch 5.patch - johndeere 3: c7147533d3cd Four - jane 2: b383d04401ea Three (again) - maria 1: fac2da4efc3c imported patch 2.patch - jane 0: b6e237e8771b imported patch 1.patch - mary $ rm -r sandbox ======= hg headers $ echo "plain=false" >> $HGRCPATH $ mkdir sandbox $ (cd sandbox ; runtest) ==== init ==== qnew -U # HG changeset patch # User test # Parent 0: a054644889e5 [mq]: 1.patch - test ==== qref adding 1 # HG changeset patch # User test # Parent diff -r ... 1 --- /dev/null +++ b/1 @@ -0,0 +1,1 @@ +1 0: 2905f1e46ee0 [mq]: 1.patch - test ==== qref -u # HG changeset patch # User mary # Parent diff -r ... 1 --- /dev/null +++ b/1 @@ -0,0 +1,1 @@ +1 0: 3682f830e656 [mq]: 1.patch - mary ==== qnew adding 2 # HG changeset patch # Parent diff -r ... 2 --- /dev/null +++ b/2 @@ -0,0 +1,1 @@ +2 1: 527f98a12a7a [mq]: 2.patch - test 0: 3682f830e656 [mq]: 1.patch - mary ==== qref -u # HG changeset patch # User jane # Parent diff -r ... 2 --- /dev/null +++ b/2 @@ -0,0 +1,1 @@ +2 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qnew -U -m # HG changeset patch # User test # Parent Three 2: 0ffa16a9088e Three - test 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qref adding 3 # HG changeset patch # User test # Parent Three diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 2: 83f1290c6086 Three - test 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qref -m # HG changeset patch # User test # Parent Drei diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 2: b0d856328d4d Drei - test 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qref -u # HG changeset patch # User mary # Parent Drei diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 2: bb9d4b28e6a6 Drei - mary 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qref -u -m # HG changeset patch # User maria # Parent Three (again) diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qnew -m adding 4of # HG changeset patch # Parent Four diff -r ... 4of --- /dev/null +++ b/4of @@ -0,0 +1,1 @@ +4 t 3: b9f922d0da40 Four - test 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qref -u # HG changeset patch # User jane # Parent Four diff -r ... 4of --- /dev/null +++ b/4of @@ -0,0 +1,1 @@ +4 t 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qnew with HG header popping 5.patch now at: 4.patch now at: 5.patch # HG changeset patch # User johndoe 4: 72bc4a0467ef imported patch 5.patch - johndoe 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref adding 5 # HG changeset patch # User johndoe # Parent diff -r ... 5 --- /dev/null +++ b/5 @@ -0,0 +1,1 @@ +5 4: ff5c06112e5a [mq]: 5.patch - johndoe 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref -U # HG changeset patch # User test # Parent diff -r ... 5 --- /dev/null +++ b/5 @@ -0,0 +1,1 @@ +5 4: c947416c22b1 [mq]: 5.patch - test 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref -u # HG changeset patch # User johndeere # Parent diff -r ... 5 --- /dev/null +++ b/5 @@ -0,0 +1,1 @@ +5 4: 1d898e201a22 [mq]: 5.patch - johndeere 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qnew with plain header popping 6.patch now at: 5.patch now at: 6.patch From: test 5: 7825a18ec839 imported patch 6.patch - test 4: 1d898e201a22 [mq]: 5.patch - johndeere 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref adding 6 From: test diff -r ... 6 --- /dev/null +++ b/6 @@ -0,0 +1,1 @@ +6 5: 09d19592680d [mq]: 6.patch - test 4: 1d898e201a22 [mq]: 5.patch - johndeere 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref -U From: test diff -r ... 6 --- /dev/null +++ b/6 @@ -0,0 +1,1 @@ +6 5: 09d19592680d [mq]: 6.patch - test 4: 1d898e201a22 [mq]: 5.patch - johndeere 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref -u From: johndeere diff -r ... 6 --- /dev/null +++ b/6 @@ -0,0 +1,1 @@ +6 5: 32641ee07196 [mq]: 6.patch - johndeere 4: 1d898e201a22 [mq]: 5.patch - johndeere 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qpop -a / qpush -a popping 6.patch popping 5.patch popping 4.patch popping 3.patch popping 2.patch popping 1.patch patch queue now empty applying 1.patch applying 2.patch applying 3.patch applying 4.patch applying 5.patch applying 6.patch now at: 6.patch 5: 1fb083c80457 imported patch 6.patch - johndeere 4: 7e96e969691d imported patch 5.patch - johndeere 3: c7147533d3cd Four - jane 2: b383d04401ea Three (again) - maria 1: fac2da4efc3c imported patch 2.patch - jane 0: b6e237e8771b imported patch 1.patch - mary $ rm -r sandbox $ runtest ==== init ==== qnew -U # HG changeset patch # User test # Parent 0: a054644889e5 [mq]: 1.patch - test ==== qref adding 1 # HG changeset patch # User test # Parent diff -r ... 1 --- /dev/null +++ b/1 @@ -0,0 +1,1 @@ +1 0: 2905f1e46ee0 [mq]: 1.patch - test ==== qref -u # HG changeset patch # User mary # Parent diff -r ... 1 --- /dev/null +++ b/1 @@ -0,0 +1,1 @@ +1 0: 3682f830e656 [mq]: 1.patch - mary ==== qnew adding 2 # HG changeset patch # Parent diff -r ... 2 --- /dev/null +++ b/2 @@ -0,0 +1,1 @@ +2 1: 527f98a12a7a [mq]: 2.patch - test 0: 3682f830e656 [mq]: 1.patch - mary ==== qref -u # HG changeset patch # User jane # Parent diff -r ... 2 --- /dev/null +++ b/2 @@ -0,0 +1,1 @@ +2 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qnew -U -m # HG changeset patch # User test # Parent Three 2: 0ffa16a9088e Three - test 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qref adding 3 # HG changeset patch # User test # Parent Three diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 2: 83f1290c6086 Three - test 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qref -m # HG changeset patch # User test # Parent Drei diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 2: b0d856328d4d Drei - test 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qref -u # HG changeset patch # User mary # Parent Drei diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 2: bb9d4b28e6a6 Drei - mary 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qref -u -m # HG changeset patch # User maria # Parent Three (again) diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qnew -m adding 4of # HG changeset patch # Parent Four diff -r ... 4of --- /dev/null +++ b/4of @@ -0,0 +1,1 @@ +4 t 3: b9f922d0da40 Four - test 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qref -u # HG changeset patch # User jane # Parent Four diff -r ... 4of --- /dev/null +++ b/4of @@ -0,0 +1,1 @@ +4 t 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qnew with HG header popping 5.patch now at: 4.patch now at: 5.patch # HG changeset patch # User johndoe 4: 72bc4a0467ef imported patch 5.patch - johndoe 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref adding 5 # HG changeset patch # User johndoe # Parent diff -r ... 5 --- /dev/null +++ b/5 @@ -0,0 +1,1 @@ +5 4: ff5c06112e5a [mq]: 5.patch - johndoe 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref -U # HG changeset patch # User test # Parent diff -r ... 5 --- /dev/null +++ b/5 @@ -0,0 +1,1 @@ +5 4: c947416c22b1 [mq]: 5.patch - test 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref -u # HG changeset patch # User johndeere # Parent diff -r ... 5 --- /dev/null +++ b/5 @@ -0,0 +1,1 @@ +5 4: 1d898e201a22 [mq]: 5.patch - johndeere 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qnew with plain header popping 6.patch now at: 5.patch now at: 6.patch From: test 5: 7825a18ec839 imported patch 6.patch - test 4: 1d898e201a22 [mq]: 5.patch - johndeere 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref adding 6 From: test diff -r ... 6 --- /dev/null +++ b/6 @@ -0,0 +1,1 @@ +6 5: 09d19592680d [mq]: 6.patch - test 4: 1d898e201a22 [mq]: 5.patch - johndeere 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref -U From: test diff -r ... 6 --- /dev/null +++ b/6 @@ -0,0 +1,1 @@ +6 5: 09d19592680d [mq]: 6.patch - test 4: 1d898e201a22 [mq]: 5.patch - johndeere 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== hg qref -u From: johndeere diff -r ... 6 --- /dev/null +++ b/6 @@ -0,0 +1,1 @@ +6 5: 32641ee07196 [mq]: 6.patch - johndeere 4: 1d898e201a22 [mq]: 5.patch - johndeere 3: 0dfb3111e7ee Four - jane 2: a6686ee84fc3 Three (again) - maria 1: a425cde5f493 [mq]: 2.patch - jane 0: 3682f830e656 [mq]: 1.patch - mary ==== qpop -a / qpush -a popping 6.patch popping 5.patch popping 4.patch popping 3.patch popping 2.patch popping 1.patch patch queue now empty applying 1.patch applying 2.patch applying 3.patch applying 4.patch applying 5.patch applying 6.patch now at: 6.patch 5: 1fb083c80457 imported patch 6.patch - johndeere 4: 7e96e969691d imported patch 5.patch - johndeere 3: c7147533d3cd Four - jane 2: b383d04401ea Three (again) - maria 1: fac2da4efc3c imported patch 2.patch - jane 0: b6e237e8771b imported patch 1.patch - mary $ cd .. mercurial-4.5.3/tests/test-debugrename.t0000644015407300116100000000056313261161234020163 0ustar augieeng00000000000000 $ hg init $ echo a > a $ hg ci -Am t adding a $ hg mv a b $ hg ci -Am t1 $ hg debugrename b b renamed from a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 $ hg mv b a $ hg ci -Am t2 $ hg debugrename a a renamed from b:37d9b5d994eab34eda9c16b195ace52c7b129980 $ hg debugrename --rev 1 b b renamed from a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 mercurial-4.5.3/tests/dummyssh0000755015407300116100000000112013261161234016330 0ustar augieeng00000000000000#!/usr/bin/env python from __future__ import absolute_import import os import sys os.chdir(os.getenv('TESTTMP')) if sys.argv[1] != "user@dummy": sys.exit(-1) os.environ["SSH_CLIENT"] = "%s 1 2" % os.environ.get('LOCALIP', '127.0.0.1') log = open("dummylog", "ab") log.write(b"Got arguments") for i, arg in enumerate(sys.argv[1:]): log.write(b" %d:%s" % (i + 1, arg)) log.write("\n") log.close() hgcmd = sys.argv[2] if os.name == 'nt': # hack to make simple unix single quote quoting work on windows hgcmd = hgcmd.replace("'", '"') r = os.system(hgcmd) sys.exit(bool(r)) mercurial-4.5.3/tests/test-releasenotes-formatting.t0000644015407300116100000002026013261161234022542 0ustar augieeng00000000000000#require fuzzywuzzy $ cat >> $HGRCPATH << EOF > [extensions] > releasenotes= > EOF $ hg init simple-repo $ cd simple-repo A fix with a single line results in a bullet point in the appropriate section $ touch fix1 $ hg -q commit -A -l - << EOF > single line fix > > .. fix:: > > Simple fix with a single line content entry. > EOF $ hg releasenotes -r . $TESTTMP/relnotes-single-line $ cat $TESTTMP/relnotes-single-line Bug Fixes ========= * Simple fix with a single line content entry. A fix with multiple lines is handled correctly $ touch fix2 $ hg -q commit -A -l - << EOF > multi line fix > > .. fix:: > > First line of fix entry. > A line after it without a space. > > A new paragraph in the fix entry. And this is a really long line. It goes on for a while. > And it wraps around to a new paragraph. > EOF $ hg releasenotes -r . $TESTTMP/relnotes-multi-line $ cat $TESTTMP/relnotes-multi-line Bug Fixes ========= * First line of fix entry. A line after it without a space. A new paragraph in the fix entry. And this is a really long line. It goes on for a while. And it wraps around to a new paragraph. A release note with a title results in a sub-section being written $ touch fix3 $ hg -q commit -A -l - << EOF > fix with title > > .. fix:: Fix Title > > First line of fix with title. > > Another paragraph of fix with title. But this is a paragraph > with multiple lines. > EOF $ hg releasenotes -r . $TESTTMP/relnotes-fix-with-title $ cat $TESTTMP/relnotes-fix-with-title Bug Fixes ========= Fix Title --------- First line of fix with title. Another paragraph of fix with title. But this is a paragraph with multiple lines. $ cd .. Formatting of multiple bullet points works $ hg init multiple-bullets $ cd multiple-bullets $ touch fix1 $ hg -q commit -A -l - << EOF > commit 1 > > .. fix:: > > first fix > EOF $ touch fix2 $ hg -q commit -A -l - << EOF > commit 2 > > .. fix:: > > second fix > > Second paragraph of second fix. > EOF $ touch fix3 $ hg -q commit -A -l - << EOF > commit 3 > > .. fix:: > > third fix > EOF $ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-bullets $ cat $TESTTMP/relnotes-multiple-bullets Bug Fixes ========= * first fix * second fix Second paragraph of second fix. * third fix $ cd .. Formatting of multiple sections works $ hg init multiple-sections $ cd multiple-sections $ touch fix1 $ hg -q commit -A -l - << EOF > commit 1 > > .. fix:: > > first fix > EOF $ touch feature1 $ hg -q commit -A -l - << EOF > commit 2 > > .. feature:: > > description of the new feature > EOF $ touch fix2 $ hg -q commit -A -l - << EOF > commit 3 > > .. fix:: > > second fix > EOF $ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-sections $ cat $TESTTMP/relnotes-multiple-sections New Features ============ * description of the new feature Bug Fixes ========= * first fix * second fix $ cd .. Section with subsections and bullets $ hg init multiple-subsections $ cd multiple-subsections $ touch fix1 $ hg -q commit -A -l - << EOF > commit 1 > > .. fix:: Title of First Fix > > First paragraph of first fix. > > Second paragraph of first fix. > EOF $ touch fix2 $ hg -q commit -A -l - << EOF > commit 2 > > .. fix:: Title of Second Fix > > First paragraph of second fix. > > Second paragraph of second fix. > EOF $ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-subsections $ cat $TESTTMP/relnotes-multiple-subsections Bug Fixes ========= Title of First Fix ------------------ First paragraph of first fix. Second paragraph of first fix. Title of Second Fix ------------------- First paragraph of second fix. Second paragraph of second fix. Now add bullet points to sections having sub-sections $ touch fix3 $ hg -q commit -A -l - << EOF > commit 3 > > .. fix:: > > Short summary of fix 3 > EOF $ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-subsections-with-bullets $ cat $TESTTMP/relnotes-multiple-subsections-with-bullets Bug Fixes ========= Title of First Fix ------------------ First paragraph of first fix. Second paragraph of first fix. Title of Second Fix ------------------- First paragraph of second fix. Second paragraph of second fix. Other Changes ------------- * Short summary of fix 3 $ cd .. Multiple 'Other Changes' sub-sections for every section $ hg init multiple-otherchanges $ cd multiple-otherchanges $ touch fix1 $ hg -q commit -A -l - << EOF > commit 1 > > .. fix:: Title of First Fix > > First paragraph of fix 1. > EOF $ touch feature1 $ hg -q commit -A -l - << EOF > commit 2 > > .. feature:: Title of First Feature > > First paragraph of feature 1. > EOF $ touch feature2 $ hg -q commit -A -l - << EOF > commit 3 > > .. feature:: > > Short summary of feature 2. > EOF $ touch fix2 $ hg -q commit -A -l - << EOF > commit 4 > > .. fix:: > > Short summary of fix 2 > EOF $ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-otherchanges $ cat $TESTTMP/relnotes-multiple-otherchanges New Features ============ Title of First Feature ---------------------- First paragraph of feature 1. Other Changes ------------- * Short summary of feature 2. Bug Fixes ========= Title of First Fix ------------------ First paragraph of fix 1. Other Changes ------------- * Short summary of fix 2 $ cd .. Using custom sections in notes $ hg init custom-section $ cd custom-section $ cat >> .hgreleasenotes << EOF > [sections] > testsection=Name of Section > EOF $ touch a $ hg -q commit -A -l - << EOF > commit 1 > > .. testsection:: > > First paragraph under this admonition. > EOF $ hg releasenotes -r . $TESTTMP/relnotes-custom-section $ cat $TESTTMP/relnotes-custom-section Name of Section =============== * First paragraph under this admonition. Overriding default sections (For eg. by default feature = New Features) $ cat >> .hgreleasenotes << EOF > [sections] > feature=Feature Additions > EOF $ touch b $ hg -q commit -A -l - << EOF > commit 2 > > .. feature:: > > Adds a new feature. > EOF $ hg releasenotes -r . $TESTTMP/relnotes-override-section $ cat $TESTTMP/relnotes-override-section Feature Additions ================= * Adds a new feature. $ cd .. Testing output for the --check (-c) flag $ hg init check-flag $ cd check-flag $ touch a $ hg -q commit -A -l - << EOF > .. asf:: > > First paragraph under this admonition. > EOF Suggest similar admonition in place of the invalid one. $ hg releasenotes -r . -c Invalid admonition 'asf' present in changeset 4026fe9e1c20 $ touch b $ hg -q commit -A -l - << EOF > .. fixes:: > > First paragraph under this admonition. > EOF $ hg releasenotes -r . -c Invalid admonition 'fixes' present in changeset 0e7130d2705c (did you mean fix?) $ cd .. Usage of --list flag $ hg init relnotes-list $ cd relnotes-list $ hg releasenotes -l feature: New Features bc: Backwards Compatibility Changes fix: Bug Fixes perf: Performance Improvements api: API Changes $ cd .. Raise error on simultaneous usage of flags $ hg init relnotes-raise-error $ cd relnotes-raise-error $ hg releasenotes -r . -l abort: cannot use both '--list' and '--rev' [255] $ hg releasenotes -l -c abort: cannot use both '--list' and '--check' [255] Display release notes for specified revs if no file is mentioned $ hg init relnotes-nofile $ cd relnotes-nofile $ touch fix1 $ hg -q commit -A -l - << EOF > commit 1 > > .. fix:: Title of First Fix > > First paragraph of fix 1. > EOF $ hg releasenote -r . Bug Fixes ========= Title of First Fix ------------------ First paragraph of fix 1. mercurial-4.5.3/tests/test-sparse-profiles.t0000644015407300116100000001267713261161234021034 0ustar augieeng00000000000000test sparse $ hg init myrepo $ cd myrepo $ cat > .hg/hgrc < [extensions] > sparse= > purge= > strip= > rebase= > EOF Config file without [section] is rejected $ cat > bad.sparse < *.html > EOF $ hg debugsparse --import-rules bad.sparse abort: sparse config entry outside of section: *.html (add an [include] or [exclude] line to declare the entry type) [255] $ rm bad.sparse $ echo a > index.html $ echo x > data.py $ echo z > readme.txt $ cat > webpage.sparse < # frontend sparse profile > [include] > *.html > EOF $ cat > backend.sparse < # backend sparse profile > [include] > *.py > EOF $ hg ci -Aqm 'initial' $ hg debugsparse --include '*.sparse' Verify enabling a single profile works $ hg debugsparse --enable-profile webpage.sparse $ ls backend.sparse index.html webpage.sparse Verify enabling two profiles works $ hg debugsparse --enable-profile backend.sparse $ ls backend.sparse data.py index.html webpage.sparse Verify disabling a profile works $ hg debugsparse --disable-profile webpage.sparse $ ls backend.sparse data.py webpage.sparse Verify that a profile is updated across multiple commits $ cat > webpage.sparse < # frontend sparse profile > [include] > *.html > EOF $ cat > backend.sparse < # backend sparse profile > [include] > *.py > *.txt > EOF $ echo foo >> data.py $ hg ci -m 'edit profile' $ ls backend.sparse data.py readme.txt webpage.sparse $ hg up -q 0 $ ls backend.sparse data.py webpage.sparse $ hg up -q 1 $ ls backend.sparse data.py readme.txt webpage.sparse Introduce a conflicting .hgsparse change $ hg up -q 0 $ cat > backend.sparse < # Different backend sparse profile > [include] > *.html > EOF $ echo bar >> data.py $ hg ci -qAm "edit profile other" $ ls backend.sparse index.html webpage.sparse Verify conflicting merge pulls in the conflicting changes $ hg merge 1 temporarily included 1 file(s) in the sparse checkout for merging merging backend.sparse merging data.py warning: conflicts while merging backend.sparse! (edit, then use 'hg resolve --mark') warning: conflicts while merging data.py! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 2 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ rm *.orig $ ls backend.sparse data.py index.html webpage.sparse Verify resolving the merge removes the temporarily unioned files $ cat > backend.sparse < # backend sparse profile > [include] > *.html > *.txt > EOF $ hg resolve -m backend.sparse $ cat > data.py < x > foo > bar > EOF $ hg resolve -m data.py (no more unresolved files) $ hg ci -qAm "merge profiles" $ ls backend.sparse index.html readme.txt webpage.sparse $ hg cat -r . data.py x foo bar Verify stripping refreshes dirstate $ hg strip -q -r . $ ls backend.sparse index.html webpage.sparse Verify rebase conflicts pulls in the conflicting changes $ hg up -q 1 $ ls backend.sparse data.py readme.txt webpage.sparse $ hg rebase -d 2 rebasing 1:a2b1de640a62 "edit profile" temporarily included 1 file(s) in the sparse checkout for merging merging backend.sparse merging data.py warning: conflicts while merging backend.sparse! (edit, then use 'hg resolve --mark') warning: conflicts while merging data.py! (edit, then use 'hg resolve --mark') unresolved conflicts (see hg resolve, then hg rebase --continue) [1] $ rm *.orig $ ls backend.sparse data.py index.html webpage.sparse Verify resolving conflict removes the temporary files $ cat > backend.sparse < [include] > *.html > *.txt > EOF $ hg resolve -m backend.sparse $ cat > data.py < x > foo > bar > EOF $ hg resolve -m data.py (no more unresolved files) continue: hg rebase --continue $ hg rebase -q --continue $ ls backend.sparse index.html readme.txt webpage.sparse $ hg cat -r . data.py x foo bar Test checking out a commit that does not contain the sparse profile. The warning message can be suppressed by setting missingwarning = false in [sparse] section of your config: $ hg debugsparse --reset $ hg rm *.sparse $ hg commit -m "delete profiles" $ hg up -q ".^" $ hg debugsparse --enable-profile backend.sparse $ ls index.html readme.txt $ hg up tip | grep warning warning: sparse profile 'backend.sparse' not found in rev bfcb76de99cc - ignoring it [1] $ ls data.py index.html readme.txt $ hg debugsparse --disable-profile backend.sparse | grep warning warning: sparse profile 'backend.sparse' not found in rev bfcb76de99cc - ignoring it [1] $ cat >> .hg/hgrc < [sparse] > missingwarning = false > EOF $ hg debugsparse --enable-profile backend.sparse $ cd .. #if unix-permissions Test file permissions changing across a sparse profile change $ hg init sparseperm $ cd sparseperm $ cat > .hg/hgrc < [extensions] > sparse= > EOF $ touch a b $ cat > .hgsparse < [include] > a > EOF $ hg commit -Aqm 'initial' $ chmod a+x b $ hg commit -qm 'make executable' $ cat >> .hgsparse < b > EOF $ hg commit -qm 'update profile' $ hg up -q 0 $ hg debugsparse --enable-profile .hgsparse $ hg up -q 2 $ ls -l b -rwxr-xr-x* b (glob) #endif mercurial-4.5.3/tests/test-histedit-obsolete.t0000644015407300116100000003661513261161234021343 0ustar augieeng00000000000000 $ . "$TESTDIR/histedit-helpers.sh" Enable obsolete $ cat >> $HGRCPATH << EOF > [ui] > logtemplate= {rev}:{node|short} {desc|firstline} > [phases] > publish=False > [experimental] > evolution.createmarkers=True > evolution.allowunstable=True > [extensions] > histedit= > rebase= > EOF Test that histedit learns about obsolescence not stored in histedit state $ hg init boo $ cd boo $ echo a > a $ hg ci -Am a adding a $ echo a > b $ echo a > c $ echo a > c $ hg ci -Am b adding b adding c $ echo a > d $ hg ci -Am c adding d $ echo "pick `hg log -r 0 -T '{node|short}'`" > plan $ echo "pick `hg log -r 2 -T '{node|short}'`" >> plan $ echo "edit `hg log -r 1 -T '{node|short}'`" >> plan $ hg histedit -r 'all()' --commands plan Editing (1b2d564fad96), you may commit or record as needed now. (hg histedit --continue to resume) [1] $ hg st A b A c ? plan $ hg commit --amend b $ hg histedit --continue $ hg log -G @ 5:46abc7c4d873 b | o 4:49d44ab2be1b c | o 0:cb9a9f314b8b a $ hg debugobsolete e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf 49d44ab2be1b67a79127568a67c9c99430633b48 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'} 1b2d564fad96311b45362f17c2aa855150efb35f 46abc7c4d8738e8563e577f7889e1b6db3da4199 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '12', 'operation': 'histedit', 'user': 'test'} 114f4176969ef342759a8a57e6bccefc4234829b 49d44ab2be1b67a79127568a67c9c99430633b48 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '12', 'operation': 'histedit', 'user': 'test'} With some node gone missing during the edit. $ echo "pick `hg log -r 0 -T '{node|short}'`" > plan $ echo "pick `hg log -r 5 -T '{node|short}'`" >> plan $ echo "edit `hg log -r 4 -T '{node|short}'`" >> plan $ hg histedit -r 'all()' --commands plan Editing (49d44ab2be1b), you may commit or record as needed now. (hg histedit --continue to resume) [1] $ hg st A b A d ? plan $ hg commit --amend -X . -m XXXXXX $ hg commit --amend -X . -m b2 $ hg --hidden --config extensions.strip= strip 'desc(XXXXXX)' --no-backup warning: ignoring unknown working parent aba7da937030! $ hg histedit --continue $ hg log -G @ 8:273c1f3b8626 c | o 7:aba7da937030 b2 | o 0:cb9a9f314b8b a $ hg debugobsolete e72d22b19f8ecf4150ab4f91d0973fd9955d3ddf 49d44ab2be1b67a79127568a67c9c99430633b48 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'} 1b2d564fad96311b45362f17c2aa855150efb35f 46abc7c4d8738e8563e577f7889e1b6db3da4199 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '12', 'operation': 'histedit', 'user': 'test'} 114f4176969ef342759a8a57e6bccefc4234829b 49d44ab2be1b67a79127568a67c9c99430633b48 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '12', 'operation': 'histedit', 'user': 'test'} 76f72745eac0643d16530e56e2f86e36e40631f1 2ca853e48edbd6453a0674dc0fe28a0974c51b9c 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'} 2ca853e48edbd6453a0674dc0fe28a0974c51b9c aba7da93703075eec9fb1dbaf143ff2bc1c49d46 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'} 49d44ab2be1b67a79127568a67c9c99430633b48 273c1f3b86267ed3ec684bb13af1fa4d6ba56e02 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'histedit', 'user': 'test'} 46abc7c4d8738e8563e577f7889e1b6db3da4199 aba7da93703075eec9fb1dbaf143ff2bc1c49d46 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '5', 'operation': 'histedit', 'user': 'test'} $ cd .. Base setup for the rest of the testing ====================================== $ hg init base $ cd base $ for x in a b c d e f ; do > echo $x > $x > hg add $x > hg ci -m $x > done $ hg log --graph @ 5:652413bf663e f | o 4:e860deea161a e | o 3:055a42cdd887 d | o 2:177f92b77385 c | o 1:d2ae7f538514 b | o 0:cb9a9f314b8b a $ HGEDITOR=cat hg histedit 1 pick d2ae7f538514 1 b pick 177f92b77385 2 c pick 055a42cdd887 3 d pick e860deea161a 4 e pick 652413bf663e 5 f # Edit history between d2ae7f538514 and 652413bf663e # # Commits are listed from least to most recent # # You can reorder changesets by reordering the lines # # Commands: # # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date # $ hg histedit 1 --commands - --verbose < pick 177f92b77385 2 c > drop d2ae7f538514 1 b > pick 055a42cdd887 3 d > fold e860deea161a 4 e > pick 652413bf663e 5 f > EOF [1] $ hg log --graph --hidden @ 10:cacdfd884a93 f | o 9:59d9f330561f d | | x 8:b558abc46d09 fold-temp-revision e860deea161a | | | x 7:96e494a2d553 d |/ o 6:b346ab9a313d c | | x 5:652413bf663e f | | | x 4:e860deea161a e | | | x 3:055a42cdd887 d | | | x 2:177f92b77385 c | | | x 1:d2ae7f538514 b |/ o 0:cb9a9f314b8b a $ hg debugobsolete d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'histedit', 'user': 'test'} 177f92b773850b59254aa5e923436f921b55483b b346ab9a313db8537ecf96fca3ca3ca984ef3bd7 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'histedit', 'user': 'test'} 055a42cdd88768532f9cf79daa407fc8d138de9b 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'histedit', 'user': 'test'} e860deea161a2f77de56603b340ebbb4536308ae 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'histedit', 'user': 'test'} 652413bf663ef2a641cab26574e46d5f5a64a55a cacdfd884a9321ec4e1de275ef3949fa953a1f83 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'histedit', 'user': 'test'} 96e494a2d553dd05902ba1cee1d94d4cb7b8faed 0 {b346ab9a313db8537ecf96fca3ca3ca984ef3bd7} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'histedit', 'user': 'test'} b558abc46d09c30f57ac31e85a8a3d64d2e906e4 0 {96e494a2d553dd05902ba1cee1d94d4cb7b8faed} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'histedit', 'user': 'test'} Ensure hidden revision does not prevent histedit ------------------------------------------------- create an hidden revision $ hg histedit 6 --commands - << EOF > pick b346ab9a313d 6 c > drop 59d9f330561f 7 d > pick cacdfd884a93 8 f > EOF $ hg log --graph @ 11:c13eb81022ca f | o 6:b346ab9a313d c | o 0:cb9a9f314b8b a check hidden revision are ignored (6 have hidden children 7 and 8) $ hg histedit 6 --commands - << EOF > pick b346ab9a313d 6 c > pick c13eb81022ca 8 f > EOF Test that rewriting leaving instability behind is allowed --------------------------------------------------------------------- $ hg up '.^' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg log -r 'children(.)' 11:c13eb81022ca f (no-eol) $ hg histedit -r '.' --commands - < edit b346ab9a313d 6 c > EOF 0 files updated, 0 files merged, 1 files removed, 0 files unresolved adding c Editing (b346ab9a313d), you may commit or record as needed now. (hg histedit --continue to resume) [1] $ echo c >> c $ hg histedit --continue 1 new orphan changesets $ hg log -r 'orphan()' 11:c13eb81022ca f (no-eol) stabilise $ hg rebase -r 'orphan()' -d . rebasing 11:c13eb81022ca "f" $ hg up tip -q Test dropping of changeset on the top of the stack ------------------------------------------------------- Nothing is rewritten below, the working directory parent must be change for the dropped changeset to be hidden. $ cd .. $ hg clone base droplast updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd droplast $ hg histedit -r '40db8afa467b' --commands - << EOF > pick 40db8afa467b 10 c > drop b449568bf7fc 11 f > EOF $ hg log -G @ 12:40db8afa467b c | o 0:cb9a9f314b8b a With rewritten ancestors $ echo e > e $ hg add e $ hg commit -m g $ echo f > f $ hg add f $ hg commit -m h $ hg histedit -r '40db8afa467b' --commands - << EOF > pick 47a8561c0449 12 g > pick 40db8afa467b 10 c > drop 1b3b05f35ff0 13 h > EOF $ hg log -G @ 17:ee6544123ab8 c | o 16:269e713e9eae g | o 0:cb9a9f314b8b a $ cd ../base Test phases support =========================================== Check that histedit respect immutability ------------------------------------------- $ cat >> $HGRCPATH << EOF > [ui] > logtemplate= {rev}:{node|short} ({phase}) {desc|firstline}\n > EOF $ hg ph -pv '.^' phase changed for 2 changesets $ hg log -G @ 13:b449568bf7fc (draft) f | o 12:40db8afa467b (public) c | o 0:cb9a9f314b8b (public) a $ hg histedit -r '.~2' abort: cannot edit public changeset: cb9a9f314b8b (see 'hg help phases' for details) [255] Prepare further testing ------------------------------------------- $ for x in g h i j k ; do > echo $x > $x > hg add $x > hg ci -m $x > done $ hg phase --force --secret .~2 $ hg log -G @ 18:ee118ab9fa44 (secret) k | o 17:3a6c53ee7f3d (secret) j | o 16:b605fb7503f2 (secret) i | o 15:7395e1ff83bd (draft) h | o 14:6b70183d2492 (draft) g | o 13:b449568bf7fc (draft) f | o 12:40db8afa467b (public) c | o 0:cb9a9f314b8b (public) a $ cd .. simple phase conservation ------------------------------------------- Resulting changeset should conserve the phase of the original one whatever the phases.new-commit option is. New-commit as draft (default) $ cp -R base simple-draft $ cd simple-draft $ hg histedit -r 'b449568bf7fc' --commands - << EOF > edit b449568bf7fc 11 f > pick 6b70183d2492 12 g > pick 7395e1ff83bd 13 h > pick b605fb7503f2 14 i > pick 3a6c53ee7f3d 15 j > pick ee118ab9fa44 16 k > EOF 0 files updated, 0 files merged, 6 files removed, 0 files unresolved adding f Editing (b449568bf7fc), you may commit or record as needed now. (hg histedit --continue to resume) [1] $ echo f >> f $ hg histedit --continue $ hg log -G @ 24:12e89af74238 (secret) k | o 23:636a8687b22e (secret) j | o 22:ccaf0a38653f (secret) i | o 21:11a89d1c2613 (draft) h | o 20:c1dec7ca82ea (draft) g | o 19:087281e68428 (draft) f | o 12:40db8afa467b (public) c | o 0:cb9a9f314b8b (public) a $ cd .. New-commit as secret (config) $ cp -R base simple-secret $ cd simple-secret $ cat >> .hg/hgrc << EOF > [phases] > new-commit=secret > EOF $ hg histedit -r 'b449568bf7fc' --commands - << EOF > edit b449568bf7fc 11 f > pick 6b70183d2492 12 g > pick 7395e1ff83bd 13 h > pick b605fb7503f2 14 i > pick 3a6c53ee7f3d 15 j > pick ee118ab9fa44 16 k > EOF 0 files updated, 0 files merged, 6 files removed, 0 files unresolved adding f Editing (b449568bf7fc), you may commit or record as needed now. (hg histedit --continue to resume) [1] $ echo f >> f $ hg histedit --continue $ hg log -G @ 24:12e89af74238 (secret) k | o 23:636a8687b22e (secret) j | o 22:ccaf0a38653f (secret) i | o 21:11a89d1c2613 (draft) h | o 20:c1dec7ca82ea (draft) g | o 19:087281e68428 (draft) f | o 12:40db8afa467b (public) c | o 0:cb9a9f314b8b (public) a $ cd .. Changeset reordering ------------------------------------------- If a secret changeset is put before a draft one, all descendant should be secret. It seems more important to present the secret phase. $ cp -R base reorder $ cd reorder $ hg histedit -r 'b449568bf7fc' --commands - << EOF > pick b449568bf7fc 11 f > pick 3a6c53ee7f3d 15 j > pick 6b70183d2492 12 g > pick b605fb7503f2 14 i > pick 7395e1ff83bd 13 h > pick ee118ab9fa44 16 k > EOF $ hg log -G @ 23:558246857888 (secret) k | o 22:28bd44768535 (secret) h | o 21:d5395202aeb9 (secret) i | o 20:21edda8e341b (secret) g | o 19:5ab64f3a4832 (secret) j | o 13:b449568bf7fc (draft) f | o 12:40db8afa467b (public) c | o 0:cb9a9f314b8b (public) a $ cd .. Changeset folding ------------------------------------------- Folding a secret changeset with a draft one turn the result secret (again, better safe than sorry). Folding between same phase changeset still works Note that there is a few reordering in this series for more extensive test $ cp -R base folding $ cd folding $ cat >> .hg/hgrc << EOF > [phases] > new-commit=secret > EOF $ hg histedit -r 'b449568bf7fc' --commands - << EOF > pick 7395e1ff83bd 13 h > fold b449568bf7fc 11 f > pick 6b70183d2492 12 g > fold 3a6c53ee7f3d 15 j > pick b605fb7503f2 14 i > fold ee118ab9fa44 16 k > EOF $ hg log -G @ 27:f9daec13fb98 (secret) i | o 24:49807617f46a (secret) g | o 21:050280826e04 (draft) h | o 12:40db8afa467b (public) c | o 0:cb9a9f314b8b (public) a $ hg co 49807617f46a 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo wat >> wat $ hg add wat $ hg ci -m 'add wat' created new head $ hg merge f9daec13fb98 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m 'merge' $ echo not wat > wat $ hg ci -m 'modify wat' $ hg histedit 050280826e04 abort: cannot edit history that contains merges [255] $ cd .. Check abort behavior ------------------------------------------- We checks that abort properly clean the repository so the same histedit can be attempted later. $ cp -R base abort $ cd abort $ hg histedit -r 'b449568bf7fc' --commands - << EOF > pick b449568bf7fc 13 f > pick 7395e1ff83bd 15 h > pick 6b70183d2492 14 g > pick b605fb7503f2 16 i > roll 3a6c53ee7f3d 17 j > edit ee118ab9fa44 18 k > EOF Editing (ee118ab9fa44), you may commit or record as needed now. (hg histedit --continue to resume) [1] $ hg histedit --abort 1 files updated, 0 files merged, 0 files removed, 0 files unresolved saved backup bundle to $TESTTMP/abort/.hg/strip-backup/4dc06258baa6-dff4ef05-backup.hg $ hg log -G @ 18:ee118ab9fa44 (secret) k | o 17:3a6c53ee7f3d (secret) j | o 16:b605fb7503f2 (secret) i | o 15:7395e1ff83bd (draft) h | o 14:6b70183d2492 (draft) g | o 13:b449568bf7fc (draft) f | o 12:40db8afa467b (public) c | o 0:cb9a9f314b8b (public) a $ hg histedit -r 'b449568bf7fc' --commands - << EOF --config experimental.evolution.track-operation=1 > pick b449568bf7fc 13 f > pick 7395e1ff83bd 15 h > pick 6b70183d2492 14 g > pick b605fb7503f2 16 i > pick 3a6c53ee7f3d 17 j > edit ee118ab9fa44 18 k > EOF Editing (ee118ab9fa44), you may commit or record as needed now. (hg histedit --continue to resume) [1] $ hg histedit --continue --config experimental.evolution.track-operation=1 $ hg log -G @ 23:175d6b286a22 (secret) k | o 22:44ca09d59ae4 (secret) j | o 21:31747692a644 (secret) i | o 20:9985cd4f21fa (draft) g | o 19:4dc06258baa6 (draft) h | o 13:b449568bf7fc (draft) f | o 12:40db8afa467b (public) c | o 0:cb9a9f314b8b (public) a $ hg debugobsolete --rev . ee118ab9fa44ebb86be85996548b5517a39e5093 175d6b286a224c23f192e79a581ce83131a53fa2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'histedit', 'user': 'test'} mercurial-4.5.3/tests/test-newbranch.t0000644015407300116100000003011313261161234017646 0ustar augieeng00000000000000 $ branchcache=.hg/cache/branch2 $ listbranchcaches() { > for f in .hg/cache/branch2*; > do echo === $f ===; > cat $f; > done; > } $ purgebranchcaches() { > rm .hg/cache/branch2* > } $ hg init t $ cd t $ hg branches $ echo foo > a $ hg add a $ hg ci -m "initial" $ hg branch foo marked working directory as branch foo (branches are permanent and global, did you want a bookmark?) $ hg branch foo $ hg ci -m "add branch name" $ hg branch bar marked working directory as branch bar $ hg ci -m "change branch name" Branch shadowing: $ hg branch default abort: a branch of the same name already exists (use 'hg update' to switch to it) [255] $ hg branch -f default marked working directory as branch default $ hg ci -m "clear branch name" created new head There should be only one default branch head $ hg heads . changeset: 3:1c28f494dae6 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: clear branch name Merging and branches $ hg co foo 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg branch foo set existing branch name fails unless force - setting existing parent branch works without force: $ hg branch bar abort: a branch of the same name already exists (use 'hg update' to switch to it) [255] $ hg branch -f bar marked working directory as branch bar $ hg branch foo marked working directory as branch foo $ echo bleah > a $ hg ci -m "modify a branch" $ hg merge default 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg branch foo set existing branch name where branch head is ancestor: $ hg branch bar abort: a branch of the same name already exists (use 'hg update' to switch to it) [255] set (other) parent branch as branch name $ hg branch default marked working directory as branch default set (first) parent branch as branch name $ hg branch foo marked working directory as branch foo $ hg ci -m "merge" $ hg log -G -T '{rev}:{node|short} {branch} {desc}\n' @ 5:530046499edf foo merge |\ | o 4:adf1a74a7f7b foo modify a branch | | o | 3:1c28f494dae6 default clear branch name | | o | 2:c21617b13b22 bar change branch name |/ o 1:6c0e42da283a foo add branch name | o 0:db01e8ea3388 default initial $ hg branches foo 5:530046499edf default 3:1c28f494dae6 (inactive) bar 2:c21617b13b22 (inactive) $ hg branches -q foo default bar Test for invalid branch cache: $ hg rollback repository tip rolled back to revision 4 (undo commit) working directory now based on revisions 4 and 3 $ cp ${branchcache}-served .hg/bc-invalid $ hg log -r foo changeset: 4:adf1a74a7f7b branch: foo tag: tip parent: 1:6c0e42da283a user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modify a branch $ cp .hg/bc-invalid $branchcache $ hg --debug log -r foo changeset: 4:adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 branch: foo tag: tip phase: draft parent: 1:6c0e42da283a56b5edc5b4fadb491365ec7f5fa8 parent: -1:0000000000000000000000000000000000000000 manifest: 1:8c342a37dfba0b3d3ce073562a00d8a813c54ffe user: test date: Thu Jan 01 00:00:00 1970 +0000 files: a extra: branch=foo description: modify a branch $ purgebranchcaches $ echo corrupted > $branchcache $ hg log -qr foo 4:adf1a74a7f7b $ listbranchcaches === .hg/cache/branch2 === corrupted === .hg/cache/branch2-served === adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4 c21617b13b220988e7a2e26290fbe4325ffa7139 o bar 1c28f494dae69a2f8fc815059d257eccf3fcfe75 o default adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 o foo Push should update the branch cache: $ hg init ../target Pushing just rev 0: $ hg push -qr 0 ../target $ (cd ../target/; listbranchcaches) === .hg/cache/branch2-base === db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 0 db01e8ea3388fd3c7c94e1436ea2bd6a53d581c5 o default Pushing everything: $ hg push -qf ../target $ (cd ../target/; listbranchcaches) === .hg/cache/branch2-base === adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4 c21617b13b220988e7a2e26290fbe4325ffa7139 o bar 1c28f494dae69a2f8fc815059d257eccf3fcfe75 o default adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 o foo Update with no arguments: tipmost revision of the current branch: $ hg up -q -C 0 $ hg up -q $ hg id 1c28f494dae6 $ hg up -q 1 $ hg up -q $ hg id adf1a74a7f7b (foo) tip $ hg branch foobar marked working directory as branch foobar $ hg up 0 files updated, 0 files merged, 0 files removed, 0 files unresolved Fast-forward merge: $ hg branch ff marked working directory as branch ff $ echo ff > ff $ hg ci -Am'fast forward' adding ff $ hg up foo 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg merge ff 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg branch foo $ hg commit -m'Merge ff into foo' $ hg parents changeset: 6:185ffbfefa30 branch: foo tag: tip parent: 4:adf1a74a7f7b parent: 5:1a3c27dc5e11 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Merge ff into foo $ hg manifest a ff Test merging, add 3 default heads and one test head: $ cd .. $ hg init merges $ cd merges $ echo a > a $ hg ci -Ama adding a $ echo b > b $ hg ci -Amb adding b $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo c > c $ hg ci -Amc adding c created new head $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo d > d $ hg ci -Amd adding d created new head $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg branch test marked working directory as branch test (branches are permanent and global, did you want a bookmark?) $ echo e >> e $ hg ci -Ame adding e $ hg log changeset: 4:3a1e01ed1df4 branch: test tag: tip parent: 0:cb9a9f314b8b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: e changeset: 3:980f7dc84c29 parent: 0:cb9a9f314b8b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: d changeset: 2:d36c0562f908 parent: 0:cb9a9f314b8b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: c changeset: 1:d2ae7f538514 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: b changeset: 0:cb9a9f314b8b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a Implicit merge with test branch as parent: $ hg merge abort: branch 'test' has one head - please merge with an explicit rev (run 'hg heads' to see all heads) [255] $ hg up -C default 1 files updated, 0 files merged, 1 files removed, 0 files unresolved Implicit merge with default branch as parent: $ hg merge abort: branch 'default' has 3 heads - please merge with an explicit rev (run 'hg heads .' to see heads) [255] 3 branch heads, explicit merge required: $ hg merge 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m merge 2 branch heads, implicit merge works: $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cd .. We expect that bare update on new branch, updates to parent $ hg init bareupdateonnewbranch $ cd bareupdateonnewbranch $ hg update 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ touch a $ hg commit -A -m "a" adding a $ touch b $ hg commit -A -m "b" adding b $ touch c $ hg commit -A -m "c" adding c $ hg update -r 1 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg log -G o changeset: 2:991a3460af53 | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: c | @ changeset: 1:0e067c57feba | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: b | o changeset: 0:3903775176ed user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a $ hg branch dev marked working directory as branch dev (branches are permanent and global, did you want a bookmark?) $ hg update 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg summary parent: 1:0e067c57feba b branch: dev commit: (new branch) update: (current) phases: 3 draft $ cd .. We need special handling for repositories with no "default" branch because "null" revision belongs to non-existent "default" branch. $ hg init nodefault $ cd nodefault $ hg branch -q foo $ touch 0 $ hg ci -Aqm0 $ touch 1 $ hg ci -Aqm1 $ hg update -qr0 $ hg branch -q bar $ touch 2 $ hg ci -Aqm2 $ hg update -qr0 $ hg branch -q baz $ touch 3 $ hg ci -Aqm3 $ hg ci --close-branch -m 'close baz' $ hg update -q null $ hg log -GT'{rev} {branch}\n' _ 4 baz | o 3 baz | | o 2 bar |/ | o 1 foo |/ o 0 foo a) updating from "null" should bring us to the tip-most branch head as there is no "default" branch: $ hg update -q null $ hg id -bn -1 default $ hg update 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id -bn 2 bar b) but if we are at uncommitted "default" branch, we should stick to the current revision: $ hg update -q 0 $ hg branch default marked working directory as branch default $ hg id -bn 0 default $ hg update 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id -bn 0 default c) also, if we have uncommitted branch at "null", we should stick to it: $ hg update -q null $ hg branch new marked working directory as branch new $ hg id -bn -1 new $ hg update 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id -bn -1 new $ cd .. We expect that update --clean discard changes in working directory, and updates to the head of parent branch. $ hg init updatebareclean $ cd updatebareclean $ hg update --clean 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ touch a $ hg commit -A -m "a" adding a $ touch b $ hg commit -A -m "b" adding b $ touch c $ hg commit -A -m "c" adding c $ hg log changeset: 2:991a3460af53 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: c changeset: 1:0e067c57feba user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: b changeset: 0:3903775176ed user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a $ hg update -r 1 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg branch new-branch marked working directory as branch new-branch (branches are permanent and global, did you want a bookmark?) $ echo "aa" >> a $ hg update --clean 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg status $ hg branch default $ hg parent changeset: 2:991a3460af53 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: c We expect that update --clean on non existing parent discards a new branch and updates to the tipmost non-closed branch head $ hg update null 0 files updated, 0 files merged, 3 files removed, 0 files unresolved $ hg branch newbranch marked working directory as branch newbranch (branches are permanent and global, did you want a bookmark?) $ hg update -C 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg summary parent: 2:991a3460af53 tip c branch: default commit: (clean) update: (current) phases: 3 draft mercurial-4.5.3/tests/test-manifest.t0000644015407300116100000000212313261161234017505 0ustar augieeng00000000000000Source bundle was generated with the following script: # hg init # echo a > a # ln -s a l # hg ci -Ama -d'0 0' # mkdir b # echo a > b/a # chmod +x b/a # hg ci -Amb -d'1 0' $ hg init $ hg -q pull "$TESTDIR/bundles/test-manifest.hg" The next call is expected to return nothing: $ hg manifest $ hg co 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg manifest a b/a l $ hg files -vr . 2 a 2 x b/a 1 l l $ hg files -r . -X b a l $ hg manifest -v 644 a 755 * b/a 644 @ l $ hg manifest --debug b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 * b/a 047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 @ l $ hg manifest -r 0 a l $ hg manifest -r 1 a b/a l $ hg manifest -r tip a b/a l $ hg manifest tip a b/a l $ hg manifest --all a b/a l The next two calls are expected to abort: $ hg manifest -r 2 abort: unknown revision '2'! [255] $ hg manifest -r tip tip abort: please specify just one revision [255] mercurial-4.5.3/tests/test-subrepo-deep-nested-change.t0000644015407300116100000012740113261161234023003 0ustar augieeng00000000000000 $ cat >> $HGRCPATH < [extdiff] > # for portability: > pdiff = sh "$RUNTESTDIR/pdiff" > [progress] > disable=False > assume-tty = 1 > delay = 0 > # set changedelay really large so we don't see nested topics > changedelay = 30000 > format = topic bar number > refresh = 0 > width = 60 > EOF Preparing the subrepository 'sub2' $ hg init sub2 $ echo sub2 > sub2/sub2 $ hg add -R sub2 adding sub2/sub2 $ hg commit -R sub2 -m "sub2 import" Preparing the 'sub1' repo which depends on the subrepo 'sub2' $ hg init sub1 $ echo sub1 > sub1/sub1 $ echo "sub2 = ../sub2" > sub1/.hgsub $ hg clone sub2 sub1/sub2 \r (no-eol) (esc) linking [ <=> ] 1\r (no-eol) (esc) linking [ <=> ] 2\r (no-eol) (esc) linking [ <=> ] 3\r (no-eol) (esc) linking [ <=> ] 4\r (no-eol) (esc) linking [ <=> ] 5\r (no-eol) (esc) linking [ <=> ] 6\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg add -R sub1 adding sub1/.hgsub adding sub1/sub1 $ hg commit -R sub1 -m "sub1 import" Preparing the 'main' repo which depends on the subrepo 'sub1' $ hg init main $ echo main > main/main $ echo "sub1 = ../sub1" > main/.hgsub $ hg clone sub1 main/sub1 \r (no-eol) (esc) linking [ <=> ] 1\r (no-eol) (esc) linking [ <=> ] 2\r (no-eol) (esc) linking [ <=> ] 3\r (no-eol) (esc) linking [ <=> ] 4\r (no-eol) (esc) linking [ <=> ] 5\r (no-eol) (esc) linking [ <=> ] 6\r (no-eol) (esc) linking [ <=> ] 7\r (no-eol) (esc) linking [ <=> ] 8\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) updating [===========================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) linking [ <=> ] 1\r (no-eol) (esc) linking [ <=> ] 2\r (no-eol) (esc) linking [ <=> ] 3\r (no-eol) (esc) linking [ <=> ] 4\r (no-eol) (esc) linking [ <=> ] 5\r (no-eol) (esc) linking [ <=> ] 6\r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) updating to branch default cloning subrepo sub2 from $TESTTMP/sub2 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg add -R main adding main/.hgsub adding main/main $ hg commit -R main -m "main import" #if serve Unfortunately, subrepos not at their nominal location cannot be cloned. But they are still served from their location within the local repository. The only reason why 'main' can be cloned via the filesystem is because 'sub1' and 'sub2' are also available as siblings of 'main'. $ hg serve -R main --debug -S -p $HGPORT -d --pid-file=hg1.pid -E error.log -A access.log adding = $TESTTMP/main adding sub1 = $TESTTMP/main/sub1 adding sub1/sub2 = $TESTTMP/main/sub1/sub2 listening at http://*:$HGPORT/ (bound to *:$HGPORT) (glob) (?) adding = $TESTTMP/main (?) adding sub1 = $TESTTMP/main/sub1 (?) adding sub1/sub2 = $TESTTMP/main/sub1/sub2 (?) $ cat hg1.pid >> $DAEMON_PIDS $ hg clone http://localhost:$HGPORT httpclone --config progress.disable=True requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 3 changes to 3 files new changesets 7f491f53a367 updating to branch default abort: HTTP Error 404: Not Found [255] $ cat access.log * "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) * "GET /?cmd=batch HTTP/1.1" 200 - * (glob) * "GET /?cmd=getbundle HTTP/1.1" 200 - * (glob) * "GET /../sub1?cmd=capabilities HTTP/1.1" 404 - (glob) $ killdaemons.py $ rm hg1.pid error.log access.log #endif Cleaning both repositories, just as a clone -U $ hg up -C -R sub2 null \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg up -C -R sub1 null \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) updating [===========================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) 0 files updated, 0 files merged, 3 files removed, 0 files unresolved $ hg up -C -R main null \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) updating [===========================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) updating [===========================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) 0 files updated, 0 files merged, 3 files removed, 0 files unresolved $ rm -rf main/sub1 $ rm -rf sub1/sub2 Clone main $ hg --config extensions.largefiles= clone main cloned \r (no-eol) (esc) linking [ <=> ] 1\r (no-eol) (esc) linking [ <=> ] 2\r (no-eol) (esc) linking [ <=> ] 3\r (no-eol) (esc) linking [ <=> ] 4\r (no-eol) (esc) linking [ <=> ] 5\r (no-eol) (esc) linking [ <=> ] 6\r (no-eol) (esc) linking [ <=> ] 7\r (no-eol) (esc) linking [ <=> ] 8\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) updating [===========================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) linking [ <=> ] 1\r (no-eol) (esc) linking [ <=> ] 2\r (no-eol) (esc) linking [ <=> ] 3\r (no-eol) (esc) linking [ <=> ] 4\r (no-eol) (esc) linking [ <=> ] 5\r (no-eol) (esc) linking [ <=> ] 6\r (no-eol) (esc) linking [ <=> ] 7\r (no-eol) (esc) linking [ <=> ] 8\r (no-eol) (esc) updating [===========================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) linking [ <=> ] 1\r (no-eol) (esc) linking [ <=> ] 2\r (no-eol) (esc) linking [ <=> ] 3\r (no-eol) (esc) linking [ <=> ] 4\r (no-eol) (esc) linking [ <=> ] 5\r (no-eol) (esc) linking [ <=> ] 6\r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) updating to branch default cloning subrepo sub1 from $TESTTMP/sub1 cloning subrepo sub1/sub2 from $TESTTMP/sub2 3 files updated, 0 files merged, 0 files removed, 0 files unresolved Largefiles is NOT enabled in the clone if the source repo doesn't require it $ cat cloned/.hg/hgrc # example repository config (see 'hg help config' for more info) [paths] default = $TESTTMP/main # path aliases to other clones of this repo in URLs or filesystem paths # (see 'hg help config.paths' for more info) # # default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork # my-fork = ssh://jdoe@example.net/hg/jdoes-fork # my-clone = /home/jdoe/jdoes-clone [ui] # name and email (local to this repository, optional), e.g. # username = Jane Doe Checking cloned repo ids $ printf "cloned " ; hg id -R cloned cloned 7f491f53a367 tip $ printf "cloned/sub1 " ; hg id -R cloned/sub1 cloned/sub1 fc3b4ce2696f tip $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2 cloned/sub1/sub2 c57a0840e3ba tip debugsub output for main and sub1 $ hg debugsub -R cloned path sub1 source ../sub1 revision fc3b4ce2696f7741438c79207583768f2ce6b0dd $ hg debugsub -R cloned/sub1 path sub2 source ../sub2 revision c57a0840e3badd667ef3c3ef65471609acb2ba3c Modifying deeply nested 'sub2' $ echo modified > cloned/sub1/sub2/sub2 $ hg commit --subrepos -m "deep nested modif should trigger a commit" -R cloned committing subrepository sub1 committing subrepository sub1/sub2 Checking modified node ids $ printf "cloned " ; hg id -R cloned cloned ffe6649062fe tip $ printf "cloned/sub1 " ; hg id -R cloned/sub1 cloned/sub1 2ecb03bf44a9 tip $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2 cloned/sub1/sub2 53dd3430bcaf tip debugsub output for main and sub1 $ hg debugsub -R cloned path sub1 source ../sub1 revision 2ecb03bf44a94e749e8669481dd9069526ce7cb9 $ hg debugsub -R cloned/sub1 path sub2 source ../sub2 revision 53dd3430bcaf5ab4a7c48262bcad6d441f510487 Check that deep archiving works $ cd cloned $ echo 'test' > sub1/sub2/test.txt $ hg --config extensions.largefiles=! add sub1/sub2/test.txt $ mkdir sub1/sub2/folder $ echo 'subfolder' > sub1/sub2/folder/test.txt $ hg ci -ASm "add test.txt" adding sub1/sub2/folder/test.txt committing subrepository sub1 committing subrepository sub1/sub2 $ rm -r main $ hg archive -S -qr 'wdir()' ../wdir $ cat ../wdir/.hg_archival.txt repo: 7f491f53a367861f47ee64a80eb997d1f341b77a node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+ branch: default latesttag: null latesttagdistance: 4 changessincelatesttag: 4 $ hg update -Cq . A deleted subrepo file is flagged as dirty, like the top level repo $ rm -r ../wdir sub1/sub2/folder/test.txt $ hg archive -S -qr 'wdir()' ../wdir $ cat ../wdir/.hg_archival.txt repo: 7f491f53a367861f47ee64a80eb997d1f341b77a node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+ branch: default latesttag: null latesttagdistance: 4 changessincelatesttag: 4 $ hg update -Cq . $ rm -r ../wdir $ hg archive -S -qr 'wdir()' ../wdir \ > --config 'experimental.archivemetatemplate=archived {node|short}\n' $ cat ../wdir/.hg_archival.txt archived ffffffffffff $ rm -r ../wdir .. but first take a detour through some deep removal testing $ hg remove -S -I 're:.*.txt' . \r (no-eol) (esc) searching [==========================================>] 1/1\r (no-eol) (esc) searching [==========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [=====================> ] 1/2\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [===========================================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) removing sub1/sub2/folder/test.txt removing sub1/sub2/test.txt $ hg status -S R sub1/sub2/folder/test.txt R sub1/sub2/test.txt $ hg update -Cq $ hg remove -I 're:.*.txt' sub1 \r (no-eol) (esc) searching [==========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) $ hg status -S $ hg remove sub1/sub2/folder/test.txt \r (no-eol) (esc) searching [==========================================>] 1/1\r (no-eol) (esc) searching [==========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) $ hg remove sub1/.hgsubstate \r (no-eol) (esc) searching [==========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) $ mv sub1/.hgsub sub1/x.hgsub $ hg status -S warning: subrepo spec file 'sub1/.hgsub' not found R sub1/.hgsubstate R sub1/sub2/folder/test.txt ! sub1/.hgsub ? sub1/x.hgsub $ mv sub1/x.hgsub sub1/.hgsub $ hg update -Cq $ touch sub1/foo $ hg forget sub1/sub2/folder/test.txt $ rm sub1/sub2/test.txt Test relative path printing + subrepos $ mkdir -p foo/bar $ cd foo $ touch bar/abc $ hg addremove -S .. \r (no-eol) (esc) searching for exact renames [ ] 0/1\r (no-eol) (esc) \r (no-eol) (esc) adding ../sub1/sub2/folder/test.txt removing ../sub1/sub2/test.txt adding ../sub1/foo adding bar/abc $ cd .. $ hg status -S A foo/bar/abc A sub1/foo R sub1/sub2/test.txt Archive wdir() with subrepos $ hg rm main \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) $ hg archive -S -r 'wdir()' ../wdir \r (no-eol) (esc) archiving [ ] 0/3\r (no-eol) (esc) archiving [=============> ] 1/3\r (no-eol) (esc) archiving [===========================> ] 2/3\r (no-eol) (esc) archiving [==========================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1) [ ] 0/4\r (no-eol) (esc) archiving (sub1) [========> ] 1/4\r (no-eol) (esc) archiving (sub1) [=================> ] 2/4\r (no-eol) (esc) archiving (sub1) [==========================> ] 3/4\r (no-eol) (esc) archiving (sub1) [===================================>] 4/4\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc) archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc) archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) $ diff -r . ../wdir | egrep -v '\.hg$|^Common subdirectories:' Only in ../wdir: .hg_archival.txt $ find ../wdir -type f | sort ../wdir/.hg_archival.txt ../wdir/.hgsub ../wdir/.hgsubstate ../wdir/foo/bar/abc ../wdir/sub1/.hgsub ../wdir/sub1/.hgsubstate ../wdir/sub1/foo ../wdir/sub1/sub1 ../wdir/sub1/sub2/folder/test.txt ../wdir/sub1/sub2/sub2 $ cat ../wdir/.hg_archival.txt repo: 7f491f53a367861f47ee64a80eb997d1f341b77a node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+ branch: default latesttag: null latesttagdistance: 4 changessincelatesttag: 4 Attempting to archive 'wdir()' with a missing file is handled gracefully $ rm sub1/sub1 $ rm -r ../wdir $ hg archive -v -S -r 'wdir()' ../wdir \r (no-eol) (esc) archiving [ ] 0/3\r (no-eol) (esc) archiving [=============> ] 1/3\r (no-eol) (esc) archiving [===========================> ] 2/3\r (no-eol) (esc) archiving [==========================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1) [ ] 0/3\r (no-eol) (esc) archiving (sub1) [===========> ] 1/3\r (no-eol) (esc) archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc) archiving (sub1) [===================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc) archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc) archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) $ find ../wdir -type f | sort ../wdir/.hg_archival.txt ../wdir/.hgsub ../wdir/.hgsubstate ../wdir/foo/bar/abc ../wdir/sub1/.hgsub ../wdir/sub1/.hgsubstate ../wdir/sub1/foo ../wdir/sub1/sub2/folder/test.txt ../wdir/sub1/sub2/sub2 Continue relative path printing + subrepos $ hg update -Cq $ rm -r ../wdir $ hg archive -S -r 'wdir()' ../wdir \r (no-eol) (esc) archiving [ ] 0/3\r (no-eol) (esc) archiving [=============> ] 1/3\r (no-eol) (esc) archiving [===========================> ] 2/3\r (no-eol) (esc) archiving [==========================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1) [ ] 0/3\r (no-eol) (esc) archiving (sub1) [===========> ] 1/3\r (no-eol) (esc) archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc) archiving (sub1) [===================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc) archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc) archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc) archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) $ cat ../wdir/.hg_archival.txt repo: 7f491f53a367861f47ee64a80eb997d1f341b77a node: 9bb10eebee29dc0f1201dcf5977b811a540255fd branch: default latesttag: null latesttagdistance: 4 changessincelatesttag: 4 $ touch sub1/sub2/folder/bar $ hg addremove sub1/sub2 adding sub1/sub2/folder/bar $ hg status -S A sub1/sub2/folder/bar ? foo/bar/abc ? sub1/foo $ hg update -Cq $ hg addremove sub1 adding sub1/sub2/folder/bar adding sub1/foo $ hg update -Cq $ rm sub1/sub2/folder/test.txt $ rm sub1/sub2/test.txt $ hg ci -ASm "remove test.txt" adding sub1/sub2/folder/bar removing sub1/sub2/folder/test.txt removing sub1/sub2/test.txt adding sub1/foo adding foo/bar/abc committing subrepository sub1 committing subrepository sub1/sub2 $ hg forget sub1/sub2/sub2 $ echo x > sub1/sub2/x.txt $ hg add sub1/sub2/x.txt Files sees uncommitted adds and removes in subrepos $ hg files -S .hgsub .hgsubstate foo/bar/abc main sub1/.hgsub sub1/.hgsubstate sub1/foo sub1/sub1 sub1/sub2/folder/bar sub1/sub2/x.txt $ hg files -S "set:eol('dos') or eol('unix') or size('<= 0')" .hgsub .hgsubstate foo/bar/abc main sub1/.hgsub sub1/.hgsubstate sub1/foo sub1/sub1 sub1/sub2/folder/bar sub1/sub2/x.txt $ hg files -r '.^' -S "set:eol('dos') or eol('unix')" .hgsub .hgsubstate main sub1/.hgsub sub1/.hgsubstate sub1/sub1 sub1/sub2/folder/test.txt sub1/sub2/sub2 sub1/sub2/test.txt $ hg files sub1 sub1/.hgsub sub1/.hgsubstate sub1/foo sub1/sub1 sub1/sub2/folder/bar sub1/sub2/x.txt $ hg files sub1/sub2 sub1/sub2/folder/bar sub1/sub2/x.txt $ hg files .hgsub .hgsubstate foo/bar/abc main $ hg files -S -r '.^' sub1/sub2/folder sub1/sub2/folder/test.txt $ hg files -S -r '.^' sub1/sub2/missing sub1/sub2/missing: no such file in rev 78026e779ea6 [1] $ hg files -r '.^' sub1/ sub1/.hgsub sub1/.hgsubstate sub1/sub1 sub1/sub2/folder/test.txt sub1/sub2/sub2 sub1/sub2/test.txt $ hg files -r '.^' sub1/sub2 sub1/sub2/folder/test.txt sub1/sub2/sub2 sub1/sub2/test.txt $ hg rollback -q $ hg up -Cq $ hg --config extensions.largefiles=! archive -S ../archive_all \r (no-eol) (esc) archiving [ ] 0/3\r (no-eol) (esc) archiving [=============> ] 1/3\r (no-eol) (esc) archiving [===========================> ] 2/3\r (no-eol) (esc) archiving [==========================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1) [ ] 0/3\r (no-eol) (esc) archiving (sub1) [===========> ] 1/3\r (no-eol) (esc) archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc) archiving (sub1) [===================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc) archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc) archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc) archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) $ find ../archive_all | sort ../archive_all ../archive_all/.hg_archival.txt ../archive_all/.hgsub ../archive_all/.hgsubstate ../archive_all/main ../archive_all/sub1 ../archive_all/sub1/.hgsub ../archive_all/sub1/.hgsubstate ../archive_all/sub1/sub1 ../archive_all/sub1/sub2 ../archive_all/sub1/sub2/folder ../archive_all/sub1/sub2/folder/test.txt ../archive_all/sub1/sub2/sub2 ../archive_all/sub1/sub2/test.txt Check that archive -X works in deep subrepos $ hg --config extensions.largefiles=! archive -S -X '**test*' ../archive_exclude \r (no-eol) (esc) archiving [ ] 0/3\r (no-eol) (esc) archiving [=============> ] 1/3\r (no-eol) (esc) archiving [===========================> ] 2/3\r (no-eol) (esc) archiving [==========================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1) [ ] 0/3\r (no-eol) (esc) archiving (sub1) [===========> ] 1/3\r (no-eol) (esc) archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc) archiving (sub1) [===================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc) archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) $ find ../archive_exclude | sort ../archive_exclude ../archive_exclude/.hg_archival.txt ../archive_exclude/.hgsub ../archive_exclude/.hgsubstate ../archive_exclude/main ../archive_exclude/sub1 ../archive_exclude/sub1/.hgsub ../archive_exclude/sub1/.hgsubstate ../archive_exclude/sub1/sub1 ../archive_exclude/sub1/sub2 ../archive_exclude/sub1/sub2/sub2 $ hg --config extensions.largefiles=! archive -S -I '**test*' ../archive_include \r (no-eol) (esc) archiving (sub1) [ <=> ] 0\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc) archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc) archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) $ find ../archive_include | sort ../archive_include ../archive_include/sub1 ../archive_include/sub1/sub2 ../archive_include/sub1/sub2/folder ../archive_include/sub1/sub2/folder/test.txt ../archive_include/sub1/sub2/test.txt Check that deep archive works with largefiles (which overrides hgsubrepo impl) This also tests the repo.ui regression in 43fb170a23bd, and that lf subrepo subrepos are archived properly. Note that add --large through a subrepo currently adds the file as a normal file $ echo "large" > sub1/sub2/large.bin $ hg --config extensions.largefiles= add --large -R sub1/sub2 sub1/sub2/large.bin $ echo "large" > large.bin $ hg --config extensions.largefiles= add --large large.bin $ hg --config extensions.largefiles= ci -S -m "add large files" committing subrepository sub1 committing subrepository sub1/sub2 $ hg --config extensions.largefiles= archive -S ../archive_lf $ find ../archive_lf | sort ../archive_lf ../archive_lf/.hg_archival.txt ../archive_lf/.hgsub ../archive_lf/.hgsubstate ../archive_lf/large.bin ../archive_lf/main ../archive_lf/sub1 ../archive_lf/sub1/.hgsub ../archive_lf/sub1/.hgsubstate ../archive_lf/sub1/sub1 ../archive_lf/sub1/sub2 ../archive_lf/sub1/sub2/folder ../archive_lf/sub1/sub2/folder/test.txt ../archive_lf/sub1/sub2/large.bin ../archive_lf/sub1/sub2/sub2 ../archive_lf/sub1/sub2/test.txt $ rm -rf ../archive_lf Exclude large files from main and sub-sub repo $ hg --config extensions.largefiles= archive -S -X '**.bin' ../archive_lf $ find ../archive_lf | sort ../archive_lf ../archive_lf/.hg_archival.txt ../archive_lf/.hgsub ../archive_lf/.hgsubstate ../archive_lf/main ../archive_lf/sub1 ../archive_lf/sub1/.hgsub ../archive_lf/sub1/.hgsubstate ../archive_lf/sub1/sub1 ../archive_lf/sub1/sub2 ../archive_lf/sub1/sub2/folder ../archive_lf/sub1/sub2/folder/test.txt ../archive_lf/sub1/sub2/sub2 ../archive_lf/sub1/sub2/test.txt $ rm -rf ../archive_lf Exclude normal files from main and sub-sub repo $ hg --config extensions.largefiles= archive -S -X '**.txt' -p '.' ../archive_lf.tgz $ tar -tzf ../archive_lf.tgz | sort .hgsub .hgsubstate large.bin main sub1/.hgsub sub1/.hgsubstate sub1/sub1 sub1/sub2/large.bin sub1/sub2/sub2 Include normal files from within a largefiles subrepo $ hg --config extensions.largefiles= archive -S -I '**.txt' ../archive_lf $ find ../archive_lf | sort ../archive_lf ../archive_lf/.hg_archival.txt ../archive_lf/sub1 ../archive_lf/sub1/sub2 ../archive_lf/sub1/sub2/folder ../archive_lf/sub1/sub2/folder/test.txt ../archive_lf/sub1/sub2/test.txt $ rm -rf ../archive_lf Include large files from within a largefiles subrepo $ hg --config extensions.largefiles= archive -S -I '**.bin' ../archive_lf $ find ../archive_lf | sort ../archive_lf ../archive_lf/large.bin ../archive_lf/sub1 ../archive_lf/sub1/sub2 ../archive_lf/sub1/sub2/large.bin $ rm -rf ../archive_lf Find an exact largefile match in a largefiles subrepo $ hg --config extensions.largefiles= archive -S -I 'sub1/sub2/large.bin' ../archive_lf $ find ../archive_lf | sort ../archive_lf ../archive_lf/sub1 ../archive_lf/sub1/sub2 ../archive_lf/sub1/sub2/large.bin $ rm -rf ../archive_lf The local repo enables largefiles if a largefiles repo is cloned $ hg showconfig extensions abort: repository requires features unknown to this Mercurial: largefiles! (see https://mercurial-scm.org/wiki/MissingRequirement for more information) [255] $ hg --config extensions.largefiles= clone -qU . ../lfclone $ cat ../lfclone/.hg/hgrc # example repository config (see 'hg help config' for more info) [paths] default = $TESTTMP/cloned # path aliases to other clones of this repo in URLs or filesystem paths # (see 'hg help config.paths' for more info) # # default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork # my-fork = ssh://jdoe@example.net/hg/jdoes-fork # my-clone = /home/jdoe/jdoes-clone [ui] # name and email (local to this repository, optional), e.g. # username = Jane Doe [extensions] largefiles= Find an exact match to a standin (should archive nothing) $ hg --config extensions.largefiles= archive -S -I 'sub/sub2/.hglf/large.bin' ../archive_lf $ find ../archive_lf 2> /dev/null | sort $ cat >> $HGRCPATH < [extensions] > largefiles= > [largefiles] > patterns=glob:**.dat > EOF Test forget through a deep subrepo with the largefiles extension, both a largefile and a normal file. Then a largefile that hasn't been committed yet. $ touch sub1/sub2/untracked.txt $ touch sub1/sub2/large.dat $ hg forget sub1/sub2/large.bin sub1/sub2/test.txt sub1/sub2/untracked.txt not removing sub1/sub2/untracked.txt: file is already untracked [1] $ hg add --large --dry-run -v sub1/sub2/untracked.txt adding sub1/sub2/untracked.txt as a largefile $ hg add --large -v sub1/sub2/untracked.txt adding sub1/sub2/untracked.txt as a largefile $ hg add --normal -v sub1/sub2/large.dat adding sub1/sub2/large.dat $ hg forget -v sub1/sub2/untracked.txt removing sub1/sub2/untracked.txt $ hg status -S A sub1/sub2/large.dat R sub1/sub2/large.bin R sub1/sub2/test.txt ? foo/bar/abc ? sub1/sub2/untracked.txt ? sub1/sub2/x.txt $ hg add sub1/sub2 $ hg archive -S -r 'wdir()' ../wdir2 $ diff -r . ../wdir2 | egrep -v '\.hg$|^Common subdirectories:' Only in ../wdir2: .hg_archival.txt Only in .: .hglf Only in .: foo Only in ./sub1/sub2: large.bin Only in ./sub1/sub2: test.txt Only in ./sub1/sub2: untracked.txt Only in ./sub1/sub2: x.txt $ find ../wdir2 -type f | sort ../wdir2/.hg_archival.txt ../wdir2/.hgsub ../wdir2/.hgsubstate ../wdir2/large.bin ../wdir2/main ../wdir2/sub1/.hgsub ../wdir2/sub1/.hgsubstate ../wdir2/sub1/sub1 ../wdir2/sub1/sub2/folder/test.txt ../wdir2/sub1/sub2/large.dat ../wdir2/sub1/sub2/sub2 $ hg status -S -mac -n | sort .hgsub .hgsubstate large.bin main sub1/.hgsub sub1/.hgsubstate sub1/sub1 sub1/sub2/folder/test.txt sub1/sub2/large.dat sub1/sub2/sub2 $ hg ci -Sqm 'forget testing' Test 'wdir()' modified file archiving with largefiles $ echo 'mod' > main $ echo 'mod' > large.bin $ echo 'mod' > sub1/sub2/large.dat $ hg archive -S -r 'wdir()' ../wdir3 $ diff -r . ../wdir3 | egrep -v '\.hg$|^Common subdirectories' Only in ../wdir3: .hg_archival.txt Only in .: .hglf Only in .: foo Only in ./sub1/sub2: large.bin Only in ./sub1/sub2: test.txt Only in ./sub1/sub2: untracked.txt Only in ./sub1/sub2: x.txt $ find ../wdir3 -type f | sort ../wdir3/.hg_archival.txt ../wdir3/.hgsub ../wdir3/.hgsubstate ../wdir3/large.bin ../wdir3/main ../wdir3/sub1/.hgsub ../wdir3/sub1/.hgsubstate ../wdir3/sub1/sub1 ../wdir3/sub1/sub2/folder/test.txt ../wdir3/sub1/sub2/large.dat ../wdir3/sub1/sub2/sub2 $ hg up -Cq Test issue4330: commit a directory where only normal files have changed $ touch foo/bar/large.dat $ hg add --large foo/bar/large.dat $ hg ci -m 'add foo/bar/large.dat' $ touch a.txt $ touch a.dat $ hg add -v foo/bar/abc a.txt a.dat adding a.dat as a largefile adding a.txt adding foo/bar/abc $ hg ci -m 'dir commit with only normal file deltas' foo/bar $ hg status A a.dat A a.txt Test a directory commit with a changed largefile and a changed normal file $ echo changed > foo/bar/large.dat $ echo changed > foo/bar/abc $ hg ci -m 'dir commit with normal and lf file deltas' foo $ hg status A a.dat A a.txt $ hg ci -m "add a.*" $ hg mv a.dat b.dat $ hg mv foo/bar/abc foo/bar/def $ hg status -C A b.dat a.dat A foo/bar/def foo/bar/abc R a.dat R foo/bar/abc $ hg ci -m "move large and normal" $ hg status -C --rev '.^' --rev . A b.dat a.dat A foo/bar/def foo/bar/abc R a.dat R foo/bar/abc $ echo foo > main $ hg ci -m "mod parent only" $ hg init sub3 $ echo "sub3 = sub3" >> .hgsub $ echo xyz > sub3/a.txt $ hg add sub3/a.txt $ hg ci -Sm "add sub3" committing subrepository sub3 $ cat .hgsub | grep -v sub3 > .hgsub1 $ mv .hgsub1 .hgsub $ hg ci -m "remove sub3" $ hg log -r "subrepo()" --style compact 0 7f491f53a367 1970-01-01 00:00 +0000 test main import 1 ffe6649062fe 1970-01-01 00:00 +0000 test deep nested modif should trigger a commit 2 9bb10eebee29 1970-01-01 00:00 +0000 test add test.txt 3 7c64f035294f 1970-01-01 00:00 +0000 test add large files 4 f734a59e2e35 1970-01-01 00:00 +0000 test forget testing 11 9685a22af5db 1970-01-01 00:00 +0000 test add sub3 12[tip] 2e0485b475b9 1970-01-01 00:00 +0000 test remove sub3 $ hg log -r "subrepo('sub3')" --style compact 11 9685a22af5db 1970-01-01 00:00 +0000 test add sub3 12[tip] 2e0485b475b9 1970-01-01 00:00 +0000 test remove sub3 $ hg log -r "subrepo('bogus')" --style compact Test .hgsubstate in the R state $ hg rm .hgsub .hgsubstate \r (no-eol) (esc) deleting [=====================> ] 1/2\r (no-eol) (esc) deleting [===========================================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) $ hg ci -m 'trash subrepo tracking' $ hg log -r "subrepo('re:sub\d+')" --style compact 0 7f491f53a367 1970-01-01 00:00 +0000 test main import 1 ffe6649062fe 1970-01-01 00:00 +0000 test deep nested modif should trigger a commit 2 9bb10eebee29 1970-01-01 00:00 +0000 test add test.txt 3 7c64f035294f 1970-01-01 00:00 +0000 test add large files 4 f734a59e2e35 1970-01-01 00:00 +0000 test forget testing 11 9685a22af5db 1970-01-01 00:00 +0000 test add sub3 12 2e0485b475b9 1970-01-01 00:00 +0000 test remove sub3 13[tip] a68b2c361653 1970-01-01 00:00 +0000 test trash subrepo tracking Restore the trashed subrepo tracking $ hg rollback -q $ hg update -Cq . Interaction with extdiff, largefiles and subrepos $ hg --config extensions.extdiff= pdiff -S $ hg --config extensions.extdiff= pdiff -r '.^' -S \r (no-eol) (esc) archiving [ ] 0/2\r (no-eol) (esc) archiving [====================> ] 1/2\r (no-eol) (esc) archiving [==========================================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1) [ <=> ] 0\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1/sub2) [ <=> ] 0\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub3) [ <=> ] 0\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving [ ] 0/2\r (no-eol) (esc) archiving [====================> ] 1/2\r (no-eol) (esc) archiving [==========================================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1) [ <=> ] 0\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1/sub2) [ <=> ] 0\r (no-eol) (esc) \r (no-eol) (esc) diff -Nru cloned.*/.hgsub cloned/.hgsub (glob) --- cloned.*/.hgsub * (glob) +++ cloned/.hgsub * (glob) @@ -1,2 +1* @@ (glob) sub1 = ../sub1 -sub3 = sub3 diff -Nru cloned.*/.hgsubstate cloned/.hgsubstate (glob) --- cloned.*/.hgsubstate * (glob) +++ cloned/.hgsubstate * (glob) @@ -1,2 +1* @@ (glob) 7a36fa02b66e61f27f3d4a822809f159479b8ab2 sub1 -b1a26de6f2a045a9f079323693614ee322f1ff7e sub3 [1] $ hg --config extensions.extdiff= pdiff -r 0 -r '.^' -S \r (no-eol) (esc) archiving [ ] 0/3\r (no-eol) (esc) archiving [=============> ] 1/3\r (no-eol) (esc) archiving [===========================> ] 2/3\r (no-eol) (esc) archiving [==========================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1) [ ] 0/1\r (no-eol) (esc) archiving (sub1) [===================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc) archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving [ ] 0/8\r (no-eol) (esc) archiving [====> ] 1/8\r (no-eol) (esc) archiving [=========> ] 2/8\r (no-eol) (esc) archiving [===============> ] 3/8\r (no-eol) (esc) archiving [====================> ] 4/8\r (no-eol) (esc) archiving [=========================> ] 5/8\r (no-eol) (esc) archiving [===============================> ] 6/8\r (no-eol) (esc) archiving [====================================> ] 7/8\r (no-eol) (esc) archiving [==========================================>] 8/8\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1) [ ] 0/1\r (no-eol) (esc) archiving (sub1) [===================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc) archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc) archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc) archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub3) [ ] 0/1\r (no-eol) (esc) archiving (sub3) [===================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) diff -Nru cloned.*/.hglf/b.dat cloned.*/.hglf/b.dat (glob) --- cloned.*/.hglf/b.dat * (glob) +++ cloned.*/.hglf/b.dat * (glob) @@ -*,0 +1* @@ (glob) +da39a3ee5e6b4b0d3255bfef95601890afd80709 diff -Nru cloned.*/.hglf/foo/bar/large.dat cloned.*/.hglf/foo/bar/large.dat (glob) --- cloned.*/.hglf/foo/bar/large.dat * (glob) +++ cloned.*/.hglf/foo/bar/large.dat * (glob) @@ -*,0 +1* @@ (glob) +2f6933b5ee0f5fdd823d9717d8729f3c2523811b diff -Nru cloned.*/.hglf/large.bin cloned.*/.hglf/large.bin (glob) --- cloned.*/.hglf/large.bin * (glob) +++ cloned.*/.hglf/large.bin * (glob) @@ -*,0 +1* @@ (glob) +7f7097b041ccf68cc5561e9600da4655d21c6d18 diff -Nru cloned.*/.hgsub cloned.*/.hgsub (glob) --- cloned.*/.hgsub * (glob) +++ cloned.*/.hgsub * (glob) @@ -1* +1,2 @@ (glob) sub1 = ../sub1 +sub3 = sub3 diff -Nru cloned.*/.hgsubstate cloned.*/.hgsubstate (glob) --- cloned.*/.hgsubstate * (glob) +++ cloned.*/.hgsubstate * (glob) @@ -1* +1,2 @@ (glob) -fc3b4ce2696f7741438c79207583768f2ce6b0dd sub1 +7a36fa02b66e61f27f3d4a822809f159479b8ab2 sub1 +b1a26de6f2a045a9f079323693614ee322f1ff7e sub3 diff -Nru cloned.*/foo/bar/def cloned.*/foo/bar/def (glob) --- cloned.*/foo/bar/def * (glob) +++ cloned.*/foo/bar/def * (glob) @@ -*,0 +1* @@ (glob) +changed diff -Nru cloned.*/main cloned.*/main (glob) --- cloned.*/main * (glob) +++ cloned.*/main * (glob) @@ -1* +1* @@ (glob) -main +foo diff -Nru cloned.*/sub1/.hgsubstate cloned.*/sub1/.hgsubstate (glob) --- cloned.*/sub1/.hgsubstate * (glob) +++ cloned.*/sub1/.hgsubstate * (glob) @@ -1* +1* @@ (glob) -c57a0840e3badd667ef3c3ef65471609acb2ba3c sub2 +c77908c81ccea3794a896c79e98b0e004aee2e9e sub2 diff -Nru cloned.*/sub1/sub2/folder/test.txt cloned.*/sub1/sub2/folder/test.txt (glob) --- cloned.*/sub1/sub2/folder/test.txt * (glob) +++ cloned.*/sub1/sub2/folder/test.txt * (glob) @@ -*,0 +1* @@ (glob) +subfolder diff -Nru cloned.*/sub1/sub2/sub2 cloned.*/sub1/sub2/sub2 (glob) --- cloned.*/sub1/sub2/sub2 * (glob) +++ cloned.*/sub1/sub2/sub2 * (glob) @@ -1* +1* @@ (glob) -sub2 +modified diff -Nru cloned.*/sub3/a.txt cloned.*/sub3/a.txt (glob) --- cloned.*/sub3/a.txt * (glob) +++ cloned.*/sub3/a.txt * (glob) @@ -*,0 +1* @@ (glob) +xyz [1] $ echo mod > sub1/sub2/sub2 $ hg --config extensions.extdiff= pdiff -S \r (no-eol) (esc) archiving (sub1) [ <=> ] 0\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc) archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) --- */cloned.*/sub1/sub2/sub2 * (glob) +++ */cloned/sub1/sub2/sub2 * (glob) @@ -1* +1* @@ (glob) -modified +mod [1] $ cd .. mercurial-4.5.3/tests/silenttestrunner.py0000644015407300116100000000133613261161234020544 0ustar augieeng00000000000000from __future__ import absolute_import, print_function import os import sys import unittest def main(modulename): '''run the tests found in module, printing nothing when all tests pass''' module = sys.modules[modulename] suite = unittest.defaultTestLoader.loadTestsFromModule(module) results = unittest.TestResult() suite.run(results) if results.errors or results.failures: for tc, exc in results.errors: print('ERROR:', tc) print() sys.stdout.write(exc) for tc, exc in results.failures: print('FAIL:', tc) print() sys.stdout.write(exc) sys.exit(1) if os.environ.get('SILENT_BE_NOISY'): main = unittest.main mercurial-4.5.3/tests/hgweberror.py0000644015407300116100000000112413261161234017255 0ustar augieeng00000000000000# A dummy extension that installs an hgweb command that throws an Exception. from __future__ import absolute_import from mercurial.hgweb import ( webcommands, ) def raiseerror(web, req, tmpl): '''Dummy web command that raises an uncaught Exception.''' # Simulate an error after partial response. if 'partialresponse' in req.form: req.respond(200, 'text/plain') req.write('partial content\n') raise AttributeError('I am an uncaught error!') def extsetup(ui): setattr(webcommands, 'raiseerror', raiseerror) webcommands.__all__.append('raiseerror') mercurial-4.5.3/tests/test-githelp.t0000644015407300116100000001750013261161234017340 0ustar augieeng00000000000000 $ cat >> $HGRCPATH << EOF > [extensions] > githelp = > EOF $ hg init repo $ cd repo $ echo foo > test_file $ mkdir dir $ echo foo > dir/file $ echo foo > removed_file $ echo foo > deleted_file $ hg add -q . $ hg commit -m 'bar' $ hg bookmark both $ touch both $ touch untracked_file $ hg remove removed_file $ rm deleted_file githelp on a single command should succeed $ hg githelp -- commit hg commit $ hg githelp -- git commit hg commit githelp should fail nicely if we don't give it arguments $ hg githelp abort: missing git command - usage: hg githelp -- [255] $ hg githelp -- git abort: missing git command - usage: hg githelp -- [255] githelp on a command with options should succeed $ hg githelp -- commit -pm "abc" hg commit --interactive -m 'abc' githelp on a command with standalone unrecognized option should succeed with warning $ hg githelp -- commit -p -v ignoring unknown option -v hg commit --interactive githelp on a command with unrecognized option packed with other options should fail with error $ hg githelp -- commit -pv abort: unknown option v packed with other options Please try passing the option as it's own flag: -v [255] githelp for git rebase --skip $ hg githelp -- git rebase --skip hg revert --all -r . hg rebase --continue githelp for git commit --amend (hg commit --amend pulls up an editor) $ hg githelp -- commit --amend hg commit --amend githelp for git commit --amend --no-edit (hg amend does not pull up an editor) $ hg githelp -- commit --amend --no-edit hg amend githelp for git checkout -- . (checking out a directory) $ hg githelp -- checkout -- . note: use --no-backup to avoid creating .orig files hg revert . githelp for git checkout "HEAD^" (should still work to pass a rev) $ hg githelp -- checkout "HEAD^" hg update .^ githelp checkout: args after -- should be treated as paths no matter what $ hg githelp -- checkout -- HEAD note: use --no-backup to avoid creating .orig files hg revert HEAD githelp for git checkout with rev and path $ hg githelp -- checkout "HEAD^" -- file.txt note: use --no-backup to avoid creating .orig files hg revert -r .^ file.txt githelp for git with rev and path, without separator $ hg githelp -- checkout "HEAD^" file.txt note: use --no-backup to avoid creating .orig files hg revert -r .^ file.txt githelp for checkout with a file as first argument $ hg githelp -- checkout test_file note: use --no-backup to avoid creating .orig files hg revert test_file githelp for checkout with a removed file as first argument $ hg githelp -- checkout removed_file note: use --no-backup to avoid creating .orig files hg revert removed_file githelp for checkout with a deleted file as first argument $ hg githelp -- checkout deleted_file note: use --no-backup to avoid creating .orig files hg revert deleted_file githelp for checkout with a untracked file as first argument $ hg githelp -- checkout untracked_file note: use --no-backup to avoid creating .orig files hg revert untracked_file githelp for checkout with a directory as first argument $ hg githelp -- checkout dir note: use --no-backup to avoid creating .orig files hg revert dir githelp for checkout when not in repo root $ cd dir $ hg githelp -- checkout file note: use --no-backup to avoid creating .orig files hg revert file $ cd .. githelp for checkout with an argument that is both a file and a revision $ hg githelp -- checkout both hg update both githelp for checkout with the -p option $ hg githelp -- git checkout -p xyz hg revert -i -r xyz $ hg githelp -- git checkout -p xyz -- abc note: use --no-backup to avoid creating .orig files hg revert -i -r xyz abc githelp for checkout with the -f option and a rev $ hg githelp -- git checkout -f xyz hg update -C xyz $ hg githelp -- git checkout --force xyz hg update -C xyz githelp for checkout with the -f option without an arg $ hg githelp -- git checkout -f hg revert --all $ hg githelp -- git checkout --force hg revert --all githelp for grep with pattern and path $ hg githelp -- grep shrubbery flib/intern/ hg grep shrubbery flib/intern/ githelp for reset, checking ~ in git becomes ~1 in mercurial $ hg githelp -- reset HEAD~ hg update .~1 $ hg githelp -- reset "HEAD^" hg update .^ $ hg githelp -- reset HEAD~3 hg update .~3 $ hg githelp -- reset --mixed HEAD NOTE: --mixed has no meaning since Mercurial has no staging area hg update . $ hg githelp -- reset --soft HEAD NOTE: --soft has no meaning since Mercurial has no staging area hg update . $ hg githelp -- reset --hard HEAD hg update --clean . githelp for git show --name-status $ hg githelp -- git show --name-status hg log --style status -r . githelp for git show --pretty=format: --name-status $ hg githelp -- git show --pretty=format: --name-status hg status --change . githelp for show with no arguments $ hg githelp -- show hg export githelp for show with a path $ hg githelp -- show test_file hg cat test_file githelp for show with not a path: $ hg githelp -- show rev hg export rev githelp for show with many arguments $ hg githelp -- show argone argtwo hg export argone argtwo $ hg githelp -- show test_file argone argtwo hg cat test_file argone argtwo githelp for show with --unified options $ hg githelp -- show --unified=10 hg export --config diff.unified=10 $ hg githelp -- show -U100 hg export --config diff.unified=100 githelp for show with a path and --unified $ hg githelp -- show -U20 test_file hg cat test_file --config diff.unified=20 githelp for stash drop without name $ hg githelp -- git stash drop hg shelve -d githelp for stash drop with name $ hg githelp -- git stash drop xyz hg shelve -d xyz githelp for whatchanged should show deprecated message $ hg githelp -- whatchanged -p This command has been deprecated in the git project, thus isn't supported by this tool. githelp for git branch -m renaming $ hg githelp -- git branch -m old new hg bookmark -m old new When the old name is omitted, git branch -m new renames the current branch. $ hg githelp -- git branch -m new hg bookmark -m `hg log -T"{activebookmark}" -r .` new Branch deletion in git strips commits $ hg githelp -- git branch -d hg strip -B $ hg githelp -- git branch -d feature hg strip -B feature -B $ hg githelp -- git branch --delete experiment1 experiment2 hg strip -B experiment1 -B experiment2 -B githelp for reuse message using the shorthand $ hg githelp -- git commit -C deadbeef hg commit -M deadbeef githelp for reuse message using the the long version $ hg githelp -- git commit --reuse-message deadbeef hg commit -M deadbeef githelp for apply with no options $ hg githelp -- apply hg import --no-commit githelp for apply with directory strip custom $ hg githelp -- apply -p 5 hg import --no-commit -p 5 git merge-base $ hg githelp -- git merge-base --is-ancestor ignoring unknown option --is-ancestor NOTE: ancestors() is part of the revset language. Learn more about revsets with 'hg help revsets' hg log -T '{node}\n' -r 'ancestor(A,B)' githelp for git blame $ hg githelp -- git blame hg annotate -udl githelp for add $ hg githelp -- git add hg add $ hg githelp -- git add -p note: Mercurial will commit when complete, as there is no staging area in Mercurial hg commit --interactive $ hg githelp -- git add --all note: use hg addremove to remove files that have been deleted. hg add githelp for reflog $ hg githelp -- git reflog hg journal note: in hg commits can be deleted from repo but we always have backups. $ hg githelp -- git reflog --all hg journal --all note: in hg commits can be deleted from repo but we always have backups. mercurial-4.5.3/tests/test-add.t0000644015407300116100000001203313261161234016430 0ustar augieeng00000000000000 $ hg init a $ cd a $ echo a > a $ hg add -n adding a $ hg st ? a $ hg add adding a $ hg st A a $ hg forget a $ hg add adding a $ hg st A a $ mkdir dir $ cd dir $ hg add ../a ../a already tracked! $ cd .. $ echo b > b $ hg add -n b $ hg st A a ? b $ hg add b $ hg st A a A b should fail $ hg add b b already tracked! $ hg st A a A b #if no-windows $ echo foo > con.xml $ hg --config ui.portablefilenames=jump add con.xml abort: ui.portablefilenames value is invalid ('jump') [255] $ hg --config ui.portablefilenames=abort add con.xml abort: filename contains 'con', which is reserved on Windows: con.xml [255] $ hg st A a A b ? con.xml $ hg add con.xml warning: filename contains 'con', which is reserved on Windows: con.xml $ hg st A a A b A con.xml $ hg forget con.xml $ rm con.xml #endif #if eol-in-paths $ echo bla > 'hello:world' $ hg --config ui.portablefilenames=abort add adding hello:world abort: filename contains ':', which is reserved on Windows: 'hello:world' [255] $ hg st A a A b ? hello:world $ hg --config ui.portablefilenames=ignore add adding hello:world $ hg st A a A b A hello:world #endif $ hg ci -m 0 --traceback $ hg log -r "heads(. or wdir() & file('**'))" changeset: 0:* (glob) tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 0 should fail $ hg add a a already tracked! $ echo aa > a $ hg ci -m 1 $ hg up 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo aaa > a $ hg ci -m 2 created new head $ hg merge merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ hg st M a ? a.orig wdir doesn't cause a crash, and can be dynamically selected if dirty $ hg log -r "heads(. or wdir() & file('**'))" changeset: 2147483647:ffffffffffff parent: 2:* (glob) parent: 1:* (glob) user: test date: * (glob) should fail $ hg add a a already tracked! $ hg st M a ? a.orig $ hg resolve -m a (no more unresolved files) $ hg ci -m merge Issue683: peculiarity with hg revert of an removed then added file $ hg forget a $ hg add a $ hg st ? a.orig $ hg rm a $ hg st R a ? a.orig $ echo a > a $ hg add a $ hg st M a ? a.orig Forgotten file can be added back (as either clean or modified) $ hg forget b $ hg add b $ hg st -A b C b $ hg forget b $ echo modified > b $ hg add b $ hg st -A b M b $ hg revert -qC b $ hg add c && echo "unexpected addition of missing file" c: * (glob) [1] $ echo c > c $ hg add d c && echo "unexpected addition of missing file" d: * (glob) [1] $ hg st M a A c ? a.orig $ hg up -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved forget and get should have the right order: added but missing dir should be forgotten before file with same name is added $ echo file d > d $ hg add d $ hg ci -md $ hg rm d $ mkdir d $ echo a > d/a $ hg add d/a $ rm -r d $ hg up -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat d file d Test that adding a directory doesn't require case matching (issue4578) #if icasefs $ mkdir -p CapsDir1/CapsDir $ echo abc > CapsDir1/CapsDir/AbC.txt $ mkdir CapsDir1/CapsDir/SubDir $ echo def > CapsDir1/CapsDir/SubDir/Def.txt $ hg add capsdir1/capsdir adding CapsDir1/CapsDir/AbC.txt adding CapsDir1/CapsDir/SubDir/Def.txt $ hg forget capsdir1/capsdir/abc.txt $ hg forget capsdir1/capsdir removing CapsDir1/CapsDir/SubDir/Def.txt $ hg add capsdir1 adding CapsDir1/CapsDir/AbC.txt adding CapsDir1/CapsDir/SubDir/Def.txt $ hg ci -m "AbCDef" capsdir1/capsdir $ hg status -A capsdir1/capsdir C CapsDir1/CapsDir/AbC.txt C CapsDir1/CapsDir/SubDir/Def.txt $ hg files capsdir1/capsdir CapsDir1/CapsDir/AbC.txt CapsDir1/CapsDir/SubDir/Def.txt $ echo xyz > CapsDir1/CapsDir/SubDir/Def.txt $ hg ci -m xyz capsdir1/capsdir/subdir/def.txt $ hg revert -r '.^' capsdir1/capsdir reverting CapsDir1/CapsDir/SubDir/Def.txt The conditional tests above mean the hash on the diff line differs on Windows and OS X $ hg diff capsdir1/capsdir diff -r * CapsDir1/CapsDir/SubDir/Def.txt (glob) --- a/CapsDir1/CapsDir/SubDir/Def.txt Thu Jan 01 00:00:00 1970 +0000 +++ b/CapsDir1/CapsDir/SubDir/Def.txt * (glob) @@ -1,1 +1,1 @@ -xyz +def $ hg mv CapsDir1/CapsDir/abc.txt CapsDir1/CapsDir/ABC.txt $ hg ci -m "case changing rename" CapsDir1/CapsDir/AbC.txt CapsDir1/CapsDir/ABC.txt $ hg status -A capsdir1/capsdir M CapsDir1/CapsDir/SubDir/Def.txt C CapsDir1/CapsDir/ABC.txt $ hg remove -f 'glob:**.txt' -X capsdir1/capsdir $ hg remove -f 'glob:**.txt' -I capsdir1/capsdir removing CapsDir1/CapsDir/ABC.txt removing CapsDir1/CapsDir/SubDir/Def.txt #endif $ cd .. mercurial-4.5.3/tests/test-mq-qdelete.t0000644015407300116100000000675313261161234017752 0ustar augieeng00000000000000 $ echo "[extensions]" >> $HGRCPATH $ echo "mq=" >> $HGRCPATH $ hg init a $ cd a $ echo 'base' > base $ hg ci -Ambase -d '1 0' adding base $ hg qnew -d '1 0' pa $ hg qnew -d '1 0' pb $ hg qnew -d '1 0' pc $ hg qdel abort: qdelete requires at least one revision or patch name [255] $ hg qdel pc abort: cannot delete applied patch pc [255] $ hg qpop popping pc now at: pb Delete the same patch twice in one command (issue2427) $ hg qdel pc pc $ hg qseries pa pb $ ls .hg/patches pa pb series status $ hg qpop popping pb now at: pa $ hg qdel -k 1 $ ls .hg/patches pa pb series status $ hg qdel -r pa patch pa finalized without changeset message $ hg qapplied $ hg log --template '{rev} {desc}\n' 1 [mq]: pa 0 base $ hg qnew pd $ hg qnew pe $ hg qnew pf $ hg qdel -r pe abort: cannot delete revision 3 above applied patches [255] $ hg qdel -r qbase:pe patch pd finalized without changeset message patch pe finalized without changeset message $ hg qapplied pf $ hg log --template '{rev} {desc}\n' 4 [mq]: pf 3 [mq]: pe 2 [mq]: pd 1 [mq]: pa 0 base $ cd .. $ hg init b $ cd b $ echo 'base' > base $ hg ci -Ambase -d '1 0' adding base $ hg qfinish abort: no revisions specified [255] $ hg qfinish -a no patches applied $ hg qnew -d '1 0' pa $ hg qnew -d '1 0' pb $ hg qnew pc # XXX fails to apply by /usr/bin/patch if we put a date $ hg qfinish 0 abort: revision 0 is not managed [255] $ hg qfinish pb abort: cannot delete revision 2 above applied patches [255] $ hg qpop popping pc now at: pb $ hg qfinish -a pc abort: unknown revision 'pc'! [255] $ hg qpush applying pc patch pc is empty now at: pc $ hg qfinish qbase:pb patch pa finalized without changeset message patch pb finalized without changeset message $ hg qapplied pc $ hg log --template '{rev} {desc}\n' 3 imported patch pc 2 [mq]: pb 1 [mq]: pa 0 base $ hg qfinish -a pc patch pc finalized without changeset message $ hg qapplied $ hg log --template '{rev} {desc}\n' 3 imported patch pc 2 [mq]: pb 1 [mq]: pa 0 base $ ls .hg/patches series status qdel -k X && hg qimp -e X used to trigger spurious output with versioned queues $ hg init --mq $ hg qimport -r 3 $ hg qpop popping imported_patch_pc patch queue now empty $ hg qdel -k imported_patch_pc $ hg qimp -e imported_patch_pc adding imported_patch_pc to series file $ hg qfinish -a no patches applied resilience to inconsistency: qfinish -a with applied patches not in series $ hg qser imported_patch_pc $ hg qapplied $ hg qpush applying imported_patch_pc patch imported_patch_pc is empty now at: imported_patch_pc $ echo next >> base $ hg qrefresh -d '1 0' $ echo > .hg/patches/series # remove 3.diff from series to confuse mq $ hg qfinish -a revision 47dfa8501675 refers to unknown patches: imported_patch_pc more complex state 'both known and unknown patches $ echo hip >> base $ hg qnew -f -d '1 0' -m 4 4.diff $ echo hop >> base $ hg qnew -f -d '1 0' -m 5 5.diff $ echo > .hg/patches/series # remove 4.diff and 5.diff from series to confuse mq $ echo hup >> base $ hg qnew -f -d '1 0' -m 6 6.diff $ echo pup > base $ hg qfinish -a warning: uncommitted changes in the working directory revision 2b1c98802260 refers to unknown patches: 5.diff revision 33a6861311c0 refers to unknown patches: 4.diff $ cd .. mercurial-4.5.3/tests/test-obsolete-bundle-strip.t0000644015407300116100000026030513261161234022131 0ustar augieeng00000000000000================================================== Test obsmarkers interaction with bundle and strip ================================================== Setup a repository with various case ==================================== Config setup ------------ $ cat >> $HGRCPATH < [ui] > # simpler log output > logtemplate = "{node|short}: {desc}\n" > > [experimental] > # enable evolution > evolution=true > > # include obsmarkers in bundle > evolution.bundle-obsmarker = yes > > [extensions] > # needed for some tests > strip = > [defaults] > # we'll query many hidden changeset > debugobsolete = --hidden > EOF $ mkcommit() { > echo "$1" > "$1" > hg add "$1" > hg ci -m "$1" > } $ getid() { > hg log --hidden --template '{node}\n' --rev "$1" > } $ mktestrepo () { > [ -n "$1" ] || exit 1 > cd $TESTTMP > hg init $1 > cd $1 > mkcommit ROOT > } Function to compare the expected bundled obsmarkers with the actually bundled obsmarkers. It also check the obsmarkers backed up during strip. $ testrevs () { > revs="$1" > testname=`basename \`pwd\`` > revsname=`hg --hidden log -T '-{desc}' --rev "${revs}"` > prefix="${TESTTMP}/${testname}${revsname}" > markersfile="${prefix}-relevant-markers.txt" > exclufile="${prefix}-exclusive-markers.txt" > bundlefile="${prefix}-bundle.hg" > contentfile="${prefix}-bundle-markers.hg" > stripcontentfile="${prefix}-bundle-markers.hg" > hg debugobsolete --hidden --rev "${revs}" | sed 's/^/ /' > "${markersfile}" > hg debugobsolete --hidden --rev "${revs}" --exclusive | sed 's/^/ /' > "${exclufile}" > echo '### Matched revisions###' > hg log --hidden --rev "${revs}" | sort > echo '### Relevant markers ###' > cat "${markersfile}" > printf "# bundling: " > hg bundle --hidden --base "parents(roots(${revs}))" --rev "${revs}" "${bundlefile}" > hg debugbundle --part-type obsmarkers "${bundlefile}" | sed 1,3d > "${contentfile}" > echo '### Bundled markers ###' > cat "${contentfile}" > echo '### diff ###' > cmp "${markersfile}" "${contentfile}" || diff -u "${markersfile}" "${contentfile}" > echo '#################################' > echo '### Exclusive markers ###' > cat "${exclufile}" > # if the matched revs do not have children, we also check the result of strip > children=`hg log --hidden --rev "((${revs})::) - (${revs})"` > if [ -z "$children" ]; > then > printf "# stripping: " > prestripfile="${prefix}-pre-strip.txt" > poststripfile="${prefix}-post-strip.txt" > strippedfile="${prefix}-stripped-markers.txt" > hg debugobsolete --hidden | sort | sed 's/^/ /' > "${prestripfile}" > hg strip --hidden --rev "${revs}" > hg debugobsolete --hidden | sort | sed 's/^/ /' > "${poststripfile}" > hg debugbundle --part-type obsmarkers .hg/strip-backup/* | sed 1,3d > "${stripcontentfile}" > echo '### Backup markers ###' > cat "${stripcontentfile}" > echo '### diff ###' > cmp "${markersfile}" "${stripcontentfile}" || diff -u "${markersfile}" "${stripcontentfile}" > echo '#################################' > cat "${prestripfile}" "${poststripfile}" | sort | uniq -u > "${strippedfile}" > echo '### Stripped markers ###' > cat "${strippedfile}" > echo '### diff ###' > cmp "${exclufile}" "${strippedfile}" || diff -u "${exclufile}" "${strippedfile}" > echo '#################################' > # restore and clean up repo for the next test > hg unbundle .hg/strip-backup/* | sed 's/^/# unbundling: /' > # clean up directory for the next test > rm .hg/strip-backup/* > fi > } root setup ------------- simple chain ============ . A0 . ⇠ø⇠◔ A1 . |/ . ◠setup ----- $ mktestrepo simple-chain $ mkcommit 'C-A0' $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit 'C-A1' created new head $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A0")'` $ hg debugobsolete `getid 'desc("C-A0")'` a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 obsoleted 1 changesets $ hg debugobsolete a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 `getid 'desc("C-A1")'` $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg log --hidden -G o cf2c22470d67: C-A1 | | x 84fcb0dfe17b: C-A0 |/ @ ea207398892e: ROOT $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} Actual testing -------------- $ testrevs 'desc("C-A0")' ### Matched revisions### 84fcb0dfe17b: C-A0 ### Relevant markers ### a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 1 changesets found ### Bundled markers ### a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### # stripping: saved backup bundle to $TESTTMP/simple-chain/.hg/strip-backup/84fcb0dfe17b-6454bbdc-backup.hg ### Backup markers ### a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads) # unbundling: (run 'hg heads' to see heads) $ testrevs 'desc("C-A1")' ### Matched revisions### cf2c22470d67: C-A1 ### Relevant markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 1 changesets found ### Bundled markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # stripping: saved backup bundle to $TESTTMP/simple-chain/.hg/strip-backup/cf2c22470d67-fa0f07b0-backup.hg ### Backup markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads) # unbundling: 2 new obsolescence markers # unbundling: obsoleted 1 changesets # unbundling: new changesets cf2c22470d67 # unbundling: (run 'hg heads' to see heads) $ testrevs 'desc("C-A")' ### Matched revisions### 84fcb0dfe17b: C-A0 cf2c22470d67: C-A1 ### Relevant markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 2 changesets found ### Bundled markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # stripping: saved backup bundle to $TESTTMP/simple-chain/.hg/strip-backup/cf2c22470d67-fce4fc64-backup.hg ### Backup markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 2 changesets with 2 changes to 2 files (+1 heads) # unbundling: 3 new obsolescence markers # unbundling: new changesets cf2c22470d67 # unbundling: (run 'hg heads' to see heads) chain with prune children ========================= . ⇠⊗ B0 . | . ⇠ø⇠◔ A1 . | . ◠setup ----- $ mktestrepo prune $ mkcommit 'C-A0' $ mkcommit 'C-B0' $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ mkcommit 'C-A1' created new head $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A0")'` $ hg debugobsolete `getid 'desc("C-A0")'` `getid 'desc("C-A1")'` obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete --record-parents `getid 'desc("C-B0")'` obsoleted 1 changesets $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg log --hidden -G o cf2c22470d67: C-A1 | | x 29f93b1df87b: C-B0 | | | x 84fcb0dfe17b: C-A0 |/ @ ea207398892e: ROOT $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} Actual testing -------------- $ testrevs 'desc("C-A0")' ### Matched revisions### 84fcb0dfe17b: C-A0 ### Relevant markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 1 changesets found ### Bundled markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### (The strip markers is considered exclusive to the pruned changeset even if it is also considered "relevant" to its parent. This allows to strip prune markers. This avoid leaving prune markers from dead-end that could be problematic) $ testrevs 'desc("C-B0")' ### Matched revisions### 29f93b1df87b: C-B0 ### Relevant markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 1 changesets found ### Bundled markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # stripping: saved backup bundle to $TESTTMP/prune/.hg/strip-backup/29f93b1df87b-7fb32101-backup.hg ### Backup markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 1 changesets with 1 changes to 1 files # unbundling: 1 new obsolescence markers # unbundling: (run 'hg update' to get a working copy) $ testrevs 'desc("C-A1")' ### Matched revisions### cf2c22470d67: C-A1 ### Relevant markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 1 changesets found ### Bundled markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # stripping: saved backup bundle to $TESTTMP/prune/.hg/strip-backup/cf2c22470d67-fa0f07b0-backup.hg ### Backup markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads) # unbundling: 1 new obsolescence markers # unbundling: obsoleted 1 changesets # unbundling: new changesets cf2c22470d67 # unbundling: (run 'hg heads' to see heads) bundling multiple revisions $ testrevs 'desc("C-A")' ### Matched revisions### 84fcb0dfe17b: C-A0 cf2c22470d67: C-A1 ### Relevant markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 2 changesets found ### Bundled markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ testrevs 'desc("C-")' ### Matched revisions### 29f93b1df87b: C-B0 84fcb0dfe17b: C-A0 cf2c22470d67: C-A1 ### Relevant markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 3 changesets found ### Bundled markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # stripping: saved backup bundle to $TESTTMP/prune/.hg/strip-backup/cf2c22470d67-884c33b0-backup.hg ### Backup markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 3 changesets with 3 changes to 3 files (+1 heads) # unbundling: 3 new obsolescence markers # unbundling: new changesets cf2c22470d67 # unbundling: (run 'hg heads' to see heads) chain with precursors also pruned ================================= . A0 (also pruned) . ⇠ø⇠◔ A1 . | . ◠setup ----- $ mktestrepo prune-inline $ mkcommit 'C-A0' $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit 'C-A1' created new head $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A0")'` $ hg debugobsolete --record-parents `getid 'desc("C-A0")'` obsoleted 1 changesets $ hg debugobsolete `getid 'desc("C-A0")'` `getid 'desc("C-A1")'` $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg log --hidden -G o cf2c22470d67: C-A1 | | x 84fcb0dfe17b: C-A0 |/ @ ea207398892e: ROOT $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} Actual testing -------------- $ testrevs 'desc("C-A0")' ### Matched revisions### 84fcb0dfe17b: C-A0 ### Relevant markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 1 changesets found ### Bundled markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### # stripping: saved backup bundle to $TESTTMP/prune-inline/.hg/strip-backup/84fcb0dfe17b-6454bbdc-backup.hg ### Backup markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads) # unbundling: (run 'hg heads' to see heads) $ testrevs 'desc("C-A1")' ### Matched revisions### cf2c22470d67: C-A1 ### Relevant markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 1 changesets found ### Bundled markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # stripping: saved backup bundle to $TESTTMP/prune-inline/.hg/strip-backup/cf2c22470d67-fa0f07b0-backup.hg ### Backup markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads) # unbundling: 1 new obsolescence markers # unbundling: new changesets cf2c22470d67 # unbundling: (run 'hg heads' to see heads) $ testrevs 'desc("C-A")' ### Matched revisions### 84fcb0dfe17b: C-A0 cf2c22470d67: C-A1 ### Relevant markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 2 changesets found ### Bundled markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # stripping: saved backup bundle to $TESTTMP/prune-inline/.hg/strip-backup/cf2c22470d67-fce4fc64-backup.hg ### Backup markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 2 changesets with 2 changes to 2 files (+1 heads) # unbundling: 3 new obsolescence markers # unbundling: new changesets cf2c22470d67 # unbundling: (run 'hg heads' to see heads) chain with missing prune ======================== . ⊗ B . | . ⇠◌⇠◔ A1 . | . ◠setup ----- $ mktestrepo missing-prune $ mkcommit 'C-A0' $ mkcommit 'C-B0' $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ mkcommit 'C-A1' created new head $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A0")'` $ hg debugobsolete `getid 'desc("C-A0")'` `getid 'desc("C-A1")'` obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete --record-parents `getid 'desc("C-B0")'` obsoleted 1 changesets (it is annoying to create prune with parent data without the changeset, so we strip it after the fact) $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup --config devel.strip-obsmarkers=no $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg log --hidden -G o cf2c22470d67: C-A1 | @ ea207398892e: ROOT $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} Actual testing -------------- $ testrevs 'desc("C-A1")' ### Matched revisions### cf2c22470d67: C-A1 ### Relevant markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 1 changesets found ### Bundled markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # stripping: saved backup bundle to $TESTTMP/missing-prune/.hg/strip-backup/cf2c22470d67-fa0f07b0-backup.hg ### Backup markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### 29f93b1df87baee1824e014080d8adf145f81783 0 {84fcb0dfe17b256ebae52e05572993b9194c018a} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 1 changesets with 1 changes to 1 files # unbundling: 3 new obsolescence markers # unbundling: new changesets cf2c22470d67 # unbundling: (run 'hg update' to get a working copy) chain with precursors also pruned ================================= . A0 (also pruned) . ⇠◌⇠◔ A1 . | . ◠setup ----- $ mktestrepo prune-inline-missing $ mkcommit 'C-A0' $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit 'C-A1' created new head $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A0")'` $ hg debugobsolete --record-parents `getid 'desc("C-A0")'` obsoleted 1 changesets $ hg debugobsolete `getid 'desc("C-A0")'` `getid 'desc("C-A1")'` (it is annoying to create prune with parent data without the changeset, so we strip it after the fact) $ hg strip --hidden --rev 'desc("C-A0")::' --no-backup --config devel.strip-obsmarkers=no $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg log --hidden -G o cf2c22470d67: C-A1 | @ ea207398892e: ROOT $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} Actual testing -------------- $ testrevs 'desc("C-A1")' ### Matched revisions### cf2c22470d67: C-A1 ### Relevant markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 1 changesets found ### Bundled markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # stripping: saved backup bundle to $TESTTMP/prune-inline-missing/.hg/strip-backup/cf2c22470d67-fa0f07b0-backup.hg ### Backup markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### 84fcb0dfe17b256ebae52e05572993b9194c018a 0 {ea207398892eb49e06441f10dda2a731f0450f20} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 84fcb0dfe17b256ebae52e05572993b9194c018a cf2c22470d67233004e934a31184ac2b35389914 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 84fcb0dfe17b256ebae52e05572993b9194c018a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 1 changesets with 1 changes to 1 files # unbundling: 3 new obsolescence markers # unbundling: new changesets cf2c22470d67 # unbundling: (run 'hg update' to get a working copy) Chain with fold and split ========================= setup ----- $ mktestrepo split-fold $ mkcommit 'C-A' $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit 'C-B' created new head $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit 'C-C' created new head $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit 'C-D' created new head $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit 'C-E' created new head $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 `getid 'desc("C-A")'` $ hg debugobsolete `getid 'desc("C-A")'` `getid 'desc("C-B")'` `getid 'desc("C-C")'` # record split obsoleted 1 changesets $ hg debugobsolete `getid 'desc("C-A")'` `getid 'desc("C-D")'` # other divergent 3 new content-divergent changesets $ hg debugobsolete `getid 'desc("C-A")'` b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 $ hg debugobsolete b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 `getid 'desc("C-E")'` 1 new content-divergent changesets $ hg debugobsolete `getid 'desc("C-B")'` `getid 'desc("C-E")'` obsoleted 1 changesets $ hg debugobsolete `getid 'desc("C-C")'` `getid 'desc("C-E")'` obsoleted 1 changesets $ hg debugobsolete `getid 'desc("C-D")'` `getid 'desc("C-E")'` obsoleted 1 changesets $ hg debugobsolete c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 `getid 'desc("C-E")'` $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg log --hidden -G o 2f20ff6509f0: C-E | | x 06dc9da25ef0: C-D |/ | x 27ec657ca21d: C-C |/ | x a9b9da38ed96: C-B |/ | x 9ac430e15fca: C-A |/ @ ea207398892e: ROOT $ hg debugobsolete a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} Actual testing -------------- $ testrevs 'desc("C-A")' ### Matched revisions### 9ac430e15fca: C-A ### Relevant markers ### a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 1 changesets found ### Bundled markers ### a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/9ac430e15fca-81204eba-backup.hg ### Backup markers ### a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads) # unbundling: (run 'hg heads' to see heads) $ testrevs 'desc("C-B")' ### Matched revisions### a9b9da38ed96: C-B ### Relevant markers ### 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 1 changesets found ### Bundled markers ### 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/a9b9da38ed96-7465d6e9-backup.hg ### Backup markers ### 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads) # unbundling: (run 'hg heads' to see heads) $ testrevs 'desc("C-C")' ### Matched revisions### 27ec657ca21d: C-C ### Relevant markers ### 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 1 changesets found ### Bundled markers ### 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/27ec657ca21d-d5dd1c7c-backup.hg ### Backup markers ### 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads) # unbundling: (run 'hg heads' to see heads) $ testrevs 'desc("C-D")' ### Matched revisions### 06dc9da25ef0: C-D ### Relevant markers ### 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 1 changesets found ### Bundled markers ### 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/06dc9da25ef0-9b1c0a91-backup.hg ### Backup markers ### 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads) # unbundling: (run 'hg heads' to see heads) $ testrevs 'desc("C-E")' ### Matched revisions### 2f20ff6509f0: C-E ### Relevant markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 1 changesets found ### Bundled markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/2f20ff6509f0-8adeb22d-backup.hg 3 new content-divergent changesets ### Backup markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 1 changesets with 1 changes to 1 files (+1 heads) # unbundling: 6 new obsolescence markers # unbundling: obsoleted 3 changesets # unbundling: new changesets 2f20ff6509f0 # unbundling: (run 'hg heads' to see heads) Bundle multiple revisions * each part of the split $ testrevs 'desc("C-B") + desc("C-C")' ### Matched revisions### 27ec657ca21d: C-C a9b9da38ed96: C-B ### Relevant markers ### 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 2 changesets found ### Bundled markers ### 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/a9b9da38ed96-0daf625a-backup.hg ### Backup markers ### 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 2 changesets with 2 changes to 2 files (+2 heads) # unbundling: (run 'hg heads' to see heads) * top one and other divergent $ testrevs 'desc("C-E") + desc("C-D")' ### Matched revisions### 06dc9da25ef0: C-D 2f20ff6509f0: C-E ### Relevant markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 2 changesets found ### Bundled markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/2f20ff6509f0-bf1b80f4-backup.hg ### Backup markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 2 changesets with 2 changes to 2 files (+2 heads) # unbundling: 7 new obsolescence markers # unbundling: obsoleted 2 changesets # unbundling: new changesets 2f20ff6509f0 # unbundling: (run 'hg heads' to see heads) * top one and initial precursors $ testrevs 'desc("C-E") + desc("C-A")' ### Matched revisions### 2f20ff6509f0: C-E 9ac430e15fca: C-A ### Relevant markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 2 changesets found ### Bundled markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/9ac430e15fca-36b6476a-backup.hg 3 new content-divergent changesets ### Backup markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 2 changesets with 2 changes to 2 files (+2 heads) # unbundling: 6 new obsolescence markers # unbundling: obsoleted 3 changesets # unbundling: new changesets 2f20ff6509f0 # unbundling: (run 'hg heads' to see heads) * top one and one of the split $ testrevs 'desc("C-E") + desc("C-C")' ### Matched revisions### 27ec657ca21d: C-C 2f20ff6509f0: C-E ### Relevant markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 2 changesets found ### Bundled markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/2f20ff6509f0-5fdfcd7d-backup.hg ### Backup markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 2 changesets with 2 changes to 2 files (+2 heads) # unbundling: 7 new obsolescence markers # unbundling: obsoleted 2 changesets # unbundling: new changesets 2f20ff6509f0 # unbundling: (run 'hg heads' to see heads) * all $ testrevs 'desc("C-")' ### Matched revisions### 06dc9da25ef0: C-D 27ec657ca21d: C-C 2f20ff6509f0: C-E 9ac430e15fca: C-A a9b9da38ed96: C-B ### Relevant markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 5 changesets found ### Bundled markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # stripping: saved backup bundle to $TESTTMP/split-fold/.hg/strip-backup/a9b9da38ed96-eeb4258f-backup.hg ### Backup markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 27ec657ca21dd27c36c99fa75586f72ff0d442f1 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 06dc9da25ef03e1ff7864dded5fcba42eff2a3f0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c a9b9da38ed96f8c6c14f429441f625a344eb4696 27ec657ca21dd27c36c99fa75586f72ff0d442f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0 9ac430e15fca923b0ba027ca85d4d75c5c9cb73c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} a9b9da38ed96f8c6c14f429441f625a344eb4696 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 2f20ff6509f0e013e90c5c8efd996131c918b0ca 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 5 changesets with 5 changes to 5 files (+4 heads) # unbundling: 9 new obsolescence markers # unbundling: new changesets 2f20ff6509f0 # unbundling: (run 'hg heads' to see heads) changeset pruned on its own =========================== . ⊗ B . | . ◕ A . | . ◠setup ----- $ mktestrepo lonely-prune $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ mkcommit 'C-A' $ mkcommit 'C-B' $ hg debugobsolete --record-parent `getid 'desc("C-B")'` obsoleted 1 changesets $ hg up 'desc("ROOT")' 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg log --hidden -G x cefb651fc2fd: C-B | o 9ac430e15fca: C-A | @ ea207398892e: ROOT $ hg debugobsolete cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} Actual testing -------------- $ testrevs 'desc("C-A")' ### Matched revisions### 9ac430e15fca: C-A ### Relevant markers ### cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 1 changesets found ### Bundled markers ### cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### $ testrevs 'desc("C-B")' ### Matched revisions### cefb651fc2fd: C-B ### Relevant markers ### cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 1 changesets found ### Bundled markers ### cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # stripping: saved backup bundle to $TESTTMP/lonely-prune/.hg/strip-backup/cefb651fc2fd-345c8dfa-backup.hg ### Backup markers ### cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 1 changesets with 1 changes to 1 files # unbundling: 1 new obsolescence markers # unbundling: (run 'hg update' to get a working copy) $ testrevs 'desc("C-")' ### Matched revisions### 9ac430e15fca: C-A cefb651fc2fd: C-B ### Relevant markers ### cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # bundling: 2 changesets found ### Bundled markers ### cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Exclusive markers ### cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # stripping: saved backup bundle to $TESTTMP/lonely-prune/.hg/strip-backup/9ac430e15fca-b9855b02-backup.hg ### Backup markers ### cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# ### Stripped markers ### cefb651fc2fdc7bb75e588781de5e432c134e8a5 0 {9ac430e15fca923b0ba027ca85d4d75c5c9cb73c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} ### diff ### ################################# # unbundling: adding changesets # unbundling: adding manifests # unbundling: adding file changes # unbundling: added 2 changesets with 2 changes to 2 files # unbundling: 1 new obsolescence markers # unbundling: new changesets 9ac430e15fca # unbundling: (run 'hg update' to get a working copy) mercurial-4.5.3/tests/test-convert-filemap.t0000644015407300116100000005431013261161234020777 0ustar augieeng00000000000000 $ HGMERGE=true; export HGMERGE $ echo '[extensions]' >> $HGRCPATH $ echo 'convert =' >> $HGRCPATH $ glog() > { > hg log -G --template '{rev} "{desc}" files: {files}\n' "$@" > } $ hg init source $ cd source $ echo foo > foo $ echo baz > baz $ mkdir -p dir/subdir $ echo dir/file >> dir/file $ echo dir/file2 >> dir/file2 $ echo dir/file3 >> dir/file3 # to be corrupted in rev 0 $ echo dir/subdir/file3 >> dir/subdir/file3 $ echo dir/subdir/file4 >> dir/subdir/file4 $ hg ci -d '0 0' -qAm '0: add foo baz dir/' $ echo bar > bar $ echo quux > quux $ echo dir/file4 >> dir/file4 # to be corrupted in rev 1 $ hg copy foo copied $ hg ci -d '1 0' -qAm '1: add bar quux; copy foo to copied' $ echo >> foo $ hg ci -d '2 0' -m '2: change foo' $ hg up -qC 1 $ echo >> bar $ echo >> quux $ hg ci -d '3 0' -m '3: change bar quux' created new head $ hg up -qC 2 $ hg merge -qr 3 $ echo >> bar $ echo >> baz $ hg ci -d '4 0' -m '4: first merge; change bar baz' $ echo >> bar $ echo 1 >> baz $ echo >> quux $ hg ci -d '5 0' -m '5: change bar baz quux' $ hg up -qC 4 $ echo >> foo $ echo 2 >> baz $ hg ci -d '6 0' -m '6: change foo baz' created new head $ hg up -qC 5 $ hg merge -qr 6 $ echo >> bar $ hg ci -d '7 0' -m '7: second merge; change bar' $ echo >> foo $ hg ci -m '8: change foo' $ glog @ 8 "8: change foo" files: foo | o 7 "7: second merge; change bar" files: bar baz |\ | o 6 "6: change foo baz" files: baz foo | | o | 5 "5: change bar baz quux" files: bar baz quux |/ o 4 "4: first merge; change bar baz" files: bar baz |\ | o 3 "3: change bar quux" files: bar quux | | o | 2 "2: change foo" files: foo |/ o 1 "1: add bar quux; copy foo to copied" files: bar copied dir/file4 quux | o 0 "0: add foo baz dir/" files: baz dir/file dir/file2 dir/file3 dir/subdir/file3 dir/subdir/file4 foo final file versions in this repo: $ hg manifest --debug 9463f52fe115e377cf2878d4fc548117211063f2 644 bar 94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644 baz 7711d36246cc83e61fb29cd6d4ef394c63f1ceaf 644 copied 3e20847584beff41d7cd16136b7331ab3d754be0 644 dir/file 75e6d3f8328f5f6ace6bf10b98df793416a09dca 644 dir/file2 e96dce0bc6a217656a3a410e5e6bec2c4f42bf7c 644 dir/file3 6edd55f559cdce67132b12ca09e09cee08b60442 644 dir/file4 5fe139720576e18e34bcc9f79174db8897c8afe9 644 dir/subdir/file3 57a1c1511590f3de52874adfa04effe8a77d64af 644 dir/subdir/file4 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux $ hg debugrename copied copied renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd $ cd .. Test interaction with startrev and verify that changing it is handled properly: $ > empty $ hg convert --filemap empty source movingstart --config convert.hg.startrev=3 -r4 initializing destination movingstart repository scanning source... sorting... converting... 1 3: change bar quux 0 4: first merge; change bar baz $ hg convert --filemap empty source movingstart scanning source... sorting... converting... 3 5: change bar baz quux 2 6: change foo baz 1 7: second merge; change bar warning: af455ce4166b3c9c88e6309c2b9332171dcea595 parent 61e22ca76c3b3e93df20338c4e02ce286898e825 is missing warning: cf908b3eeedc301c9272ebae931da966d5b326c7 parent 59e1ab45c888289513b7354484dac8a88217beab is missing 0 8: change foo splitrepo tests $ splitrepo() > { > msg="$1" > files="$2" > opts=$3 > echo "% $files: $msg" > prefix=`echo "$files" | sed -e 's/ /-/g'` > fmap="$prefix.fmap" > repo="$prefix.repo" > for i in $files; do > echo "include $i" >> "$fmap" > done > hg -q convert $opts --filemap "$fmap" --datesort source "$repo" > hg up -q -R "$repo" > glog -R "$repo" > hg -R "$repo" manifest --debug > } $ splitrepo 'skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd' foo % foo: skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd @ 3 "8: change foo" files: foo | o 2 "6: change foo baz" files: foo | o 1 "2: change foo" files: foo | o 0 "0: add foo baz dir/" files: foo 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo $ splitrepo 'merges are not merges anymore' bar % bar: merges are not merges anymore @ 4 "7: second merge; change bar" files: bar | o 3 "5: change bar baz quux" files: bar | o 2 "4: first merge; change bar baz" files: bar | o 1 "3: change bar quux" files: bar | o 0 "1: add bar quux; copy foo to copied" files: bar 9463f52fe115e377cf2878d4fc548117211063f2 644 bar $ splitrepo '1st merge is not a merge anymore; 2nd still is' baz % baz: 1st merge is not a merge anymore; 2nd still is @ 4 "7: second merge; change bar" files: baz |\ | o 3 "6: change foo baz" files: baz | | o | 2 "5: change bar baz quux" files: baz |/ o 1 "4: first merge; change bar baz" files: baz | o 0 "0: add foo baz dir/" files: baz 94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644 baz $ splitrepo 'we add additional merges when they are interesting' 'foo quux' % foo quux: we add additional merges when they are interesting @ 8 "8: change foo" files: foo | o 7 "7: second merge; change bar" files: |\ | o 6 "6: change foo baz" files: foo | | o | 5 "5: change bar baz quux" files: quux |/ o 4 "4: first merge; change bar baz" files: |\ | o 3 "3: change bar quux" files: quux | | o | 2 "2: change foo" files: foo |/ o 1 "1: add bar quux; copy foo to copied" files: quux | o 0 "0: add foo baz dir/" files: foo 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux $ splitrepo 'partial conversion' 'bar quux' '-r 3' % bar quux: partial conversion @ 1 "3: change bar quux" files: bar quux | o 0 "1: add bar quux; copy foo to copied" files: bar quux b79105bedc55102f394e90a789c9c380117c1b4a 644 bar db0421cc6b685a458c8d86c7d5c004f94429ea23 644 quux $ splitrepo 'complete the partial conversion' 'bar quux' % bar quux: complete the partial conversion @ 4 "7: second merge; change bar" files: bar | o 3 "5: change bar baz quux" files: bar quux | o 2 "4: first merge; change bar baz" files: bar | o 1 "3: change bar quux" files: bar quux | o 0 "1: add bar quux; copy foo to copied" files: bar quux 9463f52fe115e377cf2878d4fc548117211063f2 644 bar bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux $ rm -r foo.repo $ splitrepo 'partial conversion' 'foo' '-r 3' % foo: partial conversion @ 0 "0: add foo baz dir/" files: foo 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo $ splitrepo 'complete the partial conversion' 'foo' % foo: complete the partial conversion @ 3 "8: change foo" files: foo | o 2 "6: change foo baz" files: foo | o 1 "2: change foo" files: foo | o 0 "0: add foo baz dir/" files: foo 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo $ splitrepo 'copied file; source not included in new repo' copied % copied: copied file; source not included in new repo @ 0 "1: add bar quux; copy foo to copied" files: copied 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 copied $ hg --cwd copied.repo debugrename copied copied not renamed $ splitrepo 'copied file; source included in new repo' 'foo copied' % foo copied: copied file; source included in new repo @ 4 "8: change foo" files: foo | o 3 "6: change foo baz" files: foo | o 2 "2: change foo" files: foo | o 1 "1: add bar quux; copy foo to copied" files: copied | o 0 "0: add foo baz dir/" files: foo 7711d36246cc83e61fb29cd6d4ef394c63f1ceaf 644 copied 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo $ hg --cwd foo-copied.repo debugrename copied copied renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd verify the top level 'include .' if there is no other includes: $ echo "exclude something" > default.fmap $ hg convert -q --filemap default.fmap -r1 source dummydest2 $ hg -R dummydest2 log --template '{rev} {node|short} {desc|firstline}\n' 1 61e22ca76c3b 1: add bar quux; copy foo to copied 0 c085cf2ee7fe 0: add foo baz dir/ $ echo "include somethingelse" >> default.fmap $ hg convert -q --filemap default.fmap -r1 source dummydest3 $ hg -R dummydest3 log --template '{rev} {node|short} {desc|firstline}\n' $ echo "include ." >> default.fmap $ hg convert -q --filemap default.fmap -r1 source dummydest4 $ hg -R dummydest4 log --template '{rev} {node|short} {desc|firstline}\n' 1 61e22ca76c3b 1: add bar quux; copy foo to copied 0 c085cf2ee7fe 0: add foo baz dir/ ensure that the filemap contains duplicated slashes (issue3612) $ cat > renames.fmap < include dir > exclude dir/file2 > rename dir dir2//dir3 > include foo > include copied > rename foo foo2/ > rename copied ./copied2 > exclude dir/subdir > include dir/subdir/file3 > EOF $ rm source/.hg/store/data/dir/file3.i $ rm source/.hg/store/data/dir/file4.i $ hg -q convert --filemap renames.fmap --datesort source dummydest abort: data/dir/file3.i@e96dce0bc6a2: no match found! [255] $ hg -q convert --filemap renames.fmap --datesort --config convert.hg.ignoreerrors=1 source renames.repo ignoring: data/dir/file3.i@e96dce0bc6a2: no match found ignoring: data/dir/file4.i@6edd55f559cd: no match found $ hg up -q -R renames.repo $ glog -R renames.repo @ 4 "8: change foo" files: foo2 | o 3 "6: change foo baz" files: foo2 | o 2 "2: change foo" files: foo2 | o 1 "1: add bar quux; copy foo to copied" files: copied2 | o 0 "0: add foo baz dir/" files: dir2/dir3/file dir2/dir3/subdir/file3 foo2 $ hg -R renames.repo verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 4 files, 5 changesets, 7 total revisions $ hg -R renames.repo manifest --debug d43feacba7a4f1f2080dde4a4b985bd8a0236d46 644 copied2 3e20847584beff41d7cd16136b7331ab3d754be0 644 dir2/dir3/file 5fe139720576e18e34bcc9f79174db8897c8afe9 644 dir2/dir3/subdir/file3 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo2 $ hg --cwd renames.repo debugrename copied2 copied2 renamed from foo2:2ed2a3912a0b24502043eae84ee4b279c18b90dd copied: $ hg --cwd source cat copied foo copied2: $ hg --cwd renames.repo cat copied2 foo filemap errors $ cat > errors.fmap < include dir/ # beware that comments changes error line numbers! > exclude /dir > rename dir//dir /dir//dir/ "out of sync" > include > EOF $ hg -q convert --filemap errors.fmap source errors.repo errors.fmap:3: superfluous / in include '/dir' errors.fmap:3: superfluous / in rename '/dir' errors.fmap:4: unknown directive 'out of sync' errors.fmap:5: path to exclude is missing abort: errors in filemap [255] test branch closing revision pruning if branch is pruned $ hg init branchpruning $ cd branchpruning $ hg branch foo marked working directory as branch foo (branches are permanent and global, did you want a bookmark?) $ echo a > a $ hg ci -Am adda adding a $ hg ci --close-branch -m closefoo $ hg up 0 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg branch empty marked working directory as branch empty (branches are permanent and global, did you want a bookmark?) $ hg ci -m emptybranch $ hg ci --close-branch -m closeempty $ hg up 0 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg branch default marked working directory as branch default (branches are permanent and global, did you want a bookmark?) $ echo b > b $ hg ci -Am addb adding b $ hg ci --close-branch -m closedefault $ cat > filemap < include b > EOF $ cd .. $ hg convert branchpruning branchpruning-hg1 initializing destination branchpruning-hg1 repository scanning source... sorting... converting... 5 adda 4 closefoo 3 emptybranch 2 closeempty 1 addb 0 closedefault $ glog -R branchpruning-hg1 _ 5 "closedefault" files: | o 4 "addb" files: b | | _ 3 "closeempty" files: | | | o 2 "emptybranch" files: |/ | _ 1 "closefoo" files: |/ o 0 "adda" files: a exercise incremental conversion at the same time $ hg convert -r0 --filemap branchpruning/filemap branchpruning branchpruning-hg2 initializing destination branchpruning-hg2 repository scanning source... sorting... converting... 0 adda $ hg convert -r4 --filemap branchpruning/filemap branchpruning branchpruning-hg2 scanning source... sorting... converting... 0 addb $ hg convert --filemap branchpruning/filemap branchpruning branchpruning-hg2 scanning source... sorting... converting... 3 closefoo 2 emptybranch 1 closeempty 0 closedefault $ glog -R branchpruning-hg2 _ 1 "closedefault" files: | o 0 "addb" files: b Test rebuilding of map with unknown revisions in shamap - it used to crash $ cd branchpruning $ hg up -r 2 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg merge 4 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m 'merging something' $ cd .. $ echo "53792d18237d2b64971fa571936869156655338d 6d955580116e82c4b029bd30f321323bae71a7f0" >> branchpruning-hg2/.hg/shamap $ hg convert --filemap branchpruning/filemap branchpruning branchpruning-hg2 --debug --config progress.debug=true run hg source pre-conversion action run hg sink pre-conversion action scanning source... scanning: 1 revisions sorting... converting... 0 merging something source: 2503605b178fe50e8fbbb0e77b97939540aa8c87 converting: 0/1 revisions (0.00%) unknown revmap source: 53792d18237d2b64971fa571936869156655338d run hg sink post-conversion action run hg source post-conversion action filemap rename undoing revision rename $ hg init renameundo $ cd renameundo $ echo 1 > a $ echo 1 > c $ hg ci -qAm add $ hg mv -q a b/a $ hg mv -q c b/c $ hg ci -qm rename $ echo 2 > b/a $ echo 2 > b/c $ hg ci -qm modify $ cd .. $ echo "rename b ." > renameundo.fmap $ hg convert --filemap renameundo.fmap renameundo renameundo2 initializing destination renameundo2 repository scanning source... sorting... converting... 2 add 1 rename filtering out empty revision repository tip rolled back to revision 0 (undo convert) 0 modify $ glog -R renameundo2 o 1 "modify" files: a c | o 0 "add" files: a c test merge parents/empty merges pruning $ glog() > { > hg log -G --template '{rev}:{node|short}@{branch} "{desc}" files: {files}\n' "$@" > } test anonymous branch pruning $ hg init anonymousbranch $ cd anonymousbranch $ echo a > a $ echo b > b $ hg ci -Am add adding a adding b $ echo a >> a $ hg ci -m changea $ hg up 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo b >> b $ hg ci -m changeb created new head $ hg up 1 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m merge $ cd .. $ cat > filemap < include a > EOF $ hg convert --filemap filemap anonymousbranch anonymousbranch-hg initializing destination anonymousbranch-hg repository scanning source... sorting... converting... 3 add 2 changea 1 changeb 0 merge $ glog -R anonymousbranch @ 3:c71d5201a498@default "merge" files: |\ | o 2:607eb44b17f9@default "changeb" files: b | | o | 1:1f60ea617824@default "changea" files: a |/ o 0:0146e6129113@default "add" files: a b $ glog -R anonymousbranch-hg o 1:cda818e7219b@default "changea" files: a | o 0:c334dc3be0da@default "add" files: a $ cat anonymousbranch-hg/.hg/shamap 0146e6129113dba9ac90207cfdf2d7ed35257ae5 c334dc3be0daa2a4e9ce4d2e2bdcba40c09d4916 1f60ea61782421edf8d051ff4fcb61b330f26a4a cda818e7219b5f7f3fb9f49780054ed6a1905ec3 607eb44b17f9348cd5cbd26e16af87ba77b0b037 c334dc3be0daa2a4e9ce4d2e2bdcba40c09d4916 c71d5201a498b2658d105a6bf69d7a0df2649aea cda818e7219b5f7f3fb9f49780054ed6a1905ec3 $ cat > filemap < include b > EOF $ hg convert --filemap filemap anonymousbranch anonymousbranch-hg2 initializing destination anonymousbranch-hg2 repository scanning source... sorting... converting... 3 add 2 changea 1 changeb 0 merge $ glog -R anonymousbranch @ 3:c71d5201a498@default "merge" files: |\ | o 2:607eb44b17f9@default "changeb" files: b | | o | 1:1f60ea617824@default "changea" files: a |/ o 0:0146e6129113@default "add" files: a b $ glog -R anonymousbranch-hg2 o 1:62dd350b0df6@default "changeb" files: b | o 0:4b9ced861657@default "add" files: b $ cat anonymousbranch-hg2/.hg/shamap 0146e6129113dba9ac90207cfdf2d7ed35257ae5 4b9ced86165703791653059a1db6ed864630a523 1f60ea61782421edf8d051ff4fcb61b330f26a4a 4b9ced86165703791653059a1db6ed864630a523 607eb44b17f9348cd5cbd26e16af87ba77b0b037 62dd350b0df695f7d2c82a02e0499b16fd790f22 c71d5201a498b2658d105a6bf69d7a0df2649aea 62dd350b0df695f7d2c82a02e0499b16fd790f22 test named branch pruning $ hg init namedbranch $ cd namedbranch $ echo a > a $ echo b > b $ hg ci -Am add adding a adding b $ echo a >> a $ hg ci -m changea $ hg up 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg branch foo marked working directory as branch foo (branches are permanent and global, did you want a bookmark?) $ echo b >> b $ hg ci -m changeb $ hg up default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge foo 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m merge $ cd .. $ cat > filemap < include a > EOF $ hg convert --filemap filemap namedbranch namedbranch-hg initializing destination namedbranch-hg repository scanning source... sorting... converting... 3 add 2 changea 1 changeb 0 merge $ glog -R namedbranch @ 3:73899bcbe45c@default "merge" files: |\ | o 2:8097982d19fc@foo "changeb" files: b | | o | 1:1f60ea617824@default "changea" files: a |/ o 0:0146e6129113@default "add" files: a b $ glog -R namedbranch-hg o 1:cda818e7219b@default "changea" files: a | o 0:c334dc3be0da@default "add" files: a $ cd namedbranch $ hg --config extensions.mq= strip tip 1 files updated, 0 files merged, 0 files removed, 0 files unresolved saved backup bundle to $TESTTMP/namedbranch/.hg/strip-backup/73899bcbe45c-92adf160-backup.hg $ hg up foo 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m merge $ cd .. $ hg convert --filemap filemap namedbranch namedbranch-hg2 initializing destination namedbranch-hg2 repository scanning source... sorting... converting... 3 add 2 changea 1 changeb 0 merge $ glog -R namedbranch @ 3:e1959de76e1b@foo "merge" files: |\ | o 2:8097982d19fc@foo "changeb" files: b | | o | 1:1f60ea617824@default "changea" files: a |/ o 0:0146e6129113@default "add" files: a b $ glog -R namedbranch-hg2 o 2:dcf314454667@foo "merge" files: |\ | o 1:cda818e7219b@default "changea" files: a |/ o 0:c334dc3be0da@default "add" files: a $ cd .. test converting merges into a repo that contains other files $ hg init merge-test1 $ cd merge-test1 $ touch a && hg commit -Aqm 'add a' $ echo a > a && hg commit -Aqm 'edit a' $ hg up -q 0 $ touch b && hg commit -Aqm 'add b' $ hg merge -q 1 && hg commit -qm 'merge a & b' $ cd .. $ hg init merge-test2 $ cd merge-test2 $ mkdir converted $ touch converted/a toberemoved && hg commit -Aqm 'add converted/a & toberemoved' $ touch x && rm toberemoved && hg commit -Aqm 'add x & remove tobremoved' $ cd .. $ hg log -G -T '{shortest(node)} {desc}' -R merge-test1 @ 1191 merge a & b |\ | o 9077 add b | | o | d19f edit a |/ o ac82 add a $ hg log -G -T '{shortest(node)} {desc}' -R merge-test2 @ 150e add x & remove tobremoved | o bbac add converted/a & toberemoved - Build a shamap where the target converted/a is in on top of an unrelated - change to 'x'. This simulates using convert to merge several repositories - together. $ cat >> merge-test2/.hg/shamap < $(hg -R merge-test1 log -r 0 -T '{node}') $(hg -R merge-test2 log -r 0 -T '{node}') > $(hg -R merge-test1 log -r 1 -T '{node}') $(hg -R merge-test2 log -r 1 -T '{node}') > EOF $ cat >> merge-test-filemap < rename . converted/ > EOF $ hg convert --filemap merge-test-filemap merge-test1 merge-test2 --traceback scanning source... sorting... converting... 1 add b 0 merge a & b $ hg -R merge-test2 manifest -r tip converted/a converted/b x $ hg -R merge-test2 log -G -T '{shortest(node)} {desc}\n{files % "- {file}\n"}\n' o 6eaa merge a & b |\ - converted/a | | - toberemoved | | | o 2995 add b | | - converted/b | | @ | 150e add x & remove tobremoved |/ - toberemoved | - x | o bbac add converted/a & toberemoved - converted/a - toberemoved $ cd .. Test case where cleanp2 contains a file that doesn't exist in p2 - for example because filemap changed. $ hg init cleanp2 $ cd cleanp2 $ touch f f1 f2 && hg ci -Aqm '0' $ echo f1 > f1 && echo >> f && hg ci -m '1' $ hg up -qr0 && echo f2 > f2 && echo >> f && hg ci -qm '2' $ echo "include f" > filemap $ hg convert --filemap filemap . assuming destination .-hg initializing destination .-hg repository scanning source... sorting... converting... 2 0 1 1 0 2 $ hg merge && hg ci -qm '3' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ echo "include ." > filemap $ hg convert --filemap filemap . assuming destination .-hg scanning source... sorting... converting... 0 3 $ hg -R .-hg log -G -T '{shortest(node)} {desc}\n{files % "- {file}\n"}\n' o e9ed 3 |\ | o 33a0 2 | | - f | | o | f73e 1 |/ - f | o d681 0 - f $ hg -R .-hg mani -r tip f $ cd .. mercurial-4.5.3/tests/test-issue3084.t0000644015407300116100000002360113261161234017352 0ustar augieeng00000000000000 $ echo "[extensions]" >> $HGRCPATH $ echo "largefiles =" >> $HGRCPATH Create the repository outside $HOME since largefiles write to $HOME/.cache/largefiles. $ hg init test $ cd test $ echo "root" > root $ hg add root $ hg commit -m "Root commit" --config extensions.largefiles=! Ensure that .hg/largefiles isn't created before largefiles are added #if unix-permissions $ chmod 555 .hg #endif $ hg status #if unix-permissions $ chmod 755 .hg #endif $ test -f .hg/largefiles [1] $ echo "large" > foo $ hg add --large foo $ hg commit -m "Add foo as a largefile" $ hg update -r 0 getting changed largefiles 0 largefiles updated, 1 removed 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo "normal" > foo $ hg add foo $ hg commit -m "Add foo as normal file" created new head Normal file in the working copy, keeping the normal version: $ echo "n" | hg merge --config ui.interactive=Yes remote turned local normal file foo into a largefile use (l)argefile or keep (n)ormal file? n 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg status $ cat foo normal Normal file in the working copy, keeping the largefile version: $ hg update -q -C $ echo "l" | hg merge --config ui.interactive=Yes remote turned local normal file foo into a largefile use (l)argefile or keep (n)ormal file? l getting changed largefiles 1 largefiles updated, 0 removed 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg status M foo $ hg diff --nodates diff -r fa129ab6b5a7 .hglf/foo --- /dev/null +++ b/.hglf/foo @@ -0,0 +1,1 @@ +7f7097b041ccf68cc5561e9600da4655d21c6d18 diff -r fa129ab6b5a7 foo --- a/foo +++ /dev/null @@ -1,1 +0,0 @@ -normal $ cat foo large Largefile in the working copy, keeping the normal version: $ hg update -q -C -r 1 $ echo "n" | hg merge --config ui.interactive=Yes remote turned local largefile foo into a normal file keep (l)argefile or use (n)ormal file? n getting changed largefiles 0 largefiles updated, 0 removed 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg status M foo $ hg diff --nodates diff -r ff521236428a .hglf/foo --- a/.hglf/foo +++ /dev/null @@ -1,1 +0,0 @@ -7f7097b041ccf68cc5561e9600da4655d21c6d18 diff -r ff521236428a foo --- /dev/null +++ b/foo @@ -0,0 +1,1 @@ +normal $ cat foo normal Largefile in the working copy, keeping the largefile version: $ hg update -q -C -r 1 $ echo "l" | hg merge --config ui.interactive=Yes remote turned local largefile foo into a normal file keep (l)argefile or use (n)ormal file? l 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg status $ cat foo large Whatever ... commit something so we can invoke merge when updating $ hg commit -m '3: Merge' Updating from largefile to normal - no reason to prompt $ hg up -r 2 getting changed largefiles 0 largefiles updated, 0 removed 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ cat foo normal (the update above used to leave the working dir in a very weird state - clean it $ hg up -qr null $ hg up -qr 2 ) Updating from normal to largefile - no reason to prompt $ hg up -r 3 getting changed largefiles 1 largefiles updated, 0 removed 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ cat foo large $ cd .. Systematic testing of merges involving largefiles: Ancestor: normal Parent: normal-id Parent: large result: large Ancestor: normal Parent: normal2 Parent: large result: ? Ancestor: large Parent: large-id Parent: normal result: normal Ancestor: large Parent: large2 Parent: normal result: ? All cases should try merging both ways. Prepare test repo: $ hg init merges $ cd merges prepare cases with "normal" ancestor: $ hg up -qr null $ echo normal > f $ hg ci -Aqm "normal-ancestor" $ hg tag -l "normal-ancestor" $ touch f2 $ hg ci -Aqm "normal-id" $ hg tag -l "normal-id" $ echo normal2 > f $ hg ci -m "normal2" $ hg tag -l "normal2" $ echo normal > f $ hg ci -Aqm "normal-same" $ hg tag -l "normal-same" $ hg up -qr "normal-ancestor" $ hg rm f $ echo large > f $ hg add --large f $ hg ci -qm "large" $ hg tag -l "large" prepare cases with "large" ancestor: $ hg up -qr null $ echo large > f $ hg add --large f $ hg ci -qm "large-ancestor" $ hg tag -l "large-ancestor" $ touch f2 $ hg ci -Aqm "large-id" $ hg tag -l "large-id" $ echo large2 > f $ hg ci -m "large2" $ hg tag -l "large2" $ echo large > f $ hg ci -Aqm "large-same" $ hg tag -l "large-same" $ hg up -qr "large-ancestor" $ hg rm f $ echo normal > f $ hg ci -qAm "normal" $ hg tag -l "normal" $ hg log -GT '{tags}' @ normal tip | | o large-same | | | o large2 | | | o large-id |/ o large-ancestor o large | | o normal-same | | | o normal2 | | | o normal-id |/ o normal-ancestor Ancestor: normal Parent: normal-id Parent: large result: large $ hg up -Cqr normal-id $ hg merge -r large getting changed largefiles 1 largefiles updated, 0 removed 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f large swap $ hg up -Cqr large $ hg merge -r normal-id 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f large Ancestor: normal Parent: normal-same Parent: large result: large $ hg up -Cqr normal-same $ hg merge -r large getting changed largefiles 1 largefiles updated, 0 removed 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f large swap $ hg up -Cqr large $ hg merge -r normal-same 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f large Ancestor: normal Parent: normal2 Parent: large result: ? (annoying extra prompt ... but it do not do any serious harm) $ hg up -Cqr normal2 $ hg merge -r large remote turned local normal file f into a largefile use (l)argefile or keep (n)ormal file? l getting changed largefiles 1 largefiles updated, 0 removed 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f large $ hg up -Cqr normal2 $ echo n | hg merge -r large --config ui.interactive=Yes remote turned local normal file f into a largefile use (l)argefile or keep (n)ormal file? n 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f normal2 swap $ hg up -Cqr large $ hg merge -r normal2 remote turned local largefile f into a normal file keep (l)argefile or use (n)ormal file? l 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f large $ hg up -Cqr large $ echo n | hg merge -r normal2 --config ui.interactive=Yes remote turned local largefile f into a normal file keep (l)argefile or use (n)ormal file? n getting changed largefiles 0 largefiles updated, 0 removed 2 files updated, 0 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f normal2 Ancestor: large Parent: large-id Parent: normal result: normal $ hg up -Cqr large-id $ hg merge -r normal getting changed largefiles 0 largefiles updated, 0 removed 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f normal swap $ hg up -Cqr normal $ hg merge -r large-id 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f normal Ancestor: large Parent: large-same Parent: normal result: normal $ hg up -Cqr large-same $ hg merge -r normal getting changed largefiles 0 largefiles updated, 0 removed 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f normal swap $ hg up -Cqr normal $ hg merge -r large-same 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f normal Ancestor: large Parent: large2 Parent: normal result: ? (annoying extra prompt ... but it do not do any serious harm) $ hg up -Cqr large2 $ hg merge -r normal remote turned local largefile f into a normal file keep (l)argefile or use (n)ormal file? l 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f large2 $ hg up -Cqr large2 $ echo n | hg merge -r normal --config ui.interactive=Yes remote turned local largefile f into a normal file keep (l)argefile or use (n)ormal file? n getting changed largefiles 0 largefiles updated, 0 removed 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f normal swap $ hg up -Cqr normal $ hg merge -r large2 remote turned local normal file f into a largefile use (l)argefile or keep (n)ormal file? l getting changed largefiles 1 largefiles updated, 0 removed 2 files updated, 0 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f large2 $ hg up -Cqr normal $ echo n | hg merge -r large2 --config ui.interactive=Yes remote turned local normal file f into a largefile use (l)argefile or keep (n)ormal file? n 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f normal $ cd .. mercurial-4.5.3/tests/test-check-help.t0000644015407300116100000000153513261161234017710 0ustar augieeng00000000000000#require test-repo $ . "$TESTDIR/helpers-testrepo.sh" $ cat <<'EOF' > scanhelptopics.py > from __future__ import absolute_import, print_function > import re > import sys > if sys.platform == "win32": > import os, msvcrt > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) > topics = set() > topicre = re.compile(r':hg:`help ([a-z0-9\-.]+)`') > for fname in sys.argv: > with open(fname) as f: > topics.update(m.group(1) for m in topicre.finditer(f.read())) > for s in sorted(topics): > print(s) > EOF $ cd "$TESTDIR"/.. Check if ":hg:`help TOPIC`" is valid: (use "xargs -n1 -t" to see which help commands are executed) $ testrepohg files 'glob:{hgdemandimport,hgext,mercurial}/**/*.py' \ > | sed 's|\\|/|g' \ > | xargs $PYTHON "$TESTTMP/scanhelptopics.py" \ > | xargs -n1 hg help > /dev/null mercurial-4.5.3/tests/test-journal-exists.t0000644015407300116100000000144513261161234020674 0ustar augieeng00000000000000 $ hg init $ echo a > a $ hg ci -Am0 adding a $ hg -q clone . foo $ touch .hg/store/journal $ echo foo > a $ hg ci -Am0 abort: abandoned transaction found! (run 'hg recover' to clean up transaction) [255] $ hg recover rolling back interrupted transaction checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 1 changesets, 1 total revisions Check that zero-size journals are correctly aborted: #if unix-permissions no-root $ hg bundle -qa repo.hg $ chmod -w foo/.hg/store/00changelog.i $ hg -R foo unbundle repo.hg adding changesets abort: Permission denied: $TESTTMP/foo/.hg/store/.00changelog.i-* (glob) [255] $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi #endif mercurial-4.5.3/tests/fsmonitor-run-tests.py0000755015407300116100000001052313261161234021077 0ustar augieeng00000000000000#!/usr/bin/env python # fsmonitor-run-tests.py - Run Mercurial tests with fsmonitor enabled # # Copyright 2017 Facebook, Inc. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. # # This is a wrapper around run-tests.py that spins up an isolated instance of # Watchman and runs the Mercurial tests against it. This ensures that the global # version of Watchman isn't affected by anything this test does. from __future__ import absolute_import from __future__ import print_function import argparse import contextlib import json import os import shutil import subprocess import sys import tempfile import uuid osenvironb = getattr(os, 'environb', os.environ) if sys.version_info > (3, 5, 0): PYTHON3 = True xrange = range # we use xrange in one place, and we'd rather not use range def _bytespath(p): return p.encode('utf-8') elif sys.version_info >= (3, 0, 0): print('%s is only supported on Python 3.5+ and 2.7, not %s' % (sys.argv[0], '.'.join(str(v) for v in sys.version_info[:3]))) sys.exit(70) # EX_SOFTWARE from `man 3 sysexit` else: PYTHON3 = False # In python 2.x, path operations are generally done using # bytestrings by default, so we don't have to do any extra # fiddling there. We define the wrapper functions anyway just to # help keep code consistent between platforms. def _bytespath(p): return p def getparser(): """Obtain the argument parser used by the CLI.""" parser = argparse.ArgumentParser( description='Run tests with fsmonitor enabled.', epilog='Unrecognized options are passed to run-tests.py.') # - keep these sorted # - none of these options should conflict with any in run-tests.py parser.add_argument('--keep-fsmonitor-tmpdir', action='store_true', help='keep temporary directory with fsmonitor state') parser.add_argument('--watchman', help='location of watchman binary (default: watchman in PATH)', default='watchman') return parser @contextlib.contextmanager def watchman(args): basedir = tempfile.mkdtemp(prefix='hg-fsmonitor') try: # Much of this configuration is borrowed from Watchman's test harness. cfgfile = os.path.join(basedir, 'config.json') # TODO: allow setting a config with open(cfgfile, 'w') as f: f.write(json.dumps({})) logfile = os.path.join(basedir, 'log') clilogfile = os.path.join(basedir, 'cli-log') if os.name == 'nt': sockfile = '\\\\.\\pipe\\watchman-test-%s' % uuid.uuid4().hex else: sockfile = os.path.join(basedir, 'sock') pidfile = os.path.join(basedir, 'pid') statefile = os.path.join(basedir, 'state') argv = [ args.watchman, '--sockname', sockfile, '--logfile', logfile, '--pidfile', pidfile, '--statefile', statefile, '--foreground', '--log-level=2', # debug logging for watchman ] envb = osenvironb.copy() envb[b'WATCHMAN_CONFIG_FILE'] = _bytespath(cfgfile) with open(clilogfile, 'wb') as f: proc = subprocess.Popen( argv, env=envb, stdin=None, stdout=f, stderr=f) try: yield sockfile finally: proc.terminate() proc.kill() finally: if args.keep_fsmonitor_tmpdir: print('fsmonitor dir available at %s' % basedir) else: shutil.rmtree(basedir, ignore_errors=True) def run(): parser = getparser() args, runtestsargv = parser.parse_known_args() with watchman(args) as sockfile: osenvironb[b'WATCHMAN_SOCK'] = _bytespath(sockfile) # Indicate to hghave that we're running with fsmonitor enabled. osenvironb[b'HGFSMONITOR_TESTS'] = b'1' runtestdir = os.path.dirname(__file__) runtests = os.path.join(runtestdir, 'run-tests.py') blacklist = os.path.join(runtestdir, 'blacklists', 'fsmonitor') runtestsargv.insert(0, runtests) runtestsargv.extend([ '--extra-config', 'extensions.fsmonitor=', '--blacklist', blacklist, ]) return subprocess.call(runtestsargv) if __name__ == '__main__': sys.exit(run()) mercurial-4.5.3/tests/test-progress.t0000644015407300116100000003502713261161234017554 0ustar augieeng00000000000000 $ cat > loop.py < from __future__ import absolute_import > import time > from mercurial import commands, registrar > > cmdtable = {} > command = registrar.command(cmdtable) > > class incrementingtime(object): > def __init__(self): > self._time = 0.0 > def __call__(self): > self._time += 0.25 > return self._time > time.time = incrementingtime() > > @command(b'loop', > [('', 'total', '', 'override for total'), > ('', 'nested', False, 'show nested results'), > ('', 'parallel', False, 'show parallel sets of results')], > 'hg loop LOOPS', > norepo=True) > def loop(ui, loops, **opts): > loops = int(loops) > total = None > if loops >= 0: > total = loops > if opts.get('total', None): > total = int(opts.get('total')) > nested = False > if opts.get('nested', None): > nested = True > loops = abs(loops) > > for i in range(loops): > ui.progress(topiclabel, i, getloopitem(i), 'loopnum', total) > if opts.get('parallel'): > ui.progress('other', i, 'other.%d' % i, 'othernum', total) > if nested: > nested_steps = 2 > if i and i % 4 == 0: > nested_steps = 5 > for j in range(nested_steps): > ui.progress( > 'nested', j, 'nested.%d' % j, 'nestnum', nested_steps) > ui.progress( > 'nested', None, 'nested.done', 'nestnum', nested_steps) > ui.progress(topiclabel, None, 'loop.done', 'loopnum', total) > > topiclabel = 'loop' > def getloopitem(i): > return 'loop.%d' % i > > EOF $ cp $HGRCPATH $HGRCPATH.orig $ echo "[extensions]" >> $HGRCPATH $ echo "progress=" >> $HGRCPATH $ echo "loop=`pwd`/loop.py" >> $HGRCPATH $ echo "[progress]" >> $HGRCPATH $ echo "format = topic bar number" >> $HGRCPATH $ echo "assume-tty=1" >> $HGRCPATH $ echo "width=60" >> $HGRCPATH test default params, display nothing because of delay $ hg -y loop 3 $ echo "delay=0" >> $HGRCPATH $ echo "refresh=0" >> $HGRCPATH test with delay=0, refresh=0 $ hg -y loop 3 \r (no-eol) (esc) loop [ ] 0/3\r (no-eol) (esc) loop [===============> ] 1/3\r (no-eol) (esc) loop [===============================> ] 2/3\r (no-eol) (esc) \r (no-eol) (esc) no progress with --quiet $ hg -y loop 3 --quiet test plain mode exception $ HGPLAINEXCEPT=progress hg -y loop 1 \r (no-eol) (esc) loop [ ] 0/1\r (no-eol) (esc) \r (no-eol) (esc) test nested short-lived topics (which shouldn't display with nestdelay): $ hg -y loop 3 --nested \r (no-eol) (esc) loop [ ] 0/3\r (no-eol) (esc) loop [===============> ] 1/3\r (no-eol) (esc) loop [===============================> ] 2/3\r (no-eol) (esc) \r (no-eol) (esc) Test nested long-lived topic which has the same name as a short-lived peer. We shouldn't get stuck showing the short-lived inner steps, and should go back to skipping the inner steps when the slow nested step finishes. $ hg -y loop 7 --nested \r (no-eol) (esc) loop [ ] 0/7\r (no-eol) (esc) loop [=====> ] 1/7\r (no-eol) (esc) loop [============> ] 2/7\r (no-eol) (esc) loop [===================> ] 3/7\r (no-eol) (esc) loop [==========================> ] 4/7\r (no-eol) (esc) nested [==========================> ] 3/5\r (no-eol) (esc) nested [===================================> ] 4/5\r (no-eol) (esc) loop [=================================> ] 5/7\r (no-eol) (esc) loop [========================================> ] 6/7\r (no-eol) (esc) \r (no-eol) (esc) $ hg --config progress.changedelay=0 -y loop 3 --nested \r (no-eol) (esc) loop [ ] 0/3\r (no-eol) (esc) nested [ ] 0/2\r (no-eol) (esc) nested [======================> ] 1/2\r (no-eol) (esc) loop [===============> ] 1/3\r (no-eol) (esc) nested [ ] 0/2\r (no-eol) (esc) nested [======================> ] 1/2\r (no-eol) (esc) loop [===============================> ] 2/3\r (no-eol) (esc) nested [ ] 0/2\r (no-eol) (esc) nested [======================> ] 1/2\r (no-eol) (esc) \r (no-eol) (esc) test two topics being printed in parallel (as when we're doing a local --pull clone, where you get the unbundle and bundle progress at the same time): $ hg loop 3 --parallel \r (no-eol) (esc) loop [ ] 0/3\r (no-eol) (esc) loop [===============> ] 1/3\r (no-eol) (esc) loop [===============================> ] 2/3\r (no-eol) (esc) \r (no-eol) (esc) test refresh is taken in account $ hg -y --config progress.refresh=100 loop 3 test format options 1 $ hg -y --config 'progress.format=number topic item+2' loop 2 \r (no-eol) (esc) 0/2 loop lo\r (no-eol) (esc) 1/2 loop lo\r (no-eol) (esc) \r (no-eol) (esc) test format options 2 $ hg -y --config 'progress.format=number item-3 bar' loop 2 \r (no-eol) (esc) 0/2 p.0 [ ]\r (no-eol) (esc) 1/2 p.1 [=======================> ]\r (no-eol) (esc) \r (no-eol) (esc) test format options and indeterminate progress $ hg -y --config 'progress.format=number item bar' loop -- -2 \r (no-eol) (esc) 0 loop.0 [ <=> ]\r (no-eol) (esc) 1 loop.1 [ <=> ]\r (no-eol) (esc) \r (no-eol) (esc) make sure things don't fall over if count > total $ hg -y loop --total 4 6 \r (no-eol) (esc) loop [ ] 0/4\r (no-eol) (esc) loop [===========> ] 1/4\r (no-eol) (esc) loop [=======================> ] 2/4\r (no-eol) (esc) loop [===================================> ] 3/4\r (no-eol) (esc) loop [===============================================>] 4/4\r (no-eol) (esc) loop [ <=> ] 5/4\r (no-eol) (esc) \r (no-eol) (esc) test immediate progress completion $ hg -y loop 0 test delay time estimates #if no-chg $ cp $HGRCPATH.orig $HGRCPATH $ echo "[extensions]" >> $HGRCPATH $ echo "mocktime=$TESTDIR/mocktime.py" >> $HGRCPATH $ echo "progress=" >> $HGRCPATH $ echo "loop=`pwd`/loop.py" >> $HGRCPATH $ echo "[progress]" >> $HGRCPATH $ echo "assume-tty=1" >> $HGRCPATH $ echo "delay=25" >> $HGRCPATH $ echo "width=60" >> $HGRCPATH $ MOCKTIME=11 hg -y loop 8 \r (no-eol) (esc) loop [=========> ] 2/8 1m07s\r (no-eol) (esc) loop [===============> ] 3/8 56s\r (no-eol) (esc) loop [=====================> ] 4/8 45s\r (no-eol) (esc) loop [==========================> ] 5/8 34s\r (no-eol) (esc) loop [================================> ] 6/8 23s\r (no-eol) (esc) loop [=====================================> ] 7/8 12s\r (no-eol) (esc) \r (no-eol) (esc) $ MOCKTIME=10000 hg -y loop 4 \r (no-eol) (esc) loop [ ] 0/4\r (no-eol) (esc) loop [=========> ] 1/4 8h21m\r (no-eol) (esc) loop [====================> ] 2/4 5h34m\r (no-eol) (esc) loop [==============================> ] 3/4 2h47m\r (no-eol) (esc) \r (no-eol) (esc) $ MOCKTIME=1000000 hg -y loop 4 \r (no-eol) (esc) loop [ ] 0/4\r (no-eol) (esc) loop [=========> ] 1/4 5w00d\r (no-eol) (esc) loop [====================> ] 2/4 3w03d\r (no-eol) (esc) loop [=============================> ] 3/4 11d14h\r (no-eol) (esc) \r (no-eol) (esc) $ MOCKTIME=14000000 hg -y loop 4 \r (no-eol) (esc) loop [ ] 0/4\r (no-eol) (esc) loop [=========> ] 1/4 1y18w\r (no-eol) (esc) loop [===================> ] 2/4 46w03d\r (no-eol) (esc) loop [=============================> ] 3/4 23w02d\r (no-eol) (esc) \r (no-eol) (esc) Non-linear progress: $ MOCKTIME='20 20 20 20 20 20 20 20 20 20 500 500 500 500 500 20 20 20 20 20' hg -y loop 20 \r (no-eol) (esc) loop [=> ] 1/20 6m21s\r (no-eol) (esc) loop [===> ] 2/20 6m01s\r (no-eol) (esc) loop [=====> ] 3/20 5m41s\r (no-eol) (esc) loop [=======> ] 4/20 5m21s\r (no-eol) (esc) loop [=========> ] 5/20 5m01s\r (no-eol) (esc) loop [===========> ] 6/20 4m41s\r (no-eol) (esc) loop [=============> ] 7/20 4m21s\r (no-eol) (esc) loop [===============> ] 8/20 4m01s\r (no-eol) (esc) loop [================> ] 9/20 25m40s\r (no-eol) (esc) loop [===================> ] 10/20 1h06m\r (no-eol) (esc) loop [=====================> ] 11/20 1h13m\r (no-eol) (esc) loop [=======================> ] 12/20 1h07m\r (no-eol) (esc) loop [========================> ] 13/20 58m19s\r (no-eol) (esc) loop [===========================> ] 14/20 7m09s\r (no-eol) (esc) loop [=============================> ] 15/20 3m38s\r (no-eol) (esc) loop [===============================> ] 16/20 2m15s\r (no-eol) (esc) loop [=================================> ] 17/20 1m27s\r (no-eol) (esc) loop [====================================> ] 18/20 52s\r (no-eol) (esc) loop [======================================> ] 19/20 25s\r (no-eol) (esc) \r (no-eol) (esc) Time estimates should not fail when there's no end point: $ MOCKTIME=11 hg -y loop -- -4 \r (no-eol) (esc) loop [ <=> ] 2\r (no-eol) (esc) loop [ <=> ] 3\r (no-eol) (esc) \r (no-eol) (esc) #endif test line trimming by '[progress] width', when progress topic contains multi-byte characters, of which length of byte sequence and columns in display are different from each other. $ cp $HGRCPATH.orig $HGRCPATH $ cat >> $HGRCPATH < [extensions] > progress= > loop=`pwd`/loop.py > [progress] > assume-tty = 1 > delay = 0 > refresh = 0 > EOF $ rm -f loop.pyc $ cat >> loop.py < # use non-ascii characters as topic label of progress > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes > topiclabel = u'\u3042\u3044\u3046\u3048'.encode('utf-8') > EOF $ cat >> $HGRCPATH < [progress] > format = topic number > width= 12 > EOF $ hg --encoding utf-8 -y loop --total 3 3 \r (no-eol) (esc) \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88 0/3\r (no-eol) (esc) \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88 1/3\r (no-eol) (esc) \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88 2/3\r (no-eol) (esc) \r (no-eol) (esc) test calculation of bar width, when progress topic contains multi-byte characters, of which length of byte sequence and columns in display are different from each other. $ cat >> $HGRCPATH < [progress] > format = topic bar > width= 21 > # progwidth should be 9 (= 21 - (8+1) - 3) > EOF $ hg --encoding utf-8 -y loop --total 3 3 \r (no-eol) (esc) \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88 [ ]\r (no-eol) (esc) \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88 [==> ]\r (no-eol) (esc) \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88 [=====> ]\r (no-eol) (esc) \r (no-eol) (esc) test trimming progress items, when they contain multi-byte characters, of which length of byte sequence and columns in display are different from each other. $ rm -f loop.pyc $ rm -Rf __pycache__ $ cat >> loop.py < # use non-ascii characters as loop items of progress > loopitems = [ > u'\u3042\u3044'.encode('utf-8'), # 2 x 2 = 4 columns > u'\u3042\u3044\u3046'.encode('utf-8'), # 2 x 3 = 6 columns > u'\u3042\u3044\u3046\u3048'.encode('utf-8'), # 2 x 4 = 8 columns > ] > def getloopitem(i): > return loopitems[i % len(loopitems)] > EOF $ cat >> $HGRCPATH < [progress] > # trim at tail side > format = item+6 > EOF $ hg --encoding utf-8 -y loop --total 3 3 \r (no-eol) (esc) \xe3\x81\x82\xe3\x81\x84 \r (no-eol) (esc) \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\r (no-eol) (esc) \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\r (no-eol) (esc) \r (no-eol) (esc) $ cat >> $HGRCPATH < [progress] > # trim at left side > format = item-6 > EOF $ hg --encoding utf-8 -y loop --total 3 3 \r (no-eol) (esc) \xe3\x81\x82\xe3\x81\x84 \r (no-eol) (esc) \xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\r (no-eol) (esc) \xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\r (no-eol) (esc) \r (no-eol) (esc) mercurial-4.5.3/tests/test-init.t0000644015407300116100000001474313261161234016655 0ustar augieeng00000000000000This test tries to exercise the ssh functionality with a dummy script (enable general delta early) $ cat << EOF >> $HGRCPATH > [format] > usegeneraldelta=yes > EOF $ checknewrepo() > { > name=$1 > if [ -d "$name"/.hg/store ]; then > echo store created > fi > if [ -f "$name"/.hg/00changelog.i ]; then > echo 00changelog.i created > fi > cat "$name"/.hg/requires > } creating 'local' $ hg init local $ checknewrepo local store created 00changelog.i created dotencode fncache generaldelta revlogv1 store $ echo this > local/foo $ hg ci --cwd local -A -m "init" adding foo test custom revlog chunk cache sizes $ hg --config format.chunkcachesize=0 log -R local -pv abort: revlog chunk cache size 0 is not greater than 0! [255] $ hg --config format.chunkcachesize=1023 log -R local -pv abort: revlog chunk cache size 1023 is not a power of 2! [255] $ hg --config format.chunkcachesize=1024 log -R local -pv changeset: 0:08b9e9f63b32 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 files: foo description: init diff -r 000000000000 -r 08b9e9f63b32 foo --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foo Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +this creating repo with format.usestore=false $ hg --config format.usestore=false init old $ checknewrepo old generaldelta revlogv1 creating repo with format.usefncache=false $ hg --config format.usefncache=false init old2 $ checknewrepo old2 store created 00changelog.i created generaldelta revlogv1 store creating repo with format.dotencode=false $ hg --config format.dotencode=false init old3 $ checknewrepo old3 store created 00changelog.i created fncache generaldelta revlogv1 store creating repo with format.dotencode=false $ hg --config format.generaldelta=false --config format.usegeneraldelta=false init old4 $ checknewrepo old4 store created 00changelog.i created dotencode fncache revlogv1 store test failure $ hg init local abort: repository local already exists! [255] init+push to remote2 $ hg init -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2 $ hg incoming -R remote2 local comparing with local changeset: 0:08b9e9f63b32 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: init $ hg push -R local -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2 pushing to ssh://user@dummy/remote2 searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files clone to remote1 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1 searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files The largefiles extension doesn't crash $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remotelf --config extensions.largefiles= The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files init to existing repo $ hg init -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote1 abort: repository remote1 already exists! abort: could not create remote repo! [255] clone to existing repo $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1 abort: repository remote1 already exists! abort: could not create remote repo! [255] output of dummyssh $ cat dummylog Got arguments 1:user@dummy 2:hg init remote2 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio Got arguments 1:user@dummy 2:hg init remote1 Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio Got arguments 1:user@dummy 2:hg init remotelf Got arguments 1:user@dummy 2:hg -R remotelf serve --stdio Got arguments 1:user@dummy 2:hg init remote1 Got arguments 1:user@dummy 2:hg init remote1 comparing repositories $ hg tip -q -R local 0:08b9e9f63b32 $ hg tip -q -R remote1 0:08b9e9f63b32 $ hg tip -q -R remote2 0:08b9e9f63b32 check names for repositories (clashes with URL schemes, special chars) $ for i in bundle file hg http https old-http ssh static-http "with space"; do > printf "hg init \"$i\"... " > hg init "$i" > test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed" > done hg init "bundle"... ok hg init "file"... ok hg init "hg"... ok hg init "http"... ok hg init "https"... ok hg init "old-http"... ok hg init "ssh"... ok hg init "static-http"... ok hg init "with space"... ok #if eol-in-paths /* " " is not a valid name for a directory on Windows */ $ hg init " " $ test -d " " $ test -d " /.hg" #endif creating 'local/sub/repo' $ hg init local/sub/repo $ checknewrepo local/sub/repo store created 00changelog.i created dotencode fncache generaldelta revlogv1 store prepare test of init of url configured from paths $ echo '[paths]' >> $HGRCPATH $ echo "somewhere = `pwd`/url from paths" >> $HGRCPATH $ echo "elsewhere = `pwd`/another paths url" >> $HGRCPATH init should (for consistency with clone) expand the url $ hg init somewhere $ checknewrepo "url from paths" store created 00changelog.i created dotencode fncache generaldelta revlogv1 store verify that clone also expand urls $ hg clone somewhere elsewhere updating to branch default 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ checknewrepo "another paths url" store created 00changelog.i created dotencode fncache generaldelta revlogv1 store clone bookmarks $ hg -R local bookmark test $ hg -R local bookmarks * test 0:08b9e9f63b32 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote-bookmarks searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files exporting bookmark test $ hg -R remote-bookmarks bookmarks test 0:08b9e9f63b32 mercurial-4.5.3/tests/test-import-context.t0000644015407300116100000000442213261161234020677 0ustar augieeng00000000000000Test applying context diffs $ cat > writepatterns.py < import sys > > path = sys.argv[1] > lasteol = sys.argv[2] == '1' > patterns = sys.argv[3:] > > fp = file(path, 'wb') > for i, pattern in enumerate(patterns): > count = int(pattern[0:-1]) > char = pattern[-1] + '\n' > if not lasteol and i == len(patterns) - 1: > fp.write((char*count)[:-1]) > else: > fp.write(char*count) > fp.close() > EOF $ cat > cat.py < import sys > sys.stdout.write(repr(file(sys.argv[1], 'rb').read()) + '\n') > EOF Initialize the test repository $ hg init repo $ cd repo $ $PYTHON ../writepatterns.py a 0 5A 1B 5C 1D $ $PYTHON ../writepatterns.py b 1 1A 1B $ $PYTHON ../writepatterns.py c 1 5A $ $PYTHON ../writepatterns.py d 1 5A 1B $ hg add adding a adding b adding c adding d $ hg ci -m addfiles Add file, missing a last end of line $ hg import --no-commit - < *** /dev/null 2010-10-16 18:05:49.000000000 +0200 > --- b/newnoeol 2010-10-16 18:23:26.000000000 +0200 > *************** > *** 0 **** > --- 1,2 ---- > + a > + b > \ No newline at end of file > *** a/a Sat Oct 16 16:35:51 2010 > --- b/a Sat Oct 16 16:35:51 2010 > *************** > *** 3,12 **** > A > A > A > ! B > C > C > C > C > C > ! D > \ No newline at end of file > --- 3,13 ---- > A > A > A > ! E > C > C > C > C > C > ! F > ! F > > *** a/b 2010-10-16 18:40:38.000000000 +0200 > --- /dev/null 2010-10-16 18:05:49.000000000 +0200 > *************** > *** 1,2 **** > - A > - B > --- 0 ---- > *** a/c Sat Oct 16 21:34:26 2010 > --- b/c Sat Oct 16 21:34:27 2010 > *************** > *** 3,5 **** > --- 3,7 ---- > A > A > A > + B > + B > *** a/d Sat Oct 16 21:47:20 2010 > --- b/d Sat Oct 16 21:47:22 2010 > *************** > *** 2,6 **** > A > A > A > - A > - B > --- 2,4 ---- > EOF applying patch from stdin $ hg st M a M c M d A newnoeol R b What's in a $ $PYTHON ../cat.py a 'A\nA\nA\nA\nA\nE\nC\nC\nC\nC\nC\nF\nF\n' $ $PYTHON ../cat.py newnoeol 'a\nb' $ $PYTHON ../cat.py c 'A\nA\nA\nA\nA\nB\nB\n' $ $PYTHON ../cat.py d 'A\nA\nA\nA\n' $ cd .. mercurial-4.5.3/tests/test-exchange-obsmarkers-case-B5.t0000644015407300116100000001313313261161234023007 0ustar augieeng00000000000000============================================ Testing obsolescence markers push: Cases B.5 ============================================ Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of all changesets that requested to be "in sync" after the push (even if they are already on both side). This test belongs to a series of tests checking such set is properly computed and applied. This does not tests "obsmarkers" discovery capabilities. Category B: pruning case TestCase 5: Push of a children of changeset which successors is pruned B.5 Push of a children of changeset which successors is pruned ============================================================== .. This case Mirror A.4, with pruned changeset successors. .. .. {{{ .. C ◔ .. | .. B⇠ø⇠⊗ B' .. | | .. A ø⇠○ A' .. |/ .. ◠.. }}} .. .. Marker exist from: .. .. * `A ø⇠○ A'` .. * `B ø⇠○ B'` .. * chain from B .. * `B' is pruned` .. .. Command run: .. .. * hg push -r C .. .. Expected exchange: .. .. * chain from B .. .. Expected exclude: .. .. * `A ø⇠○ A'` .. * `B ø⇠○ B'` .. * `B' prune` Setup ----- $ . $TESTDIR/testlib/exchange-obsmarker-util.sh initial $ setuprepos B.5 creating test repo for test case B.5 - pulldest - main - pushdest cd into `main` and proceed with env setup $ cd main $ mkcommit A0 $ mkcommit B0 $ mkcommit C $ hg up --quiet 0 $ mkcommit A1 created new head $ mkcommit B1 $ hg debugobsolete --hidden `getid 'desc(A0)'` `getid 'desc(A1)'` obsoleted 1 changesets 2 new orphan changesets $ hg debugobsolete --hidden aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid 'desc(B0)'` $ hg debugobsolete --hidden `getid 'desc(B0)'` `getid 'desc(B1)'` obsoleted 1 changesets $ hg prune -qd '0 0' 'desc(B1)' $ hg log -G --hidden x 069b05c3876d (draft): B1 | @ e5ea8f9c7314 (draft): A1 | | * 1d0f3cd25300 (draft): C | | | x 6e72f0a95b5e (draft): B0 | | | x 28b51eb45704 (draft): A0 |/ o a9bdc8b26820 (public): O $ inspect_obsmarkers obsstore content ================ 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 069b05c3876d56f62895e853a501ea58ea85f68d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 069b05c3876d56f62895e853a501ea58ea85f68d 0 {e5ea8f9c73143125d36658e90ef70c6d2027a5b7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ cd .. $ cd .. Actual Test (explicit push version) ----------------------------------- $ dotest B.5 C -f ## Running testcase B.5 # testing echange of "C" (1d0f3cd25300) ## initial state # obstore: main 069b05c3876d56f62895e853a501ea58ea85f68d 0 {e5ea8f9c73143125d36658e90ef70c6d2027a5b7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 069b05c3876d56f62895e853a501ea58ea85f68d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest ## pushing "C" from main to pushdest pushing to pushdest searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 3 changesets with 3 changes to 3 files remote: 1 new obsolescence markers ## post push state # obstore: main 069b05c3876d56f62895e853a501ea58ea85f68d 0 {e5ea8f9c73143125d36658e90ef70c6d2027a5b7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 069b05c3876d56f62895e853a501ea58ea85f68d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest ## pulling "1d0f3cd25300" from main into pulldest pulling from main searching for changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 3 files 1 new obsolescence markers new changesets 28b51eb45704:1d0f3cd25300 (run 'hg update' to get a working copy) ## post pull state # obstore: main 069b05c3876d56f62895e853a501ea58ea85f68d 0 {e5ea8f9c73143125d36658e90ef70c6d2027a5b7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 069b05c3876d56f62895e853a501ea58ea85f68d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} mercurial-4.5.3/tests/test-rebase-emptycommit.t0000644015407300116100000000741513261161234021516 0ustar augieeng00000000000000 $ cat >> $HGRCPATH< [extensions] > rebase= > drawdag=$TESTDIR/drawdag.py > EOF $ hg init non-merge $ cd non-merge $ hg debugdrawdag<<'EOS' > F > | > E > | > D > | > B C > |/ > A > EOS $ for i in C D E F; do > hg bookmark -r $i -i BOOK-$i > done $ hg debugdrawdag<<'EOS' > E > | > D > | > B > EOS $ hg log -G -T '{rev} {desc} {bookmarks}' o 7 E | o 6 D | | o 5 F BOOK-F | | | o 4 E BOOK-E | | | o 3 D BOOK-D | | | o 2 C BOOK-C | | o | 1 B |/ o 0 A With --keep, bookmark should move $ hg rebase -r 3+4 -d E --keep rebasing 3:e7b3f00ed42e "D" (BOOK-D) note: rebase of 3:e7b3f00ed42e created no changes to commit rebasing 4:69a34c08022a "E" (BOOK-E) note: rebase of 4:69a34c08022a created no changes to commit $ hg log -G -T '{rev} {desc} {bookmarks}' o 7 E BOOK-D BOOK-E | o 6 D | | o 5 F BOOK-F | | | o 4 E | | | o 3 D | | | o 2 C BOOK-C | | o | 1 B |/ o 0 A Move D and E back for the next test $ hg bookmark BOOK-D -fqir 3 $ hg bookmark BOOK-E -fqir 4 Bookmark is usually an indication of a head. For changes that are introduced by an ancestor of bookmark B, after moving B to B-NEW, the changes are ideally still introduced by an ancestor of changeset on B-NEW. In the below case, "BOOK-D", and "BOOK-E" include changes introduced by "C". $ hg rebase -s 2 -d E rebasing 2:dc0947a82db8 "C" (BOOK-C C) rebasing 3:e7b3f00ed42e "D" (BOOK-D) note: rebase of 3:e7b3f00ed42e created no changes to commit rebasing 4:69a34c08022a "E" (BOOK-E) note: rebase of 4:69a34c08022a created no changes to commit rebasing 5:6b2aeab91270 "F" (BOOK-F F) saved backup bundle to $TESTTMP/non-merge/.hg/strip-backup/dc0947a82db8-52bb4973-rebase.hg $ hg log -G -T '{rev} {desc} {bookmarks}' o 5 F BOOK-F | o 4 C BOOK-C BOOK-D BOOK-E | o 3 E | o 2 D | o 1 B | o 0 A Merge and its ancestors all become empty $ hg init $TESTTMP/merge1 $ cd $TESTTMP/merge1 $ hg debugdrawdag<<'EOS' > E > /| > B C D > \|/ > A > EOS $ for i in C D E; do > hg bookmark -r $i -i BOOK-$i > done $ hg debugdrawdag<<'EOS' > H > | > D > | > C > | > B > EOS $ hg rebase -r '(A::)-(B::)-A' -d H rebasing 2:dc0947a82db8 "C" (BOOK-C) note: rebase of 2:dc0947a82db8 created no changes to commit rebasing 3:b18e25de2cf5 "D" (BOOK-D) note: rebase of 3:b18e25de2cf5 created no changes to commit rebasing 4:86a1f6686812 "E" (BOOK-E E) note: rebase of 4:86a1f6686812 created no changes to commit saved backup bundle to $TESTTMP/merge1/.hg/strip-backup/b18e25de2cf5-1fd0a4ba-rebase.hg $ hg log -G -T '{rev} {desc} {bookmarks}' o 4 H BOOK-C BOOK-D BOOK-E | o 3 D | o 2 C | o 1 B | o 0 A Part of ancestors of a merge become empty $ hg init $TESTTMP/merge2 $ cd $TESTTMP/merge2 $ hg debugdrawdag<<'EOS' > G > /| > E F > | | > B C D > \|/ > A > EOS $ for i in C D E F G; do > hg bookmark -r $i -i BOOK-$i > done $ hg debugdrawdag<<'EOS' > H > | > F > | > C > | > B > EOS $ hg rebase -r '(A::)-(B::)-A' -d H rebasing 2:dc0947a82db8 "C" (BOOK-C) note: rebase of 2:dc0947a82db8 created no changes to commit rebasing 3:b18e25de2cf5 "D" (BOOK-D D) rebasing 4:03ca77807e91 "E" (BOOK-E E) rebasing 5:ad6717a6a58e "F" (BOOK-F) note: rebase of 5:ad6717a6a58e created no changes to commit rebasing 6:c58e8bdac1f4 "G" (BOOK-G G) saved backup bundle to $TESTTMP/merge2/.hg/strip-backup/b18e25de2cf5-2d487005-rebase.hg $ hg log -G -T '{rev} {desc} {bookmarks}' o 7 G BOOK-G |\ | o 6 E BOOK-E | | o | 5 D BOOK-D BOOK-F |/ o 4 H BOOK-C | o 3 F | o 2 C | o 1 B | o 0 A mercurial-4.5.3/tests/test-empty.t0000644015407300116100000000146413261161234017044 0ustar augieeng00000000000000Create an empty repo: $ hg init a $ cd a Try some commands: $ hg log $ hg grep wah [1] $ hg manifest $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 0 files, 0 changesets, 0 total revisions Check the basic files created: $ ls .hg 00changelog.i requires store Should be empty: $ ls .hg/store Poke at a clone: $ cd .. $ hg clone a b updating to branch default 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd b $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 0 files, 0 changesets, 0 total revisions $ ls .hg 00changelog.i hgrc requires store Should be empty: $ ls .hg/store $ cd .. mercurial-4.5.3/tests/test-push.t0000644015407300116100000002202413261161234016660 0ustar augieeng00000000000000================================== Basic testing for the push command ================================== Testing of the '--rev' flag =========================== $ hg init test-revflag $ hg -R test-revflag unbundle "$TESTDIR/bundles/remote.hg" adding changesets adding manifests adding file changes added 9 changesets with 7 changes to 4 files (+1 heads) new changesets bfaf4b5cbf01:916f1afdef90 (run 'hg heads' to see heads, 'hg merge' to merge) $ for i in 0 1 2 3 4 5 6 7 8; do > echo > hg init test-revflag-"$i" > hg -R test-revflag push -r "$i" test-revflag-"$i" > hg -R test-revflag-"$i" verify > done pushing to test-revflag-0 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 1 changesets, 1 total revisions pushing to test-revflag-1 searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 2 changesets, 2 total revisions pushing to test-revflag-2 searching for changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 1 files checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 3 changesets, 3 total revisions pushing to test-revflag-3 searching for changes adding changesets adding manifests adding file changes added 4 changesets with 4 changes to 1 files checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 4 changesets, 4 total revisions pushing to test-revflag-4 searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 2 changesets, 2 total revisions pushing to test-revflag-5 searching for changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 1 files checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 3 changesets, 3 total revisions pushing to test-revflag-6 searching for changes adding changesets adding manifests adding file changes added 4 changesets with 5 changes to 2 files checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 4 changesets, 5 total revisions pushing to test-revflag-7 searching for changes adding changesets adding manifests adding file changes added 5 changesets with 6 changes to 3 files checking changesets checking manifests crosschecking files in changesets and manifests checking files 3 files, 5 changesets, 6 total revisions pushing to test-revflag-8 searching for changes adding changesets adding manifests adding file changes added 5 changesets with 5 changes to 2 files checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 5 changesets, 5 total revisions $ cd test-revflag-8 $ hg pull ../test-revflag-7 pulling from ../test-revflag-7 searching for changes adding changesets adding manifests adding file changes added 4 changesets with 2 changes to 3 files (+1 heads) new changesets c70afb1ee985:faa2e4234c7a (run 'hg heads' to see heads, 'hg merge' to merge) $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 4 files, 9 changesets, 7 total revisions $ cd .. Test server side validation during push ======================================= $ hg init test-validation $ cd test-validation $ cat > .hg/hgrc < [server] > validate=1 > EOF $ echo alpha > alpha $ echo beta > beta $ hg addr adding alpha adding beta $ hg ci -m 1 $ cd .. $ hg clone test-validation test-validation-clone updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved Test spurious filelog entries: $ cd test-validation-clone $ echo blah >> beta $ cp .hg/store/data/beta.i tmp1 $ hg ci -m 2 $ cp .hg/store/data/beta.i tmp2 $ hg -q rollback $ mv tmp2 .hg/store/data/beta.i $ echo blah >> beta $ hg ci -m '2 (corrupt)' Expected to fail: $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files beta@1: dddc47b3ba30 not in manifests 2 files, 2 changesets, 4 total revisions 1 integrity errors encountered! (first damaged changeset appears to be 1) [1] $ hg push pushing to $TESTTMP/test-validation searching for changes adding changesets adding manifests adding file changes transaction abort! rollback completed abort: received spurious file revlog entry [255] $ hg -q rollback $ mv tmp1 .hg/store/data/beta.i $ echo beta > beta Test missing filelog entries: $ cp .hg/store/data/beta.i tmp $ echo blah >> beta $ hg ci -m '2 (corrupt)' $ mv tmp .hg/store/data/beta.i Expected to fail: $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files beta@1: manifest refers to unknown revision dddc47b3ba30 2 files, 2 changesets, 2 total revisions 1 integrity errors encountered! (first damaged changeset appears to be 1) [1] $ hg push pushing to $TESTTMP/test-validation searching for changes adding changesets adding manifests adding file changes transaction abort! rollback completed abort: missing file data for beta:dddc47b3ba30e54484720ce0f4f768a0f4b6efb9 - run hg verify [255] $ cd .. Test push hook locking ===================== $ hg init 1 $ echo '[ui]' >> 1/.hg/hgrc $ echo 'timeout = 10' >> 1/.hg/hgrc $ echo foo > 1/foo $ hg --cwd 1 ci -A -m foo adding foo $ hg clone 1 2 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg clone 2 3 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat < $TESTTMP/debuglocks-pretxn-hook.sh > hg debuglocks > true > EOF $ echo '[hooks]' >> 2/.hg/hgrc $ echo "pretxnchangegroup.a = sh $TESTTMP/debuglocks-pretxn-hook.sh" >> 2/.hg/hgrc $ echo 'changegroup.push = hg push -qf ../1' >> 2/.hg/hgrc $ echo bar >> 3/foo $ hg --cwd 3 ci -m bar $ hg --cwd 3 push ../2 --config devel.legacy.exchange=bundle1 pushing to ../2 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files lock: user *, process * (*s) (glob) wlock: free $ hg --cwd 1 --config extensions.strip= strip tip -q $ hg --cwd 2 --config extensions.strip= strip tip -q $ hg --cwd 3 push ../2 # bundle2+ pushing to ../2 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files lock: user *, process * (*s) (glob) wlock: user *, process * (*s) (glob) Test bare push with multiple race checking options -------------------------------------------------- $ hg init test-bare-push-no-concurrency $ hg init test-bare-push-unrelated-concurrency $ hg -R test-revflag push -r 0 test-bare-push-no-concurrency --config server.concurrent-push-mode=strict pushing to test-bare-push-no-concurrency searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files $ hg -R test-revflag push -r 0 test-bare-push-unrelated-concurrency --config server.concurrent-push-mode=check-related pushing to test-bare-push-unrelated-concurrency searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files SEC: check for unsafe ssh url $ cat >> $HGRCPATH << EOF > [ui] > ssh = sh -c "read l; read l; read l" > EOF $ hg -R test-revflag push 'ssh://-oProxyCommand=touch${IFS}owned/path' pushing to ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' [255] $ hg -R test-revflag push 'ssh://%2DoProxyCommand=touch${IFS}owned/path' pushing to ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' [255] $ hg -R test-revflag push 'ssh://fakehost|touch${IFS}owned/path' pushing to ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path abort: no suitable response from remote hg! [255] $ hg -R test-revflag push 'ssh://fakehost%7Ctouch%20owned/path' pushing to ssh://fakehost%7Ctouch%20owned/path abort: no suitable response from remote hg! [255] $ [ ! -f owned ] || echo 'you got owned' mercurial-4.5.3/tests/test-lrucachedict.py0000644015407300116100000000355113261161234020524 0ustar augieeng00000000000000from __future__ import absolute_import, print_function from mercurial import ( util, ) def printifpresent(d, xs, name='d'): for x in xs: present = x in d print("'%s' in %s: %s" % (x, name, present)) if present: print("%s['%s']: %s" % (name, x, d[x])) def test_lrucachedict(): d = util.lrucachedict(4) d['a'] = 'va' d['b'] = 'vb' d['c'] = 'vc' d['d'] = 'vd' # all of these should be present printifpresent(d, ['a', 'b', 'c', 'd']) # 'a' should be dropped because it was least recently used d['e'] = 've' printifpresent(d, ['a', 'b', 'c', 'd', 'e']) assert d.get('a') is None assert d.get('e') == 've' # touch entries in some order (get or set). d['e'] d['c'] = 'vc2' d['d'] d['b'] = 'vb2' # 'e' should be dropped now d['f'] = 'vf' printifpresent(d, ['b', 'c', 'd', 'e', 'f']) d.clear() printifpresent(d, ['b', 'c', 'd', 'e', 'f']) # Now test dicts that aren't full. d = util.lrucachedict(4) d['a'] = 1 d['b'] = 2 d['a'] d['b'] printifpresent(d, ['a', 'b']) # test copy method d = util.lrucachedict(4) d['a'] = 'va3' d['b'] = 'vb3' d['c'] = 'vc3' d['d'] = 'vd3' dc = d.copy() # all of these should be present print("\nAll of these should be present:") printifpresent(dc, ['a', 'b', 'c', 'd'], 'dc') # 'a' should be dropped because it was least recently used print("\nAll of these except 'a' should be present:") dc['e'] = 've3' printifpresent(dc, ['a', 'b', 'c', 'd', 'e'], 'dc') # contents and order of original dict should remain unchanged print("\nThese should be in reverse alphabetical order and read 'v?3':") dc['b'] = 'vb3_new' for k in list(iter(d)): print("d['%s']: %s" % (k, d[k])) if __name__ == '__main__': test_lrucachedict() mercurial-4.5.3/tests/test-hgweb-empty.t0000644015407300116100000002704113261161234020135 0ustar augieeng00000000000000#require serve Some tests for hgweb in an empty repository $ hg init test $ cd test $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS $ (get-with-headers.py localhost:$HGPORT 'shortlog') 200 Script output follows test: log

log

age author description
$ echo babar babar $ (get-with-headers.py localhost:$HGPORT 'log') 200 Script output follows test: log

log

age author description
$ (get-with-headers.py localhost:$HGPORT 'graph') 200 Script output follows test: revision graph

graph

    $ (get-with-headers.py localhost:$HGPORT 'file') 200 Script output follows test: 000000000000 /

    directory / @ -1:000000000000 tip

    name size permissions
    [up] drwxr-xr-x
    $ (get-with-headers.py localhost:$HGPORT 'atom-bookmarks') 200 Script output follows http://*:$HGPORT/ (glob) (glob) (glob) test: bookmarks test bookmark history Mercurial SCM 1970-01-01T00:00:00+00:00 $ cd .. mercurial-4.5.3/tests/test-mq-merge.t0000644015407300116100000000666713261161234017432 0ustar augieeng00000000000000Setup extension: $ cat <> $HGRCPATH > [extensions] > mq = > [mq] > git = keep > EOF Test merge with mq changeset as the second parent: $ hg init m $ cd m $ touch a b c $ hg add a $ hg commit -m a $ hg add b $ hg qnew -d "0 0" b $ hg update 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg add c $ hg commit -m c created new head $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg commit -m merge abort: cannot commit over an applied mq patch [255] $ cd .. Issue529: mq aborts when merging patch deleting files $ checkundo() > { > if [ -f .hg/store/undo ]; then > echo ".hg/store/undo still exists" > fi > } Commit two dummy files in "init" changeset: $ hg init t $ cd t $ echo a > a $ echo b > b $ hg ci -Am init adding a adding b $ hg tag -l init Create a patch removing a: $ hg qnew rm_a $ hg rm a $ hg qrefresh -m "rm a" Save the patch queue so we can merge it later: $ hg qsave -c -e copy $TESTTMP/t/.hg/patches to $TESTTMP/t/.hg/patches.1 $ checkundo Update b and commit in an "update" changeset: $ hg up -C init 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo b >> b $ hg st M b $ hg ci -m update created new head # Here, qpush used to abort with : # The system cannot find the file specified => a $ hg manifest a b $ hg qpush -a -m merging with queue at: $TESTTMP/t/.hg/patches.1 applying rm_a now at: rm_a $ checkundo $ hg manifest b Ensure status is correct after merge: $ hg qpop -a popping rm_a popping .hg.patches.merge.marker patch queue now empty $ cd .. Classic MQ merge sequence *with an explicit named queue*: $ hg init t2 $ cd t2 $ echo '[diff]' > .hg/hgrc $ echo 'nodates = 1' >> .hg/hgrc $ echo a > a $ hg ci -Am init adding a $ echo b > a $ hg ci -m changea $ hg up -C 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg cp a aa $ echo c >> a $ hg qnew --git -f -e patcha $ echo d >> a $ hg qnew -d '0 0' -f -e patcha2 Create the reference queue: $ hg qsave -c -e -n refqueue copy $TESTTMP/t2/.hg/patches to $TESTTMP/t2/.hg/refqueue $ hg up -C 1 1 files updated, 0 files merged, 1 files removed, 0 files unresolved Merge: $ HGMERGE=internal:other hg qpush -a -m -n refqueue merging with queue at: $TESTTMP/t2/.hg/refqueue applying patcha patching file a Hunk #1 succeeded at 2 with fuzz 1 (offset 0 lines). fuzz found when applying patch, stopping patch didn't work out, merging patcha 1 files updated, 0 files merged, 1 files removed, 0 files unresolved 0 files updated, 2 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) applying patcha2 now at: patcha2 Check patcha is still a git patch: $ cat .hg/patches/patcha # HG changeset patch # Parent d3873e73d99ef67873dac33fbcc66268d5d2b6f4 diff --git a/a b/a --- a/a +++ b/a @@ -1,1 +1,2 @@ -b +a +c diff --git a/a b/aa copy from a copy to aa --- a/a +++ b/aa @@ -1,1 +1,1 @@ -b +a Check patcha2 is still a regular patch: $ cat .hg/patches/patcha2 # HG changeset patch # Date 0 0 # Parent ???????????????????????????????????????? (glob) diff -r ???????????? -r ???????????? a (glob) --- a/a +++ b/a @@ -1,2 +1,3 @@ a c +d $ cd .. mercurial-4.5.3/tests/test-largefiles-cache.t0000644015407300116100000001743613261161234021072 0ustar augieeng00000000000000Create user cache directory $ USERCACHE=`pwd`/cache; export USERCACHE $ cat <> ${HGRCPATH} > [extensions] > hgext.largefiles= > [largefiles] > usercache=${USERCACHE} > EOF $ mkdir -p ${USERCACHE} Create source repo, and commit adding largefile. $ hg init src $ cd src $ echo large > large $ hg add --large large $ hg commit -m 'add largefile' $ hg rm large $ hg commit -m 'branchhead without largefile' large $ hg up -qr 0 $ rm large $ echo "0000000000000000000000000000000000000000" > .hglf/large $ hg commit -m 'commit missing file with corrupt standin' large abort: large: file not found! [255] $ hg up -Cqr 0 $ cd .. Discard all cached largefiles in USERCACHE $ rm -rf ${USERCACHE} Create mirror repo, and pull from source without largefile: "pull" is used instead of "clone" for suppression of (1) updating to tip (= caching largefile from source repo), and (2) recording source repo as "default" path in .hg/hgrc. $ hg init mirror $ cd mirror $ hg pull ../src pulling from ../src requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 1 changes to 1 files new changesets eb85d9124f3f:26c18ce05e4e (run 'hg update' to get a working copy) Update working directory to "tip", which requires largefile("large"), but there is no cache file for it. So, hg must treat it as "missing"(!) file. $ hg update -r0 getting changed largefiles large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:/*/$TESTTMP/mirror (glob) 0 largefiles updated, 0 removed 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg status ! large Update working directory to null: this cleanup .hg/largefiles/dirstate $ hg update null getting changed largefiles 0 largefiles updated, 0 removed 0 files updated, 0 files merged, 1 files removed, 0 files unresolved Update working directory to tip, again. $ hg update -r0 getting changed largefiles large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:/*/$TESTTMP/mirror (glob) 0 largefiles updated, 0 removed 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg status ! large $ cd .. Verify that largefiles from pulled branchheads are fetched, also to an empty repo $ hg init mirror2 $ hg -R mirror2 pull src -r0 pulling from src adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets eb85d9124f3f (run 'hg update' to get a working copy) #if unix-permissions Portable way to print file permissions: $ cat > ls-l.py < #!$PYTHON > from __future__ import absolute_import, print_function > import os > import sys > path = sys.argv[1] > print('%03o' % (os.lstat(path).st_mode & 0o777)) > EOF $ chmod +x ls-l.py Test that files in .hg/largefiles inherit mode from .hg/store, not from file in working copy: $ cd src $ chmod 750 .hg/store $ chmod 660 large $ echo change >> large $ hg commit -m change created new head $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea 640 Test permission of with files in .hg/largefiles created by update: $ cd ../mirror $ rm -r "$USERCACHE" .hg/largefiles # avoid links $ chmod 750 .hg/store $ hg pull ../src --update -q $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea 640 Test permission of files created by push: $ hg serve -R ../src -d -p $HGPORT --pid-file hg.pid \ > --config "web.allow_push=*" --config web.push_ssl=no $ cat hg.pid >> $DAEMON_PIDS $ echo change >> large $ hg commit -m change $ rm -r "$USERCACHE" $ hg push -q http://localhost:$HGPORT/ $ ../ls-l.py ../src/.hg/largefiles/b734e14a0971e370408ab9bce8d56d8485e368a9 640 $ cd .. #endif Test issue 4053 (remove --after on a deleted, uncommitted file shouldn't say it is missing, but a remove on a nonexistent unknown file still should. Same for a forget.) $ cd src $ touch x $ hg add x $ mv x y $ hg remove -A x y ENOENT ENOENT: * (glob) not removing y: file is untracked [1] $ hg add y $ mv y z $ hg forget y z ENOENT ENOENT: * (glob) not removing z: file is already untracked [1] Largefiles are accessible from the share's store $ cd .. $ hg share -q src share_dst --config extensions.share= $ hg -R share_dst update -r0 getting changed largefiles 1 largefiles updated, 0 removed 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo modified > share_dst/large $ hg -R share_dst ci -m modified created new head Only dirstate is in the local store for the share, and the largefile is in the share source's local store. Avoid the extra largefiles added in the unix conditional above. $ hash=`hg -R share_dst cat share_dst/.hglf/large` $ echo $hash e2fb5f2139d086ded2cb600d5a91a196e76bf020 $ find share_dst/.hg/largefiles/* | sort share_dst/.hg/largefiles/dirstate $ find src/.hg/largefiles/* | egrep "(dirstate|$hash)" | sort src/.hg/largefiles/dirstate src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 Verify that backwards compatibility is maintained for old storage layout $ mv src/.hg/largefiles/$hash share_dst/.hg/largefiles $ hg verify --quiet --lfa -R share_dst --config largefiles.usercache= Inject corruption into the largefiles store and see how update handles that: $ cd src $ hg up -qC tip $ cat large modified $ rm large $ cat .hglf/large e2fb5f2139d086ded2cb600d5a91a196e76bf020 $ mv .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 .. $ echo corruption > .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 $ hg up -C getting changed largefiles large: data corruption in $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 with hash 6a7bb2556144babe3899b25e5428123735bb1e27 0 largefiles updated, 0 removed 0 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to "cd24c147f45c: modified" [12] other heads for branch "default" (re) $ hg st ! large ? z $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 #if serve Test coverage of error handling from putlfile: $ mkdir $TESTTMP/mirrorcache $ hg serve -R ../mirror -d -p $HGPORT1 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache $ cat hg.pid >> $DAEMON_PIDS $ hg push http://localhost:$HGPORT1 -f --config files.usercache=nocache pushing to http://localhost:$HGPORT1/ searching for changes abort: remotestore: could not open file $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020: HTTP Error 403: ssl required [255] $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 Test coverage of 'missing from store': $ hg serve -R ../mirror -d -p $HGPORT2 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache --config "web.allow_push=*" --config web.push_ssl=no $ cat hg.pid >> $DAEMON_PIDS $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache pushing to http://localhost:$HGPORT2/ searching for changes abort: largefile e2fb5f2139d086ded2cb600d5a91a196e76bf020 missing from store (needs to be uploaded) [255] Verify that --lfrev controls which revisions are checked for largefiles to push $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache --lfrev tip pushing to http://localhost:$HGPORT2/ searching for changes abort: largefile e2fb5f2139d086ded2cb600d5a91a196e76bf020 missing from store (needs to be uploaded) [255] $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache --lfrev null pushing to http://localhost:$HGPORT2/ searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files (+1 heads) #endif mercurial-4.5.3/tests/test-commit-amend.t0000644015407300116100000007724613261161234020273 0ustar augieeng00000000000000 $ cat << EOF >> $HGRCPATH > [format] > usegeneraldelta=yes > EOF $ hg init Setup: $ echo a >> a $ hg ci -Am 'base' adding a Refuse to amend public csets: $ hg phase -r . -p $ hg ci --amend abort: cannot amend public changesets (see 'hg help phases' for details) [255] $ hg phase -r . -f -d $ echo a >> a $ hg ci -Am 'base1' Nothing to amend: $ hg ci --amend -m 'base1' nothing changed [1] $ cat >> $HGRCPATH < [hooks] > pretxncommit.foo = sh -c "echo \\"pretxncommit \$HG_NODE\\"; hg id -r \$HG_NODE" > EOF Amending changeset with changes in working dir: (and check that --message does not trigger an editor) $ echo a >> a $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -m 'amend base1' pretxncommit 43f1ba15f28a50abf0aae529cf8a16bfced7b149 43f1ba15f28a tip saved backup bundle to $TESTTMP/.hg/strip-backup/489edb5b847d-5ab4f721-amend.hg $ echo 'pretxncommit.foo = ' >> $HGRCPATH $ hg diff -c . diff -r ad120869acf0 -r 43f1ba15f28a a --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,3 @@ a +a +a $ hg log changeset: 1:43f1ba15f28a tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: amend base1 changeset: 0:ad120869acf0 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: base Check proper abort for empty message $ cat > editor.sh << '__EOF__' > #!/bin/sh > echo "" > "$1" > __EOF__ Update the existing file to ensure that the dirstate is not in pending state (where the status of some files in the working copy is not known yet). This in turn ensures that when the transaction is aborted due to an empty message during the amend, there should be no rollback. $ echo a >> a $ echo b > b $ hg add b $ hg summary parent: 1:43f1ba15f28a tip amend base1 branch: default commit: 1 modified, 1 added, 1 unknown update: (current) phases: 2 draft $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend abort: empty commit message [255] $ hg summary parent: 1:43f1ba15f28a tip amend base1 branch: default commit: 1 modified, 1 added, 1 unknown update: (current) phases: 2 draft Add new file along with modified existing file: $ hg ci --amend -m 'amend base1 new file' saved backup bundle to $TESTTMP/.hg/strip-backup/43f1ba15f28a-007467c2-amend.hg Remove file that was added in amended commit: (and test logfile option) (and test that logfile option do not trigger an editor) $ hg rm b $ echo 'amend base1 remove new file' > ../logfile $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg ci --amend --logfile ../logfile saved backup bundle to $TESTTMP/.hg/strip-backup/c16295aaf401-1ada9901-amend.hg $ hg cat b b: no such file in rev 47343646fa3d [1] No changes, just a different message: $ hg ci -v --amend -m 'no changes, new message' amending changeset 47343646fa3d copying changeset 47343646fa3d to ad120869acf0 committing files: a committing manifest committing changelog 1 changesets found uncompressed size of bundle content: 254 (changelog) 163 (manifests) 131 a saved backup bundle to $TESTTMP/.hg/strip-backup/47343646fa3d-c2758885-amend.hg 1 changesets found uncompressed size of bundle content: 250 (changelog) 163 (manifests) 131 a adding branch adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files committed changeset 1:401431e913a1 $ hg diff -c . diff -r ad120869acf0 -r 401431e913a1 a --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,4 @@ a +a +a +a $ hg log changeset: 1:401431e913a1 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: no changes, new message changeset: 0:ad120869acf0 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: base Disable default date on commit so when -d isn't given, the old date is preserved: $ echo '[defaults]' >> $HGRCPATH $ echo 'commit=' >> $HGRCPATH Test -u/-d: $ cat > .hg/checkeditform.sh < env | grep HGEDITFORM > true > EOF $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -u foo -d '1 0' HGEDITFORM=commit.amend.normal saved backup bundle to $TESTTMP/.hg/strip-backup/401431e913a1-5e8e532c-amend.hg $ echo a >> a $ hg ci --amend -u foo -d '1 0' saved backup bundle to $TESTTMP/.hg/strip-backup/d96b1d28ae33-677e0afb-amend.hg $ hg log -r . changeset: 1:a9a13940fc03 tag: tip user: foo date: Thu Jan 01 00:00:01 1970 +0000 summary: no changes, new message Open editor with old commit message if a message isn't given otherwise: $ cat > editor.sh << '__EOF__' > #!/bin/sh > cat $1 > echo "another precious commit message" > "$1" > __EOF__ at first, test saving last-message.txt $ cat > .hg/hgrc << '__EOF__' > [hooks] > pretxncommit.test-saving-last-message = false > __EOF__ $ rm -f .hg/last-message.txt $ hg commit --amend -v -m "message given from command line" amending changeset a9a13940fc03 copying changeset a9a13940fc03 to ad120869acf0 committing files: a committing manifest committing changelog running hook pretxncommit.test-saving-last-message: false transaction abort! rollback completed abort: pretxncommit.test-saving-last-message hook exited with status 1 [255] $ cat .hg/last-message.txt message given from command line (no-eol) $ rm -f .hg/last-message.txt $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v amending changeset a9a13940fc03 copying changeset a9a13940fc03 to ad120869acf0 no changes, new message HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: foo HG: branch 'default' HG: changed a committing files: a committing manifest committing changelog running hook pretxncommit.test-saving-last-message: false transaction abort! rollback completed abort: pretxncommit.test-saving-last-message hook exited with status 1 [255] $ cat .hg/last-message.txt another precious commit message $ cat > .hg/hgrc << '__EOF__' > [hooks] > pretxncommit.test-saving-last-message = > __EOF__ then, test editing custom commit message $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v amending changeset a9a13940fc03 copying changeset a9a13940fc03 to ad120869acf0 no changes, new message HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: foo HG: branch 'default' HG: changed a committing files: a committing manifest committing changelog 1 changesets found uncompressed size of bundle content: 249 (changelog) 163 (manifests) 133 a saved backup bundle to $TESTTMP/.hg/strip-backup/a9a13940fc03-7c2e8674-amend.hg 1 changesets found uncompressed size of bundle content: 257 (changelog) 163 (manifests) 133 a adding branch adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files committed changeset 1:64a124ba1b44 Same, but with changes in working dir (different code path): $ echo a >> a $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v amending changeset 64a124ba1b44 another precious commit message HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: foo HG: branch 'default' HG: changed a committing files: a committing manifest committing changelog 1 changesets found uncompressed size of bundle content: 257 (changelog) 163 (manifests) 133 a saved backup bundle to $TESTTMP/.hg/strip-backup/64a124ba1b44-10374b8f-amend.hg 1 changesets found uncompressed size of bundle content: 257 (changelog) 163 (manifests) 135 a adding branch adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files committed changeset 1:7892795b8e38 $ rm editor.sh $ hg log -r . changeset: 1:7892795b8e38 tag: tip user: foo date: Thu Jan 01 00:00:01 1970 +0000 summary: another precious commit message Moving bookmarks, preserve active bookmark: $ hg book book1 $ hg book book2 $ hg ci --amend -m 'move bookmarks' saved backup bundle to $TESTTMP/.hg/strip-backup/7892795b8e38-3fb46217-amend.hg $ hg book book1 1:8311f17e2616 * book2 1:8311f17e2616 $ echo a >> a $ hg ci --amend -m 'move bookmarks' saved backup bundle to $TESTTMP/.hg/strip-backup/8311f17e2616-f0504fe3-amend.hg $ hg book book1 1:a3b65065808c * book2 1:a3b65065808c abort does not loose bookmarks $ cat > editor.sh << '__EOF__' > #!/bin/sh > echo "" > "$1" > __EOF__ $ echo a >> a $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend abort: empty commit message [255] $ hg book book1 1:a3b65065808c * book2 1:a3b65065808c $ hg revert -Caq $ rm editor.sh $ echo '[defaults]' >> $HGRCPATH $ echo "commit=-d '0 0'" >> $HGRCPATH Moving branches: $ hg branch foo marked working directory as branch foo (branches are permanent and global, did you want a bookmark?) $ echo a >> a $ hg ci -m 'branch foo' $ hg branch default -f marked working directory as branch default $ hg ci --amend -m 'back to default' saved backup bundle to $TESTTMP/.hg/strip-backup/f8339a38efe1-c18453c9-amend.hg $ hg branches default 2:9c07515f2650 Close branch: $ hg up -q 0 $ echo b >> b $ hg branch foo marked working directory as branch foo (branches are permanent and global, did you want a bookmark?) $ hg ci -Am 'fork' adding b $ echo b >> b $ hg ci -mb $ hg ci --amend --close-branch -m 'closing branch foo' saved backup bundle to $TESTTMP/.hg/strip-backup/c962248fa264-54245dc7-amend.hg Same thing, different code path: $ echo b >> b $ hg ci -m 'reopen branch' reopening closed branch head 4 $ echo b >> b $ hg ci --amend --close-branch saved backup bundle to $TESTTMP/.hg/strip-backup/027371728205-b900d9fa-amend.hg $ hg branches default 2:9c07515f2650 Refuse to amend during a merge: $ hg up -q default $ hg merge foo 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci --amend abort: cannot amend while merging [255] $ hg ci -m 'merge' Refuse to amend if there is a merge conflict (issue5805): $ hg up -q foo $ echo c > a $ hg up default -t :fail 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges [1] $ hg resolve -l U a $ hg ci --amend abort: unresolved merge conflicts (see 'hg help resolve') [255] $ hg up -qC . Follow copies/renames: $ hg mv b c $ hg ci -m 'b -> c' $ hg mv c d $ hg ci --amend -m 'b -> d' saved backup bundle to $TESTTMP/.hg/strip-backup/42f3f27a067d-f23cc9f7-amend.hg $ hg st --rev '.^' --copies d A d b $ hg cp d e $ hg ci -m 'e = d' $ hg cp e f $ hg ci --amend -m 'f = d' saved backup bundle to $TESTTMP/.hg/strip-backup/9198f73182d5-251d584a-amend.hg $ hg st --rev '.^' --copies f A f d $ mv f f.orig $ hg rm -A f $ hg ci -m removef $ hg cp a f $ mv f.orig f $ hg ci --amend -m replacef saved backup bundle to $TESTTMP/.hg/strip-backup/f0993ab6b482-eda301bf-amend.hg $ hg st --change . --copies $ hg log -r . --template "{file_copies}\n" Move added file (issue3410): $ echo g >> g $ hg ci -Am g adding g $ hg mv g h $ hg ci --amend saved backup bundle to $TESTTMP/.hg/strip-backup/58585e3f095c-0f5ebcda-amend.hg $ hg st --change . --copies h A h $ hg log -r . --template "{file_copies}\n" Can't rollback an amend: $ hg rollback no rollback information available [1] Preserve extra dict (issue3430): $ hg branch a marked working directory as branch a (branches are permanent and global, did you want a bookmark?) $ echo a >> a $ hg ci -ma $ hg ci --amend -m "a'" saved backup bundle to $TESTTMP/.hg/strip-backup/39a162f1d65e-9dfe13d8-amend.hg $ hg log -r . --template "{branch}\n" a $ hg ci --amend -m "a''" saved backup bundle to $TESTTMP/.hg/strip-backup/d5ca7b1ac72b-0b4c1a34-amend.hg $ hg log -r . --template "{branch}\n" a Also preserve other entries in the dict that are in the old commit, first graft something so there's an additional entry: $ hg up 0 -q $ echo z > z $ hg ci -Am 'fork' adding z created new head $ hg up 11 5 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg graft 12 grafting 12:2647734878ef "fork" (tip) $ hg ci --amend -m 'graft amend' saved backup bundle to $TESTTMP/.hg/strip-backup/fe8c6f7957ca-25638666-amend.hg $ hg log -r . --debug | grep extra extra: amend_source=fe8c6f7957ca1665ed77496ed7a07657d469ac60 extra: branch=a extra: source=2647734878ef0236dda712fae9c1651cf694ea8a Preserve phase $ hg phase '.^::.' 11: draft 13: draft $ hg phase --secret --force . $ hg phase '.^::.' 11: draft 13: secret $ hg commit --amend -m 'amend for phase' -q $ hg phase '.^::.' 11: draft 13: secret Test amend with obsolete --------------------------- Enable obsolete $ cat >> $HGRCPATH << EOF > [experimental] > evolution.createmarkers=True > evolution.allowunstable=True > EOF Amend with no files changes $ hg id -n 13 $ hg ci --amend -m 'babar' $ hg id -n 14 $ hg log -Gl 3 --style=compact @ 14[tip]:11 682950e85999 1970-01-01 00:00 +0000 test | babar | | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test | | fork | ~ o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test | a'' ~ $ hg log -Gl 4 --hidden --style=compact @ 14[tip]:11 682950e85999 1970-01-01 00:00 +0000 test | babar | | x 13:11 5167600b0f7a 1970-01-01 00:00 +0000 test |/ amend for phase | | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test | | fork | ~ o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test | a'' ~ Amend with files changes (note: the extra commit over 15 is a temporary junk I would be happy to get ride of) $ echo 'babar' >> a $ hg commit --amend $ hg log -Gl 6 --hidden --style=compact @ 15[tip]:11 a5b42b49b0d5 1970-01-01 00:00 +0000 test | babar | | x 14:11 682950e85999 1970-01-01 00:00 +0000 test |/ babar | | x 13:11 5167600b0f7a 1970-01-01 00:00 +0000 test |/ amend for phase | | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test | | fork | ~ o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test | a'' | o 10 5fa75032e226 1970-01-01 00:00 +0000 test | g ~ Test that amend does not make it easy to create obsolescence cycle --------------------------------------------------------------------- $ hg id -r 14 --hidden 682950e85999 (a) $ hg revert -ar 14 --hidden reverting a $ hg commit --amend $ hg id 37973c7e0b61 (a) tip Test that rewriting leaving instability behind is allowed --------------------------------------------------------------------- $ hg up '.^' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo 'b' >> a $ hg log --style compact -r 'children(.)' 16[tip]:11 37973c7e0b61 1970-01-01 00:00 +0000 test babar $ hg commit --amend 1 new orphan changesets $ hg log -r 'orphan()' changeset: 16:37973c7e0b61 branch: a parent: 11:0ddb275cfad1 user: test date: Thu Jan 01 00:00:00 1970 +0000 instability: orphan summary: babar Amend a merge changeset (with renames and conflicts from the second parent): $ hg up -q default $ hg branch -q bar $ hg cp a aa $ hg mv z zz $ echo cc > cc $ hg add cc $ hg ci -m aazzcc $ hg up -q default $ echo a >> a $ echo dd > cc $ hg add cc $ hg ci -m aa $ hg merge -q bar warning: conflicts while merging cc! (edit, then use 'hg resolve --mark') [1] $ hg resolve -m cc (no more unresolved files) $ hg ci -m 'merge bar' $ hg log --config diff.git=1 -pr . changeset: 20:163cfd7219f7 tag: tip parent: 19:30d96aeaf27b parent: 18:1aa437659d19 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: merge bar diff --git a/a b/aa copy from a copy to aa diff --git a/cc b/cc --- a/cc +++ b/cc @@ -1,1 +1,5 @@ +<<<<<<< working copy: 30d96aeaf27b - test: aa dd +======= +cc +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc diff --git a/z b/zz rename from z rename to zz $ hg debugrename aa aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e $ hg debugrename zz zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a $ hg debugrename cc cc not renamed $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -m 'merge bar (amend message)' --edit HGEDITFORM=commit.amend.merge $ hg log --config diff.git=1 -pr . changeset: 21:bca52d4ed186 tag: tip parent: 19:30d96aeaf27b parent: 18:1aa437659d19 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: merge bar (amend message) diff --git a/a b/aa copy from a copy to aa diff --git a/cc b/cc --- a/cc +++ b/cc @@ -1,1 +1,5 @@ +<<<<<<< working copy: 30d96aeaf27b - test: aa dd +======= +cc +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc diff --git a/z b/zz rename from z rename to zz $ hg debugrename aa aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e $ hg debugrename zz zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a $ hg debugrename cc cc not renamed $ hg mv zz z $ hg ci --amend -m 'merge bar (undo rename)' $ hg log --config diff.git=1 -pr . changeset: 22:12594a98ca3f tag: tip parent: 19:30d96aeaf27b parent: 18:1aa437659d19 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: merge bar (undo rename) diff --git a/a b/aa copy from a copy to aa diff --git a/cc b/cc --- a/cc +++ b/cc @@ -1,1 +1,5 @@ +<<<<<<< working copy: 30d96aeaf27b - test: aa dd +======= +cc +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc $ hg debugrename z z not renamed Amend a merge changeset (with renames during the merge): $ hg up -q bar $ echo x > x $ hg add x $ hg ci -m x $ hg up -q default $ hg merge -q bar $ hg mv aa aaa $ echo aa >> aaa $ hg ci -m 'merge bar again' $ hg log --config diff.git=1 -pr . changeset: 24:dffde028b388 tag: tip parent: 22:12594a98ca3f parent: 23:4c94d5bc65f5 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: merge bar again diff --git a/aa b/aa deleted file mode 100644 --- a/aa +++ /dev/null @@ -1,2 +0,0 @@ -a -a diff --git a/aaa b/aaa new file mode 100644 --- /dev/null +++ b/aaa @@ -0,0 +1,3 @@ +a +a +aa diff --git a/x b/x new file mode 100644 --- /dev/null +++ b/x @@ -0,0 +1,1 @@ +x $ hg debugrename aaa aaa renamed from aa:37d9b5d994eab34eda9c16b195ace52c7b129980 $ hg mv aaa aa $ hg ci --amend -m 'merge bar again (undo rename)' $ hg log --config diff.git=1 -pr . changeset: 25:18e3ba160489 tag: tip parent: 22:12594a98ca3f parent: 23:4c94d5bc65f5 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: merge bar again (undo rename) diff --git a/aa b/aa --- a/aa +++ b/aa @@ -1,2 +1,3 @@ a a +aa diff --git a/x b/x new file mode 100644 --- /dev/null +++ b/x @@ -0,0 +1,1 @@ +x $ hg debugrename aa aa not renamed $ hg debugrename -r '.^' aa aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e Amend a merge changeset (with manifest-level conflicts): $ hg up -q bar $ hg rm aa $ hg ci -m 'rm aa' $ hg up -q default $ echo aa >> aa $ hg ci -m aa $ hg merge -q bar --config ui.interactive=True << EOF > c > EOF local [working copy] changed aa which other [merge rev] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? c $ hg ci -m 'merge bar (with conflicts)' $ hg log --config diff.git=1 -pr . changeset: 28:b4c3035e2544 tag: tip parent: 27:4b216ca5ba97 parent: 26:67db8847a540 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: merge bar (with conflicts) $ hg rm aa $ hg ci --amend -m 'merge bar (with conflicts, amended)' $ hg log --config diff.git=1 -pr . changeset: 29:1205ed810051 tag: tip parent: 27:4b216ca5ba97 parent: 26:67db8847a540 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: merge bar (with conflicts, amended) diff --git a/aa b/aa deleted file mode 100644 --- a/aa +++ /dev/null @@ -1,4 +0,0 @@ -a -a -aa -aa Issue 3445: amending with --close-branch a commit that created a new head should fail This shouldn't be possible: $ hg up -q default $ hg branch closewithamend marked working directory as branch closewithamend $ echo foo > foo $ hg add foo $ hg ci -m.. $ hg ci --amend --close-branch -m 'closing' abort: can only close branch heads [255] This silliness fails: $ hg branch silliness marked working directory as branch silliness $ echo b >> b $ hg ci --close-branch -m'open and close' abort: can only close branch heads [255] Test that amend with --secret creates new secret changeset forcibly --------------------------------------------------------------------- $ hg phase '.^::.' 29: draft 30: draft $ hg commit --amend --secret -m 'amend as secret' -q $ hg phase '.^::.' 29: draft 31: secret Test that amend with --edit invokes editor forcibly --------------------------------------------------- $ hg parents --template "{desc}\n" amend as secret $ HGEDITOR=cat hg commit --amend -m "editor should be suppressed" $ hg parents --template "{desc}\n" editor should be suppressed $ hg status --rev '.^1::.' A foo $ HGEDITOR=cat hg commit --amend -m "editor should be invoked" --edit editor should be invoked HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: test HG: branch 'silliness' HG: added foo $ hg parents --template "{desc}\n" editor should be invoked Test that "diff()" in committemplate works correctly for amending ----------------------------------------------------------------- $ cat >> .hg/hgrc < [committemplate] > changeset.commit.amend = {desc}\n > HG: M: {file_mods} > HG: A: {file_adds} > HG: R: {file_dels} > {splitlines(diff()) % 'HG: {line}\n'} > EOF $ hg parents --template "M: {file_mods}\nA: {file_adds}\nR: {file_dels}\n" M: A: foo R: $ hg status -amr $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo" expecting diff of foo HG: M: HG: A: foo HG: R: HG: diff -r 1205ed810051 foo HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 HG: @@ -0,0 +1,1 @@ HG: +foo $ echo y > y $ hg add y $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo and y" expecting diff of foo and y HG: M: HG: A: foo y HG: R: HG: diff -r 1205ed810051 foo HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 HG: @@ -0,0 +1,1 @@ HG: +foo HG: diff -r 1205ed810051 y HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000 HG: @@ -0,0 +1,1 @@ HG: +y $ hg rm a $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo and y" expecting diff of a, foo and y HG: M: HG: A: foo y HG: R: a HG: diff -r 1205ed810051 a HG: --- a/a Thu Jan 01 00:00:00 1970 +0000 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 HG: @@ -1,2 +0,0 @@ HG: -a HG: -a HG: diff -r 1205ed810051 foo HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 HG: @@ -0,0 +1,1 @@ HG: +foo HG: diff -r 1205ed810051 y HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000 HG: @@ -0,0 +1,1 @@ HG: +y $ hg rm x $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo, x and y" expecting diff of a, foo, x and y HG: M: HG: A: foo y HG: R: a x HG: diff -r 1205ed810051 a HG: --- a/a Thu Jan 01 00:00:00 1970 +0000 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 HG: @@ -1,2 +0,0 @@ HG: -a HG: -a HG: diff -r 1205ed810051 foo HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 HG: @@ -0,0 +1,1 @@ HG: +foo HG: diff -r 1205ed810051 x HG: --- a/x Thu Jan 01 00:00:00 1970 +0000 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 HG: @@ -1,1 +0,0 @@ HG: -x HG: diff -r 1205ed810051 y HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000 HG: @@ -0,0 +1,1 @@ HG: +y $ echo cccc >> cc $ hg status -amr M cc $ HGEDITOR=cat hg commit --amend -e -m "cc should be excluded" -X cc cc should be excluded HG: M: HG: A: foo y HG: R: a x HG: diff -r 1205ed810051 a HG: --- a/a Thu Jan 01 00:00:00 1970 +0000 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 HG: @@ -1,2 +0,0 @@ HG: -a HG: -a HG: diff -r 1205ed810051 foo HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000 HG: @@ -0,0 +1,1 @@ HG: +foo HG: diff -r 1205ed810051 x HG: --- a/x Thu Jan 01 00:00:00 1970 +0000 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 HG: @@ -1,1 +0,0 @@ HG: -x HG: diff -r 1205ed810051 y HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000 HG: @@ -0,0 +1,1 @@ HG: +y Check for issue4405 ------------------- Setup the repo with a file that gets moved in a second commit. $ hg init repo $ cd repo $ touch a0 $ hg add a0 $ hg commit -m a0 $ hg mv a0 a1 $ hg commit -m a1 $ hg up -q 0 $ hg log -G --template '{rev} {desc}' o 1 a1 | @ 0 a0 Now we branch the repro, but re-use the file contents, so we have a divergence in the file revlog topology and the changelog topology. $ hg revert --rev 1 --all removing a0 adding a1 $ hg ci -qm 'a1-amend' $ hg log -G --template '{rev} {desc}' @ 2 a1-amend | | o 1 a1 |/ o 0 a0 The way mercurial does amends is by folding the working copy and old commit together into another commit (rev 3). During this process, _findlimit is called to check how far back to look for the transitive closure of file copy information, but due to the divergence of the filelog and changelog graph topologies, before _findlimit was fixed, it returned a rev which was not far enough back in this case. $ hg mv a1 a2 $ hg status --copies --rev 0 A a2 a0 R a0 $ hg ci --amend -q $ hg log -G --template '{rev} {desc}' @ 3 a1-amend | | o 1 a1 |/ o 0 a0 Before the fix, the copy information was lost. $ hg status --copies --rev 0 A a2 a0 R a0 $ cd .. Check that amend properly preserve rename from directory rename (issue-4516) If a parent of the merge renames a full directory, any files added to the old directory in the other parent will be renamed to the new directory. For some reason, the rename metadata was when amending such merge. This test ensure we do not regress. We have a dedicated repo because it needs a setup with renamed directory) $ hg init issue4516 $ cd issue4516 $ mkdir olddirname $ echo line1 > olddirname/commonfile.py $ hg add olddirname/commonfile.py $ hg ci -m first $ hg branch newdirname marked working directory as branch newdirname (branches are permanent and global, did you want a bookmark?) $ hg mv olddirname newdirname moving olddirname/commonfile.py to newdirname/commonfile.py $ hg ci -m rename $ hg update default 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo line1 > olddirname/newfile.py $ hg add olddirname/newfile.py $ hg ci -m log $ hg up newdirname 1 files updated, 0 files merged, 2 files removed, 0 files unresolved $ # create newdirname/newfile.py $ hg merge default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m add $ $ hg debugrename newdirname/newfile.py newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def $ hg status -C --change . A newdirname/newfile.py $ hg status -C --rev 1 A newdirname/newfile.py $ hg status -C --rev 2 A newdirname/commonfile.py olddirname/commonfile.py A newdirname/newfile.py olddirname/newfile.py R olddirname/commonfile.py R olddirname/newfile.py $ hg debugindex newdirname/newfile.py rev offset length delta linkrev nodeid p1 p2 0 0 89 -1 3 34a4d536c0c0 000000000000 000000000000 $ echo a >> newdirname/commonfile.py $ hg ci --amend -m bug $ hg debugrename newdirname/newfile.py newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def $ hg debugindex newdirname/newfile.py rev offset length delta linkrev nodeid p1 p2 0 0 89 -1 3 34a4d536c0c0 000000000000 000000000000 #if execbit Test if amend preserves executable bit changes $ chmod +x newdirname/commonfile.py $ hg ci -m chmod $ hg ci --amend -m "chmod amended" $ hg ci --amend -m "chmod amended second time" $ hg log -p --git -r . changeset: 7:b1326f52dddf branch: newdirname tag: tip parent: 4:7fd235f7cb2f user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: chmod amended second time diff --git a/newdirname/commonfile.py b/newdirname/commonfile.py old mode 100644 new mode 100755 #endif Test amend with file inclusion options -------------------------------------- These tests ensure that we are always amending some files that were part of the pre-amend commit. We want to test that the remaining files in the pre-amend commit were not changed in the amended commit. We do so by performing a diff of the amended commit against its parent commit. $ cd .. $ hg init testfileinclusions $ cd testfileinclusions $ echo a > a $ echo b > b $ hg commit -Aqm "Adding a and b" Only add changes to a particular file $ echo a >> a $ echo b >> b $ hg commit --amend -I a $ hg diff --git -r null -r . diff --git a/a b/a new file mode 100644 --- /dev/null +++ b/a @@ -0,0 +1,2 @@ +a +a diff --git a/b b/b new file mode 100644 --- /dev/null +++ b/b @@ -0,0 +1,1 @@ +b $ echo a >> a $ hg commit --amend b $ hg diff --git -r null -r . diff --git a/a b/a new file mode 100644 --- /dev/null +++ b/a @@ -0,0 +1,2 @@ +a +a diff --git a/b b/b new file mode 100644 --- /dev/null +++ b/b @@ -0,0 +1,2 @@ +b +b Exclude changes to a particular file $ echo b >> b $ hg commit --amend -X a $ hg diff --git -r null -r . diff --git a/a b/a new file mode 100644 --- /dev/null +++ b/a @@ -0,0 +1,2 @@ +a +a diff --git a/b b/b new file mode 100644 --- /dev/null +++ b/b @@ -0,0 +1,3 @@ +b +b +b Check the addremove flag $ echo c > c $ rm a $ hg commit --amend -A removing a adding c $ hg diff --git -r null -r . diff --git a/b b/b new file mode 100644 --- /dev/null +++ b/b @@ -0,0 +1,3 @@ +b +b +b diff --git a/c b/c new file mode 100644 --- /dev/null +++ b/c @@ -0,0 +1,1 @@ +c mercurial-4.5.3/tests/test-diff-subdir.t0000644015407300116100000000165713261161234020110 0ustar augieeng00000000000000 $ hg init $ mkdir alpha $ touch alpha/one $ mkdir beta $ touch beta/two $ hg add alpha/one beta/two $ hg ci -m "start" $ echo 1 > alpha/one $ echo 2 > beta/two everything $ hg diff --nodates diff -r 7d5ef1aea329 alpha/one --- a/alpha/one +++ b/alpha/one @@ -0,0 +1,1 @@ +1 diff -r 7d5ef1aea329 beta/two --- a/beta/two +++ b/beta/two @@ -0,0 +1,1 @@ +2 beta only $ hg diff --nodates beta diff -r 7d5ef1aea329 beta/two --- a/beta/two +++ b/beta/two @@ -0,0 +1,1 @@ +2 inside beta $ cd beta $ hg diff --nodates . diff -r 7d5ef1aea329 beta/two --- a/beta/two +++ b/beta/two @@ -0,0 +1,1 @@ +2 relative to beta $ cd .. $ hg diff --nodates --root beta diff -r 7d5ef1aea329 two --- a/two +++ b/two @@ -0,0 +1,1 @@ +2 inside beta $ cd beta $ hg diff --nodates --root . diff -r 7d5ef1aea329 two --- a/two +++ b/two @@ -0,0 +1,1 @@ +2 $ cd .. mercurial-4.5.3/tests/test-push-checkheads-pruned-B5.t0000644015407300116100000000426413261161234022505 0ustar augieeng00000000000000==================================== Testing head checking code: Case B-5 ==================================== Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This case is part of a series of tests checking this behavior. Category B: simple case involving pruned changesets TestCase 5: multi-changeset branch, mix of pruned and superceeded .. old-state: .. .. * 3 changeset branch .. .. new-state: .. .. * old head is pruned .. * old mid is superceeded .. * old root is pruned .. .. expected-result: .. .. * push allowed .. .. graph-summary: .. .. B ⊗ .. | .. A ø⇠◔ A' .. | | .. B ⊗ | .. |/ .. ◠$ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir B5 $ cd B5 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd server $ mkcommit B0 $ mkcommit C0 $ cd ../client $ hg pull pulling from $TESTTMP/B5/server searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files new changesets d73caddc5533:821fb21d0dd2 (run 'hg update' to get a working copy) $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit B1 created new head $ hg debugobsolete --record-parents `getid "desc(A0)"` obsoleted 1 changesets 2 new orphan changesets $ hg debugobsolete `getid "desc(B0)"` `getid "desc(B1)"` obsoleted 1 changesets $ hg debugobsolete --record-parents `getid "desc(C0)"` obsoleted 1 changesets $ hg log -G --hidden @ 25c56d33e4c4 (draft): B1 | | x 821fb21d0dd2 (draft): C0 | | | x d73caddc5533 (draft): B0 | | | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): root Actual testing -------------- $ hg push pushing to $TESTTMP/B5/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) 3 new obsolescence markers obsoleted 3 changesets $ cd ../.. mercurial-4.5.3/tests/test-convert-svn-move.t0000644015407300116100000001770413261161234021142 0ustar augieeng00000000000000#require svn svn-bindings $ cat >> $HGRCPATH < [extensions] > convert = > EOF $ svnadmin create svn-repo $ svnadmin load -q svn-repo < "$TESTDIR/svn/move.svndump" $ SVNREPOPATH=`pwd`/svn-repo #if windows $ SVNREPOURL=file:///`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` #else $ SVNREPOURL=file://`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` #endif Convert trunk and branches $ hg convert --datesort "$SVNREPOURL"/subproject A-hg initializing destination A-hg repository scanning source... sorting... converting... 13 createtrunk 12 moved1 11 moved1 10 moved2 9 changeb and rm d2 8 changeb and rm d2 7 moved1again 6 moved1again 5 copyfilefrompast 4 copydirfrompast 3 add d3 2 copy dir and remove subdir 1 add d4old 0 rename d4old into d4new $ cd A-hg $ hg log -G --template '{rev} {desc|firstline} files: {files}\n' o 13 rename d4old into d4new files: d4new/g d4old/g | o 12 add d4old files: d4old/g | o 11 copy dir and remove subdir files: d3/d31/e d4/d31/e d4/f | o 10 add d3 files: d3/d31/e d3/f | o 9 copydirfrompast files: d2/d | o 8 copyfilefrompast files: d | o 7 moved1again files: d1/b d1/c | | o 6 moved1again files: | | o | 5 changeb and rm d2 files: d1/b d2/d | | | o 4 changeb and rm d2 files: b | | o | 3 moved2 files: d2/d | | o | 2 moved1 files: d1/b d1/c | | | o 1 moved1 files: b c | o 0 createtrunk files: Check move copy records $ hg st --rev 12:13 --copies A d4new/g d4old/g R d4old/g Check branches $ hg branches default 13:* (glob) d1 6:* (glob) $ cd .. $ mkdir test-replace $ cd test-replace $ svnadmin create svn-repo $ svnadmin load -q svn-repo < "$TESTDIR/svn/replace.svndump" Convert files being replaced by directories $ hg convert svn-repo hg-repo initializing destination hg-repo repository scanning source... sorting... converting... 6 initial 5 clobber symlink 4 clobber1 3 clobber2 2 adddb 1 clobberdir 0 branch $ cd hg-repo Manifest before $ hg -v manifest -r 1 644 a 644 d/b 644 d2/a 644 @ dlink 644 @ dlink2 644 dlink3 Manifest after clobber1 $ hg -v manifest -r 2 644 a/b 644 d/b 644 d2/a 644 dlink/b 644 @ dlink2 644 dlink3 Manifest after clobber2 $ hg -v manifest -r 3 644 a/b 644 d/b 644 d2/a 644 dlink/b 644 @ dlink2 644 @ dlink3 Manifest after clobberdir $ hg -v manifest -r 6 644 a/b 644 d/b 644 d2/a 644 d2/c 644 dlink/b 644 @ dlink2 644 @ dlink3 Try updating $ hg up -qC default $ cd .. Test convert progress bar $ cat >> $HGRCPATH < [progress] > assume-tty = 1 > delay = 0 > changedelay = 0 > format = topic bar number > refresh = 0 > width = 60 > EOF $ hg convert svn-repo hg-progress \r (no-eol) (esc) scanning [=====> ] 1/7\r (no-eol) (esc) scanning [===========> ] 2/7\r (no-eol) (esc) scanning [=================> ] 3/7\r (no-eol) (esc) scanning [========================> ] 4/7\r (no-eol) (esc) scanning [==============================> ] 5/7\r (no-eol) (esc) scanning [====================================> ] 6/7\r (no-eol) (esc) scanning [===========================================>] 7/7\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [ ] 0/7\r (no-eol) (esc) getting files [=====> ] 1/6\r (no-eol) (esc) getting files [============> ] 2/6\r (no-eol) (esc) getting files [==================> ] 3/6\r (no-eol) (esc) getting files [=========================> ] 4/6\r (no-eol) (esc) getting files [===============================> ] 5/6\r (no-eol) (esc) getting files [======================================>] 6/6\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [=====> ] 1/7\r (no-eol) (esc) scanning paths [ ] 0/1\r (no-eol) (esc) getting files [======================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [===========> ] 2/7\r (no-eol) (esc) scanning paths [ ] 0/2\r (no-eol) (esc) scanning paths [==================> ] 1/2\r (no-eol) (esc) getting files [========> ] 1/4\r (no-eol) (esc) getting files [==================> ] 2/4\r (no-eol) (esc) getting files [============================> ] 3/4\r (no-eol) (esc) getting files [======================================>] 4/4\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [=================> ] 3/7\r (no-eol) (esc) scanning paths [ ] 0/1\r (no-eol) (esc) getting files [======================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [=======================> ] 4/7\r (no-eol) (esc) scanning paths [ ] 0/1\r (no-eol) (esc) getting files [======================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [=============================> ] 5/7\r (no-eol) (esc) scanning paths [ ] 0/1\r (no-eol) (esc) getting files [===> ] 1/8\r (no-eol) (esc) getting files [========> ] 2/8\r (no-eol) (esc) getting files [=============> ] 3/8\r (no-eol) (esc) getting files [==================> ] 4/8\r (no-eol) (esc) getting files [=======================> ] 5/8\r (no-eol) (esc) getting files [============================> ] 6/8\r (no-eol) (esc) getting files [=================================> ] 7/8\r (no-eol) (esc) getting files [======================================>] 8/8\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [===================================> ] 6/7\r (no-eol) (esc) scanning paths [ ] 0/3\r (no-eol) (esc) scanning paths [===========> ] 1/3\r (no-eol) (esc) scanning paths [========================> ] 2/3\r (no-eol) (esc) getting files [===> ] 1/8\r (no-eol) (esc) getting files [========> ] 2/8\r (no-eol) (esc) getting files [=============> ] 3/8\r (no-eol) (esc) getting files [==================> ] 4/8\r (no-eol) (esc) getting files [=======================> ] 5/8\r (no-eol) (esc) getting files [============================> ] 6/8\r (no-eol) (esc) getting files [=================================> ] 7/8\r (no-eol) (esc) getting files [======================================>] 8/8\r (no-eol) (esc) \r (no-eol) (esc) initializing destination hg-progress repository scanning source... sorting... converting... 6 initial 5 clobber symlink 4 clobber1 3 clobber2 2 adddb 1 clobberdir 0 branch $ cd .. mercurial-4.5.3/tests/test-diffstat.t0000644015407300116100000001202013261161234017500 0ustar augieeng00000000000000 $ hg init repo $ cd repo $ i=0; while [ "$i" -lt 213 ]; do echo a >> a; i=`expr $i + 1`; done $ hg add a $ cp a b $ hg add b Wide diffstat: $ hg diff --stat a | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ b | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 426 insertions(+), 0 deletions(-) diffstat width: $ COLUMNS=24 hg diff --config ui.interactive=true --stat a | 213 ++++++++++++++ b | 213 ++++++++++++++ 2 files changed, 426 insertions(+), 0 deletions(-) $ hg ci -m adda $ cat >> a < a > a > a > EOF Narrow diffstat: $ hg diff --stat a | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) $ hg ci -m appenda >>> open("c", "wb").write(b"\0") $ touch d $ hg add c d Binary diffstat: $ hg diff --stat c | Bin 1 files changed, 0 insertions(+), 0 deletions(-) Binary git diffstat: $ hg diff --stat --git c | Bin d | 0 2 files changed, 0 insertions(+), 0 deletions(-) $ hg ci -m createb >>> open("file with spaces", "wb").write(b"\0") $ hg add "file with spaces" Filename with spaces diffstat: $ hg diff --stat file with spaces | Bin 1 files changed, 0 insertions(+), 0 deletions(-) Filename with spaces git diffstat: $ hg diff --stat --git file with spaces | Bin 1 files changed, 0 insertions(+), 0 deletions(-) Filename without "a/" or "b/" (issue5759): $ hg diff --config 'diff.noprefix=1' -c1 --stat --git a | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) $ hg diff --config 'diff.noprefix=1' -c2 --stat --git c | Bin d | 0 2 files changed, 0 insertions(+), 0 deletions(-) $ hg log --config 'diff.noprefix=1' -r '1:' -p --stat --git changeset: 1:3a95b07bb77f user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: appenda a | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a a --- a +++ a @@ -211,3 +211,6 @@ a a a +a +a +a changeset: 2:c60a6c753773 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: createb c | Bin d | 0 2 files changed, 0 insertions(+), 0 deletions(-) diff --git c c new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 Ic${MZ000310RR91 diff --git d d new file mode 100644 diffstat within directories: $ hg rm -f 'file with spaces' $ mkdir dir1 dir2 $ echo new1 > dir1/new $ echo new2 > dir2/new $ hg add dir1/new dir2/new $ hg diff --stat dir1/new | 1 + dir2/new | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) $ hg diff --stat --root dir1 new | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) $ hg diff --stat --root dir1 dir2 warning: dir2 not inside relative root dir1 $ hg diff --stat --root dir1 -I dir1/old $ cd dir1 $ hg diff --stat . dir1/new | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) $ hg diff --stat --root . new | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) $ hg diff --stat --root ../dir1 ../dir2 warning: ../dir2 not inside relative root . $ hg diff --stat --root . -I old $ cd .. Files with lines beginning with '--' or '++' should be properly counted in diffstat $ hg up -Cr tip 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm dir1/new $ rm dir2/new $ rm "file with spaces" $ cat > file << EOF > line 1 > line 2 > line 3 > EOF $ hg commit -Am file adding file Lines added starting with '--' should count as additions $ cat > file << EOF > line 1 > -- line 2, with dashes > line 3 > EOF $ hg diff --root . diff -r be1569354b24 file --- a/file Thu Jan 01 00:00:00 1970 +0000 +++ b/file * (glob) @@ -1,3 +1,3 @@ line 1 -line 2 +-- line 2, with dashes line 3 $ hg diff --root . --stat file | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Lines changed starting with '--' should count as deletions $ hg commit -m filev2 $ cat > file << EOF > line 1 > -- line 2, with dashes, changed again > line 3 > EOF $ hg diff --root . diff -r 160f7c034df6 file --- a/file Thu Jan 01 00:00:00 1970 +0000 +++ b/file * (glob) @@ -1,3 +1,3 @@ line 1 --- line 2, with dashes +-- line 2, with dashes, changed again line 3 $ hg diff --root . --stat file | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Lines changed starting with '--' should count as deletions and starting with '++' should count as additions $ cat > file << EOF > line 1 > ++ line 2, switched dashes to plusses > line 3 > EOF $ hg diff --root . diff -r 160f7c034df6 file --- a/file Thu Jan 01 00:00:00 1970 +0000 +++ b/file * (glob) @@ -1,3 +1,3 @@ line 1 --- line 2, with dashes +++ line 2, switched dashes to plusses line 3 $ hg diff --root . --stat file | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) mercurial-4.5.3/tests/test-exchange-obsmarkers-case-D4.t0000644015407300116100000001333313261161234023012 0ustar augieeng00000000000000============================================ Testing obsolescence markers push: Cases D.4 ============================================ Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of all changesets that requested to be "in sync" after the push (even if they are already on both side). This test belongs to a series of tests checking such set is properly computed and applied. This does not tests "obsmarkers" discovery capabilities. Category D: Partial Information Case TestCase 4: Unknown changeset in between known changesets D.4 Unknown changeset in between known one ========================================== .. Mostly a clarification case .. .. {{{ .. B ø⇠◌⇠○ B'' .. | | .. A ø⇠◌⇠◔ A' .. \ / .. ◠O .. .. }}} .. .. Should be treated as A.3 case: .. .. {{{ .. .. B ø⇠○ B'' .. | | .. A ø⇠◔ A' .. |/ .. ◠O .. .. }}} Setup ----- $ . $TESTDIR/testlib/exchange-obsmarker-util.sh initial $ setuprepos D.4 creating test repo for test case D.4 - pulldest - main - pushdest cd into `main` and proceed with env setup $ cd main $ mkcommit A0 $ mkcommit B0 $ hg update -q 0 $ mkcommit A1 created new head $ mkcommit B1 $ hg debugobsolete `getid 'desc(A0)'` aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid 'desc(A1)'` $ hg debugobsolete `getid 'desc(B0)'` bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb obsoleted 1 changesets $ hg debugobsolete bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb `getid 'desc(B1)'` $ hg log -G --hidden @ 069b05c3876d (draft): B1 | o e5ea8f9c7314 (draft): A1 | | x 6e72f0a95b5e (draft): B0 | | | x 28b51eb45704 (draft): A0 |/ o a9bdc8b26820 (public): O $ inspect_obsmarkers obsstore content ================ 28b51eb45704506b5c603decd6bf7ac5e0f6a52f aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 069b05c3876d56f62895e853a501ea58ea85f68d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ cd .. $ cd .. Actual Test ----------- $ dotest D.4 A1 ## Running testcase D.4 # testing echange of "A1" (e5ea8f9c7314) ## initial state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 069b05c3876d56f62895e853a501ea58ea85f68d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest ## pushing "A1" from main to pushdest pushing to pushdest searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files remote: 2 new obsolescence markers ## post push state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 069b05c3876d56f62895e853a501ea58ea85f68d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest 28b51eb45704506b5c603decd6bf7ac5e0f6a52f aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest ## pulling "e5ea8f9c7314" from main into pulldest pulling from main searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files 2 new obsolescence markers new changesets e5ea8f9c7314 (run 'hg update' to get a working copy) ## post pull state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 069b05c3876d56f62895e853a501ea58ea85f68d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest 28b51eb45704506b5c603decd6bf7ac5e0f6a52f aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest 28b51eb45704506b5c603decd6bf7ac5e0f6a52f aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} mercurial-4.5.3/tests/test-config.t0000644015407300116100000000771113261161234017154 0ustar augieeng00000000000000hide outer repo $ hg init Invalid syntax: no value $ cat > .hg/hgrc << EOF > novaluekey > EOF $ hg showconfig hg: parse error at $TESTTMP/.hg/hgrc:1: novaluekey [255] Invalid syntax: no key $ cat > .hg/hgrc << EOF > =nokeyvalue > EOF $ hg showconfig hg: parse error at $TESTTMP/.hg/hgrc:1: =nokeyvalue [255] Test hint about invalid syntax from leading white space $ cat > .hg/hgrc << EOF > key=value > EOF $ hg showconfig hg: parse error at $TESTTMP/.hg/hgrc:1: key=value unexpected leading whitespace [255] $ cat > .hg/hgrc << EOF > [section] > key=value > EOF $ hg showconfig hg: parse error at $TESTTMP/.hg/hgrc:1: [section] unexpected leading whitespace [255] Reset hgrc $ echo > .hg/hgrc Test case sensitive configuration $ cat <> $HGRCPATH > [Section] > KeY = Case Sensitive > key = lower case > EOF $ hg showconfig Section Section.KeY=Case Sensitive Section.key=lower case $ hg showconfig Section -Tjson [ { "name": "Section.KeY", "source": "*.hgrc:*", (glob) "value": "Case Sensitive" }, { "name": "Section.key", "source": "*.hgrc:*", (glob) "value": "lower case" } ] $ hg showconfig Section.KeY -Tjson [ { "name": "Section.KeY", "source": "*.hgrc:*", (glob) "value": "Case Sensitive" } ] $ hg showconfig -Tjson | tail -7 }, { "name": "*", (glob) "source": "*", (glob) "value": "*" (glob) } ] Test empty config source: $ cat < emptysource.py > def reposetup(ui, repo): > ui.setconfig('empty', 'source', 'value') > EOF $ cp .hg/hgrc .hg/hgrc.orig $ cat <> .hg/hgrc > [extensions] > emptysource = `pwd`/emptysource.py > EOF $ hg config --debug empty.source read config from: * (glob) none: value $ hg config empty.source -Tjson [ { "name": "empty.source", "source": "", "value": "value" } ] $ cp .hg/hgrc.orig .hg/hgrc Test "%unset" $ cat >> $HGRCPATH < [unsettest] > local-hgrcpath = should be unset (HGRCPATH) > %unset local-hgrcpath > > global = should be unset (HGRCPATH) > > both = should be unset (HGRCPATH) > > set-after-unset = should be unset (HGRCPATH) > EOF $ cat >> .hg/hgrc < [unsettest] > local-hgrc = should be unset (.hg/hgrc) > %unset local-hgrc > > %unset global > > both = should be unset (.hg/hgrc) > %unset both > > set-after-unset = should be unset (.hg/hgrc) > %unset set-after-unset > set-after-unset = should be set (.hg/hgrc) > EOF $ hg showconfig unsettest unsettest.set-after-unset=should be set (.hg/hgrc) Test exit code when no config matches $ hg config Section.idontexist [1] sub-options in [paths] aren't expanded $ cat > .hg/hgrc << EOF > [paths] > foo = ~/foo > foo:suboption = ~/foo > EOF $ hg showconfig paths paths.foo:suboption=~/foo paths.foo=$TESTTMP/foo edit failure $ HGEDITOR=false hg config --edit abort: edit failed: false exited with status 1 [255] config affected by environment variables $ EDITOR=e1 VISUAL=e2 hg config --debug | grep 'ui\.editor' $VISUAL: ui.editor=e2 $ VISUAL=e2 hg config --debug --config ui.editor=e3 | grep 'ui\.editor' --config: ui.editor=e3 $ PAGER=p1 hg config --debug | grep 'pager\.pager' $PAGER: pager.pager=p1 $ PAGER=p1 hg config --debug --config pager.pager=p2 | grep 'pager\.pager' --config: pager.pager=p2 verify that aliases are evaluated as well $ hg init aliastest $ cd aliastest $ cat > .hg/hgrc << EOF > [ui] > user = repo user > EOF $ touch index $ unset HGUSER $ hg ci -Am test adding index $ hg log --template '{author}\n' repo user $ cd .. alias has lower priority $ hg init aliaspriority $ cd aliaspriority $ cat > .hg/hgrc << EOF > [ui] > user = alias user > username = repo user > EOF $ touch index $ unset HGUSER $ hg ci -Am test adding index $ hg log --template '{author}\n' repo user $ cd .. mercurial-4.5.3/tests/test-audit-path.t0000644015407300116100000001150713261161234017745 0ustar augieeng00000000000000 $ hg init audit of .hg $ hg add .hg/00changelog.i abort: path contains illegal component: .hg/00changelog.i [255] #if symlink Symlinks $ mkdir a $ echo a > a/a $ hg ci -Ama adding a/a $ ln -s a b $ echo b > a/b $ hg add b/b abort: path 'b/b' traverses symbolic link 'b' [255] $ hg add b should still fail - maybe $ hg add b/b abort: path 'b/b' traverses symbolic link 'b' [255] $ hg commit -m 'add symlink b' Test symlink traversing when accessing history: ----------------------------------------------- (build a changeset where the path exists as a directory) $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkdir b $ echo c > b/a $ hg add b/a $ hg ci -m 'add directory b' created new head Test that hg cat does not do anything wrong the working copy has 'b' as directory $ hg cat b/a c $ hg cat -r "desc(directory)" b/a c $ hg cat -r "desc(symlink)" b/a b/a: no such file in rev bc151a1f53bd [1] Test that hg cat does not do anything wrong the working copy has 'b' as a symlink (issue4749) $ hg up 'desc(symlink)' 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg cat b/a b/a: no such file in rev bc151a1f53bd [1] $ hg cat -r "desc(directory)" b/a c $ hg cat -r "desc(symlink)" b/a b/a: no such file in rev bc151a1f53bd [1] #endif unbundle tampered bundle $ hg init target $ cd target $ hg unbundle "$TESTDIR/bundles/tampered.hg" adding changesets adding manifests adding file changes added 5 changesets with 6 changes to 6 files (+4 heads) new changesets b7da9bf6b037:fc1393d727bc (run 'hg heads' to see heads, 'hg merge' to merge) attack .hg/test $ hg manifest -r0 .hg/test $ hg update -Cr0 abort: path contains illegal component: .hg/test [255] attack foo/.hg/test $ hg manifest -r1 foo/.hg/test $ hg update -Cr1 abort: path 'foo/.hg/test' is inside nested repo 'foo' [255] attack back/test where back symlinks to .. $ hg manifest -r2 back back/test #if symlink $ hg update -Cr2 abort: path 'back/test' traverses symbolic link 'back' [255] #else ('back' will be a file and cause some other system specific error) $ hg update -Cr2 back: is both a file and a directory abort: * (glob) [255] #endif attack ../test $ hg manifest -r3 ../test $ mkdir ../test $ echo data > ../test/file $ hg update -Cr3 abort: path contains illegal component: ../test [255] $ cat ../test/file data attack /tmp/test $ hg manifest -r4 /tmp/test $ hg update -Cr4 abort: path contains illegal component: /tmp/test [255] $ cd .. Test symlink traversal on merge: -------------------------------- #if symlink set up symlink hell $ mkdir merge-symlink-out $ hg init merge-symlink $ cd merge-symlink $ touch base $ hg commit -qAm base $ ln -s ../merge-symlink-out a $ hg commit -qAm 'symlink a -> ../merge-symlink-out' $ hg up -q 0 $ mkdir a $ touch a/poisoned $ hg commit -qAm 'file a/poisoned' $ hg log -G -T '{rev}: {desc}\n' @ 2: file a/poisoned | | o 1: symlink a -> ../merge-symlink-out |/ o 0: base try trivial merge $ hg up -qC 1 $ hg merge 2 abort: path 'a/poisoned' traverses symbolic link 'a' [255] try rebase onto other revision: cache of audited paths should be discarded, and the rebase should fail (issue5628) $ hg up -qC 2 $ hg rebase -s 2 -d 1 --config extensions.rebase= rebasing 2:e73c21d6b244 "file a/poisoned" (tip) abort: path 'a/poisoned' traverses symbolic link 'a' [255] $ ls ../merge-symlink-out $ cd .. Test symlink traversal on update: --------------------------------- $ mkdir update-symlink-out $ hg init update-symlink $ cd update-symlink $ ln -s ../update-symlink-out a $ hg commit -qAm 'symlink a -> ../update-symlink-out' $ hg rm a $ mkdir a && touch a/b $ hg ci -qAm 'file a/b' a/b $ hg up -qC 0 $ hg rm a $ mkdir a && touch a/c $ hg ci -qAm 'rm a, file a/c' $ hg log -G -T '{rev}: {desc}\n' @ 2: rm a, file a/c | | o 1: file a/b |/ o 0: symlink a -> ../update-symlink-out try linear update where symlink already exists: $ hg up -qC 0 $ hg up 1 abort: path 'a/b' traverses symbolic link 'a' [255] try linear update including symlinked directory and its content: paths are audited first by calculateupdates(), where no symlink is created so both 'a' and 'a/b' are taken as good paths. still applyupdates() should fail. $ hg up -qC null $ hg up 1 abort: path 'a/b' traverses symbolic link 'a' [255] $ ls ../update-symlink-out try branch update replacing directory with symlink, and its content: the path 'a' is audited as a directory first, which should be audited again as a symlink. $ rm -f a $ hg up -qC 2 $ hg up 1 abort: path 'a/b' traverses symbolic link 'a' [255] $ ls ../update-symlink-out $ cd .. #endif mercurial-4.5.3/tests/test-issue1802.t0000644015407300116100000000326113261161234017346 0ustar augieeng00000000000000#require execbit Create extension that can disable exec checks: $ cat > noexec.py < from mercurial import extensions, util > def setflags(orig, f, l, x): > pass > def checkexec(orig, path): > return False > def extsetup(ui): > extensions.wrapfunction(util, 'setflags', setflags) > extensions.wrapfunction(util, 'checkexec', checkexec) > EOF $ hg init unix-repo $ cd unix-repo $ touch a $ hg add a $ hg commit -m 'unix: add a' $ hg clone . ../win-repo updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ chmod +x a $ hg commit -m 'unix: chmod a' $ hg manifest -v 755 * a $ cd ../win-repo $ touch b $ hg add b $ hg commit -m 'win: add b' $ hg manifest -v 644 a 644 b $ hg pull pulling from $TESTTMP/unix-repo searching for changes adding changesets adding manifests adding file changes added 1 changesets with 0 changes to 0 files (+1 heads) new changesets 2d8bcf2dda39 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg manifest -v -r tip 755 * a Simulate a Windows merge: $ hg --config extensions.n=$TESTTMP/noexec.py merge --debug searching for copies back to rev 1 unmatched files in local: b resolving manifests branchmerge: True, force: False, partial: False ancestor: a03b0deabf2b, local: d6fa54f68ae1+, remote: 2d8bcf2dda39 a: update permissions -> e 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) Simulate a Windows commit: $ hg --config extensions.n=$TESTTMP/noexec.py commit -m 'win: merge' $ hg manifest -v 755 * a 644 b $ cd .. mercurial-4.5.3/tests/test-hghave.t0000644015407300116100000000171713261161234017151 0ustar augieeng00000000000000 $ . "$TESTDIR/helpers-testrepo.sh" Testing that hghave does not crash when checking features $ hghave --test-features 2>/dev/null Testing hghave extensibility for third party tools $ cat > hghaveaddon.py < import hghave > @hghave.check("custom", "custom hghave feature") > def has_custom(): > return True > EOF (invocation via run-tests.py) $ cat > test-hghaveaddon.t < #require custom > $ echo foo > foo > EOF $ ( \ > testrepohgenv; \ > $PYTHON $TESTDIR/run-tests.py $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t \ > ) . # Ran 1 tests, 0 skipped, 0 failed. (invocation via command line) $ unset TESTDIR $ hghave custom (terminate with exit code 2 at failure of importing hghaveaddon.py) $ rm hghaveaddon.* $ cat > hghaveaddon.py < importing this file should cause syntax error > EOF $ hghave custom failed to import hghaveaddon.py from '.': invalid syntax (hghaveaddon.py, line 1) [2] mercurial-4.5.3/tests/test-unbundlehash.t0000644015407300116100000000261313261161234020363 0ustar augieeng00000000000000#require killdaemons Test wire protocol unbundle with hashed heads (capability: unbundlehash) $ cat << EOF >> $HGRCPATH > [devel] > # This tests is intended for bundle1 only. > # bundle2 carries the head information inside the bundle itself and > # always uses 'force' as the heads value. > legacy.exchange = bundle1 > EOF Create a remote repository. $ hg init remote $ hg serve -R remote --config web.push_ssl=False --config web.allow_push=* -p $HGPORT -d --pid-file=hg1.pid -E error.log -A access.log $ cat hg1.pid >> $DAEMON_PIDS Clone the repository and push a change. $ hg clone http://localhost:$HGPORT/ local no changes found updating to branch default 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ touch local/README $ hg ci -R local -A -m hoge adding README $ hg push -R local pushing to http://localhost:$HGPORT/ searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files Ensure hashed heads format is used. The hash here is always the same since the remote repository only has the null head. $ cat access.log | grep unbundle * - - [*] "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+6768033e216468247bd031a0a2d9876d79818f8f* (glob) Explicitly kill daemons to let the test exit on Windows $ killdaemons.py mercurial-4.5.3/tests/test-issue4074.t0000644015407300116100000000077513261161234017361 0ustar augieeng00000000000000#require no-pure A script to generate nasty diff worst-case scenarios: $ cat > s.py < import random > for x in xrange(100000): > print > if random.randint(0, 100) >= 50: > x += 1 > print(hex(x)) > EOF $ hg init a $ cd a Check in a big file: $ $PYTHON ../s.py > a $ hg ci -qAm0 Modify it: $ $PYTHON ../s.py > a Time a check-in, should never take more than 10 seconds user time: $ hg ci --time -m1 time: real .* secs .user [0-9][.].* sys .* (re) mercurial-4.5.3/tests/test-trusted.py.out0000644015407300116100000001106313261161234020367 0ustar augieeng00000000000000# same user, same group trusted global = /some/path local = /another/path untrusted . . global = /some/path . . local = /another/path # same user, different group trusted global = /some/path local = /another/path untrusted . . global = /some/path . . local = /another/path # different user, same group not trusting file .hg/hgrc from untrusted user abc, group bar trusted global = /some/path untrusted . . global = /some/path . . local = /another/path # different user, same group, but we trust the group trusted global = /some/path local = /another/path untrusted . . global = /some/path . . local = /another/path # different user, different group not trusting file .hg/hgrc from untrusted user abc, group def trusted global = /some/path untrusted . . global = /some/path . . local = /another/path # different user, different group, but we trust the user trusted global = /some/path local = /another/path untrusted . . global = /some/path . . local = /another/path # different user, different group, but we trust the group trusted global = /some/path local = /another/path untrusted . . global = /some/path . . local = /another/path # different user, different group, but we trust the user and the group trusted global = /some/path local = /another/path untrusted . . global = /some/path . . local = /another/path # we trust all users # different user, different group trusted global = /some/path local = /another/path untrusted . . global = /some/path . . local = /another/path # we trust all groups # different user, different group trusted global = /some/path local = /another/path untrusted . . global = /some/path . . local = /another/path # we trust all users and groups # different user, different group trusted global = /some/path local = /another/path untrusted . . global = /some/path . . local = /another/path # we don't get confused by users and groups with the same name # different user, different group not trusting file .hg/hgrc from untrusted user abc, group def trusted global = /some/path untrusted . . global = /some/path . . local = /another/path # list of user names # different user, different group, but we trust the user trusted global = /some/path local = /another/path untrusted . . global = /some/path . . local = /another/path # list of group names # different user, different group, but we trust the group trusted global = /some/path local = /another/path untrusted . . global = /some/path . . local = /another/path # Can't figure out the name of the user running this process # different user, different group not trusting file .hg/hgrc from untrusted user abc, group def trusted global = /some/path untrusted . . global = /some/path . . local = /another/path # prints debug warnings # different user, different group not trusting file .hg/hgrc from untrusted user abc, group def trusted ignoring untrusted configuration option paths.local = /another/path global = /some/path untrusted . . global = /some/path . ignoring untrusted configuration option paths.local = /another/path . local = /another/path # report_untrusted enabled without debug hides warnings # different user, different group trusted global = /some/path untrusted . . global = /some/path . . local = /another/path # report_untrusted enabled with debug shows warnings # different user, different group not trusting file .hg/hgrc from untrusted user abc, group def trusted ignoring untrusted configuration option paths.local = /another/path global = /some/path untrusted . . global = /some/path . ignoring untrusted configuration option paths.local = /another/path . local = /another/path # ui.readconfig sections quux # read trusted, untrusted, new ui, trusted not trusting file foobar from untrusted user abc, group def trusted: ignoring untrusted configuration option foobar.baz = quux None untrusted: quux # error handling # file doesn't exist # same user, same group # different user, different group # parse error # different user, different group not trusting file .hg/hgrc from untrusted user abc, group def ('foo', '.hg/hgrc:1') # same user, same group ('foo', '.hg/hgrc:1') # access typed information # different user, different group not trusting file .hg/hgrc from untrusted user abc, group def # suboptions, trusted and untrusted (None, []) ('main', [('one', 'one'), ('two', 'two')]) # path, trusted and untrusted None .hg/monty/python # bool, trusted and untrusted False True # int, trusted and untrusted 0 42 # bytes, trusted and untrusted 0 84934656 # list, trusted and untrusted [] ['spam', 'ham', 'eggs'] mercurial-4.5.3/tests/test-branch-tag-confict.t0000644015407300116100000000311413261161234021331 0ustar augieeng00000000000000Initial setup. $ hg init repo $ cd repo $ touch thefile $ hg ci -A -m 'Initial commit.' adding thefile Create a tag. $ hg tag branchortag Create a branch with the same name as the tag. $ hg branch branchortag marked working directory as branch branchortag (branches are permanent and global, did you want a bookmark?) $ hg ci -m 'Create a branch with the same name as a tag.' This is what we have: $ hg log changeset: 2:10519b3f489a branch: branchortag tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Create a branch with the same name as a tag. changeset: 1:2635c45ca99b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Added tag branchortag for changeset f57387372b5d changeset: 0:f57387372b5d tag: branchortag user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Initial commit. Update to the tag: $ hg up 'tag(branchortag)' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg parents changeset: 0:f57387372b5d tag: branchortag user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Initial commit. Updating to the branch: $ hg up 'branch(branchortag)' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg parents changeset: 2:10519b3f489a branch: branchortag tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Create a branch with the same name as a tag. $ cd .. mercurial-4.5.3/tests/test-uncommit.t0000644015407300116100000002372313261161234017543 0ustar augieeng00000000000000Test uncommit - set up the config $ cat >> $HGRCPATH < [experimental] > evolution.createmarkers=True > evolution.allowunstable=True > [extensions] > uncommit = > drawdag=$TESTDIR/drawdag.py > EOF Build up a repo $ hg init repo $ cd repo $ hg bookmark foo Help for uncommit $ hg help uncommit hg uncommit [OPTION]... [FILE]... uncommit part or all of a local changeset This command undoes the effect of a local commit, returning the affected files to their uncommitted state. This means that files modified or deleted in the changeset will be left unchanged, and so will remain modified in the working directory. (use 'hg help -e uncommit' to show help for the uncommit extension) options ([+] can be repeated): --keep allow an empty commit after uncommiting -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns (some details hidden, use --verbose to show complete help) Uncommit with no commits should fail $ hg uncommit abort: cannot uncommit null changeset (no changeset checked out) [255] Create some commits $ touch files $ hg add files $ for i in a ab abc abcd abcde; do echo $i > files; echo $i > file-$i; hg add file-$i; hg commit -m "added file-$i"; done $ ls file-a file-ab file-abc file-abcd file-abcde files $ hg log -G -T '{rev}:{node} {desc}' --hidden @ 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde | o 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd | o 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc | o 1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab | o 0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a Simple uncommit off the top, also moves bookmark $ hg bookmark * foo 4:6c4fd43ed714 $ hg uncommit $ hg status M files A file-abcde $ hg bookmark * foo 3:6db330d65db4 $ hg log -G -T '{rev}:{node} {desc}' --hidden x 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde | @ 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd | o 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc | o 1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab | o 0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a Recommit $ hg commit -m 'new change abcde' $ hg status $ hg heads -T '{rev}:{node} {desc}' 5:0c07a3ccda771b25f1cb1edbd02e683723344ef1 new change abcde (no-eol) Uncommit of non-existent and unchanged files has no effect $ hg uncommit nothinghere nothing to uncommit [1] $ hg status $ hg uncommit file-abc nothing to uncommit [1] $ hg status Try partial uncommit, also moves bookmark $ hg bookmark * foo 5:0c07a3ccda77 $ hg uncommit files $ hg status M files $ hg bookmark * foo 6:3727deee06f7 $ hg heads -T '{rev}:{node} {desc}' 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde (no-eol) $ hg log -r . -p -T '{rev}:{node} {desc}' 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcdediff -r 6db330d65db4 -r 3727deee06f7 file-abcde --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/file-abcde Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +abcde $ hg log -G -T '{rev}:{node} {desc}' --hidden @ 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde | | x 5:0c07a3ccda771b25f1cb1edbd02e683723344ef1 new change abcde |/ | x 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde |/ o 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd | o 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc | o 1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab | o 0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a $ hg commit -m 'update files for abcde' Uncommit with dirty state $ echo "foo" >> files $ cat files abcde foo $ hg status M files $ hg uncommit abort: uncommitted changes [255] $ hg uncommit files $ cat files abcde foo $ hg commit -m "files abcde + foo" Testing the 'experimental.uncommitondirtywdir' config $ echo "bar" >> files $ hg uncommit abort: uncommitted changes [255] $ hg uncommit --config experimental.uncommitondirtywdir=True $ hg commit -m "files abcde + foo" Uncommit in the middle of a stack, does not move bookmark $ hg checkout '.^^^' 1 files updated, 0 files merged, 2 files removed, 0 files unresolved (leaving bookmark foo) $ hg log -r . -p -T '{rev}:{node} {desc}' 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abcdiff -r 69a232e754b0 -r abf2df566fc1 file-abc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/file-abc Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +abc diff -r 69a232e754b0 -r abf2df566fc1 files --- a/files Thu Jan 01 00:00:00 1970 +0000 +++ b/files Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -ab +abc $ hg bookmark foo 9:48e5bd7cd583 $ hg uncommit 3 new orphan changesets $ hg status M files A file-abc $ hg heads -T '{rev}:{node} {desc}' 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo (no-eol) $ hg bookmark foo 9:48e5bd7cd583 $ hg commit -m 'new abc' created new head Partial uncommit in the middle, does not move bookmark $ hg checkout '.^' 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg log -r . -p -T '{rev}:{node} {desc}' 1:69a232e754b08d568c4899475faf2eb44b857802 added file-abdiff -r 3004d2d9b508 -r 69a232e754b0 file-ab --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/file-ab Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +ab diff -r 3004d2d9b508 -r 69a232e754b0 files --- a/files Thu Jan 01 00:00:00 1970 +0000 +++ b/files Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -a +ab $ hg bookmark foo 9:48e5bd7cd583 $ hg uncommit file-ab 1 new orphan changesets $ hg status A file-ab $ hg heads -T '{rev}:{node} {desc}\n' 11:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo $ hg bookmark foo 9:48e5bd7cd583 $ hg commit -m 'update ab' $ hg status $ hg heads -T '{rev}:{node} {desc}\n' 12:f21039c59242b085491bb58f591afc4ed1c04c09 update ab 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo $ hg log -G -T '{rev}:{node} {desc}' --hidden @ 12:f21039c59242b085491bb58f591afc4ed1c04c09 update ab | o 11:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab | | * 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc | | | | * 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo | | | | | | x 8:83815831694b1271e9f207cb1b79b2b19275edcb files abcde + foo | | |/ | | | x 7:0977fa602c2fd7d8427ed4e7ee15ea13b84c9173 update files for abcde | | |/ | | * 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde | | | | | | x 5:0c07a3ccda771b25f1cb1edbd02e683723344ef1 new change abcde | | |/ | | | x 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde | | |/ | | * 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd | | | | | x 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc | |/ | x 1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab |/ o 0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a Uncommit with draft parent $ hg uncommit $ hg phase -r . 11: draft $ hg commit -m 'update ab again' Uncommit with public parent $ hg phase -p "::.^" $ hg uncommit $ hg phase -r . 11: public Partial uncommit with public parent $ echo xyz > xyz $ hg add xyz $ hg commit -m "update ab and add xyz" $ hg uncommit xyz $ hg status A xyz $ hg phase -r . 15: draft $ hg phase -r ".^" 11: public Uncommit leaving an empty changeset $ cd $TESTTMP $ hg init repo1 $ cd repo1 $ hg debugdrawdag <<'EOS' > Q > | > P > EOS $ hg up Q -q $ hg uncommit --keep $ hg log -G -T '{desc} FILES: {files}' @ Q FILES: | | x Q FILES: Q |/ o P FILES: P $ hg status A Q $ cd .. $ rm -rf repo1 Testing uncommit while merge $ hg init repo2 $ cd repo2 Create some history $ touch a $ hg add a $ for i in 1 2 3; do echo $i > a; hg commit -m "a $i"; done $ hg checkout 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ touch b $ hg add b $ for i in 1 2 3; do echo $i > b; hg commit -m "b $i"; done created new head $ hg log -G -T '{rev}:{node} {desc}' --hidden @ 5:2cd56cdde163ded2fbb16ba2f918c96046ab0bf2 b 3 | o 4:c3a0d5bb3b15834ffd2ef9ef603e93ec65cf2037 b 2 | o 3:49bb009ca26078726b8870f1edb29fae8f7618f5 b 1 | | o 2:990982b7384266e691f1bc08ca36177adcd1c8a9 a 3 | | | o 1:24d38e3cf160c7b6f5ffe82179332229886a6d34 a 2 |/ o 0:ea4e33293d4d274a2ba73150733c2612231f398c a 1 Add and expect uncommit to fail on both merge working dir and merge changeset $ hg merge 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg uncommit abort: outstanding uncommitted merge [255] $ hg uncommit --config experimental.uncommitondirtywdir=True abort: cannot uncommit while merging [255] $ hg status M a $ hg commit -m 'merge a and b' $ hg uncommit abort: cannot uncommit merge changeset [255] $ hg status $ hg log -G -T '{rev}:{node} {desc}' --hidden @ 6:c03b9c37bc67bf504d4912061cfb527b47a63c6e merge a and b |\ | o 5:2cd56cdde163ded2fbb16ba2f918c96046ab0bf2 b 3 | | | o 4:c3a0d5bb3b15834ffd2ef9ef603e93ec65cf2037 b 2 | | | o 3:49bb009ca26078726b8870f1edb29fae8f7618f5 b 1 | | o | 2:990982b7384266e691f1bc08ca36177adcd1c8a9 a 3 | | o | 1:24d38e3cf160c7b6f5ffe82179332229886a6d34 a 2 |/ o 0:ea4e33293d4d274a2ba73150733c2612231f398c a 1 mercurial-4.5.3/tests/test-ssh-bundle1.t0000644015407300116100000004162113261161234020032 0ustar augieeng00000000000000This test is a duplicate of 'test-http.t' feel free to factor out parts that are not bundle1/bundle2 specific. $ cat << EOF >> $HGRCPATH > [devel] > # This test is dedicated to interaction through old bundle > legacy.exchange = bundle1 > [format] # temporary settings > usegeneraldelta=yes > EOF This test tries to exercise the ssh functionality with a dummy script creating 'remote' repo $ hg init remote $ cd remote $ echo this > foo $ echo this > fooO $ hg ci -A -m "init" foo fooO insert a closed branch (issue4428) $ hg up null 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg branch closed marked working directory as branch closed (branches are permanent and global, did you want a bookmark?) $ hg ci -mc0 $ hg ci --close-branch -mc1 $ hg up -q default configure for serving $ cat < .hg/hgrc > [server] > uncompressed = True > > [hooks] > changegroup = sh -c "printenv.py changegroup-in-remote 0 ../dummylog" > EOF $ cd .. repo not found error $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local remote: abort: repository nonexistent not found! abort: no suitable response from remote hg! [255] non-existent absolute path $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy//`pwd`/nonexistent local remote: abort: repository /$TESTTMP/nonexistent not found! abort: no suitable response from remote hg! [255] clone remote via stream $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" --stream ssh://user@dummy/remote local-stream streaming all changes 4 files to transfer, 602 bytes of data transferred 602 bytes in * seconds (*) (glob) searching for changes no changes found updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd local-stream $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 3 changesets, 2 total revisions $ hg branches default 0:1160648e36ce $ cd .. clone bookmarks via stream $ hg -R local-stream book mybook $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" --stream ssh://user@dummy/local-stream stream2 streaming all changes 4 files to transfer, 602 bytes of data transferred 602 bytes in * seconds (*) (glob) searching for changes no changes found updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd stream2 $ hg book mybook 0:1160648e36ce $ cd .. $ rm -rf local-stream stream2 clone remote via pull $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 2 changes to 2 files new changesets 1160648e36ce:ad076bfb429d updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved verify $ cd local $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 3 changesets, 2 total revisions $ cat >> .hg/hgrc < [hooks] > changegroup = sh -c "printenv.py changegroup-in-local 0 ../dummylog" > EOF empty default pull $ hg paths default = ssh://user@dummy/remote $ hg pull -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" pulling from ssh://user@dummy/remote searching for changes no changes found pull from wrong ssh URL $ hg pull -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/doesnotexist pulling from ssh://user@dummy/doesnotexist remote: abort: repository doesnotexist not found! abort: no suitable response from remote hg! [255] local change $ echo bleah > foo $ hg ci -m "add" updating rc $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc $ echo "[ui]" >> .hg/hgrc $ echo "ssh = \"$PYTHON\" \"$TESTDIR/dummyssh\"" >> .hg/hgrc find outgoing $ hg out ssh://user@dummy/remote comparing with ssh://user@dummy/remote searching for changes changeset: 3:a28a9d1a809c tag: tip parent: 0:1160648e36ce user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add find incoming on the remote side $ hg incoming -R ../remote -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/local comparing with ssh://user@dummy/local searching for changes changeset: 3:a28a9d1a809c tag: tip parent: 0:1160648e36ce user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add find incoming on the remote side (using absolute path) $ hg incoming -R ../remote -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/`pwd`" comparing with ssh://user@dummy/$TESTTMP/local searching for changes changeset: 3:a28a9d1a809c tag: tip parent: 0:1160648e36ce user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add push $ hg push pushing to ssh://user@dummy/remote searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files $ cd ../remote check remote tip $ hg tip changeset: 3:a28a9d1a809c tag: tip parent: 0:1160648e36ce user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 4 changesets, 3 total revisions $ hg cat -r tip foo bleah $ echo z > z $ hg ci -A -m z z created new head test pushkeys and bookmarks $ cd ../local $ hg debugpushkey --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote namespaces bookmarks namespaces phases $ hg book foo -r 0 $ hg out -B comparing with ssh://user@dummy/remote searching for changed bookmarks foo 1160648e36ce $ hg push -B foo pushing to ssh://user@dummy/remote searching for changes no changes found exporting bookmark foo [1] $ hg debugpushkey --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote bookmarks foo 1160648e36cec0054048a7edc4110c6f84fde594 $ hg book -f foo $ hg push --traceback pushing to ssh://user@dummy/remote searching for changes no changes found updating bookmark foo [1] $ hg book -d foo $ hg in -B comparing with ssh://user@dummy/remote searching for changed bookmarks foo a28a9d1a809c $ hg book -f -r 0 foo $ hg pull -B foo pulling from ssh://user@dummy/remote no changes found updating bookmark foo $ hg book -d foo $ hg push -B foo pushing to ssh://user@dummy/remote searching for changes no changes found deleting remote bookmark foo [1] a bad, evil hook that prints to stdout $ cat < $TESTTMP/badhook > import sys > sys.stdout.write("KABOOM\n") > EOF $ echo '[hooks]' >> ../remote/.hg/hgrc $ echo "changegroup.stdout = \"$PYTHON\" $TESTTMP/badhook" >> ../remote/.hg/hgrc $ echo r > r $ hg ci -A -m z r push should succeed even though it has an unexpected response $ hg push pushing to ssh://user@dummy/remote searching for changes remote has heads on branch 'default' that are not known locally: 6c0482d977a3 remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files remote: KABOOM $ hg -R ../remote heads changeset: 5:1383141674ec tag: tip parent: 3:a28a9d1a809c user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: z changeset: 4:6c0482d977a3 parent: 0:1160648e36ce user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: z clone bookmarks $ hg -R ../remote bookmark test $ hg -R ../remote bookmarks * test 4:6c0482d977a3 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local-bookmarks requesting all changes adding changesets adding manifests adding file changes added 6 changesets with 5 changes to 4 files (+1 heads) new changesets 1160648e36ce:1383141674ec updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R local-bookmarks bookmarks test 4:6c0482d977a3 passwords in ssh urls are not supported (we use a glob here because different Python versions give different results here) $ hg push ssh://user:erroneouspwd@dummy/remote pushing to ssh://user:*@dummy/remote (glob) abort: password in URL not supported! [255] $ cd .. hide outer repo $ hg init Test remote paths with spaces (issue2983): $ hg init --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" $ touch "$TESTTMP/a repo/test" $ hg -R 'a repo' commit -A -m "test" adding test $ hg -R 'a repo' tag tag $ hg id --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" 73649e48688a $ hg id --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo#noNoNO" abort: unknown revision 'noNoNO'! [255] Test (non-)escaping of remote paths with spaces when cloning (issue3145): $ hg clone --ssh "\"$PYTHON\" \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo" destination directory: a repo abort: destination 'a repo' is not empty [255] Test hg-ssh using a helper script that will restore PYTHONPATH (which might have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right parameters: $ cat > ssh.sh << EOF > userhost="\$1" > SSH_ORIGINAL_COMMAND="\$2" > export SSH_ORIGINAL_COMMAND > PYTHONPATH="$PYTHONPATH" > export PYTHONPATH > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo" > EOF $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo" 73649e48688a $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo" remote: Illegal repository "$TESTTMP/a'repo" abort: no suitable response from remote hg! [255] $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo" remote: Illegal command "hacking -R 'a'\''repo' serve --stdio" abort: no suitable response from remote hg! [255] $ SSH_ORIGINAL_COMMAND="'hg' serve -R 'a'repo' --stdio" $PYTHON "$TESTDIR/../contrib/hg-ssh" Illegal command "'hg' serve -R 'a'repo' --stdio": No closing quotation [255] Test hg-ssh in read-only mode: $ cat > ssh.sh << EOF > userhost="\$1" > SSH_ORIGINAL_COMMAND="\$2" > export SSH_ORIGINAL_COMMAND > PYTHONPATH="$PYTHONPATH" > export PYTHONPATH > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote" > EOF $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local requesting all changes adding changesets adding manifests adding file changes added 6 changesets with 5 changes to 4 files (+1 heads) new changesets 1160648e36ce:1383141674ec updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd read-only-local $ echo "baz" > bar $ hg ci -A -m "unpushable commit" bar $ hg push --ssh "sh ../ssh.sh" pushing to ssh://user@dummy/*/remote (glob) searching for changes remote: Permission denied remote: abort: pretxnopen.hg-ssh hook failed remote: Permission denied remote: pushkey-abort: prepushkey.hg-ssh hook failed updating 6c0482d977a3 to public failed! [1] $ cd .. stderr from remote commands should be printed before stdout from local code (issue4336) $ hg clone remote stderr-ordering updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd stderr-ordering $ cat >> localwrite.py << EOF > from mercurial import exchange, extensions > > def wrappedpush(orig, repo, *args, **kwargs): > res = orig(repo, *args, **kwargs) > repo.ui.write('local stdout\n') > return res > > def extsetup(ui): > extensions.wrapfunction(exchange, 'push', wrappedpush) > EOF $ cat >> .hg/hgrc << EOF > [paths] > default-push = ssh://user@dummy/remote > [ui] > ssh = "$PYTHON" "$TESTDIR/dummyssh" > [extensions] > localwrite = localwrite.py > EOF $ echo localwrite > foo $ hg commit -m 'testing localwrite' $ hg push pushing to ssh://user@dummy/remote searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files remote: KABOOM local stdout debug output $ hg pull --debug ssh://user@dummy/remote pulling from ssh://user@dummy/remote running .* ".*/dummyssh" ['"]user@dummy['"] ('|")hg -R remote serve --stdio('|") (re) sending hello command sending between command remote: 384 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN remote: 1 preparing listkeys for "bookmarks" sending listkeys command received listkey for "bookmarks": 45 bytes query 1; heads sending batch command searching for changes all remote heads known locally no changes found preparing listkeys for "phases" sending listkeys command received listkey for "phases": 15 bytes checking for updated bookmarks $ cd .. $ cat dummylog Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio Got arguments 1:user@dummy 2:hg -R local serve --stdio Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio changegroup-in-remote hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP Got arguments 1:user@dummy 2:hg -R remote serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio changegroup-in-remote hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP Got arguments 1:user@dummy 2:hg -R remote serve --stdio Got arguments 1:user@dummy 2:hg init 'a repo' Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio changegroup-in-remote hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:ssh:$LOCALIP Got arguments 1:user@dummy 2:hg -R remote serve --stdio remote hook failure is attributed to remote $ cat > $TESTTMP/failhook << EOF > def hook(ui, repo, **kwargs): > ui.write('hook failure!\n') > ui.flush() > return 1 > EOF $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc $ hg -q --config ui.ssh="\"$PYTHON\" $TESTDIR/dummyssh" clone ssh://user@dummy/remote hookout $ cd hookout $ touch hookfailure $ hg -q commit -A -m 'remote hook failure' $ hg --config ui.ssh="\"$PYTHON\" $TESTDIR/dummyssh" push pushing to ssh://user@dummy/remote searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files remote: hook failure! remote: transaction abort! remote: rollback completed remote: abort: pretxnchangegroup.fail hook failed [1] abort during pull is properly reported as such $ echo morefoo >> ../remote/foo $ hg -R ../remote commit --message "more foo to be pulled" $ cat >> ../remote/.hg/hgrc << EOF > [extensions] > crash = ${TESTDIR}/crashgetbundler.py > EOF $ hg --config ui.ssh="\"$PYTHON\" $TESTDIR/dummyssh" pull pulling from ssh://user@dummy/remote searching for changes adding changesets remote: abort: this is an exercise transaction abort! rollback completed abort: stream ended unexpectedly (got 0 bytes, expected 4) [255] mercurial-4.5.3/tests/test-hgweb.t0000644015407300116100000005366313261161234017012 0ustar augieeng00000000000000#require serve Some tests for hgweb. Tests static files, plain files and different 404's. $ hg init test $ cd test $ mkdir da $ echo foo > da/foo $ echo foo > foo $ hg ci -Ambase adding da/foo adding foo $ hg bookmark -r0 '@' $ hg bookmark -r0 'a b c' $ hg bookmark -r0 'd/e/f' $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS manifest $ (get-with-headers.py localhost:$HGPORT 'file/tip/?style=raw') 200 Script output follows drwxr-xr-x da -rw-r--r-- 4 foo $ (get-with-headers.py localhost:$HGPORT 'file/tip/da?style=raw') 200 Script output follows -rw-r--r-- 4 foo plain file $ get-with-headers.py localhost:$HGPORT 'file/tip/foo?style=raw' 200 Script output follows foo should give a 404 - static file that does not exist $ get-with-headers.py localhost:$HGPORT 'static/bogus' 404 Not Found test: error

    error

    An error occurred while processing your request:

    Not Found

    [1] should give a 404 - bad revision $ get-with-headers.py localhost:$HGPORT 'file/spam/foo?style=raw' 404 Not Found error: revision not found: spam [1] should give a 400 - bad command $ get-with-headers.py localhost:$HGPORT 'file/tip/foo?cmd=spam&style=raw' 400* (glob) error: no such method: spam [1] $ get-with-headers.py --headeronly localhost:$HGPORT '?cmd=spam' 400 no such method: spam [1] should give a 400 - bad command as a part of url path (issue4071) $ get-with-headers.py --headeronly localhost:$HGPORT 'spam' 400 no such method: spam [1] $ get-with-headers.py --headeronly localhost:$HGPORT 'raw-spam' 400 no such method: spam [1] $ get-with-headers.py --headeronly localhost:$HGPORT 'spam/tip/foo' 400 no such method: spam [1] should give a 404 - file does not exist $ get-with-headers.py localhost:$HGPORT 'file/tip/bork?style=raw' 404 Not Found error: bork@2ef0ac749a14: not found in manifest [1] $ get-with-headers.py localhost:$HGPORT 'file/tip/bork' 404 Not Found test: error

    error

    An error occurred while processing your request:

    bork@2ef0ac749a14: not found in manifest

    [1] $ get-with-headers.py localhost:$HGPORT 'diff/tip/bork?style=raw' 404 Not Found error: bork@2ef0ac749a14: not found in manifest [1] try bad style $ (get-with-headers.py localhost:$HGPORT 'file/tip/?style=foobar') 200 Script output follows test: 2ef0ac749a14 /

    directory / @ 0:2ef0ac749a14 draft default tip @ a b c d/e/f

    name size permissions
    [up] drwxr-xr-x
    dir. da/ drwxr-xr-x
    file foo 4 -rw-r--r--
    stop and restart $ killdaemons.py $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log $ cat hg.pid >> $DAEMON_PIDS Test the access/error files are opened in append mode $ $PYTHON -c "print len(file('access.log').readlines()), 'log lines written'" 14 log lines written static file $ get-with-headers.py --twice localhost:$HGPORT 'static/style-gitweb.css' - date etag server 200 Script output follows content-length: 9118 content-type: text/css body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px; margin:10px; background: white; color: black; } a { color:#0000cc; } a:hover, a:visited, a:active { color:#880000; } div.page_header { height:25px; padding:8px; font-size:18px; font-weight:bold; background-color:#d9d8d1; } div.page_header a:visited { color:#0000cc; } div.page_header a:hover { color:#880000; } div.page_nav { padding:8px; display: flex; justify-content: space-between; align-items: center; } div.page_nav a:visited { color:#0000cc; } div.extra_nav { padding: 8px; } div.extra_nav a:visited { color: #0000cc; } div.page_path { padding:8px; border:solid #d9d8d1; border-width:0px 0px 1px} div.page_footer { padding:4px 8px; background-color: #d9d8d1; } div.page_footer_text { float:left; color:#555555; font-style:italic; } div.page_body { padding:8px; } div.title, a.title { display:block; padding:6px 8px; font-weight:bold; background-color:#edece6; text-decoration:none; color:#000000; } a.title:hover { background-color: #d9d8d1; } div.title_text { padding:6px 0px; border: solid #d9d8d1; border-width:0px 0px 1px; } div.log_body { padding:8px 8px 8px 150px; } .age { white-space:nowrap; } span.age { position:relative; float:left; width:142px; font-style:italic; } div.log_link { padding:0px 8px; font-size:10px; font-family:sans-serif; font-style:normal; position:relative; float:left; width:136px; } div.list_head { padding:6px 8px 4px; border:solid #d9d8d1; border-width:1px 0px 0px; font-style:italic; } a.list { text-decoration:none; color:#000000; } a.list:hover { text-decoration:underline; color:#880000; } table { padding:8px 4px; } th { padding:2px 5px; font-size:12px; text-align:left; } .parity0 { background-color:#ffffff; } tr.dark, .parity1, pre.sourcelines.stripes > :nth-child(4n+4) { background-color:#f6f6f0; } tr.light:hover, .parity0:hover, tr.dark:hover, .parity1:hover, pre.sourcelines.stripes > :nth-child(4n+2):hover, pre.sourcelines.stripes > :nth-child(4n+4):hover, pre.sourcelines.stripes > :nth-child(4n+1):hover + :nth-child(4n+2), pre.sourcelines.stripes > :nth-child(4n+3):hover + :nth-child(4n+4) { background-color:#edece6; } td { padding:2px 5px; font-size:12px; vertical-align:top; } td.closed { background-color: #99f; } td.link { padding:2px 5px; font-family:sans-serif; font-size:10px; } td.indexlinks { white-space: nowrap; } td.indexlinks a { padding: 2px 5px; line-height: 10px; border: 1px solid; color: #ffffff; background-color: #7777bb; border-color: #aaaadd #333366 #333366 #aaaadd; font-weight: bold; text-align: center; text-decoration: none; font-size: 10px; } td.indexlinks a:hover { background-color: #6666aa; } div.pre { font-family:monospace; font-size:12px; white-space:pre; } .search { margin-right: 8px; } div#hint { position: absolute; display: none; width: 250px; padding: 5px; background: #ffc; border: 1px solid yellow; border-radius: 5px; } #searchform:hover div#hint { display: block; } tr.thisrev a { color:#999999; text-decoration: none; } tr.thisrev pre { color:#009900; } td.annotate { white-space: nowrap; } div.annotate-info { z-index: 5; display: none; position: absolute; background-color: #FFFFFF; border: 1px solid #d9d8d1; text-align: left; color: #000000; padding: 5px; } div.annotate-info a { color: #0000FF; text-decoration: underline; } td.annotate:hover div.annotate-info { display: inline; } #diffopts-form { padding-left: 8px; display: none; } .linenr { color:#999999; text-decoration:none } div.rss_logo { float: right; white-space: nowrap; } div.rss_logo a { padding:3px 6px; line-height:10px; border:1px solid; border-color:#fcc7a5 #7d3302 #3e1a01 #ff954e; color:#ffffff; background-color:#ff6600; font-weight:bold; font-family:sans-serif; font-size:10px; text-align:center; text-decoration:none; } div.rss_logo a:hover { background-color:#ee5500; } pre { margin: 0; } span.logtags span { padding: 0px 4px; font-size: 10px; font-weight: normal; border: 1px solid; background-color: #ffaaff; border-color: #ffccff #ff00ee #ff00ee #ffccff; } span.logtags span.phasetag { background-color: #dfafff; border-color: #e2b8ff #ce48ff #ce48ff #e2b8ff; } span.logtags span.obsoletetag { background-color: #dddddd; border-color: #e4e4e4 #a3a3a3 #a3a3a3 #e4e4e4; } span.logtags span.instabilitytag { background-color: #ffb1c0; border-color: #ffbbc8 #ff4476 #ff4476 #ffbbc8; } span.logtags span.tagtag { background-color: #ffffaa; border-color: #ffffcc #ffee00 #ffee00 #ffffcc; } span.logtags span.branchtag { background-color: #aaffaa; border-color: #ccffcc #00cc33 #00cc33 #ccffcc; } span.logtags span.inbranchtag { background-color: #d5dde6; border-color: #e3ecf4 #9398f4 #9398f4 #e3ecf4; } span.logtags span.bookmarktag { background-color: #afdffa; border-color: #ccecff #46ace6 #46ace6 #ccecff; } span.difflineplus { color:#008800; } span.difflineminus { color:#cc0000; } span.difflineat { color:#990099; } div.diffblocks { counter-reset: lineno; } div.diffblock { counter-increment: lineno; } pre.sourcelines { position: relative; counter-reset: lineno; } pre.sourcelines > span { display: inline-block; box-sizing: border-box; width: 100%; padding: 0 0 0 5em; counter-increment: lineno; vertical-align: top; } pre.sourcelines > span:before { -moz-user-select: -moz-none; -khtml-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; display: inline-block; margin-left: -6em; width: 4em; color: #999; text-align: right; content: counters(lineno,"."); float: left; } pre.sourcelines > a { display: inline-block; position: absolute; left: 0px; width: 4em; height: 1em; } tr:target td, pre.sourcelines > span:target, pre.sourcelines.stripes > span:target { background-color: #bfdfff; } .description { font-family: monospace; white-space: pre; } /* Followlines */ tbody.sourcelines > tr.followlines-selected, pre.sourcelines > span.followlines-selected { background-color: #99C7E9 !important; } div#followlines { background-color: #FFF; border: 1px solid #d9d8d1; padding: 5px; position: fixed; } div.followlines-cancel { text-align: right; } div.followlines-cancel > button { line-height: 80%; padding: 0; border: 0; border-radius: 2px; background-color: inherit; font-weight: bold; } div.followlines-cancel > button:hover { color: #FFFFFF; background-color: #CF1F1F; } div.followlines-link { margin: 2px; margin-top: 4px; font-family: sans-serif; } .btn-followlines { display: none; cursor: pointer; box-sizing: content-box; font-size: 11px; width: 13px; height: 13px; border-radius: 3px; margin: 0px; margin-top: -2px; padding: 0px; background-color: #E5FDE5; border: 1px solid #9BC19B; font-family: monospace; text-align: center; line-height: 5px; } tr .btn-followlines { position: absolute; } span .btn-followlines { float: left; } span.followlines-select .btn-followlines { margin-left: -1.6em; } .btn-followlines:hover { transform: scale(1.1, 1.1); } .btn-followlines .followlines-plus { color: green; } .btn-followlines .followlines-minus { color: red; } .btn-followlines-end { background-color: #ffdcdc; } .sourcelines tr:hover .btn-followlines, .sourcelines span.followlines-select:hover > .btn-followlines { display: inline; } .btn-followlines-hidden, .sourcelines tr:hover .btn-followlines-hidden { display: none; } /* Graph */ div#wrapper { position: relative; margin: 0; padding: 0; margin-top: 3px; } canvas { position: absolute; z-index: 5; top: -0.9em; margin: 0; } ul#graphnodes { list-style: none inside none; padding: 0; margin: 0; } ul#graphnodes li { position: relative; height: 37px; overflow: visible; padding-top: 2px; } ul#graphnodes li .fg { position: absolute; z-index: 10; } ul#graphnodes li .info { font-size: 100%; font-style: italic; } /* Comparison */ .legend { padding: 1.5% 0 1.5% 0; } .legendinfo { border: 1px solid #d9d8d1; font-size: 80%; text-align: center; padding: 0.5%; } .equal { background-color: #ffffff; } .delete { background-color: #faa; color: #333; } .insert { background-color: #ffa; } .replace { background-color: #e8e8e8; } .comparison { overflow-x: auto; } .header th { text-align: center; } .block { border-top: 1px solid #d9d8d1; } .scroll-loading { -webkit-animation: change_color 1s linear 0s infinite alternate; -moz-animation: change_color 1s linear 0s infinite alternate; -o-animation: change_color 1s linear 0s infinite alternate; animation: change_color 1s linear 0s infinite alternate; } @-webkit-keyframes change_color { from { background-color: #A0CEFF; } to { } } @-moz-keyframes change_color { from { background-color: #A0CEFF; } to { } } @-o-keyframes change_color { from { background-color: #A0CEFF; } to { } } @keyframes change_color { from { background-color: #A0CEFF; } to { } } .scroll-loading-error { background-color: #FFCCCC !important; } #doc { margin: 0 8px; } 304 Not Modified phase changes are refreshed (issue4061) $ echo bar >> foo $ hg ci -msecret --secret $ get-with-headers.py localhost:$HGPORT 'log?style=raw' 200 Script output follows # HG changelog # Node ID 2ef0ac749a14e4f57a5a822464a0902c6f7f448f changeset: 2ef0ac749a14e4f57a5a822464a0902c6f7f448f revision: 0 user: test date: Thu, 01 Jan 1970 00:00:00 +0000 summary: base branch: default tag: tip bookmark: @ bookmark: a b c bookmark: d/e/f $ hg phase --draft tip $ get-with-headers.py localhost:$HGPORT 'log?style=raw' 200 Script output follows # HG changelog # Node ID a084749e708a9c4c0a5b652a2a446322ce290e04 changeset: a084749e708a9c4c0a5b652a2a446322ce290e04 revision: 1 user: test date: Thu, 01 Jan 1970 00:00:00 +0000 summary: secret branch: default tag: tip changeset: 2ef0ac749a14e4f57a5a822464a0902c6f7f448f revision: 0 user: test date: Thu, 01 Jan 1970 00:00:00 +0000 summary: base bookmark: @ bookmark: a b c bookmark: d/e/f access bookmarks $ get-with-headers.py localhost:$HGPORT 'rev/@?style=paper' | egrep '^200|changeset 0:' 200 Script output follows changeset 0:2ef0ac749a14 $ get-with-headers.py localhost:$HGPORT 'rev/%40?style=paper' | egrep '^200|changeset 0:' 200 Script output follows changeset 0:2ef0ac749a14 $ get-with-headers.py localhost:$HGPORT 'rev/a%20b%20c?style=paper' | egrep '^200|changeset 0:' 200 Script output follows changeset 0:2ef0ac749a14 $ get-with-headers.py localhost:$HGPORT 'rev/d%252Fe%252Ff?style=paper' | egrep '^200|changeset 0:' 200 Script output follows changeset 0:2ef0ac749a14 no style can be loaded from directories other than the specified paths $ mkdir -p x/templates/fallback $ cat < x/templates/fallback/map > default = 'shortlog' > shortlog = 'fall back to default\n' > mimetype = 'text/plain' > EOF $ cat < x/map > default = 'shortlog' > shortlog = 'access to outside of templates directory\n' > mimetype = 'text/plain' > EOF $ killdaemons.py $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log \ > --config web.style=fallback --config web.templates=x/templates $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT "?style=`pwd`/x" 200 Script output follows fall back to default $ get-with-headers.py localhost:$HGPORT '?style=..' 200 Script output follows fall back to default $ get-with-headers.py localhost:$HGPORT '?style=./..' 200 Script output follows fall back to default $ get-with-headers.py localhost:$HGPORT '?style=.../.../' 200 Script output follows fall back to default errors $ cat errors.log Uncaught exceptions result in a logged error and canned HTTP response $ killdaemons.py $ hg serve --config extensions.hgweberror=$TESTDIR/hgweberror.py -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT 'raiseerror' transfer-encoding content-type 500 Internal Server Error transfer-encoding: chunked Internal Server Error (no-eol) [1] $ killdaemons.py $ head -1 errors.log .* Exception happened during processing request '/raiseerror': (re) Uncaught exception after partial content sent $ hg serve --config extensions.hgweberror=$TESTDIR/hgweberror.py -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT 'raiseerror?partialresponse=1' transfer-encoding content-type 200 Script output follows transfer-encoding: chunked content-type: text/plain partial content Internal Server Error (no-eol) $ killdaemons.py $ cd .. mercurial-4.5.3/tests/test-url-rev.t0000644015407300116100000001717113261161234017304 0ustar augieeng00000000000000Test basic functionality of url#rev syntax $ hg init repo $ cd repo $ echo a > a $ hg ci -qAm 'add a' $ hg branch foo marked working directory as branch foo (branches are permanent and global, did you want a bookmark?) $ echo >> a $ hg ci -m 'change a' $ cd .. $ hg clone 'repo#foo' clone adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files new changesets 1f0dee641bb7:cd2a86ecc814 updating to branch foo 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg --cwd clone heads changeset: 1:cd2a86ecc814 branch: foo tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: change a changeset: 0:1f0dee641bb7 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add a $ hg --cwd clone parents changeset: 1:cd2a86ecc814 branch: foo tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: change a $ cat clone/.hg/hgrc # example repository config (see 'hg help config' for more info) [paths] default = $TESTTMP/repo#foo # path aliases to other clones of this repo in URLs or filesystem paths # (see 'hg help config.paths' for more info) # # default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork # my-fork = ssh://jdoe@example.net/hg/jdoes-fork # my-clone = /home/jdoe/jdoes-clone [ui] # name and email (local to this repository, optional), e.g. # username = Jane Doe Changing original repo: $ cd repo $ echo >> a $ hg ci -m 'new head of branch foo' $ hg up -qC default $ echo bar > bar $ hg ci -qAm 'add bar' $ hg log changeset: 3:4cd725637392 tag: tip parent: 0:1f0dee641bb7 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add bar changeset: 2:faba9097cad4 branch: foo user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: new head of branch foo changeset: 1:cd2a86ecc814 branch: foo user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: change a changeset: 0:1f0dee641bb7 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add a $ hg -q outgoing '../clone' 2:faba9097cad4 3:4cd725637392 $ hg summary --remote --config paths.default='../clone' parent: 3:4cd725637392 tip add bar branch: default commit: (clean) update: (current) phases: 4 draft remote: 2 outgoing $ hg -q outgoing '../clone#foo' 2:faba9097cad4 $ hg summary --remote --config paths.default='../clone#foo' parent: 3:4cd725637392 tip add bar branch: default commit: (clean) update: (current) phases: 4 draft remote: 1 outgoing $ hg -q --cwd ../clone incoming '../repo#foo' 2:faba9097cad4 $ hg --cwd ../clone summary --remote --config paths.default='../repo#foo' parent: 1:cd2a86ecc814 tip change a branch: foo commit: (clean) update: (current) remote: 1 or more incoming $ hg -q push '../clone#foo' $ hg --cwd ../clone heads changeset: 2:faba9097cad4 branch: foo tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: new head of branch foo changeset: 0:1f0dee641bb7 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add a $ hg -q --cwd ../clone incoming '../repo#foo' [1] $ hg --cwd ../clone summary --remote --config paths.default='../repo#foo' parent: 1:cd2a86ecc814 change a branch: foo commit: (clean) update: 1 new changesets (update) remote: (synced) $ cd .. $ cd clone $ hg rollback repository tip rolled back to revision 1 (undo push) $ hg -q incoming 2:faba9097cad4 $ hg -q pull $ hg heads changeset: 2:faba9097cad4 branch: foo tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: new head of branch foo changeset: 0:1f0dee641bb7 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add a Pull should not have updated: $ hg parents -q 1:cd2a86ecc814 Going back to the default branch: $ hg up -C 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg parents changeset: 0:1f0dee641bb7 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add a No new revs, no update: $ hg pull -qu $ hg parents -q 0:1f0dee641bb7 $ hg rollback repository tip rolled back to revision 1 (undo pull) $ hg parents -q 0:1f0dee641bb7 Pull -u takes us back to branch foo: $ hg pull -qu $ hg parents changeset: 2:faba9097cad4 branch: foo tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: new head of branch foo $ hg rollback repository tip rolled back to revision 1 (undo pull) working directory now based on revision 0 $ hg up -C 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg parents -q 0:1f0dee641bb7 $ hg heads -q 1:cd2a86ecc814 0:1f0dee641bb7 $ hg pull -qur default default $ hg parents changeset: 3:4cd725637392 tag: tip parent: 0:1f0dee641bb7 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add bar $ hg heads changeset: 3:4cd725637392 tag: tip parent: 0:1f0dee641bb7 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add bar changeset: 2:faba9097cad4 branch: foo user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: new head of branch foo Test handling of invalid urls $ hg id http://foo/?bar abort: unsupported URL component: "bar" [255] $ cd .. Test handling common incoming revisions between "default" and "default-push" $ hg -R clone rollback repository tip rolled back to revision 1 (undo pull) working directory now based on revision 0 $ cd repo $ hg update -q -C default $ echo modified >> bar $ hg commit -m "new head to push current default head" $ hg -q push -r ".^1" '../clone' $ hg -q outgoing '../clone' 2:faba9097cad4 4:d515801a8f3d $ hg summary --remote --config paths.default='../clone#default' --config paths.default-push='../clone#foo' parent: 4:d515801a8f3d tip new head to push current default head branch: default commit: (clean) update: (current) phases: 1 draft remote: 1 outgoing $ hg summary --remote --config paths.default='../clone#foo' --config paths.default-push='../clone' parent: 4:d515801a8f3d tip new head to push current default head branch: default commit: (clean) update: (current) phases: 1 draft remote: 2 outgoing $ hg summary --remote --config paths.default='../clone' --config paths.default-push='../clone#foo' parent: 4:d515801a8f3d tip new head to push current default head branch: default commit: (clean) update: (current) phases: 1 draft remote: 1 outgoing $ hg clone -q -r 0 . ../another $ hg -q outgoing '../another#default' 3:4cd725637392 4:d515801a8f3d $ hg summary --remote --config paths.default='../another#default' --config paths.default-push='../clone#default' parent: 4:d515801a8f3d tip new head to push current default head branch: default commit: (clean) update: (current) phases: 1 draft remote: 1 outgoing $ cd .. Test url#rev syntax of local destination path, which should be taken as a 'url#rev' path $ hg clone repo '#foo' updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg root -R '#foo' $TESTTMP/#foo mercurial-4.5.3/tests/test-clone-uncompressed.t0000644015407300116100000004025013261161234021507 0ustar augieeng00000000000000#require serve #testcases stream-legacy stream-bundle2 #if stream-bundle2 $ cat << EOF >> $HGRCPATH > [experimental] > bundle2.stream = yes > EOF #endif Initialize repository the status call is to check for issue5130 $ hg init server $ cd server $ touch foo $ hg -q commit -A -m initial >>> for i in range(1024): ... with open(str(i), 'wb') as fh: ... fh.write(str(i)) $ hg -q commit -A -m 'add a lot of files' $ hg st $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid $ cat hg.pid > $DAEMON_PIDS $ cd .. Cannot stream clone when server.uncompressed is set $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out' 200 Script output follows 1 #if stream-legacy $ hg debugcapabilities http://localhost:$HGPORT Main capabilities: batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash Bundle2 capabilities: HG20 bookmarks changegroup 01 02 digests md5 sha1 sha512 error abort unsupportedcontent pushraced pushkey hgtagsfnodes listkeys phases heads pushkey remote-changegroup http https $ hg clone --stream -U http://localhost:$HGPORT server-disabled warning: stream clone requested but server has them disabled requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 1025 changes to 1025 files new changesets 96ee1d7354c4:c17445101a72 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1" 200 Script output follows content-type: application/mercurial-0.2 $ f --size body --hexdump --bytes 100 body: size=232 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...| 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest| 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques| 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d| 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th| 0060: 69 73 20 66 |is f| #endif #if stream-bundle2 $ hg debugcapabilities http://localhost:$HGPORT Main capabilities: batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash Bundle2 capabilities: HG20 bookmarks changegroup 01 02 digests md5 sha1 sha512 error abort unsupportedcontent pushraced pushkey hgtagsfnodes listkeys phases heads pushkey remote-changegroup http https $ hg clone --stream -U http://localhost:$HGPORT server-disabled warning: stream clone requested but server has them disabled requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 1025 changes to 1025 files new changesets 96ee1d7354c4:c17445101a72 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1" 200 Script output follows content-type: application/mercurial-0.2 $ f --size body --hexdump --bytes 100 body: size=232 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...| 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest| 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques| 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d| 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th| 0060: 69 73 20 66 |is f| #endif $ killdaemons.py $ cd server $ hg serve -p $HGPORT -d --pid-file=hg.pid $ cat hg.pid > $DAEMON_PIDS $ cd .. Basic clone #if stream-legacy $ hg clone --stream -U http://localhost:$HGPORT clone1 streaming all changes 1027 files to transfer, 96.3 KB of data transferred 96.3 KB in * seconds (*/sec) (glob) searching for changes no changes found #endif #if stream-bundle2 $ hg clone --stream -U http://localhost:$HGPORT clone1 streaming all changes 1030 files to transfer, 96.4 KB of data transferred 96.4 KB in * seconds (* */sec) (glob) $ ls -1 clone1/.hg/cache branch2-served rbc-names-v1 rbc-revs-v1 #endif getbundle requests with stream=1 are uncompressed $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto '0.1 0.2 comp=zlib,none' --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1" 200 Script output follows content-type: application/mercurial-0.2 $ f --size --hex --bytes 256 body body: size=112230 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| 0010: 70 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |p.STREAM2.......| 0020: 05 09 04 0c 35 62 79 74 65 63 6f 75 6e 74 39 38 |....5bytecount98| 0030: 37 35 38 66 69 6c 65 63 6f 75 6e 74 31 30 33 30 |758filecount1030| 0040: 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 65 |requirementsdote| 0050: 6e 63 6f 64 65 25 32 43 66 6e 63 61 63 68 65 25 |ncode%2Cfncache%| 0060: 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 25 32 |2Cgeneraldelta%2| 0070: 43 72 65 76 6c 6f 67 76 31 25 32 43 73 74 6f 72 |Crevlogv1%2Cstor| 0080: 65 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 |e....s.Bdata/0.i| 0090: 00 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 |................| 00a0: 00 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff |................| 00b0: 80 29 63 a0 49 d3 23 87 bf ce fe 56 67 92 67 2c |.)c.I.#....Vg.g,| 00c0: 69 d1 ec 39 00 00 00 00 00 00 00 00 00 00 00 00 |i..9............| 00d0: 75 30 73 08 42 64 61 74 61 2f 31 2e 69 00 03 00 |u0s.Bdata/1.i...| 00e0: 01 00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 |................| 00f0: 00 00 00 00 01 ff ff ff ff ff ff ff ff f9 76 da |..............v.| --uncompressed is an alias to --stream #if stream-legacy $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed streaming all changes 1027 files to transfer, 96.3 KB of data transferred 96.3 KB in * seconds (*/sec) (glob) searching for changes no changes found #endif #if stream-bundle2 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed streaming all changes 1030 files to transfer, 96.4 KB of data transferred 96.4 KB in * seconds (* */sec) (glob) #endif Clone with background file closing enabled #if stream-legacy $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding using http://localhost:$HGPORT/ sending capabilities command sending branchmap command streaming all changes sending stream_out command 1027 files to transfer, 96.3 KB of data starting 4 threads for background file closing transferred 96.3 KB in * seconds (*/sec) (glob) query 1; heads sending batch command searching for changes all remote heads known locally no changes found sending getbundle command bundle2-input-bundle: with-transaction bundle2-input-part: "listkeys" (params: 1 mandatory) supported bundle2-input-part: "phase-heads" supported bundle2-input-part: total payload size 24 bundle2-input-bundle: 1 parts total checking for updated bookmarks #endif #if stream-bundle2 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding using http://localhost:$HGPORT/ sending capabilities command query 1; heads sending batch command streaming all changes sending getbundle command bundle2-input-bundle: with-transaction bundle2-input-part: "stream2" (params: 3 mandatory) supported applying stream bundle 1030 files to transfer, 96.4 KB of data starting 4 threads for background file closing starting 4 threads for background file closing transferred 96.4 KB in * seconds (* */sec) (glob) bundle2-input-part: total payload size 112077 bundle2-input-part: "listkeys" (params: 1 mandatory) supported bundle2-input-bundle: 1 parts total checking for updated bookmarks #endif Cannot stream clone when there are secret changesets $ hg -R server phase --force --secret -r tip $ hg clone --stream -U http://localhost:$HGPORT secret-denied warning: stream clone requested but server has them disabled requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 96ee1d7354c4 $ killdaemons.py Streaming of secrets can be overridden by server config $ cd server $ hg serve --config server.uncompressedallowsecret=true -p $HGPORT -d --pid-file=hg.pid $ cat hg.pid > $DAEMON_PIDS $ cd .. #if stream-legacy $ hg clone --stream -U http://localhost:$HGPORT secret-allowed streaming all changes 1027 files to transfer, 96.3 KB of data transferred 96.3 KB in * seconds (*/sec) (glob) searching for changes no changes found #endif #if stream-bundle2 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed streaming all changes 1030 files to transfer, 96.4 KB of data transferred 96.4 KB in * seconds (* */sec) (glob) #endif $ killdaemons.py Verify interaction between preferuncompressed and secret presence $ cd server $ hg serve --config server.preferuncompressed=true -p $HGPORT -d --pid-file=hg.pid $ cat hg.pid > $DAEMON_PIDS $ cd .. $ hg clone -U http://localhost:$HGPORT preferuncompressed-secret requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 96ee1d7354c4 $ killdaemons.py Clone not allowed when full bundles disabled and can't serve secrets $ cd server $ hg serve --config server.disablefullbundle=true -p $HGPORT -d --pid-file=hg.pid $ cat hg.pid > $DAEMON_PIDS $ cd .. $ hg clone --stream http://localhost:$HGPORT secret-full-disabled warning: stream clone requested but server has them disabled requesting all changes remote: abort: server has pull-based clones disabled abort: pull failed on remote (remove --pull if specified or upgrade Mercurial) [255] Local stream clone with secrets involved (This is just a test over behavior: if you have access to the repo's files, there is no security so it isn't important to prevent a clone here.) $ hg clone -U --stream server local-secret warning: stream clone requested but server has them disabled requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 96ee1d7354c4 Stream clone while repo is changing: $ mkdir changing $ cd changing extension for delaying the server process so we reliably can modify the repo while cloning $ cat > delayer.py < import time > from mercurial import extensions, vfs > def __call__(orig, self, path, *args, **kwargs): > if path == 'data/f1.i': > time.sleep(2) > return orig(self, path, *args, **kwargs) > extensions.wrapfunction(vfs.vfs, '__call__', __call__) > EOF prepare repo with small and big file to cover both code paths in emitrevlogdata $ hg init repo $ touch repo/f1 $ $TESTDIR/seq.py 50000 > repo/f2 $ hg -R repo ci -Aqm "0" $ hg serve -R repo -p $HGPORT1 -d --pid-file=hg.pid --config extensions.delayer=delayer.py $ cat hg.pid >> $DAEMON_PIDS clone while modifying the repo between stating file with write lock and actually serving file content $ hg clone -q --stream -U http://localhost:$HGPORT1 clone & $ sleep 1 $ echo >> repo/f1 $ echo >> repo/f2 $ hg -R repo ci -m "1" $ wait $ hg -R clone id 000000000000 $ cd .. Stream repository with bookmarks -------------------------------- (revert introduction of secret changeset) $ hg -R server phase --draft 'secret()' add a bookmark $ hg -R server bookmark -r tip some-bookmark clone it #if stream-legacy $ hg clone --stream http://localhost:$HGPORT with-bookmarks streaming all changes 1027 files to transfer, 96.3 KB of data transferred 96.3 KB in * seconds (*) (glob) searching for changes no changes found updating to branch default 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved #endif #if stream-bundle2 $ hg clone --stream http://localhost:$HGPORT with-bookmarks streaming all changes 1033 files to transfer, 96.6 KB of data transferred 96.6 KB in * seconds (* */sec) (glob) updating to branch default 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved #endif $ hg -R with-bookmarks bookmarks some-bookmark 1:c17445101a72 Stream repository with phases ----------------------------- Clone as publishing $ hg -R server phase -r 'all()' 0: draft 1: draft #if stream-legacy $ hg clone --stream http://localhost:$HGPORT phase-publish streaming all changes 1027 files to transfer, 96.3 KB of data transferred 96.3 KB in * seconds (*) (glob) searching for changes no changes found updating to branch default 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved #endif #if stream-bundle2 $ hg clone --stream http://localhost:$HGPORT phase-publish streaming all changes 1033 files to transfer, 96.6 KB of data transferred 96.6 KB in * seconds (* */sec) (glob) updating to branch default 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved #endif $ hg -R phase-publish phase -r 'all()' 0: public 1: public Clone as non publishing $ cat << EOF >> server/.hg/hgrc > [phases] > publish = False > EOF $ killdaemons.py $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid $ cat hg.pid > $DAEMON_PIDS #if stream-legacy With v1 of the stream protocol, changeset are always cloned as public. It make stream v1 unsuitable for non-publishing repository. $ hg clone --stream http://localhost:$HGPORT phase-no-publish streaming all changes 1027 files to transfer, 96.3 KB of data transferred 96.3 KB in * seconds (*) (glob) searching for changes no changes found updating to branch default 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R phase-no-publish phase -r 'all()' 0: public 1: public #endif #if stream-bundle2 $ hg clone --stream http://localhost:$HGPORT phase-no-publish streaming all changes 1034 files to transfer, 96.7 KB of data transferred 96.7 KB in * seconds (* */sec) (glob) updating to branch default 1025 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R phase-no-publish phase -r 'all()' 0: draft 1: draft #endif $ killdaemons.py mercurial-4.5.3/tests/test-rename-after-merge.t0000644015407300116100000000432513261161234021350 0ustar augieeng00000000000000Issue746: renaming files brought by the second parent of a merge was broken. Create source repository: $ hg init t $ cd t $ echo a > a $ hg ci -Am a adding a $ cd .. Fork source repository: $ hg clone t t2 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd t2 $ echo b > b $ hg ci -Am b adding b Update source repository: $ cd ../t $ echo a >> a $ hg ci -m a2 Merge repositories: $ hg pull ../t2 pulling from ../t2 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets d2ae7f538514 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg st M b Rename b as c: $ hg mv b c $ hg st A c R b Rename back c as b: $ hg mv c b $ hg st M b $ cd .. Issue 1476: renaming a first parent file into another first parent file while none of them belong to the second parent was broken $ hg init repo1476 $ cd repo1476 $ echo a > a $ hg ci -Am adda adding a $ echo b1 > b1 $ echo b2 > b2 $ hg ci -Am changea adding b1 adding b2 $ hg up -C 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo c1 > c1 $ echo c2 > c2 $ hg ci -Am addcandd adding c1 adding c2 created new head Merge heads: $ hg merge 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg mv -Af c1 c2 Commit issue 1476: $ hg ci -m merge $ hg log -r tip -C -v | grep copies copies: c2 (c1) $ hg rollback repository tip rolled back to revision 2 (undo commit) working directory now based on revisions 2 and 1 $ hg up -C . 2 files updated, 0 files merged, 2 files removed, 0 files unresolved Merge heads again: $ hg merge 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg mv -Af b1 b2 Commit issue 1476 with a rename on the other side: $ hg ci -m merge $ hg log -r tip -C -v | grep copies copies: b2 (b1) $ cd .. mercurial-4.5.3/tests/test-revlog-group-emptyiter.t0000644015407300116100000000125513261161234022354 0ustar augieeng00000000000000Issue1678: IndexError when pushing setting up base repo $ hg init a $ cd a $ touch a $ hg ci -Am a adding a $ cd .. cloning base repo $ hg clone a b updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd b setting up cset to push $ hg up null 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ touch a different msg so we get a clog new entry $ hg ci -Am b adding a created new head pushing $ hg push -f ../a pushing to ../a searching for changes adding changesets adding manifests adding file changes added 1 changesets with 0 changes to 0 files (+1 heads) $ cd .. mercurial-4.5.3/tests/test-symlink-placeholder.t0000644015407300116100000000360013261161234021646 0ustar augieeng00000000000000#require symlink Create extension that can disable symlink support: $ cat > nolink.py < from mercurial import extensions, util > def setflags(orig, f, l, x): > pass > def checklink(orig, path): > return False > def extsetup(ui): > extensions.wrapfunction(util, 'setflags', setflags) > extensions.wrapfunction(util, 'checklink', checklink) > EOF $ hg init unix-repo $ cd unix-repo $ echo foo > a $ ln -s a b $ hg ci -Am0 adding a adding b $ cd .. Simulate a checkout shared on NFS/Samba: $ hg clone -q unix-repo shared $ cd shared $ rm b $ echo foo > b $ hg --config extensions.n=$TESTTMP/nolink.py status --debug ignoring suspect symlink placeholder "b" Make a clone using placeholders: $ hg --config extensions.n=$TESTTMP/nolink.py clone . ../win-repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ../win-repo $ cat b a (no-eol) $ hg --config extensions.n=$TESTTMP/nolink.py st --debug Empty placeholder: $ rm b $ touch b $ hg --config extensions.n=$TESTTMP/nolink.py st --debug ignoring suspect symlink placeholder "b" Write binary data to the placeholder: >>> open('b', 'w').write('this is a binary\0') $ hg --config extensions.n=$TESTTMP/nolink.py st --debug ignoring suspect symlink placeholder "b" Write a long string to the placeholder: >>> open('b', 'w').write('this' * 1000) $ hg --config extensions.n=$TESTTMP/nolink.py st --debug ignoring suspect symlink placeholder "b" Commit shouldn't succeed: $ hg --config extensions.n=$TESTTMP/nolink.py ci -m1 nothing changed [1] Write a valid string to the placeholder: >>> open('b', 'w').write('this') $ hg --config extensions.n=$TESTTMP/nolink.py st --debug M b $ hg --config extensions.n=$TESTTMP/nolink.py ci -m1 $ hg manifest tip --verbose 644 a 644 @ b $ cd .. mercurial-4.5.3/tests/test-histedit-outgoing.t0000644015407300116100000001014613261161234021351 0ustar augieeng00000000000000 $ cat >> $HGRCPATH < [extensions] > histedit= > EOF $ initrepos () > { > hg init r > cd r > for x in a b c ; do > echo $x > $x > hg add $x > hg ci -m $x > done > cd .. > hg clone r r2 | grep -v updating > cd r2 > for x in d e f ; do > echo $x > $x > hg add $x > hg ci -m $x > done > cd .. > hg init r3 > cd r3 > for x in g h i ; do > echo $x > $x > hg add $x > hg ci -m $x > done > cd .. > } $ initrepos 3 files updated, 0 files merged, 0 files removed, 0 files unresolved show the edit commands offered by outgoing $ cd r2 $ HGEDITOR=cat hg histedit --outgoing ../r | grep -v comparing | grep -v searching pick 055a42cdd887 3 d pick e860deea161a 4 e pick 652413bf663e 5 f # Edit history between 055a42cdd887 and 652413bf663e # # Commits are listed from least to most recent # # You can reorder changesets by reordering the lines # # Commands: # # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date # $ cd .. show the error from unrelated repos $ cd r3 $ HGEDITOR=cat hg histedit --outgoing ../r | grep -v comparing | grep -v searching abort: repository is unrelated [1] $ cd .. show the error from unrelated repos $ cd r3 $ HGEDITOR=cat hg histedit --force --outgoing ../r comparing with ../r searching for changes warning: repository is unrelated pick 2a4042b45417 0 g pick 68c46b4927ce 1 h pick 51281e65ba79 2 i # Edit history between 2a4042b45417 and 51281e65ba79 # # Commits are listed from least to most recent # # You can reorder changesets by reordering the lines # # Commands: # # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date # $ cd .. test sensitivity to branch in URL: $ cd r2 $ hg -q update 2 $ hg -q branch foo $ hg commit -m 'create foo branch' $ HGEDITOR=cat hg histedit --outgoing '../r#foo' | grep -v comparing | grep -v searching pick f26599ee3441 6 create foo branch # Edit history between f26599ee3441 and f26599ee3441 # # Commits are listed from least to most recent # # You can reorder changesets by reordering the lines # # Commands: # # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date # test to check number of roots in outgoing revisions $ hg -q outgoing -G --template '{node|short}({branch})' '../r' @ f26599ee3441(foo) o 652413bf663e(default) | o e860deea161a(default) | o 055a42cdd887(default) $ HGEDITOR=cat hg -q histedit --outgoing '../r' abort: there are ambiguous outgoing revisions (see 'hg help histedit' for more detail) [255] $ hg -q update -C 2 $ echo aa >> a $ hg -q commit -m 'another head on default' $ hg -q outgoing -G --template '{node|short}({branch})' '../r#default' @ 3879dc049647(default) o 652413bf663e(default) | o e860deea161a(default) | o 055a42cdd887(default) $ HGEDITOR=cat hg -q histedit --outgoing '../r#default' abort: there are ambiguous outgoing revisions (see 'hg help histedit' for more detail) [255] $ cd .. mercurial-4.5.3/tests/test-pathconflicts-merge.t0000644015407300116100000001026013261161234021636 0ustar augieeng00000000000000#require symlink Path conflict checking is currently disabled by default because of issue5716. Turn it on for this test. $ cat >> $HGRCPATH << EOF > [experimental] > merge.checkpathconflicts=True > EOF $ hg init repo $ cd repo $ echo base > base $ hg add base $ hg commit -m "base" $ hg bookmark -i base $ mkdir a $ echo 1 > a/b $ hg add a/b $ hg commit -m "file" $ hg bookmark -i file $ echo 2 > a/b $ hg commit -m "file2" $ hg bookmark -i file2 $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkdir a $ ln -s c a/b $ hg add a/b $ hg commit -m "link" created new head $ hg bookmark -i link $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkdir -p a/b/c $ echo 2 > a/b/c/d $ hg add a/b/c/d $ hg commit -m "dir" created new head $ hg bookmark -i dir Merge - local file conflicts with remote directory $ hg up file 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (activating bookmark file) $ hg bookmark -i $ hg merge --verbose dir resolving manifests a/b: path conflict - a file or link has the same name as a directory the local file has been renamed to a/b~0ed027b96f31 resolve manually then use 'hg resolve --mark a/b' moving a/b to a/b~0ed027b96f31 getting a/b/c/d 1 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ hg status M a/b/c/d A a/b~0ed027b96f31 R a/b $ hg resolve --all a/b: path conflict must be resolved manually $ hg forget a/b~0ed027b96f31 && rm a/b~0ed027b96f31 $ hg resolve --mark a/b (no more unresolved files) $ hg commit -m "merge file and dir (deleted file)" Merge - local symlink conflicts with remote directory $ hg up link 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (activating bookmark link) $ hg bookmark -i $ hg merge dir a/b: path conflict - a file or link has the same name as a directory the local file has been renamed to a/b~2ea68033e3be resolve manually then use 'hg resolve --mark a/b' 1 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ hg status M a/b/c/d A a/b~2ea68033e3be R a/b $ hg resolve --list P a/b $ hg resolve --all a/b: path conflict must be resolved manually $ hg mv a/b~2ea68033e3be a/b.old $ hg resolve --mark a/b (no more unresolved files) $ hg resolve --list R a/b $ hg commit -m "merge link and dir (renamed link)" Merge - local directory conflicts with remote file or link $ hg up dir 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (activating bookmark dir) $ hg bookmark -i $ hg merge file a/b: path conflict - a file or link has the same name as a directory the remote file has been renamed to a/b~0ed027b96f31 resolve manually then use 'hg resolve --mark a/b' 1 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ hg status A a/b~0ed027b96f31 $ hg resolve --all a/b: path conflict must be resolved manually $ hg mv a/b~0ed027b96f31 a/b/old-b $ hg resolve --mark a/b (no more unresolved files) $ hg commit -m "merge dir and file (move file into dir)" created new head $ hg merge file2 merging a/b/old-b and a/b to a/b/old-b 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat a/b/old-b 2 $ hg commit -m "merge file2 (copytrace tracked rename)" $ hg merge link a/b: path conflict - a file or link has the same name as a directory the remote file has been renamed to a/b~2ea68033e3be resolve manually then use 'hg resolve --mark a/b' 1 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ hg mv a/b~2ea68033e3be a/b.old $ readlink.py a/b.old a/b.old -> c $ hg resolve --mark a/b (no more unresolved files) $ hg commit -m "merge link (rename link)" mercurial-4.5.3/tests/test-mq-qrefresh-replace-log-message.t0000644015407300116100000001712313261161234023751 0ustar augieeng00000000000000Environment setup for MQ $ echo "[extensions]" >> $HGRCPATH $ echo "mq=" >> $HGRCPATH $ cat >> $HGRCPATH < [defaults] > # explicit date to commit with fixed hashid > qnew = -d "0 0" > qrefresh = -d "0 0" > qfold = -d "0 0" > EOF $ hg init $ hg qinit Should fail if no patches applied (this tests also that editor is not invoked if '--edit' is not specified) $ hg qrefresh no patches applied [1] $ hg qrefresh -e no patches applied [1] $ hg qnew -m "First commit message" first-patch $ echo aaaa > file $ hg add file $ HGEDITOR=cat hg qrefresh Should display 'First commit message' $ hg log -l1 --template "{desc}\n" First commit message Testing changing message with -m (this tests also that '--edit' can be used with '--message', and that '[committemplate] changeset' definition and commit log specific template keyword 'extramsg' work well) $ cat >> .hg/hgrc < [committemplate] > listupfiles = {file_adds % > "HG: added {file}\n" }{file_mods % > "HG: changed {file}\n" }{file_dels % > "HG: removed {file}\n" }{if(files, "", > "HG: no files changed\n")} > > changeset = HG: this is customized commit template > {desc}\n\n > HG: Enter commit message. Lines beginning with 'HG:' are removed. > HG: {extramsg} > HG: -- > HG: user: {author} > HG: branch '{branch}'\n{listupfiles} > EOF $ echo bbbb > file $ HGEDITOR=cat hg qrefresh -m "Second commit message" -e HG: this is customized commit template Second commit message HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to use default message. HG: -- HG: user: test HG: branch 'default' HG: added file $ cat >> .hg/hgrc < # disable customizing for subsequent tests > [committemplate] > changeset = > EOF Should display 'Second commit message' $ hg log -l1 --template "{desc}\n" Second commit message Testing changing message with -l $ echo "Third commit message" > logfile $ echo " This is the 3rd log message" >> logfile $ echo bbbb > file $ hg qrefresh -l logfile Should display 'Third commit message\\\n This is the 3rd log message' $ hg log -l1 --template "{desc}\n" Third commit message This is the 3rd log message Testing changing message with -l- $ hg qnew -m "First commit message" second-patch $ echo aaaa > file2 $ hg add file2 $ echo bbbb > file2 $ (echo "Fifth commit message"; echo " This is the 5th log message") | hg qrefresh -l- Should display 'Fifth commit message\\\n This is the 5th log message' $ hg log -l1 --template "{desc}\n" Fifth commit message This is the 5th log message Test saving last-message.txt: $ cat > $TESTTMP/editor.sh << EOF > echo "==== before editing" > cat \$1 > echo "====" > (echo; echo "test saving last-message.txt") >> \$1 > EOF $ cat > $TESTTMP/commitfailure.py < from mercurial import error > def reposetup(ui, repo): > class commitfailure(repo.__class__): > def commit(self, *args, **kwargs): > raise error.Abort('emulating unexpected abort') > repo.__class__ = commitfailure > EOF $ cat >> .hg/hgrc < [extensions] > # this failure occurs before editor invocation > commitfailure = $TESTTMP/commitfailure.py > EOF $ hg qapplied first-patch second-patch $ hg tip --template "{files}\n" file2 (test that editor is not invoked before transaction starting) $ rm -f .hg/last-message.txt $ HGEDITOR="sh $TESTTMP/editor.sh" hg qrefresh -e qrefresh interrupted while patch was popped! (revert --all, qpush to recover) abort: emulating unexpected abort [255] $ test -f .hg/last-message.txt [1] (reset applied patches and directory status) $ cat >> .hg/hgrc < [extensions] > commitfailure = ! > EOF $ hg qapplied first-patch $ hg status -A file2 ? file2 $ rm file2 $ hg qpush -q second-patch now at: second-patch (test that editor is invoked and commit message is saved into "last-message.txt") $ cat >> .hg/hgrc < [hooks] > # this failure occurs after editor invocation > pretxncommit.unexpectedabort = false > EOF $ rm -f .hg/last-message.txt $ hg status --rev "second-patch^1" -arm A file2 $ HGEDITOR="sh $TESTTMP/editor.sh" hg qrefresh -e ==== before editing Fifth commit message This is the 5th log message HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to use default message. HG: -- HG: user: test HG: branch 'default' HG: added file2 ==== note: commit message saved in .hg/last-message.txt transaction abort! rollback completed qrefresh interrupted while patch was popped! (revert --all, qpush to recover) abort: pretxncommit.unexpectedabort hook exited with status 1 [255] $ cat .hg/last-message.txt Fifth commit message This is the 5th log message test saving last-message.txt Test visibility of in-memory dirstate changes outside transaction to external process $ cat > $TESTTMP/checkvisibility.sh < echo "====" > hg parents --template "{rev}:{node|short}\n" > hg status -arm > echo "====" > EOF == test visibility to external editor $ hg update -C -q first-patch $ rm -f file2 $ hg qpush -q second-patch --config hooks.pretxncommit.unexpectedabort= now at: second-patch $ echo bbbb >> file2 $ sh "$TESTTMP/checkvisibility.sh" ==== 1:e30108269082 M file2 ==== $ HGEDITOR="sh \"$TESTTMP/checkvisibility.sh\"" hg qrefresh -e ==== 0:25e397dabed2 A file2 ==== note: commit message saved in .hg/last-message.txt transaction abort! rollback completed qrefresh interrupted while patch was popped! (revert --all, qpush to recover) abort: pretxncommit.unexpectedabort hook exited with status 1 [255] (rebuilding at failure of qrefresh bases on rev #0, and it causes dropping status of "file2") $ sh "$TESTTMP/checkvisibility.sh" ==== 0:25e397dabed2 ==== == test visibility to precommit external hook $ hg update -C -q $ rm -f file2 $ hg qpush -q second-patch --config hooks.pretxncommit.unexpectedabort= now at: second-patch $ echo bbbb >> file2 $ cat >> .hg/hgrc < [hooks] > precommit.checkvisibility = sh "$TESTTMP/checkvisibility.sh" > EOF $ sh "$TESTTMP/checkvisibility.sh" ==== 1:e30108269082 M file2 ==== $ hg qrefresh ==== 0:25e397dabed2 A file2 ==== transaction abort! rollback completed qrefresh interrupted while patch was popped! (revert --all, qpush to recover) abort: pretxncommit.unexpectedabort hook exited with status 1 [255] $ sh "$TESTTMP/checkvisibility.sh" ==== 0:25e397dabed2 ==== $ cat >> .hg/hgrc < [hooks] > precommit.checkvisibility = > EOF == test visibility to pretxncommit external hook $ hg update -C -q $ rm -f file2 $ hg qpush -q second-patch --config hooks.pretxncommit.unexpectedabort= now at: second-patch $ echo bbbb >> file2 $ cat >> .hg/hgrc < [hooks] > pretxncommit.checkvisibility = sh "$TESTTMP/checkvisibility.sh" > # make checkvisibility run before unexpectedabort > priority.pretxncommit.checkvisibility = 10 > EOF $ sh "$TESTTMP/checkvisibility.sh" ==== 1:e30108269082 M file2 ==== $ hg qrefresh ==== 0:25e397dabed2 A file2 ==== transaction abort! rollback completed qrefresh interrupted while patch was popped! (revert --all, qpush to recover) abort: pretxncommit.unexpectedabort hook exited with status 1 [255] $ sh "$TESTTMP/checkvisibility.sh" ==== 0:25e397dabed2 ==== $ cat >> .hg/hgrc < [hooks] > pretxncommit.checkvisibility = > EOF mercurial-4.5.3/tests/test-amend.t0000644015407300116100000002173613261161234016776 0ustar augieeng00000000000000#testcases obsstore-off obsstore-on $ cat << EOF >> $HGRCPATH > [extensions] > amend= > debugdrawdag=$TESTDIR/drawdag.py > [diff] > git=1 > EOF #if obsstore-on $ cat << EOF >> $HGRCPATH > [experimental] > evolution.createmarkers=True > EOF #endif Basic amend $ hg init repo1 $ cd repo1 $ hg debugdrawdag <<'EOS' > B > | > A > EOS $ hg update B -q $ echo 2 >> B $ hg amend saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/112478962961-7e959a55-amend.hg (obsstore-off !) #if obsstore-off $ hg log -p -G --hidden -T '{rev} {node|short} {desc}\n' @ 1 be169c7e8dbe B | diff --git a/B b/B | new file mode 100644 | --- /dev/null | +++ b/B | @@ -0,0 +1,1 @@ | +B2 | o 0 426bada5c675 A diff --git a/A b/A new file mode 100644 --- /dev/null +++ b/A @@ -0,0 +1,1 @@ +A \ No newline at end of file #else $ hg log -p -G --hidden -T '{rev} {node|short} {desc}\n' @ 2 be169c7e8dbe B | diff --git a/B b/B | new file mode 100644 | --- /dev/null | +++ b/B | @@ -0,0 +1,1 @@ | +B2 | | x 1 112478962961 B |/ diff --git a/B b/B | new file mode 100644 | --- /dev/null | +++ b/B | @@ -0,0 +1,1 @@ | +B | \ No newline at end of file | o 0 426bada5c675 A diff --git a/A b/A new file mode 100644 --- /dev/null +++ b/A @@ -0,0 +1,1 @@ +A \ No newline at end of file #endif Nothing changed $ hg amend nothing changed [1] $ hg amend -d "0 0" nothing changed [1] $ hg amend -d "Thu Jan 01 00:00:00 1970 UTC" nothing changed [1] Matcher and metadata options $ echo 3 > C $ echo 4 > D $ hg add C D $ hg amend -m NEWMESSAGE -I C saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/be169c7e8dbe-7684ddc5-amend.hg (obsstore-off !) $ hg log -r . -T '{node|short} {desc} {files}\n' c7ba14d9075b NEWMESSAGE B C $ echo 5 > E $ rm C $ hg amend -d '2000 1000' -u 'Foo ' -A C D saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/c7ba14d9075b-b3e76daa-amend.hg (obsstore-off !) $ hg log -r . -T '{node|short} {desc} {files} {author} {date}\n' 14f6c4bcc865 NEWMESSAGE B D Foo 2000.01000 Amend with editor $ cat > $TESTTMP/prefix.sh <<'EOF' > printf 'EDITED: ' > $TESTTMP/msg > cat "$1" >> $TESTTMP/msg > mv $TESTTMP/msg "$1" > EOF $ chmod +x $TESTTMP/prefix.sh $ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend --edit saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/14f6c4bcc865-6591f15d-amend.hg (obsstore-off !) $ hg log -r . -T '{node|short} {desc}\n' 298f085230c3 EDITED: NEWMESSAGE $ HGEDITOR="sh $TESTTMP/prefix.sh" hg amend -e -m MSG saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/298f085230c3-d81a6ad3-amend.hg (obsstore-off !) $ hg log -r . -T '{node|short} {desc}\n' 974f07f28537 EDITED: MSG $ echo FOO > $TESTTMP/msg $ hg amend -l $TESTTMP/msg -m BAR abort: options --message and --logfile are mutually exclusive [255] $ hg amend -l $TESTTMP/msg saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/974f07f28537-edb6470a-amend.hg (obsstore-off !) $ hg log -r . -T '{node|short} {desc}\n' 507be9bdac71 FOO Interactive mode $ touch F G $ hg add F G $ cat < y > n > EOS diff --git a/F b/F new file mode 100644 examine changes to 'F'? [Ynesfdaq?] y diff --git a/G b/G new file mode 100644 examine changes to 'G'? [Ynesfdaq?] n saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/507be9bdac71-c8077452-amend.hg (obsstore-off !) $ hg log -r . -T '{files}\n' B D F Amend in the middle of a stack $ hg init $TESTTMP/repo2 $ cd $TESTTMP/repo2 $ hg debugdrawdag <<'EOS' > C > | > B > | > A > EOS $ hg update -q B $ echo 2 >> B $ hg amend abort: cannot amend changeset with children [255] #if obsstore-on With allowunstable, amend could work in the middle of a stack $ cat >> $HGRCPATH < [experimental] > evolution.createmarkers=True > evolution.allowunstable=True > EOF $ hg amend 1 new orphan changesets $ hg log -T '{rev} {node|short} {desc}\n' -G @ 3 be169c7e8dbe B | | * 2 26805aba1e60 C | | | x 1 112478962961 B |/ o 0 426bada5c675 A Checking the note stored in the obsmarker $ echo foo > bar $ hg add bar $ hg amend --note 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy' abort: cannot store a note of more than 255 bytes [255] $ hg amend --note "adding bar" $ hg debugobsolete -r . 112478962961147124edd43549aedd1a335e44bf be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'} be169c7e8dbe21cd10b3d79691cbe7f241e3c21c 16084da537dd8f84cfdb3055c633772269d62e1b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'note': 'adding bar', 'operation': 'amend', 'user': 'test'} #endif Cannot amend public changeset $ hg phase -r A --public $ hg update -C -q A $ hg amend -m AMEND abort: cannot amend public changesets (see 'hg help phases' for details) [255] Amend a merge changeset $ hg init $TESTTMP/repo3 $ cd $TESTTMP/repo3 $ hg debugdrawdag <<'EOS' > C > /| > A B > EOS $ hg update -q C $ hg amend -m FOO saved backup bundle to $TESTTMP/repo3/.hg/strip-backup/a35c07e8a2a4-15ff4612-amend.hg (obsstore-off !) $ rm .hg/localtags $ hg log -G -T '{desc}\n' @ FOO |\ | o B | o A More complete test for status changes (issue5732) ------------------------------------------------- Generates history of files having 3 states, r0_r1_wc: r0: ground (content/missing) r1: old state to be amended (content/missing, where missing means removed) wc: changes to be included in r1 (content/missing-tracked/untracked) $ hg init $TESTTMP/wcstates $ cd $TESTTMP/wcstates $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 1 $ hg addremove -q --similarity 0 $ hg commit -m0 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 2 $ hg addremove -q --similarity 0 $ hg commit -m1 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 wc $ hg addremove -q --similarity 0 $ hg forget *_*_*-untracked $ rm *_*_missing-* amend r1 to include wc changes $ hg amend saved backup bundle to * (glob) (obsstore-off !) clean/modified/removed/added states of the amended revision $ hg status --all --change . 'glob:content1_*_content1-tracked' C content1_content1_content1-tracked C content1_content2_content1-tracked C content1_missing_content1-tracked $ hg status --all --change . 'glob:content1_*_content[23]-tracked' M content1_content1_content3-tracked M content1_content2_content2-tracked M content1_content2_content3-tracked M content1_missing_content3-tracked $ hg status --all --change . 'glob:content1_*_missing-tracked' M content1_content2_missing-tracked R content1_missing_missing-tracked C content1_content1_missing-tracked $ hg status --all --change . 'glob:content1_*_*-untracked' R content1_content1_content1-untracked R content1_content1_content3-untracked R content1_content1_missing-untracked R content1_content2_content1-untracked R content1_content2_content2-untracked R content1_content2_content3-untracked R content1_content2_missing-untracked R content1_missing_content1-untracked R content1_missing_content3-untracked R content1_missing_missing-untracked $ hg status --all --change . 'glob:missing_content2_*' A missing_content2_content2-tracked A missing_content2_content3-tracked A missing_content2_missing-tracked $ hg status --all --change . 'glob:missing_missing_*' A missing_missing_content3-tracked working directory should be all clean (with some missing/untracked files) $ hg status --all 'glob:*_content?-tracked' C content1_content1_content1-tracked C content1_content1_content3-tracked C content1_content2_content1-tracked C content1_content2_content2-tracked C content1_content2_content3-tracked C content1_missing_content1-tracked C content1_missing_content3-tracked C missing_content2_content2-tracked C missing_content2_content3-tracked C missing_missing_content3-tracked $ hg status --all 'glob:*_missing-tracked' ! content1_content1_missing-tracked ! content1_content2_missing-tracked ! content1_missing_missing-tracked ! missing_content2_missing-tracked ! missing_missing_missing-tracked $ hg status --all 'glob:*-untracked' ? content1_content1_content1-untracked ? content1_content1_content3-untracked ? content1_content2_content1-untracked ? content1_content2_content2-untracked ? content1_content2_content3-untracked ? content1_missing_content1-untracked ? content1_missing_content3-untracked ? missing_content2_content2-untracked ? missing_content2_content3-untracked ? missing_missing_content3-untracked mercurial-4.5.3/tests/test-issue2137.t0000644015407300116100000000305313261161234017347 0ustar augieeng00000000000000https://bz.mercurial-scm.org/2137 Setup: create a little extension that has 3 side-effects: 1) ensure changelog data is not inlined 2) make revlog to use lazyparser 3) test that repo.lookup() works 1 and 2 are preconditions for the bug; 3 is the bug. $ cat > commitwrapper.py < from mercurial import extensions, node, revlog > > def reposetup(ui, repo): > class wraprepo(repo.__class__): > def commit(self, *args, **kwargs): > result = super(wraprepo, self).commit(*args, **kwargs) > tip1 = node.short(repo.changelog.tip()) > tip2 = node.short(repo.lookup(tip1)) > assert tip1 == tip2 > ui.write('new tip: %s\n' % tip1) > return result > repo.__class__ = wraprepo > > def extsetup(ui): > revlog._maxinline = 8 # split out 00changelog.d early > revlog._prereadsize = 8 # use revlog.lazyparser > EOF $ cat >> $HGRCPATH < [extensions] > commitwrapper = `pwd`/commitwrapper.py > EOF $ hg init repo1 $ cd repo1 $ echo a > a $ hg commit -A -m'add a with a long commit message to make the changelog a bit bigger' adding a new tip: 553596fad57b Test that new changesets are visible to repo.lookup(): $ echo a >> a $ hg commit -m'one more commit to demonstrate the bug' new tip: 799ae3599e0e $ hg tip changeset: 1:799ae3599e0e tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: one more commit to demonstrate the bug $ cd .. mercurial-4.5.3/tests/helper-runtests.sh0000644015407300116100000000017213261161234020237 0ustar augieeng00000000000000# # Avoid interference from actual test env: unset HGTEST_JOBS unset HGTEST_TIMEOUT unset HGTEST_PORT unset HGTEST_SHELL mercurial-4.5.3/tests/test-locate.t0000644015407300116100000000361313261161234017153 0ustar augieeng00000000000000 $ hg init repo $ cd repo $ echo 0 > a $ echo 0 > b $ echo 0 > t.h $ mkdir t $ echo 0 > t/x $ echo 0 > t/b $ echo 0 > t/e.h $ mkdir dir.h $ echo 0 > dir.h/foo $ hg ci -A -m m adding a adding b adding dir.h/foo adding t.h adding t/b adding t/e.h adding t/x $ touch nottracked $ hg locate a a $ hg locate NONEXISTENT [1] $ hg locate a b dir.h/foo t.h t/b t/e.h t/x $ hg rm a $ hg ci -m m $ hg locate a [1] $ hg locate NONEXISTENT [1] $ hg locate relpath:NONEXISTENT [1] $ hg locate b dir.h/foo t.h t/b t/e.h t/x $ hg locate -r 0 a a $ hg locate -r 0 NONEXISTENT [1] $ hg locate -r 0 relpath:NONEXISTENT [1] $ hg locate -r 0 a b dir.h/foo t.h t/b t/e.h t/x -I/-X with relative path should work: $ cd t $ hg locate b dir.h/foo t.h t/b t/e.h t/x $ hg locate -I ../t t/b t/e.h t/x Issue294: hg remove --after dir fails when dir.* also exists $ cd .. $ rm -r t $ hg rm t/b $ hg locate 't/**' t/b t/e.h t/x $ hg files b dir.h/foo t.h t/e.h t/x $ hg files b b -X with explicit path: $ hg files b -X b [1] $ mkdir otherdir $ cd otherdir $ hg files path: ../b ../dir.h/foo ../t.h ../t/e.h ../t/x $ hg files path:. ../b ../dir.h/foo ../t.h ../t/e.h ../t/x $ hg locate b ../b ../t/b $ hg locate '*.h' ../t.h ../t/e.h $ hg locate path:t/x ../t/x $ hg locate 're:.*\.h$' ../t.h ../t/e.h $ hg locate -r 0 b ../b ../t/b $ hg locate -r 0 '*.h' ../t.h ../t/e.h $ hg locate -r 0 path:t/x ../t/x $ hg locate -r 0 're:.*\.h$' ../t.h ../t/e.h $ hg files ../b ../dir.h/foo ../t.h ../t/e.h ../t/x $ hg files . [1] Convert native path separator to slash (issue5572) $ hg files -T '{path|slashpath}\n' ../b ../dir.h/foo ../t.h ../t/e.h ../t/x $ cd ../.. mercurial-4.5.3/tests/test-bookmarks-current.t0000644015407300116100000001174713261161234021363 0ustar augieeng00000000000000 $ hg init no bookmarks $ hg bookmarks no bookmarks set set bookmark X $ hg bookmark X list bookmarks $ hg bookmark * X -1:000000000000 list bookmarks with color $ hg --config extensions.color= --config color.mode=ansi \ > bookmark --color=always \x1b[0;32m * \x1b[0m\x1b[0;32mX\x1b[0m\x1b[0;32m -1:000000000000\x1b[0m (esc) update to bookmark X $ hg bookmarks * X -1:000000000000 $ hg update X 0 files updated, 0 files merged, 0 files removed, 0 files unresolved list bookmarks $ hg bookmarks * X -1:000000000000 rename $ hg bookmark -m X Z list bookmarks $ cat .hg/bookmarks.current Z (no-eol) $ cat .hg/bookmarks 0000000000000000000000000000000000000000 Z $ hg bookmarks * Z -1:000000000000 new bookmarks X and Y, first one made active $ hg bookmark Y X list bookmarks $ hg bookmark X -1:000000000000 * Y -1:000000000000 Z -1:000000000000 $ hg bookmark -d X commit $ echo 'b' > b $ hg add b $ hg commit -m'test' list bookmarks $ hg bookmark * Y 0:719295282060 Z -1:000000000000 Verify that switching to Z updates the active bookmark: $ hg update Z 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (activating bookmark Z) $ hg bookmark Y 0:719295282060 * Z -1:000000000000 Switch back to Y for the remaining tests in this file: $ hg update Y 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (activating bookmark Y) delete bookmarks $ hg bookmark -d Y $ hg bookmark -d Z list bookmarks $ hg bookmark no bookmarks set update to tip $ hg update tip 0 files updated, 0 files merged, 0 files removed, 0 files unresolved set bookmark Y using -r . but make sure that the active bookmark is not activated $ hg bookmark -r . Y list bookmarks, Y should not be active $ hg bookmark Y 0:719295282060 now, activate Y $ hg up -q Y set bookmark Z using -i $ hg bookmark -r . -i Z $ hg bookmarks * Y 0:719295282060 Z 0:719295282060 deactivate active bookmark using -i $ hg bookmark -i Y $ hg bookmarks Y 0:719295282060 Z 0:719295282060 $ hg up -q Y $ hg bookmark -i $ hg bookmarks Y 0:719295282060 Z 0:719295282060 $ hg bookmark -i no active bookmark $ hg up -q Y $ hg bookmarks * Y 0:719295282060 Z 0:719295282060 deactivate active bookmark while renaming $ hg bookmark -i -m Y X $ hg bookmarks X 0:719295282060 Z 0:719295282060 bare update moves the active bookmark forward and clear the divergent bookmarks $ echo a > a $ hg ci -Am1 adding a $ echo b >> a $ hg ci -Am2 $ hg bookmark X@1 -r 1 $ hg bookmark X@2 -r 2 $ hg update X 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (activating bookmark X) $ hg bookmarks * X 0:719295282060 X@1 1:cc586d725fbe X@2 2:49e1c4e84c58 Z 0:719295282060 $ hg update 1 files updated, 0 files merged, 0 files removed, 0 files unresolved updating bookmark X $ hg bookmarks * X 2:49e1c4e84c58 Z 0:719295282060 test deleting .hg/bookmarks.current when explicitly updating to a revision $ echo a >> b $ hg ci -m. $ hg up -q X $ test -f .hg/bookmarks.current try to update to it again to make sure we don't set and then unset it $ hg up -q X $ test -f .hg/bookmarks.current $ hg up -q 1 $ test -f .hg/bookmarks.current [1] when a bookmark is active, hg up -r . is analogous to hg book -i $ hg up -q X $ hg up -q . $ test -f .hg/bookmarks.current [1] issue 4552 -- simulate a pull moving the active bookmark $ hg up -q X $ printf "Z" > .hg/bookmarks.current $ hg log -T '{activebookmark}\n' -r Z Z $ hg log -T '{bookmarks % "{active}\n"}' -r Z Z test that updating to closed branch head also advances active bookmark $ hg commit --close-branch -m "closed" $ hg update -q ".^1" $ hg bookmark Y $ hg bookmarks X 3:4d6bd4bfb1ae * Y 3:4d6bd4bfb1ae Z 0:719295282060 $ hg update 0 files updated, 0 files merged, 0 files removed, 0 files unresolved updating bookmark Y $ hg bookmarks X 3:4d6bd4bfb1ae * Y 4:8fa964221e8e Z 0:719295282060 $ hg parents -q 4:8fa964221e8e mercurial-4.5.3/tests/test-empty-group.t0000644015407300116100000000613713261161234020200 0ustar augieeng00000000000000# A B # # 3 4 3 # |\/| |\ # |/\| | \ # 1 2 1 2 # \ / \ / # 0 0 # # if the result of the merge of 1 and 2 # is the same in 3 and 4, no new manifest # will be created and the manifest group # will be empty during the pull # # (plus we test a failure where outgoing # wrongly reported the number of csets) $ hg init a $ cd a $ touch init $ hg ci -A -m 0 adding init $ touch x y $ hg ci -A -m 1 adding x adding y $ hg update 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ touch x y $ hg ci -A -m 2 adding x adding y created new head $ hg merge 1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -A -m m1 $ hg update -C 1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge 2 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -A -m m2 created new head $ cd .. $ hg clone -r 3 a b adding changesets adding manifests adding file changes added 4 changesets with 3 changes to 3 files new changesets 5fcb73622933:d15a0c284984 updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg clone -r 4 a c adding changesets adding manifests adding file changes added 4 changesets with 3 changes to 3 files new changesets 5fcb73622933:1ec3c74fc0e0 updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R a outgoing b comparing with b searching for changes changeset: 4:1ec3c74fc0e0 tag: tip parent: 1:79f9e10cd04e parent: 2:8e1bb01c1a24 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: m2 $ hg -R a outgoing c comparing with c searching for changes changeset: 3:d15a0c284984 parent: 2:8e1bb01c1a24 parent: 1:79f9e10cd04e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: m1 $ hg -R b outgoing c comparing with c searching for changes changeset: 3:d15a0c284984 tag: tip parent: 2:8e1bb01c1a24 parent: 1:79f9e10cd04e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: m1 $ hg -R c outgoing b comparing with b searching for changes changeset: 3:1ec3c74fc0e0 tag: tip parent: 1:79f9e10cd04e parent: 2:8e1bb01c1a24 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: m2 $ hg -R b pull a pulling from a searching for changes adding changesets adding manifests adding file changes added 1 changesets with 0 changes to 0 files (+1 heads) new changesets 1ec3c74fc0e0 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg -R c pull a pulling from a searching for changes adding changesets adding manifests adding file changes added 1 changesets with 0 changes to 0 files (+1 heads) new changesets d15a0c284984 (run 'hg heads' to see heads, 'hg merge' to merge) mercurial-4.5.3/tests/test-encoding-func.py0000644015407300116100000000214713261161234020611 0ustar augieeng00000000000000from __future__ import absolute_import import unittest from mercurial import ( encoding, ) class IsasciistrTest(unittest.TestCase): asciistrs = [ b'a', b'ab', b'abc', b'abcd', b'abcde', b'abcdefghi', b'abcd\0fghi', ] def testascii(self): for s in self.asciistrs: self.assertTrue(encoding.isasciistr(s)) def testnonasciichar(self): for s in self.asciistrs: for i in range(len(s)): t = bytearray(s) t[i] |= 0x80 self.assertFalse(encoding.isasciistr(bytes(t))) class LocalEncodingTest(unittest.TestCase): def testasciifastpath(self): s = b'\0' * 100 self.assertTrue(s is encoding.tolocal(s)) self.assertTrue(s is encoding.fromlocal(s)) class Utf8bEncodingTest(unittest.TestCase): def testasciifastpath(self): s = b'\0' * 100 self.assertTrue(s is encoding.toutf8b(s)) self.assertTrue(s is encoding.fromutf8b(s)) if __name__ == '__main__': import silenttestrunner silenttestrunner.main(__name__) mercurial-4.5.3/tests/gpg/0000755015407300116100000000000013261161260015313 5ustar augieeng00000000000000mercurial-4.5.3/tests/gpg/secring.gpg0000644015407300116100000000234013261161234017444 0ustar augieeng00000000000000•˜J5\|êÆqµ“¦íû@Ðã‚"­ðÁÓZýïQF÷µ êl"ñˆ†ƒiI”Àeÿ¥æÃÈˋӂQ|£á ÿÅ®HôMÞ®6Z ŸØzÚBq™íœµ‘Ô=¢á¡ ¥ó}ÏþŒ¦ó -! d4L@{yâAA]Gÿ‚õ,®@”éûݨm©+¶ ŠscyʽÒaž¢"%×jÆ¿†môºL?ã&”([¢5ÜßÍ<8YO?¦‰ _“ŠdŸßÄ„8h÷7Žx:BêV>¼Ðzi¤>YÚÁBÈ\$E3Ô¦z¾§,ÐSZØ·ëøÚo ðß”C¦¯G[þ1 ¼Ðzi¤>YÚÁBÈ\$E3Ô¦z¾§,ÐSZØ·ëøÚo ðß”C¦¯G[´hgtest‰6 J5\| € ¢- §N$ñòÑ懻mDzg”&Zoç=£+kel–Òørß¹(Ú©„…³“µw1 k{Ê÷— ÏÔ=¡Þª‡}N_C1ª ¦A8‰•ægùÉΧO@$Ûîvýõå¼U¼‰ÊÛ¸ÿKQiºô^Û€ÁD/G;º.»Þ*]™ ´p;9Ä÷×q„S’'¥`–¢Ôâ¶t€3*¿ $|Ý1Ê5äijTfÄE®!Ç3ykïnÞ·Ç8ÖØä;YÔ8¢=IûMîðFä«…è+",#è´äÍXþjO„û³ '\ ¢]ÉC%›Ìšã…Æß«®ŠËjêK$•¹ƒù¶R?§¢F®dǰmercurial-4.5.3/tests/gpg/trustdb.gpg0000644015407300116100000000240013261161234017476 0ustar augieeng00000000000000gpgJ5\}  €ËûbG—µ5>¢- §N$ñò WÖC–™ üÁ~»>Ã+¦Ê^ymercurial-4.5.3/tests/test-symlink-os-yes-fs-no.py0000644015407300116100000000253413261161234022015 0ustar augieeng00000000000000from __future__ import absolute_import import os import sys import time from mercurial import ( commands, hg, ui as uimod, util, ) TESTDIR = os.environ["TESTDIR"] BUNDLEPATH = os.path.join(TESTDIR, 'bundles', 'test-no-symlinks.hg') # only makes sense to test on os which supports symlinks if not getattr(os, "symlink", False): sys.exit(80) # SKIPPED_STATUS defined in run-tests.py u = uimod.ui.load() # hide outer repo hg.peer(u, {}, '.', create=True) # clone with symlink support hg.clone(u, {}, BUNDLEPATH, 'test0') repo = hg.repository(u, 'test0') # wait a bit, or the status call wont update the dirstate time.sleep(1) commands.status(u, repo) # now disable symlink support -- this is what os.symlink would do on a # non-symlink file system def symlink_failure(src, dst): raise OSError(1, "Operation not permitted") os.symlink = symlink_failure def islink_failure(path): return False os.path.islink = islink_failure # dereference links as if a Samba server has exported this to a # Windows client for f in 'test0/a.lnk', 'test0/d/b.lnk': os.unlink(f) fp = open(f, 'wb') fp.write(util.readfile(f[:-4])) fp.close() # reload repository u = uimod.ui.load() repo = hg.repository(u, 'test0') commands.status(u, repo) # try cloning a repo which contains symlinks u = uimod.ui.load() hg.clone(u, {}, BUNDLEPATH, 'test1') mercurial-4.5.3/tests/test-confused-revert.t0000644015407300116100000000231713261161234021017 0ustar augieeng00000000000000 $ hg init $ echo foo > a $ hg add a $ hg commit -m "1" $ echo bar > b $ hg add b $ hg remove a Should show a removed and b added: $ hg status A b R a $ hg revert --all undeleting a forgetting b Should show b unknown and a back to normal: $ hg status ? b $ rm b $ hg co -C 0 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo foo-a > a $ hg commit -m "2a" $ hg co -C 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo foo-b > a $ hg commit -m "2b" created new head $ HGMERGE=true hg merge 1 merging a 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) Should show foo-b: $ cat a foo-b $ echo bar > b $ hg add b $ rm a $ hg remove a Should show a removed and b added: $ hg status A b R a Revert should fail: $ hg revert abort: uncommitted merge with no revision specified (use 'hg update' or see 'hg help revert') [255] Revert should be ok now: $ hg revert -r2 --all undeleting a forgetting b Should show b unknown and a marked modified (merged): $ hg status M a ? b Should show foo-b: $ cat a foo-b mercurial-4.5.3/tests/test-clone-update-order.t0000644015407300116100000000664613261161234021406 0ustar augieeng00000000000000 $ hg init $ echo foo > bar $ hg commit -Am default adding bar $ hg up -r null 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg branch mine marked working directory as branch mine (branches are permanent and global, did you want a bookmark?) $ echo hello > world $ hg commit -Am hello adding world $ hg up -r null 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg branch other marked working directory as branch other $ echo good > bye $ hg commit -Am other adding bye $ hg up -r mine 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg clone -U -u . .#other ../b -r 0 -r 1 -r 2 -b other abort: cannot specify both --noupdate and --updaterev [255] $ hg clone -U .#other ../b -r 0 -r 1 -r 2 -b other adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 3 files (+2 heads) new changesets 8c68ee086fd0:fcc393352796 $ rm -rf ../b $ hg clone -u . .#other ../b -r 0 -r 1 -r 2 -b other adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 3 files (+2 heads) new changesets 8c68ee086fd0:fcc393352796 updating to branch mine 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf ../b $ hg clone -u 0 .#other ../b -r 0 -r 1 -r 2 -b other adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 3 files (+2 heads) new changesets 8c68ee086fd0:fcc393352796 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf ../b $ hg clone -u 1 .#other ../b -r 0 -r 1 -r 2 -b other adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 3 files (+2 heads) new changesets 8c68ee086fd0:fcc393352796 updating to branch mine 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf ../b $ hg clone -u 2 .#other ../b -r 0 -r 1 -r 2 -b other adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 3 files (+2 heads) new changesets 8c68ee086fd0:fcc393352796 updating to branch other 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf ../b Test -r mine ... mine is ignored: $ hg clone -u 2 .#other ../b -r mine -r 0 -r 1 -r 2 -b other adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 3 files (+2 heads) new changesets 8c68ee086fd0:fcc393352796 updating to branch other 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf ../b $ hg clone .#other ../b -b default -b mine adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 3 files (+2 heads) new changesets 8c68ee086fd0:fcc393352796 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf ../b $ hg clone .#other ../b adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets fcc393352796 updating to branch other 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf ../b $ hg clone -U . ../c -r 1 -r 2 > /dev/null $ hg clone ../c ../b updating to branch other 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf ../b ../c mercurial-4.5.3/tests/test-convert-hg-sink.t0000644015407300116100000003166013261161234020725 0ustar augieeng00000000000000 $ cat >> $HGRCPATH < [extensions] > convert= > [convert] > hg.saverev=False > EOF $ hg init orig $ cd orig $ echo foo > foo $ echo bar > bar $ hg ci -qAm 'add foo and bar' $ hg rm foo $ hg ci -m 'remove foo' $ mkdir foo $ echo file > foo/file $ hg ci -qAm 'add foo/file' $ hg tag some-tag $ hg tag -l local-tag $ hg log changeset: 3:593cbf6fb2b4 tag: local-tag tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Added tag some-tag for changeset ad681a868e44 changeset: 2:ad681a868e44 tag: some-tag user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add foo/file changeset: 1:cbba8ecc03b7 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: remove foo changeset: 0:327daa9251fa user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add foo and bar $ hg phase --public -r tip $ cd .. $ hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded' initializing destination new repository scanning source... sorting... converting... 3 add foo and bar 2 remove foo 1 add foo/file 0 Added tag some-tag for changeset ad681a868e44 $ cd new $ hg log -G --template '{rev} {node|short} ({phase}) "{desc}"\n' o 3 593cbf6fb2b4 (public) "Added tag some-tag for changeset ad681a868e44" | o 2 ad681a868e44 (public) "add foo/file" | o 1 cbba8ecc03b7 (public) "remove foo" | o 0 327daa9251fa (public) "add foo and bar" $ hg out ../orig comparing with ../orig searching for changes no changes found [1] dirstate should be empty: $ hg debugstate $ hg parents -q $ hg up -C 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg copy bar baz put something in the dirstate: $ hg debugstate > debugstate $ grep baz debugstate a 0 -1 unset baz copy: bar -> baz add a new revision in the original repo $ cd ../orig $ echo baz > baz $ hg ci -qAm 'add baz' $ cd .. $ hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded' scanning source... sorting... converting... 0 add baz $ cd new $ hg out ../orig comparing with ../orig searching for changes no changes found [1] dirstate should be the same (no output below): $ hg debugstate > new-debugstate $ diff debugstate new-debugstate no copies $ hg up -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg debugrename baz baz not renamed $ cd .. test tag rewriting $ cat > filemap < exclude foo > EOF $ hg convert --filemap filemap orig new-filemap 2>&1 | grep -v 'subversion python bindings could not be loaded' initializing destination new-filemap repository scanning source... sorting... converting... 4 add foo and bar 3 remove foo 2 add foo/file 1 Added tag some-tag for changeset ad681a868e44 0 add baz $ cd new-filemap $ hg tags tip 2:3c74706b1ff8 some-tag 0:ba8636729451 $ cd .. Test cases for hg-hg roundtrip Helper $ glog() > { > hg log -G --template '{rev} {node|short} ({phase}) "{desc}" files: {files}\n' $* > } Create a tricky source repo $ hg init source $ cd source $ echo 0 > 0 $ hg ci -Aqm '0: add 0' $ echo a > a $ mkdir dir $ echo b > dir/b $ hg ci -qAm '1: add a and dir/b' $ echo c > dir/c $ hg ci -qAm '2: add dir/c' $ hg copy a e $ echo b >> b $ hg ci -qAm '3: copy a to e, change b' $ hg up -qr -3 $ echo a >> a $ hg ci -qAm '4: change a' $ hg merge merging a and e to e 2 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg copy b dir/d $ hg ci -qAm '5: merge 2 and 3, copy b to dir/d' $ echo a >> a $ hg ci -qAm '6: change a' $ hg mani 0 a b dir/b dir/c dir/d e $ hg phase --public -r tip $ glog @ 6 0613c8e59a3d (public) "6: change a" files: a | o 5 717e9b37cdb7 (public) "5: merge 2 and 3, copy b to dir/d" files: dir/d e |\ | o 4 86a55cb968d5 (public) "4: change a" files: a | | o | 3 0e6e235919dd (public) "3: copy a to e, change b" files: b e | | o | 2 0394b0d5e4f7 (public) "2: add dir/c" files: dir/c |/ o 1 333546584845 (public) "1: add a and dir/b" files: a dir/b | o 0 d1a24e2ebd23 (public) "0: add 0" files: 0 $ cd .. Convert excluding rev 0 and dir/ (and thus rev2): $ cat << EOF > filemap > exclude dir > EOF $ hg convert --filemap filemap source dest --config convert.hg.revs=1:: initializing destination dest repository scanning source... sorting... converting... 5 1: add a and dir/b 4 2: add dir/c 3 3: copy a to e, change b 2 4: change a 1 5: merge 2 and 3, copy b to dir/d 0 6: change a Verify that conversion skipped rev 2: $ glog -R dest o 4 78814e84a217 (draft) "6: change a" files: a | o 3 f7cff662c5e5 (draft) "5: merge 2 and 3, copy b to dir/d" files: e |\ | o 2 ab40a95b0072 (draft) "4: change a" files: a | | o | 1 bd51f17597bf (draft) "3: copy a to e, change b" files: b e |/ o 0 a4a1dae0fe35 (draft) "1: add a and dir/b" files: 0 a Verify mapping correct in both directions: $ cat source/.hg/shamap a4a1dae0fe3514cefd9b8541b7abbc8f44f946d5 333546584845f70c4cfecb992341aaef0e708166 bd51f17597bf32268e68a560b206898c3960cda2 0e6e235919dd8e9285ba8eb5adf703af9ad99378 ab40a95b00725307e79c2fd271000aa8af9759f4 86a55cb968d51770cba2a1630d6cc637b574580a f7cff662c5e581e6f3f1a85ffdd2bcb35825f6ba 717e9b37cdb7eb9917ca8e30aa3f986e6d5b177d 78814e84a217894517c2de392b903ed05e6871a4 0613c8e59a3ddb9789072ef52f1ed13496489bb4 $ cat dest/.hg/shamap 333546584845f70c4cfecb992341aaef0e708166 a4a1dae0fe3514cefd9b8541b7abbc8f44f946d5 0394b0d5e4f761ced559fd0bbdc6afc16cb3f7d1 a4a1dae0fe3514cefd9b8541b7abbc8f44f946d5 0e6e235919dd8e9285ba8eb5adf703af9ad99378 bd51f17597bf32268e68a560b206898c3960cda2 86a55cb968d51770cba2a1630d6cc637b574580a ab40a95b00725307e79c2fd271000aa8af9759f4 717e9b37cdb7eb9917ca8e30aa3f986e6d5b177d f7cff662c5e581e6f3f1a85ffdd2bcb35825f6ba 0613c8e59a3ddb9789072ef52f1ed13496489bb4 78814e84a217894517c2de392b903ed05e6871a4 Verify meta data converted correctly: $ hg -R dest log -r 1 --debug -p --git changeset: 1:bd51f17597bf32268e68a560b206898c3960cda2 phase: draft parent: 0:a4a1dae0fe3514cefd9b8541b7abbc8f44f946d5 parent: -1:0000000000000000000000000000000000000000 manifest: 1:040c72ed9b101773c24ac314776bfc846943781f user: test date: Thu Jan 01 00:00:00 1970 +0000 files+: b e extra: branch=default description: 3: copy a to e, change b diff --git a/b b/b new file mode 100644 --- /dev/null +++ b/b @@ -0,0 +1,1 @@ +b diff --git a/a b/e copy from a copy to e Verify files included and excluded correctly: $ hg -R dest manifest -r tip 0 a b e Make changes in dest and convert back: $ hg -R dest up -q $ echo dest > dest/dest $ hg -R dest ci -Aqm 'change in dest' $ hg -R dest tip changeset: 5:a2e0e3cc6d1d tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: change in dest (converting merges back after using a filemap will probably cause chaos so we exclude merges.) $ hg convert dest source --config convert.hg.revs='!merge()' scanning source... sorting... converting... 0 change in dest Verify the conversion back: $ hg -R source log --debug -r tip changeset: 7:e6d364a69ff1248b2099e603b0c145504cade6f0 tag: tip phase: draft parent: 6:0613c8e59a3ddb9789072ef52f1ed13496489bb4 parent: -1:0000000000000000000000000000000000000000 manifest: 7:aa3e9542f3b76d4f1f1b2e9c7ce9dbb48b6a95ec user: test date: Thu Jan 01 00:00:00 1970 +0000 files+: dest extra: branch=default description: change in dest Files that had been excluded are still present: $ hg -R source manifest -r tip 0 a b dest dir/b dir/c dir/d e More source changes $ cd source $ echo 1 >> a $ hg ci -m '8: source first branch' created new head $ hg up -qr -2 $ echo 2 >> a $ hg ci -m '9: source second branch' $ hg merge -q --tool internal:local $ hg ci -m '10: source merge' $ echo >> a $ hg ci -m '11: source change' $ hg mani 0 a b dest dir/b dir/c dir/d e $ glog -r 6: @ 11 0c8927d1f7f4 (draft) "11: source change" files: a | o 10 9ccb7ee8d261 (draft) "10: source merge" files: a |\ | o 9 f131b1518dba (draft) "9: source second branch" files: a | | o | 8 669cf0e74b50 (draft) "8: source first branch" files: a | | | o 7 e6d364a69ff1 (draft) "change in dest" files: dest |/ o 6 0613c8e59a3d (public) "6: change a" files: a | ~ $ cd .. $ hg convert --filemap filemap source dest --config convert.hg.revs=3: scanning source... sorting... converting... 3 8: source first branch 2 9: source second branch 1 10: source merge 0 11: source change $ glog -R dest o 9 8432d597b263 (draft) "11: source change" files: a | o 8 632ffacdcd6f (draft) "10: source merge" files: a |\ | o 7 049cfee90ee6 (draft) "9: source second branch" files: a | | o | 6 9b6845e036e5 (draft) "8: source first branch" files: a | | | @ 5 a2e0e3cc6d1d (draft) "change in dest" files: dest |/ o 4 78814e84a217 (draft) "6: change a" files: a | o 3 f7cff662c5e5 (draft) "5: merge 2 and 3, copy b to dir/d" files: e |\ | o 2 ab40a95b0072 (draft) "4: change a" files: a | | o | 1 bd51f17597bf (draft) "3: copy a to e, change b" files: b e |/ o 0 a4a1dae0fe35 (draft) "1: add a and dir/b" files: 0 a $ cd .. Two way tests $ hg init 0 $ echo f > 0/f $ echo a > 0/a-only $ echo b > 0/b-only $ hg -R 0 ci -Aqm0 $ cat << EOF > filemap-a > exclude b-only > EOF $ cat << EOF > filemap-b > exclude a-only > EOF $ hg convert --filemap filemap-a 0 a initializing destination a repository scanning source... sorting... converting... 0 0 $ hg -R a up -q $ echo a > a/f $ hg -R a ci -ma $ hg convert --filemap filemap-b 0 b initializing destination b repository scanning source... sorting... converting... 0 0 $ hg -R b up -q $ echo b > b/f $ hg -R b ci -mb $ tail 0/.hg/shamap 86f3f774ffb682bffb5dc3c1d3b3da637cb9a0d6 8a028c7c77f6c7bd6d63bc3f02ca9f779eabf16a dd9f218eb91fb857f2a62fe023e1d64a4e7812fe 8a028c7c77f6c7bd6d63bc3f02ca9f779eabf16a $ tail a/.hg/shamap 8a028c7c77f6c7bd6d63bc3f02ca9f779eabf16a 86f3f774ffb682bffb5dc3c1d3b3da637cb9a0d6 $ tail b/.hg/shamap 8a028c7c77f6c7bd6d63bc3f02ca9f779eabf16a dd9f218eb91fb857f2a62fe023e1d64a4e7812fe $ hg convert a 0 scanning source... sorting... converting... 0 a $ hg convert b 0 scanning source... sorting... converting... 0 b $ hg -R 0 log -G o changeset: 2:637fbbbe96b6 | tag: tip | parent: 0:8a028c7c77f6 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: b | | o changeset: 1:ec7b9c96e692 |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: a | @ changeset: 0:8a028c7c77f6 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 0 $ hg convert --filemap filemap-b 0 a --config convert.hg.revs=1:: scanning source... sorting... converting... $ hg -R 0 up -r1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo f >> 0/f $ hg -R 0 ci -mx $ hg convert --filemap filemap-b 0 a --config convert.hg.revs=1:: scanning source... sorting... converting... 0 x $ hg -R a log -G -T '{rev} {desc|firstline} ({files})\n' o 2 x (f) | @ 1 a (f) | o 0 0 (a-only f) $ hg -R a mani -r tip a-only f An additional round, demonstrating that unchanged files don't get converted $ echo f >> 0/f $ echo f >> 0/a-only $ hg -R 0 ci -m "extra f+a-only change" $ hg convert --filemap filemap-b 0 a --config convert.hg.revs=1:: scanning source... sorting... converting... 0 extra f+a-only change $ hg -R a log -G -T '{rev} {desc|firstline} ({files})\n' o 3 extra f+a-only change (f) | o 2 x (f) | @ 1 a (f) | o 0 0 (a-only f) Conversion after rollback $ hg -R a rollback -f repository tip rolled back to revision 2 (undo convert) $ hg convert --filemap filemap-b 0 a --config convert.hg.revs=1:: scanning source... sorting... converting... 0 extra f+a-only change $ hg -R a log -G -T '{rev} {desc|firstline} ({files})\n' o 3 extra f+a-only change (f) | o 2 x (f) | @ 1 a (f) | o 0 0 (a-only f) Convert with --full adds and removes files that didn't change $ echo f >> 0/f $ hg -R 0 ci -m "f" $ hg convert --filemap filemap-b --full 0 a --config convert.hg.revs=1:: scanning source... sorting... converting... 0 f $ hg -R a status --change tip M f A b-only R a-only mercurial-4.5.3/tests/test-rename-dir-merge.t0000644015407300116100000001512313261161234021023 0ustar augieeng00000000000000 $ hg init t $ cd t $ mkdir a $ echo foo > a/a $ echo bar > a/b $ hg ci -Am "0" adding a/a adding a/b $ hg co -C 0 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg mv a b moving a/a to b/a moving a/b to b/b $ hg ci -m "1 mv a/ b/" $ hg co -C 0 2 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo baz > a/c $ echo quux > a/d $ hg add a/c $ hg ci -m "2 add a/c" created new head $ hg merge --debug 1 searching for copies back to rev 1 unmatched files in local: a/c unmatched files in other: b/a b/b all copies found (* = to merge, ! = divergent, % = renamed and deleted): src: 'a/a' -> dst: 'b/a' src: 'a/b' -> dst: 'b/b' checking for directory renames discovered dir src: 'a/' -> dst: 'b/' pending file src: 'a/c' -> dst: 'b/c' resolving manifests branchmerge: True, force: False, partial: False ancestor: f9b20c0d4c51, local: ce36d17b18fb+, remote: 397f8b00a740 a/a: other deleted -> r removing a/a a/b: other deleted -> r removing a/b b/a: remote created -> g getting b/a b/b: remote created -> g getting b/b b/c: remote directory rename - move from a/c -> dm moving a/c to b/c 3 files updated, 0 files merged, 2 files removed, 0 files unresolved (branch merge, don't forget to commit) $ echo a/* b/* a/d b/a b/b b/c $ hg st -C M b/a M b/b A b/c a/c R a/a R a/b R a/c ? a/d $ hg ci -m "3 merge 2+1" $ hg debugrename b/c b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88 $ hg co -C 1 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg merge --debug 2 searching for copies back to rev 1 unmatched files in local: b/a b/b unmatched files in other: a/c all copies found (* = to merge, ! = divergent, % = renamed and deleted): src: 'a/a' -> dst: 'b/a' src: 'a/b' -> dst: 'b/b' checking for directory renames discovered dir src: 'a/' -> dst: 'b/' pending file src: 'a/c' -> dst: 'b/c' resolving manifests branchmerge: True, force: False, partial: False ancestor: f9b20c0d4c51, local: 397f8b00a740+, remote: ce36d17b18fb starting 4 threads for background file closing (?) b/c: local directory rename - get from a/c -> dg getting a/c to b/c 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ echo a/* b/* a/d b/a b/b b/c $ hg st -C A b/c a/c ? a/d $ hg ci -m "4 merge 1+2" created new head $ hg debugrename b/c b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88 Local directory rename with conflicting file added in remote source directory and untracked in local target directory. $ hg co -qC 1 $ echo target > b/c $ hg merge 2 b/c: untracked file differs abort: untracked files in working directory differ from files in requested revision [255] $ cat b/c target but it should succeed if the content matches $ hg cat -r 2 a/c > b/c $ hg merge 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg st -C A b/c a/c ? a/d Local directory rename with conflicting file added in remote source directory and committed in local target directory. $ hg co -qC 1 $ echo target > b/c $ hg add b/c $ hg commit -qm 'new file in target directory' $ hg merge 2 merging b/c and a/c to b/c warning: conflicts while merging b/c! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ hg st -A M b/c a/c ? a/d ? b/c.orig C b/a C b/b $ cat b/c <<<<<<< working copy: f1c50ca4f127 - test: new file in target directory target ======= baz >>>>>>> merge rev: ce36d17b18fb - test: 2 add a/c $ rm b/c.orig Remote directory rename with conflicting file added in remote target directory and committed in local source directory. $ hg co -qC 2 $ hg st -A ? a/d C a/a C a/b C a/c $ hg merge 5 merging a/c and b/c to b/c warning: conflicts while merging b/c! (edit, then use 'hg resolve --mark') 2 files updated, 0 files merged, 2 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ hg st -A M b/a M b/b M b/c a/c R a/a R a/b R a/c ? a/d ? b/c.orig $ cat b/c <<<<<<< working copy: ce36d17b18fb - test: 2 add a/c baz ======= target >>>>>>> merge rev: f1c50ca4f127 - test: new file in target directory Second scenario with two repos: $ cd .. $ hg init r1 $ cd r1 $ mkdir a $ echo foo > a/f $ hg add a adding a/f $ hg ci -m "a/f == foo" $ cd .. $ hg clone r1 r2 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd r2 $ hg mv a b moving a/f to b/f $ echo foo1 > b/f $ hg ci -m" a -> b, b/f == foo1" $ cd .. $ cd r1 $ mkdir a/aa $ echo bar > a/aa/g $ hg add a/aa adding a/aa/g $ hg ci -m "a/aa/g" $ hg pull ../r2 pulling from ../r2 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 7d51ed18da25 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg merge 2 files updated, 0 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg st -C M b/f A b/aa/g a/aa/g R a/aa/g R a/f $ cd .. Test renames to separate directories $ hg init a $ cd a $ mkdir a $ touch a/s $ touch a/t $ hg ci -Am0 adding a/s adding a/t Add more files $ touch a/s2 $ touch a/t2 $ hg ci -Am1 adding a/s2 adding a/t2 Do moves on a branch $ hg up 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ mkdir s $ mkdir t $ hg mv a/s s $ hg mv a/t t $ hg ci -Am2 created new head $ hg st --copies --change . A s/s a/s A t/t a/t R a/s R a/t Merge shouldn't move s2, t2 $ hg merge 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg st --copies M a/s2 M a/t2 Try the merge in the other direction. It may or may not be appropriate for status to list copies here. $ hg up -C 1 4 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg merge 2 files updated, 0 files merged, 2 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg st --copies M s/s M t/t R a/s R a/t mercurial-4.5.3/tests/test-revlog.t0000644015407300116100000000252213261161234017200 0ustar augieeng00000000000000 $ hg init empty-repo $ cd empty-repo Flags on revlog version 0 are rejected >>> with open('.hg/store/00changelog.i', 'wb') as fh: ... fh.write('\x00\x01\x00\x00') $ hg log abort: unknown flags (0x01) in version 0 revlog 00changelog.i! [255] Unknown flags on revlog version 1 are rejected >>> with open('.hg/store/00changelog.i', 'wb') as fh: ... fh.write('\x00\x04\x00\x01') $ hg log abort: unknown flags (0x04) in version 1 revlog 00changelog.i! [255] Unknown version is rejected >>> with open('.hg/store/00changelog.i', 'wb') as fh: ... fh.write('\x00\x00\x00\x02') $ hg log abort: unknown version (2) in revlog 00changelog.i! [255] $ cd .. Test for CVE-2016-3630 $ hg init >>> open("a.i", "w").write( ... """eJxjYGZgZIAAYQYGxhgom+k/FMx8YKx9ZUaKSOyqo4cnuKb8mbqHV5cBCVTMWb1Cwqkhe4Gsg9AD ... Joa3dYtcYYYBAQ8Qr4OqZAYRICPTSr5WKd/42rV36d+8/VmrNpv7NP1jQAXrQE4BqQUARngwVA==""" ... .decode("base64").decode("zlib")) $ hg debugindex a.i rev offset length delta linkrev nodeid p1 p2 0 0 19 -1 2 99e0332bd498 000000000000 000000000000 1 19 12 0 3 6674f57a23d8 99e0332bd498 000000000000 $ hg debugdata a.i 1 2>&1 | egrep 'Error:.*decoded' (mercurial\.\w+\.mpatch\.)?mpatchError: patch cannot be decoded (re) mercurial-4.5.3/tests/test-command-template.t0000644015407300116100000035576213261161234021152 0ustar augieeng00000000000000 $ hg init a $ cd a $ echo a > a $ hg add a $ echo line 1 > b $ echo line 2 >> b $ hg commit -l b -d '1000000 0' -u 'User Name ' $ hg add b $ echo other 1 > c $ echo other 2 >> c $ echo >> c $ echo other 3 >> c $ hg commit -l c -d '1100000 0' -u 'A. N. Other ' $ hg add c $ hg commit -m 'no person' -d '1200000 0' -u 'other@place' $ echo c >> c $ hg commit -m 'no user, no domain' -d '1300000 0' -u 'person' $ echo foo > .hg/branch $ hg commit -m 'new branch' -d '1400000 0' -u 'person' $ hg co -q 3 $ echo other 4 >> d $ hg add d $ hg commit -m 'new head' -d '1500000 0' -u 'person' $ hg merge -q foo $ hg commit -m 'merge' -d '1500001 0' -u 'person' Test arithmetic operators have the right precedence: $ hg log -l 1 -T '{date(date, "%Y") + 5 * 10} {date(date, "%Y") - 2 * 3}\n' 2020 1964 $ hg log -l 1 -T '{date(date, "%Y") * 5 + 10} {date(date, "%Y") * 3 - 2}\n' 9860 5908 Test division: $ hg debugtemplate -r0 -v '{5 / 2} {mod(5, 2)}\n' (template (/ (integer '5') (integer '2')) (string ' ') (func (symbol 'mod') (list (integer '5') (integer '2'))) (string '\n')) 2 1 $ hg debugtemplate -r0 -v '{5 / -2} {mod(5, -2)}\n' (template (/ (integer '5') (negate (integer '2'))) (string ' ') (func (symbol 'mod') (list (integer '5') (negate (integer '2')))) (string '\n')) -3 -1 $ hg debugtemplate -r0 -v '{-5 / 2} {mod(-5, 2)}\n' (template (/ (negate (integer '5')) (integer '2')) (string ' ') (func (symbol 'mod') (list (negate (integer '5')) (integer '2'))) (string '\n')) -3 1 $ hg debugtemplate -r0 -v '{-5 / -2} {mod(-5, -2)}\n' (template (/ (negate (integer '5')) (negate (integer '2'))) (string ' ') (func (symbol 'mod') (list (negate (integer '5')) (negate (integer '2')))) (string '\n')) 2 -1 Filters bind closer than arithmetic: $ hg debugtemplate -r0 -v '{revset(".")|count - 1}\n' (template (- (| (func (symbol 'revset') (string '.')) (symbol 'count')) (integer '1')) (string '\n')) 0 But negate binds closer still: $ hg debugtemplate -r0 -v '{1-3|stringify}\n' (template (- (integer '1') (| (integer '3') (symbol 'stringify'))) (string '\n')) hg: parse error: arithmetic only defined on integers [255] $ hg debugtemplate -r0 -v '{-3|stringify}\n' (template (| (negate (integer '3')) (symbol 'stringify')) (string '\n')) -3 Filters bind as close as map operator: $ hg debugtemplate -r0 -v '{desc|splitlines % "{line}\n"}' (template (% (| (symbol 'desc') (symbol 'splitlines')) (template (symbol 'line') (string '\n')))) line 1 line 2 Keyword arguments: $ hg debugtemplate -r0 -v '{foo=bar|baz}' (template (keyvalue (symbol 'foo') (| (symbol 'bar') (symbol 'baz')))) hg: parse error: can't use a key-value pair in this context [255] $ hg debugtemplate '{pad("foo", width=10, left=true)}\n' foo Call function which takes named arguments by filter syntax: $ hg debugtemplate '{" "|separate}' $ hg debugtemplate '{("not", "an", "argument", "list")|separate}' hg: parse error: unknown method 'list' [255] Second branch starting at nullrev: $ hg update null 0 files updated, 0 files merged, 4 files removed, 0 files unresolved $ echo second > second $ hg add second $ hg commit -m second -d '1000000 0' -u 'User Name ' created new head $ echo third > third $ hg add third $ hg mv second fourth $ hg commit -m third -d "2020-01-01 10:01" $ hg log --template '{join(file_copies, ",\n")}\n' -r . fourth (second) $ hg log -T '{file_copies % "{source} -> {name}\n"}' -r . second -> fourth $ hg log -T '{rev} {ifcontains("fourth", file_copies, "t", "f")}\n' -r .:7 8 t 7 f Working-directory revision has special identifiers, though they are still experimental: $ hg log -r 'wdir()' -T '{rev}:{node}\n' 2147483647:ffffffffffffffffffffffffffffffffffffffff Some keywords are invalid for working-directory revision, but they should never cause crash: $ hg log -r 'wdir()' -T '{manifest}\n' Internal resources shouldn't be exposed (issue5699): $ hg log -r. -T '{cache}{ctx}{repo}{revcache}{templ}{ui}' Never crash on internal resource not available: $ hg --cwd .. debugtemplate '{"c0bebeef"|shortest}\n' abort: template resource not available: ctx [255] Quoting for ui.logtemplate $ hg tip --config "ui.logtemplate={rev}\n" 8 $ hg tip --config "ui.logtemplate='{rev}\n'" 8 $ hg tip --config 'ui.logtemplate="{rev}\n"' 8 $ hg tip --config 'ui.logtemplate=n{rev}\n' n8 Make sure user/global hgrc does not affect tests $ echo '[ui]' > .hg/hgrc $ echo 'logtemplate =' >> .hg/hgrc $ echo 'style =' >> .hg/hgrc Add some simple styles to settings $ cat <<'EOF' >> .hg/hgrc > [templates] > simple = "{rev}\n" > simple2 = {rev}\n > rev = "should not precede {rev} keyword\n" > EOF $ hg log -l1 -Tsimple 8 $ hg log -l1 -Tsimple2 8 $ hg log -l1 -Trev should not precede 8 keyword $ hg log -l1 -T '{simple}' 8 Map file shouldn't see user templates: $ cat < tmpl > changeset = 'nothing expanded:{simple}\n' > EOF $ hg log -l1 --style ./tmpl nothing expanded: Test templates and style maps in files: $ echo "{rev}" > tmpl $ hg log -l1 -T./tmpl 8 $ hg log -l1 -Tblah/blah blah/blah (no-eol) $ printf 'changeset = "{rev}\\n"\n' > map-simple $ hg log -l1 -T./map-simple 8 a map file may have [templates] and [templatealias] sections: $ cat <<'EOF' > map-simple > [templates] > changeset = "{a}\n" > [templatealias] > a = rev > EOF $ hg log -l1 -T./map-simple 8 so it can be included in hgrc $ cat <<'EOF' > myhgrc > %include map-simple > [templates] > foo = "{changeset}" > EOF $ HGRCPATH=./myhgrc hg log -l1 -Tfoo 8 $ HGRCPATH=./myhgrc hg log -l1 -T'{a}\n' 8 Test template map inheritance $ echo "__base__ = map-cmdline.default" > map-simple $ printf 'cset = "changeset: ***{rev}***\\n"\n' >> map-simple $ hg log -l1 -T./map-simple changeset: ***8*** tag: tip user: test date: Wed Jan 01 10:01:00 2020 +0000 summary: third Test docheader, docfooter and separator in template map $ cat <<'EOF' > map-myjson > docheader = '\{\n' > docfooter = '\n}\n' > separator = ',\n' > changeset = ' {dict(rev, node|short)|json}' > EOF $ hg log -l2 -T./map-myjson { {"node": "95c24699272e", "rev": 8}, {"node": "29114dbae42b", "rev": 7} } Test docheader, docfooter and separator in [templates] section $ cat <<'EOF' >> .hg/hgrc > [templates] > myjson = ' {dict(rev, node|short)|json}' > myjson:docheader = '\{\n' > myjson:docfooter = '\n}\n' > myjson:separator = ',\n' > :docheader = 'should not be selected as a docheader for literal templates\n' > EOF $ hg log -l2 -Tmyjson { {"node": "95c24699272e", "rev": 8}, {"node": "29114dbae42b", "rev": 7} } $ hg log -l1 -T'{rev}\n' 8 Template should precede style option $ hg log -l1 --style default -T '{rev}\n' 8 Add a commit with empty description, to ensure that the templates below will omit the description line. $ echo c >> c $ hg add c $ hg commit -qm ' ' Default style is like normal output. Phases style should be the same as default style, except for extra phase lines. $ hg log > log.out $ hg log --style default > style.out $ cmp log.out style.out || diff -u log.out style.out $ hg log -T phases > phases.out $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@' +phase: draft +phase: draft +phase: draft +phase: draft +phase: draft +phase: draft +phase: draft +phase: draft +phase: draft +phase: draft $ hg log -v > log.out $ hg log -v --style default > style.out $ cmp log.out style.out || diff -u log.out style.out $ hg log -v -T phases > phases.out $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@' +phase: draft +phase: draft +phase: draft +phase: draft +phase: draft +phase: draft +phase: draft +phase: draft +phase: draft +phase: draft $ hg log -q > log.out $ hg log -q --style default > style.out $ cmp log.out style.out || diff -u log.out style.out $ hg log -q -T phases > phases.out $ cmp log.out phases.out || diff -u log.out phases.out $ hg log --debug > log.out $ hg log --debug --style default > style.out $ cmp log.out style.out || diff -u log.out style.out $ hg log --debug -T phases > phases.out $ cmp log.out phases.out || diff -u log.out phases.out Default style of working-directory revision should also be the same (but date may change while running tests): $ hg log -r 'wdir()' | sed 's|^date:.*|date:|' > log.out $ hg log -r 'wdir()' --style default | sed 's|^date:.*|date:|' > style.out $ cmp log.out style.out || diff -u log.out style.out $ hg log -r 'wdir()' -v | sed 's|^date:.*|date:|' > log.out $ hg log -r 'wdir()' -v --style default | sed 's|^date:.*|date:|' > style.out $ cmp log.out style.out || diff -u log.out style.out $ hg log -r 'wdir()' -q > log.out $ hg log -r 'wdir()' -q --style default > style.out $ cmp log.out style.out || diff -u log.out style.out $ hg log -r 'wdir()' --debug | sed 's|^date:.*|date:|' > log.out $ hg log -r 'wdir()' --debug --style default \ > | sed 's|^date:.*|date:|' > style.out $ cmp log.out style.out || diff -u log.out style.out Default style should also preserve color information (issue2866): $ cp $HGRCPATH $HGRCPATH-bak $ cat <> $HGRCPATH > [extensions] > color= > EOF $ hg --color=debug log > log.out $ hg --color=debug log --style default > style.out $ cmp log.out style.out || diff -u log.out style.out $ hg --color=debug log -T phases > phases.out $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@' +[log.phase|phase: draft] +[log.phase|phase: draft] +[log.phase|phase: draft] +[log.phase|phase: draft] +[log.phase|phase: draft] +[log.phase|phase: draft] +[log.phase|phase: draft] +[log.phase|phase: draft] +[log.phase|phase: draft] +[log.phase|phase: draft] $ hg --color=debug -v log > log.out $ hg --color=debug -v log --style default > style.out $ cmp log.out style.out || diff -u log.out style.out $ hg --color=debug -v log -T phases > phases.out $ diff -U 0 log.out phases.out | egrep -v '^---|^\+\+\+|^@@' +[log.phase|phase: draft] +[log.phase|phase: draft] +[log.phase|phase: draft] +[log.phase|phase: draft] +[log.phase|phase: draft] +[log.phase|phase: draft] +[log.phase|phase: draft] +[log.phase|phase: draft] +[log.phase|phase: draft] +[log.phase|phase: draft] $ hg --color=debug -q log > log.out $ hg --color=debug -q log --style default > style.out $ cmp log.out style.out || diff -u log.out style.out $ hg --color=debug -q log -T phases > phases.out $ cmp log.out phases.out || diff -u log.out phases.out $ hg --color=debug --debug log > log.out $ hg --color=debug --debug log --style default > style.out $ cmp log.out style.out || diff -u log.out style.out $ hg --color=debug --debug log -T phases > phases.out $ cmp log.out phases.out || diff -u log.out phases.out $ mv $HGRCPATH-bak $HGRCPATH Remove commit with empty commit message, so as to not pollute further tests. $ hg --config extensions.strip= strip -q . Revision with no copies (used to print a traceback): $ hg tip -v --template '\n' Compact style works: $ hg log -Tcompact 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test third 7:-1 29114dbae42b 1970-01-12 13:46 +0000 user second 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person merge 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person new head 4 bbe44766e73d 1970-01-17 04:53 +0000 person new branch 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person no user, no domain 2 97054abb4ab8 1970-01-14 21:20 +0000 other no person 1 b608e9d1a3f0 1970-01-13 17:33 +0000 other other 1 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 user line 1 $ hg log -v --style compact 8[tip] 95c24699272e 2020-01-01 10:01 +0000 test third 7:-1 29114dbae42b 1970-01-12 13:46 +0000 User Name second 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person merge 5:3 13207e5a10d9 1970-01-18 08:40 +0000 person new head 4 bbe44766e73d 1970-01-17 04:53 +0000 person new branch 3 10e46f2dcbf4 1970-01-16 01:06 +0000 person no user, no domain 2 97054abb4ab8 1970-01-14 21:20 +0000 other@place no person 1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other other 1 other 2 other 3 0 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name line 1 line 2 $ hg log --debug --style compact 8[tip]:7,-1 95c24699272e 2020-01-01 10:01 +0000 test third 7:-1,-1 29114dbae42b 1970-01-12 13:46 +0000 User Name second 6:5,4 d41e714fe50d 1970-01-18 08:40 +0000 person merge 5:3,-1 13207e5a10d9 1970-01-18 08:40 +0000 person new head 4:3,-1 bbe44766e73d 1970-01-17 04:53 +0000 person new branch 3:2,-1 10e46f2dcbf4 1970-01-16 01:06 +0000 person no user, no domain 2:1,-1 97054abb4ab8 1970-01-14 21:20 +0000 other@place no person 1:0,-1 b608e9d1a3f0 1970-01-13 17:33 +0000 A. N. Other other 1 other 2 other 3 0:-1,-1 1e4e1b8f71e0 1970-01-12 13:46 +0000 User Name line 1 line 2 Test xml styles: $ hg log --style xml -r 'not all()' $ hg log --style xml tip test 2020-01-01T10:01:00+00:00 third User Name 1970-01-12T13:46:40+00:00 second person 1970-01-18T08:40:01+00:00 merge person 1970-01-18T08:40:00+00:00 new head foo person 1970-01-17T04:53:20+00:00 new branch person 1970-01-16T01:06:40+00:00 no user, no domain other 1970-01-14T21:20:00+00:00 no person A. N. Other 1970-01-13T17:33:20+00:00 other 1 other 2 other 3 User Name 1970-01-12T13:46:40+00:00 line 1 line 2 $ hg log -v --style xml tip test 2020-01-01T10:01:00+00:00 third fourth third second fourth User Name 1970-01-12T13:46:40+00:00 second second person 1970-01-18T08:40:01+00:00 merge person 1970-01-18T08:40:00+00:00 new head d foo person 1970-01-17T04:53:20+00:00 new branch person 1970-01-16T01:06:40+00:00 no user, no domain c other 1970-01-14T21:20:00+00:00 no person c A. N. Other 1970-01-13T17:33:20+00:00 other 1 other 2 other 3 b User Name 1970-01-12T13:46:40+00:00 line 1 line 2 a $ hg log --debug --style xml tip test 2020-01-01T10:01:00+00:00 third fourth third second fourth default User Name 1970-01-12T13:46:40+00:00 second second default person 1970-01-18T08:40:01+00:00 merge default person 1970-01-18T08:40:00+00:00 new head d default foo person 1970-01-17T04:53:20+00:00 new branch foo person 1970-01-16T01:06:40+00:00 no user, no domain c default other 1970-01-14T21:20:00+00:00 no person c default A. N. Other 1970-01-13T17:33:20+00:00 other 1 other 2 other 3 b default User Name 1970-01-12T13:46:40+00:00 line 1 line 2 a default Test JSON style: $ hg log -k nosuch -Tjson [] $ hg log -qr . -Tjson [ { "rev": 8, "node": "95c24699272ef57d062b8bccc32c878bf841784a" } ] $ hg log -vpr . -Tjson --stat [ { "rev": 8, "node": "95c24699272ef57d062b8bccc32c878bf841784a", "branch": "default", "phase": "draft", "user": "test", "date": [1577872860, 0], "desc": "third", "bookmarks": [], "tags": ["tip"], "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"], "files": ["fourth", "second", "third"], "diffstat": " fourth | 1 +\n second | 1 -\n third | 1 +\n 3 files changed, 2 insertions(+), 1 deletions(-)\n", "diff": "diff -r 29114dbae42b -r 95c24699272e fourth\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/fourth\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+second\ndiff -r 29114dbae42b -r 95c24699272e second\n--- a/second\tMon Jan 12 13:46:40 1970 +0000\n+++ /dev/null\tThu Jan 01 00:00:00 1970 +0000\n@@ -1,1 +0,0 @@\n-second\ndiff -r 29114dbae42b -r 95c24699272e third\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/third\tWed Jan 01 10:01:00 2020 +0000\n@@ -0,0 +1,1 @@\n+third\n" } ] honor --git but not format-breaking diffopts $ hg --config diff.noprefix=True log --git -vpr . -Tjson [ { "rev": 8, "node": "95c24699272ef57d062b8bccc32c878bf841784a", "branch": "default", "phase": "draft", "user": "test", "date": [1577872860, 0], "desc": "third", "bookmarks": [], "tags": ["tip"], "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"], "files": ["fourth", "second", "third"], "diff": "diff --git a/second b/fourth\nrename from second\nrename to fourth\ndiff --git a/third b/third\nnew file mode 100644\n--- /dev/null\n+++ b/third\n@@ -0,0 +1,1 @@\n+third\n" } ] $ hg log -T json [ { "rev": 8, "node": "95c24699272ef57d062b8bccc32c878bf841784a", "branch": "default", "phase": "draft", "user": "test", "date": [1577872860, 0], "desc": "third", "bookmarks": [], "tags": ["tip"], "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"] }, { "rev": 7, "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453", "branch": "default", "phase": "draft", "user": "User Name ", "date": [1000000, 0], "desc": "second", "bookmarks": [], "tags": [], "parents": ["0000000000000000000000000000000000000000"] }, { "rev": 6, "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b", "branch": "default", "phase": "draft", "user": "person", "date": [1500001, 0], "desc": "merge", "bookmarks": [], "tags": [], "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"] }, { "rev": 5, "node": "13207e5a10d9fd28ec424934298e176197f2c67f", "branch": "default", "phase": "draft", "user": "person", "date": [1500000, 0], "desc": "new head", "bookmarks": [], "tags": [], "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"] }, { "rev": 4, "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74", "branch": "foo", "phase": "draft", "user": "person", "date": [1400000, 0], "desc": "new branch", "bookmarks": [], "tags": [], "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"] }, { "rev": 3, "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47", "branch": "default", "phase": "draft", "user": "person", "date": [1300000, 0], "desc": "no user, no domain", "bookmarks": [], "tags": [], "parents": ["97054abb4ab824450e9164180baf491ae0078465"] }, { "rev": 2, "node": "97054abb4ab824450e9164180baf491ae0078465", "branch": "default", "phase": "draft", "user": "other@place", "date": [1200000, 0], "desc": "no person", "bookmarks": [], "tags": [], "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"] }, { "rev": 1, "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965", "branch": "default", "phase": "draft", "user": "A. N. Other ", "date": [1100000, 0], "desc": "other 1\nother 2\n\nother 3", "bookmarks": [], "tags": [], "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"] }, { "rev": 0, "node": "1e4e1b8f71e05681d422154f5421e385fec3454f", "branch": "default", "phase": "draft", "user": "User Name ", "date": [1000000, 0], "desc": "line 1\nline 2", "bookmarks": [], "tags": [], "parents": ["0000000000000000000000000000000000000000"] } ] $ hg heads -v -Tjson [ { "rev": 8, "node": "95c24699272ef57d062b8bccc32c878bf841784a", "branch": "default", "phase": "draft", "user": "test", "date": [1577872860, 0], "desc": "third", "bookmarks": [], "tags": ["tip"], "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"], "files": ["fourth", "second", "third"] }, { "rev": 6, "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b", "branch": "default", "phase": "draft", "user": "person", "date": [1500001, 0], "desc": "merge", "bookmarks": [], "tags": [], "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"], "files": [] }, { "rev": 4, "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74", "branch": "foo", "phase": "draft", "user": "person", "date": [1400000, 0], "desc": "new branch", "bookmarks": [], "tags": [], "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"], "files": [] } ] $ hg log --debug -Tjson [ { "rev": 8, "node": "95c24699272ef57d062b8bccc32c878bf841784a", "branch": "default", "phase": "draft", "user": "test", "date": [1577872860, 0], "desc": "third", "bookmarks": [], "tags": ["tip"], "parents": ["29114dbae42b9f078cf2714dbe3a86bba8ec7453"], "manifest": "94961b75a2da554b4df6fb599e5bfc7d48de0c64", "extra": {"branch": "default"}, "modified": [], "added": ["fourth", "third"], "removed": ["second"] }, { "rev": 7, "node": "29114dbae42b9f078cf2714dbe3a86bba8ec7453", "branch": "default", "phase": "draft", "user": "User Name ", "date": [1000000, 0], "desc": "second", "bookmarks": [], "tags": [], "parents": ["0000000000000000000000000000000000000000"], "manifest": "f2dbc354b94e5ec0b4f10680ee0cee816101d0bf", "extra": {"branch": "default"}, "modified": [], "added": ["second"], "removed": [] }, { "rev": 6, "node": "d41e714fe50d9e4a5f11b4d595d543481b5f980b", "branch": "default", "phase": "draft", "user": "person", "date": [1500001, 0], "desc": "merge", "bookmarks": [], "tags": [], "parents": ["13207e5a10d9fd28ec424934298e176197f2c67f", "bbe44766e73d5f11ed2177f1838de10c53ef3e74"], "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216", "extra": {"branch": "default"}, "modified": [], "added": [], "removed": [] }, { "rev": 5, "node": "13207e5a10d9fd28ec424934298e176197f2c67f", "branch": "default", "phase": "draft", "user": "person", "date": [1500000, 0], "desc": "new head", "bookmarks": [], "tags": [], "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"], "manifest": "4dc3def4f9b4c6e8de820f6ee74737f91e96a216", "extra": {"branch": "default"}, "modified": [], "added": ["d"], "removed": [] }, { "rev": 4, "node": "bbe44766e73d5f11ed2177f1838de10c53ef3e74", "branch": "foo", "phase": "draft", "user": "person", "date": [1400000, 0], "desc": "new branch", "bookmarks": [], "tags": [], "parents": ["10e46f2dcbf4823578cf180f33ecf0b957964c47"], "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc", "extra": {"branch": "foo"}, "modified": [], "added": [], "removed": [] }, { "rev": 3, "node": "10e46f2dcbf4823578cf180f33ecf0b957964c47", "branch": "default", "phase": "draft", "user": "person", "date": [1300000, 0], "desc": "no user, no domain", "bookmarks": [], "tags": [], "parents": ["97054abb4ab824450e9164180baf491ae0078465"], "manifest": "cb5a1327723bada42f117e4c55a303246eaf9ccc", "extra": {"branch": "default"}, "modified": ["c"], "added": [], "removed": [] }, { "rev": 2, "node": "97054abb4ab824450e9164180baf491ae0078465", "branch": "default", "phase": "draft", "user": "other@place", "date": [1200000, 0], "desc": "no person", "bookmarks": [], "tags": [], "parents": ["b608e9d1a3f0273ccf70fb85fd6866b3482bf965"], "manifest": "6e0e82995c35d0d57a52aca8da4e56139e06b4b1", "extra": {"branch": "default"}, "modified": [], "added": ["c"], "removed": [] }, { "rev": 1, "node": "b608e9d1a3f0273ccf70fb85fd6866b3482bf965", "branch": "default", "phase": "draft", "user": "A. N. Other ", "date": [1100000, 0], "desc": "other 1\nother 2\n\nother 3", "bookmarks": [], "tags": [], "parents": ["1e4e1b8f71e05681d422154f5421e385fec3454f"], "manifest": "4e8d705b1e53e3f9375e0e60dc7b525d8211fe55", "extra": {"branch": "default"}, "modified": [], "added": ["b"], "removed": [] }, { "rev": 0, "node": "1e4e1b8f71e05681d422154f5421e385fec3454f", "branch": "default", "phase": "draft", "user": "User Name ", "date": [1000000, 0], "desc": "line 1\nline 2", "bookmarks": [], "tags": [], "parents": ["0000000000000000000000000000000000000000"], "manifest": "a0c8bcbbb45c63b90b70ad007bf38961f64f2af0", "extra": {"branch": "default"}, "modified": [], "added": ["a"], "removed": [] } ] Error if style not readable: #if unix-permissions no-root $ touch q $ chmod 0 q $ hg log --style ./q abort: Permission denied: ./q [255] #endif Error if no style: $ hg log --style notexist abort: style 'notexist' not found (available styles: bisect, changelog, compact, default, phases, show, status, xml) [255] $ hg log -T list available styles: bisect, changelog, compact, default, phases, show, status, xml abort: specify a template [255] Error if style missing key: $ echo 'q = q' > t $ hg log --style ./t abort: "changeset" not in template map [255] Error if style missing value: $ echo 'changeset =' > t $ hg log --style t hg: parse error at t:1: missing value [255] Error if include fails: $ echo 'changeset = q' >> t #if unix-permissions no-root $ hg log --style ./t abort: template file ./q: Permission denied [255] $ rm -f q #endif Include works: $ echo '{rev}' > q $ hg log --style ./t 8 7 6 5 4 3 2 1 0 Check that recursive reference does not fall into RuntimeError (issue4758): common mistake: $ cat << EOF > issue4758 > changeset = '{changeset}\n' > EOF $ hg log --style ./issue4758 abort: recursive reference 'changeset' in template [255] circular reference: $ cat << EOF > issue4758 > changeset = '{foo}' > foo = '{changeset}' > EOF $ hg log --style ./issue4758 abort: recursive reference 'foo' in template [255] buildmap() -> gettemplate(), where no thunk was made: $ cat << EOF > issue4758 > changeset = '{files % changeset}\n' > EOF $ hg log --style ./issue4758 abort: recursive reference 'changeset' in template [255] not a recursion if a keyword of the same name exists: $ cat << EOF > issue4758 > changeset = '{tags % rev}' > rev = '{rev} {tag}\n' > EOF $ hg log --style ./issue4758 -r tip 8 tip Check that {phase} works correctly on parents: $ cat << EOF > parentphase > changeset_debug = '{rev} ({phase}):{parents}\n' > parent = ' {rev} ({phase})' > EOF $ hg phase -r 5 --public $ hg phase -r 7 --secret --force $ hg log --debug -G --style ./parentphase @ 8 (secret): 7 (secret) -1 (public) | o 7 (secret): -1 (public) -1 (public) o 6 (draft): 5 (public) 4 (draft) |\ | o 5 (public): 3 (public) -1 (public) | | o | 4 (draft): 3 (public) -1 (public) |/ o 3 (public): 2 (public) -1 (public) | o 2 (public): 1 (public) -1 (public) | o 1 (public): 0 (public) -1 (public) | o 0 (public): -1 (public) -1 (public) Missing non-standard names give no error (backward compatibility): $ echo "changeset = '{c}'" > t $ hg log --style ./t Defining non-standard name works: $ cat < t > changeset = '{c}' > c = q > EOF $ hg log --style ./t 8 7 6 5 4 3 2 1 0 ui.style works: $ echo '[ui]' > .hg/hgrc $ echo 'style = t' >> .hg/hgrc $ hg log 8 7 6 5 4 3 2 1 0 Issue338: $ hg log --style=changelog > changelog $ cat changelog 2020-01-01 test * fourth, second, third: third [95c24699272e] [tip] 1970-01-12 User Name * second: second [29114dbae42b] 1970-01-18 person * merge [d41e714fe50d] * d: new head [13207e5a10d9] 1970-01-17 person * new branch [bbe44766e73d] 1970-01-16 person * c: no user, no domain [10e46f2dcbf4] 1970-01-14 other * c: no person [97054abb4ab8] 1970-01-13 A. N. Other * b: other 1 other 2 other 3 [b608e9d1a3f0] 1970-01-12 User Name * a: line 1 line 2 [1e4e1b8f71e0] Issue2130: xml output for 'hg heads' is malformed $ hg heads --style changelog 2020-01-01 test * fourth, second, third: third [95c24699272e] [tip] 1970-01-18 person * merge [d41e714fe50d] 1970-01-17 person * new branch [bbe44766e73d] Keys work: $ for key in author branch branches date desc file_adds file_dels file_mods \ > file_copies file_copies_switch files \ > manifest node parents rev tags diffstat extras \ > p1rev p2rev p1node p2node; do > for mode in '' --verbose --debug; do > hg log $mode --template "$key$mode: {$key}\n" > done > done author: test author: User Name author: person author: person author: person author: person author: other@place author: A. N. Other author: User Name author--verbose: test author--verbose: User Name author--verbose: person author--verbose: person author--verbose: person author--verbose: person author--verbose: other@place author--verbose: A. N. Other author--verbose: User Name author--debug: test author--debug: User Name author--debug: person author--debug: person author--debug: person author--debug: person author--debug: other@place author--debug: A. N. Other author--debug: User Name branch: default branch: default branch: default branch: default branch: foo branch: default branch: default branch: default branch: default branch--verbose: default branch--verbose: default branch--verbose: default branch--verbose: default branch--verbose: foo branch--verbose: default branch--verbose: default branch--verbose: default branch--verbose: default branch--debug: default branch--debug: default branch--debug: default branch--debug: default branch--debug: foo branch--debug: default branch--debug: default branch--debug: default branch--debug: default branches: branches: branches: branches: branches: foo branches: branches: branches: branches: branches--verbose: branches--verbose: branches--verbose: branches--verbose: branches--verbose: foo branches--verbose: branches--verbose: branches--verbose: branches--verbose: branches--debug: branches--debug: branches--debug: branches--debug: branches--debug: foo branches--debug: branches--debug: branches--debug: branches--debug: date: 1577872860.00 date: 1000000.00 date: 1500001.00 date: 1500000.00 date: 1400000.00 date: 1300000.00 date: 1200000.00 date: 1100000.00 date: 1000000.00 date--verbose: 1577872860.00 date--verbose: 1000000.00 date--verbose: 1500001.00 date--verbose: 1500000.00 date--verbose: 1400000.00 date--verbose: 1300000.00 date--verbose: 1200000.00 date--verbose: 1100000.00 date--verbose: 1000000.00 date--debug: 1577872860.00 date--debug: 1000000.00 date--debug: 1500001.00 date--debug: 1500000.00 date--debug: 1400000.00 date--debug: 1300000.00 date--debug: 1200000.00 date--debug: 1100000.00 date--debug: 1000000.00 desc: third desc: second desc: merge desc: new head desc: new branch desc: no user, no domain desc: no person desc: other 1 other 2 other 3 desc: line 1 line 2 desc--verbose: third desc--verbose: second desc--verbose: merge desc--verbose: new head desc--verbose: new branch desc--verbose: no user, no domain desc--verbose: no person desc--verbose: other 1 other 2 other 3 desc--verbose: line 1 line 2 desc--debug: third desc--debug: second desc--debug: merge desc--debug: new head desc--debug: new branch desc--debug: no user, no domain desc--debug: no person desc--debug: other 1 other 2 other 3 desc--debug: line 1 line 2 file_adds: fourth third file_adds: second file_adds: file_adds: d file_adds: file_adds: file_adds: c file_adds: b file_adds: a file_adds--verbose: fourth third file_adds--verbose: second file_adds--verbose: file_adds--verbose: d file_adds--verbose: file_adds--verbose: file_adds--verbose: c file_adds--verbose: b file_adds--verbose: a file_adds--debug: fourth third file_adds--debug: second file_adds--debug: file_adds--debug: d file_adds--debug: file_adds--debug: file_adds--debug: c file_adds--debug: b file_adds--debug: a file_dels: second file_dels: file_dels: file_dels: file_dels: file_dels: file_dels: file_dels: file_dels: file_dels--verbose: second file_dels--verbose: file_dels--verbose: file_dels--verbose: file_dels--verbose: file_dels--verbose: file_dels--verbose: file_dels--verbose: file_dels--verbose: file_dels--debug: second file_dels--debug: file_dels--debug: file_dels--debug: file_dels--debug: file_dels--debug: file_dels--debug: file_dels--debug: file_dels--debug: file_mods: file_mods: file_mods: file_mods: file_mods: file_mods: c file_mods: file_mods: file_mods: file_mods--verbose: file_mods--verbose: file_mods--verbose: file_mods--verbose: file_mods--verbose: file_mods--verbose: c file_mods--verbose: file_mods--verbose: file_mods--verbose: file_mods--debug: file_mods--debug: file_mods--debug: file_mods--debug: file_mods--debug: file_mods--debug: c file_mods--debug: file_mods--debug: file_mods--debug: file_copies: fourth (second) file_copies: file_copies: file_copies: file_copies: file_copies: file_copies: file_copies: file_copies: file_copies--verbose: fourth (second) file_copies--verbose: file_copies--verbose: file_copies--verbose: file_copies--verbose: file_copies--verbose: file_copies--verbose: file_copies--verbose: file_copies--verbose: file_copies--debug: fourth (second) file_copies--debug: file_copies--debug: file_copies--debug: file_copies--debug: file_copies--debug: file_copies--debug: file_copies--debug: file_copies--debug: file_copies_switch: file_copies_switch: file_copies_switch: file_copies_switch: file_copies_switch: file_copies_switch: file_copies_switch: file_copies_switch: file_copies_switch: file_copies_switch--verbose: file_copies_switch--verbose: file_copies_switch--verbose: file_copies_switch--verbose: file_copies_switch--verbose: file_copies_switch--verbose: file_copies_switch--verbose: file_copies_switch--verbose: file_copies_switch--verbose: file_copies_switch--debug: file_copies_switch--debug: file_copies_switch--debug: file_copies_switch--debug: file_copies_switch--debug: file_copies_switch--debug: file_copies_switch--debug: file_copies_switch--debug: file_copies_switch--debug: files: fourth second third files: second files: files: d files: files: c files: c files: b files: a files--verbose: fourth second third files--verbose: second files--verbose: files--verbose: d files--verbose: files--verbose: c files--verbose: c files--verbose: b files--verbose: a files--debug: fourth second third files--debug: second files--debug: files--debug: d files--debug: files--debug: c files--debug: c files--debug: b files--debug: a manifest: 6:94961b75a2da manifest: 5:f2dbc354b94e manifest: 4:4dc3def4f9b4 manifest: 4:4dc3def4f9b4 manifest: 3:cb5a1327723b manifest: 3:cb5a1327723b manifest: 2:6e0e82995c35 manifest: 1:4e8d705b1e53 manifest: 0:a0c8bcbbb45c manifest--verbose: 6:94961b75a2da manifest--verbose: 5:f2dbc354b94e manifest--verbose: 4:4dc3def4f9b4 manifest--verbose: 4:4dc3def4f9b4 manifest--verbose: 3:cb5a1327723b manifest--verbose: 3:cb5a1327723b manifest--verbose: 2:6e0e82995c35 manifest--verbose: 1:4e8d705b1e53 manifest--verbose: 0:a0c8bcbbb45c manifest--debug: 6:94961b75a2da554b4df6fb599e5bfc7d48de0c64 manifest--debug: 5:f2dbc354b94e5ec0b4f10680ee0cee816101d0bf manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216 manifest--debug: 4:4dc3def4f9b4c6e8de820f6ee74737f91e96a216 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 node: 95c24699272ef57d062b8bccc32c878bf841784a node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453 node: d41e714fe50d9e4a5f11b4d595d543481b5f980b node: 13207e5a10d9fd28ec424934298e176197f2c67f node: bbe44766e73d5f11ed2177f1838de10c53ef3e74 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47 node: 97054abb4ab824450e9164180baf491ae0078465 node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965 node: 1e4e1b8f71e05681d422154f5421e385fec3454f node--verbose: 95c24699272ef57d062b8bccc32c878bf841784a node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453 node--verbose: d41e714fe50d9e4a5f11b4d595d543481b5f980b node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74 node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47 node--verbose: 97054abb4ab824450e9164180baf491ae0078465 node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965 node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f node--debug: 95c24699272ef57d062b8bccc32c878bf841784a node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453 node--debug: d41e714fe50d9e4a5f11b4d595d543481b5f980b node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74 node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47 node--debug: 97054abb4ab824450e9164180baf491ae0078465 node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965 node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f parents: parents: -1:000000000000 parents: 5:13207e5a10d9 4:bbe44766e73d parents: 3:10e46f2dcbf4 parents: parents: parents: parents: parents: parents--verbose: parents--verbose: -1:000000000000 parents--verbose: 5:13207e5a10d9 4:bbe44766e73d parents--verbose: 3:10e46f2dcbf4 parents--verbose: parents--verbose: parents--verbose: parents--verbose: parents--verbose: parents--debug: 7:29114dbae42b9f078cf2714dbe3a86bba8ec7453 -1:0000000000000000000000000000000000000000 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000 parents--debug: 5:13207e5a10d9fd28ec424934298e176197f2c67f 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000 rev: 8 rev: 7 rev: 6 rev: 5 rev: 4 rev: 3 rev: 2 rev: 1 rev: 0 rev--verbose: 8 rev--verbose: 7 rev--verbose: 6 rev--verbose: 5 rev--verbose: 4 rev--verbose: 3 rev--verbose: 2 rev--verbose: 1 rev--verbose: 0 rev--debug: 8 rev--debug: 7 rev--debug: 6 rev--debug: 5 rev--debug: 4 rev--debug: 3 rev--debug: 2 rev--debug: 1 rev--debug: 0 tags: tip tags: tags: tags: tags: tags: tags: tags: tags: tags--verbose: tip tags--verbose: tags--verbose: tags--verbose: tags--verbose: tags--verbose: tags--verbose: tags--verbose: tags--verbose: tags--debug: tip tags--debug: tags--debug: tags--debug: tags--debug: tags--debug: tags--debug: tags--debug: tags--debug: diffstat: 3: +2/-1 diffstat: 1: +1/-0 diffstat: 0: +0/-0 diffstat: 1: +1/-0 diffstat: 0: +0/-0 diffstat: 1: +1/-0 diffstat: 1: +4/-0 diffstat: 1: +2/-0 diffstat: 1: +1/-0 diffstat--verbose: 3: +2/-1 diffstat--verbose: 1: +1/-0 diffstat--verbose: 0: +0/-0 diffstat--verbose: 1: +1/-0 diffstat--verbose: 0: +0/-0 diffstat--verbose: 1: +1/-0 diffstat--verbose: 1: +4/-0 diffstat--verbose: 1: +2/-0 diffstat--verbose: 1: +1/-0 diffstat--debug: 3: +2/-1 diffstat--debug: 1: +1/-0 diffstat--debug: 0: +0/-0 diffstat--debug: 1: +1/-0 diffstat--debug: 0: +0/-0 diffstat--debug: 1: +1/-0 diffstat--debug: 1: +4/-0 diffstat--debug: 1: +2/-0 diffstat--debug: 1: +1/-0 extras: branch=default extras: branch=default extras: branch=default extras: branch=default extras: branch=foo extras: branch=default extras: branch=default extras: branch=default extras: branch=default extras--verbose: branch=default extras--verbose: branch=default extras--verbose: branch=default extras--verbose: branch=default extras--verbose: branch=foo extras--verbose: branch=default extras--verbose: branch=default extras--verbose: branch=default extras--verbose: branch=default extras--debug: branch=default extras--debug: branch=default extras--debug: branch=default extras--debug: branch=default extras--debug: branch=foo extras--debug: branch=default extras--debug: branch=default extras--debug: branch=default extras--debug: branch=default p1rev: 7 p1rev: -1 p1rev: 5 p1rev: 3 p1rev: 3 p1rev: 2 p1rev: 1 p1rev: 0 p1rev: -1 p1rev--verbose: 7 p1rev--verbose: -1 p1rev--verbose: 5 p1rev--verbose: 3 p1rev--verbose: 3 p1rev--verbose: 2 p1rev--verbose: 1 p1rev--verbose: 0 p1rev--verbose: -1 p1rev--debug: 7 p1rev--debug: -1 p1rev--debug: 5 p1rev--debug: 3 p1rev--debug: 3 p1rev--debug: 2 p1rev--debug: 1 p1rev--debug: 0 p1rev--debug: -1 p2rev: -1 p2rev: -1 p2rev: 4 p2rev: -1 p2rev: -1 p2rev: -1 p2rev: -1 p2rev: -1 p2rev: -1 p2rev--verbose: -1 p2rev--verbose: -1 p2rev--verbose: 4 p2rev--verbose: -1 p2rev--verbose: -1 p2rev--verbose: -1 p2rev--verbose: -1 p2rev--verbose: -1 p2rev--verbose: -1 p2rev--debug: -1 p2rev--debug: -1 p2rev--debug: 4 p2rev--debug: -1 p2rev--debug: -1 p2rev--debug: -1 p2rev--debug: -1 p2rev--debug: -1 p2rev--debug: -1 p1node: 29114dbae42b9f078cf2714dbe3a86bba8ec7453 p1node: 0000000000000000000000000000000000000000 p1node: 13207e5a10d9fd28ec424934298e176197f2c67f p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47 p1node: 10e46f2dcbf4823578cf180f33ecf0b957964c47 p1node: 97054abb4ab824450e9164180baf491ae0078465 p1node: b608e9d1a3f0273ccf70fb85fd6866b3482bf965 p1node: 1e4e1b8f71e05681d422154f5421e385fec3454f p1node: 0000000000000000000000000000000000000000 p1node--verbose: 29114dbae42b9f078cf2714dbe3a86bba8ec7453 p1node--verbose: 0000000000000000000000000000000000000000 p1node--verbose: 13207e5a10d9fd28ec424934298e176197f2c67f p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47 p1node--verbose: 10e46f2dcbf4823578cf180f33ecf0b957964c47 p1node--verbose: 97054abb4ab824450e9164180baf491ae0078465 p1node--verbose: b608e9d1a3f0273ccf70fb85fd6866b3482bf965 p1node--verbose: 1e4e1b8f71e05681d422154f5421e385fec3454f p1node--verbose: 0000000000000000000000000000000000000000 p1node--debug: 29114dbae42b9f078cf2714dbe3a86bba8ec7453 p1node--debug: 0000000000000000000000000000000000000000 p1node--debug: 13207e5a10d9fd28ec424934298e176197f2c67f p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47 p1node--debug: 10e46f2dcbf4823578cf180f33ecf0b957964c47 p1node--debug: 97054abb4ab824450e9164180baf491ae0078465 p1node--debug: b608e9d1a3f0273ccf70fb85fd6866b3482bf965 p1node--debug: 1e4e1b8f71e05681d422154f5421e385fec3454f p1node--debug: 0000000000000000000000000000000000000000 p2node: 0000000000000000000000000000000000000000 p2node: 0000000000000000000000000000000000000000 p2node: bbe44766e73d5f11ed2177f1838de10c53ef3e74 p2node: 0000000000000000000000000000000000000000 p2node: 0000000000000000000000000000000000000000 p2node: 0000000000000000000000000000000000000000 p2node: 0000000000000000000000000000000000000000 p2node: 0000000000000000000000000000000000000000 p2node: 0000000000000000000000000000000000000000 p2node--verbose: 0000000000000000000000000000000000000000 p2node--verbose: 0000000000000000000000000000000000000000 p2node--verbose: bbe44766e73d5f11ed2177f1838de10c53ef3e74 p2node--verbose: 0000000000000000000000000000000000000000 p2node--verbose: 0000000000000000000000000000000000000000 p2node--verbose: 0000000000000000000000000000000000000000 p2node--verbose: 0000000000000000000000000000000000000000 p2node--verbose: 0000000000000000000000000000000000000000 p2node--verbose: 0000000000000000000000000000000000000000 p2node--debug: 0000000000000000000000000000000000000000 p2node--debug: 0000000000000000000000000000000000000000 p2node--debug: bbe44766e73d5f11ed2177f1838de10c53ef3e74 p2node--debug: 0000000000000000000000000000000000000000 p2node--debug: 0000000000000000000000000000000000000000 p2node--debug: 0000000000000000000000000000000000000000 p2node--debug: 0000000000000000000000000000000000000000 p2node--debug: 0000000000000000000000000000000000000000 p2node--debug: 0000000000000000000000000000000000000000 Filters work: $ hg log --template '{author|domain}\n' hostname place place hostname $ hg log --template '{author|person}\n' test User Name person person person person other A. N. Other User Name $ hg log --template '{author|user}\n' test user person person person person other other user $ hg log --template '{date|date}\n' Wed Jan 01 10:01:00 2020 +0000 Mon Jan 12 13:46:40 1970 +0000 Sun Jan 18 08:40:01 1970 +0000 Sun Jan 18 08:40:00 1970 +0000 Sat Jan 17 04:53:20 1970 +0000 Fri Jan 16 01:06:40 1970 +0000 Wed Jan 14 21:20:00 1970 +0000 Tue Jan 13 17:33:20 1970 +0000 Mon Jan 12 13:46:40 1970 +0000 $ hg log --template '{date|isodate}\n' 2020-01-01 10:01 +0000 1970-01-12 13:46 +0000 1970-01-18 08:40 +0000 1970-01-18 08:40 +0000 1970-01-17 04:53 +0000 1970-01-16 01:06 +0000 1970-01-14 21:20 +0000 1970-01-13 17:33 +0000 1970-01-12 13:46 +0000 $ hg log --template '{date|isodatesec}\n' 2020-01-01 10:01:00 +0000 1970-01-12 13:46:40 +0000 1970-01-18 08:40:01 +0000 1970-01-18 08:40:00 +0000 1970-01-17 04:53:20 +0000 1970-01-16 01:06:40 +0000 1970-01-14 21:20:00 +0000 1970-01-13 17:33:20 +0000 1970-01-12 13:46:40 +0000 $ hg log --template '{date|rfc822date}\n' Wed, 01 Jan 2020 10:01:00 +0000 Mon, 12 Jan 1970 13:46:40 +0000 Sun, 18 Jan 1970 08:40:01 +0000 Sun, 18 Jan 1970 08:40:00 +0000 Sat, 17 Jan 1970 04:53:20 +0000 Fri, 16 Jan 1970 01:06:40 +0000 Wed, 14 Jan 1970 21:20:00 +0000 Tue, 13 Jan 1970 17:33:20 +0000 Mon, 12 Jan 1970 13:46:40 +0000 $ hg log --template '{desc|firstline}\n' third second merge new head new branch no user, no domain no person other 1 line 1 $ hg log --template '{node|short}\n' 95c24699272e 29114dbae42b d41e714fe50d 13207e5a10d9 bbe44766e73d 10e46f2dcbf4 97054abb4ab8 b608e9d1a3f0 1e4e1b8f71e0 $ hg log --template '\n' $ hg log --template '{rev}: {children}\n' 8: 7: 8:95c24699272e 6: 5: 6:d41e714fe50d 4: 6:d41e714fe50d 3: 4:bbe44766e73d 5:13207e5a10d9 2: 3:10e46f2dcbf4 1: 2:97054abb4ab8 0: 1:b608e9d1a3f0 Formatnode filter works: $ hg -q log -r 0 --template '{node|formatnode}\n' 1e4e1b8f71e0 $ hg log -r 0 --template '{node|formatnode}\n' 1e4e1b8f71e0 $ hg -v log -r 0 --template '{node|formatnode}\n' 1e4e1b8f71e0 $ hg --debug log -r 0 --template '{node|formatnode}\n' 1e4e1b8f71e05681d422154f5421e385fec3454f Age filter: $ hg init unstable-hash $ cd unstable-hash $ hg log --template '{date|age}\n' > /dev/null || exit 1 >>> from __future__ import absolute_import >>> import datetime >>> fp = open('a', 'w') >>> n = datetime.datetime.now() + datetime.timedelta(366 * 7) >>> fp.write('%d-%d-%d 00:00' % (n.year, n.month, n.day)) >>> fp.close() $ hg add a $ hg commit -m future -d "`cat a`" $ hg log -l1 --template '{date|age}\n' 7 years from now $ cd .. $ rm -rf unstable-hash Filename filters: $ hg debugtemplate '{"foo/bar"|basename}|{"foo/"|basename}|{"foo"|basename}|\n' bar||foo| Add a dummy commit to make up for the instability of the above: $ echo a > a $ hg add a $ hg ci -m future Count filter: $ hg log -l1 --template '{node|count} {node|short|count}\n' 40 12 $ hg log -l1 --template '{revset("null^")|count} {revset(".")|count} {revset("0::3")|count}\n' 0 1 4 $ hg log -G --template '{rev}: children: {children|count}, \ > tags: {tags|count}, file_adds: {file_adds|count}, \ > ancestors: {revset("ancestors(%s)", rev)|count}' @ 9: children: 0, tags: 1, file_adds: 1, ancestors: 3 | o 8: children: 1, tags: 0, file_adds: 2, ancestors: 2 | o 7: children: 1, tags: 0, file_adds: 1, ancestors: 1 o 6: children: 0, tags: 0, file_adds: 0, ancestors: 7 |\ | o 5: children: 1, tags: 0, file_adds: 1, ancestors: 5 | | o | 4: children: 1, tags: 0, file_adds: 0, ancestors: 5 |/ o 3: children: 2, tags: 0, file_adds: 0, ancestors: 4 | o 2: children: 1, tags: 0, file_adds: 1, ancestors: 3 | o 1: children: 1, tags: 0, file_adds: 1, ancestors: 2 | o 0: children: 1, tags: 0, file_adds: 1, ancestors: 1 Upper/lower filters: $ hg log -r0 --template '{branch|upper}\n' DEFAULT $ hg log -r0 --template '{author|lower}\n' user name $ hg log -r0 --template '{date|upper}\n' abort: template filter 'upper' is not compatible with keyword 'date' [255] Add a commit that does all possible modifications at once $ echo modify >> third $ touch b $ hg add b $ hg mv fourth fifth $ hg rm a $ hg ci -m "Modify, add, remove, rename" Check the status template $ cat <> $HGRCPATH > [extensions] > color= > EOF $ hg log -T status -r 10 changeset: 10:0f9759ec227a tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Modify, add, remove, rename files: M third A b A fifth R a R fourth $ hg log -T status -C -r 10 changeset: 10:0f9759ec227a tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Modify, add, remove, rename files: M third A b A fifth fourth R a R fourth $ hg log -T status -C -r 10 -v changeset: 10:0f9759ec227a tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 description: Modify, add, remove, rename files: M third A b A fifth fourth R a R fourth $ hg log -T status -C -r 10 --debug changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c tag: tip phase: secret parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066 parent: -1:0000000000000000000000000000000000000000 manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567 user: test date: Thu Jan 01 00:00:00 1970 +0000 extra: branch=default description: Modify, add, remove, rename files: M third A b A fifth fourth R a R fourth $ hg log -T status -C -r 10 --quiet 10:0f9759ec227a $ hg --color=debug log -T status -r 10 [log.changeset changeset.secret|changeset: 10:0f9759ec227a] [log.tag|tag: tip] [log.user|user: test] [log.date|date: Thu Jan 01 00:00:00 1970 +0000] [log.summary|summary: Modify, add, remove, rename] [ui.note log.files|files:] [status.modified|M third] [status.added|A b] [status.added|A fifth] [status.removed|R a] [status.removed|R fourth] $ hg --color=debug log -T status -C -r 10 [log.changeset changeset.secret|changeset: 10:0f9759ec227a] [log.tag|tag: tip] [log.user|user: test] [log.date|date: Thu Jan 01 00:00:00 1970 +0000] [log.summary|summary: Modify, add, remove, rename] [ui.note log.files|files:] [status.modified|M third] [status.added|A b] [status.added|A fifth] [status.copied| fourth] [status.removed|R a] [status.removed|R fourth] $ hg --color=debug log -T status -C -r 10 -v [log.changeset changeset.secret|changeset: 10:0f9759ec227a] [log.tag|tag: tip] [log.user|user: test] [log.date|date: Thu Jan 01 00:00:00 1970 +0000] [ui.note log.description|description:] [ui.note log.description|Modify, add, remove, rename] [ui.note log.files|files:] [status.modified|M third] [status.added|A b] [status.added|A fifth] [status.copied| fourth] [status.removed|R a] [status.removed|R fourth] $ hg --color=debug log -T status -C -r 10 --debug [log.changeset changeset.secret|changeset: 10:0f9759ec227a4859c2014a345cd8a859022b7c6c] [log.tag|tag: tip] [log.phase|phase: secret] [log.parent changeset.secret|parent: 9:bf9dfba36635106d6a73ccc01e28b762da60e066] [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000] [ui.debug log.manifest|manifest: 8:89dd546f2de0a9d6d664f58d86097eb97baba567] [log.user|user: test] [log.date|date: Thu Jan 01 00:00:00 1970 +0000] [ui.debug log.extra|extra: branch=default] [ui.note log.description|description:] [ui.note log.description|Modify, add, remove, rename] [ui.note log.files|files:] [status.modified|M third] [status.added|A b] [status.added|A fifth] [status.copied| fourth] [status.removed|R a] [status.removed|R fourth] $ hg --color=debug log -T status -C -r 10 --quiet [log.node|10:0f9759ec227a] Check the bisect template $ hg bisect -g 1 $ hg bisect -b 3 --noupdate Testing changeset 2:97054abb4ab8 (2 changesets remaining, ~1 tests) $ hg log -T bisect -r 0:4 changeset: 0:1e4e1b8f71e0 bisect: good (implicit) user: User Name date: Mon Jan 12 13:46:40 1970 +0000 summary: line 1 changeset: 1:b608e9d1a3f0 bisect: good user: A. N. Other date: Tue Jan 13 17:33:20 1970 +0000 summary: other 1 changeset: 2:97054abb4ab8 bisect: untested user: other@place date: Wed Jan 14 21:20:00 1970 +0000 summary: no person changeset: 3:10e46f2dcbf4 bisect: bad user: person date: Fri Jan 16 01:06:40 1970 +0000 summary: no user, no domain changeset: 4:bbe44766e73d bisect: bad (implicit) branch: foo user: person date: Sat Jan 17 04:53:20 1970 +0000 summary: new branch $ hg log --debug -T bisect -r 0:4 changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f bisect: good (implicit) phase: public parent: -1:0000000000000000000000000000000000000000 parent: -1:0000000000000000000000000000000000000000 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 user: User Name date: Mon Jan 12 13:46:40 1970 +0000 files+: a extra: branch=default description: line 1 line 2 changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 bisect: good phase: public parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f parent: -1:0000000000000000000000000000000000000000 manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55 user: A. N. Other date: Tue Jan 13 17:33:20 1970 +0000 files+: b extra: branch=default description: other 1 other 2 other 3 changeset: 2:97054abb4ab824450e9164180baf491ae0078465 bisect: untested phase: public parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 parent: -1:0000000000000000000000000000000000000000 manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1 user: other@place date: Wed Jan 14 21:20:00 1970 +0000 files+: c extra: branch=default description: no person changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 bisect: bad phase: public parent: 2:97054abb4ab824450e9164180baf491ae0078465 parent: -1:0000000000000000000000000000000000000000 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc user: person date: Fri Jan 16 01:06:40 1970 +0000 files: c extra: branch=default description: no user, no domain changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74 bisect: bad (implicit) branch: foo phase: draft parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 parent: -1:0000000000000000000000000000000000000000 manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc user: person date: Sat Jan 17 04:53:20 1970 +0000 extra: branch=foo description: new branch $ hg log -v -T bisect -r 0:4 changeset: 0:1e4e1b8f71e0 bisect: good (implicit) user: User Name date: Mon Jan 12 13:46:40 1970 +0000 files: a description: line 1 line 2 changeset: 1:b608e9d1a3f0 bisect: good user: A. N. Other date: Tue Jan 13 17:33:20 1970 +0000 files: b description: other 1 other 2 other 3 changeset: 2:97054abb4ab8 bisect: untested user: other@place date: Wed Jan 14 21:20:00 1970 +0000 files: c description: no person changeset: 3:10e46f2dcbf4 bisect: bad user: person date: Fri Jan 16 01:06:40 1970 +0000 files: c description: no user, no domain changeset: 4:bbe44766e73d bisect: bad (implicit) branch: foo user: person date: Sat Jan 17 04:53:20 1970 +0000 description: new branch $ hg --color=debug log -T bisect -r 0:4 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0] [log.bisect bisect.good|bisect: good (implicit)] [log.user|user: User Name ] [log.date|date: Mon Jan 12 13:46:40 1970 +0000] [log.summary|summary: line 1] [log.changeset changeset.public|changeset: 1:b608e9d1a3f0] [log.bisect bisect.good|bisect: good] [log.user|user: A. N. Other ] [log.date|date: Tue Jan 13 17:33:20 1970 +0000] [log.summary|summary: other 1] [log.changeset changeset.public|changeset: 2:97054abb4ab8] [log.bisect bisect.untested|bisect: untested] [log.user|user: other@place] [log.date|date: Wed Jan 14 21:20:00 1970 +0000] [log.summary|summary: no person] [log.changeset changeset.public|changeset: 3:10e46f2dcbf4] [log.bisect bisect.bad|bisect: bad] [log.user|user: person] [log.date|date: Fri Jan 16 01:06:40 1970 +0000] [log.summary|summary: no user, no domain] [log.changeset changeset.draft|changeset: 4:bbe44766e73d] [log.bisect bisect.bad|bisect: bad (implicit)] [log.branch|branch: foo] [log.user|user: person] [log.date|date: Sat Jan 17 04:53:20 1970 +0000] [log.summary|summary: new branch] $ hg --color=debug log --debug -T bisect -r 0:4 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e05681d422154f5421e385fec3454f] [log.bisect bisect.good|bisect: good (implicit)] [log.phase|phase: public] [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000] [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000] [ui.debug log.manifest|manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0] [log.user|user: User Name ] [log.date|date: Mon Jan 12 13:46:40 1970 +0000] [ui.debug log.files|files+: a] [ui.debug log.extra|extra: branch=default] [ui.note log.description|description:] [ui.note log.description|line 1 line 2] [log.changeset changeset.public|changeset: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965] [log.bisect bisect.good|bisect: good] [log.phase|phase: public] [log.parent changeset.public|parent: 0:1e4e1b8f71e05681d422154f5421e385fec3454f] [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000] [ui.debug log.manifest|manifest: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55] [log.user|user: A. N. Other ] [log.date|date: Tue Jan 13 17:33:20 1970 +0000] [ui.debug log.files|files+: b] [ui.debug log.extra|extra: branch=default] [ui.note log.description|description:] [ui.note log.description|other 1 other 2 other 3] [log.changeset changeset.public|changeset: 2:97054abb4ab824450e9164180baf491ae0078465] [log.bisect bisect.untested|bisect: untested] [log.phase|phase: public] [log.parent changeset.public|parent: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965] [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000] [ui.debug log.manifest|manifest: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1] [log.user|user: other@place] [log.date|date: Wed Jan 14 21:20:00 1970 +0000] [ui.debug log.files|files+: c] [ui.debug log.extra|extra: branch=default] [ui.note log.description|description:] [ui.note log.description|no person] [log.changeset changeset.public|changeset: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47] [log.bisect bisect.bad|bisect: bad] [log.phase|phase: public] [log.parent changeset.public|parent: 2:97054abb4ab824450e9164180baf491ae0078465] [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000] [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc] [log.user|user: person] [log.date|date: Fri Jan 16 01:06:40 1970 +0000] [ui.debug log.files|files: c] [ui.debug log.extra|extra: branch=default] [ui.note log.description|description:] [ui.note log.description|no user, no domain] [log.changeset changeset.draft|changeset: 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74] [log.bisect bisect.bad|bisect: bad (implicit)] [log.branch|branch: foo] [log.phase|phase: draft] [log.parent changeset.public|parent: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47] [log.parent changeset.public|parent: -1:0000000000000000000000000000000000000000] [ui.debug log.manifest|manifest: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc] [log.user|user: person] [log.date|date: Sat Jan 17 04:53:20 1970 +0000] [ui.debug log.extra|extra: branch=foo] [ui.note log.description|description:] [ui.note log.description|new branch] $ hg --color=debug log -v -T bisect -r 0:4 [log.changeset changeset.public|changeset: 0:1e4e1b8f71e0] [log.bisect bisect.good|bisect: good (implicit)] [log.user|user: User Name ] [log.date|date: Mon Jan 12 13:46:40 1970 +0000] [ui.note log.files|files: a] [ui.note log.description|description:] [ui.note log.description|line 1 line 2] [log.changeset changeset.public|changeset: 1:b608e9d1a3f0] [log.bisect bisect.good|bisect: good] [log.user|user: A. N. Other ] [log.date|date: Tue Jan 13 17:33:20 1970 +0000] [ui.note log.files|files: b] [ui.note log.description|description:] [ui.note log.description|other 1 other 2 other 3] [log.changeset changeset.public|changeset: 2:97054abb4ab8] [log.bisect bisect.untested|bisect: untested] [log.user|user: other@place] [log.date|date: Wed Jan 14 21:20:00 1970 +0000] [ui.note log.files|files: c] [ui.note log.description|description:] [ui.note log.description|no person] [log.changeset changeset.public|changeset: 3:10e46f2dcbf4] [log.bisect bisect.bad|bisect: bad] [log.user|user: person] [log.date|date: Fri Jan 16 01:06:40 1970 +0000] [ui.note log.files|files: c] [ui.note log.description|description:] [ui.note log.description|no user, no domain] [log.changeset changeset.draft|changeset: 4:bbe44766e73d] [log.bisect bisect.bad|bisect: bad (implicit)] [log.branch|branch: foo] [log.user|user: person] [log.date|date: Sat Jan 17 04:53:20 1970 +0000] [ui.note log.description|description:] [ui.note log.description|new branch] $ hg bisect --reset Error on syntax: $ echo 'x = "f' >> t $ hg log hg: parse error at t:3: unmatched quotes [255] $ hg log -T '{date' hg: parse error at 1: unterminated template expansion [255] $ hg log -T '{date(}' hg: parse error at 7: not a prefix: end [255] $ hg log -T '{date)}' hg: parse error at 5: invalid token [255] $ hg log -T '{date date}' hg: parse error at 6: invalid token [255] $ hg log -T '{}' hg: parse error at 2: not a prefix: end [255] $ hg debugtemplate -v '{()}' (template (group None)) hg: parse error: missing argument [255] Behind the scenes, this will throw TypeError $ hg log -l 3 --template '{date|obfuscate}\n' abort: template filter 'obfuscate' is not compatible with keyword 'date' [255] Behind the scenes, this will throw a ValueError $ hg log -l 3 --template 'line: {desc|shortdate}\n' abort: template filter 'shortdate' is not compatible with keyword 'desc' [255] Behind the scenes, this will throw AttributeError $ hg log -l 3 --template 'line: {date|escape}\n' abort: template filter 'escape' is not compatible with keyword 'date' [255] $ hg log -l 3 --template 'line: {extras|localdate}\n' hg: parse error: localdate expects a date information [255] Behind the scenes, this will throw ValueError $ hg tip --template '{author|email|date}\n' hg: parse error: date expects a date information [255] $ hg tip -T '{author|email|shortdate}\n' abort: template filter 'shortdate' is not compatible with keyword 'author' [255] $ hg tip -T '{get(extras, "branch")|shortdate}\n' abort: incompatible use of template filter 'shortdate' [255] Error in nested template: $ hg log -T '{"date' hg: parse error at 2: unterminated string [255] $ hg log -T '{"foo{date|?}"}' hg: parse error at 11: syntax error [255] Thrown an error if a template function doesn't exist $ hg tip --template '{foo()}\n' hg: parse error: unknown function 'foo' [255] Pass generator object created by template function to filter $ hg log -l 1 --template '{if(author, author)|user}\n' test Test index keyword: $ hg log -l 2 -T '{index + 10}{files % " {index}:{file}"}\n' 10 0:a 1:b 2:fifth 3:fourth 4:third 11 0:a $ hg branches -T '{index} {branch}\n' 0 default 1 foo Test diff function: $ hg diff -c 8 diff -r 29114dbae42b -r 95c24699272e fourth --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000 @@ -0,0 +1,1 @@ +second diff -r 29114dbae42b -r 95c24699272e second --- a/second Mon Jan 12 13:46:40 1970 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -second diff -r 29114dbae42b -r 95c24699272e third --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/third Wed Jan 01 10:01:00 2020 +0000 @@ -0,0 +1,1 @@ +third $ hg log -r 8 -T "{diff()}" diff -r 29114dbae42b -r 95c24699272e fourth --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000 @@ -0,0 +1,1 @@ +second diff -r 29114dbae42b -r 95c24699272e second --- a/second Mon Jan 12 13:46:40 1970 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -second diff -r 29114dbae42b -r 95c24699272e third --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/third Wed Jan 01 10:01:00 2020 +0000 @@ -0,0 +1,1 @@ +third $ hg log -r 8 -T "{diff('glob:f*')}" diff -r 29114dbae42b -r 95c24699272e fourth --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000 @@ -0,0 +1,1 @@ +second $ hg log -r 8 -T "{diff('', 'glob:f*')}" diff -r 29114dbae42b -r 95c24699272e second --- a/second Mon Jan 12 13:46:40 1970 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -second diff -r 29114dbae42b -r 95c24699272e third --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/third Wed Jan 01 10:01:00 2020 +0000 @@ -0,0 +1,1 @@ +third $ hg log -r 8 -T "{diff('FOURTH'|lower)}" diff -r 29114dbae42b -r 95c24699272e fourth --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fourth Wed Jan 01 10:01:00 2020 +0000 @@ -0,0 +1,1 @@ +second ui verbosity: $ hg log -l1 -T '{verbosity}\n' $ hg log -l1 -T '{verbosity}\n' --debug debug $ hg log -l1 -T '{verbosity}\n' --quiet quiet $ hg log -l1 -T '{verbosity}\n' --verbose verbose $ cd .. latesttag: $ hg init latesttag $ cd latesttag $ echo a > file $ hg ci -Am a -d '0 0' adding file $ echo b >> file $ hg ci -m b -d '1 0' $ echo c >> head1 $ hg ci -Am h1c -d '2 0' adding head1 $ hg update -q 1 $ echo d >> head2 $ hg ci -Am h2d -d '3 0' adding head2 created new head $ echo e >> head2 $ hg ci -m h2e -d '4 0' $ hg merge -q $ hg ci -m merge -d '5 -3600' No tag set: $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n' @ 5: null+5 |\ | o 4: null+4 | | | o 3: null+3 | | o | 2: null+3 |/ o 1: null+2 | o 0: null+1 One common tag: longest path wins for {latesttagdistance}: $ hg tag -r 1 -m t1 -d '6 0' t1 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n' @ 6: t1+4 | o 5: t1+3 |\ | o 4: t1+2 | | | o 3: t1+1 | | o | 2: t1+1 |/ o 1: t1+0 | o 0: null+1 One ancestor tag: closest wins: $ hg tag -r 2 -m t2 -d '7 0' t2 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n' @ 7: t2+3 | o 6: t2+2 | o 5: t2+1 |\ | o 4: t1+2 | | | o 3: t1+1 | | o | 2: t2+0 |/ o 1: t1+0 | o 0: null+1 Two branch tags: more recent wins if same number of changes: $ hg tag -r 3 -m t3 -d '8 0' t3 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n' @ 8: t3+5 | o 7: t3+4 | o 6: t3+3 | o 5: t3+2 |\ | o 4: t3+1 | | | o 3: t3+0 | | o | 2: t2+0 |/ o 1: t1+0 | o 0: null+1 Two branch tags: fewest changes wins: $ hg tag -r 4 -m t4 -d '4 0' t4 # older than t2, but should not matter $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n" @ 9: t4+5,6 | o 8: t4+4,5 | o 7: t4+3,4 | o 6: t4+2,3 | o 5: t4+1,2 |\ | o 4: t4+0,0 | | | o 3: t3+0,0 | | o | 2: t2+0,0 |/ o 1: t1+0,0 | o 0: null+1,1 Merged tag overrides: $ hg tag -r 5 -m t5 -d '9 0' t5 $ hg tag -r 3 -m at3 -d '10 0' at3 $ hg log -G --template '{rev}: {latesttag}+{latesttagdistance}\n' @ 11: t5+6 | o 10: t5+5 | o 9: t5+4 | o 8: t5+3 | o 7: t5+2 | o 6: t5+1 | o 5: t5+0 |\ | o 4: t4+0 | | | o 3: at3:t3+0 | | o | 2: t2+0 |/ o 1: t1+0 | o 0: null+1 $ hg log -G --template "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n" @ 11: t5+6,6 | o 10: t5+5,5 | o 9: t5+4,4 | o 8: t5+3,3 | o 7: t5+2,2 | o 6: t5+1,1 | o 5: t5+0,0 |\ | o 4: t4+0,0 | | | o 3: at3+0,0 t3+0,0 | | o | 2: t2+0,0 |/ o 1: t1+0,0 | o 0: null+1,1 $ hg log -G --template "{rev}: {latesttag('re:^t[13]$') % '{tag}, C: {changes}, D: {distance}'}\n" @ 11: t3, C: 9, D: 8 | o 10: t3, C: 8, D: 7 | o 9: t3, C: 7, D: 6 | o 8: t3, C: 6, D: 5 | o 7: t3, C: 5, D: 4 | o 6: t3, C: 4, D: 3 | o 5: t3, C: 3, D: 2 |\ | o 4: t3, C: 1, D: 1 | | | o 3: t3, C: 0, D: 0 | | o | 2: t1, C: 1, D: 1 |/ o 1: t1, C: 0, D: 0 | o 0: null, C: 1, D: 1 $ cd .. Style path expansion: issue1948 - ui.style option doesn't work on OSX if it is a relative path $ mkdir -p home/styles $ cat > home/styles/teststyle < changeset = 'test {rev}:{node|short}\n' > EOF $ HOME=`pwd`/home; export HOME $ cat > latesttag/.hg/hgrc < [ui] > style = ~/styles/teststyle > EOF $ hg -R latesttag tip test 11:97e5943b523a Test recursive showlist template (issue1989): $ cat > style1989 < changeset = '{file_mods}{manifest}{extras}' > file_mod = 'M|{author|person}\n' > manifest = '{rev},{author}\n' > extra = '{key}: {author}\n' > EOF $ hg -R latesttag log -r tip --style=style1989 M|test 11,test branch: test Test new-style inline templating: $ hg log -R latesttag -r tip --template 'modified files: {file_mods % " {file}\n"}\n' modified files: .hgtags $ hg log -R latesttag -r tip -T '{rev % "a"}\n' hg: parse error: keyword 'rev' is not iterable [255] $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "a"}\n' hg: parse error: None is not iterable [255] Test new-style inline templating of non-list/dict type: $ hg log -R latesttag -r tip -T '{manifest}\n' 11:2bc6e9006ce2 $ hg log -R latesttag -r tip -T 'string length: {manifest|count}\n' string length: 15 $ hg log -R latesttag -r tip -T '{manifest % "{rev}:{node}"}\n' 11:2bc6e9006ce29882383a22d39fd1f4e66dd3e2fc $ hg log -R latesttag -r tip -T '{get(extras, "branch") % "{key}: {value}\n"}' branch: default $ hg log -R latesttag -r tip -T '{get(extras, "unknown") % "{key}\n"}' hg: parse error: None is not iterable [255] $ hg log -R latesttag -r tip -T '{min(extras) % "{key}: {value}\n"}' branch: default $ hg log -R latesttag -l1 -T '{min(revset("0:9")) % "{rev}:{node|short}\n"}' 0:ce3cec86e6c2 $ hg log -R latesttag -l1 -T '{max(revset("0:9")) % "{rev}:{node|short}\n"}' 9:fbc7cd862e9c Test manifest/get() can be join()-ed as before, though it's silly: $ hg log -R latesttag -r tip -T '{join(manifest, "")}\n' 11:2bc6e9006ce2 $ hg log -R latesttag -r tip -T '{join(get(extras, "branch"), "")}\n' default Test min/max of integers $ hg log -R latesttag -l1 -T '{min(revset("9:10"))}\n' 9 $ hg log -R latesttag -l1 -T '{max(revset("9:10"))}\n' 10 Test dot operator precedence: $ hg debugtemplate -R latesttag -r0 -v '{manifest.node|short}\n' (template (| (. (symbol 'manifest') (symbol 'node')) (symbol 'short')) (string '\n')) 89f4071fec70 (the following examples are invalid, but seem natural in parsing POV) $ hg debugtemplate -R latesttag -r0 -v '{foo|bar.baz}\n' 2> /dev/null (template (| (symbol 'foo') (. (symbol 'bar') (symbol 'baz'))) (string '\n')) [255] $ hg debugtemplate -R latesttag -r0 -v '{foo.bar()}\n' 2> /dev/null (template (. (symbol 'foo') (func (symbol 'bar') None)) (string '\n')) [255] Test evaluation of dot operator: $ hg log -R latesttag -l1 -T '{min(revset("0:9")).node}\n' ce3cec86e6c26bd9bdfc590a6b92abc9680f1796 $ hg log -R latesttag -r0 -T '{extras.branch}\n' default $ hg log -R latesttag -l1 -T '{author.invalid}\n' hg: parse error: keyword 'author' has no member [255] $ hg log -R latesttag -l1 -T '{min("abc").invalid}\n' hg: parse error: 'a' has no member [255] Test the sub function of templating for expansion: $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n' xx $ hg log -R latesttag -r 10 -T '{sub("[", "x", rev)}\n' hg: parse error: sub got an invalid pattern: [ [255] $ hg log -R latesttag -r 10 -T '{sub("[0-9]", r"\1", rev)}\n' hg: parse error: sub got an invalid replacement: \1 [255] Test the strip function with chars specified: $ hg log -R latesttag --template '{desc}\n' at3 t5 t4 t3 t2 t1 merge h2e h2d h1c b a $ hg log -R latesttag --template '{strip(desc, "te")}\n' at3 5 4 3 2 1 merg h2 h2d h1c b a Test date format: $ hg log -R latesttag --template 'date: {date(date, "%y %m %d %S %z")}\n' date: 70 01 01 10 +0000 date: 70 01 01 09 +0000 date: 70 01 01 04 +0000 date: 70 01 01 08 +0000 date: 70 01 01 07 +0000 date: 70 01 01 06 +0000 date: 70 01 01 05 +0100 date: 70 01 01 04 +0000 date: 70 01 01 03 +0000 date: 70 01 01 02 +0000 date: 70 01 01 01 +0000 date: 70 01 01 00 +0000 Test invalid date: $ hg log -R latesttag -T '{date(rev)}\n' hg: parse error: date expects a date information [255] Test integer literal: $ hg debugtemplate -v '{(0)}\n' (template (group (integer '0')) (string '\n')) 0 $ hg debugtemplate -v '{(123)}\n' (template (group (integer '123')) (string '\n')) 123 $ hg debugtemplate -v '{(-4)}\n' (template (group (negate (integer '4'))) (string '\n')) -4 $ hg debugtemplate '{(-)}\n' hg: parse error at 3: not a prefix: ) [255] $ hg debugtemplate '{(-a)}\n' hg: parse error: negation needs an integer argument [255] top-level integer literal is interpreted as symbol (i.e. variable name): $ hg debugtemplate -D 1=one -v '{1}\n' (template (integer '1') (string '\n')) one $ hg debugtemplate -D 1=one -v '{if("t", "{1}")}\n' (template (func (symbol 'if') (list (string 't') (template (integer '1')))) (string '\n')) one $ hg debugtemplate -D 1=one -v '{1|stringify}\n' (template (| (integer '1') (symbol 'stringify')) (string '\n')) one unless explicit symbol is expected: $ hg log -Ra -r0 -T '{desc|1}\n' hg: parse error: expected a symbol, got 'integer' [255] $ hg log -Ra -r0 -T '{1()}\n' hg: parse error: expected a symbol, got 'integer' [255] Test string literal: $ hg debugtemplate -Ra -r0 -v '{"string with no template fragment"}\n' (template (string 'string with no template fragment') (string '\n')) string with no template fragment $ hg debugtemplate -Ra -r0 -v '{"template: {rev}"}\n' (template (template (string 'template: ') (symbol 'rev')) (string '\n')) template: 0 $ hg debugtemplate -Ra -r0 -v '{r"rawstring: {rev}"}\n' (template (string 'rawstring: {rev}') (string '\n')) rawstring: {rev} $ hg debugtemplate -Ra -r0 -v '{files % r"rawstring: {file}"}\n' (template (% (symbol 'files') (string 'rawstring: {file}')) (string '\n')) rawstring: {file} Test string escaping: $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n' > <>\n<[> <>\n<]> <>\n< $ hg log -R latesttag -r 0 \ > --config ui.logtemplate='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n' > <>\n<[> <>\n<]> <>\n< $ hg log -R latesttag -r 0 -T esc \ > --config templates.esc='>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n' > <>\n<[> <>\n<]> <>\n< $ cat <<'EOF' > esctmpl > changeset = '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n' > EOF $ hg log -R latesttag -r 0 --style ./esctmpl > <>\n<[> <>\n<]> <>\n< Test string escaping of quotes: $ hg log -Ra -r0 -T '{"\""}\n' " $ hg log -Ra -r0 -T '{"\\\""}\n' \" $ hg log -Ra -r0 -T '{r"\""}\n' \" $ hg log -Ra -r0 -T '{r"\\\""}\n' \\\" $ hg log -Ra -r0 -T '{"\""}\n' " $ hg log -Ra -r0 -T '{"\\\""}\n' \" $ hg log -Ra -r0 -T '{r"\""}\n' \" $ hg log -Ra -r0 -T '{r"\\\""}\n' \\\" Test exception in quoted template. single backslash before quotation mark is stripped before parsing: $ cat <<'EOF' > escquotetmpl > changeset = "\" \\" \\\" \\\\" {files % \"{file}\"}\n" > EOF $ cd latesttag $ hg log -r 2 --style ../escquotetmpl " \" \" \\" head1 $ hg log -r 2 -T esc --config templates.esc='"{\"valid\"}\n"' valid $ hg log -r 2 -T esc --config templates.esc="'"'{\'"'"'valid\'"'"'}\n'"'" valid Test compatibility with 2.9.2-3.4 of escaped quoted strings in nested _evalifliteral() templates (issue4733): $ hg log -r 2 -T '{if(rev, "\"{rev}")}\n' "2 $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\"{rev}\")}")}\n' "2 $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\"{rev}\\\")}\")}")}\n' "2 $ hg log -r 2 -T '{if(rev, "\\\"")}\n' \" $ hg log -r 2 -T '{if(rev, "{if(rev, \"\\\\\\\"\")}")}\n' \" $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, \\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n' \" $ hg log -r 2 -T '{if(rev, r"\\\"")}\n' \\\" $ hg log -r 2 -T '{if(rev, "{if(rev, r\"\\\\\\\"\")}")}\n' \\\" $ hg log -r 2 -T '{if(rev, "{if(rev, \"{if(rev, r\\\"\\\\\\\\\\\\\\\"\\\")}\")}")}\n' \\\" escaped single quotes and errors: $ hg log -r 2 -T "{if(rev, '{if(rev, \'foo\')}')}"'\n' foo $ hg log -r 2 -T "{if(rev, '{if(rev, r\'foo\')}')}"'\n' foo $ hg log -r 2 -T '{if(rev, "{if(rev, \")}")}\n' hg: parse error at 21: unterminated string [255] $ hg log -r 2 -T '{if(rev, \"\\"")}\n' hg: parse error: trailing \ in string [255] $ hg log -r 2 -T '{if(rev, r\"\\"")}\n' hg: parse error: trailing \ in string [255] $ cd .. Test leading backslashes: $ cd latesttag $ hg log -r 2 -T '\{rev} {files % "\{file}"}\n' {rev} {file} $ hg log -r 2 -T '\\{rev} {files % "\\{file}"}\n' \2 \head1 $ hg log -r 2 -T '\\\{rev} {files % "\\\{file}"}\n' \{rev} \{file} $ cd .. Test leading backslashes in "if" expression (issue4714): $ cd latesttag $ hg log -r 2 -T '{if("1", "\{rev}")} {if("1", r"\{rev}")}\n' {rev} \{rev} $ hg log -r 2 -T '{if("1", "\\{rev}")} {if("1", r"\\{rev}")}\n' \2 \\{rev} $ hg log -r 2 -T '{if("1", "\\\{rev}")} {if("1", r"\\\{rev}")}\n' \{rev} \\\{rev} $ cd .. "string-escape"-ed "\x5c\x786e" becomes r"\x6e" (once) or r"n" (twice) $ hg log -R a -r 0 --template '{if("1", "\x5c\x786e", "NG")}\n' \x6e $ hg log -R a -r 0 --template '{if("1", r"\x5c\x786e", "NG")}\n' \x5c\x786e $ hg log -R a -r 0 --template '{if("", "NG", "\x5c\x786e")}\n' \x6e $ hg log -R a -r 0 --template '{if("", "NG", r"\x5c\x786e")}\n' \x5c\x786e $ hg log -R a -r 2 --template '{ifeq("no perso\x6e", desc, "\x5c\x786e", "NG")}\n' \x6e $ hg log -R a -r 2 --template '{ifeq(r"no perso\x6e", desc, "NG", r"\x5c\x786e")}\n' \x5c\x786e $ hg log -R a -r 2 --template '{ifeq(desc, "no perso\x6e", "\x5c\x786e", "NG")}\n' \x6e $ hg log -R a -r 2 --template '{ifeq(desc, r"no perso\x6e", "NG", r"\x5c\x786e")}\n' \x5c\x786e $ hg log -R a -r 8 --template '{join(files, "\n")}\n' fourth second third $ hg log -R a -r 8 --template '{join(files, r"\n")}\n' fourth\nsecond\nthird $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", "htm\x6c")}'

    1st

    2nd

    $ hg log -R a -r 2 --template '{rstdoc(r"1st\n\n2nd", "html")}'

    1st\n\n2nd

    $ hg log -R a -r 2 --template '{rstdoc("1st\n\n2nd", r"htm\x6c")}' 1st 2nd $ hg log -R a -r 2 --template '{strip(desc, "\x6e")}\n' o perso $ hg log -R a -r 2 --template '{strip(desc, r"\x6e")}\n' no person $ hg log -R a -r 2 --template '{strip("no perso\x6e", "\x6e")}\n' o perso $ hg log -R a -r 2 --template '{strip(r"no perso\x6e", r"\x6e")}\n' no perso $ hg log -R a -r 2 --template '{sub("\\x6e", "\x2d", desc)}\n' -o perso- $ hg log -R a -r 2 --template '{sub(r"\\x6e", "-", desc)}\n' no person $ hg log -R a -r 2 --template '{sub("n", r"\x2d", desc)}\n' \x2do perso\x2d $ hg log -R a -r 2 --template '{sub("n", "\x2d", "no perso\x6e")}\n' -o perso- $ hg log -R a -r 2 --template '{sub("n", r"\x2d", r"no perso\x6e")}\n' \x2do perso\x6e $ hg log -R a -r 8 --template '{files % "{file}\n"}' fourth second third Test string escaping in nested expression: $ hg log -R a -r 8 --template '{ifeq(r"\x6e", if("1", "\x5c\x786e"), join(files, "\x5c\x786e"))}\n' fourth\x6esecond\x6ethird $ hg log -R a -r 8 --template '{ifeq(if("1", r"\x6e"), "\x5c\x786e", join(files, "\x5c\x786e"))}\n' fourth\x6esecond\x6ethird $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", "\x5c\x786e"))}\n' fourth\x6esecond\x6ethird $ hg log -R a -r 8 --template '{join(files, ifeq(branch, "default", r"\x5c\x786e"))}\n' fourth\x5c\x786esecond\x5c\x786ethird $ hg log -R a -r 3:4 --template '{rev}:{sub(if("1", "\x6e"), ifeq(branch, "foo", r"\x5c\x786e", "\x5c\x786e"), desc)}\n' 3:\x6eo user, \x6eo domai\x6e 4:\x5c\x786eew bra\x5c\x786ech Test quotes in nested expression are evaluated just like a $(command) substitution in POSIX shells: $ hg log -R a -r 8 -T '{"{"{rev}:{node|short}"}"}\n' 8:95c24699272e $ hg log -R a -r 8 -T '{"{"\{{rev}} \"{node|short}\""}"}\n' {8} "95c24699272e" Test recursive evaluation: $ hg init r $ cd r $ echo a > a $ hg ci -Am '{rev}' adding a $ hg log -r 0 --template '{if(rev, desc)}\n' {rev} $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n' test 0 $ hg branch -q 'text.{rev}' $ echo aa >> aa $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped' $ hg log -l1 --template '{fill(desc, "20", author, branch)}' {node|short}desc to text.{rev}be wrapped text.{rev}desc to be text.{rev}wrapped (no-eol) $ hg log -l1 --template '{fill(desc, "20", "{node|short}:", "text.{rev}:")}' bcc7ff960b8e:desc to text.1:be wrapped text.1:desc to be text.1:wrapped (no-eol) $ hg log -l1 -T '{fill(desc, date, "", "")}\n' hg: parse error: fill expects an integer width [255] $ COLUMNS=25 hg log -l1 --template '{fill(desc, termwidth, "{node|short}:", "termwidth.{rev}:")}' bcc7ff960b8e:desc to be termwidth.1:wrapped desc termwidth.1:to be wrapped (no-eol) $ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}' {node|short} (no-eol) $ hg log -l 1 --template '{sub(r"[0-9]", "-", "{node|short}")}' bcc-ff---b-e (no-eol) $ cat >> .hg/hgrc < [extensions] > color= > [color] > mode=ansi > text.{rev} = red > text.1 = green > EOF $ hg log --color=always -l 1 --template '{label(branch, "text\n")}' \x1b[0;31mtext\x1b[0m (esc) $ hg log --color=always -l 1 --template '{label("text.{rev}", "text\n")}' \x1b[0;32mtext\x1b[0m (esc) color effect can be specified without quoting: $ hg log --color=always -l 1 --template '{label(red, "text\n")}' \x1b[0;31mtext\x1b[0m (esc) color effects can be nested (issue5413) $ hg debugtemplate --color=always \ > '{label(red, "red{label(magenta, "ma{label(cyan, "cyan")}{label(yellow, "yellow")}genta")}")}\n' \x1b[0;31mred\x1b[0;35mma\x1b[0;36mcyan\x1b[0m\x1b[0;31m\x1b[0;35m\x1b[0;33myellow\x1b[0m\x1b[0;31m\x1b[0;35mgenta\x1b[0m (esc) pad() should interact well with color codes (issue5416) $ hg debugtemplate --color=always \ > '{pad(label(red, "red"), 5, label(cyan, "-"))}\n' \x1b[0;31mred\x1b[0m\x1b[0;36m-\x1b[0m\x1b[0;36m-\x1b[0m (esc) label should be no-op if color is disabled: $ hg log --color=never -l 1 --template '{label(red, "text\n")}' text $ hg log --config extensions.color=! -l 1 --template '{label(red, "text\n")}' text Test branches inside if statement: $ hg log -r 0 --template '{if(branches, "yes", "no")}\n' no Test dict constructor: $ hg log -r 0 -T '{dict(y=node|short, x=rev)}\n' y=f7769ec2ab97 x=0 $ hg log -r 0 -T '{dict(x=rev, y=node|short) % "{key}={value}\n"}' x=0 y=f7769ec2ab97 $ hg log -r 0 -T '{dict(x=rev, y=node|short)|json}\n' {"x": 0, "y": "f7769ec2ab97"} $ hg log -r 0 -T '{dict()|json}\n' {} $ hg log -r 0 -T '{dict(rev, node=node|short)}\n' rev=0 node=f7769ec2ab97 $ hg log -r 0 -T '{dict(rev, node|short)}\n' rev=0 node=f7769ec2ab97 $ hg log -r 0 -T '{dict(rev, rev=rev)}\n' hg: parse error: duplicated dict key 'rev' inferred [255] $ hg log -r 0 -T '{dict(node, node|short)}\n' hg: parse error: duplicated dict key 'node' inferred [255] $ hg log -r 0 -T '{dict(1 + 2)}' hg: parse error: dict key cannot be inferred [255] $ hg log -r 0 -T '{dict(x=rev, x=node)}' hg: parse error: dict got multiple values for keyword argument 'x' [255] Test get function: $ hg log -r 0 --template '{get(extras, "branch")}\n' default $ hg log -r 0 --template '{get(extras, "br{"anch"}")}\n' default $ hg log -r 0 --template '{get(files, "should_fail")}\n' hg: parse error: get() expects a dict as first argument [255] Test json filter applied to hybrid object: $ hg log -r0 -T '{files|json}\n' ["a"] $ hg log -r0 -T '{extras|json}\n' {"branch": "default"} Test localdate(date, tz) function: $ TZ=JST-09 hg log -r0 -T '{date|localdate|isodate}\n' 1970-01-01 09:00 +0900 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "UTC")|isodate}\n' 1970-01-01 00:00 +0000 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "blahUTC")|isodate}\n' hg: parse error: localdate expects a timezone [255] $ TZ=JST-09 hg log -r0 -T '{localdate(date, "+0200")|isodate}\n' 1970-01-01 02:00 +0200 $ TZ=JST-09 hg log -r0 -T '{localdate(date, "0")|isodate}\n' 1970-01-01 00:00 +0000 $ TZ=JST-09 hg log -r0 -T '{localdate(date, 0)|isodate}\n' 1970-01-01 00:00 +0000 $ hg log -r0 -T '{localdate(date, "invalid")|isodate}\n' hg: parse error: localdate expects a timezone [255] $ hg log -r0 -T '{localdate(date, date)|isodate}\n' hg: parse error: localdate expects a timezone [255] Test shortest(node) function: $ echo b > b $ hg ci -qAm b $ hg log --template '{shortest(node)}\n' e777 bcc7 f776 $ hg log --template '{shortest(node, 10)}\n' e777603221 bcc7ff960b f7769ec2ab $ hg log --template '{node|shortest}\n' -l1 e777 $ hg log -r 0 -T '{shortest(node, "1{"0"}")}\n' f7769ec2ab $ hg log -r 0 -T '{shortest(node, "not an int")}\n' hg: parse error: shortest() expects an integer minlength [255] $ hg log -r 'wdir()' -T '{node|shortest}\n' ffff $ cd .. Test shortest(node) with the repo having short hash collision: $ hg init hashcollision $ cd hashcollision $ cat <> .hg/hgrc > [experimental] > evolution.createmarkers=True > EOF $ echo 0 > a $ hg ci -qAm 0 $ for i in 17 129 248 242 480 580 617 1057 2857 4025; do > hg up -q 0 > echo $i > a > hg ci -qm $i > done $ hg up -q null $ hg log -r0: -T '{rev}:{node}\n' 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a 1:11424df6dc1dd4ea255eae2b58eaca7831973bbc 2:11407b3f1b9c3e76a79c1ec5373924df096f0499 3:11dd92fe0f39dfdaacdaa5f3997edc533875cfc4 4:10776689e627b465361ad5c296a20a487e153ca4 5:a00be79088084cb3aff086ab799f8790e01a976b 6:a0b0acd79b4498d0052993d35a6a748dd51d13e6 7:a0457b3450b8e1b778f1163b31a435802987fe5d 8:c56256a09cd28e5764f32e8e2810d0f01e2e357a 9:c5623987d205cd6d9d8389bfc40fff9dbb670b48 10:c562ddd9c94164376c20b86b0b4991636a3bf84f $ hg debugobsolete a00be79088084cb3aff086ab799f8790e01a976b obsoleted 1 changesets $ hg debugobsolete c5623987d205cd6d9d8389bfc40fff9dbb670b48 obsoleted 1 changesets $ hg debugobsolete c562ddd9c94164376c20b86b0b4991636a3bf84f obsoleted 1 changesets nodes starting with '11' (we don't have the revision number '11' though) $ hg log -r 1:3 -T '{rev}:{shortest(node, 0)}\n' 1:1142 2:1140 3:11d '5:a00' is hidden, but still we have two nodes starting with 'a0' $ hg log -r 6:7 -T '{rev}:{shortest(node, 0)}\n' 6:a0b 7:a04 node '10' conflicts with the revision number '10' even if it is hidden (we could exclude hidden revision numbers, but currently we don't) $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n' 4:107 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n' --hidden 4:107 node 'c562' should be unique if the other 'c562' nodes are hidden (but we don't try the slow path to filter out hidden nodes for now) $ hg log -r 8 -T '{rev}:{node|shortest}\n' 8:c5625 $ hg log -r 8:10 -T '{rev}:{node|shortest}\n' --hidden 8:c5625 9:c5623 10:c562d $ cd .. Test pad function $ cd r $ hg log --template '{pad(rev, 20)} {author|user}\n' 2 test 1 {node|short} 0 test $ hg log --template '{pad(rev, 20, " ", True)} {author|user}\n' 2 test 1 {node|short} 0 test $ hg log --template '{pad(rev, 20, "-", False)} {author|user}\n' 2------------------- test 1------------------- {node|short} 0------------------- test Test template string in pad function $ hg log -r 0 -T '{pad("\{{rev}}", 10)} {author|user}\n' {0} test $ hg log -r 0 -T '{pad(r"\{rev}", 10)} {author|user}\n' \{rev} test Test width argument passed to pad function $ hg log -r 0 -T '{pad(rev, "1{"0"}")} {author|user}\n' 0 test $ hg log -r 0 -T '{pad(rev, "not an int")}\n' hg: parse error: pad() expects an integer width [255] Test invalid fillchar passed to pad function $ hg log -r 0 -T '{pad(rev, 10, "")}\n' hg: parse error: pad() expects a single fill character [255] $ hg log -r 0 -T '{pad(rev, 10, "--")}\n' hg: parse error: pad() expects a single fill character [255] Test boolean argument passed to pad function no crash $ hg log -r 0 -T '{pad(rev, 10, "-", "f{"oo"}")}\n' ---------0 string/literal $ hg log -r 0 -T '{pad(rev, 10, "-", "false")}\n' ---------0 $ hg log -r 0 -T '{pad(rev, 10, "-", false)}\n' 0--------- $ hg log -r 0 -T '{pad(rev, 10, "-", "")}\n' 0--------- unknown keyword is evaluated to '' $ hg log -r 0 -T '{pad(rev, 10, "-", unknownkeyword)}\n' 0--------- Test separate function $ hg log -r 0 -T '{separate("-", "", "a", "b", "", "", "c", "")}\n' a-b-c $ hg log -r 0 -T '{separate(" ", "{rev}:{node|short}", author|user, branch)}\n' 0:f7769ec2ab97 test default $ hg log -r 0 --color=always -T '{separate(" ", "a", label(red, "b"), "c", label(red, ""), "d")}\n' a \x1b[0;31mb\x1b[0m c d (esc) Test boolean expression/literal passed to if function $ hg log -r 0 -T '{if(rev, "rev 0 is True")}\n' rev 0 is True $ hg log -r 0 -T '{if(0, "literal 0 is True as well")}\n' literal 0 is True as well $ hg log -r 0 -T '{if("", "", "empty string is False")}\n' empty string is False $ hg log -r 0 -T '{if(revset(r"0 - 0"), "", "empty list is False")}\n' empty list is False $ hg log -r 0 -T '{if(true, "true is True")}\n' true is True $ hg log -r 0 -T '{if(false, "", "false is False")}\n' false is False $ hg log -r 0 -T '{if("false", "non-empty string is True")}\n' non-empty string is True Test ifcontains function $ hg log --template '{rev} {ifcontains(rev, "2 two 0", "is in the string", "is not")}\n' 2 is in the string 1 is not 0 is in the string $ hg log -T '{rev} {ifcontains(rev, "2 two{" 0"}", "is in the string", "is not")}\n' 2 is in the string 1 is not 0 is in the string $ hg log --template '{rev} {ifcontains("a", file_adds, "added a", "did not add a")}\n' 2 did not add a 1 did not add a 0 added a $ hg log --debug -T '{rev}{ifcontains(1, parents, " is parent of 1")}\n' 2 is parent of 1 1 0 Test revset function $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n' 2 current rev 1 not current rev 0 not current rev $ hg log --template '{rev} {ifcontains(rev, revset(". + .^"), "match rev", "not match rev")}\n' 2 match rev 1 match rev 0 not match rev $ hg log -T '{ifcontains(desc, revset(":"), "", "type not match")}\n' -l1 type not match $ hg log --template '{rev} Parents: {revset("parents(%s)", rev)}\n' 2 Parents: 1 1 Parents: 0 0 Parents: $ cat >> .hg/hgrc < [revsetalias] > myparents(\$1) = parents(\$1) > EOF $ hg log --template '{rev} Parents: {revset("myparents(%s)", rev)}\n' 2 Parents: 1 1 Parents: 0 0 Parents: $ hg log --template 'Rev: {rev}\n{revset("::%s", rev) % "Ancestor: {revision}\n"}\n' Rev: 2 Ancestor: 0 Ancestor: 1 Ancestor: 2 Rev: 1 Ancestor: 0 Ancestor: 1 Rev: 0 Ancestor: 0 $ hg log --template '{revset("TIP"|lower)}\n' -l1 2 $ hg log -T '{revset("%s", "t{"ip"}")}\n' -l1 2 a list template is evaluated for each item of revset/parents $ hg log -T '{rev} p: {revset("p1(%s)", rev) % "{rev}:{node|short}"}\n' 2 p: 1:bcc7ff960b8e 1 p: 0:f7769ec2ab97 0 p: $ hg log --debug -T '{rev} p:{parents % " {rev}:{node|short}"}\n' 2 p: 1:bcc7ff960b8e -1:000000000000 1 p: 0:f7769ec2ab97 -1:000000000000 0 p: -1:000000000000 -1:000000000000 therefore, 'revcache' should be recreated for each rev $ hg log -T '{rev} {file_adds}\np {revset("p1(%s)", rev) % "{file_adds}"}\n' 2 aa b p 1 p a 0 a p $ hg log --debug -T '{rev} {file_adds}\np {parents % "{file_adds}"}\n' 2 aa b p 1 p a 0 a p a revset item must be evaluated as an integer revision, not an offset from tip $ hg log -l 1 -T '{revset("null") % "{rev}:{node|short}"}\n' -1:000000000000 $ hg log -l 1 -T '{revset("%s", "null") % "{rev}:{node|short}"}\n' -1:000000000000 join() should pick '{rev}' from revset items: $ hg log -R ../a -T '{join(revset("parents(%d)", rev), ", ")}\n' -r6 4, 5 on the other hand, parents are formatted as '{rev}:{node|formatnode}' by default. join() should agree with the default formatting: $ hg log -R ../a -T '{join(parents, ", ")}\n' -r6 5:13207e5a10d9, 4:bbe44766e73d $ hg log -R ../a -T '{join(parents, ",\n")}\n' -r6 --debug 5:13207e5a10d9fd28ec424934298e176197f2c67f, 4:bbe44766e73d5f11ed2177f1838de10c53ef3e74 Invalid arguments passed to revset() $ hg log -T '{revset("%whatever", 0)}\n' hg: parse error: unexpected revspec format character w [255] $ hg log -T '{revset("%lwhatever", files)}\n' hg: parse error: unexpected revspec format character w [255] $ hg log -T '{revset("%s %s", 0)}\n' hg: parse error: missing argument for revspec [255] $ hg log -T '{revset("", 0)}\n' hg: parse error: too many revspec arguments specified [255] $ hg log -T '{revset("%s", 0, 1)}\n' hg: parse error: too many revspec arguments specified [255] $ hg log -T '{revset("%", 0)}\n' hg: parse error: incomplete revspec format character [255] $ hg log -T '{revset("%l", 0)}\n' hg: parse error: incomplete revspec format character [255] $ hg log -T '{revset("%d", 'foo')}\n' hg: parse error: invalid argument for revspec [255] $ hg log -T '{revset("%ld", files)}\n' hg: parse error: invalid argument for revspec [255] $ hg log -T '{revset("%ls", 0)}\n' hg: parse error: invalid argument for revspec [255] $ hg log -T '{revset("%b", 'foo')}\n' hg: parse error: invalid argument for revspec [255] $ hg log -T '{revset("%lb", files)}\n' hg: parse error: invalid argument for revspec [255] $ hg log -T '{revset("%r", 0)}\n' hg: parse error: invalid argument for revspec [255] Test files function $ hg log -T "{rev}\n{join(files('*'), '\n')}\n" 2 a aa b 1 a 0 a $ hg log -T "{rev}\n{join(files('aa'), '\n')}\n" 2 aa 1 0 Test relpath function $ hg log -r0 -T '{files % "{file|relpath}\n"}' a $ cd .. $ hg log -R r -r0 -T '{files % "{file|relpath}\n"}' r/a $ cd r Test active bookmark templating $ hg book foo $ hg book bar $ hg log --template "{rev} {bookmarks % '{bookmark}{ifeq(bookmark, active, \"*\")} '}\n" 2 bar* foo 1 0 $ hg log --template "{rev} {activebookmark}\n" 2 bar 1 0 $ hg bookmarks --inactive bar $ hg log --template "{rev} {activebookmark}\n" 2 1 0 $ hg book -r1 baz $ hg log --template "{rev} {join(bookmarks, ' ')}\n" 2 bar foo 1 baz 0 $ hg log --template "{rev} {ifcontains('foo', bookmarks, 't', 'f')}\n" 2 t 1 f 0 f Test namespaces dict $ hg --config extensions.revnamesext=$TESTDIR/revnamesext.py log -T '{rev}\n{namespaces % " {namespace} color={colorname} builtin={builtin}\n {join(names, ",")}\n"}\n' 2 bookmarks color=bookmark builtin=True bar,foo tags color=tag builtin=True tip branches color=branch builtin=True text.{rev} revnames color=revname builtin=False r2 1 bookmarks color=bookmark builtin=True baz tags color=tag builtin=True branches color=branch builtin=True text.{rev} revnames color=revname builtin=False r1 0 bookmarks color=bookmark builtin=True tags color=tag builtin=True branches color=branch builtin=True default revnames color=revname builtin=False r0 $ hg log -r2 -T '{namespaces % "{namespace}: {names}\n"}' bookmarks: bar foo tags: tip branches: text.{rev} $ hg log -r2 -T '{namespaces % "{namespace}:\n{names % " {name}\n"}"}' bookmarks: bar foo tags: tip branches: text.{rev} $ hg log -r2 -T '{get(namespaces, "bookmarks") % "{name}\n"}' bar foo $ hg log -r2 -T '{namespaces.bookmarks % "{bookmark}\n"}' bar foo Test stringify on sub expressions $ cd .. $ hg log -R a -r 8 --template '{join(files, if("1", if("1", ", ")))}\n' fourth, second, third $ hg log -R a -r 8 --template '{strip(if("1", if("1", "-abc-")), if("1", if("1", "-")))}\n' abc Test splitlines $ hg log -Gv -R a --template "{splitlines(desc) % 'foo {line}\n'}" @ foo Modify, add, remove, rename | o foo future | o foo third | o foo second o foo merge |\ | o foo new head | | o | foo new branch |/ o foo no user, no domain | o foo no person | o foo other 1 | foo other 2 | foo | foo other 3 o foo line 1 foo line 2 $ hg log -R a -r0 -T '{desc|splitlines}\n' line 1 line 2 $ hg log -R a -r0 -T '{join(desc|splitlines, "|")}\n' line 1|line 2 Test startswith $ hg log -Gv -R a --template "{startswith(desc)}" hg: parse error: startswith expects two arguments [255] $ hg log -Gv -R a --template "{startswith('line', desc)}" @ | o | o | o o |\ | o | | o | |/ o | o | o | o line 1 line 2 Test bad template with better error message $ hg log -Gv -R a --template '{desc|user()}' hg: parse error: expected a symbol, got 'func' [255] Test word function (including index out of bounds graceful failure) $ hg log -Gv -R a --template "{word('1', desc)}" @ add, | o | o | o o |\ | o head | | o | branch |/ o user, | o person | o 1 | o 1 Test word third parameter used as splitter $ hg log -Gv -R a --template "{word('0', desc, 'o')}" @ M | o future | o third | o sec o merge |\ | o new head | | o | new branch |/ o n | o n | o | o line 1 line 2 Test word error messages for not enough and too many arguments $ hg log -Gv -R a --template "{word('0')}" hg: parse error: word expects two or three arguments, got 1 [255] $ hg log -Gv -R a --template "{word('0', desc, 'o', 'h', 'b', 'o', 'y')}" hg: parse error: word expects two or three arguments, got 7 [255] Test word for integer literal $ hg log -R a --template "{word(2, desc)}\n" -r0 line Test word for invalid numbers $ hg log -Gv -R a --template "{word('a', desc)}" hg: parse error: word expects an integer index [255] Test word for out of range $ hg log -R a --template "{word(10000, desc)}" $ hg log -R a --template "{word(-10000, desc)}" Test indent and not adding to empty lines $ hg log -T "-----\n{indent(desc, '>> ', ' > ')}\n" -r 0:1 -R a ----- > line 1 >> line 2 ----- > other 1 >> other 2 >> other 3 Test with non-strings like dates $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a 1200000.00 1300000.00 Test broken string escapes: $ hg log -T "bogus\\" -R a hg: parse error: trailing \ in string [255] $ hg log -T "\\xy" -R a hg: parse error: invalid \x escape [255] json filter should escape HTML tags so that the output can be embedded in hgweb: $ hg log -T "{''|json}\n" -R a -l1 "\u003cfoo@example.org\u003e" Templater supports aliases of symbol and func() styles: $ hg clone -q a aliases $ cd aliases $ cat <> .hg/hgrc > [templatealias] > r = rev > rn = "{r}:{node|short}" > status(c, files) = files % "{c} {file}\n" > utcdate(d) = localdate(d, "UTC") > EOF $ hg debugtemplate -vr0 '{rn} {utcdate(date)|isodate}\n' (template (symbol 'rn') (string ' ') (| (func (symbol 'utcdate') (symbol 'date')) (symbol 'isodate')) (string '\n')) * expanded: (template (template (symbol 'rev') (string ':') (| (symbol 'node') (symbol 'short'))) (string ' ') (| (func (symbol 'localdate') (list (symbol 'date') (string 'UTC'))) (symbol 'isodate')) (string '\n')) 0:1e4e1b8f71e0 1970-01-12 13:46 +0000 $ hg debugtemplate -vr0 '{status("A", file_adds)}' (template (func (symbol 'status') (list (string 'A') (symbol 'file_adds')))) * expanded: (template (% (symbol 'file_adds') (template (string 'A') (string ' ') (symbol 'file') (string '\n')))) A a A unary function alias can be called as a filter: $ hg debugtemplate -vr0 '{date|utcdate|isodate}\n' (template (| (| (symbol 'date') (symbol 'utcdate')) (symbol 'isodate')) (string '\n')) * expanded: (template (| (func (symbol 'localdate') (list (symbol 'date') (string 'UTC'))) (symbol 'isodate')) (string '\n')) 1970-01-12 13:46 +0000 Aliases should be applied only to command arguments and templates in hgrc. Otherwise, our stock styles and web templates could be corrupted: $ hg log -r0 -T '{rn} {utcdate(date)|isodate}\n' 0:1e4e1b8f71e0 1970-01-12 13:46 +0000 $ hg log -r0 --config ui.logtemplate='"{rn} {utcdate(date)|isodate}\n"' 0:1e4e1b8f71e0 1970-01-12 13:46 +0000 $ cat < tmpl > changeset = 'nothing expanded:{rn}\n' > EOF $ hg log -r0 --style ./tmpl nothing expanded: Aliases in formatter: $ hg branches -T '{pad(branch, 7)} {rn}\n' default 6:d41e714fe50d foo 4:bbe44766e73d Aliases should honor HGPLAIN: $ HGPLAIN= hg log -r0 -T 'nothing expanded:{rn}\n' nothing expanded: $ HGPLAINEXCEPT=templatealias hg log -r0 -T '{rn}\n' 0:1e4e1b8f71e0 Unparsable alias: $ hg debugtemplate --config templatealias.bad='x(' -v '{bad}' (template (symbol 'bad')) abort: bad definition of template alias "bad": at 2: not a prefix: end [255] $ hg log --config templatealias.bad='x(' -T '{bad}' abort: bad definition of template alias "bad": at 2: not a prefix: end [255] $ cd .. Set up repository for non-ascii encoding tests: $ hg init nonascii $ cd nonascii $ $PYTHON < open('latin1', 'w').write('\xe9') > open('utf-8', 'w').write('\xc3\xa9') > EOF $ HGENCODING=utf-8 hg branch -q `cat utf-8` $ HGENCODING=utf-8 hg ci -qAm "non-ascii branch: `cat utf-8`" utf-8 json filter should try round-trip conversion to utf-8: $ HGENCODING=ascii hg log -T "{branch|json}\n" -r0 "\u00e9" $ HGENCODING=ascii hg log -T "{desc|json}\n" -r0 "non-ascii branch: \u00e9" json filter takes input as utf-8b: $ HGENCODING=ascii hg log -T "{'`cat utf-8`'|json}\n" -l1 "\u00e9" $ HGENCODING=ascii hg log -T "{'`cat latin1`'|json}\n" -l1 "\udce9" utf8 filter: $ HGENCODING=ascii hg log -T "round-trip: {branch|utf8|hex}\n" -r0 round-trip: c3a9 $ HGENCODING=latin1 hg log -T "decoded: {'`cat latin1`'|utf8|hex}\n" -l1 decoded: c3a9 $ HGENCODING=ascii hg log -T "replaced: {'`cat latin1`'|utf8|hex}\n" -l1 abort: decoding near * (glob) [255] $ hg log -T "invalid type: {rev|utf8}\n" -r0 abort: template filter 'utf8' is not compatible with keyword 'rev' [255] pad width: $ HGENCODING=utf-8 hg debugtemplate "{pad('`cat utf-8`', 2, '-')}\n" \xc3\xa9- (esc) $ cd .. Test that template function in extension is registered as expected $ cd a $ cat < $TESTTMP/customfunc.py > from mercurial import registrar > > templatefunc = registrar.templatefunc() > > @templatefunc('custom()') > def custom(context, mapping, args): > return 'custom' > EOF $ cat < .hg/hgrc > [extensions] > customfunc = $TESTTMP/customfunc.py > EOF $ hg log -r . -T "{custom()}\n" --config customfunc.enabled=true custom $ cd .. Test 'graphwidth' in 'hg log' on various topologies. The key here is that the printed graphwidths 3, 5, 7, etc. should all line up in their respective columns. We don't care about other aspects of the graph rendering here. $ hg init graphwidth $ cd graphwidth $ wrappabletext="a a a a a a a a a a a a" $ printf "first\n" > file $ hg add file $ hg commit -m "$wrappabletext" $ printf "first\nsecond\n" > file $ hg commit -m "$wrappabletext" $ hg checkout 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ printf "third\nfirst\n" > file $ hg commit -m "$wrappabletext" created new head $ hg merge merging file 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg log --graph -T "{graphwidth}" @ 3 | | @ 5 |/ o 3 $ hg commit -m "$wrappabletext" $ hg log --graph -T "{graphwidth}" @ 5 |\ | o 5 | | o | 5 |/ o 3 $ hg checkout 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ printf "third\nfirst\nsecond\n" > file $ hg commit -m "$wrappabletext" created new head $ hg log --graph -T "{graphwidth}" @ 3 | | o 7 | |\ +---o 7 | | | o 5 |/ o 3 $ hg log --graph -T "{graphwidth}" -r 3 o 5 |\ ~ ~ $ hg log --graph -T "{graphwidth}" -r 1 o 3 | ~ $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg commit -m "$wrappabletext" $ printf "seventh\n" >> file $ hg commit -m "$wrappabletext" $ hg log --graph -T "{graphwidth}" @ 3 | o 5 |\ | o 5 | | o | 7 |\ \ | o | 7 | |/ o / 5 |/ o 3 The point of graphwidth is to allow wrapping that accounts for the space taken by the graph. $ COLUMNS=10 hg log --graph -T "{fill(desc, termwidth - graphwidth)}" @ a a a a | a a a a | a a a a o a a a |\ a a a | | a a a | | a a a | o a a a | | a a a | | a a a | | a a a o | a a |\ \ a a | | | a a | | | a a | | | a a | | | a a | o | a a | |/ a a | | a a | | a a | | a a | | a a o | a a a |/ a a a | a a a | a a a o a a a a a a a a a a a a Something tricky happens when there are elided nodes; the next drawn row of edges can be more than one column wider, but the graph width only increases by one column. The remaining columns are added in between the nodes. $ hg log --graph -T "{graphwidth}" -r "0|2|4|5" o 5 |\ | \ | :\ o : : 7 :/ / : o 5 :/ o 3 $ cd .. mercurial-4.5.3/tests/test-hgwebdir-paths.py0000644015407300116100000000222113261161234020773 0ustar augieeng00000000000000from __future__ import absolute_import import os from mercurial import ( hg, ui as uimod, ) from mercurial.hgweb import ( hgwebdir_mod, ) hgwebdir = hgwebdir_mod.hgwebdir os.mkdir('webdir') os.chdir('webdir') webdir = os.path.realpath('.') u = uimod.ui.load() hg.repository(u, 'a', create=1) hg.repository(u, 'b', create=1) os.chdir('b') hg.repository(u, 'd', create=1) os.chdir('..') hg.repository(u, 'c', create=1) os.chdir('..') paths = {'t/a/': '%s/a' % webdir, 'b': '%s/b' % webdir, 'coll': '%s/*' % webdir, 'rcoll': '%s/**' % webdir} config = os.path.join(webdir, 'hgwebdir.conf') configfile = open(config, 'w') configfile.write('[paths]\n') for k, v in paths.items(): configfile.write('%s = %s\n' % (k, v)) configfile.close() confwd = hgwebdir(config) dictwd = hgwebdir(paths) assert len(confwd.repos) == len(dictwd.repos), 'different numbers' assert len(confwd.repos) == 9, 'expected 9 repos, found %d' % len(confwd.repos) found = dict(confwd.repos) for key, path in dictwd.repos: assert key in found, 'repository %s was not found' % key assert found[key] == path, 'different paths for repo %s' % key mercurial-4.5.3/tests/test-bundle2-format.t0000644015407300116100000015217613261161234020536 0ustar augieeng00000000000000This test is dedicated to test the bundle2 container format It test multiple existing parts to test different feature of the container. You probably do not need to touch this test unless you change the binary encoding of the bundle2 format itself. Create an extension to test bundle2 API $ cat > bundle2.py << EOF > """A small extension to test bundle2 implementation > > This extension allows detailed testing of the various bundle2 API and > behaviors. > """ > import gc > import os > import sys > from mercurial import util > from mercurial import bundle2 > from mercurial import scmutil > from mercurial import discovery > from mercurial import changegroup > from mercurial import error > from mercurial import obsolete > from mercurial import pycompat > from mercurial import registrar > > > try: > import msvcrt > msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) > except ImportError: > pass > > cmdtable = {} > command = registrar.command(cmdtable) > > ELEPHANTSSONG = b"""Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko > Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko > Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.""" > assert len(ELEPHANTSSONG) == 178 # future test say 178 bytes, trust it. > > @bundle2.parthandler(b'test:song') > def songhandler(op, part): > """handle a "test:song" bundle2 part, printing the lyrics on stdin""" > op.ui.write(b'The choir starts singing:\n') > verses = 0 > for line in part.read().split(b'\n'): > op.ui.write(b' %s\n' % line) > verses += 1 > op.records.add(b'song', {b'verses': verses}) > > @bundle2.parthandler(b'test:ping') > def pinghandler(op, part): > op.ui.write(b'received ping request (id %i)\n' % part.id) > if op.reply is not None and b'ping-pong' in op.reply.capabilities: > op.ui.write_err(b'replying to ping request (id %i)\n' % part.id) > op.reply.newpart(b'test:pong', [(b'in-reply-to', b'%d' % part.id)], > mandatory=False) > > @bundle2.parthandler(b'test:debugreply') > def debugreply(op, part): > """print data about the capacity of the bundle reply""" > if op.reply is None: > op.ui.write(b'debugreply: no reply\n') > else: > op.ui.write(b'debugreply: capabilities:\n') > for cap in sorted(op.reply.capabilities): > op.ui.write(b"debugreply: '%s'\n" % cap) > for val in op.reply.capabilities[cap]: > op.ui.write(b"debugreply: '%s'\n" % val) > > @command(b'bundle2', > [(b'', b'param', [], b'stream level parameter'), > (b'', b'unknown', False, b'include an unknown mandatory part in the bundle'), > (b'', b'unknownparams', False, b'include an unknown part parameters in the bundle'), > (b'', b'parts', False, b'include some arbitrary parts to the bundle'), > (b'', b'reply', False, b'produce a reply bundle'), > (b'', b'pushrace', False, b'includes a check:head part with unknown nodes'), > (b'', b'genraise', False, b'includes a part that raise an exception during generation'), > (b'', b'timeout', False, b'emulate a timeout during bundle generation'), > (b'r', b'rev', [], b'includes those changeset in the bundle'), > (b'', b'compress', b'', b'compress the stream'),], > b'[OUTPUTFILE]') > def cmdbundle2(ui, repo, path=None, **opts): > """write a bundle2 container on standard output""" > bundler = bundle2.bundle20(ui) > for p in opts['param']: > p = p.split(b'=', 1) > try: > bundler.addparam(*p) > except ValueError as exc: > raise error.Abort('%s' % exc) > > if opts['compress']: > bundler.setcompression(opts['compress']) > > if opts['reply']: > capsstring = b'ping-pong\nelephants=babar,celeste\ncity%3D%21=celeste%2Cville' > bundler.newpart(b'replycaps', data=capsstring) > > if opts['pushrace']: > # also serve to test the assignement of data outside of init > part = bundler.newpart(b'check:heads') > part.data = b'01234567890123456789' > > revs = opts['rev'] > if 'rev' in opts: > revs = scmutil.revrange(repo, opts['rev']) > if revs: > # very crude version of a changegroup part creation > bundled = repo.revs('%ld::%ld', revs, revs) > headmissing = [c.node() for c in repo.set('heads(%ld)', revs)] > headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)] > outgoing = discovery.outgoing(repo, headcommon, headmissing) > cg = changegroup.makechangegroup(repo, outgoing, b'01', > b'test:bundle2') > bundler.newpart(b'changegroup', data=cg.getchunks(), > mandatory=False) > > if opts['parts']: > bundler.newpart(b'test:empty', mandatory=False) > # add a second one to make sure we handle multiple parts > bundler.newpart(b'test:empty', mandatory=False) > bundler.newpart(b'test:song', data=ELEPHANTSSONG, mandatory=False) > bundler.newpart(b'test:debugreply', mandatory=False) > mathpart = bundler.newpart(b'test:math') > mathpart.addparam(b'pi', b'3.14') > mathpart.addparam(b'e', b'2.72') > mathpart.addparam(b'cooking', b'raw', mandatory=False) > mathpart.data = b'42' > mathpart.mandatory = False > # advisory known part with unknown mandatory param > bundler.newpart(b'test:song', [(b'randomparam', b'')], mandatory=False) > if opts['unknown']: > bundler.newpart(b'test:unknown', data=b'some random content') > if opts['unknownparams']: > bundler.newpart(b'test:song', [(b'randomparams', b'')]) > if opts['parts']: > bundler.newpart(b'test:ping', mandatory=False) > if opts['genraise']: > def genraise(): > yield b'first line\n' > raise RuntimeError('Someone set up us the bomb!') > bundler.newpart(b'output', data=genraise(), mandatory=False) > > if path is None: > file = pycompat.stdout > else: > file = open(path, 'wb') > > if opts['timeout']: > bundler.newpart(b'test:song', data=ELEPHANTSSONG, mandatory=False) > for idx, junk in enumerate(bundler.getchunks()): > ui.write(b'%d chunk\n' % idx) > if idx > 4: > # This throws a GeneratorExit inside the generator, which > # can cause problems if the exception-recovery code is > # too zealous. It's important for this test that the break > # occur while we're in the middle of a part. > break > gc.collect() > ui.write(b'fake timeout complete.\n') > return > try: > for chunk in bundler.getchunks(): > file.write(chunk) > except RuntimeError as exc: > raise error.Abort(exc) > finally: > file.flush() > > @command(b'unbundle2', [], b'') > def cmdunbundle2(ui, repo, replypath=None): > """process a bundle2 stream from stdin on the current repo""" > try: > tr = None > lock = repo.lock() > tr = repo.transaction(b'processbundle') > try: > unbundler = bundle2.getunbundler(ui, pycompat.stdin) > op = bundle2.processbundle(repo, unbundler, lambda: tr) > tr.close() > except error.BundleValueError as exc: > raise error.Abort('missing support for %s' % exc) > except error.PushRaced as exc: > raise error.Abort('push race: %s' % exc) > finally: > if tr is not None: > tr.release() > lock.release() > remains = pycompat.stdin.read() > ui.write(b'%i unread bytes\n' % len(remains)) > if op.records[b'song']: > totalverses = sum(r[b'verses'] for r in op.records[b'song']) > ui.write(b'%i total verses sung\n' % totalverses) > for rec in op.records[b'changegroup']: > ui.write(b'addchangegroup return: %i\n' % rec[b'return']) > if op.reply is not None and replypath is not None: > with open(replypath, 'wb') as file: > for chunk in op.reply.getchunks(): > file.write(chunk) > > @command(b'statbundle2', [], b'') > def cmdstatbundle2(ui, repo): > """print statistic on the bundle2 container read from stdin""" > unbundler = bundle2.getunbundler(ui, pycompat.stdin) > try: > params = unbundler.params > except error.BundleValueError as exc: > raise error.Abort(b'unknown parameters: %s' % exc) > ui.write(b'options count: %i\n' % len(params)) > for key in sorted(params): > ui.write(b'- %s\n' % key) > value = params[key] > if value is not None: > ui.write(b' %s\n' % value) > count = 0 > for p in unbundler.iterparts(): > count += 1 > ui.write(b' :%s:\n' % p.type) > ui.write(b' mandatory: %i\n' % len(p.mandatoryparams)) > ui.write(b' advisory: %i\n' % len(p.advisoryparams)) > ui.write(b' payload: %i bytes\n' % len(p.read())) > ui.write(b'parts count: %i\n' % count) > EOF $ cat >> $HGRCPATH << EOF > [extensions] > bundle2=$TESTTMP/bundle2.py > [experimental] > evolution.createmarkers=True > [ui] > ssh=$PYTHON "$TESTDIR/dummyssh" > logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline} > [web] > push_ssl = false > allow_push = * > [phases] > publish=False > EOF The extension requires a repo (currently unused) $ hg init main $ cd main $ touch a $ hg add a $ hg commit -m 'a' Empty bundle ================= - no option - no parts Test bundling $ hg bundle2 | f --hexdump 0000: 48 47 32 30 00 00 00 00 00 00 00 00 |HG20........| Test timeouts during bundling $ hg bundle2 --timeout --debug --config devel.bundle2.debug=yes bundle2-output-bundle: "HG20", 1 parts total bundle2-output: start emission of HG20 stream 0 chunk bundle2-output: bundle parameter: 1 chunk bundle2-output: start of parts bundle2-output: bundle part: "test:song" bundle2-output-part: "test:song" (advisory) 178 bytes payload bundle2-output: part 0: "test:song" bundle2-output: header chunk size: 16 2 chunk 3 chunk bundle2-output: payload chunk size: 178 4 chunk 5 chunk bundle2-generatorexit fake timeout complete. Test unbundling $ hg bundle2 | hg statbundle2 options count: 0 parts count: 0 Test old style bundle are detected and refused $ hg bundle --all --type v1 ../bundle.hg 1 changesets found $ hg statbundle2 < ../bundle.hg abort: unknown bundle version 10 [255] Test parameters ================= - some options - no parts advisory parameters, no value ------------------------------- Simplest possible parameters form Test generation simple option $ hg bundle2 --param 'caution' | f --hexdump 0000: 48 47 32 30 00 00 00 07 63 61 75 74 69 6f 6e 00 |HG20....caution.| 0010: 00 00 00 |...| Test unbundling $ hg bundle2 --param 'caution' | hg statbundle2 options count: 1 - caution parts count: 0 Test generation multiple option $ hg bundle2 --param 'caution' --param 'meal' | f --hexdump 0000: 48 47 32 30 00 00 00 0c 63 61 75 74 69 6f 6e 20 |HG20....caution | 0010: 6d 65 61 6c 00 00 00 00 |meal....| Test unbundling $ hg bundle2 --param 'caution' --param 'meal' | hg statbundle2 options count: 2 - caution - meal parts count: 0 advisory parameters, with value ------------------------------- Test generation $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants' | f --hexdump 0000: 48 47 32 30 00 00 00 1c 63 61 75 74 69 6f 6e 20 |HG20....caution | 0010: 6d 65 61 6c 3d 76 65 67 61 6e 20 65 6c 65 70 68 |meal=vegan eleph| 0020: 61 6e 74 73 00 00 00 00 |ants....| Test unbundling $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants' | hg statbundle2 options count: 3 - caution - elephants - meal vegan parts count: 0 parameter with special char in value --------------------------------------------------- Test generation $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple | f --hexdump 0000: 48 47 32 30 00 00 00 29 65 25 37 43 25 32 31 25 |HG20...)e%7C%21%| 0010: 32 30 37 2f 3d 62 61 62 61 72 25 32 35 25 32 33 |207/=babar%25%23| 0020: 25 33 44 25 33 44 74 75 74 75 20 73 69 6d 70 6c |%3D%3Dtutu simpl| 0030: 65 00 00 00 00 |e....| Test unbundling $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple | hg statbundle2 options count: 2 - e|! 7/ babar%#==tutu - simple parts count: 0 Test unknown mandatory option --------------------------------------------------- $ hg bundle2 --param 'Gravity' | hg statbundle2 abort: unknown parameters: Stream Parameter - Gravity [255] Test debug output --------------------------------------------------- bundling debug $ hg bundle2 --debug --param 'e|! 7/=babar%#==tutu' --param simple ../out.hg2 --config progress.debug=true --config devel.bundle2.debug=true bundle2-output-bundle: "HG20", (2 params) 0 parts total bundle2-output: start emission of HG20 stream bundle2-output: bundle parameter: e%7C%21%207/=babar%25%23%3D%3Dtutu simple bundle2-output: start of parts bundle2-output: end of bundle file content is ok $ f --hexdump ../out.hg2 ../out.hg2: 0000: 48 47 32 30 00 00 00 29 65 25 37 43 25 32 31 25 |HG20...)e%7C%21%| 0010: 32 30 37 2f 3d 62 61 62 61 72 25 32 35 25 32 33 |207/=babar%25%23| 0020: 25 33 44 25 33 44 74 75 74 75 20 73 69 6d 70 6c |%3D%3Dtutu simpl| 0030: 65 00 00 00 00 |e....| unbundling debug $ hg statbundle2 --debug --config progress.debug=true --config devel.bundle2.debug=true < ../out.hg2 bundle2-input: start processing of HG20 stream bundle2-input: reading bundle2 stream parameters bundle2-input: ignoring unknown parameter e|! 7/ bundle2-input: ignoring unknown parameter simple options count: 2 - e|! 7/ babar%#==tutu - simple bundle2-input: start extraction of bundle2 parts bundle2-input: part header size: 0 bundle2-input: end of bundle2 stream parts count: 0 Test buggy input --------------------------------------------------- empty parameter name $ hg bundle2 --param '' --quiet abort: empty parameter name [255] bad parameter name $ hg bundle2 --param 42babar abort: non letter first character: 42babar [255] Test part ================= $ hg bundle2 --parts ../parts.hg2 --debug --config progress.debug=true --config devel.bundle2.debug=true bundle2-output-bundle: "HG20", 7 parts total bundle2-output: start emission of HG20 stream bundle2-output: bundle parameter: bundle2-output: start of parts bundle2-output: bundle part: "test:empty" bundle2-output-part: "test:empty" (advisory) empty payload bundle2-output: part 0: "test:empty" bundle2-output: header chunk size: 17 bundle2-output: closing payload chunk bundle2-output: bundle part: "test:empty" bundle2-output-part: "test:empty" (advisory) empty payload bundle2-output: part 1: "test:empty" bundle2-output: header chunk size: 17 bundle2-output: closing payload chunk bundle2-output: bundle part: "test:song" bundle2-output-part: "test:song" (advisory) 178 bytes payload bundle2-output: part 2: "test:song" bundle2-output: header chunk size: 16 bundle2-output: payload chunk size: 178 bundle2-output: closing payload chunk bundle2-output: bundle part: "test:debugreply" bundle2-output-part: "test:debugreply" (advisory) empty payload bundle2-output: part 3: "test:debugreply" bundle2-output: header chunk size: 22 bundle2-output: closing payload chunk bundle2-output: bundle part: "test:math" bundle2-output-part: "test:math" (advisory) (params: 2 mandatory 2 advisory) 2 bytes payload bundle2-output: part 4: "test:math" bundle2-output: header chunk size: 43 bundle2-output: payload chunk size: 2 bundle2-output: closing payload chunk bundle2-output: bundle part: "test:song" bundle2-output-part: "test:song" (advisory) (params: 1 mandatory) empty payload bundle2-output: part 5: "test:song" bundle2-output: header chunk size: 29 bundle2-output: closing payload chunk bundle2-output: bundle part: "test:ping" bundle2-output-part: "test:ping" (advisory) empty payload bundle2-output: part 6: "test:ping" bundle2-output: header chunk size: 16 bundle2-output: closing payload chunk bundle2-output: end of bundle $ f --hexdump ../parts.hg2 ../parts.hg2: 0000: 48 47 32 30 00 00 00 00 00 00 00 11 0a 74 65 73 |HG20.........tes| 0010: 74 3a 65 6d 70 74 79 00 00 00 00 00 00 00 00 00 |t:empty.........| 0020: 00 00 00 00 11 0a 74 65 73 74 3a 65 6d 70 74 79 |......test:empty| 0030: 00 00 00 01 00 00 00 00 00 00 00 00 00 10 09 74 |...............t| 0040: 65 73 74 3a 73 6f 6e 67 00 00 00 02 00 00 00 00 |est:song........| 0050: 00 b2 50 61 74 61 6c 69 20 44 69 72 61 70 61 74 |..Patali Dirapat| 0060: 61 2c 20 43 72 6f 6d 64 61 20 43 72 6f 6d 64 61 |a, Cromda Cromda| 0070: 20 52 69 70 61 6c 6f 2c 20 50 61 74 61 20 50 61 | Ripalo, Pata Pa| 0080: 74 61 2c 20 4b 6f 20 4b 6f 20 4b 6f 0a 42 6f 6b |ta, Ko Ko Ko.Bok| 0090: 6f 72 6f 20 44 69 70 6f 75 6c 69 74 6f 2c 20 52 |oro Dipoulito, R| 00a0: 6f 6e 64 69 20 52 6f 6e 64 69 20 50 65 70 69 6e |ondi Rondi Pepin| 00b0: 6f 2c 20 50 61 74 61 20 50 61 74 61 2c 20 4b 6f |o, Pata Pata, Ko| 00c0: 20 4b 6f 20 4b 6f 0a 45 6d 61 6e 61 20 4b 61 72 | Ko Ko.Emana Kar| 00d0: 61 73 73 6f 6c 69 2c 20 4c 6f 75 63 72 61 20 4c |assoli, Loucra L| 00e0: 6f 75 63 72 61 20 50 6f 6e 70 6f 6e 74 6f 2c 20 |oucra Ponponto, | 00f0: 50 61 74 61 20 50 61 74 61 2c 20 4b 6f 20 4b 6f |Pata Pata, Ko Ko| 0100: 20 4b 6f 2e 00 00 00 00 00 00 00 16 0f 74 65 73 | Ko..........tes| 0110: 74 3a 64 65 62 75 67 72 65 70 6c 79 00 00 00 03 |t:debugreply....| 0120: 00 00 00 00 00 00 00 00 00 2b 09 74 65 73 74 3a |.........+.test:| 0130: 6d 61 74 68 00 00 00 04 02 01 02 04 01 04 07 03 |math............| 0140: 70 69 33 2e 31 34 65 32 2e 37 32 63 6f 6f 6b 69 |pi3.14e2.72cooki| 0150: 6e 67 72 61 77 00 00 00 02 34 32 00 00 00 00 00 |ngraw....42.....| 0160: 00 00 1d 09 74 65 73 74 3a 73 6f 6e 67 00 00 00 |....test:song...| 0170: 05 01 00 0b 00 72 61 6e 64 6f 6d 70 61 72 61 6d |.....randomparam| 0180: 00 00 00 00 00 00 00 10 09 74 65 73 74 3a 70 69 |.........test:pi| 0190: 6e 67 00 00 00 06 00 00 00 00 00 00 00 00 00 00 |ng..............| $ hg statbundle2 < ../parts.hg2 options count: 0 :test:empty: mandatory: 0 advisory: 0 payload: 0 bytes :test:empty: mandatory: 0 advisory: 0 payload: 0 bytes :test:song: mandatory: 0 advisory: 0 payload: 178 bytes :test:debugreply: mandatory: 0 advisory: 0 payload: 0 bytes :test:math: mandatory: 2 advisory: 1 payload: 2 bytes :test:song: mandatory: 1 advisory: 0 payload: 0 bytes :test:ping: mandatory: 0 advisory: 0 payload: 0 bytes parts count: 7 $ hg statbundle2 --debug --config progress.debug=true --config devel.bundle2.debug=true < ../parts.hg2 bundle2-input: start processing of HG20 stream bundle2-input: reading bundle2 stream parameters options count: 0 bundle2-input: start extraction of bundle2 parts bundle2-input: part header size: 17 bundle2-input: part type: "test:empty" bundle2-input: part id: "0" bundle2-input: part parameters: 0 :test:empty: mandatory: 0 advisory: 0 bundle2-input: payload chunk size: 0 payload: 0 bytes bundle2-input: part header size: 17 bundle2-input: part type: "test:empty" bundle2-input: part id: "1" bundle2-input: part parameters: 0 :test:empty: mandatory: 0 advisory: 0 bundle2-input: payload chunk size: 0 payload: 0 bytes bundle2-input: part header size: 16 bundle2-input: part type: "test:song" bundle2-input: part id: "2" bundle2-input: part parameters: 0 :test:song: mandatory: 0 advisory: 0 bundle2-input: payload chunk size: 178 bundle2-input: payload chunk size: 0 bundle2-input-part: total payload size 178 payload: 178 bytes bundle2-input: part header size: 22 bundle2-input: part type: "test:debugreply" bundle2-input: part id: "3" bundle2-input: part parameters: 0 :test:debugreply: mandatory: 0 advisory: 0 bundle2-input: payload chunk size: 0 payload: 0 bytes bundle2-input: part header size: 43 bundle2-input: part type: "test:math" bundle2-input: part id: "4" bundle2-input: part parameters: 3 :test:math: mandatory: 2 advisory: 1 bundle2-input: payload chunk size: 2 bundle2-input: payload chunk size: 0 bundle2-input-part: total payload size 2 payload: 2 bytes bundle2-input: part header size: 29 bundle2-input: part type: "test:song" bundle2-input: part id: "5" bundle2-input: part parameters: 1 :test:song: mandatory: 1 advisory: 0 bundle2-input: payload chunk size: 0 payload: 0 bytes bundle2-input: part header size: 16 bundle2-input: part type: "test:ping" bundle2-input: part id: "6" bundle2-input: part parameters: 0 :test:ping: mandatory: 0 advisory: 0 bundle2-input: payload chunk size: 0 payload: 0 bytes bundle2-input: part header size: 0 bundle2-input: end of bundle2 stream parts count: 7 Test actual unbundling of test part ======================================= Process the bundle $ hg unbundle2 --debug --config progress.debug=true --config devel.bundle2.debug=true < ../parts.hg2 bundle2-input: start processing of HG20 stream bundle2-input: reading bundle2 stream parameters bundle2-input-bundle: with-transaction bundle2-input: start extraction of bundle2 parts bundle2-input: part header size: 17 bundle2-input: part type: "test:empty" bundle2-input: part id: "0" bundle2-input: part parameters: 0 bundle2-input: ignoring unsupported advisory part test:empty bundle2-input-part: "test:empty" (advisory) unsupported-type bundle2-input: payload chunk size: 0 bundle2-input: part header size: 17 bundle2-input: part type: "test:empty" bundle2-input: part id: "1" bundle2-input: part parameters: 0 bundle2-input: ignoring unsupported advisory part test:empty bundle2-input-part: "test:empty" (advisory) unsupported-type bundle2-input: payload chunk size: 0 bundle2-input: part header size: 16 bundle2-input: part type: "test:song" bundle2-input: part id: "2" bundle2-input: part parameters: 0 bundle2-input: found a handler for part test:song bundle2-input-part: "test:song" (advisory) supported The choir starts singing: bundle2-input: payload chunk size: 178 bundle2-input: payload chunk size: 0 bundle2-input-part: total payload size 178 Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko. bundle2-input: part header size: 22 bundle2-input: part type: "test:debugreply" bundle2-input: part id: "3" bundle2-input: part parameters: 0 bundle2-input: found a handler for part test:debugreply bundle2-input-part: "test:debugreply" (advisory) supported debugreply: no reply bundle2-input: payload chunk size: 0 bundle2-input: part header size: 43 bundle2-input: part type: "test:math" bundle2-input: part id: "4" bundle2-input: part parameters: 3 bundle2-input: ignoring unsupported advisory part test:math bundle2-input-part: "test:math" (advisory) (params: 2 mandatory 2 advisory) unsupported-type bundle2-input: payload chunk size: 2 bundle2-input: payload chunk size: 0 bundle2-input-part: total payload size 2 bundle2-input: part header size: 29 bundle2-input: part type: "test:song" bundle2-input: part id: "5" bundle2-input: part parameters: 1 bundle2-input: found a handler for part test:song bundle2-input: ignoring unsupported advisory part test:song - randomparam bundle2-input-part: "test:song" (advisory) (params: 1 mandatory) unsupported-params (randomparam) bundle2-input: payload chunk size: 0 bundle2-input: part header size: 16 bundle2-input: part type: "test:ping" bundle2-input: part id: "6" bundle2-input: part parameters: 0 bundle2-input: found a handler for part test:ping bundle2-input-part: "test:ping" (advisory) supported received ping request (id 6) bundle2-input: payload chunk size: 0 bundle2-input: part header size: 0 bundle2-input: end of bundle2 stream bundle2-input-bundle: 6 parts total 0 unread bytes 3 total verses sung Unbundle with an unknown mandatory part (should abort) $ hg bundle2 --parts --unknown ../unknown.hg2 $ hg unbundle2 < ../unknown.hg2 The choir starts singing: Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko. debugreply: no reply 0 unread bytes abort: missing support for test:unknown [255] Unbundle with an unknown mandatory part parameters (should abort) $ hg bundle2 --unknownparams ../unknown.hg2 $ hg unbundle2 < ../unknown.hg2 0 unread bytes abort: missing support for test:song - randomparams [255] unbundle with a reply $ hg bundle2 --parts --reply ../parts-reply.hg2 $ hg unbundle2 ../reply.hg2 < ../parts-reply.hg2 0 unread bytes 3 total verses sung The reply is a bundle $ f --hexdump ../reply.hg2 ../reply.hg2: 0000: 48 47 32 30 00 00 00 00 00 00 00 1b 06 6f 75 74 |HG20.........out| 0010: 70 75 74 00 00 00 00 00 01 0b 01 69 6e 2d 72 65 |put........in-re| 0020: 70 6c 79 2d 74 6f 33 00 00 00 d9 54 68 65 20 63 |ply-to3....The c| 0030: 68 6f 69 72 20 73 74 61 72 74 73 20 73 69 6e 67 |hoir starts sing| 0040: 69 6e 67 3a 0a 20 20 20 20 50 61 74 61 6c 69 20 |ing:. Patali | 0050: 44 69 72 61 70 61 74 61 2c 20 43 72 6f 6d 64 61 |Dirapata, Cromda| 0060: 20 43 72 6f 6d 64 61 20 52 69 70 61 6c 6f 2c 20 | Cromda Ripalo, | 0070: 50 61 74 61 20 50 61 74 61 2c 20 4b 6f 20 4b 6f |Pata Pata, Ko Ko| 0080: 20 4b 6f 0a 20 20 20 20 42 6f 6b 6f 72 6f 20 44 | Ko. Bokoro D| 0090: 69 70 6f 75 6c 69 74 6f 2c 20 52 6f 6e 64 69 20 |ipoulito, Rondi | 00a0: 52 6f 6e 64 69 20 50 65 70 69 6e 6f 2c 20 50 61 |Rondi Pepino, Pa| 00b0: 74 61 20 50 61 74 61 2c 20 4b 6f 20 4b 6f 20 4b |ta Pata, Ko Ko K| 00c0: 6f 0a 20 20 20 20 45 6d 61 6e 61 20 4b 61 72 61 |o. Emana Kara| 00d0: 73 73 6f 6c 69 2c 20 4c 6f 75 63 72 61 20 4c 6f |ssoli, Loucra Lo| 00e0: 75 63 72 61 20 50 6f 6e 70 6f 6e 74 6f 2c 20 50 |ucra Ponponto, P| 00f0: 61 74 61 20 50 61 74 61 2c 20 4b 6f 20 4b 6f 20 |ata Pata, Ko Ko | 0100: 4b 6f 2e 0a 00 00 00 00 00 00 00 1b 06 6f 75 74 |Ko...........out| 0110: 70 75 74 00 00 00 01 00 01 0b 01 69 6e 2d 72 65 |put........in-re| 0120: 70 6c 79 2d 74 6f 34 00 00 00 c9 64 65 62 75 67 |ply-to4....debug| 0130: 72 65 70 6c 79 3a 20 63 61 70 61 62 69 6c 69 74 |reply: capabilit| 0140: 69 65 73 3a 0a 64 65 62 75 67 72 65 70 6c 79 3a |ies:.debugreply:| 0150: 20 20 20 20 20 27 63 69 74 79 3d 21 27 0a 64 65 | 'city=!'.de| 0160: 62 75 67 72 65 70 6c 79 3a 20 20 20 20 20 20 20 |bugreply: | 0170: 20 20 27 63 65 6c 65 73 74 65 2c 76 69 6c 6c 65 | 'celeste,ville| 0180: 27 0a 64 65 62 75 67 72 65 70 6c 79 3a 20 20 20 |'.debugreply: | 0190: 20 20 27 65 6c 65 70 68 61 6e 74 73 27 0a 64 65 | 'elephants'.de| 01a0: 62 75 67 72 65 70 6c 79 3a 20 20 20 20 20 20 20 |bugreply: | 01b0: 20 20 27 62 61 62 61 72 27 0a 64 65 62 75 67 72 | 'babar'.debugr| 01c0: 65 70 6c 79 3a 20 20 20 20 20 20 20 20 20 27 63 |eply: 'c| 01d0: 65 6c 65 73 74 65 27 0a 64 65 62 75 67 72 65 70 |eleste'.debugrep| 01e0: 6c 79 3a 20 20 20 20 20 27 70 69 6e 67 2d 70 6f |ly: 'ping-po| 01f0: 6e 67 27 0a 00 00 00 00 00 00 00 1e 09 74 65 73 |ng'..........tes| 0200: 74 3a 70 6f 6e 67 00 00 00 02 01 00 0b 01 69 6e |t:pong........in| 0210: 2d 72 65 70 6c 79 2d 74 6f 37 00 00 00 00 00 00 |-reply-to7......| 0220: 00 1b 06 6f 75 74 70 75 74 00 00 00 03 00 01 0b |...output.......| 0230: 01 69 6e 2d 72 65 70 6c 79 2d 74 6f 37 00 00 00 |.in-reply-to7...| 0240: 3d 72 65 63 65 69 76 65 64 20 70 69 6e 67 20 72 |=received ping r| 0250: 65 71 75 65 73 74 20 28 69 64 20 37 29 0a 72 65 |equest (id 7).re| 0260: 70 6c 79 69 6e 67 20 74 6f 20 70 69 6e 67 20 72 |plying to ping r| 0270: 65 71 75 65 73 74 20 28 69 64 20 37 29 0a 00 00 |equest (id 7)...| 0280: 00 00 00 00 00 00 |......| The reply is valid $ hg statbundle2 < ../reply.hg2 options count: 0 :output: mandatory: 0 advisory: 1 payload: 217 bytes :output: mandatory: 0 advisory: 1 payload: 201 bytes :test:pong: mandatory: 1 advisory: 0 payload: 0 bytes :output: mandatory: 0 advisory: 1 payload: 61 bytes parts count: 4 Unbundle the reply to get the output: $ hg unbundle2 < ../reply.hg2 remote: The choir starts singing: remote: Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko remote: Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko remote: Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko. remote: debugreply: capabilities: remote: debugreply: 'city=!' remote: debugreply: 'celeste,ville' remote: debugreply: 'elephants' remote: debugreply: 'babar' remote: debugreply: 'celeste' remote: debugreply: 'ping-pong' remote: received ping request (id 7) remote: replying to ping request (id 7) 0 unread bytes Test push race detection $ hg bundle2 --pushrace ../part-race.hg2 $ hg unbundle2 < ../part-race.hg2 0 unread bytes abort: push race: repository changed while pushing - please try again [255] Support for changegroup =================================== $ hg unbundle $TESTDIR/bundles/rebase.hg adding changesets adding manifests adding file changes added 8 changesets with 7 changes to 7 files (+3 heads) new changesets cd010b8cd998:02de42196ebe (run 'hg heads' to see heads, 'hg merge' to merge) $ hg log -G o 8:02de42196ebe draft Nicolas Dumazet H | | o 7:eea13746799a draft Nicolas Dumazet G |/| o | 6:24b6387c8c8c draft Nicolas Dumazet F | | | o 5:9520eea781bc draft Nicolas Dumazet E |/ | o 4:32af7686d403 draft Nicolas Dumazet D | | | o 3:5fddd98957c8 draft Nicolas Dumazet C | | | o 2:42ccdea3bb16 draft Nicolas Dumazet B |/ o 1:cd010b8cd998 draft Nicolas Dumazet A @ 0:3903775176ed draft test a $ hg bundle2 --debug --config progress.debug=true --config devel.bundle2.debug=true --rev '8+7+5+4' ../rev.hg2 4 changesets found list of changesets: 32af7686d403cf45b5d95f2d70cebea587ac806a 9520eea781bcca16c1e15acc0ba14335a0e8e5ba eea13746799a9e0bfd88f29d3c2e9dc9389f524f 02de42196ebee42ef284b6780a87cdc96e8eaab6 bundle2-output-bundle: "HG20", 1 parts total bundle2-output: start emission of HG20 stream bundle2-output: bundle parameter: bundle2-output: start of parts bundle2-output: bundle part: "changegroup" bundle2-output-part: "changegroup" (advisory) streamed payload bundle2-output: part 0: "changegroup" bundle2-output: header chunk size: 18 bundling: 1/4 changesets (25.00%) bundling: 2/4 changesets (50.00%) bundling: 3/4 changesets (75.00%) bundling: 4/4 changesets (100.00%) bundling: 1/4 manifests (25.00%) bundling: 2/4 manifests (50.00%) bundling: 3/4 manifests (75.00%) bundling: 4/4 manifests (100.00%) bundling: D 1/3 files (33.33%) bundling: E 2/3 files (66.67%) bundling: H 3/3 files (100.00%) bundle2-output: payload chunk size: 1555 bundle2-output: closing payload chunk bundle2-output: end of bundle $ f --hexdump ../rev.hg2 ../rev.hg2: 0000: 48 47 32 30 00 00 00 00 00 00 00 12 0b 63 68 61 |HG20.........cha| 0010: 6e 67 65 67 72 6f 75 70 00 00 00 00 00 00 00 00 |ngegroup........| 0020: 06 13 00 00 00 a4 32 af 76 86 d4 03 cf 45 b5 d9 |......2.v....E..| 0030: 5f 2d 70 ce be a5 87 ac 80 6a 5f dd d9 89 57 c8 |_-p......j_...W.| 0040: a5 4a 4d 43 6d fe 1d a9 d8 7f 21 a1 b9 7b 00 00 |.JMCm.....!..{..| 0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 0060: 00 00 32 af 76 86 d4 03 cf 45 b5 d9 5f 2d 70 ce |..2.v....E.._-p.| 0070: be a5 87 ac 80 6a 00 00 00 00 00 00 00 29 00 00 |.....j.......)..| 0080: 00 29 36 65 31 66 34 63 34 37 65 63 62 35 33 33 |.)6e1f4c47ecb533| 0090: 66 66 64 30 63 38 65 35 32 63 64 63 38 38 61 66 |ffd0c8e52cdc88af| 00a0: 62 36 63 64 33 39 65 32 30 63 0a 00 00 00 66 00 |b6cd39e20c....f.| 00b0: 00 00 68 00 00 00 02 44 0a 00 00 00 69 00 00 00 |..h....D....i...| 00c0: 6a 00 00 00 01 44 00 00 00 a4 95 20 ee a7 81 bc |j....D..... ....| 00d0: ca 16 c1 e1 5a cc 0b a1 43 35 a0 e8 e5 ba cd 01 |....Z...C5......| 00e0: 0b 8c d9 98 f3 98 1a 5a 81 15 f9 4f 8d a4 ab 50 |.......Z...O...P| 00f0: 60 89 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |`...............| 0100: 00 00 00 00 00 00 95 20 ee a7 81 bc ca 16 c1 e1 |....... ........| 0110: 5a cc 0b a1 43 35 a0 e8 e5 ba 00 00 00 00 00 00 |Z...C5..........| 0120: 00 29 00 00 00 29 34 64 65 63 65 39 63 38 32 36 |.)...)4dece9c826| 0130: 66 36 39 34 39 30 35 30 37 62 39 38 63 36 33 38 |f69490507b98c638| 0140: 33 61 33 30 30 39 62 32 39 35 38 33 37 64 0a 00 |3a3009b295837d..| 0150: 00 00 66 00 00 00 68 00 00 00 02 45 0a 00 00 00 |..f...h....E....| 0160: 69 00 00 00 6a 00 00 00 01 45 00 00 00 a2 ee a1 |i...j....E......| 0170: 37 46 79 9a 9e 0b fd 88 f2 9d 3c 2e 9d c9 38 9f |7Fy.......<...8.| 0180: 52 4f 24 b6 38 7c 8c 8c ae 37 17 88 80 f3 fa 95 |RO$.8|...7......| 0190: de d3 cb 1c f7 85 95 20 ee a7 81 bc ca 16 c1 e1 |....... ........| 01a0: 5a cc 0b a1 43 35 a0 e8 e5 ba ee a1 37 46 79 9a |Z...C5......7Fy.| 01b0: 9e 0b fd 88 f2 9d 3c 2e 9d c9 38 9f 52 4f 00 00 |......<...8.RO..| 01c0: 00 00 00 00 00 29 00 00 00 29 33 36 35 62 39 33 |.....)...)365b93| 01d0: 64 35 37 66 64 66 34 38 31 34 65 32 62 35 39 31 |d57fdf4814e2b591| 01e0: 31 64 36 62 61 63 66 66 32 62 31 32 30 31 34 34 |1d6bacff2b120144| 01f0: 34 31 0a 00 00 00 66 00 00 00 68 00 00 00 00 00 |41....f...h.....| 0200: 00 00 69 00 00 00 6a 00 00 00 01 47 00 00 00 a4 |..i...j....G....| 0210: 02 de 42 19 6e be e4 2e f2 84 b6 78 0a 87 cd c9 |..B.n......x....| 0220: 6e 8e aa b6 24 b6 38 7c 8c 8c ae 37 17 88 80 f3 |n...$.8|...7....| 0230: fa 95 de d3 cb 1c f7 85 00 00 00 00 00 00 00 00 |................| 0240: 00 00 00 00 00 00 00 00 00 00 00 00 02 de 42 19 |..............B.| 0250: 6e be e4 2e f2 84 b6 78 0a 87 cd c9 6e 8e aa b6 |n......x....n...| 0260: 00 00 00 00 00 00 00 29 00 00 00 29 38 62 65 65 |.......)...)8bee| 0270: 34 38 65 64 63 37 33 31 38 35 34 31 66 63 30 30 |48edc7318541fc00| 0280: 31 33 65 65 34 31 62 30 38 39 32 37 36 61 38 63 |13ee41b089276a8c| 0290: 32 34 62 66 0a 00 00 00 66 00 00 00 66 00 00 00 |24bf....f...f...| 02a0: 02 48 0a 00 00 00 67 00 00 00 68 00 00 00 01 48 |.H....g...h....H| 02b0: 00 00 00 00 00 00 00 8b 6e 1f 4c 47 ec b5 33 ff |........n.LG..3.| 02c0: d0 c8 e5 2c dc 88 af b6 cd 39 e2 0c 66 a5 a0 18 |...,.....9..f...| 02d0: 17 fd f5 23 9c 27 38 02 b5 b7 61 8d 05 1c 89 e4 |...#.'8...a.....| 02e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 02f0: 00 00 00 00 32 af 76 86 d4 03 cf 45 b5 d9 5f 2d |....2.v....E.._-| 0300: 70 ce be a5 87 ac 80 6a 00 00 00 81 00 00 00 81 |p......j........| 0310: 00 00 00 2b 44 00 63 33 66 31 63 61 32 39 32 34 |...+D.c3f1ca2924| 0320: 63 31 36 61 31 39 62 30 36 35 36 61 38 34 39 30 |c16a19b0656a8490| 0330: 30 65 35 30 34 65 35 62 30 61 65 63 32 64 0a 00 |0e504e5b0aec2d..| 0340: 00 00 8b 4d ec e9 c8 26 f6 94 90 50 7b 98 c6 38 |...M...&...P{..8| 0350: 3a 30 09 b2 95 83 7d 00 7d 8c 9d 88 84 13 25 f5 |:0....}.}.....%.| 0360: c6 b0 63 71 b3 5b 4e 8a 2b 1a 83 00 00 00 00 00 |..cq.[N.+.......| 0370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 95 |................| 0380: 20 ee a7 81 bc ca 16 c1 e1 5a cc 0b a1 43 35 a0 | ........Z...C5.| 0390: e8 e5 ba 00 00 00 2b 00 00 00 ac 00 00 00 2b 45 |......+.......+E| 03a0: 00 39 63 36 66 64 30 33 35 30 61 36 63 30 64 30 |.9c6fd0350a6c0d0| 03b0: 63 34 39 64 34 61 39 63 35 30 31 37 63 66 30 37 |c49d4a9c5017cf07| 03c0: 30 34 33 66 35 34 65 35 38 0a 00 00 00 8b 36 5b |043f54e58.....6[| 03d0: 93 d5 7f df 48 14 e2 b5 91 1d 6b ac ff 2b 12 01 |....H.....k..+..| 03e0: 44 41 28 a5 84 c6 5e f1 21 f8 9e b6 6a b7 d0 bc |DA(...^.!...j...| 03f0: 15 3d 80 99 e7 ce 4d ec e9 c8 26 f6 94 90 50 7b |.=....M...&...P{| 0400: 98 c6 38 3a 30 09 b2 95 83 7d ee a1 37 46 79 9a |..8:0....}..7Fy.| 0410: 9e 0b fd 88 f2 9d 3c 2e 9d c9 38 9f 52 4f 00 00 |......<...8.RO..| 0420: 00 56 00 00 00 56 00 00 00 2b 46 00 32 32 62 66 |.V...V...+F.22bf| 0430: 63 66 64 36 32 61 32 31 61 33 32 38 37 65 64 62 |cfd62a21a3287edb| 0440: 64 34 64 36 35 36 32 31 38 64 30 66 35 32 35 65 |d4d656218d0f525e| 0450: 64 37 36 61 0a 00 00 00 97 8b ee 48 ed c7 31 85 |d76a.......H..1.| 0460: 41 fc 00 13 ee 41 b0 89 27 6a 8c 24 bf 28 a5 84 |A....A..'j.$.(..| 0470: c6 5e f1 21 f8 9e b6 6a b7 d0 bc 15 3d 80 99 e7 |.^.!...j....=...| 0480: ce 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 0490: 00 00 00 00 00 02 de 42 19 6e be e4 2e f2 84 b6 |.......B.n......| 04a0: 78 0a 87 cd c9 6e 8e aa b6 00 00 00 2b 00 00 00 |x....n......+...| 04b0: 56 00 00 00 00 00 00 00 81 00 00 00 81 00 00 00 |V...............| 04c0: 2b 48 00 38 35 30 30 31 38 39 65 37 34 61 39 65 |+H.8500189e74a9e| 04d0: 30 34 37 35 65 38 32 32 30 39 33 62 63 37 64 62 |0475e822093bc7db| 04e0: 30 64 36 33 31 61 65 62 30 62 34 0a 00 00 00 00 |0d631aeb0b4.....| 04f0: 00 00 00 05 44 00 00 00 62 c3 f1 ca 29 24 c1 6a |....D...b...)$.j| 0500: 19 b0 65 6a 84 90 0e 50 4e 5b 0a ec 2d 00 00 00 |..ej...PN[..-...| 0510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 0520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 0530: 00 00 00 00 00 32 af 76 86 d4 03 cf 45 b5 d9 5f |.....2.v....E.._| 0540: 2d 70 ce be a5 87 ac 80 6a 00 00 00 00 00 00 00 |-p......j.......| 0550: 00 00 00 00 02 44 0a 00 00 00 00 00 00 00 05 45 |.....D.........E| 0560: 00 00 00 62 9c 6f d0 35 0a 6c 0d 0c 49 d4 a9 c5 |...b.o.5.l..I...| 0570: 01 7c f0 70 43 f5 4e 58 00 00 00 00 00 00 00 00 |.|.pC.NX........| 0580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 0590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 05a0: 95 20 ee a7 81 bc ca 16 c1 e1 5a cc 0b a1 43 35 |. ........Z...C5| 05b0: a0 e8 e5 ba 00 00 00 00 00 00 00 00 00 00 00 02 |................| 05c0: 45 0a 00 00 00 00 00 00 00 05 48 00 00 00 62 85 |E.........H...b.| 05d0: 00 18 9e 74 a9 e0 47 5e 82 20 93 bc 7d b0 d6 31 |...t..G^. ..}..1| 05e0: ae b0 b4 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 05f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 0600: 00 00 00 00 00 00 00 00 00 00 00 02 de 42 19 6e |.............B.n| 0610: be e4 2e f2 84 b6 78 0a 87 cd c9 6e 8e aa b6 00 |......x....n....| 0620: 00 00 00 00 00 00 00 00 00 00 02 48 0a 00 00 00 |...........H....| 0630: 00 00 00 00 00 00 00 00 00 00 00 00 00 |.............| $ hg debugbundle ../rev.hg2 Stream params: {} changegroup -- {} 32af7686d403cf45b5d95f2d70cebea587ac806a 9520eea781bcca16c1e15acc0ba14335a0e8e5ba eea13746799a9e0bfd88f29d3c2e9dc9389f524f 02de42196ebee42ef284b6780a87cdc96e8eaab6 $ hg unbundle ../rev.hg2 adding changesets adding manifests adding file changes added 0 changesets with 0 changes to 3 files (run 'hg update' to get a working copy) with reply $ hg bundle2 --rev '8+7+5+4' --reply ../rev-rr.hg2 $ hg unbundle2 ../rev-reply.hg2 < ../rev-rr.hg2 0 unread bytes addchangegroup return: 1 $ f --hexdump ../rev-reply.hg2 ../rev-reply.hg2: 0000: 48 47 32 30 00 00 00 00 00 00 00 2f 11 72 65 70 |HG20......./.rep| 0010: 6c 79 3a 63 68 61 6e 67 65 67 72 6f 75 70 00 00 |ly:changegroup..| 0020: 00 00 00 02 0b 01 06 01 69 6e 2d 72 65 70 6c 79 |........in-reply| 0030: 2d 74 6f 31 72 65 74 75 72 6e 31 00 00 00 00 00 |-to1return1.....| 0040: 00 00 1b 06 6f 75 74 70 75 74 00 00 00 01 00 01 |....output......| 0050: 0b 01 69 6e 2d 72 65 70 6c 79 2d 74 6f 31 00 00 |..in-reply-to1..| 0060: 00 64 61 64 64 69 6e 67 20 63 68 61 6e 67 65 73 |.dadding changes| 0070: 65 74 73 0a 61 64 64 69 6e 67 20 6d 61 6e 69 66 |ets.adding manif| 0080: 65 73 74 73 0a 61 64 64 69 6e 67 20 66 69 6c 65 |ests.adding file| 0090: 20 63 68 61 6e 67 65 73 0a 61 64 64 65 64 20 30 | changes.added 0| 00a0: 20 63 68 61 6e 67 65 73 65 74 73 20 77 69 74 68 | changesets with| 00b0: 20 30 20 63 68 61 6e 67 65 73 20 74 6f 20 33 20 | 0 changes to 3 | 00c0: 66 69 6c 65 73 0a 00 00 00 00 00 00 00 00 |files.........| Check handling of exception during generation. ---------------------------------------------- $ hg bundle2 --genraise > ../genfailed.hg2 abort: Someone set up us the bomb! [255] Should still be a valid bundle $ f --hexdump ../genfailed.hg2 ../genfailed.hg2: 0000: 48 47 32 30 00 00 00 00 00 00 00 0d 06 6f 75 74 |HG20.........out| 0010: 70 75 74 00 00 00 00 00 00 ff ff ff ff 00 00 00 |put.............| 0020: 48 0b 65 72 72 6f 72 3a 61 62 6f 72 74 00 00 00 |H.error:abort...| 0030: 00 01 00 07 2d 6d 65 73 73 61 67 65 75 6e 65 78 |....-messageunex| 0040: 70 65 63 74 65 64 20 65 72 72 6f 72 3a 20 53 6f |pected error: So| 0050: 6d 65 6f 6e 65 20 73 65 74 20 75 70 20 75 73 20 |meone set up us | 0060: 74 68 65 20 62 6f 6d 62 21 00 00 00 00 00 00 00 |the bomb!.......| 0070: 00 |.| And its handling on the other size raise a clean exception $ cat ../genfailed.hg2 | hg unbundle2 0 unread bytes abort: unexpected error: Someone set up us the bomb! [255] Test compression ================ Simple case where it just work: GZ ---------------------------------- $ hg bundle2 --compress GZ --rev '8+7+5+4' ../rev.hg2.bz $ f --hexdump ../rev.hg2.bz ../rev.hg2.bz: 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress| 0010: 69 6f 6e 3d 47 5a 78 9c 95 94 7d 68 95 55 1c c7 |ion=GZx...}h.U..| 0020: 9f 3b 31 e8 ce fa c3 65 be a0 a4 b4 52 b9 29 e7 |.;1....e....R.).| 0030: f5 79 ce 89 fa 63 ed 5e 77 8b 9c c3 3f 2a 1c 68 |.y...c.^w...?*.h| 0040: cf 79 9b dd 6a ae b0 28 74 b8 e5 96 5b bb 86 61 |.y..j..(t...[..a| 0050: a3 15 6e 3a 71 c8 6a e8 a5 da 95 64 28 22 ce 69 |..n:q.j....d(".i| 0060: cd 06 59 34 28 2b 51 2a 58 c3 17 56 2a 9a 9d 67 |..Y4(+Q*X..V*..g| 0070: dc c6 35 9e c4 1d f8 9e 87 f3 9c f3 3b bf 0f bf |..5.........;...| 0080: 97 e3 38 ce f4 42 b9 d6 af ae d2 55 af ae 7b ad |..8..B.....U..{.| 0090: c6 c9 8d bb 8a ec b4 07 ed 7f fd ed d3 53 be 4e |.............S.N| 00a0: f4 0e af 59 52 73 ea 50 d7 96 9e ba d4 9a 1f 87 |...YRs.P........| 00b0: 9b 9f 1d e8 7a 6a 79 e9 cb 7f cf eb fe 7e d3 82 |....zjy......~..| 00c0: ce 2f 36 38 21 23 cc 36 b7 b5 38 90 ab a1 21 92 |./68!#.6..8...!.| 00d0: 78 5a 0a 8a b1 31 0a 48 a6 29 92 4a 32 e6 1b e1 |xZ...1.H.).J2...| 00e0: 4a 85 b9 46 40 46 ed 61 63 b5 d6 aa 20 1e ac 5e |J..F@F.ac... ..^| 00f0: b0 0a ae 8a c4 03 c6 d6 f9 a3 7b eb fb 4e de 7f |..........{..N..| 0100: e4 97 55 5f 15 76 96 d2 5d bf 9d 3f 38 18 29 4c |..U_.v..]..?8.)L| 0110: 0f b7 5d 6e 9b b3 aa 7e c6 d5 15 5b f7 7c 52 f1 |..]n...~...[.|R.| 0120: 7c 73 18 63 98 6d 3e 23 51 5a 6a 2e 19 72 8d cb ||s.c.m>#QZj..r..| 0130: 09 07 14 78 82 33 e9 62 86 7d 0c 00 17 88 53 86 |...x.3.b.}....S.| 0140: 3d 75 0b 63 e2 16 c6 84 9d 76 8f 76 7a cb de fc |=u.c.....v.vz...| 0150: a8 a3 f0 46 d3 a5 f6 c7 96 b6 9f 60 3b 57 ae 28 |...F.......`;W.(| 0160: ce b2 8d e9 f4 3e 6f 66 53 dd e5 6b ad 67 be f9 |.....>ofS..k.g..| 0170: 72 ee 5f 8d 61 3c 61 b6 f9 8c d8 a5 82 63 45 3d |r._.a.| 0210: 58 dc 91 d8 40 e9 23 8e 88 84 ae 0f b9 00 2e b5 |X...@.#.........| 0220: 74 36 f3 40 53 40 34 15 c0 d7 12 8d e7 bb 65 f9 |t6.@S@4.......e.| 0230: c8 ef 03 0f ff f9 fe b6 8a 0d 6d fd ec 51 70 f7 |..........m..Qp.| 0240: a7 ad 9b 6b 9d da 74 7b 53 43 d1 43 63 fd 19 f9 |...k..t{SC.Cc...| 0250: ca 67 95 e5 ef c4 e6 6c 9e 44 e1 c5 ac 7a 82 6f |.g.....l.D...z.o| 0260: c2 e1 d2 b5 2d 81 29 f0 5d 09 6c 6f 10 ae 88 cf |....-.).].lo....| 0270: 25 05 d0 93 06 78 80 60 43 2d 10 1b 47 71 2b b7 |%....x.`C-..Gq+.| 0280: 7f bb e9 a7 e4 7d 67 7b df 9b f7 62 cf cd d8 f4 |.....}g{...b....| 0290: 48 bc 64 51 57 43 ff ea 8b 0b ae 74 64 53 07 86 |H.dQWC.....tdS..| 02a0: fa 66 3c 5e f7 e1 af a7 c2 90 ff a7 be 9e c9 29 |.f<^...........)| 02b0: b6 cc 41 48 18 69 94 8b 7c 04 7d 8c 98 a7 95 50 |..AH.i..|.}....P| 02c0: 44 d9 d0 20 c8 14 30 14 51 ad 6c 16 03 94 0f 5a |D.. ..0.Q.l....Z| 02d0: 46 93 7f 1c 87 8d 25 d7 9d a2 d1 92 4c f3 c2 54 |F.....%.....L..T| 02e0: ba f8 70 18 ca 24 0a 29 96 43 71 f2 93 95 74 18 |..p..$.).Cq...t.| 02f0: b5 65 c4 b8 f6 6c 5c 34 20 1e d5 0c 21 c0 b1 90 |.e...l\4 ...!...| 0300: 9e 12 40 b9 18 fa 5a 00 41 a2 39 d3 a9 c1 73 21 |..@...Z.A.9...s!| 0310: 8e 5e 3c b9 b8 f8 48 6a 76 46 a7 1a b6 dd 5b 51 |.^<...HjvF....[Q| 0320: 5e 19 1d 59 12 c6 32 89 02 9a c0 8f 4f b8 0a ba |^..Y..2.....O...| 0330: 5e ec 58 37 44 a3 2f dd 33 ed c9 d3 dd c7 22 1b |^.X7D./.3.....".| 0340: 2f d4 94 8e 95 3f 77 a7 ae 6e f3 32 8d bb 4a 4c |/....?w..n.2..JL| 0350: b8 0a 5a 43 34 3a b3 3a d6 77 ff 5c b6 fa ad f9 |..ZC4:.:.w.\....| 0360: db fb 6a 33 df c1 7d 99 cf ef d4 d5 6d da 77 7c |..j3..}.....m.w|| 0370: 3b 19 fd af c5 3f f1 60 c3 17 |;....?.`..| $ hg debugbundle ../rev.hg2.bz Stream params: {Compression: GZ} changegroup -- {} 32af7686d403cf45b5d95f2d70cebea587ac806a 9520eea781bcca16c1e15acc0ba14335a0e8e5ba eea13746799a9e0bfd88f29d3c2e9dc9389f524f 02de42196ebee42ef284b6780a87cdc96e8eaab6 $ hg unbundle ../rev.hg2.bz adding changesets adding manifests adding file changes added 0 changesets with 0 changes to 3 files (run 'hg update' to get a working copy) Simple case where it just work: BZ ---------------------------------- $ hg bundle2 --compress BZ --rev '8+7+5+4' ../rev.hg2.bz $ f --hexdump ../rev.hg2.bz ../rev.hg2.bz: 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress| 0010: 69 6f 6e 3d 42 5a 42 5a 68 39 31 41 59 26 53 59 |ion=BZBZh91AY&SY| 0020: a3 4b 18 3d 00 00 1a 7f ff ff bf 5f f6 ef ef 7f |.K.=......._....| 0030: f6 3f f7 d1 d9 ff ff f7 6e ff ff 6e f7 f6 bd df |.?......n..n....| 0040: b5 ab ff cf 67 f6 e7 7b f7 c0 02 d7 33 82 8b 51 |....g..{....3..Q| 0050: 04 a5 53 d5 3d 27 a0 99 18 4d 0d 34 00 d1 a1 e8 |..S.='...M.4....| 0060: 80 c8 7a 87 a9 a3 43 6a 3d 46 86 26 80 34 3d 40 |..z...Cj=F.&.4=@| 0070: c8 c9 b5 34 f4 8f 48 0f 51 ea 34 34 fd 4d aa 19 |...4..H.Q.44.M..| 0080: 03 40 0c 08 da 86 43 d4 f5 0f 42 1e a0 f3 54 33 |.@....C...B...T3| 0090: 54 d3 13 4d 03 40 32 00 00 32 03 26 80 0d 00 0d |T..M.@2..2.&....| 00a0: 00 68 c8 c8 03 20 32 30 98 8c 80 00 00 03 4d 00 |.h... 20......M.| 00b0: c8 00 00 0d 00 00 22 99 a1 34 c2 64 a6 d5 34 1a |......"..4.d..4.| 00c0: 00 00 06 86 83 4d 07 a8 d1 a0 68 01 a0 00 00 00 |.....M....h.....| 00d0: 00 0d 06 80 00 00 00 0d 00 03 40 00 00 04 a4 a1 |..........@.....| 00e0: 4d a9 89 89 b4 9a 32 0c 43 46 86 87 a9 8d 41 9a |M.....2.CF....A.| 00f0: 98 46 9a 0d 31 32 1a 34 0d 0c 8d a2 0c 98 4d 06 |.F..12.4......M.| 0100: 8c 40 c2 60 8d 0d 0c 20 c9 89 fa a0 d0 d3 21 a1 |.@.`... ......!.| 0110: ea 34 d3 68 9e a6 d1 74 05 33 cb 66 96 93 28 64 |.4.h...t.3.f..(d| 0120: 40 91 22 ac 55 9b ea 40 7b 38 94 e2 f8 06 00 cb |@.".U..@{8......| 0130: 28 02 00 4d ab 40 24 10 43 18 cf 64 b4 06 83 0c |(..M.@$.C..d....| 0140: 34 6c b4 a3 d4 0a 0a e4 a8 5c 4e 23 c0 c9 7a 31 |4l.......\N#..z1| 0150: 97 87 77 7a 64 88 80 8e 60 97 20 93 0f 8e eb c4 |..wzd...`. .....| 0160: 62 a4 44 a3 52 20 b2 99 a9 2e e1 d7 29 4a 54 ac |b.D.R ......)JT.| 0170: 44 7a bb cc 04 3d e0 aa bd 6a 33 5e 9b a2 57 36 |Dz...=...j3^..W6| 0180: fa cb 45 bb 6d 3e c1 d9 d9 f5 83 69 8a d0 e0 e2 |..E.m>.....i....| 0190: e7 ae 90 55 24 da 3f ab 78 c0 4c b4 56 a3 9e a4 |...U$.?.x.L.V...| 01a0: af 9c 65 74 86 ec 6d dc 62 dc 33 ca c8 50 dd 9d |..et..m.b.3..P..| 01b0: 98 8e 9e 59 20 f3 f0 42 91 4a 09 f5 75 8d 3d a5 |...Y ..B.J..u.=.| 01c0: a5 15 cb 8d 10 63 b0 c2 2e b2 81 f7 c1 76 0e 53 |.....c.......v.S| 01d0: 6c 0e 46 73 b5 ae 67 f9 4c 0b 45 6b a8 32 2a 2f |l.Fs..g.L.Ek.2*/| 01e0: a2 54 a4 44 05 20 a1 38 d1 a4 c6 09 a8 2b 08 99 |.T.D. .8.....+..| 01f0: a4 14 ae 8d a3 e3 aa 34 27 d8 44 ca c3 5d 21 8b |.......4'.D..]!.| 0200: 1a 1e 97 29 71 2b 09 4a 4a 55 55 94 58 65 b2 bc |...)q+.JJUU.Xe..| 0210: f3 a5 90 26 36 76 67 7a 51 98 d6 8a 4a 99 50 b5 |...&6vgzQ...J.P.| 0220: 99 8f 94 21 17 a9 8b f3 ad 4c 33 d4 2e 40 c8 0c |...!.....L3..@..| 0230: 3b 90 53 39 db 48 02 34 83 48 d6 b3 99 13 d2 58 |;.S9.H.4.H.....X| 0240: 65 8e 71 ac a9 06 95 f2 c4 8e b4 08 6b d3 0c ae |e.q.........k...| 0250: d9 90 56 71 43 a7 a2 62 16 3e 50 63 d3 57 3c 2d |..VqC..b.>Pc.W<-| 0260: 9f 0f 34 05 08 d8 a6 4b 59 31 54 66 3a 45 0c 8a |..4....KY1Tf:E..| 0270: c7 90 3a f0 6a 83 1b f5 ca fb 80 2b 50 06 fb 51 |..:.j......+P..Q| 0280: 7e a6 a4 d4 81 44 82 21 54 00 5b 1a 30 83 62 a3 |~....D.!T.[.0.b.| 0290: 18 b6 24 19 1e 45 df 4d 5c db a6 af 5b ac 90 fa |..$..E.M\...[...| 02a0: 3e ed f9 ec 4c ba 36 ee d8 60 20 a7 c7 3b cb d1 |>...L.6..` ..;..| 02b0: 90 43 7d 27 16 50 5d ad f4 14 07 0b 90 5c cc 6b |.C}'.P]......\.k| 02c0: 8d 3f a6 88 f4 34 37 a8 cf 14 63 36 19 f7 3e 28 |.?...47...c6..>(| 02d0: de 99 e8 16 a4 9d 0d 40 a1 a7 24 52 14 a6 72 62 |.......@..$R..rb| 02e0: 59 5a ca 2d e5 51 90 78 88 d9 c6 c7 21 d0 f7 46 |YZ.-.Q.x....!..F| 02f0: b2 04 46 44 4e 20 9c 12 b1 03 4e 25 e0 a9 0c 58 |..FDN ....N%...X| 0300: 5b 1d 3c 93 20 01 51 de a9 1c 69 23 32 46 14 b4 |[.<. .Q...i#2F..| 0310: 90 db 17 98 98 50 03 90 29 aa 40 b0 13 d8 43 d2 |.....P..).@...C.| 0320: 5f c5 9d eb f3 f2 ad 41 e8 7a a9 ed a1 58 84 a6 |_......A.z...X..| 0330: 42 bf d6 fc 24 82 c1 20 32 26 4a 15 a6 1d 29 7f |B...$.. 2&J...).| 0340: 7e f4 3d 07 bc 62 9a 5b ec 44 3d 72 1d 41 8b 5c |~.=..b.[.D=r.A.\| 0350: 80 de 0e 62 9a 2e f8 83 00 d5 07 a0 9c c6 74 98 |...b..........t.| 0360: 11 b2 5e a9 38 02 03 ee fd 86 5c f4 86 b3 ae da |..^.8.....\.....| 0370: 05 94 01 c5 c6 ea 18 e6 ba 2a ba b3 04 5c 96 89 |.........*...\..| 0380: 72 63 5b 10 11 f6 67 34 98 cb e4 c0 4e fa e6 99 |rc[...g4....N...| 0390: 19 6e 50 e8 26 8d 0c 17 e0 be ef e1 8e 02 6f 32 |.nP.&.........o2| 03a0: 82 dc 26 f8 a1 08 f3 8a 0d f3 c4 75 00 48 73 b8 |..&........u.Hs.| 03b0: be 3b 0d 7f d0 fd c7 78 96 ec e0 03 80 68 4d 8d |.;.....x.....hM.| 03c0: 43 8c d7 68 58 f9 50 f0 18 cb 21 58 1b 60 cd 1f |C..hX.P...!X.`..| 03d0: 84 36 2e 16 1f 0a f7 4e 8f eb df 01 2d c2 79 0b |.6.....N....-.y.| 03e0: f7 24 ea 0d e8 59 86 51 6e 1c 30 a3 ad 2f ee 8c |.$...Y.Qn.0../..| 03f0: 90 c8 84 d5 e8 34 c1 95 b2 c9 f6 4d 87 1c 7d 19 |.....4.....M..}.| 0400: d6 41 58 56 7a e0 6c ba 10 c7 e8 33 39 36 96 e7 |.AXVz.l....396..| 0410: d2 f9 59 9a 08 95 48 38 e7 0b b7 0a 24 67 c4 39 |..Y...H8....$g.9| 0420: 8b 43 88 57 9c 01 f5 61 b5 e1 27 41 7e af 83 fe |.C.W...a..'A~...| 0430: 2e e4 8a 70 a1 21 46 96 30 7a |...p.!F.0z| $ hg debugbundle ../rev.hg2.bz Stream params: {Compression: BZ} changegroup -- {} 32af7686d403cf45b5d95f2d70cebea587ac806a 9520eea781bcca16c1e15acc0ba14335a0e8e5ba eea13746799a9e0bfd88f29d3c2e9dc9389f524f 02de42196ebee42ef284b6780a87cdc96e8eaab6 $ hg unbundle ../rev.hg2.bz adding changesets adding manifests adding file changes added 0 changesets with 0 changes to 3 files (run 'hg update' to get a working copy) unknown compression while unbundling ----------------------------- $ hg bundle2 --param Compression=FooBarUnknown --rev '8+7+5+4' ../rev.hg2.bz $ cat ../rev.hg2.bz | hg statbundle2 abort: unknown parameters: Stream Parameter - Compression='FooBarUnknown' [255] $ hg unbundle ../rev.hg2.bz abort: ../rev.hg2.bz: unknown bundle feature, Stream Parameter - Compression='FooBarUnknown' (see https://mercurial-scm.org/wiki/BundleFeature for more information) [255] $ cd .. mercurial-4.5.3/tests/test-revert.t0000644015407300116100000007637313261161234017230 0ustar augieeng00000000000000 $ hg init repo $ cd repo $ echo 123 > a $ echo 123 > c $ echo 123 > e $ hg add a c e $ hg commit -m "first" a c e nothing changed $ hg revert abort: no files or directories specified (use --all to revert all files) [255] $ hg revert --all Introduce some changes and revert them -------------------------------------- $ echo 123 > b $ hg status ? b $ echo 12 > c $ hg status M c ? b $ hg add b $ hg status M c A b $ hg rm a $ hg status M c A b R a revert removal of a file $ hg revert a $ hg status M c A b revert addition of a file $ hg revert b $ hg status M c ? b revert modification of a file (--no-backup) $ hg revert --no-backup c $ hg status ? b revert deletion (! status) of a added file ------------------------------------------ $ hg add b $ hg status b A b $ rm b $ hg status b ! b $ hg revert -v b forgetting b $ hg status b b: * (glob) $ ls a c e Test creation of backup (.orig) files ------------------------------------- $ echo z > e $ hg revert --all -v saving current version of e as e.orig reverting e Test creation of backup (.orig) file in configured file location ---------------------------------------------------------------- $ echo z > e $ hg revert --all -v --config 'ui.origbackuppath=.hg/origbackups' creating directory: $TESTTMP/repo/.hg/origbackups saving current version of e as $TESTTMP/repo/.hg/origbackups/e reverting e $ rm -rf .hg/origbackups revert on clean file (no change) -------------------------------- $ hg revert a no changes needed to a revert on an untracked file --------------------------- $ echo q > q $ hg revert q file not managed: q $ rm q revert on file that does not exists ----------------------------------- $ hg revert notfound notfound: no such file in rev 334a9e57682c $ touch d $ hg add d $ hg rm a $ hg commit -m "second" $ echo z > z $ hg add z $ hg st A z ? e.orig revert to another revision (--rev) ---------------------------------- $ hg revert --all -r0 adding a removing d forgetting z revert explicitly to parent (--rev) ----------------------------------- $ hg revert --all -rtip forgetting a undeleting d $ rm a *.orig revert to another revision (--rev) and exact match -------------------------------------------------- exact match are more silent $ hg revert -r0 a $ hg st a A a $ hg rm d $ hg st d R d should keep d removed $ hg revert -r0 d no changes needed to d $ hg st d R d $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved revert of exec bit ------------------ #if execbit $ chmod +x c $ hg revert --all reverting c $ test -x c || echo non-executable non-executable $ chmod +x c $ hg commit -m exe $ chmod -x c $ hg revert --all reverting c $ test -x c && echo executable executable #endif Test that files reverted to other than the parent are treated as "modified", even if none of mode, size and timestamp of it isn't changed on the filesystem (see also issue4583). $ echo 321 > e $ hg diff --git diff --git a/e b/e --- a/e +++ b/e @@ -1,1 +1,1 @@ -123 +321 $ hg commit -m 'ambiguity from size' $ cat e 321 $ touch -t 200001010000 e $ hg debugrebuildstate $ cat >> .hg/hgrc < [fakedirstatewritetime] > # emulate invoking dirstate.write() via repo.status() > # at 2000-01-01 00:00 > fakenow = 200001010000 > > [extensions] > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py > EOF $ hg revert -r 0 e $ cat >> .hg/hgrc < [extensions] > fakedirstatewritetime = ! > EOF $ cat e 123 $ touch -t 200001010000 e $ hg status -A e M e $ cd .. Issue241: update and revert produces inconsistent repositories -------------------------------------------------------------- $ hg init a $ cd a $ echo a >> a $ hg commit -A -d '1 0' -m a adding a $ echo a >> a $ hg commit -d '2 0' -m a $ hg update 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ mkdir b $ echo b > b/b call `hg revert` with no file specified --------------------------------------- $ hg revert -rtip abort: no files or directories specified (use --all to revert all files, or 'hg update 1' to update) [255] call `hg revert` with -I --------------------------- $ echo a >> a $ hg revert -I a reverting a call `hg revert` with -X --------------------------- $ echo a >> a $ hg revert -X d reverting a call `hg revert` with --all --------------------------- $ hg revert --all -rtip reverting a $ rm *.orig Issue332: confusing message when reverting directory ---------------------------------------------------- $ hg ci -A -m b adding b/b created new head $ echo foobar > b/b $ mkdir newdir $ echo foo > newdir/newfile $ hg add newdir/newfile $ hg revert b newdir reverting b/b forgetting newdir/newfile $ echo foobar > b/b $ hg revert . reverting b/b reverting a rename target should revert the source -------------------------------------------------- $ hg mv a newa $ hg revert newa $ hg st a newa ? newa Also true for move overwriting an existing file $ hg mv --force a b/b $ hg revert b/b $ hg status a b/b $ cd .. $ hg init ignored $ cd ignored $ echo '^ignored$' > .hgignore $ echo '^ignoreddir$' >> .hgignore $ echo '^removed$' >> .hgignore $ mkdir ignoreddir $ touch ignoreddir/file $ touch ignoreddir/removed $ touch ignored $ touch removed 4 ignored files (we will add/commit everything) $ hg st -A -X .hgignore I ignored I ignoreddir/file I ignoreddir/removed I removed $ hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed $ echo >> ignored $ echo >> ignoreddir/file $ hg rm removed ignoreddir/removed should revert ignored* and undelete *removed -------------------------------------------- $ hg revert -a --no-backup reverting ignored reverting ignoreddir/file undeleting ignoreddir/removed undeleting removed $ hg st -mardi $ hg up -qC $ echo >> ignored $ hg rm removed should silently revert the named files -------------------------------------- $ hg revert --no-backup ignored removed $ hg st -mardi Reverting copy (issue3920) -------------------------- someone set up us the copies $ rm .hgignore $ hg update -C 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg mv ignored allyour $ hg copy removed base $ hg commit -m rename copies and renames, you have no chance to survive make your time (issue3920) $ hg update '.^' 1 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg revert -rtip -a adding allyour adding base removing ignored $ hg status -C A allyour ignored A base removed R ignored Test revert of a file added by one side of the merge ==================================================== remove any pending change $ hg revert --all forgetting allyour forgetting base undeleting ignored $ hg purge --all --config extensions.purge= Adds a new commit $ echo foo > newadd $ hg add newadd $ hg commit -m 'other adds' created new head merge it with the other head $ hg merge # merge 1 into 2 2 files updated, 0 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg summary parent: 2:b8ec310b2d4e tip other adds parent: 1:f6180deb8fbe rename branch: default commit: 2 modified, 1 removed (merge) update: (current) phases: 3 draft clarifies who added what $ hg status M allyour M base R ignored $ hg status --change 'p1()' A newadd $ hg status --change 'p2()' A allyour A base R ignored revert file added by p1() to p1() state ----------------------------------------- $ hg revert -r 'p1()' 'glob:newad?' $ hg status M allyour M base R ignored revert file added by p1() to p2() state ------------------------------------------ $ hg revert -r 'p2()' 'glob:newad?' removing newadd $ hg status M allyour M base R ignored R newadd revert file added by p2() to p2() state ------------------------------------------ $ hg revert -r 'p2()' 'glob:allyou?' $ hg status M allyour M base R ignored R newadd revert file added by p2() to p1() state ------------------------------------------ $ hg revert -r 'p1()' 'glob:allyou?' removing allyour $ hg status M base R allyour R ignored R newadd Systematic behavior validation of most possible cases ===================================================== This section tests most of the possible combinations of revision states and working directory states. The number of possible cases is significant but they but they all have a slightly different handling. So this section commits to and testing all of them to allow safe refactoring of the revert code. A python script is used to generate a file history for each combination of states, on one side the content (or lack thereof) in two revisions, and on the other side, the content and "tracked-ness" of the working directory. The three states generated are: - a "base" revision - a "parent" revision - the working directory (based on "parent") The files generated have names of the form: __- All known states are not tested yet. See inline documentation for details. Special cases from merge and rename are not tested by this section. Write the python script to disk ------------------------------- check list of planned files $ $PYTHON $TESTDIR/generate-working-copy-states.py filelist 2 content1_content1_content1-tracked content1_content1_content1-untracked content1_content1_content3-tracked content1_content1_content3-untracked content1_content1_missing-tracked content1_content1_missing-untracked content1_content2_content1-tracked content1_content2_content1-untracked content1_content2_content2-tracked content1_content2_content2-untracked content1_content2_content3-tracked content1_content2_content3-untracked content1_content2_missing-tracked content1_content2_missing-untracked content1_missing_content1-tracked content1_missing_content1-untracked content1_missing_content3-tracked content1_missing_content3-untracked content1_missing_missing-tracked content1_missing_missing-untracked missing_content2_content2-tracked missing_content2_content2-untracked missing_content2_content3-tracked missing_content2_content3-untracked missing_content2_missing-tracked missing_content2_missing-untracked missing_missing_content3-tracked missing_missing_content3-untracked missing_missing_missing-tracked missing_missing_missing-untracked Script to make a simple text version of the content --------------------------------------------------- $ cat << EOF >> dircontent.py > # generate a simple text view of the directory for easy comparison > import os > files = os.listdir('.') > files.sort() > for filename in files: > if os.path.isdir(filename): > continue > content = open(filename).read() > print '%-6s %s' % (content.strip(), filename) > EOF Generate appropriate repo state ------------------------------- $ hg init revert-ref $ cd revert-ref Generate base changeset $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 1 $ hg addremove --similarity 0 adding content1_content1_content1-tracked adding content1_content1_content1-untracked adding content1_content1_content3-tracked adding content1_content1_content3-untracked adding content1_content1_missing-tracked adding content1_content1_missing-untracked adding content1_content2_content1-tracked adding content1_content2_content1-untracked adding content1_content2_content2-tracked adding content1_content2_content2-untracked adding content1_content2_content3-tracked adding content1_content2_content3-untracked adding content1_content2_missing-tracked adding content1_content2_missing-untracked adding content1_missing_content1-tracked adding content1_missing_content1-untracked adding content1_missing_content3-tracked adding content1_missing_content3-untracked adding content1_missing_missing-tracked adding content1_missing_missing-untracked $ hg status A content1_content1_content1-tracked A content1_content1_content1-untracked A content1_content1_content3-tracked A content1_content1_content3-untracked A content1_content1_missing-tracked A content1_content1_missing-untracked A content1_content2_content1-tracked A content1_content2_content1-untracked A content1_content2_content2-tracked A content1_content2_content2-untracked A content1_content2_content3-tracked A content1_content2_content3-untracked A content1_content2_missing-tracked A content1_content2_missing-untracked A content1_missing_content1-tracked A content1_missing_content1-untracked A content1_missing_content3-tracked A content1_missing_content3-untracked A content1_missing_missing-tracked A content1_missing_missing-untracked $ hg commit -m 'base' (create a simple text version of the content) $ $PYTHON ../dircontent.py > ../content-base.txt $ cat ../content-base.txt content1 content1_content1_content1-tracked content1 content1_content1_content1-untracked content1 content1_content1_content3-tracked content1 content1_content1_content3-untracked content1 content1_content1_missing-tracked content1 content1_content1_missing-untracked content1 content1_content2_content1-tracked content1 content1_content2_content1-untracked content1 content1_content2_content2-tracked content1 content1_content2_content2-untracked content1 content1_content2_content3-tracked content1 content1_content2_content3-untracked content1 content1_content2_missing-tracked content1 content1_content2_missing-untracked content1 content1_missing_content1-tracked content1 content1_missing_content1-untracked content1 content1_missing_content3-tracked content1 content1_missing_content3-untracked content1 content1_missing_missing-tracked content1 content1_missing_missing-untracked Create parent changeset $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 2 $ hg addremove --similarity 0 removing content1_missing_content1-tracked removing content1_missing_content1-untracked removing content1_missing_content3-tracked removing content1_missing_content3-untracked removing content1_missing_missing-tracked removing content1_missing_missing-untracked adding missing_content2_content2-tracked adding missing_content2_content2-untracked adding missing_content2_content3-tracked adding missing_content2_content3-untracked adding missing_content2_missing-tracked adding missing_content2_missing-untracked $ hg status M content1_content2_content1-tracked M content1_content2_content1-untracked M content1_content2_content2-tracked M content1_content2_content2-untracked M content1_content2_content3-tracked M content1_content2_content3-untracked M content1_content2_missing-tracked M content1_content2_missing-untracked A missing_content2_content2-tracked A missing_content2_content2-untracked A missing_content2_content3-tracked A missing_content2_content3-untracked A missing_content2_missing-tracked A missing_content2_missing-untracked R content1_missing_content1-tracked R content1_missing_content1-untracked R content1_missing_content3-tracked R content1_missing_content3-untracked R content1_missing_missing-tracked R content1_missing_missing-untracked $ hg commit -m 'parent' (create a simple text version of the content) $ $PYTHON ../dircontent.py > ../content-parent.txt $ cat ../content-parent.txt content1 content1_content1_content1-tracked content1 content1_content1_content1-untracked content1 content1_content1_content3-tracked content1 content1_content1_content3-untracked content1 content1_content1_missing-tracked content1 content1_content1_missing-untracked content2 content1_content2_content1-tracked content2 content1_content2_content1-untracked content2 content1_content2_content2-tracked content2 content1_content2_content2-untracked content2 content1_content2_content3-tracked content2 content1_content2_content3-untracked content2 content1_content2_missing-tracked content2 content1_content2_missing-untracked content2 missing_content2_content2-tracked content2 missing_content2_content2-untracked content2 missing_content2_content3-tracked content2 missing_content2_content3-untracked content2 missing_content2_missing-tracked content2 missing_content2_missing-untracked Setup working directory $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 wc $ hg addremove --similarity 0 adding content1_missing_content1-tracked adding content1_missing_content1-untracked adding content1_missing_content3-tracked adding content1_missing_content3-untracked adding content1_missing_missing-tracked adding content1_missing_missing-untracked adding missing_missing_content3-tracked adding missing_missing_content3-untracked adding missing_missing_missing-tracked adding missing_missing_missing-untracked $ hg forget *_*_*-untracked $ rm *_*_missing-* $ hg status M content1_content1_content3-tracked M content1_content2_content1-tracked M content1_content2_content3-tracked M missing_content2_content3-tracked A content1_missing_content1-tracked A content1_missing_content3-tracked A missing_missing_content3-tracked R content1_content1_content1-untracked R content1_content1_content3-untracked R content1_content1_missing-untracked R content1_content2_content1-untracked R content1_content2_content2-untracked R content1_content2_content3-untracked R content1_content2_missing-untracked R missing_content2_content2-untracked R missing_content2_content3-untracked R missing_content2_missing-untracked ! content1_content1_missing-tracked ! content1_content2_missing-tracked ! content1_missing_missing-tracked ! missing_content2_missing-tracked ! missing_missing_missing-tracked ? content1_missing_content1-untracked ? content1_missing_content3-untracked ? missing_missing_content3-untracked $ hg status --rev 'desc("base")' M content1_content1_content3-tracked M content1_content2_content2-tracked M content1_content2_content3-tracked M content1_missing_content3-tracked A missing_content2_content2-tracked A missing_content2_content3-tracked A missing_missing_content3-tracked R content1_content1_content1-untracked R content1_content1_content3-untracked R content1_content1_missing-untracked R content1_content2_content1-untracked R content1_content2_content2-untracked R content1_content2_content3-untracked R content1_content2_missing-untracked R content1_missing_content1-untracked R content1_missing_content3-untracked R content1_missing_missing-untracked ! content1_content1_missing-tracked ! content1_content2_missing-tracked ! content1_missing_missing-tracked ! missing_content2_missing-tracked ! missing_missing_missing-tracked ? missing_missing_content3-untracked (create a simple text version of the content) $ $PYTHON ../dircontent.py > ../content-wc.txt $ cat ../content-wc.txt content1 content1_content1_content1-tracked content1 content1_content1_content1-untracked content3 content1_content1_content3-tracked content3 content1_content1_content3-untracked content1 content1_content2_content1-tracked content1 content1_content2_content1-untracked content2 content1_content2_content2-tracked content2 content1_content2_content2-untracked content3 content1_content2_content3-tracked content3 content1_content2_content3-untracked content1 content1_missing_content1-tracked content1 content1_missing_content1-untracked content3 content1_missing_content3-tracked content3 content1_missing_content3-untracked content2 missing_content2_content2-tracked content2 missing_content2_content2-untracked content3 missing_content2_content3-tracked content3 missing_content2_content3-untracked content3 missing_missing_content3-tracked content3 missing_missing_content3-untracked $ cd .. Test revert --all to parent content ----------------------------------- (setup from reference repo) $ cp -R revert-ref revert-parent-all $ cd revert-parent-all check revert output $ hg revert --all undeleting content1_content1_content1-untracked reverting content1_content1_content3-tracked undeleting content1_content1_content3-untracked reverting content1_content1_missing-tracked undeleting content1_content1_missing-untracked reverting content1_content2_content1-tracked undeleting content1_content2_content1-untracked undeleting content1_content2_content2-untracked reverting content1_content2_content3-tracked undeleting content1_content2_content3-untracked reverting content1_content2_missing-tracked undeleting content1_content2_missing-untracked forgetting content1_missing_content1-tracked forgetting content1_missing_content3-tracked forgetting content1_missing_missing-tracked undeleting missing_content2_content2-untracked reverting missing_content2_content3-tracked undeleting missing_content2_content3-untracked reverting missing_content2_missing-tracked undeleting missing_content2_missing-untracked forgetting missing_missing_content3-tracked forgetting missing_missing_missing-tracked Compare resulting directory with revert target. The diff is filtered to include change only. The only difference should be additional `.orig` backup file when applicable. $ $PYTHON ../dircontent.py > ../content-parent-all.txt $ cd .. $ diff -U 0 -- content-parent.txt content-parent-all.txt | grep _ +content3 content1_content1_content3-tracked.orig +content3 content1_content1_content3-untracked.orig +content1 content1_content2_content1-tracked.orig +content1 content1_content2_content1-untracked.orig +content3 content1_content2_content3-tracked.orig +content3 content1_content2_content3-untracked.orig +content1 content1_missing_content1-tracked +content1 content1_missing_content1-untracked +content3 content1_missing_content3-tracked +content3 content1_missing_content3-untracked +content3 missing_content2_content3-tracked.orig +content3 missing_content2_content3-untracked.orig +content3 missing_missing_content3-tracked +content3 missing_missing_content3-untracked Test revert --all to "base" content ----------------------------------- (setup from reference repo) $ cp -R revert-ref revert-base-all $ cd revert-base-all check revert output $ hg revert --all --rev 'desc(base)' undeleting content1_content1_content1-untracked reverting content1_content1_content3-tracked undeleting content1_content1_content3-untracked reverting content1_content1_missing-tracked undeleting content1_content1_missing-untracked undeleting content1_content2_content1-untracked reverting content1_content2_content2-tracked undeleting content1_content2_content2-untracked reverting content1_content2_content3-tracked undeleting content1_content2_content3-untracked reverting content1_content2_missing-tracked undeleting content1_content2_missing-untracked adding content1_missing_content1-untracked reverting content1_missing_content3-tracked adding content1_missing_content3-untracked reverting content1_missing_missing-tracked adding content1_missing_missing-untracked removing missing_content2_content2-tracked removing missing_content2_content3-tracked removing missing_content2_missing-tracked forgetting missing_missing_content3-tracked forgetting missing_missing_missing-tracked Compare resulting directory with revert target. The diff is filtered to include change only. The only difference should be additional `.orig` backup file when applicable. $ $PYTHON ../dircontent.py > ../content-base-all.txt $ cd .. $ diff -U 0 -- content-base.txt content-base-all.txt | grep _ +content3 content1_content1_content3-tracked.orig +content3 content1_content1_content3-untracked.orig +content2 content1_content2_content2-untracked.orig +content3 content1_content2_content3-tracked.orig +content3 content1_content2_content3-untracked.orig +content3 content1_missing_content3-tracked.orig +content3 content1_missing_content3-untracked.orig +content2 missing_content2_content2-untracked +content3 missing_content2_content3-tracked.orig +content3 missing_content2_content3-untracked +content3 missing_missing_content3-tracked +content3 missing_missing_content3-untracked Test revert to parent content with explicit file name ----------------------------------------------------- (setup from reference repo) $ cp -R revert-ref revert-parent-explicit $ cd revert-parent-explicit revert all files individually and check the output (output is expected to be different than in the --all case) $ for file in `$PYTHON $TESTDIR/generate-working-copy-states.py filelist 2`; do > echo '### revert for:' $file; > hg revert $file; > echo > done ### revert for: content1_content1_content1-tracked no changes needed to content1_content1_content1-tracked ### revert for: content1_content1_content1-untracked ### revert for: content1_content1_content3-tracked ### revert for: content1_content1_content3-untracked ### revert for: content1_content1_missing-tracked ### revert for: content1_content1_missing-untracked ### revert for: content1_content2_content1-tracked ### revert for: content1_content2_content1-untracked ### revert for: content1_content2_content2-tracked no changes needed to content1_content2_content2-tracked ### revert for: content1_content2_content2-untracked ### revert for: content1_content2_content3-tracked ### revert for: content1_content2_content3-untracked ### revert for: content1_content2_missing-tracked ### revert for: content1_content2_missing-untracked ### revert for: content1_missing_content1-tracked ### revert for: content1_missing_content1-untracked file not managed: content1_missing_content1-untracked ### revert for: content1_missing_content3-tracked ### revert for: content1_missing_content3-untracked file not managed: content1_missing_content3-untracked ### revert for: content1_missing_missing-tracked ### revert for: content1_missing_missing-untracked content1_missing_missing-untracked: no such file in rev * (glob) ### revert for: missing_content2_content2-tracked no changes needed to missing_content2_content2-tracked ### revert for: missing_content2_content2-untracked ### revert for: missing_content2_content3-tracked ### revert for: missing_content2_content3-untracked ### revert for: missing_content2_missing-tracked ### revert for: missing_content2_missing-untracked ### revert for: missing_missing_content3-tracked ### revert for: missing_missing_content3-untracked file not managed: missing_missing_content3-untracked ### revert for: missing_missing_missing-tracked ### revert for: missing_missing_missing-untracked missing_missing_missing-untracked: no such file in rev * (glob) check resulting directory against the --all run (There should be no difference) $ $PYTHON ../dircontent.py > ../content-parent-explicit.txt $ cd .. $ diff -U 0 -- content-parent-all.txt content-parent-explicit.txt | grep _ [1] Test revert to "base" content with explicit file name ----------------------------------------------------- (setup from reference repo) $ cp -R revert-ref revert-base-explicit $ cd revert-base-explicit revert all files individually and check the output (output is expected to be different than in the --all case) $ for file in `$PYTHON $TESTDIR/generate-working-copy-states.py filelist 2`; do > echo '### revert for:' $file; > hg revert $file --rev 'desc(base)'; > echo > done ### revert for: content1_content1_content1-tracked no changes needed to content1_content1_content1-tracked ### revert for: content1_content1_content1-untracked ### revert for: content1_content1_content3-tracked ### revert for: content1_content1_content3-untracked ### revert for: content1_content1_missing-tracked ### revert for: content1_content1_missing-untracked ### revert for: content1_content2_content1-tracked no changes needed to content1_content2_content1-tracked ### revert for: content1_content2_content1-untracked ### revert for: content1_content2_content2-tracked ### revert for: content1_content2_content2-untracked ### revert for: content1_content2_content3-tracked ### revert for: content1_content2_content3-untracked ### revert for: content1_content2_missing-tracked ### revert for: content1_content2_missing-untracked ### revert for: content1_missing_content1-tracked no changes needed to content1_missing_content1-tracked ### revert for: content1_missing_content1-untracked ### revert for: content1_missing_content3-tracked ### revert for: content1_missing_content3-untracked ### revert for: content1_missing_missing-tracked ### revert for: content1_missing_missing-untracked ### revert for: missing_content2_content2-tracked ### revert for: missing_content2_content2-untracked no changes needed to missing_content2_content2-untracked ### revert for: missing_content2_content3-tracked ### revert for: missing_content2_content3-untracked no changes needed to missing_content2_content3-untracked ### revert for: missing_content2_missing-tracked ### revert for: missing_content2_missing-untracked no changes needed to missing_content2_missing-untracked ### revert for: missing_missing_content3-tracked ### revert for: missing_missing_content3-untracked file not managed: missing_missing_content3-untracked ### revert for: missing_missing_missing-tracked ### revert for: missing_missing_missing-untracked missing_missing_missing-untracked: no such file in rev * (glob) check resulting directory against the --all run (There should be no difference) $ $PYTHON ../dircontent.py > ../content-base-explicit.txt $ cd .. $ diff -U 0 -- content-base-all.txt content-base-explicit.txt | grep _ [1] Revert to an ancestor of P2 during a merge (issue5052) ----------------------------------------------------- (prepare the repository) $ hg init issue5052 $ cd issue5052 $ echo '.\.orig' > .hgignore $ echo 0 > root $ hg ci -qAm C0 $ echo 0 > A $ hg ci -qAm C1 $ echo 1 >> A $ hg ci -qm C2 $ hg up -q 0 $ echo 1 > B $ hg ci -qAm C3 $ hg status --rev 'ancestor(.,2)' --rev 2 A A $ hg log -G -T '{rev} ({files})\n' @ 3 (B) | | o 2 (A) | | | o 1 (A) |/ o 0 (.hgignore root) actual tests: reverting to something else than a merge parent $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg status --rev 'p1()' M A $ hg status --rev 'p2()' A B $ hg status --rev '1' M A A B $ hg revert --rev 1 --all reverting A removing B $ hg status --rev 1 From the other parents $ hg up -C 'p2()' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg status --rev 'p1()' M B $ hg status --rev 'p2()' A A $ hg status --rev '1' M A A B $ hg revert --rev 1 --all reverting A removing B $ hg status --rev 1 $ cd .. mercurial-4.5.3/tests/test-hgwebdirsym.t0000644015407300116100000000316213261161234020227 0ustar augieeng00000000000000#require serve symlink Tests whether or not hgwebdir properly handles various symlink topologies. hide outer repo $ hg init $ hg init a $ echo a > a/a $ hg --cwd a ci -Ama -d'1 0' adding a $ mkdir webdir $ cd webdir $ hg init b $ echo b > b/b $ hg --cwd b ci -Amb -d'2 0' adding b $ hg init c $ echo c > c/c $ hg --cwd c ci -Amc -d'3 0' adding c $ ln -s ../a al $ ln -s ../webdir circle $ root=`pwd` $ cd .. $ cat > collections.conf < [collections] > $root=$root > EOF $ hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf collections.conf \ > -A access-collections.log -E error-collections.log $ cat hg.pid >> $DAEMON_PIDS should succeed $ get-with-headers.py localhost:$HGPORT '?style=raw' 200 Script output follows /al/ /b/ /c/ $ get-with-headers.py localhost:$HGPORT 'al/file/tip/a?style=raw' 200 Script output follows a $ get-with-headers.py localhost:$HGPORT 'b/file/tip/b?style=raw' 200 Script output follows b $ get-with-headers.py localhost:$HGPORT 'c/file/tip/c?style=raw' 200 Script output follows c should fail $ get-with-headers.py localhost:$HGPORT 'circle/al/file/tip/a?style=raw' 404 Not Found error: repository circle/al/file/tip/a not found [1] $ get-with-headers.py localhost:$HGPORT 'circle/b/file/tip/a?style=raw' 404 Not Found error: repository circle/b/file/tip/a not found [1] $ get-with-headers.py localhost:$HGPORT 'circle/c/file/tip/a?style=raw' 404 Not Found error: repository circle/c/file/tip/a not found [1] collections errors $ cat error-collections.log mercurial-4.5.3/tests/test-export.t0000644015407300116100000001336513261161234017232 0ustar augieeng00000000000000 $ hg init repo $ cd repo $ touch foo $ hg add foo $ for i in 0 1 2 3 4 5 6 7 8 9 10 11; do > echo "foo-$i" >> foo > hg ci -m "foo-$i" > done $ for out in "%nof%N" "%%%H" "%b-%R" "%h" "%r" "%m"; do > echo > echo "# foo-$out.patch" > hg export -v -o "foo-$out.patch" 2:tip > done # foo-%nof%N.patch exporting patches: foo-01of10.patch foo-02of10.patch foo-03of10.patch foo-04of10.patch foo-05of10.patch foo-06of10.patch foo-07of10.patch foo-08of10.patch foo-09of10.patch foo-10of10.patch # foo-%%%H.patch exporting patches: foo-%617188a1c80f869a7b66c85134da88a6fb145f67.patch foo-%dd41a5ff707a5225204105611ba49cc5c229d55f.patch foo-%f95a5410f8664b6e1490a4af654e4b7d41a7b321.patch foo-%4346bcfde53b4d9042489078bcfa9c3e28201db2.patch foo-%afda8c3a009cc99449a05ad8aa4655648c4ecd34.patch foo-%35284ce2b6b99c9d2ac66268fe99e68e1974e1aa.patch foo-%9688c41894e6931305fa7165a37f6568050b4e9b.patch foo-%747d3c68f8ec44bb35816bfcd59aeb50b9654c2f.patch foo-%5f17a83f5fbd9414006a5e563eab4c8a00729efd.patch foo-%f3acbafac161ec68f1598af38f794f28847ca5d3.patch # foo-%b-%R.patch exporting patches: foo-repo-2.patch foo-repo-3.patch foo-repo-4.patch foo-repo-5.patch foo-repo-6.patch foo-repo-7.patch foo-repo-8.patch foo-repo-9.patch foo-repo-10.patch foo-repo-11.patch # foo-%h.patch exporting patches: foo-617188a1c80f.patch foo-dd41a5ff707a.patch foo-f95a5410f866.patch foo-4346bcfde53b.patch foo-afda8c3a009c.patch foo-35284ce2b6b9.patch foo-9688c41894e6.patch foo-747d3c68f8ec.patch foo-5f17a83f5fbd.patch foo-f3acbafac161.patch # foo-%r.patch exporting patches: foo-02.patch foo-03.patch foo-04.patch foo-05.patch foo-06.patch foo-07.patch foo-08.patch foo-09.patch foo-10.patch foo-11.patch # foo-%m.patch exporting patches: foo-foo_2.patch foo-foo_3.patch foo-foo_4.patch foo-foo_5.patch foo-foo_6.patch foo-foo_7.patch foo-foo_8.patch foo-foo_9.patch foo-foo_10.patch foo-foo_11.patch Doing it again clobbers the files rather than appending: $ hg export -v -o "foo-%m.patch" 2:3 exporting patches: foo-foo_2.patch foo-foo_3.patch $ grep HG foo-foo_2.patch | wc -l \s*1 (re) $ grep HG foo-foo_3.patch | wc -l \s*1 (re) Exporting 4 changesets to a file: $ hg export -o export_internal 1 2 3 4 $ grep HG export_internal | wc -l \s*4 (re) Doing it again clobbers the file rather than appending: $ hg export -o export_internal 1 2 3 4 $ grep HG export_internal | wc -l \s*4 (re) Exporting 4 changesets to stdout: $ hg export 1 2 3 4 | grep HG | wc -l \s*4 (re) Exporting revision -2 to a file: $ hg export -- -2 # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 5f17a83f5fbd9414006a5e563eab4c8a00729efd # Parent 747d3c68f8ec44bb35816bfcd59aeb50b9654c2f foo-10 diff -r 747d3c68f8ec -r 5f17a83f5fbd foo --- a/foo Thu Jan 01 00:00:00 1970 +0000 +++ b/foo Thu Jan 01 00:00:00 1970 +0000 @@ -8,3 +8,4 @@ foo-7 foo-8 foo-9 +foo-10 Exporting wdir revision: $ echo "foo-wdir" >> foo $ hg export 'wdir()' # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID ffffffffffffffffffffffffffffffffffffffff # Parent f3acbafac161ec68f1598af38f794f28847ca5d3 diff -r f3acbafac161 foo --- a/foo Thu Jan 01 00:00:00 1970 +0000 +++ b/foo Thu Jan 01 00:00:00 1970 +0000 @@ -10,3 +10,4 @@ foo-9 foo-10 foo-11 +foo-wdir $ hg revert -q foo No filename should be printed if stdout is specified explicitly: $ hg export -v 1 -o - exporting patch: # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID d1c9656e973cfb5aebd5499bbd2cb350e3b12266 # Parent 871558de6af2e8c244222f8eea69b782c94ce3df foo-1 diff -r 871558de6af2 -r d1c9656e973c foo --- a/foo Thu Jan 01 00:00:00 1970 +0000 +++ b/foo Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,2 @@ foo-0 +foo-1 Checking if only alphanumeric characters are used in the file name (%m option): $ echo "line" >> foo $ hg commit -m " !\"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]"'^'"_\`abcdefghijklmnopqrstuvwxyz{|}~" $ hg export -v -o %m.patch tip exporting patch: ____________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz____.patch Catch exporting unknown revisions (especially empty revsets, see issue3353) $ hg export # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 197ecd81a57f760b54f34a58817ad5b04991fa47 # Parent f3acbafac161ec68f1598af38f794f28847ca5d3 !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ diff -r f3acbafac161 -r 197ecd81a57f foo --- a/foo Thu Jan 01 00:00:00 1970 +0000 +++ b/foo Thu Jan 01 00:00:00 1970 +0000 @@ -10,3 +10,4 @@ foo-9 foo-10 foo-11 +line $ hg export "" hg: parse error: empty query [255] $ hg export 999 abort: unknown revision '999'! [255] $ hg export "not all()" abort: export requires at least one changeset [255] Check for color output $ cat <> $HGRCPATH > [color] > mode = ansi > [extensions] > color = > EOF $ hg export --color always --nodates tip # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID * (glob) # Parent * (glob) !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ \x1b[0;1mdiff -r f3acbafac161 -r 197ecd81a57f foo\x1b[0m (esc) \x1b[0;31;1m--- a/foo\x1b[0m (esc) \x1b[0;32;1m+++ b/foo\x1b[0m (esc) \x1b[0;35m@@ -10,3 +10,4 @@\x1b[0m (esc) foo-9 foo-10 foo-11 \x1b[0;32m+line\x1b[0m (esc) $ cd .. mercurial-4.5.3/tests/test-convert-cvs-synthetic.t0000644015407300116100000001131413261161234022162 0ustar augieeng00000000000000#require cvs112 This feature requires use of builtin cvsps! $ echo "[extensions]" >> $HGRCPATH $ echo "convert = " >> $HGRCPATH create cvs repository with one project $ mkdir cvsrepo $ cd cvsrepo $ CVSROOT=`pwd` $ export CVSROOT $ CVS_OPTIONS=-f $ export CVS_OPTIONS $ cd .. $ rmdir cvsrepo $ cvscall() > { > cvs -f "$@" > } output of 'cvs ci' varies unpredictably, so just discard it $ cvsci() > { > sleep 1 > cvs -f ci "$@" >/dev/null > } $ cvscall -d "$CVSROOT" init $ mkdir cvsrepo/proj $ cvscall -q co proj create file1 on the trunk $ cd proj $ touch file1 $ cvscall -Q add file1 $ cvsci -m"add file1 on trunk" file1 create two branches $ cvscall -q tag -b v1_0 T file1 $ cvscall -q tag -b v1_1 T file1 create file2 on branch v1_0 $ cvscall -Q up -rv1_0 $ touch file2 $ cvscall -Q add file2 $ cvsci -m"add file2" file2 create file3, file4 on branch v1_1 $ cvscall -Q up -rv1_1 $ touch file3 $ touch file4 $ cvscall -Q add file3 file4 $ cvsci -m"add file3, file4 on branch v1_1" file3 file4 merge file2 from v1_0 to v1_1 $ cvscall -Q up -jv1_0 $ cvsci -m"MERGE from v1_0: add file2" cvs commit: Examining . Step things up a notch: now we make the history really hairy, with changes bouncing back and forth between trunk and v1_2 and merges going both ways. (I.e., try to model the real world.) create branch v1_2 $ cvscall -Q up -A $ cvscall -q tag -b v1_2 T file1 create file5 on branch v1_2 $ cvscall -Q up -rv1_2 $ touch file5 $ cvs -Q add file5 $ cvsci -m"add file5 on v1_2" cvs commit: Examining . create file6 on trunk post-v1_2 $ cvscall -Q up -A $ touch file6 $ cvscall -Q add file6 $ cvsci -m"add file6 on trunk post-v1_2" cvs commit: Examining . merge file5 from v1_2 to trunk $ cvscall -Q up -A $ cvscall -Q up -jv1_2 file5 $ cvsci -m"MERGE from v1_2: add file5" cvs commit: Examining . merge file6 from trunk to v1_2 $ cvscall -Q up -rv1_2 $ cvscall up -jHEAD file6 U file6 $ cvsci -m"MERGE from HEAD: add file6" cvs commit: Examining . cvs rlog output $ cvscall -q rlog proj | egrep '^(RCS file|revision)' RCS file: $TESTTMP/cvsrepo/proj/file1,v revision 1.1 RCS file: $TESTTMP/cvsrepo/proj/Attic/file2,v revision 1.1 revision 1.1.4.2 revision 1.1.4.1 revision 1.1.2.1 RCS file: $TESTTMP/cvsrepo/proj/Attic/file3,v revision 1.1 revision 1.1.2.1 RCS file: $TESTTMP/cvsrepo/proj/Attic/file4,v revision 1.1 revision 1.1.2.1 RCS file: $TESTTMP/cvsrepo/proj/file5,v revision 1.2 revision 1.1 revision 1.1.2.1 RCS file: $TESTTMP/cvsrepo/proj/file6,v revision 1.1 revision 1.1.2.2 revision 1.1.2.1 convert to hg (#1) $ cd .. $ hg convert --datesort proj proj.hg initializing destination proj.hg repository connecting to $TESTTMP/cvsrepo scanning source... collecting CVS rlog 15 log entries creating changesets 9 changeset entries sorting... converting... 8 add file1 on trunk 7 add file2 6 MERGE from v1_0: add file2 5 file file3 was initially added on branch v1_1. 4 add file3, file4 on branch v1_1 3 add file5 on v1_2 2 add file6 on trunk post-v1_2 1 MERGE from HEAD: add file6 0 MERGE from v1_2: add file5 hg log -G output (#1) $ hg -R proj.hg log -G --template "{rev} {desc}\n" o 8 MERGE from v1_2: add file5 | | o 7 MERGE from HEAD: add file6 | | o | 6 add file6 on trunk post-v1_2 | | | o 5 add file5 on v1_2 | | | | o 4 add file3, file4 on branch v1_1 | | | o | | 3 file file3 was initially added on branch v1_1. |/ / | o 2 MERGE from v1_0: add file2 |/ | o 1 add file2 |/ o 0 add file1 on trunk convert to hg (#2: with merge detection) $ hg convert \ > --config convert.cvsps.mergefrom='"^MERGE from (\S+):"' \ > --datesort \ > proj proj.hg2 initializing destination proj.hg2 repository connecting to $TESTTMP/cvsrepo scanning source... collecting CVS rlog 15 log entries creating changesets 9 changeset entries sorting... converting... 8 add file1 on trunk 7 add file2 6 MERGE from v1_0: add file2 5 file file3 was initially added on branch v1_1. 4 add file3, file4 on branch v1_1 3 add file5 on v1_2 2 add file6 on trunk post-v1_2 1 MERGE from HEAD: add file6 0 MERGE from v1_2: add file5 hg log -G output (#2) $ hg -R proj.hg2 log -G --template "{rev} {desc}\n" o 8 MERGE from v1_2: add file5 | | o 7 MERGE from HEAD: add file6 | | o | 6 add file6 on trunk post-v1_2 | | | o 5 add file5 on v1_2 | | | | o 4 add file3, file4 on branch v1_1 | | | o | | 3 file file3 was initially added on branch v1_1. |/ / | o 2 MERGE from v1_0: add file2 |/ | o 1 add file2 |/ o 0 add file1 on trunk mercurial-4.5.3/tests/test-linerange.py0000644015407300116100000001650113261161234020035 0ustar augieeng00000000000000from __future__ import absolute_import import unittest from mercurial import error, mdiff # for readability, line numbers are 0-origin text1 = ''' 00 at OLD 01 at OLD 02 at OLD 02 at NEW, 03 at OLD 03 at NEW, 04 at OLD 04 at NEW, 05 at OLD 05 at NEW, 06 at OLD 07 at OLD 08 at OLD 09 at OLD 10 at OLD 11 at OLD '''[1:] # strip initial LF text2 = ''' 00 at NEW 01 at NEW 02 at NEW, 03 at OLD 03 at NEW, 04 at OLD 04 at NEW, 05 at OLD 05 at NEW, 06 at OLD 06 at NEW 07 at NEW 08 at NEW 09 at NEW 10 at NEW 11 at NEW '''[1:] # strip initial LF def filteredblocks(blocks, rangeb): """return `rangea` extracted from `blocks` coming from `mdiff.blocksinrange` along with the mask of blocks within rangeb. """ filtered, rangea = mdiff.blocksinrange(blocks, rangeb) skipped = [b not in filtered for b in blocks] return rangea, skipped class blocksinrangetests(unittest.TestCase): def setUp(self): self.blocks = list(mdiff.allblocks(text1, text2)) assert self.blocks == [ ([0, 3, 0, 2], '!'), ((3, 7, 2, 6), '='), ([7, 12, 6, 12], '!'), ((12, 12, 12, 12), '='), ], self.blocks def testWithinEqual(self): """linerange within an "=" block""" # IDX 0 1 # 012345678901 # SRC NNOOOONNNNNN (New/Old) # ^^ linerange2 = (3, 5) linerange1, skipped = filteredblocks(self.blocks, linerange2) self.assertEqual(linerange1, (4, 6)) self.assertEqual(skipped, [True, False, True, True]) def testWithinEqualStrictly(self): """linerange matching exactly an "=" block""" # IDX 0 1 # 012345678901 # SRC NNOOOONNNNNN (New/Old) # ^^^^ linerange2 = (2, 6) linerange1, skipped = filteredblocks(self.blocks, linerange2) self.assertEqual(linerange1, (3, 7)) self.assertEqual(skipped, [True, False, True, True]) def testWithinEqualLowerbound(self): """linerange at beginning of an "=" block""" # IDX 0 1 # 012345678901 # SRC NNOOOONNNNNN (New/Old) # ^^ linerange2 = (2, 4) linerange1, skipped = filteredblocks(self.blocks, linerange2) self.assertEqual(linerange1, (3, 5)) self.assertEqual(skipped, [True, False, True, True]) def testWithinEqualLowerboundOneline(self): """oneline-linerange at beginning of an "=" block""" # IDX 0 1 # 012345678901 # SRC NNOOOONNNNNN (New/Old) # ^ linerange2 = (2, 3) linerange1, skipped = filteredblocks(self.blocks, linerange2) self.assertEqual(linerange1, (3, 4)) self.assertEqual(skipped, [True, False, True, True]) def testWithinEqualUpperbound(self): """linerange at end of an "=" block""" # IDX 0 1 # 012345678901 # SRC NNOOOONNNNNN (New/Old) # ^^^ linerange2 = (3, 6) linerange1, skipped = filteredblocks(self.blocks, linerange2) self.assertEqual(linerange1, (4, 7)) self.assertEqual(skipped, [True, False, True, True]) def testWithinEqualUpperboundOneLine(self): """oneline-linerange at end of an "=" block""" # IDX 0 1 # 012345678901 # SRC NNOOOONNNNNN (New/Old) # ^ linerange2 = (5, 6) linerange1, skipped = filteredblocks(self.blocks, linerange2) self.assertEqual(linerange1, (6, 7)) self.assertEqual(skipped, [True, False, True, True]) def testWithinFirstBlockNeq(self): """linerange within the first "!" block""" # IDX 0 1 # 012345678901 # SRC NNOOOONNNNNN (New/Old) # ^ # | (empty) # ^ # ^^ for linerange2 in [ (0, 1), (1, 1), (1, 2), (0, 2), ]: linerange1, skipped = filteredblocks(self.blocks, linerange2) self.assertEqual(linerange1, (0, 3)) self.assertEqual(skipped, [False, True, True, True]) def testWithinLastBlockNeq(self): """linerange within the last "!" block""" # IDX 0 1 # 012345678901 # SRC NNOOOONNNNNN (New/Old) # ^ # ^ # | (empty) # ^^^^^^ # ^ for linerange2 in [ (6, 7), (7, 8), (7, 7), (6, 12), (11, 12), ]: linerange1, skipped = filteredblocks(self.blocks, linerange2) self.assertEqual(linerange1, (7, 12)) self.assertEqual(skipped, [True, True, False, True]) def testAccrossTwoBlocks(self): """linerange accross two blocks""" # IDX 0 1 # 012345678901 # SRC NNOOOONNNNNN (New/Old) # ^^^^ linerange2 = (1, 5) linerange1, skipped = filteredblocks(self.blocks, linerange2) self.assertEqual(linerange1, (0, 6)) self.assertEqual(skipped, [False, False, True, True]) def testCrossingSeveralBlocks(self): """linerange accross three blocks""" # IDX 0 1 # 012345678901 # SRC NNOOOONNNNNN (New/Old) # ^^^^^^^ linerange2 = (1, 8) linerange1, skipped = filteredblocks(self.blocks, linerange2) self.assertEqual(linerange1, (0, 12)) self.assertEqual(skipped, [False, False, False, True]) def testStartInEqBlock(self): """linerange starting in an "=" block""" # IDX 0 1 # 012345678901 # SRC NNOOOONNNNNN (New/Old) # ^^^^ # ^^^^^^^ for linerange2, expectedlinerange1 in [ ((5, 9), (6, 12)), ((4, 11), (5, 12)), ]: linerange1, skipped = filteredblocks(self.blocks, linerange2) self.assertEqual(linerange1, expectedlinerange1) self.assertEqual(skipped, [True, False, False, True]) def testEndInEqBlock(self): """linerange ending in an "=" block""" # IDX 0 1 # 012345678901 # SRC NNOOOONNNNNN (New/Old) # ^^ # ^^^^^ for linerange2, expectedlinerange1 in [ ((1, 3), (0, 4)), ((0, 4), (0, 5)), ]: linerange1, skipped = filteredblocks(self.blocks, linerange2) self.assertEqual(linerange1, expectedlinerange1) self.assertEqual(skipped, [False, False, True, True]) def testOutOfRange(self): """linerange exceeding file size""" exctype = error.Abort for linerange2 in [ (0, 34), (15, 12), ]: # Could be `with self.assertRaises(error.Abort)` but python2.6 # does not have assertRaises context manager. try: mdiff.blocksinrange(self.blocks, linerange2) except exctype as exc: self.assertTrue('line range exceeds file size' in str(exc)) else: self.fail('%s not raised' % exctype.__name__) if __name__ == '__main__': import silenttestrunner silenttestrunner.main(__name__) mercurial-4.5.3/tests/test-fileset-generated.t0000644015407300116100000001457613261161234021305 0ustar augieeng00000000000000 $ hg init Set up history and working copy $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 1 $ hg addremove -q --similarity 0 $ hg commit -m first $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 2 $ hg addremove -q --similarity 0 $ hg commit -m second $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 wc $ hg addremove -q --similarity 0 $ hg forget *_*_*-untracked $ rm *_*_missing-* Test status $ hg st -A 'set:modified()' M content1_content1_content3-tracked M content1_content2_content1-tracked M content1_content2_content3-tracked M missing_content2_content3-tracked $ hg st -A 'set:added()' A content1_missing_content1-tracked A content1_missing_content3-tracked A missing_missing_content3-tracked $ hg st -A 'set:removed()' R content1_content1_content1-untracked R content1_content1_content3-untracked R content1_content1_missing-untracked R content1_content2_content1-untracked R content1_content2_content2-untracked R content1_content2_content3-untracked R content1_content2_missing-untracked R missing_content2_content2-untracked R missing_content2_content3-untracked R missing_content2_missing-untracked $ hg st -A 'set:deleted()' ! content1_content1_missing-tracked ! content1_content2_missing-tracked ! content1_missing_missing-tracked ! missing_content2_missing-tracked ! missing_missing_missing-tracked $ hg st -A 'set:missing()' ! content1_content1_missing-tracked ! content1_content2_missing-tracked ! content1_missing_missing-tracked ! missing_content2_missing-tracked ! missing_missing_missing-tracked $ hg st -A 'set:unknown()' ? content1_missing_content1-untracked ? content1_missing_content3-untracked ? missing_missing_content3-untracked $ hg st -A 'set:clean()' C content1_content1_content1-tracked C content1_content2_content2-tracked C missing_content2_content2-tracked Test log $ hg log -T '{rev}\n' --stat 'set:modified()' 1 content1_content2_content1-tracked | 2 +- content1_content2_content3-tracked | 2 +- missing_content2_content3-tracked | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) 0 content1_content1_content3-tracked | 1 + content1_content2_content1-tracked | 1 + content1_content2_content3-tracked | 1 + 3 files changed, 3 insertions(+), 0 deletions(-) Largefiles doesn't crash $ hg log -T '{rev}\n' --stat 'set:modified()' --config extensions.largefiles= The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) 1 content1_content2_content1-tracked | 2 +- content1_content2_content3-tracked | 2 +- missing_content2_content3-tracked | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) 0 content1_content1_content3-tracked | 1 + content1_content2_content1-tracked | 1 + content1_content2_content3-tracked | 1 + 3 files changed, 3 insertions(+), 0 deletions(-) $ hg log -T '{rev}\n' --stat 'set:added()' 1 content1_missing_content1-tracked | 1 - content1_missing_content3-tracked | 1 - 2 files changed, 0 insertions(+), 2 deletions(-) 0 content1_missing_content1-tracked | 1 + content1_missing_content3-tracked | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) $ hg log -T '{rev}\n' --stat 'set:removed()' 1 content1_content2_content1-untracked | 2 +- content1_content2_content2-untracked | 2 +- content1_content2_content3-untracked | 2 +- content1_content2_missing-untracked | 2 +- missing_content2_content2-untracked | 1 + missing_content2_content3-untracked | 1 + missing_content2_missing-untracked | 1 + 7 files changed, 7 insertions(+), 4 deletions(-) 0 content1_content1_content1-untracked | 1 + content1_content1_content3-untracked | 1 + content1_content1_missing-untracked | 1 + content1_content2_content1-untracked | 1 + content1_content2_content2-untracked | 1 + content1_content2_content3-untracked | 1 + content1_content2_missing-untracked | 1 + 7 files changed, 7 insertions(+), 0 deletions(-) $ hg log -T '{rev}\n' --stat 'set:deleted()' 1 content1_content2_missing-tracked | 2 +- content1_missing_missing-tracked | 1 - missing_content2_missing-tracked | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) 0 content1_content1_missing-tracked | 1 + content1_content2_missing-tracked | 1 + content1_missing_missing-tracked | 1 + 3 files changed, 3 insertions(+), 0 deletions(-) $ hg log -T '{rev}\n' --stat 'set:unknown()' 1 content1_missing_content1-untracked | 1 - content1_missing_content3-untracked | 1 - 2 files changed, 0 insertions(+), 2 deletions(-) 0 content1_missing_content1-untracked | 1 + content1_missing_content3-untracked | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) $ hg log -T '{rev}\n' --stat 'set:clean()' 1 content1_content2_content2-tracked | 2 +- missing_content2_content2-tracked | 1 + 2 files changed, 2 insertions(+), 1 deletions(-) 0 content1_content1_content1-tracked | 1 + content1_content2_content2-tracked | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) Test revert $ hg revert 'set:modified()' reverting content1_content1_content3-tracked reverting content1_content2_content1-tracked reverting content1_content2_content3-tracked reverting missing_content2_content3-tracked $ hg revert 'set:added()' forgetting content1_missing_content1-tracked forgetting content1_missing_content3-tracked forgetting missing_missing_content3-tracked $ hg revert 'set:removed()' undeleting content1_content1_content1-untracked undeleting content1_content1_content3-untracked undeleting content1_content1_missing-untracked undeleting content1_content2_content1-untracked undeleting content1_content2_content2-untracked undeleting content1_content2_content3-untracked undeleting content1_content2_missing-untracked undeleting missing_content2_content2-untracked undeleting missing_content2_content3-untracked undeleting missing_content2_missing-untracked $ hg revert 'set:deleted()' reverting content1_content1_missing-tracked reverting content1_content2_missing-tracked forgetting content1_missing_missing-tracked reverting missing_content2_missing-tracked forgetting missing_missing_missing-tracked $ hg revert 'set:unknown()' $ hg revert 'set:clean()' mercurial-4.5.3/tests/test-mq-safety.t0000644015407300116100000001150713261161234017613 0ustar augieeng00000000000000 $ echo '[extensions]' >> $HGRCPATH $ echo 'hgext.mq =' >> $HGRCPATH $ hg init repo $ cd repo $ echo foo > foo $ hg ci -qAm 'add a file' $ hg qinit $ hg qnew foo $ echo foo >> foo $ hg qrefresh -m 'append foo' $ hg qnew bar $ echo bar >> foo $ hg qrefresh -m 'append bar' Try to operate on public mq changeset $ hg qpop popping bar now at: foo $ hg phase --public qbase $ echo babar >> foo $ hg qref abort: cannot qrefresh public revision (see 'hg help phases' for details) [255] $ hg revert -a reverting foo $ hg qpop abort: popping would remove a public revision (see 'hg help phases' for details) [255] $ hg qfold bar abort: cannot qrefresh public revision (see 'hg help phases' for details) [255] $ hg revert -a reverting foo restore state for remaining test $ hg qpush applying bar now at: bar try to commit on top of a patch $ echo quux >> foo $ hg ci -m 'append quux' abort: cannot commit over an applied mq patch [255] cheat a bit... $ mv .hg/patches .hg/patches2 $ hg ci -m 'append quux' $ mv .hg/patches2 .hg/patches qpop/qrefresh on the wrong revision $ hg qpop abort: popping would remove a revision not managed by this patch queue [255] $ hg qpop -n patches using patch queue: $TESTTMP/repo/.hg/patches abort: popping would remove a revision not managed by this patch queue [255] $ hg qrefresh abort: working directory revision is not qtip [255] $ hg up -C qtip 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg qpop abort: popping would remove a revision not managed by this patch queue [255] $ hg qrefresh abort: cannot qrefresh a revision with children [255] $ hg tip --template '{rev} {desc}\n' 3 append quux qpush warning branchheads $ cd .. $ hg init branchy $ cd branchy $ echo q > q $ hg add q $ hg qnew -f qp $ hg qpop popping qp patch queue now empty $ echo a > a $ hg ci -Ama adding a $ hg up null 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg branch b marked working directory as branch b (branches are permanent and global, did you want a bookmark?) $ echo c > c $ hg ci -Amc adding c $ hg merge default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -mmerge $ hg up default 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg log changeset: 2:65309210bf4e branch: b tag: tip parent: 1:707adb4c8ae1 parent: 0:cb9a9f314b8b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: merge changeset: 1:707adb4c8ae1 branch: b parent: -1:000000000000 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: c changeset: 0:cb9a9f314b8b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a $ hg qpush applying qp now at: qp Testing applied patches, push and --force $ cd .. $ hg init forcepush $ cd forcepush $ echo a > a $ hg ci -Am adda adding a $ echo a >> a $ hg ci -m changea $ hg up 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg branch branch marked working directory as branch branch (branches are permanent and global, did you want a bookmark?) $ echo b > b $ hg ci -Am addb adding b $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg --cwd .. clone -r 0 forcepush forcepush2 adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 07f494440405 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo a >> a $ hg qnew patch Pushing applied patch with --rev without --force $ hg push -r . ../forcepush2 pushing to ../forcepush2 abort: source has mq patches applied [255] Pushing applied patch with branchhash, without --force $ hg push ../forcepush2#default pushing to ../forcepush2 abort: source has mq patches applied [255] Pushing revs excluding applied patch $ hg push --new-branch -r 'branch(branch)' -r 2 ../forcepush2 pushing to ../forcepush2 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files Pushing applied patch with --force $ hg phase --force --secret 'mq()' $ hg push --force -r default ../forcepush2 pushing to ../forcepush2 searching for changes no changes found (ignored 1 secret changesets) [1] $ hg phase --draft 'mq()' $ hg push --force -r default ../forcepush2 pushing to ../forcepush2 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) $ cd .. mercurial-4.5.3/tests/test-issue1438.t0000644015407300116100000000055713261161234017360 0ustar augieeng00000000000000#require symlink https://bz.mercurial-scm.org/1438 $ hg init $ ln -s foo link $ hg add link $ hg ci -mbad link $ hg rm link $ hg ci -mok $ hg diff -g -r 0:1 > bad.patch $ hg up 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg import --no-commit bad.patch applying bad.patch $ hg status R link ? bad.patch mercurial-4.5.3/tests/test-mq-qgoto.t0000644015407300116100000000267013261161234017452 0ustar augieeng00000000000000 $ echo "[extensions]" >> $HGRCPATH $ echo "mq=" >> $HGRCPATH $ hg init a $ cd a $ echo a > a $ hg ci -Ama adding a $ hg qnew a.patch $ echo a >> a $ hg qrefresh $ hg qnew b.patch $ echo b > b $ hg add b $ hg qrefresh $ hg qnew c.patch $ echo c > c $ hg add c $ hg qrefresh $ hg qgoto a.patch popping c.patch popping b.patch now at: a.patch $ hg qgoto c.patch applying b.patch applying c.patch now at: c.patch $ hg qgoto b.patch popping c.patch now at: b.patch Using index: $ hg qgoto 0 popping b.patch now at: a.patch $ hg qgoto 2 applying b.patch applying c.patch now at: c.patch No warnings when using index ... and update from non-qtip and with pending changes in unrelated files: $ hg qnew bug314159 $ echo d >> c $ hg qrefresh $ hg qnew bug141421 $ echo e >> b $ hg qrefresh $ hg up -r bug314159 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo f >> a $ echo f >> b $ echo f >> c $ hg qgoto 1 abort: local changes found, qrefresh first [255] $ hg qgoto 1 -f popping bug141421 popping bug314159 popping c.patch now at: b.patch $ hg st M a M b ? c.orig $ hg up -qCr. $ hg qgoto 3 applying c.patch applying bug314159 now at: bug314159 Detect ambiguous non-index: $ hg qgoto 14 patch name "14" is ambiguous: bug314159 bug141421 abort: patch 14 not in series [255] $ cd .. mercurial-4.5.3/tests/test-execute-bit.t0000644015407300116100000000103513261161234020116 0ustar augieeng00000000000000#require execbit $ hg init $ echo a > a $ hg ci -Am'not executable' adding a $ chmod +x a $ hg ci -m'executable' $ hg id 79abf14474dc tip Make sure we notice the change of mode if the cached size == -1: $ hg rm a $ hg revert -r 0 a $ hg debugstate n 0 -1 unset a $ hg status M a $ hg up 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id d69afc33ff8a $ test -x a && echo executable -- bad || echo not executable -- good not executable -- good mercurial-4.5.3/tests/test-gendoc-el.t0000644015407300116100000000012413261161234017533 0ustar augieeng00000000000000#require docutils gettext $ $TESTDIR/check-gendoc el checking for parse errors mercurial-4.5.3/tests/test-wireproto.py0000644015407300116100000000325513261161234020125 0ustar augieeng00000000000000from __future__ import absolute_import, print_function from mercurial import ( util, wireproto, ) stringio = util.stringio class proto(object): def __init__(self, args): self.args = args def getargs(self, spec): args = self.args args.setdefault('*', {}) names = spec.split() return [args[n] for n in names] class clientpeer(wireproto.wirepeer): def __init__(self, serverrepo): self.serverrepo = serverrepo @property def ui(self): return self.serverrepo.ui def url(self): return 'test' def local(self): return None def peer(self): return self def canpush(self): return True def close(self): pass def capabilities(self): return ['batch'] def _call(self, cmd, **args): return wireproto.dispatch(self.serverrepo, proto(args), cmd) def _callstream(self, cmd, **args): return stringio(self._call(cmd, **args)) @wireproto.batchable def greet(self, name): f = wireproto.future() yield {'name': mangle(name)}, f yield unmangle(f.value) class serverrepo(object): def greet(self, name): return "Hello, " + name def filtered(self, name): return self def mangle(s): return ''.join(chr(ord(c) + 1) for c in s) def unmangle(s): return ''.join(chr(ord(c) - 1) for c in s) def greet(repo, proto, name): return mangle(repo.greet(unmangle(name))) wireproto.commands['greet'] = (greet, 'name',) srv = serverrepo() clt = clientpeer(srv) print(clt.greet("Foobar")) b = clt.iterbatch() map(b.greet, ('Fo, =;: { > run-tests.py --with-hg=`which hg` "$@" > } error paths #if symlink $ ln -s `which true` hg $ run-tests.py --with-hg=./hg warning: --with-hg should specify an hg script # Ran 0 tests, 0 skipped, 0 failed. $ rm hg #endif #if execbit $ touch hg $ run-tests.py --with-hg=./hg usage: run-tests.py [options] [tests] run-tests.py: error: --with-hg must specify an executable hg script [2] $ rm hg #endif Features for testing optional lines =================================== $ cat > hghaveaddon.py < import hghave > @hghave.check("custom", "custom hghave feature") > def has_custom(): > return True > @hghave.check("missing", "missing hghave feature") > def has_missing(): > return False > EOF an empty test ======================= $ touch test-empty.t $ rt . # Ran 1 tests, 0 skipped, 0 failed. $ rm test-empty.t a succesful test ======================= $ cat > test-success.t << EOF > $ echo babar > babar > $ echo xyzzy > dont_print (?) > nothing[42]line (re) (?) > never*happens (glob) (?) > more_nothing (?) > xyzzy > nor this (?) > $ printf 'abc\ndef\nxyz\n' > 123 (?) > abc > def (?) > 456 (?) > xyz > $ printf 'zyx\nwvu\ntsr\n' > abc (?) > zyx (custom !) > wvu > no_print (no-custom !) > tsr (no-missing !) > missing (missing !) > EOF $ rt . # Ran 1 tests, 0 skipped, 0 failed. failing test ================== test churn with globs $ cat > test-failure.t < $ echo "bar-baz"; echo "bar-bad"; echo foo > bar*bad (glob) > bar*baz (glob) > | fo (re) > EOF $ rt test-failure.t --- $TESTTMP/test-failure.t +++ $TESTTMP/test-failure.t.err @@ -1,4 +1,4 @@ $ echo "bar-baz"; echo "bar-bad"; echo foo + bar*baz (glob) bar*bad (glob) - bar*baz (glob) - | fo (re) + foo ERROR: test-failure.t output changed ! Failed test-failure.t: output changed # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] test diff colorisation #if no-windows pygments $ rt test-failure.t --color always \x1b[38;5;124m--- $TESTTMP/test-failure.t\x1b[39m (esc) \x1b[38;5;34m+++ $TESTTMP/test-failure.t.err\x1b[39m (esc) \x1b[38;5;90;01m@@ -1,4 +1,4 @@\x1b[39;00m (esc) $ echo "bar-baz"; echo "bar-bad"; echo foo \x1b[38;5;34m+ bar*baz (glob)\x1b[39m (esc) bar*bad (glob) \x1b[38;5;124m- bar*baz (glob)\x1b[39m (esc) \x1b[38;5;124m- | fo (re)\x1b[39m (esc) \x1b[38;5;34m+ foo\x1b[39m (esc) \x1b[38;5;88mERROR: \x1b[39m\x1b[38;5;9mtest-failure.t\x1b[39m\x1b[38;5;88m output changed\x1b[39m (esc) ! \x1b[38;5;88mFailed \x1b[39m\x1b[38;5;9mtest-failure.t\x1b[39m\x1b[38;5;88m: output changed\x1b[39m (esc) # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] $ rt test-failure.t 2> tmp.log [1] $ cat tmp.log --- $TESTTMP/test-failure.t +++ $TESTTMP/test-failure.t.err @@ -1,4 +1,4 @@ $ echo "bar-baz"; echo "bar-bad"; echo foo + bar*baz (glob) bar*bad (glob) - bar*baz (glob) - | fo (re) + foo ERROR: test-failure.t output changed ! Failed test-failure.t: output changed # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) #endif $ cat > test-failure.t << EOF > $ true > should go away (true !) > $ true > should stay (false !) > > Should remove first line, not second or third > $ echo 'testing' > baz*foo (glob) (true !) > foobar*foo (glob) (false !) > te*ting (glob) (true !) > > Should keep first two lines, remove third and last > $ echo 'testing' > test.ng (re) (true !) > foo.ar (re) (false !) > b.r (re) (true !) > missing (?) > awol (true !) > > The "missing" line should stay, even though awol is dropped > $ echo 'testing' > test.ng (re) (true !) > foo.ar (?) > awol > missing (?) > EOF $ rt test-failure.t --- $TESTTMP/test-failure.t +++ $TESTTMP/test-failure.t.err @@ -1,11 +1,9 @@ $ true - should go away (true !) $ true should stay (false !) Should remove first line, not second or third $ echo 'testing' - baz*foo (glob) (true !) foobar*foo (glob) (false !) te*ting (glob) (true !) foo.ar (re) (false !) missing (?) @@ -13,13 +11,10 @@ $ echo 'testing' test.ng (re) (true !) foo.ar (re) (false !) - b.r (re) (true !) missing (?) - awol (true !) The "missing" line should stay, even though awol is dropped $ echo 'testing' test.ng (re) (true !) foo.ar (?) - awol missing (?) ERROR: test-failure.t output changed ! Failed test-failure.t: output changed # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] basic failing test $ cat > test-failure.t << EOF > $ echo babar > rataxes > This is a noop statement so that > this test is still more bytes than success. > pad pad pad pad............................................................ > pad pad pad pad............................................................ > pad pad pad pad............................................................ > pad pad pad pad............................................................ > pad pad pad pad............................................................ > pad pad pad pad............................................................ > EOF >>> fh = open('test-failure-unicode.t', 'wb') >>> fh.write(u' $ echo babar\u03b1\n'.encode('utf-8')) and None >>> fh.write(u' l\u03b5\u03b5t\n'.encode('utf-8')) and None $ rt --- $TESTTMP/test-failure.t +++ $TESTTMP/test-failure.t.err @@ -1,5 +1,5 @@ $ echo babar - rataxes + babar This is a noop statement so that this test is still more bytes than success. pad pad pad pad............................................................ ERROR: test-failure.t output changed !. --- $TESTTMP/test-failure-unicode.t +++ $TESTTMP/test-failure-unicode.t.err @@ -1,2 +1,2 @@ $ echo babar\xce\xb1 (esc) - l\xce\xb5\xce\xb5t (esc) + babar\xce\xb1 (esc) ERROR: test-failure-unicode.t output changed ! Failed test-failure.t: output changed Failed test-failure-unicode.t: output changed # Ran 3 tests, 0 skipped, 2 failed. python hash seed: * (glob) [1] test --outputdir $ mkdir output $ rt --outputdir output --- $TESTTMP/test-failure.t +++ $TESTTMP/output/test-failure.t.err @@ -1,5 +1,5 @@ $ echo babar - rataxes + babar This is a noop statement so that this test is still more bytes than success. pad pad pad pad............................................................ ERROR: test-failure.t output changed !. --- $TESTTMP/test-failure-unicode.t +++ $TESTTMP/output/test-failure-unicode.t.err @@ -1,2 +1,2 @@ $ echo babar\xce\xb1 (esc) - l\xce\xb5\xce\xb5t (esc) + babar\xce\xb1 (esc) ERROR: test-failure-unicode.t output changed ! Failed test-failure.t: output changed Failed test-failure-unicode.t: output changed # Ran 3 tests, 0 skipped, 2 failed. python hash seed: * (glob) [1] $ ls -a output . .. .testtimes test-failure-unicode.t.err test-failure.t.err test --xunit support $ rt --xunit=xunit.xml --- $TESTTMP/test-failure.t +++ $TESTTMP/test-failure.t.err @@ -1,5 +1,5 @@ $ echo babar - rataxes + babar This is a noop statement so that this test is still more bytes than success. pad pad pad pad............................................................ ERROR: test-failure.t output changed !. --- $TESTTMP/test-failure-unicode.t +++ $TESTTMP/test-failure-unicode.t.err @@ -1,2 +1,2 @@ $ echo babar\xce\xb1 (esc) - l\xce\xb5\xce\xb5t (esc) + babar\xce\xb1 (esc) ERROR: test-failure-unicode.t output changed ! Failed test-failure.t: output changed Failed test-failure-unicode.t: output changed # Ran 3 tests, 0 skipped, 2 failed. python hash seed: * (glob) [1] $ cat xunit.xml (glob) (glob) (glob) $ cat .testtimes test-failure-unicode.t * (glob) test-failure.t * (glob) test-success.t * (glob) $ rt --list-tests test-failure-unicode.t test-failure.t test-success.t $ rt --list-tests --json test-failure-unicode.t test-failure.t test-success.t $ cat report.json testreport ={ "test-failure-unicode.t": { "result": "success" }, "test-failure.t": { "result": "success" }, "test-success.t": { "result": "success" } } (no-eol) $ rt --list-tests --xunit=xunit.xml test-failure-unicode.t test-failure.t test-success.t $ cat xunit.xml $ rt --list-tests test-failure* --json --xunit=xunit.xml --outputdir output test-failure-unicode.t test-failure.t $ cat output/report.json testreport ={ "test-failure-unicode.t": { "result": "success" }, "test-failure.t": { "result": "success" } } (no-eol) $ cat xunit.xml $ rm test-failure-unicode.t test for --retest ==================== $ rt --retest --- $TESTTMP/test-failure.t +++ $TESTTMP/test-failure.t.err @@ -1,5 +1,5 @@ $ echo babar - rataxes + babar This is a noop statement so that this test is still more bytes than success. pad pad pad pad............................................................ ERROR: test-failure.t output changed ! Failed test-failure.t: output changed # Ran 2 tests, 1 skipped, 1 failed. python hash seed: * (glob) [1] --retest works with --outputdir $ rm -r output $ mkdir output $ mv test-failure.t.err output $ rt --retest --outputdir output --- $TESTTMP/test-failure.t +++ $TESTTMP/output/test-failure.t.err @@ -1,5 +1,5 @@ $ echo babar - rataxes + babar This is a noop statement so that this test is still more bytes than success. pad pad pad pad............................................................ ERROR: test-failure.t output changed ! Failed test-failure.t: output changed # Ran 2 tests, 1 skipped, 1 failed. python hash seed: * (glob) [1] Selecting Tests To Run ====================== successful $ rt test-success.t . # Ran 1 tests, 0 skipped, 0 failed. success w/ keyword $ rt -k xyzzy . # Ran 2 tests, 1 skipped, 0 failed. failed $ rt test-failure.t --- $TESTTMP/test-failure.t +++ $TESTTMP/test-failure.t.err @@ -1,5 +1,5 @@ $ echo babar - rataxes + babar This is a noop statement so that this test is still more bytes than success. pad pad pad pad............................................................ ERROR: test-failure.t output changed ! Failed test-failure.t: output changed # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] failure w/ keyword $ rt -k rataxes --- $TESTTMP/test-failure.t +++ $TESTTMP/test-failure.t.err @@ -1,5 +1,5 @@ $ echo babar - rataxes + babar This is a noop statement so that this test is still more bytes than success. pad pad pad pad............................................................ ERROR: test-failure.t output changed ! Failed test-failure.t: output changed # Ran 2 tests, 1 skipped, 1 failed. python hash seed: * (glob) [1] Verify that when a process fails to start we show a useful message ================================================================== $ cat > test-serve-fail.t < $ echo 'abort: child process failed to start blah' > EOF $ rt test-serve-fail.t ERROR: test-serve-fail.t output changed ! Failed test-serve-fail.t: server failed to start (HGPORT=*) (glob) # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] $ rm test-serve-fail.t Verify that we can try other ports =================================== $ hg init inuse $ hg serve -R inuse -p $HGPORT -d --pid-file=blocks.pid $ cat blocks.pid >> $DAEMON_PIDS $ cat > test-serve-inuse.t < $ hg serve -R `pwd`/inuse -p \$HGPORT -d --pid-file=hg.pid > $ cat hg.pid >> \$DAEMON_PIDS > EOF $ rt test-serve-inuse.t . # Ran 1 tests, 0 skipped, 0 failed. $ rm test-serve-inuse.t $ killdaemons.py $DAEMON_PIDS $ rm $DAEMON_PIDS Running In Debug Mode ====================== $ rt --debug 2>&1 | grep -v pwd + echo *SALT* 0 0 (glob) *SALT* 0 0 (glob) + echo babar babar + echo *SALT* 10 0 (glob) *SALT* 10 0 (glob) *+ echo *SALT* 0 0 (glob) *SALT* 0 0 (glob) + echo babar babar + echo *SALT* 2 0 (glob) *SALT* 2 0 (glob) + echo xyzzy xyzzy + echo *SALT* 9 0 (glob) *SALT* 9 0 (glob) + printf *abc\ndef\nxyz\n* (glob) abc def xyz + echo *SALT* 15 0 (glob) *SALT* 15 0 (glob) + printf *zyx\nwvu\ntsr\n* (glob) zyx wvu tsr + echo *SALT* 22 0 (glob) *SALT* 22 0 (glob) . # Ran 2 tests, 0 skipped, 0 failed. Parallel runs ============== (duplicate the failing test to get predictable output) $ cp test-failure.t test-failure-copy.t $ rt --jobs 2 test-failure*.t -n !! Failed test-failure*.t: output changed (glob) Failed test-failure*.t: output changed (glob) # Ran 2 tests, 0 skipped, 2 failed. python hash seed: * (glob) [1] failures in parallel with --first should only print one failure $ rt --jobs 2 --first test-failure*.t --- $TESTTMP/test-failure*.t (glob) +++ $TESTTMP/test-failure*.t.err (glob) @@ -1,5 +1,5 @@ $ echo babar - rataxes + babar This is a noop statement so that this test is still more bytes than success. pad pad pad pad............................................................ Failed test-failure*.t: output changed (glob) Failed test-failure*.t: output changed (glob) # Ran 2 tests, 0 skipped, 2 failed. python hash seed: * (glob) [1] (delete the duplicated test file) $ rm test-failure-copy.t Interactive run =============== (backup the failing test) $ cp test-failure.t backup Refuse the fix $ echo 'n' | rt -i --- $TESTTMP/test-failure.t +++ $TESTTMP/test-failure.t.err @@ -1,5 +1,5 @@ $ echo babar - rataxes + babar This is a noop statement so that this test is still more bytes than success. pad pad pad pad............................................................ Accept this change? [n] ERROR: test-failure.t output changed !. Failed test-failure.t: output changed # Ran 2 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] $ cat test-failure.t $ echo babar rataxes This is a noop statement so that this test is still more bytes than success. pad pad pad pad............................................................ pad pad pad pad............................................................ pad pad pad pad............................................................ pad pad pad pad............................................................ pad pad pad pad............................................................ pad pad pad pad............................................................ Interactive with custom view $ echo 'n' | rt -i --view echo $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err Accept this change? [n]* (glob) ERROR: test-failure.t output changed !. Failed test-failure.t: output changed # Ran 2 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] View the fix $ echo 'y' | rt --view echo $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err ERROR: test-failure.t output changed !. Failed test-failure.t: output changed # Ran 2 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] Accept the fix $ cat >> test-failure.t < $ echo 'saved backup bundle to \$TESTTMP/foo.hg' > saved backup bundle to \$TESTTMP/foo.hg > $ echo 'saved backup bundle to \$TESTTMP/foo.hg' > saved backup bundle to $TESTTMP\\foo.hg > $ echo 'saved backup bundle to \$TESTTMP/foo.hg' > saved backup bundle to \$TESTTMP/*.hg (glob) > EOF $ echo 'y' | rt -i 2>&1 --- $TESTTMP/test-failure.t +++ $TESTTMP/test-failure.t.err @@ -1,5 +1,5 @@ $ echo babar - rataxes + babar This is a noop statement so that this test is still more bytes than success. pad pad pad pad............................................................ @@ -11,6 +11,6 @@ $ echo 'saved backup bundle to $TESTTMP/foo.hg' saved backup bundle to $TESTTMP/foo.hg $ echo 'saved backup bundle to $TESTTMP/foo.hg' - saved backup bundle to $TESTTMP\foo.hg + saved backup bundle to $TESTTMP/foo.hg $ echo 'saved backup bundle to $TESTTMP/foo.hg' saved backup bundle to $TESTTMP/*.hg (glob) Accept this change? [n] .. # Ran 2 tests, 0 skipped, 0 failed. $ sed -e 's,(glob)$,&<,g' test-failure.t $ echo babar babar This is a noop statement so that this test is still more bytes than success. pad pad pad pad............................................................ pad pad pad pad............................................................ pad pad pad pad............................................................ pad pad pad pad............................................................ pad pad pad pad............................................................ pad pad pad pad............................................................ $ echo 'saved backup bundle to $TESTTMP/foo.hg' saved backup bundle to $TESTTMP/foo.hg $ echo 'saved backup bundle to $TESTTMP/foo.hg' saved backup bundle to $TESTTMP/foo.hg $ echo 'saved backup bundle to $TESTTMP/foo.hg' saved backup bundle to $TESTTMP/*.hg (glob)< Race condition - test file was modified when test is running $ TESTRACEDIR=`pwd` $ export TESTRACEDIR $ cat > test-race.t < $ echo 1 > $ echo "# a new line" >> $TESTRACEDIR/test-race.t > EOF $ rt -i test-race.t --- $TESTTMP/test-race.t +++ $TESTTMP/test-race.t.err @@ -1,2 +1,3 @@ $ echo 1 + 1 $ echo "# a new line" >> $TESTTMP/test-race.t Reference output has changed (run again to prompt changes) ERROR: test-race.t output changed ! Failed test-race.t: output changed # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] $ rm test-race.t When "#testcases" is used in .t files $ cat >> test-cases.t < #testcases a b > #if a > $ echo 1 > #endif > #if b > $ echo 2 > #endif > EOF $ cat <&1 > y > y > EOF --- $TESTTMP/test-cases.t +++ $TESTTMP/test-cases.t.a.err @@ -1,6 +1,7 @@ #testcases a b #if a $ echo 1 + 1 #endif #if b $ echo 2 Accept this change? [n] . --- $TESTTMP/test-cases.t +++ $TESTTMP/test-cases.t.b.err @@ -5,4 +5,5 @@ #endif #if b $ echo 2 + 2 #endif Accept this change? [n] . # Ran 2 tests, 0 skipped, 0 failed. $ cat test-cases.t #testcases a b #if a $ echo 1 1 #endif #if b $ echo 2 2 #endif $ cat >> test-cases.t <<'EOF' > #if a > $ NAME=A > #else > $ NAME=B > #endif > $ echo $NAME > A (a !) > B (b !) > EOF $ rt test-cases.t .. # Ran 2 tests, 0 skipped, 0 failed. $ rm test-cases.t (reinstall) $ mv backup test-failure.t No Diff =============== $ rt --nodiff !. Failed test-failure.t: output changed # Ran 2 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] test --tmpdir support $ rt --tmpdir=$TESTTMP/keep test-success.t Keeping testtmp dir: $TESTTMP/keep/child1/test-success.t Keeping threadtmp dir: $TESTTMP/keep/child1 . # Ran 1 tests, 0 skipped, 0 failed. timeouts ======== $ cat > test-timeout.t < $ sleep 2 > $ echo pass > pass > EOF > echo '#require slow' > test-slow-timeout.t > cat test-timeout.t >> test-slow-timeout.t $ rt --timeout=1 --slowtimeout=3 test-timeout.t test-slow-timeout.t st Skipped test-slow-timeout.t: missing feature: allow slow tests (use --allow-slow-tests) Failed test-timeout.t: timed out # Ran 1 tests, 1 skipped, 1 failed. python hash seed: * (glob) [1] $ rt --timeout=1 --slowtimeout=3 \ > test-timeout.t test-slow-timeout.t --allow-slow-tests .t Failed test-timeout.t: timed out # Ran 2 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] $ rm test-timeout.t test-slow-timeout.t test for --time ================== $ rt test-success.t --time . # Ran 1 tests, 0 skipped, 0 failed. # Producing time report start end cuser csys real Test \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re) test for --time with --job enabled ==================================== $ rt test-success.t --time --jobs 2 . # Ran 1 tests, 0 skipped, 0 failed. # Producing time report start end cuser csys real Test \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re) Skips ================ $ cat > test-skip.t < $ echo xyzzy > #require false > EOF $ rt --nodiff !.s Skipped test-skip.t: missing feature: nail clipper Failed test-failure.t: output changed # Ran 2 tests, 1 skipped, 1 failed. python hash seed: * (glob) [1] $ rt --keyword xyzzy .s Skipped test-skip.t: missing feature: nail clipper # Ran 2 tests, 2 skipped, 0 failed. Skips with xml $ rt --keyword xyzzy \ > --xunit=xunit.xml .s Skipped test-skip.t: missing feature: nail clipper # Ran 2 tests, 2 skipped, 0 failed. $ cat xunit.xml (glob) Missing skips or blacklisted skips don't count as executed: $ echo test-failure.t > blacklist $ rt --blacklist=blacklist --json\ > test-failure.t test-bogus.t ss Skipped test-bogus.t: Doesn't exist Skipped test-failure.t: blacklisted # Ran 0 tests, 2 skipped, 0 failed. $ cat report.json testreport ={ "test-bogus.t": { "result": "skip" }, "test-failure.t": { "result": "skip" } } (no-eol) Whitelist trumps blacklist $ echo test-failure.t > whitelist $ rt --blacklist=blacklist --whitelist=whitelist --json\ > test-failure.t test-bogus.t s --- $TESTTMP/test-failure.t +++ $TESTTMP/test-failure.t.err @@ -1,5 +1,5 @@ $ echo babar - rataxes + babar This is a noop statement so that this test is still more bytes than success. pad pad pad pad............................................................ ERROR: test-failure.t output changed ! Skipped test-bogus.t: Doesn't exist Failed test-failure.t: output changed # Ran 1 tests, 1 skipped, 1 failed. python hash seed: * (glob) [1] Ensure that --test-list causes only the tests listed in that file to be executed. $ echo test-success.t >> onlytest $ rt --test-list=onlytest . # Ran 1 tests, 0 skipped, 0 failed. $ echo test-bogus.t >> anothertest $ rt --test-list=onlytest --test-list=anothertest s. Skipped test-bogus.t: Doesn't exist # Ran 1 tests, 1 skipped, 0 failed. $ rm onlytest anothertest test for --json ================== $ rt --json --- $TESTTMP/test-failure.t +++ $TESTTMP/test-failure.t.err @@ -1,5 +1,5 @@ $ echo babar - rataxes + babar This is a noop statement so that this test is still more bytes than success. pad pad pad pad............................................................ ERROR: test-failure.t output changed !.s Skipped test-skip.t: missing feature: nail clipper Failed test-failure.t: output changed # Ran 2 tests, 1 skipped, 1 failed. python hash seed: * (glob) [1] $ cat report.json testreport ={ "test-failure.t": [\{] (re) "csys": "\s*[\d\.]{4,5}", ? (re) "cuser": "\s*[\d\.]{4,5}", ? (re) "diff": "---.+\+\+\+.+", ? (re) "end": "\s*[\d\.]{4,5}", ? (re) "result": "failure", ? (re) "start": "\s*[\d\.]{4,5}", ? (re) "time": "\s*[\d\.]{4,5}" (re) }, ? (re) "test-skip.t": { "csys": "\s*[\d\.]{4,5}", ? (re) "cuser": "\s*[\d\.]{4,5}", ? (re) "diff": "", ? (re) "end": "\s*[\d\.]{4,5}", ? (re) "result": "skip", ? (re) "start": "\s*[\d\.]{4,5}", ? (re) "time": "\s*[\d\.]{4,5}" (re) }, ? (re) "test-success.t": [\{] (re) "csys": "\s*[\d\.]{4,5}", ? (re) "cuser": "\s*[\d\.]{4,5}", ? (re) "diff": "", ? (re) "end": "\s*[\d\.]{4,5}", ? (re) "result": "success", ? (re) "start": "\s*[\d\.]{4,5}", ? (re) "time": "\s*[\d\.]{4,5}" (re) } } (no-eol) --json with --outputdir $ rm report.json $ rm -r output $ mkdir output $ rt --json --outputdir output --- $TESTTMP/test-failure.t +++ $TESTTMP/output/test-failure.t.err @@ -1,5 +1,5 @@ $ echo babar - rataxes + babar This is a noop statement so that this test is still more bytes than success. pad pad pad pad............................................................ ERROR: test-failure.t output changed !.s Skipped test-skip.t: missing feature: nail clipper Failed test-failure.t: output changed # Ran 2 tests, 1 skipped, 1 failed. python hash seed: * (glob) [1] $ f report.json report.json: file not found $ cat output/report.json testreport ={ "test-failure.t": [\{] (re) "csys": "\s*[\d\.]{4,5}", ? (re) "cuser": "\s*[\d\.]{4,5}", ? (re) "diff": "---.+\+\+\+.+", ? (re) "end": "\s*[\d\.]{4,5}", ? (re) "result": "failure", ? (re) "start": "\s*[\d\.]{4,5}", ? (re) "time": "\s*[\d\.]{4,5}" (re) }, ? (re) "test-skip.t": { "csys": "\s*[\d\.]{4,5}", ? (re) "cuser": "\s*[\d\.]{4,5}", ? (re) "diff": "", ? (re) "end": "\s*[\d\.]{4,5}", ? (re) "result": "skip", ? (re) "start": "\s*[\d\.]{4,5}", ? (re) "time": "\s*[\d\.]{4,5}" (re) }, ? (re) "test-success.t": [\{] (re) "csys": "\s*[\d\.]{4,5}", ? (re) "cuser": "\s*[\d\.]{4,5}", ? (re) "diff": "", ? (re) "end": "\s*[\d\.]{4,5}", ? (re) "result": "success", ? (re) "start": "\s*[\d\.]{4,5}", ? (re) "time": "\s*[\d\.]{4,5}" (re) } } (no-eol) $ ls -a output . .. .testtimes report.json test-failure.t.err Test that failed test accepted through interactive are properly reported: $ cp test-failure.t backup $ echo y | rt --json -i --- $TESTTMP/test-failure.t +++ $TESTTMP/test-failure.t.err @@ -1,5 +1,5 @@ $ echo babar - rataxes + babar This is a noop statement so that this test is still more bytes than success. pad pad pad pad............................................................ Accept this change? [n] ..s Skipped test-skip.t: missing feature: nail clipper # Ran 2 tests, 1 skipped, 0 failed. $ cat report.json testreport ={ "test-failure.t": [\{] (re) "csys": "\s*[\d\.]{4,5}", ? (re) "cuser": "\s*[\d\.]{4,5}", ? (re) "diff": "", ? (re) "end": "\s*[\d\.]{4,5}", ? (re) "result": "success", ? (re) "start": "\s*[\d\.]{4,5}", ? (re) "time": "\s*[\d\.]{4,5}" (re) }, ? (re) "test-skip.t": { "csys": "\s*[\d\.]{4,5}", ? (re) "cuser": "\s*[\d\.]{4,5}", ? (re) "diff": "", ? (re) "end": "\s*[\d\.]{4,5}", ? (re) "result": "skip", ? (re) "start": "\s*[\d\.]{4,5}", ? (re) "time": "\s*[\d\.]{4,5}" (re) }, ? (re) "test-success.t": [\{] (re) "csys": "\s*[\d\.]{4,5}", ? (re) "cuser": "\s*[\d\.]{4,5}", ? (re) "diff": "", ? (re) "end": "\s*[\d\.]{4,5}", ? (re) "result": "success", ? (re) "start": "\s*[\d\.]{4,5}", ? (re) "time": "\s*[\d\.]{4,5}" (re) } } (no-eol) $ mv backup test-failure.t backslash on end of line with glob matching is handled properly $ cat > test-glob-backslash.t << EOF > $ echo 'foo bar \\' > foo * \ (glob) > EOF $ rt test-glob-backslash.t . # Ran 1 tests, 0 skipped, 0 failed. $ rm -f test-glob-backslash.t Test globbing of local IP addresses $ echo 172.16.18.1 $LOCALIP (glob) $ echo dead:beef::1 $LOCALIP (glob) Test reusability for third party tools ====================================== $ mkdir "$TESTTMP"/anothertests $ cd "$TESTTMP"/anothertests test that `run-tests.py` can execute hghave, even if it runs not in Mercurial source tree. $ cat > test-hghave.t < #require true > $ echo foo > foo > EOF $ rt test-hghave.t . # Ran 1 tests, 0 skipped, 0 failed. test that RUNTESTDIR refers the directory, in which `run-tests.py` now running is placed. $ cat > test-runtestdir.t < - $TESTDIR, in which test-run-tests.t is placed > - \$TESTDIR, in which test-runtestdir.t is placed (expanded at runtime) > - \$RUNTESTDIR, in which run-tests.py is placed (expanded at runtime) > > #if windows > $ test "\$TESTDIR" = "$TESTTMP\anothertests" > #else > $ test "\$TESTDIR" = "$TESTTMP"/anothertests > #endif > If this prints a path, that means RUNTESTDIR didn't equal > TESTDIR as it should have. > $ test "\$RUNTESTDIR" = "$TESTDIR" || echo "\$RUNTESTDIR" > This should print the start of check-code. If this passes but the > previous check failed, that means we found a copy of check-code at whatever > RUNTESTSDIR ended up containing, even though it doesn't match TESTDIR. > $ head -n 3 "\$RUNTESTDIR"/../contrib/check-code.py | sed 's@.!.*python@#!USRBINENVPY@' > #!USRBINENVPY > # > # check-code - a style and portability checker for Mercurial > EOF $ rt test-runtestdir.t . # Ran 1 tests, 0 skipped, 0 failed. #if execbit test that TESTDIR is referred in PATH $ cat > custom-command.sh < #!/bin/sh > echo "hello world" > EOF $ chmod +x custom-command.sh $ cat > test-testdir-path.t < $ custom-command.sh > hello world > EOF $ rt test-testdir-path.t . # Ran 1 tests, 0 skipped, 0 failed. #endif test support for --allow-slow-tests $ cat > test-very-slow-test.t < #require slow > $ echo pass > pass > EOF $ rt test-very-slow-test.t s Skipped test-very-slow-test.t: missing feature: allow slow tests (use --allow-slow-tests) # Ran 0 tests, 1 skipped, 0 failed. $ rt $HGTEST_RUN_TESTS_PURE --allow-slow-tests test-very-slow-test.t . # Ran 1 tests, 0 skipped, 0 failed. support for running a test outside the current directory $ mkdir nonlocal $ cat > nonlocal/test-is-not-here.t << EOF > $ echo pass > pass > EOF $ rt nonlocal/test-is-not-here.t . # Ran 1 tests, 0 skipped, 0 failed. support for automatically discovering test if arg is a folder $ mkdir tmp && cd tmp $ cat > test-uno.t << EOF > $ echo line > line > EOF $ cp test-uno.t test-dos.t $ cd .. $ cp -R tmp tmpp $ cp tmp/test-uno.t test-solo.t $ rt tmp/ test-solo.t tmpp ..... # Ran 5 tests, 0 skipped, 0 failed. $ rm -rf tmp tmpp support for running run-tests.py from another directory $ mkdir tmp && cd tmp $ cat > useful-file.sh << EOF > important command > EOF $ cat > test-folder.t << EOF > $ cat \$TESTDIR/useful-file.sh > important command > EOF $ cat > test-folder-fail.t << EOF > $ cat \$TESTDIR/useful-file.sh > important commando > EOF $ cd .. $ rt tmp/test-*.t --- $TESTTMP/anothertests/tmp/test-folder-fail.t +++ $TESTTMP/anothertests/tmp/test-folder-fail.t.err @@ -1,2 +1,2 @@ $ cat $TESTDIR/useful-file.sh - important commando + important command ERROR: test-folder-fail.t output changed !. Failed test-folder-fail.t: output changed # Ran 2 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] support for bisecting failed tests automatically $ hg init bisect $ cd bisect $ cat >> test-bisect.t < $ echo pass > pass > EOF $ hg add test-bisect.t $ hg ci -m 'good' $ cat >> test-bisect.t < $ echo pass > fail > EOF $ hg ci -m 'bad' $ rt --known-good-rev=0 test-bisect.t --- $TESTTMP/anothertests/bisect/test-bisect.t +++ $TESTTMP/anothertests/bisect/test-bisect.t.err @@ -1,4 +1,4 @@ $ echo pass pass $ echo pass - fail + pass ERROR: test-bisect.t output changed ! Failed test-bisect.t: output changed test-bisect.t broken by 72cbf122d116 (bad) # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] $ cd .. support bisecting a separate repo $ hg init bisect-dependent $ cd bisect-dependent $ cat > test-bisect-dependent.t < $ tail -1 \$TESTDIR/../bisect/test-bisect.t > pass > EOF $ hg commit -Am dependent test-bisect-dependent.t $ rt --known-good-rev=0 test-bisect-dependent.t --- $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t +++ $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t.err @@ -1,2 +1,2 @@ $ tail -1 $TESTDIR/../bisect/test-bisect.t - pass + fail ERROR: test-bisect-dependent.t output changed ! Failed test-bisect-dependent.t: output changed Failed to identify failure point for test-bisect-dependent.t # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] $ rt --bisect-repo=../test-bisect test-bisect-dependent.t usage: run-tests.py [options] [tests] run-tests.py: error: --bisect-repo cannot be used without --known-good-rev [2] $ rt --known-good-rev=0 --bisect-repo=../bisect test-bisect-dependent.t --- $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t +++ $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t.err @@ -1,2 +1,2 @@ $ tail -1 $TESTDIR/../bisect/test-bisect.t - pass + fail ERROR: test-bisect-dependent.t output changed ! Failed test-bisect-dependent.t: output changed test-bisect-dependent.t broken by 72cbf122d116 (bad) # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] $ cd .. Test a broken #if statement doesn't break run-tests threading. ============================================================== $ mkdir broken $ cd broken $ cat > test-broken.t < true > #if notarealhghavefeature > $ false > #endif > EOF $ for f in 1 2 3 4 ; do > cat > test-works-$f.t < This is test case $f > $ sleep 1 > EOF > done $ rt -j 2 .... # Ran 5 tests, 0 skipped, 0 failed. skipped: unknown feature: notarealhghavefeature $ cd .. $ rm -rf broken Test cases in .t files ====================== $ mkdir cases $ cd cases $ cat > test-cases-abc.t <<'EOF' > #testcases A B C > $ V=B > #if A > $ V=A > #endif > #if C > $ V=C > #endif > $ echo $V | sed 's/A/C/' > C > #if C > $ [ $V = C ] > #endif > #if A > $ [ $V = C ] > [1] > #endif > #if no-C > $ [ $V = C ] > [1] > #endif > $ [ $V = D ] > [1] > EOF $ rt . --- $TESTTMP/anothertests/cases/test-cases-abc.t +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err @@ -7,7 +7,7 @@ $ V=C #endif $ echo $V | sed 's/A/C/' - C + B #if C $ [ $V = C ] #endif ERROR: test-cases-abc.t (case B) output changed !. Failed test-cases-abc.t (case B): output changed # Ran 3 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] --restart works $ rt --restart --- $TESTTMP/anothertests/cases/test-cases-abc.t +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err @@ -7,7 +7,7 @@ $ V=C #endif $ echo $V | sed 's/A/C/' - C + B #if C $ [ $V = C ] #endif ERROR: test-cases-abc.t (case B) output changed !. Failed test-cases-abc.t (case B): output changed # Ran 2 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] --restart works with outputdir $ mkdir output $ mv test-cases-abc.t.B.err output $ rt --restart --outputdir output --- $TESTTMP/anothertests/cases/test-cases-abc.t +++ $TESTTMP/anothertests/cases/output/test-cases-abc.t.B.err @@ -7,7 +7,7 @@ $ V=C #endif $ echo $V | sed 's/A/C/' - C + B #if C $ [ $V = C ] #endif ERROR: test-cases-abc.t (case B) output changed !. Failed test-cases-abc.t (case B): output changed # Ran 2 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] Test TESTCASE variable $ cat > test-cases-ab.t <<'EOF' > $ dostuff() { > > echo "In case $TESTCASE" > > } > #testcases A B > #if A > $ dostuff > In case A > #endif > #if B > $ dostuff > In case B > #endif > EOF $ rt test-cases-ab.t .. # Ran 2 tests, 0 skipped, 0 failed. Test automatic pattern replacement $ cat << EOF >> common-pattern.py > substitutions = [ > (br'foo-(.*)\\b', > br'\$XXX=\\1\$'), > (br'bar\\n', > br'\$YYY$\\n'), > ] > EOF $ cat << EOF >> test-substitution.t > $ echo foo-12 > \$XXX=12$ > $ echo foo-42 > \$XXX=42$ > $ echo bar prior > bar prior > $ echo lastbar > last\$YYY$ > $ echo foo-bar foo-baz > EOF $ rt test-substitution.t --- $TESTTMP/anothertests/cases/test-substitution.t +++ $TESTTMP/anothertests/cases/test-substitution.t.err @@ -7,3 +7,4 @@ $ echo lastbar last$YYY$ $ echo foo-bar foo-baz + $XXX=bar foo-baz$ ERROR: test-substitution.t output changed ! Failed test-substitution.t: output changed # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] --extra-config-opt works $ cat << EOF >> test-config-opt.t > $ hg init test-config-opt > $ hg -R test-config-opt purge > EOF $ rt --extra-config-opt extensions.purge= test-config-opt.t . # Ran 1 tests, 0 skipped, 0 failed. mercurial-4.5.3/tests/test-repair-strip.t0000644015407300116100000000764413261161234020335 0ustar augieeng00000000000000#require unix-permissions no-root $ cat > $TESTTMP/dumpjournal.py < import sys > for entry in sys.stdin.read().split('\n'): > if entry: > print(entry.split('\x00')[0]) > EOF $ echo "[extensions]" >> $HGRCPATH $ echo "mq=">> $HGRCPATH $ teststrip() { > hg -q up -C $1 > echo % before update $1, strip $2 > hg parents > chmod -$3 $4 > hg strip $2 2>&1 | sed 's/\(bundle\).*/\1/' | sed 's/Permission denied.*\.hg\/store\/\(.*\)/Permission denied \.hg\/store\/\1/' > echo % after update $1, strip $2 > chmod +$3 $4 > hg verify > echo % journal contents > if [ -f .hg/store/journal ]; then > cat .hg/store/journal | $PYTHON $TESTTMP/dumpjournal.py > else > echo "(no journal)" > fi > ls .hg/store/journal >/dev/null 2>&1 && hg recover > ls .hg/strip-backup/* >/dev/null 2>&1 && hg unbundle -q .hg/strip-backup/* > rm -rf .hg/strip-backup > } $ hg init test $ cd test $ echo a > a $ hg -q ci -m "a" -A $ echo b > b $ hg -q ci -m "b" -A $ echo b2 >> b $ hg -q ci -m "b2" -A $ echo c > c $ hg -q ci -m "c" -A $ teststrip 0 2 w .hg/store/data/b.i % before update 0, strip 2 changeset: 0:cb9a9f314b8b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a saved backup bundle transaction abort! failed to truncate data/b.i rollback failed - please run hg recover strip failed, backup bundle abort: Permission denied .hg/store/data/b.i % after update 0, strip 2 abandoned transaction found - run hg recover checking changesets checking manifests crosschecking files in changesets and manifests checking files b@?: rev 1 points to nonexistent changeset 2 (expected 1) b@?: 736c29771fba not in manifests warning: orphan revlog 'data/c.i' 2 files, 2 changesets, 3 total revisions 2 warnings encountered! 2 integrity errors encountered! % journal contents 00changelog.i 00manifest.i data/b.i data/c.i rolling back interrupted transaction checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 2 changesets, 2 total revisions $ teststrip 0 2 r .hg/store/data/b.i % before update 0, strip 2 changeset: 0:cb9a9f314b8b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a abort: Permission denied .hg/store/data/b.i % after update 0, strip 2 checking changesets checking manifests crosschecking files in changesets and manifests checking files 3 files, 4 changesets, 4 total revisions % journal contents (no journal) $ teststrip 0 2 w .hg/store/00manifest.i % before update 0, strip 2 changeset: 0:cb9a9f314b8b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a saved backup bundle transaction abort! failed to truncate 00manifest.i rollback failed - please run hg recover strip failed, backup bundle abort: Permission denied .hg/store/00manifest.i % after update 0, strip 2 abandoned transaction found - run hg recover checking changesets checking manifests manifest@?: rev 2 points to nonexistent changeset 2 manifest@?: 3362547cdf64 not in changesets manifest@?: rev 3 points to nonexistent changeset 3 manifest@?: 265a85892ecb not in changesets crosschecking files in changesets and manifests c@3: in manifest but not in changeset checking files b@?: rev 1 points to nonexistent changeset 2 (expected 1) c@?: rev 0 points to nonexistent changeset 3 3 files, 2 changesets, 4 total revisions 1 warnings encountered! 7 integrity errors encountered! (first damaged changeset appears to be 3) % journal contents 00changelog.i 00manifest.i data/b.i data/c.i rolling back interrupted transaction checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 2 changesets, 2 total revisions $ cd .. mercurial-4.5.3/tests/test-sparse-clear.t0000644015407300116100000000221213261161234020257 0ustar augieeng00000000000000test sparse $ hg init myrepo $ cd myrepo $ cat >> $HGRCPATH < [extensions] > sparse= > purge= > strip= > rebase= > EOF $ echo a > index.html $ echo x > data.py $ echo z > readme.txt $ cat > base.sparse < [include] > *.sparse > EOF $ hg ci -Aqm 'initial' $ cat > webpage.sparse < %include base.sparse > [include] > *.html > EOF $ hg ci -Aqm 'initial' Clear rules when there are includes $ hg debugsparse --include *.py $ ls data.py $ hg debugsparse --clear-rules $ ls base.sparse data.py index.html readme.txt webpage.sparse Clear rules when there are excludes $ hg debugsparse --exclude *.sparse $ ls data.py index.html readme.txt $ hg debugsparse --clear-rules $ ls base.sparse data.py index.html readme.txt webpage.sparse Clearing rules should not alter profiles $ hg debugsparse --enable-profile webpage.sparse $ ls base.sparse index.html webpage.sparse $ hg debugsparse --include *.py $ ls base.sparse data.py index.html webpage.sparse $ hg debugsparse --clear-rules $ ls base.sparse index.html webpage.sparse mercurial-4.5.3/tests/test-show-stack.t0000644015407300116100000001047613261161234017774 0ustar augieeng00000000000000 $ cat >> $HGRCPATH << EOF > [extensions] > show = > EOF $ hg init repo0 $ cd repo0 Empty repo / no checkout results in error $ hg show stack abort: stack view only available when there is a working directory [255] Stack displays single draft changeset as root revision $ echo 0 > foo $ hg -q commit -A -m 'commit 0' $ hg show stack @ 9f17 commit 0 Stack displays multiple draft changesets $ echo 1 > foo $ hg commit -m 'commit 1' $ echo 2 > foo $ hg commit -m 'commit 2' $ echo 3 > foo $ hg commit -m 'commit 3' $ echo 4 > foo $ hg commit -m 'commit 4' $ hg show stack @ 2737 commit 4 o d1a6 commit 3 o 128c commit 2 o 181c commit 1 o 9f17 commit 0 Public parent of draft base is displayed, separated from stack $ hg phase --public -r 0 $ hg show stack @ 2737 commit 4 o d1a6 commit 3 o 128c commit 2 o 181c commit 1 / (stack base) o 9f17 commit 0 $ hg phase --public -r 1 $ hg show stack @ 2737 commit 4 o d1a6 commit 3 o 128c commit 2 / (stack base) o 181c commit 1 Draft descendants are shown $ hg -q up 2 $ hg show stack o 2737 commit 4 o d1a6 commit 3 @ 128c commit 2 / (stack base) o 181c commit 1 $ hg -q up 3 $ hg show stack o 2737 commit 4 @ d1a6 commit 3 o 128c commit 2 / (stack base) o 181c commit 1 working dir on public changeset should display special message $ hg -q up 1 $ hg show stack (empty stack; working directory parent is a published changeset) Branch point in descendants displayed at top of graph $ hg -q up 3 $ echo b > foo $ hg commit -m 'commit 5 (new dag branch)' created new head $ hg -q up 2 $ hg show stack \ / (multiple children) | o d1a6 commit 3 @ 128c commit 2 / (stack base) o 181c commit 1 $ cd .. Base is stopped at merges $ hg init merge-base $ cd merge-base $ echo 0 > foo $ hg -q commit -A -m initial $ echo h1 > foo $ hg commit -m 'head 1' $ hg -q up 0 $ echo h2 > foo $ hg -q commit -m 'head 2' $ hg phase --public -r 0:tip $ hg -q up 1 $ hg merge -t :local 2 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg commit -m 'merge heads' TODO doesn't yet handle case where wdir is a draft merge $ hg show stack @ 8ee9 merge heads / (stack base) o 5947 head 1 $ echo d1 > foo $ hg commit -m 'draft 1' $ echo d2 > foo $ hg commit -m 'draft 2' $ hg show stack @ 430d draft 2 o 787b draft 1 / (stack base) o 8ee9 merge heads $ cd .. Now move on to stacks when there are more commits after the base branchpoint $ hg init public-rebase $ cd public-rebase $ echo 0 > foo $ hg -q commit -A -m 'base' $ hg phase --public -r . $ echo d1 > foo $ hg commit -m 'draft 1' $ echo d2 > foo $ hg commit -m 'draft 2' $ hg -q up 0 $ echo 1 > foo $ hg commit -m 'new 1' created new head $ echo 2 > foo $ hg commit -m 'new 2' $ hg -q up 2 Newer draft heads don't impact output $ hg show stack @ eaff draft 2 o 2b21 draft 1 / (stack base) o b66b base Newer public heads are rendered $ hg phase --public -r '::tip' $ hg show stack o baa4 new 2 / (2 commits ahead) : : (stack head) : @ eaff draft 2 : o 2b21 draft 1 :/ (stack base) o b66b base If rebase is available, we show a hint how to rebase to that head $ hg --config extensions.rebase= show stack o baa4 new 2 / (2 commits ahead; hg rebase --source 2b21 --dest baa4) : : (stack head) : @ eaff draft 2 : o 2b21 draft 1 :/ (stack base) o b66b base Similar tests but for multiple heads $ hg -q up 0 $ echo h2 > foo $ hg -q commit -m 'new head 2' $ hg phase --public -r . $ hg -q up 2 $ hg show stack o baa4 new 2 / (2 commits ahead) : o 9a84 new head 2 :/ (1 commits ahead) : : (stack head) : @ eaff draft 2 : o 2b21 draft 1 :/ (stack base) o b66b base $ hg --config extensions.rebase= show stack o baa4 new 2 / (2 commits ahead; hg rebase --source 2b21 --dest baa4) : o 9a84 new head 2 :/ (1 commits ahead; hg rebase --source 2b21 --dest 9a84) : : (stack head) : @ eaff draft 2 : o 2b21 draft 1 :/ (stack base) o b66b base mercurial-4.5.3/tests/test-merge-local.t0000644015407300116100000000655013261161234020076 0ustar augieeng00000000000000 $ hg init Revision 0: $ echo "unchanged" > unchanged $ echo "remove me" > remove $ echo "copy me" > copy $ echo "move me" > move $ for i in 1 2 3 4 5 6 7 8 9; do > echo "merge ok $i" >> zzz1_merge_ok > done $ echo "merge bad" > zzz2_merge_bad $ hg ci -Am "revision 0" adding copy adding move adding remove adding unchanged adding zzz1_merge_ok adding zzz2_merge_bad Revision 1: $ hg rm remove $ hg mv move moved $ hg cp copy copied $ echo "added" > added $ hg add added $ echo "new first line" > zzz1_merge_ok $ hg cat zzz1_merge_ok >> zzz1_merge_ok $ echo "new last line" >> zzz2_merge_bad $ hg ci -m "revision 1" Local changes to revision 0: $ hg co 0 4 files updated, 0 files merged, 3 files removed, 0 files unresolved $ echo "new last line" >> zzz1_merge_ok $ echo "another last line" >> zzz2_merge_bad $ hg diff --nodates | grep "^[+-][^<>]" --- a/zzz1_merge_ok +++ b/zzz1_merge_ok +new last line --- a/zzz2_merge_bad +++ b/zzz2_merge_bad +another last line $ hg st M zzz1_merge_ok M zzz2_merge_bad Local merge with bad merge tool: $ HGMERGE=false hg co merging zzz1_merge_ok merging zzz2_merge_bad merging zzz2_merge_bad failed! 3 files updated, 1 files merged, 2 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges [1] $ hg resolve -m (no more unresolved files) $ hg co 0 merging zzz1_merge_ok merging zzz2_merge_bad warning: conflicts while merging zzz2_merge_bad! (edit, then use 'hg resolve --mark') 2 files updated, 1 files merged, 3 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges [1] $ hg diff --nodates | grep "^[+-][^<>]" --- a/zzz1_merge_ok +++ b/zzz1_merge_ok +new last line --- a/zzz2_merge_bad +++ b/zzz2_merge_bad +another last line +======= $ hg st M zzz1_merge_ok M zzz2_merge_bad ? zzz2_merge_bad.orig Local merge with conflicts: $ hg resolve -m (no more unresolved files) $ hg co merging zzz1_merge_ok merging zzz2_merge_bad warning: conflicts while merging zzz2_merge_bad! (edit, then use 'hg resolve --mark') 3 files updated, 1 files merged, 2 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges [1] $ hg resolve -m (no more unresolved files) $ hg co 0 --config 'ui.origbackuppath=.hg/origbackups' merging zzz1_merge_ok merging zzz2_merge_bad warning: conflicts while merging zzz2_merge_bad! (edit, then use 'hg resolve --mark') 2 files updated, 1 files merged, 3 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges [1] Are orig files from the last commit where we want them? $ ls .hg/origbackups zzz2_merge_bad $ hg diff --nodates | grep "^[+-][^<>]" --- a/zzz1_merge_ok +++ b/zzz1_merge_ok +new last line --- a/zzz2_merge_bad +++ b/zzz2_merge_bad +another last line +======= +======= +new last line +======= $ hg st M zzz1_merge_ok M zzz2_merge_bad ? zzz2_merge_bad.orig Local merge without conflicts: $ hg revert zzz2_merge_bad $ hg resolve -m (no more unresolved files) $ hg co merging zzz1_merge_ok 4 files updated, 1 files merged, 2 files removed, 0 files unresolved $ hg diff --nodates | grep "^[+-][^<>]" --- a/zzz1_merge_ok +++ b/zzz1_merge_ok +new last line $ hg st M zzz1_merge_ok ? zzz2_merge_bad.orig mercurial-4.5.3/tests/test-diff-issue2761.t0000644015407300116100000000067213261161234020264 0ustar augieeng00000000000000Test issue2761 $ hg init $ touch to-be-deleted $ hg add adding to-be-deleted $ hg ci -m first $ echo a > to-be-deleted $ hg ci -m second $ rm to-be-deleted $ hg diff -r 0 Same issue, different code path $ hg up -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ touch does-not-exist-in-1 $ hg add adding does-not-exist-in-1 $ hg ci -m third $ rm does-not-exist-in-1 $ hg diff -r 1 mercurial-4.5.3/tests/test-globalopts.t0000644015407300116100000003414413261161234020055 0ustar augieeng00000000000000 $ hg init a $ cd a $ echo a > a $ hg ci -A -d'1 0' -m a adding a $ cd .. $ hg init b $ cd b $ echo b > b $ hg ci -A -d'1 0' -m b adding b $ cd .. $ hg clone a c updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd c $ cat >> .hg/hgrc < [paths] > relative = ../a > EOF $ hg pull -f ../b pulling from ../b searching for changes warning: repository is unrelated requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets b6c483daf290 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cd .. Testing -R/--repository: $ hg -R a tip changeset: 0:8580ff50825a tag: tip user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: a $ hg --repository b tip changeset: 0:b6c483daf290 tag: tip user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: b -R with a URL: $ hg -R file:a identify 8580ff50825a tip $ hg -R file://localhost/`pwd`/a/ identify 8580ff50825a tip -R with path aliases: $ cd c $ hg -R default identify 8580ff50825a tip $ hg -R relative identify 8580ff50825a tip $ echo '[paths]' >> $HGRCPATH $ echo 'relativetohome = a' >> $HGRCPATH $ HOME=`pwd`/../ hg -R relativetohome identify 8580ff50825a tip $ cd .. #if no-outer-repo Implicit -R: $ hg ann a/a 0: a $ hg ann a/a a/a 0: a $ hg ann a/a b/b abort: no repository found in '$TESTTMP' (.hg not found)! [255] $ hg -R b ann a/a abort: a/a not under root '$TESTTMP/b' (consider using '--cwd b') [255] $ hg log abort: no repository found in '$TESTTMP' (.hg not found)! [255] #endif Abbreviation of long option: $ hg --repo c tip changeset: 1:b6c483daf290 tag: tip parent: -1:000000000000 user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: b earlygetopt with duplicate options (36d23de02da1): $ hg --cwd a --cwd b --cwd c tip changeset: 1:b6c483daf290 tag: tip parent: -1:000000000000 user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: b $ hg --repo c --repository b -R a tip changeset: 0:8580ff50825a tag: tip user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: a earlygetopt short option without following space: $ hg -q -Rb tip 0:b6c483daf290 earlygetopt with illegal abbreviations: $ hg --confi "foo.bar=baz" abort: option --config may not be abbreviated! [255] $ hg --cw a tip abort: option --cwd may not be abbreviated! [255] $ hg --rep a tip abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo! [255] $ hg --repositor a tip abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo! [255] $ hg -qR a tip abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo! [255] $ hg -qRa tip abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo! [255] Testing --cwd: $ hg --cwd a parents changeset: 0:8580ff50825a tag: tip user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: a Testing -y/--noninteractive - just be sure it is parsed: $ hg --cwd a tip -q --noninteractive 0:8580ff50825a $ hg --cwd a tip -q -y 0:8580ff50825a Testing -q/--quiet: $ hg -R a -q tip 0:8580ff50825a $ hg -R b -q tip 0:b6c483daf290 $ hg -R c --quiet parents 0:8580ff50825a 1:b6c483daf290 Testing -v/--verbose: $ hg --cwd c head -v changeset: 1:b6c483daf290 tag: tip parent: -1:000000000000 user: test date: Thu Jan 01 00:00:01 1970 +0000 files: b description: b changeset: 0:8580ff50825a user: test date: Thu Jan 01 00:00:01 1970 +0000 files: a description: a $ hg --cwd b tip --verbose changeset: 0:b6c483daf290 tag: tip user: test date: Thu Jan 01 00:00:01 1970 +0000 files: b description: b Testing --config: $ hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo quuxfoo $ hg --cwd c --config '' tip -q abort: malformed --config option: '' (use --config section.name=value) [255] $ hg --cwd c --config a.b tip -q abort: malformed --config option: 'a.b' (use --config section.name=value) [255] $ hg --cwd c --config a tip -q abort: malformed --config option: 'a' (use --config section.name=value) [255] $ hg --cwd c --config a.= tip -q abort: malformed --config option: 'a.=' (use --config section.name=value) [255] $ hg --cwd c --config .b= tip -q abort: malformed --config option: '.b=' (use --config section.name=value) [255] Testing --debug: $ hg --cwd c log --debug changeset: 1:b6c483daf2907ce5825c0bb50f5716226281cc1a tag: tip phase: public parent: -1:0000000000000000000000000000000000000000 parent: -1:0000000000000000000000000000000000000000 manifest: 1:23226e7a252cacdc2d99e4fbdc3653441056de49 user: test date: Thu Jan 01 00:00:01 1970 +0000 files+: b extra: branch=default description: b changeset: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab phase: public parent: -1:0000000000000000000000000000000000000000 parent: -1:0000000000000000000000000000000000000000 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 user: test date: Thu Jan 01 00:00:01 1970 +0000 files+: a extra: branch=default description: a Testing --traceback: #if no-chg $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback' Traceback (most recent call last): #else Traceback for '--config' errors not supported with chg. $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback' [1] #endif Testing --time: $ hg --cwd a --time id 8580ff50825a tip time: real * (glob) Testing --version: $ hg --version -q Mercurial Distributed SCM * (glob) hide outer repo $ hg init Testing -h/--help: $ hg -h Mercurial Distributed SCM list of commands: add add the specified files on the next commit addremove add all new files, delete all missing files annotate show changeset information by line for each file archive create an unversioned archive of a repository revision backout reverse effect of earlier changeset bisect subdivision search of changesets bookmarks create a new bookmark or list existing bookmarks branch set or show the current branch name branches list repository named branches bundle create a bundle file cat output the current or given revision of files clone make a copy of an existing repository commit commit the specified files or all outstanding changes config show combined config settings from all hgrc files copy mark files as copied for the next commit diff diff repository (or selected files) export dump the header and diffs for one or more changesets files list tracked files forget forget the specified files on the next commit graft copy changes from other branches onto the current branch grep search revision history for a pattern in specified files heads show branch heads help show help for a given topic or a help overview identify identify the working directory or specified revision import import an ordered set of patches incoming show new changesets found in source init create a new repository in the given directory log show revision history of entire repository or files manifest output the current or given revision of the project manifest merge merge another revision into working directory outgoing show changesets not found in the destination paths show aliases for remote repositories phase set or show the current phase name pull pull changes from the specified source push push changes to the specified destination recover roll back an interrupted transaction remove remove the specified files on the next commit rename rename files; equivalent of copy + remove resolve redo merges or set/view the merge status of files revert restore files to their checkout state root print the root (top) of the current working directory serve start stand-alone webserver status show changed files in the working directory summary summarize working directory state tag add one or more tags for the current or given revision tags list repository tags unbundle apply one or more bundle files update update working directory (or switch revisions) verify verify the integrity of the repository version output version and copyright information additional help topics: bundlespec Bundle File Formats color Colorizing Outputs config Configuration Files dates Date Formats diffs Diff Formats environment Environment Variables extensions Using Additional Features filesets Specifying File Sets flags Command-line flags glossary Glossary hgignore Syntax for Mercurial Ignore Files hgweb Configuring hgweb internals Technical implementation topics merge-tools Merge Tools pager Pager Support patterns File Name Patterns phases Working with Phases revisions Specifying Revisions scripting Using Mercurial from scripts and automation subrepos Subrepositories templating Template Usage urls URL Paths (use 'hg help -v' to show built-in aliases and global options) $ hg --help Mercurial Distributed SCM list of commands: add add the specified files on the next commit addremove add all new files, delete all missing files annotate show changeset information by line for each file archive create an unversioned archive of a repository revision backout reverse effect of earlier changeset bisect subdivision search of changesets bookmarks create a new bookmark or list existing bookmarks branch set or show the current branch name branches list repository named branches bundle create a bundle file cat output the current or given revision of files clone make a copy of an existing repository commit commit the specified files or all outstanding changes config show combined config settings from all hgrc files copy mark files as copied for the next commit diff diff repository (or selected files) export dump the header and diffs for one or more changesets files list tracked files forget forget the specified files on the next commit graft copy changes from other branches onto the current branch grep search revision history for a pattern in specified files heads show branch heads help show help for a given topic or a help overview identify identify the working directory or specified revision import import an ordered set of patches incoming show new changesets found in source init create a new repository in the given directory log show revision history of entire repository or files manifest output the current or given revision of the project manifest merge merge another revision into working directory outgoing show changesets not found in the destination paths show aliases for remote repositories phase set or show the current phase name pull pull changes from the specified source push push changes to the specified destination recover roll back an interrupted transaction remove remove the specified files on the next commit rename rename files; equivalent of copy + remove resolve redo merges or set/view the merge status of files revert restore files to their checkout state root print the root (top) of the current working directory serve start stand-alone webserver status show changed files in the working directory summary summarize working directory state tag add one or more tags for the current or given revision tags list repository tags unbundle apply one or more bundle files update update working directory (or switch revisions) verify verify the integrity of the repository version output version and copyright information additional help topics: bundlespec Bundle File Formats color Colorizing Outputs config Configuration Files dates Date Formats diffs Diff Formats environment Environment Variables extensions Using Additional Features filesets Specifying File Sets flags Command-line flags glossary Glossary hgignore Syntax for Mercurial Ignore Files hgweb Configuring hgweb internals Technical implementation topics merge-tools Merge Tools pager Pager Support patterns File Name Patterns phases Working with Phases revisions Specifying Revisions scripting Using Mercurial from scripts and automation subrepos Subrepositories templating Template Usage urls URL Paths (use 'hg help -v' to show built-in aliases and global options) Not tested: --debugger mercurial-4.5.3/tests/test-status.t0000644015407300116100000002540313261161234017230 0ustar augieeng00000000000000 $ hg init repo1 $ cd repo1 $ mkdir a b a/1 b/1 b/2 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2 hg status in repo root: $ hg status ? a/1/in_a_1 ? a/in_a ? b/1/in_b_1 ? b/2/in_b_2 ? b/in_b ? in_root hg status . in repo root: $ hg status . ? a/1/in_a_1 ? a/in_a ? b/1/in_b_1 ? b/2/in_b_2 ? b/in_b ? in_root $ hg status --cwd a ? a/1/in_a_1 ? a/in_a ? b/1/in_b_1 ? b/2/in_b_2 ? b/in_b ? in_root $ hg status --cwd a . ? 1/in_a_1 ? in_a $ hg status --cwd a .. ? 1/in_a_1 ? in_a ? ../b/1/in_b_1 ? ../b/2/in_b_2 ? ../b/in_b ? ../in_root $ hg status --cwd b ? a/1/in_a_1 ? a/in_a ? b/1/in_b_1 ? b/2/in_b_2 ? b/in_b ? in_root $ hg status --cwd b . ? 1/in_b_1 ? 2/in_b_2 ? in_b $ hg status --cwd b .. ? ../a/1/in_a_1 ? ../a/in_a ? 1/in_b_1 ? 2/in_b_2 ? in_b ? ../in_root $ hg status --cwd a/1 ? a/1/in_a_1 ? a/in_a ? b/1/in_b_1 ? b/2/in_b_2 ? b/in_b ? in_root $ hg status --cwd a/1 . ? in_a_1 $ hg status --cwd a/1 .. ? in_a_1 ? ../in_a $ hg status --cwd b/1 ? a/1/in_a_1 ? a/in_a ? b/1/in_b_1 ? b/2/in_b_2 ? b/in_b ? in_root $ hg status --cwd b/1 . ? in_b_1 $ hg status --cwd b/1 .. ? in_b_1 ? ../2/in_b_2 ? ../in_b $ hg status --cwd b/2 ? a/1/in_a_1 ? a/in_a ? b/1/in_b_1 ? b/2/in_b_2 ? b/in_b ? in_root $ hg status --cwd b/2 . ? in_b_2 $ hg status --cwd b/2 .. ? ../1/in_b_1 ? in_b_2 ? ../in_b combining patterns with root and patterns without a root works $ hg st a/in_a re:.*b$ ? a/in_a ? b/in_b tweaking defaults works $ hg status --cwd a --config ui.tweakdefaults=yes ? 1/in_a_1 ? in_a ? ../b/1/in_b_1 ? ../b/2/in_b_2 ? ../b/in_b ? ../in_root $ HGPLAIN=1 hg status --cwd a --config ui.tweakdefaults=yes ? a/1/in_a_1 (glob) ? a/in_a (glob) ? b/1/in_b_1 (glob) ? b/2/in_b_2 (glob) ? b/in_b (glob) ? in_root $ HGPLAINEXCEPT=tweakdefaults hg status --cwd a --config ui.tweakdefaults=yes ? 1/in_a_1 (glob) ? in_a ? ../b/1/in_b_1 (glob) ? ../b/2/in_b_2 (glob) ? ../b/in_b (glob) ? ../in_root (glob) relative paths can be requested $ cat >> $HGRCPATH < [commands] > status.relative = True > EOF $ hg status --cwd a ? 1/in_a_1 ? in_a ? ../b/1/in_b_1 ? ../b/2/in_b_2 ? ../b/in_b ? ../in_root $ HGPLAIN=1 hg status --cwd a ? a/1/in_a_1 (glob) ? a/in_a (glob) ? b/1/in_b_1 (glob) ? b/2/in_b_2 (glob) ? b/in_b (glob) ? in_root if relative paths are explicitly off, tweakdefaults doesn't change it $ cat >> $HGRCPATH < [commands] > status.relative = False > EOF $ hg status --cwd a --config ui.tweakdefaults=yes ? a/1/in_a_1 ? a/in_a ? b/1/in_b_1 ? b/2/in_b_2 ? b/in_b ? in_root $ cd .. $ hg init repo2 $ cd repo2 $ touch modified removed deleted ignored $ echo "^ignored$" > .hgignore $ hg ci -A -m 'initial checkin' adding .hgignore adding deleted adding modified adding removed $ touch modified added unknown ignored $ hg add added $ hg remove removed $ rm deleted hg status: $ hg status A added R removed ! deleted ? unknown hg status modified added removed deleted unknown never-existed ignored: $ hg status modified added removed deleted unknown never-existed ignored never-existed: * (glob) A added R removed ! deleted ? unknown $ hg copy modified copied hg status -C: $ hg status -C A added A copied modified R removed ! deleted ? unknown hg status -A: $ hg status -A A added A copied modified R removed ! deleted ? unknown I ignored C .hgignore C modified $ hg status -A -Tjson [ { "path": "added", "status": "A" }, { "copy": "modified", "path": "copied", "status": "A" }, { "path": "removed", "status": "R" }, { "path": "deleted", "status": "!" }, { "path": "unknown", "status": "?" }, { "path": "ignored", "status": "I" }, { "path": ".hgignore", "status": "C" }, { "path": "modified", "status": "C" } ] $ hg status -A -Tpickle > pickle >>> from __future__ import print_function >>> import pickle >>> print(sorted((x['status'], x['path']) for x in pickle.load(open("pickle")))) [('!', 'deleted'), ('?', 'pickle'), ('?', 'unknown'), ('A', 'added'), ('A', 'copied'), ('C', '.hgignore'), ('C', 'modified'), ('I', 'ignored'), ('R', 'removed')] $ rm pickle $ echo "^ignoreddir$" > .hgignore $ mkdir ignoreddir $ touch ignoreddir/file Test templater support: $ hg status -AT "[{status}]\t{if(copy, '{copy} -> ')}{path}\n" [M] .hgignore [A] added [A] modified -> copied [R] removed [!] deleted [?] ignored [?] unknown [I] ignoreddir/file [C] modified $ hg status -AT default M .hgignore A added A copied modified R removed ! deleted ? ignored ? unknown I ignoreddir/file C modified $ hg status -T compact abort: "status" not in template map [255] hg status ignoreddir/file: $ hg status ignoreddir/file hg status -i ignoreddir/file: $ hg status -i ignoreddir/file I ignoreddir/file $ cd .. Check 'status -q' and some combinations $ hg init repo3 $ cd repo3 $ touch modified removed deleted ignored $ echo "^ignored$" > .hgignore $ hg commit -A -m 'initial checkin' adding .hgignore adding deleted adding modified adding removed $ touch added unknown ignored $ hg add added $ echo "test" >> modified $ hg remove removed $ rm deleted $ hg copy modified copied Specify working directory revision explicitly, that should be the same as "hg status" $ hg status --change "wdir()" M modified A added A copied R removed ! deleted ? unknown Run status with 2 different flags. Check if result is the same or different. If result is not as expected, raise error $ assert() { > hg status $1 > ../a > hg status $2 > ../b > if diff ../a ../b > /dev/null; then > out=0 > else > out=1 > fi > if [ $3 -eq 0 ]; then > df="same" > else > df="different" > fi > if [ $out -ne $3 ]; then > echo "Error on $1 and $2, should be $df." > fi > } Assert flag1 flag2 [0-same | 1-different] $ assert "-q" "-mard" 0 $ assert "-A" "-marduicC" 0 $ assert "-qA" "-mardcC" 0 $ assert "-qAui" "-A" 0 $ assert "-qAu" "-marducC" 0 $ assert "-qAi" "-mardicC" 0 $ assert "-qu" "-u" 0 $ assert "-q" "-u" 1 $ assert "-m" "-a" 1 $ assert "-r" "-d" 1 $ cd .. $ hg init repo4 $ cd repo4 $ touch modified removed deleted $ hg ci -q -A -m 'initial checkin' $ touch added unknown $ hg add added $ hg remove removed $ rm deleted $ echo x > modified $ hg copy modified copied $ hg ci -m 'test checkin' -d "1000001 0" $ rm * $ touch unrelated $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0" hg status --change 1: $ hg status --change 1 M modified A added A copied R removed hg status --change 1 unrelated: $ hg status --change 1 unrelated hg status -C --change 1 added modified copied removed deleted: $ hg status -C --change 1 added modified copied removed deleted M modified A added A copied modified R removed hg status -A --change 1 and revset: $ hg status -A --change '1|1' M modified A added A copied modified R removed C deleted $ cd .. hg status with --rev and reverted changes: $ hg init reverted-changes-repo $ cd reverted-changes-repo $ echo a > file $ hg add file $ hg ci -m a $ echo b > file $ hg ci -m b reverted file should appear clean $ hg revert -r 0 . reverting file $ hg status -A --rev 0 C file #if execbit reverted file with changed flag should appear modified $ chmod +x file $ hg status -A --rev 0 M file $ hg revert -r 0 . reverting file reverted and committed file with changed flag should appear modified $ hg co -C . 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ chmod +x file $ hg ci -m 'change flag' $ hg status -A --rev 1 --rev 2 M file $ hg diff -r 1 -r 2 #endif $ cd .. hg status of binary file starting with '\1\n', a separator for metadata: $ hg init repo5 $ cd repo5 >>> open("010a", "wb").write("\1\nfoo") $ hg ci -q -A -m 'initial checkin' $ hg status -A C 010a >>> open("010a", "wb").write("\1\nbar") $ hg status -A M 010a $ hg ci -q -m 'modify 010a' $ hg status -A --rev 0:1 M 010a $ touch empty $ hg ci -q -A -m 'add another file' $ hg status -A --rev 1:2 010a C 010a $ cd .. test "hg status" with "directory pattern" which matches against files only known on target revision. $ hg init repo6 $ cd repo6 $ echo a > a.txt $ hg add a.txt $ hg commit -m '#0' $ mkdir -p 1/2/3/4/5 $ echo b > 1/2/3/4/5/b.txt $ hg add 1/2/3/4/5/b.txt $ hg commit -m '#1' $ hg update -C 0 > /dev/null $ hg status -A C a.txt the directory matching against specified pattern should be removed, because directory existence prevents 'dirstate.walk()' from showing warning message about such pattern. $ test ! -d 1 $ hg status -A --rev 1 1/2/3/4/5/b.txt R 1/2/3/4/5/b.txt $ hg status -A --rev 1 1/2/3/4/5 R 1/2/3/4/5/b.txt $ hg status -A --rev 1 1/2/3 R 1/2/3/4/5/b.txt $ hg status -A --rev 1 1 R 1/2/3/4/5/b.txt $ hg status --config ui.formatdebug=True --rev 1 1 status = [ {*'path': '1/2/3/4/5/b.txt'*}, (glob) ] #if windows $ hg --config ui.slash=false status -A --rev 1 1 R 1\2\3\4\5\b.txt #endif $ cd .. Status after move overwriting a file (issue4458) ================================================= $ hg init issue4458 $ cd issue4458 $ echo a > a $ echo b > b $ hg commit -Am base adding a adding b with --force $ hg mv b --force a $ hg st --copies M a b R b $ hg revert --all reverting a undeleting b $ rm *.orig without force $ hg rm a $ hg st --copies R a $ hg mv b a $ hg st --copies M a b R b using ui.statuscopies setting $ hg st --config ui.statuscopies=true M a b R b $ hg st --config ui.statuscopies=false M a R b $ hg st --config ui.tweakdefaults=yes M a b R b using log status template (issue5155) $ hg log -Tstatus -r 'wdir()' -C changeset: 2147483647:ffffffffffff parent: 0:8c55c58b4c0e user: test date: * (glob) files: M a b R b Other "bug" highlight, the revision status does not report the copy information. This is buggy behavior. $ hg commit -m 'blah' $ hg st --copies --change . M a R b using log status template, the copy information is displayed correctly. $ hg log -Tstatus -r. -C changeset: 1:6685fde43d21 tag: tip user: test date: * (glob) summary: blah files: M a b R b $ cd .. mercurial-4.5.3/tests/test-histedit-fold.t0000644015407300116100000003013613261161234020443 0ustar augieeng00000000000000Test histedit extension: Fold commands ====================================== This test file is dedicated to testing the fold command in non conflicting case. Initialization --------------- $ . "$TESTDIR/histedit-helpers.sh" $ cat >> $HGRCPATH < [alias] > logt = log --template '{rev}:{node|short} {desc|firstline}\n' > [extensions] > histedit= > EOF Simple folding -------------------- $ addwithdate () > { > echo $1 > $1 > hg add $1 > hg ci -m $1 -d "$2 0" > } $ initrepo () > { > hg init r > cd r > addwithdate a 1 > addwithdate b 2 > addwithdate c 3 > addwithdate d 4 > addwithdate e 5 > addwithdate f 6 > } $ initrepo log before edit $ hg logt --graph @ 5:178e35e0ce73 f | o 4:1ddb6c90f2ee e | o 3:532247a8969b d | o 2:ff2c9fa2018b c | o 1:97d72e5f12c7 b | o 0:8580ff50825a a $ hg histedit ff2c9fa2018b --commands - 2>&1 < pick 1ddb6c90f2ee e > pick 178e35e0ce73 f > fold ff2c9fa2018b c > pick 532247a8969b d > EOF log after edit $ hg logt --graph @ 4:c4d7f3def76d d | o 3:575228819b7e f | o 2:505a591af19e e | o 1:97d72e5f12c7 b | o 0:8580ff50825a a post-fold manifest $ hg manifest a b c d e f check histedit_source, including that it uses the later date, from the first changeset $ hg log --debug --rev 3 changeset: 3:575228819b7e6ed69e8c0a6a383ee59a80db7358 phase: draft parent: 2:505a591af19eed18f560af827b9e03d2076773dc parent: -1:0000000000000000000000000000000000000000 manifest: 3:81eede616954057198ead0b2c73b41d1f392829a user: test date: Thu Jan 01 00:00:06 1970 +0000 files+: c f extra: branch=default extra: histedit_source=7cad1d7030207872dfd1c3a7cb430f24f2884086,ff2c9fa2018b15fa74b33363bda9527323e2a99f description: f *** c rollup will fold without preserving the folded commit's message or date $ OLDHGEDITOR=$HGEDITOR $ HGEDITOR=false $ hg histedit 97d72e5f12c7 --commands - 2>&1 < pick 97d72e5f12c7 b > roll 505a591af19e e > pick 575228819b7e f > pick c4d7f3def76d d > EOF $ HGEDITOR=$OLDHGEDITOR log after edit $ hg logt --graph @ 3:bab801520cec d | o 2:58c8f2bfc151 f | o 1:5d939c56c72e b | o 0:8580ff50825a a description is taken from rollup target commit $ hg log --debug --rev 1 changeset: 1:5d939c56c72e77e29f5167696218e2131a40f5cf phase: draft parent: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab parent: -1:0000000000000000000000000000000000000000 manifest: 1:b5e112a3a8354e269b1524729f0918662d847c38 user: test date: Thu Jan 01 00:00:02 1970 +0000 files+: b e extra: branch=default extra: histedit_source=97d72e5f12c7e84f85064aa72e5a297142c36ed9,505a591af19eed18f560af827b9e03d2076773dc description: b check saving last-message.txt $ cat > $TESTTMP/abortfolding.py < from mercurial import util > def abortfolding(ui, repo, hooktype, **kwargs): > ctx = repo[kwargs.get('node')] > if set(ctx.files()) == {'c', 'd', 'f'}: > return True # abort folding commit only > ui.warn('allow non-folding commit\\n') > EOF $ cat > .hg/hgrc < [hooks] > pretxncommit.abortfolding = python:$TESTTMP/abortfolding.py:abortfolding > EOF $ cat > $TESTTMP/editor.sh << EOF > echo "==== before editing" > cat \$1 > echo "====" > echo "check saving last-message.txt" >> \$1 > EOF $ rm -f .hg/last-message.txt $ hg status --rev '58c8f2bfc151^1::bab801520cec' A c A d A f $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit 58c8f2bfc151 --commands - 2>&1 < pick 58c8f2bfc151 f > fold bab801520cec d > EOF allow non-folding commit ==== before editing f *** c *** d HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: test HG: branch 'default' HG: added c HG: added d HG: added f ==== transaction abort! rollback completed abort: pretxncommit.abortfolding hook failed [255] $ cat .hg/last-message.txt f *** c *** d check saving last-message.txt $ cd .. $ rm -r r folding preserves initial author but uses later date ---------------------------------------------------- $ initrepo $ hg ci -d '7 0' --user "someone else" --amend --quiet tip before edit $ hg log --rev . changeset: 5:10c36dd37515 tag: tip user: someone else date: Thu Jan 01 00:00:07 1970 +0000 summary: f $ hg --config progress.debug=1 --debug \ > histedit 1ddb6c90f2ee --commands - 2>&1 < egrep 'editing|unresolved' > pick 1ddb6c90f2ee e > fold 10c36dd37515 f > EOF editing: pick 1ddb6c90f2ee 4 e 1/2 changes (50.00%) editing: fold 10c36dd37515 5 f 2/2 changes (100.00%) tip after edit, which should use the later date, from the second changeset $ hg log --rev . changeset: 4:e4f3ec5d0b40 tag: tip user: test date: Thu Jan 01 00:00:07 1970 +0000 summary: e $ cd .. $ rm -r r folding and creating no new change doesn't break: ------------------------------------------------- folded content is dropped during a merge. The folded commit should properly disappear. $ mkdir fold-to-empty-test $ cd fold-to-empty-test $ hg init $ printf "1\n2\n3\n" > file $ hg add file $ hg commit -m '1+2+3' $ echo 4 >> file $ hg commit -m '+4' $ echo 5 >> file $ hg commit -m '+5' $ echo 6 >> file $ hg commit -m '+6' $ hg logt --graph @ 3:251d831eeec5 +6 | o 2:888f9082bf99 +5 | o 1:617f94f13c0f +4 | o 0:0189ba417d34 1+2+3 $ hg histedit 1 --commands - << EOF > pick 617f94f13c0f 1 +4 > drop 888f9082bf99 2 +5 > fold 251d831eeec5 3 +6 > EOF 1 files updated, 0 files merged, 0 files removed, 0 files unresolved merging file warning: conflicts while merging file! (edit, then use 'hg resolve --mark') Fix up the change (fold 251d831eeec5) (hg histedit --continue to resume) [1] There were conflicts, we keep P1 content. This should effectively drop the changes from +6. $ hg status -v M file ? file.orig # The repository is in an unfinished *histedit* state. # Unresolved merge conflicts: # # file # # To mark files as resolved: hg resolve --mark FILE # To continue: hg histedit --continue # To abort: hg histedit --abort $ hg resolve -l U file $ hg revert -r 'p1()' file $ hg resolve --mark file (no more unresolved files) continue: hg histedit --continue $ hg histedit --continue 251d831eeec5: empty changeset saved backup bundle to $TESTTMP/fold-to-empty-test/.hg/strip-backup/888f9082bf99-daa0b8b3-histedit.hg $ hg logt --graph @ 1:617f94f13c0f +4 | o 0:0189ba417d34 1+2+3 $ cd .. Test fold through dropped ------------------------- Test corner case where folded revision is separated from its parent by a dropped revision. $ hg init fold-with-dropped $ cd fold-with-dropped $ printf "1\n2\n3\n" > file $ hg commit -Am '1+2+3' adding file $ echo 4 >> file $ hg commit -m '+4' $ echo 5 >> file $ hg commit -m '+5' $ echo 6 >> file $ hg commit -m '+6' $ hg logt -G @ 3:251d831eeec5 +6 | o 2:888f9082bf99 +5 | o 1:617f94f13c0f +4 | o 0:0189ba417d34 1+2+3 $ hg histedit 1 --commands - << EOF > pick 617f94f13c0f 1 +4 > drop 888f9082bf99 2 +5 > fold 251d831eeec5 3 +6 > EOF 1 files updated, 0 files merged, 0 files removed, 0 files unresolved merging file warning: conflicts while merging file! (edit, then use 'hg resolve --mark') Fix up the change (fold 251d831eeec5) (hg histedit --continue to resume) [1] $ cat > file << EOF > 1 > 2 > 3 > 4 > 5 > EOF $ hg resolve --mark file (no more unresolved files) continue: hg histedit --continue $ hg commit -m '+5.2' created new head $ echo 6 >> file $ HGEDITOR=cat hg histedit --continue +4 *** +5.2 *** +6 HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: test HG: branch 'default' HG: changed file saved backup bundle to $TESTTMP/fold-with-dropped/.hg/strip-backup/617f94f13c0f-3d69522c-histedit.hg $ hg logt -G @ 1:10c647b2cdd5 +4 | o 0:0189ba417d34 1+2+3 $ hg export tip # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 10c647b2cdd54db0603ecb99b2ff5ce66d5a5323 # Parent 0189ba417d34df9dda55f88b637dcae9917b5964 +4 *** +5.2 *** +6 diff -r 0189ba417d34 -r 10c647b2cdd5 file --- a/file Thu Jan 01 00:00:00 1970 +0000 +++ b/file Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +1,6 @@ 1 2 3 +4 +5 +6 $ cd .. Folding with initial rename (issue3729) --------------------------------------- $ hg init fold-rename $ cd fold-rename $ echo a > a.txt $ hg add a.txt $ hg commit -m a $ hg rename a.txt b.txt $ hg commit -m rename $ echo b >> b.txt $ hg commit -m b $ hg logt --follow b.txt 2:e0371e0426bc b 1:1c4f440a8085 rename 0:6c795aa153cb a $ hg histedit 1c4f440a8085 --commands - 2>&1 << EOF | fixbundle > pick 1c4f440a8085 rename > fold e0371e0426bc b > EOF $ hg logt --follow b.txt 1:cf858d235c76 rename 0:6c795aa153cb a $ cd .. Folding with swapping --------------------- This is an excuse to test hook with histedit temporary commit (issue4422) $ hg init issue4422 $ cd issue4422 $ echo a > a.txt $ hg add a.txt $ hg commit -m a $ echo b > b.txt $ hg add b.txt $ hg commit -m b $ echo c > c.txt $ hg add c.txt $ hg commit -m c $ hg logt 2:a1a953ffb4b0 c 1:199b6bb90248 b 0:6c795aa153cb a Setup the proper environment variable symbol for the platform, to be subbed into the hook command. #if windows $ NODE="%HG_NODE%" #else $ NODE="\$HG_NODE" #endif $ hg histedit 6c795aa153cb --config hooks.commit="echo commit $NODE" --commands - 2>&1 << EOF | fixbundle > pick 199b6bb90248 b > fold a1a953ffb4b0 c > pick 6c795aa153cb a > EOF commit 9599899f62c05f4377548c32bf1c9f1a39634b0c $ hg logt 1:9599899f62c0 a 0:79b99e9c8e49 b $ echo "foo" > amended.txt $ hg add amended.txt $ hg ci -q --config extensions.largefiles= --amend -I amended.txt The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) Test that folding multiple changes in a row doesn't show multiple editors. $ echo foo >> foo $ hg add foo $ hg ci -m foo1 $ echo foo >> foo $ hg ci -m foo2 $ echo foo >> foo $ hg ci -m foo3 $ hg logt 4:21679ff7675c foo3 3:b7389cc4d66e foo2 2:0e01aeef5fa8 foo1 1:578c7455730c a 0:79b99e9c8e49 b $ cat > "$TESTTMP/editor.sh" < echo ran editor >> "$TESTTMP/editorlog.txt" > cat \$1 >> "$TESTTMP/editorlog.txt" > echo END >> "$TESTTMP/editorlog.txt" > echo merged foos > \$1 > EOF $ HGEDITOR="sh \"$TESTTMP/editor.sh\"" hg histedit 1 --commands - 2>&1 < pick 578c7455730c 1 a > pick 0e01aeef5fa8 2 foo1 > fold b7389cc4d66e 3 foo2 > fold 21679ff7675c 4 foo3 > EOF $ hg logt 2:e8bedbda72c1 merged foos 1:578c7455730c a 0:79b99e9c8e49 b Editor should have run only once $ cat $TESTTMP/editorlog.txt ran editor foo1 *** foo2 *** foo3 HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: test HG: branch 'default' HG: added foo END $ cd .. Test rolling into a commit with multiple children (issue5498) $ hg init roll $ cd roll $ echo a > a $ hg commit -qAm aa $ echo b > b $ hg commit -qAm bb $ hg up -q ".^" $ echo c > c $ hg commit -qAm cc $ hg log -G -T '{node|short} {desc}' @ 5db65b93a12b cc | | o 301d76bdc3ae bb |/ o 8f0162e483d0 aa $ hg histedit . --commands - << EOF > r 5db65b93a12b > EOF hg: parse error: first changeset cannot use verb "roll" [255] $ hg log -G -T '{node|short} {desc}' @ 5db65b93a12b cc | | o 301d76bdc3ae bb |/ o 8f0162e483d0 aa mercurial-4.5.3/tests/test-push-checkheads-pruned-B1.t0000644015407300116100000000304413261161234022474 0ustar augieeng00000000000000==================================== Testing head checking code: Case B-1 ==================================== Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This case is part of a series of tests checking this behavior. Category B: simple case involving pruned changesets TestCase 1: single pruned changeset .. old-state: .. .. * 1 changeset branch .. .. new-state: .. .. * old branch is pruned .. * 1 new unrelated branch .. .. expected-result: .. .. * push allowed .. .. graph-summary: .. .. ◔ B .. | .. A ⊗ | .. |/ .. ◠$ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir B1 $ cd B1 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd client $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit B0 created new head $ hg debugobsolete --record-parents `getid "desc(A0)"` obsoleted 1 changesets $ hg log -G --hidden @ 74ff5441d343 (draft): B0 | | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): root Actual testing -------------- $ hg push pushing to $TESTTMP/B1/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) 1 new obsolescence markers obsoleted 1 changesets $ cd ../.. mercurial-4.5.3/tests/test-diff-upgrade.t0000644015407300116100000001422013261161234020235 0ustar augieeng00000000000000#require execbit $ cat <> $HGRCPATH > [extensions] > autodiff = $TESTDIR/autodiff.py > [diff] > nodates = 1 > EOF $ hg init repo $ cd repo make a combination of new, changed and deleted file $ echo regular > regular $ echo rmregular > rmregular $ $PYTHON -c "open('bintoregular', 'wb').write(b'\0')" $ touch rmempty $ echo exec > exec $ chmod +x exec $ echo rmexec > rmexec $ chmod +x rmexec $ echo setexec > setexec $ echo unsetexec > unsetexec $ chmod +x unsetexec $ echo binary > binary $ $PYTHON -c "open('rmbinary', 'wb').write(b'\0')" $ hg ci -Am addfiles adding binary adding bintoregular adding exec adding regular adding rmbinary adding rmempty adding rmexec adding rmregular adding setexec adding unsetexec $ echo regular >> regular $ echo newregular >> newregular $ rm rmempty $ touch newempty $ rm rmregular $ echo exec >> exec $ echo newexec > newexec $ echo bintoregular > bintoregular $ chmod +x newexec $ rm rmexec $ chmod +x setexec $ chmod -x unsetexec $ $PYTHON -c "open('binary', 'wb').write(b'\0\0')" $ $PYTHON -c "open('newbinary', 'wb').write(b'\0')" $ rm rmbinary $ hg addremove -s 0 adding newbinary adding newempty adding newexec adding newregular removing rmbinary removing rmempty removing rmexec removing rmregular git=no: regular diff for all files $ hg autodiff --git=no diff -r a66d19b9302d binary Binary file binary has changed diff -r a66d19b9302d bintoregular Binary file bintoregular has changed diff -r a66d19b9302d exec --- a/exec +++ b/exec @@ -1,1 +1,2 @@ exec +exec diff -r a66d19b9302d newbinary Binary file newbinary has changed diff -r a66d19b9302d newexec --- /dev/null +++ b/newexec @@ -0,0 +1,1 @@ +newexec diff -r a66d19b9302d newregular --- /dev/null +++ b/newregular @@ -0,0 +1,1 @@ +newregular diff -r a66d19b9302d regular --- a/regular +++ b/regular @@ -1,1 +1,2 @@ regular +regular diff -r a66d19b9302d rmbinary Binary file rmbinary has changed diff -r a66d19b9302d rmexec --- a/rmexec +++ /dev/null @@ -1,1 +0,0 @@ -rmexec diff -r a66d19b9302d rmregular --- a/rmregular +++ /dev/null @@ -1,1 +0,0 @@ -rmregular git=yes: git diff for single regular file $ hg autodiff --git=yes regular diff --git a/regular b/regular --- a/regular +++ b/regular @@ -1,1 +1,2 @@ regular +regular git=auto: regular diff for regular files and non-binary removals $ hg autodiff --git=auto regular newregular rmregular rmexec diff -r a66d19b9302d newregular --- /dev/null +++ b/newregular @@ -0,0 +1,1 @@ +newregular diff -r a66d19b9302d regular --- a/regular +++ b/regular @@ -1,1 +1,2 @@ regular +regular diff -r a66d19b9302d rmexec --- a/rmexec +++ /dev/null @@ -1,1 +0,0 @@ -rmexec diff -r a66d19b9302d rmregular --- a/rmregular +++ /dev/null @@ -1,1 +0,0 @@ -rmregular $ for f in exec newexec setexec unsetexec binary newbinary newempty rmempty rmbinary bintoregular; do > echo > echo '% git=auto: git diff for' $f > hg autodiff --git=auto $f > done % git=auto: git diff for exec diff -r a66d19b9302d exec --- a/exec +++ b/exec @@ -1,1 +1,2 @@ exec +exec % git=auto: git diff for newexec diff --git a/newexec b/newexec new file mode 100755 --- /dev/null +++ b/newexec @@ -0,0 +1,1 @@ +newexec % git=auto: git diff for setexec diff --git a/setexec b/setexec old mode 100644 new mode 100755 % git=auto: git diff for unsetexec diff --git a/unsetexec b/unsetexec old mode 100755 new mode 100644 % git=auto: git diff for binary diff --git a/binary b/binary index a9128c283485202893f5af379dd9beccb6e79486..09f370e38f498a462e1ca0faa724559b6630c04f GIT binary patch literal 2 Jc${Nk0000200961 % git=auto: git diff for newbinary diff --git a/newbinary b/newbinary new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 Ic${MZ000310RR91 % git=auto: git diff for newempty diff --git a/newempty b/newempty new file mode 100644 % git=auto: git diff for rmempty diff --git a/rmempty b/rmempty deleted file mode 100644 % git=auto: git diff for rmbinary diff --git a/rmbinary b/rmbinary deleted file mode 100644 index f76dd238ade08917e6712764a16a22005a50573d..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 GIT binary patch literal 0 Hc$@ a $ hg ci -A -m test -u nobody -d '1 0' adding a annotate -c $ hg annotate -c a 8435f90966e4: a annotate -cl $ hg annotate -cl a 8435f90966e4:1: a annotate -d $ hg annotate -d a Thu Jan 01 00:00:01 1970 +0000: a annotate -n $ hg annotate -n a 0: a annotate -nl $ hg annotate -nl a 0:1: a annotate -u $ hg annotate -u a nobody: a annotate -cdnu $ hg annotate -cdnu a nobody 0 8435f90966e4 Thu Jan 01 00:00:01 1970 +0000: a annotate -cdnul $ hg annotate -cdnul a nobody 0 8435f90966e4 Thu Jan 01 00:00:01 1970 +0000:1: a annotate (JSON) $ hg annotate -Tjson a [ { "abspath": "a", "lines": [{"line": "a\n", "rev": 0}], "path": "a" } ] $ hg annotate -Tjson -cdfnul a [ { "abspath": "a", "lines": [{"date": [1.0, 0], "file": "a", "line": "a\n", "line_number": 1, "node": "8435f90966e442695d2ded29fdade2bac5ad8065", "rev": 0, "user": "nobody"}], "path": "a" } ] $ cat <>a > a > a > EOF $ hg ci -ma1 -d '1 0' $ hg cp a b $ hg ci -mb -d '1 0' $ cat <> b > b4 > b5 > b6 > EOF $ hg ci -mb2 -d '2 0' annotate multiple files (JSON) $ hg annotate -Tjson a b [ { "abspath": "a", "lines": [{"line": "a\n", "rev": 0}, {"line": "a\n", "rev": 1}, {"line": "a\n", "rev": 1}], "path": "a" }, { "abspath": "b", "lines": [{"line": "a\n", "rev": 0}, {"line": "a\n", "rev": 1}, {"line": "a\n", "rev": 1}, {"line": "b4\n", "rev": 3}, {"line": "b5\n", "rev": 3}, {"line": "b6\n", "rev": 3}], "path": "b" } ] annotate multiple files (template) $ hg annotate -T'== {abspath} ==\n{lines % "{rev}: {line}"}' a b == a == 0: a 1: a 1: a == b == 0: a 1: a 1: a 3: b4 3: b5 3: b6 annotate -n b $ hg annotate -n b 0: a 1: a 1: a 3: b4 3: b5 3: b6 annotate --no-follow b $ hg annotate --no-follow b 2: a 2: a 2: a 3: b4 3: b5 3: b6 annotate -nl b $ hg annotate -nl b 0:1: a 1:2: a 1:3: a 3:4: b4 3:5: b5 3:6: b6 annotate -nf b $ hg annotate -nf b 0 a: a 1 a: a 1 a: a 3 b: b4 3 b: b5 3 b: b6 annotate -nlf b $ hg annotate -nlf b 0 a:1: a 1 a:2: a 1 a:3: a 3 b:4: b4 3 b:5: b5 3 b:6: b6 $ hg up -C 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat <> b > b4 > c > b5 > EOF $ hg ci -mb2.1 -d '2 0' created new head $ hg merge merging b 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -mmergeb -d '3 0' annotate after merge $ hg annotate -nf b 0 a: a 1 a: a 1 a: a 3 b: b4 4 b: c 3 b: b5 annotate after merge with -l $ hg annotate -nlf b 0 a:1: a 1 a:2: a 1 a:3: a 3 b:4: b4 4 b:5: c 3 b:5: b5 $ hg up -C 1 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg cp a b $ cat < b > a > z > a > EOF $ hg ci -mc -d '3 0' created new head $ hg merge merging b 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat <> b > b4 > c > b5 > EOF $ echo d >> b $ hg ci -mmerge2 -d '4 0' annotate after rename merge $ hg annotate -nf b 0 a: a 6 b: z 1 a: a 3 b: b4 4 b: c 3 b: b5 7 b: d annotate after rename merge with -l $ hg annotate -nlf b 0 a:1: a 6 b:2: z 1 a:3: a 3 b:4: b4 4 b:5: c 3 b:5: b5 7 b:7: d --skip nothing (should be the same as no --skip at all) $ hg annotate -nlf b --skip '1::0' 0 a:1: a 6 b:2: z 1 a:3: a 3 b:4: b4 4 b:5: c 3 b:5: b5 7 b:7: d --skip a modified line. Note a slight behavior difference in pure - this is because the pure code comes up with slightly different deltas internally. $ hg annotate -nlf b --skip 6 0 a:1: a 1 a:2* z (no-pure !) 0 a:1* z (pure !) 1 a:3: a 3 b:4: b4 4 b:5: c 3 b:5: b5 7 b:7: d --skip added lines (and test multiple skip) $ hg annotate -nlf b --skip 3 0 a:1: a 6 b:2: z 1 a:3: a 1 a:3* b4 4 b:5: c 1 a:3* b5 7 b:7: d $ hg annotate -nlf b --skip 4 0 a:1: a 6 b:2: z 1 a:3: a 3 b:4: b4 1 a:3* c 3 b:5: b5 7 b:7: d $ hg annotate -nlf b --skip 3 --skip 4 0 a:1: a 6 b:2: z 1 a:3: a 1 a:3* b4 1 a:3* c 1 a:3* b5 7 b:7: d $ hg annotate -nlf b --skip 'merge()' 0 a:1: a 6 b:2: z 1 a:3: a 3 b:4: b4 4 b:5: c 3 b:5: b5 3 b:5* d --skip everything -- use the revision the file was introduced in $ hg annotate -nlf b --skip 'all()' 0 a:1: a 0 a:1* z 0 a:1* a 0 a:1* b4 0 a:1* c 0 a:1* b5 0 a:1* d Issue2807: alignment of line numbers with -l $ echo more >> b $ hg ci -mmore -d '5 0' $ echo more >> b $ hg ci -mmore -d '6 0' $ echo more >> b $ hg ci -mmore -d '7 0' $ hg annotate -nlf b 0 a: 1: a 6 b: 2: z 1 a: 3: a 3 b: 4: b4 4 b: 5: c 3 b: 5: b5 7 b: 7: d 8 b: 8: more 9 b: 9: more 10 b:10: more linkrev vs rev $ hg annotate -r tip -n a 0: a 1: a 1: a linkrev vs rev with -l $ hg annotate -r tip -nl a 0:1: a 1:2: a 1:3: a Issue589: "undelete" sequence leads to crash annotate was crashing when trying to --follow something like A -> B -> A generate ABA rename configuration $ echo foo > foo $ hg add foo $ hg ci -m addfoo $ hg rename foo bar $ hg ci -m renamefoo $ hg rename bar foo $ hg ci -m renamebar annotate after ABA with follow $ hg annotate --follow foo foo: foo missing file $ hg ann nosuchfile abort: nosuchfile: no such file in rev e9e6b4fa872f [255] annotate file without '\n' on last line $ printf "" > c $ hg ci -A -m test -u nobody -d '1 0' adding c $ hg annotate c $ printf "a\nb" > c $ hg ci -m test $ hg annotate c [0-9]+: a (re) [0-9]+: b (re) Issue3841: check annotation of the file of which filelog includes merging between the revision and its ancestor to reproduce the situation with recent Mercurial, this script uses (1) "hg debugsetparents" to merge without ancestor check by "hg merge", and (2) the extension to allow filelog merging between the revision and its ancestor by overriding "repo._filecommit". $ cat > ../legacyrepo.py < from __future__ import absolute_import > from mercurial import error, node > def reposetup(ui, repo): > class legacyrepo(repo.__class__): > def _filecommit(self, fctx, manifest1, manifest2, > linkrev, tr, changelist): > fname = fctx.path() > text = fctx.data() > flog = self.file(fname) > fparent1 = manifest1.get(fname, node.nullid) > fparent2 = manifest2.get(fname, node.nullid) > meta = {} > copy = fctx.renamed() > if copy and copy[0] != fname: > raise error.Abort('copying is not supported') > if fparent2 != node.nullid: > changelist.append(fname) > return flog.add(text, meta, tr, linkrev, > fparent1, fparent2) > raise error.Abort('only merging is supported') > repo.__class__ = legacyrepo > EOF $ cat > baz < 1 > 2 > 3 > 4 > 5 > EOF $ hg add baz $ hg commit -m "baz:0" $ cat > baz < 1 baz:1 > 2 > 3 > 4 > 5 > EOF $ hg commit -m "baz:1" $ cat > baz < 1 baz:1 > 2 baz:2 > 3 > 4 > 5 > EOF $ hg debugsetparents 17 17 $ hg --config extensions.legacyrepo=../legacyrepo.py commit -m "baz:2" $ hg debugindexdot .hg/store/data/baz.i digraph G { -1 -> 0 0 -> 1 1 -> 2 1 -> 2 } $ hg annotate baz 17: 1 baz:1 18: 2 baz:2 16: 3 16: 4 16: 5 $ cat > baz < 1 baz:1 > 2 baz:2 > 3 baz:3 > 4 > 5 > EOF $ hg commit -m "baz:3" $ cat > baz < 1 baz:1 > 2 baz:2 > 3 baz:3 > 4 baz:4 > 5 > EOF $ hg debugsetparents 19 18 $ hg --config extensions.legacyrepo=../legacyrepo.py commit -m "baz:4" $ hg debugindexdot .hg/store/data/baz.i digraph G { -1 -> 0 0 -> 1 1 -> 2 1 -> 2 2 -> 3 3 -> 4 2 -> 4 } $ hg annotate baz 17: 1 baz:1 18: 2 baz:2 19: 3 baz:3 20: 4 baz:4 16: 5 annotate clean file $ hg annotate -ncr "wdir()" foo 11 472b18db256d : foo annotate modified file $ echo foofoo >> foo $ hg annotate -r "wdir()" foo 11 : foo 20+: foofoo $ hg annotate -cr "wdir()" foo 472b18db256d : foo b6bedd5477e7+: foofoo $ hg annotate -ncr "wdir()" foo 11 472b18db256d : foo 20 b6bedd5477e7+: foofoo $ hg annotate --debug -ncr "wdir()" foo 11 472b18db256d1e8282064eab4bfdaf48cbfe83cd : foo 20 b6bedd5477e797f25e568a6402d4697f3f895a72+: foofoo $ hg annotate -udr "wdir()" foo test Thu Jan 01 00:00:00 1970 +0000: foo test [A-Za-z0-9:+ ]+: foofoo (re) $ hg annotate -ncr "wdir()" -Tjson foo [ { "abspath": "foo", "lines": [{"line": "foo\n", "node": "472b18db256d1e8282064eab4bfdaf48cbfe83cd", "rev": 11}, {"line": "foofoo\n", "node": null, "rev": null}], "path": "foo" } ] annotate added file $ echo bar > bar $ hg add bar $ hg annotate -ncr "wdir()" bar 20 b6bedd5477e7+: bar annotate renamed file $ hg rename foo renamefoo2 $ hg annotate -ncr "wdir()" renamefoo2 11 472b18db256d : foo 20 b6bedd5477e7+: foofoo annotate missing file $ rm baz $ hg annotate -ncr "wdir()" baz abort: $TESTTMP\repo\baz: $ENOENT$ (windows !) abort: $ENOENT$: $TESTTMP/repo/baz (no-windows !) [255] annotate removed file $ hg rm baz $ hg annotate -ncr "wdir()" baz abort: $TESTTMP\repo\baz: $ENOENT$ (windows !) abort: $ENOENT$: $TESTTMP/repo/baz (no-windows !) [255] $ hg revert --all --no-backup --quiet $ hg id -n 20 Test followlines() revset; we usually check both followlines(pat, range) and followlines(pat, range, descend=True) to make sure both give the same result when they should. $ echo a >> foo $ hg ci -m 'foo: add a' $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5)' 16: baz:0 19: baz:3 20: baz:4 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=20)' 16: baz:0 19: baz:3 20: baz:4 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19)' 16: baz:0 19: baz:3 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)' 19: baz:3 20: baz:4 $ printf "0\n0\n" | cat - baz > baz1 $ mv baz1 baz $ hg ci -m 'added two lines with 0' $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)' 16: baz:0 19: baz:3 20: baz:4 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, descend=true, startrev=19)' 19: baz:3 20: baz:4 $ echo 6 >> baz $ hg ci -m 'added line 8' $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)' 16: baz:0 19: baz:3 20: baz:4 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=1)' 19: baz:3 20: baz:4 $ sed 's/3/3+/' baz > baz.new $ mv baz.new baz $ hg ci -m 'baz:3->3+' $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7, descend=0)' 16: baz:0 19: baz:3 20: baz:4 24: baz:3->3+ $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=17, descend=True)' 19: baz:3 20: baz:4 24: baz:3->3+ $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 1:2, descend=false)' 22: added two lines with 0 file patterns are okay $ hg log -T '{rev}: {desc}\n' -r 'followlines("path:baz", 1:2)' 22: added two lines with 0 renames are followed $ hg mv baz qux $ sed 's/4/4+/' qux > qux.new $ mv qux.new qux $ hg ci -m 'qux:4->4+' $ hg log -T '{rev}: {desc}\n' -r 'followlines(qux, 5:7)' 16: baz:0 19: baz:3 20: baz:4 24: baz:3->3+ 25: qux:4->4+ but are missed when following children $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7, startrev=22, descend=True)' 24: baz:3->3+ merge $ hg up 24 --quiet $ echo 7 >> baz $ hg ci -m 'one more line, out of line range' created new head $ sed 's/3+/3-/' baz > baz.new $ mv baz.new baz $ hg ci -m 'baz:3+->3-' $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)' 16: baz:0 19: baz:3 20: baz:4 24: baz:3->3+ 27: baz:3+->3- $ hg merge 25 merging baz and qux to qux 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m merge $ hg log -T '{rev}: {desc}\n' -r 'followlines(qux, 5:7)' 16: baz:0 19: baz:3 20: baz:4 24: baz:3->3+ 25: qux:4->4+ 27: baz:3+->3- 28: merge $ hg up 25 --quiet $ hg merge 27 merging qux and baz to qux 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m 'merge from other side' created new head $ hg log -T '{rev}: {desc}\n' -r 'followlines(qux, 5:7)' 16: baz:0 19: baz:3 20: baz:4 24: baz:3->3+ 25: qux:4->4+ 27: baz:3+->3- 29: merge from other side $ hg up 24 --quiet we are missing the branch with rename when following children $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7, startrev=26, descend=True)' 27: baz:3+->3- we follow all branches in descending direction $ hg up 23 --quiet $ sed 's/3/+3/' baz > baz.new $ mv baz.new baz $ hg ci -m 'baz:3->+3' created new head $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 2:5, startrev=16, descend=True)' --graph @ 30: baz:3->+3 : : o 27: baz:3+->3- : : : o 24: baz:3->3+ :/ o 20: baz:4 |\ | o 19: baz:3 |/ o 18: baz:2 : o 16: baz:0 | ~ Issue5595: on a merge changeset with different line ranges depending on parent, be conservative and use the surrounding interval to avoid loosing track of possible further descendants in specified range. $ hg up 23 --quiet $ hg cat baz -r 24 0 0 1 baz:1 2 baz:2 3+ baz:3 4 baz:4 5 6 $ cat > baz << EOF > 0 > 0 > a > b > 3+ baz:3 > 4 baz:4 > y > z > EOF $ hg ci -m 'baz: mostly rewrite with some content from 24' created new head $ hg merge --tool :merge-other 24 merging baz 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m 'merge forgetting about baz rewrite' $ cat > baz << EOF > 0 > 0 > 1 baz:1 > 2+ baz:2 > 3+ baz:3 > 4 baz:4 > 5 > 6 > EOF $ hg ci -m 'baz: narrow change (2->2+)' $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:4, startrev=20, descend=True)' --graph @ 33: baz: narrow change (2->2+) | o 32: merge forgetting about baz rewrite |\ | o 31: baz: mostly rewrite with some content from 24 | : | : o 30: baz:3->+3 | :/ +---o 27: baz:3+->3- | : o : 24: baz:3->3+ :/ o 20: baz:4 |\ ~ ~ check error cases $ hg up 24 --quiet $ hg log -r 'followlines()' hg: parse error: followlines takes at least 1 positional arguments [255] $ hg log -r 'followlines(baz)' hg: parse error: followlines requires a line range [255] $ hg log -r 'followlines(baz, 1)' hg: parse error: followlines expects a line range [255] $ hg log -r 'followlines(baz, 1:2, startrev=desc("b"))' hg: parse error: followlines expects exactly one revision [255] $ hg log -r 'followlines("glob:*", 1:2)' hg: parse error: followlines expects exactly one file [255] $ hg log -r 'followlines(baz, 1:)' hg: parse error: line range bounds must be integers [255] $ hg log -r 'followlines(baz, :1)' hg: parse error: line range bounds must be integers [255] $ hg log -r 'followlines(baz, x:4)' hg: parse error: line range bounds must be integers [255] $ hg log -r 'followlines(baz, 5:4)' hg: parse error: line range must be positive [255] $ hg log -r 'followlines(baz, 0:4)' hg: parse error: fromline must be strictly positive [255] $ hg log -r 'followlines(baz, 2:40)' abort: line range exceeds file size [255] $ hg log -r 'followlines(baz, 2:4, startrev=20, descend=[1])' hg: parse error at 43: not a prefix: [ [255] $ hg log -r 'followlines(baz, 2:4, startrev=20, descend=a)' hg: parse error: descend argument must be a boolean [255] Test empty annotate output $ printf '\0' > binary $ touch empty $ hg ci -qAm 'add binary and empty files' $ hg annotate binary empty binary: binary file $ hg annotate -Tjson binary empty [ { "abspath": "binary", "path": "binary" }, { "abspath": "empty", "lines": [], "path": "empty" } ] Test annotate with whitespace options $ cd .. $ hg init repo-ws $ cd repo-ws $ cat > a < aa > > b b > EOF $ hg ci -Am "adda" adding a $ sed 's/EOL$//g' > a < a a > > EOL > b b > EOF $ hg ci -m "changea" Annotate with no option $ hg annotate a 1: a a 0: 1: 1: b b Annotate with --ignore-space-change $ hg annotate --ignore-space-change a 1: a a 1: 0: 0: b b Annotate with --ignore-all-space $ hg annotate --ignore-all-space a 0: a a 0: 1: 0: b b Annotate with --ignore-blank-lines (similar to no options case) $ hg annotate --ignore-blank-lines a 1: a a 0: 1: 1: b b $ cd .. Annotate with orphaned CR (issue5798) ------------------------------------- $ hg init repo-cr $ cd repo-cr $ cat <<'EOF' >> "$TESTTMP/substcr.py" > import sys > from mercurial import util > util.setbinary(sys.stdin) > util.setbinary(sys.stdout) > stdin = getattr(sys.stdin, 'buffer', sys.stdin) > stdout = getattr(sys.stdout, 'buffer', sys.stdout) > stdout.write(stdin.read().replace(b'\r', b'[CR]')) > EOF >>> with open('a', 'wb') as f: ... f.write(b'0a\r0b\r\n0c\r0d\r\n0e\n0f\n0g') $ hg ci -qAm0 >>> with open('a', 'wb') as f: ... f.write(b'0a\r0b\r\n1c\r1d\r\n0e\n1f\n0g') $ hg ci -m1 $ hg annotate -r0 a | $PYTHON "$TESTTMP/substcr.py" 0: 0a[CR]0b[CR] 0: 0c[CR]0d[CR] 0: 0e 0: 0f 0: 0g $ hg annotate -r1 a | $PYTHON "$TESTTMP/substcr.py" 0: 0a[CR]0b[CR] 1: 1c[CR]1d[CR] 0: 0e 1: 1f 0: 0g $ cd .. Annotate with linkrev pointing to another branch ------------------------------------------------ create history with a filerev whose linkrev points to another branch $ hg init branchedlinkrev $ cd branchedlinkrev $ echo A > a $ hg commit -Am 'contentA' adding a $ echo B >> a $ hg commit -m 'contentB' $ hg up --rev 'desc(contentA)' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo unrelated > unrelated $ hg commit -Am 'unrelated' adding unrelated created new head $ hg graft -r 'desc(contentB)' grafting 1:fd27c222e3e6 "contentB" $ echo C >> a $ hg commit -m 'contentC' $ echo W >> a $ hg log -G @ changeset: 4:072f1e8df249 | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: contentC | o changeset: 3:ff38df03cc4b | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: contentB | o changeset: 2:62aaf3f6fc06 | parent: 0:f0932f74827e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: unrelated | | o changeset: 1:fd27c222e3e6 |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: contentB | o changeset: 0:f0932f74827e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: contentA Annotate should list ancestor of starting revision only $ hg annotate a 0: A 3: B 4: C $ hg annotate a -r 'wdir()' 0 : A 3 : B 4 : C 4+: W Even when the starting revision is the linkrev-shadowed one: $ hg annotate a -r 3 0: A 3: B $ cd .. Issue5360: Deleted chunk in p1 of a merge changeset $ hg init repo-5360 $ cd repo-5360 $ echo 1 > a $ hg commit -A a -m 1 $ echo 2 >> a $ hg commit -m 2 $ echo a > a $ hg commit -m a $ hg update '.^' -q $ echo 3 >> a $ hg commit -m 3 -q $ hg merge 2 -q $ cat > a << EOF > b > 1 > 2 > 3 > a > EOF $ hg resolve --mark -q $ hg commit -m m $ hg annotate a 4: b 0: 1 1: 2 3: 3 2: a $ cd .. mercurial-4.5.3/tests/test-bundle-r.t0000644015407300116100000002237113261161234017416 0ustar augieeng00000000000000 $ hg init test $ cd test $ hg unbundle "$TESTDIR/bundles/remote.hg" adding changesets adding manifests adding file changes added 9 changesets with 7 changes to 4 files (+1 heads) new changesets bfaf4b5cbf01:916f1afdef90 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg up tip 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd .. $ for i in 0 1 2 3 4 5 6 7 8; do > mkdir test-"$i" > hg --cwd test-"$i" init > hg -R test bundle -r "$i" test-"$i".hg test-"$i" > cd test-"$i" > hg unbundle ../test-"$i".hg > hg verify > hg tip -q > cd .. > done searching for changes 1 changesets found adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets bfaf4b5cbf01 (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 1 changesets, 1 total revisions 0:bfaf4b5cbf01 searching for changes 2 changesets found adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files new changesets bfaf4b5cbf01:21f32785131f (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 2 changesets, 2 total revisions 1:21f32785131f searching for changes 3 changesets found adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 1 files new changesets bfaf4b5cbf01:4ce51a113780 (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 3 changesets, 3 total revisions 2:4ce51a113780 searching for changes 4 changesets found adding changesets adding manifests adding file changes added 4 changesets with 4 changes to 1 files new changesets bfaf4b5cbf01:93ee6ab32777 (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 4 changesets, 4 total revisions 3:93ee6ab32777 searching for changes 2 changesets found adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files new changesets bfaf4b5cbf01:c70afb1ee985 (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 2 changesets, 2 total revisions 1:c70afb1ee985 searching for changes 3 changesets found adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 1 files new changesets bfaf4b5cbf01:f03ae5a9b979 (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 3 changesets, 3 total revisions 2:f03ae5a9b979 searching for changes 4 changesets found adding changesets adding manifests adding file changes added 4 changesets with 5 changes to 2 files new changesets bfaf4b5cbf01:095cb14b1b4d (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 4 changesets, 5 total revisions 3:095cb14b1b4d searching for changes 5 changesets found adding changesets adding manifests adding file changes added 5 changesets with 6 changes to 3 files new changesets bfaf4b5cbf01:faa2e4234c7a (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files 3 files, 5 changesets, 6 total revisions 4:faa2e4234c7a searching for changes 5 changesets found adding changesets adding manifests adding file changes added 5 changesets with 5 changes to 2 files new changesets bfaf4b5cbf01:916f1afdef90 (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 5 changesets, 5 total revisions 4:916f1afdef90 $ cd test-8 $ hg pull ../test-7 pulling from ../test-7 searching for changes adding changesets adding manifests adding file changes added 4 changesets with 2 changes to 3 files (+1 heads) new changesets c70afb1ee985:faa2e4234c7a (run 'hg heads' to see heads, 'hg merge' to merge) $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 4 files, 9 changesets, 7 total revisions $ hg rollback repository tip rolled back to revision 4 (undo pull) $ cd .. should fail $ hg -R test bundle --base 2 -r tip test-bundle-branch1.hg test-3 abort: --base is incompatible with specifying a destination [255] $ hg -R test bundle -a -r tip test-bundle-branch1.hg test-3 abort: --all is incompatible with specifying a destination [255] $ hg -R test bundle -r tip test-bundle-branch1.hg abort: repository default-push not found! [255] $ hg -R test bundle --base 2 -r tip test-bundle-branch1.hg 2 changesets found $ hg -R test bundle --base 2 -r 7 test-bundle-branch2.hg 4 changesets found $ hg -R test bundle --base 2 test-bundle-all.hg 6 changesets found $ hg -R test bundle --base 2 --all test-bundle-all-2.hg ignoring --base because --all was specified 9 changesets found $ hg -R test bundle --base 3 -r tip test-bundle-should-fail.hg 1 changesets found empty bundle $ hg -R test bundle --base 7 --base 8 test-bundle-empty.hg no changes found [1] issue76 msg2163 $ hg -R test bundle --base 3 -r 3 -r 3 test-bundle-cset-3.hg no changes found [1] Issue1910: 'hg bundle --base $head' does not exclude $head from result $ hg -R test bundle --base 7 test-bundle-cset-7.hg 4 changesets found $ hg clone test-2 test-9 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd test-9 revision 2 $ hg tip -q 2:4ce51a113780 $ hg unbundle ../test-bundle-should-fail.hg adding changesets transaction abort! rollback completed abort: 00changelog.i@93ee6ab32777: unknown parent! [255] revision 2 $ hg tip -q 2:4ce51a113780 $ hg unbundle ../test-bundle-all.hg adding changesets adding manifests adding file changes added 6 changesets with 4 changes to 4 files (+1 heads) new changesets 93ee6ab32777:916f1afdef90 (run 'hg heads' to see heads, 'hg merge' to merge) revision 8 $ hg tip -q 8:916f1afdef90 $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 4 files, 9 changesets, 7 total revisions $ hg rollback repository tip rolled back to revision 2 (undo unbundle) revision 2 $ hg tip -q 2:4ce51a113780 $ hg unbundle ../test-bundle-branch1.hg adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files new changesets 93ee6ab32777:916f1afdef90 (run 'hg update' to get a working copy) revision 4 $ hg tip -q 4:916f1afdef90 $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 5 changesets, 5 total revisions $ hg rollback repository tip rolled back to revision 2 (undo unbundle) $ hg unbundle ../test-bundle-branch2.hg adding changesets adding manifests adding file changes added 4 changesets with 3 changes to 3 files (+1 heads) new changesets c70afb1ee985:faa2e4234c7a (run 'hg heads' to see heads, 'hg merge' to merge) revision 6 $ hg tip -q 6:faa2e4234c7a $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 3 files, 7 changesets, 6 total revisions $ hg rollback repository tip rolled back to revision 2 (undo unbundle) $ hg unbundle ../test-bundle-cset-7.hg adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files new changesets 93ee6ab32777:916f1afdef90 (run 'hg update' to get a working copy) revision 4 $ hg tip -q 4:916f1afdef90 $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 5 changesets, 5 total revisions $ cd ../test $ hg merge 7 note: possible conflict - afile was renamed multiple times to: anotherfile adifferentfile 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m merge $ cd .. $ hg -R test bundle --base 2 test-bundle-head.hg 7 changesets found $ hg clone test-2 test-10 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd test-10 $ hg unbundle ../test-bundle-head.hg adding changesets adding manifests adding file changes added 7 changesets with 4 changes to 4 files new changesets 93ee6ab32777:03fc0b0e347c (run 'hg update' to get a working copy) revision 9 $ hg tip -q 9:03fc0b0e347c $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 4 files, 10 changesets, 7 total revisions $ cd .. mercurial-4.5.3/tests/test-push-checkheads-superceed-A4.t0000644015407300116100000000322113261161234023155 0ustar augieeng00000000000000==================================== Testing head checking code: Case A-4 ==================================== Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This case is part of a series of tests checking this behavior. Category A: simple case involving a branch being superceeded by another. TestCase 4: New changeset as children of the successor .. old-state: .. .. * 1-changeset branch .. .. new-state: .. .. * 2-changeset branch, first is a successor, but head is new .. .. expected-result: .. .. * push allowed .. .. graph-summary: .. .. ◔ B .. | .. A ø⇠◔ A' .. |/ .. ◠$ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir A4 $ cd A4 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd client $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit A1 created new head $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` obsoleted 1 changesets $ mkcommit B0 $ hg log -G --hidden @ f40ded968333 (draft): B0 | o f6082bc4ffef (draft): A1 | | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): root Actual testing -------------- $ hg push pushing to $TESTTMP/A4/server searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files (+1 heads) 1 new obsolescence markers obsoleted 1 changesets $ cd ../../ mercurial-4.5.3/tests/test-convert-cvs.t0000644015407300116100000003237513261161234020164 0ustar augieeng00000000000000#require cvs $ cvscall() > { > cvs -f "$@" > } $ hgcat() > { > hg --cwd src-hg cat -r tip "$1" > } $ echo "[extensions]" >> $HGRCPATH $ echo "convert = " >> $HGRCPATH $ cat > cvshooks.py < def cvslog(ui,repo,hooktype,log): > ui.write('%s hook: %d entries\n' % (hooktype,len(log))) > > def cvschangesets(ui,repo,hooktype,changesets): > ui.write('%s hook: %d changesets\n' % (hooktype,len(changesets))) > EOF $ hookpath=`pwd` $ cat <> $HGRCPATH > [hooks] > cvslog = python:$hookpath/cvshooks.py:cvslog > cvschangesets = python:$hookpath/cvshooks.py:cvschangesets > EOF create cvs repository $ mkdir cvsrepo $ cd cvsrepo $ CVSROOT=`pwd` $ export CVSROOT $ CVS_OPTIONS=-f $ export CVS_OPTIONS $ cd .. $ rmdir cvsrepo $ cvscall -q -d "$CVSROOT" init create source directory $ mkdir src-temp $ cd src-temp $ echo a > a $ mkdir b $ cd b $ echo c > c $ cd .. import source directory $ cvscall -q import -m import src INITIAL start N src/a N src/b/c No conflicts created by this import $ cd .. checkout source directory $ cvscall -q checkout src U src/a U src/b/c commit a new revision changing b/c $ cd src $ sleep 1 $ echo c >> b/c $ cvscall -q commit -mci0 . | grep '<--' $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob) $ cd .. convert fresh repo and also check localtimezone option NOTE: This doesn't check all time zones -- it merely determines that the configuration option is taking effect. An arbitrary (U.S.) time zone is used here. TZ=US/Hawaii is selected since it does not use DST (unlike other U.S. time zones) and is always a fixed difference from UTC. This choice is limited to work on Linux environments. At least on FreeBSD 11 this timezone is not known. A better choice is TZ=Pacific/Johnston. On Linux "US/Hawaii" is just a symlink to this name and also it is known on FreeBSD and on Solaris. $ TZ=Pacific/Johnston hg convert --config convert.localtimezone=True src src-hg initializing destination src-hg repository connecting to $TESTTMP/cvsrepo scanning source... collecting CVS rlog 5 log entries cvslog hook: 5 entries creating changesets 3 changeset entries cvschangesets hook: 3 changesets sorting... converting... 2 Initial revision 1 ci0 0 import updating tags $ hgcat a a $ hgcat b/c c c convert fresh repo with --filemap $ echo include b/c > filemap $ hg convert --filemap filemap src src-filemap initializing destination src-filemap repository connecting to $TESTTMP/cvsrepo scanning source... collecting CVS rlog 5 log entries cvslog hook: 5 entries creating changesets 3 changeset entries cvschangesets hook: 3 changesets sorting... converting... 2 Initial revision 1 ci0 0 import filtering out empty revision repository tip rolled back to revision 1 (undo convert) updating tags $ hgcat b/c c c $ hg -R src-filemap log --template '{rev} {desc} files: {files}\n' 2 update tags files: .hgtags 1 ci0 files: b/c 0 Initial revision files: b/c convert full repository (issue1649) $ cvscall -q -d "$CVSROOT" checkout -d srcfull "." | grep -v CVSROOT U srcfull/src/a U srcfull/src/b/c $ ls srcfull CVS CVSROOT src $ hg convert srcfull srcfull-hg \ > | grep -v 'log entries' | grep -v 'hook:' \ > | grep -v '^[0-3] .*' # filter instable changeset order initializing destination srcfull-hg repository connecting to $TESTTMP/cvsrepo scanning source... collecting CVS rlog creating changesets 4 changeset entries sorting... converting... updating tags $ hg cat -r tip --cwd srcfull-hg src/a a $ hg cat -r tip --cwd srcfull-hg src/b/c c c commit new file revisions $ cd src $ echo a >> a $ echo c >> b/c $ cvscall -q commit -mci1 . | grep '<--' $TESTTMP/cvsrepo/src/a,v <-- a $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob) $ cd .. convert again $ TZ=Pacific/Johnston hg convert --config convert.localtimezone=True src src-hg connecting to $TESTTMP/cvsrepo scanning source... collecting CVS rlog 7 log entries cvslog hook: 7 entries creating changesets 4 changeset entries cvschangesets hook: 4 changesets sorting... converting... 0 ci1 $ hgcat a a a $ hgcat b/c c c c convert again with --filemap $ hg convert --filemap filemap src src-filemap connecting to $TESTTMP/cvsrepo scanning source... collecting CVS rlog 7 log entries cvslog hook: 7 entries creating changesets 4 changeset entries cvschangesets hook: 4 changesets sorting... converting... 0 ci1 $ hgcat b/c c c c $ hg -R src-filemap log --template '{rev} {desc} files: {files}\n' 3 ci1 files: b/c 2 update tags files: .hgtags 1 ci0 files: b/c 0 Initial revision files: b/c commit branch $ cd src $ cvs -q update -r1.1 b/c U b/c $ cvs -q tag -b branch T a T b/c $ cvs -q update -r branch > /dev/null $ sleep 1 $ echo d >> b/c $ cvs -q commit -mci2 . | grep '<--' $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob) $ cd .. convert again $ TZ=Pacific/Johnston hg convert --config convert.localtimezone=True src src-hg connecting to $TESTTMP/cvsrepo scanning source... collecting CVS rlog 8 log entries cvslog hook: 8 entries creating changesets 5 changeset entries cvschangesets hook: 5 changesets sorting... converting... 0 ci2 $ hgcat b/c c d convert again with --filemap $ TZ=Pacific/Johnston hg convert --config convert.localtimezone=True --filemap filemap src src-filemap connecting to $TESTTMP/cvsrepo scanning source... collecting CVS rlog 8 log entries cvslog hook: 8 entries creating changesets 5 changeset entries cvschangesets hook: 5 changesets sorting... converting... 0 ci2 $ hgcat b/c c d $ hg -R src-filemap log --template '{rev} {desc} files: {files}\n' 4 ci2 files: b/c 3 ci1 files: b/c 2 update tags files: .hgtags 1 ci0 files: b/c 0 Initial revision files: b/c commit a new revision with funny log message $ cd src $ sleep 1 $ echo e >> a $ cvscall -q commit -m'funny > ---------------------------- > log message' . | grep '<--' |\ > sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g' checking in src/a,v commit new file revisions with some fuzz $ sleep 1 $ echo f >> a $ cvscall -q commit -mfuzzy . | grep '<--' $TESTTMP/cvsrepo/src/a,v <-- a $ sleep 4 # the two changes will be split if fuzz < 4 $ echo g >> b/c $ cvscall -q commit -mfuzzy . | grep '<--' $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob) $ cd .. convert again $ TZ=Pacific/Johnston hg convert --config convert.cvsps.fuzz=2 --config convert.localtimezone=True src src-hg connecting to $TESTTMP/cvsrepo scanning source... collecting CVS rlog 11 log entries cvslog hook: 11 entries creating changesets 8 changeset entries cvschangesets hook: 8 changesets sorting... converting... 2 funny 1 fuzzy 0 fuzzy $ hg -R src-hg log -G --template '{rev} ({branches}) {desc} date: {date|date} files: {files}\n' o 8 (branch) fuzzy date: * -1000 files: b/c (glob) | o 7 (branch) fuzzy date: * -1000 files: a (glob) | o 6 (branch) funny | ---------------------------- | log message date: * -1000 files: a (glob) o 5 (branch) ci2 date: * -1000 files: b/c (glob) o 4 () ci1 date: * -1000 files: a b/c (glob) | o 3 () update tags date: * +0000 files: .hgtags (glob) | | o 2 (INITIAL) import date: * -1000 files: (glob) | | o | 1 () ci0 date: * -1000 files: b/c (glob) |/ o 0 () Initial revision date: * -1000 files: a b/c (glob) testing debugcvsps $ cd src $ hg debugcvsps --fuzz=2 -x >/dev/null commit a new revision changing a and removing b/c $ cvscall -q update -A U a U b/c $ sleep 1 $ echo h >> a $ cvscall -Q remove -f b/c $ cvscall -q commit -mci | grep '<--' $TESTTMP/cvsrepo/src/a,v <-- a $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob) update and verify the cvsps cache $ hg debugcvsps --fuzz=2 -u collecting CVS rlog 13 log entries cvslog hook: 13 entries creating changesets 11 changeset entries cvschangesets hook: 11 changesets --------------------- PatchSet 1 Date: * (glob) Author: * (glob) Branch: HEAD Tag: (none) Branchpoints: INITIAL Log: Initial revision Members: a:INITIAL->1.1 --------------------- PatchSet 2 Date: * (glob) Author: * (glob) Branch: HEAD Tag: (none) Branchpoints: INITIAL, branch Log: Initial revision Members: b/c:INITIAL->1.1 --------------------- PatchSet 3 Date: * (glob) Author: * (glob) Branch: INITIAL Tag: start Log: import Members: a:1.1->1.1.1.1 b/c:1.1->1.1.1.1 --------------------- PatchSet 4 Date: * (glob) Author: * (glob) Branch: HEAD Tag: (none) Log: ci0 Members: b/c:1.1->1.2 --------------------- PatchSet 5 Date: * (glob) Author: * (glob) Branch: HEAD Tag: (none) Branchpoints: branch Log: ci1 Members: a:1.1->1.2 --------------------- PatchSet 6 Date: * (glob) Author: * (glob) Branch: HEAD Tag: (none) Log: ci1 Members: b/c:1.2->1.3 --------------------- PatchSet 7 Date: * (glob) Author: * (glob) Branch: branch Tag: (none) Log: ci2 Members: b/c:1.1->1.1.2.1 --------------------- PatchSet 8 Date: * (glob) Author: * (glob) Branch: branch Tag: (none) Log: funny ---------------------------- log message Members: a:1.2->1.2.2.1 --------------------- PatchSet 9 Date: * (glob) Author: * (glob) Branch: branch Tag: (none) Log: fuzzy Members: a:1.2.2.1->1.2.2.2 --------------------- PatchSet 10 Date: * (glob) Author: * (glob) Branch: branch Tag: (none) Log: fuzzy Members: b/c:1.1.2.1->1.1.2.2 --------------------- PatchSet 11 Date: * (glob) Author: * (glob) Branch: HEAD Tag: (none) Log: ci Members: a:1.2->1.3 b/c:1.3->1.4(DEAD) $ cd .. Test transcoding CVS log messages (issue5597) ============================================= To emulate commit messages in (non-ascii) multiple encodings portably, this test scenario writes CVS history file (*,v file) directly via python code. Commit messages of version 1.2 - 1.4 use u3042 in 3 encodings below. |encoding |byte sequence | decodable as: | | | | utf-8 euc-jp cp932 | +----------+--------------+--------------------+ |utf-8 |\xe3\x81\x82 | o x x | |euc-jp |\xa4\xa2 | x o o | |cp932 |\x82\xa0 | x x o | $ mkdir -p cvsrepo/transcoding $ python < fp = open('cvsrepo/transcoding/file,v', 'w') > fp.write((''' > head 1.4; > access; > symbols > start:1.1.1.1 INITIAL:1.1.1; > locks; strict; > comment @# @; > > > 1.4 > date 2017.07.10.00.00.04; author nobody; state Exp; > branches; > next 1.3; > commitid 10059635D016A510FFA; > > 1.3 > date 2017.07.10.00.00.03; author nobody; state Exp; > branches; > next 1.2; > commitid 10059635CFF6A4FF34E; > > 1.2 > date 2017.07.10.00.00.02; author nobody; state Exp; > branches; > next 1.1; > commitid 10059635CFD6A4D5095; > > 1.1 > date 2017.07.10.00.00.01; author nobody; state Exp; > branches > 1.1.1.1; > next ; > commitid 10059635CFB6A4A3C33; > > 1.1.1.1 > date 2017.07.10.00.00.01; author nobody; state Exp; > branches; > next ; > commitid 10059635CFB6A4A3C33; > > > desc > @@ > > > 1.4 > log > @''' + u'\u3042'.encode('cp932') + ''' (cp932) > @ > text > @1 > 2 > 3 > 4 > @ > > > 1.3 > log > @''' + u'\u3042'.encode('euc-jp') + ''' (euc-jp) > @ > text > @d4 1 > @ > > > 1.2 > log > @''' + u'\u3042'.encode('utf-8') + ''' (utf-8) > @ > text > @d3 1 > @ > > > 1.1 > log > @Initial revision > @ > text > @d2 1 > @ > > > 1.1.1.1 > log > @import > @ > text > @@ > ''').lstrip()) > EOF $ cvscall -q checkout transcoding U transcoding/file Test converting in normal case ------------------------------ (filtering by grep in order to check only form of debug messages) $ hg convert --config convert.cvsps.logencoding=utf-8,euc-jp,cp932 -q --debug transcoding transcoding-hg | grep 'transcoding by' transcoding by utf-8: 1.1 of file transcoding by utf-8: 1.1.1.1 of file transcoding by utf-8: 1.2 of file transcoding by euc-jp: 1.3 of file transcoding by cp932: 1.4 of file $ hg -R transcoding-hg --encoding utf-8 log -T "{rev}: {desc}\n" 5: update tags 4: import 3: \xe3\x81\x82 (cp932) (esc) 2: \xe3\x81\x82 (euc-jp) (esc) 1: \xe3\x81\x82 (utf-8) (esc) 0: Initial revision $ rm -rf transcoding-hg Test converting in error cases ------------------------------ unknown encoding in convert.cvsps.logencoding $ hg convert --config convert.cvsps.logencoding=foobar -q transcoding transcoding-hg abort: unknown encoding: foobar (check convert.cvsps.logencoding configuration) [255] $ rm -rf transcoding-hg no acceptable encoding in convert.cvsps.logencoding $ hg convert --config convert.cvsps.logencoding=utf-8,euc-jp -q transcoding transcoding-hg abort: no encoding can transcode CVS log message for 1.4 of file (check convert.cvsps.logencoding configuration) [255] $ rm -rf transcoding-hg mercurial-4.5.3/tests/badserverext.py0000644015407300116100000002404013261161234017607 0ustar augieeng00000000000000# badserverext.py - Extension making servers behave badly # # Copyright 2017 Gregory Szorc # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. # no-check-code """Extension to make servers behave badly. This extension is useful for testing Mercurial behavior when various network events occur. Various config options in the [badserver] section influence behavior: closebeforeaccept If true, close() the server socket when a new connection arrives before accept() is called. The server will then exit. closeafteraccept If true, the server will close() the client socket immediately after accept(). closeafterrecvbytes If defined, close the client socket after receiving this many bytes. closeaftersendbytes If defined, close the client socket after sending this many bytes. """ from __future__ import absolute_import import socket from mercurial import( registrar, ) from mercurial.hgweb import ( server, ) configtable = {} configitem = registrar.configitem(configtable) configitem('badserver', 'closeafteraccept', default=False, ) configitem('badserver', 'closeafterrecvbytes', default=0, ) configitem('badserver', 'closeaftersendbytes', default=0, ) configitem('badserver', 'closebeforeaccept', default=False, ) # We can't adjust __class__ on a socket instance. So we define a proxy type. class socketproxy(object): __slots__ = ( '_orig', '_logfp', '_closeafterrecvbytes', '_closeaftersendbytes', ) def __init__(self, obj, logfp, closeafterrecvbytes=0, closeaftersendbytes=0): object.__setattr__(self, '_orig', obj) object.__setattr__(self, '_logfp', logfp) object.__setattr__(self, '_closeafterrecvbytes', closeafterrecvbytes) object.__setattr__(self, '_closeaftersendbytes', closeaftersendbytes) def __getattribute__(self, name): if name in ('makefile',): return object.__getattribute__(self, name) return getattr(object.__getattribute__(self, '_orig'), name) def __delattr__(self, name): delattr(object.__getattribute__(self, '_orig'), name) def __setattr__(self, name, value): setattr(object.__getattribute__(self, '_orig'), name, value) def makefile(self, mode, bufsize): f = object.__getattribute__(self, '_orig').makefile(mode, bufsize) logfp = object.__getattribute__(self, '_logfp') closeafterrecvbytes = object.__getattribute__(self, '_closeafterrecvbytes') closeaftersendbytes = object.__getattribute__(self, '_closeaftersendbytes') return fileobjectproxy(f, logfp, closeafterrecvbytes=closeafterrecvbytes, closeaftersendbytes=closeaftersendbytes) # We can't adjust __class__ on socket._fileobject, so define a proxy. class fileobjectproxy(object): __slots__ = ( '_orig', '_logfp', '_closeafterrecvbytes', '_closeaftersendbytes', ) def __init__(self, obj, logfp, closeafterrecvbytes=0, closeaftersendbytes=0): object.__setattr__(self, '_orig', obj) object.__setattr__(self, '_logfp', logfp) object.__setattr__(self, '_closeafterrecvbytes', closeafterrecvbytes) object.__setattr__(self, '_closeaftersendbytes', closeaftersendbytes) def __getattribute__(self, name): if name in ('read', 'readline', 'write', '_writelog'): return object.__getattribute__(self, name) return getattr(object.__getattribute__(self, '_orig'), name) def __delattr__(self, name): delattr(object.__getattribute__(self, '_orig'), name) def __setattr__(self, name, value): setattr(object.__getattribute__(self, '_orig'), name, value) def _writelog(self, msg): msg = msg.replace('\r', '\\r').replace('\n', '\\n') object.__getattribute__(self, '_logfp').write(msg) object.__getattribute__(self, '_logfp').write('\n') object.__getattribute__(self, '_logfp').flush() def read(self, size=-1): remaining = object.__getattribute__(self, '_closeafterrecvbytes') # No read limit. Call original function. if not remaining: result = object.__getattribute__(self, '_orig').read(size) self._writelog('read(%d) -> (%d) (%s) %s' % (size, len(result), result)) return result origsize = size if size < 0: size = remaining else: size = min(remaining, size) result = object.__getattribute__(self, '_orig').read(size) remaining -= len(result) self._writelog('read(%d from %d) -> (%d) %s' % ( size, origsize, len(result), result)) object.__setattr__(self, '_closeafterrecvbytes', remaining) if remaining <= 0: self._writelog('read limit reached, closing socket') self._sock.close() # This is the easiest way to abort the current request. raise Exception('connection closed after receiving N bytes') return result def readline(self, size=-1): remaining = object.__getattribute__(self, '_closeafterrecvbytes') # No read limit. Call original function. if not remaining: result = object.__getattribute__(self, '_orig').readline(size) self._writelog('readline(%d) -> (%d) %s' % ( size, len(result), result)) return result origsize = size if size < 0: size = remaining else: size = min(remaining, size) result = object.__getattribute__(self, '_orig').readline(size) remaining -= len(result) self._writelog('readline(%d from %d) -> (%d) %s' % ( size, origsize, len(result), result)) object.__setattr__(self, '_closeafterrecvbytes', remaining) if remaining <= 0: self._writelog('read limit reached; closing socket') self._sock.close() # This is the easiest way to abort the current request. raise Exception('connection closed after receiving N bytes') return result def write(self, data): remaining = object.__getattribute__(self, '_closeaftersendbytes') # No byte limit on this operation. Call original function. if not remaining: self._writelog('write(%d) -> %s' % (len(data), data)) result = object.__getattribute__(self, '_orig').write(data) return result if len(data) > remaining: newdata = data[0:remaining] else: newdata = data remaining -= len(newdata) self._writelog('write(%d from %d) -> (%d) %s' % ( len(newdata), len(data), remaining, newdata)) result = object.__getattribute__(self, '_orig').write(newdata) object.__setattr__(self, '_closeaftersendbytes', remaining) if remaining <= 0: self._writelog('write limit reached; closing socket') self._sock.close() raise Exception('connection closed after sending N bytes') return result def extsetup(ui): # Change the base HTTP server class so various events can be performed. # See SocketServer.BaseServer for how the specially named methods work. class badserver(server.MercurialHTTPServer): def __init__(self, ui, *args, **kwargs): self._ui = ui super(badserver, self).__init__(ui, *args, **kwargs) # Need to inherit object so super() works. class badrequesthandler(self.RequestHandlerClass, object): def send_header(self, name, value): # Make headers deterministic to facilitate testing. if name.lower() == 'date': value = 'Fri, 14 Apr 2017 00:00:00 GMT' elif name.lower() == 'server': value = 'badhttpserver' return super(badrequesthandler, self).send_header(name, value) self.RequestHandlerClass = badrequesthandler # Called to accept() a pending socket. def get_request(self): if self._ui.configbool('badserver', 'closebeforeaccept'): self.socket.close() # Tells the server to stop processing more requests. self.__shutdown_request = True # Simulate failure to stop processing this request. raise socket.error('close before accept') if self._ui.configbool('badserver', 'closeafteraccept'): request, client_address = super(badserver, self).get_request() request.close() raise socket.error('close after accept') return super(badserver, self).get_request() # Does heavy lifting of processing a request. Invokes # self.finish_request() which calls self.RequestHandlerClass() which # is a hgweb.server._httprequesthandler. def process_request(self, socket, address): # Wrap socket in a proxy if we need to count bytes. closeafterrecvbytes = self._ui.configint('badserver', 'closeafterrecvbytes') closeaftersendbytes = self._ui.configint('badserver', 'closeaftersendbytes') if closeafterrecvbytes or closeaftersendbytes: socket = socketproxy(socket, self.errorlog, closeafterrecvbytes=closeafterrecvbytes, closeaftersendbytes=closeaftersendbytes) return super(badserver, self).process_request(socket, address) server.MercurialHTTPServer = badserver mercurial-4.5.3/tests/test-pager-legacy.t0000644015407300116100000001652613261161234020253 0ustar augieeng00000000000000 $ cat >> fakepager.py < import sys > for line in sys.stdin: > sys.stdout.write('paged! %r\n' % line) > EOF Enable ui.formatted because pager won't fire without it, and set up pager and tell it to use our fake pager that lets us see when the pager was running. $ cat >> $HGRCPATH < [ui] > formatted = yes > color = no > [extensions] > pager= > [pager] > pager = $PYTHON $TESTTMP/fakepager.py > EOF $ hg init repo $ cd repo $ echo a >> a $ hg add a $ hg ci -m 'add a' $ for x in `$PYTHON $TESTDIR/seq.py 1 10`; do > echo a $x >> a > hg ci -m "modify a $x" > done By default diff and log are paged, but summary is not: $ hg diff -c 2 --pager=yes paged! 'diff -r f4be7687d414 -r bce265549556 a\n' paged! '--- a/a\tThu Jan 01 00:00:00 1970 +0000\n' paged! '+++ b/a\tThu Jan 01 00:00:00 1970 +0000\n' paged! '@@ -1,2 +1,3 @@\n' paged! ' a\n' paged! ' a 1\n' paged! '+a 2\n' $ hg log --limit 2 paged! 'changeset: 10:46106edeeb38\n' paged! 'tag: tip\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 10\n' paged! '\n' paged! 'changeset: 9:6dd8ea7dd621\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 9\n' paged! '\n' $ hg summary parent: 10:46106edeeb38 tip modify a 10 branch: default commit: (clean) update: (current) phases: 11 draft We can enable the pager on summary: $ hg --config pager.attend-summary=yes summary paged! 'parent: 10:46106edeeb38 tip\n' paged! ' modify a 10\n' paged! 'branch: default\n' paged! 'commit: (clean)\n' paged! 'update: (current)\n' paged! 'phases: 11 draft\n' $ hg --config pager.attend-diff=no diff -c 2 diff -r f4be7687d414 -r bce265549556 a --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +1,3 @@ a a 1 +a 2 If we completely change the attend list that's respected: $ hg --config pager.attend=summary diff -c 2 diff -r f4be7687d414 -r bce265549556 a --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +1,3 @@ a a 1 +a 2 If 'log' is in attend, then 'history' should also be paged: $ hg history --limit 2 --config pager.attend=log paged! 'changeset: 10:46106edeeb38\n' paged! 'tag: tip\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 10\n' paged! '\n' paged! 'changeset: 9:6dd8ea7dd621\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 9\n' paged! '\n' Possible bug: history is explicitly ignored in pager config, but because log is in the attend list it still gets pager treatment. $ hg history --limit 2 --config pager.attend=log \ > --config pager.ignore=history paged! 'changeset: 10:46106edeeb38\n' paged! 'tag: tip\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 10\n' paged! '\n' paged! 'changeset: 9:6dd8ea7dd621\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 9\n' paged! '\n' Possible bug: history is explicitly marked as attend-history=no, but it doesn't fail to get paged because log is still in the attend list. $ hg history --limit 2 --config pager.attend-history=no paged! 'changeset: 10:46106edeeb38\n' paged! 'tag: tip\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 10\n' paged! '\n' paged! 'changeset: 9:6dd8ea7dd621\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 9\n' paged! '\n' Possible bug: disabling pager for log but enabling it for history doesn't result in history being paged. $ hg history --limit 2 --config pager.attend-log=no \ > --config pager.attend-history=yes changeset: 10:46106edeeb38 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modify a 10 changeset: 9:6dd8ea7dd621 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modify a 9 Pager should not start if stdout is not a tty. $ hg log -l1 -q --config ui.formatted=False 10:46106edeeb38 Pager with color enabled allows colors to come through by default, even though stdout is no longer a tty. $ cat >> $HGRCPATH < [ui] > color = always > [color] > mode = ansi > EOF $ hg log --limit 3 paged! '\x1b[0;33mchangeset: 10:46106edeeb38\x1b[0m\n' paged! 'tag: tip\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 10\n' paged! '\n' paged! '\x1b[0;33mchangeset: 9:6dd8ea7dd621\x1b[0m\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 9\n' paged! '\n' paged! '\x1b[0;33mchangeset: 8:cff05a6312fe\x1b[0m\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 8\n' paged! '\n' Pager works with shell aliases. $ cat >> $HGRCPATH < [alias] > echoa = !echo a > EOF $ hg echoa a $ hg --config pager.attend-echoa=yes echoa paged! 'a\n' Pager attributes should be copied to mq repo. Otherwise pager would be started twice and color mode would be lost. $ cat >> $HGRCPATH < [extensions] > mq = > EOF $ hg init --mq $ hg qnew foo.patch $ hg qpop popping foo.patch patch queue now empty $ hg ci --mq -m 'commit patches' $ hg log --mq --debug starting pager for command 'extension-via-attend-log' paged! '\x1b[0;33mchangeset: 0:6cc2ded15503e368aaf76b6cc3d12f320c9e3b87\x1b[0m\n' paged! 'tag: tip\n' paged! 'phase: draft\n' paged! 'parent: -1:0000000000000000000000000000000000000000\n' paged! 'parent: -1:0000000000000000000000000000000000000000\n' paged! 'manifest: 0:4980de1ae1b612014d5bcfa9507da84ce8891daa\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'files+: .hgignore foo.patch series\n' paged! 'extra: branch=default\n' paged! 'description:\n' paged! 'commit patches\n' paged! '\n' paged! '\n' Pager works with hg aliases including environment variables. $ cat >> $HGRCPATH <<'EOF' > [alias] > printa = log -T "$A\n" -r 0 > EOF $ A=1 hg --config pager.attend-printa=yes printa paged! '1\n' $ A=2 hg --config pager.attend-printa=yes printa paged! '2\n' Something that's explicitly attended is still not paginated if the pager is globally set to off using a flag: $ A=2 hg --config pager.attend-printa=yes printa --pager=no 2 Pager should not override the exit code of other commands $ cat >> $TESTTMP/fortytwo.py <<'EOF' > from mercurial import registrar, commands > cmdtable = {} > command = registrar.command(cmdtable) > @command(b'fortytwo', [], 'fortytwo', norepo=True) > def fortytwo(ui, *opts): > ui.write('42\n') > return 42 > EOF $ cat >> $HGRCPATH <<'EOF' > [extensions] > fortytwo = $TESTTMP/fortytwo.py > EOF $ hg fortytwo --pager=on paged! '42\n' [42] mercurial-4.5.3/tests/test-push-checkheads-partial-C2.t0000644015407300116100000000373513261161234022644 0ustar augieeng00000000000000==================================== Testing head checking code: Case C-2 ==================================== Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This case is part of a series of tests checking this behavior. Category C: case were the branch is only partially obsoleted TestCase 2: 2 changeset branch, only the base is rewritten .. old-state: .. .. * 2 changeset branch .. .. new-state: .. .. * 1 new changesets branches superceeding only the base of the old one .. * The old branch is still alive (base is obsolete, head is alive) .. .. expected-result: .. .. * push denied .. .. graph-summary: .. .. B ○ .. | .. A ø⇠◔ A' .. |/ .. ◠$ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir C2 $ cd C2 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd server $ mkcommit B0 $ cd ../client $ hg pull pulling from $TESTTMP/C2/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets d73caddc5533 (run 'hg update' to get a working copy) $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit A1 created new head $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` obsoleted 1 changesets 1 new orphan changesets $ hg log -G --hidden @ f6082bc4ffef (draft): A1 | | * d73caddc5533 (draft): B0 | | | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): root Actual testing -------------- $ hg push --rev 'desc(A1)' pushing to $TESTTMP/C2/server searching for changes abort: push creates new remote head f6082bc4ffef! (merge or see 'hg help push' for details about pushing new heads) [255] $ cd ../.. mercurial-4.5.3/tests/test-convert-hg-svn.t0000644015407300116100000000640613261161234020567 0ustar augieeng00000000000000#require svn svn-bindings $ filter_svn_output () { > egrep -v 'Committing|Updating|(^$)' | sed -e 's/done$//' || true > } $ cat <> $HGRCPATH > [extensions] > convert = > mq = > EOF $ SVNREPOPATH=`pwd`/svn-repo #if windows $ SVNREPOURL=file:///`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` #else $ SVNREPOURL=file://`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` #endif $ svnadmin create "$SVNREPOPATH" $ cat > "$SVNREPOPATH"/hooks/pre-revprop-change < #!/bin/sh > > REPOS="$1" > REV="$2" > USER="$3" > PROPNAME="$4" > ACTION="$5" > > if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi > > echo "Changing prohibited revision property" >&2 > exit 1 > EOF $ chmod +x "$SVNREPOPATH"/hooks/pre-revprop-change $ svn co "$SVNREPOURL" "$SVNREPOPATH"-wc Checked out revision 0. $ cd "$SVNREPOPATH"-wc $ echo a > a $ svn add a A a $ svn ci -m'added a' a | filter_svn_output Adding a Transmitting file data . Committed revision 1. $ cd .. initial roundtrip $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg | grep -v initializing scanning source... sorting... converting... 0 added a $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc scanning source... sorting... converting... second roundtrip should do nothing $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg scanning source... sorting... converting... $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc scanning source... sorting... converting... new hg rev $ hg clone "$SVNREPOPATH"-hg "$SVNREPOPATH"-work updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd "$SVNREPOPATH"-work $ echo b > b $ hg add b $ hg ci -mb adding an empty revision $ hg qnew -m emtpy empty $ hg qfinish -a $ cd .. echo hg to svn $ hg --cwd "$SVNREPOPATH"-hg pull -q "$SVNREPOPATH"-work $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc scanning source... sorting... converting... 1 b 0 emtpy svn back to hg should do nothing $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg scanning source... sorting... converting... hg back to svn should do nothing $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc scanning source... sorting... converting... verify which shamap format we are storing and must be able to handle $ cat svn-repo-hg/.hg/shamap svn:????????-????-????-????-????????????@1 ???????????????????????????????????????? (glob) svn:????????-????-????-????-????????????@2 ???????????????????????????????????????? (glob) svn:????????-????-????-????-????????????@2 ???????????????????????????????????????? (glob) $ cat svn-repo-wc/.svn/hg-shamap ???????????????????????????????????????? 1 (glob) ???????????????????????????????????????? svn:????????-????-????-????-????????????@2 (glob) ???????????????????????????????????????? svn:????????-????-????-????-????????????@2 (glob) mercurial-4.5.3/tests/test-mq-qsave.t0000644015407300116100000000035713261161234017440 0ustar augieeng00000000000000 $ echo "[extensions]" >> $HGRCPATH $ echo "mq=" >> $HGRCPATH $ hg init $ echo 'base' > base $ hg ci -Ambase adding base $ hg qnew -mmqbase mqbase $ hg qsave $ hg qrestore 2 restoring status: hg patches saved state mercurial-4.5.3/tests/test-websub.t0000644015407300116100000000157513261161234017200 0ustar augieeng00000000000000#require serve $ hg init test $ cd test $ cat > .hg/hgrc < [extensions] > # this is only necessary to check that the mapping from > # interhg to websub works > interhg = > > [websub] > issues = s|Issue(\d+)|Issue\1| > > [interhg] > # check that we maintain some interhg backwards compatibility... > # yes, 'x' is a weird delimiter... > markbugs = sxbugxbugx > EOF $ touch foo $ hg add foo $ hg commit -d '1 0' -m 'Issue123: fixed the bug!' $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS log $ get-with-headers.py localhost:$HGPORT "rev/tip" | grep bts
    Issue123: fixed the bug!
    errors $ cat errors.log $ cd .. mercurial-4.5.3/tests/test-setdiscovery.t0000644015407300116100000004001413261161234020423 0ustar augieeng00000000000000 Function to test discovery between two repos in both directions, using both the local shortcut (which is currently not activated by default) and the full remotable protocol: $ testdesc() { # revs_a, revs_b, dagdesc > if [ -d foo ]; then rm -rf foo; fi > hg init foo > cd foo > hg debugbuilddag "$3" > hg clone . a $1 --quiet > hg clone . b $2 --quiet > echo > echo "% -- a -> b tree" > hg -R a debugdiscovery b --verbose --old > echo > echo "% -- a -> b set" > hg -R a debugdiscovery b --verbose --debug --config progress.debug=true > echo > echo "% -- a -> b set (tip only)" > hg -R a debugdiscovery b --verbose --debug --config progress.debug=true --rev tip > echo > echo "% -- b -> a tree" > hg -R b debugdiscovery a --verbose --old > echo > echo "% -- b -> a set" > hg -R b debugdiscovery a --verbose --debug --config progress.debug=true > echo > echo "% -- b -> a set (tip only)" > hg -R b debugdiscovery a --verbose --debug --config progress.debug=true --rev tip > cd .. > } Small superset: $ testdesc '-ra1 -ra2' '-rb1 -rb2 -rb3' ' > +2:f +1:a1:b1 > +5 :b2 > b tree comparing with b searching for changes unpruned common: 01241442b3c2 66f7d451a68b b5714e113bc0 common heads: 01241442b3c2 b5714e113bc0 local is subset % -- a -> b set comparing with b query 1; heads searching for changes all local heads known remotely common heads: 01241442b3c2 b5714e113bc0 local is subset % -- a -> b set (tip only) comparing with b query 1; heads searching for changes all local heads known remotely common heads: b5714e113bc0 % -- b -> a tree comparing with a searching for changes unpruned common: 01241442b3c2 b5714e113bc0 common heads: 01241442b3c2 b5714e113bc0 remote is subset % -- b -> a set comparing with a query 1; heads searching for changes all remote heads known locally common heads: 01241442b3c2 b5714e113bc0 remote is subset % -- b -> a set (tip only) comparing with a query 1; heads searching for changes all remote heads known locally common heads: 01241442b3c2 b5714e113bc0 remote is subset Many new: $ testdesc '-ra1 -ra2' '-rb' ' > +2:f +3:a1 +3:b > b tree comparing with b searching for changes unpruned common: bebd167eb94d common heads: bebd167eb94d % -- a -> b set comparing with b query 1; heads searching for changes taking initial sample searching: 2 queries query 2; still undecided: 29, sample size is: 29 2 total queries in *.????s (glob) common heads: bebd167eb94d % -- a -> b set (tip only) comparing with b query 1; heads searching for changes taking quick initial sample searching: 2 queries query 2; still undecided: 31, sample size is: 31 2 total queries in *.????s (glob) common heads: 66f7d451a68b % -- b -> a tree comparing with a searching for changes unpruned common: 66f7d451a68b bebd167eb94d common heads: bebd167eb94d % -- b -> a set comparing with a query 1; heads searching for changes taking initial sample searching: 2 queries query 2; still undecided: 2, sample size is: 2 2 total queries in *.????s (glob) common heads: bebd167eb94d % -- b -> a set (tip only) comparing with a query 1; heads searching for changes taking initial sample searching: 2 queries query 2; still undecided: 2, sample size is: 2 2 total queries in *.????s (glob) common heads: bebd167eb94d Both sides many new with stub: $ testdesc '-ra1 -ra2' '-rb' ' > +2:f +2:a1 +30 :b > b tree comparing with b searching for changes unpruned common: 2dc09a01254d common heads: 2dc09a01254d % -- a -> b set comparing with b query 1; heads searching for changes taking initial sample searching: 2 queries query 2; still undecided: 29, sample size is: 29 2 total queries in *.????s (glob) common heads: 2dc09a01254d % -- a -> b set (tip only) comparing with b query 1; heads searching for changes taking quick initial sample searching: 2 queries query 2; still undecided: 31, sample size is: 31 2 total queries in *.????s (glob) common heads: 66f7d451a68b % -- b -> a tree comparing with a searching for changes unpruned common: 2dc09a01254d 66f7d451a68b common heads: 2dc09a01254d % -- b -> a set comparing with a query 1; heads searching for changes taking initial sample searching: 2 queries query 2; still undecided: 29, sample size is: 29 2 total queries in *.????s (glob) common heads: 2dc09a01254d % -- b -> a set (tip only) comparing with a query 1; heads searching for changes taking initial sample searching: 2 queries query 2; still undecided: 29, sample size is: 29 2 total queries in *.????s (glob) common heads: 2dc09a01254d Both many new: $ testdesc '-ra' '-rb' ' > +2:f +30 :b > b tree comparing with b searching for changes unpruned common: 66f7d451a68b common heads: 66f7d451a68b % -- a -> b set comparing with b query 1; heads searching for changes taking quick initial sample searching: 2 queries query 2; still undecided: 31, sample size is: 31 2 total queries in *.????s (glob) common heads: 66f7d451a68b % -- a -> b set (tip only) comparing with b query 1; heads searching for changes taking quick initial sample searching: 2 queries query 2; still undecided: 31, sample size is: 31 2 total queries in *.????s (glob) common heads: 66f7d451a68b % -- b -> a tree comparing with a searching for changes unpruned common: 66f7d451a68b common heads: 66f7d451a68b % -- b -> a set comparing with a query 1; heads searching for changes taking quick initial sample searching: 2 queries query 2; still undecided: 31, sample size is: 31 2 total queries in *.????s (glob) common heads: 66f7d451a68b % -- b -> a set (tip only) comparing with a query 1; heads searching for changes taking quick initial sample searching: 2 queries query 2; still undecided: 31, sample size is: 31 2 total queries in *.????s (glob) common heads: 66f7d451a68b Both many new skewed: $ testdesc '-ra' '-rb' ' > +2:f +30 :b > b tree comparing with b searching for changes unpruned common: 66f7d451a68b common heads: 66f7d451a68b % -- a -> b set comparing with b query 1; heads searching for changes taking quick initial sample searching: 2 queries query 2; still undecided: 51, sample size is: 51 2 total queries in *.????s (glob) common heads: 66f7d451a68b % -- a -> b set (tip only) comparing with b query 1; heads searching for changes taking quick initial sample searching: 2 queries query 2; still undecided: 51, sample size is: 51 2 total queries in *.????s (glob) common heads: 66f7d451a68b % -- b -> a tree comparing with a searching for changes unpruned common: 66f7d451a68b common heads: 66f7d451a68b % -- b -> a set comparing with a query 1; heads searching for changes taking quick initial sample searching: 2 queries query 2; still undecided: 31, sample size is: 31 2 total queries in *.????s (glob) common heads: 66f7d451a68b % -- b -> a set (tip only) comparing with a query 1; heads searching for changes taking quick initial sample searching: 2 queries query 2; still undecided: 31, sample size is: 31 2 total queries in *.????s (glob) common heads: 66f7d451a68b Both many new on top of long history: $ testdesc '-ra' '-rb' ' > +1000:f +30 :b > b tree comparing with b searching for changes unpruned common: 7ead0cba2838 common heads: 7ead0cba2838 % -- a -> b set comparing with b query 1; heads searching for changes taking quick initial sample searching: 2 queries query 2; still undecided: 1049, sample size is: 11 sampling from both directions searching: 3 queries query 3; still undecided: 31, sample size is: 31 3 total queries in *.????s (glob) common heads: 7ead0cba2838 % -- a -> b set (tip only) comparing with b query 1; heads searching for changes taking quick initial sample searching: 2 queries query 2; still undecided: 1049, sample size is: 11 sampling from both directions searching: 3 queries query 3; still undecided: 31, sample size is: 31 3 total queries in *.????s (glob) common heads: 7ead0cba2838 % -- b -> a tree comparing with a searching for changes unpruned common: 7ead0cba2838 common heads: 7ead0cba2838 % -- b -> a set comparing with a query 1; heads searching for changes taking quick initial sample searching: 2 queries query 2; still undecided: 1029, sample size is: 11 sampling from both directions searching: 3 queries query 3; still undecided: 15, sample size is: 15 3 total queries in *.????s (glob) common heads: 7ead0cba2838 % -- b -> a set (tip only) comparing with a query 1; heads searching for changes taking quick initial sample searching: 2 queries query 2; still undecided: 1029, sample size is: 11 sampling from both directions searching: 3 queries query 3; still undecided: 15, sample size is: 15 3 total queries in *.????s (glob) common heads: 7ead0cba2838 One with >200 heads, which used to use up all of the sample: $ hg init manyheads $ cd manyheads $ echo "+300:r @a" >dagdesc $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads $ echo "@b *r+3" >>dagdesc # one more head $ hg debugbuilddag > $DAEMON_PIDS $ hg -R b incoming http://localhost:$HGPORT/ -T '{node|short}\n' comparing with http://localhost:$HGPORT/ searching for changes e64a39e7da8b $ killdaemons.py $ cut -d' ' -f6- access.log | grep -v cmd=known # cmd=known uses random sampling "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D513314ca8b3ae4dac8eec56966265b00fcf866db x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:$USUAL_BUNDLE_CAPS$&cg=1&common=513314ca8b3ae4dac8eec56966265b00fcf866db&heads=e64a39e7da8b0d54bc63e81169aff001c13b3477 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ $ cat errors.log $ cd .. Issue 4438 - test coverage for 3ef893520a85 issues. $ mkdir issue4438 $ cd issue4438 #if false generate new bundles: $ hg init r1 $ for i in `$PYTHON $TESTDIR/seq.py 101`; do hg -R r1 up -qr null && hg -R r1 branch -q b$i && hg -R r1 ci -qmb$i; done $ hg clone -q r1 r2 $ for i in `$PYTHON $TESTDIR/seq.py 10`; do hg -R r1 up -qr null && hg -R r1 branch -q c$i && hg -R r1 ci -qmc$i; done $ hg -R r2 branch -q r2change && hg -R r2 ci -qmr2change $ hg -R r1 bundle -qa $TESTDIR/bundles/issue4438-r1.hg $ hg -R r2 bundle -qa $TESTDIR/bundles/issue4438-r2.hg #else use existing bundles: $ hg clone -q $TESTDIR/bundles/issue4438-r1.hg r1 $ hg clone -q $TESTDIR/bundles/issue4438-r2.hg r2 #endif Set iteration order could cause wrong and unstable results - fixed in 73cfaa348650: $ hg -R r1 outgoing r2 -T'{rev} ' comparing with r2 searching for changes 101 102 103 104 105 106 107 108 109 110 (no-eol) The case where all the 'initialsamplesize' samples already were common would give 'all remote heads known locally' without checking the remaining heads - fixed in 86c35b7ae300: $ cat >> $TESTTMP/unrandomsample.py << EOF > import random > def sample(population, k): > return sorted(population)[:k] > random.sample = sample > EOF $ cat >> r1/.hg/hgrc << EOF > [extensions] > unrandomsample = $TESTTMP/unrandomsample.py > EOF $ hg -R r1 outgoing r2 -T'{rev} ' --config extensions.blackbox= comparing with r2 searching for changes 101 102 103 104 105 106 107 108 109 110 (no-eol) $ hg -R r1 --config extensions.blackbox= blackbox * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> serve --cmdserver chgunix * (glob) (chg !) * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> -R r1 outgoing r2 *-T{rev} * --config *extensions.blackbox=* (glob) * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> found 101 common and 1 unknown server heads, 2 roundtrips in *.????s (glob) * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> -R r1 outgoing r2 *-T{rev} * --config *extensions.blackbox=* exited 0 after *.?? seconds (glob) * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> -R r1 --config *extensions.blackbox=* blackbox (glob) $ cd .. mercurial-4.5.3/tests/flagprocessorext.py0000644015407300116100000001027313261161234020506 0ustar augieeng00000000000000# coding=UTF-8 from __future__ import absolute_import import base64 import zlib from mercurial import ( changegroup, exchange, extensions, filelog, revlog, util, ) # Test only: These flags are defined here only in the context of testing the # behavior of the flag processor. The canonical way to add flags is to get in # touch with the community and make them known in revlog. REVIDX_NOOP = (1 << 3) REVIDX_BASE64 = (1 << 2) REVIDX_GZIP = (1 << 1) REVIDX_FAIL = 1 def validatehash(self, text): return True def bypass(self, text): return False def noopdonothing(self, text): return (text, True) def b64encode(self, text): return (base64.b64encode(text), False) def b64decode(self, text): return (base64.b64decode(text), True) def gzipcompress(self, text): return (zlib.compress(text), False) def gzipdecompress(self, text): return (zlib.decompress(text), True) def supportedoutgoingversions(orig, repo): versions = orig(repo) versions.discard('01') versions.discard('02') versions.add('03') return versions def allsupportedversions(orig, ui): versions = orig(ui) versions.add('03') return versions def noopaddrevision(orig, self, text, transaction, link, p1, p2, cachedelta=None, node=None, flags=revlog.REVIDX_DEFAULT_FLAGS): if b'[NOOP]' in text: flags |= REVIDX_NOOP return orig(self, text, transaction, link, p1, p2, cachedelta=cachedelta, node=node, flags=flags) def b64addrevision(orig, self, text, transaction, link, p1, p2, cachedelta=None, node=None, flags=revlog.REVIDX_DEFAULT_FLAGS): if b'[BASE64]' in text: flags |= REVIDX_BASE64 return orig(self, text, transaction, link, p1, p2, cachedelta=cachedelta, node=node, flags=flags) def gzipaddrevision(orig, self, text, transaction, link, p1, p2, cachedelta=None, node=None, flags=revlog.REVIDX_DEFAULT_FLAGS): if b'[GZIP]' in text: flags |= REVIDX_GZIP return orig(self, text, transaction, link, p1, p2, cachedelta=cachedelta, node=node, flags=flags) def failaddrevision(orig, self, text, transaction, link, p1, p2, cachedelta=None, node=None, flags=revlog.REVIDX_DEFAULT_FLAGS): # This addrevision wrapper is meant to add a flag we will not have # transforms registered for, ensuring we handle this error case. if b'[FAIL]' in text: flags |= REVIDX_FAIL return orig(self, text, transaction, link, p1, p2, cachedelta=cachedelta, node=node, flags=flags) def extsetup(ui): # Enable changegroup3 for flags to be sent over the wire wrapfunction = extensions.wrapfunction wrapfunction(changegroup, 'supportedoutgoingversions', supportedoutgoingversions) wrapfunction(changegroup, 'allsupportedversions', allsupportedversions) # Teach revlog about our test flags flags = [REVIDX_NOOP, REVIDX_BASE64, REVIDX_GZIP, REVIDX_FAIL] revlog.REVIDX_KNOWN_FLAGS |= util.bitsfrom(flags) revlog.REVIDX_FLAGS_ORDER.extend(flags) # Teach exchange to use changegroup 3 for k in exchange._bundlespeccgversions.keys(): exchange._bundlespeccgversions[k] = '03' # Add wrappers for addrevision, responsible to set flags depending on the # revision data contents. wrapfunction(filelog.filelog, 'addrevision', noopaddrevision) wrapfunction(filelog.filelog, 'addrevision', b64addrevision) wrapfunction(filelog.filelog, 'addrevision', gzipaddrevision) wrapfunction(filelog.filelog, 'addrevision', failaddrevision) # Register flag processors for each extension revlog.addflagprocessor( REVIDX_NOOP, ( noopdonothing, noopdonothing, validatehash, ) ) revlog.addflagprocessor( REVIDX_BASE64, ( b64decode, b64encode, bypass, ), ) revlog.addflagprocessor( REVIDX_GZIP, ( gzipdecompress, gzipcompress, bypass ) ) mercurial-4.5.3/tests/test-exchange-obsmarkers-case-B1.t0000644015407300116100000000474613261161234023015 0ustar augieeng00000000000000============================================ Testing obsolescence markers push: Cases B.1 ============================================ Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of all changesets that requested to be "in sync" after the push (even if they are already on both side). This test belongs to a series of tests checking such set is properly computed and applied. This does not tests "obsmarkers" discovery capabilities. Category B: pruning case TestCase 1: Prune on non-targeted common changeset B.1 Prune on non-targeted common changeset ========================================== .. {{{ .. ⊗ B .. | .. ◕ A .. | .. ◠O .. }}} .. .. Marker exist from: .. .. * B (prune) .. .. Command runs: .. .. * hg push -r O .. .. Expected exclude: .. .. * B (prune) Setup ----- $ . $TESTDIR/testlib/exchange-obsmarker-util.sh Initial $ setuprepos B.1 creating test repo for test case B.1 - pulldest - main - pushdest cd into `main` and proceed with env setup $ cd main $ mkcommit A $ mkcommit B make both changeset known in remote $ hg push -qf ../pushdest $ hg push -qf ../pulldest create prune marker $ hg prune -qd '0 0' . $ hg log -G --hidden x f6fbb35d8ac9 (draft): B | @ f5bc6836db60 (draft): A | o a9bdc8b26820 (public): O $ inspect_obsmarkers obsstore content ================ f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ cd .. $ cd .. Actual Test ----------- $ dotest B.1 O ## Running testcase B.1 # testing echange of "O" (a9bdc8b26820) ## initial state # obstore: main f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest ## pushing "O" from main to pushdest pushing to pushdest searching for changes no changes found ## post push state # obstore: main f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest ## pulling "a9bdc8b26820" from main into pulldest pulling from main no changes found ## post pull state # obstore: main f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest mercurial-4.5.3/tests/test-rebase-templates.t0000644015407300116100000000260213261161234021136 0ustar augieeng00000000000000Testing templating for rebase command Setup $ cat >> $HGRCPATH < [extensions] > rebase= > [experimental] > evolution=createmarkers > EOF $ hg init repo $ cd repo $ for ch in a b c d; do echo foo > $ch; hg commit -Aqm "Added "$ch; done $ hg log -G -T "{rev}:{node|short} {desc}" @ 3:62615734edd5 Added d | o 2:28ad74487de9 Added c | o 1:29becc82797a Added b | o 0:18d04c59bb5d Added a Getting the JSON output for nodechanges $ hg rebase -s 2 -d 0 -q -Tjson [ { "nodechanges": {"28ad74487de9599d00d81085be739c61fc340652": ["849767420fd5519cf0026232411a943ed03cc9fb"], "62615734edd52f06b6fb9c2beb429e4fe30d57b8": ["df21b32134ba85d86bca590cbe9b8b7cbc346c53"]} } ] $ hg log -G -T "{rev}:{node|short} {desc}" @ 5:df21b32134ba Added d | o 4:849767420fd5 Added c | | o 1:29becc82797a Added b |/ o 0:18d04c59bb5d Added a $ hg rebase -s 1 -d 5 -q -T "{nodechanges|json}" {"29becc82797a4bc11ec8880b58eaecd2ab3e7760": ["d9d6773efc831c274eace04bc13e8e6412517139"]} (no-eol) $ hg log -G -T "{rev}:{node|short} {desc}" o 6:d9d6773efc83 Added b | @ 5:df21b32134ba Added d | o 4:849767420fd5 Added c | o 0:18d04c59bb5d Added a $ hg rebase -s 6 -d 4 -q -T "{nodechanges % '{oldnode}:{newnodes % ' {node} '}'}" d9d6773efc831c274eace04bc13e8e6412517139: f48cd65c6dc3d2acb55da54402a5b029546e546f (no-eol) mercurial-4.5.3/tests/test-extra-filelog-entry.t0000644015407300116100000000070013261161234021577 0ustar augieeng00000000000000Issue351: mq: qrefresh can create extra revlog entry $ echo "[extensions]" >> $HGRCPATH $ echo "mq=" >> $HGRCPATH $ hg init $ hg qinit $ echo b > b $ hg ci -A -m foo adding b $ echo cc > b $ hg qnew -f foo.diff $ echo b > b $ hg qrefresh $ hg debugindex b rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 3 ..... 0 1e88685f5dde 000000000000 000000000000 (re) mercurial-4.5.3/tests/test-push-checkheads-unpushed-D6.t0000644015407300116100000000373613261161234023051 0ustar augieeng00000000000000==================================== Testing head checking code: Case D-6 ==================================== Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This case is part of a series of tests checking this behavior. Category D: remote head is "obs-affected" locally, but result is not part of the push TestCase 6: single changeset, superseeded then pruned (on a new changeset unpushed) changeset This is a partial push variation of case B-6 .. old-state: .. .. * 1 changeset branch .. .. new-state: .. .. * old branch is rewritten onto another one, .. * the new version is then pruned. .. .. expected-result: .. .. * push denied .. .. graph-summary: .. .. A ø⇠⊗ A' .. | | .. C ◔ | ○ B .. \|/ .. ◠$ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir D6 $ cd D6 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd client $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit B0 created new head $ mkcommit A1 $ hg up '0' 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ mkcommit C0 created new head $ hg debugobsolete `getid "desc(A0)"` `getid "desc(A1)"` obsoleted 1 changesets $ hg debugobsolete --record-parents `getid "desc(A1)"` obsoleted 1 changesets $ hg log -G --hidden @ 0f88766e02d6 (draft): C0 | | x ba93660aff8d (draft): A1 | | | o 74ff5441d343 (draft): B0 |/ | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): root Actual testing -------------- $ hg push --rev 'desc(C0)' pushing to $TESTTMP/D6/server searching for changes abort: push creates new remote head 0f88766e02d6! (merge or see 'hg help push' for details about pushing new heads) [255] $ cd ../.. mercurial-4.5.3/tests/test-issue1175.t0000644015407300116100000000412513261161234017351 0ustar augieeng00000000000000https://bz.mercurial-scm.org/1175 $ hg init $ touch a $ hg ci -Am0 adding a $ hg mv a a1 $ hg ci -m1 $ hg co 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg mv a a2 $ hg up note: possible conflict - a was renamed multiple times to: a2 a1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg ci -m2 $ touch a $ hg ci -Am3 adding a $ hg mv a b $ hg ci -Am4 a $ hg ci --debug --traceback -Am5 b committing files: b warning: can't find ancestor for 'b' copied from 'a'! committing manifest committing changelog updating the branch cache committed changeset 5:83a687e8a97c80992ba385bbfd766be181bfb1d1 $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 4 files, 6 changesets, 4 total revisions $ hg export --git tip # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 83a687e8a97c80992ba385bbfd766be181bfb1d1 # Parent 1d1625283f71954f21d14c3d44d0ad3c019c597f 5 diff --git a/b b/b new file mode 100644 https://bz.mercurial-scm.org/show_bug.cgi?id=4476 $ hg init foo $ cd foo $ touch a && hg ci -Aqm a $ hg mv a b $ echo b1 >> b $ hg ci -Aqm b1 $ hg up 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg mv a b $ echo b2 >> b $ hg ci -Aqm b2 $ hg graft 1 grafting 1:5974126fad84 "b1" merging b warning: conflicts while merging b! (edit, then use 'hg resolve --mark') abort: unresolved conflicts, can't continue (use 'hg resolve' and 'hg graft --continue') [255] $ echo a > b $ echo b3 >> b $ hg resolve --mark b (no more unresolved files) continue: hg graft --continue $ hg graft --continue grafting 1:5974126fad84 "b1" warning: can't find ancestor for 'b' copied from 'a'! $ hg log -f b -T 'changeset: {rev}:{node|short}\nsummary: {desc}\n\n' changeset: 3:376d30ccffc0 summary: b1 changeset: 2:416baaa2e5e4 summary: b2 changeset: 0:3903775176ed summary: a mercurial-4.5.3/tests/test-check-config.t0000644015407300116100000000275713261161234020234 0ustar augieeng00000000000000#require test-repo $ . "$TESTDIR/helpers-testrepo.sh" Sanity check check-config.py $ cat > testfile.py << EOF > # Good > foo = ui.config('ui', 'username') > # Missing > foo = ui.config('ui', 'doesnotexist') > # Missing different type > foo = ui.configint('ui', 'missingint') > # Missing with default value > foo = ui.configbool('ui', 'missingbool1', default=True) > foo = ui.configbool('ui', 'missingbool2', False) > # Inconsistent values for defaults. > foo = ui.configint('ui', 'intdefault', default=1) > foo = ui.configint('ui', 'intdefault', default=42) > # Can suppress inconsistent value error > foo = ui.configint('ui', 'intdefault2', default=1) > # inconsistent config: ui.intdefault2 > foo = ui.configint('ui', 'intdefault2', default=42) > EOF $ cat > files << EOF > mercurial/help/config.txt > $TESTTMP/testfile.py > EOF $ cd "$TESTDIR"/.. $ $PYTHON contrib/check-config.py < $TESTTMP/files foo = ui.configint('ui', 'intdefault', default=42) conflict on ui.intdefault: ('int', '42') != ('int', '1') at $TESTTMP/testfile.py:12: undocumented: ui.doesnotexist (str) undocumented: ui.intdefault (int) [42] undocumented: ui.intdefault2 (int) [42] undocumented: ui.missingbool1 (bool) [True] undocumented: ui.missingbool2 (bool) undocumented: ui.missingint (int) New errors are not allowed. Warnings are strongly discouraged. $ testrepohg files "set:(**.py or **.txt) - tests/**" | sed 's|\\|/|g' | > $PYTHON contrib/check-config.py mercurial-4.5.3/tests/test-bisect3.t0000644015407300116100000001404213261161234017236 0ustar augieeng00000000000000# Here we create a simple DAG which has just enough of the required # topology to test all the bisection status labels: # # 13--14 # / # 0--1--2--3---------9--10--11--12 # \ / # 4--5--6--7--8 $ hg init $ echo '0' >a $ hg add a $ hg ci -u test -d '0 0' -m '0' $ echo '1' >a $ hg ci -u test -d '1 0' -m '1' branch 2-3 $ echo '2' >b $ hg add b $ hg ci -u test -d '2 0' -m '2' $ echo '3' >b $ hg ci -u test -d '3 0' -m '3' branch 4-8 $ hg up -r 1 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo '4' >c $ hg add c $ hg ci -u test -d '4 0' -m '4' created new head $ echo '5' >c $ hg ci -u test -d '5 0' -m '5' $ echo '6' >c $ hg ci -u test -d '6 0' -m '6' $ echo '7' >c $ hg ci -u test -d '7 0' -m '7' $ echo '8' >c $ hg ci -u test -d '8 0' -m '8' merge $ hg merge -r 3 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -u test -d '9 0' -m '9=8+3' $ echo '10' >a $ hg ci -u test -d '10 0' -m '10' $ echo '11' >a $ hg ci -u test -d '11 0' -m '11' $ echo '12' >a $ hg ci -u test -d '12 0' -m '12' unrelated branch $ hg up -r 3 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo '13' >d $ hg add d $ hg ci -u test -d '13 0' -m '13' created new head $ echo '14' >d $ hg ci -u test -d '14 0' -m '14' mark changesets $ hg bisect --reset $ hg bisect --good 4 $ hg bisect --good 6 $ hg bisect --bad 12 Testing changeset 9:2197c557e14c (6 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg bisect --bad 10 Testing changeset 8:e74a86251f58 (4 changesets remaining, ~2 tests) 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg bisect --skip 7 Testing changeset 8:e74a86251f58 (4 changesets remaining, ~2 tests) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved test template $ hg log --template '{rev}:{node|short} {bisect}\n' 14:cbf2f3105bbf 13:e07efca37c43 12:98c6b56349c0 bad 11:03f491376e63 bad (implicit) 10:c012b15e2409 bad 9:2197c557e14c untested 8:e74a86251f58 untested 7:a5f87041c899 skipped 6:7d997bedcd8d good 5:2dd1875f1028 good (implicit) 4:2a1daef14cd4 good 3:8417d459b90c ignored 2:e1355ee1f23e ignored 1:ce7c85e06a9f good (implicit) 0:b4e73ffab476 good (implicit) $ hg log --template '{bisect|shortbisect} {rev}:{node|short}\n' 14:cbf2f3105bbf 13:e07efca37c43 B 12:98c6b56349c0 B 11:03f491376e63 B 10:c012b15e2409 U 9:2197c557e14c U 8:e74a86251f58 S 7:a5f87041c899 G 6:7d997bedcd8d G 5:2dd1875f1028 G 4:2a1daef14cd4 I 3:8417d459b90c I 2:e1355ee1f23e G 1:ce7c85e06a9f G 0:b4e73ffab476 test style $ hg log --style bisect changeset: 14:cbf2f3105bbf bisect: tag: tip user: test date: Thu Jan 01 00:00:14 1970 +0000 summary: 14 changeset: 13:e07efca37c43 bisect: parent: 3:8417d459b90c user: test date: Thu Jan 01 00:00:13 1970 +0000 summary: 13 changeset: 12:98c6b56349c0 bisect: bad user: test date: Thu Jan 01 00:00:12 1970 +0000 summary: 12 changeset: 11:03f491376e63 bisect: bad (implicit) user: test date: Thu Jan 01 00:00:11 1970 +0000 summary: 11 changeset: 10:c012b15e2409 bisect: bad user: test date: Thu Jan 01 00:00:10 1970 +0000 summary: 10 changeset: 9:2197c557e14c bisect: untested parent: 8:e74a86251f58 parent: 3:8417d459b90c user: test date: Thu Jan 01 00:00:09 1970 +0000 summary: 9=8+3 changeset: 8:e74a86251f58 bisect: untested user: test date: Thu Jan 01 00:00:08 1970 +0000 summary: 8 changeset: 7:a5f87041c899 bisect: skipped user: test date: Thu Jan 01 00:00:07 1970 +0000 summary: 7 changeset: 6:7d997bedcd8d bisect: good user: test date: Thu Jan 01 00:00:06 1970 +0000 summary: 6 changeset: 5:2dd1875f1028 bisect: good (implicit) user: test date: Thu Jan 01 00:00:05 1970 +0000 summary: 5 changeset: 4:2a1daef14cd4 bisect: good parent: 1:ce7c85e06a9f user: test date: Thu Jan 01 00:00:04 1970 +0000 summary: 4 changeset: 3:8417d459b90c bisect: ignored user: test date: Thu Jan 01 00:00:03 1970 +0000 summary: 3 changeset: 2:e1355ee1f23e bisect: ignored user: test date: Thu Jan 01 00:00:02 1970 +0000 summary: 2 changeset: 1:ce7c85e06a9f bisect: good (implicit) user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: 1 changeset: 0:b4e73ffab476 bisect: good (implicit) user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 0 $ hg log --quiet --style bisect 14:cbf2f3105bbf 13:e07efca37c43 B 12:98c6b56349c0 B 11:03f491376e63 B 10:c012b15e2409 U 9:2197c557e14c U 8:e74a86251f58 S 7:a5f87041c899 G 6:7d997bedcd8d G 5:2dd1875f1028 G 4:2a1daef14cd4 I 3:8417d459b90c I 2:e1355ee1f23e G 1:ce7c85e06a9f G 0:b4e73ffab476 $ hg --config extensions.color= --color=debug log --quiet --style bisect [log.bisect| ] 14:cbf2f3105bbf [log.bisect| ] 13:e07efca37c43 [log.bisect bisect.bad|B] 12:98c6b56349c0 [log.bisect bisect.bad|B] 11:03f491376e63 [log.bisect bisect.bad|B] 10:c012b15e2409 [log.bisect bisect.untested|U] 9:2197c557e14c [log.bisect bisect.untested|U] 8:e74a86251f58 [log.bisect bisect.skipped|S] 7:a5f87041c899 [log.bisect bisect.good|G] 6:7d997bedcd8d [log.bisect bisect.good|G] 5:2dd1875f1028 [log.bisect bisect.good|G] 4:2a1daef14cd4 [log.bisect bisect.ignored|I] 3:8417d459b90c [log.bisect bisect.ignored|I] 2:e1355ee1f23e [log.bisect bisect.good|G] 1:ce7c85e06a9f [log.bisect bisect.good|G] 0:b4e73ffab476 mercurial-4.5.3/tests/test-obsolete-tag-cache.t0000644015407300116100000001106713261161234021334 0ustar augieeng00000000000000 $ cat >> $HGRCPATH << EOF > [extensions] > blackbox= > rebase= > mock=$TESTDIR/mockblackbox.py > > [experimental] > evolution.createmarkers=True > EOF Create a repo with some tags $ hg init repo $ cd repo $ echo initial > foo $ hg -q commit -A -m initial $ hg tag -m 'test tag' test1 $ echo first > first $ hg -q commit -A -m first $ hg tag -m 'test2 tag' test2 $ hg -q up -r 0 $ echo newhead > newhead $ hg commit -A -m newhead adding newhead created new head $ hg tag -m 'test head 2 tag' head2 $ hg log -G -T '{rev}:{node|short} {tags} {desc}\n' @ 5:2942a772f72a tip test head 2 tag | o 4:042eb6bfcc49 head2 newhead | | o 3:c3cb30f2d2cd test2 tag | | | o 2:d75775ffbc6b test2 first | | | o 1:5f97d42da03f test tag |/ o 0:55482a6fb4b1 test1 initial Trigger tags cache population by doing something that accesses tags info $ hg tags tip 5:2942a772f72a head2 4:042eb6bfcc49 test2 2:d75775ffbc6b test1 0:55482a6fb4b1 $ cat .hg/cache/tags2-visible 5 2942a772f72a444bef4bef13874d515f50fa27b6 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1 d75775ffbc6bca1794d300f5571272879bd280da test2 Hiding a non-tip changeset should change filtered hash and cause tags recompute $ hg debugobsolete -d '0 0' c3cb30f2d2cd0aae008cc91a07876e3c5131fd22 -u dummyuser obsoleted 1 changesets $ hg tags tip 5:2942a772f72a head2 4:042eb6bfcc49 test1 0:55482a6fb4b1 $ cat .hg/cache/tags2-visible 5 2942a772f72a444bef4bef13874d515f50fa27b6 f34fbc9a9769ba9eff5aff3d008a6b49f85c08b1 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1 $ hg blackbox -l 5 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> tags 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> 2/2 cache hits/lookups in * seconds (glob) 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> writing .hg/cache/tags2-visible with 2 tags 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> tags exited 0 after * seconds (glob) 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> blackbox -l 5 Hiding another changeset should cause the filtered hash to change $ hg debugobsolete -d '0 0' d75775ffbc6bca1794d300f5571272879bd280da -u dummyuser obsoleted 1 changesets $ hg debugobsolete -d '0 0' 5f97d42da03fd56f3b228b03dfe48af5c0adf75b -u dummyuser obsoleted 1 changesets $ hg tags tip 5:2942a772f72a head2 4:042eb6bfcc49 $ cat .hg/cache/tags2-visible 5 2942a772f72a444bef4bef13874d515f50fa27b6 2fce1eec33263d08a4d04293960fc73a555230e4 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2 $ hg blackbox -l 5 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> tags 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> 1/1 cache hits/lookups in * seconds (glob) 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> writing .hg/cache/tags2-visible with 1 tags 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> tags exited 0 after * seconds (glob) 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> blackbox -l 5 Resolving tags on an unfiltered repo writes a separate tags cache $ hg --hidden tags tip 5:2942a772f72a head2 4:042eb6bfcc49 test2 2:d75775ffbc6b test1 0:55482a6fb4b1 $ cat .hg/cache/tags2 5 2942a772f72a444bef4bef13874d515f50fa27b6 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1 d75775ffbc6bca1794d300f5571272879bd280da test2 $ hg blackbox -l 5 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> --hidden tags 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> 2/2 cache hits/lookups in * seconds (glob) 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> writing .hg/cache/tags2 with 3 tags 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> --hidden tags exited 0 after * seconds (glob) 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> blackbox -l 5 mercurial-4.5.3/tests/test-check-interfaces.py0000644015407300116100000000411713261161234021267 0ustar augieeng00000000000000# Test that certain objects conform to well-defined interfaces. from __future__ import absolute_import, print_function from mercurial import ( bundlerepo, httppeer, localrepo, sshpeer, statichttprepo, ui as uimod, unionrepo, ) def checkobject(o): """Verify a constructed object conforms to interface rules. An object must have __abstractmethods__ defined. All "public" attributes of the object (attributes not prefixed with an underscore) must be in __abstractmethods__ or appear on a base class with __abstractmethods__. """ name = o.__class__.__name__ allowed = set() for cls in o.__class__.__mro__: if not getattr(cls, '__abstractmethods__', set()): continue allowed |= cls.__abstractmethods__ allowed |= {a for a in dir(cls) if not a.startswith('_')} if not allowed: print('%s does not have abstract methods' % name) return public = {a for a in dir(o) if not a.startswith('_')} for attr in sorted(public - allowed): print('public attributes not in abstract interface: %s.%s' % ( name, attr)) # Facilitates testing localpeer. class dummyrepo(object): def __init__(self): self.ui = uimod.ui() def filtered(self, name): pass def _restrictcapabilities(self, caps): pass # Facilitates testing sshpeer without requiring an SSH server. class testingsshpeer(sshpeer.sshpeer): def _validaterepo(self, *args, **kwargs): pass class badpeer(httppeer.httppeer): def __init__(self): super(badpeer, self).__init__(uimod.ui(), 'http://localhost') self.badattribute = True def badmethod(self): pass def main(): ui = uimod.ui() checkobject(badpeer()) checkobject(httppeer.httppeer(ui, 'http://localhost')) checkobject(localrepo.localpeer(dummyrepo())) checkobject(testingsshpeer(ui, 'ssh://localhost/foo')) checkobject(bundlerepo.bundlepeer(dummyrepo())) checkobject(statichttprepo.statichttppeer(dummyrepo())) checkobject(unionrepo.unionpeer(dummyrepo())) main() mercurial-4.5.3/tests/test-addremove.t0000644015407300116100000000306413261161234017652 0ustar augieeng00000000000000 $ hg init rep $ cd rep $ mkdir dir $ touch foo dir/bar $ hg -v addremove adding dir/bar adding foo $ hg -v commit -m "add 1" committing files: dir/bar foo committing manifest committing changelog committed changeset 0:6f7f953567a2 $ cd dir/ $ touch ../foo_2 bar_2 $ hg -v addremove adding dir/bar_2 adding foo_2 $ hg -v commit -m "add 2" committing files: dir/bar_2 foo_2 committing manifest committing changelog committed changeset 1:e65414bf35c5 $ cd .. $ hg forget foo $ hg -v addremove adding foo $ hg forget foo $ hg -v addremove nonexistent nonexistent: $ENOENT$ [1] $ cd .. $ hg init subdir $ cd subdir $ mkdir dir $ cd dir $ touch a.py $ hg addremove 'glob:*.py' adding a.py $ hg forget a.py $ hg addremove -I 'glob:*.py' adding a.py $ hg forget a.py $ hg addremove adding dir/a.py $ cd .. $ hg init sim $ cd sim $ echo a > a $ echo a >> a $ echo a >> a $ echo c > c $ hg commit -Ama adding a adding c $ mv a b $ rm c $ echo d > d $ hg addremove -n -s 50 # issue 1696 removing a adding b removing c adding d recording removal of a as rename to b (100% similar) $ hg addremove -s 50 removing a adding b removing c adding d recording removal of a as rename to b (100% similar) $ hg commit -mb $ cp b c $ hg forget b $ hg addremove -s 50 adding b adding c $ rm c $ hg ci -A -m "c" nonexistent nonexistent: $ENOENT$ abort: failed to mark all new/missing files as added/removed [255] $ hg st ! c $ cd .. mercurial-4.5.3/tests/test-merge-tools.t0000644015407300116100000007062413261161234020147 0ustar augieeng00000000000000test merge-tools configuration - mostly exercising filemerge.py $ unset HGMERGE # make sure HGMERGE doesn't interfere with the test $ hg init revision 0 $ echo "revision 0" > f $ echo "space" >> f $ hg commit -Am "revision 0" adding f revision 1 $ echo "revision 1" > f $ echo "space" >> f $ hg commit -Am "revision 1" $ hg update 0 > /dev/null revision 2 $ echo "revision 2" > f $ echo "space" >> f $ hg commit -Am "revision 2" created new head $ hg update 0 > /dev/null revision 3 - simple to merge $ echo "revision 3" >> f $ hg commit -Am "revision 3" created new head revision 4 - hard to merge $ hg update 0 > /dev/null $ echo "revision 4" > f $ hg commit -Am "revision 4" created new head $ echo "[merge-tools]" > .hg/hgrc $ beforemerge() { > cat .hg/hgrc > echo "# hg update -C 1" > hg update -C 1 > /dev/null > } $ aftermerge() { > echo "# cat f" > cat f > echo "# hg stat" > hg stat > echo "# hg resolve --list" > hg resolve --list > rm -f f.orig > } Tool selection default is internal merge: $ beforemerge [merge-tools] # hg update -C 1 hg merge -r 2 override $PATH to ensure hgmerge not visible; use $PYTHON in case we're running from a devel copy, not a temp installation $ PATH="$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2 merging f warning: conflicts while merging f! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f <<<<<<< working copy: ef83787e2614 - test: revision 1 revision 1 ======= revision 2 >>>>>>> merge rev: 0185f4e0cf02 - test: revision 2 space # hg stat M f ? f.orig # hg resolve --list U f simplest hgrc using false for merge: $ echo "false.whatever=" >> .hg/hgrc $ beforemerge [merge-tools] false.whatever= # hg update -C 1 $ hg merge -r 2 merging f merging f failed! 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.orig # hg resolve --list U f #if unix-permissions unexecutable file in $PATH shouldn't be found: $ echo "echo fail" > false $ hg up -qC 1 $ PATH="`pwd`:$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2 merging f warning: conflicts while merging f! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ rm false #endif executable directory in $PATH shouldn't be found: $ mkdir false $ hg up -qC 1 $ PATH="`pwd`:$BINDIR:/usr/sbin" $PYTHON "$BINDIR"/hg merge -r 2 merging f warning: conflicts while merging f! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ rmdir false true with higher .priority gets precedence: $ echo "true.priority=1" >> .hg/hgrc $ beforemerge [merge-tools] false.whatever= true.priority=1 # hg update -C 1 $ hg merge -r 2 merging f 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ aftermerge # cat f revision 1 space # hg stat M f # hg resolve --list R f unless lowered on command line: $ beforemerge [merge-tools] false.whatever= true.priority=1 # hg update -C 1 $ hg merge -r 2 --config merge-tools.true.priority=-7 merging f merging f failed! 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.orig # hg resolve --list U f or false set higher on command line: $ beforemerge [merge-tools] false.whatever= true.priority=1 # hg update -C 1 $ hg merge -r 2 --config merge-tools.false.priority=117 merging f merging f failed! 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.orig # hg resolve --list U f or true set to disabled: $ beforemerge [merge-tools] false.whatever= true.priority=1 # hg update -C 1 $ hg merge -r 2 --config merge-tools.true.disabled=yes merging f merging f failed! 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.orig # hg resolve --list U f or true.executable not found in PATH: $ beforemerge [merge-tools] false.whatever= true.priority=1 # hg update -C 1 $ hg merge -r 2 --config merge-tools.true.executable=nonexistentmergetool merging f merging f failed! 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.orig # hg resolve --list U f or true.executable with bogus path: $ beforemerge [merge-tools] false.whatever= true.priority=1 # hg update -C 1 $ hg merge -r 2 --config merge-tools.true.executable=/nonexistent/mergetool merging f merging f failed! 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.orig # hg resolve --list U f but true.executable set to cat found in PATH works: $ echo "true.executable=cat" >> .hg/hgrc $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 merging f revision 1 space revision 0 space revision 2 space 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ aftermerge # cat f revision 1 space # hg stat M f # hg resolve --list R f and true.executable set to cat with path works: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config merge-tools.true.executable=cat merging f revision 1 space revision 0 space revision 2 space 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ aftermerge # cat f revision 1 space # hg stat M f # hg resolve --list R f #if unix-permissions environment variables in true.executable are handled: $ echo 'echo "custom merge tool"' > .hg/merge.sh $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg --config merge-tools.true.executable='sh' \ > --config merge-tools.true.args=.hg/merge.sh \ > merge -r 2 merging f custom merge tool 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ aftermerge # cat f revision 1 space # hg stat M f # hg resolve --list R f #endif Tool selection and merge-patterns merge-patterns specifies new tool false: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config merge-patterns.f=false merging f merging f failed! 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.orig # hg resolve --list U f merge-patterns specifies executable not found in PATH and gets warning: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool couldn't find merge tool true (for pattern f) merging f couldn't find merge tool true (for pattern f) merging f failed! 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.orig # hg resolve --list U f merge-patterns specifies executable with bogus path and gets warning: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexistent/mergetool couldn't find merge tool true (for pattern f) merging f couldn't find merge tool true (for pattern f) merging f failed! 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.orig # hg resolve --list U f ui.merge overrules priority ui.merge specifies false: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config ui.merge=false merging f merging f failed! 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.orig # hg resolve --list U f ui.merge specifies internal:fail: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config ui.merge=internal:fail 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f # hg resolve --list U f ui.merge specifies :local (without internal prefix): $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config ui.merge=:local 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ aftermerge # cat f revision 1 space # hg stat M f # hg resolve --list R f ui.merge specifies internal:other: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config ui.merge=internal:other 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ aftermerge # cat f revision 2 space # hg stat M f # hg resolve --list R f ui.merge specifies internal:prompt: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config ui.merge=internal:prompt keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f # hg resolve --list U f ui.merge specifies :prompt, with 'leave unresolved' chosen $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config ui.merge=:prompt --config ui.interactive=True << EOF > u > EOF keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f # hg resolve --list U f prompt with EOF $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config ui.merge=internal:prompt --config ui.interactive=true keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f # hg resolve --list U f $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.orig # hg resolve --list U f $ rm f $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? [1] $ aftermerge # cat f revision 1 space # hg stat M f # hg resolve --list U f $ hg resolve --all --config ui.merge=internal:prompt keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.orig # hg resolve --list U f ui.merge specifies internal:dump: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config ui.merge=internal:dump merging f 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.base ? f.local ? f.orig ? f.other # hg resolve --list U f f.base: $ cat f.base revision 0 space f.local: $ cat f.local revision 1 space f.other: $ cat f.other revision 2 space $ rm f.base f.local f.other check that internal:dump doesn't dump files if premerge runs successfully $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 3 --config ui.merge=internal:dump merging f 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ aftermerge # cat f revision 1 space revision 3 # hg stat M f # hg resolve --list R f check that internal:forcedump dumps files, even if local and other can be merged easily $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 3 --config ui.merge=internal:forcedump merging f 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.base ? f.local ? f.orig ? f.other # hg resolve --list U f $ cat f.base revision 0 space $ cat f.local revision 1 space $ cat f.other revision 0 space revision 3 $ rm -f f.base f.local f.other ui.merge specifies internal:other but is overruled by pattern for false: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false merging f merging f failed! 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.orig # hg resolve --list U f Premerge ui.merge specifies internal:other but is overruled by --tool=false $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config ui.merge=internal:other --tool=false merging f merging f failed! 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.orig # hg resolve --list U f HGMERGE specifies internal:other but is overruled by --tool=false $ HGMERGE=internal:other ; export HGMERGE $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --tool=false merging f merging f failed! 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.orig # hg resolve --list U f $ unset HGMERGE # make sure HGMERGE doesn't interfere with remaining tests update is a merge ... (this also tests that files reverted with '--rev REV' are treated as "modified", even if none of mode, size and timestamp of them isn't changed on the filesystem (see also issue4583)) $ cat >> $HGRCPATH < [fakedirstatewritetime] > # emulate invoking dirstate.write() via repo.status() > # at 2000-01-01 00:00 > fakenow = 200001010000 > EOF $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg update -q 0 $ f -s f f: size=17 $ touch -t 200001010000 f $ hg debugrebuildstate $ cat >> $HGRCPATH < [extensions] > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py > EOF $ hg revert -q -r 1 . $ cat >> $HGRCPATH < [extensions] > fakedirstatewritetime = ! > EOF $ f -s f f: size=17 $ touch -t 200001010000 f $ hg status f M f $ hg update -r 2 merging f revision 1 space revision 0 space revision 2 space 0 files updated, 1 files merged, 0 files removed, 0 files unresolved $ aftermerge # cat f revision 1 space # hg stat M f # hg resolve --list R f update should also have --tool $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg update -q 0 $ f -s f f: size=17 $ touch -t 200001010000 f $ hg debugrebuildstate $ cat >> $HGRCPATH < [extensions] > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py > EOF $ hg revert -q -r 1 . $ cat >> $HGRCPATH < [extensions] > fakedirstatewritetime = ! > EOF $ f -s f f: size=17 $ touch -t 200001010000 f $ hg status f M f $ hg update -r 2 --tool false merging f merging f failed! 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.orig # hg resolve --list U f Default is silent simplemerge: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 3 merging f 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ aftermerge # cat f revision 1 space revision 3 # hg stat M f # hg resolve --list R f .premerge=True is same: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 3 --config merge-tools.true.premerge=True merging f 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ aftermerge # cat f revision 1 space revision 3 # hg stat M f # hg resolve --list R f .premerge=False executes merge-tool: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 3 --config merge-tools.true.premerge=False merging f revision 1 space revision 0 space revision 0 space revision 3 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ aftermerge # cat f revision 1 space # hg stat M f # hg resolve --list R f premerge=keep keeps conflict markers in: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 4 --config merge-tools.true.premerge=keep merging f <<<<<<< working copy: ef83787e2614 - test: revision 1 revision 1 space ======= revision 4 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4 revision 0 space revision 4 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ aftermerge # cat f <<<<<<< working copy: ef83787e2614 - test: revision 1 revision 1 space ======= revision 4 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4 # hg stat M f # hg resolve --list R f premerge=keep-merge3 keeps conflict markers with base content: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 4 --config merge-tools.true.premerge=keep-merge3 merging f <<<<<<< working copy: ef83787e2614 - test: revision 1 revision 1 space ||||||| base revision 0 space ======= revision 4 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4 revision 0 space revision 4 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ aftermerge # cat f <<<<<<< working copy: ef83787e2614 - test: revision 1 revision 1 space ||||||| base revision 0 space ======= revision 4 >>>>>>> merge rev: 81448d39c9a0 - test: revision 4 # hg stat M f # hg resolve --list R f Tool execution set tools.args explicit to include $base $local $other $output: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \ > | sed 's,==> .* <==,==> ... <==,g' merging f ==> ... <== revision 0 space ==> ... <== revision 1 space ==> ... <== revision 2 space ==> ... <== revision 1 space 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ aftermerge # cat f revision 1 space # hg stat M f # hg resolve --list R f Merge with "echo mergeresult > $local": $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local' merging f 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ aftermerge # cat f mergeresult # hg stat M f # hg resolve --list R f - and $local is the file f: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f' merging f 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ aftermerge # cat f mergeresult # hg stat M f # hg resolve --list R f Merge with "echo mergeresult > $output" - the variable is a bit magic: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output' merging f 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ aftermerge # cat f mergeresult # hg stat M f # hg resolve --list R f Merge using tool with a path that must be quoted: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ cat < 'my merge tool' > cat "\$1" "\$2" "\$3" > "\$4" > EOF $ hg --config merge-tools.true.executable='sh' \ > --config merge-tools.true.args='"./my merge tool" $base $local $other $output' \ > merge -r 2 merging f 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ rm -f 'my merge tool' $ aftermerge # cat f revision 0 space revision 1 space revision 2 space # hg stat M f # hg resolve --list R f Issue3581: Merging a filename that needs to be quoted (This test doesn't work on Windows filesystems even on Linux, so check for Unix-like permission) #if unix-permissions $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ echo "revision 5" > '"; exit 1; echo "' $ hg commit -Am "revision 5" adding "; exit 1; echo " warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "' $ hg update -C 1 > /dev/null $ echo "revision 6" > '"; exit 1; echo "' $ hg commit -Am "revision 6" adding "; exit 1; echo " warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "' created new head $ hg merge --config merge-tools.true.executable="true" -r 5 merging "; exit 1; echo " 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg update -C 1 > /dev/null #endif Merge post-processing cat is a bad merge-tool and doesn't change: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -y -r 2 --config merge-tools.true.checkchanged=1 merging f revision 1 space revision 0 space revision 2 space output file f appears unchanged was merge successful (yn)? n merging f failed! 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ aftermerge # cat f revision 1 space # hg stat M f ? f.orig # hg resolve --list U f #if symlink internal merge cannot handle symlinks and shouldn't try: $ hg update -q -C 1 $ rm f $ ln -s symlink f $ hg commit -qm 'f is symlink' $ hg merge -r 2 --tool internal:merge merging f warning: internal :merge cannot merge symlinks for f warning: conflicts while merging f! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] #endif Verify naming of temporary files and that extension is preserved: $ hg update -q -C 1 $ hg mv f f.txt $ hg ci -qm "f.txt" $ hg update -q -C 2 $ hg merge -y -r tip --tool echo --config merge-tools.echo.args='$base $local $other $output' merging f and f.txt to f.txt */f~base.?????? $TESTTMP/f.txt.orig */f~other.??????.txt $TESTTMP/f.txt (glob) 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) Check that debugpicktool examines which merge tool is chosen for specified file as expected $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 (default behavior: checking files in the working parent context) $ hg manifest f $ hg debugpickmergetool f = true (-X/-I and file patterns limmit examination targets) $ hg debugpickmergetool -X f $ hg debugpickmergetool unknown unknown: no such file in rev ef83787e2614 (--changedelete emulates merging change and delete) $ hg debugpickmergetool --changedelete f = :prompt (-r REV causes checking files in specified revision) $ hg manifest -r tip f.txt $ hg debugpickmergetool -r tip f.txt = true #if symlink (symlink causes chosing :prompt) $ hg debugpickmergetool -r 6d00b3726f6e f = :prompt #endif (--verbose shows some configurations) $ hg debugpickmergetool --tool foobar -v with --tool 'foobar' f = foobar $ HGMERGE=false hg debugpickmergetool -v with HGMERGE='false' f = false $ hg debugpickmergetool --config ui.merge=false -v with ui.merge='false' f = false (--debug shows errors detected intermediately) $ hg debugpickmergetool --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool --debug f couldn't find merge tool true (for pattern f) couldn't find merge tool true f = false mercurial-4.5.3/tests/test-eol-clone.t0000644015407300116100000000260313261161234017557 0ustar augieeng00000000000000Testing cloning with the EOL extension $ cat >> $HGRCPATH < [extensions] > eol = > > [eol] > native = CRLF > EOF setup repository $ hg init repo $ cd repo $ cat > .hgeol < [patterns] > **.txt = native > EOF $ printf "first\r\nsecond\r\nthird\r\n" > a.txt $ hg commit --addremove -m 'checkin' adding .hgeol adding a.txt Clone $ cd .. $ hg clone repo repo-2 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd repo-2 $ cat a.txt first\r (esc) second\r (esc) third\r (esc) $ hg cat a.txt first second third $ hg remove .hgeol $ hg commit -m 'remove eol' $ hg push --quiet $ cd .. Test clone of repo with .hgeol in working dir, but no .hgeol in tip $ hg clone repo repo-3 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd repo-3 $ cat a.txt first second third Test clone of revision with .hgeol $ cd .. $ hg clone -r 0 repo repo-4 adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files new changesets 90f94e2cf4e2 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd repo-4 $ cat .hgeol [patterns] **.txt = native $ cat a.txt first\r (esc) second\r (esc) third\r (esc) $ cd .. mercurial-4.5.3/tests/test-remove.t0000644015407300116100000004202013261161234017174 0ustar augieeng00000000000000 $ remove() { > hg rm $@ > echo "exit code: $?" > hg st > # do not use ls -R, which recurses in .hg subdirs on Mac OS X 10.5 > find . -name .hg -prune -o -type f -print | sort > hg up -C > } $ cat >> $HGRCPATH < [progress] > disable=False > assume-tty = 1 > delay = 0 > # set changedelay really large so we don't see nested topics > changedelay = 30000 > format = topic bar number > refresh = 0 > width = 60 > EOF $ hg init a $ cd a $ echo a > foo file not managed $ remove foo \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) not removing foo: file is untracked exit code: 1 ? foo ./foo 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg add foo $ hg commit -m1 the table cases 00 state added, options none $ echo b > bar $ hg add bar $ remove bar \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) skipping [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) not removing bar: file has been marked for add (use 'hg forget' to undo add) exit code: 1 A bar ./bar ./foo \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 01 state clean, options none $ remove foo \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) exit code: 0 R foo ? bar ./bar \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 02 state modified, options none $ echo b >> foo $ remove foo \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) skipping [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) not removing foo: file is modified (use -f to force removal) exit code: 1 M foo ? bar ./bar ./foo \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 03 state missing, options none $ rm foo $ remove foo \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) exit code: 0 R foo ? bar ./bar \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 10 state added, options -f $ echo b > bar $ hg add bar $ remove -f bar \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) exit code: 0 ? bar ./bar ./foo 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm bar 11 state clean, options -f $ remove -f foo \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) exit code: 0 R foo \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 12 state modified, options -f $ echo b >> foo $ remove -f foo \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) exit code: 0 R foo \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 13 state missing, options -f $ rm foo $ remove -f foo \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) exit code: 0 R foo \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 20 state added, options -A $ echo b > bar $ hg add bar $ remove -A bar \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) skipping [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) not removing bar: file still exists exit code: 1 A bar ./bar ./foo \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 21 state clean, options -Av $ remove -Av foo \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) skipping [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) not removing foo: file still exists exit code: 1 ? bar ./bar ./foo 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 22 state modified, options -Av $ echo b >> foo $ remove -Av foo \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) skipping [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) not removing foo: file still exists exit code: 1 M foo ? bar ./bar ./foo \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 23 state missing, options -A $ rm foo $ remove -A foo \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) exit code: 0 R foo ? bar ./bar \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 30 state added, options -Af $ echo b > bar $ hg add bar $ remove -Af bar \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) exit code: 0 ? bar ./bar ./foo 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm bar 31 state clean, options -Af $ remove -Af foo \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) exit code: 0 R foo ./foo \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 32 state modified, options -Af $ echo b >> foo $ remove -Af foo \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) exit code: 0 R foo ./foo \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 33 state missing, options -Af $ rm foo $ remove -Af foo \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) exit code: 0 R foo \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved test some directory stuff $ mkdir test $ echo a > test/foo $ echo b > test/bar $ hg ci -Am2 adding test/bar adding test/foo dir, options none $ rm test/bar $ remove test \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [=====================> ] 1/2\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [===========================================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) removing test/bar removing test/foo exit code: 0 R test/bar R test/foo ./foo \r (no-eol) (esc) updating [===========================================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) 2 files updated, 0 files merged, 0 files removed, 0 files unresolved dir, options -f $ rm test/bar $ remove -f test \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [=====================> ] 1/2\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [===========================================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) removing test/bar removing test/foo exit code: 0 R test/bar R test/foo ./foo \r (no-eol) (esc) updating [===========================================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) 2 files updated, 0 files merged, 0 files removed, 0 files unresolved dir, options -Av $ rm test/bar $ remove -Av test \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) skipping [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) removing test/bar not removing test/foo: file still exists exit code: 1 R test/bar ./foo ./test/foo \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved dir, options -A $ rm test/bar $ remove -A test \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) skipping [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) removing test/bar exit code: 1 R test/bar ./foo ./test/foo \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved without any files/dirs, options -A $ rm test/bar $ remove -A \r (no-eol) (esc) skipping [=====================> ] 1/2\r (no-eol) (esc) skipping [===========================================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) removing test/bar exit code: 1 R test/bar ./foo ./test/foo \r (no-eol) (esc) updating [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved dir, options -Af $ rm test/bar $ remove -Af test \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [=====================> ] 1/2\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [===========================================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) removing test/bar removing test/foo exit code: 0 R test/bar R test/foo ./foo ./test/foo \r (no-eol) (esc) updating [===========================================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) 2 files updated, 0 files merged, 0 files removed, 0 files unresolved test remove dropping empty trees (issue1861) $ mkdir -p issue1861/b/c $ echo x > issue1861/x $ echo y > issue1861/b/c/y $ hg ci -Am add adding issue1861/b/c/y adding issue1861/x $ hg rm issue1861/b \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) removing issue1861/b/c/y $ hg ci -m remove $ ls issue1861 x test that commit does not crash if the user removes a newly added file $ touch f1 $ hg add f1 $ rm f1 $ hg ci -A -mx removing f1 nothing changed [1] handling of untracked directories and missing files $ mkdir d1 $ echo a > d1/a $ hg rm --after d1 \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) not removing d1: no tracked files [1] $ hg add d1/a $ rm d1/a $ hg rm --after d1 \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) removing d1/a $ hg rm --after nosuch nosuch: * (glob) \r (no-eol) (esc) deleting [===========================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) [1] mercurial-4.5.3/tests/filterpyflakes.py0000755015407300116100000000157213261161234020145 0ustar augieeng00000000000000#!/usr/bin/env python # Filter output by pyflakes to control which warnings we check from __future__ import absolute_import, print_function import re import sys lines = [] for line in sys.stdin: # We blacklist tests that are too noisy for us pats = [ r"undefined name 'WindowsError'", r"redefinition of unused '[^']+' from line", # for cffi, allow re-exports from pure.* r"cffi/[^:]*:.*\bimport \*' used", r"cffi/[^:]*:.*\*' imported but unused", ] keep = True for pat in pats: if re.search(pat, line): keep = False break # pattern matches if keep: fn = line.split(':', 1)[0] f = open(fn) data = f.read() f.close() if 'no-' 'check-code' in data: continue lines.append(line) for line in lines: sys.stdout.write(line) print() mercurial-4.5.3/tests/test-largefiles-misc.t0000644015407300116100000010004613261161234020750 0ustar augieeng00000000000000This file contains testcases that tend to be related to special cases or less common commands affecting largefile. Each sections should be independent of each others. $ USERCACHE="$TESTTMP/cache"; export USERCACHE $ mkdir "${USERCACHE}" $ cat >> $HGRCPATH < [extensions] > largefiles= > purge= > rebase= > transplant= > [phases] > publish=False > [largefiles] > minsize=2 > patterns=glob:**.dat > usercache=${USERCACHE} > [hooks] > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status" > EOF Test copies and moves from a directory other than root (issue3516) ========================================================================= $ hg init lf_cpmv $ cd lf_cpmv $ mkdir dira $ mkdir dira/dirb $ touch dira/dirb/largefile $ hg add --large dira/dirb/largefile $ hg commit -m "added" Invoking status precommit hook A dira/dirb/largefile $ cd dira $ hg cp dirb/largefile foo/largefile TODO: Ideally, this should mention the largefile, not the standin $ hg log -T '{rev}\n' --stat 'set:clean()' 0 .hglf/dira/dirb/largefile | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) $ hg ci -m "deep copy" Invoking status precommit hook A dira/foo/largefile $ find . | sort . ./dirb ./dirb/largefile ./foo ./foo/largefile $ hg mv foo/largefile baz/largefile $ hg ci -m "moved" Invoking status precommit hook A dira/baz/largefile R dira/foo/largefile $ find . | sort . ./baz ./baz/largefile ./dirb ./dirb/largefile $ cd .. $ hg mv dira dirc moving .hglf/dira/baz/largefile to .hglf/dirc/baz/largefile moving .hglf/dira/dirb/largefile to .hglf/dirc/dirb/largefile $ find * | sort dirc dirc/baz dirc/baz/largefile dirc/dirb dirc/dirb/largefile $ hg clone -q . ../fetch $ hg --config extensions.fetch= fetch ../fetch abort: uncommitted changes [255] $ hg up -qC $ cd .. Clone a local repository owned by another user =================================================== #if unix-permissions We have to simulate that here by setting $HOME and removing write permissions $ ORIGHOME="$HOME" $ mkdir alice $ HOME="`pwd`/alice" $ cd alice $ hg init pubrepo $ cd pubrepo $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null $ hg add --large a-large-file $ hg commit -m "Add a large file" Invoking status precommit hook A a-large-file $ cd .. $ chmod -R a-w pubrepo $ cd .. $ mkdir bob $ HOME="`pwd`/bob" $ cd bob $ hg clone --pull ../alice/pubrepo pubrepo requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 09a186cfa6da updating to branch default getting changed largefiles 1 largefiles updated, 0 removed 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd .. $ chmod -R u+w alice/pubrepo $ HOME="$ORIGHOME" #endif Symlink to a large largefile should behave the same as a symlink to a normal file ===================================================================================== #if symlink $ hg init largesymlink $ cd largesymlink $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null $ hg add --large largefile $ hg commit -m "commit a large file" Invoking status precommit hook A largefile $ ln -s largefile largelink $ hg add largelink $ hg commit -m "commit a large symlink" Invoking status precommit hook A largelink $ rm -f largelink $ hg up >/dev/null $ test -f largelink [1] $ test -L largelink [1] $ rm -f largelink # make next part of the test independent of the previous $ hg up -C >/dev/null $ test -f largelink $ test -L largelink $ cd .. #endif test for pattern matching on 'hg status': ============================================== to boost performance, largefiles checks whether specified patterns are related to largefiles in working directory (NOT to STANDIN) or not. $ hg init statusmatch $ cd statusmatch $ mkdir -p a/b/c/d $ echo normal > a/b/c/d/e.normal.txt $ hg add a/b/c/d/e.normal.txt $ echo large > a/b/c/d/e.large.txt $ hg add --large a/b/c/d/e.large.txt $ mkdir -p a/b/c/x $ echo normal > a/b/c/x/y.normal.txt $ hg add a/b/c/x/y.normal.txt $ hg commit -m 'add files' Invoking status precommit hook A a/b/c/d/e.large.txt A a/b/c/d/e.normal.txt A a/b/c/x/y.normal.txt (1) no pattern: no performance boost $ hg status -A C a/b/c/d/e.large.txt C a/b/c/d/e.normal.txt C a/b/c/x/y.normal.txt (2) pattern not related to largefiles: performance boost $ hg status -A a/b/c/x C a/b/c/x/y.normal.txt (3) pattern related to largefiles: no performance boost $ hg status -A a/b/c/d C a/b/c/d/e.large.txt C a/b/c/d/e.normal.txt (4) pattern related to STANDIN (not to largefiles): performance boost $ hg status -A .hglf/a C .hglf/a/b/c/d/e.large.txt (5) mixed case: no performance boost $ hg status -A a/b/c/x a/b/c/d C a/b/c/d/e.large.txt C a/b/c/d/e.normal.txt C a/b/c/x/y.normal.txt verify that largefiles doesn't break filesets $ hg log --rev . --exclude "set:binary()" changeset: 0:41bd42f10efa tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add files sharing a largefile repo automatically enables largefiles on the share $ hg share --config extensions.share= . ../shared_lfrepo updating working directory getting changed largefiles 1 largefiles updated, 0 removed 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat ../shared_lfrepo/.hg/hgrc [extensions] largefiles= verify that large files in subrepos handled properly $ hg init subrepo $ echo "subrepo = subrepo" > .hgsub $ hg add .hgsub $ hg ci -m "add subrepo" Invoking status precommit hook A .hgsub ? .hgsubstate $ echo "rev 1" > subrepo/large.txt $ hg add --large subrepo/large.txt $ hg sum parent: 1:8ee150ea2e9c tip add subrepo branch: default commit: 1 subrepos update: (current) phases: 2 draft $ hg st $ hg st -S A subrepo/large.txt $ hg ci -S -m "commit top repo" committing subrepository subrepo Invoking status precommit hook A large.txt Invoking status precommit hook M .hgsubstate # No differences $ hg st -S $ hg sum parent: 2:ce4cd0c527a6 tip commit top repo branch: default commit: (clean) update: (current) phases: 3 draft $ echo "rev 2" > subrepo/large.txt $ hg st -S M subrepo/large.txt $ hg sum parent: 2:ce4cd0c527a6 tip commit top repo branch: default commit: 1 subrepos update: (current) phases: 3 draft $ hg ci -m "this commit should fail without -S" abort: uncommitted changes in subrepository "subrepo" (use --subrepos for recursive commit) [255] Add a normal file to the subrepo, then test archiving $ echo 'normal file' > subrepo/normal.txt $ touch large.dat $ mv subrepo/large.txt subrepo/renamed-large.txt $ hg addremove -S --dry-run adding large.dat as a largefile removing subrepo/large.txt adding subrepo/normal.txt adding subrepo/renamed-large.txt $ hg status -S ! subrepo/large.txt ? large.dat ? subrepo/normal.txt ? subrepo/renamed-large.txt $ hg addremove --dry-run subrepo removing subrepo/large.txt adding subrepo/normal.txt adding subrepo/renamed-large.txt $ hg status -S ! subrepo/large.txt ? large.dat ? subrepo/normal.txt ? subrepo/renamed-large.txt $ cd .. $ hg -R statusmatch addremove --dry-run statusmatch/subrepo removing statusmatch/subrepo/large.txt adding statusmatch/subrepo/normal.txt adding statusmatch/subrepo/renamed-large.txt $ hg -R statusmatch status -S ! subrepo/large.txt ? large.dat ? subrepo/normal.txt ? subrepo/renamed-large.txt $ hg -R statusmatch addremove --dry-run -S adding large.dat as a largefile removing subrepo/large.txt adding subrepo/normal.txt adding subrepo/renamed-large.txt $ cd statusmatch $ mv subrepo/renamed-large.txt subrepo/large.txt $ hg addremove subrepo adding subrepo/normal.txt $ hg forget subrepo/normal.txt $ hg addremove -S adding large.dat as a largefile adding subrepo/normal.txt $ rm large.dat $ hg addremove subrepo $ hg addremove -S removing large.dat Lock in subrepo, otherwise the change isn't archived $ hg ci -S -m "add normal file to top level" committing subrepository subrepo Invoking status precommit hook M large.txt A normal.txt Invoking status precommit hook M .hgsubstate $ hg archive -S ../lf_subrepo_archive $ find ../lf_subrepo_archive | sort ../lf_subrepo_archive ../lf_subrepo_archive/.hg_archival.txt ../lf_subrepo_archive/.hgsub ../lf_subrepo_archive/.hgsubstate ../lf_subrepo_archive/a ../lf_subrepo_archive/a/b ../lf_subrepo_archive/a/b/c ../lf_subrepo_archive/a/b/c/d ../lf_subrepo_archive/a/b/c/d/e.large.txt ../lf_subrepo_archive/a/b/c/d/e.normal.txt ../lf_subrepo_archive/a/b/c/x ../lf_subrepo_archive/a/b/c/x/y.normal.txt ../lf_subrepo_archive/subrepo ../lf_subrepo_archive/subrepo/large.txt ../lf_subrepo_archive/subrepo/normal.txt $ cat ../lf_subrepo_archive/.hg_archival.txt repo: 41bd42f10efa43698cc02052ea0977771cba506d node: d56a95e6522858bc08a724c4fe2bdee066d1c30b branch: default latesttag: null latesttagdistance: 4 changessincelatesttag: 4 Test update with subrepos. $ hg update 0 getting changed largefiles 0 largefiles updated, 1 removed 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg status -S $ hg update tip getting changed largefiles 1 largefiles updated, 0 removed 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg status -S # modify a large file $ echo "modified" > subrepo/large.txt $ hg st -S M subrepo/large.txt # update -C should revert the change. $ hg update -C getting changed largefiles 1 largefiles updated, 0 removed 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg status -S Forget doesn't change the content of the file $ echo 'pre-forget content' > subrepo/large.txt $ hg forget -v subrepo/large.txt removing subrepo/large.txt $ cat subrepo/large.txt pre-forget content Test reverting a forgotten file $ hg revert -R subrepo subrepo/large.txt $ hg status -SA subrepo/large.txt C subrepo/large.txt $ hg rm -v subrepo/large.txt removing subrepo/large.txt $ hg revert -R subrepo subrepo/large.txt $ rm subrepo/large.txt $ hg addremove -S removing subrepo/large.txt $ hg st -S R subrepo/large.txt Test archiving a revision that references a subrepo that is not yet cloned (see test-subrepo-recursion.t): $ hg clone -U . ../empty $ cd ../empty $ hg archive --subrepos -r tip ../archive.tar.gz cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo $ cd .. Test addremove, forget and others ============================================== Test that addremove picks up largefiles prior to the initial commit (issue3541) $ hg init addrm2 $ cd addrm2 $ touch large.dat $ touch large2.dat $ touch normal $ hg add --large large.dat $ hg addremove -v adding large2.dat as a largefile adding normal Test that forgetting all largefiles reverts to islfilesrepo() == False (addremove will add *.dat as normal files now) $ hg forget large.dat $ hg forget large2.dat $ hg addremove -v adding large.dat adding large2.dat Test commit's addremove option prior to the first commit $ hg forget large.dat $ hg forget large2.dat $ hg add --large large.dat $ hg ci -Am "commit" adding large2.dat as a largefile Invoking status precommit hook A large.dat A large2.dat A normal $ find .hglf | sort .hglf .hglf/large.dat .hglf/large2.dat Test actions on largefiles using relative paths from subdir $ mkdir sub $ cd sub $ echo anotherlarge > anotherlarge $ hg add --large anotherlarge $ hg st A sub/anotherlarge $ hg st anotherlarge A anotherlarge $ hg commit -m anotherlarge anotherlarge Invoking status precommit hook A sub/anotherlarge $ hg log anotherlarge changeset: 1:9627a577c5e9 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: anotherlarge $ hg --debug log -T '{rev}: {desc}\n' ../sub/anotherlarge updated patterns: ../.hglf/sub/../sub/anotherlarge, ../sub/anotherlarge 1: anotherlarge $ hg log -G anotherlarge @ changeset: 1:9627a577c5e9 | tag: tip ~ user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: anotherlarge $ hg log glob:another* changeset: 1:9627a577c5e9 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: anotherlarge $ hg --debug log -T '{rev}: {desc}\n' -G glob:another* updated patterns: glob:../.hglf/sub/another*, glob:another* @ 1: anotherlarge | ~ #if no-msys $ hg --debug log -T '{rev}: {desc}\n' 'glob:../.hglf/sub/another*' # no-msys updated patterns: glob:../.hglf/sub/another* 1: anotherlarge $ hg --debug log -G -T '{rev}: {desc}\n' 'glob:../.hglf/sub/another*' # no-msys updated patterns: glob:../.hglf/sub/another* @ 1: anotherlarge | ~ #endif $ echo more >> anotherlarge $ hg st . M anotherlarge $ hg cat anotherlarge anotherlarge $ hg revert anotherlarge $ hg st ? sub/anotherlarge.orig Test orig files go where we want them $ echo moremore >> anotherlarge $ hg revert anotherlarge -v --config 'ui.origbackuppath=.hg/origbackups' creating directory: $TESTTMP/addrm2/.hg/origbackups/.hglf/sub saving current version of ../.hglf/sub/anotherlarge as $TESTTMP/addrm2/.hg/origbackups/.hglf/sub/anotherlarge reverting ../.hglf/sub/anotherlarge creating directory: $TESTTMP/addrm2/.hg/origbackups/sub found 90c622cf65cebe75c5842f9136c459333faf392e in store found 90c622cf65cebe75c5842f9136c459333faf392e in store $ ls ../.hg/origbackups/sub anotherlarge $ cd .. Test glob logging from the root dir $ hg log glob:**another* changeset: 1:9627a577c5e9 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: anotherlarge $ hg log -G glob:**another* @ changeset: 1:9627a577c5e9 | tag: tip ~ user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: anotherlarge $ cd .. Log from outer space $ hg --debug log -R addrm2 -T '{rev}: {desc}\n' 'addrm2/sub/anotherlarge' updated patterns: addrm2/.hglf/sub/anotherlarge, addrm2/sub/anotherlarge 1: anotherlarge $ hg --debug log -R addrm2 -T '{rev}: {desc}\n' 'addrm2/.hglf/sub/anotherlarge' updated patterns: addrm2/.hglf/sub/anotherlarge 1: anotherlarge Check error message while exchange ========================================================= issue3651: summary/outgoing with largefiles shows "no remote repo" unexpectedly $ mkdir issue3651 $ cd issue3651 $ hg init src $ echo a > src/a $ hg -R src add --large src/a $ hg -R src commit -m '#0' Invoking status precommit hook A a check messages when no remote repository is specified: "no remote repo" route for "hg outgoing --large" is not tested here, because it can't be reproduced easily. $ hg init clone1 $ hg -R clone1 -q pull src $ hg -R clone1 -q update $ hg -R clone1 paths | grep default [1] $ hg -R clone1 summary --large parent: 0:fc0bd45326d3 tip #0 branch: default commit: (clean) update: (current) phases: 1 draft largefiles: (no remote repo) check messages when there is no files to upload: $ hg -q clone src clone2 $ hg -R clone2 paths | grep default default = $TESTTMP/issue3651/src $ hg -R clone2 summary --large parent: 0:fc0bd45326d3 tip #0 branch: default commit: (clean) update: (current) phases: 1 draft largefiles: (no files to upload) $ hg -R clone2 outgoing --large comparing with $TESTTMP/issue3651/src searching for changes no changes found largefiles: no files to upload [1] $ hg -R clone2 outgoing --large --graph --template "{rev}" comparing with $TESTTMP/issue3651/src searching for changes no changes found largefiles: no files to upload check messages when there are files to upload: $ echo b > clone2/b $ hg -R clone2 add --large clone2/b $ hg -R clone2 commit -m '#1' Invoking status precommit hook A b $ hg -R clone2 summary --large parent: 1:1acbe71ce432 tip #1 branch: default commit: (clean) update: (current) phases: 2 draft largefiles: 1 entities for 1 files to upload $ hg -R clone2 outgoing --large comparing with $TESTTMP/issue3651/src searching for changes changeset: 1:1acbe71ce432 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: #1 largefiles to upload (1 entities): b $ hg -R clone2 outgoing --large --graph --template "{rev}" comparing with $TESTTMP/issue3651/src searching for changes @ 1 largefiles to upload (1 entities): b $ cp clone2/b clone2/b1 $ cp clone2/b clone2/b2 $ hg -R clone2 add --large clone2/b1 clone2/b2 $ hg -R clone2 commit -m '#2: add largefiles referring same entity' Invoking status precommit hook A b1 A b2 $ hg -R clone2 summary --large parent: 2:6095d0695d70 tip #2: add largefiles referring same entity branch: default commit: (clean) update: (current) phases: 3 draft largefiles: 1 entities for 3 files to upload $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" comparing with $TESTTMP/issue3651/src searching for changes 1:1acbe71ce432 2:6095d0695d70 largefiles to upload (1 entities): b b1 b2 $ hg -R clone2 cat -r 1 clone2/.hglf/b 89e6c98d92887913cadf06b2adb97f26cde4849b $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true comparing with $TESTTMP/issue3651/src query 1; heads searching for changes all remote heads known locally 1:1acbe71ce432 2:6095d0695d70 finding outgoing largefiles: 0/2 revisions (0.00%) finding outgoing largefiles: 1/2 revisions (50.00%) largefiles to upload (1 entities): b 89e6c98d92887913cadf06b2adb97f26cde4849b b1 89e6c98d92887913cadf06b2adb97f26cde4849b b2 89e6c98d92887913cadf06b2adb97f26cde4849b $ echo bbb > clone2/b $ hg -R clone2 commit -m '#3: add new largefile entity as existing file' Invoking status precommit hook M b $ echo bbbb > clone2/b $ hg -R clone2 commit -m '#4: add new largefile entity as existing file' Invoking status precommit hook M b $ cp clone2/b1 clone2/b $ hg -R clone2 commit -m '#5: refer existing largefile entity again' Invoking status precommit hook M b $ hg -R clone2 summary --large parent: 5:036794ea641c tip #5: refer existing largefile entity again branch: default commit: (clean) update: (current) phases: 6 draft largefiles: 3 entities for 3 files to upload $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" comparing with $TESTTMP/issue3651/src searching for changes 1:1acbe71ce432 2:6095d0695d70 3:7983dce246cc 4:233f12ada4ae 5:036794ea641c largefiles to upload (3 entities): b b1 b2 $ hg -R clone2 cat -r 3 clone2/.hglf/b c801c9cfe94400963fcb683246217d5db77f9a9a $ hg -R clone2 cat -r 4 clone2/.hglf/b 13f9ed0898e315bf59dc2973fec52037b6f441a2 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true comparing with $TESTTMP/issue3651/src query 1; heads searching for changes all remote heads known locally 1:1acbe71ce432 2:6095d0695d70 3:7983dce246cc 4:233f12ada4ae 5:036794ea641c finding outgoing largefiles: 0/5 revisions (0.00%) finding outgoing largefiles: 1/5 revisions (20.00%) finding outgoing largefiles: 2/5 revisions (40.00%) finding outgoing largefiles: 3/5 revisions (60.00%) finding outgoing largefiles: 4/5 revisions (80.00%) largefiles to upload (3 entities): b 13f9ed0898e315bf59dc2973fec52037b6f441a2 89e6c98d92887913cadf06b2adb97f26cde4849b c801c9cfe94400963fcb683246217d5db77f9a9a b1 89e6c98d92887913cadf06b2adb97f26cde4849b b2 89e6c98d92887913cadf06b2adb97f26cde4849b Pushing revision #1 causes uploading entity 89e6c98d9288, which is shared also by largefiles b1, b2 in revision #2 and b in revision #5. Then, entity 89e6c98d9288 is not treated as "outgoing entity" at "hg summary" and "hg outgoing", even though files in outgoing revision #2 and #5 refer it. $ hg -R clone2 push -r 1 -q $ hg -R clone2 summary --large parent: 5:036794ea641c tip #5: refer existing largefile entity again branch: default commit: (clean) update: (current) phases: 6 draft largefiles: 2 entities for 1 files to upload $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" comparing with $TESTTMP/issue3651/src searching for changes 2:6095d0695d70 3:7983dce246cc 4:233f12ada4ae 5:036794ea641c largefiles to upload (2 entities): b $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true comparing with $TESTTMP/issue3651/src query 1; heads searching for changes all remote heads known locally 2:6095d0695d70 3:7983dce246cc 4:233f12ada4ae 5:036794ea641c finding outgoing largefiles: 0/4 revisions (0.00%) finding outgoing largefiles: 1/4 revisions (25.00%) finding outgoing largefiles: 2/4 revisions (50.00%) finding outgoing largefiles: 3/4 revisions (75.00%) largefiles to upload (2 entities): b 13f9ed0898e315bf59dc2973fec52037b6f441a2 c801c9cfe94400963fcb683246217d5db77f9a9a $ cd .. merge action 'd' for 'local renamed directory to d2/g' which has no filename ================================================================================== $ hg init merge-action $ cd merge-action $ touch l $ hg add --large l $ mkdir d1 $ touch d1/f $ hg ci -Aqm0 Invoking status precommit hook A d1/f A l $ echo > d1/f $ touch d1/g $ hg ci -Aqm1 Invoking status precommit hook M d1/f A d1/g $ hg up -qr0 $ hg mv d1 d2 moving d1/f to d2/f $ hg ci -qm2 Invoking status precommit hook A d2/f R d1/f $ hg merge merging d2/f and d1/f to d2/f 1 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cd .. Merge conflicts: ===================== $ hg init merge $ cd merge $ echo 0 > f-different $ echo 0 > f-same $ echo 0 > f-unchanged-1 $ echo 0 > f-unchanged-2 $ hg add --large * $ hg ci -m0 Invoking status precommit hook A f-different A f-same A f-unchanged-1 A f-unchanged-2 $ echo tmp1 > f-unchanged-1 $ echo tmp1 > f-unchanged-2 $ echo tmp1 > f-same $ hg ci -m1 Invoking status precommit hook M f-same M f-unchanged-1 M f-unchanged-2 $ echo 2 > f-different $ echo 0 > f-unchanged-1 $ echo 1 > f-unchanged-2 $ echo 1 > f-same $ hg ci -m2 Invoking status precommit hook M f-different M f-same M f-unchanged-1 M f-unchanged-2 $ hg up -qr0 $ echo tmp2 > f-unchanged-1 $ echo tmp2 > f-unchanged-2 $ echo tmp2 > f-same $ hg ci -m3 Invoking status precommit hook M f-same M f-unchanged-1 M f-unchanged-2 created new head $ echo 1 > f-different $ echo 1 > f-unchanged-1 $ echo 0 > f-unchanged-2 $ echo 1 > f-same $ hg ci -m4 Invoking status precommit hook M f-different M f-same M f-unchanged-1 M f-unchanged-2 $ hg merge largefile f-different has a merge conflict ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7 keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l getting changed largefiles 1 largefiles updated, 0 removed 0 files updated, 4 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f-different 1 $ cat f-same 1 $ cat f-unchanged-1 1 $ cat f-unchanged-2 1 $ cd .. Test largefile insulation (do not enabled a side effect ======================================================== Check whether "largefiles" feature is supported only in repositories enabling largefiles extension. $ mkdir individualenabling $ cd individualenabling $ hg init enabledlocally $ echo large > enabledlocally/large $ hg -R enabledlocally add --large enabledlocally/large $ hg -R enabledlocally commit -m '#0' Invoking status precommit hook A large $ hg init notenabledlocally $ echo large > notenabledlocally/large $ hg -R notenabledlocally add --large notenabledlocally/large $ hg -R notenabledlocally commit -m '#0' Invoking status precommit hook A large $ cat >> $HGRCPATH < [extensions] > # disable globally > largefiles=! > EOF $ cat >> enabledlocally/.hg/hgrc < [extensions] > # enable locally > largefiles= > EOF $ hg -R enabledlocally root $TESTTMP/individualenabling/enabledlocally $ hg -R notenabledlocally root abort: repository requires features unknown to this Mercurial: largefiles! (see https://mercurial-scm.org/wiki/MissingRequirement for more information) [255] $ hg init push-dst $ hg -R enabledlocally push push-dst pushing to push-dst abort: required features are not supported in the destination: largefiles [255] $ hg init pull-src $ hg -R pull-src pull enabledlocally pulling from enabledlocally abort: required features are not supported in the destination: largefiles [255] $ hg clone enabledlocally clone-dst abort: repository requires features unknown to this Mercurial: largefiles! (see https://mercurial-scm.org/wiki/MissingRequirement for more information) [255] $ test -d clone-dst [1] $ hg clone --pull enabledlocally clone-pull-dst abort: required features are not supported in the destination: largefiles [255] $ test -d clone-pull-dst [1] #if serve Test largefiles specific peer setup, when largefiles is enabled locally (issue4109) $ hg showconfig extensions | grep largefiles extensions.largefiles=! $ mkdir -p $TESTTMP/individualenabling/usercache $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid $ cat hg.pid >> $DAEMON_PIDS $ hg init pull-dst $ cat > pull-dst/.hg/hgrc < [extensions] > # enable locally > largefiles= > [largefiles] > # ignore system cache to force largefiles specific wire proto access > usercache=$TESTTMP/individualenabling/usercache > EOF $ hg -R pull-dst -q pull -u http://localhost:$HGPORT $ killdaemons.py #endif Test overridden functions work correctly even for repos disabling largefiles (issue4547) $ hg showconfig extensions | grep largefiles extensions.largefiles=! (test updating implied by clone) $ hg init enabled-but-no-largefiles $ echo normal1 > enabled-but-no-largefiles/normal1 $ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal1 $ hg -R enabled-but-no-largefiles commit -m '#0@enabled-but-no-largefiles' Invoking status precommit hook A normal1 $ cat >> enabled-but-no-largefiles/.hg/hgrc < [extensions] > # enable locally > largefiles= > EOF $ hg clone -q enabled-but-no-largefiles no-largefiles $ echo normal2 > enabled-but-no-largefiles/normal2 $ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal2 $ hg -R enabled-but-no-largefiles commit -m '#1@enabled-but-no-largefiles' Invoking status precommit hook A normal2 $ echo normal3 > no-largefiles/normal3 $ hg -R no-largefiles add no-largefiles/normal3 $ hg -R no-largefiles commit -m '#1@no-largefiles' Invoking status precommit hook A normal3 $ hg -R no-largefiles -q pull --rebase Invoking status precommit hook A normal3 (test reverting) $ hg init subrepo-root $ cat >> subrepo-root/.hg/hgrc < [extensions] > # enable locally > largefiles= > EOF $ echo large > subrepo-root/large $ mkdir -p subrepo-root/dir/subdir $ echo large2 > subrepo-root/dir/subdir/large.bin $ hg -R subrepo-root add --large subrepo-root/large subrepo-root/dir/subdir/large.bin $ hg clone -q no-largefiles subrepo-root/no-largefiles $ cat > subrepo-root/.hgsub < no-largefiles = no-largefiles > EOF $ hg -R subrepo-root add subrepo-root/.hgsub $ hg -R subrepo-root commit -m '#0' Invoking status precommit hook A .hgsub A dir/subdir/large.bin A large ? .hgsubstate $ echo dirty >> subrepo-root/large $ echo dirty >> subrepo-root/no-largefiles/normal1 $ hg -R subrepo-root status -S M large M no-largefiles/normal1 $ hg -R subrepo-root extdiff -p echo -S --config extensions.extdiff= "*\\no-largefiles\\normal1" "*\\no-largefiles\\normal1" (glob) (windows !) */no-largefiles/normal1 */no-largefiles/normal1 (glob) (no-windows !) [1] $ hg -R subrepo-root revert --all reverting subrepo-root/.hglf/large reverting subrepo no-largefiles reverting subrepo-root/no-largefiles/normal1 Move (and then undo) a directory move with only largefiles. $ cd subrepo-root $ $PYTHON $TESTDIR/list-tree.py .hglf dir* large* .hglf/ .hglf/dir/ .hglf/dir/subdir/ .hglf/dir/subdir/large.bin .hglf/large dir/ dir/subdir/ dir/subdir/large.bin large large.orig $ hg mv dir/subdir dir/subdir2 moving .hglf/dir/subdir/large.bin to .hglf/dir/subdir2/large.bin $ $PYTHON $TESTDIR/list-tree.py .hglf dir* large* .hglf/ .hglf/dir/ .hglf/dir/subdir2/ .hglf/dir/subdir2/large.bin .hglf/large dir/ dir/subdir2/ dir/subdir2/large.bin large large.orig $ hg status -C A dir/subdir2/large.bin dir/subdir/large.bin R dir/subdir/large.bin ? large.orig $ echo 'modified' > dir/subdir2/large.bin $ hg status -C A dir/subdir2/large.bin dir/subdir/large.bin R dir/subdir/large.bin ? large.orig $ hg revert --all undeleting .hglf/dir/subdir/large.bin forgetting .hglf/dir/subdir2/large.bin reverting subrepo no-largefiles $ hg status -C ? dir/subdir2/large.bin ? large.orig The content of the forgotten file shouldn't be clobbered $ cat dir/subdir2/large.bin modified The standin for subdir2 should be deleted, not just dropped $ $PYTHON $TESTDIR/list-tree.py .hglf dir* large* .hglf/ .hglf/dir/ .hglf/dir/subdir/ .hglf/dir/subdir/large.bin .hglf/large dir/ dir/subdir/ dir/subdir/large.bin dir/subdir2/ dir/subdir2/large.bin large large.orig $ rm -r dir/subdir2 'subdir' should not be in the destination. It would be if the subdir2 directory existed under .hglf/. $ hg mv dir/subdir dir/subdir2 moving .hglf/dir/subdir/large.bin to .hglf/dir/subdir2/large.bin $ hg status -C A dir/subdir2/large.bin dir/subdir/large.bin R dir/subdir/large.bin ? large.orig $ $PYTHON $TESTDIR/list-tree.py .hglf dir* large* .hglf/ .hglf/dir/ .hglf/dir/subdir2/ .hglf/dir/subdir2/large.bin .hglf/large dir/ dir/subdir2/ dir/subdir2/large.bin large large.orig Start from scratch, and rename something other than the final path component. $ hg up -qC . $ hg --config extensions.purge= purge $ hg mv dir/subdir dir2/subdir moving .hglf/dir/subdir/large.bin to .hglf/dir2/subdir/large.bin $ hg status -C A dir2/subdir/large.bin dir/subdir/large.bin R dir/subdir/large.bin $ $PYTHON $TESTDIR/list-tree.py .hglf dir* large* .hglf/ .hglf/dir2/ .hglf/dir2/subdir/ .hglf/dir2/subdir/large.bin .hglf/large dir2/ dir2/subdir/ dir2/subdir/large.bin large $ hg revert --all undeleting .hglf/dir/subdir/large.bin forgetting .hglf/dir2/subdir/large.bin reverting subrepo no-largefiles $ hg status -C ? dir2/subdir/large.bin $ $PYTHON $TESTDIR/list-tree.py .hglf dir* large* .hglf/ .hglf/dir/ .hglf/dir/subdir/ .hglf/dir/subdir/large.bin .hglf/large dir/ dir/subdir/ dir/subdir/large.bin dir2/ dir2/subdir/ dir2/subdir/large.bin large $ cd ../.. Test "pull --rebase" when rebase is enabled before largefiles (issue3861) ========================================================================= $ hg showconfig extensions | grep largefiles extensions.largefiles=! $ mkdir issue3861 $ cd issue3861 $ hg init src $ hg clone -q src dst $ echo a > src/a $ hg -R src commit -Aqm "#0" Invoking status precommit hook A a $ cat >> dst/.hg/hgrc < [extensions] > largefiles= > EOF $ hg -R dst pull --rebase pulling from $TESTTMP/issue3861/src requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets bf5e395ced2c nothing to rebase - updating instead 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd .. mercurial-4.5.3/tests/test-hg-parseurl.py0000644015407300116100000000110413261161234020313 0ustar augieeng00000000000000from __future__ import absolute_import, print_function from mercurial import ( hg, ) def testparse(url, branch=[]): print('%s, branches: %r' % hg.parseurl(url, branch)) testparse('http://example.com/no/anchor') testparse('http://example.com/an/anchor#foo') testparse('http://example.com/no/anchor/branches', branch=['foo']) testparse('http://example.com/an/anchor/branches#bar', branch=['foo']) testparse('http://example.com/an/anchor/branches-None#foo', branch=None) testparse('http://example.com/') testparse('http://example.com') testparse('http://example.com#foo') mercurial-4.5.3/tests/test-hgweb-csp.t0000644015407300116100000001070113261161234017557 0ustar augieeng00000000000000#require serve $ cat > web.conf << EOF > [paths] > / = $TESTTMP/* > EOF $ hg init repo1 $ cd repo1 $ touch foo $ hg -q commit -A -m initial $ cd .. $ hg serve -p $HGPORT -d --pid-file=hg.pid --web-conf web.conf $ cat hg.pid >> $DAEMON_PIDS repo index should not send Content-Security-Policy header by default $ get-with-headers.py --headeronly localhost:$HGPORT '' content-security-policy etag 200 Script output follows static page should not send CSP by default $ get-with-headers.py --headeronly localhost:$HGPORT static/mercurial.js content-security-policy etag 200 Script output follows repo page should not send CSP by default, should send ETag $ get-with-headers.py --headeronly localhost:$HGPORT repo1 content-security-policy etag 200 Script output follows etag: W/"*" (glob) $ killdaemons.py Configure CSP without nonce $ cat >> web.conf << EOF > [web] > csp = script-src https://example.com/ 'unsafe-inline' > EOF $ hg serve -p $HGPORT -d --pid-file=hg.pid --web-conf web.conf $ cat hg.pid > $DAEMON_PIDS repo index should send Content-Security-Policy header when enabled $ get-with-headers.py --headeronly localhost:$HGPORT '' content-security-policy etag 200 Script output follows content-security-policy: script-src https://example.com/ 'unsafe-inline' static page should send CSP when enabled $ get-with-headers.py --headeronly localhost:$HGPORT static/mercurial.js content-security-policy etag 200 Script output follows content-security-policy: script-src https://example.com/ 'unsafe-inline' repo page should send CSP by default, include etag w/o nonce $ get-with-headers.py --headeronly localhost:$HGPORT repo1 content-security-policy etag 200 Script output follows content-security-policy: script-src https://example.com/ 'unsafe-inline' etag: W/"*" (glob) nonce should not be added to html if CSP doesn't use it $ get-with-headers.py localhost:$HGPORT repo1/graph/tip | egrep 'content-security-policy| test: f4fca47b67e6 primes.py

    view primes.py @ 0:f4fca47b67e6 draft default tip

    a
    author test
    date Thu, 01 Jan 1970 00:00:00 +0000
    parents
    children
    line wrap: on
    line source
      
      """Fun with generators. Corresponding Haskell implementation:
      
      primes = 2 : sieve [3, 5..]
          where sieve (p:ns) = p : sieve [n | n <- ns, mod n p /= 0]
      """
      
      from itertools import dropwhile, ifilter, islice, count, chain
      
      def primes():
          """Generate all primes."""
          def sieve(ns):
              p = ns.next()
              # It is important to yield *here* in order to stop the
              # infinite recursion.
              yield p
              ns = ifilter(lambda n: n % p != 0, ns)
              for n in sieve(ns):
                  yield n
      
          odds = ifilter(lambda i: i % 2 == 1, count())
          return chain([2], sieve(dropwhile(lambda n: n < 3, odds)))
      
      if __name__ == "__main__":
          import sys
          try:
              n = int(sys.argv[1])
          except (ValueError, IndexError):
              n = 10
          p = primes()
          print("The first %d primes: %s" % (n, list(islice(p, n))))
      
      
    hgweb fileannotate, html $ (get-with-headers.py localhost:$HGPORT 'annotate/tip/primes.py') | filterhtml 200 Script output follows test: primes.py annotate

    annotate primes.py @ 0:f4fca47b67e6 draft default tip

    a
    author test
    date Thu, 01 Jan 1970 00:00:00 +0000
    parents
    children
    Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
    rev   line source
    0
    test
    parents:
    diff changeset
    1 """Fun with generators. Corresponding Haskell implementation:
    test
    parents:
    diff changeset
    2
    test
    parents:
    diff changeset
    3 primes = 2 : sieve [3, 5..]
    test
    parents:
    diff changeset
    4 where sieve (p:ns) = p : sieve [n | n <- ns, mod n p /= 0]
    test
    parents:
    diff changeset
    5 """
    test
    parents:
    diff changeset
    6
    test
    parents:
    diff changeset
    7 from itertools import dropwhile, ifilter, islice, count, chain
    test
    parents:
    diff changeset
    8
    test
    parents:
    diff changeset
    9 def primes():
    test
    parents:
    diff changeset
    10 """Generate all primes."""
    test
    parents:
    diff changeset
    11 def sieve(ns):
    test
    parents:
    diff changeset
    12 p = ns.next()
    test
    parents:
    diff changeset
    13 # It is important to yield *here* in order to stop the
    test
    parents:
    diff changeset
    14 # infinite recursion.
    test
    parents:
    diff changeset
    15 yield p
    test
    parents:
    diff changeset
    16 ns = ifilter(lambda n: n % p != 0, ns)
    test
    parents:
    diff changeset
    17 for n in sieve(ns):
    test
    parents:
    diff changeset
    18 yield n
    test
    parents:
    diff changeset
    19
    test
    parents:
    diff changeset
    20 odds = ifilter(lambda i: i % 2 == 1, count())
    test
    parents:
    diff changeset
    21 return chain([2], sieve(dropwhile(lambda n: n < 3, odds)))
    test
    parents:
    diff changeset
    22
    test
    parents:
    diff changeset
    23 if __name__ == "__main__":
    test
    parents:
    diff changeset
    24 import sys
    test
    parents:
    diff changeset
    25 try:
    test
    parents:
    diff changeset
    26 n = int(sys.argv[1])
    test
    parents:
    diff changeset
    27 except (ValueError, IndexError):
    test
    parents:
    diff changeset
    28 n = 10
    test
    parents:
    diff changeset
    29 p = primes()
    test
    parents:
    diff changeset
    30 print("The first %d primes: %s" % (n, list(islice(p, n))))
    test
    parents:
    diff changeset
    31
    hgweb fileannotate, raw $ (get-with-headers.py localhost:$HGPORT 'annotate/tip/primes.py?style=raw') \ > | sed "s/test@//" > a $ echo "200 Script output follows" > b $ echo "" >> b $ echo "" >> b $ hg annotate "primes.py" >> b $ echo "" >> b $ echo "" >> b $ echo "" >> b $ echo "" >> b $ cmp b a || diff -u b a hgweb filerevision, raw $ (get-with-headers.py localhost:$HGPORT 'file/tip/primes.py?style=raw') \ > > a $ echo "200 Script output follows" > b $ echo "" >> b $ hg cat primes.py >> b $ cmp b a || diff -u b a hgweb highlightcss friendly $ get-with-headers.py localhost:$HGPORT 'highlightcss' > out $ head -n 4 out 200 Script output follows /* pygments_style = friendly */ $ rm out errors encountered $ cat errors.log $ killdaemons.py Change the pygments style $ cat > .hg/hgrc < [web] > pygments_style = fruity > EOF hg serve again $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS hgweb highlightcss fruity $ get-with-headers.py localhost:$HGPORT 'highlightcss' > out $ head -n 4 out 200 Script output follows /* pygments_style = fruity */ $ rm out errors encountered $ cat errors.log $ killdaemons.py only highlight C source files $ cat > .hg/hgrc < [web] > highlightfiles = **.c > EOF hg serve again $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS test that fileset in highlightfiles works and primes.py is not highlighted $ get-with-headers.py localhost:$HGPORT 'file/tip/primes.py' | grep 'id="l11"' def sieve(ns): errors encountered $ cat errors.log $ cd .. $ hg init eucjp $ cd eucjp $ $PYTHON -c 'print("\265\376")' >> eucjp.txt # Japanese kanji "Kyo" $ hg ci -Ama adding eucjp.txt $ hgserveget () { > killdaemons.py > echo % HGENCODING="$1" hg serve > HGENCODING="$1" hg serve -p $HGPORT -d -n test --pid-file=hg.pid -E errors.log > cat hg.pid >> $DAEMON_PIDS > > echo % hgweb filerevision, html > get-with-headers.py localhost:$HGPORT "file/tip/$2" \ > | grep '
    ' > echo % errors encountered > cat errors.log > } $ hgserveget euc-jp eucjp.txt % HGENCODING=euc-jp hg serve % hgweb filerevision, html % errors encountered $ hgserveget utf-8 eucjp.txt % HGENCODING=utf-8 hg serve % hgweb filerevision, html % errors encountered $ hgserveget us-ascii eucjp.txt % HGENCODING=us-ascii hg serve % hgweb filerevision, html % errors encountered We attempt to highlight unknown files by default $ killdaemons.py $ cat > .hg/hgrc << EOF > [web] > highlightfiles = ** > EOF $ cat > unknownfile << EOF > #!$PYTHON > def foo(): > pass > EOF $ hg add unknownfile $ hg commit -m unknown unknownfile $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT 'file/tip/unknownfile' | grep l2 def foo(): We can prevent Pygments from falling back to a non filename-based detection mode $ cat > .hg/hgrc << EOF > [web] > highlightfiles = ** > highlightonlymatchfilename = true > EOF $ killdaemons.py $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT 'file/tip/unknownfile' | grep l2 def foo(): $ cd .. mercurial-4.5.3/tests/test-parents.t0000644015407300116100000000610513261161234017357 0ustar augieeng00000000000000test parents command $ hg init repo $ cd repo no working directory $ hg parents $ echo a > a $ echo b > b $ hg ci -Amab -d '0 0' adding a adding b $ echo a >> a $ hg ci -Ama -d '1 0' $ echo b >> b $ hg ci -Amb -d '2 0' $ echo c > c $ hg ci -Amc -d '3 0' adding c $ hg up -C 1 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo d > c $ hg ci -Amc2 -d '4 0' adding c created new head $ hg up -C 3 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg parents changeset: 3:02d851b7e549 user: test date: Thu Jan 01 00:00:03 1970 +0000 summary: c $ hg parents a changeset: 1:d786049f033a user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: a hg parents c, single revision $ hg parents c changeset: 3:02d851b7e549 user: test date: Thu Jan 01 00:00:03 1970 +0000 summary: c $ hg parents -r 3 c abort: 'c' not found in manifest! [255] $ hg parents -r 2 changeset: 1:d786049f033a user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: a $ hg parents -r 2 a changeset: 1:d786049f033a user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: a $ hg parents -r 2 ../a abort: ../a not under root '$TESTTMP/repo' [255] cd dir; hg parents -r 2 ../a $ mkdir dir $ cd dir $ hg parents -r 2 ../a changeset: 1:d786049f033a user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: a $ hg parents -r 2 path:a changeset: 1:d786049f033a user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: a $ cd .. $ hg parents -r 2 glob:a abort: can only specify an explicit filename [255] merge working dir with 2 parents, hg parents c $ HGMERGE=true hg merge merging c 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg parents c changeset: 3:02d851b7e549 user: test date: Thu Jan 01 00:00:03 1970 +0000 summary: c changeset: 4:48cee28d4b4e tag: tip parent: 1:d786049f033a user: test date: Thu Jan 01 00:00:04 1970 +0000 summary: c2 merge working dir with 1 parent, hg parents $ hg up -C 2 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ HGMERGE=true hg merge -r 4 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg parents changeset: 2:6cfac479f009 user: test date: Thu Jan 01 00:00:02 1970 +0000 summary: b changeset: 4:48cee28d4b4e tag: tip parent: 1:d786049f033a user: test date: Thu Jan 01 00:00:04 1970 +0000 summary: c2 merge working dir with 1 parent, hg parents c $ hg parents c changeset: 4:48cee28d4b4e tag: tip parent: 1:d786049f033a user: test date: Thu Jan 01 00:00:04 1970 +0000 summary: c2 $ cd .. mercurial-4.5.3/tests/test-xdg.t0000644015407300116100000000041013261161234016456 0ustar augieeng00000000000000#if no-windows no-osx $ mkdir -p xdgconf/hg $ echo '[ui]' > xdgconf/hg/hgrc $ echo 'username = foobar' >> xdgconf/hg/hgrc $ XDG_CONFIG_HOME="`pwd`/xdgconf" ; export XDG_CONFIG_HOME $ unset HGRCPATH $ hg config ui.username 2>/dev/null foobar #endif mercurial-4.5.3/tests/test-changelog-exec.t0000644015407300116100000000216413261161234020555 0ustar augieeng00000000000000#require execbit b51a8138292a introduced a regression where we would mention in the changelog executable files added by the second parent of a merge. Test that that doesn't happen anymore $ hg init repo $ cd repo $ echo foo > foo $ hg ci -qAm 'add foo' $ echo bar > bar $ chmod +x bar $ hg ci -qAm 'add bar' manifest of p2: $ hg manifest bar foo $ hg up -qC 0 $ echo >> foo $ hg ci -m 'change foo' created new head manifest of p1: $ hg manifest foo $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ chmod +x foo $ hg ci -m 'merge' this should not mention bar but should mention foo: $ hg tip -v changeset: 3:c53d17ff3380 tag: tip parent: 2:ed1b79f46b9a parent: 1:d394a8db219b user: test date: Thu Jan 01 00:00:00 1970 +0000 files: foo description: merge $ hg debugindex bar rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 5 ..... 1 b004912a8510 000000000000 000000000000 (re) $ cd .. mercurial-4.5.3/tests/test-ui-config.py0000644015407300116100000001044013261161234017745 0ustar augieeng00000000000000from __future__ import absolute_import, print_function from mercurial import ( dispatch, error, ui as uimod, ) testui = uimod.ui.load() # disable the configuration registration warning # # the purpose of this test is to check the old behavior, not to validate the # behavior from registered item. so we silent warning related to unregisted # config. testui.setconfig('devel', 'warn-config-unknown', False, 'test') testui.setconfig('devel', 'all-warnings', False, 'test') parsed = dispatch._parseconfig(testui, [ 'values.string=string value', 'values.bool1=true', 'values.bool2=false', 'values.boolinvalid=foo', 'values.int1=42', 'values.int2=-42', 'values.intinvalid=foo', 'lists.list1=foo', 'lists.list2=foo bar baz', 'lists.list3=alice, bob', 'lists.list4=foo bar baz alice, bob', 'lists.list5=abc d"ef"g "hij def"', 'lists.list6="hello world", "how are you?"', 'lists.list7=Do"Not"Separate', 'lists.list8="Do"Separate', 'lists.list9="Do\\"NotSeparate"', 'lists.list10=string "with extraneous" quotation mark"', 'lists.list11=x, y', 'lists.list12="x", "y"', 'lists.list13=""" key = "x", "y" """', 'lists.list14=,,,, ', 'lists.list15=" just with starting quotation', 'lists.list16="longer quotation" with "no ending quotation', 'lists.list17=this is \\" "not a quotation mark"', 'lists.list18=\n \n\nding\ndong', 'date.epoch=0 0', 'date.birth=2005-04-19T00:00:00', 'date.invalid=0' ]) print(repr(testui.configitems('values'))) print(repr(testui.configitems('lists'))) print("---") print(repr(testui.config('values', 'string'))) print(repr(testui.config('values', 'bool1'))) print(repr(testui.config('values', 'bool2'))) print(repr(testui.config('values', 'unknown'))) print("---") try: print(repr(testui.configbool('values', 'string'))) except error.ConfigError as inst: print(inst) print(repr(testui.configbool('values', 'bool1'))) print(repr(testui.configbool('values', 'bool2'))) print(repr(testui.configbool('values', 'bool2', True))) print(repr(testui.configbool('values', 'unknown'))) print(repr(testui.configbool('values', 'unknown', True))) print("---") print(repr(testui.configint('values', 'int1'))) print(repr(testui.configint('values', 'int2'))) print("---") print(repr(testui.configlist('lists', 'list1'))) print(repr(testui.configlist('lists', 'list2'))) print(repr(testui.configlist('lists', 'list3'))) print(repr(testui.configlist('lists', 'list4'))) print(repr(testui.configlist('lists', 'list4', ['foo']))) print(repr(testui.configlist('lists', 'list5'))) print(repr(testui.configlist('lists', 'list6'))) print(repr(testui.configlist('lists', 'list7'))) print(repr(testui.configlist('lists', 'list8'))) print(repr(testui.configlist('lists', 'list9'))) print(repr(testui.configlist('lists', 'list10'))) print(repr(testui.configlist('lists', 'list11'))) print(repr(testui.configlist('lists', 'list12'))) print(repr(testui.configlist('lists', 'list13'))) print(repr(testui.configlist('lists', 'list14'))) print(repr(testui.configlist('lists', 'list15'))) print(repr(testui.configlist('lists', 'list16'))) print(repr(testui.configlist('lists', 'list17'))) print(repr(testui.configlist('lists', 'list18'))) print(repr(testui.configlist('lists', 'unknown'))) print(repr(testui.configlist('lists', 'unknown', ''))) print(repr(testui.configlist('lists', 'unknown', 'foo'))) print(repr(testui.configlist('lists', 'unknown', ['foo']))) print(repr(testui.configlist('lists', 'unknown', 'foo bar'))) print(repr(testui.configlist('lists', 'unknown', 'foo, bar'))) print(repr(testui.configlist('lists', 'unknown', ['foo bar']))) print(repr(testui.configlist('lists', 'unknown', ['foo', 'bar']))) print("---") print(repr(testui.configdate('date', 'epoch'))) print(repr(testui.configdate('date', 'birth'))) print(repr(testui.config('values', 'String'))) def function(): pass # values that aren't strings should work testui.setconfig('hook', 'commit', function) print(function == testui.config('hook', 'commit')) # invalid values try: testui.configbool('values', 'boolinvalid') except error.ConfigError: print('boolinvalid') try: testui.configint('values', 'intinvalid') except error.ConfigError: print('intinvalid') try: testui.configdate('date', 'invalid') except error.ConfigError: print('dateinvalid') mercurial-4.5.3/tests/test-bisect2.t0000644015407300116100000004677313261161234017255 0ustar augieeng00000000000000# The tests in test-bisect are done on a linear history. Here the # following repository history is used for testing: # # 17 # | # 18 16 # \ / # 15 # / \ # / \ # 10 13 # / \ | # / \ | 14 # 7 6 9 12 / # \ / \ | |/ # 4 \ | 11 # \ \ | / # 3 5 | / # \ / |/ # 2 8 # \ / # 1 # | # 0 init $ hg init committing changes $ echo > a $ echo '0' >> a $ hg add a $ hg ci -m "0" -d "0 0" $ echo '1' >> a $ hg ci -m "1" -d "1 0" $ echo '2' >> a $ hg ci -m "2" -d "2 0" $ echo '3' >> a $ hg ci -m "3" -d "3 0" $ echo '4' >> a $ hg ci -m "4" -d "4 0" create branch $ hg up -r 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo '5' >> b $ hg add b $ hg ci -m "5" -d "5 0" created new head merge $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m "merge 4,5" -d "6 0" create branch $ hg up -r 4 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo '7' > c $ hg add c $ hg ci -m "7" -d "7 0" created new head create branch $ hg up -r 1 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo '8' > d $ hg add d $ hg ci -m "8" -d "8 0" created new head $ echo '9' >> d $ hg ci -m "9" -d "9 0" merge $ hg merge -r 6 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m "merge 6,9" -d "10 0" create branch $ hg up -r 8 2 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo '11' > e $ hg add e $ hg ci -m "11" -d "11 0" created new head $ echo '12' >> e $ hg ci -m "12" -d "12 0" $ echo '13' >> e $ hg ci -m "13" -d "13 0" create branch $ hg up -r 11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo '14' > f $ hg add f $ hg ci -m "14" -d "14 0" created new head merge $ hg up -r 13 -C 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg merge -r 10 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m "merge 10,13" -d "15 0" $ echo '16' >> e $ hg ci -m "16" -d "16 0" $ echo '17' >> e $ hg ci -m "17" -d "17 0" create branch $ hg up -r 15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo '18' >> e $ hg ci -m "18" -d "18 0" created new head log $ hg log changeset: 18:d42e18c7bc9b tag: tip parent: 15:857b178a7cf3 user: test date: Thu Jan 01 00:00:18 1970 +0000 summary: 18 changeset: 17:228c06deef46 user: test date: Thu Jan 01 00:00:17 1970 +0000 summary: 17 changeset: 16:609d82a7ebae user: test date: Thu Jan 01 00:00:16 1970 +0000 summary: 16 changeset: 15:857b178a7cf3 parent: 13:b0a32c86eb31 parent: 10:429fcd26f52d user: test date: Thu Jan 01 00:00:15 1970 +0000 summary: merge 10,13 changeset: 14:faa450606157 parent: 11:82ca6f06eccd user: test date: Thu Jan 01 00:00:14 1970 +0000 summary: 14 changeset: 13:b0a32c86eb31 user: test date: Thu Jan 01 00:00:13 1970 +0000 summary: 13 changeset: 12:9f259202bbe7 user: test date: Thu Jan 01 00:00:12 1970 +0000 summary: 12 changeset: 11:82ca6f06eccd parent: 8:dab8161ac8fc user: test date: Thu Jan 01 00:00:11 1970 +0000 summary: 11 changeset: 10:429fcd26f52d parent: 9:3c77083deb4a parent: 6:a214d5d3811a user: test date: Thu Jan 01 00:00:10 1970 +0000 summary: merge 6,9 changeset: 9:3c77083deb4a user: test date: Thu Jan 01 00:00:09 1970 +0000 summary: 9 changeset: 8:dab8161ac8fc parent: 1:4ca5088da217 user: test date: Thu Jan 01 00:00:08 1970 +0000 summary: 8 changeset: 7:50c76098bbf2 parent: 4:5c668c22234f user: test date: Thu Jan 01 00:00:07 1970 +0000 summary: 7 changeset: 6:a214d5d3811a parent: 5:385a529b6670 parent: 4:5c668c22234f user: test date: Thu Jan 01 00:00:06 1970 +0000 summary: merge 4,5 changeset: 5:385a529b6670 parent: 2:051e12f87bf1 user: test date: Thu Jan 01 00:00:05 1970 +0000 summary: 5 changeset: 4:5c668c22234f user: test date: Thu Jan 01 00:00:04 1970 +0000 summary: 4 changeset: 3:0950834f0a9c user: test date: Thu Jan 01 00:00:03 1970 +0000 summary: 3 changeset: 2:051e12f87bf1 user: test date: Thu Jan 01 00:00:02 1970 +0000 summary: 2 changeset: 1:4ca5088da217 user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: 1 changeset: 0:33b1f9bc8bc5 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 0 hg up -C $ hg up -C 0 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to "d42e18c7bc9b: 18" 3 other heads for branch "default" complex bisect test 1 # first bad rev is 9 $ hg bisect -r $ hg bisect -g 0 $ hg bisect -b 17 # -> update to rev 6 Testing changeset 6:a214d5d3811a (15 changesets remaining, ~3 tests) 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg log -q -r 'bisect(pruned)' 0:33b1f9bc8bc5 17:228c06deef46 $ hg log -q -r 'bisect(untested)' 1:4ca5088da217 2:051e12f87bf1 3:0950834f0a9c 4:5c668c22234f 5:385a529b6670 6:a214d5d3811a 8:dab8161ac8fc 9:3c77083deb4a 10:429fcd26f52d 11:82ca6f06eccd 12:9f259202bbe7 13:b0a32c86eb31 15:857b178a7cf3 16:609d82a7ebae $ hg log -q -r 'bisect(ignored)' $ hg bisect -g # -> update to rev 13 Testing changeset 13:b0a32c86eb31 (9 changesets remaining, ~3 tests) 3 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg bisect -s # -> update to rev 10 Testing changeset 10:429fcd26f52d (9 changesets remaining, ~3 tests) 3 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg bisect -b # -> update to rev 8 Testing changeset 8:dab8161ac8fc (3 changesets remaining, ~1 tests) 2 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg bisect -g # -> update to rev 9 Testing changeset 9:3c77083deb4a (2 changesets remaining, ~1 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -b The first bad revision is: changeset: 9:3c77083deb4a user: test date: Thu Jan 01 00:00:09 1970 +0000 summary: 9 $ hg log -q -r 'bisect(range)' 0:33b1f9bc8bc5 1:4ca5088da217 2:051e12f87bf1 3:0950834f0a9c 4:5c668c22234f 5:385a529b6670 6:a214d5d3811a 8:dab8161ac8fc 9:3c77083deb4a 10:429fcd26f52d 11:82ca6f06eccd 12:9f259202bbe7 13:b0a32c86eb31 15:857b178a7cf3 16:609d82a7ebae 17:228c06deef46 $ hg log -q -r 'bisect(pruned)' 0:33b1f9bc8bc5 1:4ca5088da217 2:051e12f87bf1 3:0950834f0a9c 4:5c668c22234f 5:385a529b6670 6:a214d5d3811a 8:dab8161ac8fc 9:3c77083deb4a 10:429fcd26f52d 13:b0a32c86eb31 15:857b178a7cf3 16:609d82a7ebae 17:228c06deef46 18:d42e18c7bc9b $ hg log -q -r 'bisect(untested)' 11:82ca6f06eccd 12:9f259202bbe7 $ hg log -q -r 'bisect(goods)' 0:33b1f9bc8bc5 1:4ca5088da217 2:051e12f87bf1 3:0950834f0a9c 4:5c668c22234f 5:385a529b6670 6:a214d5d3811a 8:dab8161ac8fc $ hg log -q -r 'bisect(bads)' 9:3c77083deb4a 10:429fcd26f52d 15:857b178a7cf3 16:609d82a7ebae 17:228c06deef46 18:d42e18c7bc9b complex bisect test 2 # first good rev is 13 $ hg bisect -r $ hg bisect -g 18 $ hg bisect -b 1 # -> update to rev 6 Testing changeset 6:a214d5d3811a (13 changesets remaining, ~3 tests) 2 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg bisect -s # -> update to rev 10 Testing changeset 10:429fcd26f52d (13 changesets remaining, ~3 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg log -q -r 'bisect(pruned)' 0:33b1f9bc8bc5 1:4ca5088da217 6:a214d5d3811a 18:d42e18c7bc9b $ hg bisect -b # -> update to rev 12 Testing changeset 12:9f259202bbe7 (5 changesets remaining, ~2 tests) 3 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg log -q -r 'bisect(pruned)' 0:33b1f9bc8bc5 1:4ca5088da217 2:051e12f87bf1 3:0950834f0a9c 4:5c668c22234f 5:385a529b6670 6:a214d5d3811a 8:dab8161ac8fc 9:3c77083deb4a 10:429fcd26f52d 18:d42e18c7bc9b $ hg log -q -r 'bisect(untested)' 11:82ca6f06eccd 12:9f259202bbe7 13:b0a32c86eb31 15:857b178a7cf3 $ hg bisect -b # -> update to rev 13 Testing changeset 13:b0a32c86eb31 (3 changesets remaining, ~1 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -g The first good revision is: changeset: 13:b0a32c86eb31 user: test date: Thu Jan 01 00:00:13 1970 +0000 summary: 13 $ hg log -q -r 'bisect(range)' 1:4ca5088da217 2:051e12f87bf1 3:0950834f0a9c 4:5c668c22234f 5:385a529b6670 6:a214d5d3811a 8:dab8161ac8fc 9:3c77083deb4a 10:429fcd26f52d 11:82ca6f06eccd 12:9f259202bbe7 13:b0a32c86eb31 15:857b178a7cf3 18:d42e18c7bc9b complex bisect test 3 first bad rev is 15 10,9,13 are skipped an might be the first bad revisions as well $ hg bisect -r $ hg bisect -g 1 $ hg bisect -b 16 # -> update to rev 6 Testing changeset 6:a214d5d3811a (13 changesets remaining, ~3 tests) 2 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg log -q -r 'bisect(pruned)' 0:33b1f9bc8bc5 1:4ca5088da217 16:609d82a7ebae 17:228c06deef46 $ hg bisect -g # -> update to rev 13 Testing changeset 13:b0a32c86eb31 (8 changesets remaining, ~3 tests) 3 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg bisect -s # -> update to rev 10 Testing changeset 10:429fcd26f52d (8 changesets remaining, ~3 tests) 3 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg bisect -s # -> update to rev 12 Testing changeset 12:9f259202bbe7 (8 changesets remaining, ~3 tests) 3 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg log -q -r 'bisect(pruned)' 0:33b1f9bc8bc5 1:4ca5088da217 2:051e12f87bf1 3:0950834f0a9c 4:5c668c22234f 5:385a529b6670 6:a214d5d3811a 10:429fcd26f52d 13:b0a32c86eb31 16:609d82a7ebae 17:228c06deef46 $ hg bisect -g # -> update to rev 9 Testing changeset 9:3c77083deb4a (5 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg bisect -s # -> update to rev 15 Testing changeset 15:857b178a7cf3 (5 changesets remaining, ~2 tests) 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg log -q -r 'bisect(ignored)' $ hg bisect -b Due to skipped revisions, the first bad revision could be any of: changeset: 9:3c77083deb4a user: test date: Thu Jan 01 00:00:09 1970 +0000 summary: 9 changeset: 10:429fcd26f52d parent: 9:3c77083deb4a parent: 6:a214d5d3811a user: test date: Thu Jan 01 00:00:10 1970 +0000 summary: merge 6,9 changeset: 13:b0a32c86eb31 user: test date: Thu Jan 01 00:00:13 1970 +0000 summary: 13 changeset: 15:857b178a7cf3 parent: 13:b0a32c86eb31 parent: 10:429fcd26f52d user: test date: Thu Jan 01 00:00:15 1970 +0000 summary: merge 10,13 $ hg log -q -r 'bisect(range)' 1:4ca5088da217 2:051e12f87bf1 3:0950834f0a9c 4:5c668c22234f 5:385a529b6670 6:a214d5d3811a 8:dab8161ac8fc 9:3c77083deb4a 10:429fcd26f52d 11:82ca6f06eccd 12:9f259202bbe7 13:b0a32c86eb31 15:857b178a7cf3 16:609d82a7ebae $ hg log -q -r 'bisect(ignored)' complex bisect test 4 first good revision is 17 15,16 are skipped an might be the first good revisions as well $ hg bisect -r $ hg bisect -g 17 $ hg bisect -b 8 # -> update to rev 10 Testing changeset 13:b0a32c86eb31 (8 changesets remaining, ~3 tests) 2 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg bisect -b # -> update to rev 13 Testing changeset 10:429fcd26f52d (5 changesets remaining, ~2 tests) 3 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg bisect -b # -> update to rev 15 Testing changeset 15:857b178a7cf3 (3 changesets remaining, ~1 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg log -q -r 'bisect(pruned)' 0:33b1f9bc8bc5 1:4ca5088da217 2:051e12f87bf1 3:0950834f0a9c 4:5c668c22234f 5:385a529b6670 6:a214d5d3811a 8:dab8161ac8fc 9:3c77083deb4a 10:429fcd26f52d 11:82ca6f06eccd 12:9f259202bbe7 13:b0a32c86eb31 17:228c06deef46 $ hg bisect -s # -> update to rev 16 Testing changeset 16:609d82a7ebae (3 changesets remaining, ~1 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg log -q -r 'bisect(pruned)' 0:33b1f9bc8bc5 1:4ca5088da217 2:051e12f87bf1 3:0950834f0a9c 4:5c668c22234f 5:385a529b6670 6:a214d5d3811a 8:dab8161ac8fc 9:3c77083deb4a 10:429fcd26f52d 11:82ca6f06eccd 12:9f259202bbe7 13:b0a32c86eb31 15:857b178a7cf3 17:228c06deef46 $ hg bisect -s Due to skipped revisions, the first good revision could be any of: changeset: 15:857b178a7cf3 parent: 13:b0a32c86eb31 parent: 10:429fcd26f52d user: test date: Thu Jan 01 00:00:15 1970 +0000 summary: merge 10,13 changeset: 16:609d82a7ebae user: test date: Thu Jan 01 00:00:16 1970 +0000 summary: 16 changeset: 17:228c06deef46 user: test date: Thu Jan 01 00:00:17 1970 +0000 summary: 17 $ hg log -q -r 'bisect(range)' 8:dab8161ac8fc 9:3c77083deb4a 10:429fcd26f52d 11:82ca6f06eccd 12:9f259202bbe7 13:b0a32c86eb31 15:857b178a7cf3 16:609d82a7ebae 17:228c06deef46 $ hg log -q -r 'bisect(pruned)' 0:33b1f9bc8bc5 1:4ca5088da217 2:051e12f87bf1 3:0950834f0a9c 4:5c668c22234f 5:385a529b6670 6:a214d5d3811a 8:dab8161ac8fc 9:3c77083deb4a 10:429fcd26f52d 11:82ca6f06eccd 12:9f259202bbe7 13:b0a32c86eb31 15:857b178a7cf3 16:609d82a7ebae 17:228c06deef46 test unrelated revs: $ hg bisect --reset $ hg bisect -b 7 $ hg bisect -g 14 abort: starting revisions are not directly related [255] $ hg log -q -r 'bisect(range)' $ hg log -q -r 'bisect(pruned)' 0:33b1f9bc8bc5 1:4ca5088da217 2:051e12f87bf1 3:0950834f0a9c 4:5c668c22234f 7:50c76098bbf2 14:faa450606157 $ hg bisect --reset end at merge: 17 bad, 11 good (but 9 is first bad) $ hg bisect -r $ hg bisect -b 17 $ hg bisect -g 11 Testing changeset 13:b0a32c86eb31 (5 changesets remaining, ~2 tests) 3 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg log -q -r 'bisect(ignored)' 2:051e12f87bf1 3:0950834f0a9c 4:5c668c22234f 5:385a529b6670 6:a214d5d3811a 9:3c77083deb4a 10:429fcd26f52d $ hg bisect -g Testing changeset 15:857b178a7cf3 (3 changesets remaining, ~1 tests) 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -b The first bad revision is: changeset: 15:857b178a7cf3 parent: 13:b0a32c86eb31 parent: 10:429fcd26f52d user: test date: Thu Jan 01 00:00:15 1970 +0000 summary: merge 10,13 Not all ancestors of this changeset have been checked. Use bisect --extend to continue the bisection from the common ancestor, dab8161ac8fc. $ hg log -q -r 'bisect(range)' 11:82ca6f06eccd 12:9f259202bbe7 13:b0a32c86eb31 15:857b178a7cf3 16:609d82a7ebae 17:228c06deef46 $ hg log -q -r 'bisect(pruned)' 0:33b1f9bc8bc5 1:4ca5088da217 8:dab8161ac8fc 11:82ca6f06eccd 12:9f259202bbe7 13:b0a32c86eb31 15:857b178a7cf3 16:609d82a7ebae 17:228c06deef46 18:d42e18c7bc9b $ hg log -q -r 'bisect(untested)' $ hg log -q -r 'bisect(ignored)' 2:051e12f87bf1 3:0950834f0a9c 4:5c668c22234f 5:385a529b6670 6:a214d5d3811a 9:3c77083deb4a 10:429fcd26f52d $ hg bisect --extend Extending search to changeset 8:dab8161ac8fc 2 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg log -q -r 'bisect(untested)' $ hg log -q -r 'bisect(ignored)' 2:051e12f87bf1 3:0950834f0a9c 4:5c668c22234f 5:385a529b6670 6:a214d5d3811a 9:3c77083deb4a 10:429fcd26f52d $ hg bisect -g # dab8161ac8fc Testing changeset 9:3c77083deb4a (3 changesets remaining, ~1 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg log -q -r 'bisect(untested)' 9:3c77083deb4a 10:429fcd26f52d $ hg log -q -r 'bisect(ignored)' 2:051e12f87bf1 3:0950834f0a9c 4:5c668c22234f 5:385a529b6670 6:a214d5d3811a $ hg log -q -r 'bisect(goods)' 0:33b1f9bc8bc5 1:4ca5088da217 8:dab8161ac8fc 11:82ca6f06eccd 12:9f259202bbe7 13:b0a32c86eb31 $ hg log -q -r 'bisect(bads)' 15:857b178a7cf3 16:609d82a7ebae 17:228c06deef46 18:d42e18c7bc9b $ hg bisect -b The first bad revision is: changeset: 9:3c77083deb4a user: test date: Thu Jan 01 00:00:09 1970 +0000 summary: 9 $ hg log -q -r 'bisect(range)' 8:dab8161ac8fc 9:3c77083deb4a 10:429fcd26f52d 11:82ca6f06eccd 12:9f259202bbe7 13:b0a32c86eb31 15:857b178a7cf3 16:609d82a7ebae 17:228c06deef46 $ hg log -q -r 'bisect(pruned)' 0:33b1f9bc8bc5 1:4ca5088da217 8:dab8161ac8fc 9:3c77083deb4a 10:429fcd26f52d 11:82ca6f06eccd 12:9f259202bbe7 13:b0a32c86eb31 15:857b178a7cf3 16:609d82a7ebae 17:228c06deef46 18:d42e18c7bc9b $ hg log -q -r 'bisect(untested)' $ hg log -q -r 'bisect(ignored)' 2:051e12f87bf1 3:0950834f0a9c 4:5c668c22234f 5:385a529b6670 6:a214d5d3811a $ hg log -q -r 'bisect(goods)' 0:33b1f9bc8bc5 1:4ca5088da217 8:dab8161ac8fc 11:82ca6f06eccd 12:9f259202bbe7 13:b0a32c86eb31 $ hg log -q -r 'bisect(bads)' 9:3c77083deb4a 10:429fcd26f52d 15:857b178a7cf3 16:609d82a7ebae 17:228c06deef46 18:d42e18c7bc9b user adds irrelevant but consistent information (here: -g 2) to bisect state $ hg bisect -r $ hg bisect -b 13 $ hg bisect -g 8 Testing changeset 11:82ca6f06eccd (3 changesets remaining, ~1 tests) 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg log -q -r 'bisect(untested)' 11:82ca6f06eccd 12:9f259202bbe7 $ hg bisect -g 2 Testing changeset 11:82ca6f06eccd (3 changesets remaining, ~1 tests) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg log -q -r 'bisect(untested)' 11:82ca6f06eccd 12:9f259202bbe7 $ hg bisect -b The first bad revision is: changeset: 11:82ca6f06eccd parent: 8:dab8161ac8fc user: test date: Thu Jan 01 00:00:11 1970 +0000 summary: 11 $ hg log -q -r 'bisect(range)' 8:dab8161ac8fc 11:82ca6f06eccd 12:9f259202bbe7 13:b0a32c86eb31 $ hg log -q -r 'bisect(pruned)' 0:33b1f9bc8bc5 1:4ca5088da217 2:051e12f87bf1 8:dab8161ac8fc 11:82ca6f06eccd 12:9f259202bbe7 13:b0a32c86eb31 14:faa450606157 15:857b178a7cf3 16:609d82a7ebae 17:228c06deef46 18:d42e18c7bc9b $ hg log -q -r 'bisect(untested)' mercurial-4.5.3/tests/test-push-checkheads-unpushed-D7.t0000644015407300116100000000455613261161234023053 0ustar augieeng00000000000000==================================== Testing head checking code: Case D-7 ==================================== Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This case is part of a series of tests checking this behavior. Category D: remote head is "obs-affected" locally, but result is not part of the push TestCase 7: single changesets, superseeded multiple time then pruned (on a new changeset unpushed) changeset This is a partial push variation of B6 .. old-state: .. .. * 1 changeset branch .. .. new-state: .. .. * old branch is rewritten onto another one, .. * The rewriting it again rewritten on the root .. * the new version is then pruned. .. .. expected-result: .. .. * push allowed .. .. graph-summary: .. .. A' .. A ø⇠ø⇠⊗ A'' .. | | | .. C ◔ | ◔ | B .. \|/ / .. | / .. |/ .. | .. ◠$ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir D7 $ cd D7 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd client $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit B0 created new head $ mkcommit A1 $ hg up '0' 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ mkcommit A2 created new head $ hg up '0' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit C0 created new head $ hg debugobsolete `getid "desc(A0)"` `getid "desc(A1)"` obsoleted 1 changesets $ hg debugobsolete `getid "desc(A1)"` `getid "desc(A2)"` obsoleted 1 changesets $ hg debugobsolete --record-parents `getid "desc(A2)"` obsoleted 1 changesets $ hg log -G --hidden @ 0f88766e02d6 (draft): C0 | | x c1f8d089020f (draft): A2 |/ | x ba93660aff8d (draft): A1 | | | o 74ff5441d343 (draft): B0 |/ | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): root Actual testing -------------- $ hg push --rev 'desc(C0)' pushing to $TESTTMP/D7/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) 3 new obsolescence markers obsoleted 1 changesets $ cd ../.. mercurial-4.5.3/tests/test-convert-p4.t0000644015407300116100000001052113261161234017701 0ustar augieeng00000000000000#require p4 $ echo "[extensions]" >> $HGRCPATH $ echo "convert = " >> $HGRCPATH create p4 depot $ P4ROOT=`pwd`/depot; export P4ROOT $ P4AUDIT=$P4ROOT/audit; export P4AUDIT $ P4JOURNAL=$P4ROOT/journal; export P4JOURNAL $ P4LOG=$P4ROOT/log; export P4LOG $ P4PORT=localhost:$HGPORT; export P4PORT $ P4DEBUG=1; export P4DEBUG start the p4 server $ [ ! -d $P4ROOT ] && mkdir $P4ROOT $ p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr & $ echo $! >> $DAEMON_PIDS $ trap "echo stopping the p4 server ; p4 admin stop" EXIT $ # wait for the server to initialize $ while ! p4 ; do > sleep 1 > done >/dev/null 2>/dev/null create a client spec $ P4CLIENT=hg-p4-import; export P4CLIENT $ DEPOTPATH=//depot/test-mercurial-import/... $ p4 client -o | sed '/^View:/,$ d' >p4client $ echo View: >>p4client $ echo " $DEPOTPATH //$P4CLIENT/..." >>p4client $ p4 client -i a $ mkdir b $ echo c > b/c $ p4 add a b/c //depot/test-mercurial-import/a#1 - opened for add //depot/test-mercurial-import/b/c#1 - opened for add $ p4 submit -d initial Submitting change 1. Locking 2 files ... add //depot/test-mercurial-import/a#1 add //depot/test-mercurial-import/b/c#1 Change 1 submitted. change some files $ p4 edit a //depot/test-mercurial-import/a#1 - opened for edit $ echo aa >> a $ p4 submit -d "change a" Submitting change 2. Locking 1 files ... edit //depot/test-mercurial-import/a#2 Change 2 submitted. $ p4 edit b/c //depot/test-mercurial-import/b/c#1 - opened for edit $ echo cc >> b/c $ p4 submit -d "change b/c" Submitting change 3. Locking 1 files ... edit //depot/test-mercurial-import/b/c#2 Change 3 submitted. convert $ hg convert -s p4 $DEPOTPATH dst initializing destination dst repository scanning source... reading p4 views collecting p4 changelists 1 initial 2 change a 3 change b/c sorting... converting... 2 initial 1 change a 0 change b/c $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' rev=2 desc="change b/c" tags="tip" files="b/c" rev=1 desc="change a" tags="" files="a" rev=0 desc="initial" tags="" files="a b/c" change some files $ p4 edit a b/c //depot/test-mercurial-import/a#2 - opened for edit //depot/test-mercurial-import/b/c#2 - opened for edit $ echo aaa >> a $ echo ccc >> b/c $ p4 submit -d "change a b/c" Submitting change 4. Locking 2 files ... edit //depot/test-mercurial-import/a#3 edit //depot/test-mercurial-import/b/c#3 Change 4 submitted. convert again $ hg convert -s p4 $DEPOTPATH dst scanning source... reading p4 views collecting p4 changelists 4 change a b/c sorting... converting... 0 change a b/c $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' rev=3 desc="change a b/c" tags="tip" files="a b/c" rev=2 desc="change b/c" tags="" files="b/c" rev=1 desc="change a" tags="" files="a" rev=0 desc="initial" tags="" files="a b/c" interesting names $ echo dddd > "d d" $ mkdir " e" $ echo fff >" e/ f" $ p4 add "d d" " e/ f" //depot/test-mercurial-import/d d#1 - opened for add //depot/test-mercurial-import/ e/ f#1 - opened for add $ p4 submit -d "add d e f" Submitting change 5. Locking 2 files ... add //depot/test-mercurial-import/ e/ f#1 add //depot/test-mercurial-import/d d#1 Change 5 submitted. convert again $ hg convert -s p4 $DEPOTPATH dst scanning source... reading p4 views collecting p4 changelists 5 add d e f sorting... converting... 0 add d e f $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' rev=4 desc="add d e f" tags="tip" files=" e/ f d d" rev=3 desc="change a b/c" tags="" files="a b/c" rev=2 desc="change b/c" tags="" files="b/c" rev=1 desc="change a" tags="" files="a" rev=0 desc="initial" tags="" files="a b/c" empty commit message $ p4 edit a //depot/test-mercurial-import/a#3 - opened for edit $ echo aaaaa >> a $ p4 submit -d "" Submitting change 6. Locking 1 files ... edit //depot/test-mercurial-import/a#4 Change 6 submitted. $ hg convert -s p4 $DEPOTPATH dst scanning source... reading p4 views collecting p4 changelists 6 **empty changelist description** sorting... converting... 0 exit trap: stopping the p4 server mercurial-4.5.3/tests/test-diff-copy-depth.t0000644015407300116100000000143313261161234020664 0ustar augieeng00000000000000 $ for i in aaa zzz; do > hg init t > cd t > > echo > echo "-- With $i" > > touch file > hg add file > hg ci -m "Add" > > hg cp file $i > hg ci -m "a -> $i" > > hg cp $i other-file > echo "different" >> $i > hg ci -m "$i -> other-file" > > hg cp other-file somename > > echo "Status": > hg st -C > echo > echo "Diff:" > hg diff -g > > cd .. > rm -rf t > done -- With aaa Status: A somename other-file Diff: diff --git a/other-file b/somename copy from other-file copy to somename -- With zzz Status: A somename other-file Diff: diff --git a/other-file b/somename copy from other-file copy to somename mercurial-4.5.3/tests/test-import-git.t0000644015407300116100000004750413261161234020006 0ustar augieeng00000000000000 $ hg init repo $ cd repo New file: $ hg import -d "1000000 0" -mnew - < diff --git a/new b/new > new file mode 100644 > index 0000000..7898192 > --- /dev/null > +++ b/new > @@ -0,0 +1 @@ > +a > EOF applying patch from stdin $ hg tip -q 0:ae3ee40d2079 New empty file: $ hg import -d "1000000 0" -mempty - < diff --git a/empty b/empty > new file mode 100644 > EOF applying patch from stdin $ hg tip -q 1:ab199dc869b5 $ hg locate empty empty chmod +x: $ hg import -d "1000000 0" -msetx - < diff --git a/new b/new > old mode 100644 > new mode 100755 > EOF applying patch from stdin #if execbit $ hg tip -q 2:3a34410f282e $ test -x new $ hg rollback -q #else $ hg tip -q 1:ab199dc869b5 #endif Copy and removing x bit: $ hg import -f -d "1000000 0" -mcopy - < diff --git a/new b/copy > old mode 100755 > new mode 100644 > similarity index 100% > copy from new > copy to copy > diff --git a/new b/copyx > similarity index 100% > copy from new > copy to copyx > EOF applying patch from stdin $ test -f copy #if execbit $ test ! -x copy $ test -x copyx $ hg tip -q 2:21dfaae65c71 #else $ hg tip -q 2:0efdaa8e3bf3 #endif $ hg up -qCr1 $ hg rollback -q Copy (like above but independent of execbit): $ hg import -d "1000000 0" -mcopy - < diff --git a/new b/copy > similarity index 100% > copy from new > copy to copy > diff --git a/new b/copyx > similarity index 100% > copy from new > copy to copyx > EOF applying patch from stdin $ hg tip -q 2:0efdaa8e3bf3 $ test -f copy $ cat copy a $ hg cat copy a Rename: $ hg import -d "1000000 0" -mrename - < diff --git a/copy b/rename > similarity index 100% > rename from copy > rename to rename > EOF applying patch from stdin $ hg tip -q 3:b1f57753fad2 $ hg locate copyx empty new rename Delete: $ hg import -d "1000000 0" -mdelete - < diff --git a/copyx b/copyx > deleted file mode 100755 > index 7898192..0000000 > --- a/copyx > +++ /dev/null > @@ -1 +0,0 @@ > -a > EOF applying patch from stdin $ hg tip -q 4:1bd1da94b9b2 $ hg locate empty new rename $ test -f copyx [1] Regular diff: $ hg import -d "1000000 0" -mregular - < diff --git a/rename b/rename > index 7898192..72e1fe3 100644 > --- a/rename > +++ b/rename > @@ -1 +1,5 @@ > a > +a > +a > +a > +a > EOF applying patch from stdin $ hg tip -q 5:46fe99cb3035 Copy and modify: $ hg import -d "1000000 0" -mcopymod - < diff --git a/rename b/copy2 > similarity index 80% > copy from rename > copy to copy2 > index 72e1fe3..b53c148 100644 > --- a/rename > +++ b/copy2 > @@ -1,5 +1,5 @@ > a > a > -a > +b > a > a > EOF applying patch from stdin $ hg tip -q 6:ffeb3197c12d $ hg cat copy2 a a b a a Rename and modify: $ hg import -d "1000000 0" -mrenamemod - < diff --git a/copy2 b/rename2 > similarity index 80% > rename from copy2 > rename to rename2 > index b53c148..8f81e29 100644 > --- a/copy2 > +++ b/rename2 > @@ -1,5 +1,5 @@ > a > a > b > -a > +c > a > EOF applying patch from stdin $ hg tip -q 7:401aede9e6bb $ hg locate copy2 [1] $ hg cat rename2 a a b c a One file renamed multiple times: $ hg import -d "1000000 0" -mmultirenames - < diff --git a/rename2 b/rename3 > rename from rename2 > rename to rename3 > diff --git a/rename2 b/rename3-2 > rename from rename2 > rename to rename3-2 > EOF applying patch from stdin $ hg tip -q 8:2ef727e684e8 $ hg log -vr. --template '{rev} {files} / {file_copies}\n' 8 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2) $ hg locate rename2 rename3 rename3-2 rename3 rename3-2 $ hg cat rename3 a a b c a $ hg cat rename3-2 a a b c a $ echo foo > foo $ hg add foo $ hg ci -m 'add foo' Binary files and regular patch hunks: $ hg import -d "1000000 0" -m binaryregular - < diff --git a/binary b/binary > new file mode 100644 > index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 > GIT binary patch > literal 4 > Lc\${NkU|;|M00aO5 > > diff --git a/foo b/foo2 > rename from foo > rename to foo2 > EOF applying patch from stdin $ hg tip -q 10:27377172366e $ cat foo2 foo $ hg manifest --debug | grep binary 045c85ba38952325e126c70962cc0f9d9077bc67 644 binary Multiple binary files: $ hg import -d "1000000 0" -m multibinary - < diff --git a/mbinary1 b/mbinary1 > new file mode 100644 > index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 > GIT binary patch > literal 4 > Lc\${NkU|;|M00aO5 > > diff --git a/mbinary2 b/mbinary2 > new file mode 100644 > index 0000000000000000000000000000000000000000..112363ac1917b417ffbd7f376ca786a1e5fa7490 > GIT binary patch > literal 5 > Mc\${NkU|\`?^000jF3jhEB > > EOF applying patch from stdin $ hg tip -q 11:18b73a84b4ab $ hg manifest --debug | grep mbinary 045c85ba38952325e126c70962cc0f9d9077bc67 644 mbinary1 a874b471193996e7cb034bb301cac7bdaf3e3f46 644 mbinary2 Binary file and delta hunk (we build the patch using this sed hack to avoid an unquoted ^, which check-code says breaks sh on Solaris): $ sed 's/ caret /^/g;s/ dollarparen /$(/g' > quote-hack.patch <<'EOF' > diff --git a/delta b/delta > new file mode 100644 > index 0000000000000000000000000000000000000000..8c9b7831b231c2600843e303e66b521353a200b3 > GIT binary patch > literal 3749 > zcmV;W4qEYvP) zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU=M@d9MRCwC#oC!>o#}>x{(W-y~UN*tK > z%A%sxiUy2Ys)0Vm#ueArYKoYqX;GuiqZpgirM6nCVoYk?YNAz3G~z;BZ~@~&OQEe4 > zmGvS5isFJI;Pd_7J+EKxyHZeu` caret t4r2>F;h-+VK3{_{WoGv8dSpFDYDrA%3UX03pt > zOaVoi0*W#P6lDr1$`nwPDWE7*rhuYM0Y#YtiZTThWeObRRaI42 > zS3iFIxJ8Q=EnBv1Z7?pBw_bLjJb3V+tgP(Tty_2R-mR#p04x78n2n7MSOFyt4i1iv > zjxH`PPEJmgD7U?IK&h;(EGQ@_DJc<@01=4fiNXHcKZ8LhZQ8T}E3U4tUS3}OrcgQW > zWdX{K8#l7Ev&#$ysR)G#0*rC+Dj$|_qJ`@D*stNP_AFUe&x!Q > zJ9q9B7Z=ym)MyZ?Tg1ROunUYr81nV?B@!tYS~5_|%gfW#(_s<4UN1!Q?Dv8d>g#m6 > z%*@R2@bI2JdnzxQ!EDU`$eQY!tgI~Zn$prz;gaXNod5*5p(1Bz=P$qfvZ$y?dC@X~ > zlAD+NAKhB{=;6bMwzjqn>9mavvKOGd`s%A+fBiL>Q;xJWpa72C+}u{JTHUX>{~}Qj > zUb%hyHgN~c?cBLjInvUALMD9g-aXt54ZL8AOCvXL-V6!~ijR*kEG$&Mv?!pE61OlI > z8nzMSPE8F7bH|Py*RNl1VUCggq@_6gkEeiz7{rmTeuNTW6+KVS#0FG%IHf-3L > zGiS21vn>WCCr+GLx caret !uNetzB6u3o(w6&1C2?_LW8ij$+$sZ*zZ`|US3H@8N~%&V%Z > zAeA0HdhFS=$6|nzn3%YH`SN<>DQRO;Qc caret )dfdvA caret 5u`Xf;Zzu zzkh#LA)v7gpoE5ou3o*GoUUF%b#iht&kl9d0)><$FE1}ACr68;uCA`6DrGmz_U+rp > zL>Rx;X_yhk$fP_yJrTCQ|NgsW0A<985g&c@k-NKly<>mgU8n||ZPPV<`SN8#%$+-T > zfP$T!ou8jypFVwnzqhxyUvIxXd-wF~*U!ht=hCH1wzjqn9x#)IrhDa;S0JbK caret z_$W > zd(8rX@;7|t*;GJ5h$SZ{v(}+UBEs$4w~?{@9%`_Z zunCgwT@1|CU9+;X caret 4z&|M~@yw23Ay50NFWn=FqF%yLZEUty;AT2??1oV@B)Nt))J7 > zh>{5j2@f7T=-an%L_`E)h;mZ4D_5>?7tjQtVPRo2XU-&;mX(!l-MSTJP4XWY82JAC > z@57+y&!1=P{Mn{W8)-HzEsgAtd63}Cazc>O6vGb>51%@9DzbyI3?4j~$ijmT95_IS > zS#r!LCDW%*4-O7CGnkr$xXR1RQ&UrA z*s){8pw68;i+kiG%CpBKYSJLLFyq&*U8}qDp+kpe&6ZK?&s7y?b}i > zuwcOgO%x-27A;y785zknl_{sU;E6v$8{pWmVS{KaJPpu`i;HP$#flY@u~Ua~K3%tN > z-LhrNh{9SoHgDd%WXTc$$~Dq{?AWou3!H&?V8K{ caret {P9Ot5vecD?%1&-E-ntBFj87( > zy5`QE%QRX7qcHC%1{Ua}M~}L6=`wQUNEQ=I;qc+ZMMXtK2T+0os;jEco;}OV9z1w3 > zARqv caret bm-85xnRCng3OT|MyVSmR3ND7 caret ?KaQGG! caret (aTbo1N;Nz;X3Q9FJbwK6`0?Yp > zj*X2ac;Pw3!I2|JShDaF>-gJmzm1NLj){rk&o|$E caret WAsfrK=x&@B!`w7Hik81sPz4 > zuJTaiCppM>-+c!wPzcUw)5@?J4U-u|pJ~xbWUe-C+60k caret 7>9!)56DbjmA~`OJJ40v > zu3hCA7eJXZWeN|1iJLu87$;+fS8+Kq6O`aT)*_x@sY#t7LxwoEcVw*)cWhhQW@l%! > z{#Z=y+qcK@%z{p*D=8_Fcg278AnH3fI5;~yGu?9TscxXaaP*4$f zpxmunH#%=+ICMvZA~wyNH%~eMl!-g caret R!cYJ#WmLq5N8viz#J%%LPtkO?V)tZ81cp> > z{ALK?fNPePmd;289&M8Q3>YwgZX5GcGY&n>K1 zpJmIJO`A3iy+Y3X`k>cY-@}Iw2Onq`=!ba3eATgs3yg3Wej=+P-Z8WF#w=RXvS@J3 > zEyhVTj-gO?kfDu1g9afo9lx6 zO6c6FbNt@;;*w$z;N|H>h{czme)_4V6UC4hv**kX2@L caret Bgds dollarparen &P7M4dhfmWe)!=B > zR3X=Y{P9N}p@-##@1ZNW1YbVaiP~D@8m&i*Hpp&@ > z`9!Sj+O;byD~s8qZ>6QB8uv7Bpn&&?xe;;e z6DH*4=AB7C1D9Amu?ia-wtxSAlmTEO96XHx)-+rKP;ip$pukuSJGW3P1aUmc2yo%) > z&d1X+1qzaag-%x+eKHx{?Afz3GBQSw9u0lw zHr6)1ynEF zrok&TPU40rL0ZYDwenNrrmPZ`gjo@DEF`7 caret cKP||pUr;+r)hyn9O37=xA`3%Bj-ih > z+1usk<%5G-y+R?tA`qY=)6&vNjL{P?QzHg%P%>`ZxP=QB%DHY6L26?36V_p caret {}n$q > z3@9W=KmGI*Ng_Q#AzA%-z|Z caret |#oW(hkfgpuS$RKRhlrarX%efMMCs}GLChec5+y{6 > z1Qnxim_C-fmQuaAK_NUHUBV&;1c0V)wjihVnlt caret asFCe0&a@tqp > zEEy;$L}D$X6)wfQNl8gu6Z>oB3_RrP=gTyK2@@w#LbQfLNHj>Q&z(C5wUFhK+}0aV > zSohlc=7K+spN z!}t+Yljq7-p$X;4_YL?6d;mdY3R##o1e%rlPxrsMh8|;sKTr~ caret QD#sw3&vS$FwlTk > zp1#Gw!Qo-$LtvpXt#ApV0g) caret F=qFB`VB!W297x=$mr<$>rco3v$QKih_xN!k6;M=@ > zCr?gDNQj7tm@;JwD;Ty&NlBSCYZk(b3dZeN8D4h2{r20dSFc7;(>E&r`s=TVtzpB4 > zk+ caret N&zCAiRns(?p6iBlk9v&h{1ve(FNtc)td51M>)TkXhc6{>5C)`fS$&)A1*CP1% > zld+peue4aYbg3C0!+4mu+}vE caret j_feX+ZijvffBI7Ofh#RZ*U3<3J5(+nfRCzexqQ5 > zgM&##Y4Dd{e%ZKjqrbm@|Ni}l4jo!AqtFynj3Xsd$o caret ?yV4$|UQ(j&UWCH>M=o_&N > zmclXc3i|Q#<;#EoG>~V}4unTHbUK}u=y4;rA3S&vzC3 caret aJP!&D4RvvGfoyo(>C>la > zijP<=v>X{3Ne&2BXo}DV8l0V-jdv`$am0ubG{Wuh%CTd|l9Q7m;G&|U@#Dvbhlj(d > zg6W{3ATxYt#T?)3;SmIgOP4M|Dki~I_TX7SxP0x}wI~DQI7Lhm2BI7gph(aPIFAd; > zQ&UsF`Q{rOz+z=87c5v%@5u~d6dWV5OlX`oH3cAH&UlvsZUEo(Q(P|lKs17rXvaiU > zQcj}IEufi1+Bnh6&(EhF{7O3vLHp`jjlp0J zwrmcd5MnP}xByB_)P@{J>DR9x6;`cUwPM8z){yooNiXPOc9_{W-gtwxE5TUg0vJk6 > zO#JGruV&1cL6VGK2?+_YQr4`+EY8;Sm$9U$uuGRN=uj3k7?O9b+R~J7t_y*K64ZnI > zM+{aEpcRbC29ZyG!Cfdp > zutFf`Q`vljgo!(wHf=)F#m2_MIuj;L(2ja2YsQRX+rswV{d z;tq*`y}dm#NDJHKlV}uTIm!_vAq5E7!X-p{P=Z=Sh668>PuVS1*6e}OwOiMc;u3OQ > z@Bs)w3=lzfKoufH$SFuPG@uZ4NOnM#+=8LnQ2Q4zUd+nM+OT26;lqbN{P07dhH{jH > zManE8 caret dLms-Q2;1kB<*Q1a3f8kZr;xX=!Qro@`~@xN*Qj>gx;i;0Z24!~i2uLb`}v > zA?R$|wvC+m caret Ups=*(4lDh*=UN8{5h(A?p#D caret 2N$8u4Z55!q?ZAh(iEEng9_Zi>IgO > z#~**JC8hE4@n{hO&8btT5F*?nC_%LhA3i)PDhh-pB_&1wGrDIl caret *=8x3n&;akBf caret - > zJd&86kq$%%907v caret tgWoQdwI`|oNK%VvU~S#CHFD%&|Ni~t > zKJ(|#H`$<5W+6ZkBb213rXonKZLB+X> caret L}J@W6osP3piLD_5?R!`S}*{xLBzFiL4@ > zX+}l{`A%?f@T5tT%ztu60p;)be`fWC`tP@WpO=?cpf8Xuf1OSj6d3f@Ki(ovDYq%0 > z{4ZSe`kOay5@=lAT!}vFzxyemC{sXDrhuYM0Y#ZI1r%ipD9W11{w=@&xgJ}t2x;ep > P00000NkvXXu0mjfZ5|Er > > literal 0 > HcmV?d00001 > > EOF $ hg import -d "1000000 0" -m delta quote-hack.patch applying quote-hack.patch $ rm quote-hack.patch $ hg manifest --debug | grep delta 9600f98bb60ce732634d126aaa4ac1ec959c573e 644 delta $ hg import -d "1000000 0" -m delta - <<'EOF' > diff --git a/delta b/delta > index 8c9b7831b231c2600843e303e66b521353a200b3..0021dd95bc0dba53c39ce81377126d43731d68df 100644 > GIT binary patch > delta 49 > zcmZ1~yHs|=21Z8J$r~9bFdA-lVv=EEw4WT$qRf2QSa5SIOAHI6(&k4T8H|kLo4vWB > FSO9ZT4bA`n > > delta 49 > zcmV-10M7rV9i<(xumJ(}ld%Di0Xefm0vrMXpOaq%BLm9I%d>?9Tm%6Vv*HM70RcC& > HOA1;9yU-AD > > EOF applying patch from stdin $ hg manifest --debug | grep delta 56094bbea136dcf8dbd4088f6af469bde1a98b75 644 delta Filenames with spaces: $ sed 's,EOL$,,g' < diff --git a/foo bar b/foo bar > new file mode 100644 > index 0000000..257cc56 > --- /dev/null > +++ b/foo bar EOL > @@ -0,0 +1 @@ > +foo > EOF applying patch from stdin $ hg tip -q 14:4b79479c9a6d $ cat "foo bar" foo Copy then modify the original file: $ hg import -d "1000000 0" -m copy-mod-orig - < diff --git a/foo2 b/foo2 > index 257cc56..fe08ec6 100644 > --- a/foo2 > +++ b/foo2 > @@ -1 +1,2 @@ > foo > +new line > diff --git a/foo2 b/foo3 > similarity index 100% > copy from foo2 > copy to foo3 > EOF applying patch from stdin $ hg tip -q 15:9cbe44af4ae9 $ cat foo3 foo Move text file and patch as binary $ echo a > text2 $ hg ci -Am0 adding text2 $ hg import -d "1000000 0" -m rename-as-binary - <<"EOF" > diff --git a/text2 b/binary2 > rename from text2 > rename to binary2 > index 78981922613b2afb6025042ff6bd878ac1994e85..10efcb362e9f3b3420fcfbfc0e37f3dc16e29757 > GIT binary patch > literal 5 > Mc$`b*O5$Pw00T?_*Z=?k > > EOF applying patch from stdin $ cat binary2 a b \x00 (no-eol) (esc) $ hg st --copies --change . A binary2 text2 R text2 Invalid base85 content $ hg rollback repository tip rolled back to revision 16 (undo import) working directory now based on revision 16 $ hg revert -aq $ hg import -d "1000000 0" -m invalid-binary - <<"EOF" > diff --git a/text2 b/binary2 > rename from text2 > rename to binary2 > index 78981922613b2afb6025042ff6bd878ac1994e85..10efcb362e9f3b3420fcfbfc0e37f3dc16e29757 > GIT binary patch > literal 5 > Mc$`b*O.$Pw00T?_*Z=?k > > EOF applying patch from stdin abort: could not decode "binary2" binary patch: bad base85 character at position 6 [255] $ hg revert -aq $ hg import -d "1000000 0" -m rename-as-binary - <<"EOF" > diff --git a/text2 b/binary2 > rename from text2 > rename to binary2 > index 78981922613b2afb6025042ff6bd878ac1994e85..10efcb362e9f3b3420fcfbfc0e37f3dc16e29757 > GIT binary patch > literal 6 > Mc$`b*O5$Pw00T?_*Z=?k > > EOF applying patch from stdin abort: "binary2" length is 5 bytes, should be 6 [255] $ hg revert -aq $ hg import -d "1000000 0" -m rename-as-binary - <<"EOF" > diff --git a/text2 b/binary2 > rename from text2 > rename to binary2 > index 78981922613b2afb6025042ff6bd878ac1994e85..10efcb362e9f3b3420fcfbfc0e37f3dc16e29757 > GIT binary patch > Mc$`b*O5$Pw00T?_*Z=?k > > EOF applying patch from stdin abort: could not extract "binary2" binary data [255] Simulate a copy/paste turning LF into CRLF (issue2870) $ hg revert -aq $ cat > binary.diff <<"EOF" > diff --git a/text2 b/binary2 > rename from text2 > rename to binary2 > index 78981922613b2afb6025042ff6bd878ac1994e85..10efcb362e9f3b3420fcfbfc0e37f3dc16e29757 > GIT binary patch > literal 5 > Mc$`b*O5$Pw00T?_*Z=?k > > EOF >>> fp = file('binary.diff', 'rb') >>> data = fp.read() >>> fp.close() >>> file('binary.diff', 'wb').write(data.replace('\n', '\r\n')) $ rm binary2 $ hg import --no-commit binary.diff applying binary.diff $ cd .. Consecutive import with renames (issue2459) $ hg init issue2459 $ cd issue2459 $ hg import --no-commit --force - < diff --git a/a b/a > new file mode 100644 > EOF applying patch from stdin $ hg import --no-commit --force - < diff --git a/a b/b > rename from a > rename to b > EOF applying patch from stdin a has not been committed yet, so no copy data will be stored for b. $ hg debugstate a 0 -1 unset b $ hg ci -m done $ cd .. Renames and strip $ hg init renameandstrip $ cd renameandstrip $ echo a > a $ hg ci -Am adda adding a $ hg import --no-commit -p2 - < diff --git a/foo/a b/foo/b > rename from foo/a > rename to foo/b > EOF applying patch from stdin $ hg st --copies A b a R a Prefix with strip, renames, creates etc $ hg revert -aC undeleting a forgetting b $ rm b $ mkdir -p dir/dir2 $ echo b > dir/dir2/b $ echo c > dir/dir2/c $ echo d > dir/d $ hg ci -Am addbcd adding dir/d adding dir/dir2/b adding dir/dir2/c prefix '.' is the same as no prefix $ hg import --no-commit --prefix . - < diff --git a/dir/a b/dir/a > --- /dev/null > +++ b/dir/a > @@ -0,0 +1 @@ > +aaaa > diff --git a/dir/d b/dir/d > --- a/dir/d > +++ b/dir/d > @@ -1,1 +1,2 @@ > d > +dddd > EOF applying patch from stdin $ cat dir/a aaaa $ cat dir/d d dddd $ hg revert -aC forgetting dir/a reverting dir/d $ rm dir/a prefix with default strip $ hg import --no-commit --prefix dir/ - < diff --git a/a b/a > --- /dev/null > +++ b/a > @@ -0,0 +1 @@ > +aaa > diff --git a/d b/d > --- a/d > +++ b/d > @@ -1,1 +1,2 @@ > d > +dd > EOF applying patch from stdin $ cat dir/a aaa $ cat dir/d d dd $ hg revert -aC forgetting dir/a reverting dir/d $ rm dir/a (test that prefixes are relative to the cwd) $ mkdir tmpdir $ cd tmpdir $ hg import --no-commit -p2 --prefix ../dir/ - < diff --git a/foo/a b/foo/a > new file mode 100644 > --- /dev/null > +++ b/foo/a > @@ -0,0 +1 @@ > +a > diff --git a/foo/dir2/b b/foo/dir2/b2 > rename from foo/dir2/b > rename to foo/dir2/b2 > diff --git a/foo/dir2/c b/foo/dir2/c > --- a/foo/dir2/c > +++ b/foo/dir2/c > @@ -0,0 +1 @@ > +cc > diff --git a/foo/d b/foo/d > deleted file mode 100644 > --- a/foo/d > +++ /dev/null > @@ -1,1 +0,0 @@ > -d > EOF applying patch from stdin $ hg st --copies M dir/dir2/c A dir/a A dir/dir2/b2 dir/dir2/b R dir/d R dir/dir2/b $ cd .. Renames, similarity and git diff $ hg revert -aC forgetting dir/a undeleting dir/d undeleting dir/dir2/b forgetting dir/dir2/b2 reverting dir/dir2/c $ rm dir/a dir/dir2/b2 $ hg import --similarity 90 --no-commit - < diff --git a/a b/b > rename from a > rename to b > EOF applying patch from stdin $ hg st --copies A b a R a $ cd .. Pure copy with existing destination $ hg init copytoexisting $ cd copytoexisting $ echo a > a $ echo b > b $ hg ci -Am add adding a adding b $ hg import --no-commit - < diff --git a/a b/b > copy from a > copy to b > EOF applying patch from stdin abort: cannot create b: destination already exists [255] $ cat b b Copy and changes with existing destination $ hg import --no-commit - < diff --git a/a b/b > copy from a > copy to b > --- a/a > +++ b/b > @@ -1,1 +1,2 @@ > a > +b > EOF applying patch from stdin cannot create b: destination already exists 1 out of 1 hunks FAILED -- saving rejects to file b.rej abort: patch failed to apply [255] $ cat b b #if symlink $ ln -s b linkb $ hg add linkb $ hg ci -m addlinkb $ hg import --no-commit - < diff --git a/linkb b/linkb > deleted file mode 120000 > --- a/linkb > +++ /dev/null > @@ -1,1 +0,0 @@ > -badhunk > \ No newline at end of file > EOF applying patch from stdin patching file linkb Hunk #1 FAILED at 0 1 out of 1 hunks FAILED -- saving rejects to file linkb.rej abort: patch failed to apply [255] $ hg st ? b.rej ? linkb.rej #endif Test corner case involving copies and multiple hunks (issue3384) $ hg revert -qa $ hg import --no-commit - < diff --git a/a b/c > copy from a > copy to c > --- a/a > +++ b/c > @@ -1,1 +1,2 @@ > a > +a > @@ -2,1 +2,2 @@ > a > +a > diff --git a/a b/a > --- a/a > +++ b/a > @@ -1,1 +1,2 @@ > a > +b > EOF applying patch from stdin Test email metadata $ hg revert -qa $ hg --encoding utf-8 import - < From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= > Subject: [PATCH] =?UTF-8?q?=C5=A7=E2=82=AC=C3=9F=E1=B9=AA?= > > diff --git a/a b/a > --- a/a > +++ b/a > @@ -1,1 +1,2 @@ > a > +a > EOF applying patch from stdin $ hg --encoding utf-8 log -r . changeset: *:* (glob) tag: tip user: Rapha\xc3\xabl Hertzog (esc) date: * (glob) summary: \xc5\xa7\xe2\x82\xac\xc3\x9f\xe1\xb9\xaa (esc) $ cd .. mercurial-4.5.3/tests/test-mq-header-date.t0000644015407300116100000004276613261161234020476 0ustar augieeng00000000000000 $ cat <> $HGRCPATH > [extensions] > mq = > [diff] > nodates = true > EOF $ catpatch() { > cat .hg/patches/$1.patch | sed -e "s/^diff \-r [0-9a-f]* /diff -r ... /" \ > -e "s/^\(# Parent \).*/\1/" > } $ catlog() { > catpatch $1 > hg log --template "{rev}: {node|short} {desc} - {author}\n" > } $ catlogd() { > catpatch $1 > hg log --template "{rev}: {node|short} {desc} - {author} - {date}\n" > } $ drop() { > hg qpop > hg qdel $1.patch > } $ runtest() { > echo ==== init > hg init a > cd a > hg qinit > > > echo ==== qnew -d > hg qnew -d '3 0' 1.patch > catlogd 1 > > echo ==== qref > echo "1" >1 > hg add > hg qref > catlogd 1 > > echo ==== qref -d > hg qref -d '4 0' > catlogd 1 > > > echo ==== qnew > hg qnew 2.patch > echo "2" >2 > hg add > hg qref > catlog 2 > > echo ==== qref -d > hg qref -d '5 0' > catlog 2 > > drop 2 > > > echo ==== qnew -d -m > hg qnew -d '6 0' -m "Three" 3.patch > catlogd 3 > > echo ==== qref > echo "3" >3 > hg add > hg qref > catlogd 3 > > echo ==== qref -m > hg qref -m "Drei" > catlogd 3 > > echo ==== qref -d > hg qref -d '7 0' > catlogd 3 > > echo ==== qref -d -m > hg qref -d '8 0' -m "Three (again)" > catlogd 3 > > > echo ==== qnew -m > hg qnew -m "Four" 4.patch > echo "4" >4 > hg add > hg qref > catlog 4 > > echo ==== qref -d > hg qref -d '9 0' > catlog 4 > > drop 4 > > > echo ==== qnew with HG header > hg qnew --config 'mq.plain=true' 5.patch > hg qpop > echo "# HG changeset patch" >>.hg/patches/5.patch > echo "# Date 10 0" >>.hg/patches/5.patch > hg qpush 2>&1 | grep 'Now at' > catlogd 5 > > echo ==== hg qref > echo "5" >5 > hg add > hg qref > catlogd 5 > > echo ==== hg qref -d > hg qref -d '11 0' > catlogd 5 > > > echo ==== qnew with plain header > hg qnew --config 'mq.plain=true' -d '12 0' 6.patch > hg qpop > hg qpush 2>&1 | grep 'now at' > catlog 6 > > echo ==== hg qref > echo "6" >6 > hg add > hg qref > catlogd 6 > > echo ==== hg qref -d > hg qref -d '13 0' > catlogd 6 > > drop 6 > > > echo ==== qnew -u > hg qnew -u jane 6.patch > echo "6" >6 > hg add > hg qref > catlog 6 > > echo ==== qref -d > hg qref -d '12 0' > catlog 6 > > drop 6 > > > echo ==== qnew -d > hg qnew -d '13 0' 7.patch > echo "7" >7 > hg add > hg qref > catlog 7 > > echo ==== qref -u > hg qref -u john > catlogd 7 > > > echo ==== qnew > hg qnew 8.patch > echo "8" >8 > hg add > hg qref > catlog 8 > > echo ==== qref -u -d > hg qref -u john -d '14 0' > catlog 8 > > drop 8 > > > echo ==== qnew -m > hg qnew -m "Nine" 9.patch > echo "9" >9 > hg add > hg qref > catlog 9 > > echo ==== qref -u -d > hg qref -u john -d '15 0' > catlog 9 > > drop 9 > > > echo ==== "qpop -a / qpush -a" > hg qpop -a > hg qpush -a > hg log --template "{rev}: {node|short} {desc} - {author} - {date}\n" > } ======= plain headers $ echo "[mq]" >> $HGRCPATH $ echo "plain=true" >> $HGRCPATH $ mkdir sandbox $ (cd sandbox ; runtest) ==== init ==== qnew -d Date: 3 0 0: 758bd2596a39 [mq]: 1.patch - test - 3.00 ==== qref adding 1 Date: 3 0 diff -r ... 1 --- /dev/null +++ b/1 @@ -0,0 +1,1 @@ +1 0: 8c640e9949a8 [mq]: 1.patch - test - 3.00 ==== qref -d Date: 4 0 diff -r ... 1 --- /dev/null +++ b/1 @@ -0,0 +1,1 @@ +1 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== qnew adding 2 diff -r ... 2 --- /dev/null +++ b/2 @@ -0,0 +1,1 @@ +2 1: fc7e8a2f6499 [mq]: 2.patch - test 0: 4a67dfeea974 [mq]: 1.patch - test ==== qref -d Date: 5 0 diff -r ... 2 --- /dev/null +++ b/2 @@ -0,0 +1,1 @@ +2 1: 1d9a6a118fd1 [mq]: 2.patch - test 0: 4a67dfeea974 [mq]: 1.patch - test popping 2.patch now at: 1.patch ==== qnew -d -m Date: 6 0 Three 1: 2a9ef0bdefba Three - test - 6.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== qref adding 3 Date: 6 0 Three diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 1: 7f19ad9eea7b Three - test - 6.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== qref -m Date: 6 0 Drei diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 1: 7ff7377793e3 Drei - test - 6.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== qref -d Date: 7 0 Drei diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 1: d89d3144f518 Drei - test - 7.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== qref -d -m Date: 8 0 Three (again) diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 1: b1b6b0fe0e6d Three (again) - test - 8.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== qnew -m adding 4 Four diff -r ... 4 --- /dev/null +++ b/4 @@ -0,0 +1,1 @@ +4 2: 74ded07d166b Four - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test ==== qref -d Date: 9 0 Four diff -r ... 4 --- /dev/null +++ b/4 @@ -0,0 +1,1 @@ +4 2: 1a651320cf8e Four - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test popping 4.patch now at: 3.patch ==== qnew with HG header popping 5.patch now at: 3.patch # HG changeset patch # Date 10 0 2: d16a272220d2 imported patch 5.patch - test - 10.00 1: b1b6b0fe0e6d Three (again) - test - 8.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== hg qref adding 5 # HG changeset patch # Date 10 0 # Parent diff -r ... 5 --- /dev/null +++ b/5 @@ -0,0 +1,1 @@ +5 2: 5dbf69c07df9 [mq]: 5.patch - test - 10.00 1: b1b6b0fe0e6d Three (again) - test - 8.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== hg qref -d # HG changeset patch # Date 11 0 # Parent diff -r ... 5 --- /dev/null +++ b/5 @@ -0,0 +1,1 @@ +5 2: 049de6af0c1d [mq]: 5.patch - test - 11.00 1: b1b6b0fe0e6d Three (again) - test - 8.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== qnew with plain header popping 6.patch now at: 5.patch now at: 6.patch Date: 12 0 3: 8ad9ebc22b96 imported patch 6.patch - test 2: 049de6af0c1d [mq]: 5.patch - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test ==== hg qref adding 6 Date: 12 0 diff -r ... 6 --- /dev/null +++ b/6 @@ -0,0 +1,1 @@ +6 3: 038c46b02a56 [mq]: 6.patch - test - 12.00 2: 049de6af0c1d [mq]: 5.patch - test - 11.00 1: b1b6b0fe0e6d Three (again) - test - 8.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== hg qref -d Date: 13 0 diff -r ... 6 --- /dev/null +++ b/6 @@ -0,0 +1,1 @@ +6 3: 2785642ea4b4 [mq]: 6.patch - test - 13.00 2: 049de6af0c1d [mq]: 5.patch - test - 11.00 1: b1b6b0fe0e6d Three (again) - test - 8.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 popping 6.patch now at: 5.patch ==== qnew -u adding 6 From: jane diff -r ... 6 --- /dev/null +++ b/6 @@ -0,0 +1,1 @@ +6 3: a05a33f187ce [mq]: 6.patch - jane 2: 049de6af0c1d [mq]: 5.patch - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test ==== qref -d From: jane Date: 12 0 diff -r ... 6 --- /dev/null +++ b/6 @@ -0,0 +1,1 @@ +6 3: 5702c529dfe9 [mq]: 6.patch - jane 2: 049de6af0c1d [mq]: 5.patch - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test popping 6.patch now at: 5.patch ==== qnew -d adding 7 Date: 13 0 diff -r ... 7 --- /dev/null +++ b/7 @@ -0,0 +1,1 @@ +7 3: 8dd1eb8d4132 [mq]: 7.patch - test 2: 049de6af0c1d [mq]: 5.patch - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test ==== qref -u From: john Date: 13 0 diff -r ... 7 --- /dev/null +++ b/7 @@ -0,0 +1,1 @@ +7 3: 4f9d07369cc4 [mq]: 7.patch - john - 13.00 2: 049de6af0c1d [mq]: 5.patch - test - 11.00 1: b1b6b0fe0e6d Three (again) - test - 8.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== qnew adding 8 diff -r ... 8 --- /dev/null +++ b/8 @@ -0,0 +1,1 @@ +8 4: 868b62f09492 [mq]: 8.patch - test 3: 4f9d07369cc4 [mq]: 7.patch - john 2: 049de6af0c1d [mq]: 5.patch - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test ==== qref -u -d From: john Date: 14 0 diff -r ... 8 --- /dev/null +++ b/8 @@ -0,0 +1,1 @@ +8 4: b1e878ae55b9 [mq]: 8.patch - john 3: 4f9d07369cc4 [mq]: 7.patch - john 2: 049de6af0c1d [mq]: 5.patch - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test popping 8.patch now at: 7.patch ==== qnew -m adding 9 Nine diff -r ... 9 --- /dev/null +++ b/9 @@ -0,0 +1,1 @@ +9 4: 7251936ac2bf Nine - test 3: 4f9d07369cc4 [mq]: 7.patch - john 2: 049de6af0c1d [mq]: 5.patch - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test ==== qref -u -d From: john Date: 15 0 Nine diff -r ... 9 --- /dev/null +++ b/9 @@ -0,0 +1,1 @@ +9 4: a0de5bf6e9f7 Nine - john 3: 4f9d07369cc4 [mq]: 7.patch - john 2: 049de6af0c1d [mq]: 5.patch - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test popping 9.patch now at: 7.patch ==== qpop -a / qpush -a popping 7.patch popping 5.patch popping 3.patch popping 1.patch patch queue now empty applying 1.patch applying 3.patch applying 5.patch applying 7.patch now at: 7.patch 3: d26a5b7ffce1 imported patch 7.patch - john - 13.00 2: dda6cf77060a imported patch 5.patch - test - 11.00 1: 25e32d66c8c7 Three (again) - test - 8.00 0: e5011c0211fe imported patch 1.patch - test - 4.00 $ rm -r sandbox ======= hg headers $ echo "plain=false" >> $HGRCPATH $ mkdir sandbox $ (cd sandbox ; runtest) ==== init ==== qnew -d # HG changeset patch # Date 3 0 # Parent 0: 758bd2596a39 [mq]: 1.patch - test - 3.00 ==== qref adding 1 # HG changeset patch # Date 3 0 # Parent diff -r ... 1 --- /dev/null +++ b/1 @@ -0,0 +1,1 @@ +1 0: 8c640e9949a8 [mq]: 1.patch - test - 3.00 ==== qref -d # HG changeset patch # Date 4 0 # Parent diff -r ... 1 --- /dev/null +++ b/1 @@ -0,0 +1,1 @@ +1 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== qnew adding 2 # HG changeset patch # Parent diff -r ... 2 --- /dev/null +++ b/2 @@ -0,0 +1,1 @@ +2 1: fc7e8a2f6499 [mq]: 2.patch - test 0: 4a67dfeea974 [mq]: 1.patch - test ==== qref -d # HG changeset patch # Date 5 0 # Parent diff -r ... 2 --- /dev/null +++ b/2 @@ -0,0 +1,1 @@ +2 1: 1d9a6a118fd1 [mq]: 2.patch - test 0: 4a67dfeea974 [mq]: 1.patch - test popping 2.patch now at: 1.patch ==== qnew -d -m # HG changeset patch # Date 6 0 # Parent Three 1: 2a9ef0bdefba Three - test - 6.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== qref adding 3 # HG changeset patch # Date 6 0 # Parent Three diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 1: 7f19ad9eea7b Three - test - 6.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== qref -m # HG changeset patch # Date 6 0 # Parent Drei diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 1: 7ff7377793e3 Drei - test - 6.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== qref -d # HG changeset patch # Date 7 0 # Parent Drei diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 1: d89d3144f518 Drei - test - 7.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== qref -d -m # HG changeset patch # Date 8 0 # Parent Three (again) diff -r ... 3 --- /dev/null +++ b/3 @@ -0,0 +1,1 @@ +3 1: b1b6b0fe0e6d Three (again) - test - 8.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== qnew -m adding 4 # HG changeset patch # Parent Four diff -r ... 4 --- /dev/null +++ b/4 @@ -0,0 +1,1 @@ +4 2: 74ded07d166b Four - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test ==== qref -d # HG changeset patch # Date 9 0 # Parent Four diff -r ... 4 --- /dev/null +++ b/4 @@ -0,0 +1,1 @@ +4 2: 1a651320cf8e Four - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test popping 4.patch now at: 3.patch ==== qnew with HG header popping 5.patch now at: 3.patch # HG changeset patch # Date 10 0 2: d16a272220d2 imported patch 5.patch - test - 10.00 1: b1b6b0fe0e6d Three (again) - test - 8.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== hg qref adding 5 # HG changeset patch # Date 10 0 # Parent diff -r ... 5 --- /dev/null +++ b/5 @@ -0,0 +1,1 @@ +5 2: 5dbf69c07df9 [mq]: 5.patch - test - 10.00 1: b1b6b0fe0e6d Three (again) - test - 8.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== hg qref -d # HG changeset patch # Date 11 0 # Parent diff -r ... 5 --- /dev/null +++ b/5 @@ -0,0 +1,1 @@ +5 2: 049de6af0c1d [mq]: 5.patch - test - 11.00 1: b1b6b0fe0e6d Three (again) - test - 8.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== qnew with plain header popping 6.patch now at: 5.patch now at: 6.patch Date: 12 0 3: 8ad9ebc22b96 imported patch 6.patch - test 2: 049de6af0c1d [mq]: 5.patch - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test ==== hg qref adding 6 Date: 12 0 diff -r ... 6 --- /dev/null +++ b/6 @@ -0,0 +1,1 @@ +6 3: 038c46b02a56 [mq]: 6.patch - test - 12.00 2: 049de6af0c1d [mq]: 5.patch - test - 11.00 1: b1b6b0fe0e6d Three (again) - test - 8.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== hg qref -d Date: 13 0 diff -r ... 6 --- /dev/null +++ b/6 @@ -0,0 +1,1 @@ +6 3: 2785642ea4b4 [mq]: 6.patch - test - 13.00 2: 049de6af0c1d [mq]: 5.patch - test - 11.00 1: b1b6b0fe0e6d Three (again) - test - 8.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 popping 6.patch now at: 5.patch ==== qnew -u adding 6 # HG changeset patch # User jane # Parent diff -r ... 6 --- /dev/null +++ b/6 @@ -0,0 +1,1 @@ +6 3: a05a33f187ce [mq]: 6.patch - jane 2: 049de6af0c1d [mq]: 5.patch - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test ==== qref -d # HG changeset patch # User jane # Date 12 0 # Parent diff -r ... 6 --- /dev/null +++ b/6 @@ -0,0 +1,1 @@ +6 3: 5702c529dfe9 [mq]: 6.patch - jane 2: 049de6af0c1d [mq]: 5.patch - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test popping 6.patch now at: 5.patch ==== qnew -d adding 7 # HG changeset patch # Date 13 0 # Parent diff -r ... 7 --- /dev/null +++ b/7 @@ -0,0 +1,1 @@ +7 3: 8dd1eb8d4132 [mq]: 7.patch - test 2: 049de6af0c1d [mq]: 5.patch - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test ==== qref -u # HG changeset patch # User john # Date 13 0 # Parent diff -r ... 7 --- /dev/null +++ b/7 @@ -0,0 +1,1 @@ +7 3: 4f9d07369cc4 [mq]: 7.patch - john - 13.00 2: 049de6af0c1d [mq]: 5.patch - test - 11.00 1: b1b6b0fe0e6d Three (again) - test - 8.00 0: 4a67dfeea974 [mq]: 1.patch - test - 4.00 ==== qnew adding 8 # HG changeset patch # Parent diff -r ... 8 --- /dev/null +++ b/8 @@ -0,0 +1,1 @@ +8 4: 868b62f09492 [mq]: 8.patch - test 3: 4f9d07369cc4 [mq]: 7.patch - john 2: 049de6af0c1d [mq]: 5.patch - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test ==== qref -u -d # HG changeset patch # User john # Date 14 0 # Parent diff -r ... 8 --- /dev/null +++ b/8 @@ -0,0 +1,1 @@ +8 4: b1e878ae55b9 [mq]: 8.patch - john 3: 4f9d07369cc4 [mq]: 7.patch - john 2: 049de6af0c1d [mq]: 5.patch - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test popping 8.patch now at: 7.patch ==== qnew -m adding 9 # HG changeset patch # Parent Nine diff -r ... 9 --- /dev/null +++ b/9 @@ -0,0 +1,1 @@ +9 4: 7251936ac2bf Nine - test 3: 4f9d07369cc4 [mq]: 7.patch - john 2: 049de6af0c1d [mq]: 5.patch - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test ==== qref -u -d # HG changeset patch # User john # Date 15 0 # Parent Nine diff -r ... 9 --- /dev/null +++ b/9 @@ -0,0 +1,1 @@ +9 4: a0de5bf6e9f7 Nine - john 3: 4f9d07369cc4 [mq]: 7.patch - john 2: 049de6af0c1d [mq]: 5.patch - test 1: b1b6b0fe0e6d Three (again) - test 0: 4a67dfeea974 [mq]: 1.patch - test popping 9.patch now at: 7.patch ==== qpop -a / qpush -a popping 7.patch popping 5.patch popping 3.patch popping 1.patch patch queue now empty applying 1.patch applying 3.patch applying 5.patch applying 7.patch now at: 7.patch 3: d26a5b7ffce1 imported patch 7.patch - john - 13.00 2: dda6cf77060a imported patch 5.patch - test - 11.00 1: 25e32d66c8c7 Three (again) - test - 8.00 0: e5011c0211fe imported patch 1.patch - test - 4.00 $ rm -r sandbox mercurial-4.5.3/tests/test-merge4.t0000644015407300116100000000121613261161234017064 0ustar augieeng00000000000000 $ hg init $ echo This is file a1 > a $ hg add a $ hg commit -m "commit #0" $ echo This is file b1 > b $ hg add b $ hg commit -m "commit #1" $ hg update 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo This is file c1 > c $ hg add c $ hg commit -m "commit #2" created new head $ hg merge 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ rm b $ echo This is file c22 > c Test hg behaves when committing with a missing file added by a merge $ hg commit -m "commit #3" abort: cannot commit merge with missing files [255] mercurial-4.5.3/tests/test-filebranch.t0000644015407300116100000001003513261161234017775 0ustar augieeng00000000000000This test makes sure that we don't mark a file as merged with its ancestor when we do a merge. $ cat < merge > from __future__ import print_function > import sys, os > print("merging for", os.path.basename(sys.argv[1])) > EOF $ HGMERGE="$PYTHON ../merge"; export HGMERGE Creating base: $ hg init a $ cd a $ echo 1 > foo $ echo 1 > bar $ echo 1 > baz $ echo 1 > quux $ hg add foo bar baz quux $ hg commit -m "base" $ cd .. $ hg clone a b updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved Creating branch a: $ cd a $ echo 2a > foo $ echo 2a > bar $ hg commit -m "branch a" Creating branch b: $ cd .. $ cd b $ echo 2b > foo $ echo 2b > baz $ hg commit -m "branch b" We shouldn't have anything but n state here: $ hg debugstate --nodates | grep -v "^n" [1] Merging: $ hg pull ../a pulling from ../a searching for changes adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files (+1 heads) new changesets bdd988058d16 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg merge -v resolving manifests getting bar merging foo merging for foo 1 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ echo 2m > foo $ echo 2b > baz $ echo new > quux $ hg ci -m "merge" main: we should have a merge here: $ hg debugindex --changelog rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 73 ..... 0 cdca01651b96 000000000000 000000000000 (re) 1 73 68 ..... 1 f6718a9cb7f3 cdca01651b96 000000000000 (re) 2 141 68 ..... 2 bdd988058d16 cdca01651b96 000000000000 (re) 3 209 66 ..... 3 d8a521142a3c f6718a9cb7f3 bdd988058d16 (re) log should show foo and quux changed: $ hg log -v -r tip changeset: 3:d8a521142a3c tag: tip parent: 1:f6718a9cb7f3 parent: 2:bdd988058d16 user: test date: Thu Jan 01 00:00:00 1970 +0000 files: foo quux description: merge foo: we should have a merge here: $ hg debugindex foo rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 3 ..... 0 b8e02f643373 000000000000 000000000000 (re) 1 3 4 ..... 1 2ffeddde1b65 b8e02f643373 000000000000 (re) 2 7 4 ..... 2 33d1fb69067a b8e02f643373 000000000000 (re) 3 11 4 ..... 3 aa27919ee430 2ffeddde1b65 33d1fb69067a (re) bar: we should not have a merge here: $ hg debugindex bar rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 3 ..... 0 b8e02f643373 000000000000 000000000000 (re) 1 3 4 ..... 2 33d1fb69067a b8e02f643373 000000000000 (re) baz: we should not have a merge here: $ hg debugindex baz rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 3 ..... 0 b8e02f643373 000000000000 000000000000 (re) 1 3 4 ..... 1 2ffeddde1b65 b8e02f643373 000000000000 (re) quux: we should not have a merge here: $ hg debugindex quux rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 3 ..... 0 b8e02f643373 000000000000 000000000000 (re) 1 3 5 ..... 3 6128c0f33108 b8e02f643373 000000000000 (re) Manifest entries should match tips of all files: $ hg manifest --debug 33d1fb69067a0139622a3fa3b7ba1cdb1367972e 644 bar 2ffeddde1b65b4827f6746174a145474129fa2ce 644 baz aa27919ee4303cfd575e1fb932dd64d75aa08be4 644 foo 6128c0f33108e8cfbb4e0824d13ae48b466d7280 644 quux Everything should be clean now: $ hg status $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 4 files, 4 changesets, 10 total revisions $ cd .. mercurial-4.5.3/tests/test-i18n.t0000644015407300116100000000373513261161234016470 0ustar augieeng00000000000000(Translations are optional) #if gettext no-outer-repo Test that translations are compiled and installed correctly. Default encoding in tests is "ascii" and the translation is encoded using the "replace" error handler: $ LANGUAGE=pt_BR hg tip abortado: n?o foi encontrado um reposit?rio em '$TESTTMP' (.hg n?o encontrado)! [255] Using a more accommodating encoding: $ HGENCODING=UTF-8 LANGUAGE=pt_BR hg tip abortado: n\xc3\xa3o foi encontrado um reposit\xc3\xb3rio em '$TESTTMP' (.hg n\xc3\xa3o encontrado)! (esc) [255] Different encoding: $ HGENCODING=Latin-1 LANGUAGE=pt_BR hg tip abortado: n\xe3o foi encontrado um reposit\xf3rio em '$TESTTMP' (.hg n\xe3o encontrado)! (esc) [255] #endif #if gettext Test keyword search in translated help text: $ HGENCODING=UTF-8 LANGUAGE=de hg help -k Aktualisiert Themen: subrepos Unterarchive Befehle: pull Ruft \xc3\x84nderungen von der angegebenen Quelle ab (esc) update Aktualisiert das Arbeitsverzeichnis (oder wechselt die Version) #endif Check Mercurial specific translation problems in each *.po files, and tool itself by doctest $ cd "$TESTDIR"/../i18n $ $PYTHON check-translation.py *.po $ $PYTHON check-translation.py --doctest $ cd $TESTTMP #if gettext Check i18n cache isn't reused after encoding change: $ cat > $TESTTMP/encodingchange.py << EOF > from mercurial import encoding, registrar > from mercurial.i18n import _ > cmdtable = {} > command = registrar.command(cmdtable) > @command(b'encodingchange', norepo=True) > def encodingchange(ui): > for encode in (b'ascii', b'UTF-8', b'ascii', b'UTF-8'): > encoding.encoding = encode > ui.write(b'%s\n' % _(b'(EXPERIMENTAL)')) > EOF $ LANGUAGE=ja hg --config extensions.encodingchange=$TESTTMP/encodingchange.py encodingchange (?????) (\xe5\xae\x9f\xe9\xa8\x93\xe7\x9a\x84\xe5\xae\x9f\xe8\xa3\x85) (esc) (?????) (\xe5\xae\x9f\xe9\xa8\x93\xe7\x9a\x84\xe5\xae\x9f\xe8\xa3\x85) (esc) #endif mercurial-4.5.3/tests/test-exchange-obsmarkers-case-A6.t0000644015407300116100000001141413261161234023007 0ustar augieeng00000000000000============================================ Testing obsolescence markers push: Cases A.6 ============================================ Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of all changesets that requested to be "in sync" after the push (even if they are already on both side). This test belongs to a series of tests checking such set is properly computed and applied. This does not tests "obsmarkers" discovery capabilities. Category A: simple cases TestCase 6: new markers between changesets already known on both side Variants: # a: explicit push # b: bare push A.6 new markers between changesets already known on both side ============================================================== .. {{{ .. A ◕⇠◠B .. |/ .. ◠O .. }}} .. .. Marker exist from: .. .. * `A◕⇠◠B` .. .. Command runs: .. .. * hg push -r B .. * hg push .. .. Expected exchange: .. .. * `A◕⇠◠B` Setup ----- $ . $TESTDIR/testlib/exchange-obsmarker-util.sh initial $ setuprepos A.6 creating test repo for test case A.6 - pulldest - main - pushdest cd into `main` and proceed with env setup $ cd main $ mkcommit A0 $ hg update -q 0 $ mkcommit A1 created new head make both changeset known in remote $ hg push -qf ../pushdest $ hg push -qf ../pulldest create a marker after this $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'` obsoleted 1 changesets $ hg log -G --hidden @ e5ea8f9c7314 (draft): A1 | | x 28b51eb45704 (draft): A0 |/ o a9bdc8b26820 (public): O $ inspect_obsmarkers obsstore content ================ 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ cd .. $ cd .. $ cp -R A.6 A.6.a $ cp -R A.6 A.6.b Actual Test (explicit push version) ----------------------------------- $ dotest A.6.a A1 ## Running testcase A.6.a # testing echange of "A1" (e5ea8f9c7314) ## initial state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest ## pushing "A1" from main to pushdest pushing to pushdest searching for changes no changes found remote: 1 new obsolescence markers remote: obsoleted 1 changesets ## post push state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest ## pulling "e5ea8f9c7314" from main into pulldest pulling from main no changes found 1 new obsolescence markers obsoleted 1 changesets ## post pull state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} Actual Test (bare push version) ------------------------------- $ dotest A.6.b ## Running testcase A.6.b ## initial state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest ## pushing from main to pushdest pushing to pushdest searching for changes no changes found remote: 1 new obsolescence markers remote: obsoleted 1 changesets ## post push state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest ## pulling from main into pulldest pulling from main searching for changes no changes found 1 new obsolescence markers obsoleted 1 changesets ## post pull state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} mercurial-4.5.3/tests/test-obshistory.t0000644015407300116100000003605013261161234020112 0ustar augieeng00000000000000This test file test the various messages when accessing obsolete revisions. Global setup ============ $ . $TESTDIR/testlib/obsmarker-common.sh $ cat >> $HGRCPATH < [ui] > interactive = true > [phases] > publish=False > [experimental] > evolution.createmarkers = yes > evolution.effect-flags = yes > EOF Test output on amended commit ============================= Test setup ---------- $ hg init $TESTTMP/local-amend $ cd $TESTTMP/local-amend $ mkcommit ROOT $ mkcommit A0 $ echo 42 >> A0 $ hg commit --amend -m "A1 > > Better commit message" $ hg log --hidden -G @ changeset: 2:4ae3a4151de9 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A1 | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 2:4ae3a4151de9 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Actual test ----------- $ hg update 471f378eab4c abort: hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9! (use --hidden to access hidden revisions) [255] $ hg update --hidden "desc(A0)" updating to a hidden changeset 471f378eab4c (hidden revision '471f378eab4c' was rewritten as: 4ae3a4151de9) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Test output with pruned commit ============================== Test setup ---------- $ hg init $TESTTMP/local-prune $ cd $TESTTMP/local-prune $ mkcommit ROOT $ mkcommit A0 # 0 $ mkcommit B0 # 1 $ hg log --hidden -G @ changeset: 2:0dec01379d3b | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: B0 | o changeset: 1:471f378eab4c | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT $ hg debugobsolete --record-parents `getid 'desc(B0)'` obsoleted 1 changesets $ hg log --hidden -G @ changeset: 2:0dec01379d3b | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: pruned | summary: B0 | o changeset: 1:471f378eab4c | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Actual test ----------- $ hg up 1 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg up 0dec01379d3b abort: hidden revision '0dec01379d3b' is pruned! (use --hidden to access hidden revisions) [255] $ hg up --hidden -r 'desc(B0)' updating to a hidden changeset 0dec01379d3b (hidden revision '0dec01379d3b' is pruned) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Test output with splitted commit ================================ Test setup ---------- $ hg init $TESTTMP/local-split $ cd $TESTTMP/local-split $ mkcommit ROOT $ echo 42 >> a $ echo 43 >> b $ hg commit -A -m "A0" adding a adding b $ hg log --hidden -G @ changeset: 1:471597cad322 | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT # Simulate a split $ hg up 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo 42 >> a $ hg commit -A -m "A0" adding a created new head $ echo 43 >> b $ hg commit -A -m "A0" adding b $ hg debugobsolete `getid '1'` `getid '2'` `getid '3'` obsoleted 1 changesets $ hg log --hidden -G @ changeset: 3:f257fde29c7a | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 2:337fec4d2edc | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | | x changeset: 1:471597cad322 |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: split as 2:337fec4d2edc, 3:f257fde29c7a | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Actual test ----------- $ hg update 471597cad322 abort: hidden revision '471597cad322' was split as: 337fec4d2edc, f257fde29c7a! (use --hidden to access hidden revisions) [255] $ hg update --hidden 'min(desc(A0))' updating to a hidden changeset 471597cad322 (hidden revision '471597cad322' was split as: 337fec4d2edc, f257fde29c7a) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved Test output with lots of splitted commit ======================================== Test setup ---------- $ hg init $TESTTMP/local-lots-split $ cd $TESTTMP/local-lots-split $ mkcommit ROOT $ echo 42 >> a $ echo 43 >> b $ echo 44 >> c $ echo 45 >> d $ hg commit -A -m "A0" adding a adding b adding c adding d $ hg log --hidden -G @ changeset: 1:de7290d8b885 | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT # Simulate a split $ hg up 0 0 files updated, 0 files merged, 4 files removed, 0 files unresolved $ echo 42 >> a $ hg commit -A -m "A0" adding a created new head $ echo 43 >> b $ hg commit -A -m "A0" adding b $ echo 44 >> c $ hg commit -A -m "A0" adding c $ echo 45 >> d $ hg commit -A -m "A0" adding d $ hg debugobsolete `getid '1'` `getid '2'` `getid '3'` `getid '4'` `getid '5'` obsoleted 1 changesets $ hg log --hidden -G @ changeset: 5:c7f044602e9b | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 4:1ae8bc733a14 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 3:f257fde29c7a | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 2:337fec4d2edc | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | | x changeset: 1:de7290d8b885 |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: split as 2:337fec4d2edc, 3:f257fde29c7a, 4:1ae8bc733a14, 5:c7f044602e9b | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Actual test ----------- $ hg update de7290d8b885 abort: hidden revision 'de7290d8b885' was split as: 337fec4d2edc, f257fde29c7a and 2 more! (use --hidden to access hidden revisions) [255] $ hg update --hidden 'min(desc(A0))' updating to a hidden changeset de7290d8b885 (hidden revision 'de7290d8b885' was split as: 337fec4d2edc, f257fde29c7a and 2 more) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved Test output with folded commit ============================== Test setup ---------- $ hg init $TESTTMP/local-fold $ cd $TESTTMP/local-fold $ mkcommit ROOT $ mkcommit A0 $ mkcommit B0 $ hg log --hidden -G @ changeset: 2:0dec01379d3b | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: B0 | o changeset: 1:471f378eab4c | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT # Simulate a fold $ hg up 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo "A0" > A0 $ echo "B0" > B0 $ hg add A0 B0 $ hg commit -m "C0" created new head $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(C0)'` obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete `getid 'desc(B0)'` `getid 'desc(C0)'` obsoleted 1 changesets $ hg log --hidden -G @ changeset: 3:eb5a0daa2192 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: C0 | | x changeset: 2:0dec01379d3b | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | obsolete: rewritten as 3:eb5a0daa2192 | | summary: B0 | | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten as 3:eb5a0daa2192 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Actual test ----------- $ hg update 471f378eab4c abort: hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192! (use --hidden to access hidden revisions) [255] $ hg update --hidden 'desc(A0)' updating to a hidden changeset 471f378eab4c (hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192) 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg update 0dec01379d3b abort: hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192! (use --hidden to access hidden revisions) [255] $ hg update --hidden 'desc(B0)' updating to a hidden changeset 0dec01379d3b (hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Test output with divergence =========================== Test setup ---------- $ hg init $TESTTMP/local-divergence $ cd $TESTTMP/local-divergence $ mkcommit ROOT $ mkcommit A0 $ hg commit --amend -m "A1" $ hg log --hidden -G @ changeset: 2:fdf9bde5129a | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A1 | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 2:fdf9bde5129a | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT $ hg update --hidden 'desc(A0)' updating to a hidden changeset 471f378eab4c (hidden revision '471f378eab4c' was rewritten as: fdf9bde5129a) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg commit --amend -m "A2" 2 new content-divergent changesets $ hg log --hidden -G @ changeset: 3:65b757b745b9 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | instability: content-divergent | summary: A2 | | * changeset: 2:fdf9bde5129a |/ parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | instability: content-divergent | summary: A1 | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 2:fdf9bde5129a | obsolete: rewritten using amend as 3:65b757b745b9 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Actual test ----------- $ hg update 471f378eab4c abort: hidden revision '471f378eab4c' has diverged! (use --hidden to access hidden revisions) [255] $ hg update --hidden 'desc(A0)' updating to a hidden changeset 471f378eab4c (hidden revision '471f378eab4c' has diverged) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved Test output with amended + folded commit ======================================== Test setup ---------- $ hg init $TESTTMP/local-amend-fold $ cd $TESTTMP/local-amend-fold $ mkcommit ROOT $ mkcommit A0 $ mkcommit B0 $ hg commit --amend -m "B1" $ hg log --hidden -G @ changeset: 3:b7ea6d14e664 | tag: tip | parent: 1:471f378eab4c | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: B1 | | x changeset: 2:0dec01379d3b |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 3:b7ea6d14e664 | summary: B0 | o changeset: 1:471f378eab4c | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT # Simulate a fold $ hg up 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo "A0" > A0 $ echo "B0" > B0 $ hg add A0 B0 $ hg commit -m "C0" created new head $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(C0)'` obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete `getid 'desc(B1)'` `getid 'desc(C0)'` obsoleted 1 changesets $ hg log --hidden -G @ changeset: 4:eb5a0daa2192 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: C0 | | x changeset: 3:b7ea6d14e664 | | parent: 1:471f378eab4c | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | obsolete: rewritten as 4:eb5a0daa2192 | | summary: B1 | | | | x changeset: 2:0dec01379d3b | |/ user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | obsolete: rewritten using amend as 3:b7ea6d14e664 | | summary: B0 | | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten as 4:eb5a0daa2192 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Actual test ----------- $ hg update 471f378eab4c abort: hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192! (use --hidden to access hidden revisions) [255] $ hg update --hidden 'desc(A0)' updating to a hidden changeset 471f378eab4c (hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192) 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg update --hidden 0dec01379d3b updating to a hidden changeset 0dec01379d3b (hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg update 0dec01379d3b 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg update --hidden 'desc(B0)' 0 files updated, 0 files merged, 0 files removed, 0 files unresolved mercurial-4.5.3/tests/test-default-push.t0000644015407300116100000000701413261161234020304 0ustar augieeng00000000000000 $ hg init a $ echo a > a/a $ hg --cwd a ci -Ama adding a $ hg clone a c updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg clone a b updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo b >> b/a $ hg --cwd b ci -mb Push should provide a hint when both 'default' and 'default-push' not set: $ cd c $ hg push --config paths.default= abort: default repository not configured! (see 'hg help config.paths') [255] $ cd .. Push should push to 'default' when 'default-push' not set: $ hg --cwd b push pushing to $TESTTMP/a searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files Push should push to 'default-push' when set: $ echo '[paths]' >> b/.hg/hgrc $ echo 'default-push = ../c' >> b/.hg/hgrc $ hg --cwd b push pushing to $TESTTMP/c searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files But push should push to 'default' if explicitly specified (issue5000): $ hg --cwd b push default pushing to $TESTTMP/a searching for changes no changes found [1] Push should push to 'default-push' when 'default' is not set $ hg -q clone a push-default-only $ cd push-default-only $ rm .hg/hgrc $ touch foo $ hg -q commit -A -m 'add foo' $ hg --config paths.default-push=../a push pushing to $TESTTMP/a searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files $ cd .. Pushing to a path that isn't defined should not fall back to default $ hg --cwd b push doesnotexist abort: repository doesnotexist does not exist! [255] :pushurl is used when defined $ hg -q clone a pushurlsource $ hg -q clone a pushurldest $ cd pushurlsource Windows needs a leading slash to make a URL that passes all of the checks $ WD=`pwd` #if windows $ WD="/$WD" #endif $ cat > .hg/hgrc << EOF > [paths] > default = https://example.com/not/relevant > default:pushurl = file://$WD/../pushurldest > EOF $ touch pushurl $ hg -q commit -A -m 'add pushurl' $ hg push pushing to file:/*/$TESTTMP/pushurlsource/../pushurldest (glob) searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files :pushrev is used when no -r is passed $ cat >> .hg/hgrc << EOF > default:pushrev = . > EOF $ hg -q up -r 0 $ echo head1 > foo $ hg -q commit -A -m head1 $ hg -q up -r 0 $ echo head2 > foo $ hg -q commit -A -m head2 $ hg push -f pushing to file:/*/$TESTTMP/pushurlsource/../pushurldest (glob) searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) $ hg --config 'paths.default:pushrev=draft()' push -f pushing to file:/*/$TESTTMP/pushurlsource/../pushurldest (glob) searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) Invalid :pushrev raises appropriately $ hg --config 'paths.default:pushrev=notdefined()' push pushing to file:/*/$TESTTMP/pushurlsource/../pushurldest (glob) hg: parse error: unknown identifier: notdefined [255] $ hg --config 'paths.default:pushrev=(' push pushing to file:/*/$TESTTMP/pushurlsource/../pushurldest (glob) hg: parse error at 1: not a prefix: end [255] $ cd .. mercurial-4.5.3/tests/test-dirstate-race.t0000644015407300116100000001421713261161234020435 0ustar augieeng00000000000000 $ hg init repo $ cd repo $ echo a > a $ hg add a $ hg commit -m test Do we ever miss a sub-second change?: $ for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do > hg co -qC 0 > echo b > a > hg st > done M a M a M a M a M a M a M a M a M a M a M a M a M a M a M a M a M a M a M a M a $ echo test > b $ mkdir dir1 $ echo test > dir1/c $ echo test > d $ echo test > e #if execbit A directory will typically have the execute bit -- make sure it doesn't get confused with a file with the exec bit set $ chmod +x e #endif $ hg add b dir1 d e adding dir1/c $ hg commit -m test2 $ cat >> $TESTTMP/dirstaterace.py << EOF > from mercurial import ( > context, > extensions, > ) > def extsetup(): > extensions.wrapfunction(context.workingctx, '_checklookup', overridechecklookup) > def overridechecklookup(orig, self, files): > # make an update that changes the dirstate from underneath > self._repo.ui.system(r"sh '$TESTTMP/dirstaterace.sh'", > cwd=self._repo.root) > return orig(self, files) > EOF $ hg debugrebuilddirstate $ hg debugdirstate n 0 -1 unset a n 0 -1 unset b n 0 -1 unset d n 0 -1 unset dir1/c n 0 -1 unset e XXX Note that this returns M for files that got replaced by directories. This is definitely a bug, but the fix for that is hard and the next status run is fine anyway. $ cat > $TESTTMP/dirstaterace.sh < rm b && rm -r dir1 && rm d && mkdir d && rm e && mkdir e > EOF $ hg status --config extensions.dirstaterace=$TESTTMP/dirstaterace.py M d M e ! b ! dir1/c $ hg debugdirstate n 644 2 * a (glob) n 0 -1 unset b n 0 -1 unset d n 0 -1 unset dir1/c n 0 -1 unset e $ hg status ! b ! d ! dir1/c ! e $ rmdir d e $ hg update -C -q . Test that dirstate changes aren't written out at the end of "hg status", if .hg/dirstate is already changed simultaneously before acquisition of wlock in workingctx._poststatusfixup(). This avoidance is important to keep consistency of dirstate in race condition (see issue5584 for detail). $ hg parents -q 1:* (glob) $ hg debugrebuilddirstate $ hg debugdirstate n 0 -1 unset a n 0 -1 unset b n 0 -1 unset d n 0 -1 unset dir1/c n 0 -1 unset e $ cat > $TESTTMP/dirstaterace.sh < # This script assumes timetable of typical issue5584 case below: > # > # 1. "hg status" loads .hg/dirstate > # 2. "hg status" confirms clean-ness of FILE > # 3. "hg update -C 0" updates the working directory simultaneously > # (FILE is removed, and FILE is dropped from .hg/dirstate) > # 4. "hg status" acquires wlock > # (.hg/dirstate is re-loaded = no FILE entry in dirstate) > # 5. "hg status" marks FILE in dirstate as clean > # (FILE entry is added to in-memory dirstate) > # 6. "hg status" writes dirstate changes into .hg/dirstate > # (FILE entry is written into .hg/dirstate) > # > # To reproduce similar situation easily and certainly, #2 and #3 > # are swapped. "hg cat" below ensures #2 on "hg status" side. > > hg update -q -C 0 > hg cat -r 1 b > b > EOF "hg status" below should excludes "e", of which exec flag is set, for portability of test scenario, because unsure but missing "e" is treated differently in _checklookup() according to runtime platform. - "missing(!)" on POSIX, "pctx[f].cmp(self[f])" raises ENOENT - "modified(M)" on Windows, "self.flags(f) != pctx.flags(f)" is True $ hg status --config extensions.dirstaterace=$TESTTMP/dirstaterace.py --debug -X path:e skip updating dirstate: identity mismatch M a ! d ! dir1/c $ hg parents -q 0:* (glob) $ hg files a $ hg debugdirstate n * * * a (glob) $ rm b #if fsmonitor Create fsmonitor state. $ hg status $ f --type .hg/fsmonitor.state .hg/fsmonitor.state: file Test that invalidating fsmonitor state in the middle (which doesn't require the wlock) causes the fsmonitor update to be skipped. hg debugrebuilddirstate ensures that the dirstaterace hook will be called, but it also invalidates the fsmonitor state. So back it up and restore it. $ mv .hg/fsmonitor.state .hg/fsmonitor.state.tmp $ hg debugrebuilddirstate $ mv .hg/fsmonitor.state.tmp .hg/fsmonitor.state $ cat > $TESTTMP/dirstaterace.sh < rm .hg/fsmonitor.state > EOF $ hg status --config extensions.dirstaterace=$TESTTMP/dirstaterace.py --debug skip updating fsmonitor.state: identity mismatch $ f .hg/fsmonitor.state .hg/fsmonitor.state: file not found #endif Set up a rebase situation for issue5581. $ echo c2 > a $ echo c2 > b $ hg add b $ hg commit -m c2 created new head $ echo c3 >> a $ hg commit -m c3 $ hg update 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo c4 >> a $ echo c4 >> b $ hg commit -m c4 created new head Configure a merge tool that runs status in the middle of the rebase. The goal of the status call is to trigger a potential bug if fsmonitor's state is written even though the wlock is held by another process. The output of 'hg status' in the merge tool goes to /dev/null because we're more interested in the results of 'hg status' run after the rebase. $ cat >> $TESTTMP/mergetool-race.sh << EOF > echo "custom merge tool" > printf "c2\nc3\nc4\n" > \$1 > hg --cwd "$TESTTMP/repo" status > /dev/null > echo "custom merge tool end" > EOF $ cat >> $HGRCPATH << EOF > [extensions] > rebase = > [merge-tools] > test.executable=sh > test.args=$TESTTMP/mergetool-race.sh \$output > EOF $ hg rebase -s . -d 3 --tool test rebasing 4:b08445fd6b2a "c4" (tip) merging a custom merge tool custom merge tool end saved backup bundle to $TESTTMP/repo/.hg/strip-backup/* (glob) This hg status should be empty, whether or not fsmonitor is enabled (issue5581). $ hg status mercurial-4.5.3/tests/test-diff-newlines.t0000644015407300116100000000065213261161234020436 0ustar augieeng00000000000000 $ hg init $ $PYTHON -c 'open("a", "wb").write(b"confuse str.splitlines\nembedded\rnewline\n")' $ hg ci -Ama -d '1 0' adding a $ echo clean diff >> a $ hg ci -mb -d '2 0' $ hg diff -r0 -r1 diff -r 107ba6f817b5 -r 310ce7989cdc a --- a/a Thu Jan 01 00:00:01 1970 +0000 +++ b/a Thu Jan 01 00:00:02 1970 +0000 @@ -1,2 +1,3 @@ confuse str.splitlines embedded\r (no-eol) (esc) newline +clean diff mercurial-4.5.3/tests/test-largefiles-wireproto.t0000644015407300116100000003512213261161234022051 0ustar augieeng00000000000000This file contains testcases that tend to be related to the wire protocol part of largefiles. $ USERCACHE="$TESTTMP/cache"; export USERCACHE $ mkdir "${USERCACHE}" $ cat >> $HGRCPATH < [extensions] > largefiles= > purge= > rebase= > transplant= > [phases] > publish=False > [largefiles] > minsize=2 > patterns=glob:**.dat > usercache=${USERCACHE} > [web] > allow_archive = zip > [hooks] > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status" > EOF #if serve vanilla clients not locked out from largefiles servers on vanilla repos $ mkdir r1 $ cd r1 $ hg init $ echo c1 > f1 $ hg add f1 $ hg commit -m "m1" Invoking status precommit hook A f1 $ cd .. $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid $ cat hg.pid >> $DAEMON_PIDS $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2 requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets b6eb3a2e2efe updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved largefiles clients still work with vanilla servers $ hg serve --config extensions.largefiles=! -R r1 -d -p $HGPORT1 --pid-file hg.pid $ cat hg.pid >> $DAEMON_PIDS $ hg clone http://localhost:$HGPORT1 r3 requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets b6eb3a2e2efe updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved #endif vanilla clients locked out from largefiles http repos $ mkdir r4 $ cd r4 $ hg init $ echo c1 > f1 $ hg add --large f1 $ hg commit -m "m1" Invoking status precommit hook A f1 $ cd .. largefiles can be pushed locally (issue3583) $ hg init dest $ cd r4 $ hg outgoing ../dest comparing with ../dest searching for changes changeset: 0:639881c12b4c tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: m1 $ hg push ../dest pushing to ../dest searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files exit code with nothing outgoing (issue3611) $ hg outgoing ../dest comparing with ../dest searching for changes no changes found [1] $ cd .. #if serve $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid $ cat hg.pid >> $DAEMON_PIDS $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5 abort: remote error: This repository uses the largefiles extension. Please enable it in your Mercurial config file. [255] used all HGPORTs, kill all daemons $ killdaemons.py #endif vanilla clients locked out from largefiles ssh repos $ hg --config extensions.largefiles=! clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5 remote: remote: This repository uses the largefiles extension. remote: remote: Please enable it in your Mercurial config file. remote: remote: - abort: remote error (check previous remote output) [255] #if serve largefiles clients refuse to push largefiles repos to vanilla servers $ mkdir r6 $ cd r6 $ hg init $ echo c1 > f1 $ hg add f1 $ hg commit -m "m1" Invoking status precommit hook A f1 $ cat >> .hg/hgrc < [web] > push_ssl = false > allow_push = * > ! $ cd .. $ hg clone r6 r7 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd r7 $ echo c2 > f2 $ hg add --large f2 $ hg commit -m "m2" Invoking status precommit hook A f2 $ hg verify --large checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 2 changesets, 2 total revisions searching 1 changesets for largefiles verified existence of 1 revisions of 1 largefiles $ hg serve --config extensions.largefiles=! -R ../r6 -d -p $HGPORT --pid-file ../hg.pid $ cat ../hg.pid >> $DAEMON_PIDS $ hg push http://localhost:$HGPORT pushing to http://localhost:$HGPORT/ searching for changes abort: http://localhost:$HGPORT/ does not appear to be a largefile store [255] $ cd .. putlfile errors are shown (issue3123) Corrupt the cached largefile in r7 and move it out of the servers usercache $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 . $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8" $ hg init empty $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \ > --config 'web.allow_push=*' --config web.push_ssl=False $ cat hg.pid >> $DAEMON_PIDS $ hg push -R r7 http://localhost:$HGPORT1 pushing to http://localhost:$HGPORT1/ searching for changes remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ [255] $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 $ hg push -R r7 http://localhost:$HGPORT1 pushing to http://localhost:$HGPORT1/ searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 2 changesets with 2 changes to 2 files $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 server side corruption $ rm -rf empty Push a largefiles repository to a served empty repository $ hg init r8 $ echo c3 > r8/f1 $ hg add --large r8/f1 -R r8 $ hg commit -m "m1" -R r8 Invoking status precommit hook A f1 $ hg init empty $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \ > --config 'web.allow_push=*' --config web.push_ssl=False $ cat hg.pid >> $DAEMON_PIDS $ rm "${USERCACHE}"/* $ hg push -R r8 http://localhost:$HGPORT2/#default pushing to http://localhost:$HGPORT2/ searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] Clone over http, no largefiles pulled on clone. $ hg clone http://localhost:$HGPORT2/#default http-clone -U adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets cf03e5bb9936 Archive contains largefiles >>> import os >>> import urllib2 >>> u = 'http://localhost:%s/archive/default.zip' % os.environ['HGPORT2'] >>> with open('archive.zip', 'w') as f: ... f.write(urllib2.urlopen(u).read()) $ unzip -t archive.zip Archive: archive.zip testing: empty-default/.hg_archival.txt*OK (glob) testing: empty-default/f1*OK (glob) No errors detected in compressed data of archive.zip. test 'verify' with remotestore: $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 . $ hg -R http-clone verify --large --lfa checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 1 changesets, 1 total revisions searching 1 changesets for largefiles changeset 0:cf03e5bb9936: f1 missing verified existence of 1 revisions of 1 largefiles [1] $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/ $ hg -R http-clone -q verify --large --lfa largefiles pulled on update - a largefile missing on the server: $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 . $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache getting changed largefiles f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/ 0 largefiles updated, 0 removed 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R http-clone st ! f1 $ hg -R http-clone up -Cqr null largefiles pulled on update - a largefile corrupted on the server: $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache getting changed largefiles f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27) 0 largefiles updated, 0 removed 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R http-clone st ! f1 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] $ [ ! -f http-clone/f1 ] $ [ ! -f http-clone-usercache ] $ hg -R http-clone verify --large --lfc checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 1 changesets, 1 total revisions searching 1 changesets for largefiles verified contents of 1 revisions of 1 largefiles $ hg -R http-clone up -Cqr null largefiles pulled on update - no server side problems: $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/ $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache --config progress.debug=true resolving manifests branchmerge: False, force: False, partial: False ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936 .hglf/f1: remote created -> g getting .hglf/f1 updating: .hglf/f1 1/1 files (100.00%) getting changed largefiles using http://localhost:$HGPORT2/ sending capabilities command sending batch command getting largefiles: 0/1 files (0.00%) getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90 sending getlfile command found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store 1 largefiles updated, 0 removed 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ ls http-clone-usercache/* http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90 $ rm -rf empty http-clone* used all HGPORTs, kill all daemons $ killdaemons.py largefiles should batch verify remote calls $ hg init batchverifymain $ cd batchverifymain $ echo "aaa" >> a $ hg add --large a $ hg commit -m "a" Invoking status precommit hook A a $ echo "bbb" >> b $ hg add --large b $ hg commit -m "b" Invoking status precommit hook A b $ cd .. $ hg serve -R batchverifymain -d -p $HGPORT --pid-file hg.pid \ > -A access.log $ cat hg.pid >> $DAEMON_PIDS $ hg clone --noupdate http://localhost:$HGPORT batchverifyclone requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files new changesets 567253b0f523:04d19c27a332 $ hg -R batchverifyclone verify --large --lfa checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 2 changesets, 2 total revisions searching 2 changesets for largefiles verified existence of 2 revisions of 2 largefiles $ tail -1 access.log $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3D972a1a11f19934401291cc99117ec614933374ce%3Bstatlfile+sha%3Dc801c9cfe94400963fcb683246217d5db77f9a9a x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $ hg -R batchverifyclone update getting changed largefiles 2 largefiles updated, 0 removed 2 files updated, 0 files merged, 0 files removed, 0 files unresolved Clear log file before next test $ printf "" > access.log Verify should check file on remote server only when file is not available locally. $ echo "ccc" >> batchverifymain/c $ hg -R batchverifymain status ? c $ hg -R batchverifymain add --large batchverifymain/c $ hg -R batchverifymain commit -m "c" Invoking status precommit hook A c $ hg -R batchverifyclone pull pulling from http://localhost:$HGPORT/ searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 6bba8cb6935d (run 'hg update' to get a working copy) $ hg -R batchverifyclone verify --lfa checking changesets checking manifests crosschecking files in changesets and manifests checking files 3 files, 3 changesets, 3 total revisions searching 3 changesets for largefiles verified existence of 3 revisions of 3 largefiles $ tail -1 access.log $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3Dc8559c3c9cfb42131794b7d8009230403b9b454c x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $ killdaemons.py largefiles should not ask for password again after successful authorization $ hg init credentialmain $ cd credentialmain $ echo "aaa" >> a $ hg add --large a $ hg commit -m "a" Invoking status precommit hook A a Before running server clear the user cache to force clone to download a large file from the server rather than to get it from the cache $ rm "${USERCACHE}"/* $ cd .. $ cat << EOT > userpass.py > import base64 > from mercurial.hgweb import common > def perform_authentication(hgweb, req, op): > auth = req.env.get('HTTP_AUTHORIZATION') > if not auth: > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') > def extsetup(): > common.permhooks.insert(0, perform_authentication) > EOT $ hg serve --config extensions.x=userpass.py -R credentialmain \ > -d -p $HGPORT --pid-file hg.pid -A access.log $ cat hg.pid >> $DAEMON_PIDS $ cat << EOF > get_pass.py > import getpass > def newgetpass(arg): > return "pass" > getpass.getpass = newgetpass > EOF $ hg clone --config ui.interactive=true --config extensions.getpass=get_pass.py \ > http://user@localhost:$HGPORT credentialclone http authorization required for http://localhost:$HGPORT/ realm: mercurial user: user password: requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 567253b0f523 updating to branch default getting changed largefiles 1 largefiles updated, 0 removed 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ killdaemons.py $ rm hg.pid access.log #endif mercurial-4.5.3/tests/test-getbundle.t0000644015407300116100000003446513261161234017666 0ustar augieeng00000000000000#require serve = Test the getbundle() protocol function = Create a test repository: $ hg init repo $ cd repo $ hg debugbuilddag -n -m '+2 :fork +5 :p1 *fork +6 :p2 /p1 :m1 +3' > /dev/null $ hg log -G --template '{node}\n' o 10c14a2cc935e1d8c31f9e98587dcf27fb08a6da | o 4801a72e5d88cb515b0c7e40fae34180f3f837f2 | o 0b2f73f04880d9cb6a5cd8a757f0db0ad01e32c3 | o 8365676dbab05860ce0d9110f2af51368b961bbd |\ | o 5686dbbd9fc46cb806599c878d02fe1cb56b83d3 | | | o 13c0170174366b441dc68e8e33757232fa744458 | | | o 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 | | | o 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 | | | o 928b5f94cdb278bb536eba552de348a4e92ef24d | | | o f34414c64173e0ecb61b25dc55e116dbbcc89bee | | | o 8931463777131cd73923e560b760061f2aa8a4bc | | o | 6621d79f61b23ec74cf4b69464343d9e0980ec8b | | o | bac16991d12ff45f9dc43c52da1946dfadb83e80 | | o | ff42371d57168345fdf1a3aac66a51f6a45d41d2 | | o | d5f6e1ea452285324836a49d7d3c2a63cfed1d31 | | o | 713346a995c363120712aed1aee7e04afd867638 |/ o 29a4d1f17bd3f0779ca0525bebb1cfb51067c738 | o 7704483d56b2a7b5db54dcee7c62378ac629b348 $ cd .. = Test locally = Get everything: $ hg debuggetbundle repo bundle $ hg debugbundle bundle 7704483d56b2a7b5db54dcee7c62378ac629b348 29a4d1f17bd3f0779ca0525bebb1cfb51067c738 713346a995c363120712aed1aee7e04afd867638 d5f6e1ea452285324836a49d7d3c2a63cfed1d31 ff42371d57168345fdf1a3aac66a51f6a45d41d2 bac16991d12ff45f9dc43c52da1946dfadb83e80 6621d79f61b23ec74cf4b69464343d9e0980ec8b 8931463777131cd73923e560b760061f2aa8a4bc f34414c64173e0ecb61b25dc55e116dbbcc89bee 928b5f94cdb278bb536eba552de348a4e92ef24d 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 13c0170174366b441dc68e8e33757232fa744458 5686dbbd9fc46cb806599c878d02fe1cb56b83d3 8365676dbab05860ce0d9110f2af51368b961bbd 0b2f73f04880d9cb6a5cd8a757f0db0ad01e32c3 4801a72e5d88cb515b0c7e40fae34180f3f837f2 10c14a2cc935e1d8c31f9e98587dcf27fb08a6da Get part of linear run: $ hg debuggetbundle repo bundle -H 4801a72e5d88cb515b0c7e40fae34180f3f837f2 -C 8365676dbab05860ce0d9110f2af51368b961bbd $ hg debugbundle bundle 0b2f73f04880d9cb6a5cd8a757f0db0ad01e32c3 4801a72e5d88cb515b0c7e40fae34180f3f837f2 Get missing branch and merge: $ hg debuggetbundle repo bundle -H 4801a72e5d88cb515b0c7e40fae34180f3f837f2 -C 13c0170174366b441dc68e8e33757232fa744458 $ hg debugbundle bundle 713346a995c363120712aed1aee7e04afd867638 d5f6e1ea452285324836a49d7d3c2a63cfed1d31 ff42371d57168345fdf1a3aac66a51f6a45d41d2 bac16991d12ff45f9dc43c52da1946dfadb83e80 6621d79f61b23ec74cf4b69464343d9e0980ec8b 5686dbbd9fc46cb806599c878d02fe1cb56b83d3 8365676dbab05860ce0d9110f2af51368b961bbd 0b2f73f04880d9cb6a5cd8a757f0db0ad01e32c3 4801a72e5d88cb515b0c7e40fae34180f3f837f2 Get from only one head: $ hg debuggetbundle repo bundle -H 928b5f94cdb278bb536eba552de348a4e92ef24d -C 29a4d1f17bd3f0779ca0525bebb1cfb51067c738 $ hg debugbundle bundle 8931463777131cd73923e560b760061f2aa8a4bc f34414c64173e0ecb61b25dc55e116dbbcc89bee 928b5f94cdb278bb536eba552de348a4e92ef24d Get parts of two branches: $ hg debuggetbundle repo bundle -H 13c0170174366b441dc68e8e33757232fa744458 -C 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 -H bac16991d12ff45f9dc43c52da1946dfadb83e80 -C d5f6e1ea452285324836a49d7d3c2a63cfed1d31 $ hg debugbundle bundle ff42371d57168345fdf1a3aac66a51f6a45d41d2 bac16991d12ff45f9dc43c52da1946dfadb83e80 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 13c0170174366b441dc68e8e33757232fa744458 Check that we get all needed file changes: $ hg debugbundle bundle --all format: id, p1, p2, cset, delta base, len(delta) changelog ff42371d57168345fdf1a3aac66a51f6a45d41d2 d5f6e1ea452285324836a49d7d3c2a63cfed1d31 0000000000000000000000000000000000000000 ff42371d57168345fdf1a3aac66a51f6a45d41d2 d5f6e1ea452285324836a49d7d3c2a63cfed1d31 99 bac16991d12ff45f9dc43c52da1946dfadb83e80 ff42371d57168345fdf1a3aac66a51f6a45d41d2 0000000000000000000000000000000000000000 bac16991d12ff45f9dc43c52da1946dfadb83e80 ff42371d57168345fdf1a3aac66a51f6a45d41d2 99 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 0000000000000000000000000000000000000000 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 bac16991d12ff45f9dc43c52da1946dfadb83e80 102 13c0170174366b441dc68e8e33757232fa744458 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 0000000000000000000000000000000000000000 13c0170174366b441dc68e8e33757232fa744458 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 102 manifest dac7984588fc4eea7acbf39693a9c1b06f5b175d 591f732a3faf1fb903815273f3c199a514a61ccb 0000000000000000000000000000000000000000 ff42371d57168345fdf1a3aac66a51f6a45d41d2 591f732a3faf1fb903815273f3c199a514a61ccb 113 0772616e6b48a76afb6c1458e193cbb3dae2e4ff dac7984588fc4eea7acbf39693a9c1b06f5b175d 0000000000000000000000000000000000000000 bac16991d12ff45f9dc43c52da1946dfadb83e80 dac7984588fc4eea7acbf39693a9c1b06f5b175d 113 eb498cd9af6c44108e43041e951ce829e29f6c80 bff2f4817ced57b386caf7c4e3e36a4bc9af7e93 0000000000000000000000000000000000000000 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 0772616e6b48a76afb6c1458e193cbb3dae2e4ff 295 b15709c071ddd2d93188508ba156196ab4f19620 eb498cd9af6c44108e43041e951ce829e29f6c80 0000000000000000000000000000000000000000 13c0170174366b441dc68e8e33757232fa744458 eb498cd9af6c44108e43041e951ce829e29f6c80 114 mf 4f73f97080266ab8e0c0561ca8d0da3eaf65b695 301ca08d026bb72cb4258a9d211bdf7ca0bcd810 0000000000000000000000000000000000000000 ff42371d57168345fdf1a3aac66a51f6a45d41d2 301ca08d026bb72cb4258a9d211bdf7ca0bcd810 17 c7b583de053293870e145f45bd2d61643563fd06 4f73f97080266ab8e0c0561ca8d0da3eaf65b695 0000000000000000000000000000000000000000 bac16991d12ff45f9dc43c52da1946dfadb83e80 4f73f97080266ab8e0c0561ca8d0da3eaf65b695 18 266ee3c0302a5a18f1cf96817ac79a51836179e9 edc0f6b8db80d68ae6aff2b19f7e5347ab68fa63 0000000000000000000000000000000000000000 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 c7b583de053293870e145f45bd2d61643563fd06 149 698c6a36220548cd3903ca7dada27c59aa500c52 266ee3c0302a5a18f1cf96817ac79a51836179e9 0000000000000000000000000000000000000000 13c0170174366b441dc68e8e33757232fa744458 266ee3c0302a5a18f1cf96817ac79a51836179e9 19 nf11 33fbc651630ffa7ccbebfe4eb91320a873e7291c 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 0000000000000000000000000000000000000000 16 nf12 ddce0544363f037e9fb889faca058f52dc01c0a5 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 13c0170174366b441dc68e8e33757232fa744458 0000000000000000000000000000000000000000 16 nf4 3c1407305701051cbed9f9cb9a68bdfb5997c235 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 ff42371d57168345fdf1a3aac66a51f6a45d41d2 0000000000000000000000000000000000000000 15 nf5 0dbd89c185f53a1727c54cd1ce256482fa23968e 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 bac16991d12ff45f9dc43c52da1946dfadb83e80 0000000000000000000000000000000000000000 15 Get branch and merge: $ hg debuggetbundle repo bundle -C 7704483d56b2a7b5db54dcee7c62378ac629b348 -H 0b2f73f04880d9cb6a5cd8a757f0db0ad01e32c3 $ hg debugbundle bundle 29a4d1f17bd3f0779ca0525bebb1cfb51067c738 713346a995c363120712aed1aee7e04afd867638 d5f6e1ea452285324836a49d7d3c2a63cfed1d31 ff42371d57168345fdf1a3aac66a51f6a45d41d2 bac16991d12ff45f9dc43c52da1946dfadb83e80 6621d79f61b23ec74cf4b69464343d9e0980ec8b 8931463777131cd73923e560b760061f2aa8a4bc f34414c64173e0ecb61b25dc55e116dbbcc89bee 928b5f94cdb278bb536eba552de348a4e92ef24d 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 13c0170174366b441dc68e8e33757232fa744458 5686dbbd9fc46cb806599c878d02fe1cb56b83d3 8365676dbab05860ce0d9110f2af51368b961bbd 0b2f73f04880d9cb6a5cd8a757f0db0ad01e32c3 = Test bundle2 = $ hg debuggetbundle repo bundle -t bundle2 $ hg debugbundle bundle Stream params: {} changegroup -- {version: 01} 7704483d56b2a7b5db54dcee7c62378ac629b348 29a4d1f17bd3f0779ca0525bebb1cfb51067c738 713346a995c363120712aed1aee7e04afd867638 d5f6e1ea452285324836a49d7d3c2a63cfed1d31 ff42371d57168345fdf1a3aac66a51f6a45d41d2 bac16991d12ff45f9dc43c52da1946dfadb83e80 6621d79f61b23ec74cf4b69464343d9e0980ec8b 8931463777131cd73923e560b760061f2aa8a4bc f34414c64173e0ecb61b25dc55e116dbbcc89bee 928b5f94cdb278bb536eba552de348a4e92ef24d 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 13c0170174366b441dc68e8e33757232fa744458 5686dbbd9fc46cb806599c878d02fe1cb56b83d3 8365676dbab05860ce0d9110f2af51368b961bbd 0b2f73f04880d9cb6a5cd8a757f0db0ad01e32c3 4801a72e5d88cb515b0c7e40fae34180f3f837f2 10c14a2cc935e1d8c31f9e98587dcf27fb08a6da = Test via HTTP = Get everything: $ hg serve -R repo -p $HGPORT -d --pid-file=hg.pid -E error.log -A access.log $ cat hg.pid >> $DAEMON_PIDS $ hg debuggetbundle http://localhost:$HGPORT/ bundle $ hg debugbundle bundle 7704483d56b2a7b5db54dcee7c62378ac629b348 29a4d1f17bd3f0779ca0525bebb1cfb51067c738 713346a995c363120712aed1aee7e04afd867638 d5f6e1ea452285324836a49d7d3c2a63cfed1d31 ff42371d57168345fdf1a3aac66a51f6a45d41d2 bac16991d12ff45f9dc43c52da1946dfadb83e80 6621d79f61b23ec74cf4b69464343d9e0980ec8b 8931463777131cd73923e560b760061f2aa8a4bc f34414c64173e0ecb61b25dc55e116dbbcc89bee 928b5f94cdb278bb536eba552de348a4e92ef24d 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 13c0170174366b441dc68e8e33757232fa744458 5686dbbd9fc46cb806599c878d02fe1cb56b83d3 8365676dbab05860ce0d9110f2af51368b961bbd 0b2f73f04880d9cb6a5cd8a757f0db0ad01e32c3 4801a72e5d88cb515b0c7e40fae34180f3f837f2 10c14a2cc935e1d8c31f9e98587dcf27fb08a6da Get parts of two branches: $ hg debuggetbundle http://localhost:$HGPORT/ bundle -H 13c0170174366b441dc68e8e33757232fa744458 -C 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 -H bac16991d12ff45f9dc43c52da1946dfadb83e80 -C d5f6e1ea452285324836a49d7d3c2a63cfed1d31 $ hg debugbundle bundle ff42371d57168345fdf1a3aac66a51f6a45d41d2 bac16991d12ff45f9dc43c52da1946dfadb83e80 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 13c0170174366b441dc68e8e33757232fa744458 Check that we get all needed file changes: $ hg debugbundle bundle --all format: id, p1, p2, cset, delta base, len(delta) changelog ff42371d57168345fdf1a3aac66a51f6a45d41d2 d5f6e1ea452285324836a49d7d3c2a63cfed1d31 0000000000000000000000000000000000000000 ff42371d57168345fdf1a3aac66a51f6a45d41d2 d5f6e1ea452285324836a49d7d3c2a63cfed1d31 99 bac16991d12ff45f9dc43c52da1946dfadb83e80 ff42371d57168345fdf1a3aac66a51f6a45d41d2 0000000000000000000000000000000000000000 bac16991d12ff45f9dc43c52da1946dfadb83e80 ff42371d57168345fdf1a3aac66a51f6a45d41d2 99 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 700b7e19db54103633c4bf4a6a6b6d55f4d50c03 0000000000000000000000000000000000000000 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 bac16991d12ff45f9dc43c52da1946dfadb83e80 102 13c0170174366b441dc68e8e33757232fa744458 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 0000000000000000000000000000000000000000 13c0170174366b441dc68e8e33757232fa744458 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 102 manifest dac7984588fc4eea7acbf39693a9c1b06f5b175d 591f732a3faf1fb903815273f3c199a514a61ccb 0000000000000000000000000000000000000000 ff42371d57168345fdf1a3aac66a51f6a45d41d2 591f732a3faf1fb903815273f3c199a514a61ccb 113 0772616e6b48a76afb6c1458e193cbb3dae2e4ff dac7984588fc4eea7acbf39693a9c1b06f5b175d 0000000000000000000000000000000000000000 bac16991d12ff45f9dc43c52da1946dfadb83e80 dac7984588fc4eea7acbf39693a9c1b06f5b175d 113 eb498cd9af6c44108e43041e951ce829e29f6c80 bff2f4817ced57b386caf7c4e3e36a4bc9af7e93 0000000000000000000000000000000000000000 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 0772616e6b48a76afb6c1458e193cbb3dae2e4ff 295 b15709c071ddd2d93188508ba156196ab4f19620 eb498cd9af6c44108e43041e951ce829e29f6c80 0000000000000000000000000000000000000000 13c0170174366b441dc68e8e33757232fa744458 eb498cd9af6c44108e43041e951ce829e29f6c80 114 mf 4f73f97080266ab8e0c0561ca8d0da3eaf65b695 301ca08d026bb72cb4258a9d211bdf7ca0bcd810 0000000000000000000000000000000000000000 ff42371d57168345fdf1a3aac66a51f6a45d41d2 301ca08d026bb72cb4258a9d211bdf7ca0bcd810 17 c7b583de053293870e145f45bd2d61643563fd06 4f73f97080266ab8e0c0561ca8d0da3eaf65b695 0000000000000000000000000000000000000000 bac16991d12ff45f9dc43c52da1946dfadb83e80 4f73f97080266ab8e0c0561ca8d0da3eaf65b695 18 266ee3c0302a5a18f1cf96817ac79a51836179e9 edc0f6b8db80d68ae6aff2b19f7e5347ab68fa63 0000000000000000000000000000000000000000 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 c7b583de053293870e145f45bd2d61643563fd06 149 698c6a36220548cd3903ca7dada27c59aa500c52 266ee3c0302a5a18f1cf96817ac79a51836179e9 0000000000000000000000000000000000000000 13c0170174366b441dc68e8e33757232fa744458 266ee3c0302a5a18f1cf96817ac79a51836179e9 19 nf11 33fbc651630ffa7ccbebfe4eb91320a873e7291c 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 63476832d8ec6558cf9bbe3cbe0c757e5cf18043 0000000000000000000000000000000000000000 16 nf12 ddce0544363f037e9fb889faca058f52dc01c0a5 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 13c0170174366b441dc68e8e33757232fa744458 0000000000000000000000000000000000000000 16 nf4 3c1407305701051cbed9f9cb9a68bdfb5997c235 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 ff42371d57168345fdf1a3aac66a51f6a45d41d2 0000000000000000000000000000000000000000 15 nf5 0dbd89c185f53a1727c54cd1ce256482fa23968e 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 bac16991d12ff45f9dc43c52da1946dfadb83e80 0000000000000000000000000000000000000000 15 Verify we hit the HTTP server: $ cat access.log * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=700b7e19db54103633c4bf4a6a6b6d55f4d50c03+d5f6e1ea452285324836a49d7d3c2a63cfed1d31&heads=13c0170174366b441dc68e8e33757232fa744458+bac16991d12ff45f9dc43c52da1946dfadb83e80 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) $ cat error.log mercurial-4.5.3/tests/fakepatchtime.py0000644015407300116100000000216313261161234017720 0ustar augieeng00000000000000# extension to emulate invoking 'patch.internalpatch()' at the time # specified by '[fakepatchtime] fakenow' from __future__ import absolute_import from mercurial import ( extensions, patch as patchmod, registrar, util, ) configtable = {} configitem = registrar.configitem(configtable) configitem('fakepatchtime', 'fakenow', default=None, ) def internalpatch(orig, ui, repo, patchobj, strip, prefix='', files=None, eolmode='strict', similarity=0): if files is None: files = set() r = orig(ui, repo, patchobj, strip, prefix=prefix, files=files, eolmode=eolmode, similarity=similarity) fakenow = ui.config('fakepatchtime', 'fakenow') if fakenow: # parsing 'fakenow' in YYYYmmddHHMM format makes comparison between # 'fakenow' value and 'touch -t YYYYmmddHHMM' argument easy fakenow = util.parsedate(fakenow, ['%Y%m%d%H%M'])[0] for f in files: repo.wvfs.utime(f, (fakenow, fakenow)) return r def extsetup(ui): extensions.wrapfunction(patchmod, 'internalpatch', internalpatch) mercurial-4.5.3/tests/test-ui-verbosity.py0000644015407300116100000000262513261161234020534 0ustar augieeng00000000000000from __future__ import absolute_import, print_function import os from mercurial import ( ui as uimod, ) hgrc = os.environ['HGRCPATH'] f = open(hgrc) basehgrc = f.read() f.close() print(' hgrc settings command line options final result ') print(' quiet verbo debug quiet verbo debug quiet verbo debug') for i in xrange(64): hgrc_quiet = bool(i & 1<<0) hgrc_verbose = bool(i & 1<<1) hgrc_debug = bool(i & 1<<2) cmd_quiet = bool(i & 1<<3) cmd_verbose = bool(i & 1<<4) cmd_debug = bool(i & 1<<5) f = open(hgrc, 'w') f.write(basehgrc) f.write('\n[ui]\n') if hgrc_quiet: f.write('quiet = True\n') if hgrc_verbose: f.write('verbose = True\n') if hgrc_debug: f.write('debug = True\n') f.close() u = uimod.ui.load() if cmd_quiet or cmd_debug or cmd_verbose: u.setconfig('ui', 'quiet', str(bool(cmd_quiet))) u.setconfig('ui', 'verbose', str(bool(cmd_verbose))) u.setconfig('ui', 'debug', str(bool(cmd_debug))) check = '' if u.debugflag: if not u.verbose or u.quiet: check = ' *' elif u.verbose and u.quiet: check = ' +' print(('%2d %5s %5s %5s %5s %5s %5s -> %5s %5s %5s%s' % (i, hgrc_quiet, hgrc_verbose, hgrc_debug, cmd_quiet, cmd_verbose, cmd_debug, u.quiet, u.verbose, u.debugflag, check))) mercurial-4.5.3/tests/test-merge-halt.t0000644015407300116100000000622013261161234017726 0ustar augieeng00000000000000 $ cat >> $HGRCPATH < [extensions] > rebase= > [phases] > publish=False > [merge] > EOF $ hg init repo $ cd repo $ echo a > a $ echo b > b $ hg commit -qAm ab $ echo c >> a $ echo c >> b $ hg commit -qAm c $ hg up -q ".^" $ echo d >> a $ echo d >> b $ hg commit -qAm d Testing on-failure=continue $ echo on-failure=continue >> $HGRCPATH $ hg rebase -s 1 -d 2 --tool false rebasing 1:1f28a51c3c9b "c" merging a merging b merging a failed! merging b failed! unresolved conflicts (see hg resolve, then hg rebase --continue) [1] $ hg resolve --list U a U b $ hg rebase --abort rebase aborted Testing on-failure=halt $ echo on-failure=halt >> $HGRCPATH $ hg rebase -s 1 -d 2 --tool false rebasing 1:1f28a51c3c9b "c" merging a merging b merging a failed! merge halted after failed merge (see hg resolve) [1] $ hg resolve --list U a U b $ hg rebase --abort rebase aborted Testing on-failure=prompt $ cat <> $HGRCPATH > [merge] > on-failure=prompt > [ui] > interactive=1 > EOS $ cat < y > n > EOS rebasing 1:1f28a51c3c9b "c" merging a merging b merging a failed! continue merge operation (yn)? y merging b failed! continue merge operation (yn)? n merge halted after failed merge (see hg resolve) [1] $ hg resolve --list U a U b $ hg rebase --abort rebase aborted Check that successful tool with failed post-check halts the merge $ cat <> $HGRCPATH > [merge-tools] > true.check=changed > EOS $ cat < y > n > n > EOS rebasing 1:1f28a51c3c9b "c" merging a merging b output file a appears unchanged was merge successful (yn)? y output file b appears unchanged was merge successful (yn)? n merging b failed! continue merge operation (yn)? n merge halted after failed merge (see hg resolve) [1] $ hg resolve --list R a U b $ hg rebase --abort rebase aborted Check that conflicts with conflict check also halts the merge $ cat <> $HGRCPATH > [merge-tools] > true.check=conflicts > true.premerge=keep > [merge] > on-failure=halt > EOS $ hg rebase -s 1 -d 2 --tool true rebasing 1:1f28a51c3c9b "c" merging a merging b merging a failed! merge halted after failed merge (see hg resolve) [1] $ hg resolve --list U a U b $ hg rebase --abort rebase aborted Check that always-prompt also can halt the merge $ cat < y > n > EOS rebasing 1:1f28a51c3c9b "c" merging a merging b was merge of 'a' successful (yn)? y was merge of 'b' successful (yn)? n merging b failed! merge halted after failed merge (see hg resolve) [1] $ hg resolve --list R a U b $ hg rebase --abort rebase aborted Check that successful tool otherwise allows the merge to continue $ hg rebase -s 1 -d 2 --tool echo --keep --config merge-tools.echo.premerge=keep rebasing 1:1f28a51c3c9b "c" merging a merging b $TESTTMP/repo/a *a~base* *a~other* (glob) $TESTTMP/repo/b *b~base* *b~other* (glob) mercurial-4.5.3/tests/test-ui-color.py.out0000644015407300116100000000006713261161234020430 0ustar augieeng00000000000000warning error 'buffered\n' colored? True colored? True mercurial-4.5.3/tests/test-rebase-check-restore.t0000644015407300116100000000513213261161234021677 0ustar augieeng00000000000000 $ cat >> $HGRCPATH < [extensions] > rebase= > > [phases] > publish=False > > [alias] > tglog = log -G --template "{rev}:{phase} '{desc}' {branches}\n" > EOF $ hg init a $ cd a $ echo A > A $ hg add A $ hg ci -m A $ echo 'B' > B $ hg add B $ hg ci -m B $ echo C >> A $ hg ci -m C $ hg up -q -C 0 $ echo D >> A $ hg ci -m D created new head $ echo E > E $ hg add E $ hg ci -m E $ hg up -q -C 0 $ hg branch 'notdefault' marked working directory as branch notdefault (branches are permanent and global, did you want a bookmark?) $ echo F >> A $ hg ci -m F $ cd .. Rebasing B onto E - check keep: and phases $ hg clone -q -u . a a1 $ cd a1 $ hg phase --force --secret 2 $ hg tglog @ 5:draft 'F' notdefault | | o 4:draft 'E' | | | o 3:draft 'D' |/ | o 2:secret 'C' | | | o 1:draft 'B' |/ o 0:draft 'A' $ hg rebase -s 1 -d 4 --keep rebasing 1:27547f69f254 "B" rebasing 2:965c486023db "C" merging A warning: conflicts while merging A! (edit, then use 'hg resolve --mark') unresolved conflicts (see hg resolve, then hg rebase --continue) [1] Solve the conflict and go on: $ echo 'conflict solved' > A $ rm A.orig $ hg resolve -m A (no more unresolved files) continue: hg rebase --continue $ hg rebase --continue already rebased 1:27547f69f254 "B" as 45396c49d53b rebasing 2:965c486023db "C" $ hg tglog o 7:secret 'C' | o 6:draft 'B' | | @ 5:draft 'F' notdefault | | o | 4:draft 'E' | | o | 3:draft 'D' |/ | o 2:secret 'C' | | | o 1:draft 'B' |/ o 0:draft 'A' $ cd .. Rebase F onto E - check keepbranches: $ hg clone -q -u . a a2 $ cd a2 $ hg phase --force --secret 2 $ hg tglog @ 5:draft 'F' notdefault | | o 4:draft 'E' | | | o 3:draft 'D' |/ | o 2:secret 'C' | | | o 1:draft 'B' |/ o 0:draft 'A' $ hg rebase -s 5 -d 4 --keepbranches rebasing 5:01e6ebbd8272 "F" (tip) merging A warning: conflicts while merging A! (edit, then use 'hg resolve --mark') unresolved conflicts (see hg resolve, then hg rebase --continue) [1] Solve the conflict and go on: $ echo 'conflict solved' > A $ rm A.orig $ hg resolve -m A (no more unresolved files) continue: hg rebase --continue $ hg rebase --continue rebasing 5:01e6ebbd8272 "F" (tip) saved backup bundle to $TESTTMP/a2/.hg/strip-backup/01e6ebbd8272-6fd3a015-rebase.hg $ hg tglog @ 5:draft 'F' notdefault | o 4:draft 'E' | o 3:draft 'D' | | o 2:secret 'C' | | | o 1:draft 'B' |/ o 0:draft 'A' $ cd .. mercurial-4.5.3/tests/test-sparse-import.t0000644015407300116100000000711113261161234020506 0ustar augieeng00000000000000test sparse $ hg init myrepo $ cd myrepo $ cat >> $HGRCPATH < [extensions] > sparse= > purge= > strip= > rebase= > EOF $ echo a > index.html $ echo x > data.py $ echo z > readme.txt $ cat > base.sparse < [include] > *.sparse > EOF $ hg ci -Aqm 'initial' $ cat > webpage.sparse < %include base.sparse > [include] > *.html > EOF $ hg ci -Aqm 'initial' Import a rules file against a 'blank' sparse profile $ cat > $TESTTMP/rules_to_import < [include] > *.py > EOF $ hg debugsparse --import-rules $TESTTMP/rules_to_import $ ls data.py $ hg debugsparse --reset $ rm .hg/sparse $ cat > $TESTTMP/rules_to_import < %include base.sparse > [include] > *.py > EOF $ hg debugsparse --import-rules $TESTTMP/rules_to_import $ ls base.sparse data.py webpage.sparse $ hg debugsparse --reset $ rm .hg/sparse Start against an existing profile; rules *already active* should be ignored $ hg debugsparse --enable-profile webpage.sparse $ hg debugsparse --include *.py $ cat > $TESTTMP/rules_to_import < %include base.sparse > [include] > *.html > *.txt > [exclude] > *.py > EOF $ hg debugsparse --import-rules $TESTTMP/rules_to_import $ ls base.sparse index.html readme.txt webpage.sparse $ cat .hg/sparse %include webpage.sparse [include] *.py *.txt [exclude] *.py $ hg debugsparse --reset $ rm .hg/sparse Same tests, with -Tjson enabled to output summaries $ cat > $TESTTMP/rules_to_import < [include] > *.py > EOF $ hg debugsparse --import-rules $TESTTMP/rules_to_import -Tjson [ { "exclude_rules_added": 0, "files_added": 0, "files_conflicting": 0, "files_dropped": 4, "include_rules_added": 1, "profiles_added": 0 } ] $ hg debugsparse --reset $ rm .hg/sparse $ cat > $TESTTMP/rules_to_import < %include base.sparse > [include] > *.py > EOF $ hg debugsparse --import-rules $TESTTMP/rules_to_import -Tjson [ { "exclude_rules_added": 0, "files_added": 0, "files_conflicting": 0, "files_dropped": 2, "include_rules_added": 1, "profiles_added": 1 } ] $ hg debugsparse --reset $ rm .hg/sparse $ hg debugsparse --enable-profile webpage.sparse $ hg debugsparse --include *.py $ cat > $TESTTMP/rules_to_import < %include base.sparse > [include] > *.html > *.txt > [exclude] > *.py > EOF $ hg debugsparse --import-rules $TESTTMP/rules_to_import -Tjson [ { "exclude_rules_added": 1, "files_added": 1, "files_conflicting": 0, "files_dropped": 1, "include_rules_added": 1, "profiles_added": 0 } ] If importing results in no new rules being added, no refresh should take place! $ cat > $TESTTMP/trap_sparse_refresh.py < from mercurial import error, sparse > def extsetup(ui): > def abort_refresh(*args, **kwargs): > raise error.Abort('sparse._refresh called!') > sparse.refreshwdir = abort_refresh > EOF $ cat >> $HGRCPATH < [extensions] > trap_sparse_refresh=$TESTTMP/trap_sparse_refresh.py > EOF $ cat > $TESTTMP/rules_to_import < [include] > *.py > EOF $ hg debugsparse --import-rules $TESTTMP/rules_to_import If an exception is raised during refresh, restore the existing rules again. $ cat > $TESTTMP/rules_to_import < [exclude] > *.html > EOF $ hg debugsparse --import-rules $TESTTMP/rules_to_import abort: sparse._refresh called! [255] $ cat .hg/sparse %include webpage.sparse [include] *.py *.txt [exclude] *.py mercurial-4.5.3/tests/test-rebase-legacy.t0000644015407300116100000000365213261161234020412 0ustar augieeng00000000000000Test rebase --continue with rebasestate written by legacy client $ cat >> $HGRCPATH < [extensions] > rebase= > drawdag=$TESTDIR/drawdag.py > EOF $ hg init $ hg debugdrawdag <<'EOF' > D H > | | > C G > | | > B F > | | > Z A E > \|/ > R > EOF rebasestate generated by a legacy client running "hg rebase -r B+D+E+G+H -d Z" $ touch .hg/last-message.txt $ cat > .hg/rebasestate < 0000000000000000000000000000000000000000 > f424eb6a8c01c4a0c0fba9f863f79b3eb5b4b69f > 0000000000000000000000000000000000000000 > 0 > 0 > 0 > > 21a6c45028857f500f56ae84fbf40689c429305b:-2 > de008c61a447fcfd93f808ef527d933a84048ce7:0000000000000000000000000000000000000000 > c1e6b162678d07d0b204e5c8267d51b4e03b633c:0000000000000000000000000000000000000000 > aeba276fcb7df8e10153a07ee728d5540693f5aa:-3 > bd5548558fcf354d37613005737a143871bf3723:-3 > d2fa1c02b2401b0e32867f26cce50818a4bd796a:0000000000000000000000000000000000000000 > 6f7a236de6852570cd54649ab62b1012bb78abc8:0000000000000000000000000000000000000000 > 6582e6951a9c48c236f746f186378e36f59f4928:0000000000000000000000000000000000000000 > EOF $ hg rebase --continue rebasing 4:c1e6b162678d "B" (B) rebasing 8:6f7a236de685 "D" (D) rebasing 2:de008c61a447 "E" (E) rebasing 7:d2fa1c02b240 "G" (G) rebasing 9:6582e6951a9c "H" (H tip) warning: orphaned descendants detected, not stripping c1e6b162678d, de008c61a447 saved backup bundle to $TESTTMP/.hg/strip-backup/6f7a236de685-9880a3dc-rebase.hg $ hg log -G -T '{rev}:{node|short} {desc}\n' o 11:721b8da0a708 H | o 10:9d65695ec3c2 G | o 9:21c8397a5d68 E | | o 8:fc52970345e8 D | | | o 7:eac96551b107 B |/ | o 6:bd5548558fcf C | | | | o 5:aeba276fcb7d F | | | | o | 4:c1e6b162678d B | | | o | | 3:f424eb6a8c01 Z | | | +---o 2:de008c61a447 E | | | o 1:21a6c4502885 A |/ o 0:b41ce7760717 R mercurial-4.5.3/tests/test-copy-move-merge.t0000644015407300116100000001000413261161234020707 0ustar augieeng00000000000000Test for the full copytracing algorithm ======================================= $ hg init t $ cd t $ echo 1 > a $ hg ci -qAm "first" $ hg cp a b $ hg mv a c $ echo 2 >> b $ echo 2 >> c $ hg ci -qAm "second" $ hg co -C 0 1 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo 0 > a $ echo 1 >> a $ hg ci -qAm "other" $ hg merge --debug searching for copies back to rev 1 unmatched files in other: b c all copies found (* = to merge, ! = divergent, % = renamed and deleted): src: 'a' -> dst: 'b' * src: 'a' -> dst: 'c' * checking for directory renames resolving manifests branchmerge: True, force: False, partial: False ancestor: b8bf91eeebbc, local: add3f11052fa+, remote: 17c05bb7fcb6 preserving a for resolve of b preserving a for resolve of c removing a starting 4 threads for background file closing (?) b: remote moved from a -> m (premerge) picked tool ':merge' for b (binary False symlink False changedelete False) merging a and b to b my b@add3f11052fa+ other b@17c05bb7fcb6 ancestor a@b8bf91eeebbc premerge successful c: remote moved from a -> m (premerge) picked tool ':merge' for c (binary False symlink False changedelete False) merging a and c to c my c@add3f11052fa+ other c@17c05bb7fcb6 ancestor a@b8bf91eeebbc premerge successful 0 files updated, 2 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) file b $ cat b 0 1 2 file c $ cat c 0 1 2 Test disabling copy tracing - first verify copy metadata was kept $ hg up -qC 2 $ hg rebase --keep -d 1 -b 2 --config extensions.rebase= rebasing 2:add3f11052fa "other" (tip) merging b and a to b merging c and a to c $ cat b 0 1 2 - next verify copy metadata is lost when disabled $ hg strip -r . --config extensions.strip= 2 files updated, 0 files merged, 0 files removed, 0 files unresolved saved backup bundle to $TESTTMP/t/.hg/strip-backup/550bd84c0cd3-fc575957-backup.hg $ hg up -qC 2 $ hg rebase --keep -d 1 -b 2 --config extensions.rebase= --config experimental.copytrace=off --config ui.interactive=True << EOF > c > EOF rebasing 2:add3f11052fa "other" (tip) other [source] changed a which local [dest] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c $ cat b 1 2 $ cd .. Verify disabling copy tracing still keeps copies from rebase source $ hg init copydisable $ cd copydisable $ touch a $ hg ci -Aqm 'add a' $ touch b $ hg ci -Aqm 'add b, c' $ hg cp b x $ echo x >> x $ hg ci -qm 'copy b->x' $ hg up -q 1 $ touch z $ hg ci -Aqm 'add z' $ hg log -G -T '{rev} {desc}\n' @ 3 add z | | o 2 copy b->x |/ o 1 add b, c | o 0 add a $ hg rebase -d . -b 2 --config extensions.rebase= --config experimental.copytrace=off rebasing 2:6adcf8c12e7d "copy b->x" saved backup bundle to $TESTTMP/copydisable/.hg/strip-backup/6adcf8c12e7d-ce4b3e75-rebase.hg $ hg up -q 3 $ hg log -f x -T '{rev} {desc}\n' 3 copy b->x 1 add b, c $ cd ../ Verify we duplicate existing copies, instead of detecting them $ hg init copydisable3 $ cd copydisable3 $ touch a $ hg ci -Aqm 'add a' $ hg cp a b $ hg ci -Aqm 'copy a->b' $ hg mv b c $ hg ci -Aqm 'move b->c' $ hg up -q 0 $ hg cp a b $ echo b >> b $ hg ci -Aqm 'copy a->b (2)' $ hg log -G -T '{rev} {desc}\n' @ 3 copy a->b (2) | | o 2 move b->c | | | o 1 copy a->b |/ o 0 add a $ hg rebase -d 2 -s 3 --config extensions.rebase= --config experimental.copytrace=off rebasing 3:47e1a9e6273b "copy a->b (2)" (tip) saved backup bundle to $TESTTMP/copydisable3/.hg/strip-backup/47e1a9e6273b-2d099c59-rebase.hg $ hg log -G -f b @ changeset: 3:76024fb4b05b : tag: tip : user: test : date: Thu Jan 01 00:00:00 1970 +0000 : summary: copy a->b (2) : o changeset: 0:ac82d8b1f7c4 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add a mercurial-4.5.3/tests/test-username-newline.t0000644015407300116100000000101513261161234021154 0ustar augieeng00000000000000 $ hg init $ touch a $ unset HGUSER $ echo "[ui]" >> .hg/hgrc $ echo "username= foo" >> .hg/hgrc $ echo " bar1" >> .hg/hgrc $ hg ci -Am m adding a abort: username 'foo\nbar1' contains a newline [255] $ rm .hg/hgrc $ HGUSER=`(echo foo; echo bar2)` hg ci -Am m adding a abort: username 'foo\nbar2' contains a newline [255] $ hg ci -Am m -u "`(echo foo; echo bar3)`" adding a transaction abort! rollback completed abort: username 'foo\nbar3' contains a newline! [255] mercurial-4.5.3/tests/test-convert-hg-source.t0000644015407300116100000001123013261161234021250 0ustar augieeng00000000000000 $ cat >> $HGRCPATH < [extensions] > convert= > [convert] > hg.saverev=False > EOF $ hg init orig $ cd orig $ echo foo > foo $ echo bar > bar $ hg ci -qAm 'add foo bar' -d '0 0' $ echo >> foo $ hg ci -m 'change foo' -d '1 0' $ hg up -qC 0 $ hg copy --after --force foo bar $ hg copy foo baz $ hg ci -m 'make bar and baz copies of foo' -d '2 0' created new head Test that template can print all file copies (issue4362) $ hg log -r . --template "{file_copies % ' File: {file_copy}\n'}" File: bar (foo) File: baz (foo) $ hg bookmark premerge1 $ hg merge -r 1 merging baz and foo to baz 1 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m 'merge local copy' -d '3 0' $ hg up -C 1 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (leaving bookmark premerge1) $ hg bookmark premerge2 $ hg merge 2 merging foo and baz to baz 1 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m 'merge remote copy' -d '4 0' created new head Make and delete some tags $ hg tag that $ hg tag --remove that $ hg tag this #if execbit $ chmod +x baz #else $ echo some other change to make sure we get a rev 5 > baz #endif $ hg ci -m 'mark baz executable' -d '5 0' $ cd .. $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded' initializing destination new repository scanning source... sorting... converting... 8 add foo bar 7 change foo 6 make bar and baz copies of foo 5 merge local copy 4 merge remote copy 3 Added tag that for changeset 88586c4e9f02 2 Removed tag that 1 Added tag this for changeset c56a7f387039 0 mark baz executable updating bookmarks $ cd new $ hg out ../orig comparing with ../orig searching for changes no changes found [1] #if execbit $ hg bookmarks premerge1 3:973ef48a98a4 premerge2 8:91d107c423ba #else Different hash because no x bit $ hg bookmarks premerge1 3:973ef48a98a4 premerge2 8:3537b15eaaca #endif Test that redoing a convert results in an identical graph $ cd ../ $ rm new/.hg/shamap $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded' scanning source... sorting... converting... 8 add foo bar 7 change foo 6 make bar and baz copies of foo 5 merge local copy 4 merge remote copy 3 Added tag that for changeset 88586c4e9f02 2 Removed tag that 1 Added tag this for changeset c56a7f387039 0 mark baz executable updating bookmarks $ hg -R new log -G -T '{rev} {desc}' o 8 mark baz executable | o 7 Added tag this for changeset c56a7f387039 | o 6 Removed tag that | o 5 Added tag that for changeset 88586c4e9f02 | o 4 merge remote copy |\ +---o 3 merge local copy | |/ | o 2 make bar and baz copies of foo | | o | 1 change foo |/ o 0 add foo bar check shamap LF and CRLF handling $ cat > rewrite.py < import sys > # Interlace LF and CRLF > lines = [(l.rstrip() + ((i % 2) and '\n' or '\r\n')) > for i, l in enumerate(file(sys.argv[1]))] > file(sys.argv[1], 'wb').write(''.join(lines)) > EOF $ $PYTHON rewrite.py new/.hg/shamap $ cd orig $ hg up -qC 1 $ echo foo >> foo $ hg ci -qm 'change foo again' $ hg up -qC 2 $ echo foo >> foo $ hg ci -qm 'change foo again again' $ cd .. $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded' scanning source... sorting... converting... 1 change foo again again 0 change foo again updating bookmarks init broken repository $ hg init broken $ cd broken $ echo a >> a $ echo b >> b $ hg ci -qAm init $ echo a >> a $ echo b >> b $ hg copy b c $ hg ci -qAm changeall $ hg up -qC 0 $ echo bc >> b $ hg ci -m changebagain created new head $ HGMERGE=internal:local hg -q merge $ hg ci -m merge $ hg mv b d $ hg ci -m moveb break it $ rm .hg/store/data/b.* $ cd .. $ hg --config convert.hg.ignoreerrors=True convert broken fixed initializing destination fixed repository scanning source... sorting... converting... 4 init ignoring: data/b.i@1e88685f5dde: no match found 3 changeall 2 changebagain 1 merge 0 moveb $ hg -R fixed verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 3 files, 5 changesets, 5 total revisions manifest -r 0 $ hg -R fixed manifest -r 0 a manifest -r tip $ hg -R fixed manifest -r tip a c d mercurial-4.5.3/tests/test-convert-svn-source.t0000644015407300116100000002230313261161234021463 0ustar augieeng00000000000000#require svn svn-bindings $ filter_svn_output () { > egrep -v 'Committing|Updating|(^$)' | sed -e 's/done$//' || true > } $ cat >> $HGRCPATH < [extensions] > convert = > [convert] > svn.trunk = mytrunk > EOF $ svnadmin create svn-repo $ SVNREPOPATH=`pwd`/svn-repo #if windows $ SVNREPOURL=file:///`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` #else $ SVNREPOURL=file://`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` #endif $ INVALIDREVISIONID=svn:x2147622-4a9f-4db4-a8d3-13562ff547b2/proj%20B/mytrunk@1 $ VALIDREVISIONID=svn:a2147622-4a9f-4db4-a8d3-13562ff547b2/proj%20B/mytrunk/mytrunk@1 Now test that it works with trunk/tags layout, but no branches yet. Initial svn import $ mkdir projB $ cd projB $ mkdir mytrunk $ mkdir tags $ cd .. $ svn import -m "init projB" projB "$SVNREPOURL/proj%20B" | filter_svn_output | sort Adding projB/mytrunk Adding projB/tags Committed revision 1. Update svn repository $ svn co "$SVNREPOURL/proj%20B/mytrunk" B | filter_svn_output Checked out revision 1. $ cd B $ echo hello > 'letter .txt' $ svn add 'letter .txt' | filter_svn_output A letter .txt $ svn ci -m hello | filter_svn_output Adding letter .txt Transmitting file data . Committed revision 2. $ svn-safe-append.py world 'letter .txt' $ svn ci -m world | filter_svn_output Sending letter .txt Transmitting file data . Committed revision 3. $ svn copy -m "tag v0.1" "$SVNREPOURL/proj%20B/mytrunk" "$SVNREPOURL/proj%20B/tags/v0.1" | filter_svn_output Committed revision 4. $ svn-safe-append.py 'nice day today!' 'letter .txt' $ svn ci -m "nice day" | filter_svn_output Sending letter .txt Transmitting file data . Committed revision 5. $ cd .. Convert to hg once and also test localtimezone option NOTE: This doesn't check all time zones -- it merely determines that the configuration option is taking effect. An arbitrary (U.S.) time zone is used here. TZ=US/Hawaii is selected since it does not use DST (unlike other U.S. time zones) and is always a fixed difference from UTC. $ TZ=US/Hawaii hg convert --config convert.localtimezone=True "$SVNREPOURL/proj%20B" B-hg initializing destination B-hg repository scanning source... sorting... converting... 3 init projB 2 hello 1 world 0 nice day updating tags Update svn repository again $ cd B $ svn-safe-append.py "see second letter" 'letter .txt' $ echo "nice to meet you" > letter2.txt $ svn add letter2.txt | filter_svn_output A letter2.txt $ svn ci -m "second letter" | filter_svn_output Sending letter .txt Adding letter2.txt Transmitting file data .. Committed revision 6. $ svn copy -m "tag v0.2" "$SVNREPOURL/proj%20B/mytrunk" "$SVNREPOURL/proj%20B/tags/v0.2" | filter_svn_output Committed revision 7. $ svn-safe-append.py "blah-blah-blah" letter2.txt $ svn ci -m "work in progress" | filter_svn_output Sending letter2.txt Transmitting file data . Committed revision 8. $ cd .. $ hg convert -s svn "$SVNREPOURL/proj%20B/non-existent-path" dest initializing destination dest repository abort: no revision found in module /proj B/non-existent-path [255] ######################################## Test incremental conversion $ TZ=US/Hawaii hg convert --config convert.localtimezone=True "$SVNREPOURL/proj%20B" B-hg scanning source... sorting... converting... 1 second letter 0 work in progress updating tags $ cd B-hg $ hg log -G --template '{rev} {desc|firstline} date: {date|date} files: {files}\n' o 7 update tags date: * +0000 files: .hgtags (glob) | o 6 work in progress date: * -1000 files: letter2.txt (glob) | o 5 second letter date: * -1000 files: letter .txt letter2.txt (glob) | o 4 update tags date: * +0000 files: .hgtags (glob) | o 3 nice day date: * -1000 files: letter .txt (glob) | o 2 world date: * -1000 files: letter .txt (glob) | o 1 hello date: * -1000 files: letter .txt (glob) | o 0 init projB date: * -1000 files: (glob) $ hg tags -q tip v0.2 v0.1 $ cd .. Test filemap $ echo 'include letter2.txt' > filemap $ hg convert --filemap filemap "$SVNREPOURL/proj%20B/mytrunk" fmap initializing destination fmap repository scanning source... sorting... converting... 5 init projB 4 hello 3 world 2 nice day 1 second letter 0 work in progress $ hg -R fmap branch -q default $ hg log -G -R fmap --template '{rev} {desc|firstline} files: {files}\n' o 1 work in progress files: letter2.txt | o 0 second letter files: letter2.txt Convert with --full adds and removes files that didn't change $ cd B $ echo >> "letter .txt" $ svn ci -m 'nothing' | filter_svn_output Sending letter .txt Transmitting file data . Committed revision 9. $ cd .. $ echo 'rename letter2.txt letter3.txt' > filemap $ hg convert --filemap filemap --full "$SVNREPOURL/proj%20B/mytrunk" fmap scanning source... sorting... converting... 0 nothing $ hg -R fmap st --change tip A letter .txt A letter3.txt R letter2.txt test invalid splicemap1 $ cat > splicemap < $INVALIDREVISIONID $VALIDREVISIONID > EOF $ hg convert --splicemap splicemap "$SVNREPOURL/proj%20B/mytrunk" smap initializing destination smap repository abort: splicemap entry svn:x2147622-4a9f-4db4-a8d3-13562ff547b2/proj%20B/mytrunk@1 is not a valid revision identifier [255] Test stop revision $ hg convert --rev 1 "$SVNREPOURL/proj%20B/mytrunk" stoprev initializing destination stoprev repository scanning source... sorting... converting... 0 init projB $ hg -R stoprev branch -q default Check convert_revision extra-records. This is also the only place testing more than one extra field in a revision. $ cd stoprev $ hg tip --debug | grep extra extra: branch=default extra: convert_revision=svn:........-....-....-....-............/proj B/mytrunk@1 (re) $ cd .. Test converting empty heads (issue3347). Also tests getting logs directly without debugsvnlog. $ svnadmin create svn-empty $ svnadmin load -q svn-empty < "$TESTDIR/svn/empty.svndump" $ hg --config convert.svn.trunk= --config convert.svn.debugsvnlog=0 convert svn-empty assuming destination svn-empty-hg initializing destination svn-empty-hg repository scanning source... sorting... converting... 1 init projA 0 adddir $ hg --config convert.svn.trunk= convert "$SVNREPOURL/../svn-empty/trunk" assuming destination trunk-hg initializing destination trunk-hg repository scanning source... sorting... converting... 1 init projA 0 adddir Test that a too-new repository format is properly rejected: $ mv svn-empty/format format $ echo 999 > svn-empty/format It's important that this command explicitly specify svn, otherwise it can have surprising side effects (like falling back to a perforce depot that can be seen from the test environment and slurping from that.) $ hg convert --source-type svn svn-empty this-will-fail initializing destination this-will-fail repository file:/*/$TESTTMP/svn-empty does not look like a Subversion repository to libsvn version 1.*.* (glob) abort: svn-empty: missing or unsupported repository [255] $ mv format svn-empty/format enable svn subrepos $ cat >> $HGRCPATH < [subrepos] > svn:allowed = true > EOF try converting when we have an svn subrepo and a merge in hg superrepo (issue5657) $ cd "$TESTTMP" $ hg init withmerge $ cd withmerge $ echo "subrepo = [svn]$SVNREPOURL" >.hgsub $ hg add .hgsub $ svn checkout "$SVNREPOURL" subrepo | sort A subrepo/proj B A subrepo/proj B/mytrunk A subrepo/proj B/mytrunk/letter .txt A subrepo/proj B/mytrunk/letter2.txt A subrepo/proj B/tags A subrepo/proj B/tags/v0.1 A subrepo/proj B/tags/v0.1/letter .txt A subrepo/proj B/tags/v0.2 A subrepo/proj B/tags/v0.2/letter .txt A subrepo/proj B/tags/v0.2/letter2.txt Checked out revision 9. $ hg ci -m "Adding svn subrepo" $ touch file1.txt $ hg add file1.txt $ hg ci -m "Adding file1" $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ touch file2.txt $ hg add file2.txt $ hg ci -m "Adding file2" created new head $ hg merge 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m "merged" $ cd .. $ hg --config extensions.convert= convert withmerge withmerge-converted initializing destination withmerge-converted repository scanning source... sorting... converting... 3 Adding svn subrepo 2 Adding file1 1 Adding file2 0 merged $ cd withmerge-converted $ hg up | sort 4 files updated, 0 files merged, 0 files removed, 0 files unresolved A subrepo/proj B A subrepo/proj B/mytrunk A subrepo/proj B/mytrunk/letter .txt A subrepo/proj B/mytrunk/letter2.txt A subrepo/proj B/tags A subrepo/proj B/tags/v0.1 A subrepo/proj B/tags/v0.1/letter .txt A subrepo/proj B/tags/v0.2 A subrepo/proj B/tags/v0.2/letter .txt A subrepo/proj B/tags/v0.2/letter2.txt Checked out revision 9. $ ls file1.txt file2.txt subrepo mercurial-4.5.3/tests/test-profile.t0000644015407300116100000000752013261161234017345 0ustar augieeng00000000000000test --time $ hg --time help -q help 2>&1 | grep time > /dev/null $ hg init a $ cd a Function to check that statprof ran $ statprofran () { > egrep 'Sample count:|No samples recorded' > /dev/null > } test --profile $ hg st --profile 2>&1 | statprofran Abreviated version $ hg st --prof 2>&1 | statprofran In alias $ hg --config "alias.profst=status --profile" profst 2>&1 | statprofran #if lsprof $ prof='hg --config profiling.type=ls --profile' $ $prof st 2>../out $ grep CallCount ../out > /dev/null || cat ../out $ $prof --config profiling.output=../out st $ grep CallCount ../out > /dev/null || cat ../out $ $prof --config profiling.output=blackbox --config extensions.blackbox= st $ grep CallCount .hg/blackbox.log > /dev/null || cat .hg/blackbox.log $ $prof --config profiling.format=text st 2>../out $ grep CallCount ../out > /dev/null || cat ../out $ echo "[profiling]" >> $HGRCPATH $ echo "format=kcachegrind" >> $HGRCPATH $ $prof st 2>../out $ grep 'events: Ticks' ../out > /dev/null || cat ../out $ $prof --config profiling.output=../out st $ grep 'events: Ticks' ../out > /dev/null || cat ../out #endif #if lsprof serve Profiling of HTTP requests works $ $prof --config profiling.format=text --config profiling.output=../profile.log serve -d -p $HGPORT --pid-file ../hg.pid -A ../access.log $ cat ../hg.pid >> $DAEMON_PIDS $ hg -q clone -U http://localhost:$HGPORT ../clone A single profile is logged because file logging doesn't append $ grep CallCount ../profile.log | wc -l \s*1 (re) #endif Install an extension that can sleep and guarantee a profiler has time to run $ cat >> sleepext.py << EOF > import time > from mercurial import registrar, commands > cmdtable = {} > command = registrar.command(cmdtable) > @command(b'sleep', [], 'hg sleep') > def sleep(ui, *args, **kwargs): > time.sleep(0.1) > EOF $ cat >> $HGRCPATH << EOF > [extensions] > sleep = `pwd`/sleepext.py > EOF statistical profiler works $ hg --profile sleep 2>../out $ cat ../out | statprofran Various statprof formatters work $ hg --profile --config profiling.statformat=byline sleep 2>../out $ head -n 1 ../out % cumulative self $ cat ../out | statprofran $ hg --profile --config profiling.statformat=bymethod sleep 2>../out $ head -n 1 ../out % cumulative self $ cat ../out | statprofran $ hg --profile --config profiling.statformat=hotpath sleep 2>../out $ cat ../out | statprofran $ hg --profile --config profiling.statformat=json sleep 2>../out $ cat ../out \[\[-?\d+.* (re) statprof can be used as a standalone module $ $PYTHON -m mercurial.statprof hotpath must specify --file to load [1] $ cd .. #if no-chg profiler extension could be loaded before other extensions $ cat > fooprof.py < from __future__ import absolute_import > import contextlib > @contextlib.contextmanager > def profile(ui, fp): > print('fooprof: start profile') > yield > print('fooprof: end profile') > def extsetup(ui): > ui.write('fooprof: loaded\n') > EOF $ cat > otherextension.py < from __future__ import absolute_import > def extsetup(ui): > ui.write('otherextension: loaded\n') > EOF $ hg init b $ cd b $ cat >> .hg/hgrc < [extensions] > other = $TESTTMP/otherextension.py > fooprof = $TESTTMP/fooprof.py > EOF $ hg root otherextension: loaded fooprof: loaded $TESTTMP/b $ HGPROF=fooprof hg root --profile fooprof: loaded fooprof: start profile otherextension: loaded $TESTTMP/b fooprof: end profile $ HGPROF=other hg root --profile 2>&1 | head -n 2 otherextension: loaded unrecognized profiler 'other' - ignored $ HGPROF=unknown hg root --profile 2>&1 | head -n 1 unrecognized profiler 'unknown' - ignored $ cd .. #endif mercurial-4.5.3/tests/test-casefolding.t0000644015407300116100000001122613261161234020161 0ustar augieeng00000000000000#require icasefs $ hg debugfs | grep 'case-sensitive:' case-sensitive: no test file addition with bad case $ hg init repo1 $ cd repo1 $ echo a > a $ hg add A $ hg st A a $ hg ci -m adda $ hg manifest a $ cd .. test case collision on rename (issue750) $ hg init repo2 $ cd repo2 $ echo a > a $ hg --debug ci -Am adda adding a committing files: a committing manifest committing changelog updating the branch cache committed changeset 0:07f4944404050f47db2e5c5071e0e84e7a27bba9 Case-changing renames should work: $ hg mv a A $ hg mv A a $ hg st addremove after case-changing rename has no effect (issue4590) $ hg mv a A $ hg addremove recording removal of a as rename to A (100% similar) $ hg revert --all forgetting A undeleting a test changing case of path components $ mkdir D $ echo b > D/b $ hg ci -Am addb D/b $ hg mv D/b d/b D/b: not overwriting - file already committed (hg rename --force to replace the file by recording a rename) $ hg mv D/b d/c $ hg st A D/c R D/b $ mv D temp $ mv temp d $ hg st A D/c R D/b $ hg revert -aq $ rm d/c $ echo c > D/c $ hg add D/c $ hg st A D/c $ hg ci -m addc D/c $ hg mv d/b d/e $ hg st A D/e R D/b $ hg revert -aq $ rm d/e $ hg mv d/b D/B $ hg st A D/B R D/b $ cd .. test case collision between revisions (issue912) $ hg init repo3 $ cd repo3 $ echo a > a $ hg ci -Am adda adding a $ hg rm a $ hg ci -Am removea $ echo A > A on linux hfs keeps the old case stored, force it $ mv a aa $ mv aa A $ hg ci -Am addA adding A used to fail under case insensitive fs $ hg up -C 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg up -C 1 files updated, 0 files merged, 1 files removed, 0 files unresolved no clobbering of untracked files with wrong casing $ hg up -r null 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo gold > a $ hg up A: untracked file differs abort: untracked files in working directory differ from files in requested revision [255] $ cat a gold $ rm a test that normal file in different case on target context is not unlinked by largefiles extension. $ cat >> .hg/hgrc < [extensions] > largefiles= > EOF $ hg update -q -C 1 $ hg status -A $ echo 'A as largefiles' > A $ hg add --large A $ hg commit -m '#3' created new head $ hg manifest -r 3 .hglf/A $ hg manifest -r 0 a $ hg update -q -C 0 $ hg status -A C a $ hg update -q -C 3 $ hg update -q 0 $ hg up -C -r 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg mv A a $ hg diff -g > rename.diff $ hg ci -m 'A -> a' $ hg up -q '.^' $ hg import rename.diff -m "import rename A -> a" applying rename.diff $ hg st ? rename.diff $ hg files a $ find * | sort a rename.diff $ rm rename.diff $ cd .. issue 3342: file in nested directory causes unexpected abort $ hg init issue3342 $ cd issue3342 $ mkdir -p a/B/c/D $ echo e > a/B/c/D/e $ hg add a/B/c/D/e $ hg ci -m 'add e' issue 4481: revert across case only renames $ hg mv a/B/c/D/e a/B/c/d/E $ hg ci -m "uppercase E" $ echo 'foo' > a/B/c/D/E $ hg ci -m 'e content change' $ hg revert --all -r 0 removing a/B/c/D/E adding a/B/c/D/e $ find * | sort a a/B a/B/c a/B/c/D a/B/c/D/e a/B/c/D/e.orig $ cd .. issue 3340: mq does not handle case changes correctly in addition to reported case, 'hg qrefresh' is also tested against case changes. $ echo "[extensions]" >> $HGRCPATH $ echo "mq=" >> $HGRCPATH $ hg init issue3340 $ cd issue3340 $ echo a > mIxEdCaSe $ hg add mIxEdCaSe $ hg commit -m '#0' $ hg rename mIxEdCaSe tmp $ hg rename tmp MiXeDcAsE $ hg status -A A MiXeDcAsE mIxEdCaSe R mIxEdCaSe $ hg qnew changecase $ hg status -A C MiXeDcAsE $ hg qpop -a popping changecase patch queue now empty $ hg qnew refresh-casechange $ hg status -A C mIxEdCaSe $ hg rename mIxEdCaSe tmp $ hg rename tmp MiXeDcAsE $ hg status -A A MiXeDcAsE mIxEdCaSe R mIxEdCaSe $ hg qrefresh $ hg status -A C MiXeDcAsE $ hg qpop -a popping refresh-casechange patch queue now empty $ hg qnew refresh-pattern $ hg status $ echo A > A $ hg add adding A $ hg qrefresh a # issue 3271, qrefresh with file handled case wrong $ hg status # empty status means the qrefresh worked #if osx We assume anyone running the tests on a case-insensitive volume on OS X will be using HFS+. If that's not true, this test will fail. $ rm A >>> open(u'a\u200c'.encode('utf-8'), 'w').write('unicode is fun') $ hg status M A #endif $ cd .. mercurial-4.5.3/tests/test-rebase-dest.t0000644015407300116100000002257213261161234020107 0ustar augieeng00000000000000Require a destination $ cat >> $HGRCPATH < [extensions] > rebase = > [commands] > rebase.requiredest = True > EOF $ hg init repo $ cd repo $ echo a >> a $ hg commit -qAm aa $ echo b >> b $ hg commit -qAm bb $ hg up ".^" 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo c >> c $ hg commit -qAm cc $ hg rebase abort: you must specify a destination (use: hg rebase -d REV) [255] $ hg rebase -d 1 rebasing 2:5db65b93a12b "cc" (tip) saved backup bundle to $TESTTMP/repo/.hg/strip-backup/5db65b93a12b-4fb789ec-rebase.hg $ hg rebase -d 0 -r . -q $ HGPLAIN=1 hg rebase rebasing 2:889b0bc6a730 "cc" (tip) saved backup bundle to $TESTTMP/repo/.hg/strip-backup/889b0bc6a730-41ec4f81-rebase.hg $ hg rebase -d 0 -r . -q $ hg --config commands.rebase.requiredest=False rebase rebasing 2:279de9495438 "cc" (tip) saved backup bundle to $TESTTMP/repo/.hg/strip-backup/279de9495438-ab0a5128-rebase.hg Requiring dest should not break continue or other rebase options $ hg up 1 -q $ echo d >> c $ hg commit -qAm dc $ hg log -G -T '{rev} {desc}' @ 3 dc | | o 2 cc |/ o 1 bb | o 0 aa $ hg rebase -d 2 rebasing 3:0537f6b50def "dc" (tip) merging c warning: conflicts while merging c! (edit, then use 'hg resolve --mark') unresolved conflicts (see hg resolve, then hg rebase --continue) [1] $ echo d > c $ hg resolve --mark --all (no more unresolved files) continue: hg rebase --continue $ hg rebase --continue rebasing 3:0537f6b50def "dc" (tip) saved backup bundle to $TESTTMP/repo/.hg/strip-backup/0537f6b50def-be4c7386-rebase.hg $ cd .. Check rebase.requiredest interaction with pull --rebase $ hg clone repo clone updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd repo $ echo e > e $ hg commit -qAm ee $ cd .. $ cd clone $ echo f > f $ hg commit -qAm ff $ hg pull --rebase abort: rebase destination required by configuration (use hg pull followed by hg rebase -d DEST) [255] Setup rebase with multiple destinations $ cd $TESTTMP $ cat >> $TESTTMP/maprevset.py < from __future__ import absolute_import > from mercurial import registrar, revset, revsetlang, smartset > revsetpredicate = registrar.revsetpredicate() > cache = {} > @revsetpredicate('map') > def map(repo, subset, x): > """(set, mapping)""" > setarg, maparg = revsetlang.getargs(x, 2, 2, '') > rset = revset.getset(repo, smartset.fullreposet(repo), setarg) > mapstr = revsetlang.getstring(maparg, '') > map = dict(a.split(':') for a in mapstr.split(',')) > rev = rset.first() > desc = repo[rev].description() > newdesc = map.get(desc) > if newdesc == 'null': > revs = [-1] > else: > query = revsetlang.formatspec('desc(%s)', newdesc) > revs = repo.revs(query) > return smartset.baseset(revs) > EOF $ cat >> $HGRCPATH < [ui] > allowemptycommit=1 > [extensions] > drawdag=$TESTDIR/drawdag.py > [phases] > publish=False > [alias] > tglog = log -G --template "{rev}: {node|short} {desc} {instabilities}" -r 'sort(all(), topo)' > [extensions] > maprevset=$TESTTMP/maprevset.py > [experimental] > evolution=true > EOF $ rebasewithdag() { > N=`$PYTHON -c "print($N+1)"` > hg init repo$N && cd repo$N > hg debugdrawdag > hg rebase "$@" > _rebasetmp > r=$? > grep -v 'saved backup bundle' _rebasetmp > [ $r -eq 0 ] && rm -f .hg/localtags && hg tglog > cd .. > return $r > } Destination resolves to an empty set: $ rebasewithdag -s B -d 'SRC - SRC' <<'EOS' > C > | > B > | > A > EOS nothing to rebase - empty destination [1] Multiple destinations and --collapse are not compatible: $ rebasewithdag -s C+E -d 'SRC^^' --collapse <<'EOS' > C F > | | > B E > | | > A D > EOS abort: --collapse does not work with multiple destinations [255] Multiple destinations cannot be used with --base: $ rebasewithdag -b B+E -d 'SRC^^' --collapse <<'EOS' > B E > | | > A D > EOS abort: unknown revision 'SRC'! [255] Rebase to null should work: $ rebasewithdag -r A+C+D -d 'null' <<'EOS' > C D > | | > A B > EOS already rebased 0:426bada5c675 "A" (A) already rebased 2:dc0947a82db8 "C" (C) rebasing 3:004dc1679908 "D" (D tip) o 4: d8d8601abd5e D o 2: dc0947a82db8 C | | o 1: fc2b737bb2e5 B | o 0: 426bada5c675 A Destination resolves to multiple changesets: $ rebasewithdag -s B -d 'ALLSRC+SRC' <<'EOS' > C > | > B > | > Z > EOS abort: rebase destination for f0a671a46792 is not unique [255] Destination is an ancestor of source: $ rebasewithdag -s B -d 'SRC' <<'EOS' > C > | > B > | > Z > EOS abort: source and destination form a cycle [255] Switch roots: $ rebasewithdag -s 'all() - roots(all())' -d 'roots(all()) - ::SRC' <<'EOS' > C F > | | > B E > | | > A D > EOS rebasing 2:112478962961 "B" (B) rebasing 4:26805aba1e60 "C" (C) rebasing 3:cd488e83d208 "E" (E) rebasing 5:0069ba24938a "F" (F tip) o 9: d150ff263fc8 F | o 8: 66f30a1a2eab E | | o 7: 93db94ffae0e C | | | o 6: d0071c3b0c88 B | | | o 1: 058c1e1fb10a D | o 0: 426bada5c675 A Different destinations for merge changesets with a same root: $ rebasewithdag -s B -d '((parents(SRC)-B-A)::) - (::ALLSRC)' <<'EOS' > C G > |\| > | F > | > B E > |\| > A D > EOS rebasing 3:a4256619d830 "B" (B) rebasing 6:8e139e245220 "C" (C tip) o 8: 51e2ce92e06a C |\ | o 7: 2ed0c8546285 B | |\ o | | 5: 8fdb2c1feb20 G | | | | | o 4: cd488e83d208 E | | | o | | 2: a6661b868de9 F / / | o 1: 058c1e1fb10a D | o 0: 426bada5c675 A Move to a previous parent: $ rebasewithdag -s E+F+G -d 'SRC^^' <<'EOS' > H > | > D G > |/ > C F > |/ > B E # E will be ignored, since E^^ is empty > |/ > A > EOS rebasing 4:33441538d4aa "F" (F) rebasing 6:cf43ad9da869 "G" (G) rebasing 7:eef94f3b5f03 "H" (H tip) o 10: b3d84c6666cf H | | o 5: f585351a92f8 D |/ o 3: 26805aba1e60 C | | o 9: f7c28a1a15e2 G |/ o 1: 112478962961 B | | o 8: 02aa697facf7 F |/ | o 2: 7fb047a69f22 E |/ o 0: 426bada5c675 A Source overlaps with destination: $ rebasewithdag -s 'B+C+D' -d 'map(SRC, "B:C,C:D")' <<'EOS' > B C D > \|/ > A > EOS rebasing 2:dc0947a82db8 "C" (C) rebasing 1:112478962961 "B" (B) o 5: 5fe9935d5222 B | o 4: 12d20731b9e0 C | o 3: b18e25de2cf5 D | o 0: 426bada5c675 A Detect cycles early: $ rebasewithdag -r 'all()-Z' -d 'map(SRC, "A:B,B:C,C:D,D:B")' <<'EOS' > A B C > \|/ > | D > |/ > Z > EOS abort: source and destination form a cycle [255] Detect source is ancestor of dest in runtime: $ rebasewithdag -r 'C+B' -d 'map(SRC, "C:B,B:D")' -q <<'EOS' > D > | > B C > \| > A > EOS abort: source is ancestor of destination [255] "Already rebased" fast path still works: $ rebasewithdag -r 'all()' -d 'SRC^' <<'EOS' > E F > /| | > B C D > \|/ > A > EOS already rebased 1:112478962961 "B" (B) already rebased 2:dc0947a82db8 "C" (C) already rebased 3:b18e25de2cf5 "D" (D) already rebased 4:312782b8f06e "E" (E) already rebased 5:ad6717a6a58e "F" (F tip) o 5: ad6717a6a58e F | o 3: b18e25de2cf5 D | | o 4: 312782b8f06e E | |\ +---o 2: dc0947a82db8 C | | | o 1: 112478962961 B |/ o 0: 426bada5c675 A Massively rewrite the DAG: $ rebasewithdag -r 'all()' -d 'map(SRC, "A:I,I:null,H:A,B:J,J:C,C:H,D:E,F:G,G:K,K:D,E:B")' <<'EOS' > D G K > | | | > C F J > | | | > B E I > \| | > A H > EOS rebasing 4:701514e1408d "I" (I) rebasing 0:426bada5c675 "A" (A) rebasing 1:e7050b6e5048 "H" (H) rebasing 5:26805aba1e60 "C" (C) rebasing 7:cf89f86b485b "J" (J) rebasing 2:112478962961 "B" (B) rebasing 3:7fb047a69f22 "E" (E) rebasing 8:f585351a92f8 "D" (D) rebasing 10:ae41898d7875 "K" (K tip) rebasing 9:711f53bbef0b "G" (G) rebasing 6:64a8289d2492 "F" (F) o 21: 3735afb3713a F | o 20: 07698142d7a7 G | o 19: 33aba52e7e72 K | o 18: 9fdae89dc5a1 D | o 17: 277dda9a65ee E | o 16: 9c74fd8657ad B | o 15: 6527eb0688bb J | o 14: e94d655b928d C | o 13: 620d6d349459 H | o 12: a569a116758f A | o 11: 2bf1302f5c18 I Resolve instability: $ rebasewithdag <<'EOF' -r 'orphan()-obsolete()' -d 'max((successors(max(roots(ALLSRC) & ::SRC)^)-obsolete())::)' > F2 > | > J E E2 > | |/ > I2 I | E3 > \| |/ > H | G > | | | > B2 D F > | |/ # rebase: B -> B2 > N C # amend: E -> E2 > | | # amend: E2 -> E3 > M B # rebase: F -> F2 > \| # amend: I -> I2 > A > EOF 6 new orphan changesets rebasing 16:5c432343bf59 "J" (J tip) rebasing 3:26805aba1e60 "C" (C) rebasing 6:f585351a92f8 "D" (D) rebasing 10:ffebc37c5d0b "E3" (E3) rebasing 13:fb184bcfeee8 "F2" (F2) rebasing 11:dc838ab4c0da "G" (G) o 22: 174f63d574a8 G | o 21: c9d9fbe76705 F2 | o 20: 0a03c2ede755 E3 | o 19: 228d9d2541b1 D | o 18: cd856b400c95 C | o 17: 9148200c858c J | o 15: eb74780f5094 I2 | o 12: 78309edd643f H | o 5: 4b4531bd8e1d B2 | o 4: 337c285c272b N | o 2: 699bc4b6fa22 M | o 0: 426bada5c675 A mercurial-4.5.3/tests/test-merge-revert.t0000644015407300116100000000251013261161234020303 0ustar augieeng00000000000000 $ hg init $ echo "added file1" > file1 $ echo "added file2" > file2 $ hg add file1 file2 $ hg commit -m "added file1 and file2" $ echo "changed file1" >> file1 $ hg commit -m "changed file1" $ hg -q log 1:08a16e8e4408 0:d29c767a4b52 $ hg id 08a16e8e4408 tip $ hg update -C 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id d29c767a4b52 $ echo "changed file1" >> file1 $ hg id d29c767a4b52+ $ hg revert --all reverting file1 $ hg diff $ hg status ? file1.orig $ hg id d29c767a4b52 $ hg update 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg diff $ hg status ? file1.orig $ hg id 08a16e8e4408 tip $ hg update -C 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo "changed file1" >> file1 $ hg update 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg diff $ hg status ? file1.orig $ hg id 08a16e8e4408 tip $ hg revert --all $ hg diff $ hg status ? file1.orig $ hg id 08a16e8e4408 tip $ hg revert -r tip --all $ hg diff $ hg status ? file1.orig $ hg id 08a16e8e4408 tip $ hg update -C 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg diff $ hg status ? file1.orig $ hg id 08a16e8e4408 tip mercurial-4.5.3/tests/drawdag.py0000644015407300116100000003151213261161234016524 0ustar augieeng00000000000000# drawdag.py - convert ASCII revision DAG to actual changesets # # Copyright 2016 Facebook, Inc. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. """ create changesets from an ASCII graph for testing purpose. For example, given the following input:: c d |/ b | a 4 changesets and 4 local tags will be created. `hg log -G -T "{rev} {desc} (tag: {tags})"` will output:: o 3 d (tag: d tip) | | o 2 c (tag: c) |/ o 1 b (tag: b) | o 0 a (tag: a) For root nodes (nodes without parents) in the graph, they can be revsets pointing to existing nodes. The ASCII graph could also have disconnected components with same names referring to the same changeset. Therefore, given the repo having the 4 changesets (and tags) above, with the following ASCII graph as input:: foo bar bar foo | / | | ancestor(c,d) a baz The result (`hg log -G -T "{desc}"`) will look like:: o foo |\ +---o bar | | | | o | baz | / +---o d | | +---o c | | o | b |/ o a Note that if you take the above `hg log` output directly as input. It will work as expected - the result would be an isomorphic graph:: o foo |\ | | o d | |/ | | o c | |/ | | o bar | |/| | o | b | |/ o / baz / o a This is because 'o' is specially handled in the input: instead of using 'o' as the node name, the word to the right will be used. Some special comments could have side effects: - Create obsmarkers # replace: A -> B -> C -> D # chained 1 to 1 replacements # split: A -> B, C # 1 to many # prune: A, B, C # many to nothing """ from __future__ import absolute_import, print_function import collections import itertools import re from mercurial.i18n import _ from mercurial import ( context, error, node, obsolete, pycompat, registrar, scmutil, tags as tagsmod, ) cmdtable = {} command = registrar.command(cmdtable) _pipechars = b'\\/+-|' _nonpipechars = b''.join(pycompat.bytechr(i) for i in range(33, 127) if pycompat.bytechr(i) not in _pipechars) def _isname(ch): """char -> bool. return True if ch looks like part of a name, False otherwise""" return ch in _nonpipechars def _parseasciigraph(text): r"""str -> {str : [str]}. convert the ASCII graph to edges >>> import pprint >>> pprint.pprint({pycompat.sysstr(k): [pycompat.sysstr(vv) for vv in v] ... for k, v in _parseasciigraph(br''' ... G ... | ... I D C F # split: B -> E, F, G ... \ \| | # replace: C -> D -> H ... H B E # prune: F, I ... \|/ ... A ... ''').items()}) {'A': [], 'B': ['A'], 'C': ['B'], 'D': ['B'], 'E': ['A'], 'F': ['E'], 'G': ['F'], 'H': ['A'], 'I': ['H']} >>> pprint.pprint({pycompat.sysstr(k): [pycompat.sysstr(vv) for vv in v] ... for k, v in _parseasciigraph(br''' ... o foo ... |\ ... +---o bar ... | | | ... | o | baz ... | / ... +---o d ... | | ... +---o c ... | | ... o | b ... |/ ... o a ... ''').items()}) {'a': [], 'b': ['a'], 'bar': ['b', 'a'], 'baz': [], 'c': ['b'], 'd': ['b'], 'foo': ['baz', 'b']} """ lines = text.splitlines() edges = collections.defaultdict(list) # {node: []} def get(y, x): """(int, int) -> char. give a coordinate, return the char. return a space for anything out of range""" if x < 0 or y < 0: return b' ' try: return lines[y][x:x + 1] or b' ' except IndexError: return b' ' def getname(y, x): """(int, int) -> str. like get(y, x) but concatenate left and right parts. if name is an 'o', try to replace it to the right""" result = b'' for i in itertools.count(0): ch = get(y, x - i) if not _isname(ch): break result = ch + result for i in itertools.count(1): ch = get(y, x + i) if not _isname(ch): break result += ch if result == b'o': # special handling, find the name to the right result = b'' for i in itertools.count(2): ch = get(y, x + i) if ch == b' ' or ch in _pipechars: if result or x + i >= len(lines[y]): break else: result += ch return result or b'o' return result def parents(y, x): """(int, int) -> [str]. follow the ASCII edges at given position, return a list of parents""" visited = {(y, x)} visit = [] result = [] def follow(y, x, expected): """conditionally append (y, x) to visit array, if it's a char in excepted. 'o' in expected means an '_isname' test. if '-' (or '+') is not in excepted, and get(y, x) is '-' (or '+'), the next line (y + 1, x) will be checked instead.""" ch = get(y, x) if any(ch == c and c not in expected for c in (b'-', b'+')): y += 1 return follow(y + 1, x, expected) if ch in expected or (b'o' in expected and _isname(ch)): visit.append((y, x)) # -o- # starting point: # /|\ # follow '-' (horizontally), and '/|\' (to the bottom) follow(y + 1, x, b'|') follow(y + 1, x - 1, b'/') follow(y + 1, x + 1, b'\\') follow(y, x - 1, b'-') follow(y, x + 1, b'-') while visit: y, x = visit.pop() if (y, x) in visited: continue visited.add((y, x)) ch = get(y, x) if _isname(ch): result.append(getname(y, x)) continue elif ch == b'|': follow(y + 1, x, b'/|o') follow(y + 1, x - 1, b'/') follow(y + 1, x + 1, b'\\') elif ch == b'+': follow(y, x - 1, b'-') follow(y, x + 1, b'-') follow(y + 1, x - 1, b'/') follow(y + 1, x + 1, b'\\') follow(y + 1, x, b'|') elif ch == b'\\': follow(y + 1, x + 1, b'\\|o') elif ch == b'/': follow(y + 1, x - 1, b'/|o') elif ch == b'-': follow(y, x - 1, b'-+o') follow(y, x + 1, b'-+o') return result for y, line in enumerate(lines): for x, ch in enumerate(pycompat.bytestr(line)): if ch == b'#': # comment break if _isname(ch): edges[getname(y, x)] += parents(y, x) return dict(edges) class simplefilectx(object): def __init__(self, path, data): self._data = data self._path = path def data(self): return self._data def filenode(self): return None def path(self): return self._path def renamed(self): return None def flags(self): return b'' class simplecommitctx(context.committablectx): def __init__(self, repo, name, parentctxs, added): opts = { 'changes': scmutil.status([], list(added), [], [], [], [], []), 'date': b'0 0', 'extra': {b'branch': b'default'}, } super(simplecommitctx, self).__init__(self, name, **opts) self._repo = repo self._added = added self._parents = parentctxs while len(self._parents) < 2: self._parents.append(repo[node.nullid]) def filectx(self, key): return simplefilectx(key, self._added[key]) def commit(self): return self._repo.commitctx(self) def _walkgraph(edges): """yield node, parents in topologically order""" visible = set(edges.keys()) remaining = {} # {str: [str]} for k, vs in edges.items(): for v in vs: if v not in remaining: remaining[v] = [] remaining[k] = vs[:] while remaining: leafs = [k for k, v in remaining.items() if not v] if not leafs: raise error.Abort(_('the graph has cycles')) for leaf in sorted(leafs): if leaf in visible: yield leaf, edges[leaf] del remaining[leaf] for k, v in remaining.items(): if leaf in v: v.remove(leaf) def _getcomments(text): """ >>> [pycompat.sysstr(s) for s in _getcomments(br''' ... G ... | ... I D C F # split: B -> E, F, G ... \ \| | # replace: C -> D -> H ... H B E # prune: F, I ... \|/ ... A ... ''')] ['split: B -> E, F, G', 'replace: C -> D -> H', 'prune: F, I'] """ for line in text.splitlines(): if b' # ' not in line: continue yield line.split(b' # ', 1)[1].split(b' # ')[0].strip() @command(b'debugdrawdag', []) def debugdrawdag(ui, repo, **opts): """read an ASCII graph from stdin and create changesets The ASCII graph is like what :hg:`log -G` outputs, with each `o` replaced to the name of the node. The command will create dummy changesets and local tags with those names to make the dummy changesets easier to be referred to. If the name of a node is a single character 'o', It will be replaced by the word to the right. This makes it easier to reuse :hg:`log -G -T '{desc}'` outputs. For root (no parents) nodes, revset can be used to query existing repo. Note that the revset cannot have confusing characters which can be seen as the part of the graph edges, like `|/+-\`. """ text = ui.fin.read() # parse the graph and make sure len(parents) <= 2 for each node edges = _parseasciigraph(text) for k, v in edges.items(): if len(v) > 2: raise error.Abort(_('%s: too many parents: %s') % (k, b' '.join(v))) # parse comments to get extra file content instructions files = collections.defaultdict(dict) # {(name, path): content} comments = list(_getcomments(text)) filere = re.compile(br'^(\w+)/([\w/]+)\s*=\s*(.*)$', re.M) for name, path, content in filere.findall(b'\n'.join(comments)): content = content.replace(br'\n', b'\n').replace(br'\1', b'\1') files[name][path] = content committed = {None: node.nullid} # {name: node} # for leaf nodes, try to find existing nodes in repo for name, parents in edges.items(): if len(parents) == 0: try: committed[name] = scmutil.revsingle(repo, name) except error.RepoLookupError: pass # commit in topological order for name, parents in _walkgraph(edges): if name in committed: continue pctxs = [repo[committed[n]] for n in parents] pctxs.sort(key=lambda c: c.node()) added = {} if len(parents) > 1: # If it's a merge, take the files and contents from the parents for f in pctxs[1].manifest(): if f not in pctxs[0].manifest(): added[f] = pctxs[1][f].data() else: # If it's not a merge, add a single file added[name] = name # add extra file contents in comments for path, content in files.get(name, {}).items(): added[path] = content ctx = simplecommitctx(repo, name, pctxs, added) n = ctx.commit() committed[name] = n tagsmod.tag(repo, [name], n, message=None, user=None, date=None, local=True) # handle special comments with repo.wlock(), repo.lock(), repo.transaction(b'drawdag'): getctx = lambda x: repo.unfiltered()[committed[x.strip()]] for comment in comments: rels = [] # obsolete relationships args = comment.split(b':', 1) if len(args) <= 1: continue cmd = args[0].strip() arg = args[1].strip() if cmd in (b'replace', b'rebase', b'amend'): nodes = [getctx(m) for m in arg.split(b'->')] for i in range(len(nodes) - 1): rels.append((nodes[i], (nodes[i + 1],))) elif cmd in (b'split',): pre, succs = arg.split(b'->') succs = succs.split(b',') rels.append((getctx(pre), (getctx(s) for s in succs))) elif cmd in (b'prune',): for n in arg.split(b','): rels.append((getctx(n), ())) if rels: obsolete.createmarkers(repo, rels, date=(0, 0), operation=cmd) mercurial-4.5.3/tests/test-logexchange.t0000644015407300116100000000552713261161234020176 0ustar augieeng00000000000000Testing the functionality to pull remotenames ============================================= $ cat >> $HGRCPATH << EOF > [alias] > glog = log -G -T '{rev}:{node|short} {desc}' > [experimental] > remotenames = True > EOF Making a server repo -------------------- $ hg init server $ cd server $ for ch in a b c d e f g h; do > echo "foo" >> $ch > hg ci -Aqm "Added "$ch > done $ hg glog @ 7:ec2426147f0e Added h | o 6:87d6d6676308 Added g | o 5:825660c69f0c Added f | o 4:aa98ab95a928 Added e | o 3:62615734edd5 Added d | o 2:28ad74487de9 Added c | o 1:29becc82797a Added b | o 0:18d04c59bb5d Added a $ hg bookmark -r 3 foo $ hg bookmark -r 6 bar $ hg up 4 0 files updated, 0 files merged, 3 files removed, 0 files unresolved $ hg branch wat marked working directory as branch wat (branches are permanent and global, did you want a bookmark?) $ echo foo >> bar $ hg ci -Aqm "added bar" Making a client repo -------------------- $ cd .. $ hg clone server client updating to branch default 8 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd client $ cat .hg/logexchange/bookmarks 0 87d6d66763085b629e6d7ed56778c79827273022\x00file:$TESTTMP/server\x00bar (esc) 62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00file:$TESTTMP/server\x00foo (esc) $ cat .hg/logexchange/branches 0 ec2426147f0e39dbc9cef599b066be6035ce691d\x00file:$TESTTMP/server\x00default (esc) 3e1487808078543b0af6d10dadf5d46943578db0\x00file:$TESTTMP/server\x00wat (esc) Making a new server ------------------- $ cd .. $ hg init server2 $ cd server2 $ hg pull ../server/ pulling from ../server/ requesting all changes adding changesets adding manifests adding file changes added 9 changesets with 9 changes to 9 files (+1 heads) adding remote bookmark bar adding remote bookmark foo new changesets 18d04c59bb5d:3e1487808078 (run 'hg heads' to see heads) Pulling form the new server --------------------------- $ cd ../client/ $ hg pull ../server2/ pulling from ../server2/ searching for changes no changes found $ cat .hg/logexchange/bookmarks 0 62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00file:$TESTTMP/server\x00foo (esc) 87d6d66763085b629e6d7ed56778c79827273022\x00file:$TESTTMP/server\x00bar (esc) 87d6d66763085b629e6d7ed56778c79827273022\x00file:$TESTTMP/server2\x00bar (esc) 62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00file:$TESTTMP/server2\x00foo (esc) $ cat .hg/logexchange/branches 0 3e1487808078543b0af6d10dadf5d46943578db0\x00file:$TESTTMP/server\x00wat (esc) ec2426147f0e39dbc9cef599b066be6035ce691d\x00file:$TESTTMP/server\x00default (esc) ec2426147f0e39dbc9cef599b066be6035ce691d\x00file:$TESTTMP/server2\x00default (esc) 3e1487808078543b0af6d10dadf5d46943578db0\x00file:$TESTTMP/server2\x00wat (esc) mercurial-4.5.3/tests/test-bheads.t0000644015407300116100000002012413261161234017126 0ustar augieeng00000000000000 $ heads() > { > hg heads --template '{rev}: {desc|firstline|strip} ({branches})\n' "$@" > } $ hg init a $ cd a $ echo 'root' >root $ hg add root $ hg commit -m "Adding root node" $ heads 0: Adding root node () ------- $ heads . 0: Adding root node () ======= $ echo 'a' >a $ hg add a $ hg branch a marked working directory as branch a (branches are permanent and global, did you want a bookmark?) $ hg commit -m "Adding a branch" $ heads 1: Adding a branch (a) 0: Adding root node () ------- $ heads . 1: Adding a branch (a) ======= $ hg update -C 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo 'b' >b $ hg add b $ hg branch b marked working directory as branch b $ hg commit -m "Adding b branch" $ heads 2: Adding b branch (b) 1: Adding a branch (a) 0: Adding root node () ------- $ heads . 2: Adding b branch (b) ======= $ echo 'bh1' >bh1 $ hg add bh1 $ hg commit -m "Adding b branch head 1" $ heads 3: Adding b branch head 1 (b) 1: Adding a branch (a) 0: Adding root node () ------- $ heads . 3: Adding b branch head 1 (b) ======= $ hg update -C 2 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo 'bh2' >bh2 $ hg add bh2 $ hg commit -m "Adding b branch head 2" created new head $ heads 4: Adding b branch head 2 (b) 3: Adding b branch head 1 (b) 1: Adding a branch (a) 0: Adding root node () $ heads . 4: Adding b branch head 2 (b) 3: Adding b branch head 1 (b) ======= $ hg update -C 2 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo 'bh3' >bh3 $ hg add bh3 $ hg commit -m "Adding b branch head 3" created new head $ heads 5: Adding b branch head 3 (b) 4: Adding b branch head 2 (b) 3: Adding b branch head 1 (b) 1: Adding a branch (a) 0: Adding root node () ------- $ heads . 5: Adding b branch head 3 (b) 4: Adding b branch head 2 (b) 3: Adding b branch head 1 (b) ======= $ hg merge 4 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg commit -m "Merging b branch head 2 and b branch head 3" $ heads 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) 1: Adding a branch (a) 0: Adding root node () ------- $ heads . 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) ======= $ echo 'c' >c $ hg add c $ hg branch c marked working directory as branch c $ hg commit -m "Adding c branch" $ heads 7: Adding c branch (c) 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) 1: Adding a branch (a) 0: Adding root node () ------- $ heads . 7: Adding c branch (c) ======= $ heads -r 3 . no open branch heads found on branches c (started at 3) [1] $ heads -r 2 . 7: Adding c branch (c) ------- $ hg update -C 4 0 files updated, 0 files merged, 2 files removed, 0 files unresolved ------- $ heads -r 3 . 3: Adding b branch head 1 (b) ------- $ heads -r 2 . 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) ------- $ heads -r 7 . no open branch heads found on branches b (started at 7) [1] ======= $ for i in 0 1 2 3 4 5 6 7; do > hg update -C "$i" > heads > echo '-------' > heads . > echo '-------' > done 0 files updated, 0 files merged, 2 files removed, 0 files unresolved 7: Adding c branch (c) 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) 1: Adding a branch (a) 0: Adding root node () ------- 0: Adding root node () ------- 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 7: Adding c branch (c) 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) 1: Adding a branch (a) 0: Adding root node () ------- 1: Adding a branch (a) ------- 1 files updated, 0 files merged, 1 files removed, 0 files unresolved 7: Adding c branch (c) 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) 1: Adding a branch (a) 0: Adding root node () ------- 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) ------- 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 7: Adding c branch (c) 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) 1: Adding a branch (a) 0: Adding root node () ------- 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) ------- 1 files updated, 0 files merged, 1 files removed, 0 files unresolved 7: Adding c branch (c) 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) 1: Adding a branch (a) 0: Adding root node () ------- 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) ------- 1 files updated, 0 files merged, 1 files removed, 0 files unresolved 7: Adding c branch (c) 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) 1: Adding a branch (a) 0: Adding root node () ------- 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) ------- 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 7: Adding c branch (c) 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) 1: Adding a branch (a) 0: Adding root node () ------- 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) ------- 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 7: Adding c branch (c) 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) 1: Adding a branch (a) 0: Adding root node () ------- 7: Adding c branch (c) ------- ======= $ for i in a b c z; do > heads "$i" > echo '-------' > done 1: Adding a branch (a) ------- 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) ------- 7: Adding c branch (c) ------- abort: unknown revision 'z'! ------- ======= $ heads 0 1 2 3 4 5 6 7 7: Adding c branch (c) 6: Merging b branch head 2 and b branch head 3 (b) 3: Adding b branch head 1 (b) 1: Adding a branch (a) 0: Adding root node () Topological heads: $ heads -t 7: Adding c branch (c) 3: Adding b branch head 1 (b) 1: Adding a branch (a) $ cd .. ______________ "created new head" message tests $ hg init newheadmsg $ cd newheadmsg Init: no msg $ echo 1 > a $ hg ci -Am "a0: Initial root" adding a $ echo 2 >> a $ hg ci -m "a1 (HN)" $ hg branch b marked working directory as branch b (branches are permanent and global, did you want a bookmark?) $ echo 1 > b $ hg ci -Am "b2: Initial root for branch b" adding b $ echo 2 >> b $ hg ci -m "b3 (HN)" Case NN: msg $ hg up -q null $ hg branch -f b marked working directory as branch b $ echo 1 > bb $ hg ci -Am "b4 (NN): new topo root for branch b" adding bb created new head Case HN: no msg $ echo 2 >> bb $ hg ci -m "b5 (HN)" Case BN: msg $ hg branch -f default marked working directory as branch default $ echo 1 > aa $ hg ci -Am "a6 (BN): new branch root" adding aa created new head Case CN: msg $ hg up -q 4 $ echo 3 >> bbb $ hg ci -Am "b7 (CN): regular new head" adding bbb created new head Case BB: msg $ hg up -q 4 $ hg merge -q 3 $ hg branch -f default marked working directory as branch default $ hg ci -m "a8 (BB): weird new branch root" created new head Case CB: msg $ hg up -q 4 $ hg merge -q 1 $ hg ci -m "b9 (CB): new head from branch merge" created new head Case HB: no msg $ hg up -q 7 $ hg merge -q 6 $ hg ci -m "b10 (HB): continuing head from branch merge" Case CC: msg $ hg up -q 4 $ hg merge -q 2 $ hg ci -m "b11 (CC): new head from merge" created new head Case CH: no msg $ hg up -q 2 $ hg merge -q 10 $ hg ci -m "b12 (CH): continuing head from merge" Case HH: no msg $ hg merge -q 3 $ hg ci -m "b12 (HH): merging two heads" $ cd .. mercurial-4.5.3/tests/test-histedit-edit.t0000644015407300116100000002752413261161234020453 0ustar augieeng00000000000000 $ . "$TESTDIR/histedit-helpers.sh" $ cat >> $HGRCPATH < [extensions] > histedit= > strip= > EOF $ initrepo () > { > hg init r > cd r > for x in a b c d e f g; do > echo $x > $x > hg add $x > hg ci -m $x > done > } $ initrepo log before edit $ hg log --graph @ changeset: 6:3c6a8ed2ebe8 | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: g | o changeset: 5:652413bf663e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: f | o changeset: 4:e860deea161a | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: e | o changeset: 3:055a42cdd887 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: d | o changeset: 2:177f92b77385 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: c | o changeset: 1:d2ae7f538514 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: b | o changeset: 0:cb9a9f314b8b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a dirty a file $ echo a > g $ hg histedit 177f92b77385 --commands - 2>&1 << EOF > EOF abort: uncommitted changes [255] $ echo g > g edit the history $ hg histedit 177f92b77385 --commands - 2>&1 << EOF| fixbundle > pick 177f92b77385 c > pick 055a42cdd887 d > edit e860deea161a e > pick 652413bf663e f > pick 3c6a8ed2ebe8 g > EOF 0 files updated, 0 files merged, 3 files removed, 0 files unresolved Editing (e860deea161a), you may commit or record as needed now. (hg histedit --continue to resume) try to update and get an error $ hg update tip abort: histedit in progress (use 'hg histedit --continue' or 'hg histedit --abort') [255] edit the plan via the editor $ cat >> $TESTTMP/editplan.sh < cat > \$1 < drop e860deea161a e > drop 652413bf663e f > drop 3c6a8ed2ebe8 g > EOF2 > EOF $ HGEDITOR="sh $TESTTMP/editplan.sh" hg histedit --edit-plan $ cat .hg/histedit-state v1 055a42cdd88768532f9cf79daa407fc8d138de9b 3c6a8ed2ebe862cc949d2caa30775dd6f16fb799 False 3 drop e860deea161a2f77de56603b340ebbb4536308ae drop 652413bf663ef2a641cab26574e46d5f5a64a55a drop 3c6a8ed2ebe862cc949d2caa30775dd6f16fb799 0 strip-backup/177f92b77385-0ebe6a8f-histedit.hg edit the plan via --commands $ hg histedit --edit-plan --commands - 2>&1 << EOF > edit e860deea161a e > pick 652413bf663e f > drop 3c6a8ed2ebe8 g > EOF $ cat .hg/histedit-state v1 055a42cdd88768532f9cf79daa407fc8d138de9b 3c6a8ed2ebe862cc949d2caa30775dd6f16fb799 False 3 edit e860deea161a2f77de56603b340ebbb4536308ae pick 652413bf663ef2a641cab26574e46d5f5a64a55a drop 3c6a8ed2ebe862cc949d2caa30775dd6f16fb799 0 strip-backup/177f92b77385-0ebe6a8f-histedit.hg Go at a random point and try to continue $ hg id -n 3+ $ hg up 0 abort: histedit in progress (use 'hg histedit --continue' or 'hg histedit --abort') [255] Try to delete necessary commit $ hg strip -r 652413b abort: histedit in progress, can't strip 652413bf663e [255] commit, then edit the revision $ hg ci -m 'wat' created new head $ echo a > e qnew should fail while we're in the middle of the edit step $ hg --config extensions.mq= qnew please-fail abort: histedit in progress (use 'hg histedit --continue' or 'hg histedit --abort') [255] $ HGEDITOR='echo foobaz > ' hg histedit --continue 2>&1 | fixbundle $ hg log --graph @ changeset: 6:b5f70786f9b0 | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: f | o changeset: 5:a5e1ba2f7afb | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: foobaz | o changeset: 4:1a60820cd1f6 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: wat | o changeset: 3:055a42cdd887 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: d | o changeset: 2:177f92b77385 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: c | o changeset: 1:d2ae7f538514 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: b | o changeset: 0:cb9a9f314b8b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a $ hg cat e a Stripping necessary commits should not break --abort $ hg histedit 1a60820cd1f6 --commands - 2>&1 << EOF| fixbundle > edit 1a60820cd1f6 wat > pick a5e1ba2f7afb foobaz > pick b5f70786f9b0 g > EOF 0 files updated, 0 files merged, 2 files removed, 0 files unresolved Editing (1a60820cd1f6), you may commit or record as needed now. (hg histedit --continue to resume) $ mv .hg/histedit-state .hg/histedit-state.bak $ hg strip -q -r b5f70786f9b0 $ mv .hg/histedit-state.bak .hg/histedit-state $ hg histedit --abort adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 3 files 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg log -r . changeset: 6:b5f70786f9b0 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: f check histedit_source $ hg log --debug --rev 5 changeset: 5:a5e1ba2f7afb899ef1581cea528fd885d2fca70d phase: draft parent: 4:1a60820cd1f6004a362aa622ebc47d59bc48eb34 parent: -1:0000000000000000000000000000000000000000 manifest: 5:5ad3be8791f39117565557781f5464363b918a45 user: test date: Thu Jan 01 00:00:00 1970 +0000 files: e extra: branch=default extra: histedit_source=e860deea161a2f77de56603b340ebbb4536308ae description: foobaz $ hg histedit tip --commands - 2>&1 < edit b5f70786f9b0 f > EOF 0 files updated, 0 files merged, 1 files removed, 0 files unresolved Editing (b5f70786f9b0), you may commit or record as needed now. (hg histedit --continue to resume) $ hg status A f $ hg summary parent: 5:a5e1ba2f7afb foobaz branch: default commit: 1 added (new branch head) update: 1 new changesets (update) phases: 7 draft hist: 1 remaining (histedit --continue) (test also that editor is invoked if histedit is continued for "edit" action) $ HGEDITOR='cat' hg histedit --continue f HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: test HG: branch 'default' HG: added f saved backup bundle to $TESTTMP/r/.hg/strip-backup/b5f70786f9b0-c28d9c86-histedit.hg $ hg status log after edit $ hg log --limit 1 changeset: 6:a107ee126658 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: f say we'll change the message, but don't. $ cat > ../edit.sh < cat "\$1" | sed s/pick/mess/ > tmp > mv tmp "\$1" > EOF $ HGEDITOR="sh ../edit.sh" hg histedit tip 2>&1 | fixbundle $ hg status $ hg log --limit 1 changeset: 6:1fd3b2fe7754 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: f modify the message check saving last-message.txt, at first $ cat > $TESTTMP/commitfailure.py < from mercurial import error > def reposetup(ui, repo): > class commitfailure(repo.__class__): > def commit(self, *args, **kwargs): > raise error.Abort('emulating unexpected abort') > repo.__class__ = commitfailure > EOF $ cat >> .hg/hgrc < [extensions] > # this failure occurs before editor invocation > commitfailure = $TESTTMP/commitfailure.py > EOF $ cat > $TESTTMP/editor.sh < echo "==== before editing" > cat \$1 > echo "====" > echo "check saving last-message.txt" >> \$1 > EOF (test that editor is not invoked before transaction starting) $ rm -f .hg/last-message.txt $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit tip --commands - 2>&1 << EOF | fixbundle > mess 1fd3b2fe7754 f > EOF abort: emulating unexpected abort $ test -f .hg/last-message.txt [1] $ cat >> .hg/hgrc < [extensions] > commitfailure = ! > EOF $ hg histedit --abort -q (test that editor is invoked and commit message is saved into "last-message.txt") $ cat >> .hg/hgrc < [hooks] > # this failure occurs after editor invocation > pretxncommit.unexpectedabort = false > EOF $ hg status --rev '1fd3b2fe7754^1' --rev 1fd3b2fe7754 A f $ rm -f .hg/last-message.txt $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit tip --commands - 2>&1 << EOF > mess 1fd3b2fe7754 f > EOF ==== before editing f HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: test HG: branch 'default' HG: added f ==== note: commit message saved in .hg/last-message.txt transaction abort! rollback completed abort: pretxncommit.unexpectedabort hook exited with status 1 [255] $ cat .hg/last-message.txt f check saving last-message.txt (test also that editor is invoked if histedit is continued for "message" action) $ HGEDITOR=cat hg histedit --continue f HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: test HG: branch 'default' HG: added f note: commit message saved in .hg/last-message.txt transaction abort! rollback completed abort: pretxncommit.unexpectedabort hook exited with status 1 [255] $ cat >> .hg/hgrc < [hooks] > pretxncommit.unexpectedabort = > EOF $ hg histedit --abort -q then, check "modify the message" itself $ hg histedit tip --commands - 2>&1 << EOF | fixbundle > mess 1fd3b2fe7754 f > EOF $ hg status $ hg log --limit 1 changeset: 6:62feedb1200e tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: f rollback should not work after a histedit $ hg rollback no rollback information available [1] $ cd .. $ hg clone -qr0 r r0 $ cd r0 $ hg phase -fdr0 $ hg histedit --commands - 0 2>&1 << EOF > edit cb9a9f314b8b a > $EDITED > EOF 0 files updated, 0 files merged, 1 files removed, 0 files unresolved adding a Editing (cb9a9f314b8b), you may commit or record as needed now. (hg histedit --continue to resume) [1] $ HGEDITOR=true hg histedit --continue saved backup bundle to $TESTTMP/r0/.hg/strip-backup/cb9a9f314b8b-cc5ccb0b-histedit.hg $ hg log -G @ changeset: 0:0efcea34f18a tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a $ echo foo >> b $ hg addr adding b $ hg ci -m 'add b' $ echo foo >> a $ hg ci -m 'extend a' $ hg phase --public 1 Attempting to fold a change into a public change should not work: $ cat > ../edit.sh < cat "\$1" | sed s/pick/fold/ > tmp > mv tmp "\$1" > EOF $ HGEDITOR="sh ../edit.sh" hg histedit 2 warning: histedit rules saved to: .hg/histedit-last-edit.txt hg: parse error: first changeset cannot use verb "fold" [255] $ cat .hg/histedit-last-edit.txt fold 0012be4a27ea 2 extend a # Edit history between 0012be4a27ea and 0012be4a27ea # # Commits are listed from least to most recent # # You can reorder changesets by reordering the lines # # Commands: # # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, fold = use commit # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date # mercurial-4.5.3/tests/test-simple-update.t0000644015407300116100000000401113261161234020446 0ustar augieeng00000000000000 $ hg init test $ cd test $ echo foo>foo $ hg addremove adding foo $ hg commit -m "1" $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 1 changesets, 1 total revisions $ hg clone . ../branch updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ../branch $ hg co 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo bar>>foo $ hg commit -m "2" $ cd ../test $ hg pull ../branch pulling from ../branch searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 30aff43faee1 (run 'hg update' to get a working copy) $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 2 changesets, 2 total revisions $ hg co 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat foo foo bar $ hg manifest --debug 6f4310b00b9a147241b071a60c28a650827fb03d 644 foo update to rev 0 with a date $ hg upd -d foo 0 abort: you can't specify a revision and a date [255] $ cd .. update with worker processes #if no-windows $ cat < forceworker.py > from mercurial import extensions, worker > def nocost(orig, ui, costperop, nops): > return worker._numworkers(ui) > 1 > def uisetup(ui): > extensions.wrapfunction(worker, 'worthwhile', nocost) > EOF $ hg init worker $ cd worker $ cat <> .hg/hgrc > [extensions] > forceworker = $TESTTMP/forceworker.py > [worker] > numcpus = 4 > EOF $ for i in `$PYTHON $TESTDIR/seq.py 1 100`; do > echo $i > $i > done $ hg ci -qAm 'add 100 files' $ hg update null 0 files updated, 0 files merged, 100 files removed, 0 files unresolved $ hg update -v | grep 100 getting 100 100 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd .. #endif mercurial-4.5.3/tests/test-obsmarker-template.t0000644015407300116100000023616313261161234021512 0ustar augieeng00000000000000This test file test the various templates related to obsmarkers. Global setup ============ $ . $TESTDIR/testlib/obsmarker-common.sh $ cat >> $HGRCPATH < [ui] > interactive = true > [phases] > publish=False > [experimental] > evolution=true > [templates] > obsfatesuccessors = "{if(successors, " as ")}{join(successors, ", ")}" > obsfateverb = "{obsfateverb(successors, markers)}" > obsfateoperations = "{if(obsfateoperations(markers), " using {join(obsfateoperations(markers), ", ")}")}" > obsfateusers = "{if(obsfateusers(markers), " by {join(obsfateusers(markers), ", ")}")}" > obsfatedate = "{if(obsfatedate(markers), "{ifeq(min(obsfatedate(markers)), max(obsfatedate(markers)), " (at {min(obsfatedate(markers))|isodate})", " (between {min(obsfatedate(markers))|isodate} and {max(obsfatedate(markers))|isodate})")}")}" > obsfatetempl = "{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}; " > [alias] > tlog = log -G -T '{node|short}\ > {if(predecessors, "\n Predecessors: {predecessors}")}\ > {if(predecessors, "\n semi-colon: {join(predecessors, "; ")}")}\ > {if(predecessors, "\n json: {predecessors|json}")}\ > {if(predecessors, "\n map: {join(predecessors % "{rev}:{node}", " ")}")}\ > {if(successorssets, "\n Successors: {successorssets}")}\ > {if(successorssets, "\n multi-line: {join(successorssets, "\n multi-line: ")}")}\ > {if(successorssets, "\n json: {successorssets|json}")}\n' > fatelog = log -G -T '{node|short}\n{if(succsandmarkers, " Obsfate: {succsandmarkers % "{obsfatetempl}"} \n" )}' > fatelogjson = log -G -T '{node|short}\n{if(succsandmarkers, " Obsfate: {succsandmarkers|json}\n")}' > fatelogkw = log -G -T '{node|short}\n{if(obsfate, "{obsfate % " Obsfate: {fate}\n"}")}' > EOF Test templates on amended commit ================================ Test setup ---------- $ hg init $TESTTMP/templates-local-amend $ cd $TESTTMP/templates-local-amend $ mkcommit ROOT $ mkcommit A0 $ echo 42 >> A0 $ hg commit --amend -m "A1" --config devel.default-date="1234567890 0" $ hg commit --amend -m "A2" --config devel.default-date="987654321 0" --config devel.user.obsmarker=test2 $ hg log --hidden -G @ changeset: 3:d004c8f274b9 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A2 | | x changeset: 2:a468dc9b3633 |/ parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 3:d004c8f274b9 by test2 | summary: A1 | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 2:a468dc9b3633 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Check templates --------------- $ hg up 'desc(A0)' --hidden updating to a hidden changeset 471f378eab4c (hidden revision '471f378eab4c' was rewritten as: d004c8f274b9) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Predecessors template should show current revision as it is the working copy $ hg tlog o d004c8f274b9 | Predecessors: 1:471f378eab4c | semi-colon: 1:471f378eab4c | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"] | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 | @ 471f378eab4c |/ Successors: 3:d004c8f274b9 | multi-line: 3:d004c8f274b9 | json: [["d004c8f274b9ec480a47a93c10dac5eee63adb78"]] o ea207398892e $ hg fatelog o d004c8f274b9 | | @ 471f378eab4c |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test, test2 (between 2001-04-19 04:25 +0000 and 2009-02-13 23:31 +0000); o ea207398892e $ hg fatelogkw o d004c8f274b9 | | @ 471f378eab4c |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test, test2 o ea207398892e $ hg log -G --config ui.logtemplate= o changeset: 3:d004c8f274b9 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A2 | | @ changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 3:d004c8f274b9 by test, test2 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT $ hg log -G -T "default" o changeset: 3:d004c8f274b9 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A2 | | @ changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 3:d004c8f274b9 by test, test2 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT $ hg up 'desc(A1)' --hidden updating to a hidden changeset a468dc9b3633 (hidden revision 'a468dc9b3633' was rewritten as: d004c8f274b9) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Predecessors template should show current revision as it is the working copy $ hg tlog o d004c8f274b9 | Predecessors: 2:a468dc9b3633 | semi-colon: 2:a468dc9b3633 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"] | map: 2:a468dc9b36338b14fdb7825f55ce3df4e71517ad | @ a468dc9b3633 |/ Successors: 3:d004c8f274b9 | multi-line: 3:d004c8f274b9 | json: [["d004c8f274b9ec480a47a93c10dac5eee63adb78"]] o ea207398892e $ hg fatelog o d004c8f274b9 | | @ a468dc9b3633 |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000); o ea207398892e Predecessors template should show all the predecessors as we force their display with --hidden $ hg tlog --hidden o d004c8f274b9 | Predecessors: 2:a468dc9b3633 | semi-colon: 2:a468dc9b3633 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"] | map: 2:a468dc9b36338b14fdb7825f55ce3df4e71517ad | @ a468dc9b3633 |/ Predecessors: 1:471f378eab4c | semi-colon: 1:471f378eab4c | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"] | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 | Successors: 3:d004c8f274b9 | multi-line: 3:d004c8f274b9 | json: [["d004c8f274b9ec480a47a93c10dac5eee63adb78"]] | x 471f378eab4c |/ Successors: 2:a468dc9b3633 | multi-line: 2:a468dc9b3633 | json: [["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]] o ea207398892e $ hg fatelog --hidden o d004c8f274b9 | | @ a468dc9b3633 |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000); | x 471f378eab4c |/ Obsfate: rewritten using amend as 2:a468dc9b3633 by test (at 2009-02-13 23:31 +0000); o ea207398892e Predecessors template shouldn't show anything as all obsolete commit are not visible. $ hg up 'desc(A2)' 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg tlog @ d004c8f274b9 | o ea207398892e $ hg tlog --hidden @ d004c8f274b9 | Predecessors: 2:a468dc9b3633 | semi-colon: 2:a468dc9b3633 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"] | map: 2:a468dc9b36338b14fdb7825f55ce3df4e71517ad | x a468dc9b3633 |/ Predecessors: 1:471f378eab4c | semi-colon: 1:471f378eab4c | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"] | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 | Successors: 3:d004c8f274b9 | multi-line: 3:d004c8f274b9 | json: [["d004c8f274b9ec480a47a93c10dac5eee63adb78"]] | x 471f378eab4c |/ Successors: 2:a468dc9b3633 | multi-line: 2:a468dc9b3633 | json: [["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]] o ea207398892e $ hg fatelog @ d004c8f274b9 | o ea207398892e $ hg fatelog --hidden @ d004c8f274b9 | | x a468dc9b3633 |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000); | x 471f378eab4c |/ Obsfate: rewritten using amend as 2:a468dc9b3633 by test (at 2009-02-13 23:31 +0000); o ea207398892e $ hg fatelogjson --hidden @ d004c8f274b9 | | x a468dc9b3633 |/ Obsfate: [{"markers": [["a468dc9b36338b14fdb7825f55ce3df4e71517ad", ["d004c8f274b9ec480a47a93c10dac5eee63adb78"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test2"]], [987654321.0, 0], null]], "successors": ["d004c8f274b9ec480a47a93c10dac5eee63adb78"]}] | x 471f378eab4c |/ Obsfate: [{"markers": [["471f378eab4c5e25f6c77f785b27c936efb22874", ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"], 0, [["ef1", "9"], ["operation", "amend"], ["user", "test"]], [1234567890.0, 0], null]], "successors": ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]}] o ea207398892e Check other fatelog implementations ----------------------------------- $ hg fatelogkw --hidden -q @ d004c8f274b9 | | x a468dc9b3633 |/ Obsfate: rewritten using amend as 3:d004c8f274b9 | x 471f378eab4c |/ Obsfate: rewritten using amend as 2:a468dc9b3633 o ea207398892e $ hg fatelogkw --hidden @ d004c8f274b9 | | x a468dc9b3633 |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test2 | x 471f378eab4c |/ Obsfate: rewritten using amend as 2:a468dc9b3633 o ea207398892e $ hg fatelogkw --hidden -v @ d004c8f274b9 | | x a468dc9b3633 |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000) | x 471f378eab4c |/ Obsfate: rewritten using amend as 2:a468dc9b3633 by test (at 2009-02-13 23:31 +0000) o ea207398892e $ hg log -G -T "default" --hidden @ changeset: 3:d004c8f274b9 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A2 | | x changeset: 2:a468dc9b3633 |/ parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 3:d004c8f274b9 by test2 | summary: A1 | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 2:a468dc9b3633 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT $ hg log -G -T "default" --hidden -v @ changeset: 3:d004c8f274b9 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | files: A0 | description: | A2 | | | x changeset: 2:a468dc9b3633 |/ parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +0000) | files: A0 | description: | A1 | | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 2:a468dc9b3633 by test (at 2009-02-13 23:31 +0000) | files: A0 | description: | A0 | | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 files: ROOT description: ROOT Test templates with splitted commit =================================== $ hg init $TESTTMP/templates-local-split $ cd $TESTTMP/templates-local-split $ mkcommit ROOT $ echo 42 >> a $ echo 43 >> b $ hg commit -A -m "A0" adding a adding b $ hg log --hidden -G @ changeset: 1:471597cad322 | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT # Simulate split $ hg up -r "desc(ROOT)" 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo 42 >> a $ hg commit -A -m "A0" adding a created new head $ echo 43 >> b $ hg commit -A -m "A0" adding b $ hg debugobsolete `getid "1"` `getid "2"` `getid "3"` obsoleted 1 changesets $ hg log --hidden -G @ changeset: 3:f257fde29c7a | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 2:337fec4d2edc | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | | x changeset: 1:471597cad322 |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: split as 2:337fec4d2edc, 3:f257fde29c7a | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Check templates --------------- $ hg up 'obsolete()' --hidden updating to a hidden changeset 471597cad322 (hidden revision '471597cad322' was split as: 337fec4d2edc, f257fde29c7a) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved Predecessors template should show current revision as it is the working copy $ hg tlog o f257fde29c7a | Predecessors: 1:471597cad322 | semi-colon: 1:471597cad322 | json: ["471597cad322d1f659bb169751be9133dad92ef3"] | map: 1:471597cad322d1f659bb169751be9133dad92ef3 o 337fec4d2edc | Predecessors: 1:471597cad322 | semi-colon: 1:471597cad322 | json: ["471597cad322d1f659bb169751be9133dad92ef3"] | map: 1:471597cad322d1f659bb169751be9133dad92ef3 | @ 471597cad322 |/ Successors: 2:337fec4d2edc 3:f257fde29c7a | multi-line: 2:337fec4d2edc 3:f257fde29c7a | json: [["337fec4d2edcf0e7a467e35f818234bc620068b5", "f257fde29c7a847c9b607f6e958656d0df0fb15c"]] o ea207398892e $ hg fatelog o f257fde29c7a | o 337fec4d2edc | | @ 471597cad322 |/ Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a by test (at 1970-01-01 00:00 +0000); o ea207398892e $ hg up f257fde29c7a 0 files updated, 0 files merged, 0 files removed, 0 files unresolved Predecessors template should not show a predecessor as it's not displayed in the log $ hg tlog @ f257fde29c7a | o 337fec4d2edc | o ea207398892e Predecessors template should show both predecessors as we force their display with --hidden $ hg tlog --hidden @ f257fde29c7a | Predecessors: 1:471597cad322 | semi-colon: 1:471597cad322 | json: ["471597cad322d1f659bb169751be9133dad92ef3"] | map: 1:471597cad322d1f659bb169751be9133dad92ef3 o 337fec4d2edc | Predecessors: 1:471597cad322 | semi-colon: 1:471597cad322 | json: ["471597cad322d1f659bb169751be9133dad92ef3"] | map: 1:471597cad322d1f659bb169751be9133dad92ef3 | x 471597cad322 |/ Successors: 2:337fec4d2edc 3:f257fde29c7a | multi-line: 2:337fec4d2edc 3:f257fde29c7a | json: [["337fec4d2edcf0e7a467e35f818234bc620068b5", "f257fde29c7a847c9b607f6e958656d0df0fb15c"]] o ea207398892e $ hg fatelog --hidden @ f257fde29c7a | o 337fec4d2edc | | x 471597cad322 |/ Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a by test (at 1970-01-01 00:00 +0000); o ea207398892e $ hg fatelogjson --hidden @ f257fde29c7a | o 337fec4d2edc | | x 471597cad322 |/ Obsfate: [{"markers": [["471597cad322d1f659bb169751be9133dad92ef3", ["337fec4d2edcf0e7a467e35f818234bc620068b5", "f257fde29c7a847c9b607f6e958656d0df0fb15c"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["337fec4d2edcf0e7a467e35f818234bc620068b5", "f257fde29c7a847c9b607f6e958656d0df0fb15c"]}] o ea207398892e Check other fatelog implementations ----------------------------------- $ hg fatelogkw --hidden -q @ f257fde29c7a | o 337fec4d2edc | | x 471597cad322 |/ Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a o ea207398892e $ hg fatelogkw --hidden @ f257fde29c7a | o 337fec4d2edc | | x 471597cad322 |/ Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a o ea207398892e $ hg fatelogkw --hidden -v @ f257fde29c7a | o 337fec4d2edc | | x 471597cad322 |/ Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a by test (at 1970-01-01 00:00 +0000) o ea207398892e $ hg log -G -T "default" --hidden @ changeset: 3:f257fde29c7a | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 2:337fec4d2edc | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | | x changeset: 1:471597cad322 |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: split as 2:337fec4d2edc, 3:f257fde29c7a | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Test templates with folded commit ================================= Test setup ---------- $ hg init $TESTTMP/templates-local-fold $ cd $TESTTMP/templates-local-fold $ mkcommit ROOT $ mkcommit A0 $ mkcommit B0 $ hg log --hidden -G @ changeset: 2:0dec01379d3b | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: B0 | o changeset: 1:471f378eab4c | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Simulate a fold $ hg up -r "desc(ROOT)" 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo "A0" > A0 $ echo "B0" > B0 $ hg commit -A -m "C0" adding A0 adding B0 created new head $ hg debugobsolete `getid "desc(A0)"` `getid "desc(C0)"` obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete `getid "desc(B0)"` `getid "desc(C0)"` obsoleted 1 changesets $ hg log --hidden -G @ changeset: 3:eb5a0daa2192 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: C0 | | x changeset: 2:0dec01379d3b | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | obsolete: rewritten as 3:eb5a0daa2192 | | summary: B0 | | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten as 3:eb5a0daa2192 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Check templates --------------- $ hg up 'desc(A0)' --hidden updating to a hidden changeset 471f378eab4c (hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192) 0 files updated, 0 files merged, 1 files removed, 0 files unresolved Predecessors template should show current revision as it is the working copy $ hg tlog o eb5a0daa2192 | Predecessors: 1:471f378eab4c | semi-colon: 1:471f378eab4c | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"] | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 | @ 471f378eab4c |/ Successors: 3:eb5a0daa2192 | multi-line: 3:eb5a0daa2192 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]] o ea207398892e $ hg fatelog o eb5a0daa2192 | | @ 471f378eab4c |/ Obsfate: rewritten as 3:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000); o ea207398892e $ hg up 'desc(B0)' --hidden updating to a hidden changeset 0dec01379d3b (hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Predecessors template should show both predecessors as they should be both displayed $ hg tlog o eb5a0daa2192 | Predecessors: 2:0dec01379d3b 1:471f378eab4c | semi-colon: 2:0dec01379d3b; 1:471f378eab4c | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"] | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 1:471f378eab4c5e25f6c77f785b27c936efb22874 | @ 0dec01379d3b | | Successors: 3:eb5a0daa2192 | | multi-line: 3:eb5a0daa2192 | | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]] | x 471f378eab4c |/ Successors: 3:eb5a0daa2192 | multi-line: 3:eb5a0daa2192 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]] o ea207398892e $ hg fatelog o eb5a0daa2192 | | @ 0dec01379d3b | | Obsfate: rewritten as 3:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000); | x 471f378eab4c |/ Obsfate: rewritten as 3:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000); o ea207398892e $ hg up 'desc(C0)' 0 files updated, 0 files merged, 0 files removed, 0 files unresolved Predecessors template should not show predecessors as they are not displayed in the log $ hg tlog @ eb5a0daa2192 | o ea207398892e Predecessors template should show both predecessors as we force their display with --hidden $ hg tlog --hidden @ eb5a0daa2192 | Predecessors: 2:0dec01379d3b 1:471f378eab4c | semi-colon: 2:0dec01379d3b; 1:471f378eab4c | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"] | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 1:471f378eab4c5e25f6c77f785b27c936efb22874 | x 0dec01379d3b | | Successors: 3:eb5a0daa2192 | | multi-line: 3:eb5a0daa2192 | | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]] | x 471f378eab4c |/ Successors: 3:eb5a0daa2192 | multi-line: 3:eb5a0daa2192 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]] o ea207398892e $ hg fatelog --hidden @ eb5a0daa2192 | | x 0dec01379d3b | | Obsfate: rewritten as 3:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000); | x 471f378eab4c |/ Obsfate: rewritten as 3:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000); o ea207398892e $ hg fatelogjson --hidden @ eb5a0daa2192 | | x 0dec01379d3b | | Obsfate: [{"markers": [["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]}] | x 471f378eab4c |/ Obsfate: [{"markers": [["471f378eab4c5e25f6c77f785b27c936efb22874", ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]}] o ea207398892e Check other fatelog implementations ----------------------------------- $ hg fatelogkw --hidden -q @ eb5a0daa2192 | | x 0dec01379d3b | | Obsfate: rewritten as 3:eb5a0daa2192 | x 471f378eab4c |/ Obsfate: rewritten as 3:eb5a0daa2192 o ea207398892e $ hg fatelogkw --hidden @ eb5a0daa2192 | | x 0dec01379d3b | | Obsfate: rewritten as 3:eb5a0daa2192 | x 471f378eab4c |/ Obsfate: rewritten as 3:eb5a0daa2192 o ea207398892e $ hg fatelogkw --hidden -v @ eb5a0daa2192 | | x 0dec01379d3b | | Obsfate: rewritten as 3:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000) | x 471f378eab4c |/ Obsfate: rewritten as 3:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000) o ea207398892e $ hg log -G -T "default" --hidden @ changeset: 3:eb5a0daa2192 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: C0 | | x changeset: 2:0dec01379d3b | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | obsolete: rewritten as 3:eb5a0daa2192 | | summary: B0 | | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten as 3:eb5a0daa2192 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Test templates with divergence ============================== Test setup ---------- $ hg init $TESTTMP/templates-local-divergence $ cd $TESTTMP/templates-local-divergence $ mkcommit ROOT $ mkcommit A0 $ hg commit --amend -m "A1" $ hg log --hidden -G @ changeset: 2:fdf9bde5129a | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A1 | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 2:fdf9bde5129a | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT $ hg update --hidden 'desc(A0)' updating to a hidden changeset 471f378eab4c (hidden revision '471f378eab4c' was rewritten as: fdf9bde5129a) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg commit --amend -m "A2" 2 new content-divergent changesets $ hg log --hidden -G @ changeset: 3:65b757b745b9 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | instability: content-divergent | summary: A2 | | * changeset: 2:fdf9bde5129a |/ parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | instability: content-divergent | summary: A1 | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 2:fdf9bde5129a | obsolete: rewritten using amend as 3:65b757b745b9 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT $ hg commit --amend -m 'A3' $ hg log --hidden -G @ changeset: 4:019fadeab383 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | instability: content-divergent | summary: A3 | | x changeset: 3:65b757b745b9 |/ parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 4:019fadeab383 | summary: A2 | | * changeset: 2:fdf9bde5129a |/ parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | instability: content-divergent | summary: A1 | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 2:fdf9bde5129a | obsolete: rewritten using amend as 3:65b757b745b9 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Check templates --------------- $ hg up 'desc(A0)' --hidden updating to a hidden changeset 471f378eab4c (hidden revision '471f378eab4c' has diverged) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved Predecessors template should show current revision as it is the working copy $ hg tlog * 019fadeab383 | Predecessors: 1:471f378eab4c | semi-colon: 1:471f378eab4c | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"] | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 | * fdf9bde5129a |/ Predecessors: 1:471f378eab4c | semi-colon: 1:471f378eab4c | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"] | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 | @ 471f378eab4c |/ Successors: 2:fdf9bde5129a; 4:019fadeab383 | multi-line: 2:fdf9bde5129a | multi-line: 4:019fadeab383 | json: [["fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e"], ["019fadeab383f6699fa83ad7bdb4d82ed2c0e5ab"]] o ea207398892e $ hg fatelog * 019fadeab383 | | * fdf9bde5129a |/ | @ 471f378eab4c |/ Obsfate: rewritten using amend as 2:fdf9bde5129a by test (at 1970-01-01 00:00 +0000); rewritten using amend as 4:019fadeab383 by test (at 1970-01-01 00:00 +0000); o ea207398892e $ hg up 'desc(A1)' 0 files updated, 0 files merged, 0 files removed, 0 files unresolved Predecessors template should not show predecessors as they are not displayed in the log $ hg tlog * 019fadeab383 | | @ fdf9bde5129a |/ o ea207398892e $ hg fatelog * 019fadeab383 | | @ fdf9bde5129a |/ o ea207398892e Predecessors template should the predecessors as we force their display with --hidden $ hg tlog --hidden * 019fadeab383 | Predecessors: 3:65b757b745b9 | semi-colon: 3:65b757b745b9 | json: ["65b757b745b935093c87a2bccd877521cccffcbd"] | map: 3:65b757b745b935093c87a2bccd877521cccffcbd | x 65b757b745b9 |/ Predecessors: 1:471f378eab4c | semi-colon: 1:471f378eab4c | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"] | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 | Successors: 4:019fadeab383 | multi-line: 4:019fadeab383 | json: [["019fadeab383f6699fa83ad7bdb4d82ed2c0e5ab"]] | @ fdf9bde5129a |/ Predecessors: 1:471f378eab4c | semi-colon: 1:471f378eab4c | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"] | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 | x 471f378eab4c |/ Successors: 2:fdf9bde5129a; 3:65b757b745b9 | multi-line: 2:fdf9bde5129a | multi-line: 3:65b757b745b9 | json: [["fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e"], ["65b757b745b935093c87a2bccd877521cccffcbd"]] o ea207398892e $ hg fatelog --hidden * 019fadeab383 | | x 65b757b745b9 |/ Obsfate: rewritten using amend as 4:019fadeab383 by test (at 1970-01-01 00:00 +0000); | @ fdf9bde5129a |/ | x 471f378eab4c |/ Obsfate: rewritten using amend as 2:fdf9bde5129a by test (at 1970-01-01 00:00 +0000); rewritten using amend as 3:65b757b745b9 by test (at 1970-01-01 00:00 +0000); o ea207398892e $ hg fatelogjson --hidden * 019fadeab383 | | x 65b757b745b9 |/ Obsfate: [{"markers": [["65b757b745b935093c87a2bccd877521cccffcbd", ["019fadeab383f6699fa83ad7bdb4d82ed2c0e5ab"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["019fadeab383f6699fa83ad7bdb4d82ed2c0e5ab"]}] | @ fdf9bde5129a |/ | x 471f378eab4c |/ Obsfate: [{"markers": [["471f378eab4c5e25f6c77f785b27c936efb22874", ["fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e"]}, {"markers": [["471f378eab4c5e25f6c77f785b27c936efb22874", ["65b757b745b935093c87a2bccd877521cccffcbd"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["65b757b745b935093c87a2bccd877521cccffcbd"]}] o ea207398892e Check other fatelog implementations ----------------------------------- $ hg fatelogkw --hidden -q * 019fadeab383 | | x 65b757b745b9 |/ Obsfate: rewritten using amend as 4:019fadeab383 | @ fdf9bde5129a |/ | x 471f378eab4c |/ Obsfate: rewritten using amend as 2:fdf9bde5129a | Obsfate: rewritten using amend as 3:65b757b745b9 o ea207398892e $ hg fatelogkw --hidden * 019fadeab383 | | x 65b757b745b9 |/ Obsfate: rewritten using amend as 4:019fadeab383 | @ fdf9bde5129a |/ | x 471f378eab4c |/ Obsfate: rewritten using amend as 2:fdf9bde5129a | Obsfate: rewritten using amend as 3:65b757b745b9 o ea207398892e $ hg fatelogkw --hidden -v * 019fadeab383 | | x 65b757b745b9 |/ Obsfate: rewritten using amend as 4:019fadeab383 by test (at 1970-01-01 00:00 +0000) | @ fdf9bde5129a |/ | x 471f378eab4c |/ Obsfate: rewritten using amend as 2:fdf9bde5129a by test (at 1970-01-01 00:00 +0000) | Obsfate: rewritten using amend as 3:65b757b745b9 by test (at 1970-01-01 00:00 +0000) o ea207398892e $ hg log -G -T "default" --hidden * changeset: 4:019fadeab383 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | instability: content-divergent | summary: A3 | | x changeset: 3:65b757b745b9 |/ parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 4:019fadeab383 | summary: A2 | | @ changeset: 2:fdf9bde5129a |/ parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | instability: content-divergent | summary: A1 | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 2:fdf9bde5129a | obsolete: rewritten using amend as 3:65b757b745b9 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Test templates with amended + folded commit =========================================== Test setup ---------- $ hg init $TESTTMP/templates-local-amend-fold $ cd $TESTTMP/templates-local-amend-fold $ mkcommit ROOT $ mkcommit A0 $ mkcommit B0 $ hg commit --amend -m "B1" $ hg log --hidden -G @ changeset: 3:b7ea6d14e664 | tag: tip | parent: 1:471f378eab4c | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: B1 | | x changeset: 2:0dec01379d3b |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 3:b7ea6d14e664 | summary: B0 | o changeset: 1:471f378eab4c | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT # Simulate a fold $ hg up -r "desc(ROOT)" 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo "A0" > A0 $ echo "B0" > B0 $ hg commit -A -m "C0" adding A0 adding B0 created new head $ hg debugobsolete `getid "desc(A0)"` `getid "desc(C0)"` obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete `getid "desc(B1)"` `getid "desc(C0)"` obsoleted 1 changesets $ hg log --hidden -G @ changeset: 4:eb5a0daa2192 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: C0 | | x changeset: 3:b7ea6d14e664 | | parent: 1:471f378eab4c | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | obsolete: rewritten as 4:eb5a0daa2192 | | summary: B1 | | | | x changeset: 2:0dec01379d3b | |/ user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | obsolete: rewritten using amend as 3:b7ea6d14e664 | | summary: B0 | | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten as 4:eb5a0daa2192 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Check templates --------------- $ hg up 'desc(A0)' --hidden updating to a hidden changeset 471f378eab4c (hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192) 0 files updated, 0 files merged, 1 files removed, 0 files unresolved Predecessors template should show current revision as it is the working copy $ hg tlog o eb5a0daa2192 | Predecessors: 1:471f378eab4c | semi-colon: 1:471f378eab4c | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"] | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 | @ 471f378eab4c |/ Successors: 4:eb5a0daa2192 | multi-line: 4:eb5a0daa2192 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]] o ea207398892e $ hg fatelog o eb5a0daa2192 | | @ 471f378eab4c |/ Obsfate: rewritten as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000); o ea207398892e $ hg up 'desc(B0)' --hidden updating to a hidden changeset 0dec01379d3b (hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Predecessors template should both predecessors as they are visible $ hg tlog o eb5a0daa2192 | Predecessors: 2:0dec01379d3b 1:471f378eab4c | semi-colon: 2:0dec01379d3b; 1:471f378eab4c | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"] | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 1:471f378eab4c5e25f6c77f785b27c936efb22874 | @ 0dec01379d3b | | Successors: 4:eb5a0daa2192 | | multi-line: 4:eb5a0daa2192 | | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]] | x 471f378eab4c |/ Successors: 4:eb5a0daa2192 | multi-line: 4:eb5a0daa2192 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]] o ea207398892e $ hg fatelog o eb5a0daa2192 | | @ 0dec01379d3b | | Obsfate: rewritten using amend as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000); | x 471f378eab4c |/ Obsfate: rewritten as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000); o ea207398892e $ hg up 'desc(B1)' --hidden updating to a hidden changeset b7ea6d14e664 (hidden revision 'b7ea6d14e664' was rewritten as: eb5a0daa2192) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved Predecessors template should both predecessors as they are visible $ hg tlog o eb5a0daa2192 | Predecessors: 1:471f378eab4c 3:b7ea6d14e664 | semi-colon: 1:471f378eab4c; 3:b7ea6d14e664 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874", "b7ea6d14e664bdc8922221f7992631b50da3fb07"] | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 3:b7ea6d14e664bdc8922221f7992631b50da3fb07 | @ b7ea6d14e664 | | Successors: 4:eb5a0daa2192 | | multi-line: 4:eb5a0daa2192 | | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]] | x 471f378eab4c |/ Successors: 4:eb5a0daa2192 | multi-line: 4:eb5a0daa2192 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]] o ea207398892e $ hg fatelog o eb5a0daa2192 | | @ b7ea6d14e664 | | Obsfate: rewritten as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000); | x 471f378eab4c |/ Obsfate: rewritten as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000); o ea207398892e $ hg up 'desc(C0)' 0 files updated, 0 files merged, 0 files removed, 0 files unresolved Predecessors template should show no predecessors as they are both non visible $ hg tlog @ eb5a0daa2192 | o ea207398892e $ hg fatelog @ eb5a0daa2192 | o ea207398892e Predecessors template should show all predecessors as we force their display with --hidden $ hg tlog --hidden @ eb5a0daa2192 | Predecessors: 1:471f378eab4c 3:b7ea6d14e664 | semi-colon: 1:471f378eab4c; 3:b7ea6d14e664 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874", "b7ea6d14e664bdc8922221f7992631b50da3fb07"] | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 3:b7ea6d14e664bdc8922221f7992631b50da3fb07 | x b7ea6d14e664 | | Predecessors: 2:0dec01379d3b | | semi-colon: 2:0dec01379d3b | | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"] | | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 | | Successors: 4:eb5a0daa2192 | | multi-line: 4:eb5a0daa2192 | | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]] | | x 0dec01379d3b | |/ Successors: 3:b7ea6d14e664 | | multi-line: 3:b7ea6d14e664 | | json: [["b7ea6d14e664bdc8922221f7992631b50da3fb07"]] | x 471f378eab4c |/ Successors: 4:eb5a0daa2192 | multi-line: 4:eb5a0daa2192 | json: [["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]] o ea207398892e $ hg fatelog --hidden @ eb5a0daa2192 | | x b7ea6d14e664 | | Obsfate: rewritten as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000); | | x 0dec01379d3b | |/ Obsfate: rewritten using amend as 3:b7ea6d14e664 by test (at 1970-01-01 00:00 +0000); | x 471f378eab4c |/ Obsfate: rewritten as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000); o ea207398892e $ hg fatelogjson --hidden @ eb5a0daa2192 | | x b7ea6d14e664 | | Obsfate: [{"markers": [["b7ea6d14e664bdc8922221f7992631b50da3fb07", ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]}] | | x 0dec01379d3b | |/ Obsfate: [{"markers": [["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", ["b7ea6d14e664bdc8922221f7992631b50da3fb07"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["b7ea6d14e664bdc8922221f7992631b50da3fb07"]}] | x 471f378eab4c |/ Obsfate: [{"markers": [["471f378eab4c5e25f6c77f785b27c936efb22874", ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["eb5a0daa21923bbf8caeb2c42085b9e463861fd0"]}] o ea207398892e Check other fatelog implementations ----------------------------------- $ hg fatelogkw --hidden -q @ eb5a0daa2192 | | x b7ea6d14e664 | | Obsfate: rewritten as 4:eb5a0daa2192 | | x 0dec01379d3b | |/ Obsfate: rewritten using amend as 3:b7ea6d14e664 | x 471f378eab4c |/ Obsfate: rewritten as 4:eb5a0daa2192 o ea207398892e $ hg fatelogkw --hidden @ eb5a0daa2192 | | x b7ea6d14e664 | | Obsfate: rewritten as 4:eb5a0daa2192 | | x 0dec01379d3b | |/ Obsfate: rewritten using amend as 3:b7ea6d14e664 | x 471f378eab4c |/ Obsfate: rewritten as 4:eb5a0daa2192 o ea207398892e $ hg fatelogkw --hidden -v @ eb5a0daa2192 | | x b7ea6d14e664 | | Obsfate: rewritten as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000) | | x 0dec01379d3b | |/ Obsfate: rewritten using amend as 3:b7ea6d14e664 by test (at 1970-01-01 00:00 +0000) | x 471f378eab4c |/ Obsfate: rewritten as 4:eb5a0daa2192 by test (at 1970-01-01 00:00 +0000) o ea207398892e $ hg log -G -T "default" --hidden @ changeset: 4:eb5a0daa2192 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: C0 | | x changeset: 3:b7ea6d14e664 | | parent: 1:471f378eab4c | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | obsolete: rewritten as 4:eb5a0daa2192 | | summary: B1 | | | | x changeset: 2:0dec01379d3b | |/ user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | obsolete: rewritten using amend as 3:b7ea6d14e664 | | summary: B0 | | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten as 4:eb5a0daa2192 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Test template with pushed and pulled obs markers ================================================ Test setup ---------- $ hg init $TESTTMP/templates-local-remote-markers-1 $ cd $TESTTMP/templates-local-remote-markers-1 $ mkcommit ROOT $ mkcommit A0 $ hg clone $TESTTMP/templates-local-remote-markers-1 $TESTTMP/templates-local-remote-markers-2 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd $TESTTMP/templates-local-remote-markers-2 $ hg log --hidden -G @ changeset: 1:471f378eab4c | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT $ cd $TESTTMP/templates-local-remote-markers-1 $ hg commit --amend -m "A1" $ hg commit --amend -m "A2" $ hg log --hidden -G @ changeset: 3:7a230b46bf61 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A2 | | x changeset: 2:fdf9bde5129a |/ parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 3:7a230b46bf61 | summary: A1 | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 2:fdf9bde5129a | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT $ cd $TESTTMP/templates-local-remote-markers-2 $ hg pull pulling from $TESTTMP/templates-local-remote-markers-1 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 0 changes to 1 files (+1 heads) 2 new obsolescence markers obsoleted 1 changesets new changesets 7a230b46bf61 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg log --hidden -G o changeset: 2:7a230b46bf61 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A2 | | @ changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 2:7a230b46bf61 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT $ hg debugobsolete 471f378eab4c5e25f6c77f785b27c936efb22874 fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'} fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 7a230b46bf61e50b30308c6cfd7bd1269ef54702 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'} Check templates --------------- Predecessors template should show current revision as it is the working copy $ hg tlog o 7a230b46bf61 | Predecessors: 1:471f378eab4c | semi-colon: 1:471f378eab4c | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"] | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 | @ 471f378eab4c |/ Successors: 2:7a230b46bf61 | multi-line: 2:7a230b46bf61 | json: [["7a230b46bf61e50b30308c6cfd7bd1269ef54702"]] o ea207398892e $ hg fatelog o 7a230b46bf61 | | @ 471f378eab4c |/ Obsfate: rewritten using amend as 2:7a230b46bf61 by test (at 1970-01-01 00:00 +0000); o ea207398892e $ hg up 'desc(A2)' 0 files updated, 0 files merged, 0 files removed, 0 files unresolved Predecessors template should show no predecessors as they are non visible $ hg tlog @ 7a230b46bf61 | o ea207398892e $ hg fatelog @ 7a230b46bf61 | o ea207398892e Predecessors template should show all predecessors as we force their display with --hidden $ hg tlog --hidden @ 7a230b46bf61 | Predecessors: 1:471f378eab4c | semi-colon: 1:471f378eab4c | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"] | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 | x 471f378eab4c |/ Successors: 2:7a230b46bf61 | multi-line: 2:7a230b46bf61 | json: [["7a230b46bf61e50b30308c6cfd7bd1269ef54702"]] o ea207398892e $ hg fatelog --hidden @ 7a230b46bf61 | | x 471f378eab4c |/ Obsfate: rewritten using amend as 2:7a230b46bf61 by test (at 1970-01-01 00:00 +0000); o ea207398892e Check other fatelog implementations ----------------------------------- $ hg fatelogkw --hidden -q @ 7a230b46bf61 | | x 471f378eab4c |/ Obsfate: rewritten using amend as 2:7a230b46bf61 o ea207398892e $ hg fatelogkw --hidden @ 7a230b46bf61 | | x 471f378eab4c |/ Obsfate: rewritten using amend as 2:7a230b46bf61 o ea207398892e $ hg fatelogkw --hidden -v @ 7a230b46bf61 | | x 471f378eab4c |/ Obsfate: rewritten using amend as 2:7a230b46bf61 by test (at 1970-01-01 00:00 +0000) o ea207398892e $ hg log -G -T "default" --hidden @ changeset: 2:7a230b46bf61 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A2 | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 2:7a230b46bf61 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Test template with obsmarkers cycle =================================== Test setup ---------- $ hg init $TESTTMP/templates-local-cycle $ cd $TESTTMP/templates-local-cycle $ mkcommit ROOT $ mkcommit A0 $ mkcommit B0 $ hg up -r 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ mkcommit C0 created new head Create the cycle $ hg debugobsolete `getid "desc(A0)"` `getid "desc(B0)"` obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete `getid "desc(B0)"` `getid "desc(C0)"` obsoleted 1 changesets $ hg debugobsolete `getid "desc(B0)"` `getid "desc(A0)"` Check templates --------------- $ hg tlog @ f897c6137566 | o ea207398892e $ hg fatelog @ f897c6137566 | o ea207398892e $ hg up -r "desc(B0)" --hidden updating to a hidden changeset 0dec01379d3b (hidden revision '0dec01379d3b' is pruned) 2 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg tlog o f897c6137566 | Predecessors: 2:0dec01379d3b | semi-colon: 2:0dec01379d3b | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"] | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 | @ 0dec01379d3b | | Predecessors: 1:471f378eab4c | | semi-colon: 1:471f378eab4c | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"] | | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 | | Successors: 3:f897c6137566; 1:471f378eab4c | | multi-line: 3:f897c6137566 | | multi-line: 1:471f378eab4c | | json: [["f897c6137566320b081514b4c7227ecc3d384b39"], ["471f378eab4c5e25f6c77f785b27c936efb22874"]] | x 471f378eab4c |/ Predecessors: 2:0dec01379d3b | semi-colon: 2:0dec01379d3b | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"] | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 | Successors: 2:0dec01379d3b | multi-line: 2:0dec01379d3b | json: [["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]] o ea207398892e $ hg fatelog o f897c6137566 | | @ 0dec01379d3b | | Obsfate: rewritten as 3:f897c6137566 by test (at 1970-01-01 00:00 +0000); rewritten as 1:471f378eab4c by test (at 1970-01-01 00:00 +0000); | x 471f378eab4c |/ Obsfate: rewritten as 2:0dec01379d3b by test (at 1970-01-01 00:00 +0000); o ea207398892e $ hg up -r "desc(A0)" --hidden 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg tlog o f897c6137566 | Predecessors: 1:471f378eab4c | semi-colon: 1:471f378eab4c | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"] | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 | @ 471f378eab4c |/ o ea207398892e $ hg fatelog o f897c6137566 | | @ 471f378eab4c |/ Obsfate: pruned; o ea207398892e $ hg up -r "desc(ROOT)" --hidden 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg tlog o f897c6137566 | @ ea207398892e $ hg fatelog o f897c6137566 | @ ea207398892e $ hg tlog --hidden o f897c6137566 | Predecessors: 2:0dec01379d3b | semi-colon: 2:0dec01379d3b | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"] | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 | x 0dec01379d3b | | Predecessors: 1:471f378eab4c | | semi-colon: 1:471f378eab4c | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"] | | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 | | Successors: 3:f897c6137566; 1:471f378eab4c | | multi-line: 3:f897c6137566 | | multi-line: 1:471f378eab4c | | json: [["f897c6137566320b081514b4c7227ecc3d384b39"], ["471f378eab4c5e25f6c77f785b27c936efb22874"]] | x 471f378eab4c |/ Predecessors: 2:0dec01379d3b | semi-colon: 2:0dec01379d3b | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"] | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 | Successors: 2:0dec01379d3b | multi-line: 2:0dec01379d3b | json: [["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]] @ ea207398892e Check other fatelog implementations ----------------------------------- $ hg fatelogkw --hidden -q o f897c6137566 | | x 0dec01379d3b | | Obsfate: rewritten as 3:f897c6137566 | | Obsfate: rewritten as 1:471f378eab4c | x 471f378eab4c |/ Obsfate: rewritten as 2:0dec01379d3b @ ea207398892e $ hg fatelogkw --hidden o f897c6137566 | | x 0dec01379d3b | | Obsfate: rewritten as 3:f897c6137566 | | Obsfate: rewritten as 1:471f378eab4c | x 471f378eab4c |/ Obsfate: rewritten as 2:0dec01379d3b @ ea207398892e $ hg fatelogkw --hidden -v o f897c6137566 | | x 0dec01379d3b | | Obsfate: rewritten as 3:f897c6137566 by test (at 1970-01-01 00:00 +0000) | | Obsfate: rewritten as 1:471f378eab4c by test (at 1970-01-01 00:00 +0000) | x 471f378eab4c |/ Obsfate: rewritten as 2:0dec01379d3b by test (at 1970-01-01 00:00 +0000) @ ea207398892e $ hg log -G -T "default" --hidden o changeset: 3:f897c6137566 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: C0 | | x changeset: 2:0dec01379d3b | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | obsolete: rewritten as 3:f897c6137566 | | obsolete: rewritten as 1:471f378eab4c | | summary: B0 | | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten as 2:0dec01379d3b | summary: A0 | @ changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Test template with split + divergence with cycles ================================================= $ hg log -G o changeset: 3:f897c6137566 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: C0 | @ changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT $ hg up 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Create a commit with three files $ touch A B C $ hg commit -A -m "Add A,B,C" A B C Split it $ hg up 3 0 files updated, 0 files merged, 3 files removed, 0 files unresolved $ touch A $ hg commit -A -m "Add A,B,C" A created new head $ touch B $ hg commit -A -m "Add A,B,C" B $ touch C $ hg commit -A -m "Add A,B,C" C $ hg log -G @ changeset: 7:ba2ed02b0c9a | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: Add A,B,C | o changeset: 6:4a004186e638 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: Add A,B,C | o changeset: 5:dd800401bd8c | parent: 3:f897c6137566 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: Add A,B,C | | o changeset: 4:9bd10a0775e4 |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: Add A,B,C | o changeset: 3:f897c6137566 | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: C0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT $ hg debugobsolete `getid "4"` `getid "5"` `getid "6"` `getid "7"` obsoleted 1 changesets $ hg log -G @ changeset: 7:ba2ed02b0c9a | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: Add A,B,C | o changeset: 6:4a004186e638 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: Add A,B,C | o changeset: 5:dd800401bd8c | parent: 3:f897c6137566 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: Add A,B,C | o changeset: 3:f897c6137566 | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: C0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Diverge one of the splitted commit $ hg up 6 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg commit --amend -m "Add only B" 1 new orphan changesets $ hg up 6 --hidden 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg commit --amend -m "Add B only" 4 new content-divergent changesets $ hg log -G @ changeset: 9:0b997eb7ceee | tag: tip | parent: 5:dd800401bd8c | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | instability: content-divergent | summary: Add B only | | * changeset: 8:b18bc8331526 |/ parent: 5:dd800401bd8c | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | instability: content-divergent | summary: Add only B | | * changeset: 7:ba2ed02b0c9a | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | instability: orphan, content-divergent | | summary: Add A,B,C | | | x changeset: 6:4a004186e638 |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 8:b18bc8331526 | obsolete: rewritten using amend as 9:0b997eb7ceee | summary: Add A,B,C | * changeset: 5:dd800401bd8c | parent: 3:f897c6137566 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | instability: content-divergent | summary: Add A,B,C | o changeset: 3:f897c6137566 | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: C0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Check templates --------------- $ hg tlog @ 0b997eb7ceee | Predecessors: 6:4a004186e638 | semi-colon: 6:4a004186e638 | json: ["4a004186e63889f20cb16434fcbd72220bd1eace"] | map: 6:4a004186e63889f20cb16434fcbd72220bd1eace | * b18bc8331526 |/ Predecessors: 6:4a004186e638 | semi-colon: 6:4a004186e638 | json: ["4a004186e63889f20cb16434fcbd72220bd1eace"] | map: 6:4a004186e63889f20cb16434fcbd72220bd1eace | * ba2ed02b0c9a | | | x 4a004186e638 |/ Successors: 8:b18bc8331526; 9:0b997eb7ceee | multi-line: 8:b18bc8331526 | multi-line: 9:0b997eb7ceee | json: [["b18bc8331526a22cbb1801022bd1555bf291c48b"], ["0b997eb7ceeee06200a02f8aab185979092d514e"]] * dd800401bd8c | o f897c6137566 | o ea207398892e $ hg fatelog @ 0b997eb7ceee | | * b18bc8331526 |/ | * ba2ed02b0c9a | | | x 4a004186e638 |/ Obsfate: rewritten using amend as 8:b18bc8331526 by test (at 1970-01-01 00:00 +0000); rewritten using amend as 9:0b997eb7ceee by test (at 1970-01-01 00:00 +0000); * dd800401bd8c | o f897c6137566 | o ea207398892e $ hg tlog --hidden @ 0b997eb7ceee | Predecessors: 6:4a004186e638 | semi-colon: 6:4a004186e638 | json: ["4a004186e63889f20cb16434fcbd72220bd1eace"] | map: 6:4a004186e63889f20cb16434fcbd72220bd1eace | * b18bc8331526 |/ Predecessors: 6:4a004186e638 | semi-colon: 6:4a004186e638 | json: ["4a004186e63889f20cb16434fcbd72220bd1eace"] | map: 6:4a004186e63889f20cb16434fcbd72220bd1eace | * ba2ed02b0c9a | | Predecessors: 4:9bd10a0775e4 | | semi-colon: 4:9bd10a0775e4 | | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"] | | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7 | x 4a004186e638 |/ Predecessors: 4:9bd10a0775e4 | semi-colon: 4:9bd10a0775e4 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"] | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7 | Successors: 8:b18bc8331526; 9:0b997eb7ceee | multi-line: 8:b18bc8331526 | multi-line: 9:0b997eb7ceee | json: [["b18bc8331526a22cbb1801022bd1555bf291c48b"], ["0b997eb7ceeee06200a02f8aab185979092d514e"]] * dd800401bd8c | Predecessors: 4:9bd10a0775e4 | semi-colon: 4:9bd10a0775e4 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"] | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7 | x 9bd10a0775e4 |/ Successors: 5:dd800401bd8c 6:4a004186e638 7:ba2ed02b0c9a | multi-line: 5:dd800401bd8c 6:4a004186e638 7:ba2ed02b0c9a | json: [["dd800401bd8c79d815329277739e433e883f784e", "4a004186e63889f20cb16434fcbd72220bd1eace", "ba2ed02b0c9a56b9fdbc4e79c7e57866984d8a1f"]] o f897c6137566 | Predecessors: 2:0dec01379d3b | semi-colon: 2:0dec01379d3b | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"] | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 | x 0dec01379d3b | | Predecessors: 1:471f378eab4c | | semi-colon: 1:471f378eab4c | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"] | | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 | | Successors: 3:f897c6137566; 1:471f378eab4c | | multi-line: 3:f897c6137566 | | multi-line: 1:471f378eab4c | | json: [["f897c6137566320b081514b4c7227ecc3d384b39"], ["471f378eab4c5e25f6c77f785b27c936efb22874"]] | x 471f378eab4c |/ Predecessors: 2:0dec01379d3b | semi-colon: 2:0dec01379d3b | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"] | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 | Successors: 2:0dec01379d3b | multi-line: 2:0dec01379d3b | json: [["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]] o ea207398892e $ hg fatelog --hidden @ 0b997eb7ceee | | * b18bc8331526 |/ | * ba2ed02b0c9a | | | x 4a004186e638 |/ Obsfate: rewritten using amend as 8:b18bc8331526 by test (at 1970-01-01 00:00 +0000); rewritten using amend as 9:0b997eb7ceee by test (at 1970-01-01 00:00 +0000); * dd800401bd8c | | x 9bd10a0775e4 |/ Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a by test (at 1970-01-01 00:00 +0000); o f897c6137566 | | x 0dec01379d3b | | Obsfate: rewritten as 3:f897c6137566 by test (at 1970-01-01 00:00 +0000); rewritten as 1:471f378eab4c by test (at 1970-01-01 00:00 +0000); | x 471f378eab4c |/ Obsfate: rewritten as 2:0dec01379d3b by test (at 1970-01-01 00:00 +0000); o ea207398892e $ hg fatelogjson --hidden @ 0b997eb7ceee | | * b18bc8331526 |/ | * ba2ed02b0c9a | | | x 4a004186e638 |/ Obsfate: [{"markers": [["4a004186e63889f20cb16434fcbd72220bd1eace", ["b18bc8331526a22cbb1801022bd1555bf291c48b"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["b18bc8331526a22cbb1801022bd1555bf291c48b"]}, {"markers": [["4a004186e63889f20cb16434fcbd72220bd1eace", ["0b997eb7ceeee06200a02f8aab185979092d514e"], 0, [["ef1", "1"], ["operation", "amend"], ["user", "test"]], [0.0, 0], null]], "successors": ["0b997eb7ceeee06200a02f8aab185979092d514e"]}] * dd800401bd8c | | x 9bd10a0775e4 |/ Obsfate: [{"markers": [["9bd10a0775e478708cada5f176ec6de654359ce7", ["dd800401bd8c79d815329277739e433e883f784e", "4a004186e63889f20cb16434fcbd72220bd1eace", "ba2ed02b0c9a56b9fdbc4e79c7e57866984d8a1f"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["dd800401bd8c79d815329277739e433e883f784e", "4a004186e63889f20cb16434fcbd72220bd1eace", "ba2ed02b0c9a56b9fdbc4e79c7e57866984d8a1f"]}] o f897c6137566 | | x 0dec01379d3b | | Obsfate: [{"markers": [["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", ["f897c6137566320b081514b4c7227ecc3d384b39"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["f897c6137566320b081514b4c7227ecc3d384b39"]}, {"markers": [["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", ["471f378eab4c5e25f6c77f785b27c936efb22874"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["471f378eab4c5e25f6c77f785b27c936efb22874"]}] | x 471f378eab4c |/ Obsfate: [{"markers": [["471f378eab4c5e25f6c77f785b27c936efb22874", ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"], 0, [["user", "test"]], [0.0, 0], null]], "successors": ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]}] o ea207398892e $ hg up --hidden 4 updating to a hidden changeset 9bd10a0775e4 (hidden revision '9bd10a0775e4' has diverged) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg rebase -r 7 -d 8 --config extensions.rebase= rebasing 7:ba2ed02b0c9a "Add A,B,C" $ hg tlog * eceed8f98ffc | Predecessors: 4:9bd10a0775e4 | semi-colon: 4:9bd10a0775e4 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"] | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7 | * 0b997eb7ceee | | Predecessors: 4:9bd10a0775e4 | | semi-colon: 4:9bd10a0775e4 | | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"] | | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7 * | b18bc8331526 |/ Predecessors: 4:9bd10a0775e4 | semi-colon: 4:9bd10a0775e4 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"] | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7 * dd800401bd8c | Predecessors: 4:9bd10a0775e4 | semi-colon: 4:9bd10a0775e4 | json: ["9bd10a0775e478708cada5f176ec6de654359ce7"] | map: 4:9bd10a0775e478708cada5f176ec6de654359ce7 | @ 9bd10a0775e4 |/ Successors: 5:dd800401bd8c 9:0b997eb7ceee 10:eceed8f98ffc; 5:dd800401bd8c 8:b18bc8331526 10:eceed8f98ffc | multi-line: 5:dd800401bd8c 9:0b997eb7ceee 10:eceed8f98ffc | multi-line: 5:dd800401bd8c 8:b18bc8331526 10:eceed8f98ffc | json: [["dd800401bd8c79d815329277739e433e883f784e", "0b997eb7ceeee06200a02f8aab185979092d514e", "eceed8f98ffc4186032e29a6542ab98888ebf68d"], ["dd800401bd8c79d815329277739e433e883f784e", "b18bc8331526a22cbb1801022bd1555bf291c48b", "eceed8f98ffc4186032e29a6542ab98888ebf68d"]] o f897c6137566 | o ea207398892e $ hg fatelog * eceed8f98ffc | | * 0b997eb7ceee | | * | b18bc8331526 |/ * dd800401bd8c | | @ 9bd10a0775e4 |/ Obsfate: split using amend, rebase as 5:dd800401bd8c, 9:0b997eb7ceee, 10:eceed8f98ffc by test (at 1970-01-01 00:00 +0000); split using amend, rebase as 5:dd800401bd8c, 8:b18bc8331526, 10:eceed8f98ffc by test (at 1970-01-01 00:00 +0000); o f897c6137566 | o ea207398892e Check other fatelog implementations ----------------------------------- $ hg fatelogkw --hidden -q * eceed8f98ffc | | * 0b997eb7ceee | | * | b18bc8331526 |/ | x ba2ed02b0c9a | | Obsfate: rewritten using rebase as 10:eceed8f98ffc | x 4a004186e638 |/ Obsfate: rewritten using amend as 8:b18bc8331526 | Obsfate: rewritten using amend as 9:0b997eb7ceee * dd800401bd8c | | @ 9bd10a0775e4 |/ Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a o f897c6137566 | | x 0dec01379d3b | | Obsfate: rewritten as 3:f897c6137566 | | Obsfate: rewritten as 1:471f378eab4c | x 471f378eab4c |/ Obsfate: rewritten as 2:0dec01379d3b o ea207398892e $ hg fatelogkw --hidden * eceed8f98ffc | | * 0b997eb7ceee | | * | b18bc8331526 |/ | x ba2ed02b0c9a | | Obsfate: rewritten using rebase as 10:eceed8f98ffc | x 4a004186e638 |/ Obsfate: rewritten using amend as 8:b18bc8331526 | Obsfate: rewritten using amend as 9:0b997eb7ceee * dd800401bd8c | | @ 9bd10a0775e4 |/ Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a o f897c6137566 | | x 0dec01379d3b | | Obsfate: rewritten as 3:f897c6137566 | | Obsfate: rewritten as 1:471f378eab4c | x 471f378eab4c |/ Obsfate: rewritten as 2:0dec01379d3b o ea207398892e $ hg fatelogkw --hidden -v * eceed8f98ffc | | * 0b997eb7ceee | | * | b18bc8331526 |/ | x ba2ed02b0c9a | | Obsfate: rewritten using rebase as 10:eceed8f98ffc by test (at 1970-01-01 00:00 +0000) | x 4a004186e638 |/ Obsfate: rewritten using amend as 8:b18bc8331526 by test (at 1970-01-01 00:00 +0000) | Obsfate: rewritten using amend as 9:0b997eb7ceee by test (at 1970-01-01 00:00 +0000) * dd800401bd8c | | @ 9bd10a0775e4 |/ Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a by test (at 1970-01-01 00:00 +0000) o f897c6137566 | | x 0dec01379d3b | | Obsfate: rewritten as 3:f897c6137566 by test (at 1970-01-01 00:00 +0000) | | Obsfate: rewritten as 1:471f378eab4c by test (at 1970-01-01 00:00 +0000) | x 471f378eab4c |/ Obsfate: rewritten as 2:0dec01379d3b by test (at 1970-01-01 00:00 +0000) o ea207398892e $ hg log -G -T "default" --hidden * changeset: 10:eceed8f98ffc | tag: tip | parent: 8:b18bc8331526 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | instability: content-divergent | summary: Add A,B,C | | * changeset: 9:0b997eb7ceee | | parent: 5:dd800401bd8c | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | instability: content-divergent | | summary: Add B only | | * | changeset: 8:b18bc8331526 |/ parent: 5:dd800401bd8c | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | instability: content-divergent | summary: Add only B | | x changeset: 7:ba2ed02b0c9a | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | obsolete: rewritten using rebase as 10:eceed8f98ffc | | summary: Add A,B,C | | | x changeset: 6:4a004186e638 |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 8:b18bc8331526 | obsolete: rewritten using amend as 9:0b997eb7ceee | summary: Add A,B,C | * changeset: 5:dd800401bd8c | parent: 3:f897c6137566 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | instability: content-divergent | summary: Add A,B,C | | @ changeset: 4:9bd10a0775e4 |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a | summary: Add A,B,C | o changeset: 3:f897c6137566 | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: C0 | | x changeset: 2:0dec01379d3b | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | obsolete: rewritten as 3:f897c6137566 | | obsolete: rewritten as 1:471f378eab4c | | summary: B0 | | | x changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten as 2:0dec01379d3b | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Test templates with pruned commits ================================== Test setup ---------- $ hg init $TESTTMP/templates-local-prune $ cd $TESTTMP/templates-local-prune $ mkcommit ROOT $ mkcommit A0 $ hg debugobsolete --record-parent `getid "."` obsoleted 1 changesets Check output ------------ $ hg up "desc(A0)" --hidden 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg tlog @ 471f378eab4c | o ea207398892e $ hg fatelog @ 471f378eab4c | Obsfate: pruned by test (at 1970-01-01 00:00 +0000); o ea207398892e Test templates with multiple pruned commits =========================================== Test setup ---------- $ hg init $TESTTMP/multiple-local-prune $ cd $TESTTMP/multiple-local-prune $ mkcommit ROOT $ mkcommit A0 $ hg commit --amend -m "A1" $ hg debugobsolete --record-parent `getid "."` obsoleted 1 changesets $ hg up -r "desc(A0)" --hidden updating to a hidden changeset 471f378eab4c (hidden revision '471f378eab4c' is pruned) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg commit --amend -m "A2" $ hg debugobsolete --record-parent `getid "."` obsoleted 1 changesets Check output ------------ $ hg up "desc(A0)" --hidden updating to a hidden changeset 471f378eab4c (hidden revision '471f378eab4c' is pruned) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg tlog @ 471f378eab4c | o ea207398892e # todo: the obsfate output is not ideal $ hg fatelog @ 471f378eab4c | Obsfate: pruned; o ea207398892e $ hg fatelog --hidden x 65b757b745b9 | Obsfate: pruned by test (at 1970-01-01 00:00 +0000); | x fdf9bde5129a |/ Obsfate: pruned by test (at 1970-01-01 00:00 +0000); | @ 471f378eab4c |/ Obsfate: rewritten using amend as 2:fdf9bde5129a by test (at 1970-01-01 00:00 +0000); rewritten using amend as 3:65b757b745b9 by test (at 1970-01-01 00:00 +0000); o ea207398892e Check other fatelog implementations ----------------------------------- $ hg fatelogkw --hidden -q x 65b757b745b9 | Obsfate: pruned | x fdf9bde5129a |/ Obsfate: pruned | @ 471f378eab4c |/ Obsfate: rewritten using amend as 2:fdf9bde5129a | Obsfate: rewritten using amend as 3:65b757b745b9 o ea207398892e $ hg fatelogkw --hidden x 65b757b745b9 | Obsfate: pruned | x fdf9bde5129a |/ Obsfate: pruned | @ 471f378eab4c |/ Obsfate: rewritten using amend as 2:fdf9bde5129a | Obsfate: rewritten using amend as 3:65b757b745b9 o ea207398892e $ hg fatelogkw --hidden -v x 65b757b745b9 | Obsfate: pruned by test (at 1970-01-01 00:00 +0000) | x fdf9bde5129a |/ Obsfate: pruned by test (at 1970-01-01 00:00 +0000) | @ 471f378eab4c |/ Obsfate: rewritten using amend as 2:fdf9bde5129a by test (at 1970-01-01 00:00 +0000) | Obsfate: rewritten using amend as 3:65b757b745b9 by test (at 1970-01-01 00:00 +0000) o ea207398892e $ hg log -G -T "default" --hidden x changeset: 3:65b757b745b9 | tag: tip | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: pruned | summary: A2 | | x changeset: 2:fdf9bde5129a |/ parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: pruned | summary: A1 | | @ changeset: 1:471f378eab4c |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: rewritten using amend as 2:fdf9bde5129a | obsolete: rewritten using amend as 3:65b757b745b9 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Test templates with splitted and pruned commit ============================================== $ hg init $TESTTMP/templates-local-split-prune $ cd $TESTTMP/templates-local-split-prune $ mkcommit ROOT $ echo 42 >> a $ echo 43 >> b $ hg commit -A -m "A0" adding a adding b $ hg log --hidden -G @ changeset: 1:471597cad322 | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT # Simulate split $ hg up -r "desc(ROOT)" 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo 42 >> a $ hg commit -A -m "A1" adding a created new head $ echo 43 >> b $ hg commit -A -m "A2" adding b $ hg debugobsolete `getid "1"` `getid "2"` `getid "3"` obsoleted 1 changesets # Simulate prune $ hg debugobsolete --record-parent `getid "."` obsoleted 1 changesets $ hg log --hidden -G @ changeset: 3:0d0ef4bdf70e | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: pruned | summary: A2 | o changeset: 2:617adc3a144c | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A1 | | x changeset: 1:471597cad322 |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: split as 2:617adc3a144c, 3:0d0ef4bdf70e | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT Check templates --------------- $ hg up 'desc("A0")' --hidden updating to a hidden changeset 471597cad322 (hidden revision '471597cad322' is pruned) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved # todo: the obsfate output is not ideal $ hg fatelog o 617adc3a144c | | @ 471597cad322 |/ Obsfate: pruned; o ea207398892e $ hg up -r 'desc("A2")' --hidden updating to a hidden changeset 0d0ef4bdf70e (hidden revision '0d0ef4bdf70e' is pruned) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg fatelog --hidden @ 0d0ef4bdf70e | Obsfate: pruned by test (at 1970-01-01 00:00 +0000); o 617adc3a144c | | x 471597cad322 |/ Obsfate: split as 2:617adc3a144c, 3:0d0ef4bdf70e by test (at 1970-01-01 00:00 +0000); o ea207398892e Check other fatelog implementations ----------------------------------- $ hg fatelogkw --hidden -q @ 0d0ef4bdf70e | Obsfate: pruned o 617adc3a144c | | x 471597cad322 |/ Obsfate: split as 2:617adc3a144c, 3:0d0ef4bdf70e o ea207398892e $ hg fatelogkw --hidden @ 0d0ef4bdf70e | Obsfate: pruned o 617adc3a144c | | x 471597cad322 |/ Obsfate: split as 2:617adc3a144c, 3:0d0ef4bdf70e o ea207398892e $ hg fatelogkw --hidden -v @ 0d0ef4bdf70e | Obsfate: pruned by test (at 1970-01-01 00:00 +0000) o 617adc3a144c | | x 471597cad322 |/ Obsfate: split as 2:617adc3a144c, 3:0d0ef4bdf70e by test (at 1970-01-01 00:00 +0000) o ea207398892e $ hg log -G -T "default" --hidden @ changeset: 3:0d0ef4bdf70e | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: pruned | summary: A2 | o changeset: 2:617adc3a144c | parent: 0:ea207398892e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A1 | | x changeset: 1:471597cad322 |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | obsolete: split as 2:617adc3a144c, 3:0d0ef4bdf70e | summary: A0 | o changeset: 0:ea207398892e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: ROOT mercurial-4.5.3/tests/test-install.t0000644015407300116100000002132613261161234017353 0ustar augieeng00000000000000hg debuginstall $ hg debuginstall checking encoding (ascii)... checking Python executable (*) (glob) checking Python version (2.*) (glob) checking Python lib (*lib*)... (glob) checking Python security support (*) (glob) TLS 1.2 not supported by Python install; network connections lack modern security (?) SNI not supported by Python install; may have connectivity issues with some servers (?) checking Mercurial version (*) (glob) checking Mercurial custom build (*) (glob) checking module policy (*) (glob) checking installed modules (*mercurial)... (glob) checking registered compression engines (*zlib*) (glob) checking available compression engines (*zlib*) (glob) checking available compression engines for wire protocol (*zlib*) (glob) checking "re2" regexp engine \((available|missing)\) (re) checking templates (*mercurial?templates)... (glob) checking default template (*mercurial?templates?map-cmdline.default) (glob) checking commit editor... (* -c "import sys; sys.exit(0)") (glob) checking username (test) no problems detected hg debuginstall JSON $ hg debuginstall -Tjson | sed 's|\\\\|\\|g' [ { "compengines": ["bz2", "bz2truncated", "none", "zlib"*], (glob) "compenginesavail": ["bz2", "bz2truncated", "none", "zlib"*], (glob) "compenginesserver": [*"zlib"*], (glob) "defaulttemplate": "*mercurial?templates?map-cmdline.default", (glob) "defaulttemplateerror": null, "defaulttemplatenotfound": "default", "editor": "* -c \"import sys; sys.exit(0)\"", (glob) "editornotfound": false, "encoding": "ascii", "encodingerror": null, "extensionserror": null, (no-pure !) "hgmodulepolicy": "*", (glob) "hgmodules": "*mercurial", (glob) "hgver": "*", (glob) "hgverextra": "*", (glob) "problems": 0, "pythonexe": "*", (glob) "pythonlib": "*", (glob) "pythonsecurity": [*], (glob) "pythonver": "*.*.*", (glob) "re2": (true|false), (re) "templatedirs": "*mercurial?templates", (glob) "username": "test", "usernameerror": null, "vinotfound": false } ] hg debuginstall with no username $ HGUSER= hg debuginstall checking encoding (ascii)... checking Python executable (*) (glob) checking Python version (2.*) (glob) checking Python lib (*lib*)... (glob) checking Python security support (*) (glob) TLS 1.2 not supported by Python install; network connections lack modern security (?) SNI not supported by Python install; may have connectivity issues with some servers (?) checking Mercurial version (*) (glob) checking Mercurial custom build (*) (glob) checking module policy (*) (glob) checking installed modules (*mercurial)... (glob) checking registered compression engines (*zlib*) (glob) checking available compression engines (*zlib*) (glob) checking available compression engines for wire protocol (*zlib*) (glob) checking "re2" regexp engine \((available|missing)\) (re) checking templates (*mercurial?templates)... (glob) checking default template (*mercurial?templates?map-cmdline.default) (glob) checking commit editor... (* -c "import sys; sys.exit(0)") (glob) checking username... no username supplied (specify a username in your configuration file) 1 problems detected, please check your install! [1] hg debuginstall with invalid encoding $ HGENCODING=invalidenc hg debuginstall | grep encoding checking encoding (invalidenc)... unknown encoding: invalidenc exception message in JSON $ HGENCODING=invalidenc HGUSER= hg debuginstall -Tjson | grep error "defaulttemplateerror": null, "encodingerror": "unknown encoding: invalidenc", "extensionserror": null, (no-pure !) "usernameerror": "no username supplied", path variables are expanded (~ is the same as $TESTTMP) $ mkdir tools $ touch tools/testeditor.exe #if execbit $ chmod 755 tools/testeditor.exe #endif $ HGEDITOR="~/tools/testeditor.exe" hg debuginstall checking encoding (ascii)... checking Python executable (*) (glob) checking Python version (*) (glob) checking Python lib (*lib*)... (glob) checking Python security support (*) (glob) TLS 1.2 not supported by Python install; network connections lack modern security (?) SNI not supported by Python install; may have connectivity issues with some servers (?) checking Mercurial version (*) (glob) checking Mercurial custom build (*) (glob) checking module policy (*) (glob) checking installed modules (*mercurial)... (glob) checking registered compression engines (*zlib*) (glob) checking available compression engines (*zlib*) (glob) checking available compression engines for wire protocol (*zlib*) (glob) checking "re2" regexp engine \((available|missing)\) (re) checking templates (*mercurial?templates)... (glob) checking default template (*mercurial?templates?map-cmdline.default) (glob) checking commit editor... ($TESTTMP/tools/testeditor.exe) checking username (test) no problems detected #if test-repo $ . "$TESTDIR/helpers-testrepo.sh" $ cat >> wixxml.py << EOF > import os, subprocess, sys > import xml.etree.ElementTree as ET > > # MSYS mangles the path if it expands $TESTDIR > testdir = os.environ['TESTDIR'] > ns = {'wix' : 'http://schemas.microsoft.com/wix/2006/wi'} > > def directory(node, relpath): > '''generator of files in the xml node, rooted at relpath''' > dirs = node.findall('./{%(wix)s}Directory' % ns) > > for d in dirs: > for subfile in directory(d, relpath + d.attrib['Name'] + '/'): > yield subfile > > files = node.findall('./{%(wix)s}Component/{%(wix)s}File' % ns) > > for f in files: > yield relpath + f.attrib['Name'] > > def hgdirectory(relpath): > '''generator of tracked files, rooted at relpath''' > hgdir = "%s/../mercurial" % (testdir) > args = ['hg', '--cwd', hgdir, 'files', relpath] > proc = subprocess.Popen(args, stdout=subprocess.PIPE, > stderr=subprocess.PIPE) > output = proc.communicate()[0] > > slash = '/' > for line in output.splitlines(): > if os.name == 'nt': > yield line.replace(os.sep, slash) > else: > yield line > > tracked = [f for f in hgdirectory(sys.argv[1])] > > xml = ET.parse("%s/../contrib/wix/%s.wxs" % (testdir, sys.argv[1])) > root = xml.getroot() > dir = root.find('.//{%(wix)s}DirectoryRef' % ns) > > installed = [f for f in directory(dir, '')] > > print('Not installed:') > for f in sorted(set(tracked) - set(installed)): > print(' %s' % f) > > print('Not tracked:') > for f in sorted(set(installed) - set(tracked)): > print(' %s' % f) > EOF $ ( testrepohgenv; $PYTHON wixxml.py help ) Not installed: help/common.txt help/hg-ssh.8.txt help/hg.1.txt help/hgignore.5.txt help/hgrc.5.txt Not tracked: $ ( testrepohgenv; $PYTHON wixxml.py templates ) Not installed: Not tracked: #endif #if virtualenv Verify that Mercurial is installable with pip. Note that this MUST be the last test in this file, because we do some nasty things to the shell environment in order to make the virtualenv work reliably. $ cd $TESTTMP Note: --no-site-packages is deprecated, but some places have an ancient virtualenv from their linux distro or similar and it's not yet the default for them. $ unset PYTHONPATH $ $PYTHON -m virtualenv --no-site-packages --never-download installenv >> pip.log Note: we use this weird path to run pip and hg to avoid platform differences, since it's bin on most platforms but Scripts on Windows. $ ./installenv/*/pip install --no-index $TESTDIR/.. >> pip.log $ ./installenv/*/hg debuginstall || cat pip.log checking encoding (ascii)... checking Python executable (*) (glob) checking Python version (2.*) (glob) checking Python lib (*)... (glob) checking Python security support (*) (glob) TLS 1.2 not supported by Python install; network connections lack modern security (?) SNI not supported by Python install; may have connectivity issues with some servers (?) checking Mercurial version (*) (glob) checking Mercurial custom build (*) (glob) checking module policy (*) (glob) checking installed modules (*/mercurial)... (glob) checking registered compression engines (*) (glob) checking available compression engines (*) (glob) checking available compression engines for wire protocol (*) (glob) checking "re2" regexp engine \((available|missing)\) (re) checking templates ($TESTTMP/installenv/*/site-packages/mercurial/templates)... (glob) checking default template ($TESTTMP/installenv/*/site-packages/mercurial/templates/map-cmdline.default) (glob) checking commit editor... (*) (glob) checking username (test) no problems detected #endif mercurial-4.5.3/tests/test-convert-cvs-branch.t0000644015407300116100000000654213261161234021414 0ustar augieeng00000000000000#require cvs This is https://bz.mercurial-scm.org/1148 and https://bz.mercurial-scm.org/1447 $ cvscall() > { > cvs -f "$@" > /dev/null > } $ cat <> $HGRCPATH > [extensions] > convert = > [convert] > cvsps.cache = 0 > EOF create cvs repository $ mkdir cvsrepo $ cd cvsrepo $ CVSROOT=`pwd` $ export CVSROOT $ CVS_OPTIONS=-f $ export CVS_OPTIONS $ cd .. $ rmdir cvsrepo $ cvscall -q -d "$CVSROOT" init Create a new project $ mkdir src $ cd src $ echo "1" > a $ echo "1" > b $ cvscall import -m "init" src v0 r0 | sort $ cd .. $ cvscall co src cvs checkout: Updating src $ cd src Branch the project $ cvscall tag -b BRANCH cvs tag: Tagging . $ cvscall up -r BRANCH > /dev/null cvs update: Updating . Modify file a, then b, then a $ sleep 1 $ echo "2" > a $ cvscall ci -m "mod a" cvs commit: Examining . $ echo "2" > b $ cvscall ci -m "mod b" cvs commit: Examining . $ sleep 1 $ echo "3" > a $ cvscall ci -m "mod a again" cvs commit: Examining . Convert $ cd .. $ hg convert src assuming destination src-hg initializing destination src-hg repository connecting to $TESTTMP/cvsrepo scanning source... collecting CVS rlog 7 log entries creating changesets 5 changeset entries sorting... converting... 4 Initial revision 3 init 2 mod a 1 mod b 0 mod a again updating tags Check the result $ hg -R src-hg log -G --template '{rev} ({branches}) {desc} files: {files}\n' o 5 () update tags files: .hgtags | | o 4 (BRANCH) mod a again files: a | | | o 3 (BRANCH) mod b files: b | | | o 2 (BRANCH) mod a files: a | | | o 1 (v0) init files: |/ o 0 () Initial revision files: a b issue 1447 $ cvscall() > { > cvs -f "$@" > /dev/null > sleep 1 > } $ cvsci() > { > cvs -f ci "$@" >/dev/null > sleep 1 > } $ cvscall -Q -d `pwd`/cvsmaster2 init $ cd cvsmaster2 $ CVSROOT=`pwd` $ export CVSROOT $ mkdir foo $ cd .. $ cvscall -Q co -d cvswork2 foo $ cd cvswork2 $ echo foo > a.txt $ echo bar > b.txt $ cvscall -Q add a.txt b.txt $ cvsci -m "Initial commit" cvs commit: Examining . $ echo foo > b.txt $ cvsci -m "Fix b on HEAD" cvs commit: Examining . $ echo bar > a.txt $ cvsci -m "Small fix in a on HEAD" cvs commit: Examining . $ cvscall -Q tag -b BRANCH $ cvscall -Q up -P -rBRANCH $ echo baz > b.txt $ cvsci -m "Change on BRANCH in b" cvs commit: Examining . $ hg debugcvsps -x --parents foo collecting CVS rlog 5 log entries creating changesets 4 changeset entries --------------------- PatchSet 1 Date: * (glob) Author: * (glob) Branch: HEAD Tag: (none) Log: Initial commit Members: a.txt:INITIAL->1.1 b.txt:INITIAL->1.1 --------------------- PatchSet 2 Date: * (glob) Author: * (glob) Branch: HEAD Tag: (none) Branchpoints: BRANCH Parent: 1 Log: Fix b on HEAD Members: b.txt:1.1->1.2 --------------------- PatchSet 3 Date: * (glob) Author: * (glob) Branch: HEAD Tag: (none) Branchpoints: BRANCH Parent: 2 Log: Small fix in a on HEAD Members: a.txt:1.1->1.2 --------------------- PatchSet 4 Date: * (glob) Author: * (glob) Branch: BRANCH Tag: (none) Parent: 3 Log: Change on BRANCH in b Members: b.txt:1.2->1.2.2.1 $ cd .. mercurial-4.5.3/tests/test-dispatch.py.out0000644015407300116100000000074113261161234020475 0ustar augieeng00000000000000running: init test1 result: None running: add foo result: 0 running: commit -m commit1 -d 2000-01-01 foo result: None running: commit -m commit2 -d 2000-01-02 foo result: None running: log -r 0 changeset: 0:0e4634943879 user: test date: Sat Jan 01 00:00:00 2000 +0000 summary: commit1 result: None running: log -r tip changeset: 1:45589e459b2e tag: tip user: test date: Sun Jan 02 00:00:00 2000 +0000 summary: commit2 result: None mercurial-4.5.3/tests/test-worker.t0000644015407300116100000000604213261161234017214 0ustar augieeng00000000000000Test UI worker interaction $ cat > t.py < from __future__ import absolute_import, print_function > import time > from mercurial import ( > error, > registrar, > ui as uimod, > worker, > ) > def abort(ui, args): > if args[0] == 0: > # by first worker for test stability > raise error.Abort('known exception') > return runme(ui, []) > def exc(ui, args): > if args[0] == 0: > # by first worker for test stability > raise Exception('unknown exception') > return runme(ui, []) > def runme(ui, args): > for arg in args: > ui.status('run\n') > yield 1, arg > time.sleep(0.1) # easier to trigger killworkers code path > functable = { > 'abort': abort, > 'exc': exc, > 'runme': runme, > } > cmdtable = {} > command = registrar.command(cmdtable) > @command(b'test', [], 'hg test [COST] [FUNC]') > def t(ui, repo, cost=1.0, func='runme'): > cost = float(cost) > func = functable[func] > ui.status('start\n') > runs = worker.worker(ui, cost, func, (ui,), range(8)) > for n, i in runs: > pass > ui.status('done\n') > EOF $ abspath=`pwd`/t.py $ hg init Run tests with worker enable by forcing a heigh cost $ hg --config "extensions.t=$abspath" test 100000.0 start run run run run run run run run done Run tests without worker by forcing a low cost $ hg --config "extensions.t=$abspath" test 0.0000001 start run run run run run run run run done #if no-windows Known exception should be caught, but printed if --traceback is enabled $ hg --config "extensions.t=$abspath" --config 'worker.numcpus=8' \ > test 100000.0 abort 2>&1 start abort: known exception [255] $ hg --config "extensions.t=$abspath" --config 'worker.numcpus=8' \ > test 100000.0 abort --traceback 2>&1 | egrep '^(SystemExit|Abort)' Abort: known exception SystemExit: 255 Traceback must be printed for unknown exceptions $ hg --config "extensions.t=$abspath" --config 'worker.numcpus=8' \ > test 100000.0 exc 2>&1 | grep '^Exception' Exception: unknown exception Workers should not do cleanups in all cases $ cat > $TESTTMP/detectcleanup.py < from __future__ import absolute_import > import atexit > import os > import time > oldfork = os.fork > count = 0 > parentpid = os.getpid() > def delayedfork(): > global count > count += 1 > pid = oldfork() > # make it easier to test SIGTERM hitting other workers when they have > # not set up error handling yet. > if count > 1 and pid == 0: > time.sleep(0.1) > return pid > os.fork = delayedfork > def cleanup(): > if os.getpid() != parentpid: > os.write(1, 'should never happen\n') > atexit.register(cleanup) > EOF $ hg --config "extensions.t=$abspath" --config worker.numcpus=8 --config \ > "extensions.d=$TESTTMP/detectcleanup.py" test 100000 abort start abort: known exception [255] #endif mercurial-4.5.3/tests/test-exchange-obsmarkers-case-A2.t0000644015407300116100000000766013261161234023013 0ustar augieeng00000000000000============================================ Testing obsolescence markers push: Cases A.2 ============================================ Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of all changesets that requested to be "in sync" after the push (even if they are already on both side). This test belongs to a series of tests checking such set is properly computed and applied. This does not tests "obsmarkers" discovery capabilities. Category A: simple cases TestCase 2: Two heads, only one of them pushed A.2 Two heads, only on of then pushed ===================================== .. {{{ .. ⇠○ B .. ⇠◔ | A .. |/ .. ◠O .. }}} .. .. Markers exist from: .. .. * A .. * B .. .. .. Command runs: .. .. * hg push -r A .. .. Expected exchange: .. .. * chain from A .. .. Expected Exclude: .. .. * chain from B Setup ----- $ . $TESTDIR/testlib/exchange-obsmarker-util.sh initial $ setuprepos A.2 creating test repo for test case A.2 - pulldest - main - pushdest cd into `main` and proceed with env setup $ cd main $ mkcommit A $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid 'desc(A)'` $ hg up '.~1' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit B created new head $ hg debugobsolete bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb `getid 'desc(B)'` $ hg log -G @ 35b183996678 (draft): B | | o f5bc6836db60 (draft): A |/ o a9bdc8b26820 (public): O $ inspect_obsmarkers obsstore content ================ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 35b1839966785d5703a01607229eea932db42f87 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ cd .. $ cd .. Actual Test ----------- $ dotest A.2 A ## Running testcase A.2 # testing echange of "A" (f5bc6836db60) ## initial state # obstore: main aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 35b1839966785d5703a01607229eea932db42f87 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest ## pushing "A" from main to pushdest pushing to pushdest searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files remote: 1 new obsolescence markers ## post push state # obstore: main aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 35b1839966785d5703a01607229eea932db42f87 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest ## pulling "f5bc6836db60" from main into pulldest pulling from main searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files 1 new obsolescence markers new changesets f5bc6836db60 (run 'hg update' to get a working copy) ## post pull state # obstore: main aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 35b1839966785d5703a01607229eea932db42f87 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ cd .. mercurial-4.5.3/tests/test-obsolete-bounds-checking.t0000644015407300116100000000227113261161234022560 0ustar augieeng00000000000000Create a repo, set the username to something more than 255 bytes, then run hg amend on it. $ unset HGUSER $ cat >> $HGRCPATH << EOF > [ui] > username = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > [extensions] > amend = > [experimental] > evolution.createmarkers=True > evolution.exchange=True > EOF $ hg init tmpa $ cd tmpa $ echo a > a $ hg add adding a $ hg commit -m "Initial commit" $ echo a >> a $ hg amend 2>&1 | egrep -v '^(\*\*| )' transaction abort! rollback completed Traceback (most recent call last): *ProgrammingError: obsstore metadata value cannot be longer than 255 bytes (value "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " for key "user" is 285 bytes) (glob) mercurial-4.5.3/tests/test-doctest.py0000644015407300116100000000504513261161234017537 0ustar augieeng00000000000000# this is hack to make sure no escape characters are inserted into the output from __future__ import absolute_import import doctest import os import re import sys ispy3 = (sys.version_info[0] >= 3) if 'TERM' in os.environ: del os.environ['TERM'] class py3docchecker(doctest.OutputChecker): def check_output(self, want, got, optionflags): want2 = re.sub(r'''\bu(['"])(.*?)\1''', r'\1\2\1', want) # py2: u'' got2 = re.sub(r'''\bb(['"])(.*?)\1''', r'\1\2\1', got) # py3: b'' # py3: : b'' -> : # : -> : got2 = re.sub(r'''^mercurial\.\w+\.(\w+): (['"])(.*?)\2''', r'\1: \3', got2, re.MULTILINE) got2 = re.sub(r'^mercurial\.\w+\.(\w+): ', r'\1: ', got2, re.MULTILINE) return any(doctest.OutputChecker.check_output(self, w, g, optionflags) for w, g in [(want, got), (want2, got2)]) def testmod(name, optionflags=0, testtarget=None): __import__(name) mod = sys.modules[name] if testtarget is not None: mod = getattr(mod, testtarget) # minimal copy of doctest.testmod() finder = doctest.DocTestFinder() checker = None if ispy3: checker = py3docchecker() runner = doctest.DocTestRunner(checker=checker, optionflags=optionflags) for test in finder.find(mod, name): runner.run(test) runner.summarize() testmod('mercurial.changegroup') testmod('mercurial.changelog') testmod('mercurial.color') testmod('mercurial.config') testmod('mercurial.context') testmod('mercurial.dagparser', optionflags=doctest.NORMALIZE_WHITESPACE) testmod('mercurial.dispatch') testmod('mercurial.encoding') testmod('mercurial.fancyopts') testmod('mercurial.formatter') testmod('mercurial.hg') testmod('mercurial.hgweb.hgwebdir_mod') testmod('mercurial.match') testmod('mercurial.mdiff') testmod('mercurial.minirst') testmod('mercurial.patch') testmod('mercurial.pathutil') testmod('mercurial.parser') testmod('mercurial.pycompat') testmod('mercurial.revsetlang') testmod('mercurial.smartset') testmod('mercurial.store') testmod('mercurial.subrepo') testmod('mercurial.templatefilters') testmod('mercurial.templater') testmod('mercurial.ui') testmod('mercurial.url') testmod('mercurial.util') testmod('mercurial.util', testtarget='platform') testmod('hgext.convert.convcmd') testmod('hgext.convert.cvsps') testmod('hgext.convert.filemap') testmod('hgext.convert.p4') testmod('hgext.convert.subversion') testmod('hgext.mq') # Helper scripts in tests/ that have doctests: testmod('drawdag') mercurial-4.5.3/tests/test-permissions.t0000644015407300116100000000243313261161234020256 0ustar augieeng00000000000000#require unix-permissions no-root $ hg init t $ cd t $ echo foo > a $ hg add a $ hg commit -m "1" $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 1 changesets, 1 total revisions $ chmod -r .hg/store/data/a.i $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files abort: Permission denied: $TESTTMP/t/.hg/store/data/a.i [255] $ chmod +r .hg/store/data/a.i $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 1 changesets, 1 total revisions $ chmod -w .hg/store/data/a.i $ echo barber > a $ hg commit -m "2" trouble committing a! abort: Permission denied: $TESTTMP/t/.hg/store/data/a.i [255] $ chmod -w . $ hg diff --nodates diff -r 2a18120dc1c9 a --- a/a +++ b/a @@ -1,1 +1,1 @@ -foo +barber $ chmod +w . $ chmod +w .hg/store/data/a.i $ mkdir dir $ touch dir/a $ hg status M a ? dir/a $ chmod -rx dir #if no-fsmonitor (fsmonitor makes "hg status" avoid accessing to "dir") $ hg status dir: Permission denied M a #endif Reenable perm to allow deletion: $ chmod +rx dir $ cd .. mercurial-4.5.3/tests/test-check-module-imports.t0000644015407300116100000000274313261161234021742 0ustar augieeng00000000000000#require test-repo $ . "$TESTDIR/helpers-testrepo.sh" $ import_checker="$TESTDIR"/../contrib/import-checker.py $ cd "$TESTDIR"/.. There are a handful of cases here that require renaming a module so it doesn't overlap with a stdlib module name. There are also some cycles here that we should still endeavor to fix, and some cycles will be hidden by deduplication algorithm in the cycle detector, so fixing these may expose other cycles. Known-bad files are excluded by -X as some of them would produce unstable outputs, which should be fixed later. $ testrepohg locate 'set:**.py or grep(r"^#!.*?python")' \ > 'tests/**.t' \ > -X hgweb.cgi \ > -X setup.py \ > -X contrib/debugshell.py \ > -X contrib/hgweb.fcgi \ > -X contrib/python-zstandard/ \ > -X contrib/win32/hgwebdir_wsgi.py \ > -X doc/gendoc.py \ > -X doc/hgmanpage.py \ > -X i18n/posplit \ > -X mercurial/thirdparty \ > -X tests/hypothesishelpers.py \ > -X tests/test-commit-interactive.t \ > -X tests/test-contrib-check-code.t \ > -X tests/test-demandimport.py \ > -X tests/test-extension.t \ > -X tests/test-hghave.t \ > -X tests/test-hgweb-auth.py \ > -X tests/test-hgweb-no-path-info.t \ > -X tests/test-hgweb-no-request-uri.t \ > -X tests/test-hgweb-non-interactive.t \ > -X tests/test-hook.t \ > -X tests/test-import.t \ > -X tests/test-imports-checker.t \ > -X tests/test-lock.py \ > -X tests/test-verify-repo-operations.py \ > | sed 's-\\-/-g' | $PYTHON "$import_checker" - mercurial-4.5.3/tests/test-push-checkheads-unpushed-D3.t0000644015407300116100000000551713261161234023045 0ustar augieeng00000000000000==================================== Testing head checking code: Case D-3 ==================================== Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This case is part of a series of tests checking this behavior. Category D: remote head is "obs-affected" locally, but result is not part of the push TestCase 3: multi-changeset branch, split on multiple new others, only one of them is pushed .. old-state: .. .. * 2 changesets branch .. .. new-state: .. .. * 2 new branches, each superseding one changeset in the old one. .. .. expected-result: .. .. * pushing only one of the resulting branch (either of them) .. * push denied .. .. graph-summary: .. .. B'◔⇢ø B .. | | .. A | ø⇠◔ A' .. | |/ .. \| .. ◠$ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir D3 $ cd D3 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd server $ mkcommit B0 $ hg up 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ cd ../client $ hg pull pulling from $TESTTMP/D3/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets d73caddc5533 (run 'hg update' to get a working copy) $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit A1 created new head $ hg up '0' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit B1 created new head $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` obsoleted 1 changesets $ hg log -G --hidden @ 25c56d33e4c4 (draft): B1 | | o f6082bc4ffef (draft): A1 |/ | x d73caddc5533 (draft): B0 | | | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): root Actual testing -------------- $ hg push --rev 'desc(A1)' pushing to $TESTTMP/D3/server searching for changes abort: push creates new remote head f6082bc4ffef! (merge or see 'hg help push' for details about pushing new heads) [255] $ hg push --rev 'desc(B1)' pushing to $TESTTMP/D3/server searching for changes abort: push creates new remote head 25c56d33e4c4! (merge or see 'hg help push' for details about pushing new heads) [255] Extra testing ------------- In this case, even a bare push is creating more heads $ hg push pushing to $TESTTMP/D3/server searching for changes abort: push creates new remote head 25c56d33e4c4! (merge or see 'hg help push' for details about pushing new heads) [255] $ cd ../.. mercurial-4.5.3/tests/test-patch-offset.t0000644015407300116100000000321013261161234020260 0ustar augieeng00000000000000 $ cat > writepatterns.py < import sys > > path = sys.argv[1] > patterns = sys.argv[2:] > > fp = file(path, 'wb') > for pattern in patterns: > count = int(pattern[0:-1]) > char = pattern[-1] + '\n' > fp.write(char*count) > fp.close() > EOF prepare repo $ hg init a $ cd a These initial lines of Xs were not in the original file used to generate the patch. So all the patch hunks need to be applied to a constant offset within this file. If the offset isn't tracked then the hunks can be applied to the wrong lines of this file. $ $PYTHON ../writepatterns.py a 34X 10A 1B 10A 1C 10A 1B 10A 1D 10A 1B 10A 1E 10A 1B 10A $ hg commit -Am adda adding a This is a cleaner patch generated via diff In this case it reproduces the problem when the output of hg export does not import patch $ hg import -v -m 'b' -d '2 0' - < --- a/a 2009-12-08 19:26:17.000000000 -0800 > +++ b/a 2009-12-08 19:26:17.000000000 -0800 > @@ -9,7 +9,7 @@ > A > A > B > -A > +a > A > A > A > @@ -53,7 +53,7 @@ > A > A > B > -A > +a > A > A > A > @@ -75,7 +75,7 @@ > A > A > B > -A > +a > A > A > A > EOF applying patch from stdin patching file a Hunk #1 succeeded at 43 (offset 34 lines). Hunk #2 succeeded at 87 (offset 34 lines). Hunk #3 succeeded at 109 (offset 34 lines). committing files: a committing manifest committing changelog created 189885cecb41 compare imported changes against reference file $ $PYTHON ../writepatterns.py aref 34X 10A 1B 1a 9A 1C 10A 1B 10A 1D 10A 1B 1a 9A 1E 10A 1B 1a 9A $ diff aref a $ cd .. mercurial-4.5.3/tests/test-revlog-raw.py.out0000644015407300116100000000012613261161234020760 0ustar augieeng00000000000000local test passed addgroupcopy test passed clone test passed lowlevelcopy test passed mercurial-4.5.3/tests/test-check-shbang.t0000644015407300116100000000144113261161234020216 0ustar augieeng00000000000000#require test-repo $ . "$TESTDIR/helpers-testrepo.sh" $ cd "`dirname "$TESTDIR"`" look for python scripts that do not use /usr/bin/env $ testrepohg files 'set:grep(r"^#!.*?python") and not grep(r"^#!/usr/bi{1}n/env python") - **/*.t' [1] In tests, enforce $PYTHON and *not* /usr/bin/env python or similar: $ testrepohg files 'set:grep(r"#!.*?python") and **/*.t' \ > -X tests/test-check-execute.t \ > -X tests/test-check-module-imports.t \ > -X tests/test-check-pyflakes.t \ > -X tests/test-check-shbang.t [1] The above exclusions are because they're looking for files that contain Python but don't end in .py - please avoid adding more. look for shell scripts that do not use /bin/sh $ testrepohg files 'set:grep(r"^#!.*/bi{1}n/sh") and not grep(r"^#!/bi{1}n/sh")' [1] mercurial-4.5.3/tests/tinyproxy.py0000755015407300116100000001432713261161234017210 0ustar augieeng00000000000000#!/usr/bin/env python from __future__ import absolute_import, print_function __doc__ = """Tiny HTTP Proxy. This module implements GET, HEAD, POST, PUT and DELETE methods on BaseHTTPServer, and behaves as an HTTP proxy. The CONNECT method is also implemented experimentally, but has not been tested yet. Any help will be greatly appreciated. SUZUKI Hisao """ __version__ = "0.2.1" import optparse import os import select import socket import sys from mercurial import util httpserver = util.httpserver socketserver = util.socketserver urlreq = util.urlreq if os.environ.get('HGIPV6', '0') == '1': family = socket.AF_INET6 else: family = socket.AF_INET class ProxyHandler (httpserver.basehttprequesthandler): __base = httpserver.basehttprequesthandler __base_handle = __base.handle server_version = "TinyHTTPProxy/" + __version__ rbufsize = 0 # self.rfile Be unbuffered def handle(self): (ip, port) = self.client_address allowed = getattr(self, 'allowed_clients', None) if allowed is not None and ip not in allowed: self.raw_requestline = self.rfile.readline() if self.parse_request(): self.send_error(403) else: self.__base_handle() def log_request(self, code='-', size='-'): xheaders = [h for h in self.headers.items() if h[0].startswith('x-')] self.log_message('"%s" %s %s%s', self.requestline, str(code), str(size), ''.join([' %s:%s' % h for h in sorted(xheaders)])) # Flush for Windows, so output isn't lost on TerminateProcess() sys.stdout.flush() sys.stderr.flush() def _connect_to(self, netloc, soc): i = netloc.find(':') if i >= 0: host_port = netloc[:i], int(netloc[i + 1:]) else: host_port = netloc, 80 print("\t" "connect to %s:%d" % host_port) try: soc.connect(host_port) except socket.error as arg: try: msg = arg[1] except (IndexError, TypeError): msg = arg self.send_error(404, msg) return 0 return 1 def do_CONNECT(self): soc = socket.socket(family, socket.SOCK_STREAM) try: if self._connect_to(self.path, soc): self.log_request(200) self.wfile.write(self.protocol_version + " 200 Connection established\r\n") self.wfile.write("Proxy-agent: %s\r\n" % self.version_string()) self.wfile.write("\r\n") self._read_write(soc, 300) finally: print("\t" "bye") soc.close() self.connection.close() def do_GET(self): (scm, netloc, path, params, query, fragment) = urlreq.urlparse( self.path, 'http') if scm != 'http' or fragment or not netloc: self.send_error(400, "bad url %s" % self.path) return soc = socket.socket(family, socket.SOCK_STREAM) try: if self._connect_to(netloc, soc): self.log_request() soc.send("%s %s %s\r\n" % ( self.command, urlreq.urlunparse(('', '', path, params, query, '')), self.request_version)) self.headers['Connection'] = 'close' del self.headers['Proxy-Connection'] for key_val in self.headers.items(): soc.send("%s: %s\r\n" % key_val) soc.send("\r\n") self._read_write(soc) finally: print("\t" "bye") soc.close() self.connection.close() def _read_write(self, soc, max_idling=20): iw = [self.connection, soc] ow = [] count = 0 while True: count += 1 (ins, _, exs) = select.select(iw, ow, iw, 3) if exs: break if ins: for i in ins: if i is soc: out = self.connection else: out = soc try: data = i.recv(8192) except socket.error: break if data: out.send(data) count = 0 else: print("\t" "idle", count) if count == max_idling: break do_HEAD = do_GET do_POST = do_GET do_PUT = do_GET do_DELETE = do_GET class ThreadingHTTPServer (socketserver.ThreadingMixIn, httpserver.httpserver): def __init__(self, *args, **kwargs): httpserver.httpserver.__init__(self, *args, **kwargs) a = open("proxy.pid", "w") a.write(str(os.getpid()) + "\n") a.close() def runserver(port=8000, bind=""): server_address = (bind, port) ProxyHandler.protocol_version = "HTTP/1.0" httpd = ThreadingHTTPServer(server_address, ProxyHandler) sa = httpd.socket.getsockname() print("Serving HTTP on", sa[0], "port", sa[1], "...") try: httpd.serve_forever() except KeyboardInterrupt: print("\nKeyboard interrupt received, exiting.") httpd.server_close() sys.exit(0) if __name__ == '__main__': argv = sys.argv if argv[1:] and argv[1] in ('-h', '--help'): print(argv[0], "[port [allowed_client_name ...]]") else: if argv[2:]: allowed = [] for name in argv[2:]: client = socket.gethostbyname(name) allowed.append(client) print("Accept: %s (%s)" % (client, name)) ProxyHandler.allowed_clients = allowed del argv[2:] else: print("Any clients will be served...") parser = optparse.OptionParser() parser.add_option('-b', '--bind', metavar='ADDRESS', help='Specify alternate bind address ' '[default: all interfaces]', default='') (options, args) = parser.parse_args() port = 8000 if len(args) == 1: port = int(args[0]) runserver(port, options.bind) mercurial-4.5.3/tests/test-dispatch.t0000644015407300116100000001353613261161234017510 0ustar augieeng00000000000000test command parsing and dispatch $ hg init a $ cd a Redundant options used to crash (issue436): $ hg -v log -v $ hg -v log -v x $ echo a > a $ hg ci -Ama adding a Missing arg: $ hg cat hg cat: invalid arguments hg cat [OPTION]... FILE... output the current or given revision of files options ([+] can be repeated): -o --output FORMAT print output to file with formatted name -r --rev REV print the given revision --decode apply any matching decode filter -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns (use 'hg cat -h' to show more help) [255] Missing parameter for early option: $ hg log -R 2>&1 | grep 'hg log' hg log: option -R requires argument hg log [OPTION]... [FILE] (use 'hg log -h' to show more help) "--" may be an option value: $ hg -R -- log abort: repository -- not found! [255] $ hg log -R -- abort: repository -- not found! [255] $ hg log -T -- -- (no-eol) $ hg log -T -- -k nomatch Parsing of early options should stop at "--": $ hg cat -- --config=hooks.pre-cat=false --config=hooks.pre-cat=false: no such file in rev cb9a9f314b8b [1] $ hg cat -- --debugger --debugger: no such file in rev cb9a9f314b8b [1] Unparsable form of early options: $ hg cat --debugg abort: option --debugger may not be abbreviated! [255] Parsing failure of early options should be detected before executing the command: $ hg log -b '--config=hooks.pre-log=false' default abort: option --config may not be abbreviated! [255] $ hg log -b -R. default abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo! [255] $ hg log --cwd .. -b --cwd=. default abort: option --cwd may not be abbreviated! [255] However, we can't prevent it from loading extensions and configs: $ cat < bad.py > raise Exception('bad') > EOF $ hg log -b '--config=extensions.bad=bad.py' default *** failed to import extension bad from bad.py: bad abort: option --config may not be abbreviated! [255] $ mkdir -p badrepo/.hg $ echo 'invalid-syntax' > badrepo/.hg/hgrc $ hg log -b -Rbadrepo default hg: parse error at badrepo/.hg/hgrc:1: invalid-syntax [255] $ hg log -b --cwd=inexistent default abort: $ENOENT$: 'inexistent' [255] $ hg log -b '--config=ui.traceback=yes' 2>&1 | grep '^Traceback' Traceback (most recent call last): $ hg log -b '--config=profiling.enabled=yes' 2>&1 | grep -i sample Sample count: .*|No samples recorded\. (re) Early options can't be specified in [aliases] and [defaults] because they are applied before the command name is resolved: $ hg log -b '--config=alias.log=log --config=hooks.pre-log=false' hg log: option -b not recognized error in definition for alias 'log': --config may only be given on the command line [255] $ hg log -b '--config=defaults.log=--config=hooks.pre-log=false' abort: option --config may not be abbreviated! [255] Shell aliases bypass any command parsing rules but for the early one: $ hg log -b '--config=alias.log=!echo howdy' howdy Early options must come first if HGPLAIN=+strictflags is specified: (BUG: chg cherry-picks early options to pass them as a server command) #if no-chg $ HGPLAIN=+strictflags hg log -b --config='hooks.pre-log=false' default abort: unknown revision '--config=hooks.pre-log=false'! [255] $ HGPLAIN=+strictflags hg log -b -R. default abort: unknown revision '-R.'! [255] $ HGPLAIN=+strictflags hg log -b --cwd=. default abort: unknown revision '--cwd=.'! [255] #endif $ HGPLAIN=+strictflags hg log -b --debugger default abort: unknown revision '--debugger'! [255] $ HGPLAIN=+strictflags hg log -b --config='alias.log=!echo pwned' default abort: unknown revision '--config=alias.log=!echo pwned'! [255] $ HGPLAIN=+strictflags hg log --config='hooks.pre-log=false' -b default abort: option --config may not be abbreviated! [255] $ HGPLAIN=+strictflags hg log -q --cwd=.. -b default abort: option --cwd may not be abbreviated! [255] $ HGPLAIN=+strictflags hg log -q -R . -b default abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo! [255] $ HGPLAIN=+strictflags hg --config='hooks.pre-log=false' log -b default abort: pre-log hook exited with status 1 [255] $ HGPLAIN=+strictflags hg --cwd .. -q -Ra log -b default 0:cb9a9f314b8b $ HGPLAIN=+strictflags hg --cwd .. -q --repository a log -b default 0:cb9a9f314b8b $ HGPLAIN=+strictflags hg --cwd .. -q --repo a log -b default 0:cb9a9f314b8b For compatibility reasons, HGPLAIN=+strictflags is not enabled by plain HGPLAIN: $ HGPLAIN= hg log --config='hooks.pre-log=false' -b default abort: pre-log hook exited with status 1 [255] $ HGPLAINEXCEPT= hg log --cwd .. -q -Ra -b default 0:cb9a9f314b8b [defaults] $ hg cat a a $ cat >> $HGRCPATH < [defaults] > cat = -r null > EOF $ hg cat a a: no such file in rev 000000000000 [1] $ cd "$TESTTMP" OSError "No such file or directory" / "The system cannot find the path specified" should include filename even when it is empty $ hg -R a archive '' abort: *: '' (glob) [255] #if no-outer-repo No repo: $ hg cat abort: no repository found in '$TESTTMP' (.hg not found)! [255] #endif #if rmcwd Current directory removed: $ mkdir $TESTTMP/repo1 $ cd $TESTTMP/repo1 $ rm -rf $TESTTMP/repo1 The output could be one of the following and something else: chg: abort: failed to getcwd (errno = *) (glob) abort: error getting current working directory: * (glob) sh: 0: getcwd() failed: $ENOENT$ Since the exact behavior depends on the shell, only check it returns non-zero. $ HGDEMANDIMPORT=disable hg version -q 2>/dev/null || false [1] #endif mercurial-4.5.3/tests/test-committer.t0000644015407300116100000000503013261161234017702 0ustar augieeng00000000000000 $ unset HGUSER $ EMAIL="My Name " $ export EMAIL $ hg init test $ cd test $ touch asdf $ hg add asdf $ hg commit -m commit-1 $ hg tip changeset: 0:53f268a58230 tag: tip user: My Name date: Thu Jan 01 00:00:00 1970 +0000 summary: commit-1 $ unset EMAIL $ echo 1234 > asdf $ hg commit -u "foo@bar.com" -m commit-1 $ hg tip changeset: 1:3871b2a9e9bf tag: tip user: foo@bar.com date: Thu Jan 01 00:00:00 1970 +0000 summary: commit-1 $ echo "[ui]" >> .hg/hgrc $ echo "username = foobar " >> .hg/hgrc $ echo 12 > asdf $ hg commit -m commit-1 $ hg tip changeset: 2:8eeac6695c1c tag: tip user: foobar date: Thu Jan 01 00:00:00 1970 +0000 summary: commit-1 $ echo 1 > asdf $ hg commit -u "foo@bar.com" -m commit-1 $ hg tip changeset: 3:957606a725e4 tag: tip user: foo@bar.com date: Thu Jan 01 00:00:00 1970 +0000 summary: commit-1 $ echo 123 > asdf $ echo "[ui]" > .hg/hgrc $ echo "username = " >> .hg/hgrc $ hg commit -m commit-1 abort: no username supplied (use 'hg config --edit' to set your username) [255] # test alternate config var $ echo 1234 > asdf $ echo "[ui]" > .hg/hgrc $ echo "user = Foo Bar II " >> .hg/hgrc $ hg commit -m commit-1 $ hg tip changeset: 4:6f24bfb4c617 tag: tip user: Foo Bar II date: Thu Jan 01 00:00:00 1970 +0000 summary: commit-1 # test prompt username $ cat > .hg/hgrc < [ui] > askusername = True > EOF $ echo 12345 > asdf $ hg commit --config ui.interactive=False -m ask enter a commit username: no username found, using '[^']*' instead (re) $ hg rollback -q $ hg commit --config ui.interactive=True -m ask < Asked User > EOF enter a commit username: Asked User $ hg tip changeset: 5:84c91d963b70 tag: tip user: Asked User date: Thu Jan 01 00:00:00 1970 +0000 summary: ask # test no .hg/hgrc (uses generated non-interactive username) $ echo space > asdf $ rm .hg/hgrc $ hg commit -m commit-1 2>&1 no username found, using '[^']*' instead (re) $ echo space2 > asdf $ hg commit -u ' ' -m commit-1 transaction abort! rollback completed abort: empty username! [255] # don't add tests here, previous test is unstable $ cd .. mercurial-4.5.3/tests/test-manifest.py0000644015407300116100000004147013261161234017702 0ustar augieeng00000000000000from __future__ import absolute_import import binascii import itertools import silenttestrunner import unittest from mercurial import ( manifest as manifestmod, match as matchmod, ) EMTPY_MANIFEST = b'' EMTPY_MANIFEST_V2 = b'\0\n' HASH_1 = b'1' * 40 BIN_HASH_1 = binascii.unhexlify(HASH_1) HASH_2 = b'f' * 40 BIN_HASH_2 = binascii.unhexlify(HASH_2) HASH_3 = b'1234567890abcdef0987654321deadbeef0fcafe' BIN_HASH_3 = binascii.unhexlify(HASH_3) A_SHORT_MANIFEST = ( b'bar/baz/qux.py\0%(hash2)s%(flag2)s\n' b'foo\0%(hash1)s%(flag1)s\n' ) % {b'hash1': HASH_1, b'flag1': b'', b'hash2': HASH_2, b'flag2': b'l', } # Same data as A_SHORT_MANIFEST A_SHORT_MANIFEST_V2 = ( b'\0\n' b'\x00bar/baz/qux.py\0%(flag2)s\n%(hash2)s\n' b'\x00foo\0%(flag1)s\n%(hash1)s\n' ) % {b'hash1': BIN_HASH_1, b'flag1': b'', b'hash2': BIN_HASH_2, b'flag2': b'l', } # Same data as A_SHORT_MANIFEST A_METADATA_MANIFEST = ( b'\0foo\0bar\n' b'\x00bar/baz/qux.py\0%(flag2)s\0foo\0bar\n%(hash2)s\n' # flag and metadata b'\x00foo\0%(flag1)s\0foo\n%(hash1)s\n' # no flag, but metadata ) % {b'hash1': BIN_HASH_1, b'flag1': b'', b'hash2': BIN_HASH_2, b'flag2': b'l', } A_STEM_COMPRESSED_MANIFEST = ( b'\0\n' b'\x00bar/baz/qux.py\0%(flag2)s\n%(hash2)s\n' b'\x04qux/foo.py\0%(flag1)s\n%(hash1)s\n' # simple case of 4 stem chars b'\x0az.py\0%(flag1)s\n%(hash1)s\n' # tricky newline = 10 stem characters b'\x00%(verylongdir)sx/x\0\n%(hash1)s\n' b'\xffx/y\0\n%(hash2)s\n' # more than 255 stem chars ) % {b'hash1': BIN_HASH_1, b'flag1': b'', b'hash2': BIN_HASH_2, b'flag2': b'l', b'verylongdir': 255 * b'x', } A_DEEPER_MANIFEST = ( b'a/b/c/bar.py\0%(hash3)s%(flag1)s\n' b'a/b/c/bar.txt\0%(hash1)s%(flag1)s\n' b'a/b/c/foo.py\0%(hash3)s%(flag1)s\n' b'a/b/c/foo.txt\0%(hash2)s%(flag2)s\n' b'a/b/d/baz.py\0%(hash3)s%(flag1)s\n' b'a/b/d/qux.py\0%(hash1)s%(flag2)s\n' b'a/b/d/ten.txt\0%(hash3)s%(flag2)s\n' b'a/b/dog.py\0%(hash3)s%(flag1)s\n' b'a/b/fish.py\0%(hash2)s%(flag1)s\n' b'a/c/london.py\0%(hash3)s%(flag2)s\n' b'a/c/paper.txt\0%(hash2)s%(flag2)s\n' b'a/c/paris.py\0%(hash2)s%(flag1)s\n' b'a/d/apple.py\0%(hash3)s%(flag1)s\n' b'a/d/pizza.py\0%(hash3)s%(flag2)s\n' b'a/green.py\0%(hash1)s%(flag2)s\n' b'a/purple.py\0%(hash2)s%(flag1)s\n' b'app.py\0%(hash3)s%(flag1)s\n' b'readme.txt\0%(hash2)s%(flag1)s\n' ) % {b'hash1': HASH_1, b'flag1': b'', b'hash2': HASH_2, b'flag2': b'l', b'hash3': HASH_3, } HUGE_MANIFEST_ENTRIES = 200001 izip = getattr(itertools, 'izip', zip) if 'xrange' not in globals(): xrange = range A_HUGE_MANIFEST = b''.join(sorted( b'file%d\0%s%s\n' % (i, h, f) for i, h, f in izip(xrange(200001), itertools.cycle((HASH_1, HASH_2)), itertools.cycle((b'', b'x', b'l'))))) class basemanifesttests(object): def parsemanifest(self, text): raise NotImplementedError('parsemanifest not implemented by test case') def testEmptyManifest(self): m = self.parsemanifest(EMTPY_MANIFEST) self.assertEqual(0, len(m)) self.assertEqual([], list(m)) def testEmptyManifestv2(self): m = self.parsemanifest(EMTPY_MANIFEST_V2) self.assertEqual(0, len(m)) self.assertEqual([], list(m)) def testManifest(self): m = self.parsemanifest(A_SHORT_MANIFEST) self.assertEqual([b'bar/baz/qux.py', b'foo'], list(m)) self.assertEqual(BIN_HASH_2, m[b'bar/baz/qux.py']) self.assertEqual(b'l', m.flags(b'bar/baz/qux.py')) self.assertEqual(BIN_HASH_1, m[b'foo']) self.assertEqual(b'', m.flags(b'foo')) with self.assertRaises(KeyError): m[b'wat'] def testParseManifestV2(self): m1 = self.parsemanifest(A_SHORT_MANIFEST) m2 = self.parsemanifest(A_SHORT_MANIFEST_V2) # Should have same content as A_SHORT_MANIFEST self.assertEqual(m1.text(), m2.text()) def testParseManifestMetadata(self): # Metadata is for future-proofing and should be accepted but ignored m = self.parsemanifest(A_METADATA_MANIFEST) self.assertEqual(A_SHORT_MANIFEST, m.text()) def testParseManifestStemCompression(self): m = self.parsemanifest(A_STEM_COMPRESSED_MANIFEST) self.assertIn(b'bar/baz/qux.py', m) self.assertIn(b'bar/qux/foo.py', m) self.assertIn(b'bar/qux/foz.py', m) self.assertIn(256 * b'x' + b'/x', m) self.assertIn(256 * b'x' + b'/y', m) self.assertEqual(A_STEM_COMPRESSED_MANIFEST, m.text(usemanifestv2=True)) def testTextV2(self): m1 = self.parsemanifest(A_SHORT_MANIFEST) v2text = m1.text(usemanifestv2=True) self.assertEqual(A_SHORT_MANIFEST_V2, v2text) def testSetItem(self): want = BIN_HASH_1 m = self.parsemanifest(EMTPY_MANIFEST) m[b'a'] = want self.assertIn(b'a', m) self.assertEqual(want, m[b'a']) self.assertEqual(b'a\0' + HASH_1 + b'\n', m.text()) m = self.parsemanifest(A_SHORT_MANIFEST) m[b'a'] = want self.assertEqual(want, m[b'a']) self.assertEqual(b'a\0' + HASH_1 + b'\n' + A_SHORT_MANIFEST, m.text()) def testSetFlag(self): want = b'x' m = self.parsemanifest(EMTPY_MANIFEST) # first add a file; a file-less flag makes no sense m[b'a'] = BIN_HASH_1 m.setflag(b'a', want) self.assertEqual(want, m.flags(b'a')) self.assertEqual(b'a\0' + HASH_1 + want + b'\n', m.text()) m = self.parsemanifest(A_SHORT_MANIFEST) # first add a file; a file-less flag makes no sense m[b'a'] = BIN_HASH_1 m.setflag(b'a', want) self.assertEqual(want, m.flags(b'a')) self.assertEqual(b'a\0' + HASH_1 + want + b'\n' + A_SHORT_MANIFEST, m.text()) def testCopy(self): m = self.parsemanifest(A_SHORT_MANIFEST) m[b'a'] = BIN_HASH_1 m2 = m.copy() del m del m2 # make sure we don't double free() anything def testCompaction(self): unhex = binascii.unhexlify h1, h2 = unhex(HASH_1), unhex(HASH_2) m = self.parsemanifest(A_SHORT_MANIFEST) m[b'alpha'] = h1 m[b'beta'] = h2 del m[b'foo'] want = b'alpha\0%s\nbar/baz/qux.py\0%sl\nbeta\0%s\n' % ( HASH_1, HASH_2, HASH_2) self.assertEqual(want, m.text()) self.assertEqual(3, len(m)) self.assertEqual([b'alpha', b'bar/baz/qux.py', b'beta'], list(m)) self.assertEqual(h1, m[b'alpha']) self.assertEqual(h2, m[b'bar/baz/qux.py']) self.assertEqual(h2, m[b'beta']) self.assertEqual(b'', m.flags(b'alpha')) self.assertEqual(b'l', m.flags(b'bar/baz/qux.py')) self.assertEqual(b'', m.flags(b'beta')) with self.assertRaises(KeyError): m[b'foo'] def testSetGetNodeSuffix(self): clean = self.parsemanifest(A_SHORT_MANIFEST) m = self.parsemanifest(A_SHORT_MANIFEST) h = m[b'foo'] f = m.flags(b'foo') want = h + b'a' # Merge code wants to set 21-byte fake hashes at times m[b'foo'] = want self.assertEqual(want, m[b'foo']) self.assertEqual([(b'bar/baz/qux.py', BIN_HASH_2), (b'foo', BIN_HASH_1 + b'a')], list(m.iteritems())) # Sometimes it even tries a 22-byte fake hash, but we can # return 21 and it'll work out m[b'foo'] = want + b'+' self.assertEqual(want, m[b'foo']) # make sure the suffix survives a copy match = matchmod.match(b'', b'', [b're:foo']) m2 = m.matches(match) self.assertEqual(want, m2[b'foo']) self.assertEqual(1, len(m2)) m2 = m.copy() self.assertEqual(want, m2[b'foo']) # suffix with iteration self.assertEqual([(b'bar/baz/qux.py', BIN_HASH_2), (b'foo', want)], list(m.iteritems())) # shows up in diff self.assertEqual({b'foo': ((want, f), (h, b''))}, m.diff(clean)) self.assertEqual({b'foo': ((h, b''), (want, f))}, clean.diff(m)) def testMatchException(self): m = self.parsemanifest(A_SHORT_MANIFEST) match = matchmod.match(b'', b'', [b're:.*']) def filt(path): if path == b'foo': assert False return True match.matchfn = filt with self.assertRaises(AssertionError): m.matches(match) def testRemoveItem(self): m = self.parsemanifest(A_SHORT_MANIFEST) del m[b'foo'] with self.assertRaises(KeyError): m[b'foo'] self.assertEqual(1, len(m)) self.assertEqual(1, len(list(m))) # now restore and make sure everything works right m[b'foo'] = b'a' * 20 self.assertEqual(2, len(m)) self.assertEqual(2, len(list(m))) def testManifestDiff(self): MISSING = (None, b'') addl = b'z-only-in-left\0' + HASH_1 + b'\n' addr = b'z-only-in-right\0' + HASH_2 + b'x\n' left = self.parsemanifest( A_SHORT_MANIFEST.replace(HASH_1, HASH_3 + b'x') + addl) right = self.parsemanifest(A_SHORT_MANIFEST + addr) want = { b'foo': ((BIN_HASH_3, b'x'), (BIN_HASH_1, b'')), b'z-only-in-left': ((BIN_HASH_1, b''), MISSING), b'z-only-in-right': (MISSING, (BIN_HASH_2, b'x')), } self.assertEqual(want, left.diff(right)) want = { b'bar/baz/qux.py': (MISSING, (BIN_HASH_2, b'l')), b'foo': (MISSING, (BIN_HASH_3, b'x')), b'z-only-in-left': (MISSING, (BIN_HASH_1, b'')), } self.assertEqual(want, self.parsemanifest(EMTPY_MANIFEST).diff(left)) want = { b'bar/baz/qux.py': ((BIN_HASH_2, b'l'), MISSING), b'foo': ((BIN_HASH_3, b'x'), MISSING), b'z-only-in-left': ((BIN_HASH_1, b''), MISSING), } self.assertEqual(want, left.diff(self.parsemanifest(EMTPY_MANIFEST))) copy = right.copy() del copy[b'z-only-in-right'] del right[b'foo'] want = { b'foo': (MISSING, (BIN_HASH_1, b'')), b'z-only-in-right': ((BIN_HASH_2, b'x'), MISSING), } self.assertEqual(want, right.diff(copy)) short = self.parsemanifest(A_SHORT_MANIFEST) pruned = short.copy() del pruned[b'foo'] want = { b'foo': ((BIN_HASH_1, b''), MISSING), } self.assertEqual(want, short.diff(pruned)) want = { b'foo': (MISSING, (BIN_HASH_1, b'')), } self.assertEqual(want, pruned.diff(short)) want = { b'bar/baz/qux.py': None, b'foo': (MISSING, (BIN_HASH_1, b'')), } self.assertEqual(want, pruned.diff(short, clean=True)) def testReversedLines(self): backwards = b''.join( l + b'\n' for l in reversed(A_SHORT_MANIFEST.split(b'\n')) if l) try: self.parsemanifest(backwards) self.fail('Should have raised ValueError') except ValueError as v: self.assertIn('Manifest lines not in sorted order.', str(v)) def testNoTerminalNewline(self): try: self.parsemanifest(A_SHORT_MANIFEST + b'wat') self.fail('Should have raised ValueError') except ValueError as v: self.assertIn('Manifest did not end in a newline.', str(v)) def testNoNewLineAtAll(self): try: self.parsemanifest(b'wat') self.fail('Should have raised ValueError') except ValueError as v: self.assertIn('Manifest did not end in a newline.', str(v)) def testHugeManifest(self): m = self.parsemanifest(A_HUGE_MANIFEST) self.assertEqual(HUGE_MANIFEST_ENTRIES, len(m)) self.assertEqual(len(m), len(list(m))) def testMatchesMetadata(self): '''Tests matches() for a few specific files to make sure that both the set of files as well as their flags and nodeids are correct in the resulting manifest.''' m = self.parsemanifest(A_HUGE_MANIFEST) match = matchmod.match(b'/', b'', [b'file1', b'file200', b'file300'], exact=True) m2 = m.matches(match) w = (b'file1\0%sx\n' b'file200\0%sl\n' b'file300\0%s\n') % (HASH_2, HASH_1, HASH_1) self.assertEqual(w, m2.text()) def testMatchesNonexistentFile(self): '''Tests matches() for a small set of specific files, including one nonexistent file to make sure in only matches against existing files. ''' m = self.parsemanifest(A_DEEPER_MANIFEST) match = matchmod.match(b'/', b'', [b'a/b/c/bar.txt', b'a/b/d/qux.py', b'readme.txt', b'nonexistent'], exact=True) m2 = m.matches(match) self.assertEqual( [b'a/b/c/bar.txt', b'a/b/d/qux.py', b'readme.txt'], m2.keys()) def testMatchesNonexistentDirectory(self): '''Tests matches() for a relpath match on a directory that doesn't actually exist.''' m = self.parsemanifest(A_DEEPER_MANIFEST) match = matchmod.match(b'/', b'', [b'a/f'], default=b'relpath') m2 = m.matches(match) self.assertEqual([], m2.keys()) def testMatchesExactLarge(self): '''Tests matches() for files matching a large list of exact files. ''' m = self.parsemanifest(A_HUGE_MANIFEST) flist = m.keys()[80:300] match = matchmod.match(b'/', b'', flist, exact=True) m2 = m.matches(match) self.assertEqual(flist, m2.keys()) def testMatchesFull(self): '''Tests matches() for what should be a full match.''' m = self.parsemanifest(A_DEEPER_MANIFEST) match = matchmod.match(b'/', b'', [b'']) m2 = m.matches(match) self.assertEqual(m.keys(), m2.keys()) def testMatchesDirectory(self): '''Tests matches() on a relpath match on a directory, which should match against all files within said directory.''' m = self.parsemanifest(A_DEEPER_MANIFEST) match = matchmod.match(b'/', b'', [b'a/b'], default=b'relpath') m2 = m.matches(match) self.assertEqual([ b'a/b/c/bar.py', b'a/b/c/bar.txt', b'a/b/c/foo.py', b'a/b/c/foo.txt', b'a/b/d/baz.py', b'a/b/d/qux.py', b'a/b/d/ten.txt', b'a/b/dog.py', b'a/b/fish.py'], m2.keys()) def testMatchesExactPath(self): '''Tests matches() on an exact match on a directory, which should result in an empty manifest because you can't perform an exact match against a directory.''' m = self.parsemanifest(A_DEEPER_MANIFEST) match = matchmod.match(b'/', b'', [b'a/b'], exact=True) m2 = m.matches(match) self.assertEqual([], m2.keys()) def testMatchesCwd(self): '''Tests matches() on a relpath match with the current directory ('.') when not in the root directory.''' m = self.parsemanifest(A_DEEPER_MANIFEST) match = matchmod.match(b'/', b'a/b', [b'.'], default=b'relpath') m2 = m.matches(match) self.assertEqual([ b'a/b/c/bar.py', b'a/b/c/bar.txt', b'a/b/c/foo.py', b'a/b/c/foo.txt', b'a/b/d/baz.py', b'a/b/d/qux.py', b'a/b/d/ten.txt', b'a/b/dog.py', b'a/b/fish.py'], m2.keys()) def testMatchesWithPattern(self): '''Tests matches() for files matching a pattern that reside deeper than the specified directory.''' m = self.parsemanifest(A_DEEPER_MANIFEST) match = matchmod.match(b'/', b'', [b'a/b/*/*.txt']) m2 = m.matches(match) self.assertEqual( [b'a/b/c/bar.txt', b'a/b/c/foo.txt', b'a/b/d/ten.txt'], m2.keys()) class testmanifestdict(unittest.TestCase, basemanifesttests): def parsemanifest(self, text): return manifestmod.manifestdict(text) class testtreemanifest(unittest.TestCase, basemanifesttests): def parsemanifest(self, text): return manifestmod.treemanifest(b'', text) def testWalkSubtrees(self): m = self.parsemanifest(A_DEEPER_MANIFEST) dirs = [s._dir for s in m.walksubtrees()] self.assertEqual( sorted([ b'', b'a/', b'a/c/', b'a/d/', b'a/b/', b'a/b/c/', b'a/b/d/']), sorted(dirs) ) match = matchmod.match(b'/', b'', [b'path:a/b/']) dirs = [s._dir for s in m.walksubtrees(matcher=match)] self.assertEqual( sorted([b'a/b/', b'a/b/c/', b'a/b/d/']), sorted(dirs) ) if __name__ == '__main__': silenttestrunner.main(__name__) mercurial-4.5.3/tests/test-debugindexdot.t0000644015407300116100000000066313261161234020533 0ustar augieeng00000000000000Just exercise debugindexdot Create a short file history including a merge. $ hg init t $ cd t $ echo a > a $ hg ci -qAm t1 -d '0 0' $ echo a >> a $ hg ci -m t2 -d '1 0' $ hg up -qC 0 $ echo b >> a $ hg ci -m t3 -d '2 0' created new head $ HGMERGE=true hg merge -q $ hg ci -m merge -d '3 0' $ hg debugindexdot .hg/store/data/a.i digraph G { -1 -> 0 0 -> 1 0 -> 2 2 -> 3 1 -> 3 } $ cd .. mercurial-4.5.3/tests/test-ui-config.py.out0000644015407300116100000000304313261161234020554 0ustar augieeng00000000000000[('string', 'string value'), ('bool1', 'true'), ('bool2', 'false'), ('boolinvalid', 'foo'), ('int1', '42'), ('int2', '-42'), ('intinvalid', 'foo')] [('list1', 'foo'), ('list2', 'foo bar baz'), ('list3', 'alice, bob'), ('list4', 'foo bar baz alice, bob'), ('list5', 'abc d"ef"g "hij def"'), ('list6', '"hello world", "how are you?"'), ('list7', 'Do"Not"Separate'), ('list8', '"Do"Separate'), ('list9', '"Do\\"NotSeparate"'), ('list10', 'string "with extraneous" quotation mark"'), ('list11', 'x, y'), ('list12', '"x", "y"'), ('list13', '""" key = "x", "y" """'), ('list14', ',,,,'), ('list15', '" just with starting quotation'), ('list16', '"longer quotation" with "no ending quotation'), ('list17', 'this is \\" "not a quotation mark"'), ('list18', 'ding\ndong')] --- 'string value' 'true' 'false' None --- values.string is not a boolean ('string value') True False False False True --- 42 -42 --- ['foo'] ['foo', 'bar', 'baz'] ['alice', 'bob'] ['foo', 'bar', 'baz', 'alice', 'bob'] ['foo', 'bar', 'baz', 'alice', 'bob'] ['abc', 'd"ef"g', 'hij def'] ['hello world', 'how are you?'] ['Do"Not"Separate'] ['Do', 'Separate'] ['Do"NotSeparate'] ['string', 'with extraneous', 'quotation', 'mark"'] ['x', 'y'] ['x', 'y'] ['', ' key = ', 'x"', 'y', '', '"'] [] ['"', 'just', 'with', 'starting', 'quotation'] ['longer quotation', 'with', '"no', 'ending', 'quotation'] ['this', 'is', '"', 'not a quotation mark'] ['ding', 'dong'] [] [] ['foo'] ['foo'] ['foo', 'bar'] ['foo', 'bar'] ['foo bar'] ['foo', 'bar'] --- (0, 0) (1113868800, 0) None True boolinvalid intinvalid dateinvalid mercurial-4.5.3/tests/test-py3-commands.t0000644015407300116100000001422513261161234020217 0ustar augieeng00000000000000#require py3exe This test helps in keeping a track on which commands we can run on Python 3 and see what kind of errors are coming up. The full traceback is hidden to have a stable output. $ HGBIN=`which hg` $ for cmd in version debuginstall ; do > echo $cmd > $PYTHON3 $HGBIN $cmd 2>&1 2>&1 | tail -1 > done version warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. debuginstall no problems detected #if test-repo Make a clone so that any features in the developer's .hg/hgrc that might confuse Python 3 don't break this test. When we can do commit in Python 3, we'll stop doing this. We use e76ed1e480ef for the clone because it has different files than 273ce12ad8f1, so we can test both `files` from dirstate and `files` loaded from a specific revision. $ hg clone -r e76ed1e480ef "`dirname "$TESTDIR"`" testrepo 2>&1 | tail -1 15 files updated, 0 files merged, 0 files removed, 0 files unresolved Test using -R, which exercises some URL code: $ $PYTHON3 $HGBIN -R testrepo files -r 273ce12ad8f1 | tail -1 testrepo/tkmerge Now prove `hg files` is reading the whole manifest. We have to grep out some potential warnings that come from hgrc as yet. $ cd testrepo $ $PYTHON3 $HGBIN files -r 273ce12ad8f1 .hgignore PKG-INFO README hg mercurial/__init__.py mercurial/byterange.py mercurial/fancyopts.py mercurial/hg.py mercurial/mdiff.py mercurial/revlog.py mercurial/transaction.py notes.txt setup.py tkmerge $ $PYTHON3 $HGBIN files -r 273ce12ad8f1 | wc -l \s*14 (re) $ $PYTHON3 $HGBIN files | wc -l \s*15 (re) Test if log-like commands work: $ $PYTHON3 $HGBIN tip changeset: 10:e76ed1e480ef tag: tip user: oxymoron@cinder.waste.org date: Tue May 03 23:37:43 2005 -0800 summary: Fix linking of changeset revs when merging $ $PYTHON3 $HGBIN log -r0 changeset: 0:9117c6561b0b user: mpm@selenic.com date: Tue May 03 13:16:10 2005 -0800 summary: Add back links from file revisions to changeset revisions $ cd .. #endif Test if `hg config` works: $ $PYTHON3 $HGBIN config devel.all-warnings=true devel.default-date=0 0 largefiles.usercache=$TESTTMP/.cache/largefiles ui.slash=True ui.interactive=False ui.mergemarkers=detailed ui.promptecho=True web.address=localhost web.ipv6=False $ cat > included-hgrc < [extensions] > babar = imaginary_elephant > EOF $ cat >> $HGRCPATH < %include $TESTTMP/included-hgrc > EOF $ $PYTHON3 $HGBIN version | tail -1 *** failed to import extension babar from imaginary_elephant: *: 'imaginary_elephant' (glob) warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ rm included-hgrc $ touch included-hgrc Test bytes-ness of policy.policy with HGMODULEPOLICY $ HGMODULEPOLICY=py $ export HGMODULEPOLICY $ $PYTHON3 `which hg` debuginstall 2>&1 2>&1 | tail -1 no problems detected `hg init` can create empty repos `hg status works fine` `hg summary` also works! $ $PYTHON3 `which hg` init py3repo $ cd py3repo $ echo "This is the file 'iota'." > iota $ $PYTHON3 $HGBIN status ? iota $ $PYTHON3 $HGBIN add iota $ $PYTHON3 $HGBIN status A iota $ hg diff --nodates --git diff --git a/iota b/iota new file mode 100644 --- /dev/null +++ b/iota @@ -0,0 +1,1 @@ +This is the file 'iota'. $ $PYTHON3 $HGBIN commit --message 'commit performed in Python 3' $ $PYTHON3 $HGBIN status $ mkdir A $ echo "This is the file 'mu'." > A/mu $ $PYTHON3 $HGBIN addremove adding A/mu $ $PYTHON3 $HGBIN status A A/mu $ HGEDITOR='echo message > ' $PYTHON3 $HGBIN commit $ $PYTHON3 $HGBIN status $ $PYHON3 $HGBIN summary parent: 1:e1e9167203d4 tip message branch: default commit: (clean) update: (current) phases: 2 draft Test weird unicode-vs-bytes stuff $ $PYTHON3 $HGBIN help | egrep -v '^ |^$' Mercurial Distributed SCM list of commands: additional help topics: (use 'hg help -v' to show built-in aliases and global options) $ $PYTHON3 $HGBIN help help | egrep -v '^ |^$' hg help [-ecks] [TOPIC] show help for a given topic or a help overview options ([+] can be repeated): (some details hidden, use --verbose to show complete help) $ $PYTHON3 $HGBIN help -k notopic abort: no matches (try 'hg help' for a list of topics) [255] Prove the repo is valid using the Python 2 `hg`: $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 2 changesets, 2 total revisions $ hg log changeset: 1:e1e9167203d4 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: message changeset: 0:71c96e924262 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: commit performed in Python 3 $ $PYTHON3 $HGBIN log -G @ changeset: 1:e1e9167203d4 | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: message | o changeset: 0:71c96e924262 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: commit performed in Python 3 $ $PYTHON3 $HGBIN log -Tjson [ { "rev": 1, "node": "e1e9167203d450ca2f558af628955b5f5afd4489", "branch": "default", "phase": "draft", "user": "test", "date": [0, 0], "desc": "message", "bookmarks": [], "tags": ["tip"], "parents": ["71c96e924262969ff0d8d3d695b0f75412ccc3d8"] }, { "rev": 0, "node": "71c96e924262969ff0d8d3d695b0f75412ccc3d8", "branch": "default", "phase": "draft", "user": "test", "date": [0, 0], "desc": "commit performed in Python 3", "bookmarks": [], "tags": [], "parents": ["0000000000000000000000000000000000000000"] } ] Show that update works now! $ $PYTHON3 $HGBIN up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ $PYTHON3 $HGBIN identify 71c96e924262 branches and bookmarks also works! $ $PYTHON3 $HGBIN branches default 1:e1e9167203d4 $ $PYTHON3 $HGBIN bookmark book $ $PYTHON3 $HGBIN bookmarks * book 0:71c96e924262 mercurial-4.5.3/tests/test-subrepo-svn.t0000644015407300116100000004274613261161234020201 0ustar augieeng00000000000000#require svn15 $ SVNREPOPATH=`pwd`/svn-repo #if windows $ SVNREPOURL=file:///`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` #else $ SVNREPOURL=file://`$PYTHON -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` #endif $ filter_svn_output () { > egrep -v 'Committing|Transmitting|Updating|(^$)' || true > } create subversion repo $ WCROOT="`pwd`/svn-wc" $ svnadmin create svn-repo $ svn co "$SVNREPOURL" svn-wc Checked out revision 0. $ cd svn-wc $ mkdir src $ echo alpha > src/alpha $ svn add src A src A src/alpha $ mkdir externals $ echo other > externals/other $ svn add externals A externals A externals/other $ svn ci -qm 'Add alpha' $ svn up -q $ echo "externals -r1 $SVNREPOURL/externals" > extdef $ svn propset -F extdef svn:externals src property 'svn:externals' set on 'src' $ svn ci -qm 'Setting externals' $ cd .. create hg repo $ mkdir sub $ cd sub $ hg init t $ cd t first revision, no sub $ echo a > a $ hg ci -Am0 adding a add first svn sub with leading whitespaces $ echo "s = [svn] $SVNREPOURL/src" >> .hgsub $ echo "subdir/s = [svn] $SVNREPOURL/src" >> .hgsub $ svn co --quiet "$SVNREPOURL"/src s $ mkdir subdir $ svn co --quiet "$SVNREPOURL"/src subdir/s $ hg add .hgsub svn subrepo is disabled by default $ hg ci -m1 abort: svn subrepos not allowed (see 'hg help config.subrepos' for details) [255] so enable it $ cat >> $HGRCPATH < [subrepos] > svn:allowed = true > EOF $ hg ci -m1 make sure we avoid empty commits (issue2445) $ hg sum parent: 1:* tip (glob) 1 branch: default commit: (clean) update: (current) phases: 2 draft $ hg ci -moops nothing changed [1] debugsub $ hg debugsub path s source file:/*/$TESTTMP/svn-repo/src (glob) revision 2 path subdir/s source file:/*/$TESTTMP/svn-repo/src (glob) revision 2 change file in svn and hg, commit $ echo a >> a $ echo alpha >> s/alpha $ hg sum parent: 1:* tip (glob) 1 branch: default commit: 1 modified, 1 subrepos update: (current) phases: 2 draft $ hg commit --subrepos -m 'Message!' | filter_svn_output committing subrepository s Sending*s/alpha (glob) Committed revision 3. Fetching external item into '*s/externals'* (glob) External at revision 1. At revision 3. $ hg debugsub path s source file:/*/$TESTTMP/svn-repo/src (glob) revision 3 path subdir/s source file:/*/$TESTTMP/svn-repo/src (glob) revision 2 missing svn file, commit should fail $ rm s/alpha $ hg commit --subrepos -m 'abort on missing file' committing subrepository s abort: cannot commit missing svn entries (in subrepository "s") [255] $ svn revert s/alpha > /dev/null add an unrelated revision in svn and update the subrepo to without bringing any changes. $ svn mkdir "$SVNREPOURL/unrelated" -qm 'create unrelated' $ svn up -q s $ hg sum parent: 2:* tip (glob) Message! branch: default commit: (clean) update: (current) phases: 3 draft $ echo a > s/a should be empty despite change to s/a $ hg st add a commit from svn $ cd "$WCROOT/src" $ svn up -q $ echo xyz >> alpha $ svn propset svn:mime-type 'text/xml' alpha property 'svn:mime-type' set on 'alpha' $ svn ci -qm 'amend a from svn' $ cd ../../sub/t this commit from hg will fail $ echo zzz >> s/alpha $ (hg ci --subrepos -m 'amend alpha from hg' 2>&1; echo "[$?]") | grep -vi 'out of date' committing subrepository s abort: svn:*Commit failed (details follow): (glob) [255] $ svn revert -q s/alpha this commit fails because of meta changes $ svn propset svn:mime-type 'text/html' s/alpha property 'svn:mime-type' set on 's/alpha' $ (hg ci --subrepos -m 'amend alpha from hg' 2>&1; echo "[$?]") | grep -vi 'out of date' committing subrepository s abort: svn:*Commit failed (details follow): (glob) [255] $ svn revert -q s/alpha this commit fails because of externals changes $ echo zzz > s/externals/other $ hg ci --subrepos -m 'amend externals from hg' committing subrepository s abort: cannot commit svn externals (in subrepository "s") [255] $ hg diff --subrepos -r 1:2 | grep -v diff --- a/.hgsubstate Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgsubstate Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +1,2 @@ -2 s +3 s 2 subdir/s --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,2 @@ a +a $ svn revert -q s/externals/other this commit fails because of externals meta changes $ svn propset svn:mime-type 'text/html' s/externals/other property 'svn:mime-type' set on 's/externals/other' $ hg ci --subrepos -m 'amend externals from hg' committing subrepository s abort: cannot commit svn externals (in subrepository "s") [255] $ svn revert -q s/externals/other clone $ cd .. $ hg clone t tc updating to branch default A tc/s/alpha U tc/s Fetching external item into 'tc/s/externals'* (glob) A tc/s/externals/other Checked out external at revision 1. Checked out revision 3. A tc/subdir/s/alpha U tc/subdir/s Fetching external item into 'tc/subdir/s/externals'* (glob) A tc/subdir/s/externals/other Checked out external at revision 1. Checked out revision 2. 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd tc debugsub in clone $ hg debugsub path s source file:/*/$TESTTMP/svn-repo/src (glob) revision 3 path subdir/s source file:/*/$TESTTMP/svn-repo/src (glob) revision 2 verify subrepo is contained within the repo directory $ $PYTHON -c "import os.path; print os.path.exists('s')" True update to nullrev (must delete the subrepo) $ hg up null 0 files updated, 0 files merged, 3 files removed, 0 files unresolved $ ls Check hg update --clean $ cd "$TESTTMP/sub/t" $ cd s $ echo c0 > alpha $ echo c1 > f1 $ echo c1 > f2 $ svn add f1 -q $ svn status | sort ? * a (glob) ? * f2 (glob) A * f1 (glob) M * alpha (glob) Performing status on external item at 'externals'* (glob) X * externals (glob) $ cd ../.. $ hg -R t update -C Fetching external item into 't/s/externals'* (glob) Checked out external at revision 1. Checked out revision 3. 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd t/s $ svn status | sort ? * a (glob) ? * f1 (glob) ? * f2 (glob) Performing status on external item at 'externals'* (glob) X * externals (glob) Sticky subrepositories, no changes $ cd "$TESTTMP/sub/t" $ hg id -n 2 $ cd s $ svnversion 3 $ cd .. $ hg update 1 U *s/alpha (glob) Fetching external item into '*s/externals'* (glob) Checked out external at revision 1. Checked out revision 2. 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id -n 1 $ cd s $ svnversion 2 $ cd .. Sticky subrepositories, file changes $ touch s/f1 $ cd s $ svn add f1 A f1 $ cd .. $ hg id -n 1+ $ cd s $ svnversion 2M $ cd .. $ hg update tip subrepository s diverged (local revision: 2, remote revision: 3) (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m subrepository sources for s differ use (l)ocal source (2) or (r)emote source (3)? l 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id -n 2+ $ cd s $ svnversion 2M $ cd .. $ hg update --clean tip U *s/alpha (glob) Fetching external item into '*s/externals'* (glob) Checked out external at revision 1. Checked out revision 3. 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Sticky subrepository, revision updates $ hg id -n 2 $ cd s $ svnversion 3 $ cd .. $ cd s $ svn update -qr 1 $ cd .. $ hg update 1 subrepository s diverged (local revision: 3, remote revision: 2) (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m subrepository sources for s differ (in checked out version) use (l)ocal source (1) or (r)emote source (2)? l 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id -n 1+ $ cd s $ svnversion 1 $ cd .. Sticky subrepository, file changes and revision updates $ touch s/f1 $ cd s $ svn add f1 A f1 $ svnversion 1M $ cd .. $ hg id -n 1+ $ hg update tip subrepository s diverged (local revision: 3, remote revision: 3) (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m subrepository sources for s differ use (l)ocal source (1) or (r)emote source (3)? l 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id -n 2+ $ cd s $ svnversion 1M $ cd .. Sticky repository, update --clean $ hg update --clean tip | grep -v 's[/\]externals[/\]other' U *s/alpha (glob) U *s (glob) Fetching external item into '*s/externals'* (glob) Checked out external at revision 1. Checked out revision 3. 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id -n 2 $ cd s $ svnversion 3 $ cd .. Test subrepo already at intended revision: $ cd s $ svn update -qr 2 $ cd .. $ hg update 1 subrepository s diverged (local revision: 3, remote revision: 2) (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id -n 1+ $ cd s $ svnversion 2 $ cd .. Test case where subversion would fail to update the subrepo because there are unknown directories being replaced by tracked ones (happens with rebase). $ cd "$WCROOT/src" $ mkdir dir $ echo epsilon.py > dir/epsilon.py $ svn add dir A dir A dir/epsilon.py $ svn ci -qm 'Add dir/epsilon.py' $ cd ../.. $ hg init rebaserepo $ cd rebaserepo $ svn co -r5 --quiet "$SVNREPOURL"/src s $ echo "s = [svn] $SVNREPOURL/src" >> .hgsub $ hg add .hgsub $ hg ci -m addsub $ echo a > a $ hg add . adding a $ hg ci -m adda $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ svn up -qr6 s $ hg ci -m updatesub created new head $ echo pyc > s/dir/epsilon.pyc $ hg up 1 D *s/dir (glob) Fetching external item into '*s/externals'* (glob) Checked out external at revision 1. Checked out revision 5. 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg up -q 2 Modify one of the externals to point to a different path so we can test having obstructions when switching branches on checkout: $ hg checkout tip 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo "obstruct = [svn] $SVNREPOURL/externals" >> .hgsub $ svn co -r5 --quiet "$SVNREPOURL"/externals obstruct $ hg commit -m 'Start making obstructed working copy' $ hg book other $ hg co -r 'p1(tip)' 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (leaving bookmark other) $ echo "obstruct = [svn] $SVNREPOURL/src" >> .hgsub $ svn co -r5 --quiet "$SVNREPOURL"/src obstruct $ hg commit -m 'Other branch which will be obstructed' created new head Switching back to the head where we have another path mapped to the same subrepo should work if the subrepo is clean. $ hg co other A *obstruct/other (glob) Checked out revision 1. 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (activating bookmark other) This is surprising, but is also correct based on the current code: $ echo "updating should (maybe) fail" > obstruct/other $ hg co tip abort: uncommitted changes (commit or update --clean to discard changes) [255] Point to a Subversion branch which has since been deleted and recreated First, create that condition in the repository. $ hg ci --subrepos -m cleanup | filter_svn_output committing subrepository obstruct Sending obstruct/other Committed revision 7. At revision 7. $ svn mkdir -qm "baseline" $SVNREPOURL/trunk $ svn copy -qm "initial branch" $SVNREPOURL/trunk $SVNREPOURL/branch $ svn co --quiet "$SVNREPOURL"/branch tempwc $ cd tempwc $ echo "something old" > somethingold $ svn add somethingold A somethingold $ svn ci -qm 'Something old' $ svn rm -qm "remove branch" $SVNREPOURL/branch $ svn copy -qm "recreate branch" $SVNREPOURL/trunk $SVNREPOURL/branch $ svn up -q $ echo "something new" > somethingnew $ svn add somethingnew A somethingnew $ svn ci -qm 'Something new' $ cd .. $ rm -rf tempwc $ svn co "$SVNREPOURL/branch"@10 recreated A recreated/somethingold Checked out revision 10. $ echo "recreated = [svn] $SVNREPOURL/branch" >> .hgsub $ hg ci -m addsub $ cd recreated $ svn up -q $ cd .. $ hg ci -m updatesub $ hg up -r-2 D *recreated/somethingnew (glob) A *recreated/somethingold (glob) Checked out revision 10. 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (leaving bookmark other) $ test -f recreated/somethingold Test archive $ hg archive -S ../archive-all --debug --config progress.debug=true archiving: 0/2 files (0.00%) archiving: .hgsub 1/2 files (50.00%) archiving: .hgsubstate 2/2 files (100.00%) archiving (obstruct): 0/1 files (0.00%) archiving (obstruct): 1/1 files (100.00%) archiving (recreated): 0/1 files (0.00%) archiving (recreated): 1/1 files (100.00%) archiving (s): 0/2 files (0.00%) archiving (s): 1/2 files (50.00%) archiving (s): 2/2 files (100.00%) $ hg archive -S ../archive-exclude --debug --config progress.debug=true -X **old archiving: 0/2 files (0.00%) archiving: .hgsub 1/2 files (50.00%) archiving: .hgsubstate 2/2 files (100.00%) archiving (obstruct): 0/1 files (0.00%) archiving (obstruct): 1/1 files (100.00%) archiving (recreated): 0 files archiving (s): 0/2 files (0.00%) archiving (s): 1/2 files (50.00%) archiving (s): 2/2 files (100.00%) $ find ../archive-exclude | sort ../archive-exclude ../archive-exclude/.hg_archival.txt ../archive-exclude/.hgsub ../archive-exclude/.hgsubstate ../archive-exclude/obstruct ../archive-exclude/obstruct/other ../archive-exclude/s ../archive-exclude/s/alpha ../archive-exclude/s/dir ../archive-exclude/s/dir/epsilon.py Test forgetting files, not implemented in svn subrepo, used to traceback $ hg forget 'notafile*' notafile*: $ENOENT$ [1] Test a subrepo referencing a just moved svn path. Last commit rev will be different from the revision, and the path will be different as well. $ cd "$WCROOT" $ svn up > /dev/null $ mkdir trunk/subdir branches $ echo a > trunk/subdir/a $ svn add trunk/subdir branches A trunk/subdir A trunk/subdir/a A branches $ svn ci -qm addsubdir $ svn cp -qm branchtrunk $SVNREPOURL/trunk $SVNREPOURL/branches/somebranch $ cd .. $ hg init repo2 $ cd repo2 $ svn co $SVNREPOURL/branches/somebranch/subdir A subdir/a Checked out revision 15. $ echo "subdir = [svn] $SVNREPOURL/branches/somebranch/subdir" > .hgsub $ hg add .hgsub $ hg ci -m addsub $ hg up null 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg up A *subdir/a (glob) Checked out revision 15. 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd .. Test sanitizing ".hg/hgrc" in subrepo $ cd sub/t $ hg update -q -C tip $ cd s $ mkdir .hg $ echo '.hg/hgrc in svn repo' > .hg/hgrc $ mkdir -p sub/.hg $ echo 'sub/.hg/hgrc in svn repo' > sub/.hg/hgrc $ svn add .hg sub A .hg A .hg/hgrc A sub A sub/.hg A sub/.hg/hgrc $ svn ci -qm 'add .hg/hgrc to be sanitized at hg update' $ svn up -q $ cd .. $ hg commit -S -m 'commit with svn revision including .hg/hgrc' $ grep ' s$' .hgsubstate 16 s $ cd .. $ hg -R tc pull -u -q 2>&1 | sort warning: removing potentially hostile 'hgrc' in '$TESTTMP/sub/tc/s/.hg' warning: removing potentially hostile 'hgrc' in '$TESTTMP/sub/tc/s/sub/.hg' $ cd tc $ grep ' s$' .hgsubstate 16 s $ test -f s/.hg/hgrc [1] $ test -f s/sub/.hg/hgrc [1] Test that sanitizing is omitted in meta data area: $ mkdir s/.svn/.hg $ echo '.hg/hgrc in svn metadata area' > s/.svn/.hg/hgrc $ hg update -q -C '.^1' $ cd ../.. SEC: test for ssh exploit $ hg init ssh-vuln $ cd ssh-vuln $ echo "s = [svn]$SVNREPOURL/src" >> .hgsub $ svn co --quiet "$SVNREPOURL"/src s $ hg add .hgsub $ hg ci -m1 $ echo "s = [svn]svn+ssh://-oProxyCommand=touch%20owned%20nested" > .hgsub $ hg ci -m2 $ cd .. $ hg clone ssh-vuln ssh-vuln-clone updating to branch default abort: potentially unsafe url: 'svn+ssh://-oProxyCommand=touch owned nested' (in subrepository "s") [255] also check that a percent encoded '-' (%2D) doesn't work $ cd ssh-vuln $ echo "s = [svn]svn+ssh://%2DoProxyCommand=touch%20owned%20nested" > .hgsub $ hg ci -m3 $ cd .. $ rm -r ssh-vuln-clone $ hg clone ssh-vuln ssh-vuln-clone updating to branch default abort: potentially unsafe url: 'svn+ssh://-oProxyCommand=touch owned nested' (in subrepository "s") [255] also check that hiding the attack in the username doesn't work: $ cd ssh-vuln $ echo "s = [svn]svn+ssh://%2DoProxyCommand=touch%20owned%20foo@example.com/nested" > .hgsub $ hg ci -m3 $ cd .. $ rm -r ssh-vuln-clone $ hg clone ssh-vuln ssh-vuln-clone updating to branch default abort: potentially unsafe url: 'svn+ssh://-oProxyCommand=touch owned foo@example.com/nested' (in subrepository "s") [255] mercurial-4.5.3/tests/test-http-clone-r.t0000644015407300116100000001516413261161234020224 0ustar augieeng00000000000000#require serve creating 'remote $ hg init remote $ cd remote $ hg unbundle "$TESTDIR/bundles/remote.hg" adding changesets adding manifests adding file changes added 9 changesets with 7 changes to 4 files (+1 heads) new changesets bfaf4b5cbf01:916f1afdef90 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg up tip 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Starting server $ hg serve -p $HGPORT -E ../error.log -d --pid-file=../hg1.pid $ cd .. $ cat hg1.pid >> $DAEMON_PIDS clone remote via stream $ for i in 0 1 2 3 4 5 6 7 8; do > hg clone -r "$i" http://localhost:$HGPORT/ test-"$i" > if cd test-"$i"; then > hg verify > cd .. > fi > done adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets bfaf4b5cbf01 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 1 changesets, 1 total revisions adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files new changesets bfaf4b5cbf01:21f32785131f updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 2 changesets, 2 total revisions adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 1 files new changesets bfaf4b5cbf01:4ce51a113780 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 3 changesets, 3 total revisions adding changesets adding manifests adding file changes added 4 changesets with 4 changes to 1 files new changesets bfaf4b5cbf01:93ee6ab32777 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 4 changesets, 4 total revisions adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files new changesets bfaf4b5cbf01:c70afb1ee985 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 2 changesets, 2 total revisions adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 1 files new changesets bfaf4b5cbf01:f03ae5a9b979 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 3 changesets, 3 total revisions adding changesets adding manifests adding file changes added 4 changesets with 5 changes to 2 files new changesets bfaf4b5cbf01:095cb14b1b4d updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 4 changesets, 5 total revisions adding changesets adding manifests adding file changes added 5 changesets with 6 changes to 3 files new changesets bfaf4b5cbf01:faa2e4234c7a updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 3 files, 5 changesets, 6 total revisions adding changesets adding manifests adding file changes added 5 changesets with 5 changes to 2 files new changesets bfaf4b5cbf01:916f1afdef90 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 5 changesets, 5 total revisions $ cd test-8 $ hg pull ../test-7 pulling from ../test-7 searching for changes adding changesets adding manifests adding file changes added 4 changesets with 2 changes to 3 files (+1 heads) new changesets c70afb1ee985:faa2e4234c7a (run 'hg heads' to see heads, 'hg merge' to merge) $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 4 files, 9 changesets, 7 total revisions $ cd .. $ cd test-1 $ hg pull -r 4 http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ searching for changes adding changesets adding manifests adding file changes added 1 changesets with 0 changes to 0 files (+1 heads) new changesets c70afb1ee985 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 3 changesets, 2 total revisions $ hg pull http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ searching for changes adding changesets adding manifests adding file changes added 6 changesets with 5 changes to 4 files new changesets 4ce51a113780:916f1afdef90 (run 'hg update' to get a working copy) $ cd .. $ cd test-2 $ hg pull -r 5 http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ searching for changes adding changesets adding manifests adding file changes added 2 changesets with 0 changes to 0 files (+1 heads) new changesets c70afb1ee985:f03ae5a9b979 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 5 changesets, 3 total revisions $ hg pull http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ searching for changes adding changesets adding manifests adding file changes added 4 changesets with 4 changes to 4 files new changesets 93ee6ab32777:916f1afdef90 (run 'hg update' to get a working copy) $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 4 files, 9 changesets, 7 total revisions $ cd .. no default destination if url has no path: $ hg clone http://localhost:$HGPORT/ abort: empty destination path is not valid [255] $ cat error.log mercurial-4.5.3/tests/test-pull-branch.t0000644015407300116100000001276613261161234020124 0ustar augieeng00000000000000 $ hg init t $ cd t $ echo 1 > foo $ hg ci -Am1 # 0 adding foo $ hg branch branchA marked working directory as branch branchA (branches are permanent and global, did you want a bookmark?) $ echo a1 > foo $ hg ci -ma1 # 1 $ cd .. $ hg init tt $ cd tt $ hg pull ../t pulling from ../t requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files new changesets 495a0ec48aaf:50e089d141b7 (run 'hg update' to get a working copy) $ hg up branchA 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ../t $ echo a2 > foo $ hg ci -ma2 # 2 Create branch B: $ hg up 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg branch branchB marked working directory as branch branchB $ echo b1 > foo $ hg ci -mb1 # 3 $ cd ../tt A new branch is there $ hg pull -u ../t pulling from ../t searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files (+1 heads) new changesets 9f878dea0b96:5be59ce5067b 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Develop both branches: $ cd ../t $ hg up branchA 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo a3 > foo $ hg ci -ma3 # 4 $ hg up branchB 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo b2 > foo $ hg ci -mb2 # 5 $ cd ../tt Should succeed, no new heads: $ hg pull -u ../t pulling from ../t searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files new changesets 7c8fe7e20c32:453e93fa00a5 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Add a head on other branch: $ cd ../t $ hg up branchA 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo a4 > foo $ hg ci -ma4 # 6 $ hg up branchB 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo b3.1 > foo $ hg ci -m b3.1 # 7 $ hg up 5 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo b3.2 > foo $ hg ci -m b3.2 # 8 created new head $ cd ../tt Should succeed because there is only one head on our branch: $ hg pull -u ../t pulling from ../t searching for changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 1 files (+1 heads) new changesets da3a8a0161c6:b61cab8fe4e8 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ../t $ hg up -C branchA 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo a5.1 > foo $ hg ci -ma5.1 # 9 $ hg up 6 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo a5.2 > foo $ hg ci -ma5.2 # 10 created new head $ hg up 7 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo b4.1 > foo $ hg ci -m b4.1 # 11 $ hg up -C 8 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo b4.2 > foo $ hg ci -m b4.2 # 12 $ cd ../tt $ hg pull -u ../t pulling from ../t searching for changes adding changesets adding manifests adding file changes added 4 changesets with 4 changes to 1 files (+1 heads) new changesets 0c4d148ae29e:ecfc3f4a6fd9 1 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to "d740e1a584e7: a5.2" 1 other heads for branch "branchA" Make changes on new branch on tt $ hg up 6 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg branch branchC marked working directory as branch branchC $ echo b1 > bar $ hg ci -Am "commit on branchC on tt" adding bar Make changes on default branch on t $ cd ../t $ hg up -C default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo a1 > bar $ hg ci -Am "commit on default on t" adding bar Pull branchC from tt $ hg pull ../tt pulling from ../tt searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 7d8ffa4c0b22 (run 'hg heads' to see heads) Make changes on default and branchC on tt $ cd ../tt $ hg pull ../t pulling from ../t searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 2b94b54b6b5f (run 'hg heads' to see heads) $ hg up -C default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo a1 > bar1 $ hg ci -Am "commit on default on tt" adding bar1 $ hg up branchC 2 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo a1 > bar2 $ hg ci -Am "commit on branchC on tt" adding bar2 Make changes on default and branchC on t $ cd ../t $ hg up default 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo a1 > bar3 $ hg ci -Am "commit on default on t" adding bar3 $ hg up branchC 2 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo a1 > bar4 $ hg ci -Am "commit on branchC on tt" adding bar4 Pull from tt $ hg pull ../tt pulling from ../tt searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files (+2 heads) new changesets eed40c14b407:e634733b0309 (run 'hg heads .' to see heads, 'hg merge' to merge) $ cd .. mercurial-4.5.3/tests/test-gendoc-it.t0000644015407300116100000000012413261161234017547 0ustar augieeng00000000000000#require docutils gettext $ $TESTDIR/check-gendoc it checking for parse errors mercurial-4.5.3/tests/test-status-rev.t0000644015407300116100000001426013261161234020021 0ustar augieeng00000000000000Tests of 'hg status --rev ' to make sure status between and '.' get combined correctly with the dirstate status. $ hg init First commit $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 1 $ hg addremove --similarity 0 adding content1_content1_content1-tracked adding content1_content1_content1-untracked adding content1_content1_content3-tracked adding content1_content1_content3-untracked adding content1_content1_missing-tracked adding content1_content1_missing-untracked adding content1_content2_content1-tracked adding content1_content2_content1-untracked adding content1_content2_content2-tracked adding content1_content2_content2-untracked adding content1_content2_content3-tracked adding content1_content2_content3-untracked adding content1_content2_missing-tracked adding content1_content2_missing-untracked adding content1_missing_content1-tracked adding content1_missing_content1-untracked adding content1_missing_content3-tracked adding content1_missing_content3-untracked adding content1_missing_missing-tracked adding content1_missing_missing-untracked $ hg commit -m first Second commit $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 2 $ hg addremove --similarity 0 removing content1_missing_content1-tracked removing content1_missing_content1-untracked removing content1_missing_content3-tracked removing content1_missing_content3-untracked removing content1_missing_missing-tracked removing content1_missing_missing-untracked adding missing_content2_content2-tracked adding missing_content2_content2-untracked adding missing_content2_content3-tracked adding missing_content2_content3-untracked adding missing_content2_missing-tracked adding missing_content2_missing-untracked $ hg commit -m second Working copy $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 wc $ hg addremove --similarity 0 adding content1_missing_content1-tracked adding content1_missing_content1-untracked adding content1_missing_content3-tracked adding content1_missing_content3-untracked adding content1_missing_missing-tracked adding content1_missing_missing-untracked adding missing_missing_content3-tracked adding missing_missing_content3-untracked adding missing_missing_missing-tracked adding missing_missing_missing-untracked $ hg forget *_*_*-untracked $ rm *_*_missing-* Status compared to parent of the working copy, i.e. the dirstate status $ hg status -A --rev 1 'glob:missing_content2_content3-tracked' M missing_content2_content3-tracked $ hg status -A --rev 1 'glob:missing_content2_content2-tracked' C missing_content2_content2-tracked $ hg status -A --rev 1 'glob:missing_missing_content3-tracked' A missing_missing_content3-tracked $ hg status -A --rev 1 'glob:missing_missing_content3-untracked' ? missing_missing_content3-untracked $ hg status -A --rev 1 'glob:missing_content2_*-untracked' R missing_content2_content2-untracked R missing_content2_content3-untracked R missing_content2_missing-untracked $ hg status -A --rev 1 'glob:missing_*_missing-tracked' ! missing_content2_missing-tracked ! missing_missing_missing-tracked $ hg status -A --rev 1 'glob:missing_missing_missing-untracked' missing_missing_missing-untracked: $ENOENT$ Status between first and second commit. Should ignore dirstate status. $ hg status -A --rev 0:1 'glob:content1_content2_*' M content1_content2_content1-tracked M content1_content2_content1-untracked M content1_content2_content2-tracked M content1_content2_content2-untracked M content1_content2_content3-tracked M content1_content2_content3-untracked M content1_content2_missing-tracked M content1_content2_missing-untracked $ hg status -A --rev 0:1 'glob:content1_content1_*' C content1_content1_content1-tracked C content1_content1_content1-untracked C content1_content1_content3-tracked C content1_content1_content3-untracked C content1_content1_missing-tracked C content1_content1_missing-untracked $ hg status -A --rev 0:1 'glob:missing_content2_*' A missing_content2_content2-tracked A missing_content2_content2-untracked A missing_content2_content3-tracked A missing_content2_content3-untracked A missing_content2_missing-tracked A missing_content2_missing-untracked $ hg status -A --rev 0:1 'glob:content1_missing_*' R content1_missing_content1-tracked R content1_missing_content1-untracked R content1_missing_content3-tracked R content1_missing_content3-untracked R content1_missing_missing-tracked R content1_missing_missing-untracked $ hg status -A --rev 0:1 'glob:missing_missing_*' Status compared to one revision back, checking that the dirstate status is correctly combined with the inter-revision status $ hg status -A --rev 0 'glob:content1_*_content[23]-tracked' M content1_content1_content3-tracked M content1_content2_content2-tracked M content1_content2_content3-tracked M content1_missing_content3-tracked $ hg status -A --rev 0 'glob:content1_*_content1-tracked' C content1_content1_content1-tracked C content1_content2_content1-tracked C content1_missing_content1-tracked $ hg status -A --rev 0 'glob:missing_*_content?-tracked' A missing_content2_content2-tracked A missing_content2_content3-tracked A missing_missing_content3-tracked BROKEN: missing_content2_content[23]-untracked exist, so should be listed $ hg status -A --rev 0 'glob:missing_*_content?-untracked' ? missing_missing_content3-untracked $ hg status -A --rev 0 'glob:content1_*_*-untracked' R content1_content1_content1-untracked R content1_content1_content3-untracked R content1_content1_missing-untracked R content1_content2_content1-untracked R content1_content2_content2-untracked R content1_content2_content3-untracked R content1_content2_missing-untracked R content1_missing_content1-untracked R content1_missing_content3-untracked R content1_missing_missing-untracked $ hg status -A --rev 0 'glob:*_*_missing-tracked' ! content1_content1_missing-tracked ! content1_content2_missing-tracked ! content1_missing_missing-tracked ! missing_content2_missing-tracked ! missing_missing_missing-tracked $ hg status -A --rev 0 'glob:missing_*_missing-untracked' mercurial-4.5.3/tests/test-hgweb-no-request-uri.t0000644015407300116100000001064113261161234021674 0ustar augieeng00000000000000This tests if hgweb and hgwebdir still work if the REQUEST_URI variable is no longer passed with the request. Instead, SCRIPT_NAME and PATH_INFO should be used from d74fc8dec2b4 onward to route the request. $ hg init repo $ cd repo $ echo foo > bar $ hg add bar $ hg commit -m "test" $ hg tip changeset: 0:61c9426e69fe tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: test $ cat > request.py < from __future__ import absolute_import > import os > import sys > from mercurial.hgweb import ( > hgweb, > hgwebdir, > ) > from mercurial import ( > util, > ) > stringio = util.stringio > > errors = stringio() > input = stringio() > > def startrsp(status, headers): > print('---- STATUS') > print(status) > print('---- HEADERS') > print([i for i in headers if i[0] != 'ETag']) > print('---- DATA') > return output.write > > env = { > 'wsgi.version': (1, 0), > 'wsgi.url_scheme': 'http', > 'wsgi.errors': errors, > 'wsgi.input': input, > 'wsgi.multithread': False, > 'wsgi.multiprocess': False, > 'wsgi.run_once': False, > 'REQUEST_METHOD': 'GET', > 'SCRIPT_NAME': '', > 'SERVER_NAME': '$LOCALIP', > 'SERVER_PORT': os.environ['HGPORT'], > 'SERVER_PROTOCOL': 'HTTP/1.0' > } > > def process(app): > content = app(env, startrsp) > sys.stdout.write(output.getvalue()) > sys.stdout.write(''.join(content)) > getattr(content, 'close', lambda : None)() > print('---- ERRORS') > print(errors.getvalue()) > > output = stringio() > env['PATH_INFO'] = '/' > env['QUERY_STRING'] = 'style=atom' > process(hgweb('.', name = 'repo')) > > output = stringio() > env['PATH_INFO'] = '/file/tip/' > env['QUERY_STRING'] = 'style=raw' > process(hgweb('.', name = 'repo')) > > output = stringio() > env['PATH_INFO'] = '/' > env['QUERY_STRING'] = 'style=raw' > process(hgwebdir({'repo': '.'})) > > output = stringio() > env['PATH_INFO'] = '/repo/file/tip/' > env['QUERY_STRING'] = 'style=raw' > process(hgwebdir({'repo': '.'})) > EOF $ $PYTHON request.py ---- STATUS 200 Script output follows ---- HEADERS [('Content-Type', 'application/atom+xml; charset=ascii')] ---- DATA http://$LOCALIP:$HGPORT/ (glob) (glob) (glob) repo Changelog 1970-01-01T00:00:00+00:00 [default] test http://$LOCALIP:$HGPORT/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c (glob) (glob) test test 1970-01-01T00:00:00+00:00 1970-01-01T00:00:00+00:00
    changeset 61c9426e69fe
    branch default
    bookmark
    tag tip
    user test
    description test
    files bar
    ---- ERRORS ---- STATUS 200 Script output follows ---- HEADERS [('Content-Type', 'text/plain; charset=ascii')] ---- DATA -rw-r--r-- 4 bar ---- ERRORS ---- STATUS 200 Script output follows ---- HEADERS [('Content-Type', 'text/plain; charset=ascii')] ---- DATA /repo/ ---- ERRORS ---- STATUS 200 Script output follows ---- HEADERS [('Content-Type', 'text/plain; charset=ascii')] ---- DATA -rw-r--r-- 4 bar ---- ERRORS $ cd .. mercurial-4.5.3/tests/test-extensions-wrapfunction.py0000644015407300116100000000401513261161234023002 0ustar augieeng00000000000000from __future__ import absolute_import, print_function from mercurial import extensions def genwrapper(x): def f(orig, *args, **kwds): return [x] + orig(*args, **kwds) f.x = x return f def getid(wrapper): return getattr(wrapper, 'x', '-') wrappers = [genwrapper(i) for i in range(5)] class dummyclass(object): def getstack(self): return ['orig'] dummy = dummyclass() def batchwrap(wrappers): for w in wrappers: extensions.wrapfunction(dummy, 'getstack', w) print('wrap %d: %s' % (getid(w), dummy.getstack())) def batchunwrap(wrappers): for w in wrappers: result = None try: result = extensions.unwrapfunction(dummy, 'getstack', w) msg = str(dummy.getstack()) except (ValueError, IndexError) as e: msg = e.__class__.__name__ print('unwrap %s: %s: %s' % (getid(w), getid(result), msg)) batchwrap(wrappers + [wrappers[0]]) batchunwrap([(wrappers[i] if i >= 0 else None) for i in [3, None, 0, 4, 0, 2, 1, None]]) wrap0 = extensions.wrappedfunction(dummy, 'getstack', wrappers[0]) wrap1 = extensions.wrappedfunction(dummy, 'getstack', wrappers[1]) # Use them in a different order from how they were created to check that # the wrapping happens in __enter__, not in __init__ print('context manager', dummy.getstack()) with wrap1: print('context manager', dummy.getstack()) with wrap0: print('context manager', dummy.getstack()) # Bad programmer forgets to unwrap the function, but the context # managers still unwrap their wrappings. extensions.wrapfunction(dummy, 'getstack', wrappers[2]) print('context manager', dummy.getstack()) print('context manager', dummy.getstack()) print('context manager', dummy.getstack()) # Wrap callable object which has no __name__ class callableobj(object): def __call__(self): return ['orig'] dummy.cobj = callableobj() extensions.wrapfunction(dummy, 'cobj', wrappers[0]) print('wrap callable object', dummy.cobj()) mercurial-4.5.3/tests/test-issue612.t0000644015407300116100000000115113261161234017260 0ustar augieeng00000000000000https://bz.mercurial-scm.org/612 $ hg init $ mkdir src $ echo a > src/a.c $ hg ci -Ama adding src/a.c $ hg mv src source moving src/a.c to source/a.c $ hg ci -Ammove $ hg co -C 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo new > src/a.c $ echo compiled > src/a.o $ hg ci -mupdate created new head $ hg status ? src/a.o $ hg merge merging src/a.c and source/a.c to source/a.c 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg status M source/a.c R src/a.c ? src/a.o mercurial-4.5.3/tests/test-hybridencode.py0000644015407300116100000005141113261161234020527 0ustar augieeng00000000000000from __future__ import absolute_import, print_function from mercurial import ( store, ) def show(s): # show test input print("A = '%s'" % s.encode("string_escape")) # show the result of the C implementation, if available h = store._pathencode(s) print("B = '%s'" % h.encode("string_escape")) # compare it with reference implementation in Python r = store._hybridencode(s, True) if h != r: print("R = '%s'" % r.encode("string_escape")) print() show("data/abcdefghijklmnopqrstuvwxyz0123456789 !#%&'()+,-.;=[]^`{}") print("uppercase char X is encoded as _x") show("data/ABCDEFGHIJKLMNOPQRSTUVWXYZ") print("underbar is doubled") show("data/_") print("tilde is character-encoded") show("data/~") print("characters in ASCII code range 1..31") show('data/\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f' '\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f') print("characters in ASCII code range 126..255") show('data/\x7e\x7f' '\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f' '\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f') show('data/\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf' '\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf') show('data/\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf' '\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf') show('data/\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef' '\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff') print("Windows reserved characters") show('data/less <, greater >, colon :, double-quote ", backslash \\' ', pipe |, question-mark ?, asterisk *') print("encoding directories ending in .hg, .i or .d with '.hg' suffix") show('data/x.h.i/x.hg/x.i/x.d/foo') show('data/a.hg/a.i/a.d/foo') show('data/au.hg/au.i/au.d/foo') show('data/aux.hg/aux.i/aux.d/foo') show('data/auxy.hg/auxy.i/auxy.d/foo') print("but these are not encoded on *filenames*") show('data/foo/x.hg') show('data/foo/x.i') show('data/foo/x.d') show('data/foo/a.hg') show('data/foo/a.i') show('data/foo/a.d') show('data/foo/au.hg') show('data/foo/au.i') show('data/foo/au.d') show('data/foo/aux.hg') show('data/foo/aux.i') show('data/foo/aux.d') show('data/foo/auxy.hg') show('data/foo/auxy.i') show('data/foo/auxy.d') print("plain .hg, .i and .d directories have the leading dot encoded") show('data/.hg/.i/.d/foo') show('data/aux.bla/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c.i') show('data/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/' 'TENTH/ELEVENTH/LOREMIPSUM.TXT.i') show('data/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/' 'wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules' '.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider.i') show('data/AUX.THE-QUICK-BROWN-FOX-JU:MPS-OVER-THE-LAZY-DOG-THE-QUICK-' 'BROWN-FOX-JUMPS-OVER-THE-LAZY-DOG.TXT.i') show('data/Project Planning/Resources/AnotherLongDirectoryName/' 'Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt') show('data/Project.Planning/Resources/AnotherLongDirectoryName/' 'Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt') show('data/foo.../foo / /a./_. /__/.x../ bla/.FOO/something.i') show('data/c/co/com/com0/com1/com2/com3/com4/com5/com6/com7/com8/com9') show('data/C/CO/COM/COM0/COM1/COM2/COM3/COM4/COM5/COM6/COM7/COM8/COM9') show('data/c.x/co.x/com.x/com0.x/com1.x/com2.x/com3.x/com4.x/com5.x' '/com6.x/com7.x/com8.x/com9.x') show('data/x.c/x.co/x.com0/x.com1/x.com2/x.com3/x.com4/x.com5' '/x.com6/x.com7/x.com8/x.com9') show('data/cx/cox/comx/com0x/com1x/com2x/com3x/com4x/com5x' '/com6x/com7x/com8x/com9x') show('data/xc/xco/xcom0/xcom1/xcom2/xcom3/xcom4/xcom5' '/xcom6/xcom7/xcom8/xcom9') show('data/l/lp/lpt/lpt0/lpt1/lpt2/lpt3/lpt4/lpt5/lpt6/lpt7/lpt8/lpt9') show('data/L/LP/LPT/LPT0/LPT1/LPT2/LPT3/LPT4/LPT5/LPT6/LPT7/LPT8/LPT9') show('data/l.x/lp.x/lpt.x/lpt0.x/lpt1.x/lpt2.x/lpt3.x/lpt4.x/lpt5.x' '/lpt6.x/lpt7.x/lpt8.x/lpt9.x') show('data/x.l/x.lp/x.lpt/x.lpt0/x.lpt1/x.lpt2/x.lpt3/x.lpt4/x.lpt5' '/x.lpt6/x.lpt7/x.lpt8/x.lpt9') show('data/lx/lpx/lptx/lpt0x/lpt1x/lpt2x/lpt3x/lpt4x/lpt5x' '/lpt6x/lpt7x/lpt8x/lpt9x') show('data/xl/xlp/xlpt/xlpt0/xlpt1/xlpt2/xlpt3/xlpt4/xlpt5' '/xlpt6/xlpt7/xlpt8/xlpt9') show('data/con/p/pr/prn/a/au/aux/n/nu/nul') show('data/CON/P/PR/PRN/A/AU/AUX/N/NU/NUL') show('data/con.x/p.x/pr.x/prn.x/a.x/au.x/aux.x/n.x/nu.x/nul.x') show('data/x.con/x.p/x.pr/x.prn/x.a/x.au/x.aux/x.n/x.nu/x.nul') show('data/conx/px/prx/prnx/ax/aux/auxx/nx/nux/nulx') show('data/xcon/xp/xpr/xprn/xa/xau/xaux/xn/xnu/xnul') show('data/a./au./aux./auxy./aux.') show('data/c./co./con./cony./con.') show('data/p./pr./prn./prny./prn.') show('data/n./nu./nul./nuly./nul.') show('data/l./lp./lpt./lpt1./lpt1y./lpt1.') show('data/lpt9./lpt9y./lpt9.') show('data/com./com1./com1y./com1.') show('data/com9./com9y./com9.') show('data/a /au /aux /auxy /aux ') print("largest unhashed path") show('data/123456789-123456789-123456789-123456789-123456789-' 'unhashed--xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') print("shortest hashed path") show('data/123456789-123456789-123456789-123456789-123456789-' 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("changing one char in part that's hashed away produces a different hash") show('data/123456789-123456789-123456789-123456789-123456789-' 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxy-' '123456789-123456') print("uppercase hitting length limit due to encoding") show('data/A23456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/Z23456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') print("compare with lowercase not hitting limit") show('data/a23456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/z23456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') print("not hitting limit with any of these") show("data/abcdefghijklmnopqrstuvwxyz0123456789 !#%&'()+,-.;=" "[]^`{}xxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-" "123456789-12345") print("underbar hitting length limit due to encoding") show('data/_23456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') print("tilde hitting length limit due to encoding") show('data/~23456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') print("Windows reserved characters hitting length limit") show('data/<23456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/>23456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/:23456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/"23456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/\\23456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/|23456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/?23456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/*23456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') print("initial space hitting length limit") show('data/ 23456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') print("initial dot hitting length limit") show('data/.23456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') print("trailing space in filename hitting length limit") show('data/123456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-1234 ') print("trailing dot in filename hitting length limit") show('data/123456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-1234.') print("initial space in directory hitting length limit") show('data/ x/456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') print("initial dot in directory hitting length limit") show('data/.x/456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') print("trailing space in directory hitting length limit") show('data/x /456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') print("trailing dot in directory hitting length limit") show('data/x./456789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') print("with directories that need direncoding, hitting length limit") show('data/x.i/56789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/x.d/56789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/x.hg/5789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') print("Windows reserved filenames, hitting length limit") show('data/con/56789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/prn/56789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/aux/56789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/nul/56789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/com1/6789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/com9/6789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/lpt1/6789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') show('data/lpt9/6789-123456789-123456789-123456789-123456789-' 'xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') print("non-reserved names, just not hitting limit") show('data/123456789-123456789-123456789-123456789-123456789-' '/com/com0/lpt/lpt0/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12345') print("hashed path with largest untruncated 1st dir") show('data/12345678/-123456789-123456789-123456789-123456789-' 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path with smallest truncated 1st dir") show('data/123456789/123456789-123456789-123456789-123456789-' 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path with largest untruncated two dirs") show('data/12345678/12345678/9-123456789-123456789-123456789-' 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path with smallest truncated two dirs") show('data/123456789/123456789/123456789-123456789-123456789-' 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path with largest untruncated three dirs") show('data/12345678/12345678/12345678/89-123456789-123456789-' 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path with smallest truncated three dirs") show('data/123456789/123456789/123456789/123456789-123456789-' 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path with largest untruncated four dirs") show('data/12345678/12345678/12345678/12345678/789-123456789-' 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path with smallest truncated four dirs") show('data/123456789/123456789/123456789/123456789/123456789-' 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path with largest untruncated five dirs") show('data/12345678/12345678/12345678/12345678/12345678/6789-' 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path with smallest truncated five dirs") show('data/123456789/123456789/123456789/123456789/123456789/' 'hashed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path with largest untruncated six dirs") show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/ed----xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path with smallest truncated six dirs") show('data/123456789/123456789/123456789/123456789/123456789/' '123456789/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path with largest untruncated seven dirs") show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/xxxxxx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path with smallest truncated seven dirs") show('data/123456789/123456789/123456789/123456789/123456789/' '123456789/123456789/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path with largest untruncated eight dirs") print("(directory 8 is dropped because it hits _maxshortdirslen)") show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/12345678/xxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path with smallest truncated eight dirs") print("(directory 8 is dropped because it hits _maxshortdirslen)") show('data/123456789/123456789/123456789/123456789/123456789/' '123456789/123456789/123456789/xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path with largest non-dropped directory 8") print("(just not hitting the _maxshortdirslen boundary)") show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("...adding one truncated char to dir 1..7 won't drop dir 8") show('data/12345678x/12345678/12345678/12345678/12345678/12345' '678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') show('data/12345678/12345678x/12345678/12345678/12345678/12345' '678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') show('data/12345678/12345678/12345678x/12345678/12345678/12345' '678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') show('data/12345678/12345678/12345678/12345678x/12345678/12345' '678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') show('data/12345678/12345678/12345678/12345678/12345678x/12345' '678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') show('data/12345678/12345678/12345678/12345678/12345678/12345' '678x/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678x/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path with shortest dropped directory 8") print("(just hitting the _maxshortdirslen boundary)") show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/123456/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("hashed path that drops dir 8 due to dot or space at end is") print("encoded, and thus causing to hit _maxshortdirslen") show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/1234./-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/1234 /-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print("... with dir 8 short enough for encoding") show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/12./xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/12 /xx-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-123456') print('''Extensions are replicated on hashed paths. Note that we only get to encode files that end in .i or .d inside the store. Encoded filenames are thus bound in length.''') show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12.345.i') show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12.345.d') show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12.3456.i') show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12.34567.i') show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12.345678.i') show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12.3456789.i') show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12.3456789-.i') show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12.3456789-1.i') show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12.3456789-12.i') show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12.3456789-123.i') show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12.3456789-1234.i') show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12.3456789-12345.i') show('data/12345678/12345678/12345678/12345678/12345678/12345' '678/12345678/12345/-xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-' '123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWX' 'YZ-abcdefghjiklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPRSTU' 'VWXYZ-1234567890-xxxxxxxxx-xxxxxxxxx-xxxxxxxx-xxxx' 'xxxxx-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwww' 'wwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww-wwwwwwwww.i') print("paths outside data/ can be encoded") show('metadata/dir/00manifest.i') show('metadata/12345678/12345678/12345678/12345678/12345678/' '12345678/12345678/12345678/12345678/12345678/12345678/' '12345678/12345678/00manifest.i') mercurial-4.5.3/tests/test-duplicateoptions.py0000644015407300116100000000203413261161234021453 0ustar augieeng00000000000000from __future__ import absolute_import, print_function import os from mercurial import ( commands, extensions, ui as uimod, ) ignore = {b'highlight', b'win32text', b'factotum'} if os.name != 'nt': ignore.add(b'win32mbcs') disabled = [ext for ext in extensions.disabled().keys() if ext not in ignore] hgrc = open(os.environ["HGRCPATH"], 'wb') hgrc.write(b'[extensions]\n') for ext in disabled: hgrc.write(ext + b'=\n') hgrc.close() u = uimod.ui.load() extensions.loadall(u) globalshort = set() globallong = set() for option in commands.globalopts: option[0] and globalshort.add(option[0]) option[1] and globallong.add(option[1]) for cmd, entry in commands.table.items(): seenshort = globalshort.copy() seenlong = globallong.copy() for option in entry[1]: if (option[0] and option[0] in seenshort) or \ (option[1] and option[1] in seenlong): print("command '" + cmd + "' has duplicate option " + str(option)) seenshort.add(option[0]) seenlong.add(option[1]) mercurial-4.5.3/tests/test-static-http.t0000644015407300116100000001722513261161234020154 0ustar augieeng00000000000000#require killdaemons $ hg clone http://localhost:$HGPORT/ copy abort: * (glob) [255] $ test -d copy [1] This server doesn't do range requests so it's basically only good for one pull $ $PYTHON "$TESTDIR/dumbhttp.py" -p $HGPORT --pid dumb.pid \ > --logfile server.log $ cat dumb.pid >> $DAEMON_PIDS $ hg init remote $ cd remote $ echo foo > bar $ echo c2 > '.dotfile with spaces' $ hg add adding .dotfile with spaces adding bar $ hg commit -m"test" $ hg tip changeset: 0:02770d679fb8 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: test $ cd .. $ hg clone static-http://localhost:$HGPORT/remote local requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files new changesets 02770d679fb8 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd local $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 1 changesets, 2 total revisions $ cat bar foo $ cd ../remote $ echo baz > quux $ hg commit -A -mtest2 adding quux check for HTTP opener failures when cachefile does not exist $ rm .hg/cache/* $ cd ../local $ cat >> .hg/hgrc < [hooks] > changegroup = sh -c "printenv.py changegroup" > EOF $ hg pull pulling from static-http://localhost:$HGPORT/remote searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 4ac2e3648604 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432 HG_NODE_LAST=4ac2e3648604439c580c69b09ec9d93a88d93432 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT/remote (run 'hg update' to get a working copy) trying to push $ hg update 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo more foo >> bar $ hg commit -m"test" $ hg push pushing to static-http://localhost:$HGPORT/remote abort: destination does not support push [255] trying clone -r $ cd .. $ hg clone -r doesnotexist static-http://localhost:$HGPORT/remote local0 abort: unknown revision 'doesnotexist'! [255] $ hg clone -r 0 static-http://localhost:$HGPORT/remote local0 adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files new changesets 02770d679fb8 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved test with "/" URI (issue747) and subrepo $ hg init $ hg init sub $ touch sub/test $ hg -R sub commit -A -m "test" adding test $ hg -R sub tag not-empty $ echo sub=sub > .hgsub $ echo a > a $ hg add a .hgsub $ hg -q ci -ma $ hg clone static-http://localhost:$HGPORT/ local2 requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 3 changes to 3 files new changesets a9ebfbe8e587 updating to branch default cloning subrepo sub from static-http://localhost:$HGPORT/sub requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files new changesets be090ea66256:322ea90975df 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd local2 $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 3 files, 1 changesets, 3 total revisions checking subrepo links $ cat a a $ hg paths default = static-http://localhost:$HGPORT/ test with empty repo (issue965) $ cd .. $ hg init remotempty $ hg clone static-http://localhost:$HGPORT/remotempty local3 no changes found updating to branch default 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd local3 $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 0 files, 0 changesets, 0 total revisions $ hg paths default = static-http://localhost:$HGPORT/remotempty test with non-repo $ cd .. $ mkdir notarepo $ hg clone static-http://localhost:$HGPORT/notarepo local3 abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository! [255] Clone with tags and branches works $ hg init remote-with-names $ cd remote-with-names $ echo 0 > foo $ hg -q commit -A -m initial $ echo 1 > foo $ hg commit -m 'commit 1' $ hg -q up 0 $ hg branch mybranch marked working directory as branch mybranch (branches are permanent and global, did you want a bookmark?) $ echo 2 > foo $ hg commit -m 'commit 2 (mybranch)' $ hg tag -r 1 'default-tag' $ hg tag -r 2 'branch-tag' $ cd .. $ hg clone static-http://localhost:$HGPORT/remote-with-names local-with-names requesting all changes adding changesets adding manifests adding file changes added 5 changesets with 5 changes to 2 files (+1 heads) new changesets 68986213bd44:0c325bd2b5a7 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Clone a specific branch works $ hg clone -r mybranch static-http://localhost:$HGPORT/remote-with-names local-with-names-branch adding changesets adding manifests adding file changes added 4 changesets with 4 changes to 2 files new changesets 68986213bd44:0c325bd2b5a7 updating to branch mybranch 2 files updated, 0 files merged, 0 files removed, 0 files unresolved Clone a specific tag works $ hg clone -r default-tag static-http://localhost:$HGPORT/remote-with-names local-with-names-tag adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files new changesets 68986213bd44:4ee3fcef1c80 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ killdaemons.py List of files accessed over HTTP: $ cat server.log | sed -n -e 's|.*GET \(/[^ ]*\).*|\1|p' | sort -u /.hg/bookmarks /.hg/bookmarks.current /.hg/cache/hgtagsfnodes1 /.hg/requires /.hg/store/00changelog.i /.hg/store/00manifest.i /.hg/store/data/%7E2ehgsub.i /.hg/store/data/%7E2ehgsubstate.i /.hg/store/data/a.i /notarepo/.hg/00changelog.i /notarepo/.hg/requires /remote-with-names/.hg/bookmarks /remote-with-names/.hg/bookmarks.current /remote-with-names/.hg/cache/branch2-served /remote-with-names/.hg/cache/hgtagsfnodes1 /remote-with-names/.hg/cache/tags2-served /remote-with-names/.hg/localtags /remote-with-names/.hg/requires /remote-with-names/.hg/store/00changelog.i /remote-with-names/.hg/store/00manifest.i /remote-with-names/.hg/store/data/%7E2ehgtags.i /remote-with-names/.hg/store/data/foo.i /remote/.hg/bookmarks /remote/.hg/bookmarks.current /remote/.hg/cache/branch2-base /remote/.hg/cache/branch2-immutable /remote/.hg/cache/branch2-served /remote/.hg/cache/hgtagsfnodes1 /remote/.hg/cache/rbc-names-v1 /remote/.hg/cache/tags2-served /remote/.hg/localtags /remote/.hg/requires /remote/.hg/store/00changelog.i /remote/.hg/store/00manifest.i /remote/.hg/store/data/%7E2edotfile%20with%20spaces.i /remote/.hg/store/data/%7E2ehgtags.i /remote/.hg/store/data/bar.i /remote/.hg/store/data/quux.i /remotempty/.hg/bookmarks /remotempty/.hg/bookmarks.current /remotempty/.hg/requires /remotempty/.hg/store/00changelog.i /remotempty/.hg/store/00manifest.i /sub/.hg/bookmarks /sub/.hg/bookmarks.current /sub/.hg/cache/hgtagsfnodes1 /sub/.hg/requires /sub/.hg/store/00changelog.i /sub/.hg/store/00manifest.i /sub/.hg/store/data/%7E2ehgtags.i /sub/.hg/store/data/test.i mercurial-4.5.3/tests/test-histedit-fold-non-commute.t0000644015407300116100000002127213261161234022703 0ustar augieeng00000000000000 $ . "$TESTDIR/histedit-helpers.sh" $ cat >> $HGRCPATH < [extensions] > histedit= > EOF $ modwithdate () > { > echo $1 > $1 > hg ci -m $1 -d "$2 0" > } $ initrepo () > { > hg init $1 > cd $1 > for x in a b c d e f ; do > echo $x$x$x$x$x > $x > hg add $x > done > hg ci -m 'Initial commit' > modwithdate a 1 > modwithdate b 2 > modwithdate c 3 > modwithdate d 4 > modwithdate e 5 > modwithdate f 6 > echo 'I can haz no commute' > e > hg ci -m 'does not commute with e' -d '7 0' > cd .. > } $ initrepo r $ cd r Initial generation of the command files $ EDITED="$TESTTMP/editedhistory" $ hg log --template 'pick {node|short} {rev} {desc}\n' -r 3 >> $EDITED $ hg log --template 'pick {node|short} {rev} {desc}\n' -r 4 >> $EDITED $ hg log --template 'fold {node|short} {rev} {desc}\n' -r 7 >> $EDITED $ hg log --template 'pick {node|short} {rev} {desc}\n' -r 5 >> $EDITED $ hg log --template 'pick {node|short} {rev} {desc}\n' -r 6 >> $EDITED $ cat $EDITED pick 092e4ce14829 3 c pick ae78f4c9d74f 4 d fold 42abbb61bede 7 does not commute with e pick 7f3755409b00 5 e pick dd184f2faeb0 6 f log before edit $ hg log --graph @ changeset: 7:42abbb61bede | tag: tip | user: test | date: Thu Jan 01 00:00:07 1970 +0000 | summary: does not commute with e | o changeset: 6:dd184f2faeb0 | user: test | date: Thu Jan 01 00:00:06 1970 +0000 | summary: f | o changeset: 5:7f3755409b00 | user: test | date: Thu Jan 01 00:00:05 1970 +0000 | summary: e | o changeset: 4:ae78f4c9d74f | user: test | date: Thu Jan 01 00:00:04 1970 +0000 | summary: d | o changeset: 3:092e4ce14829 | user: test | date: Thu Jan 01 00:00:03 1970 +0000 | summary: c | o changeset: 2:40ccdd8beb95 | user: test | date: Thu Jan 01 00:00:02 1970 +0000 | summary: b | o changeset: 1:cd997a145b29 | user: test | date: Thu Jan 01 00:00:01 1970 +0000 | summary: a | o changeset: 0:1715188a53c7 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Initial commit edit the history $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle 2 files updated, 0 files merged, 0 files removed, 0 files unresolved merging e warning: conflicts while merging e! (edit, then use 'hg resolve --mark') Fix up the change (fold 42abbb61bede) (hg histedit --continue to resume) fix up $ echo 'I can haz no commute' > e $ hg resolve --mark e (no more unresolved files) continue: hg histedit --continue $ HGEDITOR=cat hg histedit --continue 2>&1 | fixbundle | grep -v '2 files removed' d *** does not commute with e HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: test HG: branch 'default' HG: changed d HG: changed e merging e warning: conflicts while merging e! (edit, then use 'hg resolve --mark') Fix up the change (pick 7f3755409b00) (hg histedit --continue to resume) just continue this time keep the non-commuting change, and thus the pending change will be dropped $ hg revert -r 'p1()' e $ hg resolve --mark e (no more unresolved files) continue: hg histedit --continue $ hg diff $ hg histedit --continue 2>&1 | fixbundle 7f3755409b00: skipping changeset (no changes) log after edit $ hg log --graph @ changeset: 5:1300355b1a54 | tag: tip | user: test | date: Thu Jan 01 00:00:06 1970 +0000 | summary: f | o changeset: 4:e2ac33269083 | user: test | date: Thu Jan 01 00:00:07 1970 +0000 | summary: d | o changeset: 3:092e4ce14829 | user: test | date: Thu Jan 01 00:00:03 1970 +0000 | summary: c | o changeset: 2:40ccdd8beb95 | user: test | date: Thu Jan 01 00:00:02 1970 +0000 | summary: b | o changeset: 1:cd997a145b29 | user: test | date: Thu Jan 01 00:00:01 1970 +0000 | summary: a | o changeset: 0:1715188a53c7 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Initial commit contents of e $ hg cat e I can haz no commute manifest $ hg manifest a b c d e f $ cd .. Repeat test using "roll", not "fold". "roll" folds in changes but drops message and date $ initrepo r2 $ cd r2 Initial generation of the command files $ EDITED="$TESTTMP/editedhistory.2" $ hg log --template 'pick {node|short} {rev} {desc}\n' -r 3 >> $EDITED $ hg log --template 'pick {node|short} {rev} {desc}\n' -r 4 >> $EDITED $ hg log --template 'roll {node|short} {rev} {desc}\n' -r 7 >> $EDITED $ hg log --template 'pick {node|short} {rev} {desc}\n' -r 5 >> $EDITED $ hg log --template 'pick {node|short} {rev} {desc}\n' -r 6 >> $EDITED $ cat $EDITED pick 092e4ce14829 3 c pick ae78f4c9d74f 4 d roll 42abbb61bede 7 does not commute with e pick 7f3755409b00 5 e pick dd184f2faeb0 6 f log before edit $ hg log --graph @ changeset: 7:42abbb61bede | tag: tip | user: test | date: Thu Jan 01 00:00:07 1970 +0000 | summary: does not commute with e | o changeset: 6:dd184f2faeb0 | user: test | date: Thu Jan 01 00:00:06 1970 +0000 | summary: f | o changeset: 5:7f3755409b00 | user: test | date: Thu Jan 01 00:00:05 1970 +0000 | summary: e | o changeset: 4:ae78f4c9d74f | user: test | date: Thu Jan 01 00:00:04 1970 +0000 | summary: d | o changeset: 3:092e4ce14829 | user: test | date: Thu Jan 01 00:00:03 1970 +0000 | summary: c | o changeset: 2:40ccdd8beb95 | user: test | date: Thu Jan 01 00:00:02 1970 +0000 | summary: b | o changeset: 1:cd997a145b29 | user: test | date: Thu Jan 01 00:00:01 1970 +0000 | summary: a | o changeset: 0:1715188a53c7 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Initial commit edit the history $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle 2 files updated, 0 files merged, 0 files removed, 0 files unresolved merging e warning: conflicts while merging e! (edit, then use 'hg resolve --mark') Fix up the change (roll 42abbb61bede) (hg histedit --continue to resume) fix up $ echo 'I can haz no commute' > e $ hg resolve --mark e (no more unresolved files) continue: hg histedit --continue $ hg histedit --continue 2>&1 | fixbundle | grep -v '2 files removed' merging e warning: conflicts while merging e! (edit, then use 'hg resolve --mark') Fix up the change (pick 7f3755409b00) (hg histedit --continue to resume) just continue this time $ hg revert -r 'p1()' e $ hg resolve --mark e (no more unresolved files) continue: hg histedit --continue $ hg histedit --continue 2>&1 | fixbundle 7f3755409b00: skipping changeset (no changes) log after edit $ hg log --graph @ changeset: 5:b538bcb461be | tag: tip | user: test | date: Thu Jan 01 00:00:06 1970 +0000 | summary: f | o changeset: 4:317e37cb6d66 | user: test | date: Thu Jan 01 00:00:04 1970 +0000 | summary: d | o changeset: 3:092e4ce14829 | user: test | date: Thu Jan 01 00:00:03 1970 +0000 | summary: c | o changeset: 2:40ccdd8beb95 | user: test | date: Thu Jan 01 00:00:02 1970 +0000 | summary: b | o changeset: 1:cd997a145b29 | user: test | date: Thu Jan 01 00:00:01 1970 +0000 | summary: a | o changeset: 0:1715188a53c7 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Initial commit contents of e $ hg cat e I can haz no commute manifest $ hg manifest a b c d e f description is taken from rollup target commit $ hg log --debug --rev 4 changeset: 4:317e37cb6d66c1c84628c00e5bf4c8c292831951 phase: draft parent: 3:092e4ce14829f4974399ce4316d59f64ef0b6725 parent: -1:0000000000000000000000000000000000000000 manifest: 4:b068a323d969f22af1296ec6a5ea9384cef437ac user: test date: Thu Jan 01 00:00:04 1970 +0000 files: d e extra: branch=default extra: histedit_source=ae78f4c9d74ffa4b6cb5045001c303fe9204e890,42abbb61bede6f4366fa1e74a664343e5d558a70 description: d done with repo r2 $ cd .. mercurial-4.5.3/tests/test-inherit-mode.t0000644015407300116100000000764613261161234020302 0ustar augieeng00000000000000#require unix-permissions test that new files created in .hg inherit the permissions from .hg/store $ mkdir dir just in case somebody has a strange $TMPDIR $ chmod g-s dir $ cd dir $ cat >printmodes.py < from __future__ import absolute_import, print_function > import os > import sys > > allnames = [] > isdir = {} > for root, dirs, files in os.walk(sys.argv[1]): > for d in dirs: > name = os.path.join(root, d) > isdir[name] = 1 > allnames.append(name) > for f in files: > name = os.path.join(root, f) > allnames.append(name) > allnames.sort() > for name in allnames: > suffix = name in isdir and '/' or '' > print('%05o %s%s' % (os.lstat(name).st_mode & 0o7777, name, suffix)) > EOF $ cat >mode.py < from __future__ import absolute_import, print_function > import os > import sys > print('%05o' % os.lstat(sys.argv[1]).st_mode) > EOF $ umask 077 $ hg init repo $ cd repo $ chmod 0770 .hg/store before commit store can be written by the group, other files cannot store is setgid $ $PYTHON ../printmodes.py . 00700 ./.hg/ 00600 ./.hg/00changelog.i 00600 ./.hg/requires 00770 ./.hg/store/ $ mkdir dir $ touch foo dir/bar $ hg ci -qAm 'add files' after commit working dir files can only be written by the owner files created in .hg can be written by the group (in particular, store/**, dirstate, branch cache file, undo files) new directories are setgid $ $PYTHON ../printmodes.py . 00700 ./.hg/ 00600 ./.hg/00changelog.i 00770 ./.hg/cache/ 00660 ./.hg/cache/branch2-served 00660 ./.hg/cache/rbc-names-v1 00660 ./.hg/cache/rbc-revs-v1 00660 ./.hg/dirstate 00660 ./.hg/fsmonitor.state (fsmonitor !) 00660 ./.hg/last-message.txt 00600 ./.hg/requires 00770 ./.hg/store/ 00660 ./.hg/store/00changelog.i 00660 ./.hg/store/00manifest.i 00770 ./.hg/store/data/ 00770 ./.hg/store/data/dir/ 00660 ./.hg/store/data/dir/bar.i 00660 ./.hg/store/data/foo.i 00660 ./.hg/store/fncache 00660 ./.hg/store/phaseroots 00660 ./.hg/store/undo 00660 ./.hg/store/undo.backupfiles 00660 ./.hg/store/undo.phaseroots 00660 ./.hg/undo.backup.dirstate 00660 ./.hg/undo.bookmarks 00660 ./.hg/undo.branch 00660 ./.hg/undo.desc 00660 ./.hg/undo.dirstate 00700 ./dir/ 00600 ./dir/bar 00600 ./foo $ umask 007 $ hg init ../push before push group can write everything $ $PYTHON ../printmodes.py ../push 00770 ../push/.hg/ 00660 ../push/.hg/00changelog.i 00660 ../push/.hg/requires 00770 ../push/.hg/store/ $ umask 077 $ hg -q push ../push after push group can still write everything $ $PYTHON ../printmodes.py ../push 00770 ../push/.hg/ 00660 ../push/.hg/00changelog.i 00770 ../push/.hg/cache/ 00660 ../push/.hg/cache/branch2-base 00660 ../push/.hg/dirstate 00660 ../push/.hg/requires 00770 ../push/.hg/store/ 00660 ../push/.hg/store/00changelog.i 00660 ../push/.hg/store/00manifest.i 00770 ../push/.hg/store/data/ 00770 ../push/.hg/store/data/dir/ 00660 ../push/.hg/store/data/dir/bar.i 00660 ../push/.hg/store/data/foo.i 00660 ../push/.hg/store/fncache 00660 ../push/.hg/store/undo 00660 ../push/.hg/store/undo.backupfiles 00660 ../push/.hg/store/undo.phaseroots 00660 ../push/.hg/undo.bookmarks 00660 ../push/.hg/undo.branch 00660 ../push/.hg/undo.desc 00660 ../push/.hg/undo.dirstate Test that we don't lose the setgid bit when we call chmod. Not all systems support setgid directories (e.g. HFS+), so just check that directories have the same mode. $ cd .. $ hg init setgid $ cd setgid $ chmod g+rwx .hg/store $ chmod g+s .hg/store 2> /dev/null || true $ mkdir dir $ touch dir/file $ hg ci -qAm 'add dir/file' $ storemode=`$PYTHON ../mode.py .hg/store` $ dirmode=`$PYTHON ../mode.py .hg/store/data/dir` $ if [ "$storemode" != "$dirmode" ]; then > echo "$storemode != $dirmode" > fi $ cd .. $ cd .. # g-s dir mercurial-4.5.3/tests/test-bisect.t0000644015407300116100000004472113261161234017162 0ustar augieeng00000000000000 $ hg init committing changes $ count=0 $ echo > a $ while test $count -lt 32 ; do > echo 'a' >> a > test $count -eq 0 && hg add > hg ci -m "msg $count" -d "$count 0" > count=`expr $count + 1` > done adding a $ hg log changeset: 31:58c80a7c8a40 tag: tip user: test date: Thu Jan 01 00:00:31 1970 +0000 summary: msg 31 changeset: 30:ed2d2f24b11c user: test date: Thu Jan 01 00:00:30 1970 +0000 summary: msg 30 changeset: 29:b5bd63375ab9 user: test date: Thu Jan 01 00:00:29 1970 +0000 summary: msg 29 changeset: 28:8e0c2264c8af user: test date: Thu Jan 01 00:00:28 1970 +0000 summary: msg 28 changeset: 27:288867a866e9 user: test date: Thu Jan 01 00:00:27 1970 +0000 summary: msg 27 changeset: 26:3efc6fd51aeb user: test date: Thu Jan 01 00:00:26 1970 +0000 summary: msg 26 changeset: 25:02a84173a97a user: test date: Thu Jan 01 00:00:25 1970 +0000 summary: msg 25 changeset: 24:10e0acd3809e user: test date: Thu Jan 01 00:00:24 1970 +0000 summary: msg 24 changeset: 23:5ec79163bff4 user: test date: Thu Jan 01 00:00:23 1970 +0000 summary: msg 23 changeset: 22:06c7993750ce user: test date: Thu Jan 01 00:00:22 1970 +0000 summary: msg 22 changeset: 21:e5db6aa3fe2a user: test date: Thu Jan 01 00:00:21 1970 +0000 summary: msg 21 changeset: 20:7128fb4fdbc9 user: test date: Thu Jan 01 00:00:20 1970 +0000 summary: msg 20 changeset: 19:52798545b482 user: test date: Thu Jan 01 00:00:19 1970 +0000 summary: msg 19 changeset: 18:86977a90077e user: test date: Thu Jan 01 00:00:18 1970 +0000 summary: msg 18 changeset: 17:03515f4a9080 user: test date: Thu Jan 01 00:00:17 1970 +0000 summary: msg 17 changeset: 16:a2e6ea4973e9 user: test date: Thu Jan 01 00:00:16 1970 +0000 summary: msg 16 changeset: 15:e7fa0811edb0 user: test date: Thu Jan 01 00:00:15 1970 +0000 summary: msg 15 changeset: 14:ce8f0998e922 user: test date: Thu Jan 01 00:00:14 1970 +0000 summary: msg 14 changeset: 13:9d7d07bc967c user: test date: Thu Jan 01 00:00:13 1970 +0000 summary: msg 13 changeset: 12:1941b52820a5 user: test date: Thu Jan 01 00:00:12 1970 +0000 summary: msg 12 changeset: 11:7b4cd9578619 user: test date: Thu Jan 01 00:00:11 1970 +0000 summary: msg 11 changeset: 10:7c5eff49a6b6 user: test date: Thu Jan 01 00:00:10 1970 +0000 summary: msg 10 changeset: 9:eb44510ef29a user: test date: Thu Jan 01 00:00:09 1970 +0000 summary: msg 9 changeset: 8:453eb4dba229 user: test date: Thu Jan 01 00:00:08 1970 +0000 summary: msg 8 changeset: 7:03750880c6b5 user: test date: Thu Jan 01 00:00:07 1970 +0000 summary: msg 7 changeset: 6:a3d5c6fdf0d3 user: test date: Thu Jan 01 00:00:06 1970 +0000 summary: msg 6 changeset: 5:7874a09ea728 user: test date: Thu Jan 01 00:00:05 1970 +0000 summary: msg 5 changeset: 4:9b2ba8336a65 user: test date: Thu Jan 01 00:00:04 1970 +0000 summary: msg 4 changeset: 3:b53bea5e2fcb user: test date: Thu Jan 01 00:00:03 1970 +0000 summary: msg 3 changeset: 2:db07c04beaca user: test date: Thu Jan 01 00:00:02 1970 +0000 summary: msg 2 changeset: 1:5cd978ea5149 user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: msg 1 changeset: 0:b99c7b9c8e11 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: msg 0 $ hg up -C 0 files updated, 0 files merged, 0 files removed, 0 files unresolved bisect test $ hg bisect -r $ hg bisect -b $ hg status -v # The repository is in an unfinished *bisect* state. # To mark the changeset good: hg bisect --good # To mark the changeset bad: hg bisect --bad # To abort: hg bisect --reset $ hg status -v --config commands.status.skipstates=bisect $ hg summary parent: 31:58c80a7c8a40 tip msg 31 branch: default commit: (clean) update: (current) phases: 32 draft $ hg bisect -g 1 Testing changeset 16:a2e6ea4973e9 (30 changesets remaining, ~4 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -g Testing changeset 23:5ec79163bff4 (15 changesets remaining, ~3 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved skip $ hg bisect -s Testing changeset 24:10e0acd3809e (15 changesets remaining, ~3 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -g Testing changeset 27:288867a866e9 (7 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -g Testing changeset 29:b5bd63375ab9 (4 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -b Testing changeset 28:8e0c2264c8af (2 changesets remaining, ~1 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -g The first bad revision is: changeset: 29:b5bd63375ab9 user: test date: Thu Jan 01 00:00:29 1970 +0000 summary: msg 29 mark revsets instead of single revs $ hg bisect -r $ hg bisect -b "0::3" $ hg bisect -s "13::16" $ hg bisect -g "26::tip" Testing changeset 12:1941b52820a5 (23 changesets remaining, ~4 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat .hg/bisect.state bad b99c7b9c8e11558adef3fad9af211c58d46f325b bad 5cd978ea51499179507ee7b6f340d2dbaa401185 bad db07c04beaca44cf24832541e7f4a2346a95275b bad b53bea5e2fcb30d3e00bd3409507a5659ce0fd8b current 1941b52820a544549596820a8ae006842b0e2c64 good 3efc6fd51aeb8594398044c6c846ca59ae021203 good 288867a866e9adb7a29880b66936c874b80f4651 good 8e0c2264c8af790daf3585ada0669d93dee09c83 good b5bd63375ab9a290419f2024b7f4ee9ea7ce90a8 good ed2d2f24b11c368fa8aa0da9f4e1db580abade59 good 58c80a7c8a4025a94cedaf7b4a4e3124e8909a96 skip 9d7d07bc967ca98ad0600c24953fd289ad5fa991 skip ce8f0998e922c179e80819d5066fbe46e2998784 skip e7fa0811edb063f6319531f0d0a865882138e180 skip a2e6ea4973e9196ddd3386493b0c214b41fd97d3 bisect reverse test $ hg bisect -r $ hg bisect -b null $ hg bisect -g tip Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -g Testing changeset 7:03750880c6b5 (16 changesets remaining, ~4 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved skip $ hg bisect -s Testing changeset 6:a3d5c6fdf0d3 (16 changesets remaining, ~4 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -g Testing changeset 2:db07c04beaca (7 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -g Testing changeset 0:b99c7b9c8e11 (3 changesets remaining, ~1 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -b Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -g The first good revision is: changeset: 1:5cd978ea5149 user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: msg 1 $ hg bisect -r $ hg bisect -g tip $ hg bisect -b tip abort: inconsistent state, 31:58c80a7c8a40 is good and bad [255] $ hg bisect -r $ hg bisect -g null $ hg bisect -bU tip Testing changeset 15:e7fa0811edb0 (32 changesets remaining, ~5 tests) $ hg id 5cd978ea5149 Issue1228: hg bisect crashes when you skip the last rev in bisection Issue1182: hg bisect exception $ hg bisect -r $ hg bisect -b 4 $ hg bisect -g 0 Testing changeset 2:db07c04beaca (4 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -s Testing changeset 1:5cd978ea5149 (4 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -s Testing changeset 3:b53bea5e2fcb (4 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -s Due to skipped revisions, the first bad revision could be any of: changeset: 1:5cd978ea5149 user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: msg 1 changeset: 2:db07c04beaca user: test date: Thu Jan 01 00:00:02 1970 +0000 summary: msg 2 changeset: 3:b53bea5e2fcb user: test date: Thu Jan 01 00:00:03 1970 +0000 summary: msg 3 changeset: 4:9b2ba8336a65 user: test date: Thu Jan 01 00:00:04 1970 +0000 summary: msg 4 reproduce non converging bisect, issue1182 $ hg bisect -r $ hg bisect -g 0 $ hg bisect -b 2 Testing changeset 1:5cd978ea5149 (2 changesets remaining, ~1 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -s Due to skipped revisions, the first bad revision could be any of: changeset: 1:5cd978ea5149 user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: msg 1 changeset: 2:db07c04beaca user: test date: Thu Jan 01 00:00:02 1970 +0000 summary: msg 2 test no action $ hg bisect -r $ hg bisect abort: cannot bisect (no known good revisions) [255] reproduce AssertionError, issue1445 $ hg bisect -r $ hg bisect -b 6 $ hg bisect -g 0 Testing changeset 3:b53bea5e2fcb (6 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -s Testing changeset 2:db07c04beaca (6 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -s Testing changeset 4:9b2ba8336a65 (6 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -s Testing changeset 1:5cd978ea5149 (6 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -s Testing changeset 5:7874a09ea728 (6 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect -g The first bad revision is: changeset: 6:a3d5c6fdf0d3 user: test date: Thu Jan 01 00:00:06 1970 +0000 summary: msg 6 $ hg log -r "bisect(good)" changeset: 0:b99c7b9c8e11 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: msg 0 changeset: 5:7874a09ea728 user: test date: Thu Jan 01 00:00:05 1970 +0000 summary: msg 5 $ hg log -r "bisect(bad)" changeset: 6:a3d5c6fdf0d3 user: test date: Thu Jan 01 00:00:06 1970 +0000 summary: msg 6 $ hg log -r "bisect(current)" changeset: 5:7874a09ea728 user: test date: Thu Jan 01 00:00:05 1970 +0000 summary: msg 5 $ hg log -r "bisect(skip)" changeset: 1:5cd978ea5149 user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: msg 1 changeset: 2:db07c04beaca user: test date: Thu Jan 01 00:00:02 1970 +0000 summary: msg 2 changeset: 3:b53bea5e2fcb user: test date: Thu Jan 01 00:00:03 1970 +0000 summary: msg 3 changeset: 4:9b2ba8336a65 user: test date: Thu Jan 01 00:00:04 1970 +0000 summary: msg 4 test legacy bisected() keyword $ hg log -r "bisected(bad)" changeset: 6:a3d5c6fdf0d3 user: test date: Thu Jan 01 00:00:06 1970 +0000 summary: msg 6 $ set +e test invalid command assuming that the shell returns 127 if command not found ... $ hg bisect -r $ hg bisect --command 'exit 127' abort: failed to execute exit 127 [255] test bisecting command $ cat > script.py < #!$PYTHON > from __future__ import absolute_import > import sys > from mercurial import hg, ui as uimod > repo = hg.repository(uimod.ui.load(), '.') > if repo['.'].rev() < 6: > sys.exit(1) > EOF $ chmod +x script.py $ hg bisect -r $ hg up -qr tip $ hg bisect --command "\"$PYTHON\" \"$TESTTMP/script.py\" and some parameters" changeset 31:58c80a7c8a40: good abort: cannot bisect (no known bad revisions) [255] $ hg up -qr 0 $ hg bisect --command "\"$PYTHON\" \"$TESTTMP/script.py\" and some parameters" changeset 0:b99c7b9c8e11: bad changeset 15:e7fa0811edb0: good changeset 7:03750880c6b5: good changeset 3:b53bea5e2fcb: bad changeset 5:7874a09ea728: bad changeset 6:a3d5c6fdf0d3: good The first good revision is: changeset: 6:a3d5c6fdf0d3 user: test date: Thu Jan 01 00:00:06 1970 +0000 summary: msg 6 test bisecting via a command without updating the working dir, and ensure that the bisect state file is updated before running a test command $ hg update null 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ cat > script.sh <<'EOF' > #!/bin/sh > test -n "$HG_NODE" || (echo HG_NODE missing; exit 127) > current="`hg log -r \"bisect(current)\" --template {node}`" > test "$current" = "$HG_NODE" || (echo current is bad: $current; exit 127) > rev="`hg log -r $HG_NODE --template {rev}`" > test "$rev" -ge 6 > EOF $ chmod +x script.sh $ hg bisect -r $ hg bisect --good tip --noupdate $ hg bisect --bad 0 --noupdate Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests) $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params" --noupdate changeset 15:e7fa0811edb0: good changeset 7:03750880c6b5: good changeset 3:b53bea5e2fcb: bad changeset 5:7874a09ea728: bad changeset 6:a3d5c6fdf0d3: good The first good revision is: changeset: 6:a3d5c6fdf0d3 user: test date: Thu Jan 01 00:00:06 1970 +0000 summary: msg 6 ensure that we still don't have a working dir $ hg parents test the same case, this time with updating $ cat > script.sh <<'EOF' > #!/bin/sh > test -n "$HG_NODE" || (echo HG_NODE missing; exit 127) > current="`hg log -r \"bisect(current)\" --template {node}`" > test "$current" = "$HG_NODE" || (echo current is bad: $current; exit 127) > rev="`hg log -r . --template {rev}`" > test "$rev" -ge 6 > EOF $ chmod +x script.sh $ hg bisect -r $ hg up -qr tip $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params" changeset 31:58c80a7c8a40: good abort: cannot bisect (no known bad revisions) [255] $ hg up -qr 0 $ hg bisect --command "sh \"$TESTTMP/script.sh\" and some params" changeset 0:b99c7b9c8e11: bad changeset 15:e7fa0811edb0: good changeset 7:03750880c6b5: good changeset 3:b53bea5e2fcb: bad changeset 5:7874a09ea728: bad changeset 6:a3d5c6fdf0d3: good The first good revision is: changeset: 6:a3d5c6fdf0d3 user: test date: Thu Jan 01 00:00:06 1970 +0000 summary: msg 6 $ hg graft -q 15 warning: conflicts while merging a! (edit, then use 'hg resolve --mark') abort: unresolved conflicts, can't continue (use 'hg resolve' and 'hg graft --continue') [255] $ hg bisect --reset $ hg up -C . 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Check that bisect does not break on obsolete changesets ========================================================= $ cat >> $HGRCPATH << EOF > [experimental] > evolution.createmarkers=True > EOF tip is obsolete --------------------- $ hg debugobsolete `hg id --debug -i -r tip` obsoleted 1 changesets $ hg bisect --reset $ hg bisect --good 15 $ hg bisect --bad 30 Testing changeset 22:06c7993750ce (15 changesets remaining, ~3 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect --command true changeset 22:06c7993750ce: good changeset 26:3efc6fd51aeb: good changeset 28:8e0c2264c8af: good changeset 29:b5bd63375ab9: good The first bad revision is: changeset: 30:ed2d2f24b11c tag: tip user: test date: Thu Jan 01 00:00:30 1970 +0000 summary: msg 30 Changeset in the bad:good range is obsolete --------------------------------------------- $ hg up 30 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 'a' >> a $ hg ci -m "msg 32" -d "32 0" $ hg bisect --reset $ hg bisect --good . $ hg bisect --bad 25 Testing changeset 28:8e0c2264c8af (6 changesets remaining, ~2 tests) 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg bisect --command true changeset 28:8e0c2264c8af: good changeset 26:3efc6fd51aeb: good The first good revision is: changeset: 26:3efc6fd51aeb user: test date: Thu Jan 01 00:00:26 1970 +0000 summary: msg 26 Test the validation message when exclusive options are used: $ hg bisect -r $ hg bisect -b -c false abort: --bad and --command are incompatible [255] $ hg bisect -b -e abort: --bad and --extend are incompatible [255] $ hg bisect -b -g abort: --bad and --good are incompatible [255] $ hg bisect -b -r abort: --bad and --reset are incompatible [255] $ hg bisect -b -s abort: --bad and --skip are incompatible [255] $ hg bisect -c false -e abort: --command and --extend are incompatible [255] $ hg bisect -c false -g abort: --command and --good are incompatible [255] $ hg bisect -c false -r abort: --command and --reset are incompatible [255] $ hg bisect -c false -s abort: --command and --skip are incompatible [255] $ hg bisect -e -g abort: --extend and --good are incompatible [255] $ hg bisect -e -r abort: --extend and --reset are incompatible [255] $ hg bisect -e -s abort: --extend and --skip are incompatible [255] $ hg bisect -g -r abort: --good and --reset are incompatible [255] $ hg bisect -g -s abort: --good and --skip are incompatible [255] $ hg bisect -r -s abort: --reset and --skip are incompatible [255] mercurial-4.5.3/tests/svn-safe-append.py0000755015407300116100000000102513261161234020101 0ustar augieeng00000000000000#!/usr/bin/env python from __future__ import absolute_import __doc__ = """Same as `echo a >> b`, but ensures a changed mtime of b. Without this svn will not detect workspace changes.""" import os import sys text = sys.argv[1] fname = sys.argv[2] f = open(fname, "ab") try: before = os.fstat(f.fileno()).st_mtime f.write(text) f.write("\n") finally: f.close() inc = 1 now = os.stat(fname).st_mtime while now == before: t = now + inc inc += 1 os.utime(fname, (t, t)) now = os.stat(fname).st_mtime mercurial-4.5.3/tests/test-churn.t0000644015407300116100000001322313261161234017021 0ustar augieeng00000000000000 $ echo "[extensions]" >> $HGRCPATH $ echo "churn=" >> $HGRCPATH create test repository $ hg init repo $ cd repo $ echo a > a $ hg ci -Am adda -u user1 -d 6:00 adding a $ echo b >> a $ echo b > b $ hg ci -m changeba -u user2 -d 9:00 a $ hg ci -Am addb -u user2 -d 9:30 adding b $ echo c >> a $ echo c >> b $ echo c > c $ hg ci -m changeca -u user3 -d 12:00 a $ hg ci -m changecb -u user3 -d 12:15 b $ hg ci -Am addc -u user3 -d 12:30 adding c $ mkdir -p d/e $ echo abc > d/e/f1.txt $ hg ci -Am "add d/e/f1.txt" -u user1 -d 12:45 d/e/f1.txt $ mkdir -p d/g $ echo def > d/g/f2.txt $ hg ci -Am "add d/g/f2.txt" -u user1 -d 13:00 d/g/f2.txt churn separate directories $ cd d $ hg churn e user1 1 *************************************************************** churn all $ hg churn user1 3 *************************************************************** user3 3 *************************************************************** user2 2 ****************************************** churn excluding one dir $ hg churn -X e user3 3 *************************************************************** user1 2 ****************************************** user2 2 ****************************************** churn up to rev 2 $ hg churn -r :2 user2 2 *************************************************************** user1 1 ******************************** $ cd .. churn with aliases $ cat > ../aliases < user1 alias1 > user3 alias3 > not-an-alias > EOF churn with .hgchurn $ mv ../aliases .hgchurn $ hg churn skipping malformed alias: not-an-alias alias1 3 ************************************************************** alias3 3 ************************************************************** user2 2 ***************************************** $ rm .hgchurn churn with column specifier $ COLUMNS=40 hg churn user1 3 *********************** user3 3 *********************** user2 2 *************** churn by hour $ hg churn -f '%H' -s 06 1 ***************** 09 2 ********************************* 12 4 ****************************************************************** 13 1 ***************** churn with separated added/removed lines $ hg rm d/g/f2.txt $ hg ci -Am "removed d/g/f2.txt" -u user1 -d 14:00 d/g/f2.txt $ hg churn --diffstat user1 +3/-1 +++++++++++++++++++++++++++++++++++++++++-------------- user3 +3/-0 +++++++++++++++++++++++++++++++++++++++++ user2 +2/-0 +++++++++++++++++++++++++++ churn --diffstat with color $ hg --config extensions.color= churn --config color.mode=ansi \ > --diffstat --color=always user1 +3/-1 \x1b[0;32m+++++++++++++++++++++++++++++++++++++++++\x1b[0m\x1b[0;31m--------------\x1b[0m (esc) user3 +3/-0 \x1b[0;32m+++++++++++++++++++++++++++++++++++++++++\x1b[0m (esc) user2 +2/-0 \x1b[0;32m+++++++++++++++++++++++++++\x1b[0m (esc) changeset number churn $ hg churn -c user1 4 *************************************************************** user3 3 *********************************************** user2 2 ******************************** $ echo 'with space = no-space' >> ../aliases $ echo a >> a $ hg commit -m a -u 'with space' -d 15:00 churn with space in alias $ hg churn --aliases ../aliases -r tip no-space 1 ************************************************************ $ cd .. Issue833: ZeroDivisionError $ hg init issue-833 $ cd issue-833 $ touch foo $ hg ci -Am foo adding foo this was failing with a ZeroDivisionError $ hg churn test 0 $ cd .. Ignore trailing or leading spaces in emails $ cd repo $ touch bar $ hg ci -Am'bar' -u 'user4 ' adding bar $ touch foo $ hg ci -Am'foo' -u 'user4 < user4@x.com >' adding foo $ hg log -l2 --template '[{author|email}]\n' [ user4@x.com ] [user4@x.com] $ hg churn -c user1 4 ********************************************************* user3 3 ******************************************* user2 2 ***************************** user4@x.com 2 ***************************** with space 1 ************** Test multibyte sequences in names $ echo bar >> bar $ hg --encoding utf-8 ci -m'changed bar' -u 'El Niño ' $ hg --encoding utf-8 churn -ct '{author|person}' user1 4 ********************************************************** user3 3 ******************************************** user2 2 ***************************** user4 2 ***************************** El Ni\xc3\xb1o 1 *************** (esc) with space 1 *************** Test --template argument, with backwards compatibility $ hg churn -t '{author|user}' user1 4 *************************************************************** user3 3 *********************************************** user2 2 ******************************** nino 1 **************** with 1 **************** 0 user4 0 $ hg churn -T '{author|user}' user1 4 *************************************************************** user3 3 *********************************************** user2 2 ******************************** nino 1 **************** with 1 **************** 0 user4 0 $ hg churn -t 'alltogether' alltogether 11 ********************************************************* $ hg churn -T 'alltogether' alltogether 11 ********************************************************* $ cd .. mercurial-4.5.3/tests/run-tests.py0000755015407300116100000033623413261161234017073 0ustar augieeng00000000000000#!/usr/bin/env python # # run-tests.py - Run a set of tests on Mercurial # # Copyright 2006 Matt Mackall # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. # Modifying this script is tricky because it has many modes: # - serial (default) vs parallel (-jN, N > 1) # - no coverage (default) vs coverage (-c, -C, -s) # - temp install (default) vs specific hg script (--with-hg, --local) # - tests are a mix of shell scripts and Python scripts # # If you change this script, it is recommended that you ensure you # haven't broken it by running it in various modes with a representative # sample of test scripts. For example: # # 1) serial, no coverage, temp install: # ./run-tests.py test-s* # 2) serial, no coverage, local hg: # ./run-tests.py --local test-s* # 3) serial, coverage, temp install: # ./run-tests.py -c test-s* # 4) serial, coverage, local hg: # ./run-tests.py -c --local test-s* # unsupported # 5) parallel, no coverage, temp install: # ./run-tests.py -j2 test-s* # 6) parallel, no coverage, local hg: # ./run-tests.py -j2 --local test-s* # 7) parallel, coverage, temp install: # ./run-tests.py -j2 -c test-s* # currently broken # 8) parallel, coverage, local install: # ./run-tests.py -j2 -c --local test-s* # unsupported (and broken) # 9) parallel, custom tmp dir: # ./run-tests.py -j2 --tmpdir /tmp/myhgtests # 10) parallel, pure, tests that call run-tests: # ./run-tests.py --pure `grep -l run-tests.py *.t` # # (You could use any subset of the tests: test-s* happens to match # enough that it's worth doing parallel runs, few enough that it # completes fairly quickly, includes both shell and Python scripts, and # includes some scripts that run daemon processes.) from __future__ import absolute_import, print_function import argparse import collections import difflib import distutils.version as version import errno import json import os import random import re import shutil import signal import socket import subprocess import sys import sysconfig import tempfile import threading import time import unittest import xml.dom.minidom as minidom try: import Queue as queue except ImportError: import queue try: import shlex shellquote = shlex.quote except (ImportError, AttributeError): import pipes shellquote = pipes.quote if os.environ.get('RTUNICODEPEDANTRY', False): try: reload(sys) sys.setdefaultencoding("undefined") except NameError: pass origenviron = os.environ.copy() osenvironb = getattr(os, 'environb', os.environ) processlock = threading.Lock() pygmentspresent = False # ANSI color is unsupported prior to Windows 10 if os.name != 'nt': try: # is pygments installed import pygments import pygments.lexers as lexers import pygments.lexer as lexer import pygments.formatters as formatters import pygments.token as token import pygments.style as style pygmentspresent = True difflexer = lexers.DiffLexer() terminal256formatter = formatters.Terminal256Formatter() except ImportError: pass if pygmentspresent: class TestRunnerStyle(style.Style): default_style = "" skipped = token.string_to_tokentype("Token.Generic.Skipped") failed = token.string_to_tokentype("Token.Generic.Failed") skippedname = token.string_to_tokentype("Token.Generic.SName") failedname = token.string_to_tokentype("Token.Generic.FName") styles = { skipped: '#e5e5e5', skippedname: '#00ffff', failed: '#7f0000', failedname: '#ff0000', } class TestRunnerLexer(lexer.RegexLexer): tokens = { 'root': [ (r'^Skipped', token.Generic.Skipped, 'skipped'), (r'^Failed ', token.Generic.Failed, 'failed'), (r'^ERROR: ', token.Generic.Failed, 'failed'), ], 'skipped': [ (r'[\w-]+\.(t|py)', token.Generic.SName), (r':.*', token.Generic.Skipped), ], 'failed': [ (r'[\w-]+\.(t|py)', token.Generic.FName), (r'(:| ).*', token.Generic.Failed), ] } runnerformatter = formatters.Terminal256Formatter(style=TestRunnerStyle) runnerlexer = TestRunnerLexer() if sys.version_info > (3, 5, 0): PYTHON3 = True xrange = range # we use xrange in one place, and we'd rather not use range def _bytespath(p): if p is None: return p return p.encode('utf-8') def _strpath(p): if p is None: return p return p.decode('utf-8') elif sys.version_info >= (3, 0, 0): print('%s is only supported on Python 3.5+ and 2.7, not %s' % (sys.argv[0], '.'.join(str(v) for v in sys.version_info[:3]))) sys.exit(70) # EX_SOFTWARE from `man 3 sysexit` else: PYTHON3 = False # In python 2.x, path operations are generally done using # bytestrings by default, so we don't have to do any extra # fiddling there. We define the wrapper functions anyway just to # help keep code consistent between platforms. def _bytespath(p): return p _strpath = _bytespath # For Windows support wifexited = getattr(os, "WIFEXITED", lambda x: False) # Whether to use IPv6 def checksocketfamily(name, port=20058): """return true if we can listen on localhost using family=name name should be either 'AF_INET', or 'AF_INET6'. port being used is okay - EADDRINUSE is considered as successful. """ family = getattr(socket, name, None) if family is None: return False try: s = socket.socket(family, socket.SOCK_STREAM) s.bind(('localhost', port)) s.close() return True except socket.error as exc: if exc.errno == errno.EADDRINUSE: return True elif exc.errno in (errno.EADDRNOTAVAIL, errno.EPROTONOSUPPORT): return False else: raise else: return False # useipv6 will be set by parseargs useipv6 = None def checkportisavailable(port): """return true if a port seems free to bind on localhost""" if useipv6: family = socket.AF_INET6 else: family = socket.AF_INET try: s = socket.socket(family, socket.SOCK_STREAM) s.bind(('localhost', port)) s.close() return True except socket.error as exc: if exc.errno not in (errno.EADDRINUSE, errno.EADDRNOTAVAIL, errno.EPROTONOSUPPORT): raise return False closefds = os.name == 'posix' def Popen4(cmd, wd, timeout, env=None): processlock.acquire() p = subprocess.Popen(cmd, shell=True, bufsize=-1, cwd=wd, env=env, close_fds=closefds, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) processlock.release() p.fromchild = p.stdout p.tochild = p.stdin p.childerr = p.stderr p.timeout = False if timeout: def t(): start = time.time() while time.time() - start < timeout and p.returncode is None: time.sleep(.1) p.timeout = True if p.returncode is None: terminate(p) threading.Thread(target=t).start() return p PYTHON = _bytespath(sys.executable.replace('\\', '/')) IMPL_PATH = b'PYTHONPATH' if 'java' in sys.platform: IMPL_PATH = b'JYTHONPATH' defaults = { 'jobs': ('HGTEST_JOBS', 1), 'timeout': ('HGTEST_TIMEOUT', 180), 'slowtimeout': ('HGTEST_SLOWTIMEOUT', 500), 'port': ('HGTEST_PORT', 20059), 'shell': ('HGTEST_SHELL', 'sh'), } def canonpath(path): return os.path.realpath(os.path.expanduser(path)) def parselistfiles(files, listtype, warn=True): entries = dict() for filename in files: try: path = os.path.expanduser(os.path.expandvars(filename)) f = open(path, "rb") except IOError as err: if err.errno != errno.ENOENT: raise if warn: print("warning: no such %s file: %s" % (listtype, filename)) continue for line in f.readlines(): line = line.split(b'#', 1)[0].strip() if line: entries[line] = filename f.close() return entries def parsettestcases(path): """read a .t test file, return a set of test case names If path does not exist, return an empty set. """ cases = set() try: with open(path, 'rb') as f: for l in f: if l.startswith(b'#testcases '): cases.update(l[11:].split()) except IOError as ex: if ex.errno != errno.ENOENT: raise return cases def getparser(): """Obtain the OptionParser used by the CLI.""" parser = argparse.ArgumentParser(usage='%(prog)s [options] [tests]') selection = parser.add_argument_group('Test Selection') selection.add_argument('--allow-slow-tests', action='store_true', help='allow extremely slow tests') selection.add_argument("--blacklist", action="append", help="skip tests listed in the specified blacklist file") selection.add_argument("--changed", help="run tests that are changed in parent rev or working directory") selection.add_argument("-k", "--keywords", help="run tests matching keywords") selection.add_argument("-r", "--retest", action="store_true", help = "retest failed tests") selection.add_argument("--test-list", action="append", help="read tests to run from the specified file") selection.add_argument("--whitelist", action="append", help="always run tests listed in the specified whitelist file") selection.add_argument('tests', metavar='TESTS', nargs='*', help='Tests to run') harness = parser.add_argument_group('Test Harness Behavior') harness.add_argument('--bisect-repo', metavar='bisect_repo', help=("Path of a repo to bisect. Use together with " "--known-good-rev")) harness.add_argument("-d", "--debug", action="store_true", help="debug mode: write output of test scripts to console" " rather than capturing and diffing it (disables timeout)") harness.add_argument("-f", "--first", action="store_true", help="exit on the first test failure") harness.add_argument("-i", "--interactive", action="store_true", help="prompt to accept changed output") harness.add_argument("-j", "--jobs", type=int, help="number of jobs to run in parallel" " (default: $%s or %d)" % defaults['jobs']) harness.add_argument("--keep-tmpdir", action="store_true", help="keep temporary directory after running tests") harness.add_argument('--known-good-rev', metavar="known_good_rev", help=("Automatically bisect any failures using this " "revision as a known-good revision.")) harness.add_argument("--list-tests", action="store_true", help="list tests instead of running them") harness.add_argument("--loop", action="store_true", help="loop tests repeatedly") harness.add_argument('--random', action="store_true", help='run tests in random order') harness.add_argument("-p", "--port", type=int, help="port on which servers should listen" " (default: $%s or %d)" % defaults['port']) harness.add_argument('--profile-runner', action='store_true', help='run statprof on run-tests') harness.add_argument("-R", "--restart", action="store_true", help="restart at last error") harness.add_argument("--runs-per-test", type=int, dest="runs_per_test", help="run each test N times (default=1)", default=1) harness.add_argument("--shell", help="shell to use (default: $%s or %s)" % defaults['shell']) harness.add_argument('--showchannels', action='store_true', help='show scheduling channels') harness.add_argument("--slowtimeout", type=int, help="kill errant slow tests after SLOWTIMEOUT seconds" " (default: $%s or %d)" % defaults['slowtimeout']) harness.add_argument("-t", "--timeout", type=int, help="kill errant tests after TIMEOUT seconds" " (default: $%s or %d)" % defaults['timeout']) harness.add_argument("--tmpdir", help="run tests in the given temporary directory" " (implies --keep-tmpdir)") harness.add_argument("-v", "--verbose", action="store_true", help="output verbose messages") hgconf = parser.add_argument_group('Mercurial Configuration') hgconf.add_argument("--chg", action="store_true", help="install and use chg wrapper in place of hg") hgconf.add_argument("--compiler", help="compiler to build with") hgconf.add_argument('--extra-config-opt', action="append", default=[], help='set the given config opt in the test hgrc') hgconf.add_argument("-l", "--local", action="store_true", help="shortcut for --with-hg=/../hg, " "and --with-chg=/../contrib/chg/chg if --chg is set") hgconf.add_argument("--ipv6", action="store_true", help="prefer IPv6 to IPv4 for network related tests") hgconf.add_argument("--pure", action="store_true", help="use pure Python code instead of C extensions") hgconf.add_argument("-3", "--py3k-warnings", action="store_true", help="enable Py3k warnings on Python 2.7+") hgconf.add_argument("--with-chg", metavar="CHG", help="use specified chg wrapper in place of hg") hgconf.add_argument("--with-hg", metavar="HG", help="test using specified hg script rather than a " "temporary installation") # This option should be deleted once test-check-py3-compat.t and other # Python 3 tests run with Python 3. hgconf.add_argument("--with-python3", metavar="PYTHON3", help="Python 3 interpreter (if running under Python 2)" " (TEMPORARY)") reporting = parser.add_argument_group('Results Reporting') reporting.add_argument("-C", "--annotate", action="store_true", help="output files annotated with coverage") reporting.add_argument("--color", choices=["always", "auto", "never"], default=os.environ.get('HGRUNTESTSCOLOR', 'auto'), help="colorisation: always|auto|never (default: auto)") reporting.add_argument("-c", "--cover", action="store_true", help="print a test coverage report") reporting.add_argument('--exceptions', action='store_true', help='log all exceptions and generate an exception report') reporting.add_argument("-H", "--htmlcov", action="store_true", help="create an HTML report of the coverage of the files") reporting.add_argument("--json", action="store_true", help="store test result data in 'report.json' file") reporting.add_argument("--outputdir", help="directory to write error logs to (default=test directory)") reporting.add_argument("-n", "--nodiff", action="store_true", help="skip showing test changes") reporting.add_argument("-S", "--noskips", action="store_true", help="don't report skip tests verbosely") reporting.add_argument("--time", action="store_true", help="time how long each test takes") reporting.add_argument("--view", help="external diff viewer") reporting.add_argument("--xunit", help="record xunit results at specified path") for option, (envvar, default) in defaults.items(): defaults[option] = type(default)(os.environ.get(envvar, default)) parser.set_defaults(**defaults) return parser def parseargs(args, parser): """Parse arguments with our OptionParser and validate results.""" options = parser.parse_args(args) # jython is always pure if 'java' in sys.platform or '__pypy__' in sys.modules: options.pure = True if options.with_hg: options.with_hg = canonpath(_bytespath(options.with_hg)) if not (os.path.isfile(options.with_hg) and os.access(options.with_hg, os.X_OK)): parser.error('--with-hg must specify an executable hg script') if os.path.basename(options.with_hg) not in [b'hg', b'hg.exe']: sys.stderr.write('warning: --with-hg should specify an hg script\n') if options.local: testdir = os.path.dirname(_bytespath(canonpath(sys.argv[0]))) reporootdir = os.path.dirname(testdir) pathandattrs = [(b'hg', 'with_hg')] if options.chg: pathandattrs.append((b'contrib/chg/chg', 'with_chg')) for relpath, attr in pathandattrs: binpath = os.path.join(reporootdir, relpath) if os.name != 'nt' and not os.access(binpath, os.X_OK): parser.error('--local specified, but %r not found or ' 'not executable' % binpath) setattr(options, attr, binpath) if (options.chg or options.with_chg) and os.name == 'nt': parser.error('chg does not work on %s' % os.name) if options.with_chg: options.chg = False # no installation to temporary location options.with_chg = canonpath(_bytespath(options.with_chg)) if not (os.path.isfile(options.with_chg) and os.access(options.with_chg, os.X_OK)): parser.error('--with-chg must specify a chg executable') if options.chg and options.with_hg: # chg shares installation location with hg parser.error('--chg does not work when --with-hg is specified ' '(use --with-chg instead)') if options.color == 'always' and not pygmentspresent: sys.stderr.write('warning: --color=always ignored because ' 'pygments is not installed\n') if options.bisect_repo and not options.known_good_rev: parser.error("--bisect-repo cannot be used without --known-good-rev") global useipv6 if options.ipv6: useipv6 = checksocketfamily('AF_INET6') else: # only use IPv6 if IPv4 is unavailable and IPv6 is available useipv6 = ((not checksocketfamily('AF_INET')) and checksocketfamily('AF_INET6')) options.anycoverage = options.cover or options.annotate or options.htmlcov if options.anycoverage: try: import coverage covver = version.StrictVersion(coverage.__version__).version if covver < (3, 3): parser.error('coverage options require coverage 3.3 or later') except ImportError: parser.error('coverage options now require the coverage package') if options.anycoverage and options.local: # this needs some path mangling somewhere, I guess parser.error("sorry, coverage options do not work when --local " "is specified") if options.anycoverage and options.with_hg: parser.error("sorry, coverage options do not work when --with-hg " "is specified") global verbose if options.verbose: verbose = '' if options.tmpdir: options.tmpdir = canonpath(options.tmpdir) if options.jobs < 1: parser.error('--jobs must be positive') if options.interactive and options.debug: parser.error("-i/--interactive and -d/--debug are incompatible") if options.debug: if options.timeout != defaults['timeout']: sys.stderr.write( 'warning: --timeout option ignored with --debug\n') if options.slowtimeout != defaults['slowtimeout']: sys.stderr.write( 'warning: --slowtimeout option ignored with --debug\n') options.timeout = 0 options.slowtimeout = 0 if options.py3k_warnings: if PYTHON3: parser.error( '--py3k-warnings can only be used on Python 2.7') if options.with_python3: if PYTHON3: parser.error('--with-python3 cannot be used when executing with ' 'Python 3') options.with_python3 = canonpath(options.with_python3) # Verify Python3 executable is acceptable. proc = subprocess.Popen([options.with_python3, b'--version'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) out, _err = proc.communicate() ret = proc.wait() if ret != 0: parser.error('could not determine version of python 3') if not out.startswith('Python '): parser.error('unexpected output from python3 --version: %s' % out) vers = version.LooseVersion(out[len('Python '):]) if vers < version.LooseVersion('3.5.0'): parser.error('--with-python3 version must be 3.5.0 or greater; ' 'got %s' % out) if options.blacklist: options.blacklist = parselistfiles(options.blacklist, 'blacklist') if options.whitelist: options.whitelisted = parselistfiles(options.whitelist, 'whitelist') else: options.whitelisted = {} if options.showchannels: options.nodiff = True return options def rename(src, dst): """Like os.rename(), trade atomicity and opened files friendliness for existing destination support. """ shutil.copy(src, dst) os.remove(src) _unified_diff = difflib.unified_diff if PYTHON3: import functools _unified_diff = functools.partial(difflib.diff_bytes, difflib.unified_diff) def getdiff(expected, output, ref, err): servefail = False lines = [] for line in _unified_diff(expected, output, ref, err): if line.startswith(b'+++') or line.startswith(b'---'): line = line.replace(b'\\', b'/') if line.endswith(b' \n'): line = line[:-2] + b'\n' lines.append(line) if not servefail and line.startswith( b'+ abort: child process failed to start'): servefail = True return servefail, lines verbose = False def vlog(*msg): """Log only when in verbose mode.""" if verbose is False: return return log(*msg) # Bytes that break XML even in a CDATA block: control characters 0-31 # sans \t, \n and \r CDATA_EVIL = re.compile(br"[\000-\010\013\014\016-\037]") # Match feature conditionalized output lines in the form, capturing the feature # list in group 2, and the preceeding line output in group 1: # # output..output (feature !)\n optline = re.compile(b'(.*) \((.+?) !\)\n$') def cdatasafe(data): """Make a string safe to include in a CDATA block. Certain control characters are illegal in a CDATA block, and there's no way to include a ]]> in a CDATA either. This function replaces illegal bytes with ? and adds a space between the ]] so that it won't break the CDATA block. """ return CDATA_EVIL.sub(b'?', data).replace(b']]>', b'] ]>') def log(*msg): """Log something to stdout. Arguments are strings to print. """ with iolock: if verbose: print(verbose, end=' ') for m in msg: print(m, end=' ') print() sys.stdout.flush() def highlightdiff(line, color): if not color: return line assert pygmentspresent return pygments.highlight(line.decode('latin1'), difflexer, terminal256formatter).encode('latin1') def highlightmsg(msg, color): if not color: return msg assert pygmentspresent return pygments.highlight(msg, runnerlexer, runnerformatter) def terminate(proc): """Terminate subprocess""" vlog('# Terminating process %d' % proc.pid) try: proc.terminate() except OSError: pass def killdaemons(pidfile): import killdaemons as killmod return killmod.killdaemons(pidfile, tryhard=False, remove=True, logfn=vlog) class Test(unittest.TestCase): """Encapsulates a single, runnable test. While this class conforms to the unittest.TestCase API, it differs in that instances need to be instantiated manually. (Typically, unittest.TestCase classes are instantiated automatically by scanning modules.) """ # Status code reserved for skipped tests (used by hghave). SKIPPED_STATUS = 80 def __init__(self, path, outputdir, tmpdir, keeptmpdir=False, debug=False, first=False, timeout=None, startport=None, extraconfigopts=None, py3kwarnings=False, shell=None, hgcommand=None, slowtimeout=None, usechg=False, useipv6=False): """Create a test from parameters. path is the full path to the file defining the test. tmpdir is the main temporary directory to use for this test. keeptmpdir determines whether to keep the test's temporary directory after execution. It defaults to removal (False). debug mode will make the test execute verbosely, with unfiltered output. timeout controls the maximum run time of the test. It is ignored when debug is True. See slowtimeout for tests with #require slow. slowtimeout overrides timeout if the test has #require slow. startport controls the starting port number to use for this test. Each test will reserve 3 port numbers for execution. It is the caller's responsibility to allocate a non-overlapping port range to Test instances. extraconfigopts is an iterable of extra hgrc config options. Values must have the form "key=value" (something understood by hgrc). Values of the form "foo.key=value" will result in "[foo] key=value". py3kwarnings enables Py3k warnings. shell is the shell to execute tests in. """ if timeout is None: timeout = defaults['timeout'] if startport is None: startport = defaults['port'] if slowtimeout is None: slowtimeout = defaults['slowtimeout'] self.path = path self.bname = os.path.basename(path) self.name = _strpath(self.bname) self._testdir = os.path.dirname(path) self._outputdir = outputdir self._tmpname = os.path.basename(path) self.errpath = os.path.join(self._outputdir, b'%s.err' % self.bname) self._threadtmp = tmpdir self._keeptmpdir = keeptmpdir self._debug = debug self._first = first self._timeout = timeout self._slowtimeout = slowtimeout self._startport = startport self._extraconfigopts = extraconfigopts or [] self._py3kwarnings = py3kwarnings self._shell = _bytespath(shell) self._hgcommand = hgcommand or b'hg' self._usechg = usechg self._useipv6 = useipv6 self._aborted = False self._daemonpids = [] self._finished = None self._ret = None self._out = None self._skipped = None self._testtmp = None self._chgsockdir = None self._refout = self.readrefout() def readrefout(self): """read reference output""" # If we're not in --debug mode and reference output file exists, # check test output against it. if self._debug: return None # to match "out is None" elif os.path.exists(self.refpath): with open(self.refpath, 'rb') as f: return f.read().splitlines(True) else: return [] # needed to get base class __repr__ running @property def _testMethodName(self): return self.name def __str__(self): return self.name def shortDescription(self): return self.name def setUp(self): """Tasks to perform before run().""" self._finished = False self._ret = None self._out = None self._skipped = None try: os.mkdir(self._threadtmp) except OSError as e: if e.errno != errno.EEXIST: raise name = self._tmpname self._testtmp = os.path.join(self._threadtmp, name) os.mkdir(self._testtmp) # Remove any previous output files. if os.path.exists(self.errpath): try: os.remove(self.errpath) except OSError as e: # We might have raced another test to clean up a .err # file, so ignore ENOENT when removing a previous .err # file. if e.errno != errno.ENOENT: raise if self._usechg: self._chgsockdir = os.path.join(self._threadtmp, b'%s.chgsock' % name) os.mkdir(self._chgsockdir) def run(self, result): """Run this test and report results against a TestResult instance.""" # This function is extremely similar to unittest.TestCase.run(). Once # we require Python 2.7 (or at least its version of unittest), this # function can largely go away. self._result = result result.startTest(self) try: try: self.setUp() except (KeyboardInterrupt, SystemExit): self._aborted = True raise except Exception: result.addError(self, sys.exc_info()) return success = False try: self.runTest() except KeyboardInterrupt: self._aborted = True raise except unittest.SkipTest as e: result.addSkip(self, str(e)) # The base class will have already counted this as a # test we "ran", but we want to exclude skipped tests # from those we count towards those run. result.testsRun -= 1 except self.failureException as e: # This differs from unittest in that we don't capture # the stack trace. This is for historical reasons and # this decision could be revisited in the future, # especially for PythonTest instances. if result.addFailure(self, str(e)): success = True except Exception: result.addError(self, sys.exc_info()) else: success = True try: self.tearDown() except (KeyboardInterrupt, SystemExit): self._aborted = True raise except Exception: result.addError(self, sys.exc_info()) success = False if success: result.addSuccess(self) finally: result.stopTest(self, interrupted=self._aborted) def runTest(self): """Run this test instance. This will return a tuple describing the result of the test. """ env = self._getenv() self._genrestoreenv(env) self._daemonpids.append(env['DAEMON_PIDS']) self._createhgrc(env['HGRCPATH']) vlog('# Test', self.name) ret, out = self._run(env) self._finished = True self._ret = ret self._out = out def describe(ret): if ret < 0: return 'killed by signal: %d' % -ret return 'returned error code %d' % ret self._skipped = False if ret == self.SKIPPED_STATUS: if out is None: # Debug mode, nothing to parse. missing = ['unknown'] failed = None else: missing, failed = TTest.parsehghaveoutput(out) if not missing: missing = ['skipped'] if failed: self.fail('hg have failed checking for %s' % failed[-1]) else: self._skipped = True raise unittest.SkipTest(missing[-1]) elif ret == 'timeout': self.fail('timed out') elif ret is False: self.fail('no result code from test') elif out != self._refout: # Diff generation may rely on written .err file. if (ret != 0 or out != self._refout) and not self._skipped \ and not self._debug: with open(self.errpath, 'wb') as f: for line in out: f.write(line) # The result object handles diff calculation for us. with firstlock: if self._result.addOutputMismatch(self, ret, out, self._refout): # change was accepted, skip failing return if self._first: global firsterror firsterror = True if ret: msg = 'output changed and ' + describe(ret) else: msg = 'output changed' self.fail(msg) elif ret: self.fail(describe(ret)) def tearDown(self): """Tasks to perform after run().""" for entry in self._daemonpids: killdaemons(entry) self._daemonpids = [] if self._keeptmpdir: log('\nKeeping testtmp dir: %s\nKeeping threadtmp dir: %s' % (self._testtmp.decode('utf-8'), self._threadtmp.decode('utf-8'))) else: shutil.rmtree(self._testtmp, True) shutil.rmtree(self._threadtmp, True) if self._usechg: # chgservers will stop automatically after they find the socket # files are deleted shutil.rmtree(self._chgsockdir, True) if (self._ret != 0 or self._out != self._refout) and not self._skipped \ and not self._debug and self._out: with open(self.errpath, 'wb') as f: for line in self._out: f.write(line) vlog("# Ret was:", self._ret, '(%s)' % self.name) def _run(self, env): # This should be implemented in child classes to run tests. raise unittest.SkipTest('unknown test type') def abort(self): """Terminate execution of this test.""" self._aborted = True def _portmap(self, i): offset = b'' if i == 0 else b'%d' % i return (br':%d\b' % (self._startport + i), b':$HGPORT%s' % offset) def _getreplacements(self): """Obtain a mapping of text replacements to apply to test output. Test output needs to be normalized so it can be compared to expected output. This function defines how some of that normalization will occur. """ r = [ # This list should be parallel to defineport in _getenv self._portmap(0), self._portmap(1), self._portmap(2), (br'([^0-9])%s' % re.escape(self._localip()), br'\1$LOCALIP'), (br'\bHG_TXNID=TXN:[a-f0-9]{40}\b', br'HG_TXNID=TXN:$ID$'), ] r.append((self._escapepath(self._testtmp), b'$TESTTMP')) replacementfile = os.path.join(self._testdir, b'common-pattern.py') if os.path.exists(replacementfile): data = {} with open(replacementfile, mode='rb') as source: # the intermediate 'compile' step help with debugging code = compile(source.read(), replacementfile, 'exec') exec(code, data) r.extend(data.get('substitutions', ())) return r def _escapepath(self, p): if os.name == 'nt': return ( (b''.join(c.isalpha() and b'[%s%s]' % (c.lower(), c.upper()) or c in b'/\\' and br'[/\\]' or c.isdigit() and c or b'\\' + c for c in p)) ) else: return re.escape(p) def _localip(self): if self._useipv6: return b'::1' else: return b'127.0.0.1' def _genrestoreenv(self, testenv): """Generate a script that can be used by tests to restore the original environment.""" # Put the restoreenv script inside self._threadtmp scriptpath = os.path.join(self._threadtmp, b'restoreenv.sh') testenv['HGTEST_RESTOREENV'] = scriptpath # Only restore environment variable names that the shell allows # us to export. name_regex = re.compile('^[a-zA-Z][a-zA-Z0-9_]*$') # Do not restore these variables; otherwise tests would fail. reqnames = {'PYTHON', 'TESTDIR', 'TESTTMP'} with open(scriptpath, 'w') as envf: for name, value in origenviron.items(): if not name_regex.match(name): # Skip environment variables with unusual names not # allowed by most shells. continue if name in reqnames: continue envf.write('%s=%s\n' % (name, shellquote(value))) for name in testenv: if name in origenviron or name in reqnames: continue envf.write('unset %s\n' % (name,)) def _getenv(self): """Obtain environment variables to use during test execution.""" def defineport(i): offset = '' if i == 0 else '%s' % i env["HGPORT%s" % offset] = '%s' % (self._startport + i) env = os.environ.copy() env['PYTHONUSERBASE'] = sysconfig.get_config_var('userbase') or '' env['HGEMITWARNINGS'] = '1' env['TESTTMP'] = self._testtmp env['HOME'] = self._testtmp # This number should match portneeded in _getport for port in xrange(3): # This list should be parallel to _portmap in _getreplacements defineport(port) env["HGRCPATH"] = os.path.join(self._threadtmp, b'.hgrc') env["DAEMON_PIDS"] = os.path.join(self._threadtmp, b'daemon.pids') env["HGEDITOR"] = ('"' + sys.executable + '"' + ' -c "import sys; sys.exit(0)"') env["HGMERGE"] = "internal:merge" env["HGUSER"] = "test" env["HGENCODING"] = "ascii" env["HGENCODINGMODE"] = "strict" env['HGIPV6'] = str(int(self._useipv6)) # LOCALIP could be ::1 or 127.0.0.1. Useful for tests that require raw # IP addresses. env['LOCALIP'] = self._localip() # Reset some environment variables to well-known values so that # the tests produce repeatable output. env['LANG'] = env['LC_ALL'] = env['LANGUAGE'] = 'C' env['TZ'] = 'GMT' env["EMAIL"] = "Foo Bar " env['COLUMNS'] = '80' env['TERM'] = 'xterm' for k in ('HG HGPROF CDPATH GREP_OPTIONS http_proxy no_proxy ' + 'HGPLAIN HGPLAINEXCEPT EDITOR VISUAL PAGER ' + 'NO_PROXY CHGDEBUG').split(): if k in env: del env[k] # unset env related to hooks for k in env.keys(): if k.startswith('HG_'): del env[k] if self._usechg: env['CHGSOCKNAME'] = os.path.join(self._chgsockdir, b'server') return env def _createhgrc(self, path): """Create an hgrc file for this test.""" with open(path, 'wb') as hgrc: hgrc.write(b'[ui]\n') hgrc.write(b'slash = True\n') hgrc.write(b'interactive = False\n') hgrc.write(b'mergemarkers = detailed\n') hgrc.write(b'promptecho = True\n') hgrc.write(b'[defaults]\n') hgrc.write(b'[devel]\n') hgrc.write(b'all-warnings = true\n') hgrc.write(b'default-date = 0 0\n') hgrc.write(b'[largefiles]\n') hgrc.write(b'usercache = %s\n' % (os.path.join(self._testtmp, b'.cache/largefiles'))) hgrc.write(b'[lfs]\n') hgrc.write(b'usercache = %s\n' % (os.path.join(self._testtmp, b'.cache/lfs'))) hgrc.write(b'[web]\n') hgrc.write(b'address = localhost\n') hgrc.write(b'ipv6 = %s\n' % str(self._useipv6).encode('ascii')) for opt in self._extraconfigopts: section, key = opt.encode('utf-8').split(b'.', 1) assert b'=' in key, ('extra config opt %s must ' 'have an = for assignment' % opt) hgrc.write(b'[%s]\n%s\n' % (section, key)) def fail(self, msg): # unittest differentiates between errored and failed. # Failed is denoted by AssertionError (by default at least). raise AssertionError(msg) def _runcommand(self, cmd, env, normalizenewlines=False): """Run command in a sub-process, capturing the output (stdout and stderr). Return a tuple (exitcode, output). output is None in debug mode. """ if self._debug: proc = subprocess.Popen(cmd, shell=True, cwd=self._testtmp, env=env) ret = proc.wait() return (ret, None) proc = Popen4(cmd, self._testtmp, self._timeout, env) def cleanup(): terminate(proc) ret = proc.wait() if ret == 0: ret = signal.SIGTERM << 8 killdaemons(env['DAEMON_PIDS']) return ret output = '' proc.tochild.close() try: output = proc.fromchild.read() except KeyboardInterrupt: vlog('# Handling keyboard interrupt') cleanup() raise ret = proc.wait() if wifexited(ret): ret = os.WEXITSTATUS(ret) if proc.timeout: ret = 'timeout' if ret: killdaemons(env['DAEMON_PIDS']) for s, r in self._getreplacements(): output = re.sub(s, r, output) if normalizenewlines: output = output.replace('\r\n', '\n') return ret, output.splitlines(True) class PythonTest(Test): """A Python-based test.""" @property def refpath(self): return os.path.join(self._testdir, b'%s.out' % self.bname) def _run(self, env): py3kswitch = self._py3kwarnings and b' -3' or b'' cmd = b'%s%s "%s"' % (PYTHON, py3kswitch, self.path) vlog("# Running", cmd) normalizenewlines = os.name == 'nt' result = self._runcommand(cmd, env, normalizenewlines=normalizenewlines) if self._aborted: raise KeyboardInterrupt() return result # Some glob patterns apply only in some circumstances, so the script # might want to remove (glob) annotations that otherwise should be # retained. checkcodeglobpats = [ # On Windows it looks like \ doesn't require a (glob), but we know # better. re.compile(br'^pushing to \$TESTTMP/.*[^)]$'), re.compile(br'^moving \S+/.*[^)]$'), re.compile(br'^pulling from \$TESTTMP/.*[^)]$'), # Not all platforms have 127.0.0.1 as loopback (though most do), # so we always glob that too. re.compile(br'.*\$LOCALIP.*$'), ] bchr = chr if PYTHON3: bchr = lambda x: bytes([x]) class TTest(Test): """A "t test" is a test backed by a .t file.""" SKIPPED_PREFIX = b'skipped: ' FAILED_PREFIX = b'hghave check failed: ' NEEDESCAPE = re.compile(br'[\x00-\x08\x0b-\x1f\x7f-\xff]').search ESCAPESUB = re.compile(br'[\x00-\x08\x0b-\x1f\\\x7f-\xff]').sub ESCAPEMAP = dict((bchr(i), br'\x%02x' % i) for i in range(256)) ESCAPEMAP.update({b'\\': b'\\\\', b'\r': br'\r'}) def __init__(self, path, *args, **kwds): # accept an extra "case" parameter case = kwds.pop('case', None) self._case = case self._allcases = parsettestcases(path) super(TTest, self).__init__(path, *args, **kwds) if case: self.name = '%s (case %s)' % (self.name, _strpath(case)) self.errpath = b'%s.%s.err' % (self.errpath[:-4], case) self._tmpname += b'-%s' % case @property def refpath(self): return os.path.join(self._testdir, self.bname) def _run(self, env): with open(self.path, 'rb') as f: lines = f.readlines() # .t file is both reference output and the test input, keep reference # output updated with the the test input. This avoids some race # conditions where the reference output does not match the actual test. if self._refout is not None: self._refout = lines salt, script, after, expected = self._parsetest(lines) # Write out the generated script. fname = b'%s.sh' % self._testtmp with open(fname, 'wb') as f: for l in script: f.write(l) cmd = b'%s "%s"' % (self._shell, fname) vlog("# Running", cmd) exitcode, output = self._runcommand(cmd, env) if self._aborted: raise KeyboardInterrupt() # Do not merge output if skipped. Return hghave message instead. # Similarly, with --debug, output is None. if exitcode == self.SKIPPED_STATUS or output is None: return exitcode, output return self._processoutput(exitcode, output, salt, after, expected) def _hghave(self, reqs): # TODO do something smarter when all other uses of hghave are gone. runtestdir = os.path.abspath(os.path.dirname(_bytespath(__file__))) tdir = runtestdir.replace(b'\\', b'/') proc = Popen4(b'%s -c "%s/hghave %s"' % (self._shell, tdir, b' '.join(reqs)), self._testtmp, 0, self._getenv()) stdout, stderr = proc.communicate() ret = proc.wait() if wifexited(ret): ret = os.WEXITSTATUS(ret) if ret == 2: print(stdout.decode('utf-8')) sys.exit(1) if ret != 0: return False, stdout if b'slow' in reqs: self._timeout = self._slowtimeout return True, None def _iftest(self, args): # implements "#if" reqs = [] for arg in args: if arg.startswith(b'no-') and arg[3:] in self._allcases: if arg[3:] == self._case: return False elif arg in self._allcases: if arg != self._case: return False else: reqs.append(arg) return self._hghave(reqs)[0] def _parsetest(self, lines): # We generate a shell script which outputs unique markers to line # up script results with our source. These markers include input # line number and the last return code. salt = b"SALT%d" % time.time() def addsalt(line, inpython): if inpython: script.append(b'%s %d 0\n' % (salt, line)) else: script.append(b'echo %s %d $?\n' % (salt, line)) script = [] # After we run the shell script, we re-unify the script output # with non-active parts of the source, with synchronization by our # SALT line number markers. The after table contains the non-active # components, ordered by line number. after = {} # Expected shell script output. expected = {} pos = prepos = -1 # True or False when in a true or false conditional section skipping = None # We keep track of whether or not we're in a Python block so we # can generate the surrounding doctest magic. inpython = False if self._debug: script.append(b'set -x\n') if self._hgcommand != b'hg': script.append(b'alias hg="%s"\n' % self._hgcommand) if os.getenv('MSYSTEM'): script.append(b'alias pwd="pwd -W"\n') if self._case: script.append(b'TESTCASE=%s\n' % shellquote(self._case)) script.append(b'export TESTCASE\n') n = 0 for n, l in enumerate(lines): if not l.endswith(b'\n'): l += b'\n' if l.startswith(b'#require'): lsplit = l.split() if len(lsplit) < 2 or lsplit[0] != b'#require': after.setdefault(pos, []).append(' !!! invalid #require\n') haveresult, message = self._hghave(lsplit[1:]) if not haveresult: script = [b'echo "%s"\nexit 80\n' % message] break after.setdefault(pos, []).append(l) elif l.startswith(b'#if'): lsplit = l.split() if len(lsplit) < 2 or lsplit[0] != b'#if': after.setdefault(pos, []).append(' !!! invalid #if\n') if skipping is not None: after.setdefault(pos, []).append(' !!! nested #if\n') skipping = not self._iftest(lsplit[1:]) after.setdefault(pos, []).append(l) elif l.startswith(b'#else'): if skipping is None: after.setdefault(pos, []).append(' !!! missing #if\n') skipping = not skipping after.setdefault(pos, []).append(l) elif l.startswith(b'#endif'): if skipping is None: after.setdefault(pos, []).append(' !!! missing #if\n') skipping = None after.setdefault(pos, []).append(l) elif skipping: after.setdefault(pos, []).append(l) elif l.startswith(b' >>> '): # python inlines after.setdefault(pos, []).append(l) prepos = pos pos = n if not inpython: # We've just entered a Python block. Add the header. inpython = True addsalt(prepos, False) # Make sure we report the exit code. script.append(b'%s -m heredoctest < '): # continuations after.setdefault(prepos, []).append(l) script.append(l[4:]) elif l.startswith(b' '): # results # Queue up a list of expected results. expected.setdefault(pos, []).append(l[2:]) else: if inpython: script.append(b'EOF\n') inpython = False # Non-command/result. Queue up for merged output. after.setdefault(pos, []).append(l) if inpython: script.append(b'EOF\n') if skipping is not None: after.setdefault(pos, []).append(' !!! missing #endif\n') addsalt(n + 1, False) return salt, script, after, expected def _processoutput(self, exitcode, output, salt, after, expected): # Merge the script output back into a unified test. warnonly = 1 # 1: not yet; 2: yes; 3: for sure not if exitcode != 0: warnonly = 3 pos = -1 postout = [] for l in output: lout, lcmd = l, None if salt in l: lout, lcmd = l.split(salt, 1) while lout: if not lout.endswith(b'\n'): lout += b' (no-eol)\n' # Find the expected output at the current position. els = [None] if expected.get(pos, None): els = expected[pos] i = 0 optional = [] while i < len(els): el = els[i] r = self.linematch(el, lout) if isinstance(r, str): if r == '-glob': lout = ''.join(el.rsplit(' (glob)', 1)) r = '' # Warn only this line. elif r == "retry": postout.append(b' ' + el) els.pop(i) break else: log('\ninfo, unknown linematch result: %r\n' % r) r = False if r: els.pop(i) break if el: if el.endswith(b" (?)\n"): optional.append(i) else: m = optline.match(el) if m: conditions = [ c for c in m.group(2).split(b' ')] if not self._iftest(conditions): optional.append(i) i += 1 if r: if r == "retry": continue # clean up any optional leftovers for i in optional: postout.append(b' ' + els[i]) for i in reversed(optional): del els[i] postout.append(b' ' + el) else: if self.NEEDESCAPE(lout): lout = TTest._stringescape(b'%s (esc)\n' % lout.rstrip(b'\n')) postout.append(b' ' + lout) # Let diff deal with it. if r != '': # If line failed. warnonly = 3 # for sure not elif warnonly == 1: # Is "not yet" and line is warn only. warnonly = 2 # Yes do warn. break else: # clean up any optional leftovers while expected.get(pos, None): el = expected[pos].pop(0) if el: if not el.endswith(b" (?)\n"): m = optline.match(el) if m: conditions = [c for c in m.group(2).split(b' ')] if self._iftest(conditions): # Don't append as optional line continue else: continue postout.append(b' ' + el) if lcmd: # Add on last return code. ret = int(lcmd.split()[1]) if ret != 0: postout.append(b' [%d]\n' % ret) if pos in after: # Merge in non-active test bits. postout += after.pop(pos) pos = int(lcmd.split()[0]) if pos in after: postout += after.pop(pos) if warnonly == 2: exitcode = False # Set exitcode to warned. return exitcode, postout @staticmethod def rematch(el, l): try: el = b'(?:' + el + b')' # use \Z to ensure that the regex matches to the end of the string if os.name == 'nt': return re.match(el + br'\r?\n\Z', l) return re.match(el + br'\n\Z', l) except re.error: # el is an invalid regex return False @staticmethod def globmatch(el, l): # The only supported special characters are * and ? plus / which also # matches \ on windows. Escaping of these characters is supported. if el + b'\n' == l: if os.altsep: # matching on "/" is not needed for this line for pat in checkcodeglobpats: if pat.match(el): return True return b'-glob' return True el = el.replace(b'$LOCALIP', b'*') i, n = 0, len(el) res = b'' while i < n: c = el[i:i + 1] i += 1 if c == b'\\' and i < n and el[i:i + 1] in b'*?\\/': res += el[i - 1:i + 1] i += 1 elif c == b'*': res += b'.*' elif c == b'?': res += b'.' elif c == b'/' and os.altsep: res += b'[/\\\\]' else: res += re.escape(c) return TTest.rematch(res, l) def linematch(self, el, l): retry = False if el == l: # perfect match (fast) return True if el: if el.endswith(b" (?)\n"): retry = "retry" el = el[:-5] + b"\n" else: m = optline.match(el) if m: conditions = [c for c in m.group(2).split(b' ')] el = m.group(1) + b"\n" if not self._iftest(conditions): retry = "retry" # Not required by listed features if el.endswith(b" (esc)\n"): if PYTHON3: el = el[:-7].decode('unicode_escape') + '\n' el = el.encode('utf-8') else: el = el[:-7].decode('string-escape') + '\n' if el == l or os.name == 'nt' and el[:-1] + b'\r\n' == l: return True if el.endswith(b" (re)\n"): return TTest.rematch(el[:-6], l) or retry if el.endswith(b" (glob)\n"): # ignore '(glob)' added to l by 'replacements' if l.endswith(b" (glob)\n"): l = l[:-8] + b"\n" return TTest.globmatch(el[:-8], l) or retry if os.altsep: _l = l.replace(b'\\', b'/') if el == _l or os.name == 'nt' and el[:-1] + b'\r\n' == _l: return True return retry @staticmethod def parsehghaveoutput(lines): '''Parse hghave log lines. Return tuple of lists (missing, failed): * the missing/unknown features * the features for which existence check failed''' missing = [] failed = [] for line in lines: if line.startswith(TTest.SKIPPED_PREFIX): line = line.splitlines()[0] missing.append(line[len(TTest.SKIPPED_PREFIX):].decode('utf-8')) elif line.startswith(TTest.FAILED_PREFIX): line = line.splitlines()[0] failed.append(line[len(TTest.FAILED_PREFIX):].decode('utf-8')) return missing, failed @staticmethod def _escapef(m): return TTest.ESCAPEMAP[m.group(0)] @staticmethod def _stringescape(s): return TTest.ESCAPESUB(TTest._escapef, s) iolock = threading.RLock() firstlock = threading.RLock() firsterror = False class TestResult(unittest._TextTestResult): """Holds results when executing via unittest.""" # Don't worry too much about accessing the non-public _TextTestResult. # It is relatively common in Python testing tools. def __init__(self, options, *args, **kwargs): super(TestResult, self).__init__(*args, **kwargs) self._options = options # unittest.TestResult didn't have skipped until 2.7. We need to # polyfill it. self.skipped = [] # We have a custom "ignored" result that isn't present in any Python # unittest implementation. It is very similar to skipped. It may make # sense to map it into skip some day. self.ignored = [] self.times = [] self._firststarttime = None # Data stored for the benefit of generating xunit reports. self.successes = [] self.faildata = {} if options.color == 'auto': self.color = pygmentspresent and self.stream.isatty() elif options.color == 'never': self.color = False else: # 'always', for testing purposes self.color = pygmentspresent def addFailure(self, test, reason): self.failures.append((test, reason)) if self._options.first: self.stop() else: with iolock: if reason == "timed out": self.stream.write('t') else: if not self._options.nodiff: self.stream.write('\n') # Exclude the '\n' from highlighting to lex correctly formatted = 'ERROR: %s output changed\n' % test self.stream.write(highlightmsg(formatted, self.color)) self.stream.write('!') self.stream.flush() def addSuccess(self, test): with iolock: super(TestResult, self).addSuccess(test) self.successes.append(test) def addError(self, test, err): super(TestResult, self).addError(test, err) if self._options.first: self.stop() # Polyfill. def addSkip(self, test, reason): self.skipped.append((test, reason)) with iolock: if self.showAll: self.stream.writeln('skipped %s' % reason) else: self.stream.write('s') self.stream.flush() def addIgnore(self, test, reason): self.ignored.append((test, reason)) with iolock: if self.showAll: self.stream.writeln('ignored %s' % reason) else: if reason not in ('not retesting', "doesn't match keyword"): self.stream.write('i') else: self.testsRun += 1 self.stream.flush() def addOutputMismatch(self, test, ret, got, expected): """Record a mismatch in test output for a particular test.""" if self.shouldStop or firsterror: # don't print, some other test case already failed and # printed, we're just stale and probably failed due to our # temp dir getting cleaned up. return accepted = False lines = [] with iolock: if self._options.nodiff: pass elif self._options.view: v = self._options.view if PYTHON3: v = _bytespath(v) os.system(b"%s %s %s" % (v, test.refpath, test.errpath)) else: servefail, lines = getdiff(expected, got, test.refpath, test.errpath) if servefail: raise test.failureException( 'server failed to start (HGPORT=%s)' % test._startport) else: self.stream.write('\n') for line in lines: line = highlightdiff(line, self.color) if PYTHON3: self.stream.flush() self.stream.buffer.write(line) self.stream.buffer.flush() else: self.stream.write(line) self.stream.flush() # handle interactive prompt without releasing iolock if self._options.interactive: if test.readrefout() != expected: self.stream.write( 'Reference output has changed (run again to prompt ' 'changes)') else: self.stream.write('Accept this change? [n] ') answer = sys.stdin.readline().strip() if answer.lower() in ('y', 'yes'): if test.path.endswith(b'.t'): rename(test.errpath, test.path) else: rename(test.errpath, '%s.out' % test.path) accepted = True if not accepted: self.faildata[test.name] = b''.join(lines) return accepted def startTest(self, test): super(TestResult, self).startTest(test) # os.times module computes the user time and system time spent by # child's processes along with real elapsed time taken by a process. # This module has one limitation. It can only work for Linux user # and not for Windows. test.started = os.times() if self._firststarttime is None: # thread racy but irrelevant self._firststarttime = test.started[4] def stopTest(self, test, interrupted=False): super(TestResult, self).stopTest(test) test.stopped = os.times() starttime = test.started endtime = test.stopped origin = self._firststarttime self.times.append((test.name, endtime[2] - starttime[2], # user space CPU time endtime[3] - starttime[3], # sys space CPU time endtime[4] - starttime[4], # real time starttime[4] - origin, # start date in run context endtime[4] - origin, # end date in run context )) if interrupted: with iolock: self.stream.writeln('INTERRUPTED: %s (after %d seconds)' % ( test.name, self.times[-1][3])) class TestSuite(unittest.TestSuite): """Custom unittest TestSuite that knows how to execute Mercurial tests.""" def __init__(self, testdir, jobs=1, whitelist=None, blacklist=None, retest=False, keywords=None, loop=False, runs_per_test=1, loadtest=None, showchannels=False, *args, **kwargs): """Create a new instance that can run tests with a configuration. testdir specifies the directory where tests are executed from. This is typically the ``tests`` directory from Mercurial's source repository. jobs specifies the number of jobs to run concurrently. Each test executes on its own thread. Tests actually spawn new processes, so state mutation should not be an issue. If there is only one job, it will use the main thread. whitelist and blacklist denote tests that have been whitelisted and blacklisted, respectively. These arguments don't belong in TestSuite. Instead, whitelist and blacklist should be handled by the thing that populates the TestSuite with tests. They are present to preserve backwards compatible behavior which reports skipped tests as part of the results. retest denotes whether to retest failed tests. This arguably belongs outside of TestSuite. keywords denotes key words that will be used to filter which tests to execute. This arguably belongs outside of TestSuite. loop denotes whether to loop over tests forever. """ super(TestSuite, self).__init__(*args, **kwargs) self._jobs = jobs self._whitelist = whitelist self._blacklist = blacklist self._retest = retest self._keywords = keywords self._loop = loop self._runs_per_test = runs_per_test self._loadtest = loadtest self._showchannels = showchannels def run(self, result): # We have a number of filters that need to be applied. We do this # here instead of inside Test because it makes the running logic for # Test simpler. tests = [] num_tests = [0] for test in self._tests: def get(): num_tests[0] += 1 if getattr(test, 'should_reload', False): return self._loadtest(test, num_tests[0]) return test if not os.path.exists(test.path): result.addSkip(test, "Doesn't exist") continue if not (self._whitelist and test.bname in self._whitelist): if self._blacklist and test.bname in self._blacklist: result.addSkip(test, 'blacklisted') continue if self._retest and not os.path.exists(test.errpath): result.addIgnore(test, 'not retesting') continue if self._keywords: with open(test.path, 'rb') as f: t = f.read().lower() + test.bname.lower() ignored = False for k in self._keywords.lower().split(): if k not in t: result.addIgnore(test, "doesn't match keyword") ignored = True break if ignored: continue for _ in xrange(self._runs_per_test): tests.append(get()) runtests = list(tests) done = queue.Queue() running = 0 channels = [""] * self._jobs def job(test, result): for n, v in enumerate(channels): if not v: channel = n break else: raise ValueError('Could not find output channel') channels[channel] = "=" + test.name[5:].split(".")[0] try: test(result) done.put(None) except KeyboardInterrupt: pass except: # re-raises done.put(('!', test, 'run-test raised an error, see traceback')) raise finally: try: channels[channel] = '' except IndexError: pass def stat(): count = 0 while channels: d = '\n%03s ' % count for n, v in enumerate(channels): if v: d += v[0] channels[n] = v[1:] or '.' else: d += ' ' d += ' ' with iolock: sys.stdout.write(d + ' ') sys.stdout.flush() for x in xrange(10): if channels: time.sleep(.1) count += 1 stoppedearly = False if self._showchannels: statthread = threading.Thread(target=stat, name="stat") statthread.start() try: while tests or running: if not done.empty() or running == self._jobs or not tests: try: done.get(True, 1) running -= 1 if result and result.shouldStop: stoppedearly = True break except queue.Empty: continue if tests and not running == self._jobs: test = tests.pop(0) if self._loop: if getattr(test, 'should_reload', False): num_tests[0] += 1 tests.append( self._loadtest(test, num_tests[0])) else: tests.append(test) if self._jobs == 1: job(test, result) else: t = threading.Thread(target=job, name=test.name, args=(test, result)) t.start() running += 1 # If we stop early we still need to wait on started tests to # finish. Otherwise, there is a race between the test completing # and the test's cleanup code running. This could result in the # test reporting incorrect. if stoppedearly: while running: try: done.get(True, 1) running -= 1 except queue.Empty: continue except KeyboardInterrupt: for test in runtests: test.abort() channels = [] return result # Save the most recent 5 wall-clock runtimes of each test to a # human-readable text file named .testtimes. Tests are sorted # alphabetically, while times for each test are listed from oldest to # newest. def loadtimes(outputdir): times = [] try: with open(os.path.join(outputdir, b'.testtimes-')) as fp: for line in fp: ts = line.split() times.append((ts[0], [float(t) for t in ts[1:]])) except IOError as err: if err.errno != errno.ENOENT: raise return times def savetimes(outputdir, result): saved = dict(loadtimes(outputdir)) maxruns = 5 skipped = set([str(t[0]) for t in result.skipped]) for tdata in result.times: test, real = tdata[0], tdata[3] if test not in skipped: ts = saved.setdefault(test, []) ts.append(real) ts[:] = ts[-maxruns:] fd, tmpname = tempfile.mkstemp(prefix=b'.testtimes', dir=outputdir, text=True) with os.fdopen(fd, 'w') as fp: for name, ts in sorted(saved.items()): fp.write('%s %s\n' % (name, ' '.join(['%.3f' % (t,) for t in ts]))) timepath = os.path.join(outputdir, b'.testtimes') try: os.unlink(timepath) except OSError: pass try: os.rename(tmpname, timepath) except OSError: pass class TextTestRunner(unittest.TextTestRunner): """Custom unittest test runner that uses appropriate settings.""" def __init__(self, runner, *args, **kwargs): super(TextTestRunner, self).__init__(*args, **kwargs) self._runner = runner def listtests(self, test): result = TestResult(self._runner.options, self.stream, self.descriptions, 0) test = sorted(test, key=lambda t: t.name) for t in test: print(t.name) result.addSuccess(t) if self._runner.options.xunit: with open(self._runner.options.xunit, "wb") as xuf: self._writexunit(result, xuf) if self._runner.options.json: jsonpath = os.path.join(self._runner._outputdir, b'report.json') with open(jsonpath, 'w') as fp: self._writejson(result, fp) return result def run(self, test): result = TestResult(self._runner.options, self.stream, self.descriptions, self.verbosity) test(result) failed = len(result.failures) skipped = len(result.skipped) ignored = len(result.ignored) with iolock: self.stream.writeln('') if not self._runner.options.noskips: for test, msg in result.skipped: formatted = 'Skipped %s: %s\n' % (test.name, msg) self.stream.write(highlightmsg(formatted, result.color)) for test, msg in result.failures: formatted = 'Failed %s: %s\n' % (test.name, msg) self.stream.write(highlightmsg(formatted, result.color)) for test, msg in result.errors: self.stream.writeln('Errored %s: %s' % (test.name, msg)) if self._runner.options.xunit: with open(self._runner.options.xunit, "wb") as xuf: self._writexunit(result, xuf) if self._runner.options.json: jsonpath = os.path.join(self._runner._outputdir, b'report.json') with open(jsonpath, 'w') as fp: self._writejson(result, fp) self._runner._checkhglib('Tested') savetimes(self._runner._outputdir, result) if failed and self._runner.options.known_good_rev: self._bisecttests(t for t, m in result.failures) self.stream.writeln( '# Ran %d tests, %d skipped, %d failed.' % (result.testsRun, skipped + ignored, failed)) if failed: self.stream.writeln('python hash seed: %s' % os.environ['PYTHONHASHSEED']) if self._runner.options.time: self.printtimes(result.times) if self._runner.options.exceptions: exceptions = aggregateexceptions( os.path.join(self._runner._outputdir, b'exceptions')) total = sum(exceptions.values()) self.stream.writeln('Exceptions Report:') self.stream.writeln('%d total from %d frames' % (total, len(exceptions))) for (frame, line, exc), count in exceptions.most_common(): self.stream.writeln('%d\t%s: %s' % (count, frame, exc)) self.stream.flush() return result def _bisecttests(self, tests): bisectcmd = ['hg', 'bisect'] bisectrepo = self._runner.options.bisect_repo if bisectrepo: bisectcmd.extend(['-R', os.path.abspath(bisectrepo)]) def pread(args): env = os.environ.copy() env['HGPLAIN'] = '1' p = subprocess.Popen(args, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, env=env) data = p.stdout.read() p.wait() return data for test in tests: pread(bisectcmd + ['--reset']), pread(bisectcmd + ['--bad', '.']) pread(bisectcmd + ['--good', self._runner.options.known_good_rev]) # TODO: we probably need to forward more options # that alter hg's behavior inside the tests. opts = '' withhg = self._runner.options.with_hg if withhg: opts += ' --with-hg=%s ' % shellquote(_strpath(withhg)) rtc = '%s %s %s %s' % (sys.executable, sys.argv[0], opts, test) data = pread(bisectcmd + ['--command', rtc]) m = re.search( (br'\nThe first (?Pbad|good) revision ' br'is:\nchangeset: +\d+:(?P[a-f0-9]+)\n.*\n' br'summary: +(?P[^\n]+)\n'), data, (re.MULTILINE | re.DOTALL)) if m is None: self.stream.writeln( 'Failed to identify failure point for %s' % test) continue dat = m.groupdict() verb = 'broken' if dat['goodbad'] == 'bad' else 'fixed' self.stream.writeln( '%s %s by %s (%s)' % ( test, verb, dat['node'], dat['summary'])) def printtimes(self, times): # iolock held by run self.stream.writeln('# Producing time report') times.sort(key=lambda t: (t[3])) cols = '%7.3f %7.3f %7.3f %7.3f %7.3f %s' self.stream.writeln('%-7s %-7s %-7s %-7s %-7s %s' % ('start', 'end', 'cuser', 'csys', 'real', 'Test')) for tdata in times: test = tdata[0] cuser, csys, real, start, end = tdata[1:6] self.stream.writeln(cols % (start, end, cuser, csys, real, test)) @staticmethod def _writexunit(result, outf): # See http://llg.cubic.org/docs/junit/ for a reference. timesd = dict((t[0], t[3]) for t in result.times) doc = minidom.Document() s = doc.createElement('testsuite') s.setAttribute('name', 'run-tests') s.setAttribute('tests', str(result.testsRun)) s.setAttribute('errors', "0") # TODO s.setAttribute('failures', str(len(result.failures))) s.setAttribute('skipped', str(len(result.skipped) + len(result.ignored))) doc.appendChild(s) for tc in result.successes: t = doc.createElement('testcase') t.setAttribute('name', tc.name) tctime = timesd.get(tc.name) if tctime is not None: t.setAttribute('time', '%.3f' % tctime) s.appendChild(t) for tc, err in sorted(result.faildata.items()): t = doc.createElement('testcase') t.setAttribute('name', tc) tctime = timesd.get(tc) if tctime is not None: t.setAttribute('time', '%.3f' % tctime) # createCDATASection expects a unicode or it will # convert using default conversion rules, which will # fail if string isn't ASCII. err = cdatasafe(err).decode('utf-8', 'replace') cd = doc.createCDATASection(err) # Use 'failure' here instead of 'error' to match errors = 0, # failures = len(result.failures) in the testsuite element. failelem = doc.createElement('failure') failelem.setAttribute('message', 'output changed') failelem.setAttribute('type', 'output-mismatch') failelem.appendChild(cd) t.appendChild(failelem) s.appendChild(t) for tc, message in result.skipped: # According to the schema, 'skipped' has no attributes. So store # the skip message as a text node instead. t = doc.createElement('testcase') t.setAttribute('name', tc.name) binmessage = message.encode('utf-8') message = cdatasafe(binmessage).decode('utf-8', 'replace') cd = doc.createCDATASection(message) skipelem = doc.createElement('skipped') skipelem.appendChild(cd) t.appendChild(skipelem) s.appendChild(t) outf.write(doc.toprettyxml(indent=' ', encoding='utf-8')) @staticmethod def _writejson(result, outf): timesd = {} for tdata in result.times: test = tdata[0] timesd[test] = tdata[1:] outcome = {} groups = [('success', ((tc, None) for tc in result.successes)), ('failure', result.failures), ('skip', result.skipped)] for res, testcases in groups: for tc, __ in testcases: if tc.name in timesd: diff = result.faildata.get(tc.name, b'') try: diff = diff.decode('unicode_escape') except UnicodeDecodeError as e: diff = '%r decoding diff, sorry' % e tres = {'result': res, 'time': ('%0.3f' % timesd[tc.name][2]), 'cuser': ('%0.3f' % timesd[tc.name][0]), 'csys': ('%0.3f' % timesd[tc.name][1]), 'start': ('%0.3f' % timesd[tc.name][3]), 'end': ('%0.3f' % timesd[tc.name][4]), 'diff': diff, } else: # blacklisted test tres = {'result': res} outcome[tc.name] = tres jsonout = json.dumps(outcome, sort_keys=True, indent=4, separators=(',', ': ')) outf.writelines(("testreport =", jsonout)) def sorttests(testdescs, shuffle=False): """Do an in-place sort of tests.""" if shuffle: random.shuffle(testdescs) return # keywords for slow tests slow = {b'svn': 10, b'cvs': 10, b'hghave': 10, b'largefiles-update': 10, b'run-tests': 10, b'corruption': 10, b'race': 10, b'i18n': 10, b'check': 100, b'gendoc': 100, b'contrib-perf': 200, } perf = {} def sortkey(f): # run largest tests first, as they tend to take the longest f = f['path'] try: return perf[f] except KeyError: try: val = -os.stat(f).st_size except OSError as e: if e.errno != errno.ENOENT: raise perf[f] = -1e9 # file does not exist, tell early return -1e9 for kw, mul in slow.items(): if kw in f: val *= mul if f.endswith(b'.py'): val /= 10.0 perf[f] = val / 1000.0 return perf[f] testdescs.sort(key=sortkey) class TestRunner(object): """Holds context for executing tests. Tests rely on a lot of state. This object holds it for them. """ # Programs required to run tests. REQUIREDTOOLS = [ b'diff', b'grep', b'unzip', b'gunzip', b'bunzip2', b'sed', ] # Maps file extensions to test class. TESTTYPES = [ (b'.py', PythonTest), (b'.t', TTest), ] def __init__(self): self.options = None self._hgroot = None self._testdir = None self._outputdir = None self._hgtmp = None self._installdir = None self._bindir = None self._tmpbinddir = None self._pythondir = None self._coveragefile = None self._createdfiles = [] self._hgcommand = None self._hgpath = None self._portoffset = 0 self._ports = {} def run(self, args, parser=None): """Run the test suite.""" oldmask = os.umask(0o22) try: parser = parser or getparser() options = parseargs(args, parser) tests = [_bytespath(a) for a in options.tests] if options.test_list is not None: for listfile in options.test_list: with open(listfile, 'rb') as f: tests.extend(t for t in f.read().splitlines() if t) self.options = options self._checktools() testdescs = self.findtests(tests) if options.profile_runner: import statprof statprof.start() result = self._run(testdescs) if options.profile_runner: statprof.stop() statprof.display() return result finally: os.umask(oldmask) def _run(self, testdescs): sorttests(testdescs, shuffle=self.options.random) self._testdir = osenvironb[b'TESTDIR'] = getattr( os, 'getcwdb', os.getcwd)() # assume all tests in same folder for now if testdescs: pathname = os.path.dirname(testdescs[0]['path']) if pathname: osenvironb[b'TESTDIR'] = os.path.join(osenvironb[b'TESTDIR'], pathname) if self.options.outputdir: self._outputdir = canonpath(_bytespath(self.options.outputdir)) else: self._outputdir = self._testdir if testdescs and pathname: self._outputdir = os.path.join(self._outputdir, pathname) if 'PYTHONHASHSEED' not in os.environ: # use a random python hash seed all the time # we do the randomness ourself to know what seed is used os.environ['PYTHONHASHSEED'] = str(random.getrandbits(32)) if self.options.tmpdir: self.options.keep_tmpdir = True tmpdir = _bytespath(self.options.tmpdir) if os.path.exists(tmpdir): # Meaning of tmpdir has changed since 1.3: we used to create # HGTMP inside tmpdir; now HGTMP is tmpdir. So fail if # tmpdir already exists. print("error: temp dir %r already exists" % tmpdir) return 1 os.makedirs(tmpdir) else: d = None if os.name == 'nt': # without this, we get the default temp dir location, but # in all lowercase, which causes troubles with paths (issue3490) d = osenvironb.get(b'TMP', None) tmpdir = tempfile.mkdtemp(b'', b'hgtests.', d) self._hgtmp = osenvironb[b'HGTMP'] = ( os.path.realpath(tmpdir)) if self.options.with_hg: self._installdir = None whg = self.options.with_hg self._bindir = os.path.dirname(os.path.realpath(whg)) assert isinstance(self._bindir, bytes) self._hgcommand = os.path.basename(whg) self._tmpbindir = os.path.join(self._hgtmp, b'install', b'bin') os.makedirs(self._tmpbindir) normbin = os.path.normpath(os.path.abspath(whg)) normbin = normbin.replace(os.sep.encode('ascii'), b'/') # Other Python scripts in the test harness need to # `import mercurial`. If `hg` is a Python script, we assume # the Mercurial modules are relative to its path and tell the tests # to load Python modules from its directory. with open(whg, 'rb') as fh: initial = fh.read(1024) if re.match(b'#!.*python', initial): self._pythondir = self._bindir # If it looks like our in-repo Rust binary, use the source root. # This is a bit hacky. But rhg is still not supported outside the # source directory. So until it is, do the simple thing. elif re.search(b'/rust/target/[^/]+/hg', normbin): self._pythondir = os.path.dirname(self._testdir) # Fall back to the legacy behavior. else: self._pythondir = self._bindir else: self._installdir = os.path.join(self._hgtmp, b"install") self._bindir = os.path.join(self._installdir, b"bin") self._hgcommand = b'hg' self._tmpbindir = self._bindir self._pythondir = os.path.join(self._installdir, b"lib", b"python") # set CHGHG, then replace "hg" command by "chg" chgbindir = self._bindir if self.options.chg or self.options.with_chg: osenvironb[b'CHGHG'] = os.path.join(self._bindir, self._hgcommand) else: osenvironb.pop(b'CHGHG', None) # drop flag for hghave if self.options.chg: self._hgcommand = b'chg' elif self.options.with_chg: chgbindir = os.path.dirname(os.path.realpath(self.options.with_chg)) self._hgcommand = os.path.basename(self.options.with_chg) osenvironb[b"BINDIR"] = self._bindir osenvironb[b"PYTHON"] = PYTHON if self.options.with_python3: osenvironb[b'PYTHON3'] = self.options.with_python3 fileb = _bytespath(__file__) runtestdir = os.path.abspath(os.path.dirname(fileb)) osenvironb[b'RUNTESTDIR'] = runtestdir if PYTHON3: sepb = _bytespath(os.pathsep) else: sepb = os.pathsep path = [self._bindir, runtestdir] + osenvironb[b"PATH"].split(sepb) if os.path.islink(__file__): # test helper will likely be at the end of the symlink realfile = os.path.realpath(fileb) realdir = os.path.abspath(os.path.dirname(realfile)) path.insert(2, realdir) if chgbindir != self._bindir: path.insert(1, chgbindir) if self._testdir != runtestdir: path = [self._testdir] + path if self._tmpbindir != self._bindir: path = [self._tmpbindir] + path osenvironb[b"PATH"] = sepb.join(path) # Include TESTDIR in PYTHONPATH so that out-of-tree extensions # can run .../tests/run-tests.py test-foo where test-foo # adds an extension to HGRC. Also include run-test.py directory to # import modules like heredoctest. pypath = [self._pythondir, self._testdir, runtestdir] # We have to augment PYTHONPATH, rather than simply replacing # it, in case external libraries are only available via current # PYTHONPATH. (In particular, the Subversion bindings on OS X # are in /opt/subversion.) oldpypath = osenvironb.get(IMPL_PATH) if oldpypath: pypath.append(oldpypath) osenvironb[IMPL_PATH] = sepb.join(pypath) if self.options.pure: os.environ["HGTEST_RUN_TESTS_PURE"] = "--pure" os.environ["HGMODULEPOLICY"] = "py" if self.options.allow_slow_tests: os.environ["HGTEST_SLOW"] = "slow" elif 'HGTEST_SLOW' in os.environ: del os.environ['HGTEST_SLOW'] self._coveragefile = os.path.join(self._testdir, b'.coverage') if self.options.exceptions: exceptionsdir = os.path.join(self._outputdir, b'exceptions') try: os.makedirs(exceptionsdir) except OSError as e: if e.errno != errno.EEXIST: raise # Remove all existing exception reports. for f in os.listdir(exceptionsdir): os.unlink(os.path.join(exceptionsdir, f)) osenvironb[b'HGEXCEPTIONSDIR'] = exceptionsdir logexceptions = os.path.join(self._testdir, b'logexceptions.py') self.options.extra_config_opt.append( 'extensions.logexceptions=%s' % logexceptions.decode('utf-8')) vlog("# Using TESTDIR", self._testdir) vlog("# Using RUNTESTDIR", osenvironb[b'RUNTESTDIR']) vlog("# Using HGTMP", self._hgtmp) vlog("# Using PATH", os.environ["PATH"]) vlog("# Using", IMPL_PATH, osenvironb[IMPL_PATH]) vlog("# Writing to directory", self._outputdir) try: return self._runtests(testdescs) or 0 finally: time.sleep(.1) self._cleanup() def findtests(self, args): """Finds possible test files from arguments. If you wish to inject custom tests into the test harness, this would be a good function to monkeypatch or override in a derived class. """ if not args: if self.options.changed: proc = Popen4('hg st --rev "%s" -man0 .' % self.options.changed, None, 0) stdout, stderr = proc.communicate() args = stdout.strip(b'\0').split(b'\0') else: args = os.listdir(b'.') expanded_args = [] for arg in args: if os.path.isdir(arg): if not arg.endswith(b'/'): arg += b'/' expanded_args.extend([arg + a for a in os.listdir(arg)]) else: expanded_args.append(arg) args = expanded_args tests = [] for t in args: if not (os.path.basename(t).startswith(b'test-') and (t.endswith(b'.py') or t.endswith(b'.t'))): continue if t.endswith(b'.t'): # .t file may contain multiple test cases cases = sorted(parsettestcases(t)) if cases: tests += [{'path': t, 'case': c} for c in sorted(cases)] else: tests.append({'path': t}) else: tests.append({'path': t}) return tests def _runtests(self, testdescs): def _reloadtest(test, i): # convert a test back to its description dict desc = {'path': test.path} case = getattr(test, '_case', None) if case: desc['case'] = case return self._gettest(desc, i) try: if self.options.restart: orig = list(testdescs) while testdescs: desc = testdescs[0] # desc['path'] is a relative path if 'case' in desc: errpath = b'%s.%s.err' % (desc['path'], desc['case']) else: errpath = b'%s.err' % desc['path'] errpath = os.path.join(self._outputdir, errpath) if os.path.exists(errpath): break testdescs.pop(0) if not testdescs: print("running all tests") testdescs = orig tests = [self._gettest(d, i) for i, d in enumerate(testdescs)] failed = False kws = self.options.keywords if kws is not None and PYTHON3: kws = kws.encode('utf-8') suite = TestSuite(self._testdir, jobs=self.options.jobs, whitelist=self.options.whitelisted, blacklist=self.options.blacklist, retest=self.options.retest, keywords=kws, loop=self.options.loop, runs_per_test=self.options.runs_per_test, showchannels=self.options.showchannels, tests=tests, loadtest=_reloadtest) verbosity = 1 if self.options.verbose: verbosity = 2 runner = TextTestRunner(self, verbosity=verbosity) if self.options.list_tests: result = runner.listtests(suite) else: if self._installdir: self._installhg() self._checkhglib("Testing") else: self._usecorrectpython() if self.options.chg: assert self._installdir self._installchg() result = runner.run(suite) if result.failures: failed = True if self.options.anycoverage: self._outputcoverage() except KeyboardInterrupt: failed = True print("\ninterrupted!") if failed: return 1 def _getport(self, count): port = self._ports.get(count) # do we have a cached entry? if port is None: portneeded = 3 # above 100 tries we just give up and let test reports failure for tries in xrange(100): allfree = True port = self.options.port + self._portoffset for idx in xrange(portneeded): if not checkportisavailable(port + idx): allfree = False break self._portoffset += portneeded if allfree: break self._ports[count] = port return port def _gettest(self, testdesc, count): """Obtain a Test by looking at its filename. Returns a Test instance. The Test may not be runnable if it doesn't map to a known type. """ path = testdesc['path'] lctest = path.lower() testcls = Test for ext, cls in self.TESTTYPES: if lctest.endswith(ext): testcls = cls break refpath = os.path.join(self._testdir, path) tmpdir = os.path.join(self._hgtmp, b'child%d' % count) # extra keyword parameters. 'case' is used by .t tests kwds = dict((k, testdesc[k]) for k in ['case'] if k in testdesc) t = testcls(refpath, self._outputdir, tmpdir, keeptmpdir=self.options.keep_tmpdir, debug=self.options.debug, first=self.options.first, timeout=self.options.timeout, startport=self._getport(count), extraconfigopts=self.options.extra_config_opt, py3kwarnings=self.options.py3k_warnings, shell=self.options.shell, hgcommand=self._hgcommand, usechg=bool(self.options.with_chg or self.options.chg), useipv6=useipv6, **kwds) t.should_reload = True return t def _cleanup(self): """Clean up state from this test invocation.""" if self.options.keep_tmpdir: return vlog("# Cleaning up HGTMP", self._hgtmp) shutil.rmtree(self._hgtmp, True) for f in self._createdfiles: try: os.remove(f) except OSError: pass def _usecorrectpython(self): """Configure the environment to use the appropriate Python in tests.""" # Tests must use the same interpreter as us or bad things will happen. pyexename = sys.platform == 'win32' and b'python.exe' or b'python' if getattr(os, 'symlink', None): vlog("# Making python executable in test path a symlink to '%s'" % sys.executable) mypython = os.path.join(self._tmpbindir, pyexename) try: if os.readlink(mypython) == sys.executable: return os.unlink(mypython) except OSError as err: if err.errno != errno.ENOENT: raise if self._findprogram(pyexename) != sys.executable: try: os.symlink(sys.executable, mypython) self._createdfiles.append(mypython) except OSError as err: # child processes may race, which is harmless if err.errno != errno.EEXIST: raise else: exedir, exename = os.path.split(sys.executable) vlog("# Modifying search path to find %s as %s in '%s'" % (exename, pyexename, exedir)) path = os.environ['PATH'].split(os.pathsep) while exedir in path: path.remove(exedir) os.environ['PATH'] = os.pathsep.join([exedir] + path) if not self._findprogram(pyexename): print("WARNING: Cannot find %s in search path" % pyexename) def _installhg(self): """Install hg into the test environment. This will also configure hg with the appropriate testing settings. """ vlog("# Performing temporary installation of HG") installerrs = os.path.join(self._hgtmp, b"install.err") compiler = '' if self.options.compiler: compiler = '--compiler ' + self.options.compiler if self.options.pure: pure = b"--pure" else: pure = b"" # Run installer in hg root script = os.path.realpath(sys.argv[0]) exe = sys.executable if PYTHON3: compiler = _bytespath(compiler) script = _bytespath(script) exe = _bytespath(exe) hgroot = os.path.dirname(os.path.dirname(script)) self._hgroot = hgroot os.chdir(hgroot) nohome = b'--home=""' if os.name == 'nt': # The --home="" trick works only on OS where os.sep == '/' # because of a distutils convert_path() fast-path. Avoid it at # least on Windows for now, deal with .pydistutils.cfg bugs # when they happen. nohome = b'' cmd = (b'%(exe)s setup.py %(pure)s clean --all' b' build %(compiler)s --build-base="%(base)s"' b' install --force --prefix="%(prefix)s"' b' --install-lib="%(libdir)s"' b' --install-scripts="%(bindir)s" %(nohome)s >%(logfile)s 2>&1' % {b'exe': exe, b'pure': pure, b'compiler': compiler, b'base': os.path.join(self._hgtmp, b"build"), b'prefix': self._installdir, b'libdir': self._pythondir, b'bindir': self._bindir, b'nohome': nohome, b'logfile': installerrs}) # setuptools requires install directories to exist. def makedirs(p): try: os.makedirs(p) except OSError as e: if e.errno != errno.EEXIST: raise makedirs(self._pythondir) makedirs(self._bindir) vlog("# Running", cmd) if os.system(cmd) == 0: if not self.options.verbose: try: os.remove(installerrs) except OSError as e: if e.errno != errno.ENOENT: raise else: with open(installerrs, 'rb') as f: for line in f: if PYTHON3: sys.stdout.buffer.write(line) else: sys.stdout.write(line) sys.exit(1) os.chdir(self._testdir) self._usecorrectpython() if self.options.py3k_warnings and not self.options.anycoverage: vlog("# Updating hg command to enable Py3k Warnings switch") with open(os.path.join(self._bindir, 'hg'), 'rb') as f: lines = [line.rstrip() for line in f] lines[0] += ' -3' with open(os.path.join(self._bindir, 'hg'), 'wb') as f: for line in lines: f.write(line + '\n') hgbat = os.path.join(self._bindir, b'hg.bat') if os.path.isfile(hgbat): # hg.bat expects to be put in bin/scripts while run-tests.py # installation layout put it in bin/ directly. Fix it with open(hgbat, 'rb') as f: data = f.read() if b'"%~dp0..\python" "%~dp0hg" %*' in data: data = data.replace(b'"%~dp0..\python" "%~dp0hg" %*', b'"%~dp0python" "%~dp0hg" %*') with open(hgbat, 'wb') as f: f.write(data) else: print('WARNING: cannot fix hg.bat reference to python.exe') if self.options.anycoverage: custom = os.path.join(self._testdir, 'sitecustomize.py') target = os.path.join(self._pythondir, 'sitecustomize.py') vlog('# Installing coverage trigger to %s' % target) shutil.copyfile(custom, target) rc = os.path.join(self._testdir, '.coveragerc') vlog('# Installing coverage rc to %s' % rc) os.environ['COVERAGE_PROCESS_START'] = rc covdir = os.path.join(self._installdir, '..', 'coverage') try: os.mkdir(covdir) except OSError as e: if e.errno != errno.EEXIST: raise os.environ['COVERAGE_DIR'] = covdir def _checkhglib(self, verb): """Ensure that the 'mercurial' package imported by python is the one we expect it to be. If not, print a warning to stderr.""" if ((self._bindir == self._pythondir) and (self._bindir != self._tmpbindir)): # The pythondir has been inferred from --with-hg flag. # We cannot expect anything sensible here. return expecthg = os.path.join(self._pythondir, b'mercurial') actualhg = self._gethgpath() if os.path.abspath(actualhg) != os.path.abspath(expecthg): sys.stderr.write('warning: %s with unexpected mercurial lib: %s\n' ' (expected %s)\n' % (verb, actualhg, expecthg)) def _gethgpath(self): """Return the path to the mercurial package that is actually found by the current Python interpreter.""" if self._hgpath is not None: return self._hgpath cmd = b'%s -c "import mercurial; print (mercurial.__path__[0])"' cmd = cmd % PYTHON if PYTHON3: cmd = _strpath(cmd) pipe = os.popen(cmd) try: self._hgpath = _bytespath(pipe.read().strip()) finally: pipe.close() return self._hgpath def _installchg(self): """Install chg into the test environment""" vlog('# Performing temporary installation of CHG') assert os.path.dirname(self._bindir) == self._installdir assert self._hgroot, 'must be called after _installhg()' cmd = (b'"%(make)s" clean install PREFIX="%(prefix)s"' % {b'make': 'make', # TODO: switch by option or environment? b'prefix': self._installdir}) cwd = os.path.join(self._hgroot, b'contrib', b'chg') vlog("# Running", cmd) proc = subprocess.Popen(cmd, shell=True, cwd=cwd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) out, _err = proc.communicate() if proc.returncode != 0: if PYTHON3: sys.stdout.buffer.write(out) else: sys.stdout.write(out) sys.exit(1) def _outputcoverage(self): """Produce code coverage output.""" import coverage coverage = coverage.coverage vlog('# Producing coverage report') # chdir is the easiest way to get short, relative paths in the # output. os.chdir(self._hgroot) covdir = os.path.join(self._installdir, '..', 'coverage') cov = coverage(data_file=os.path.join(covdir, 'cov')) # Map install directory paths back to source directory. cov.config.paths['srcdir'] = ['.', self._pythondir] cov.combine() omit = [os.path.join(x, '*') for x in [self._bindir, self._testdir]] cov.report(ignore_errors=True, omit=omit) if self.options.htmlcov: htmldir = os.path.join(self._outputdir, 'htmlcov') cov.html_report(directory=htmldir, omit=omit) if self.options.annotate: adir = os.path.join(self._outputdir, 'annotated') if not os.path.isdir(adir): os.mkdir(adir) cov.annotate(directory=adir, omit=omit) def _findprogram(self, program): """Search PATH for a executable program""" dpb = _bytespath(os.defpath) sepb = _bytespath(os.pathsep) for p in osenvironb.get(b'PATH', dpb).split(sepb): name = os.path.join(p, program) if os.name == 'nt' or os.access(name, os.X_OK): return name return None def _checktools(self): """Ensure tools required to run tests are present.""" for p in self.REQUIREDTOOLS: if os.name == 'nt' and not p.endswith('.exe'): p += '.exe' found = self._findprogram(p) if found: vlog("# Found prerequisite", p, "at", found) else: print("WARNING: Did not find prerequisite tool: %s " % p.decode("utf-8")) def aggregateexceptions(path): exceptions = collections.Counter() for f in os.listdir(path): with open(os.path.join(path, f), 'rb') as fh: data = fh.read().split(b'\0') if len(data) != 4: continue exc, mainframe, hgframe, hgline = data exc = exc.decode('utf-8') mainframe = mainframe.decode('utf-8') hgframe = hgframe.decode('utf-8') hgline = hgline.decode('utf-8') exceptions[(hgframe, hgline, exc)] += 1 return exceptions if __name__ == '__main__': runner = TestRunner() try: import msvcrt msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) except ImportError: pass sys.exit(runner.run(sys.argv[1:])) mercurial-4.5.3/tests/test-cache-abuse.t0000644015407300116100000000504413261161234020044 0ustar augieeng00000000000000Enable obsolete markers $ cat >> $HGRCPATH << EOF > [experimental] > evolution.createmarkers=True > [phases] > publish=False > EOF Build a repo with some cacheable bits: $ hg init a $ cd a $ echo a > a $ hg ci -qAm0 $ hg tag t1 $ hg book -i bk1 $ hg branch -q b2 $ hg ci -Am1 $ hg tag t2 $ echo dumb > dumb $ hg ci -qAmdumb $ hg debugobsolete b1174d11b69e63cb0c5726621a43c859f0858d7f obsoleted 1 changesets $ hg phase -pr t1 $ hg phase -fsr t2 Make a helper function to check cache damage invariants: - command output shouldn't change - cache should be present after first use - corruption/repair should be silent (no exceptions or warnings) - cache should survive deletion, overwrite, and append - unreadable / unwriteable caches should be ignored - cache should be rebuilt after corruption $ damage() { > CMD=$1 > CACHE=.hg/cache/$2 > CLEAN=$3 > hg $CMD > before > test -f $CACHE || echo "not present" > echo bad > $CACHE > test -z "$CLEAN" || $CLEAN > hg $CMD > after > "$RUNTESTDIR/pdiff" before after || echo "*** overwrite corruption" > echo corruption >> $CACHE > test -z "$CLEAN" || $CLEAN > hg $CMD > after > "$RUNTESTDIR/pdiff" before after || echo "*** append corruption" > rm $CACHE > mkdir $CACHE > test -z "$CLEAN" || $CLEAN > hg $CMD > after > "$RUNTESTDIR/pdiff" before after || echo "*** read-only corruption" > test -d $CACHE || echo "*** directory clobbered" > rmdir $CACHE > test -z "$CLEAN" || $CLEAN > hg $CMD > after > "$RUNTESTDIR/pdiff" before after || echo "*** missing corruption" > test -f $CACHE || echo "not rebuilt" > } Beat up tags caches: $ damage "tags --hidden" tags2 $ damage tags tags2-visible $ damage "tag -f t3" hgtagsfnodes1 1 new orphan changesets 1 new orphan changesets 1 new orphan changesets 1 new orphan changesets 1 new orphan changesets Beat up branch caches: $ damage branches branch2-base "rm .hg/cache/branch2-[vs]*" $ damage branches branch2-served "rm .hg/cache/branch2-[bv]*" $ damage branches branch2-visible $ damage "log -r branch(.)" rbc-names-v1 $ damage "log -r branch(default)" rbc-names-v1 $ damage "log -r branch(b2)" rbc-revs-v1 We currently can't detect an rbc cache with unknown names: $ damage "log -qr branch(b2)" rbc-names-v1 --- before * (glob) +++ after * (glob) @@ -1,8 +?,0 @@ (glob) -2:5fb7d38b9dc4 -3:60b597ffdafa -4:b1174d11b69e -5:6354685872c0 -6:5ebc725f1bef -7:7b76eec2f273 -8:ef3428d9d644 -9:ba7a936bc03c *** append corruption mercurial-4.5.3/tests/hypothesishelpers.py0000644015407300116100000000420013261161234020667 0ustar augieeng00000000000000# Helper module to use the Hypothesis tool in tests # # Copyright 2015 David R. MacIver # # For details see http://hypothesis.readthedocs.org from __future__ import absolute_import, print_function import os import sys import traceback try: # hypothesis 2.x from hypothesis.configuration import set_hypothesis_home_dir from hypothesis import settings except ImportError: # hypothesis 1.x from hypothesis.settings import set_hypothesis_home_dir from hypothesis import Settings as settings import hypothesis.strategies as st from hypothesis import given # hypothesis store data regarding generate example and code set_hypothesis_home_dir(os.path.join( os.getenv('TESTTMP'), ".hypothesis" )) def check(*args, **kwargs): """decorator to make a function a hypothesis test Decorated function are run immediately (to be used doctest style)""" def accept(f): # Workaround for https://github.com/DRMacIver/hypothesis/issues/206 # Fixed in version 1.13 (released 2015 october 29th) f.__module__ = '__anon__' try: with settings(max_examples=2000): given(*args, **kwargs)(f)() except Exception: traceback.print_exc(file=sys.stdout) sys.exit(1) return accept def roundtrips(data, decode, encode): """helper to tests function that must do proper encode/decode roundtripping """ @given(data) def testroundtrips(value): encoded = encode(value) decoded = decode(encoded) if decoded != value: raise ValueError( "Round trip failed: %s(%r) -> %s(%r) -> %r" % ( encode.__name__, value, decode.__name__, encoded, decoded )) try: testroundtrips() except Exception: # heredoc swallow traceback, we work around it traceback.print_exc(file=sys.stdout) raise print("Round trip OK") # strategy for generating bytestring that might be an issue for Mercurial bytestrings = ( st.builds(lambda s, e: s.encode(e), st.text(), st.sampled_from([ 'utf-8', 'utf-16', ]))) | st.binary() mercurial-4.5.3/tests/test-diffdir.t0000644015407300116100000000271713261161234017317 0ustar augieeng00000000000000 $ hg init $ touch a $ hg add a $ hg ci -m "a" $ echo 123 > b $ hg add b $ hg diff --nodates diff -r 3903775176ed b --- /dev/null +++ b/b @@ -0,0 +1,1 @@ +123 $ hg diff --nodates -r tip diff -r 3903775176ed b --- /dev/null +++ b/b @@ -0,0 +1,1 @@ +123 $ echo foo > a $ hg diff --nodates diff -r 3903775176ed a --- a/a +++ b/a @@ -0,0 +1,1 @@ +foo diff -r 3903775176ed b --- /dev/null +++ b/b @@ -0,0 +1,1 @@ +123 $ hg diff -r "" hg: parse error: empty query [255] $ hg diff -r tip -r "" hg: parse error: empty query [255] Remove a file that was added via merge. Since the file is not in parent 1, it should not be in the diff. $ hg ci -m 'a=foo' a $ hg co -Cq null $ echo 123 > b $ hg add b $ hg ci -m "b" created new head $ hg merge 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg rm -f a $ hg diff --nodates Rename a file that was added via merge. Since the rename source is not in parent 1, the diff should be relative to /dev/null $ hg co -Cq 2 $ hg merge 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg mv a a2 $ hg diff --nodates diff -r cf44b38435e5 a2 --- /dev/null +++ b/a2 @@ -0,0 +1,1 @@ +foo $ hg diff --nodates --git diff --git a/a2 b/a2 new file mode 100644 --- /dev/null +++ b/a2 @@ -0,0 +1,1 @@ +foo mercurial-4.5.3/tests/test-push-checkheads-partial-C4.t0000644015407300116100000000357313261161234022646 0ustar augieeng00000000000000==================================== Testing head checking code: Case C-4 ==================================== Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This case is part of a series of tests checking this behavior. Category C: case were the branch is only partially obsoleted TestCase 4: 2 changeset branch, only the base is pruned .. old-state: .. .. * 2 changeset branch .. .. new-state: .. .. * old base is pruned .. * 1 new unrelated branch .. .. expected-result: .. .. * push denied .. .. graph-summary: .. .. B ◔ .. | .. A ⊗ ◔ C .. |/ .. ◠$ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir C4 $ cd C4 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd server $ mkcommit B0 $ cd ../client $ hg pull pulling from $TESTTMP/C4/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets d73caddc5533 (run 'hg update' to get a working copy) $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit C0 created new head $ hg debugobsolete --record-parents `getid "desc(A0)"` obsoleted 1 changesets 1 new orphan changesets $ hg log -G --hidden @ 0f88766e02d6 (draft): C0 | | * d73caddc5533 (draft): B0 | | | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): root Actual testing -------------- $ hg push --rev 'desc(C0)' pushing to $TESTTMP/C4/server searching for changes abort: push creates new remote head 0f88766e02d6! (merge or see 'hg help push' for details about pushing new heads) [255] $ cd ../.. mercurial-4.5.3/tests/test-split.t0000644015407300116100000002502513261161234017040 0ustar augieeng00000000000000#testcases obsstore-on obsstore-off $ cat > $TESTTMP/editor.py < #!$PYTHON > import os, sys > path = os.path.join(os.environ['TESTTMP'], 'messages') > messages = open(path).read().split('--\n') > prompt = open(sys.argv[1]).read() > sys.stdout.write(''.join('EDITOR: %s' % l for l in prompt.splitlines(True))) > sys.stdout.flush() > with open(sys.argv[1], 'w') as f: > f.write(messages[0]) > with open(path, 'w') as f: > f.write('--\n'.join(messages[1:])) > EOF $ cat >> $HGRCPATH < [extensions] > drawdag=$TESTDIR/drawdag.py > split= > [ui] > interactive=1 > color=no > paginate=never > [diff] > git=1 > unified=0 > [alias] > glog=log -G -T '{rev}:{node|short} {desc} {bookmarks}\n' > EOF #if obsstore-on $ cat >> $HGRCPATH < [experimental] > evolution=all > EOF #endif $ hg init a $ cd a Nothing to split $ hg split nothing to split [1] $ hg commit -m empty --config ui.allowemptycommit=1 $ hg split abort: cannot split an empty revision [255] $ rm -rf .hg $ hg init Cannot split working directory $ hg split -r 'wdir()' abort: cannot split working directory [255] Generate some content. The sed filter drop CR on Windows, which is dropped in the a > b line. $ $TESTDIR/seq.py 1 5 | sed 's/\r$//' >> a $ hg ci -m a1 -A a -q $ hg bookmark -i r1 $ sed 's/1/11/;s/3/33/;s/5/55/' a > b $ mv b a $ hg ci -m a2 -q $ hg bookmark -i r2 Cannot split a public changeset $ hg phase --public -r 'all()' $ hg split . abort: cannot split public changeset (see 'hg help phases' for details) [255] $ hg phase --draft -f -r 'all()' Cannot split while working directory is dirty $ touch dirty $ hg add dirty $ hg split . abort: uncommitted changes [255] $ hg forget dirty $ rm dirty Split a head $ cp -R . ../b $ cp -R . ../c $ hg bookmark r3 $ hg split 'all()' abort: cannot split multiple revisions [255] $ runsplit() { > cat > $TESTTMP/messages < split 1 > -- > split 2 > -- > split 3 > EOF > cat < y > y > y > y > y > y > EOF > } $ HGEDITOR=false runsplit diff --git a/a b/a 1 hunks, 1 lines changed examine changes to 'a'? [Ynesfdaq?] y @@ -5,1 +5,1 @@ 4 -5 +55 record this change to 'a'? [Ynesfdaq?] y transaction abort! rollback completed abort: edit failed: false exited with status 1 [255] $ hg status $ HGEDITOR="\"$PYTHON\" $TESTTMP/editor.py" $ runsplit diff --git a/a b/a 1 hunks, 1 lines changed examine changes to 'a'? [Ynesfdaq?] y @@ -5,1 +5,1 @@ 4 -5 +55 record this change to 'a'? [Ynesfdaq?] y EDITOR: HG: Splitting 1df0d5c5a3ab. Write commit message for the first split changeset. EDITOR: a2 EDITOR: EDITOR: EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. EDITOR: HG: Leave message empty to abort commit. EDITOR: HG: -- EDITOR: HG: user: test EDITOR: HG: branch 'default' EDITOR: HG: changed a created new head diff --git a/a b/a 1 hunks, 1 lines changed examine changes to 'a'? [Ynesfdaq?] y @@ -3,1 +3,1 @@ 2 -3 +33 record this change to 'a'? [Ynesfdaq?] y EDITOR: HG: Splitting 1df0d5c5a3ab. So far it has been split into: EDITOR: HG: - e704349bd21b: split 1 EDITOR: HG: Write commit message for the next split changeset. EDITOR: a2 EDITOR: EDITOR: EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. EDITOR: HG: Leave message empty to abort commit. EDITOR: HG: -- EDITOR: HG: user: test EDITOR: HG: branch 'default' EDITOR: HG: changed a diff --git a/a b/a 1 hunks, 1 lines changed examine changes to 'a'? [Ynesfdaq?] y @@ -1,1 +1,1 @@ -1 +11 record this change to 'a'? [Ynesfdaq?] y EDITOR: HG: Splitting 1df0d5c5a3ab. So far it has been split into: EDITOR: HG: - e704349bd21b: split 1 EDITOR: HG: - a09ad58faae3: split 2 EDITOR: HG: Write commit message for the next split changeset. EDITOR: a2 EDITOR: EDITOR: EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. EDITOR: HG: Leave message empty to abort commit. EDITOR: HG: -- EDITOR: HG: user: test EDITOR: HG: branch 'default' EDITOR: HG: changed a saved backup bundle to $TESTTMP/a/.hg/strip-backup/1df0d5c5a3ab-8341b760-split.hg (obsstore-off !) #if obsstore-off $ hg bookmark r1 0:a61bcde8c529 r2 3:00eebaf8d2e2 * r3 3:00eebaf8d2e2 $ hg glog -p @ 3:00eebaf8d2e2 split 3 r2 r3 | diff --git a/a b/a | --- a/a | +++ b/a | @@ -1,1 +1,1 @@ | -1 | +11 | o 2:a09ad58faae3 split 2 | diff --git a/a b/a | --- a/a | +++ b/a | @@ -3,1 +3,1 @@ | -3 | +33 | o 1:e704349bd21b split 1 | diff --git a/a b/a | --- a/a | +++ b/a | @@ -5,1 +5,1 @@ | -5 | +55 | o 0:a61bcde8c529 a1 r1 diff --git a/a b/a new file mode 100644 --- /dev/null +++ b/a @@ -0,0 +1,5 @@ +1 +2 +3 +4 +5 #else $ hg bookmark r1 0:a61bcde8c529 r2 4:00eebaf8d2e2 * r3 4:00eebaf8d2e2 $ hg glog @ 4:00eebaf8d2e2 split 3 r2 r3 | o 3:a09ad58faae3 split 2 | o 2:e704349bd21b split 1 | o 0:a61bcde8c529 a1 r1 #endif Split a head while working parent is not that head $ cd $TESTTMP/b $ hg up 0 -q $ hg bookmark r3 $ runsplit tip >/dev/null #if obsstore-off $ hg bookmark r1 0:a61bcde8c529 r2 3:00eebaf8d2e2 * r3 0:a61bcde8c529 $ hg glog o 3:00eebaf8d2e2 split 3 r2 | o 2:a09ad58faae3 split 2 | o 1:e704349bd21b split 1 | @ 0:a61bcde8c529 a1 r1 r3 #else $ hg bookmark r1 0:a61bcde8c529 r2 4:00eebaf8d2e2 * r3 0:a61bcde8c529 $ hg glog o 4:00eebaf8d2e2 split 3 r2 | o 3:a09ad58faae3 split 2 | o 2:e704349bd21b split 1 | @ 0:a61bcde8c529 a1 r1 r3 #endif Split a non-head $ cd $TESTTMP/c $ echo d > d $ hg ci -m d1 -A d $ hg bookmark -i d1 $ echo 2 >> d $ hg ci -m d2 $ echo 3 >> d $ hg ci -m d3 $ hg bookmark -i d3 $ hg up '.^' -q $ hg bookmark d2 $ cp -R . ../d $ runsplit -r 1 | grep rebasing rebasing 2:b5c5ea414030 "d1" (d1) rebasing 3:f4a0a8d004cc "d2" (d2) rebasing 4:777940761eba "d3" (d3) #if obsstore-off $ hg bookmark d1 4:c4b449ef030e * d2 5:c9dd00ab36a3 d3 6:19f476bc865c r1 0:a61bcde8c529 r2 3:00eebaf8d2e2 $ hg glog -p o 6:19f476bc865c d3 d3 | diff --git a/d b/d | --- a/d | +++ b/d | @@ -2,0 +3,1 @@ | +3 | @ 5:c9dd00ab36a3 d2 d2 | diff --git a/d b/d | --- a/d | +++ b/d | @@ -1,0 +2,1 @@ | +2 | o 4:c4b449ef030e d1 d1 | diff --git a/d b/d | new file mode 100644 | --- /dev/null | +++ b/d | @@ -0,0 +1,1 @@ | +d | o 3:00eebaf8d2e2 split 3 r2 | diff --git a/a b/a | --- a/a | +++ b/a | @@ -1,1 +1,1 @@ | -1 | +11 | o 2:a09ad58faae3 split 2 | diff --git a/a b/a | --- a/a | +++ b/a | @@ -3,1 +3,1 @@ | -3 | +33 | o 1:e704349bd21b split 1 | diff --git a/a b/a | --- a/a | +++ b/a | @@ -5,1 +5,1 @@ | -5 | +55 | o 0:a61bcde8c529 a1 r1 diff --git a/a b/a new file mode 100644 --- /dev/null +++ b/a @@ -0,0 +1,5 @@ +1 +2 +3 +4 +5 #else $ hg bookmark d1 8:c4b449ef030e * d2 9:c9dd00ab36a3 d3 10:19f476bc865c r1 0:a61bcde8c529 r2 7:00eebaf8d2e2 $ hg glog o 10:19f476bc865c d3 d3 | @ 9:c9dd00ab36a3 d2 d2 | o 8:c4b449ef030e d1 d1 | o 7:00eebaf8d2e2 split 3 r2 | o 6:a09ad58faae3 split 2 | o 5:e704349bd21b split 1 | o 0:a61bcde8c529 a1 r1 #endif Split a non-head without rebase $ cd $TESTTMP/d #if obsstore-off $ runsplit -r 1 --no-rebase abort: cannot split changeset with children without rebase [255] #else $ runsplit -r 1 --no-rebase >/dev/null 3 new orphan changesets $ hg bookmark d1 2:b5c5ea414030 * d2 3:f4a0a8d004cc d3 4:777940761eba r1 0:a61bcde8c529 r2 7:00eebaf8d2e2 $ hg glog o 7:00eebaf8d2e2 split 3 r2 | o 6:a09ad58faae3 split 2 | o 5:e704349bd21b split 1 | | * 4:777940761eba d3 d3 | | | @ 3:f4a0a8d004cc d2 d2 | | | * 2:b5c5ea414030 d1 d1 | | | x 1:1df0d5c5a3ab a2 |/ o 0:a61bcde8c529 a1 r1 #endif Split a non-head with obsoleted descendants #if obsstore-on $ hg init $TESTTMP/e $ cd $TESTTMP/e $ hg debugdrawdag <<'EOS' > H I J > | | | > F G1 G2 # amend: G1 -> G2 > | | / # prune: F > C D E > \|/ > B > | > A > EOS 2 new orphan changesets $ eval `hg tags -T '{tag}={node}\n'` $ rm .hg/localtags $ hg split $B --config experimental.evolution=createmarkers abort: split would leave orphaned changesets behind [255] $ cat > $TESTTMP/messages < Split B > EOF $ cat < y > y > EOF diff --git a/B b/B new file mode 100644 examine changes to 'B'? [Ynesfdaq?] y @@ -0,0 +1,1 @@ +B \ No newline at end of file record this change to 'B'? [Ynesfdaq?] y EDITOR: HG: Splitting 112478962961. Write commit message for the first split changeset. EDITOR: B EDITOR: EDITOR: EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. EDITOR: HG: Leave message empty to abort commit. EDITOR: HG: -- EDITOR: HG: user: test EDITOR: HG: branch 'default' EDITOR: HG: added B created new head rebasing 2:26805aba1e60 "C" rebasing 3:be0ef73c17ad "D" rebasing 4:49cb92066bfd "E" rebasing 7:97a6268cc7ef "G2" rebasing 10:e2f1e425c0db "J" $ hg glog -r 'sort(all(), topo)' o 16:556c085f8b52 J | o 15:8761f6c9123f G2 | o 14:a7aeffe59b65 E | | o 13:e1e914ede9ab D |/ | o 12:01947e9b98aa C |/ o 11:0947baa74d47 Split B | | * 9:88ede1d5ee13 I | | | x 6:af8cbf225b7b G1 | | | x 3:be0ef73c17ad D | | | | * 8:74863e5b5074 H | | | | | x 5:ee481a2a1e69 F | | | | | x 2:26805aba1e60 C | |/ | x 1:112478962961 B |/ o 0:426bada5c675 A #endif mercurial-4.5.3/tests/test-push-checkheads-superceed-A2.t0000644015407300116100000000406013261161234023155 0ustar augieeng00000000000000==================================== Testing head checking code: Case A-2 ==================================== Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This case is part of a series of tests checking this behavior. Category A: simple case involving a branch being superceeded by another. TestCase 2: multi-changeset branch .. old-state: .. .. * 1 branch with 2 changesets .. .. new-state: .. .. * another 2-changeset branch succeeding the old one .. .. expected-result: .. .. * push allowed .. .. graph-summary: .. .. B ø⇠◔ B' .. | | .. A ø⇠◔ A' .. |/ .. ◠$ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir A2 $ cd A2 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd server $ mkcommit B0 $ cd ../client $ hg pull pulling from $TESTTMP/A2/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets d73caddc5533 (run 'hg update' to get a working copy) $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit A1 created new head $ mkcommit B1 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` obsoleted 1 changesets $ hg log -G --hidden @ 262c8c798096 (draft): B1 | o f6082bc4ffef (draft): A1 | | x d73caddc5533 (draft): B0 | | | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): root Actual testing -------------- $ hg push pushing to $TESTTMP/A2/server searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files (+1 heads) 2 new obsolescence markers obsoleted 2 changesets $ cd ../.. mercurial-4.5.3/tests/test-hook.t0000644015407300116100000010532213261161234016644 0ustar augieeng00000000000000commit hooks can see env vars (and post-transaction one are run unlocked) $ cat > $TESTTMP/txnabort.checkargs.py < def showargs(ui, repo, hooktype, **kwargs): > ui.write('%s Python hook: %s\n' % (hooktype, ','.join(sorted(kwargs)))) > EOF $ hg init a $ cd a $ cat > .hg/hgrc < [hooks] > commit = sh -c "HG_LOCAL= HG_TAG= printenv.py commit" > commit.b = sh -c "HG_LOCAL= HG_TAG= printenv.py commit.b" > precommit = sh -c "HG_LOCAL= HG_NODE= HG_TAG= printenv.py precommit" > pretxncommit = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxncommit" > pretxncommit.tip = hg -q tip > pre-identify = sh -c "printenv.py pre-identify 1" > pre-cat = sh -c "printenv.py pre-cat" > post-cat = sh -c "printenv.py post-cat" > pretxnopen = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnopen" > pretxnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnclose" > txnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py txnclose" > txnabort.0 = python:$TESTTMP/txnabort.checkargs.py:showargs > txnabort.1 = sh -c "HG_LOCAL= HG_TAG= printenv.py txnabort" > txnclose.checklock = sh -c "hg debuglock > /dev/null" > EOF $ echo a > a $ hg add a $ hg commit -m a precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=0000000000000000000000000000000000000000 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$TESTTMP/a 0:cb9a9f314b8b pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 $ hg clone . ../b updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ../b changegroup hooks can see env vars $ cat > .hg/hgrc < [hooks] > prechangegroup = sh -c "printenv.py prechangegroup" > changegroup = sh -c "printenv.py changegroup" > incoming = sh -c "printenv.py incoming" > EOF pretxncommit and commit hooks can see both parents of merge $ cd ../a $ echo b >> a $ hg commit -m a1 -d "1 0" precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a 1:ab228980c14d pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b $ hg update -C 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo b > b $ hg add b $ hg commit -m b -d '1 0' precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a 2:ee9deb46ab31 pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit created new head txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b $ hg merge 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg commit -m merge -d '2 0' precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd HG_PENDING=$TESTTMP/a 3:07f3376c1e65 pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd test generic hooks $ hg id pre-identify hook: HG_ARGS=id HG_HOOKNAME=pre-identify HG_HOOKTYPE=pre-identify HG_OPTS={'bookmarks': None, 'branch': None, 'id': None, 'insecure': None, 'num': None, 'remotecmd': '', 'rev': '', 'ssh': '', 'tags': None, 'template': ''} HG_PATS=[] abort: pre-identify hook exited with status 1 [255] $ hg cat b pre-cat hook: HG_ARGS=cat b HG_HOOKNAME=pre-cat HG_HOOKTYPE=pre-cat HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': '', 'template': ''} HG_PATS=['b'] b post-cat hook: HG_ARGS=cat b HG_HOOKNAME=post-cat HG_HOOKTYPE=post-cat HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': '', 'template': ''} HG_PATS=['b'] HG_RESULT=0 $ cd ../b $ hg pull ../a pulling from ../a searching for changes prechangegroup hook: HG_HOOKNAME=prechangegroup HG_HOOKTYPE=prechangegroup HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a adding changesets adding manifests adding file changes added 3 changesets with 2 changes to 2 files new changesets ab228980c14d:07f3376c1e65 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_NODE_LAST=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a (run 'hg update' to get a working copy) tag hooks can see env vars $ cd ../a $ cat >> .hg/hgrc < pretag = sh -c "printenv.py pretag" > tag = sh -c "HG_PARENT1= HG_PARENT2= printenv.py tag" > EOF $ hg tag -d '3 0' a pretag hook: HG_HOOKNAME=pretag HG_HOOKTYPE=pretag HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$TESTTMP/a 4:539e4b31b6dc pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit tag hook: HG_HOOKNAME=tag HG_HOOKTYPE=tag HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 $ hg tag -l la pretag hook: HG_HOOKNAME=pretag HG_HOOKTYPE=pretag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la tag hook: HG_HOOKNAME=tag HG_HOOKTYPE=tag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la pretag hook can forbid tagging $ cat >> .hg/hgrc < pretag.forbid = sh -c "printenv.py pretag.forbid 1" > EOF $ hg tag -d '4 0' fa pretag hook: HG_HOOKNAME=pretag HG_HOOKTYPE=pretag HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa pretag.forbid hook: HG_HOOKNAME=pretag.forbid HG_HOOKTYPE=pretag HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa abort: pretag.forbid hook exited with status 1 [255] $ hg tag -l fla pretag hook: HG_HOOKNAME=pretag HG_HOOKTYPE=pretag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla pretag.forbid hook: HG_HOOKNAME=pretag.forbid HG_HOOKTYPE=pretag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla abort: pretag.forbid hook exited with status 1 [255] pretxncommit hook can see changeset, can roll back txn, changeset no more there after $ cat >> .hg/hgrc < pretxncommit.forbid0 = sh -c "hg tip -q" > pretxncommit.forbid1 = sh -c "printenv.py pretxncommit.forbid 1" > EOF $ echo z > z $ hg add z $ hg -q tip 4:539e4b31b6dc $ hg commit -m 'fail' -d '4 0' precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a 5:6f611f8018c1 5:6f611f8018c1 pretxncommit.forbid hook: HG_HOOKNAME=pretxncommit.forbid1 HG_HOOKTYPE=pretxncommit HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a transaction abort! txnabort Python hook: txnid,txnname txnabort hook: HG_HOOKNAME=txnabort.1 HG_HOOKTYPE=txnabort HG_TXNID=TXN:$ID$ HG_TXNNAME=commit rollback completed abort: pretxncommit.forbid1 hook exited with status 1 [255] $ hg -q tip 4:539e4b31b6dc (Check that no 'changelog.i.a' file were left behind) $ ls -1 .hg/store/ 00changelog.i 00manifest.i data fncache journal.phaseroots phaseroots undo undo.backup.fncache undo.backupfiles undo.phaseroots precommit hook can prevent commit $ cat >> .hg/hgrc < precommit.forbid = sh -c "printenv.py precommit.forbid 1" > EOF $ hg commit -m 'fail' -d '4 0' precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 precommit.forbid hook: HG_HOOKNAME=precommit.forbid HG_HOOKTYPE=precommit HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 abort: precommit.forbid hook exited with status 1 [255] $ hg -q tip 4:539e4b31b6dc preupdate hook can prevent update $ cat >> .hg/hgrc < preupdate = sh -c "printenv.py preupdate" > EOF $ hg update 1 preupdate hook: HG_HOOKNAME=preupdate HG_HOOKTYPE=preupdate HG_PARENT1=ab228980c14d 0 files updated, 0 files merged, 2 files removed, 0 files unresolved update hook $ cat >> .hg/hgrc < update = sh -c "printenv.py update" > EOF $ hg update preupdate hook: HG_HOOKNAME=preupdate HG_HOOKTYPE=preupdate HG_PARENT1=539e4b31b6dc update hook: HG_ERROR=0 HG_HOOKNAME=update HG_HOOKTYPE=update HG_PARENT1=539e4b31b6dc 2 files updated, 0 files merged, 0 files removed, 0 files unresolved pushkey hook $ cat >> .hg/hgrc < pushkey = sh -c "printenv.py pushkey" > EOF $ cd ../b $ hg bookmark -r null foo $ hg push -B foo ../a pushing to ../a searching for changes no changes found pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=push pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a pushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey HG_KEY=foo HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_PUSHKEYCOMPAT=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a exporting bookmark foo [1] $ cd ../a listkeys hook $ cat >> .hg/hgrc < listkeys = sh -c "printenv.py listkeys" > EOF $ hg bookmark -r null bar pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark $ cd ../b $ hg pull -B bar ../a pulling from ../a listkeys hook: HG_HOOKNAME=listkeys HG_HOOKTYPE=listkeys HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'} no changes found adding remote bookmark bar $ cd ../a test that prepushkey can prevent incoming keys $ cat >> .hg/hgrc < prepushkey = sh -c "printenv.py prepushkey.forbid 1" > EOF $ cd ../b $ hg bookmark -r null baz $ hg push -B baz ../a pushing to ../a searching for changes listkeys hook: HG_HOOKNAME=listkeys HG_HOOKTYPE=listkeys HG_NAMESPACE=phases HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'} listkeys hook: HG_HOOKNAME=listkeys HG_HOOKTYPE=listkeys HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'} no changes found pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=push prepushkey.forbid hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=baz HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_PUSHKEYCOMPAT=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a abort: prepushkey hook exited with status 1 [255] $ cd ../a test that prelistkeys can prevent listing keys $ cat >> .hg/hgrc < prelistkeys = sh -c "printenv.py prelistkeys.forbid 1" > EOF $ hg bookmark -r null quux pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark $ cd ../b $ hg pull -B quux ../a pulling from ../a prelistkeys.forbid hook: HG_HOOKNAME=prelistkeys HG_HOOKTYPE=prelistkeys HG_NAMESPACE=bookmarks abort: prelistkeys hook exited with status 1 [255] $ cd ../a $ rm .hg/hgrc prechangegroup hook can prevent incoming changes $ cd ../b $ hg -q tip 3:07f3376c1e65 $ cat > .hg/hgrc < [hooks] > prechangegroup.forbid = sh -c "printenv.py prechangegroup.forbid 1" > EOF $ hg pull ../a pulling from ../a searching for changes prechangegroup.forbid hook: HG_HOOKNAME=prechangegroup.forbid HG_HOOKTYPE=prechangegroup HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a abort: prechangegroup.forbid hook exited with status 1 [255] pretxnchangegroup hook can see incoming changes, can roll back txn, incoming changes no longer there after $ cat > .hg/hgrc < [hooks] > pretxnchangegroup.forbid0 = hg tip -q > pretxnchangegroup.forbid1 = sh -c "printenv.py pretxnchangegroup.forbid 1" > EOF $ hg pull ../a pulling from ../a searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files 4:539e4b31b6dc pretxnchangegroup.forbid hook: HG_HOOKNAME=pretxnchangegroup.forbid1 HG_HOOKTYPE=pretxnchangegroup HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_NODE_LAST=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a transaction abort! rollback completed abort: pretxnchangegroup.forbid1 hook exited with status 1 [255] $ hg -q tip 3:07f3376c1e65 outgoing hooks can see env vars $ rm .hg/hgrc $ cat > ../a/.hg/hgrc < [hooks] > preoutgoing = sh -c "printenv.py preoutgoing" > outgoing = sh -c "printenv.py outgoing" > EOF $ hg pull ../a pulling from ../a searching for changes preoutgoing hook: HG_HOOKNAME=preoutgoing HG_HOOKTYPE=preoutgoing HG_SOURCE=pull outgoing hook: HG_HOOKNAME=outgoing HG_HOOKTYPE=outgoing HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_SOURCE=pull adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files adding remote bookmark quux new changesets 539e4b31b6dc (run 'hg update' to get a working copy) $ hg rollback repository tip rolled back to revision 3 (undo pull) preoutgoing hook can prevent outgoing changes $ cat >> ../a/.hg/hgrc < preoutgoing.forbid = sh -c "printenv.py preoutgoing.forbid 1" > EOF $ hg pull ../a pulling from ../a searching for changes preoutgoing hook: HG_HOOKNAME=preoutgoing HG_HOOKTYPE=preoutgoing HG_SOURCE=pull preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid HG_HOOKTYPE=preoutgoing HG_SOURCE=pull abort: preoutgoing.forbid hook exited with status 1 [255] outgoing hooks work for local clones $ cd .. $ cat > a/.hg/hgrc < [hooks] > preoutgoing = sh -c "printenv.py preoutgoing" > outgoing = sh -c "printenv.py outgoing" > EOF $ hg clone a c preoutgoing hook: HG_HOOKNAME=preoutgoing HG_HOOKTYPE=preoutgoing HG_SOURCE=clone outgoing hook: HG_HOOKNAME=outgoing HG_HOOKTYPE=outgoing HG_NODE=0000000000000000000000000000000000000000 HG_SOURCE=clone updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf c preoutgoing hook can prevent outgoing changes for local clones $ cat >> a/.hg/hgrc < preoutgoing.forbid = sh -c "printenv.py preoutgoing.forbid 1" > EOF $ hg clone a zzz preoutgoing hook: HG_HOOKNAME=preoutgoing HG_HOOKTYPE=preoutgoing HG_SOURCE=clone preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid HG_HOOKTYPE=preoutgoing HG_SOURCE=clone abort: preoutgoing.forbid hook exited with status 1 [255] $ cd "$TESTTMP/b" $ cat > hooktests.py < from __future__ import print_function > from mercurial import error > > uncallable = 0 > > def printargs(ui, args): > a = list(args.items()) > a.sort() > ui.write('hook args:\n') > for k, v in a: > ui.write(' %s %s\n' % (k, v)) > > def passhook(ui, repo, **args): > printargs(ui, args) > > def failhook(ui, repo, **args): > printargs(ui, args) > return True > > class LocalException(Exception): > pass > > def raisehook(**args): > raise LocalException('exception from hook') > > def aborthook(**args): > raise error.Abort('raise abort from hook') > > def brokenhook(**args): > return 1 + {} > > def verbosehook(ui, **args): > ui.note('verbose output from hook\n') > > def printtags(ui, repo, **args): > ui.write('%s\n' % sorted(repo.tags())) > > class container: > unreachable = 1 > EOF $ cat > syntaxerror.py << EOF > (foo > EOF test python hooks #if windows $ PYTHONPATH="$TESTTMP/b;$PYTHONPATH" #else $ PYTHONPATH="$TESTTMP/b:$PYTHONPATH" #endif $ export PYTHONPATH $ echo '[hooks]' > ../a/.hg/hgrc $ echo 'preoutgoing.broken = python:hooktests.brokenhook' >> ../a/.hg/hgrc $ hg pull ../a 2>&1 | grep 'raised an exception' error: preoutgoing.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict' $ echo '[hooks]' > ../a/.hg/hgrc $ echo 'preoutgoing.raise = python:hooktests.raisehook' >> ../a/.hg/hgrc $ hg pull ../a 2>&1 | grep 'raised an exception' error: preoutgoing.raise hook raised an exception: exception from hook $ echo '[hooks]' > ../a/.hg/hgrc $ echo 'preoutgoing.abort = python:hooktests.aborthook' >> ../a/.hg/hgrc $ hg pull ../a pulling from ../a searching for changes error: preoutgoing.abort hook failed: raise abort from hook abort: raise abort from hook [255] $ echo '[hooks]' > ../a/.hg/hgrc $ echo 'preoutgoing.fail = python:hooktests.failhook' >> ../a/.hg/hgrc $ hg pull ../a pulling from ../a searching for changes hook args: hooktype preoutgoing source pull abort: preoutgoing.fail hook failed [255] $ echo '[hooks]' > ../a/.hg/hgrc $ echo 'preoutgoing.uncallable = python:hooktests.uncallable' >> ../a/.hg/hgrc $ hg pull ../a pulling from ../a searching for changes abort: preoutgoing.uncallable hook is invalid: "hooktests.uncallable" is not callable [255] $ echo '[hooks]' > ../a/.hg/hgrc $ echo 'preoutgoing.nohook = python:hooktests.nohook' >> ../a/.hg/hgrc $ hg pull ../a pulling from ../a searching for changes abort: preoutgoing.nohook hook is invalid: "hooktests.nohook" is not defined [255] $ echo '[hooks]' > ../a/.hg/hgrc $ echo 'preoutgoing.nomodule = python:nomodule' >> ../a/.hg/hgrc $ hg pull ../a pulling from ../a searching for changes abort: preoutgoing.nomodule hook is invalid: "nomodule" not in a module [255] $ echo '[hooks]' > ../a/.hg/hgrc $ echo 'preoutgoing.badmodule = python:nomodule.nowhere' >> ../a/.hg/hgrc $ hg pull ../a pulling from ../a searching for changes abort: preoutgoing.badmodule hook is invalid: import of "nomodule" failed (run with --traceback for stack trace) [255] $ echo '[hooks]' > ../a/.hg/hgrc $ echo 'preoutgoing.unreachable = python:hooktests.container.unreachable' >> ../a/.hg/hgrc $ hg pull ../a pulling from ../a searching for changes abort: preoutgoing.unreachable hook is invalid: import of "hooktests.container" failed (run with --traceback for stack trace) [255] $ echo '[hooks]' > ../a/.hg/hgrc $ echo 'preoutgoing.syntaxerror = python:syntaxerror.syntaxerror' >> ../a/.hg/hgrc $ hg pull ../a pulling from ../a searching for changes abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed (run with --traceback for stack trace) [255] The second egrep is to filter out lines like ' ^', which are slightly different between Python 2.6 and Python 2.7. $ hg pull ../a --traceback 2>&1 | egrep -v '^( +File| [_a-zA-Z*(])' | egrep -v '^( )+(\^)?$' pulling from ../a searching for changes exception from first failed import attempt: Traceback (most recent call last): SyntaxError: * (glob) exception from second failed import attempt: Traceback (most recent call last): ImportError: No module named hgext_syntaxerror Traceback (most recent call last): HookLoadError: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed $ echo '[hooks]' > ../a/.hg/hgrc $ echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc $ hg pull ../a pulling from ../a searching for changes hook args: hooktype preoutgoing source pull adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files adding remote bookmark quux new changesets 539e4b31b6dc (run 'hg update' to get a working copy) post- python hooks that fail to *run* don't cause an abort $ rm ../a/.hg/hgrc $ echo '[hooks]' > .hg/hgrc $ echo 'post-pull.broken = python:hooktests.brokenhook' >> .hg/hgrc $ hg pull ../a pulling from ../a searching for changes no changes found error: post-pull.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict' (run with --traceback for stack trace) but post- python hooks that fail to *load* do $ echo '[hooks]' > .hg/hgrc $ echo 'post-pull.nomodule = python:nomodule' >> .hg/hgrc $ hg pull ../a pulling from ../a searching for changes no changes found abort: post-pull.nomodule hook is invalid: "nomodule" not in a module [255] $ echo '[hooks]' > .hg/hgrc $ echo 'post-pull.badmodule = python:nomodule.nowhere' >> .hg/hgrc $ hg pull ../a pulling from ../a searching for changes no changes found abort: post-pull.badmodule hook is invalid: import of "nomodule" failed (run with --traceback for stack trace) [255] $ echo '[hooks]' > .hg/hgrc $ echo 'post-pull.nohook = python:hooktests.nohook' >> .hg/hgrc $ hg pull ../a pulling from ../a searching for changes no changes found abort: post-pull.nohook hook is invalid: "hooktests.nohook" is not defined [255] make sure --traceback works $ echo '[hooks]' > .hg/hgrc $ echo 'commit.abort = python:hooktests.aborthook' >> .hg/hgrc $ echo aa > a $ hg --traceback commit -d '0 0' -ma 2>&1 | grep '^Traceback' Traceback (most recent call last): $ cd .. $ hg init c $ cd c $ cat > hookext.py < def autohook(ui, **args): > ui.write('Automatically installed hook\n') > > def reposetup(ui, repo): > repo.ui.setconfig("hooks", "commit.auto", autohook) > EOF $ echo '[extensions]' >> .hg/hgrc $ echo 'hookext = hookext.py' >> .hg/hgrc $ touch foo $ hg add foo $ hg ci -d '0 0' -m 'add foo' Automatically installed hook $ echo >> foo $ hg ci --debug -d '0 0' -m 'change foo' committing files: foo committing manifest committing changelog updating the branch cache committed changeset 1:52998019f6252a2b893452765fcb0a47351a5708 calling hook commit.auto: hgext_hookext.autohook Automatically installed hook $ hg showconfig hooks hooks.commit.auto= (glob) test python hook configured with python:[file]:[hook] syntax $ cd .. $ mkdir d $ cd d $ hg init repo $ mkdir hooks $ cd hooks $ cat > testhooks.py < def testhook(ui, **args): > ui.write('hook works\n') > EOF $ echo '[hooks]' > ../repo/.hg/hgrc $ echo "pre-commit.test = python:`pwd`/testhooks.py:testhook" >> ../repo/.hg/hgrc $ cd ../repo $ hg commit -d '0 0' hook works nothing changed [1] $ echo '[hooks]' > .hg/hgrc $ echo "update.ne = python:`pwd`/nonexistent.py:testhook" >> .hg/hgrc $ echo "pre-identify.npmd = python:`pwd`/:no_python_module_dir" >> .hg/hgrc $ hg up null loading update.ne hook failed: abort: $ENOENT$: $TESTTMP/d/repo/nonexistent.py [255] $ hg id loading pre-identify.npmd hook failed: abort: No module named repo! [255] $ cd ../../b make sure --traceback works on hook import failure $ cat > importfail.py < import somebogusmodule > # dereference something in the module to force demandimport to load it > somebogusmodule.whatever > EOF $ echo '[hooks]' > .hg/hgrc $ echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc $ echo a >> a $ hg --traceback commit -ma 2>&1 | egrep -v '^( +File| [a-zA-Z(])' exception from first failed import attempt: Traceback (most recent call last): ImportError: No module named somebogusmodule exception from second failed import attempt: Traceback (most recent call last): ImportError: No module named hgext_importfail Traceback (most recent call last): HookLoadError: precommit.importfail hook is invalid: import of "importfail" failed abort: precommit.importfail hook is invalid: import of "importfail" failed Issue1827: Hooks Update & Commit not completely post operation commit and update hooks should run after command completion. The largefiles use demonstrates a recursive wlock, showing the hook doesn't run until the final release (and dirstate flush). $ echo '[hooks]' > .hg/hgrc $ echo 'commit = hg id' >> .hg/hgrc $ echo 'update = hg id' >> .hg/hgrc $ echo bb > a $ hg ci -ma 223eafe2750c tip $ hg up 0 --config extensions.largefiles= The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) cb9a9f314b8b 1 files updated, 0 files merged, 0 files removed, 0 files unresolved make sure --verbose (and --quiet/--debug etc.) are propagated to the local ui that is passed to pre/post hooks $ echo '[hooks]' > .hg/hgrc $ echo 'pre-identify = python:hooktests.verbosehook' >> .hg/hgrc $ hg id cb9a9f314b8b $ hg id --verbose calling hook pre-identify: hooktests.verbosehook verbose output from hook cb9a9f314b8b Ensure hooks can be prioritized $ echo '[hooks]' > .hg/hgrc $ echo 'pre-identify.a = python:hooktests.verbosehook' >> .hg/hgrc $ echo 'pre-identify.b = python:hooktests.verbosehook' >> .hg/hgrc $ echo 'priority.pre-identify.b = 1' >> .hg/hgrc $ echo 'pre-identify.c = python:hooktests.verbosehook' >> .hg/hgrc $ hg id --verbose calling hook pre-identify.b: hooktests.verbosehook verbose output from hook calling hook pre-identify.a: hooktests.verbosehook verbose output from hook calling hook pre-identify.c: hooktests.verbosehook verbose output from hook cb9a9f314b8b new tags must be visible in pretxncommit (issue3210) $ echo 'pretxncommit.printtags = python:hooktests.printtags' >> .hg/hgrc $ hg tag -f foo ['a', 'foo', 'tip'] post-init hooks must not crash (issue4983) This also creates the `to` repo for the next test block. $ cd .. $ cat << EOF >> hgrc-with-post-init-hook > [hooks] > post-init = sh -c "printenv.py post-init" > EOF $ HGRCPATH=hgrc-with-post-init-hook hg init to post-init hook: HG_ARGS=init to HG_HOOKNAME=post-init HG_HOOKTYPE=post-init HG_OPTS={'insecure': None, 'remotecmd': '', 'ssh': ''} HG_PATS=['to'] HG_RESULT=0 new commits must be visible in pretxnchangegroup (issue3428) $ echo '[hooks]' >> to/.hg/hgrc $ echo 'prechangegroup = hg --traceback tip' >> to/.hg/hgrc $ echo 'pretxnchangegroup = hg --traceback tip' >> to/.hg/hgrc $ echo a >> to/a $ hg --cwd to ci -Ama adding a $ hg clone to from updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo aa >> from/a $ hg --cwd from ci -mb $ hg --cwd from push pushing to $TESTTMP/to searching for changes changeset: 0:cb9a9f314b8b tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files changeset: 1:9836a07b9b9d tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: b pretxnclose hook failure should abort the transaction $ hg init txnfailure $ cd txnfailure $ touch a && hg commit -Aqm a $ cat >> .hg/hgrc < [hooks] > pretxnclose.error = exit 1 > EOF $ hg strip -r 0 --config extensions.strip= 0 files updated, 0 files merged, 1 files removed, 0 files unresolved saved backup bundle to * (glob) transaction abort! rollback completed strip failed, backup bundle stored in * (glob) abort: pretxnclose.error hook exited with status 1 [255] $ hg recover no interrupted transaction available [1] $ cd .. check whether HG_PENDING makes pending changes only in related repositories visible to an external hook. (emulate a transaction running concurrently by copied .hg/store/00changelog.i.a in subsequent test) $ cat > $TESTTMP/savepending.sh < cp .hg/store/00changelog.i.a .hg/store/00changelog.i.a.saved > exit 1 # to avoid adding new revision for subsequent tests > EOF $ cd a $ hg tip -q 4:539e4b31b6dc $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" commit -m "invisible" transaction abort! rollback completed abort: pretxnclose hook exited with status 1 [255] $ cp .hg/store/00changelog.i.a.saved .hg/store/00changelog.i.a (check (in)visibility of new changeset while transaction running in repo) $ cat > $TESTTMP/checkpending.sh < echo '@a' > hg -R "$TESTTMP/a" tip -q > echo '@a/nested' > hg -R "$TESTTMP/a/nested" tip -q > exit 1 # to avoid adding new revision for subsequent tests > EOF $ hg init nested $ cd nested $ echo a > a $ hg add a $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" commit -m '#0' @a 4:539e4b31b6dc @a/nested 0:bf5e395ced2c transaction abort! rollback completed abort: pretxnclose hook exited with status 1 [255] Hook from untrusted hgrc are reported as failure ================================================ $ cat << EOF > $TESTTMP/untrusted.py > from mercurial import scmutil, util > def uisetup(ui): > class untrustedui(ui.__class__): > def _trusted(self, fp, f): > if util.normpath(fp.name).endswith('untrusted/.hg/hgrc'): > return False > return super(untrustedui, self)._trusted(fp, f) > ui.__class__ = untrustedui > EOF $ cat << EOF >> $HGRCPATH > [extensions] > untrusted=$TESTTMP/untrusted.py > EOF $ hg init untrusted $ cd untrusted Non-blocking hook ----------------- $ cat << EOF >> .hg/hgrc > [hooks] > txnclose.testing=echo txnclose hook called > EOF $ touch a && hg commit -Aqm a warning: untrusted hook txnclose.testing not executed $ hg log changeset: 0:3903775176ed tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a Non-blocking hook ----------------- $ cat << EOF >> .hg/hgrc > [hooks] > pretxnclose.testing=echo pre-txnclose hook called > EOF $ touch b && hg commit -Aqm a transaction abort! rollback completed abort: untrusted hook pretxnclose.testing not executed (see 'hg help config.trusted') [255] $ hg log changeset: 0:3903775176ed tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a mercurial-4.5.3/tests/test-convert-p4-filetypes.t0000644015407300116100000005275613261161234021723 0ustar augieeng00000000000000#require p4 execbit symlink $ echo "[extensions]" >> $HGRCPATH $ echo "convert = " >> $HGRCPATH create p4 depot $ P4ROOT=`pwd`/depot; export P4ROOT $ P4AUDIT=$P4ROOT/audit; export P4AUDIT $ P4JOURNAL=$P4ROOT/journal; export P4JOURNAL $ P4LOG=$P4ROOT/log; export P4LOG $ P4PORT=localhost:$HGPORT; export P4PORT $ P4DEBUG=1; export P4DEBUG $ P4CHARSET=utf8; export P4CHARSET start the p4 server $ [ ! -d $P4ROOT ] && mkdir $P4ROOT $ p4d -f -J off -xi >$P4ROOT/stdout 2>$P4ROOT/stderr $ p4d -f -J off >$P4ROOT/stdout 2>$P4ROOT/stderr & $ echo $! >> $DAEMON_PIDS $ trap "echo stopping the p4 server ; p4 admin stop" EXIT wait for the server to initialize $ while ! p4 ; do > sleep 1 > done >/dev/null 2>/dev/null create a client spec $ P4CLIENT=hg-p4-import; export P4CLIENT $ DEPOTPATH=//depot/test-mercurial-import/... $ p4 client -o | sed '/^View:/,$ d' >p4client $ echo View: >>p4client $ echo " $DEPOTPATH //$P4CLIENT/..." >>p4client $ p4 client -i T2=`echo $T | tr [:upper:] [:lower:]` > case $T in > apple) > ;; > symlink*) > echo "this is target $T" >target_$T2 > ln -s target_$T file_$T2 > p4 add target_$T2 > p4 add -t $T file_$T2 > ;; > binary*) > $PYTHON -c "file('file_$T2', 'wb').write('this is $T')" > p4 add -t $T file_$T2 > ;; > *) > echo "this is $T" >file_$T2 > p4 add -t $T file_$T2 > ;; > esac > done //depot/test-mercurial-import/file_text#1 - opened for add //depot/test-mercurial-import/file_binary#1 - opened for add //depot/test-mercurial-import/target_symlink#1 - opened for add //depot/test-mercurial-import/file_symlink#1 - opened for add //depot/test-mercurial-import/file_text+m#1 - opened for add //depot/test-mercurial-import/file_text+w#1 - opened for add //depot/test-mercurial-import/file_text+x#1 - opened for add //depot/test-mercurial-import/file_text+k#1 - opened for add //depot/test-mercurial-import/file_text+kx#1 - opened for add //depot/test-mercurial-import/file_text+ko#1 - opened for add //depot/test-mercurial-import/file_text+l#1 - opened for add //depot/test-mercurial-import/file_text+c#1 - opened for add //depot/test-mercurial-import/file_text+d#1 - opened for add //depot/test-mercurial-import/file_text+f#1 - opened for add //depot/test-mercurial-import/file_text+s#1 - opened for add //depot/test-mercurial-import/file_text+s2#1 - opened for add //depot/test-mercurial-import/file_binary+k#1 - opened for add //depot/test-mercurial-import/file_binary+x#1 - opened for add //depot/test-mercurial-import/file_binary+kx#1 - opened for add //depot/test-mercurial-import/target_symlink+k#1 - opened for add //depot/test-mercurial-import/file_symlink+k#1 - opened for add //depot/test-mercurial-import/file_ctext#1 - opened for add //depot/test-mercurial-import/file_cxtext#1 - opened for add //depot/test-mercurial-import/file_ktext#1 - opened for add //depot/test-mercurial-import/file_kxtext#1 - opened for add //depot/test-mercurial-import/file_ltext#1 - opened for add //depot/test-mercurial-import/file_tempobj#1 - opened for add //depot/test-mercurial-import/file_ubinary#1 - opened for add //depot/test-mercurial-import/file_uxbinary#1 - opened for add //depot/test-mercurial-import/file_xbinary#1 - opened for add //depot/test-mercurial-import/file_xltext#1 - opened for add //depot/test-mercurial-import/file_xtempobj#1 - opened for add //depot/test-mercurial-import/file_xtext#1 - opened for add $ p4 submit -d initial Submitting change 1. Locking 33 files ... add //depot/test-mercurial-import/file_binary#1 add //depot/test-mercurial-import/file_binary+k#1 add //depot/test-mercurial-import/file_binary+kx#1 add //depot/test-mercurial-import/file_binary+x#1 add //depot/test-mercurial-import/file_ctext#1 add //depot/test-mercurial-import/file_cxtext#1 add //depot/test-mercurial-import/file_ktext#1 add //depot/test-mercurial-import/file_kxtext#1 add //depot/test-mercurial-import/file_ltext#1 add //depot/test-mercurial-import/file_symlink#1 add //depot/test-mercurial-import/file_symlink+k#1 add //depot/test-mercurial-import/file_tempobj#1 add //depot/test-mercurial-import/file_text#1 add //depot/test-mercurial-import/file_text+c#1 add //depot/test-mercurial-import/file_text+d#1 add //depot/test-mercurial-import/file_text+f#1 add //depot/test-mercurial-import/file_text+k#1 add //depot/test-mercurial-import/file_text+ko#1 add //depot/test-mercurial-import/file_text+kx#1 add //depot/test-mercurial-import/file_text+l#1 add //depot/test-mercurial-import/file_text+m#1 add //depot/test-mercurial-import/file_text+s#1 add //depot/test-mercurial-import/file_text+s2#1 add //depot/test-mercurial-import/file_text+w#1 add //depot/test-mercurial-import/file_text+x#1 add //depot/test-mercurial-import/file_ubinary#1 add //depot/test-mercurial-import/file_uxbinary#1 add //depot/test-mercurial-import/file_xbinary#1 add //depot/test-mercurial-import/file_xltext#1 add //depot/test-mercurial-import/file_xtempobj#1 add //depot/test-mercurial-import/file_xtext#1 add //depot/test-mercurial-import/target_symlink#1 add //depot/test-mercurial-import/target_symlink+k#1 Change 1 submitted. //depot/test-mercurial-import/file_binary+k#1 - refreshing //depot/test-mercurial-import/file_binary+kx#1 - refreshing //depot/test-mercurial-import/file_ktext#1 - refreshing //depot/test-mercurial-import/file_kxtext#1 - refreshing //depot/test-mercurial-import/file_symlink+k#1 - refreshing //depot/test-mercurial-import/file_text+k#1 - refreshing //depot/test-mercurial-import/file_text+ko#1 - refreshing //depot/test-mercurial-import/file_text+kx#1 - refreshing test keyword expansion $ p4 edit file_* target_* //depot/test-mercurial-import/file_binary#1 - opened for edit //depot/test-mercurial-import/file_binary+k#1 - opened for edit //depot/test-mercurial-import/file_binary+kx#1 - opened for edit //depot/test-mercurial-import/file_binary+x#1 - opened for edit //depot/test-mercurial-import/file_ctext#1 - opened for edit //depot/test-mercurial-import/file_cxtext#1 - opened for edit //depot/test-mercurial-import/file_ktext#1 - opened for edit //depot/test-mercurial-import/file_kxtext#1 - opened for edit //depot/test-mercurial-import/file_ltext#1 - opened for edit //depot/test-mercurial-import/file_symlink#1 - opened for edit //depot/test-mercurial-import/file_symlink+k#1 - opened for edit //depot/test-mercurial-import/file_tempobj#1 - opened for edit //depot/test-mercurial-import/file_text#1 - opened for edit //depot/test-mercurial-import/file_text+c#1 - opened for edit //depot/test-mercurial-import/file_text+d#1 - opened for edit //depot/test-mercurial-import/file_text+f#1 - opened for edit //depot/test-mercurial-import/file_text+k#1 - opened for edit //depot/test-mercurial-import/file_text+ko#1 - opened for edit //depot/test-mercurial-import/file_text+kx#1 - opened for edit //depot/test-mercurial-import/file_text+l#1 - opened for edit //depot/test-mercurial-import/file_text+m#1 - opened for edit //depot/test-mercurial-import/file_text+s#1 - opened for edit //depot/test-mercurial-import/file_text+s2#1 - opened for edit //depot/test-mercurial-import/file_text+w#1 - opened for edit //depot/test-mercurial-import/file_text+x#1 - opened for edit //depot/test-mercurial-import/file_ubinary#1 - opened for edit //depot/test-mercurial-import/file_uxbinary#1 - opened for edit //depot/test-mercurial-import/file_xbinary#1 - opened for edit //depot/test-mercurial-import/file_xltext#1 - opened for edit //depot/test-mercurial-import/file_xtempobj#1 - opened for edit //depot/test-mercurial-import/file_xtext#1 - opened for edit //depot/test-mercurial-import/target_symlink#1 - opened for edit //depot/test-mercurial-import/target_symlink+k#1 - opened for edit $ for T in $TYPES ; do > T2=`echo $T | tr [:upper:] [:lower:]` > echo '$Id$' >>file_$T2 > echo '$Header$' >>file_$T2 > echo '$Date$' >>file_$T2 > echo '$DateTime$' >>file_$T2 > echo '$Change$' >>file_$T2 > echo '$File$' >>file_$T2 > echo '$Revision$' >>file_$T2 > echo '$Header$$Header$Header$' >>file_$T2 > done $ ln -s 'target_$Header$' crazy_symlink+k $ p4 add -t symlink+k crazy_symlink+k //depot/test-mercurial-import/crazy_symlink+k#1 - opened for add $ p4 submit -d keywords Submitting change 2. Locking 34 files ... add //depot/test-mercurial-import/crazy_symlink+k#1 edit //depot/test-mercurial-import/file_binary#2 edit //depot/test-mercurial-import/file_binary+k#2 edit //depot/test-mercurial-import/file_binary+kx#2 edit //depot/test-mercurial-import/file_binary+x#2 edit //depot/test-mercurial-import/file_ctext#2 edit //depot/test-mercurial-import/file_cxtext#2 edit //depot/test-mercurial-import/file_ktext#2 edit //depot/test-mercurial-import/file_kxtext#2 edit //depot/test-mercurial-import/file_ltext#2 edit //depot/test-mercurial-import/file_symlink#2 edit //depot/test-mercurial-import/file_symlink+k#2 edit //depot/test-mercurial-import/file_tempobj#2 edit //depot/test-mercurial-import/file_text#2 edit //depot/test-mercurial-import/file_text+c#2 edit //depot/test-mercurial-import/file_text+d#2 edit //depot/test-mercurial-import/file_text+f#2 edit //depot/test-mercurial-import/file_text+k#2 edit //depot/test-mercurial-import/file_text+ko#2 edit //depot/test-mercurial-import/file_text+kx#2 edit //depot/test-mercurial-import/file_text+l#2 edit //depot/test-mercurial-import/file_text+m#2 edit //depot/test-mercurial-import/file_text+s#2 edit //depot/test-mercurial-import/file_text+s2#2 edit //depot/test-mercurial-import/file_text+w#2 edit //depot/test-mercurial-import/file_text+x#2 edit //depot/test-mercurial-import/file_ubinary#2 edit //depot/test-mercurial-import/file_uxbinary#2 edit //depot/test-mercurial-import/file_xbinary#2 edit //depot/test-mercurial-import/file_xltext#2 edit //depot/test-mercurial-import/file_xtempobj#2 edit //depot/test-mercurial-import/file_xtext#2 edit //depot/test-mercurial-import/target_symlink#2 edit //depot/test-mercurial-import/target_symlink+k#2 Change 2 submitted. //depot/test-mercurial-import/crazy_symlink+k#1 - refreshing //depot/test-mercurial-import/file_binary+k#2 - refreshing //depot/test-mercurial-import/file_binary+kx#2 - refreshing //depot/test-mercurial-import/file_ktext#2 - refreshing //depot/test-mercurial-import/file_kxtext#2 - refreshing //depot/test-mercurial-import/file_symlink+k#2 - refreshing //depot/test-mercurial-import/file_text+k#2 - refreshing //depot/test-mercurial-import/file_text+ko#2 - refreshing //depot/test-mercurial-import/file_text+kx#2 - refreshing check keywords in p4 $ grep -H Header file_* file_binary:$Header$ file_binary:$Header$$Header$Header$ file_binary+k:$Header: //depot/test-mercurial-import/file_binary+k#2 $ file_binary+k:$Header: //depot/test-mercurial-import/file_binary+k#2 $$Header: //depot/test-mercurial-import/file_binary+k#2 $Header$ file_binary+kx:$Header: //depot/test-mercurial-import/file_binary+kx#2 $ file_binary+kx:$Header: //depot/test-mercurial-import/file_binary+kx#2 $$Header: //depot/test-mercurial-import/file_binary+kx#2 $Header$ file_binary+x:$Header$ file_binary+x:$Header$$Header$Header$ file_ctext:$Header$ file_ctext:$Header$$Header$Header$ file_cxtext:$Header$ file_cxtext:$Header$$Header$Header$ file_ktext:$Header: //depot/test-mercurial-import/file_ktext#2 $ file_ktext:$Header: //depot/test-mercurial-import/file_ktext#2 $$Header: //depot/test-mercurial-import/file_ktext#2 $Header$ file_kxtext:$Header: //depot/test-mercurial-import/file_kxtext#2 $ file_kxtext:$Header: //depot/test-mercurial-import/file_kxtext#2 $$Header: //depot/test-mercurial-import/file_kxtext#2 $Header$ file_ltext:$Header$ file_ltext:$Header$$Header$Header$ file_symlink:$Header$ file_symlink:$Header$$Header$Header$ file_symlink+k:$Header$ file_symlink+k:$Header$$Header$Header$ file_tempobj:$Header$ file_tempobj:$Header$$Header$Header$ file_text:$Header$ file_text:$Header$$Header$Header$ file_text+c:$Header$ file_text+c:$Header$$Header$Header$ file_text+d:$Header$ file_text+d:$Header$$Header$Header$ file_text+f:$Header$ file_text+f:$Header$$Header$Header$ file_text+k:$Header: //depot/test-mercurial-import/file_text+k#2 $ file_text+k:$Header: //depot/test-mercurial-import/file_text+k#2 $$Header: //depot/test-mercurial-import/file_text+k#2 $Header$ file_text+ko:$Header: //depot/test-mercurial-import/file_text+ko#2 $ file_text+ko:$Header: //depot/test-mercurial-import/file_text+ko#2 $$Header: //depot/test-mercurial-import/file_text+ko#2 $Header$ file_text+kx:$Header: //depot/test-mercurial-import/file_text+kx#2 $ file_text+kx:$Header: //depot/test-mercurial-import/file_text+kx#2 $$Header: //depot/test-mercurial-import/file_text+kx#2 $Header$ file_text+l:$Header$ file_text+l:$Header$$Header$Header$ file_text+m:$Header$ file_text+m:$Header$$Header$Header$ file_text+s:$Header$ file_text+s:$Header$$Header$Header$ file_text+s2:$Header$ file_text+s2:$Header$$Header$Header$ file_text+w:$Header$ file_text+w:$Header$$Header$Header$ file_text+x:$Header$ file_text+x:$Header$$Header$Header$ file_ubinary:$Header$ file_ubinary:$Header$$Header$Header$ file_uxbinary:$Header$ file_uxbinary:$Header$$Header$Header$ file_xbinary:$Header$ file_xbinary:$Header$$Header$Header$ file_xltext:$Header$ file_xltext:$Header$$Header$Header$ file_xtempobj:$Header$ file_xtempobj:$Header$$Header$Header$ file_xtext:$Header$ file_xtext:$Header$$Header$Header$ convert $ hg convert -s p4 $DEPOTPATH dst initializing destination dst repository scanning source... reading p4 views collecting p4 changelists 1 initial 2 keywords sorting... converting... 1 initial 0 keywords $ hg -R dst log --template 'rev={rev} desc="{desc}" tags="{tags}" files="{files}"\n' rev=1 desc="keywords" tags="tip" files="crazy_symlink+k file_binary file_binary+k file_binary+kx file_binary+x file_ctext file_cxtext file_ktext file_kxtext file_ltext file_tempobj file_text file_text+c file_text+d file_text+f file_text+k file_text+ko file_text+kx file_text+l file_text+m file_text+s file_text+s2 file_text+w file_text+x file_ubinary file_uxbinary file_xbinary file_xltext file_xtempobj file_xtext target_symlink target_symlink+k" rev=0 desc="initial" tags="" files="file_binary file_binary+k file_binary+kx file_binary+x file_ctext file_cxtext file_ktext file_kxtext file_ltext file_symlink file_symlink+k file_text file_text+c file_text+d file_text+f file_text+k file_text+ko file_text+kx file_text+l file_text+m file_text+s2 file_text+w file_text+x file_ubinary file_uxbinary file_xbinary file_xltext file_xtext target_symlink target_symlink+k" revision 0 $ hg -R dst update 0 30 files updated, 0 files merged, 0 files removed, 0 files unresolved $ head dst/file_* | cat -v ==> dst/file_binary <== this is binary ==> dst/file_binary+k <== this is binary+k ==> dst/file_binary+kx <== this is binary+kx ==> dst/file_binary+x <== this is binary+x ==> dst/file_ctext <== this is ctext ==> dst/file_cxtext <== this is cxtext ==> dst/file_ktext <== this is ktext ==> dst/file_kxtext <== this is kxtext ==> dst/file_ltext <== this is ltext ==> dst/file_symlink <== this is target symlink ==> dst/file_symlink+k <== this is target symlink+k ==> dst/file_text <== this is text ==> dst/file_text+c <== this is text+C ==> dst/file_text+d <== this is text+D ==> dst/file_text+f <== this is text+F ==> dst/file_text+k <== this is text+k ==> dst/file_text+ko <== this is text+ko ==> dst/file_text+kx <== this is text+kx ==> dst/file_text+l <== this is text+l ==> dst/file_text+m <== this is text+m ==> dst/file_text+s2 <== this is text+S2 ==> dst/file_text+w <== this is text+w ==> dst/file_text+x <== this is text+x ==> dst/file_ubinary <== this is ubinary ==> dst/file_uxbinary <== this is uxbinary ==> dst/file_xbinary <== this is xbinary ==> dst/file_xltext <== this is xltext ==> dst/file_xtext <== this is xtext revision 1 $ hg -R dst update 1 32 files updated, 0 files merged, 0 files removed, 0 files unresolved $ head dst/file_* | cat -v ==> dst/file_binary <== this is binary$Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_binary+k <== this is binary+k$Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_binary+kx <== this is binary+kx$Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_binary+x <== this is binary+x$Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_ctext <== this is ctext $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_cxtext <== this is cxtext $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_ktext <== this is ktext $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_kxtext <== this is kxtext $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_ltext <== this is ltext $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_symlink <== this is target symlink $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_symlink+k <== this is target symlink+k $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_tempobj <== this is tempobj $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_text <== this is text $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_text+c <== this is text+C $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_text+d <== this is text+D $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_text+f <== this is text+F $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_text+k <== this is text+k $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_text+ko <== this is text+ko $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_text+kx <== this is text+kx $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_text+l <== this is text+l $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_text+m <== this is text+m $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_text+s <== this is text+S $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_text+s2 <== this is text+S2 $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_text+w <== this is text+w $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_text+x <== this is text+x $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_ubinary <== this is ubinary $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_uxbinary <== this is uxbinary $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_xbinary <== this is xbinary $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_xltext <== this is xltext $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_xtempobj <== this is xtempobj $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ ==> dst/file_xtext <== this is xtext $Id$ $Header$ $Date$ $DateTime$ $Change$ $File$ $Revision$ $Header$$Header$Header$ crazy_symlink $ readlink.py crazy_symlink+k crazy_symlink+k -> target_$Header: //depot/test-mercurial-import/crazy_symlink+k#1 $ $ readlink.py dst/crazy_symlink+k dst/crazy_symlink+k -> target_$Header$ exit trap: stopping the p4 server mercurial-4.5.3/tests/testlib/0000755015407300116100000000000013261161260016204 5ustar augieeng00000000000000mercurial-4.5.3/tests/testlib/obsmarker-common.sh0000644015407300116100000000031513261161234022013 0ustar augieeng00000000000000mkcommit() { echo "$1" > "$1" hg add "$1" hg ci -m "$1" } getid() { hg log --hidden --template '{node}\n' --rev "$1" } cat >> $HGRCPATH < %d\n' % (rev, move[1]))) else: ui.write(('test-debug-phase: move rev %d: %s -> %d\n' % (rev, move[0], move[1]))) class reportphaserepo(repo.__class__): def transaction(self, *args, **kwargs): tr = super(reportphaserepo, self).transaction(*args, **kwargs) tr.addpostclose('report-phase', reportphasemove) return tr repo.__class__ = reportphaserepo mercurial-4.5.3/tests/testlib/exchange-obsmarker-util.sh0000755015407300116100000000705013261161234023266 0ustar augieeng00000000000000#!/bin/sh # setup config and various utility to test obsolescence marker exchanges tests cat >> $TESTTMP/prune.sh << EOF rev=\`hg log --hidden --template '{node}\n' --rev "\$3"\` hg debugobsolete --record-parents \$1 "\$2" \$rev \ && hg up --quiet 'max((::.) - obsolete())' EOF cat >> $HGRCPATH < "$1" hg add "$1" hg ci -m "$1" } getid() { hg log --hidden --template '{node}\n' --rev "$1" } setuprepos() { echo creating test repo for test case $1 mkdir $1 cd $1 echo - pulldest hg init pushdest cd pushdest mkcommit O hg phase --public . cd .. echo - main hg clone -q pushdest main echo - pushdest hg clone -q main pulldest echo 'cd into `main` and proceed with env setup' } inspect_obsmarkers (){ # This exist as its own function to help the evolve extension reuse the tests as is. # The evolve extensions version will includes more advances query (eg: # related to obsmarkers discovery) to this. echo 'obsstore content' echo '================' hg debugobsolete } dotest() { # dotest TESTNAME [TARGETNODE] [PUSHFLAGS+] # # test exchange for the given test case. # # This function performs push and pull in all directions through all # protocols and display the resulting obsolescence markers on all sides. testcase=$1 shift target="$1" if [ $# -gt 0 ]; then shift fi targetnode="" desccall="" cd $testcase echo "## Running testcase $testcase" if [ -n "$target" ]; then desccall="desc("\'"$target"\'")" targetnode="`hg -R main id -qr \"$desccall\"`" echo "# testing echange of \"$target\" ($targetnode)" fi echo "## initial state" echo "# obstore: main" hg -R main debugobsolete | sort echo "# obstore: pushdest" hg -R pushdest debugobsolete | sort echo "# obstore: pulldest" hg -R pulldest debugobsolete | sort if [ -n "$target" ]; then echo "## pushing \"$target\"" from main to pushdest hg -R main push -r "$desccall" $@ pushdest else echo "## pushing from main to pushdest" hg -R main push pushdest $@ fi echo "## post push state" echo "# obstore: main" hg -R main debugobsolete | sort echo "# obstore: pushdest" hg -R pushdest debugobsolete | sort echo "# obstore: pulldest" hg -R pulldest debugobsolete | sort if [ -n "$target" ]; then echo "## pulling \"$targetnode\"" from main into pulldest hg -R pulldest pull -r $targetnode $@ main else echo "## pulling from main into pulldest" hg -R pulldest pull main $@ fi echo "## post pull state" echo "# obstore: main" hg -R main debugobsolete | sort echo "# obstore: pushdest" hg -R pushdest debugobsolete | sort echo "# obstore: pulldest" hg -R pulldest debugobsolete | sort cd .. } mercurial-4.5.3/tests/testlib/push-checkheads-util.sh0000644015407300116100000000136613261161234022561 0ustar augieeng00000000000000# setup config and various utility to test new heads checks on push cat >> $HGRCPATH < "$1" hg add "$1" hg ci -m "$1" } getid() { hg log --hidden --template '{node}\n' --rev "$1" } setuprepos() { echo creating basic server and client repo hg init server cd server mkcommit root hg phase --public . mkcommit A0 cd .. hg clone server client } mercurial-4.5.3/tests/test-pull-r.t0000644015407300116100000000666613261161234017132 0ustar augieeng00000000000000 $ hg init repo $ cd repo $ echo foo > foo $ hg ci -qAm 'add foo' $ echo >> foo $ hg ci -m 'change foo' $ hg up -qC 0 $ echo bar > bar $ hg ci -qAm 'add bar' $ hg log changeset: 2:effea6de0384 tag: tip parent: 0:bbd179dfa0a7 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add bar changeset: 1:ed1b79f46b9a user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: change foo changeset: 0:bbd179dfa0a7 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add foo $ cd .. don't show "(+1 heads)" message when pulling closed head $ hg clone -q repo repo2 $ hg clone -q repo2 repo3 $ cd repo2 $ hg up -q 0 $ echo hello >> foo $ hg ci -mx1 created new head $ hg ci -mx2 --close-branch $ cd ../repo3 $ hg heads -q --closed 2:effea6de0384 1:ed1b79f46b9a $ hg pull pulling from $TESTTMP/repo2 searching for changes adding changesets adding manifests adding file changes added 2 changesets with 1 changes to 1 files new changesets 8c900227dd5d:00cfe9073916 (run 'hg update' to get a working copy) $ hg heads -q --closed 4:00cfe9073916 2:effea6de0384 1:ed1b79f46b9a $ cd .. $ hg init copy $ cd copy Pull a missing revision: $ hg pull -qr missing ../repo abort: unknown revision 'missing'! [255] Pull multiple revisions with update: $ hg pull -qu -r 0 -r 1 ../repo $ hg -q parents 0:bbd179dfa0a7 $ hg rollback repository tip rolled back to revision -1 (undo pull) working directory now based on revision -1 $ hg pull -qr 0 ../repo $ hg log changeset: 0:bbd179dfa0a7 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add foo $ hg pull -qr 1 ../repo $ hg log changeset: 1:ed1b79f46b9a tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: change foo changeset: 0:bbd179dfa0a7 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add foo This used to abort: received changelog group is empty: $ hg pull -qr 1 ../repo Test race condition with -r and -U (issue4707) We pull '-U -r ' and the name change right after/during the changegroup emission. We use http because http is better is our racy-est option. $ echo babar > ../repo/jungle $ cat < ../repo/.hg/hgrc > [hooks] > outgoing.makecommit = hg ci -Am 'racy commit'; echo committed in pull-race > EOF $ hg serve -R ../repo -p $HGPORT2 -d --pid-file=../repo.pid $ cat ../repo.pid >> $DAEMON_PIDS $ hg pull --rev default --update http://localhost:$HGPORT2/ pulling from http://localhost:$HGPORT2/ searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets effea6de0384 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg log -G @ changeset: 2:effea6de0384 | tag: tip | parent: 0:bbd179dfa0a7 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: add bar | | o changeset: 1:ed1b79f46b9a |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: change foo | o changeset: 0:bbd179dfa0a7 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add foo $ cd .. $ killdaemons.py mercurial-4.5.3/tests/test-push-checkheads-pruned-B7.t0000644015407300116100000000351613261161234022506 0ustar augieeng00000000000000==================================== Testing head checking code: Case B-7 ==================================== Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This case is part of a series of tests checking this behavior. Category B: simple case involving pruned changesets TestCase 7: single changesets, pruned then superseeded (on an existing changeset) .. old-state: .. .. * 1 changeset branch .. .. new-state: .. .. * old branch is rewritten onto the common set, .. * the new version is then pruned. .. .. expected-result: .. .. * push allowed .. .. graph-summary: .. .. A ø⇠⊗ A' .. B ◔ | | .. \|/ .. ◠$ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir B7 $ cd B7 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd client $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit B0 created new head $ mkcommit A1 $ hg up 'desc(B0)' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg debugobsolete `getid "desc(A0)"` `getid "desc(A1)"` obsoleted 1 changesets $ hg debugobsolete --record-parents `getid "desc(A1)"` obsoleted 1 changesets $ hg log -G --hidden x ba93660aff8d (draft): A1 | @ 74ff5441d343 (draft): B0 | | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): root Actual testing -------------- $ hg push pushing to $TESTTMP/B7/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) 2 new obsolescence markers obsoleted 1 changesets $ cd ../.. mercurial-4.5.3/tests/test-convert-svn-startrev.t0000644015407300116100000000331013261161234022032 0ustar augieeng00000000000000#require svn svn-bindings $ cat >> $HGRCPATH < [extensions] > convert = > EOF $ convert() > { > startrev=$1 > repopath=A-r$startrev-hg > hg convert --config convert.svn.startrev=$startrev \ > --config convert.svn.trunk=branches/branch1 \ > --config convert.svn.branches=" " \ > --config convert.svn.tags= \ > --datesort svn-repo $repopath > hg -R $repopath log -G \ > --template '{rev} {desc|firstline} files: {files}\n' > echo > } $ svnadmin create svn-repo $ svnadmin load -q svn-repo < "$TESTDIR/svn/startrev.svndump" Convert before branching point $ convert 3 initializing destination A-r3-hg repository scanning source... sorting... converting... 3 removeb 2 changeaa 1 branch, changeaaa 0 addc,changeaaaa o 3 addc,changeaaaa files: a c | o 2 branch, changeaaa files: a | o 1 changeaa files: a | o 0 removeb files: a Convert before branching point $ convert 4 initializing destination A-r4-hg repository scanning source... sorting... converting... 2 changeaa 1 branch, changeaaa 0 addc,changeaaaa o 2 addc,changeaaaa files: a c | o 1 branch, changeaaa files: a | o 0 changeaa files: a Convert at branching point $ convert 5 initializing destination A-r5-hg repository scanning source... sorting... converting... 1 branch, changeaaa 0 addc,changeaaaa o 1 addc,changeaaaa files: a c | o 0 branch, changeaaa files: a Convert last revision only $ convert 6 initializing destination A-r6-hg repository scanning source... sorting... converting... 0 addc,changeaaaa o 0 addc,changeaaaa files: a c mercurial-4.5.3/tests/test-config-env.py.out0000644015407300116100000000017613261161234020733 0ustar augieeng00000000000000pager.pager=p0 # $TESTTMP/sysrc:4 ui.editor=e1 # $TESTTMP/userrc:2 pager.pager=p2 # $PAGER ui.editor=e1 # $TESTTMP/userrc:2 mercurial-4.5.3/tests/cgienv0000644015407300116100000000332713261161234015742 0ustar augieeng00000000000000DOCUMENT_ROOT="/var/www/hg"; export DOCUMENT_ROOT GATEWAY_INTERFACE="CGI/1.1"; export GATEWAY_INTERFACE HTTP_ACCEPT="text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; export HTTP_ACCEPT HTTP_ACCEPT_CHARSET="ISO-8859-1,utf-8;q=0.7,*;q=0.7"; export HTTP_ACCEPT_CHARSET HTTP_ACCEPT_ENCODING="gzip,deflate"; export HTTP_ACCEPT_ENCODING HTTP_ACCEPT_LANGUAGE="en-us,en;q=0.5"; export HTTP_ACCEPT_LANGUAGE HTTP_CACHE_CONTROL="max-age=0"; export HTTP_CACHE_CONTROL HTTP_CONNECTION="keep-alive"; export HTTP_CONNECTION HTTP_HOST="hg.omnifarious.org"; export HTTP_HOST HTTP_KEEP_ALIVE="300"; export HTTP_KEEP_ALIVE HTTP_USER_AGENT="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.4) Gecko/20060608 Ubuntu/dapper-security Firefox/1.5.0.4"; export HTTP_USER_AGENT PATH_INFO="/"; export PATH_INFO PATH_TRANSLATED="/var/www/hg/index.html"; export PATH_TRANSLATED QUERY_STRING=""; export QUERY_STRING REMOTE_ADDR="127.0.0.2"; export REMOTE_ADDR REMOTE_PORT="44703"; export REMOTE_PORT REQUEST_METHOD="GET"; export REQUEST_METHOD REQUEST_URI="/test/"; export REQUEST_URI SCRIPT_FILENAME="/home/hopper/hg_public/test.cgi"; export SCRIPT_FILENAME SCRIPT_NAME="/test"; export SCRIPT_NAME SCRIPT_URI="http://hg.omnifarious.org/test/"; export SCRIPT_URI SCRIPT_URL="/test/"; export SCRIPT_URL SERVER_ADDR="127.0.0.1"; export SERVER_ADDR SERVER_ADMIN="eric@localhost"; export SERVER_ADMIN SERVER_NAME="hg.omnifarious.org"; export SERVER_NAME SERVER_PORT="80"; export SERVER_PORT SERVER_PROTOCOL="HTTP/1.1"; export SERVER_PROTOCOL SERVER_SIGNATURE="
    Apache/2.0.53 (Fedora) Server at hg.omnifarious.org Port 80
    "; export SERVER_SIGNATURE SERVER_SOFTWARE="Apache/2.0.53 (Fedora)"; export SERVER_SOFTWARE mercurial-4.5.3/tests/test-push-checkheads-superceed-A8.t0000644015407300116100000000355113261161234023167 0ustar augieeng00000000000000==================================== Testing head checking code: Case A-8 ==================================== Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This case is part of a series of tests checking this behavior. Category A: simple case involving a branch being superceeded by another. TestCase 8: single-changeset branch indirect rewrite .. old-state: .. .. * 1-changeset branch .. .. new-state: .. .. * 1-changeset branch succeeding to A, through another unpushed changesets .. .. expected-result: .. .. * push allowed .. .. graph-summary: .. .. A' .. A ø⇠ø⇠◔ A'' .. |/ / .. | / .. |/ .. ◠$ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir A8 $ cd A8 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd client $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit A1 created new head $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit A2 created new head $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` obsoleted 1 changesets $ hg debugobsolete `getid "desc(A1)" ` `getid "desc(A2)"` obsoleted 1 changesets $ hg log -G --hidden @ c1f8d089020f (draft): A2 | | x f6082bc4ffef (draft): A1 |/ | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): root Actual testing -------------- $ hg push pushing to $TESTTMP/A8/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) 2 new obsolescence markers obsoleted 1 changesets $ cd ../.. mercurial-4.5.3/tests/test-clone-r.t0000644015407300116100000001743013261161234017245 0ustar augieeng00000000000000 $ hg init test $ cd test $ echo 0 >> afile $ hg add afile $ hg commit -m "0.0" $ echo 1 >> afile $ hg commit -m "0.1" $ echo 2 >> afile $ hg commit -m "0.2" $ echo 3 >> afile $ hg commit -m "0.3" $ hg update -C 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 1 >> afile $ hg commit -m "1.1" created new head $ echo 2 >> afile $ hg commit -m "1.2" $ echo a line > fred $ echo 3 >> afile $ hg add fred $ hg commit -m "1.3" $ hg mv afile adifferentfile $ hg commit -m "1.3m" $ hg update -C 3 1 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg mv afile anotherfile $ hg commit -m "0.3m" $ hg debugindex -f 1 afile rev flag offset length size ..... link p1 p2 nodeid (re) 0 0000 0 3 2 ..... 0 -1 -1 362fef284ce2 (re) 1 0000 3 5 4 ..... 1 0 -1 125144f7e028 (re) 2 0000 8 7 6 ..... 2 1 -1 4c982badb186 (re) 3 0000 15 9 8 ..... 3 2 -1 19b1fc555737 (re) $ hg debugindex adifferentfile rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 75 ..... 7 2565f3199a74 000000000000 000000000000 (re) $ hg debugindex anotherfile rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 75 ..... 8 2565f3199a74 000000000000 000000000000 (re) $ hg debugindex fred rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 8 ..... 6 12ab3bcc5ea4 000000000000 000000000000 (re) $ hg debugindex --manifest rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 48 ..... 0 43eadb1d2d06 000000000000 000000000000 (re) 1 48 48 ..... 1 8b89697eba2c 43eadb1d2d06 000000000000 (re) 2 96 48 ..... 2 626a32663c2f 8b89697eba2c 000000000000 (re) 3 144 48 ..... 3 f54c32f13478 626a32663c2f 000000000000 (re) 4 192 .. ..... 6 de68e904d169 626a32663c2f 000000000000 (re) 5 2.. .. ..... 7 09bb521d218d de68e904d169 000000000000 (re) 6 3.. 54 ..... 8 1fde233dfb0f f54c32f13478 000000000000 (re) $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 4 files, 9 changesets, 7 total revisions $ cd .. $ for i in 0 1 2 3 4 5 6 7 8; do > echo > echo ---- hg clone -r "$i" test test-"$i" > hg clone -r "$i" test test-"$i" > cd test-"$i" > hg verify > cd .. > done ---- hg clone -r 0 test test-0 adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets f9ee2f85a263 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 1 changesets, 1 total revisions ---- hg clone -r 1 test test-1 adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files new changesets f9ee2f85a263:34c2bf6b0626 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 2 changesets, 2 total revisions ---- hg clone -r 2 test test-2 adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 1 files new changesets f9ee2f85a263:e38ba6f5b7e0 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 3 changesets, 3 total revisions ---- hg clone -r 3 test test-3 adding changesets adding manifests adding file changes added 4 changesets with 4 changes to 1 files new changesets f9ee2f85a263:eebf5a27f8ca updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 4 changesets, 4 total revisions ---- hg clone -r 4 test test-4 adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files new changesets f9ee2f85a263:095197eb4973 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 2 changesets, 2 total revisions ---- hg clone -r 5 test test-5 adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 1 files new changesets f9ee2f85a263:1bb50a9436a7 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 3 changesets, 3 total revisions ---- hg clone -r 6 test test-6 adding changesets adding manifests adding file changes added 4 changesets with 5 changes to 2 files new changesets f9ee2f85a263:7373c1169842 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 4 changesets, 5 total revisions ---- hg clone -r 7 test test-7 adding changesets adding manifests adding file changes added 5 changesets with 6 changes to 3 files new changesets f9ee2f85a263:a6a34bfa0076 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 3 files, 5 changesets, 6 total revisions ---- hg clone -r 8 test test-8 adding changesets adding manifests adding file changes added 5 changesets with 5 changes to 2 files new changesets f9ee2f85a263:aa35859c02ea updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved checking changesets checking manifests crosschecking files in changesets and manifests checking files 2 files, 5 changesets, 5 total revisions $ cd test-8 $ hg pull ../test-7 pulling from ../test-7 searching for changes adding changesets adding manifests adding file changes added 4 changesets with 2 changes to 3 files (+1 heads) new changesets 095197eb4973:a6a34bfa0076 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 4 files, 9 changesets, 7 total revisions $ cd .. $ hg clone test test-9 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd test-9 $ hg branch foobar marked working directory as branch foobar (branches are permanent and global, did you want a bookmark?) $ echo file2 >> file2 $ hg add file2 $ hg commit -m "changeset9" $ echo file3 >> file3 $ hg add file3 $ hg commit -m "changeset10" $ cd .. $ hg clone -r 9 -u foobar test-9 test-10 adding changesets adding manifests adding file changes added 6 changesets with 6 changes to 3 files new changesets f9ee2f85a263:7100abb79635 updating to branch foobar 2 files updated, 0 files merged, 0 files removed, 0 files unresolved mercurial-4.5.3/tests/test-mq-subrepo.t0000644015407300116100000003651413261161234020004 0ustar augieeng00000000000000 $ cat <> $HGRCPATH > [ui] > commitsubrepos = Yes > [extensions] > mq = > record = > [diff] > nodates = 1 > EOF $ stdin=`pwd`/stdin.tmp fn to create new repository w/dirty subrepo, and cd into it $ mkrepo() { > hg init $1 > cd $1 > hg qinit > } fn to create dirty subrepo $ mksubrepo() { > hg init $1 > cd $1 > echo a > a > hg add > cd .. > } $ testadd() { > cat - > "$stdin" > mksubrepo sub > echo sub = sub >> .hgsub > hg add .hgsub > echo % abort when adding .hgsub w/dirty subrepo > hg status -S > echo '%' $* > cat "$stdin" | hg $* > echo [$?] > hg -R sub ci -m0sub > echo % update substate when adding .hgsub w/clean updated subrepo > hg status -S > echo '%' $* > cat "$stdin" | hg $* > hg debugsub > } $ testmod() { > cat - > "$stdin" > mksubrepo sub2 > echo sub2 = sub2 >> .hgsub > echo % abort when modifying .hgsub w/dirty subrepo > hg status -S > echo '%' $* > cat "$stdin" | hg $* > echo [$?] > hg -R sub2 ci -m0sub2 > echo % update substate when modifying .hgsub w/clean updated subrepo > hg status -S > echo '%' $* > cat "$stdin" | hg $* > hg debugsub > } $ testrm1() { > cat - > "$stdin" > mksubrepo sub3 > echo sub3 = sub3 >> .hgsub > hg ci -Aqmsub3 > $EXTRA > echo b >> sub3/a > hg rm .hgsub > echo % update substate when removing .hgsub w/dirty subrepo > hg status -S > echo '%' $* > cat "$stdin" | hg $* > echo % debugsub should be empty > hg debugsub > } $ testrm2() { > cat - > "$stdin" > mksubrepo sub4 > echo sub4 = sub4 >> .hgsub > hg ci -Aqmsub4 > $EXTRA > hg rm .hgsub > echo % update substate when removing .hgsub w/clean updated subrepo > hg status -S > echo '%' $* > cat "$stdin" | hg $* > echo % debugsub should be empty > hg debugsub > } handle subrepos safely on qnew $ mkrepo repo-2499-qnew $ testadd qnew -X path:no-effect -m0 0.diff adding a % abort when adding .hgsub w/dirty subrepo A .hgsub A sub/a % qnew -X path:no-effect -m0 0.diff abort: uncommitted changes in subrepository "sub" [255] % update substate when adding .hgsub w/clean updated subrepo A .hgsub A sub/a % qnew -X path:no-effect -m0 0.diff path sub source sub revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31 $ testmod qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff adding a % abort when modifying .hgsub w/dirty subrepo M .hgsub A sub2/a % qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff abort: uncommitted changes in subrepository "sub2" [255] % update substate when modifying .hgsub w/clean updated subrepo M .hgsub A sub2/a % qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff path sub source sub revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31 path sub2 source sub2 revision 1f94c7611cc6b74f5a17b16121a1170d44776845 $ hg qpop -qa patch queue now empty $ testrm1 qnew -m2 2.diff adding a % update substate when removing .hgsub w/dirty subrepo M sub3/a R .hgsub % qnew -m2 2.diff % debugsub should be empty $ hg qpop -qa patch queue now empty $ testrm2 qnew -m3 3.diff adding a % update substate when removing .hgsub w/clean updated subrepo R .hgsub % qnew -m3 3.diff % debugsub should be empty $ cd .. handle subrepos safely on qrefresh $ mkrepo repo-2499-qrefresh $ hg qnew -m0 0.diff $ testadd qrefresh adding a % abort when adding .hgsub w/dirty subrepo A .hgsub A sub/a % qrefresh abort: uncommitted changes in subrepository "sub" [255] % update substate when adding .hgsub w/clean updated subrepo A .hgsub A sub/a % qrefresh path sub source sub revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31 $ hg qnew -m1 1.diff $ testmod qrefresh adding a % abort when modifying .hgsub w/dirty subrepo M .hgsub A sub2/a % qrefresh abort: uncommitted changes in subrepository "sub2" [255] % update substate when modifying .hgsub w/clean updated subrepo M .hgsub A sub2/a % qrefresh path sub source sub revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31 path sub2 source sub2 revision 1f94c7611cc6b74f5a17b16121a1170d44776845 $ hg qpop -qa patch queue now empty $ EXTRA='hg qnew -m2 2.diff' $ testrm1 qrefresh adding a % update substate when removing .hgsub w/dirty subrepo M sub3/a R .hgsub % qrefresh % debugsub should be empty $ hg qpop -qa patch queue now empty $ EXTRA='hg qnew -m3 3.diff' $ testrm2 qrefresh adding a % update substate when removing .hgsub w/clean updated subrepo R .hgsub % qrefresh % debugsub should be empty $ EXTRA= $ cd .. handle subrepos safely on qpush/qpop (and we cannot qpop / qpush with a modified subrepo) $ mkrepo repo-2499-qpush $ mksubrepo sub adding a $ hg -R sub ci -m0sub $ echo sub = sub > .hgsub $ hg add .hgsub $ hg commit -m0 $ hg debugsub path sub source sub revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31 $ echo foo > ./sub/a $ hg -R sub commit -m foo $ hg commit -m1 $ hg qimport -r "0:tip" $ hg -R sub id --id aa037b301eba qpop $ hg -R sub update 0000 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg qpop abort: local changed subrepos found, qrefresh first [255] $ hg revert sub reverting subrepo sub adding sub/a $ hg qpop popping 1 now at: 0 $ hg status -AS C .hgsub C .hgsubstate C sub/a $ hg -R sub id --id b2fdb12cd82b qpush $ hg -R sub update 0000 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg qpush abort: local changed subrepos found, qrefresh first [255] $ hg revert sub reverting subrepo sub adding sub/a $ hg qpush applying 1 subrepository sub diverged (local revision: b2fdb12cd82b, remote revision: aa037b301eba) (M)erge, keep (l)ocal or keep (r)emote? m 1 files updated, 0 files merged, 0 files removed, 0 files unresolved now at: 1 $ hg status -AS C .hgsub C .hgsubstate C sub/a $ hg -R sub id --id aa037b301eba $ cd .. handle subrepos safely on qrecord $ mkrepo repo-2499-qrecord $ testadd qrecord --config ui.interactive=1 -m0 0.diff < y > y > EOF adding a % abort when adding .hgsub w/dirty subrepo A .hgsub A sub/a % qrecord --config ui.interactive=1 -m0 0.diff diff --git a/.hgsub b/.hgsub new file mode 100644 examine changes to '.hgsub'? [Ynesfdaq?] y @@ -0,0 +1,1 @@ +sub = sub record this change to '.hgsub'? [Ynesfdaq?] y warning: subrepo spec file '.hgsub' not found warning: subrepo spec file '.hgsub' not found abort: uncommitted changes in subrepository "sub" [255] % update substate when adding .hgsub w/clean updated subrepo A .hgsub A sub/a % qrecord --config ui.interactive=1 -m0 0.diff diff --git a/.hgsub b/.hgsub new file mode 100644 examine changes to '.hgsub'? [Ynesfdaq?] y @@ -0,0 +1,1 @@ +sub = sub record this change to '.hgsub'? [Ynesfdaq?] y warning: subrepo spec file '.hgsub' not found warning: subrepo spec file '.hgsub' not found path sub source sub revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31 $ testmod qrecord --config ui.interactive=1 -m1 1.diff < y > y > EOF adding a % abort when modifying .hgsub w/dirty subrepo M .hgsub A sub2/a % qrecord --config ui.interactive=1 -m1 1.diff diff --git a/.hgsub b/.hgsub 1 hunks, 1 lines changed examine changes to '.hgsub'? [Ynesfdaq?] y @@ -1,1 +1,2 @@ sub = sub +sub2 = sub2 record this change to '.hgsub'? [Ynesfdaq?] y abort: uncommitted changes in subrepository "sub2" [255] % update substate when modifying .hgsub w/clean updated subrepo M .hgsub A sub2/a % qrecord --config ui.interactive=1 -m1 1.diff diff --git a/.hgsub b/.hgsub 1 hunks, 1 lines changed examine changes to '.hgsub'? [Ynesfdaq?] y @@ -1,1 +1,2 @@ sub = sub +sub2 = sub2 record this change to '.hgsub'? [Ynesfdaq?] y path sub source sub revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31 path sub2 source sub2 revision 1f94c7611cc6b74f5a17b16121a1170d44776845 $ hg qpop -qa patch queue now empty $ testrm1 qrecord --config ui.interactive=1 -m2 2.diff < y > y > EOF adding a % update substate when removing .hgsub w/dirty subrepo M sub3/a R .hgsub % qrecord --config ui.interactive=1 -m2 2.diff diff --git a/.hgsub b/.hgsub deleted file mode 100644 examine changes to '.hgsub'? [Ynesfdaq?] y % debugsub should be empty $ hg qpop -qa patch queue now empty $ testrm2 qrecord --config ui.interactive=1 -m3 3.diff < y > y > EOF adding a % update substate when removing .hgsub w/clean updated subrepo R .hgsub % qrecord --config ui.interactive=1 -m3 3.diff diff --git a/.hgsub b/.hgsub deleted file mode 100644 examine changes to '.hgsub'? [Ynesfdaq?] y % debugsub should be empty $ cd .. correctly handle subrepos with patch queues $ mkrepo repo-subrepo-with-queue $ mksubrepo sub adding a $ hg -R sub qnew sub0.diff $ echo sub = sub >> .hgsub $ hg add .hgsub $ hg qnew 0.diff $ cd .. check whether MQ operations can import updated .hgsubstate correctly both into 'revision' and 'patch file under .hg/patches': $ hg init importing-hgsubstate $ cd importing-hgsubstate $ echo a > a $ hg commit -u test -d '0 0' -Am '#0 in parent' adding a $ hg init sub $ echo sa > sub/sa $ hg -R sub commit -u test -d '0 0' -Am '#0 in sub' adding sa $ echo 'sub = sub' > .hgsub $ touch .hgsubstate $ hg add .hgsub .hgsubstate $ hg qnew -u test -d '0 0' import-at-qnew $ hg -R sub parents --template '{node} sub\n' b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub $ cat .hgsubstate b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub $ hg diff -c tip diff -r f499373e340c -r f69e96d86e75 .hgsub --- /dev/null +++ b/.hgsub @@ -0,0 +1,1 @@ +sub = sub diff -r f499373e340c -r f69e96d86e75 .hgsubstate --- /dev/null +++ b/.hgsubstate @@ -0,0 +1,1 @@ +b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub $ cat .hg/patches/import-at-qnew # HG changeset patch # User test # Date 0 0 # Parent f499373e340cdca5d01dee904aeb42dd2a325e71 diff -r f499373e340c -r f69e96d86e75 .hgsub --- /dev/null +++ b/.hgsub @@ -0,0 +1,1 @@ +sub = sub diff -r f499373e340c -r f69e96d86e75 .hgsubstate --- /dev/null +++ b/.hgsubstate @@ -0,0 +1,1 @@ +b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub $ hg parents --template '{node}\n' f69e96d86e75a6d4fd88285dc9697acb23951041 $ hg parents --template '{files}\n' .hgsub .hgsubstate check also whether qnew not including ".hgsubstate" explicitly causes as same result (in node hash) as one including it. $ hg qpop -a -q patch queue now empty $ hg qdelete import-at-qnew $ echo 'sub = sub' > .hgsub $ hg add .hgsub $ rm -f .hgsubstate $ hg qnew -u test -d '0 0' import-at-qnew $ hg parents --template '{node}\n' f69e96d86e75a6d4fd88285dc9697acb23951041 $ hg parents --template '{files}\n' .hgsub .hgsubstate check whether qrefresh imports updated .hgsubstate correctly $ hg qpop popping import-at-qnew patch queue now empty $ hg qpush applying import-at-qnew now at: import-at-qnew $ hg parents --template '{files}\n' .hgsub .hgsubstate $ hg qnew import-at-qrefresh $ echo sb > sub/sb $ hg -R sub commit -u test -d '0 0' -Am '#1 in sub' adding sb $ hg qrefresh -u test -d '0 0' $ hg -R sub parents --template '{node} sub\n' 88ac1bef5ed43b689d1d200b59886b675dec474b sub $ cat .hgsubstate 88ac1bef5ed43b689d1d200b59886b675dec474b sub $ hg diff -c tip diff -r 05b056bb9c8c -r d987bec230f4 .hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,1 +1,1 @@ -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub +88ac1bef5ed43b689d1d200b59886b675dec474b sub $ cat .hg/patches/import-at-qrefresh # HG changeset patch # User test # Date 0 0 # Parent 05b056bb9c8c05ff15258b84fd42ab3527271033 diff -r 05b056bb9c8c .hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,1 +1,1 @@ -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub +88ac1bef5ed43b689d1d200b59886b675dec474b sub $ hg parents --template '{files}\n' .hgsubstate $ hg qrefresh -u test -d '0 0' $ cat .hgsubstate 88ac1bef5ed43b689d1d200b59886b675dec474b sub $ hg diff -c tip diff -r 05b056bb9c8c -r d987bec230f4 .hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,1 +1,1 @@ -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub +88ac1bef5ed43b689d1d200b59886b675dec474b sub $ cat .hg/patches/import-at-qrefresh # HG changeset patch # User test # Date 0 0 # Parent 05b056bb9c8c05ff15258b84fd42ab3527271033 diff -r 05b056bb9c8c .hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,1 +1,1 @@ -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub +88ac1bef5ed43b689d1d200b59886b675dec474b sub $ hg parents --template '{files}\n' .hgsubstate $ hg update -C tip 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg qpop -a popping import-at-qrefresh popping import-at-qnew patch queue now empty $ hg -R sub update -C 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo 'sub = sub' > .hgsub $ hg commit -Am '#1 in parent' adding .hgsub $ hg -R sub update -C 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg commit -Am '#2 in parent (but will be rolled back soon)' $ hg rollback repository tip rolled back to revision 1 (undo commit) working directory now based on revision 1 $ hg status M .hgsubstate $ hg qnew -u test -d '0 0' checkstate-at-qnew $ hg -R sub parents --template '{node} sub\n' 88ac1bef5ed43b689d1d200b59886b675dec474b sub $ cat .hgsubstate 88ac1bef5ed43b689d1d200b59886b675dec474b sub $ hg diff -c tip diff -r 4d91eb2fa1d1 -r 1259c112d884 .hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,1 +1,1 @@ -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub +88ac1bef5ed43b689d1d200b59886b675dec474b sub $ cat .hg/patches/checkstate-at-qnew # HG changeset patch # User test # Date 0 0 # Parent 4d91eb2fa1d1b22ec513347b9cd06f6b49d470fa diff -r 4d91eb2fa1d1 -r 1259c112d884 .hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,1 +1,1 @@ -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub +88ac1bef5ed43b689d1d200b59886b675dec474b sub $ hg parents --template '{files}\n' .hgsubstate check whether qrefresh not including ".hgsubstate" explicitly causes as same result (in node hash) as one including it. $ hg update -C -q 0 $ hg qpop -a -q patch queue now empty $ hg qnew -u test -d '0 0' add-hgsub-at-qrefresh $ echo 'sub = sub' > .hgsub $ echo > .hgsubstate $ hg add .hgsub .hgsubstate $ hg qrefresh -u test -d '0 0' $ hg parents --template '{node}\n' 7c48c35501aae6770ed9c2517014628615821a8e $ hg parents --template '{files}\n' .hgsub .hgsubstate $ hg qpop -a -q patch queue now empty $ hg qdelete add-hgsub-at-qrefresh $ hg qnew -u test -d '0 0' add-hgsub-at-qrefresh $ echo 'sub = sub' > .hgsub $ hg add .hgsub $ rm -f .hgsubstate $ hg qrefresh -u test -d '0 0' $ hg parents --template '{node}\n' 7c48c35501aae6770ed9c2517014628615821a8e $ hg parents --template '{files}\n' .hgsub .hgsubstate $ cd .. $ cd .. mercurial-4.5.3/tests/test-exchange-obsmarkers-case-B7.t0000644015407300116100000000502113261161234023006 0ustar augieeng00000000000000============================================ Testing obsolescence markers push: Cases B.7 ============================================ Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of all changesets that requested to be "in sync" after the push (even if they are already on both side). This test belongs to a series of tests checking such set is properly computed and applied. This does not tests "obsmarkers" discovery capabilities. Category B: pruning case TestCase 7: Prune on non-targeted common changeset B.7 Prune above non-targeted common changeset ============================================= .. (very similar to B1, but the prune changeset is unknown on remote) .. .. {{{ .. ⊗ B .. | .. ◕ A .. | .. ◠O .. }}} .. .. Marker exist from: .. .. * B (prune) .. .. Command runs: .. .. * hg push -r O .. .. Expected exclude: .. .. * B (prune) Setup ----- $ . $TESTDIR/testlib/exchange-obsmarker-util.sh Initial $ setuprepos B.7 creating test repo for test case B.7 - pulldest - main - pushdest cd into `main` and proceed with env setup $ cd main $ mkcommit A $ hg push -q ../pushdest $ hg push -q ../pulldest $ mkcommit B $ hg prune -qd '0 0' . $ hg log -G --hidden x f6fbb35d8ac9 (draft): B | @ f5bc6836db60 (draft): A | o a9bdc8b26820 (public): O $ inspect_obsmarkers obsstore content ================ f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ cd .. $ cd .. Actual Test ------------------------------------- $ dotest B.7 O ## Running testcase B.7 # testing echange of "O" (a9bdc8b26820) ## initial state # obstore: main f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest ## pushing "O" from main to pushdest pushing to pushdest searching for changes no changes found ## post push state # obstore: main f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest ## pulling "a9bdc8b26820" from main into pulldest pulling from main no changes found ## post pull state # obstore: main f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest mercurial-4.5.3/tests/test-parseindex.t0000644015407300116100000001273113261161234020047 0ustar augieeng00000000000000revlog.parseindex must be able to parse the index file even if an index entry is split between two 64k blocks. The ideal test would be to create an index file with inline data where 64k < size < 64k + 64 (64k is the size of the read buffer, 64 is the size of an index entry) and with an index entry starting right before the 64k block boundary, and try to read it. We approximate that by reducing the read buffer to 1 byte. $ hg init a $ cd a $ echo abc > foo $ hg add foo $ hg commit -m 'add foo' $ echo >> foo $ hg commit -m 'change foo' $ hg log -r 0: changeset: 0:7c31755bf9b5 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add foo changeset: 1:26333235a41c tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: change foo $ cat >> test.py << EOF > from mercurial import changelog, vfs > from mercurial.node import * > > class singlebyteread(object): > def __init__(self, real): > self.real = real > > def read(self, size=-1): > if size == 65536: > size = 1 > return self.real.read(size) > > def __getattr__(self, key): > return getattr(self.real, key) > > def opener(*args): > o = vfs.vfs(*args) > def wrapper(*a): > f = o(*a) > return singlebyteread(f) > return wrapper > > cl = changelog.changelog(opener('.hg/store')) > print len(cl), 'revisions:' > for r in cl: > print short(cl.node(r)) > EOF $ $PYTHON test.py 2 revisions: 7c31755bf9b5 26333235a41c $ cd .. #if no-pure Test SEGV caused by bad revision passed to reachableroots() (issue4775): $ cd a $ $PYTHON < from mercurial import changelog, vfs > cl = changelog.changelog(vfs.vfs('.hg/store')) > print 'good heads:' > for head in [0, len(cl) - 1, -1]: > print'%s: %r' % (head, cl.reachableroots(0, [head], [0])) > print 'bad heads:' > for head in [len(cl), 10000, -2, -10000, None]: > print '%s:' % head, > try: > cl.reachableroots(0, [head], [0]) > print 'uncaught buffer overflow?' > except (IndexError, TypeError) as inst: > print inst > print 'good roots:' > for root in [0, len(cl) - 1, -1]: > print '%s: %r' % (root, cl.reachableroots(root, [len(cl) - 1], [root])) > print 'out-of-range roots are ignored:' > for root in [len(cl), 10000, -2, -10000]: > print '%s: %r' % (root, cl.reachableroots(root, [len(cl) - 1], [root])) > print 'bad roots:' > for root in [None]: > print '%s:' % root, > try: > cl.reachableroots(root, [len(cl) - 1], [root]) > print 'uncaught error?' > except TypeError as inst: > print inst > EOF good heads: 0: [0] 1: [0] -1: [] bad heads: 2: head out of range 10000: head out of range -2: head out of range -10000: head out of range None: an integer is required good roots: 0: [0] 1: [1] -1: [-1] out-of-range roots are ignored: 2: [] 10000: [] -2: [] -10000: [] bad roots: None: an integer is required $ cd .. Test corrupted p1/p2 fields that could cause SEGV at parsers.c: $ mkdir invalidparent $ cd invalidparent $ hg clone --pull -q --config phases.publish=False ../a limit $ hg clone --pull -q --config phases.publish=False ../a segv $ rm -R limit/.hg/cache segv/.hg/cache $ $PYTHON < data = open("limit/.hg/store/00changelog.i", "rb").read() > for n, p in [('limit', '\0\0\0\x02'), ('segv', '\0\x01\0\0')]: > # corrupt p1 at rev0 and p2 at rev1 > d = data[:24] + p + data[28:127 + 28] + p + data[127 + 32:] > open(n + "/.hg/store/00changelog.i", "wb").write(d) > EOF $ hg debugindex -f1 limit/.hg/store/00changelog.i rev flag offset length size base link p1 p2 nodeid 0 0000 0 63 62 0 0 2 -1 7c31755bf9b5 1 0000 63 66 65 1 1 0 2 26333235a41c $ hg debugindex -f1 segv/.hg/store/00changelog.i rev flag offset length size base link p1 p2 nodeid 0 0000 0 63 62 0 0 65536 -1 7c31755bf9b5 1 0000 63 66 65 1 1 0 65536 26333235a41c $ cat < test.py > import sys > from mercurial import changelog, vfs > cl = changelog.changelog(vfs.vfs(sys.argv[1])) > n0, n1 = cl.node(0), cl.node(1) > ops = [ > ('reachableroots', > lambda: cl.index.reachableroots2(0, [1], [0], False)), > ('compute_phases_map_sets', lambda: cl.computephases([[0], []])), > ('index_headrevs', lambda: cl.headrevs()), > ('find_gca_candidates', lambda: cl.commonancestorsheads(n0, n1)), > ('find_deepest', lambda: cl.ancestor(n0, n1)), > ] > for l, f in ops: > print l + ':', > try: > f() > print 'uncaught buffer overflow?' > except ValueError, inst: > print inst > EOF $ $PYTHON test.py limit/.hg/store reachableroots: parent out of range compute_phases_map_sets: parent out of range index_headrevs: parent out of range find_gca_candidates: parent out of range find_deepest: parent out of range $ $PYTHON test.py segv/.hg/store reachableroots: parent out of range compute_phases_map_sets: parent out of range index_headrevs: parent out of range find_gca_candidates: parent out of range find_deepest: parent out of range $ cd .. #endif mercurial-4.5.3/tests/test-hgweb-diffs.t0000644015407300116100000010047413261161234020074 0ustar augieeng00000000000000#require serve setting up repo $ hg init test $ cd test $ echo a > a $ echo b > b $ hg ci -Ama adding a adding b change permissions for git diffs $ hg import -q --bypass - < # HG changeset patch > # User test > # Date 0 0 > b > > diff --git a/a b/a > old mode 100644 > new mode 100755 > diff --git a/b b/b > deleted file mode 100644 > --- a/b > +++ /dev/null > @@ -1,1 +0,0 @@ > -b > EOF set up hgweb $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS revision $ get-with-headers.py localhost:$HGPORT 'rev/0' 200 Script output follows test: 0cd96de13884

    changeset 0:0cd96de13884 draft

    a
    author test
    date Thu, 01 Jan 1970 00:00:00 +0000
    parents
    children 559edbd9ed20
    files a b
    diffstat 2 files changed, 2 insertions(+), 0 deletions(-) [+]
    line wrap: on
    line diff
      --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
      +++ b/a	Thu Jan 01 00:00:00 1970 +0000
      @@ -0,0 +1,1 @@
      +a
      --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
      +++ b/b	Thu Jan 01 00:00:00 1970 +0000
      @@ -0,0 +1,1 @@
      +b
    raw revision $ get-with-headers.py localhost:$HGPORT 'raw-rev/0' 200 Script output follows # HG changeset patch # User test # Date 0 0 # Node ID 0cd96de13884b090099512d4794ae87ad067ea8e a diff -r 000000000000 -r 0cd96de13884 a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +a diff -r 000000000000 -r 0cd96de13884 b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/b Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +b diff removed file $ hg log --template "{file_mods}\n{file_dels}\n" -r tip a b $ hg parents --template "{node|short}\n" -r tip 0cd96de13884 $ hg parents --template "{node|short}\n" -r tip b 0cd96de13884 $ get-with-headers.py localhost:$HGPORT 'diff/tip/b' 200 Script output follows test: b diff

    diff b @ 1:559edbd9ed20 draft default tip

    b
    author test
    date Thu, 01 Jan 1970 00:00:00 +0000
    parents 0cd96de13884
    children
    line wrap: on
    line diff
      --- a/b	Thu Jan 01 00:00:00 1970 +0000
      +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
      @@ -1,1 +0,0 @@
      -b
    set up hgweb with git diffs + noprefix $ killdaemons.py $ hg serve --config 'diff.git=1' --config 'diff.noprefix=1' -p $HGPORT -d \ > --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS patch header and diffstat $ get-with-headers.py localhost:$HGPORT 'rev/0' \ > | egrep 'files changed|---|\+\+\+' 2 files changed, 2 insertions(+), 0 deletions(-) --- /dev/null +++ a --- /dev/null +++ b set up hgweb with git diffs $ killdaemons.py $ hg serve --config 'diff.git=1' -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS revision $ get-with-headers.py localhost:$HGPORT 'rev/0' 200 Script output follows test: 0cd96de13884

    changeset 0:0cd96de13884 draft

    a
    author test
    date Thu, 01 Jan 1970 00:00:00 +0000
    parents
    children 559edbd9ed20
    files a b
    diffstat 2 files changed, 2 insertions(+), 0 deletions(-) [+]
    line wrap: on
    line diff
      new file mode 100644
      --- /dev/null
      +++ b/a
      @@ -0,0 +1,1 @@
      +a
      new file mode 100644
      --- /dev/null
      +++ b/b
      @@ -0,0 +1,1 @@
      +b
    revision $ get-with-headers.py localhost:$HGPORT 'raw-rev/0' 200 Script output follows # HG changeset patch # User test # Date 0 0 # Node ID 0cd96de13884b090099512d4794ae87ad067ea8e a diff --git a/a b/a new file mode 100644 --- /dev/null +++ b/a @@ -0,0 +1,1 @@ +a diff --git a/b b/b new file mode 100644 --- /dev/null +++ b/b @@ -0,0 +1,1 @@ +b diff modified file $ hg log --template "{file_mods}\n{file_dels}\n" -r tip a b $ hg parents --template "{node|short}\n" -r tip 0cd96de13884 $ hg parents --template "{node|short}\n" -r tip a 0cd96de13884 $ get-with-headers.py localhost:$HGPORT 'diff/tip/a' 200 Script output follows test: a diff

    diff a @ 1:559edbd9ed20 draft default tip

    b
    author test
    date Thu, 01 Jan 1970 00:00:00 +0000
    parents 0cd96de13884
    children
    line wrap: on
    line diff
      old mode 100644
      new mode 100755
    comparison new file $ hg parents --template "{rev}:{node|short}\n" -r 0 $ hg log --template "{rev}:{node|short}\n" -r 0 0:0cd96de13884 $ get-with-headers.py localhost:$HGPORT 'comparison/0/a' 200 Script output follows test: a comparison

    comparison a @ 0:0cd96de13884 draft

    a
    author test
    date Thu, 01 Jan 1970 00:00:00 +0000
    parents
    children
    comparison
    equal deleted inserted replaced
    -1:000000000000 0:0cd96de13884
    1 a
    comparison existing file $ hg up 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo a >> a $ hg ci -mc $ hg parents --template "{rev}:{node|short}\n" -r tip 1:559edbd9ed20 $ hg log --template "{rev}:{node|short}\n" -r tip 2:d73db4d812ff $ get-with-headers.py localhost:$HGPORT 'comparison/tip/a' 200 Script output follows test: a comparison

    comparison a @ 2:d73db4d812ff draft default tip

    c
    author test
    date Thu, 01 Jan 1970 00:00:00 +0000
    parents 0cd96de13884
    children
    comparison
    equal deleted inserted replaced
    1:559edbd9ed20 2:d73db4d812ff
    1 a 1 a
    2 a
    comparison removed file $ hg rm a $ hg ci -md $ hg parents --template "{rev}:{node|short}\n" -r tip 2:d73db4d812ff $ hg log --template "{rev}:{node|short}\n" -r tip 3:20e80271eb7a $ get-with-headers.py localhost:$HGPORT 'comparison/tip/a' 200 Script output follows test: a comparison

    comparison a @ 3:20e80271eb7a draft default tip

    d
    author test
    date Thu, 01 Jan 1970 00:00:00 +0000
    parents d73db4d812ff
    children
    comparison
    equal deleted inserted replaced
    2:d73db4d812ff 3:20e80271eb7a
    1 a
    2 a
    comparison not-modified file $ echo e > e $ hg add e $ hg ci -m e $ echo f > f $ hg add f $ hg ci -m f $ hg tip --template "{rev}:{node|short}\n" 5:41d9fc4a6ae1 $ hg diff -c tip e $ hg parents --template "{rev}:{node|short}\n" -r tip 4:402bea3b0976 $ hg parents --template "{rev}:{node|short}\n" -r tip e 4:402bea3b0976 $ get-with-headers.py localhost:$HGPORT 'comparison/tip/e' 200 Script output follows test: e comparison

    comparison e @ 5:41d9fc4a6ae1 draft default tip

    f
    author test
    date Thu, 01 Jan 1970 00:00:00 +0000
    parents 402bea3b0976
    children
    comparison
    equal deleted inserted replaced
    4:402bea3b0976 5:41d9fc4a6ae1
    $ cd .. test import rev as raw-rev $ hg clone -r0 test test1 adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files new changesets 0cd96de13884 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd test1 $ hg import -q --bypass --exact http://localhost:$HGPORT/rev/1 raw revision with diff block numbers $ killdaemons.py $ cat < .hg/hgrc > [web] > templates = rawdiff > EOF $ mkdir rawdiff $ cat < rawdiff/map > mimetype = 'text/plain; charset={encoding}' > changeset = '{diff}' > difflineplus = '{line}' > difflineminus = '{line}' > difflineat = '{line}' > diffline = '{line}' > filenodelink = '' > filenolink = '' > fileline = '{line}' > diffblock = 'Block: {blockno}\n{lines}\n' > EOF $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT 'raw-rev/0' 200 Script output follows Block: 1 diff -r 000000000000 -r 0cd96de13884 a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +a Block: 2 diff -r 000000000000 -r 0cd96de13884 b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/b Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +b $ killdaemons.py $ rm .hg/hgrc rawdiff/map $ rmdir rawdiff $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS errors $ cat ../test/errors.log $ cd .. mercurial-4.5.3/tests/test-convert-git.t0000644015407300116100000010706113261161234020147 0ustar augieeng00000000000000#require git $ echo "[core]" >> $HOME/.gitconfig $ echo "autocrlf = false" >> $HOME/.gitconfig $ echo "[core]" >> $HOME/.gitconfig $ echo "autocrlf = false" >> $HOME/.gitconfig $ echo "[extensions]" >> $HGRCPATH $ echo "convert=" >> $HGRCPATH $ cat >> $HGRCPATH < [subrepos] > git:allowed = true > EOF $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE $ INVALIDID1=afd12345af $ INVALIDID2=28173x36ddd1e67bf7098d541130558ef5534a86 $ VALIDID1=39b3d83f9a69a9ba4ebb111461071a0af0027357 $ VALIDID2=8dd6476bd09d9c7776355dc454dafe38efaec5da $ count=10 $ commit() > { > GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000" > GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" > git commit "$@" >/dev/null 2>/dev/null || echo "git commit error" > count=`expr $count + 1` > } $ mkdir git-repo $ cd git-repo $ git init-db >/dev/null 2>/dev/null $ echo a > a $ mkdir d $ echo b > d/b $ git add a d $ commit -a -m t1 Remove the directory, then try to replace it with a file (issue754) $ git rm -f d/b rm 'd/b' $ commit -m t2 $ echo d > d $ git add d $ commit -m t3 $ echo b >> a $ commit -a -m t4.1 $ git checkout -b other HEAD~ >/dev/null 2>/dev/null $ echo c > a $ echo a >> a $ commit -a -m t4.2 $ git checkout master >/dev/null 2>/dev/null $ git pull --no-commit . other > /dev/null 2>/dev/null $ commit -m 'Merge branch other' $ cd .. $ hg convert --config extensions.progress= --config progress.assume-tty=1 \ > --config progress.delay=0 --config progress.changedelay=0 \ > --config progress.refresh=0 --config progress.width=60 \ > --config progress.format='topic, bar, number' --datesort git-repo \r (no-eol) (esc) scanning [======> ] 1/6\r (no-eol) (esc) scanning [=============> ] 2/6\r (no-eol) (esc) scanning [=====================> ] 3/6\r (no-eol) (esc) scanning [============================> ] 4/6\r (no-eol) (esc) scanning [===================================> ] 5/6\r (no-eol) (esc) scanning [===========================================>] 6/6\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [ ] 0/6\r (no-eol) (esc) getting files [==================> ] 1/2\r (no-eol) (esc) getting files [======================================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [======> ] 1/6\r (no-eol) (esc) getting files [======================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [=============> ] 2/6\r (no-eol) (esc) getting files [======================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [====================> ] 3/6\r (no-eol) (esc) getting files [======================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [===========================> ] 4/6\r (no-eol) (esc) getting files [======================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [==================================> ] 5/6\r (no-eol) (esc) getting files [======================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) assuming destination git-repo-hg initializing destination git-repo-hg repository scanning source... sorting... converting... 5 t1 4 t2 3 t3 2 t4.1 1 t4.2 0 Merge branch other updating bookmarks $ hg up -q -R git-repo-hg $ hg -R git-repo-hg tip -v changeset: 5:c78094926be2 bookmark: master tag: tip parent: 3:f5f5cb45432b parent: 4:4e174f80c67c user: test date: Mon Jan 01 00:00:15 2007 +0000 files: a description: Merge branch other $ count=10 $ mkdir git-repo2 $ cd git-repo2 $ git init-db >/dev/null 2>/dev/null $ echo foo > foo $ git add foo $ commit -a -m 'add foo' $ echo >> foo $ commit -a -m 'change foo' $ git checkout -b Bar HEAD~ >/dev/null 2>/dev/null $ echo quux >> quux $ git add quux $ commit -a -m 'add quux' $ echo bar > bar $ git add bar $ commit -a -m 'add bar' $ git checkout -b Baz HEAD~ >/dev/null 2>/dev/null $ echo baz > baz $ git add baz $ commit -a -m 'add baz' $ git checkout master >/dev/null 2>/dev/null $ git pull --no-commit . Bar Baz > /dev/null 2>/dev/null $ commit -m 'Octopus merge' $ echo bar >> bar $ commit -a -m 'change bar' $ git checkout -b Foo HEAD~ >/dev/null 2>/dev/null $ echo >> foo $ commit -a -m 'change foo' $ git checkout master >/dev/null 2>/dev/null $ git pull --no-commit -s ours . Foo > /dev/null 2>/dev/null $ commit -m 'Discard change to foo' $ cd .. $ glog() > { > hg log -G --template '{rev} "{desc|firstline}" files: {files}\n' "$@" > } $ splitrepo() > { > msg="$1" > files="$2" > opts=$3 > echo "% $files: $msg" > prefix=`echo "$files" | sed -e 's/ /-/g'` > fmap="$prefix.fmap" > repo="$prefix.repo" > for i in $files; do > echo "include $i" >> "$fmap" > done > hg -q convert $opts --filemap "$fmap" --datesort git-repo2 "$repo" > hg up -q -R "$repo" > glog -R "$repo" > hg -R "$repo" manifest --debug > } full conversion $ hg convert --datesort git-repo2 fullrepo \ > --config extensions.progress= --config progress.assume-tty=1 \ > --config progress.delay=0 --config progress.changedelay=0 \ > --config progress.refresh=0 --config progress.width=60 \ > --config progress.format='topic, bar, number' \r (no-eol) (esc) scanning [===> ] 1/9\r (no-eol) (esc) scanning [========> ] 2/9\r (no-eol) (esc) scanning [=============> ] 3/9\r (no-eol) (esc) scanning [==================> ] 4/9\r (no-eol) (esc) scanning [=======================> ] 5/9\r (no-eol) (esc) scanning [============================> ] 6/9\r (no-eol) (esc) scanning [=================================> ] 7/9\r (no-eol) (esc) scanning [======================================> ] 8/9\r (no-eol) (esc) scanning [===========================================>] 9/9\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [ ] 0/9\r (no-eol) (esc) getting files [======================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [===> ] 1/9\r (no-eol) (esc) getting files [======================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [========> ] 2/9\r (no-eol) (esc) getting files [======================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [=============> ] 3/9\r (no-eol) (esc) getting files [======================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [=================> ] 4/9\r (no-eol) (esc) getting files [======================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [======================> ] 5/9\r (no-eol) (esc) getting files [===> ] 1/8\r (no-eol) (esc) getting files [========> ] 2/8\r (no-eol) (esc) getting files [=============> ] 3/8\r (no-eol) (esc) getting files [==================> ] 4/8\r (no-eol) (esc) getting files [=======================> ] 5/8\r (no-eol) (esc) getting files [============================> ] 6/8\r (no-eol) (esc) getting files [=================================> ] 7/8\r (no-eol) (esc) getting files [======================================>] 8/8\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [===========================> ] 6/9\r (no-eol) (esc) getting files [======================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [===============================> ] 7/9\r (no-eol) (esc) getting files [======================================>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) converting [====================================> ] 8/9\r (no-eol) (esc) getting files [==================> ] 1/2\r (no-eol) (esc) getting files [======================================>] 2/2\r (no-eol) (esc) \r (no-eol) (esc) initializing destination fullrepo repository scanning source... sorting... converting... 8 add foo 7 change foo 6 add quux 5 add bar 4 add baz 3 Octopus merge 2 change bar 1 change foo 0 Discard change to foo updating bookmarks $ hg up -q -R fullrepo $ glog -R fullrepo @ 9 "Discard change to foo" files: foo |\ | o 8 "change foo" files: foo | | o | 7 "change bar" files: bar |/ o 6 "(octopus merge fixup)" files: |\ | o 5 "Octopus merge" files: baz | |\ o | | 4 "add baz" files: baz | | | +---o 3 "add bar" files: bar | | o | 2 "add quux" files: quux | | | o 1 "change foo" files: foo |/ o 0 "add foo" files: foo $ hg -R fullrepo manifest --debug 245a3b8bc653999c2b22cdabd517ccb47aecafdf 644 bar 354ae8da6e890359ef49ade27b68bbc361f3ca88 644 baz 9277c9cc8dd4576fc01a17939b4351e5ada93466 644 foo 88dfeab657e8cf2cef3dec67b914f49791ae76b1 644 quux $ splitrepo 'octopus merge' 'foo bar baz' % foo bar baz: octopus merge @ 8 "Discard change to foo" files: foo |\ | o 7 "change foo" files: foo | | o | 6 "change bar" files: bar |/ o 5 "(octopus merge fixup)" files: |\ | o 4 "Octopus merge" files: baz | |\ o | | 3 "add baz" files: baz | | | +---o 2 "add bar" files: bar | | | o 1 "change foo" files: foo |/ o 0 "add foo" files: foo 245a3b8bc653999c2b22cdabd517ccb47aecafdf 644 bar 354ae8da6e890359ef49ade27b68bbc361f3ca88 644 baz 9277c9cc8dd4576fc01a17939b4351e5ada93466 644 foo $ splitrepo 'only some parents of an octopus merge; "discard" a head' 'foo baz quux' % foo baz quux: only some parents of an octopus merge; "discard" a head @ 6 "Discard change to foo" files: foo | o 5 "change foo" files: foo | o 4 "Octopus merge" files: |\ | o 3 "add baz" files: baz | | | o 2 "add quux" files: quux | | o | 1 "change foo" files: foo |/ o 0 "add foo" files: foo 354ae8da6e890359ef49ade27b68bbc361f3ca88 644 baz 9277c9cc8dd4576fc01a17939b4351e5ada93466 644 foo 88dfeab657e8cf2cef3dec67b914f49791ae76b1 644 quux test importing git renames and copies $ cd git-repo2 $ git mv foo foo-renamed since bar is not touched in this commit, this copy will not be detected $ cp bar bar-copied $ cp baz baz-copied $ cp baz baz-copied2 $ cp baz ba-copy $ echo baz2 >> baz $ git add bar-copied baz-copied baz-copied2 ba-copy $ commit -a -m 'rename and copy' $ cd .. input validation $ hg convert --config convert.git.similarity=foo --datesort git-repo2 fullrepo abort: convert.git.similarity is not a valid integer ('foo') [255] $ hg convert --config convert.git.similarity=-1 --datesort git-repo2 fullrepo abort: similarity must be between 0 and 100 [255] $ hg convert --config convert.git.similarity=101 --datesort git-repo2 fullrepo abort: similarity must be between 0 and 100 [255] $ hg -q convert --config convert.git.similarity=100 --datesort git-repo2 fullrepo $ hg -R fullrepo status -C --change master M baz A ba-copy baz A bar-copied A baz-copied baz A baz-copied2 baz A foo-renamed foo R foo Ensure that the modification to the copy source was preserved (there was a bug where if the copy dest was alphabetically prior to the copy source, the copy source took the contents of the copy dest) $ hg cat -r tip fullrepo/baz baz baz2 $ cd git-repo2 $ echo bar2 >> bar $ commit -a -m 'change bar' $ cp bar bar-copied2 $ git add bar-copied2 $ commit -a -m 'copy with no changes' $ cd .. $ hg -q convert --config convert.git.similarity=100 \ > --config convert.git.findcopiesharder=1 --datesort git-repo2 fullrepo $ hg -R fullrepo status -C --change master A bar-copied2 bar renamelimit config option works $ cd git-repo2 $ cat >> copy-source << EOF > sc0 > sc1 > sc2 > sc3 > sc4 > sc5 > sc6 > EOF $ git add copy-source $ commit -m 'add copy-source' $ cp copy-source source-copy0 $ echo 0 >> source-copy0 $ cp copy-source source-copy1 $ echo 1 >> source-copy1 $ git add source-copy0 source-copy1 $ commit -a -m 'copy copy-source 2 times' $ cd .. $ hg -q convert --config convert.git.renamelimit=1 \ > --config convert.git.findcopiesharder=true --datesort git-repo2 fullrepo2 $ hg -R fullrepo2 status -C --change master A source-copy0 A source-copy1 $ hg -q convert --config convert.git.renamelimit=100 \ > --config convert.git.findcopiesharder=true --datesort git-repo2 fullrepo3 $ hg -R fullrepo3 status -C --change master A source-copy0 copy-source A source-copy1 copy-source test binary conversion (issue1359) $ count=19 $ mkdir git-repo3 $ cd git-repo3 $ git init-db >/dev/null 2>/dev/null $ $PYTHON -c 'file("b", "wb").write("".join([chr(i) for i in range(256)])*16)' $ git add b $ commit -a -m addbinary $ cd .. convert binary file $ hg convert git-repo3 git-repo3-hg initializing destination git-repo3-hg repository scanning source... sorting... converting... 0 addbinary updating bookmarks $ cd git-repo3-hg $ hg up -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ $PYTHON -c 'print len(file("b", "rb").read())' 4096 $ cd .. test author vs committer $ mkdir git-repo4 $ cd git-repo4 $ git init-db >/dev/null 2>/dev/null $ echo >> foo $ git add foo $ commit -a -m addfoo $ echo >> foo $ GIT_AUTHOR_NAME="nottest" $ commit -a -m addfoo2 $ cd .. convert author committer $ hg convert git-repo4 git-repo4-hg initializing destination git-repo4-hg repository scanning source... sorting... converting... 1 addfoo 0 addfoo2 updating bookmarks $ hg -R git-repo4-hg log -v changeset: 1:d63e967f93da bookmark: master tag: tip user: nottest date: Mon Jan 01 00:00:21 2007 +0000 files: foo description: addfoo2 committer: test changeset: 0:0735477b0224 user: test date: Mon Jan 01 00:00:20 2007 +0000 files: foo description: addfoo Various combinations of committeractions fail $ hg --config convert.git.committeractions=messagedifferent,messagealways convert git-repo4 bad-committer initializing destination bad-committer repository abort: committeractions cannot define both messagedifferent and messagealways [255] $ hg --config convert.git.committeractions=dropcommitter,replaceauthor convert git-repo4 bad-committer initializing destination bad-committer repository abort: committeractions cannot define both dropcommitter and replaceauthor [255] $ hg --config convert.git.committeractions=dropcommitter,messagealways convert git-repo4 bad-committer initializing destination bad-committer repository abort: committeractions cannot define both dropcommitter and messagealways [255] custom prefix on messagedifferent works $ hg --config convert.git.committeractions=messagedifferent=different: convert git-repo4 git-repo4-hg-messagedifferentprefix initializing destination git-repo4-hg-messagedifferentprefix repository scanning source... sorting... converting... 1 addfoo 0 addfoo2 updating bookmarks $ hg -R git-repo4-hg-messagedifferentprefix log -v changeset: 1:2fe0c98a109d bookmark: master tag: tip user: nottest date: Mon Jan 01 00:00:21 2007 +0000 files: foo description: addfoo2 different: test changeset: 0:0735477b0224 user: test date: Mon Jan 01 00:00:20 2007 +0000 files: foo description: addfoo messagealways will always add the "committer: " line even if committer identical $ hg --config convert.git.committeractions=messagealways convert git-repo4 git-repo4-hg-messagealways initializing destination git-repo4-hg-messagealways repository scanning source... sorting... converting... 1 addfoo 0 addfoo2 updating bookmarks $ hg -R git-repo4-hg-messagealways log -v changeset: 1:8db057d8cd37 bookmark: master tag: tip user: nottest date: Mon Jan 01 00:00:21 2007 +0000 files: foo description: addfoo2 committer: test changeset: 0:8f71fe9c98be user: test date: Mon Jan 01 00:00:20 2007 +0000 files: foo description: addfoo committer: test custom prefix on messagealways works $ hg --config convert.git.committeractions=messagealways=always: convert git-repo4 git-repo4-hg-messagealwaysprefix initializing destination git-repo4-hg-messagealwaysprefix repository scanning source... sorting... converting... 1 addfoo 0 addfoo2 updating bookmarks $ hg -R git-repo4-hg-messagealwaysprefix log -v changeset: 1:83c17174de79 bookmark: master tag: tip user: nottest date: Mon Jan 01 00:00:21 2007 +0000 files: foo description: addfoo2 always: test changeset: 0:2ac9bcb3534a user: test date: Mon Jan 01 00:00:20 2007 +0000 files: foo description: addfoo always: test replaceauthor replaces author with committer $ hg --config convert.git.committeractions=replaceauthor convert git-repo4 git-repo4-hg-replaceauthor initializing destination git-repo4-hg-replaceauthor repository scanning source... sorting... converting... 1 addfoo 0 addfoo2 updating bookmarks $ hg -R git-repo4-hg-replaceauthor log -v changeset: 1:122c1d8999ea bookmark: master tag: tip user: test date: Mon Jan 01 00:00:21 2007 +0000 files: foo description: addfoo2 changeset: 0:0735477b0224 user: test date: Mon Jan 01 00:00:20 2007 +0000 files: foo description: addfoo dropcommitter removes the committer $ hg --config convert.git.committeractions=dropcommitter convert git-repo4 git-repo4-hg-dropcommitter initializing destination git-repo4-hg-dropcommitter repository scanning source... sorting... converting... 1 addfoo 0 addfoo2 updating bookmarks $ hg -R git-repo4-hg-dropcommitter log -v changeset: 1:190b2da396cc bookmark: master tag: tip user: nottest date: Mon Jan 01 00:00:21 2007 +0000 files: foo description: addfoo2 changeset: 0:0735477b0224 user: test date: Mon Jan 01 00:00:20 2007 +0000 files: foo description: addfoo --sourceorder should fail $ hg convert --sourcesort git-repo4 git-repo4-sourcesort-hg initializing destination git-repo4-sourcesort-hg repository abort: --sourcesort is not supported by this data source [255] test converting certain branches $ mkdir git-testrevs $ cd git-testrevs $ git init Initialized empty Git repository in $TESTTMP/git-testrevs/.git/ $ echo a >> a ; git add a > /dev/null; git commit -m 'first' > /dev/null $ echo a >> a ; git add a > /dev/null; git commit -m 'master commit' > /dev/null $ git checkout -b goodbranch 'HEAD^' Switched to a new branch 'goodbranch' $ echo a >> b ; git add b > /dev/null; git commit -m 'good branch commit' > /dev/null $ git checkout -b badbranch 'HEAD^' Switched to a new branch 'badbranch' $ echo a >> c ; git add c > /dev/null; git commit -m 'bad branch commit' > /dev/null $ cd .. $ hg convert git-testrevs hg-testrevs --rev master --rev goodbranch initializing destination hg-testrevs repository scanning source... sorting... converting... 2 first 1 good branch commit 0 master commit updating bookmarks $ cd hg-testrevs $ hg log -G -T '{rev} {bookmarks}' o 2 master | | o 1 goodbranch |/ o 0 $ cd .. test sub modules $ mkdir git-repo5 $ cd git-repo5 $ git init-db >/dev/null 2>/dev/null $ echo 'sub' >> foo $ git add foo $ commit -a -m 'addfoo' $ BASE=`pwd` $ cd .. $ mkdir git-repo6 $ cd git-repo6 $ git init-db >/dev/null 2>/dev/null $ git submodule add ${BASE} >/dev/null 2>/dev/null $ commit -a -m 'addsubmodule' >/dev/null 2>/dev/null test non-tab whitespace .gitmodules $ cat >> .gitmodules < [submodule "git-repo5"] > path = git-repo5 > url = git-repo5 > EOF $ git commit -q -a -m "weird white space submodule" $ cd .. $ hg convert git-repo6 hg-repo6 initializing destination hg-repo6 repository scanning source... sorting... converting... 1 addsubmodule 0 weird white space submodule updating bookmarks $ rm -rf hg-repo6 $ cd git-repo6 $ git reset --hard 'HEAD^' > /dev/null test missing .gitmodules $ git submodule add ../git-repo4 >/dev/null 2>/dev/null $ git checkout HEAD .gitmodules $ git rm .gitmodules rm '.gitmodules' $ git commit -q -m "remove .gitmodules" .gitmodules $ git commit -q -m "missing .gitmodules" $ cd .. $ hg convert git-repo6 hg-repo6 --traceback 2>&1 | grep -v "fatal: Path '.gitmodules' does not exist" initializing destination hg-repo6 repository scanning source... sorting... converting... 2 addsubmodule 1 remove .gitmodules 0 missing .gitmodules warning: cannot read submodules config file in * (glob) updating bookmarks $ rm -rf hg-repo6 $ cd git-repo6 $ rm -rf git-repo4 $ git reset --hard 'HEAD^^' > /dev/null $ cd .. test invalid splicemap1 $ cat > splicemap < $VALIDID1 > EOF $ hg convert --splicemap splicemap git-repo2 git-repo2-splicemap1-hg initializing destination git-repo2-splicemap1-hg repository abort: syntax error in splicemap(1): child parent1[,parent2] expected [255] test invalid splicemap2 $ cat > splicemap < $VALIDID1 $VALIDID2, $VALIDID2, $VALIDID2 > EOF $ hg convert --splicemap splicemap git-repo2 git-repo2-splicemap2-hg initializing destination git-repo2-splicemap2-hg repository abort: syntax error in splicemap(1): child parent1[,parent2] expected [255] test invalid splicemap3 $ cat > splicemap < $INVALIDID1 $INVALIDID2 > EOF $ hg convert --splicemap splicemap git-repo2 git-repo2-splicemap3-hg initializing destination git-repo2-splicemap3-hg repository abort: splicemap entry afd12345af is not a valid revision identifier [255] convert sub modules $ hg convert git-repo6 git-repo6-hg initializing destination git-repo6-hg repository scanning source... sorting... converting... 0 addsubmodule updating bookmarks $ hg -R git-repo6-hg log -v changeset: 0:* (glob) bookmark: master tag: tip user: nottest date: Mon Jan 01 00:00:23 2007 +0000 files: .hgsub .hgsubstate description: addsubmodule committer: test $ cd git-repo6-hg $ hg up >/dev/null 2>/dev/null $ cat .hgsubstate * git-repo5 (glob) $ cd git-repo5 $ cat foo sub $ cd ../.. make sure rename detection doesn't break removing and adding gitmodules $ cd git-repo6 $ git mv .gitmodules .gitmodules-renamed $ commit -a -m 'rename .gitmodules' $ git mv .gitmodules-renamed .gitmodules $ commit -a -m 'rename .gitmodules back' $ cd .. $ hg --config convert.git.similarity=100 convert -q git-repo6 git-repo6-hg $ hg -R git-repo6-hg log -r 'tip^' -T "{desc|firstline}\n" rename .gitmodules $ hg -R git-repo6-hg status -C --change 'tip^' A .gitmodules-renamed R .hgsub R .hgsubstate $ hg -R git-repo6-hg log -r tip -T "{desc|firstline}\n" rename .gitmodules back $ hg -R git-repo6-hg status -C --change tip A .hgsub A .hgsubstate R .gitmodules-renamed convert the revision removing '.gitmodules' itself (and related submodules) $ cd git-repo6 $ git rm .gitmodules rm '.gitmodules' $ git rm --cached git-repo5 rm 'git-repo5' $ commit -a -m 'remove .gitmodules and submodule git-repo5' $ cd .. $ hg convert -q git-repo6 git-repo6-hg $ hg -R git-repo6-hg tip -T "{desc|firstline}\n" remove .gitmodules and submodule git-repo5 $ hg -R git-repo6-hg tip -T "{file_dels}\n" .hgsub .hgsubstate skip submodules in the conversion $ hg convert -q git-repo6 no-submodules --config convert.git.skipsubmodules=True $ hg -R no-submodules manifest --all .gitmodules-renamed convert using a different remote prefix $ git init git-repo7 Initialized empty Git repository in $TESTTMP/git-repo7/.git/ $ cd git-repo7 TODO: it'd be nice to use (?) lines instead of grep -v to handle the git output variance, but that doesn't currently work in the middle of a block, so do this for now. $ touch a && git add a && git commit -am "commit a" | grep -v changed [master (root-commit) 8ae5f69] commit a Author: nottest create mode 100644 a $ cd .. $ git clone git-repo7 git-repo7-client Cloning into 'git-repo7-client'... done. $ hg convert --config convert.git.remoteprefix=origin git-repo7-client hg-repo7 initializing destination hg-repo7 repository scanning source... sorting... converting... 0 commit a updating bookmarks $ hg -R hg-repo7 bookmarks master 0:03bf38caa4c6 origin/master 0:03bf38caa4c6 Run convert when the remote branches have changed (there was an old bug where the local convert read branches from the server) $ cd git-repo7 $ echo a >> a $ git commit -q -am "move master forward" $ cd .. $ rm -rf hg-repo7 $ hg convert --config convert.git.remoteprefix=origin git-repo7-client hg-repo7 initializing destination hg-repo7 repository scanning source... sorting... converting... 0 commit a updating bookmarks $ hg -R hg-repo7 bookmarks master 0:03bf38caa4c6 origin/master 0:03bf38caa4c6 damaged git repository tests: In case the hard-coded hashes change, the following commands can be used to list the hashes and their corresponding types in the repository: cd git-repo4/.git/objects find . -type f | cut -c 3- | sed 's_/__' | xargs -n 1 -t git cat-file -t cd ../../.. damage git repository by renaming a commit object $ COMMIT_OBJ=1c/0ce3c5886f83a1d78a7b517cdff5cf9ca17bdd $ mv git-repo4/.git/objects/$COMMIT_OBJ git-repo4/.git/objects/$COMMIT_OBJ.tmp $ hg convert git-repo4 git-repo4-broken-hg 2>&1 | grep 'abort:' abort: cannot retrieve number of commits in $TESTTMP/git-repo4/.git $ mv git-repo4/.git/objects/$COMMIT_OBJ.tmp git-repo4/.git/objects/$COMMIT_OBJ damage git repository by renaming a blob object $ BLOB_OBJ=8b/137891791fe96927ad78e64b0aad7bded08bdc $ mv git-repo4/.git/objects/$BLOB_OBJ git-repo4/.git/objects/$BLOB_OBJ.tmp $ hg convert git-repo4 git-repo4-broken-hg 2>&1 | grep 'abort:' abort: cannot read 'blob' object at 8b137891791fe96927ad78e64b0aad7bded08bdc $ mv git-repo4/.git/objects/$BLOB_OBJ.tmp git-repo4/.git/objects/$BLOB_OBJ damage git repository by renaming a tree object $ TREE_OBJ=72/49f083d2a63a41cc737764a86981eb5f3e4635 $ mv git-repo4/.git/objects/$TREE_OBJ git-repo4/.git/objects/$TREE_OBJ.tmp $ hg convert git-repo4 git-repo4-broken-hg 2>&1 | grep 'abort:' abort: cannot read changes in 1c0ce3c5886f83a1d78a7b517cdff5cf9ca17bdd #if no-windows git19 test for escaping the repo name (CVE-2016-3069) $ git init '`echo pwned >COMMAND-INJECTION`' Initialized empty Git repository in $TESTTMP/`echo pwned >COMMAND-INJECTION`/.git/ $ cd '`echo pwned >COMMAND-INJECTION`' $ git commit -q --allow-empty -m 'empty' $ cd .. $ hg convert '`echo pwned >COMMAND-INJECTION`' 'converted' initializing destination converted repository scanning source... sorting... converting... 0 empty updating bookmarks $ test -f COMMAND-INJECTION [1] test for safely passing paths to git (CVE-2016-3105) $ git init 'ext::sh -c echo% pwned% >GIT-EXT-COMMAND-INJECTION% #' Initialized empty Git repository in $TESTTMP/ext::sh -c echo% pwned% >GIT-EXT-COMMAND-INJECTION% #/.git/ $ cd 'ext::sh -c echo% pwned% >GIT-EXT-COMMAND-INJECTION% #' $ git commit -q --allow-empty -m 'empty' $ cd .. $ hg convert 'ext::sh -c echo% pwned% >GIT-EXT-COMMAND-INJECTION% #' 'converted-git-ext' initializing destination converted-git-ext repository scanning source... sorting... converting... 0 empty updating bookmarks $ test -f GIT-EXT-COMMAND-INJECTION [1] #endif Conversion of extra commit metadata to extras works $ git init gitextras >/dev/null 2>/dev/null $ cd gitextras $ touch foo $ git add foo $ commit -m initial $ echo 1 > foo $ tree=`git write-tree` Git doesn't provider a user-facing API to write extra metadata into the commit, so create the commit object by hand $ git hash-object -t commit -w --stdin << EOF > tree ${tree} > parent ba6b1344e977ece9e00958dbbf17f1f09384b2c1 > author test 1000000000 +0000 > committer test 1000000000 +0000 > extra-1 extra-1 > extra-2 extra-2 with space > convert_revision 0000aaaabbbbccccddddeeee > > message with extras > EOF 8123727c8361a4117d1a2d80e0c4e7d70c757f18 $ git reset --hard 8123727c8361a4117d1a2d80e0c4e7d70c757f18 > /dev/null $ cd .. convert will not retain custom metadata keys by default $ hg convert gitextras hgextras1 initializing destination hgextras1 repository scanning source... sorting... converting... 1 initial 0 message with extras updating bookmarks $ hg -R hgextras1 log --debug -r 1 changeset: 1:e13a39880f68479127b2a80fa0b448cc8524aa09 bookmark: master tag: tip phase: draft parent: 0:dcb68977c55cd02cbd13b901df65c4b6e7b9c4b9 parent: -1:0000000000000000000000000000000000000000 manifest: 0:6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50 user: test date: Sun Sep 09 01:46:40 2001 +0000 extra: branch=default extra: convert_revision=8123727c8361a4117d1a2d80e0c4e7d70c757f18 description: message with extras Attempting to convert a banned extra is disallowed $ hg convert --config convert.git.extrakeys=tree,parent gitextras hgextras-banned initializing destination hgextras-banned repository abort: copying of extra key is forbidden: parent, tree [255] Converting a specific extra works $ hg convert --config convert.git.extrakeys=extra-1 gitextras hgextras2 initializing destination hgextras2 repository scanning source... sorting... converting... 1 initial 0 message with extras updating bookmarks $ hg -R hgextras2 log --debug -r 1 changeset: 1:d40fb205d58597e6ecfd55b16f198be5bf436391 bookmark: master tag: tip phase: draft parent: 0:dcb68977c55cd02cbd13b901df65c4b6e7b9c4b9 parent: -1:0000000000000000000000000000000000000000 manifest: 0:6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50 user: test date: Sun Sep 09 01:46:40 2001 +0000 extra: branch=default extra: convert_revision=8123727c8361a4117d1a2d80e0c4e7d70c757f18 extra: extra-1=extra-1 description: message with extras Converting multiple extras works $ hg convert --config convert.git.extrakeys=extra-1,extra-2 gitextras hgextras3 initializing destination hgextras3 repository scanning source... sorting... converting... 1 initial 0 message with extras updating bookmarks $ hg -R hgextras3 log --debug -r 1 changeset: 1:0105af33379e7b6491501fd34141b7af700fe125 bookmark: master tag: tip phase: draft parent: 0:dcb68977c55cd02cbd13b901df65c4b6e7b9c4b9 parent: -1:0000000000000000000000000000000000000000 manifest: 0:6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50 user: test date: Sun Sep 09 01:46:40 2001 +0000 extra: branch=default extra: convert_revision=8123727c8361a4117d1a2d80e0c4e7d70c757f18 extra: extra-1=extra-1 extra: extra-2=extra-2 with space description: message with extras convert.git.saverev can be disabled to prevent convert_revision from being written $ hg convert --config convert.git.saverev=false gitextras hgextras4 initializing destination hgextras4 repository scanning source... sorting... converting... 1 initial 0 message with extras updating bookmarks $ hg -R hgextras4 log --debug -r 1 changeset: 1:1dcaf4ffe5bee43fa86db2800821f6f0af212c5c bookmark: master tag: tip phase: draft parent: 0:a13935fec4daf06a5a87a7307ccb0fc94f98d06d parent: -1:0000000000000000000000000000000000000000 manifest: 0:6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50 user: test date: Sun Sep 09 01:46:40 2001 +0000 extra: branch=default description: message with extras convert.git.saverev and convert.git.extrakeys can be combined to preserve convert_revision from source $ hg convert --config convert.git.saverev=false --config convert.git.extrakeys=convert_revision gitextras hgextras5 initializing destination hgextras5 repository scanning source... sorting... converting... 1 initial 0 message with extras updating bookmarks $ hg -R hgextras5 log --debug -r 1 changeset: 1:574d85931544d4542007664fee3747360e85ee28 bookmark: master tag: tip phase: draft parent: 0:a13935fec4daf06a5a87a7307ccb0fc94f98d06d parent: -1:0000000000000000000000000000000000000000 manifest: 0:6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50 user: test date: Sun Sep 09 01:46:40 2001 +0000 extra: branch=default extra: convert_revision=0000aaaabbbbccccddddeeee description: message with extras mercurial-4.5.3/tests/test-propertycache.py.out0000644015407300116100000000424513261161234021551 0ustar augieeng00000000000000 === property cache === calllog: [] cached value (unfiltered): NOCACHE = first access on unfiltered, should do a call access: 0 calllog: [0] cached value (unfiltered): 0 = second access on unfiltered, should not do call access 0 calllog: [0] cached value (unfiltered): 0 = first access on "visible" view, should do a call cached value ("visible" view): NOCACHE access: 7 calllog: [0, 7] cached value (unfiltered): 0 cached value ("visible" view): 7 = second access on "visible view", should not do call access: 7 calllog: [0, 7] cached value (unfiltered): 0 cached value ("visible" view): 7 = no effect on other view cached value ("immutable" view): NOCACHE access: 9 calllog: [0, 7, 9] cached value (unfiltered): 0 cached value ("visible" view): 7 cached value ("immutable" view): 9 === unfiltered property cache === unficalllog: [] cached value (unfiltered): NOCACHE cached value ("visible" view): NOCACHE cached value ("immutable" view): NOCACHE = first access on unfiltered, should do a call access (unfiltered): 100 unficalllog: [100] cached value (unfiltered): 100 = second access on unfiltered, should not do call access (unfiltered): 100 unficalllog: [100] cached value (unfiltered): 100 = access on view should use the unfiltered cache access (unfiltered): 100 access ("visible" view): 100 access ("immutable" view): 100 unficalllog: [100] cached value (unfiltered): 100 cached value ("visible" view): NOCACHE cached value ("immutable" view): NOCACHE = even if we clear the unfiltered cache cached value (unfiltered): NOCACHE cached value ("visible" view): NOCACHE cached value ("immutable" view): NOCACHE unficalllog: [100] access ("visible" view): 100 unficalllog: [100, 100] cached value (unfiltered): 100 cached value ("visible" view): NOCACHE cached value ("immutable" view): NOCACHE access ("immutable" view): 100 unficalllog: [100, 100] cached value (unfiltered): 100 cached value ("visible" view): NOCACHE cached value ("immutable" view): NOCACHE access (unfiltered): 100 unficalllog: [100, 100] cached value (unfiltered): 100 cached value ("visible" view): NOCACHE cached value ("immutable" view): NOCACHE mercurial-4.5.3/tests/revlog-formatv0.py0000755015407300116100000000355513261161234020156 0ustar augieeng00000000000000#!/usr/bin/env python # Copyright 2010 Intevation GmbH # Author(s): # Thomas Arendsen Hein # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. """Create a Mercurial repository in revlog format 0 changeset: 0:a1ef0b125355 tag: tip user: user date: Thu Jan 01 00:00:00 1970 +0000 files: empty description: empty file """ from __future__ import absolute_import import os import sys files = [ (b'formatv0/.hg/00changelog.i', b'000000000000004400000000000000000000000000000000000000' b'000000000000000000000000000000000000000000000000000000' b'0000a1ef0b125355d27765928be600cfe85784284ab3'), (b'formatv0/.hg/00changelog.d', b'756163613935613961356635353036303562366138343738336237' b'61623536363738616436356635380a757365720a3020300a656d70' b'74790a0a656d7074792066696c65'), (b'formatv0/.hg/00manifest.i', b'000000000000003000000000000000000000000000000000000000' b'000000000000000000000000000000000000000000000000000000' b'0000aca95a9a5f550605b6a84783b7ab56678ad65f58'), (b'formatv0/.hg/00manifest.d', b'75656d707479006238306465356431333837353835343163356630' b'35323635616431343461623966613836643164620a'), (b'formatv0/.hg/data/empty.i', b'000000000000000000000000000000000000000000000000000000' b'000000000000000000000000000000000000000000000000000000' b'0000b80de5d138758541c5f05265ad144ab9fa86d1db'), (b'formatv0/.hg/data/empty.d', b''), ] def makedirs(name): """recursive directory creation""" parent = os.path.dirname(name) if parent: makedirs(parent) os.mkdir(name) makedirs(os.path.join(*'formatv0/.hg/data'.split('/'))) for name, data in files: f = open(name, 'wb') f.write(data.decode('hex')) f.close() sys.exit(0) mercurial-4.5.3/tests/test-push-race.t0000644015407300116100000013056413261161234017601 0ustar augieeng00000000000000============================================================================================ Test cases where there are race condition between two clients pushing to the same repository ============================================================================================ This file tests cases where two clients push to a server at the same time. The "raced" client is done preparing it push bundle when the "racing" client perform its push. The "raced" client starts its actual push after the "racing" client push is fully complete. A set of extension and shell functions ensures this scheduling. $ cat >> delaypush.py << EOF > """small extension orchestrate push race > > Client with the extensions will create a file when ready and get stuck until > a file is created.""" > > import errno > import os > import time > > from mercurial import ( > exchange, > extensions, > registrar, > ) > > configtable = {} > configitem = registrar.configitem(configtable) > > configitem('delaypush', 'ready-path', > default=None, > ) > configitem('delaypush', 'release-path', > default=None, > ) > > def delaypush(orig, pushop): > # notify we are done preparing > ui = pushop.repo.ui > readypath = ui.config('delaypush', 'ready-path') > if readypath is not None: > with open(readypath, 'w') as r: > r.write('foo') > ui.status('wrote ready: %s\n' % readypath) > # now wait for the other process to be done > watchpath = ui.config('delaypush', 'release-path') > if watchpath is not None: > ui.status('waiting on: %s\n' % watchpath) > limit = 100 > while 0 < limit and not os.path.exists(watchpath): > limit -= 1 > time.sleep(0.1) > if limit <= 0: > ui.warn('exiting without watchfile: %s' % watchpath) > else: > # delete the file at the end of the push > def delete(): > try: > os.unlink(watchpath) > except OSError as exc: > if exc.errno != errno.ENOENT: > raise > ui.atexit(delete) > return orig(pushop) > > def uisetup(ui): > extensions.wrapfunction(exchange, '_pushbundle2', delaypush) > EOF $ waiton () { > # wait for a file to be created (then delete it) > count=100 > while [ ! -f $1 ] ; > do > sleep 0.1; > count=`expr $count - 1`; > if [ $count -lt 0 ]; > then > break > fi; > done > [ -f $1 ] || echo "ready file still missing: $1" > rm -f $1 > } $ release () { > # create a file and wait for it be deleted > count=100 > touch $1 > while [ -f $1 ] ; > do > sleep 0.1; > count=`expr $count - 1`; > if [ $count -lt 0 ]; > then > break > fi; > done > [ ! -f $1 ] || echo "delay file still exist: $1" > } $ cat >> $HGRCPATH << EOF > [ui] > ssh = $PYTHON "$TESTDIR/dummyssh" > # simplify output > logtemplate = {node|short} {desc} ({branch}) > [phases] > publish = no > [experimental] > evolution=true > [alias] > graph = log -G --rev 'sort(all(), "topo")' > EOF We tests multiple cases: * strict: no race detected, * unrelated: race on unrelated heads are allowed. #testcases strict unrelated #if unrelated $ cat >> $HGRCPATH << EOF > [server] > concurrent-push-mode = check-related > EOF #endif Setup ----- create a repo with one root $ hg init server $ cd server $ echo root > root $ hg ci -Am "C-ROOT" adding root $ cd .. clone it in two clients $ hg clone ssh://user@dummy/server client-racy requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 842e2fac6304 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg clone ssh://user@dummy/server client-other requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 842e2fac6304 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved setup one to allow race on push $ cat >> client-racy/.hg/hgrc << EOF > [extensions] > delaypush = $TESTTMP/delaypush.py > [delaypush] > ready-path = $TESTTMP/readyfile > release-path = $TESTTMP/watchfile > EOF Simple race, both try to push to the server at the same time ------------------------------------------------------------ Both try to replace the same head # a # | b # |/ # * Creating changesets $ echo b > client-other/a $ hg -R client-other/ add client-other/a $ hg -R client-other/ commit -m "C-A" $ echo b > client-racy/b $ hg -R client-racy/ add client-racy/b $ hg -R client-racy/ commit -m "C-B" Pushing $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 & $ waiton $TESTTMP/readyfile $ hg -R client-other push -r 'tip' pushing to ssh://user@dummy/server searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files $ release $TESTTMP/watchfile Check the result of the push $ cat ./push-log pushing to ssh://user@dummy/server searching for changes wrote ready: $TESTTMP/readyfile waiting on: $TESTTMP/watchfile abort: push failed: 'repository changed while pushing - please try again' $ hg -R server graph o 98217d5a1659 C-A (default) | @ 842e2fac6304 C-ROOT (default) Pushing on two different heads ------------------------------ Both try to replace a different head # a b # | | # * * # |/ # * (resync-all) $ hg -R ./server pull ./client-racy pulling from ./client-racy searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets a9149a1428e2 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg -R ./client-other pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets a9149a1428e2 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg -R ./client-racy pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 98217d5a1659 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg -R server graph o a9149a1428e2 C-B (default) | | o 98217d5a1659 C-A (default) |/ @ 842e2fac6304 C-ROOT (default) Creating changesets $ echo aa >> client-other/a $ hg -R client-other/ commit -m "C-C" $ echo bb >> client-racy/b $ hg -R client-racy/ commit -m "C-D" Pushing $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 & $ waiton $TESTTMP/readyfile $ hg -R client-other push -r 'tip' pushing to ssh://user@dummy/server searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files $ release $TESTTMP/watchfile Check the result of the push #if strict $ cat ./push-log pushing to ssh://user@dummy/server searching for changes wrote ready: $TESTTMP/readyfile waiting on: $TESTTMP/watchfile abort: push failed: 'repository changed while pushing - please try again' $ hg -R server graph o 51c544a58128 C-C (default) | o 98217d5a1659 C-A (default) | | o a9149a1428e2 C-B (default) |/ @ 842e2fac6304 C-ROOT (default) #endif #if unrelated (The two heads are unrelated, push should be allowed) $ cat ./push-log pushing to ssh://user@dummy/server searching for changes wrote ready: $TESTTMP/readyfile waiting on: $TESTTMP/watchfile remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files $ hg -R server graph o 59e76faf78bd C-D (default) | o a9149a1428e2 C-B (default) | | o 51c544a58128 C-C (default) | | | o 98217d5a1659 C-A (default) |/ @ 842e2fac6304 C-ROOT (default) #endif Pushing while someone creates a new head ----------------------------------------- Pushing a new changeset while someone creates a new branch. # a (raced) # | # * b # |/ # * (resync-all) #if strict $ hg -R ./server pull ./client-racy pulling from ./client-racy searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 59e76faf78bd (run 'hg update' to get a working copy) #endif #if unrelated $ hg -R ./server pull ./client-racy pulling from ./client-racy searching for changes no changes found #endif $ hg -R ./client-other pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 59e76faf78bd (run 'hg update' to get a working copy) $ hg -R ./client-racy pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 51c544a58128 (run 'hg update' to get a working copy) $ hg -R server graph o 59e76faf78bd C-D (default) | o a9149a1428e2 C-B (default) | | o 51c544a58128 C-C (default) | | | o 98217d5a1659 C-A (default) |/ @ 842e2fac6304 C-ROOT (default) Creating changesets (new head) $ hg -R client-other/ up 'desc("C-A")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo aaa >> client-other/a $ hg -R client-other/ commit -m "C-E" created new head (children of existing head) $ hg -R client-racy/ up 'desc("C-C")' 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo bbb >> client-racy/a $ hg -R client-racy/ commit -m "C-F" Pushing $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 & $ waiton $TESTTMP/readyfile $ hg -R client-other push -fr 'tip' pushing to ssh://user@dummy/server searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files (+1 heads) $ release $TESTTMP/watchfile Check the result of the push #if strict $ cat ./push-log pushing to ssh://user@dummy/server searching for changes wrote ready: $TESTTMP/readyfile waiting on: $TESTTMP/watchfile abort: push failed: 'repository changed while pushing - please try again' $ hg -R server graph o d603e2c0cdd7 C-E (default) | | o 51c544a58128 C-C (default) |/ o 98217d5a1659 C-A (default) | | o 59e76faf78bd C-D (default) | | | o a9149a1428e2 C-B (default) |/ @ 842e2fac6304 C-ROOT (default) #endif #if unrelated (The racing new head do not affect existing heads, push should go through) $ cat ./push-log pushing to ssh://user@dummy/server searching for changes wrote ready: $TESTTMP/readyfile waiting on: $TESTTMP/watchfile remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files $ hg -R server graph o d9e379a8c432 C-F (default) | o 51c544a58128 C-C (default) | | o d603e2c0cdd7 C-E (default) |/ o 98217d5a1659 C-A (default) | | o 59e76faf78bd C-D (default) | | | o a9149a1428e2 C-B (default) |/ @ 842e2fac6304 C-ROOT (default) #endif Pushing touching different named branch (same topo): new branch raced --------------------------------------------------------------------- Pushing two children on the same head, one is a different named branch # a (raced, branch-a) # | # | b (default branch) # |/ # * (resync-all) #if strict $ hg -R ./server pull ./client-racy pulling from ./client-racy searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets d9e379a8c432 (run 'hg update' to get a working copy) #endif #if unrelated $ hg -R ./server pull ./client-racy pulling from ./client-racy searching for changes no changes found #endif $ hg -R ./client-other pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets d9e379a8c432 (run 'hg update' to get a working copy) $ hg -R ./client-racy pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets d603e2c0cdd7 (run 'hg heads .' to see heads, 'hg merge' to merge) $ hg -R server graph o d9e379a8c432 C-F (default) | o 51c544a58128 C-C (default) | | o d603e2c0cdd7 C-E (default) |/ o 98217d5a1659 C-A (default) | | o 59e76faf78bd C-D (default) | | | o a9149a1428e2 C-B (default) |/ @ 842e2fac6304 C-ROOT (default) Creating changesets (update existing head) $ hg -R client-other/ up 'desc("C-F")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo aaa >> client-other/a $ hg -R client-other/ commit -m "C-G" (new named branch from that existing head) $ hg -R client-racy/ up 'desc("C-F")' 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo bbb >> client-racy/a $ hg -R client-racy/ branch my-first-test-branch marked working directory as branch my-first-test-branch (branches are permanent and global, did you want a bookmark?) $ hg -R client-racy/ commit -m "C-H" Pushing $ hg -R client-racy push -r 'tip' --new-branch > ./push-log 2>&1 & $ waiton $TESTTMP/readyfile $ hg -R client-other push -fr 'tip' pushing to ssh://user@dummy/server searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files $ release $TESTTMP/watchfile Check the result of the push #if strict $ cat ./push-log pushing to ssh://user@dummy/server searching for changes wrote ready: $TESTTMP/readyfile waiting on: $TESTTMP/watchfile abort: push failed: 'repository changed while pushing - please try again' $ hg -R server graph o 75d69cba5402 C-G (default) | o d9e379a8c432 C-F (default) | o 51c544a58128 C-C (default) | | o d603e2c0cdd7 C-E (default) |/ o 98217d5a1659 C-A (default) | | o 59e76faf78bd C-D (default) | | | o a9149a1428e2 C-B (default) |/ @ 842e2fac6304 C-ROOT (default) #endif #if unrelated (unrelated named branches are unrelated) $ cat ./push-log pushing to ssh://user@dummy/server searching for changes wrote ready: $TESTTMP/readyfile waiting on: $TESTTMP/watchfile remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files (+1 heads) $ hg -R server graph o 833be552cfe6 C-H (my-first-test-branch) | | o 75d69cba5402 C-G (default) |/ o d9e379a8c432 C-F (default) | o 51c544a58128 C-C (default) | | o d603e2c0cdd7 C-E (default) |/ o 98217d5a1659 C-A (default) | | o 59e76faf78bd C-D (default) | | | o a9149a1428e2 C-B (default) |/ @ 842e2fac6304 C-ROOT (default) #endif The racing new head do not affect existing heads, push should go through pushing touching different named branch (same topo): old branch raced --------------------------------------------------------------------- Pushing two children on the same head, one is a different named branch # a (raced, default-branch) # | # | b (new branch) # |/ # * (default-branch) (resync-all) #if strict $ hg -R ./server pull ./client-racy pulling from ./client-racy searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 833be552cfe6 (run 'hg heads .' to see heads, 'hg merge' to merge) #endif #if unrelated $ hg -R ./server pull ./client-racy pulling from ./client-racy searching for changes no changes found #endif $ hg -R ./client-other pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 833be552cfe6 (run 'hg heads .' to see heads, 'hg merge' to merge) $ hg -R ./client-racy pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 75d69cba5402 (run 'hg heads' to see heads) $ hg -R server graph o 833be552cfe6 C-H (my-first-test-branch) | | o 75d69cba5402 C-G (default) |/ o d9e379a8c432 C-F (default) | o 51c544a58128 C-C (default) | | o d603e2c0cdd7 C-E (default) |/ o 98217d5a1659 C-A (default) | | o 59e76faf78bd C-D (default) | | | o a9149a1428e2 C-B (default) |/ @ 842e2fac6304 C-ROOT (default) Creating changesets (new named branch from one head) $ hg -R client-other/ up 'desc("C-G")' 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo aaa >> client-other/a $ hg -R client-other/ branch my-second-test-branch marked working directory as branch my-second-test-branch $ hg -R client-other/ commit -m "C-I" (children "updating" that same head) $ hg -R client-racy/ up 'desc("C-G")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo bbb >> client-racy/a $ hg -R client-racy/ commit -m "C-J" Pushing $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 & $ waiton $TESTTMP/readyfile $ hg -R client-other push -fr 'tip' --new-branch pushing to ssh://user@dummy/server searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files $ release $TESTTMP/watchfile Check the result of the push #if strict $ cat ./push-log pushing to ssh://user@dummy/server searching for changes wrote ready: $TESTTMP/readyfile waiting on: $TESTTMP/watchfile abort: push failed: 'repository changed while pushing - please try again' $ hg -R server graph o b35ed749f288 C-I (my-second-test-branch) | o 75d69cba5402 C-G (default) | | o 833be552cfe6 C-H (my-first-test-branch) |/ o d9e379a8c432 C-F (default) | o 51c544a58128 C-C (default) | | o d603e2c0cdd7 C-E (default) |/ o 98217d5a1659 C-A (default) | | o 59e76faf78bd C-D (default) | | | o a9149a1428e2 C-B (default) |/ @ 842e2fac6304 C-ROOT (default) #endif #if unrelated (unrelated named branches are unrelated) $ cat ./push-log pushing to ssh://user@dummy/server searching for changes wrote ready: $TESTTMP/readyfile waiting on: $TESTTMP/watchfile remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files (+1 heads) $ hg -R server graph o 89420bf00fae C-J (default) | | o b35ed749f288 C-I (my-second-test-branch) |/ o 75d69cba5402 C-G (default) | | o 833be552cfe6 C-H (my-first-test-branch) |/ o d9e379a8c432 C-F (default) | o 51c544a58128 C-C (default) | | o d603e2c0cdd7 C-E (default) |/ o 98217d5a1659 C-A (default) | | o 59e76faf78bd C-D (default) | | | o a9149a1428e2 C-B (default) |/ @ 842e2fac6304 C-ROOT (default) #endif pushing racing push touch multiple heads ---------------------------------------- There are multiple heads, but the racing push touch all of them # a (raced) # | b # |/| # * * # |/ # * (resync-all) #if strict $ hg -R ./server pull ./client-racy pulling from ./client-racy searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 89420bf00fae (run 'hg heads .' to see heads, 'hg merge' to merge) #endif #if unrelated $ hg -R ./server pull ./client-racy pulling from ./client-racy searching for changes no changes found #endif $ hg -R ./client-other pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 89420bf00fae (run 'hg heads' to see heads) $ hg -R ./client-racy pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets b35ed749f288 (run 'hg heads .' to see heads, 'hg merge' to merge) $ hg -R server graph o 89420bf00fae C-J (default) | | o b35ed749f288 C-I (my-second-test-branch) |/ o 75d69cba5402 C-G (default) | | o 833be552cfe6 C-H (my-first-test-branch) |/ o d9e379a8c432 C-F (default) | o 51c544a58128 C-C (default) | | o d603e2c0cdd7 C-E (default) |/ o 98217d5a1659 C-A (default) | | o 59e76faf78bd C-D (default) | | | o a9149a1428e2 C-B (default) |/ @ 842e2fac6304 C-ROOT (default) Creating changesets (merges heads) $ hg -R client-other/ up 'desc("C-E")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R client-other/ merge 'desc("C-D")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg -R client-other/ commit -m "C-K" (update one head) $ hg -R client-racy/ up 'desc("C-D")' 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo bbb >> client-racy/b $ hg -R client-racy/ commit -m "C-L" Pushing $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 & $ waiton $TESTTMP/readyfile $ hg -R client-other push -fr 'tip' --new-branch pushing to ssh://user@dummy/server searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 0 changes to 0 files (-1 heads) $ release $TESTTMP/watchfile Check the result of the push $ cat ./push-log pushing to ssh://user@dummy/server searching for changes wrote ready: $TESTTMP/readyfile waiting on: $TESTTMP/watchfile abort: push failed: 'repository changed while pushing - please try again' $ hg -R server graph o be705100c623 C-K (default) |\ | o d603e2c0cdd7 C-E (default) | | o | 59e76faf78bd C-D (default) | | | | o 89420bf00fae C-J (default) | | | | | | o b35ed749f288 C-I (my-second-test-branch) | | |/ | | o 75d69cba5402 C-G (default) | | | | | | o 833be552cfe6 C-H (my-first-test-branch) | | |/ | | o d9e379a8c432 C-F (default) | | | | | o 51c544a58128 C-C (default) | |/ o | a9149a1428e2 C-B (default) | | | o 98217d5a1659 C-A (default) |/ @ 842e2fac6304 C-ROOT (default) pushing raced push touch multiple heads --------------------------------------- There are multiple heads, the raced push touch all of them # b # | a (raced) # |/| # * * # |/ # * (resync-all) $ hg -R ./server pull ./client-racy pulling from ./client-racy searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets cac2cead0ff0 (run 'hg heads .' to see heads, 'hg merge' to merge) $ hg -R ./client-other pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets cac2cead0ff0 (run 'hg heads .' to see heads, 'hg merge' to merge) $ hg -R ./client-racy pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 0 changes to 0 files new changesets be705100c623 (run 'hg update' to get a working copy) $ hg -R server graph o cac2cead0ff0 C-L (default) | | o be705100c623 C-K (default) |/| | o d603e2c0cdd7 C-E (default) | | o | 59e76faf78bd C-D (default) | | | | o 89420bf00fae C-J (default) | | | | | | o b35ed749f288 C-I (my-second-test-branch) | | |/ | | o 75d69cba5402 C-G (default) | | | | | | o 833be552cfe6 C-H (my-first-test-branch) | | |/ | | o d9e379a8c432 C-F (default) | | | | | o 51c544a58128 C-C (default) | |/ o | a9149a1428e2 C-B (default) | | | o 98217d5a1659 C-A (default) |/ @ 842e2fac6304 C-ROOT (default) Creating changesets (update existing head) $ echo aaa >> client-other/a $ hg -R client-other/ commit -m "C-M" (merge heads) $ hg -R client-racy/ merge 'desc("C-K")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg -R client-racy/ commit -m "C-N" Pushing $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 & $ waiton $TESTTMP/readyfile $ hg -R client-other push -fr 'tip' --new-branch pushing to ssh://user@dummy/server searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files $ release $TESTTMP/watchfile Check the result of the push $ cat ./push-log pushing to ssh://user@dummy/server searching for changes wrote ready: $TESTTMP/readyfile waiting on: $TESTTMP/watchfile abort: push failed: 'repository changed while pushing - please try again' $ hg -R server graph o 6fd3090135df C-M (default) | o be705100c623 C-K (default) |\ | o d603e2c0cdd7 C-E (default) | | +---o cac2cead0ff0 C-L (default) | | o | 59e76faf78bd C-D (default) | | | | o 89420bf00fae C-J (default) | | | | | | o b35ed749f288 C-I (my-second-test-branch) | | |/ | | o 75d69cba5402 C-G (default) | | | | | | o 833be552cfe6 C-H (my-first-test-branch) | | |/ | | o d9e379a8c432 C-F (default) | | | | | o 51c544a58128 C-C (default) | |/ o | a9149a1428e2 C-B (default) | | | o 98217d5a1659 C-A (default) |/ @ 842e2fac6304 C-ROOT (default) racing commit push a new head behind another named branch --------------------------------------------------------- non-continuous branch are valid case, we tests for them. # b (branch default) # | # o (branch foo) # | # | a (raced, branch default) # |/ # * (branch foo) # | # * (branch default) (resync-all + other branch) $ hg -R ./server pull ./client-racy pulling from ./client-racy searching for changes adding changesets adding manifests adding file changes added 1 changesets with 0 changes to 0 files new changesets 866a66e18630 (run 'hg update' to get a working copy) (creates named branch on head) $ hg -R ./server/ up 'desc("C-N")' 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R ./server/ branch other marked working directory as branch other $ hg -R ./server/ ci -m "C-Z" $ hg -R ./server/ up null 0 files updated, 0 files merged, 3 files removed, 0 files unresolved (sync client) $ hg -R ./client-other pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 2 changesets with 0 changes to 0 files new changesets 866a66e18630:55a6f1c01b48 (run 'hg update' to get a working copy) $ hg -R ./client-racy pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 2 changesets with 1 changes to 1 files (+1 heads) new changesets 6fd3090135df:55a6f1c01b48 (run 'hg heads .' to see heads, 'hg merge' to merge) $ hg -R server graph o 55a6f1c01b48 C-Z (other) | o 866a66e18630 C-N (default) |\ +---o 6fd3090135df C-M (default) | | | o cac2cead0ff0 C-L (default) | | o | be705100c623 C-K (default) |\| o | d603e2c0cdd7 C-E (default) | | | o 59e76faf78bd C-D (default) | | | | o 89420bf00fae C-J (default) | | | | | | o b35ed749f288 C-I (my-second-test-branch) | | |/ | | o 75d69cba5402 C-G (default) | | | | | | o 833be552cfe6 C-H (my-first-test-branch) | | |/ | | o d9e379a8c432 C-F (default) | | | +---o 51c544a58128 C-C (default) | | | o a9149a1428e2 C-B (default) | | o | 98217d5a1659 C-A (default) |/ o 842e2fac6304 C-ROOT (default) Creating changesets (update default head through another named branch one) $ hg -R client-other/ up 'desc("C-Z")' 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo aaa >> client-other/a $ hg -R client-other/ commit -m "C-O" $ echo aaa >> client-other/a $ hg -R client-other/ branch --force default marked working directory as branch default $ hg -R client-other/ commit -m "C-P" created new head (update default head) $ hg -R client-racy/ up 'desc("C-Z")' 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo bbb >> client-other/a $ hg -R client-racy/ branch --force default marked working directory as branch default $ hg -R client-racy/ commit -m "C-Q" created new head Pushing $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 & $ waiton $TESTTMP/readyfile $ hg -R client-other push -fr 'tip' --new-branch pushing to ssh://user@dummy/server searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 2 changesets with 1 changes to 1 files $ release $TESTTMP/watchfile Check the result of the push $ cat ./push-log pushing to ssh://user@dummy/server searching for changes wrote ready: $TESTTMP/readyfile waiting on: $TESTTMP/watchfile abort: push failed: 'repository changed while pushing - please try again' $ hg -R server graph o 1b58ee3f79e5 C-P (default) | o d0a85b2252a9 C-O (other) | o 55a6f1c01b48 C-Z (other) | o 866a66e18630 C-N (default) |\ +---o 6fd3090135df C-M (default) | | | o cac2cead0ff0 C-L (default) | | o | be705100c623 C-K (default) |\| o | d603e2c0cdd7 C-E (default) | | | o 59e76faf78bd C-D (default) | | | | o 89420bf00fae C-J (default) | | | | | | o b35ed749f288 C-I (my-second-test-branch) | | |/ | | o 75d69cba5402 C-G (default) | | | | | | o 833be552cfe6 C-H (my-first-test-branch) | | |/ | | o d9e379a8c432 C-F (default) | | | +---o 51c544a58128 C-C (default) | | | o a9149a1428e2 C-B (default) | | o | 98217d5a1659 C-A (default) |/ o 842e2fac6304 C-ROOT (default) raced commit push a new head behind another named branch --------------------------------------------------------- non-continuous branch are valid case, we tests for them. # b (raced branch default) # | # o (branch foo) # | # | a (branch default) # |/ # * (branch foo) # | # * (branch default) (resync-all) $ hg -R ./server pull ./client-racy pulling from ./client-racy searching for changes adding changesets adding manifests adding file changes added 1 changesets with 0 changes to 0 files (+1 heads) new changesets b0ee3d6f51bc (run 'hg heads .' to see heads, 'hg merge' to merge) $ hg -R ./client-other pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 0 changes to 0 files (+1 heads) new changesets b0ee3d6f51bc (run 'hg heads .' to see heads, 'hg merge' to merge) $ hg -R ./client-racy pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 2 changesets with 1 changes to 1 files (+1 heads) new changesets d0a85b2252a9:1b58ee3f79e5 (run 'hg heads .' to see heads, 'hg merge' to merge) $ hg -R server graph o b0ee3d6f51bc C-Q (default) | | o 1b58ee3f79e5 C-P (default) | | | o d0a85b2252a9 C-O (other) |/ o 55a6f1c01b48 C-Z (other) | o 866a66e18630 C-N (default) |\ +---o 6fd3090135df C-M (default) | | | o cac2cead0ff0 C-L (default) | | o | be705100c623 C-K (default) |\| o | d603e2c0cdd7 C-E (default) | | | o 59e76faf78bd C-D (default) | | | | o 89420bf00fae C-J (default) | | | | | | o b35ed749f288 C-I (my-second-test-branch) | | |/ | | o 75d69cba5402 C-G (default) | | | | | | o 833be552cfe6 C-H (my-first-test-branch) | | |/ | | o d9e379a8c432 C-F (default) | | | +---o 51c544a58128 C-C (default) | | | o a9149a1428e2 C-B (default) | | o | 98217d5a1659 C-A (default) |/ o 842e2fac6304 C-ROOT (default) Creating changesets (update 'other' named branch head) $ hg -R client-other/ up 'desc("C-P")' 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo aaa >> client-other/a $ hg -R client-other/ branch --force other marked working directory as branch other $ hg -R client-other/ commit -m "C-R" created new head (update 'other named brnach through a 'default' changeset') $ hg -R client-racy/ up 'desc("C-P")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo bbb >> client-racy/a $ hg -R client-racy/ commit -m "C-S" $ echo bbb >> client-racy/a $ hg -R client-racy/ branch --force other marked working directory as branch other $ hg -R client-racy/ commit -m "C-T" created new head Pushing $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 & $ waiton $TESTTMP/readyfile $ hg -R client-other push -fr 'tip' --new-branch pushing to ssh://user@dummy/server searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files $ release $TESTTMP/watchfile Check the result of the push $ cat ./push-log pushing to ssh://user@dummy/server searching for changes wrote ready: $TESTTMP/readyfile waiting on: $TESTTMP/watchfile abort: push failed: 'repository changed while pushing - please try again' $ hg -R server graph o de7b9e2ba3f6 C-R (other) | o 1b58ee3f79e5 C-P (default) | o d0a85b2252a9 C-O (other) | | o b0ee3d6f51bc C-Q (default) |/ o 55a6f1c01b48 C-Z (other) | o 866a66e18630 C-N (default) |\ +---o 6fd3090135df C-M (default) | | | o cac2cead0ff0 C-L (default) | | o | be705100c623 C-K (default) |\| o | d603e2c0cdd7 C-E (default) | | | o 59e76faf78bd C-D (default) | | | | o 89420bf00fae C-J (default) | | | | | | o b35ed749f288 C-I (my-second-test-branch) | | |/ | | o 75d69cba5402 C-G (default) | | | | | | o 833be552cfe6 C-H (my-first-test-branch) | | |/ | | o d9e379a8c432 C-F (default) | | | +---o 51c544a58128 C-C (default) | | | o a9149a1428e2 C-B (default) | | o | 98217d5a1659 C-A (default) |/ o 842e2fac6304 C-ROOT (default) raced commit push a new head obsoleting the one touched by the racing push -------------------------------------------------------------------------- # b (racing) # | # ø⇠◔ a (raced) # |/ # * (resync-all) $ hg -R ./server pull ./client-racy pulling from ./client-racy searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files (+1 heads) new changesets 2efd43f7b5ba:3d57ed3c1091 (run 'hg heads .' to see heads, 'hg merge' to merge) $ hg -R ./client-other pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files (+1 heads) new changesets 2efd43f7b5ba:3d57ed3c1091 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg -R ./client-racy pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets de7b9e2ba3f6 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg -R server graph o 3d57ed3c1091 C-T (other) | o 2efd43f7b5ba C-S (default) | | o de7b9e2ba3f6 C-R (other) |/ o 1b58ee3f79e5 C-P (default) | o d0a85b2252a9 C-O (other) | | o b0ee3d6f51bc C-Q (default) |/ o 55a6f1c01b48 C-Z (other) | o 866a66e18630 C-N (default) |\ +---o 6fd3090135df C-M (default) | | | o cac2cead0ff0 C-L (default) | | o | be705100c623 C-K (default) |\| o | d603e2c0cdd7 C-E (default) | | | o 59e76faf78bd C-D (default) | | | | o 89420bf00fae C-J (default) | | | | | | o b35ed749f288 C-I (my-second-test-branch) | | |/ | | o 75d69cba5402 C-G (default) | | | | | | o 833be552cfe6 C-H (my-first-test-branch) | | |/ | | o d9e379a8c432 C-F (default) | | | +---o 51c544a58128 C-C (default) | | | o a9149a1428e2 C-B (default) | | o | 98217d5a1659 C-A (default) |/ o 842e2fac6304 C-ROOT (default) Creating changesets and markers (continue existing head) $ hg -R client-other/ up 'desc("C-Q")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo aaa >> client-other/a $ hg -R client-other/ commit -m "C-U" (new topo branch obsoleting that same head) $ hg -R client-racy/ up 'desc("C-Z")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo bbb >> client-racy/a $ hg -R client-racy/ branch --force default marked working directory as branch default $ hg -R client-racy/ commit -m "C-V" created new head $ ID_Q=`hg -R client-racy log -T '{node}\n' -r 'desc("C-Q")'` $ ID_V=`hg -R client-racy log -T '{node}\n' -r 'desc("C-V")'` $ hg -R client-racy debugobsolete $ID_Q $ID_V obsoleted 1 changesets Pushing $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 & $ waiton $TESTTMP/readyfile $ hg -R client-other push -fr 'tip' --new-branch pushing to ssh://user@dummy/server searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 0 changes to 0 files $ release $TESTTMP/watchfile Check the result of the push $ cat ./push-log pushing to ssh://user@dummy/server searching for changes wrote ready: $TESTTMP/readyfile waiting on: $TESTTMP/watchfile abort: push failed: 'repository changed while pushing - please try again' $ hg -R server debugobsolete $ hg -R server graph o a98a47d8b85b C-U (default) | o b0ee3d6f51bc C-Q (default) | | o 3d57ed3c1091 C-T (other) | | | o 2efd43f7b5ba C-S (default) | | | | o de7b9e2ba3f6 C-R (other) | |/ | o 1b58ee3f79e5 C-P (default) | | | o d0a85b2252a9 C-O (other) |/ o 55a6f1c01b48 C-Z (other) | o 866a66e18630 C-N (default) |\ +---o 6fd3090135df C-M (default) | | | o cac2cead0ff0 C-L (default) | | o | be705100c623 C-K (default) |\| o | d603e2c0cdd7 C-E (default) | | | o 59e76faf78bd C-D (default) | | | | o 89420bf00fae C-J (default) | | | | | | o b35ed749f288 C-I (my-second-test-branch) | | |/ | | o 75d69cba5402 C-G (default) | | | | | | o 833be552cfe6 C-H (my-first-test-branch) | | |/ | | o d9e379a8c432 C-F (default) | | | +---o 51c544a58128 C-C (default) | | | o a9149a1428e2 C-B (default) | | o | 98217d5a1659 C-A (default) |/ o 842e2fac6304 C-ROOT (default) racing commit push a new head obsoleting the one touched by the raced push -------------------------------------------------------------------------- (mirror test case of the previous one # a (raced branch default) # | # ø⇠◔ b (racing) # |/ # * (resync-all) $ hg -R ./server pull ./client-racy pulling from ./client-racy searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) 1 new obsolescence markers obsoleted 1 changesets 1 new orphan changesets new changesets 720c5163ecf6 (run 'hg heads .' to see heads, 'hg merge' to merge) $ hg -R ./client-other pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) 1 new obsolescence markers obsoleted 1 changesets 1 new orphan changesets new changesets 720c5163ecf6 (run 'hg heads .' to see heads, 'hg merge' to merge) $ hg -R ./client-racy pull pulling from ssh://user@dummy/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 0 changes to 0 files 1 new orphan changesets new changesets a98a47d8b85b (run 'hg update' to get a working copy) $ hg -R server debugobsolete b0ee3d6f51bc4c0ca6d4f2907708027a6c376233 720c5163ecf64dcc6216bee2d62bf3edb1882499 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ hg -R server graph o 720c5163ecf6 C-V (default) | | * a98a47d8b85b C-U (default) | | | x b0ee3d6f51bc C-Q (default) |/ | o 3d57ed3c1091 C-T (other) | | | o 2efd43f7b5ba C-S (default) | | | | o de7b9e2ba3f6 C-R (other) | |/ | o 1b58ee3f79e5 C-P (default) | | | o d0a85b2252a9 C-O (other) |/ o 55a6f1c01b48 C-Z (other) | o 866a66e18630 C-N (default) |\ +---o 6fd3090135df C-M (default) | | | o cac2cead0ff0 C-L (default) | | o | be705100c623 C-K (default) |\| o | d603e2c0cdd7 C-E (default) | | | o 59e76faf78bd C-D (default) | | | | o 89420bf00fae C-J (default) | | | | | | o b35ed749f288 C-I (my-second-test-branch) | | |/ | | o 75d69cba5402 C-G (default) | | | | | | o 833be552cfe6 C-H (my-first-test-branch) | | |/ | | o d9e379a8c432 C-F (default) | | | +---o 51c544a58128 C-C (default) | | | o a9149a1428e2 C-B (default) | | o | 98217d5a1659 C-A (default) |/ o 842e2fac6304 C-ROOT (default) Creating changesets and markers (new topo branch obsoleting that same head) $ hg -R client-other/ up 'desc("C-Q")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo bbb >> client-other/a $ hg -R client-other/ branch --force default marked working directory as branch default $ hg -R client-other/ commit -m "C-W" 1 new orphan changesets created new head $ ID_V=`hg -R client-other log -T '{node}\n' -r 'desc("C-V")'` $ ID_W=`hg -R client-other log -T '{node}\n' -r 'desc("C-W")'` $ hg -R client-other debugobsolete $ID_V $ID_W obsoleted 1 changesets (continue the same head) $ echo aaa >> client-racy/a $ hg -R client-racy/ commit -m "C-X" Pushing $ hg -R client-racy push -r 'tip' > ./push-log 2>&1 & $ waiton $TESTTMP/readyfile $ hg -R client-other push -fr 'tip' --new-branch pushing to ssh://user@dummy/server searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 0 changes to 1 files (+1 heads) remote: 1 new obsolescence markers remote: obsoleted 1 changesets remote: 1 new orphan changesets $ release $TESTTMP/watchfile Check the result of the push $ cat ./push-log pushing to ssh://user@dummy/server searching for changes wrote ready: $TESTTMP/readyfile waiting on: $TESTTMP/watchfile abort: push failed: 'repository changed while pushing - please try again' $ hg -R server debugobsolete b0ee3d6f51bc4c0ca6d4f2907708027a6c376233 720c5163ecf64dcc6216bee2d62bf3edb1882499 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 720c5163ecf64dcc6216bee2d62bf3edb1882499 39bc0598afe90ab18da460bafecc0fa953b77596 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ hg -R server graph --hidden * 39bc0598afe9 C-W (default) | | * a98a47d8b85b C-U (default) |/ x b0ee3d6f51bc C-Q (default) | | o 3d57ed3c1091 C-T (other) | | | o 2efd43f7b5ba C-S (default) | | | | o de7b9e2ba3f6 C-R (other) | |/ | o 1b58ee3f79e5 C-P (default) | | | o d0a85b2252a9 C-O (other) |/ | x 720c5163ecf6 C-V (default) |/ o 55a6f1c01b48 C-Z (other) | o 866a66e18630 C-N (default) |\ +---o 6fd3090135df C-M (default) | | | o cac2cead0ff0 C-L (default) | | o | be705100c623 C-K (default) |\| o | d603e2c0cdd7 C-E (default) | | | o 59e76faf78bd C-D (default) | | | | o 89420bf00fae C-J (default) | | | | | | o b35ed749f288 C-I (my-second-test-branch) | | |/ | | o 75d69cba5402 C-G (default) | | | | | | o 833be552cfe6 C-H (my-first-test-branch) | | |/ | | o d9e379a8c432 C-F (default) | | | +---o 51c544a58128 C-C (default) | | | o a9149a1428e2 C-B (default) | | o | 98217d5a1659 C-A (default) |/ o 842e2fac6304 C-ROOT (default) mercurial-4.5.3/tests/mockblackbox.py0000644015407300116100000000053613261161234017554 0ustar augieeng00000000000000from __future__ import absolute_import from mercurial import ( util, ) # XXX: we should probably offer a devel option to do this in blackbox directly def getuser(): return 'bob' def getpid(): return 5000 # mock the date and user apis so the output is always the same def uisetup(ui): util.getuser = getuser util.getpid = getpid mercurial-4.5.3/tests/test-repo-compengines.t0000644015407300116100000000361413261161234021157 0ustar augieeng00000000000000A new repository uses zlib storage, which doesn't need a requirement $ hg init default $ cd default $ cat .hg/requires dotencode fncache generaldelta revlogv1 store $ touch foo $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text to trigger compression' $ hg debugrevlog -c | grep 0x78 0x78 (x) : 1 (100.00%) 0x78 (x) : 110 (100.00%) $ cd .. Unknown compression engine to format.compression aborts $ hg --config experimental.format.compression=unknown init unknown abort: compression engine unknown defined by experimental.format.compression not available (run "hg debuginstall" to list available compression engines) [255] A requirement specifying an unknown compression engine results in bail $ hg init unknownrequirement $ cd unknownrequirement $ echo exp-compression-unknown >> .hg/requires $ hg log abort: repository requires features unknown to this Mercurial: exp-compression-unknown! (see https://mercurial-scm.org/wiki/MissingRequirement for more information) [255] $ cd .. #if zstd $ hg --config experimental.format.compression=zstd init zstd $ cd zstd $ cat .hg/requires dotencode exp-compression-zstd fncache generaldelta revlogv1 store $ touch foo $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text' $ hg debugrevlog -c | grep 0x28 0x28 : 1 (100.00%) 0x28 : 98 (100.00%) $ cd .. Specifying a new format.compression on an existing repo won't introduce data with that engine or a requirement $ cd default $ touch bar $ hg --config experimental.format.compression=zstd -q commit -A -m 'add bar with a lot of repeated repeated repeated text' $ cat .hg/requires dotencode fncache generaldelta revlogv1 store $ hg debugrevlog -c | grep 0x78 0x78 (x) : 2 (100.00%) 0x78 (x) : 199 (100.00%) #endif mercurial-4.5.3/tests/test-rebase-scenario-global.t0000644015407300116100000005206113261161234022205 0ustar augieeng00000000000000 $ cat >> $HGRCPATH < [extensions] > rebase= > drawdag=$TESTDIR/drawdag.py > > [phases] > publish=False > > [alias] > tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n" > EOF $ hg init a $ cd a $ hg unbundle "$TESTDIR/bundles/rebase.hg" adding changesets adding manifests adding file changes added 8 changesets with 7 changes to 7 files (+2 heads) new changesets cd010b8cd998:02de42196ebe (run 'hg heads' to see heads, 'hg merge' to merge) $ hg up tip 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd .. Rebasing D onto H - simple rebase: (this also tests that editor is invoked if '--edit' is specified, and that we can abort or warn for colliding untracked files) $ hg clone -q -u . a a1 $ cd a1 $ hg tglog @ 7: 02de42196ebe 'H' | | o 6: eea13746799a 'G' |/| o | 5: 24b6387c8c8c 'F' | | | o 4: 9520eea781bc 'E' |/ | o 3: 32af7686d403 'D' | | | o 2: 5fddd98957c8 'C' | | | o 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' $ hg status --rev "3^1" --rev 3 A D $ echo collide > D $ HGEDITOR=cat hg rebase -s 3 -d 7 --edit --config merge.checkunknown=warn rebasing 3:32af7686d403 "D" D: replacing untracked file D HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: Nicolas Dumazet HG: branch 'default' HG: added D saved backup bundle to $TESTTMP/a1/.hg/strip-backup/32af7686d403-6f7dface-rebase.hg $ cat D.orig collide $ rm D.orig $ hg tglog o 7: 1619f02ff7dd 'D' | @ 6: 02de42196ebe 'H' | | o 5: eea13746799a 'G' |/| o | 4: 24b6387c8c8c 'F' | | | o 3: 9520eea781bc 'E' |/ | o 2: 5fddd98957c8 'C' | | | o 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' $ cd .. D onto F - intermediate point: (this also tests that editor is not invoked if '--edit' is not specified, and that we can ignore for colliding untracked files) $ hg clone -q -u . a a2 $ cd a2 $ echo collide > D $ HGEDITOR=cat hg rebase -s 3 -d 5 --config merge.checkunknown=ignore rebasing 3:32af7686d403 "D" saved backup bundle to $TESTTMP/a2/.hg/strip-backup/32af7686d403-6f7dface-rebase.hg $ cat D.orig collide $ rm D.orig $ hg tglog o 7: 2107530e74ab 'D' | | @ 6: 02de42196ebe 'H' |/ | o 5: eea13746799a 'G' |/| o | 4: 24b6387c8c8c 'F' | | | o 3: 9520eea781bc 'E' |/ | o 2: 5fddd98957c8 'C' | | | o 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' $ cd .. E onto H - skip of G: (this also tests that we can overwrite untracked files and don't create backups if they have the same contents) $ hg clone -q -u . a a3 $ cd a3 $ hg cat -r 4 E | tee E E $ hg rebase -s 4 -d 7 rebasing 4:9520eea781bc "E" rebasing 6:eea13746799a "G" note: rebase of 6:eea13746799a created no changes to commit saved backup bundle to $TESTTMP/a3/.hg/strip-backup/9520eea781bc-fcd8edd4-rebase.hg $ f E.orig E.orig: file not found $ hg tglog o 6: 9f8b8ec77260 'E' | @ 5: 02de42196ebe 'H' | o 4: 24b6387c8c8c 'F' | | o 3: 32af7686d403 'D' | | | o 2: 5fddd98957c8 'C' | | | o 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' $ cd .. F onto E - rebase of a branching point (skip G): $ hg clone -q -u . a a4 $ cd a4 $ hg rebase -s 5 -d 4 rebasing 5:24b6387c8c8c "F" rebasing 6:eea13746799a "G" note: rebase of 6:eea13746799a created no changes to commit rebasing 7:02de42196ebe "H" (tip) saved backup bundle to $TESTTMP/a4/.hg/strip-backup/24b6387c8c8c-c3fe765d-rebase.hg $ hg tglog @ 6: e9240aeaa6ad 'H' | o 5: 5d0ccadb6e3e 'F' | o 4: 9520eea781bc 'E' | | o 3: 32af7686d403 'D' | | | o 2: 5fddd98957c8 'C' | | | o 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' $ cd .. G onto H - merged revision having a parent in ancestors of target: $ hg clone -q -u . a a5 $ cd a5 $ hg rebase -s 6 -d 7 rebasing 6:eea13746799a "G" saved backup bundle to $TESTTMP/a5/.hg/strip-backup/eea13746799a-883828ed-rebase.hg $ hg tglog o 7: 397834907a90 'G' |\ | @ 6: 02de42196ebe 'H' | | | o 5: 24b6387c8c8c 'F' | | o | 4: 9520eea781bc 'E' |/ | o 3: 32af7686d403 'D' | | | o 2: 5fddd98957c8 'C' | | | o 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' $ cd .. F onto B - G maintains E as parent: $ hg clone -q -u . a a6 $ cd a6 $ hg rebase -s 5 -d 1 rebasing 5:24b6387c8c8c "F" rebasing 6:eea13746799a "G" rebasing 7:02de42196ebe "H" (tip) saved backup bundle to $TESTTMP/a6/.hg/strip-backup/24b6387c8c8c-c3fe765d-rebase.hg $ hg tglog @ 7: c87be72f9641 'H' | | o 6: 17badd73d4f1 'G' |/| o | 5: 74fb9ed646c4 'F' | | | o 4: 9520eea781bc 'E' | | | | o 3: 32af7686d403 'D' | | | +---o 2: 5fddd98957c8 'C' | | o | 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' $ cd .. These will fail (using --source): G onto F - rebase onto an ancestor: $ hg clone -q -u . a a7 $ cd a7 $ hg rebase -s 6 -d 5 nothing to rebase [1] F onto G - rebase onto a descendant: $ hg rebase -s 5 -d 6 abort: source and destination form a cycle [255] G onto B - merge revision with both parents not in ancestors of target: $ hg rebase -s 6 -d 1 rebasing 6:eea13746799a "G" abort: cannot rebase 6:eea13746799a without moving at least one of its parents [255] $ hg rebase --abort rebase aborted These will abort gracefully (using --base): G onto G - rebase onto same changeset: $ hg rebase -b 6 -d 6 nothing to rebase - eea13746799a is both "base" and destination [1] G onto F - rebase onto an ancestor: $ hg rebase -b 6 -d 5 nothing to rebase [1] F onto G - rebase onto a descendant: $ hg rebase -b 5 -d 6 nothing to rebase - "base" 24b6387c8c8c is already an ancestor of destination eea13746799a [1] C onto A - rebase onto an ancestor: $ hg rebase -d 0 -s 2 rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-f9244fa1-rebase.hg $ hg tglog o 7: c9659aac0000 'D' | o 6: e1c4361dd923 'C' | | @ 5: 02de42196ebe 'H' | | | | o 4: eea13746799a 'G' | |/| | o | 3: 24b6387c8c8c 'F' |/ / | o 2: 9520eea781bc 'E' |/ | o 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' Check rebasing public changeset $ hg pull --config phases.publish=True -q -r 6 . # update phase of 6 $ hg rebase -d 0 -b 6 nothing to rebase [1] $ hg rebase -d 5 -b 6 abort: can't rebase public changeset e1c4361dd923 (see 'hg help phases' for details) [255] $ hg rebase -d 5 -r '1 + (6::)' abort: can't rebase public changeset e1c4361dd923 (see 'hg help phases' for details) [255] $ hg rebase -d 5 -b 6 --keep rebasing 6:e1c4361dd923 "C" rebasing 7:c9659aac0000 "D" (tip) Check rebasing mutable changeset Source phase greater or equal to destination phase: new changeset get the phase of source: $ hg id -n 5 $ hg rebase -s9 -d0 rebasing 9:2b23e52411f4 "D" (tip) saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2b23e52411f4-f942decf-rebase.hg $ hg id -n # check we updated back to parent 5 $ hg log --template "{phase}\n" -r 9 draft $ hg rebase -s9 -d1 rebasing 9:2cb10d0cfc6c "D" (tip) saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2cb10d0cfc6c-ddb0f256-rebase.hg $ hg log --template "{phase}\n" -r 9 draft $ hg phase --force --secret 9 $ hg rebase -s9 -d0 rebasing 9:c5b12b67163a "D" (tip) saved backup bundle to $TESTTMP/a7/.hg/strip-backup/c5b12b67163a-4e372053-rebase.hg $ hg log --template "{phase}\n" -r 9 secret $ hg rebase -s9 -d1 rebasing 9:2a0524f868ac "D" (tip) saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2a0524f868ac-cefd8574-rebase.hg $ hg log --template "{phase}\n" -r 9 secret Source phase lower than destination phase: new changeset get the phase of destination: $ hg rebase -s8 -d9 rebasing 8:6d4f22462821 "C" saved backup bundle to $TESTTMP/a7/.hg/strip-backup/6d4f22462821-3441f70b-rebase.hg $ hg log --template "{phase}\n" -r 'rev(9)' secret $ cd .. Check that temporary bundle doesn't lose phase when not using generaldelta $ hg --config format.usegeneraldelta=no init issue5678 $ cd issue5678 $ grep generaldelta .hg/requires [1] $ echo a > a $ hg ci -Aqm a $ echo b > b $ hg ci -Aqm b $ hg co -q '.^' $ echo c > c $ hg ci -Aqm c $ hg phase --public $ hg log -G -T '{rev}:{node|shortest} {phase} {desc}\n' @ 2:d36c public c | | o 1:d2ae draft b |/ o 0:cb9a public a $ hg rebase -s 1 -d 2 rebasing 1:d2ae7f538514 "b" saved backup bundle to $TESTTMP/issue5678/.hg/strip-backup/d2ae7f538514-2953539b-rebase.hg $ hg log -G -T '{rev}:{node|shortest} {phase} {desc}\n' o 2:c882 draft b | @ 1:d36c public c | o 0:cb9a public a $ cd .. Test for revset We need a bit different graph All destination are B $ hg init ah $ cd ah $ hg unbundle "$TESTDIR/bundles/rebase-revset.hg" adding changesets adding manifests adding file changes added 9 changesets with 9 changes to 9 files (+2 heads) new changesets 9ae2ed22e576:479ddb54a924 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg tglog o 8: 479ddb54a924 'I' | o 7: 72434a4e60b0 'H' | o 6: 3d8a618087a7 'G' | | o 5: 41bfcc75ed73 'F' | | | o 4: c01897464e7f 'E' |/ o 3: ffd453c31098 'D' | o 2: c9e50f6cdc55 'C' | | o 1: 8fd0f7e49f53 'B' |/ o 0: 9ae2ed22e576 'A' $ cd .. Simple case with keep: Source on have two descendant heads but ask for one $ hg clone -q -u . ah ah1 $ cd ah1 $ hg rebase -r '2::8' -d 1 abort: can't remove original changesets with unrebased descendants (use --keep to keep original changesets) [255] $ hg rebase -r '2::8' -d 1 -k rebasing 2:c9e50f6cdc55 "C" rebasing 3:ffd453c31098 "D" rebasing 6:3d8a618087a7 "G" rebasing 7:72434a4e60b0 "H" rebasing 8:479ddb54a924 "I" (tip) $ hg tglog o 13: 9bf1d9358a90 'I' | o 12: 274623a778d4 'H' | o 11: ab8c8617c8e8 'G' | o 10: c8cbf59f70da 'D' | o 9: 563e4faab485 'C' | | o 8: 479ddb54a924 'I' | | | o 7: 72434a4e60b0 'H' | | | o 6: 3d8a618087a7 'G' | | | | o 5: 41bfcc75ed73 'F' | | | | | o 4: c01897464e7f 'E' | |/ | o 3: ffd453c31098 'D' | | | o 2: c9e50f6cdc55 'C' | | o | 1: 8fd0f7e49f53 'B' |/ o 0: 9ae2ed22e576 'A' $ cd .. Base on have one descendant heads we ask for but common ancestor have two $ hg clone -q -u . ah ah2 $ cd ah2 $ hg rebase -r '3::8' -d 1 abort: can't remove original changesets with unrebased descendants (use --keep to keep original changesets) [255] $ hg rebase -r '3::8' -d 1 --keep rebasing 3:ffd453c31098 "D" rebasing 6:3d8a618087a7 "G" rebasing 7:72434a4e60b0 "H" rebasing 8:479ddb54a924 "I" (tip) $ hg tglog o 12: 9d7da0053b1c 'I' | o 11: 8fbd00952cbc 'H' | o 10: 51d434a615ee 'G' | o 9: a9c125634b0b 'D' | | o 8: 479ddb54a924 'I' | | | o 7: 72434a4e60b0 'H' | | | o 6: 3d8a618087a7 'G' | | | | o 5: 41bfcc75ed73 'F' | | | | | o 4: c01897464e7f 'E' | |/ | o 3: ffd453c31098 'D' | | | o 2: c9e50f6cdc55 'C' | | o | 1: 8fd0f7e49f53 'B' |/ o 0: 9ae2ed22e576 'A' $ cd .. rebase subset $ hg clone -q -u . ah ah3 $ cd ah3 $ hg rebase -r '3::7' -d 1 abort: can't remove original changesets with unrebased descendants (use --keep to keep original changesets) [255] $ hg rebase -r '3::7' -d 1 --keep rebasing 3:ffd453c31098 "D" rebasing 6:3d8a618087a7 "G" rebasing 7:72434a4e60b0 "H" $ hg tglog o 11: 8fbd00952cbc 'H' | o 10: 51d434a615ee 'G' | o 9: a9c125634b0b 'D' | | o 8: 479ddb54a924 'I' | | | o 7: 72434a4e60b0 'H' | | | o 6: 3d8a618087a7 'G' | | | | o 5: 41bfcc75ed73 'F' | | | | | o 4: c01897464e7f 'E' | |/ | o 3: ffd453c31098 'D' | | | o 2: c9e50f6cdc55 'C' | | o | 1: 8fd0f7e49f53 'B' |/ o 0: 9ae2ed22e576 'A' $ cd .. rebase subset with multiple head $ hg clone -q -u . ah ah4 $ cd ah4 $ hg rebase -r '3::(7+5)' -d 1 abort: can't remove original changesets with unrebased descendants (use --keep to keep original changesets) [255] $ hg rebase -r '3::(7+5)' -d 1 --keep rebasing 3:ffd453c31098 "D" rebasing 4:c01897464e7f "E" rebasing 5:41bfcc75ed73 "F" rebasing 6:3d8a618087a7 "G" rebasing 7:72434a4e60b0 "H" $ hg tglog o 13: 8fbd00952cbc 'H' | o 12: 51d434a615ee 'G' | | o 11: df23d8bda0b7 'F' | | | o 10: 47b7889448ff 'E' |/ o 9: a9c125634b0b 'D' | | o 8: 479ddb54a924 'I' | | | o 7: 72434a4e60b0 'H' | | | o 6: 3d8a618087a7 'G' | | | | o 5: 41bfcc75ed73 'F' | | | | | o 4: c01897464e7f 'E' | |/ | o 3: ffd453c31098 'D' | | | o 2: c9e50f6cdc55 'C' | | o | 1: 8fd0f7e49f53 'B' |/ o 0: 9ae2ed22e576 'A' $ cd .. More advanced tests rebase on ancestor with revset $ hg clone -q -u . ah ah5 $ cd ah5 $ hg rebase -r '6::' -d 2 rebasing 6:3d8a618087a7 "G" rebasing 7:72434a4e60b0 "H" rebasing 8:479ddb54a924 "I" (tip) saved backup bundle to $TESTTMP/ah5/.hg/strip-backup/3d8a618087a7-b4f73f31-rebase.hg $ hg tglog o 8: fcb52e68a694 'I' | o 7: 77bd65cd7600 'H' | o 6: 12d0e738fb18 'G' | | o 5: 41bfcc75ed73 'F' | | | o 4: c01897464e7f 'E' | | | o 3: ffd453c31098 'D' |/ o 2: c9e50f6cdc55 'C' | | o 1: 8fd0f7e49f53 'B' |/ o 0: 9ae2ed22e576 'A' $ cd .. rebase with multiple root. We rebase E and G on B We would expect heads are I, F if it was supported $ hg clone -q -u . ah ah6 $ cd ah6 $ hg rebase -r '(4+6)::' -d 1 rebasing 4:c01897464e7f "E" rebasing 5:41bfcc75ed73 "F" rebasing 6:3d8a618087a7 "G" rebasing 7:72434a4e60b0 "H" rebasing 8:479ddb54a924 "I" (tip) saved backup bundle to $TESTTMP/ah6/.hg/strip-backup/3d8a618087a7-aae93a24-rebase.hg $ hg tglog o 8: 9136df9a87cf 'I' | o 7: 23e8f30da832 'H' | o 6: b0efe8534e8b 'G' | | o 5: 6eb5b496ab79 'F' | | | o 4: d15eade9b0b1 'E' |/ | o 3: ffd453c31098 'D' | | | o 2: c9e50f6cdc55 'C' | | o | 1: 8fd0f7e49f53 'B' |/ o 0: 9ae2ed22e576 'A' $ cd .. More complex rebase with multiple roots each root have a different common ancestor with the destination and this is a detach (setup) $ hg clone -q -u . a a8 $ cd a8 $ echo I > I $ hg add I $ hg commit -m I $ hg up 4 1 files updated, 0 files merged, 3 files removed, 0 files unresolved $ echo I > J $ hg add J $ hg commit -m J created new head $ echo I > K $ hg add K $ hg commit -m K $ hg tglog @ 10: 23a4ace37988 'K' | o 9: 1301922eeb0c 'J' | | o 8: e7ec4e813ba6 'I' | | | o 7: 02de42196ebe 'H' | | +---o 6: eea13746799a 'G' | |/ | o 5: 24b6387c8c8c 'F' | | o | 4: 9520eea781bc 'E' |/ | o 3: 32af7686d403 'D' | | | o 2: 5fddd98957c8 'C' | | | o 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' (actual test) $ hg rebase --dest 'desc(G)' --rev 'desc(K) + desc(I)' rebasing 8:e7ec4e813ba6 "I" rebasing 10:23a4ace37988 "K" (tip) saved backup bundle to $TESTTMP/a8/.hg/strip-backup/23a4ace37988-b06984b3-rebase.hg $ hg log --rev 'children(desc(G))' changeset: 9:adb617877056 parent: 6:eea13746799a user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: I changeset: 10:882431a34a0e tag: tip parent: 6:eea13746799a user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: K $ hg tglog @ 10: 882431a34a0e 'K' | | o 9: adb617877056 'I' |/ | o 8: 1301922eeb0c 'J' | | | | o 7: 02de42196ebe 'H' | | | o---+ 6: eea13746799a 'G' |/ / | o 5: 24b6387c8c8c 'F' | | o | 4: 9520eea781bc 'E' |/ | o 3: 32af7686d403 'D' | | | o 2: 5fddd98957c8 'C' | | | o 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' Test that rebase is not confused by $CWD disappearing during rebase (issue4121) $ cd .. $ hg init cwd-vanish $ cd cwd-vanish $ touch initial-file $ hg add initial-file $ hg commit -m 'initial commit' $ touch dest-file $ hg add dest-file $ hg commit -m 'dest commit' $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ touch other-file $ hg add other-file $ hg commit -m 'first source commit' created new head $ mkdir subdir $ cd subdir $ touch subfile $ hg add subfile $ hg commit -m 'second source with subdir' $ hg rebase -b . -d 1 --traceback rebasing 2:779a07b1b7a0 "first source commit" current directory was removed (rmcwd !) (consider changing to repo root: $TESTTMP/cwd-vanish) (rmcwd !) rebasing 3:a7d6f3a00bf3 "second source with subdir" (tip) saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-853e0073-rebase.hg Get back to the root of cwd-vanish. Note that even though `cd ..` works on most systems, it does not work on FreeBSD 10, so we use an absolute path to get back to the repository. $ cd $TESTTMP Test that rebase is done in topo order (issue5370) $ hg init order $ cd order $ touch a && hg add a && hg ci -m A $ touch b && hg add b && hg ci -m B $ touch c && hg add c && hg ci -m C $ hg up 1 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ touch d && hg add d && hg ci -m D created new head $ hg up 2 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ touch e && hg add e && hg ci -m E $ hg up 3 1 files updated, 0 files merged, 2 files removed, 0 files unresolved $ touch f && hg add f && hg ci -m F $ hg up 0 0 files updated, 0 files merged, 3 files removed, 0 files unresolved $ touch g && hg add g && hg ci -m G created new head $ hg tglog @ 6: 124bb27b6f28 'G' | | o 5: 412b391de760 'F' | | | | o 4: 82ae8dc7a9b7 'E' | | | | o | 3: ab709c9f7171 'D' | | | | | o 2: d84f5cfaaf14 'C' | |/ | o 1: 76035bbd54bd 'B' |/ o 0: 216878401574 'A' $ hg rebase -s 1 -d 6 rebasing 1:76035bbd54bd "B" rebasing 2:d84f5cfaaf14 "C" rebasing 4:82ae8dc7a9b7 "E" rebasing 3:ab709c9f7171 "D" rebasing 5:412b391de760 "F" saved backup bundle to $TESTTMP/order/.hg/strip-backup/76035bbd54bd-e341bc99-rebase.hg $ hg tglog o 6: 31884cfb735e 'F' | o 5: 6d89fa5b0909 'D' | | o 4: de64d97c697b 'E' | | | o 3: b18e4d2d0aa1 'C' |/ o 2: 0983daf9ff6a 'B' | @ 1: 124bb27b6f28 'G' | o 0: 216878401574 'A' Test experimental revset ======================== $ cd ../cwd-vanish Make the repo a bit more interesting $ hg up 1 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo aaa > aaa $ hg add aaa $ hg commit -m aaa created new head $ hg log -G @ changeset: 4:5f7bc9025ed2 | tag: tip | parent: 1:58d79cc1cf43 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: aaa | | o changeset: 3:1910d5ff34ea | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | summary: second source with subdir | | | o changeset: 2:82901330b6ef |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: first source commit | o changeset: 1:58d79cc1cf43 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: dest commit | o changeset: 0:e94b687f7da3 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: initial commit Testing from lower head $ hg up 3 2 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg log -r '_destrebase()' changeset: 4:5f7bc9025ed2 tag: tip parent: 1:58d79cc1cf43 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: aaa Testing from upper head $ hg log -r '_destrebase(4)' changeset: 3:1910d5ff34ea user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: second source with subdir $ hg up 4 1 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg log -r '_destrebase()' changeset: 3:1910d5ff34ea user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: second source with subdir Testing rebase being called inside another transaction $ cd $TESTTMP $ hg init tr-state $ cd tr-state $ cat > $TESTTMP/wraprebase.py < from __future__ import absolute_import > from mercurial import extensions > def _rebase(orig, ui, repo, *args, **kwargs): > with repo.wlock(): > with repo.lock(): > with repo.transaction('wrappedrebase'): > return orig(ui, repo, *args, **kwargs) > def wraprebase(loaded): > assert loaded > rebasemod = extensions.find('rebase') > extensions.wrapcommand(rebasemod.cmdtable, 'rebase', _rebase) > def extsetup(ui): > extensions.afterloaded('rebase', wraprebase) > EOF $ cat >> .hg/hgrc < [extensions] > wraprebase=$TESTTMP/wraprebase.py > [experimental] > evolution=true > EOF $ hg debugdrawdag <<'EOS' > B C > |/ > A > EOS $ hg rebase -s C -d B rebasing 2:dc0947a82db8 "C" (C tip) $ [ -f .hg/rebasestate ] && echo 'WRONG: rebasestate should not exist' [1] mercurial-4.5.3/tests/test-convert-cvsnt-mergepoints.t0000644015407300116100000001005113261161234023043 0ustar augieeng00000000000000#require cvs $ filterpath() > { > eval "$@" | sed "s:$CVSROOT:*REPO*:g" > } $ cvscall() > { > cvs -f "$@" > } output of 'cvs ci' varies unpredictably, so discard most of it -- just keep the part that matters $ cvsci() > { > cvs -f ci -f "$@" > /dev/null > } $ hgcat() > { > hg --cwd src-hg cat -r tip "$1" > } $ echo "[extensions]" >> $HGRCPATH $ echo "convert = " >> $HGRCPATH create cvs repository $ mkdir cvsmaster $ cd cvsmaster $ CVSROOT=`pwd` $ export CVSROOT $ CVS_OPTIONS=-f $ export CVS_OPTIONS $ cd .. $ rmdir cvsmaster $ filterpath cvscall -Q -d "$CVSROOT" init checkout #1: add foo.txt $ cvscall -Q checkout -d cvsworktmp . $ cd cvsworktmp $ mkdir foo $ cvscall -Q add foo $ cd foo $ echo foo > foo.txt $ cvscall -Q add foo.txt $ cvsci -m "add foo.txt" foo.txt $ cd ../.. $ rm -rf cvsworktmp checkout #2: create MYBRANCH1 and modify foo.txt on it $ cvscall -Q checkout -d cvswork foo $ cd cvswork $ cvscall -q rtag -b -R MYBRANCH1 foo $ cvscall -Q update -P -r MYBRANCH1 $ echo bar > foo.txt $ cvsci -m "bar" foo.txt $ echo baz > foo.txt $ cvsci -m "baz" foo.txt create MYBRANCH1_2 and modify foo.txt some more $ cvscall -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo $ cvscall -Q update -P -r MYBRANCH1_2 $ echo bazzie > foo.txt $ cvsci -m "bazzie" foo.txt create MYBRANCH1_1 and modify foo.txt yet again $ cvscall -q rtag -b -R MYBRANCH1_1 foo $ cvscall -Q update -P -r MYBRANCH1_1 $ echo quux > foo.txt $ cvsci -m "quux" foo.txt merge MYBRANCH1 to MYBRANCH1_1 $ filterpath cvscall -Q update -P -jMYBRANCH1 rcsmerge: warning: conflicts during merge RCS file: *REPO*/foo/foo.txt,v retrieving revision 1.1 retrieving revision 1.1.2.2 Merging differences between 1.1 and 1.1.2.2 into foo.txt carefully placed sleep to dodge cvs bug (optimization?) where it sometimes ignores a "commit" command if it comes too fast (the -f option in cvsci seems to work for all the other commits in this script) $ sleep 1 $ echo xyzzy > foo.txt $ cvsci -m "merge1+clobber" foo.txt #if unix-permissions return to trunk and merge MYBRANCH1_2 $ cvscall -Q update -P -A $ filterpath cvscall -Q update -P -jMYBRANCH1_2 RCS file: *REPO*/foo/foo.txt,v retrieving revision 1.1 retrieving revision 1.1.2.2.2.1 Merging differences between 1.1 and 1.1.2.2.2.1 into foo.txt $ cvsci -m "merge2" foo.txt $ REALCVS=`which cvs` $ echo "for x in \$*; do if [ \"\$x\" = \"rlog\" ]; then echo \"RCS file: $CVSROOT/foo/foo.txt,v\"; cat \"$TESTDIR/test-convert-cvsnt-mergepoints.rlog\"; exit 0; fi; done; $REALCVS \$*" > ../cvs $ chmod +x ../cvs $ PATH=..:${PATH} hg debugcvsps --parents foo collecting CVS rlog 7 log entries creating changesets 7 changeset entries --------------------- PatchSet 1 Date: * (glob) Author: user Branch: HEAD Tag: (none) Branchpoints: MYBRANCH1, MYBRANCH1_1 Log: foo.txt Members: foo.txt:INITIAL->1.1 --------------------- PatchSet 2 Date: * (glob) Author: user Branch: MYBRANCH1 Tag: (none) Parent: 1 Log: bar Members: foo.txt:1.1->1.1.2.1 --------------------- PatchSet 3 Date: * (glob) Author: user Branch: MYBRANCH1 Tag: (none) Branchpoints: MYBRANCH1_2 Parent: 2 Log: baz Members: foo.txt:1.1.2.1->1.1.2.2 --------------------- PatchSet 4 Date: * (glob) Author: user Branch: MYBRANCH1_1 Tag: (none) Parent: 1 Log: quux Members: foo.txt:1.1->1.1.4.1 --------------------- PatchSet 5 Date: * (glob) Author: user Branch: MYBRANCH1_2 Tag: (none) Parent: 3 Log: bazzie Members: foo.txt:1.1.2.2->1.1.2.2.2.1 --------------------- PatchSet 6 Date: * (glob) Author: user Branch: HEAD Tag: (none) Parents: 1,5 Log: merge Members: foo.txt:1.1->1.2 --------------------- PatchSet 7 Date: * (glob) Author: user Branch: MYBRANCH1_1 Tag: (none) Parents: 4,3 Log: merge Members: foo.txt:1.1.4.1->1.1.4.2 #endif $ cd .. mercurial-4.5.3/tests/test-exchange-obsmarkers-case-B3.t0000644015407300116100000000555013261161234023011 0ustar augieeng00000000000000============================================ Testing obsolescence markers push: Cases B.3 ============================================ Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of all changesets that requested to be "in sync" after the push (even if they are already on both side). This test belongs to a series of tests checking such set is properly computed and applied. This does not tests "obsmarkers" discovery capabilities. Category B: pruning case TestCase 3: Pruned changeset on non-pushed part of the history B.3 Pruned changeset on non-pushed part of the history ====================================================== .. {{{ .. ⊗ C .. | .. ○ B .. | ◔ A .. |/ .. ◠O .. }}} .. .. Marker exists from: .. .. * C (prune) .. .. Commands run: .. .. * hg push -r A .. .. Expected exchange: .. .. * ø .. .. Expected exclude: .. .. * chain from B Setup ----- $ . $TESTDIR/testlib/exchange-obsmarker-util.sh initial $ setuprepos B.3 creating test repo for test case B.3 - pulldest - main - pushdest cd into `main` and proceed with env setup $ cd main $ mkcommit A $ hg up --quiet 0 $ mkcommit B created new head $ mkcommit C $ hg prune -qd '0 0' . $ hg log -G --hidden x e56289ab6378 (draft): C | @ 35b183996678 (draft): B | | o f5bc6836db60 (draft): A |/ o a9bdc8b26820 (public): O $ inspect_obsmarkers obsstore content ================ e56289ab6378dc752fd7965f8bf66b58bda740bd 0 {35b1839966785d5703a01607229eea932db42f87} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ cd .. $ cd .. Actual Test ----------------------------------- $ dotest B.3 A ## Running testcase B.3 # testing echange of "A" (f5bc6836db60) ## initial state # obstore: main e56289ab6378dc752fd7965f8bf66b58bda740bd 0 {35b1839966785d5703a01607229eea932db42f87} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest ## pushing "A" from main to pushdest pushing to pushdest searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files ## post push state # obstore: main e56289ab6378dc752fd7965f8bf66b58bda740bd 0 {35b1839966785d5703a01607229eea932db42f87} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest ## pulling "f5bc6836db60" from main into pulldest pulling from main searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets f5bc6836db60 (run 'hg update' to get a working copy) ## post pull state # obstore: main e56289ab6378dc752fd7965f8bf66b58bda740bd 0 {35b1839966785d5703a01607229eea932db42f87} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest mercurial-4.5.3/tests/test-rename-merge2.t0000644015407300116100000011221613261161234020332 0ustar augieeng00000000000000 $ mkdir -p t $ cd t $ cat < merge > import sys, os > f = open(sys.argv[1], "wb") > f.write("merge %s %s %s" % (sys.argv[1], sys.argv[2], sys.argv[3])) > f.close() > EOF perform a test merge with possible renaming args: $1 = action in local branch $2 = action in remote branch $3 = action in working dir $4 = expected result $ tm() > { > hg init t > cd t > echo "[merge]" >> .hg/hgrc > echo "followcopies = 1" >> .hg/hgrc > > # base > echo base > a > echo base > rev # used to force commits > hg add a rev > hg ci -m "base" > > # remote > echo remote > rev > if [ "$2" != "" ] ; then $2 ; fi > hg ci -m "remote" > > # local > hg co -q 0 > echo local > rev > if [ "$1" != "" ] ; then $1 ; fi > hg ci -m "local" > > # working dir > echo local > rev > if [ "$3" != "" ] ; then $3 ; fi > > # merge > echo "--------------" > echo "test L:$1 R:$2 W:$3 - $4" > echo "--------------" > hg merge -y --debug --traceback --tool="$PYTHON ../merge" > > echo "--------------" > hg status -camC -X rev > > hg ci -m "merge" > > echo "--------------" > echo > > cd .. > rm -r t > } $ up() { > cp rev $1 > hg add $1 2> /dev/null > if [ "$2" != "" ] ; then > cp rev $2 > hg add $2 2> /dev/null > fi > } $ uc() { up $1; hg cp $1 $2; } # update + copy $ um() { up $1; hg mv $1 $2; } $ nc() { hg cp $1 $2; } # just copy $ nm() { hg mv $1 $2; } # just move $ tm "up a " "nc a b" " " "1 get local a to b" created new head -------------- test L:up a R:nc a b W: - 1 get local a to b -------------- searching for copies back to rev 1 unmatched files in other: b all copies found (* = to merge, ! = divergent, % = renamed and deleted): src: 'a' -> dst: 'b' * checking for directory renames resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: e300d1c794ec+, remote: 4ce40f5aca24 preserving a for resolve of b preserving rev for resolve of rev starting 4 threads for background file closing (?) b: remote copied from a -> m (premerge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) merging a and b to b my b@e300d1c794ec+ other b@4ce40f5aca24 ancestor a@924404dff337 premerge successful rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@e300d1c794ec+ other rev@4ce40f5aca24 ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 0 files updated, 2 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- M b a C a -------------- $ tm "nc a b" "up a " " " "2 get rem change to a and b" created new head -------------- test L:nc a b R:up a W: - 2 get rem change to a and b -------------- searching for copies back to rev 1 unmatched files in local: b all copies found (* = to merge, ! = divergent, % = renamed and deleted): src: 'a' -> dst: 'b' * checking for directory renames resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 86a2aa42fc76+, remote: f4db7e329e71 preserving b for resolve of b preserving rev for resolve of rev a: remote is newer -> g getting a b: local copied/moved from a -> m (premerge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) merging b and a to b my b@86a2aa42fc76+ other a@f4db7e329e71 ancestor a@924404dff337 premerge successful rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@86a2aa42fc76+ other rev@f4db7e329e71 ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 1 files updated, 2 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- M a M b a -------------- $ tm "up a " "nm a b" " " "3 get local a change to b, remove a" created new head -------------- test L:up a R:nm a b W: - 3 get local a change to b, remove a -------------- searching for copies back to rev 1 unmatched files in other: b all copies found (* = to merge, ! = divergent, % = renamed and deleted): src: 'a' -> dst: 'b' * checking for directory renames resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: e300d1c794ec+, remote: bdb19105162a preserving a for resolve of b preserving rev for resolve of rev removing a starting 4 threads for background file closing (?) b: remote moved from a -> m (premerge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) merging a and b to b my b@e300d1c794ec+ other b@bdb19105162a ancestor a@924404dff337 premerge successful rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@e300d1c794ec+ other rev@bdb19105162a ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 0 files updated, 2 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- M b a -------------- $ tm "nm a b" "up a " " " "4 get remote change to b" created new head -------------- test L:nm a b R:up a W: - 4 get remote change to b -------------- searching for copies back to rev 1 unmatched files in local: b all copies found (* = to merge, ! = divergent, % = renamed and deleted): src: 'a' -> dst: 'b' * checking for directory renames resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 02963e448370+, remote: f4db7e329e71 preserving b for resolve of b preserving rev for resolve of rev starting 4 threads for background file closing (?) b: local copied/moved from a -> m (premerge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) merging b and a to b my b@02963e448370+ other a@f4db7e329e71 ancestor a@924404dff337 premerge successful rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@02963e448370+ other rev@f4db7e329e71 ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 0 files updated, 2 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- M b a -------------- $ tm " " "nc a b" " " "5 get b" created new head -------------- test L: R:nc a b W: - 5 get b -------------- searching for copies back to rev 1 unmatched files in other: b all copies found (* = to merge, ! = divergent, % = renamed and deleted): src: 'a' -> dst: 'b' checking for directory renames resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: 4ce40f5aca24 preserving rev for resolve of rev b: remote created -> g getting b rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@94b33a1b7f2d+ other rev@4ce40f5aca24 ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 1 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- M b C a -------------- $ tm "nc a b" " " " " "6 nothing" created new head -------------- test L:nc a b R: W: - 6 nothing -------------- searching for copies back to rev 1 unmatched files in local: b all copies found (* = to merge, ! = divergent, % = renamed and deleted): src: 'a' -> dst: 'b' checking for directory renames resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 97c705ade336 preserving rev for resolve of rev starting 4 threads for background file closing (?) rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@86a2aa42fc76+ other rev@97c705ade336 ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- C a C b -------------- $ tm " " "nm a b" " " "7 get b" created new head -------------- test L: R:nm a b W: - 7 get b -------------- searching for copies back to rev 1 unmatched files in other: b all copies found (* = to merge, ! = divergent, % = renamed and deleted): src: 'a' -> dst: 'b' checking for directory renames resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 94b33a1b7f2d+, remote: bdb19105162a preserving rev for resolve of rev a: other deleted -> r removing a b: remote created -> g getting b rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@94b33a1b7f2d+ other rev@bdb19105162a ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 1 files updated, 1 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- M b -------------- $ tm "nm a b" " " " " "8 nothing" created new head -------------- test L:nm a b R: W: - 8 nothing -------------- searching for copies back to rev 1 unmatched files in local: b all copies found (* = to merge, ! = divergent, % = renamed and deleted): src: 'a' -> dst: 'b' checking for directory renames resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 02963e448370+, remote: 97c705ade336 preserving rev for resolve of rev starting 4 threads for background file closing (?) rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@02963e448370+ other rev@97c705ade336 ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- C b -------------- $ tm "um a b" "um a b" " " "9 do merge with ancestor in a" created new head -------------- test L:um a b R:um a b W: - 9 do merge with ancestor in a -------------- searching for copies back to rev 1 unmatched files new in both: b resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 62e7bf090eba+, remote: 49b6d8032493 preserving b for resolve of b preserving rev for resolve of rev starting 4 threads for background file closing (?) b: both renamed from a -> m (premerge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) merging b my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337 rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337 b: both renamed from a -> m (merge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) my b@62e7bf090eba+ other b@49b6d8032493 ancestor a@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob) merge tool returned: 0 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@62e7bf090eba+ other rev@49b6d8032493 ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 0 files updated, 2 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- M b -------------- m "um a c" "um x c" " " "10 do merge with no ancestor" $ tm "nm a b" "nm a c" " " "11 get c, keep b" created new head -------------- test L:nm a b R:nm a c W: - 11 get c, keep b -------------- searching for copies back to rev 1 unmatched files in local: b unmatched files in other: c all copies found (* = to merge, ! = divergent, % = renamed and deleted): src: 'a' -> dst: 'b' ! src: 'a' -> dst: 'c' ! checking for directory renames resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 02963e448370+, remote: fe905ef2c33e note: possible conflict - a was renamed multiple times to: b c preserving rev for resolve of rev c: remote created -> g getting c rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@02963e448370+ other rev@fe905ef2c33e ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 1 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- M c C b -------------- $ tm "nc a b" "up b " " " "12 merge b no ancestor" created new head -------------- test L:nc a b R:up b W: - 12 merge b no ancestor -------------- searching for copies back to rev 1 unmatched files new in both: b resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 86a2aa42fc76+, remote: af30c7647fc7 preserving b for resolve of b preserving rev for resolve of rev starting 4 threads for background file closing (?) b: both created -> m (premerge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) merging b my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000 rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337 b: both created -> m (merge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) my b@86a2aa42fc76+ other b@af30c7647fc7 ancestor b@000000000000 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob) merge tool returned: 0 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@86a2aa42fc76+ other rev@af30c7647fc7 ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 0 files updated, 2 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- M b C a -------------- $ tm "up b " "nm a b" " " "13 merge b no ancestor" created new head -------------- test L:up b R:nm a b W: - 13 merge b no ancestor -------------- searching for copies back to rev 1 unmatched files new in both: b resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a preserving b for resolve of b preserving rev for resolve of rev a: other deleted -> r removing a starting 4 threads for background file closing (?) b: both created -> m (premerge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) merging b my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000 rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337 b: both created -> m (merge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob) merge tool returned: 0 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 0 files updated, 2 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- M b -------------- $ tm "nc a b" "up a b" " " "14 merge b no ancestor" created new head -------------- test L:nc a b R:up a b W: - 14 merge b no ancestor -------------- searching for copies back to rev 1 unmatched files new in both: b resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a preserving b for resolve of b preserving rev for resolve of rev a: remote is newer -> g getting a b: both created -> m (premerge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) merging b my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000 rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337 b: both created -> m (merge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob) merge tool returned: 0 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 1 files updated, 2 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- M a M b -------------- $ tm "up b " "nm a b" " " "15 merge b no ancestor, remove a" created new head -------------- test L:up b R:nm a b W: - 15 merge b no ancestor, remove a -------------- searching for copies back to rev 1 unmatched files new in both: b resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 59318016310c+, remote: bdb19105162a preserving b for resolve of b preserving rev for resolve of rev a: other deleted -> r removing a starting 4 threads for background file closing (?) b: both created -> m (premerge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) merging b my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000 rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337 b: both created -> m (merge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) my b@59318016310c+ other b@bdb19105162a ancestor b@000000000000 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob) merge tool returned: 0 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@59318016310c+ other rev@bdb19105162a ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 0 files updated, 2 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- M b -------------- $ tm "nc a b" "up a b" " " "16 get a, merge b no ancestor" created new head -------------- test L:nc a b R:up a b W: - 16 get a, merge b no ancestor -------------- searching for copies back to rev 1 unmatched files new in both: b resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 86a2aa42fc76+, remote: 8dbce441892a preserving b for resolve of b preserving rev for resolve of rev a: remote is newer -> g getting a b: both created -> m (premerge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) merging b my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000 rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337 b: both created -> m (merge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) my b@86a2aa42fc76+ other b@8dbce441892a ancestor b@000000000000 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob) merge tool returned: 0 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@86a2aa42fc76+ other rev@8dbce441892a ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 1 files updated, 2 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- M a M b -------------- $ tm "up a b" "nc a b" " " "17 keep a, merge b no ancestor" created new head -------------- test L:up a b R:nc a b W: - 17 keep a, merge b no ancestor -------------- searching for copies back to rev 1 unmatched files new in both: b resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 0b76e65c8289+, remote: 4ce40f5aca24 preserving b for resolve of b preserving rev for resolve of rev starting 4 threads for background file closing (?) b: both created -> m (premerge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) merging b my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000 rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337 b: both created -> m (merge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) my b@0b76e65c8289+ other b@4ce40f5aca24 ancestor b@000000000000 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob) merge tool returned: 0 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@0b76e65c8289+ other rev@4ce40f5aca24 ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 0 files updated, 2 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- M b C a -------------- $ tm "nm a b" "up a b" " " "18 merge b no ancestor" created new head -------------- test L:nm a b R:up a b W: - 18 merge b no ancestor -------------- searching for copies back to rev 1 unmatched files new in both: b resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 02963e448370+, remote: 8dbce441892a preserving b for resolve of b preserving rev for resolve of rev starting 4 threads for background file closing (?) a: prompt deleted/changed -> m (premerge) picked tool ':prompt' for a (binary False symlink False changedelete True) other [merge rev] changed a which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u b: both created -> m (premerge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) merging b my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000 rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337 b: both created -> m (merge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) my b@02963e448370+ other b@8dbce441892a ancestor b@000000000000 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob) merge tool returned: 0 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@02963e448370+ other rev@8dbce441892a ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 0 files updated, 2 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon -------------- M a M b abort: unresolved merge conflicts (see 'hg help resolve') -------------- $ tm "up a b" "nm a b" " " "19 merge b no ancestor, prompt remove a" created new head -------------- test L:up a b R:nm a b W: - 19 merge b no ancestor, prompt remove a -------------- searching for copies back to rev 1 unmatched files new in both: b resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 0b76e65c8289+, remote: bdb19105162a preserving a for resolve of a preserving b for resolve of b preserving rev for resolve of rev starting 4 threads for background file closing (?) a: prompt changed/deleted -> m (premerge) picked tool ':prompt' for a (binary False symlink False changedelete True) local [working copy] changed a which other [merge rev] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? u b: both created -> m (premerge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) merging b my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000 rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337 b: both created -> m (merge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) my b@0b76e65c8289+ other b@bdb19105162a ancestor b@000000000000 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob) merge tool returned: 0 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@0b76e65c8289+ other rev@bdb19105162a ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 0 files updated, 2 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon -------------- M b C a abort: unresolved merge conflicts (see 'hg help resolve') -------------- $ tm "up a " "um a b" " " "20 merge a and b to b, remove a" created new head -------------- test L:up a R:um a b W: - 20 merge a and b to b, remove a -------------- searching for copies back to rev 1 unmatched files in other: b all copies found (* = to merge, ! = divergent, % = renamed and deleted): src: 'a' -> dst: 'b' * checking for directory renames resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: e300d1c794ec+, remote: 49b6d8032493 preserving a for resolve of b preserving rev for resolve of rev removing a starting 4 threads for background file closing (?) b: remote moved from a -> m (premerge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) merging a and b to b my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337 rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337 b: remote moved from a -> m (merge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) my b@e300d1c794ec+ other b@49b6d8032493 ancestor a@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob) merge tool returned: 0 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@e300d1c794ec+ other rev@49b6d8032493 ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 0 files updated, 2 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- M b a -------------- $ tm "um a b" "up a " " " "21 merge a and b to b" created new head -------------- test L:um a b R:up a W: - 21 merge a and b to b -------------- searching for copies back to rev 1 unmatched files in local: b all copies found (* = to merge, ! = divergent, % = renamed and deleted): src: 'a' -> dst: 'b' * checking for directory renames resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 62e7bf090eba+, remote: f4db7e329e71 preserving b for resolve of b preserving rev for resolve of rev starting 4 threads for background file closing (?) b: local copied/moved from a -> m (premerge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) merging b and a to b my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337 rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337 b: local copied/moved from a -> m (merge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) my b@62e7bf090eba+ other a@f4db7e329e71 ancestor a@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/b* * * (glob) merge tool returned: 0 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@62e7bf090eba+ other rev@f4db7e329e71 ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 0 files updated, 2 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- M b a -------------- m "nm a b" "um x a" " " "22 get a, keep b" $ tm "nm a b" "up a c" " " "23 get c, keep b" created new head -------------- test L:nm a b R:up a c W: - 23 get c, keep b -------------- searching for copies back to rev 1 unmatched files in local: b unmatched files in other: c all copies found (* = to merge, ! = divergent, % = renamed and deleted): src: 'a' -> dst: 'b' * checking for directory renames resolving manifests branchmerge: True, force: False, partial: False ancestor: 924404dff337, local: 02963e448370+, remote: 2b958612230f preserving b for resolve of b preserving rev for resolve of rev c: remote created -> g getting c b: local copied/moved from a -> m (premerge) picked tool '* ../merge' for b (binary False symlink False changedelete False) (glob) merging b and a to b my b@02963e448370+ other a@2b958612230f ancestor a@924404dff337 premerge successful rev: versions differ -> m (premerge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) merging rev my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337 rev: versions differ -> m (merge) picked tool '* ../merge' for rev (binary False symlink False changedelete False) (glob) my rev@02963e448370+ other rev@2b958612230f ancestor rev@924404dff337 launching merge tool: * ../merge *$TESTTMP/t/t/rev* * * (glob) merge tool returned: 0 1 files updated, 2 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) -------------- M b a M c -------------- $ cd .. Systematic and terse testing of merge merges and ancestor calculation: Expected result: \ a m1 m2 dst 0 - f f f "versions differ" 1 f g g g "versions differ" 2 f f f f "versions differ" 3 f f g f+g "remote copied to " + f 4 f f g g "remote moved to " + f 5 f g f f+g "local copied to " + f2 6 f g f g "local moved to " + f2 7 - (f) f f "remote differs from untracked local" 8 f (f) f f "remote differs from untracked local" $ hg init ancestortest $ cd ancestortest $ for x in 1 2 3 4 5 6 8; do mkdir $x; echo a > $x/f; done $ hg ci -Aqm "a" $ mkdir 0 $ touch 0/f $ hg mv 1/f 1/g $ hg cp 5/f 5/g $ hg mv 6/f 6/g $ hg rm 8/f $ for x in */*; do echo m1 > $x; done $ hg ci -Aqm "m1" $ hg up -qr0 $ mkdir 0 7 $ touch 0/f 7/f $ hg mv 1/f 1/g $ hg cp 3/f 3/g $ hg mv 4/f 4/g $ for x in */*; do echo m2 > $x; done $ hg ci -Aqm "m2" $ hg up -qr1 $ mkdir 7 8 $ echo m > 7/f $ echo m > 8/f $ hg merge -f --tool internal:dump -v --debug -r2 | sed '/^resolving manifests/,$d' 2> /dev/null searching for copies back to rev 1 unmatched files in local: 5/g 6/g unmatched files in other: 3/g 4/g 7/f unmatched files new in both: 0/f 1/g all copies found (* = to merge, ! = divergent, % = renamed and deleted): src: '3/f' -> dst: '3/g' * src: '4/f' -> dst: '4/g' * src: '5/f' -> dst: '5/g' * src: '6/f' -> dst: '6/g' * checking for directory renames $ hg mani 0/f 1/g 2/f 3/f 4/f 5/f 5/g 6/g $ for f in */*; do echo $f:; cat $f; done 0/f: m1 0/f.base: 0/f.local: m1 0/f.orig: m1 0/f.other: m2 1/g: m1 1/g.base: a 1/g.local: m1 1/g.orig: m1 1/g.other: m2 2/f: m1 2/f.base: a 2/f.local: m1 2/f.orig: m1 2/f.other: m2 3/f: m1 3/f.base: a 3/f.local: m1 3/f.orig: m1 3/f.other: m2 3/g: m1 3/g.base: a 3/g.local: m1 3/g.orig: m1 3/g.other: m2 4/g: m1 4/g.base: a 4/g.local: m1 4/g.orig: m1 4/g.other: m2 5/f: m1 5/f.base: a 5/f.local: m1 5/f.orig: m1 5/f.other: m2 5/g: m1 5/g.base: a 5/g.local: m1 5/g.orig: m1 5/g.other: m2 6/g: m1 6/g.base: a 6/g.local: m1 6/g.orig: m1 6/g.other: m2 7/f: m 7/f.base: 7/f.local: m 7/f.orig: m 7/f.other: m2 8/f: m2 $ cd .. mercurial-4.5.3/tests/generate-working-copy-states.py0000644015407300116100000000636713261161234022646 0ustar augieeng00000000000000# Helper script used for generating history and working copy files and content. # The file's name corresponds to its history. The number of changesets can # be specified on the command line. With 2 changesets, files with names like # content1_content2_content1-untracked are generated. The first two filename # segments describe the contents in the two changesets. The third segment # ("content1-untracked") describes the state in the working copy, i.e. # the file has content "content1" and is untracked (since it was previously # tracked, it has been forgotten). # # This script generates the filenames and their content, but it's up to the # caller to tell hg about the state. # # There are two subcommands: # filelist # state (|wc) # # Typical usage: # # $ python $TESTDIR/generate-working-copy-states.py state 2 1 # $ hg addremove --similarity 0 # $ hg commit -m 'first' # # $ python $TESTDIR/generate-working-copy-states.py state 2 1 # $ hg addremove --similarity 0 # $ hg commit -m 'second' # # $ python $TESTDIR/generate-working-copy-states.py state 2 wc # $ hg addremove --similarity 0 # $ hg forget *_*_*-untracked # $ rm *_*_missing-* from __future__ import absolute_import, print_function import os import sys # Generates pairs of (filename, contents), where 'contents' is a list # describing the file's content at each revision (or in the working copy). # At each revision, it is either None or the file's actual content. When not # None, it may be either new content or the same content as an earlier # revisions, so all of (modified,clean,added,removed) can be tested. def generatestates(maxchangesets, parentcontents): depth = len(parentcontents) if depth == maxchangesets + 1: for tracked in ('untracked', 'tracked'): filename = "_".join([(content is None and 'missing' or content) for content in parentcontents]) + "-" + tracked yield (filename, parentcontents) else: for content in ({None, 'content' + str(depth + 1)} | set(parentcontents)): for combination in generatestates(maxchangesets, parentcontents + [content]): yield combination # retrieve the command line arguments target = sys.argv[1] maxchangesets = int(sys.argv[2]) if target == 'state': depth = sys.argv[3] # sort to make sure we have stable output combinations = sorted(generatestates(maxchangesets, [])) # compute file content content = [] for filename, states in combinations: if target == 'filelist': print(filename) elif target == 'state': if depth == 'wc': # Make sure there is content so the file gets written and can be # tracked. It will be deleted outside of this script. content.append((filename, states[maxchangesets] or 'TOBEDELETED')) else: content.append((filename, states[int(depth) - 1])) else: print("unknown target:", target, file=sys.stderr) sys.exit(1) # write actual content for filename, data in content: if data is not None: f = open(filename, 'wb') f.write(data + '\n') f.close() elif os.path.exists(filename): os.remove(filename) mercurial-4.5.3/tests/test-mq-qclone-http.t0000644015407300116100000001002213261161234020545 0ustar augieeng00000000000000#require killdaemons hide outer repo $ hg init $ echo "[extensions]" >> $HGRCPATH $ echo "mq=" >> $HGRCPATH $ mkdir webdir $ cd webdir $ hg init a $ hg --cwd a qinit -c $ echo a > a/a $ hg --cwd a ci -A -m a adding a $ echo b > a/b $ hg --cwd a addremove adding b $ hg --cwd a qnew -f b.patch $ hg --cwd a qcommit -m b.patch $ hg --cwd a log --template "{desc}\n" [mq]: b.patch a $ hg --cwd a/.hg/patches log --template "{desc}\n" b.patch $ root=`pwd` $ cd .. test with recursive collection $ cat > collections.conf < [paths] > /=$root/** > EOF $ hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf collections.conf \ > -A access-paths.log -E error-paths-1.log $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT '?style=raw' 200 Script output follows /a/ /a/.hg/patches/ $ hg qclone http://localhost:$HGPORT/a b requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files new changesets cb9a9f314b8b:184916345baa requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 3 changes to 3 files new changesets 4052ceaa8c4e updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg --cwd b log --template "{desc}\n" a $ hg --cwd b qpush -a applying b.patch now at: b.patch $ hg --cwd b log --template "{desc}\n" imported patch b.patch a test with normal collection $ cat > collections1.conf < [paths] > /=$root/* > EOF $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf collections1.conf \ > -A access-paths.log -E error-paths-1.log $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows /a/ /a/.hg/patches/ $ hg qclone http://localhost:$HGPORT1/a c requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files new changesets cb9a9f314b8b:184916345baa requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 3 changes to 3 files new changesets 4052ceaa8c4e updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg --cwd c log --template "{desc}\n" a $ hg --cwd c qpush -a applying b.patch now at: b.patch $ hg --cwd c log --template "{desc}\n" imported patch b.patch a test with old-style collection $ cat > collections2.conf < [collections] > $root=$root > EOF $ hg serve -p $HGPORT2 -d --pid-file=hg.pid --webdir-conf collections2.conf \ > -A access-paths.log -E error-paths-1.log $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT2 '?style=raw' 200 Script output follows /a/ /a/.hg/patches/ $ hg qclone http://localhost:$HGPORT2/a d requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files new changesets cb9a9f314b8b:184916345baa requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 3 changes to 3 files new changesets 4052ceaa8c4e updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg --cwd d log --template "{desc}\n" a $ hg --cwd d qpush -a applying b.patch now at: b.patch $ hg --cwd d log --template "{desc}\n" imported patch b.patch a test --mq works and uses correct repository config $ hg --cwd d outgoing --mq comparing with http://localhost:$HGPORT2/a/.hg/patches searching for changes no changes found [1] $ hg --cwd d log --mq --template '{rev} {desc|firstline}\n' 0 b.patch $ killdaemons.py mercurial-4.5.3/tests/test-hgweb-symrev.t0000644015407300116100000020202713261161234020323 0ustar augieeng00000000000000#require serve Test symbolic revision usage in links produced by hgweb pages. There are multiple issues related to this: - issue2296 - issue2826 - issue3594 - issue3634 Set up the repo $ hg init test $ cd test $ echo 0 > foo $ mkdir dir $ echo 0 > dir/bar $ hg ci -Am 'first' adding dir/bar adding foo $ echo 1 >> foo $ hg ci -m 'second' $ echo 2 >> foo $ hg ci -m 'third' $ hg bookmark -r1 xyzzy $ hg log -G --template '{rev}:{node|short} {tags} {bookmarks}\n' @ 2:9d8c40cba617 tip | o 1:a7c1559b7bba xyzzy | o 0:43c799df6e75 $ hg serve --config web.allow_archive=zip -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log $ cat hg.pid >> $DAEMON_PIDS $ REVLINKS='href=[^>]+(rev=|/)(43c799df6e75|0|a7c1559b7bba|1|xyzzy|9d8c40cba617|2|tip|default)' (De)referencing symbolic revisions (paper) $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=paper' | egrep $REVLINKS
  • graph
  • changeset
  • browse
  • zip less more | rev 2: (0) tip third second first less more | rev 2: (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph?style=paper' | egrep $REVLINKS
  • log
  • changeset
  • browse
  • less more | rev 2: (0) tip third second first less more | rev 2: (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file?style=paper' | egrep $REVLINKS
  • log
  • graph
  • changeset
  • zip directory / @ 2:9d8c40cba617 [up] $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'branches?style=paper' | egrep $REVLINKS $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'tags?style=paper' | egrep $REVLINKS $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'bookmarks?style=paper' | egrep $REVLINKS $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=paper&rev=all()' | egrep $REVLINKS third second first $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'rev/xyzzy?style=paper' | egrep $REVLINKS
  • log
  • graph
  • raw
  • browse
  • zip changeset 1:a7c1559b7bba 43c799df6e75 9d8c40cba617 foo $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog/xyzzy?style=paper' | egrep $REVLINKS
  • graph
  • changeset
  • browse
  • zip less more | rev 1: (0) tip second first less more | rev 1: (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph/xyzzy?style=paper' | egrep $REVLINKS
  • log
  • changeset
  • browse
  • less more | rev 1: (0) tip second first less more | rev 1: (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy?style=paper' | egrep $REVLINKS
  • log
  • graph
  • changeset
  • zip directory / @ 1:a7c1559b7bba [up] $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy/foo?style=paper' | egrep $REVLINKS
  • log
  • graph
  • changeset
  • browse
  • latest
  • diff
  • comparison
  • annotate
  • file log
  • raw
  • view foo @ 1:a7c1559b7bba 43c799df6e75 9d8c40cba617 $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log/xyzzy/foo?style=paper' | egrep $REVLINKS href="/atom-log/tip/foo" title="Atom feed for test:foo" /> href="/rss-log/tip/foo" title="RSS feed for test:foo" />
  • log
  • graph
  • changeset
  • browse
  • file
  • diff
  • comparison
  • annotate
  • raw
  • log foo @ 1:a7c1559b7bba less more | (0) tip
    second first less more | (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'annotate/xyzzy/foo?style=paper' | egrep $REVLINKS
  • log
  • graph
  • changeset
  • browse
  • file
  • latest
  • diff
  • comparison
  • file log
  • raw
  • annotate foo @ 1:a7c1559b7bba 43c799df6e75 9d8c40cba617 diff changeset 0 diff changeset $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'diff/xyzzy/foo?style=paper' | egrep $REVLINKS
  • log
  • graph
  • changeset
  • browse
  • file
  • latest
  • comparison
  • annotate
  • file log
  • raw
  • diff foo @ 1:a7c1559b7bba 43c799df6e75 9d8c40cba617 $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'comparison/xyzzy/foo?style=paper' | egrep $REVLINKS
  • log
  • graph
  • changeset
  • browse
  • file
  • latest
  • diff
  • annotate
  • file log
  • raw
  • comparison foo @ 1:a7c1559b7bba 43c799df6e75 9d8c40cba617 (De)referencing symbolic revisions (coal) $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=coal' | egrep $REVLINKS
  • graph
  • changeset
  • browse
  • zip less more | rev 2: (0) tip third second first less more | rev 2: (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph?style=coal' | egrep $REVLINKS
  • log
  • changeset
  • browse
  • less more | rev 2: (0) tip third second first less more | rev 2: (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file?style=coal' | egrep $REVLINKS
  • log
  • graph
  • changeset
  • zip directory / @ 2:9d8c40cba617 [up] $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'branches?style=coal' | egrep $REVLINKS $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'tags?style=coal' | egrep $REVLINKS $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'bookmarks?style=coal' | egrep $REVLINKS $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=coal&rev=all()' | egrep $REVLINKS third second first $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'rev/xyzzy?style=coal' | egrep $REVLINKS
  • log
  • graph
  • raw
  • browse
  • zip changeset 1:a7c1559b7bba 43c799df6e75 9d8c40cba617 foo $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog/xyzzy?style=coal' | egrep $REVLINKS
  • graph
  • changeset
  • browse
  • zip less more | rev 1: (0) tip second first less more | rev 1: (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph/xyzzy?style=coal' | egrep $REVLINKS
  • log
  • changeset
  • browse
  • less more | rev 1: (0) tip second first less more | rev 1: (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy?style=coal' | egrep $REVLINKS
  • log
  • graph
  • changeset
  • zip directory / @ 1:a7c1559b7bba [up] $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy/foo?style=coal' | egrep $REVLINKS
  • log
  • graph
  • changeset
  • browse
  • latest
  • diff
  • comparison
  • annotate
  • file log
  • raw
  • view foo @ 1:a7c1559b7bba 43c799df6e75 9d8c40cba617 $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log/xyzzy/foo?style=coal' | egrep $REVLINKS href="/atom-log/tip/foo" title="Atom feed for test:foo" /> href="/rss-log/tip/foo" title="RSS feed for test:foo" />
  • log
  • graph
  • changeset
  • browse
  • file
  • diff
  • comparison
  • annotate
  • raw
  • log foo @ 1:a7c1559b7bba less more | (0) tip second first less more | (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'annotate/xyzzy/foo?style=coal' | egrep $REVLINKS
  • log
  • graph
  • changeset
  • browse
  • file
  • latest
  • diff
  • comparison
  • file log
  • raw
  • annotate foo @ 1:a7c1559b7bba 43c799df6e75 9d8c40cba617 diff changeset 0 diff changeset $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'diff/xyzzy/foo?style=coal' | egrep $REVLINKS
  • log
  • graph
  • changeset
  • browse
  • file
  • latest
  • comparison
  • annotate
  • file log
  • raw
  • diff foo @ 1:a7c1559b7bba 43c799df6e75 9d8c40cba617 $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'comparison/xyzzy/foo?style=coal' | egrep $REVLINKS
  • log
  • graph
  • changeset
  • browse
  • file
  • latest
  • diff
  • annotate
  • file log
  • raw
  • comparison foo @ 1:a7c1559b7bba 43c799df6e75 9d8c40cba617 (De)referencing symbolic revisions (gitweb) $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'summary?style=gitweb' | egrep $REVLINKS files | zip | changeset | files changeset | files changeset | files xyzzy changeset | changelog | files default changeset | changelog | files $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=gitweb' | egrep $REVLINKS changelog | graph | files | zip |
    (0) tip
    changeset | files changeset | files changeset | files (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log?style=gitweb' | egrep $REVLINKS shortlog | graph | files | zip | (0) tip
    changeset
    changeset
    changeset
    (0) tip
    $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph?style=gitweb' | egrep $REVLINKS shortlog | changelog | files | less more | (0) tip third second first less more | (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'tags?style=gitweb' | egrep $REVLINKS tip changeset | changelog | files $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'bookmarks?style=gitweb' | egrep $REVLINKS xyzzy changeset | changelog | files $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'branches?style=gitweb' | egrep $REVLINKS default changeset | changelog | files $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file?style=gitweb' | egrep $REVLINKS changeset | zip | [up] dir files foo file | revisions | annotate $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=gitweb&rev=all()' | egrep $REVLINKS files | zip changeset
    changeset
    changeset
    $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'rev/xyzzy?style=gitweb' | egrep $REVLINKS shortlog | changelog | graph | files | raw | zip | a7c1559b7bba 43c799df6e75 9d8c40cba617 foo file | annotate | diff | comparison | revisions $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog/xyzzy?style=gitweb' | egrep $REVLINKS changelog | graph | files | zip |
    (0) tip
    changeset | files changeset | files (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log/xyzzy?style=gitweb' | egrep $REVLINKS shortlog | graph | files | zip | (0) tip
    changeset
    changeset
    (0) tip
    $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph/xyzzy?style=gitweb' | egrep $REVLINKS shortlog | changelog | files | less more | (0) tip second first less more | (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy?style=gitweb' | egrep $REVLINKS changeset | zip | [up] dir files foo file | revisions | annotate $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy/foo?style=gitweb' | egrep $REVLINKS files | changeset | latest | revisions | annotate | diff | comparison | raw | a7c1559b7bba 9d8c40cba617 $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log/xyzzy/foo?style=gitweb' | egrep $REVLINKS file | annotate | diff | comparison | rss | (0) tip file | diff | annotate file | diff | annotate less more (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'annotate/xyzzy/foo?style=gitweb' | egrep $REVLINKS files | changeset | file | latest | revisions | diff | comparison | raw | a7c1559b7bba 9d8c40cba617 diff changeset 0 diff changeset $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'diff/xyzzy/foo?style=gitweb' | egrep $REVLINKS files | changeset | file | latest | revisions | annotate | comparison | raw | a7c1559b7bba 9d8c40cba617 $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'comparison/xyzzy/foo?style=gitweb' | egrep $REVLINKS files | changeset | file | latest | revisions | annotate | diff | raw | a7c1559b7bba 9d8c40cba617 (De)referencing symbolic revisions (monoblue) $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'summary?style=monoblue' | egrep $REVLINKS
  • zip
  • changeset | files changeset | files changeset | files xyzzy changeset | changelog | files default changeset | changelog | files $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=monoblue' | egrep $REVLINKS
  • graph
  • files
  • zip
  • changeset | files changeset | files changeset | files (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log?style=monoblue' | egrep $REVLINKS
  • graph
  • files
  • zip
  • (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph?style=monoblue' | egrep $REVLINKS
  • files
  • third second first less more | (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'tags?style=monoblue' | egrep $REVLINKS tip changeset | changelog | files $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'bookmarks?style=monoblue' | egrep $REVLINKS xyzzy changeset | changelog | files $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'branches?style=monoblue' | egrep $REVLINKS default changeset | changelog | files $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file?style=monoblue' | egrep $REVLINKS
  • graph
  • changeset
  • zip
  • [up] dir files foo file | revisions | annotate $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=monoblue&rev=all()' | egrep $REVLINKS
  • zip
  • $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'rev/xyzzy?style=monoblue' | egrep $REVLINKS
  • graph
  • files
  • raw
  • zip
  • a7c1559b7bba
    43c799df6e75
    9d8c40cba617
    foo file | annotate | diff | comparison | revisions $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog/xyzzy?style=monoblue' | egrep $REVLINKS
  • graph
  • files
  • zip
  • changeset | files changeset | files (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log/xyzzy?style=monoblue' | egrep $REVLINKS
  • graph
  • files
  • zip
  • (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph/xyzzy?style=monoblue' | egrep $REVLINKS
  • files
  • second first less more | (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy?style=monoblue' | egrep $REVLINKS
  • graph
  • changeset
  • zip
  • [up] dir files foo file | revisions | annotate $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy/foo?style=monoblue' | egrep $REVLINKS
  • graph
  • files
  • latest
  • revisions
  • annotate
  • diff
  • comparison
  • raw
  • a7c1559b7bba
    9d8c40cba617 $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log/xyzzy/foo?style=monoblue' | egrep $REVLINKS
  • graph
  • files
  • file
  • annotate
  • diff
  • comparison
  • rss
  • file | diff | annotate file | diff | annotate (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'annotate/xyzzy/foo?style=monoblue' | egrep $REVLINKS
  • graph
  • files
  • file
  • latest
  • revisions
  • diff
  • comparison
  • raw
  • a7c1559b7bba
    9d8c40cba617 diff changeset 0 diff changeset $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'diff/xyzzy/foo?style=monoblue' | egrep $REVLINKS
  • graph
  • files
  • file
  • latest
  • revisions
  • annotate
  • comparison
  • raw
  • a7c1559b7bba
    43c799df6e75
    9d8c40cba617
    $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'comparison/xyzzy/foo?style=monoblue' | egrep $REVLINKS
  • graph
  • files
  • file
  • latest
  • revisions
  • annotate
  • diff
  • raw
  • a7c1559b7bba
    43c799df6e75
    9d8c40cba617
    (De)referencing symbolic revisions (spartan) $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=spartan' | egrep $REVLINKS changelog graph files zip navigate: (0) tip third second first navigate: (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log?style=spartan' | egrep $REVLINKS shortlog graph files zip navigate: (0) tip 9d8c40cba617 files: foo a7c1559b7bba files: foo 43c799df6e75 files: dir/bar foo navigate: (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph?style=spartan' | egrep $REVLINKS changelog shortlog files navigate: (0) tip third second first navigate: (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'tags?style=spartan' | egrep $REVLINKS tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'branches?style=spartan' | egrep $REVLINKS default $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file?style=spartan' | egrep $REVLINKS changelog shortlog graph changeset zip

    Mercurial / files for changeset 9d8c40cba617: /

    [up] dir/ foo $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=spartan&rev=all()' | egrep $REVLINKS zip 9d8c40cba617 a7c1559b7bba files: foo a7c1559b7bba 43c799df6e75 9d8c40cba617 files: foo 43c799df6e75 a7c1559b7bba files: dir/bar foo $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'rev/xyzzy?style=spartan' | egrep $REVLINKS changelog shortlog graph files raw zip a7c1559b7bba 43c799df6e75 9d8c40cba617 foo $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog/xyzzy?style=spartan' | egrep $REVLINKS changelog graph files zip navigate: (0) tip second first navigate: (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log/xyzzy?style=spartan' | egrep $REVLINKS shortlog graph files zip navigate: (0) tip a7c1559b7bba files: foo 43c799df6e75 files: dir/bar foo navigate: (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph/xyzzy?style=spartan' | egrep $REVLINKS changelog shortlog files navigate: (0) tip second first navigate: (0) tip $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy?style=spartan' | egrep $REVLINKS changelog shortlog graph changeset zip

    Mercurial / files for changeset a7c1559b7bba: /

    [up] dir/ foo $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy/foo?style=spartan' | egrep $REVLINKS changelog shortlog graph changeset files revisions annotate raw a7c1559b7bba 9d8c40cba617 $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log/xyzzy/foo?style=spartan' | egrep $REVLINKS href="/atom-log/tip/foo" title="Atom feed for test:foo"> href="/rss-log/tip/foo" title="RSS feed for test:foo"> file annotate rss atom

    navigate: (0) tip

    second a7c1559b7bba (diff) (annotate) first 43c799df6e75 (diff) (annotate) $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'annotate/xyzzy/foo?style=spartan' | egrep $REVLINKS changelog shortlog graph changeset files file revisions raw a7c1559b7bba 9d8c40cba617 diff changeset 0 diff changeset $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'diff/xyzzy/foo?style=spartan' | egrep $REVLINKS changelog shortlog graph changeset file revisions annotate raw a7c1559b7bba 43c799df6e75 9d8c40cba617 Done $ cat errors.log $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS $ cd .. mercurial-4.5.3/tests/test-rename.t0000644015407300116100000003337713261161234017165 0ustar augieeng00000000000000 $ hg init $ mkdir d1 d1/d11 d2 $ echo d1/a > d1/a $ echo d1/ba > d1/ba $ echo d1/a1 > d1/d11/a1 $ echo d1/b > d1/b $ echo d2/b > d2/b $ hg add d1/a d1/b d1/ba d1/d11/a1 d2/b $ hg commit -m "1" rename a single file $ hg rename d1/d11/a1 d2/c $ hg --config ui.portablefilenames=abort rename d1/a d1/con.xml abort: filename contains 'con', which is reserved on Windows: d1/con.xml [255] $ hg sum parent: 0:9b4b6e7b2c26 tip 1 branch: default commit: 1 renamed update: (current) phases: 1 draft $ hg status -C A d2/c d1/d11/a1 R d1/d11/a1 $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm d2/c rename a single file using absolute paths $ hg rename `pwd`/d1/d11/a1 `pwd`/d2/c $ hg status -C A d2/c d1/d11/a1 R d1/d11/a1 $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm d2/c rename --after a single file $ mv d1/d11/a1 d2/c $ hg rename --after d1/d11/a1 d2/c $ hg status -C A d2/c d1/d11/a1 R d1/d11/a1 $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm d2/c rename --after a single file when src and tgt already tracked $ mv d1/d11/a1 d2/c $ hg addrem -s 0 removing d1/d11/a1 adding d2/c $ hg rename --after d1/d11/a1 d2/c $ hg status -C A d2/c d1/d11/a1 R d1/d11/a1 $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm d2/c rename --after a single file to a nonexistent target filename $ hg rename --after d1/a dummy d1/a: not recording move - dummy does not exist move a single file to an existing directory $ hg rename d1/d11/a1 d2 $ hg status -C A d2/a1 d1/d11/a1 R d1/d11/a1 $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm d2/a1 move --after a single file to an existing directory $ mv d1/d11/a1 d2 $ hg rename --after d1/d11/a1 d2 $ hg status -C A d2/a1 d1/d11/a1 R d1/d11/a1 $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm d2/a1 rename a file using a relative path $ (cd d1/d11; hg rename ../../d2/b e) $ hg status -C A d1/d11/e d2/b R d2/b $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm d1/d11/e rename --after a file using a relative path $ (cd d1/d11; mv ../../d2/b e; hg rename --after ../../d2/b e) $ hg status -C A d1/d11/e d2/b R d2/b $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm d1/d11/e rename directory d1 as d3 $ hg rename d1/ d3 moving d1/a to d3/a moving d1/b to d3/b moving d1/ba to d3/ba moving d1/d11/a1 to d3/d11/a1 $ hg status -C A d3/a d1/a A d3/b d1/b A d3/ba d1/ba A d3/d11/a1 d1/d11/a1 R d1/a R d1/b R d1/ba R d1/d11/a1 $ hg update -C 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf d3 rename --after directory d1 as d3 $ mv d1 d3 $ hg rename --after d1 d3 moving d1/a to d3/a moving d1/b to d3/b moving d1/ba to d3/ba moving d1/d11/a1 to d3/d11/a1 $ hg status -C A d3/a d1/a A d3/b d1/b A d3/ba d1/ba A d3/d11/a1 d1/d11/a1 R d1/a R d1/b R d1/ba R d1/d11/a1 $ hg update -C 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf d3 move a directory using a relative path $ (cd d2; mkdir d3; hg rename ../d1/d11 d3) moving ../d1/d11/a1 to d3/d11/a1 $ hg status -C A d2/d3/d11/a1 d1/d11/a1 R d1/d11/a1 $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf d2/d3 move --after a directory using a relative path $ (cd d2; mkdir d3; mv ../d1/d11 d3; hg rename --after ../d1/d11 d3) moving ../d1/d11/a1 to d3/d11/a1 $ hg status -C A d2/d3/d11/a1 d1/d11/a1 R d1/d11/a1 $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf d2/d3 move directory d1/d11 to an existing directory d2 (removes empty d1) $ hg rename d1/d11/ d2 moving d1/d11/a1 to d2/d11/a1 $ hg status -C A d2/d11/a1 d1/d11/a1 R d1/d11/a1 $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf d2/d11 move directories d1 and d2 to a new directory d3 $ mkdir d3 $ hg rename d1 d2 d3 moving d1/a to d3/d1/a moving d1/b to d3/d1/b moving d1/ba to d3/d1/ba moving d1/d11/a1 to d3/d1/d11/a1 moving d2/b to d3/d2/b $ hg status -C A d3/d1/a d1/a A d3/d1/b d1/b A d3/d1/ba d1/ba A d3/d1/d11/a1 d1/d11/a1 A d3/d2/b d2/b R d1/a R d1/b R d1/ba R d1/d11/a1 R d2/b $ hg update -C 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf d3 move --after directories d1 and d2 to a new directory d3 $ mkdir d3 $ mv d1 d2 d3 $ hg rename --after d1 d2 d3 moving d1/a to d3/d1/a moving d1/b to d3/d1/b moving d1/ba to d3/d1/ba moving d1/d11/a1 to d3/d1/d11/a1 moving d2/b to d3/d2/b $ hg status -C A d3/d1/a d1/a A d3/d1/b d1/b A d3/d1/ba d1/ba A d3/d1/d11/a1 d1/d11/a1 A d3/d2/b d2/b R d1/a R d1/b R d1/ba R d1/d11/a1 R d2/b $ hg update -C 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf d3 move everything under directory d1 to existing directory d2, do not overwrite existing files (d2/b) $ hg rename d1/* d2 d2/b: not overwriting - file already committed (hg rename --force to replace the file by recording a rename) moving d1/d11/a1 to d2/d11/a1 $ hg status -C A d2/a d1/a A d2/ba d1/ba A d2/d11/a1 d1/d11/a1 R d1/a R d1/ba R d1/d11/a1 $ diff -u d1/b d2/b --- d1/b * (glob) +++ d2/b * (glob) @@ * (glob) -d1/b +d2/b [1] $ hg update -C 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm d2/a d2/ba d2/d11/a1 attempt to move one file into a non-existent directory $ hg rename d1/a dx/ abort: destination dx/ is not a directory [255] $ hg status -C $ hg update -C 0 files updated, 0 files merged, 0 files removed, 0 files unresolved attempt to move potentially more than one file into a non-existent directory $ hg rename 'glob:d1/**' dx abort: with multiple sources, destination must be an existing directory [255] move every file under d1 to d2/d21 $ mkdir d2/d21 $ hg rename 'glob:d1/**' d2/d21 moving d1/a to d2/d21/a moving d1/b to d2/d21/b moving d1/ba to d2/d21/ba moving d1/d11/a1 to d2/d21/a1 $ hg status -C A d2/d21/a d1/a A d2/d21/a1 d1/d11/a1 A d2/d21/b d1/b A d2/d21/ba d1/ba R d1/a R d1/b R d1/ba R d1/d11/a1 $ hg update -C 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf d2/d21 move --after some files under d1 to d2/d21 $ mkdir d2/d21 $ mv d1/a d1/d11/a1 d2/d21 $ hg rename --after 'glob:d1/**' d2/d21 moving d1/a to d2/d21/a d1/b: not recording move - d2/d21/b does not exist d1/ba: not recording move - d2/d21/ba does not exist moving d1/d11/a1 to d2/d21/a1 $ hg status -C A d2/d21/a d1/a A d2/d21/a1 d1/d11/a1 R d1/a R d1/d11/a1 $ hg update -C 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf d2/d21 move every file under d1 starting with an 'a' to d2/d21 (regexp) $ mkdir d2/d21 $ hg rename 're:d1/([^a][^/]*/)*a.*' d2/d21 moving d1/a to d2/d21/a moving d1/d11/a1 to d2/d21/a1 $ hg status -C A d2/d21/a d1/a A d2/d21/a1 d1/d11/a1 R d1/a R d1/d11/a1 $ hg update -C 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf d2/d21 attempt to overwrite an existing file $ echo "ca" > d1/ca $ hg rename d1/ba d1/ca d1/ca: not overwriting - file exists (hg rename --after to record the rename) $ hg status -C ? d1/ca $ hg update -C 0 files updated, 0 files merged, 0 files removed, 0 files unresolved forced overwrite of an existing file $ echo "ca" > d1/ca $ hg rename --force d1/ba d1/ca $ hg status -C A d1/ca d1/ba R d1/ba $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm d1/ca attempt to overwrite an existing broken symlink #if symlink $ ln -s ba d1/ca $ hg rename --traceback d1/ba d1/ca d1/ca: not overwriting - file exists (hg rename --after to record the rename) $ hg status -C ? d1/ca $ hg update -C 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm d1/ca replace a symlink with a file $ ln -s ba d1/ca $ hg rename --force d1/ba d1/ca $ hg status -C A d1/ca d1/ba R d1/ba $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm d1/ca #endif do not copy more than one source file to the same destination file $ mkdir d3 $ hg rename d1/* d2/* d3 moving d1/d11/a1 to d3/d11/a1 d3/b: not overwriting - d2/b collides with d1/b $ hg status -C A d3/a d1/a A d3/b d1/b A d3/ba d1/ba A d3/d11/a1 d1/d11/a1 R d1/a R d1/b R d1/ba R d1/d11/a1 $ hg update -C 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf d3 move a whole subtree with "hg rename ." $ mkdir d3 $ (cd d1; hg rename . ../d3) moving a to ../d3/d1/a moving b to ../d3/d1/b moving ba to ../d3/d1/ba moving d11/a1 to ../d3/d1/d11/a1 $ hg status -C A d3/d1/a d1/a A d3/d1/b d1/b A d3/d1/ba d1/ba A d3/d1/d11/a1 d1/d11/a1 R d1/a R d1/b R d1/ba R d1/d11/a1 $ hg update -C 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf d3 move a whole subtree with "hg rename --after ." $ mkdir d3 $ mv d1/* d3 $ (cd d1; hg rename --after . ../d3) moving a to ../d3/a moving b to ../d3/b moving ba to ../d3/ba moving d11/a1 to ../d3/d11/a1 $ hg status -C A d3/a d1/a A d3/b d1/b A d3/ba d1/ba A d3/d11/a1 d1/d11/a1 R d1/a R d1/b R d1/ba R d1/d11/a1 $ hg update -C 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf d3 move the parent tree with "hg rename .." $ (cd d1/d11; hg rename .. ../../d3) moving ../a to ../../d3/a moving ../b to ../../d3/b moving ../ba to ../../d3/ba moving a1 to ../../d3/d11/a1 $ hg status -C A d3/a d1/a A d3/b d1/b A d3/ba d1/ba A d3/d11/a1 d1/d11/a1 R d1/a R d1/b R d1/ba R d1/d11/a1 $ hg update -C 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf d3 skip removed files $ hg remove d1/b $ hg rename d1 d3 moving d1/a to d3/a moving d1/ba to d3/ba moving d1/d11/a1 to d3/d11/a1 $ hg status -C A d3/a d1/a A d3/ba d1/ba A d3/d11/a1 d1/d11/a1 R d1/a R d1/b R d1/ba R d1/d11/a1 $ hg update -C 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm -rf d3 transitive rename $ hg rename d1/b d1/bb $ hg rename d1/bb d1/bc $ hg status -C A d1/bc d1/b R d1/b $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm d1/bc transitive rename --after $ hg rename d1/b d1/bb $ mv d1/bb d1/bc $ hg rename --after d1/bb d1/bc $ hg status -C A d1/bc d1/b R d1/b $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm d1/bc $ echo "# idempotent renames (d1/b -> d1/bb followed by d1/bb -> d1/b)" # idempotent renames (d1/b -> d1/bb followed by d1/bb -> d1/b) $ hg rename d1/b d1/bb $ echo "some stuff added to d1/bb" >> d1/bb $ hg rename d1/bb d1/b $ hg status -C M d1/b $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved overwriting with renames (issue1959) $ hg rename d1/a d1/c $ hg rename d1/b d1/a $ hg status -C M d1/a d1/b A d1/c d1/a R d1/b $ hg diff --git diff --git a/d1/a b/d1/a --- a/d1/a +++ b/d1/a @@ -1,1 +1,1 @@ -d1/a +d1/b diff --git a/d1/b b/d1/b deleted file mode 100644 --- a/d1/b +++ /dev/null @@ -1,1 +0,0 @@ -d1/b diff --git a/d1/a b/d1/c copy from d1/a copy to d1/c $ hg update -C 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm d1/c # The file was marked as added, so 'hg update' action was 'forget' check illegal path components $ hg rename d1/d11/a1 .hg/foo abort: path contains illegal component: .hg/foo [255] $ hg status -C $ hg rename d1/d11/a1 ../foo abort: ../foo not under root '$TESTTMP' [255] $ hg status -C $ mv d1/d11/a1 .hg/foo $ hg rename --after d1/d11/a1 .hg/foo abort: path contains illegal component: .hg/foo [255] $ hg status -C ! d1/d11/a1 $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm .hg/foo $ hg rename d1/d11/a1 .hg abort: path contains illegal component: .hg/a1 [255] $ hg --config extensions.largefiles= rename d1/d11/a1 .hg The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) abort: path contains illegal component: .hg/a1 [255] $ hg status -C $ hg rename d1/d11/a1 .. abort: ../a1 not under root '$TESTTMP' [255] $ hg --config extensions.largefiles= rename d1/d11/a1 .. The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !) abort: ../a1 not under root '$TESTTMP' [255] $ hg status -C $ mv d1/d11/a1 .hg $ hg rename --after d1/d11/a1 .hg abort: path contains illegal component: .hg/a1 [255] $ hg status -C ! d1/d11/a1 $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm .hg/a1 $ (cd d1/d11; hg rename ../../d2/b ../../.hg/foo) abort: path contains illegal component: .hg/foo [255] $ hg status -C $ (cd d1/d11; hg rename ../../d2/b ../../../foo) abort: ../../../foo not under root '$TESTTMP' [255] $ hg status -C mercurial-4.5.3/tests/test-import-bypass.t0000644015407300116100000002223713261161234020520 0ustar augieeng00000000000000 $ echo "[extensions]" >> $HGRCPATH $ echo "purge=" >> $HGRCPATH $ shortlog() { > hg log -G --template '{rev}:{node|short} {author} {date|hgdate} - {branch} - {desc|firstline}\n' > } Test --bypass with other options $ hg init repo-options $ cd repo-options $ echo a > a $ hg ci -Am adda adding a $ echo a >> a $ hg branch foo marked working directory as branch foo (branches are permanent and global, did you want a bookmark?) $ hg ci -Am changea $ hg export . > ../test.diff $ hg up null 0 files updated, 0 files merged, 1 files removed, 0 files unresolved Test importing an existing revision (this also tests that "hg import" disallows combination of '--exact' and '--edit') $ hg import --bypass --exact --edit ../test.diff abort: cannot use --exact with --edit [255] $ hg import --bypass --exact ../test.diff applying ../test.diff $ shortlog o 1:4e322f7ce8e3 test 0 0 - foo - changea | o 0:07f494440405 test 0 0 - default - adda Test failure without --exact $ hg import --bypass ../test.diff applying ../test.diff unable to find 'a' for patching (use '--prefix' to apply patch relative to the current directory) abort: patch failed to apply [255] $ hg st $ shortlog o 1:4e322f7ce8e3 test 0 0 - foo - changea | o 0:07f494440405 test 0 0 - default - adda Test --user, --date and --message $ hg up 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg import --bypass --u test2 -d '1 0' -m patch2 ../test.diff applying ../test.diff $ cat .hg/last-message.txt patch2 (no-eol) $ shortlog o 2:2e127d1da504 test2 1 0 - default - patch2 | | o 1:4e322f7ce8e3 test 0 0 - foo - changea |/ @ 0:07f494440405 test 0 0 - default - adda $ hg rollback repository tip rolled back to revision 1 (undo import) Test --import-branch (this also tests that editor is not invoked for '--bypass', if the patch contains the commit message, regardless of '--edit') $ HGEDITOR=cat hg import --bypass --import-branch --edit ../test.diff applying ../test.diff $ shortlog o 1:4e322f7ce8e3 test 0 0 - foo - changea | @ 0:07f494440405 test 0 0 - default - adda $ hg rollback repository tip rolled back to revision 1 (undo import) Test --strip $ hg import --bypass --strip 0 - < # HG changeset patch > # User test > # Date 0 0 > # Branch foo > # Node ID 4e322f7ce8e3e4203950eac9ece27bf7e45ffa6c > # Parent 07f4944404050f47db2e5c5071e0e84e7a27bba9 > changea > > diff -r 07f494440405 -r 4e322f7ce8e3 a > --- a Thu Jan 01 00:00:00 1970 +0000 > +++ a Thu Jan 01 00:00:00 1970 +0000 > @@ -1,1 +1,2 @@ > a > +a > EOF applying patch from stdin $ hg rollback repository tip rolled back to revision 1 (undo import) Test --strip with --bypass $ mkdir -p dir/dir2 $ echo bb > dir/dir2/b $ echo cc > dir/dir2/c $ echo d > dir/d $ hg ci -Am 'addabcd' adding dir/d adding dir/dir2/b adding dir/dir2/c $ shortlog @ 2:d805bc8236b6 test 0 0 - default - addabcd | | o 1:4e322f7ce8e3 test 0 0 - foo - changea |/ o 0:07f494440405 test 0 0 - default - adda $ hg import --bypass --strip 2 --prefix dir/ - < # HG changeset patch > # User test > # Date 0 0 > # Branch foo > changeabcd > > diff --git a/foo/a b/foo/a > new file mode 100644 > --- /dev/null > +++ b/foo/a > @@ -0,0 +1 @@ > +a > diff --git a/foo/dir2/b b/foo/dir2/b2 > rename from foo/dir2/b > rename to foo/dir2/b2 > diff --git a/foo/dir2/c b/foo/dir2/c > --- a/foo/dir2/c > +++ b/foo/dir2/c > @@ -0,0 +1 @@ > +cc > diff --git a/foo/d b/foo/d > deleted file mode 100644 > --- a/foo/d > +++ /dev/null > @@ -1,1 +0,0 @@ > -d > EOF applying patch from stdin $ shortlog o 3:5bd46886ca3e test 0 0 - default - changeabcd | @ 2:d805bc8236b6 test 0 0 - default - addabcd | | o 1:4e322f7ce8e3 test 0 0 - foo - changea |/ o 0:07f494440405 test 0 0 - default - adda $ hg diff --change 3 --git diff --git a/dir/a b/dir/a new file mode 100644 --- /dev/null +++ b/dir/a @@ -0,0 +1,1 @@ +a diff --git a/dir/d b/dir/d deleted file mode 100644 --- a/dir/d +++ /dev/null @@ -1,1 +0,0 @@ -d diff --git a/dir/dir2/b b/dir/dir2/b2 rename from dir/dir2/b rename to dir/dir2/b2 diff --git a/dir/dir2/c b/dir/dir2/c --- a/dir/dir2/c +++ b/dir/dir2/c @@ -1,1 +1,2 @@ cc +cc $ hg -q --config extensions.strip= strip . Test unsupported combinations $ hg import --bypass --no-commit ../test.diff abort: cannot use --no-commit with --bypass [255] $ hg import --bypass --similarity 50 ../test.diff abort: cannot use --similarity with --bypass [255] $ hg import --exact --prefix dir/ ../test.diff abort: cannot use --exact with --prefix [255] Test commit editor (this also tests that editor is invoked, if the patch doesn't contain the commit message, regardless of '--edit') $ cat > ../test.diff < diff -r 07f494440405 -r 4e322f7ce8e3 a > --- a/a Thu Jan 01 00:00:00 1970 +0000 > +++ b/a Thu Jan 01 00:00:00 1970 +0000 > @@ -1,1 +1,2 @@ > -a > +b > +c > EOF $ HGEDITOR=cat hg import --bypass ../test.diff applying ../test.diff HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: test HG: branch 'default' HG: changed a abort: empty commit message [255] Test patch.eol is handled (this also tests that editor is not invoked for '--bypass', if the commit message is explicitly specified, regardless of '--edit') $ $PYTHON -c 'file("a", "wb").write("a\r\n")' $ hg ci -m makeacrlf $ HGEDITOR=cat hg import -m 'should fail because of eol' --edit --bypass ../test.diff applying ../test.diff patching file a Hunk #1 FAILED at 0 abort: patch failed to apply [255] $ hg --config patch.eol=auto import -d '0 0' -m 'test patch.eol' --bypass ../test.diff applying ../test.diff $ shortlog o 3:c606edafba99 test 0 0 - default - test patch.eol | @ 2:872023de769d test 0 0 - default - makeacrlf | | o 1:4e322f7ce8e3 test 0 0 - foo - changea |/ o 0:07f494440405 test 0 0 - default - adda Test applying multiple patches $ hg up -qC 0 $ echo e > e $ hg ci -Am adde adding e created new head $ hg export . > ../patch1.diff $ hg up -qC 1 $ echo f > f $ hg ci -Am addf adding f $ hg export . > ../patch2.diff $ cd .. $ hg clone -r1 repo-options repo-multi1 adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files new changesets 07f494440405:4e322f7ce8e3 updating to branch foo 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd repo-multi1 $ hg up 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg import --bypass ../patch1.diff ../patch2.diff applying ../patch1.diff applying ../patch2.diff $ shortlog o 3:bc8ca3f8a7c4 test 0 0 - default - addf | o 2:16581080145e test 0 0 - default - adde | | o 1:4e322f7ce8e3 test 0 0 - foo - changea |/ @ 0:07f494440405 test 0 0 - default - adda Test applying multiple patches with --exact $ cd .. $ hg clone -r1 repo-options repo-multi2 adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files new changesets 07f494440405:4e322f7ce8e3 updating to branch foo 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd repo-multi2 $ hg import --bypass --exact ../patch1.diff ../patch2.diff applying ../patch1.diff applying ../patch2.diff $ shortlog o 3:d60cb8989666 test 0 0 - foo - addf | | o 2:16581080145e test 0 0 - default - adde | | @ | 1:4e322f7ce8e3 test 0 0 - foo - changea |/ o 0:07f494440405 test 0 0 - default - adda $ cd .. Test avoiding editor invocation at applying the patch with --exact even if commit message is empty $ cd repo-options $ echo a >> a $ hg commit -m ' ' $ hg tip -T "{node}\n" 1b77bc7d1db9f0e7f1716d515b630516ab386c89 $ hg export -o ../empty-log.diff . $ hg update -q -C ".^1" $ hg --config extensions.strip= strip -q tip $ HGEDITOR=cat hg import --exact --bypass ../empty-log.diff applying ../empty-log.diff $ hg tip -T "{node}\n" 1b77bc7d1db9f0e7f1716d515b630516ab386c89 $ cd .. #if symlink execbit Test complicated patch with --exact $ hg init repo-exact $ cd repo-exact $ echo a > a $ echo c > c $ echo d > d $ echo e > e $ echo f > f $ chmod +x f $ ln -s c linkc $ hg ci -Am t adding a adding c adding d adding e adding f adding linkc $ hg cp a aa1 $ echo b >> a $ echo b > b $ hg add b $ hg cp a aa2 $ echo aa >> aa2 $ chmod +x e $ chmod -x f $ ln -s a linka $ hg rm d $ hg rm linkc $ hg mv c cc $ hg ci -m patch $ hg export --git . > ../test.diff $ hg up -C null 0 files updated, 0 files merged, 7 files removed, 0 files unresolved $ hg purge $ hg st $ hg import --bypass --exact ../test.diff applying ../test.diff The patch should have matched the exported revision and generated no additional data. If not, diff both heads to debug it. $ shortlog o 1:2978fd5c8aa4 test 0 0 - default - patch | o 0:a0e19e636a43 test 0 0 - default - t #endif $ cd .. mercurial-4.5.3/tests/test-push-checkheads-superceed-A6.t0000644015407300116100000000503313261161234023162 0ustar augieeng00000000000000==================================== Testing head checking code: Case A-6 ==================================== Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This case is part of a series of tests checking this behavior. Category A: simple case involving a branch being superceeded by another. TestCase 6: multi-changeset branch, split on multiple other, (base on its own branch), same number of head .. old-state: .. .. * 2 branch (1-changeset, and 2-changesets) .. .. new-state: .. .. * 1 new branch superceeding the base of the old-2-changesets-branch, .. * 1 new changesets on the old-1-changeset-branch superceeding the head of the other .. .. expected-result: .. .. * push allowed .. .. graph-summary: .. .. B'◔⇢ø B .. | | .. A | ø⇠◔ A' .. | |/ .. C â— | .. \| .. â— $ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir A6 $ cd A6 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd server $ mkcommit B0 $ hg up 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ mkcommit C0 created new head $ cd ../client $ hg pull pulling from $TESTTMP/A6/server searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files (+1 heads) new changesets d73caddc5533:0f88766e02d6 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit A1 created new head $ hg up 'desc(C0)' 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit B1 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` obsoleted 1 changesets $ hg log -G --hidden @ d70a1f75a020 (draft): B1 | | o f6082bc4ffef (draft): A1 | | o | 0f88766e02d6 (draft): C0 |/ | x d73caddc5533 (draft): B0 | | | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): root Actual testing -------------- $ hg push pushing to $TESTTMP/A6/server searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files (+1 heads) 2 new obsolescence markers obsoleted 2 changesets $ cd ../.. mercurial-4.5.3/tests/test-purge.t0000644015407300116100000001160713261161234017030 0ustar augieeng00000000000000 $ cat <> $HGRCPATH > [extensions] > purge = > EOF init $ hg init t $ cd t setup $ echo r1 > r1 $ hg ci -qAmr1 -d'0 0' $ mkdir directory $ echo r2 > directory/r2 $ hg ci -qAmr2 -d'1 0' $ echo 'ignored' > .hgignore $ hg ci -qAmr3 -d'2 0' delete an empty directory $ mkdir empty_dir $ hg purge -p -v empty_dir $ hg purge -v removing directory empty_dir $ ls directory r1 delete an untracked directory $ mkdir untracked_dir $ touch untracked_dir/untracked_file1 $ touch untracked_dir/untracked_file2 $ hg purge -p untracked_dir/untracked_file1 untracked_dir/untracked_file2 $ hg purge -v removing file untracked_dir/untracked_file1 removing file untracked_dir/untracked_file2 removing directory untracked_dir $ ls directory r1 delete an untracked file $ touch untracked_file $ touch untracked_file_readonly $ $PYTHON < import os, stat > f= 'untracked_file_readonly' > os.chmod(f, stat.S_IMODE(os.stat(f).st_mode) & ~stat.S_IWRITE) > EOF $ hg purge -p untracked_file untracked_file_readonly $ hg purge -v removing file untracked_file removing file untracked_file_readonly $ ls directory r1 delete an untracked file in a tracked directory $ touch directory/untracked_file $ hg purge -p directory/untracked_file $ hg purge -v removing file directory/untracked_file $ ls directory r1 delete nested directories $ mkdir -p untracked_directory/nested_directory $ hg purge -p untracked_directory/nested_directory $ hg purge -v removing directory untracked_directory/nested_directory removing directory untracked_directory $ ls directory r1 delete nested directories from a subdir $ mkdir -p untracked_directory/nested_directory $ cd directory $ hg purge -p untracked_directory/nested_directory $ hg purge -v removing directory untracked_directory/nested_directory removing directory untracked_directory $ cd .. $ ls directory r1 delete only part of the tree $ mkdir -p untracked_directory/nested_directory $ touch directory/untracked_file $ cd directory $ hg purge -p ../untracked_directory untracked_directory/nested_directory $ hg purge -v ../untracked_directory removing directory untracked_directory/nested_directory removing directory untracked_directory $ cd .. $ ls directory r1 $ ls directory/untracked_file directory/untracked_file $ rm directory/untracked_file skip ignored files if --all not specified $ touch ignored $ hg purge -p $ hg purge -v $ ls directory ignored r1 $ hg purge -p --all ignored $ hg purge -v --all removing file ignored $ ls directory r1 abort with missing files until we support name mangling filesystems $ touch untracked_file $ rm r1 hide error messages to avoid changing the output when the text changes $ hg purge -p 2> /dev/null untracked_file $ hg st ! r1 ? untracked_file $ hg purge -p untracked_file $ hg purge -v 2> /dev/null removing file untracked_file $ hg st ! r1 $ hg purge -v $ hg revert --all --quiet $ hg st -a tracked file in ignored directory (issue621) $ echo directory >> .hgignore $ hg ci -m 'ignore directory' $ touch untracked_file $ hg purge -p untracked_file $ hg purge -v removing file untracked_file skip excluded files $ touch excluded_file $ hg purge -p -X excluded_file $ hg purge -v -X excluded_file $ ls directory excluded_file r1 $ rm excluded_file skip files in excluded dirs $ mkdir excluded_dir $ touch excluded_dir/file $ hg purge -p -X excluded_dir $ hg purge -v -X excluded_dir $ ls directory excluded_dir r1 $ ls excluded_dir file $ rm -R excluded_dir skip excluded empty dirs $ mkdir excluded_dir $ hg purge -p -X excluded_dir $ hg purge -v -X excluded_dir $ ls directory excluded_dir r1 $ rmdir excluded_dir skip patterns $ mkdir .svn $ touch .svn/foo $ mkdir directory/.svn $ touch directory/.svn/foo $ hg purge -p -X .svn -X '*/.svn' $ hg purge -p -X re:.*.svn $ rm -R .svn directory r1 only remove files $ mkdir -p empty_dir dir $ touch untracked_file dir/untracked_file $ hg purge -p --files dir/untracked_file untracked_file $ hg purge -v --files removing file dir/untracked_file removing file untracked_file $ ls dir empty_dir $ ls dir only remove dirs $ mkdir -p empty_dir dir $ touch untracked_file dir/untracked_file $ hg purge -p --dirs empty_dir $ hg purge -v --dirs removing directory empty_dir $ ls dir untracked_file $ ls dir untracked_file remove both files and dirs $ mkdir -p empty_dir dir $ touch untracked_file dir/untracked_file $ hg purge -p --files --dirs dir/untracked_file untracked_file empty_dir $ hg purge -v --files --dirs removing file dir/untracked_file removing file untracked_file removing directory empty_dir removing directory dir $ ls $ cd .. mercurial-4.5.3/tests/test-strict.t0000644015407300116100000000302113261161234017205 0ustar augieeng00000000000000 $ hg init $ echo a > a $ hg ci -Ama adding a $ hg an a 0: a $ hg --config ui.strict=False an a 0: a $ echo "[ui]" >> $HGRCPATH $ echo "strict=True" >> $HGRCPATH $ hg an a hg: unknown command 'an' Mercurial Distributed SCM basic commands: add add the specified files on the next commit annotate show changeset information by line for each file clone make a copy of an existing repository commit commit the specified files or all outstanding changes diff diff repository (or selected files) export dump the header and diffs for one or more changesets forget forget the specified files on the next commit init create a new repository in the given directory log show revision history of entire repository or files merge merge another revision into working directory pull pull changes from the specified source push push changes to the specified destination remove remove the specified files on the next commit serve start stand-alone webserver status show changed files in the working directory summary summarize working directory state update update working directory (or switch revisions) (use 'hg help' for the full list of commands or 'hg -v' for details) [255] $ hg annotate a 0: a should succeed - up is an alias, not an abbreviation $ hg up 0 files updated, 0 files merged, 0 files removed, 0 files unresolved mercurial-4.5.3/tests/test-mq-qimport.t0000644015407300116100000001701713261161234020015 0ustar augieeng00000000000000#require killdaemons $ cat > writelines.py < import sys > path = sys.argv[1] > args = sys.argv[2:] > assert (len(args) % 2) == 0 > > f = file(path, 'wb') > for i in xrange(len(args)/2): > count, s = args[2*i:2*i+2] > count = int(count) > s = s.decode('string_escape') > f.write(s*count) > f.close() > > EOF > cat <> $HGRCPATH > [extensions] > mq = > [diff] > git = 1 > EOF $ hg init repo $ cd repo qimport without file or revision $ hg qimport abort: no files or revisions specified [255] qimport non-existing-file $ hg qimport non-existing-file abort: unable to read file non-existing-file [255] qimport null revision $ hg qimport -r null abort: revision -1 is not mutable (see 'hg help phases' for details) [255] $ hg qseries import email $ hg qimport --push -n email - < From: Username in email > Subject: [PATCH] Message in email > Date: Fri, 02 Jan 1970 00:00:00 +0000 > > Text before patch. > > # HG changeset patch > # User Username in patch > # Date 0 0 > # Node ID 1a706973a7d84cb549823634a821d9bdf21c6220 > # Parent 0000000000000000000000000000000000000000 > First line of commit message. > > More text in commit message. > --- confuse the diff detection > > diff --git a/x b/x > new file mode 100644 > --- /dev/null > +++ b/x > @@ -0,0 +1,1 @@ > +new file > Text after patch. > > EOF adding email to series file applying email now at: email hg tip -v $ hg tip -v changeset: 0:1a706973a7d8 tag: email tag: qbase tag: qtip tag: tip user: Username in patch date: Thu Jan 01 00:00:00 1970 +0000 files: x description: First line of commit message. More text in commit message. $ hg qpop popping email patch queue now empty $ hg qdelete email import URL $ echo foo >> foo $ hg add foo $ hg diff > url.diff $ hg revert --no-backup foo $ rm foo Under unix: file:///foobar/blah Under windows: file:///c:/foobar/blah $ patchurl=`pwd | tr '\\\\' /`/url.diff $ expr "$patchurl" : "\/" > /dev/null || patchurl="/$patchurl" $ hg qimport file://"$patchurl" adding url.diff to series file $ rm url.diff $ hg qun url.diff import patch that already exists $ echo foo2 >> foo $ hg add foo $ hg diff > ../url.diff $ hg revert --no-backup foo $ rm foo $ hg qimport ../url.diff abort: patch "url.diff" already exists [255] $ hg qpush applying url.diff now at: url.diff $ cat foo foo $ hg qpop popping url.diff patch queue now empty qimport -f $ hg qimport -f ../url.diff adding url.diff to series file $ hg qpush applying url.diff now at: url.diff $ cat foo foo2 $ hg qpop popping url.diff patch queue now empty build diff with CRLF $ $PYTHON ../writelines.py b 5 'a\n' 5 'a\r\n' $ hg ci -Am addb adding b $ $PYTHON ../writelines.py b 2 'a\n' 10 'b\n' 2 'a\r\n' $ hg diff > b.diff $ hg up -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved qimport CRLF diff $ hg qimport b.diff adding b.diff to series file $ hg qpush applying b.diff now at: b.diff try to import --push $ cat > appendfoo.diff < append foo > > diff -r 07f494440405 -r 261500830e46 baz > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/baz Thu Jan 01 00:00:00 1970 +0000 > @@ -0,0 +1,1 @@ > +foo > EOF $ cat > appendbar.diff < append bar > > diff -r 07f494440405 -r 261500830e46 baz > --- a/baz Thu Jan 01 00:00:00 1970 +0000 > +++ b/baz Thu Jan 01 00:00:00 1970 +0000 > @@ -1,1 +1,2 @@ > foo > +bar > EOF $ hg qimport --push appendfoo.diff appendbar.diff adding appendfoo.diff to series file adding appendbar.diff to series file applying appendfoo.diff applying appendbar.diff now at: appendbar.diff $ hg qfin -a patch b.diff finalized without changeset message $ touch .hg/patches/append_foo $ hg qimport -r 'p1(.)::' $ hg qapplied append_foo__1 append_bar $ hg qfin -a $ rm .hg/patches/append_foo $ hg qimport -r 'p1(.)::' -P $ hg qpop -a popping append_bar popping append_foo patch queue now empty $ hg qdel append_foo $ hg qdel -k append_bar qimport -e $ hg qimport -e append_bar adding append_bar to series file $ hg qdel -k append_bar qimport -e --name newname oldexisitingpatch $ hg qimport -e --name this-name-is-better append_bar renaming append_bar to this-name-is-better adding this-name-is-better to series file $ hg qser this-name-is-better url.diff qimport -e --name without --force $ cp .hg/patches/this-name-is-better .hg/patches/3.diff $ hg qimport -e --name this-name-is-better 3.diff abort: patch "this-name-is-better" already exists [255] $ hg qser this-name-is-better url.diff qimport -e --name with --force $ hg qimport --force -e --name this-name-is-better 3.diff renaming 3.diff to this-name-is-better adding this-name-is-better to series file $ hg qser this-name-is-better url.diff import patch of bad filename $ touch '../ bad.diff' $ hg qimport '../ bad.diff' abort: patch name cannot begin or end with whitespace [255] $ touch '.hg/patches/ bad.diff' $ hg qimport -e ' bad.diff' abort: patch name cannot begin or end with whitespace [255] qimport with bad name, should abort before reading file $ hg qimport non-existent-file --name .hg abort: patch name cannot begin with ".hg" [255] $ hg qimport non-existent-file --name ' foo' abort: patch name cannot begin or end with whitespace [255] $ hg qimport non-existent-file --name 'foo ' abort: patch name cannot begin or end with whitespace [255] qimport http:// patch with leading slashes in url set up hgweb $ cd .. $ hg init served $ cd served $ echo a > a $ hg ci -Am patch adding a $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS $ cd ../repo $ hg qimport http://localhost:$HGPORT/raw-rev/0/// adding 0 to series file check qimport phase: $ hg -q qpush now at: 0 $ hg phase qparent 1: draft $ hg qimport -r qparent $ hg phase qbase 1: draft $ hg qfinish qbase $ echo '[mq]' >> $HGRCPATH $ echo 'secret=true' >> $HGRCPATH $ hg qimport -r qparent $ hg phase qbase 1: secret $ cd .. $ killdaemons.py check patch name generation for non-alpha-numeric summary line $ cd repo $ hg qpop -a -q patch queue now empty $ hg qseries -v 0 U imported_patch_b_diff 1 U 0 2 U this-name-is-better 3 U url.diff $ echo bb >> b $ hg commit -m '==++--==' $ hg qimport -r tip $ hg qseries -v 0 A 1.diff 1 U imported_patch_b_diff 2 U 0 3 U this-name-is-better 4 U url.diff check reserved patch names $ hg qpop -qa patch queue now empty $ echo >> b $ hg commit -m 'status' $ echo >> b $ hg commit -m '.' $ echo >> b $ hg commit -m 'taken' $ mkdir .hg/patches/taken $ touch .hg/patches/taken__1 $ hg qimport -r -3:: $ hg qap 1.diff__1 2.diff taken__2 check very long patch name $ hg qpop -qa patch queue now empty $ echo >> b $ hg commit -m 'abcdefghi pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi pqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' $ hg qimport -r . $ hg qap abcdefghi_pqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghi_pqrstuvwxyzabcdefg mercurial-4.5.3/tests/test-exchange-obsmarkers-case-D2.t0000644015407300116100000000766313261161234023021 0ustar augieeng00000000000000============================================ Testing obsolescence markers push: Cases D.2 ============================================ Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of all changesets that requested to be "in sync" after the push (even if they are already on both side). This test belongs to a series of tests checking such set is properly computed and applied. This does not tests "obsmarkers" discovery capabilities. Category D: Partial Information Case TestCase 2: missing prune target (prune in "pushed set") D.2 missing prune target (prune in "pushed set") ================================================ .. {{{ .. A ø⇠✕ A' .. |/ .. â— O .. }}} .. .. Marker exist from: .. .. * A' succeed to A .. * A' (prune) .. .. Command runs: .. .. * hg push .. .. Expected exchange: .. .. * `A ø⇠o A'` .. * A' (prune) Setup ----- $ . $TESTDIR/testlib/exchange-obsmarker-util.sh Initial $ setuprepos D.2 creating test repo for test case D.2 - pulldest - main - pushdest cd into `main` and proceed with env setup $ cd main $ mkcommit A0 $ hg up -q 0 $ mkcommit A1 created new head $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'` obsoleted 1 changesets $ hg prune --date '0 0' . obsoleted 1 changesets $ hg strip --hidden -q 'desc(A1)' $ hg log -G --hidden x 28b51eb45704 (draft): A0 | @ a9bdc8b26820 (public): O $ inspect_obsmarkers obsstore content ================ 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ cd .. $ cd .. Actual Test ----------- $ dotest D.2 ## Running testcase D.2 ## initial state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest ## pushing from main to pushdest pushing to pushdest searching for changes no changes found remote: 2 new obsolescence markers ## post push state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest ## pulling from main into pulldest pulling from main searching for changes no changes found 2 new obsolescence markers ## post pull state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} mercurial-4.5.3/tests/test-treemanifest.t0000644015407300116100000006535413261161234020404 0ustar augieeng00000000000000#require killdaemons $ cat << EOF >> $HGRCPATH > [format] > usegeneraldelta=yes > [ui] > ssh=$PYTHON "$TESTDIR/dummyssh" > EOF Set up repo $ hg --config experimental.treemanifest=True init repo $ cd repo Requirements get set on init $ grep treemanifest .hg/requires treemanifest Without directories, looks like any other repo $ echo 0 > a $ echo 0 > b $ hg ci -Aqm initial $ hg debugdata -m 0 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc) b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc) Submanifest is stored in separate revlog $ mkdir dir1 $ echo 1 > dir1/a $ echo 1 > dir1/b $ echo 1 > e $ hg ci -Aqm 'add dir1' $ hg debugdata -m 1 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc) b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc) dir1\x008b3ffd73f901e83304c83d33132c8e774ceac44et (esc) e\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc) $ hg debugdata --dir dir1 0 a\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc) b\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc) Can add nested directories $ mkdir dir1/dir1 $ echo 2 > dir1/dir1/a $ echo 2 > dir1/dir1/b $ mkdir dir1/dir2 $ echo 2 > dir1/dir2/a $ echo 2 > dir1/dir2/b $ hg ci -Aqm 'add dir1/dir1' $ hg files -r . a b dir1/a dir1/b dir1/dir1/a dir1/dir1/b dir1/dir2/a dir1/dir2/b e The manifest command works $ hg manifest a b dir1/a dir1/b dir1/dir1/a dir1/dir1/b dir1/dir2/a dir1/dir2/b e Revision is not created for unchanged directory $ mkdir dir2 $ echo 3 > dir2/a $ hg add dir2 adding dir2/a $ hg debugindex --dir dir1 > before $ hg ci -qm 'add dir2' $ hg debugindex --dir dir1 > after $ diff before after $ rm before after Removing directory does not create an revlog entry $ hg rm dir1/dir1 removing dir1/dir1/a removing dir1/dir1/b $ hg debugindex --dir dir1/dir1 > before $ hg ci -qm 'remove dir1/dir1' $ hg debugindex --dir dir1/dir1 > after $ diff before after $ rm before after Check that hg files (calls treemanifest.walk()) works without loading all directory revlogs $ hg co 'desc("add dir2")' 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ mv .hg/store/meta/dir2 .hg/store/meta/dir2-backup $ hg files -r . dir1 dir1/a dir1/b dir1/dir1/a dir1/dir1/b dir1/dir2/a dir1/dir2/b Check that status between revisions works (calls treemanifest.matches()) without loading all directory revlogs $ hg status --rev 'desc("add dir1")' --rev . dir1 A dir1/dir1/a A dir1/dir1/b A dir1/dir2/a A dir1/dir2/b $ mv .hg/store/meta/dir2-backup .hg/store/meta/dir2 Merge creates 2-parent revision of directory revlog $ echo 5 > dir1/a $ hg ci -Aqm 'modify dir1/a' $ hg co '.^' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 6 > dir1/b $ hg ci -Aqm 'modify dir1/b' $ hg merge 'desc("modify dir1/a")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m 'conflict-free merge involving dir1/' $ cat dir1/a 5 $ cat dir1/b 6 $ hg debugindex --dir dir1 rev offset length delta linkrev nodeid p1 p2 0 0 54 -1 1 8b3ffd73f901 000000000000 000000000000 1 54 68 0 2 68e9d057c5a8 8b3ffd73f901 000000000000 2 122 12 1 4 4698198d2624 68e9d057c5a8 000000000000 3 134 55 1 5 44844058ccce 68e9d057c5a8 000000000000 4 189 55 1 6 bf3d9b744927 68e9d057c5a8 000000000000 5 244 55 4 7 dde7c0af2a03 bf3d9b744927 44844058ccce Merge keeping directory from parent 1 does not create revlog entry. (Note that dir1's manifest does change, but only because dir1/a's filelog changes.) $ hg co 'desc("add dir2")' 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 8 > dir2/a $ hg ci -m 'modify dir2/a' created new head $ hg debugindex --dir dir2 > before $ hg merge 'desc("modify dir1/a")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg revert -r 'desc("modify dir2/a")' . reverting dir1/a $ hg ci -m 'merge, keeping parent 1' $ hg debugindex --dir dir2 > after $ diff before after $ rm before after Merge keeping directory from parent 2 does not create revlog entry. (Note that dir2's manifest does change, but only because dir2/a's filelog changes.) $ hg co 'desc("modify dir2/a")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg debugindex --dir dir1 > before $ hg merge 'desc("modify dir1/a")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg revert -r 'desc("modify dir1/a")' . reverting dir2/a $ hg ci -m 'merge, keeping parent 2' created new head $ hg debugindex --dir dir1 > after $ diff before after $ rm before after Create flat source repo for tests with mixed flat/tree manifests $ cd .. $ hg init repo-flat $ cd repo-flat Create a few commits with flat manifest $ echo 0 > a $ echo 0 > b $ echo 0 > e $ for d in dir1 dir1/dir1 dir1/dir2 dir2 > do > mkdir $d > echo 0 > $d/a > echo 0 > $d/b > done $ hg ci -Aqm initial $ echo 1 > a $ echo 1 > dir1/a $ echo 1 > dir1/dir1/a $ hg ci -Aqm 'modify on branch 1' $ hg co 0 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 2 > b $ echo 2 > dir1/b $ echo 2 > dir1/dir1/b $ hg ci -Aqm 'modify on branch 2' $ hg merge 1 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m 'merge of flat manifests to new flat manifest' $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log $ cat hg.pid >> $DAEMON_PIDS Create clone with tree manifests enabled $ cd .. $ hg clone --config experimental.treemanifest=1 \ > http://localhost:$HGPORT repo-mixed -r 1 adding changesets adding manifests adding file changes added 2 changesets with 14 changes to 11 files new changesets 5b02a3e8db7e:581ef6037d8b updating to branch default 11 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd repo-mixed $ test -d .hg/store/meta [1] $ grep treemanifest .hg/requires treemanifest Should be possible to push updates from flat to tree manifest repo $ hg -R ../repo-flat push ssh://user@dummy/repo-mixed pushing to ssh://user@dummy/repo-mixed searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 2 changesets with 3 changes to 3 files Commit should store revlog per directory $ hg co 1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 3 > a $ echo 3 > dir1/a $ echo 3 > dir1/dir1/a $ hg ci -m 'first tree' created new head $ find .hg/store/meta | sort .hg/store/meta .hg/store/meta/dir1 .hg/store/meta/dir1/00manifest.i .hg/store/meta/dir1/dir1 .hg/store/meta/dir1/dir1/00manifest.i .hg/store/meta/dir1/dir2 .hg/store/meta/dir1/dir2/00manifest.i .hg/store/meta/dir2 .hg/store/meta/dir2/00manifest.i Merge of two trees $ hg co 2 6 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge 1 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m 'merge of flat manifests to new tree manifest' created new head $ hg diff -r 3 Parent of tree root manifest should be flat manifest, and two for merge $ hg debugindex -m rev offset length delta linkrev nodeid p1 p2 0 0 80 -1 0 40536115ed9e 000000000000 000000000000 1 80 83 0 1 f3376063c255 40536115ed9e 000000000000 2 163 89 0 2 5d9b9da231a2 40536115ed9e 000000000000 3 252 83 2 3 d17d663cbd8a 5d9b9da231a2 f3376063c255 4 335 124 1 4 51e32a8c60ee f3376063c255 000000000000 5 459 126 2 5 cc5baa78b230 5d9b9da231a2 f3376063c255 Status across flat/tree boundary should work $ hg status --rev '.^' --rev . M a M dir1/a M dir1/dir1/a Turning off treemanifest config has no effect $ hg debugindex --dir dir1 rev offset length delta linkrev nodeid p1 p2 0 0 127 -1 4 064927a0648a 000000000000 000000000000 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000 $ echo 2 > dir1/a $ hg --config experimental.treemanifest=False ci -qm 'modify dir1/a' $ hg debugindex --dir dir1 rev offset length delta linkrev nodeid p1 p2 0 0 127 -1 4 064927a0648a 000000000000 000000000000 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000 2 238 55 1 6 5b16163a30c6 25ecb8cb8618 000000000000 Stripping and recovering changes should work $ hg st --change tip M dir1/a $ hg --config extensions.strip= strip tip 1 files updated, 0 files merged, 0 files removed, 0 files unresolved saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/51cfd7b1e13b-78a2f3ed-backup.hg $ hg debugindex --dir dir1 rev offset length delta linkrev nodeid p1 p2 0 0 127 -1 4 064927a0648a 000000000000 000000000000 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000 $ hg incoming .hg/strip-backup/* comparing with .hg/strip-backup/*-backup.hg (glob) searching for changes changeset: 6:51cfd7b1e13b tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modify dir1/a $ hg pull .hg/strip-backup/* pulling from .hg/strip-backup/51cfd7b1e13b-78a2f3ed-backup.hg searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 51cfd7b1e13b (run 'hg update' to get a working copy) $ hg --config extensions.strip= strip tip saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/*-backup.hg (glob) $ hg unbundle -q .hg/strip-backup/* $ hg debugindex --dir dir1 rev offset length delta linkrev nodeid p1 p2 0 0 127 -1 4 064927a0648a 000000000000 000000000000 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000 2 238 55 1 6 5b16163a30c6 25ecb8cb8618 000000000000 $ hg st --change tip M dir1/a Shelving and unshelving should work $ echo foo >> dir1/a $ hg --config extensions.shelve= shelve shelved as default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg --config extensions.shelve= unshelve unshelving change 'default' $ hg diff --nodates diff -r 708a273da119 dir1/a --- a/dir1/a +++ b/dir1/a @@ -1,1 +1,2 @@ 1 +foo Pushing from treemanifest repo to an empty repo makes that a treemanifest repo $ cd .. $ hg init empty-repo $ cat << EOF >> empty-repo/.hg/hgrc > [experimental] > changegroup3=yes > EOF $ grep treemanifest empty-repo/.hg/requires [1] $ hg push -R repo -r 0 empty-repo pushing to empty-repo searching for changes adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files $ grep treemanifest empty-repo/.hg/requires treemanifest Pushing to an empty repo works $ hg --config experimental.treemanifest=1 init clone $ grep treemanifest clone/.hg/requires treemanifest $ hg push -R repo clone pushing to clone searching for changes adding changesets adding manifests adding file changes added 11 changesets with 15 changes to 10 files (+3 heads) $ grep treemanifest clone/.hg/requires treemanifest $ hg -R clone verify checking changesets checking manifests checking directory manifests crosschecking files in changesets and manifests checking files 10 files, 11 changesets, 15 total revisions Create deeper repo with tree manifests. $ hg --config experimental.treemanifest=True init deeprepo $ cd deeprepo $ mkdir .A $ mkdir b $ mkdir b/bar $ mkdir b/bar/orange $ mkdir b/bar/orange/fly $ mkdir b/foo $ mkdir b/foo/apple $ mkdir b/foo/apple/bees $ touch .A/one.txt $ touch .A/two.txt $ touch b/bar/fruits.txt $ touch b/bar/orange/fly/gnat.py $ touch b/bar/orange/fly/housefly.txt $ touch b/foo/apple/bees/flower.py $ touch c.txt $ touch d.py $ hg ci -Aqm 'initial' $ echo >> .A/one.txt $ echo >> .A/two.txt $ echo >> b/bar/fruits.txt $ echo >> b/bar/orange/fly/gnat.py $ echo >> b/bar/orange/fly/housefly.txt $ echo >> b/foo/apple/bees/flower.py $ echo >> c.txt $ echo >> d.py $ hg ci -Aqm 'second' We'll see that visitdir works by removing some treemanifest revlogs and running the files command with various parameters. Test files from the root. $ hg files -r . .A/one.txt .A/two.txt b/bar/fruits.txt b/bar/orange/fly/gnat.py b/bar/orange/fly/housefly.txt b/foo/apple/bees/flower.py c.txt d.py Excludes with a glob should not exclude everything from the glob's root $ hg files -r . -X 'b/fo?' b b/bar/fruits.txt b/bar/orange/fly/gnat.py b/bar/orange/fly/housefly.txt $ cp -R .hg/store .hg/store-copy Test files for a subdirectory. $ rm -r .hg/store/meta/~2e_a $ hg files -r . b b/bar/fruits.txt b/bar/orange/fly/gnat.py b/bar/orange/fly/housefly.txt b/foo/apple/bees/flower.py $ hg diff -r '.^' -r . --stat b b/bar/fruits.txt | 1 + b/bar/orange/fly/gnat.py | 1 + b/bar/orange/fly/housefly.txt | 1 + b/foo/apple/bees/flower.py | 1 + 4 files changed, 4 insertions(+), 0 deletions(-) $ cp -R .hg/store-copy/. .hg/store Test files with just includes and excludes. $ rm -r .hg/store/meta/~2e_a $ rm -r .hg/store/meta/b/bar/orange/fly $ rm -r .hg/store/meta/b/foo/apple/bees $ hg files -r . -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees b/bar/fruits.txt $ hg diff -r '.^' -r . --stat -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees b/bar/fruits.txt | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) $ cp -R .hg/store-copy/. .hg/store Test files for a subdirectory, excluding a directory within it. $ rm -r .hg/store/meta/~2e_a $ rm -r .hg/store/meta/b/foo $ hg files -r . -X path:b/foo b b/bar/fruits.txt b/bar/orange/fly/gnat.py b/bar/orange/fly/housefly.txt $ hg diff -r '.^' -r . --stat -X path:b/foo b b/bar/fruits.txt | 1 + b/bar/orange/fly/gnat.py | 1 + b/bar/orange/fly/housefly.txt | 1 + 3 files changed, 3 insertions(+), 0 deletions(-) $ cp -R .hg/store-copy/. .hg/store Test files for a sub directory, including only a directory within it, and including an unrelated directory. $ rm -r .hg/store/meta/~2e_a $ rm -r .hg/store/meta/b/foo $ hg files -r . -I path:b/bar/orange -I path:a b b/bar/orange/fly/gnat.py b/bar/orange/fly/housefly.txt $ hg diff -r '.^' -r . --stat -I path:b/bar/orange -I path:a b b/bar/orange/fly/gnat.py | 1 + b/bar/orange/fly/housefly.txt | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) $ cp -R .hg/store-copy/. .hg/store Test files for a pattern, including a directory, and excluding a directory within that. $ rm -r .hg/store/meta/~2e_a $ rm -r .hg/store/meta/b/foo $ rm -r .hg/store/meta/b/bar/orange $ hg files -r . glob:**.txt -I path:b/bar -X path:b/bar/orange b/bar/fruits.txt $ hg diff -r '.^' -r . --stat glob:**.txt -I path:b/bar -X path:b/bar/orange b/bar/fruits.txt | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) $ cp -R .hg/store-copy/. .hg/store Add some more changes to the deep repo $ echo narf >> b/bar/fruits.txt $ hg ci -m narf $ echo troz >> b/bar/orange/fly/gnat.py $ hg ci -m troz Verify works $ hg verify checking changesets checking manifests checking directory manifests crosschecking files in changesets and manifests checking files 8 files, 4 changesets, 18 total revisions Dirlogs are included in fncache $ grep meta/.A/00manifest.i .hg/store/fncache meta/.A/00manifest.i Rebuilt fncache includes dirlogs $ rm .hg/store/fncache $ hg debugrebuildfncache adding data/.A/one.txt.i adding data/.A/two.txt.i adding data/b/bar/fruits.txt.i adding data/b/bar/orange/fly/gnat.py.i adding data/b/bar/orange/fly/housefly.txt.i adding data/b/foo/apple/bees/flower.py.i adding data/c.txt.i adding data/d.py.i adding meta/.A/00manifest.i adding meta/b/00manifest.i adding meta/b/bar/00manifest.i adding meta/b/bar/orange/00manifest.i adding meta/b/bar/orange/fly/00manifest.i adding meta/b/foo/00manifest.i adding meta/b/foo/apple/00manifest.i adding meta/b/foo/apple/bees/00manifest.i 16 items added, 0 removed from fncache Finish first server $ killdaemons.py Back up the recently added revlogs $ cp -R .hg/store .hg/store-newcopy Verify reports missing dirlog $ rm .hg/store/meta/b/00manifest.* $ hg verify checking changesets checking manifests checking directory manifests 0: empty or missing b/ b/@0: parent-directory manifest refers to unknown revision 67688a370455 b/@1: parent-directory manifest refers to unknown revision f065da70369e b/@2: parent-directory manifest refers to unknown revision ac0d30948e0b b/@3: parent-directory manifest refers to unknown revision 367152e6af28 warning: orphan revlog 'meta/b/bar/00manifest.i' warning: orphan revlog 'meta/b/bar/orange/00manifest.i' warning: orphan revlog 'meta/b/bar/orange/fly/00manifest.i' warning: orphan revlog 'meta/b/foo/00manifest.i' warning: orphan revlog 'meta/b/foo/apple/00manifest.i' warning: orphan revlog 'meta/b/foo/apple/bees/00manifest.i' crosschecking files in changesets and manifests b/bar/fruits.txt@0: in changeset but not in manifest b/bar/orange/fly/gnat.py@0: in changeset but not in manifest b/bar/orange/fly/housefly.txt@0: in changeset but not in manifest b/foo/apple/bees/flower.py@0: in changeset but not in manifest checking files 8 files, 4 changesets, 18 total revisions 6 warnings encountered! 9 integrity errors encountered! (first damaged changeset appears to be 0) [1] $ cp -R .hg/store-newcopy/. .hg/store Verify reports missing dirlog entry $ mv -f .hg/store-copy/meta/b/00manifest.* .hg/store/meta/b/ $ hg verify checking changesets checking manifests checking directory manifests b/@2: parent-directory manifest refers to unknown revision ac0d30948e0b b/@3: parent-directory manifest refers to unknown revision 367152e6af28 b/bar/@?: rev 2 points to unexpected changeset 2 b/bar/@?: 44d7e1146e0d not in parent-directory manifest b/bar/@?: rev 3 points to unexpected changeset 3 b/bar/@?: 70b10c6b17b7 not in parent-directory manifest b/bar/orange/@?: rev 2 points to unexpected changeset 3 (expected None) b/bar/orange/fly/@?: rev 2 points to unexpected changeset 3 (expected None) crosschecking files in changesets and manifests checking files 8 files, 4 changesets, 18 total revisions 2 warnings encountered! 8 integrity errors encountered! (first damaged changeset appears to be 2) [1] $ cp -R .hg/store-newcopy/. .hg/store Test cloning a treemanifest repo over http. $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log $ cat hg.pid >> $DAEMON_PIDS $ cd .. We can clone even with the knob turned off and we'll get a treemanifest repo. $ hg clone --config experimental.treemanifest=False \ > --config experimental.changegroup3=True \ > http://localhost:$HGPORT deepclone requesting all changes adding changesets adding manifests adding file changes added 4 changesets with 18 changes to 8 files new changesets 775704be6f52:523e5c631710 updating to branch default 8 files updated, 0 files merged, 0 files removed, 0 files unresolved No server errors. $ cat deeprepo/errors.log requires got updated to include treemanifest $ cat deepclone/.hg/requires | grep treemanifest treemanifest Tree manifest revlogs exist. $ find deepclone/.hg/store/meta | sort deepclone/.hg/store/meta deepclone/.hg/store/meta/b deepclone/.hg/store/meta/b/00manifest.i deepclone/.hg/store/meta/b/bar deepclone/.hg/store/meta/b/bar/00manifest.i deepclone/.hg/store/meta/b/bar/orange deepclone/.hg/store/meta/b/bar/orange/00manifest.i deepclone/.hg/store/meta/b/bar/orange/fly deepclone/.hg/store/meta/b/bar/orange/fly/00manifest.i deepclone/.hg/store/meta/b/foo deepclone/.hg/store/meta/b/foo/00manifest.i deepclone/.hg/store/meta/b/foo/apple deepclone/.hg/store/meta/b/foo/apple/00manifest.i deepclone/.hg/store/meta/b/foo/apple/bees deepclone/.hg/store/meta/b/foo/apple/bees/00manifest.i deepclone/.hg/store/meta/~2e_a deepclone/.hg/store/meta/~2e_a/00manifest.i Verify passes. $ cd deepclone $ hg verify checking changesets checking manifests checking directory manifests crosschecking files in changesets and manifests checking files 8 files, 4 changesets, 18 total revisions $ cd .. Create clones using old repo formats to use in later tests $ hg clone --config format.usestore=False \ > --config experimental.changegroup3=True \ > http://localhost:$HGPORT deeprepo-basicstore requesting all changes adding changesets adding manifests adding file changes added 4 changesets with 18 changes to 8 files new changesets 775704be6f52:523e5c631710 updating to branch default 8 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd deeprepo-basicstore $ grep store .hg/requires [1] $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --errorlog=errors.log $ cat hg.pid >> $DAEMON_PIDS $ cd .. $ hg clone --config format.usefncache=False \ > --config experimental.changegroup3=True \ > http://localhost:$HGPORT deeprepo-encodedstore requesting all changes adding changesets adding manifests adding file changes added 4 changesets with 18 changes to 8 files new changesets 775704be6f52:523e5c631710 updating to branch default 8 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd deeprepo-encodedstore $ grep fncache .hg/requires [1] $ hg serve -p $HGPORT2 -d --pid-file=hg.pid --errorlog=errors.log $ cat hg.pid >> $DAEMON_PIDS $ cd .. Local clone with basicstore $ hg clone -U deeprepo-basicstore local-clone-basicstore $ hg -R local-clone-basicstore verify checking changesets checking manifests checking directory manifests crosschecking files in changesets and manifests checking files 8 files, 4 changesets, 18 total revisions Local clone with encodedstore $ hg clone -U deeprepo-encodedstore local-clone-encodedstore $ hg -R local-clone-encodedstore verify checking changesets checking manifests checking directory manifests crosschecking files in changesets and manifests checking files 8 files, 4 changesets, 18 total revisions Local clone with fncachestore $ hg clone -U deeprepo local-clone-fncachestore $ hg -R local-clone-fncachestore verify checking changesets checking manifests checking directory manifests crosschecking files in changesets and manifests checking files 8 files, 4 changesets, 18 total revisions Stream clone with basicstore $ hg clone --config experimental.changegroup3=True --stream -U \ > http://localhost:$HGPORT1 stream-clone-basicstore streaming all changes 18 files to transfer, * of data (glob) transferred * in * seconds (*) (glob) searching for changes no changes found $ hg -R stream-clone-basicstore verify checking changesets checking manifests checking directory manifests crosschecking files in changesets and manifests checking files 8 files, 4 changesets, 18 total revisions Stream clone with encodedstore $ hg clone --config experimental.changegroup3=True --stream -U \ > http://localhost:$HGPORT2 stream-clone-encodedstore streaming all changes 18 files to transfer, * of data (glob) transferred * in * seconds (*) (glob) searching for changes no changes found $ hg -R stream-clone-encodedstore verify checking changesets checking manifests checking directory manifests crosschecking files in changesets and manifests checking files 8 files, 4 changesets, 18 total revisions Stream clone with fncachestore $ hg clone --config experimental.changegroup3=True --stream -U \ > http://localhost:$HGPORT stream-clone-fncachestore streaming all changes 18 files to transfer, * of data (glob) transferred * in * seconds (*) (glob) searching for changes no changes found $ hg -R stream-clone-fncachestore verify checking changesets checking manifests checking directory manifests crosschecking files in changesets and manifests checking files 8 files, 4 changesets, 18 total revisions Packed bundle $ hg -R deeprepo debugcreatestreamclonebundle repo-packed.hg writing 5330 bytes for 18 files bundle requirements: generaldelta, revlogv1, treemanifest $ hg debugbundle --spec repo-packed.hg none-packed1;requirements%3Dgeneraldelta%2Crevlogv1%2Ctreemanifest Bundle with changegroup2 is not supported $ hg -R deeprepo bundle --all -t v2 deeprepo.bundle abort: repository does not support bundle version 02 [255] Pull does not include changegroup for manifest the client already has from other branch $ mkdir grafted-dir-repo $ cd grafted-dir-repo $ hg --config experimental.treemanifest=1 init $ mkdir dir $ echo a > dir/file $ echo a > file $ hg ci -Am initial adding dir/file adding file $ echo b > dir/file $ hg ci -m updated $ hg co '.^' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg revert -r tip dir/ reverting dir/file $ echo b > file # to make sure root manifest is sent $ hg ci -m grafted created new head $ cd .. $ hg --config experimental.treemanifest=1 clone --pull -r 1 \ > grafted-dir-repo grafted-dir-repo-clone adding changesets adding manifests adding file changes added 2 changesets with 3 changes to 2 files new changesets d84f4c419457:09ab742f3b0f updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd grafted-dir-repo-clone $ hg pull -r 2 pulling from $TESTTMP/grafted-dir-repo searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 73699489fb7c (run 'hg heads' to see heads, 'hg merge' to merge) Committing a empty commit does not duplicate root treemanifest $ echo z >> z $ hg commit -Aqm 'pre-empty commit' $ hg rm z $ hg commit --amend -m 'empty commit' saved backup bundle to $TESTTMP/grafted-dir-repo-clone/.hg/strip-backup/cb99d5717cea-9e3b6b02-amend.hg $ hg log -r 'tip + tip^' -T '{manifest}\n' 1:678d3574b88c 1:678d3574b88c $ hg --config extensions.strip= strip -r . -q mercurial-4.5.3/tests/test-rollback.t0000644015407300116100000003026313261161234017476 0ustar augieeng00000000000000setup repo $ hg init t $ cd t $ echo a > a $ hg commit -Am'add a' adding a $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 1 changesets, 1 total revisions $ hg parents changeset: 0:1f0dee641bb7 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add a rollback to null revision $ hg status $ hg rollback repository tip rolled back to revision -1 (undo commit) working directory now based on revision -1 $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 0 files, 0 changesets, 0 total revisions $ hg parents $ hg status A a Two changesets this time so we rollback to a real changeset $ hg commit -m'add a again' $ echo a >> a $ hg commit -m'modify a' Test issue 902 (current branch is preserved) $ hg branch test marked working directory as branch test (branches are permanent and global, did you want a bookmark?) $ hg rollback repository tip rolled back to revision 0 (undo commit) working directory now based on revision 0 $ hg branch default Test issue 1635 (commit message saved) $ cat .hg/last-message.txt ; echo modify a Test rollback of hg before issue 902 was fixed $ hg commit -m "test3" $ hg branch test marked working directory as branch test (branches are permanent and global, did you want a bookmark?) $ rm .hg/undo.branch $ hg rollback repository tip rolled back to revision 0 (undo commit) named branch could not be reset: current branch is still 'test' working directory now based on revision 0 $ hg branch test working dir unaffected by rollback: do not restore dirstate et. al. $ hg log --template '{rev} {branch} {desc|firstline}\n' 0 default add a again $ hg status M a $ hg bookmark foo $ hg commit -m'modify a again' $ echo b > b $ hg bookmark bar -r default #making bar active, before the transaction $ hg commit -Am'add b' adding b $ hg log --template '{rev} {branch} {desc|firstline}\n' 2 test add b 1 test modify a again 0 default add a again $ hg update bar 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (activating bookmark bar) $ cat .hg/undo.branch ; echo test $ hg rollback -f repository tip rolled back to revision 1 (undo commit) $ hg id -n 0 $ hg branch default $ cat .hg/bookmarks.current ; echo bar $ hg bookmark --delete foo bar rollback by pretxncommit saves commit message (issue1635) $ echo a >> a $ hg --config hooks.pretxncommit=false commit -m"precious commit message" transaction abort! rollback completed abort: pretxncommit hook exited with status * (glob) [255] $ cat .hg/last-message.txt ; echo precious commit message same thing, but run $EDITOR $ cat > editor.sh << '__EOF__' > echo "another precious commit message" > "$1" > __EOF__ $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg --config hooks.pretxncommit=false commit 2>&1 note: commit message saved in .hg/last-message.txt transaction abort! rollback completed abort: pretxncommit hook exited with status * (glob) [255] $ cat .hg/last-message.txt another precious commit message test rollback on served repository #if serve $ hg commit -m "precious commit message" $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS $ cd .. $ hg clone http://localhost:$HGPORT u requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 2 changes to 1 files (+1 heads) new changesets 23b0221f3370:068774709090 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd u $ hg id default 068774709090 now rollback and observe that 'hg serve' reloads the repository and presents the correct tip changeset: $ hg -R ../t rollback repository tip rolled back to revision 1 (undo commit) working directory now based on revision 0 $ hg id default 791dd2169706 $ killdaemons.py #endif update to older changeset and then refuse rollback, because that would lose data (issue2998) $ cd ../t $ hg -q update $ rm `hg status -un` $ template='{rev}:{node|short} [{branch}] {desc|firstline}\n' $ echo 'valuable new file' > b $ echo 'valuable modification' >> a $ hg commit -A -m'a valuable change' adding b $ hg update 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg rollback abort: rollback of last commit while not checked out may lose data (use -f to force) [255] $ hg tip -q 2:4d9cd3795eea $ hg rollback -f repository tip rolled back to revision 1 (undo commit) $ hg status $ hg log --removed b # yep, it's gone same again, but emulate an old client that doesn't write undo.desc $ hg -q update $ echo 'valuable modification redux' >> a $ hg commit -m'a valuable change redux' $ rm .hg/undo.desc $ hg update 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg rollback rolling back unknown transaction $ cat a a corrupt journal test $ echo "foo" > .hg/store/journal $ hg recover rolling back interrupted transaction couldn't read journal entry 'foo\n'! checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 2 changesets, 2 total revisions rollback disabled by config $ cat >> $HGRCPATH < [ui] > rollback = false > EOF $ echo narf >> pinky-sayings.txt $ hg add pinky-sayings.txt $ hg ci -m 'First one.' $ hg rollback abort: rollback is disabled because it is unsafe (see `hg help -v rollback` for information) [255] $ cd .. I/O errors on stdio are handled properly (issue5658) $ cat > badui.py << EOF > import errno > from mercurial.i18n import _ > from mercurial import ( > registrar, > error, > ui as uimod, > ) > > configtable = {} > configitem = registrar.configitem(configtable) > > configitem('ui', 'ioerrors', > default=list, > ) > > def pretxncommit(ui, repo, **kwargs): > ui.warn('warn during pretxncommit\n') > > def pretxnclose(ui, repo, **kwargs): > ui.warn('warn during pretxnclose\n') > > def txnclose(ui, repo, **kwargs): > ui.warn('warn during txnclose\n') > > def txnabort(ui, repo, **kwargs): > ui.warn('warn during abort\n') > > class fdproxy(object): > def __init__(self, ui, o): > self._ui = ui > self._o = o > > def __getattr__(self, attr): > return getattr(self._o, attr) > > def write(self, msg): > errors = set(self._ui.configlist('ui', 'ioerrors')) > pretxncommit = msg == 'warn during pretxncommit\n' > pretxnclose = msg == 'warn during pretxnclose\n' > txnclose = msg == 'warn during txnclose\n' > txnabort = msg == 'warn during abort\n' > msgabort = msg == _('transaction abort!\n') > msgrollback = msg == _('rollback completed\n') > > if pretxncommit and 'pretxncommit' in errors: > raise IOError(errno.EPIPE, 'simulated epipe') > if pretxnclose and 'pretxnclose' in errors: > raise IOError(errno.EIO, 'simulated eio') > if txnclose and 'txnclose' in errors: > raise IOError(errno.EBADF, 'simulated badf') > if txnabort and 'txnabort' in errors: > raise IOError(errno.EPIPE, 'simulated epipe') > if msgabort and 'msgabort' in errors: > raise IOError(errno.EBADF, 'simulated ebadf') > if msgrollback and 'msgrollback' in errors: > raise IOError(errno.EIO, 'simulated eio') > > return self._o.write(msg) > > def uisetup(ui): > class badui(ui.__class__): > def write_err(self, *args, **kwargs): > olderr = self.ferr > try: > self.ferr = fdproxy(self, olderr) > return super(badui, self).write_err(*args, **kwargs) > finally: > self.ferr = olderr > > ui.__class__ = badui > > def reposetup(ui, repo): > ui.setconfig('hooks', 'pretxnclose.badui', pretxnclose, 'badui') > ui.setconfig('hooks', 'txnclose.badui', txnclose, 'badui') > ui.setconfig('hooks', 'pretxncommit.badui', pretxncommit, 'badui') > ui.setconfig('hooks', 'txnabort.badui', txnabort, 'badui') > EOF $ cat >> $HGRCPATH << EOF > [extensions] > badui = $TESTTMP/badui.py > EOF An I/O error during pretxncommit is handled $ hg init ioerror-pretxncommit $ cd ioerror-pretxncommit $ echo 0 > foo $ hg -q commit -A -m initial warn during pretxncommit warn during pretxnclose warn during txnclose $ echo 1 > foo $ hg --config ui.ioerrors=pretxncommit commit -m 'error during pretxncommit' warn during pretxnclose warn during txnclose $ hg commit -m 'commit 1' nothing changed [1] $ cd .. An I/O error during pretxnclose is handled $ hg init ioerror-pretxnclose $ cd ioerror-pretxnclose $ echo 0 > foo $ hg -q commit -A -m initial warn during pretxncommit warn during pretxnclose warn during txnclose $ echo 1 > foo $ hg --config ui.ioerrors=pretxnclose commit -m 'error during pretxnclose' warn during pretxncommit warn during txnclose $ hg commit -m 'commit 1' nothing changed [1] $ cd .. An I/O error during txnclose is handled $ hg init ioerror-txnclose $ cd ioerror-txnclose $ echo 0 > foo $ hg -q commit -A -m initial warn during pretxncommit warn during pretxnclose warn during txnclose $ echo 1 > foo $ hg --config ui.ioerrors=txnclose commit -m 'error during txnclose' warn during pretxncommit warn during pretxnclose $ hg commit -m 'commit 1' nothing changed [1] $ cd .. An I/O error writing "transaction abort" is handled $ hg init ioerror-msgabort $ cd ioerror-msgabort $ echo 0 > foo $ hg -q commit -A -m initial warn during pretxncommit warn during pretxnclose warn during txnclose $ echo 1 > foo $ hg --config ui.ioerrors=msgabort --config hooks.pretxncommit=false commit -m 'error during abort message' warn during abort rollback completed abort: pretxncommit hook exited with status 1 [255] $ hg commit -m 'commit 1' warn during pretxncommit warn during pretxnclose warn during txnclose $ cd .. An I/O error during txnabort should still result in rollback $ hg init ioerror-txnabort $ cd ioerror-txnabort $ echo 0 > foo $ hg -q commit -A -m initial warn during pretxncommit warn during pretxnclose warn during txnclose $ echo 1 > foo $ hg --config ui.ioerrors=txnabort --config hooks.pretxncommit=false commit -m 'error during abort' transaction abort! rollback completed abort: pretxncommit hook exited with status 1 [255] $ hg commit -m 'commit 1' warn during pretxncommit warn during pretxnclose warn during txnclose $ cd .. An I/O error writing "rollback completed" is handled $ hg init ioerror-msgrollback $ cd ioerror-msgrollback $ echo 0 > foo $ hg -q commit -A -m initial warn during pretxncommit warn during pretxnclose warn during txnclose $ echo 1 > foo $ hg --config ui.ioerrors=msgrollback --config hooks.pretxncommit=false commit -m 'error during rollback message' transaction abort! warn during abort abort: pretxncommit hook exited with status 1 [255] $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 1 changesets, 1 total revisions $ cd .. Multiple I/O errors after transaction open are handled. This is effectively what happens if a peer disconnects in the middle of a transaction. $ hg init ioerror-multiple $ cd ioerror-multiple $ echo 0 > foo $ hg -q commit -A -m initial warn during pretxncommit warn during pretxnclose warn during txnclose $ echo 1 > foo $ hg --config ui.ioerrors=pretxncommit,pretxnclose,txnclose,txnabort,msgabort,msgrollback commit -m 'multiple errors' $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 2 changesets, 2 total revisions $ cd .. mercurial-4.5.3/tests/test-gendoc-ru.t0000644015407300116100000000012413261161234017561 0ustar augieeng00000000000000#require docutils gettext $ $TESTDIR/check-gendoc ru checking for parse errors mercurial-4.5.3/tests/test-push-checkheads-pruned-B3.t0000644015407300116100000000377613261161234022512 0ustar augieeng00000000000000==================================== Testing head checking code: Case B-3 ==================================== Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This case is part of a series of tests checking this behavior. Category B: simple case involving pruned changesets TestCase 3: multi-changeset branch, other is pruned, rest is superceeded .. old-state: .. .. * 2 changeset branch .. .. new-state: .. .. * old head is superceeded .. * old other is pruned .. .. expected-result: .. .. * push allowed .. .. graph-summary: .. .. B ø⇠◔ B' .. | | .. A ⊗ | .. |/ .. â— $ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir B3 $ cd B3 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd server $ mkcommit B0 $ cd ../client $ hg pull pulling from $TESTTMP/B3/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets d73caddc5533 (run 'hg update' to get a working copy) $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit B1 created new head $ hg debugobsolete --record-parents `getid "desc(A0)"` obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` obsoleted 1 changesets $ hg log -G --hidden @ 25c56d33e4c4 (draft): B1 | | x d73caddc5533 (draft): B0 | | | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): root Actual testing -------------- $ hg push pushing to $TESTTMP/B3/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) 2 new obsolescence markers obsoleted 2 changesets $ cd ../.. mercurial-4.5.3/tests/test-unified-test.t0000644015407300116100000000374013261161234020305 0ustar augieeng00000000000000Test that the syntax of "unified tests" is properly processed ============================================================== Simple commands: $ echo foo foo $ printf 'oh no' oh no (no-eol) $ printf 'bar\nbaz\n' | cat bar baz Multi-line command: $ foo() { > echo bar > } $ foo bar Return codes before inline python: $ sh -c 'exit 1' [1] Doctest commands: >>> from __future__ import print_function >>> print('foo') foo $ echo interleaved interleaved >>> for c in 'xyz': ... print(c) x y z >>> print() >>> foo = 'global name' >>> def func(): ... print(foo, 'should be visible in func()') >>> func() global name should be visible in func() >>> print('''multiline ... string''') multiline string Regular expressions: $ echo foobarbaz foobar.* (re) $ echo barbazquux .*quux.* (re) Globs: $ printf '* \\foobarbaz {10}\n' \* \\fo?bar* {10} (glob) Literal match ending in " (re)": $ echo 'foo (re)' foo (re) Windows: \r\n is handled like \n and can be escaped: #if windows $ printf 'crlf\r\ncr\r\tcrlf\r\ncrlf\r\n' crlf cr\r (no-eol) (esc) \tcrlf (esc) crlf\r (esc) #endif Combining esc with other markups - and handling lines ending with \r instead of \n: $ printf 'foo/bar\r' fo?/bar\r (no-eol) (glob) (esc) #if windows $ printf 'foo\\bar\r' foo/bar\r (no-eol) (esc) #endif $ printf 'foo/bar\rfoo/bar\r' foo.bar\r \(no-eol\) (re) (esc) foo.bar\r \(no-eol\) (re) testing hghave $ hghave true $ hghave false skipped: missing feature: nail clipper [1] $ hghave no-true skipped: system supports yak shaving [1] $ hghave no-false Conditional sections based on hghave: #if true $ echo tested tested #else $ echo skipped #endif #if false $ echo skipped #else $ echo tested tested #endif #if no-false $ echo tested tested #else $ echo skipped #endif #if no-true $ echo skipped #else $ echo tested tested #endif Exit code: $ (exit 1) [1] mercurial-4.5.3/tests/test-keyword.t0000644015407300116100000007730213261161234017376 0ustar augieeng00000000000000Run kwdemo outside a repo $ hg -q --config extensions.keyword= --config keywordmaps.Foo="{author|user}" kwdemo [extensions] keyword = [keyword] demo.txt = [keywordset] svn = False [keywordmaps] Foo = {author|user} $Foo: test $ $ cat <> $HGRCPATH > [extensions] > keyword = > mq = > notify = > record = > transplant = > [ui] > interactive = true > EOF hide outer repo $ hg init Run kwdemo before [keyword] files are set up as it would succeed without uisetup otherwise $ hg --quiet kwdemo [extensions] keyword = [keyword] demo.txt = [keywordset] svn = False [keywordmaps] Author = {author|user} Date = {date|utcdate} Header = {root}/{file},v {node|short} {date|utcdate} {author|user} Id = {file|basename},v {node|short} {date|utcdate} {author|user} RCSFile = {file|basename},v RCSfile = {file|basename},v Revision = {node|short} Source = {root}/{file},v $Author: test $ $Date: ????/??/?? ??:??:?? $ (glob) $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob) $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob) $RCSFile: demo.txt,v $ $RCSfile: demo.txt,v $ $Revision: ???????????? $ (glob) $Source: */demo.txt,v $ (glob) $ hg --quiet kwdemo "Branch = {branches}" [extensions] keyword = [keyword] demo.txt = [keywordset] svn = False [keywordmaps] Branch = {branches} $Branch: demobranch $ (test template filter svnisodate and svnutcdate) $ hg --quiet kwdemo --config keywordset.svn=True [extensions] keyword = [keyword] demo.txt = [keywordset] svn = True [keywordmaps] Author = {author|user} Date = {date|svnisodate} Id = {file|basename},v {node|short} {date|svnutcdate} {author|user} LastChangedBy = {author|user} LastChangedDate = {date|svnisodate} LastChangedRevision = {node|short} Revision = {node|short} $Author: test $ $Date: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob) $Id: demo.txt,v ???????????? ????-??-?? ??:??:??Z test $ (glob) $LastChangedBy: test $ $LastChangedDate: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob) $LastChangedRevision: ???????????? $ (glob) $Revision: ???????????? $ (glob) $ cat <> $HGRCPATH > [keyword] > ** = > b = ignore > i = ignore > [hooks] > EOF $ cp $HGRCPATH $HGRCPATH.nohooks > cat <> $HGRCPATH > commit= > commit.test=cp a hooktest > EOF $ hg init Test-bndl $ cd Test-bndl kwshrink should exit silently in empty/invalid repo $ hg kwshrink Symlinks cannot be created on Windows. A bundle to test this was made with: hg init t cd t echo a > a ln -s a sym hg add sym hg ci -m addsym -u mercurial hg bundle --base null ../test-keyword.hg $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg pulling from *test-keyword.hg (glob) requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets a2392c293916 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 'expand $Id$' > a $ echo 'do not process $Id:' >> a $ echo 'xxx $' >> a $ echo 'ignore $Id$' > b Output files as they were created $ cat a b expand $Id$ do not process $Id: xxx $ ignore $Id$ no kwfiles $ hg kwfiles untracked candidates $ hg -v kwfiles --unknown k a Add files and check status $ hg addremove adding a adding b $ hg status A a A b Default keyword expansion including commit hook Interrupted commit should not change state or run commit hook $ hg --debug commit abort: empty commit message [255] $ hg status A a A b Commit with several checks $ hg --debug commit -mabsym -u 'User Name ' committing files: a b committing manifest committing changelog overwriting a expanding keywords updating the branch cache committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9 running hook commit.test: cp a hooktest $ hg status ? hooktest $ hg debugrebuildstate $ hg --quiet identify ef63ca68695b cat files in working directory with keywords expanded $ cat a b expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ do not process $Id: xxx $ ignore $Id$ hg cat files and symlink, no expansion $ hg cat sym a b && echo expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ do not process $Id: xxx $ ignore $Id$ a $ diff a hooktest $ cp $HGRCPATH.nohooks $HGRCPATH $ rm hooktest hg status of kw-ignored binary file starting with '\1\n' >>> open("i", "wb").write("\1\nfoo") $ hg -q commit -Am metasep i $ hg status >>> open("i", "wb").write("\1\nbar") $ hg status M i $ hg -q commit -m "modify metasep" i $ hg status --rev 2:3 M i $ touch empty $ hg -q commit -A -m "another file" $ hg status -A --rev 3:4 i C i $ hg -q strip --no-backup 2 Test hook execution bundle $ hg bundle --base null ../kw.hg 2 changesets found $ cd .. $ hg init Test $ cd Test Notify on pull to check whether keywords stay as is in email ie. if patch.diff wrapper acts as it should $ cat <> $HGRCPATH > [hooks] > incoming.notify = python:hgext.notify.hook > [notify] > sources = pull > diffstat = False > maxsubject = 15 > [reposubs] > * = Test > EOF Pull from bundle and trigger notify $ hg pull -u ../kw.hg pulling from ../kw.hg requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 3 changes to 3 files new changesets a2392c293916:ef63ca68695b 3 files updated, 0 files merged, 0 files removed, 0 files unresolved MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: * (glob) Subject: changeset in... From: mercurial X-Hg-Notification: changeset a2392c293916 Message-Id: (glob) To: Test changeset a2392c293916 in $TESTTMP/Test details: $TESTTMP/Test?cmd=changeset;node=a2392c293916 description: addsym diffs (6 lines): diff -r 000000000000 -r a2392c293916 sym --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sym Sat Feb 09 20:25:47 2008 +0100 @@ -0,0 +1,1 @@ +a \ No newline at end of file MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date:* (glob) Subject: changeset in... From: User Name X-Hg-Notification: changeset ef63ca68695b Message-Id: (glob) To: Test changeset ef63ca68695b in $TESTTMP/Test details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b description: absym diffs (12 lines): diff -r a2392c293916 -r ef63ca68695b a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,3 @@ +expand $Id$ +do not process $Id: +xxx $ diff -r a2392c293916 -r ef63ca68695b b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/b Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +ignore $Id$ $ cp $HGRCPATH.nohooks $HGRCPATH Touch files and check with status $ touch a b $ hg status Update and expand $ rm sym a b $ hg update -C 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat a b expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ do not process $Id: xxx $ ignore $Id$ Check whether expansion is filewise and file mode is preserved $ echo '$Id$' > c $ echo 'tests for different changenodes' >> c #if unix-permissions $ chmod 600 c $ ls -l c | cut -b 1-10 -rw------- #endif commit file c $ hg commit -A -mcndiff -d '1 0' -u 'User Name ' adding c #if unix-permissions $ ls -l c | cut -b 1-10 -rw------- #endif force expansion $ hg -v kwexpand overwriting a expanding keywords overwriting c expanding keywords compare changenodes in a and c $ cat a c expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ do not process $Id: xxx $ $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ tests for different changenodes record $ echo '$Id$' > r $ hg add r record chunk >>> lines = open('a', 'rb').readlines() >>> lines.insert(1, 'foo\n') >>> lines.append('bar\n') >>> open('a', 'wb').writelines(lines) $ hg record -d '10 1' -m rectest a< y > y > n > EOF diff --git a/a b/a 2 hunks, 2 lines changed examine changes to 'a'? [Ynesfdaq?] y @@ -1,3 +1,4 @@ expand $Id$ +foo do not process $Id: xxx $ record change 1/2 to 'a'? [Ynesfdaq?] y @@ -2,2 +3,3 @@ do not process $Id: xxx $ +bar record change 2/2 to 'a'? [Ynesfdaq?] n $ hg identify 5f5eb23505c3+ tip $ hg status M a A r Cat modified file a $ cat a expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $ foo do not process $Id: xxx $ bar Diff remaining chunk $ hg diff a diff -r 5f5eb23505c3 a --- a/a Thu Jan 01 00:00:09 1970 -0000 +++ b/a * (glob) @@ -2,3 +2,4 @@ foo do not process $Id: xxx $ +bar $ hg rollback repository tip rolled back to revision 2 (undo commit) working directory now based on revision 2 Record all chunks in file a $ echo foo > msg - do not use "hg record -m" here! $ hg record -l msg -d '11 1' a< y > y > y > EOF diff --git a/a b/a 2 hunks, 2 lines changed examine changes to 'a'? [Ynesfdaq?] y @@ -1,3 +1,4 @@ expand $Id$ +foo do not process $Id: xxx $ record change 1/2 to 'a'? [Ynesfdaq?] y @@ -2,2 +3,3 @@ do not process $Id: xxx $ +bar record change 2/2 to 'a'? [Ynesfdaq?] y File a should be clean $ hg status -A a C a rollback and revert expansion $ cat a expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $ foo do not process $Id: xxx $ bar $ hg --verbose rollback repository tip rolled back to revision 2 (undo commit) working directory now based on revision 2 overwriting a expanding keywords $ hg status a M a $ cat a expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ foo do not process $Id: xxx $ bar $ echo '$Id$' > y $ echo '$Id$' > z $ hg add y $ hg commit -Am "rollback only" z $ cat z $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $ $ hg --verbose rollback repository tip rolled back to revision 2 (undo commit) working directory now based on revision 2 overwriting z shrinking keywords Only z should be overwritten $ hg status a y z M a A y A z $ cat z $Id$ $ hg forget y z $ rm y z record added file alone $ hg -v record -l msg -d '12 2' r< y > y > EOF diff --git a/r b/r new file mode 100644 examine changes to 'r'? [Ynesfdaq?] y @@ -0,0 +1,1 @@ +$Id$ record this change to 'r'? [Ynesfdaq?] y resolving manifests patching file r committing files: r committing manifest committing changelog committed changeset 3:82a2f715724d overwriting r expanding keywords $ hg status r $ hg --verbose rollback repository tip rolled back to revision 2 (undo commit) working directory now based on revision 2 overwriting r shrinking keywords $ hg forget r $ rm msg r $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved record added keyword ignored file $ echo '$Id$' > i $ hg add i $ hg --verbose record -d '13 1' -m recignored< y > y > EOF diff --git a/i b/i new file mode 100644 examine changes to 'i'? [Ynesfdaq?] y @@ -0,0 +1,1 @@ +$Id$ record this change to 'i'? [Ynesfdaq?] y resolving manifests patching file i committing files: i committing manifest committing changelog committed changeset 3:9f40ceb5a072 $ cat i $Id$ $ hg -q rollback $ hg forget i $ rm i amend $ echo amend >> a $ echo amend >> b $ hg -q commit -d '14 1' -m 'prepare amend' $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords overwriting a expanding keywords $ hg -q id 67d8c481a6be $ head -1 a expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $ $ hg -q strip --no-backup tip Test patch queue repo $ hg init --mq $ hg qimport -r tip -n mqtest.diff $ hg commit --mq -m mqtest Keywords should not be expanded in patch $ cat .hg/patches/mqtest.diff # HG changeset patch # User User Name # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9 cndiff diff -r ef63ca68695b -r 40a904bbbe4c c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,2 @@ +$Id$ +tests for different changenodes $ hg qpop popping mqtest.diff patch queue now empty qgoto, implying qpush, should expand $ hg qgoto mqtest.diff applying mqtest.diff now at: mqtest.diff $ cat c $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ tests for different changenodes $ hg cat c $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ tests for different changenodes Keywords should not be expanded in filelog $ hg --config 'extensions.keyword=!' cat c $Id$ tests for different changenodes qpop and move on $ hg qpop popping mqtest.diff patch queue now empty Copy and show added kwfiles $ hg cp a c $ hg kwfiles a c Commit and show expansion in original and copy $ hg --debug commit -ma2c -d '1 0' -u 'User Name ' committing files: c c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292 committing manifest committing changelog overwriting c expanding keywords updating the branch cache committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d $ cat a c expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ do not process $Id: xxx $ expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $ do not process $Id: xxx $ Touch copied c and check its status $ touch c $ hg status Copy kwfile to keyword ignored file unexpanding keywords $ hg --verbose copy a i copying a to i overwriting i shrinking keywords $ head -n 1 i expand $Id$ $ hg forget i $ rm i Copy ignored file to ignored file: no overwriting $ hg --verbose copy b i copying b to i $ hg forget i $ rm i cp symlink file; hg cp -A symlink file (part1) - copied symlink points to kwfile: overwrite #if symlink $ cp sym i $ ls -l i -rw-r--r--* (glob) $ head -1 i expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ $ hg copy --after --verbose sym i copying sym to i overwriting i shrinking keywords $ head -1 i expand $Id$ $ hg forget i $ rm i #endif Test different options of hg kwfiles $ hg kwfiles a c $ hg -v kwfiles --ignore I b I sym $ hg kwfiles --all K a K c I b I sym Diff specific revision $ hg diff --rev 1 diff -r ef63ca68695b c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c * (glob) @@ -0,0 +1,3 @@ +expand $Id$ +do not process $Id: +xxx $ Status after rollback: $ hg rollback repository tip rolled back to revision 1 (undo commit) working directory now based on revision 1 $ hg status A c $ hg update --clean 0 files updated, 0 files merged, 0 files removed, 0 files unresolved #if symlink cp symlink file; hg cp -A symlink file (part2) - copied symlink points to kw ignored file: do not overwrite $ cat a > i $ ln -s i symignored $ hg commit -Am 'fake expansion in ignored and symlink' i symignored $ cp symignored x $ hg copy --after --verbose symignored x copying symignored to x $ head -n 1 x expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ $ hg forget x $ rm x $ hg rollback repository tip rolled back to revision 1 (undo commit) working directory now based on revision 1 $ hg update --clean 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm i symignored #endif Custom keywordmaps as argument to kwdemo $ hg --quiet kwdemo "Xinfo = {author}: {desc}" [extensions] keyword = [keyword] ** = b = ignore demo.txt = i = ignore [keywordset] svn = False [keywordmaps] Xinfo = {author}: {desc} $Xinfo: test: hg keyword configuration and expansion example $ Configure custom keywordmaps $ cat <>$HGRCPATH > [keywordmaps] > Id = {file} {node|short} {date|rfc822date} {author|user} > Xinfo = {author}: {desc} > EOF Cat and hg cat files before custom expansion $ cat a b expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ do not process $Id: xxx $ ignore $Id$ $ hg cat sym a b && echo expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $ do not process $Id: xxx $ ignore $Id$ a Write custom keyword and prepare multi-line commit message $ echo '$Xinfo$' >> a $ cat <> log > firstline > secondline > EOF Interrupted commit should not change state $ hg commit abort: empty commit message [255] $ hg status M a ? c ? log Commit with multi-line message and custom expansion $ hg --debug commit -l log -d '2 0' -u 'User Name ' committing files: a committing manifest committing changelog overwriting a expanding keywords updating the branch cache committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83 $ rm log Stat, verify and show custom expansion (firstline) $ hg status ? c $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 3 files, 3 changesets, 4 total revisions $ cat a b expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ do not process $Id: xxx $ $Xinfo: User Name : firstline $ ignore $Id$ $ hg cat sym a b && echo expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ do not process $Id: xxx $ $Xinfo: User Name : firstline $ ignore $Id$ a annotate $ hg annotate a 1: expand $Id$ 1: do not process $Id: 1: xxx $ 2: $Xinfo$ remove with status checks $ hg debugrebuildstate $ hg remove a $ hg --debug commit -m rma committing files: committing manifest committing changelog updating the branch cache committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012 $ hg status ? c Rollback, revert, and check expansion $ hg rollback repository tip rolled back to revision 2 (undo commit) working directory now based on revision 2 $ hg status R a ? c $ hg revert --no-backup --rev tip a $ cat a expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ do not process $Id: xxx $ $Xinfo: User Name : firstline $ Clone to test global and local configurations $ cd .. Expansion in destination with global configuration $ hg --quiet clone Test globalconf $ cat globalconf/a expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ do not process $Id: xxx $ $Xinfo: User Name : firstline $ No expansion in destination with local configuration in origin only $ hg --quiet --config 'keyword.**=ignore' clone Test localconf $ cat localconf/a expand $Id$ do not process $Id: xxx $ $Xinfo$ Clone to test incoming $ hg clone -r1 Test Test-a adding changesets adding manifests adding file changes added 2 changesets with 3 changes to 3 files new changesets a2392c293916:ef63ca68695b updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd Test-a $ cat <> .hg/hgrc > [paths] > default = ../Test > EOF $ hg incoming comparing with $TESTTMP/Test searching for changes changeset: 2:bb948857c743 tag: tip user: User Name date: Thu Jan 01 00:00:02 1970 +0000 summary: firstline Imported patch should not be rejected >>> import re >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read()) >>> open('a', 'wb').write(text) $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name ' committing files: a committing manifest committing changelog overwriting a expanding keywords updating the branch cache committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082 $ hg export -o ../rejecttest.diff tip $ cd ../Test $ hg import ../rejecttest.diff applying ../rejecttest.diff $ cat a b expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest do not process $Id: rejecttest xxx $ $Xinfo: User Name : rejects? $ ignore $Id$ $ hg rollback repository tip rolled back to revision 2 (undo import) working directory now based on revision 2 $ hg update --clean 1 files updated, 0 files merged, 0 files removed, 0 files unresolved kwexpand/kwshrink on selected files $ mkdir x $ hg copy a x/a $ hg --verbose kwshrink a overwriting a shrinking keywords - sleep required for dirstate.normal() check $ sleep 1 $ hg status a $ hg --verbose kwexpand a overwriting a expanding keywords $ hg status a kwexpand x/a should abort $ hg --verbose kwexpand x/a abort: outstanding uncommitted changes [255] $ cd x $ hg --debug commit -m xa -d '3 0' -u 'User Name ' committing files: x/a x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e committing manifest committing changelog overwriting x/a expanding keywords updating the branch cache committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4 $ cat a expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $ do not process $Id: xxx $ $Xinfo: User Name : xa $ kwshrink a inside directory x $ hg --verbose kwshrink a overwriting x/a shrinking keywords $ cat a expand $Id$ do not process $Id: xxx $ $Xinfo$ $ cd .. kwexpand nonexistent $ hg kwexpand nonexistent nonexistent:* (glob) #if serve hg serve - expand with hgweb file - no expansion with hgweb annotate/changeset/filediff/comparison - expand with hgweb file, again - check errors $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw' 200 Script output follows expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ do not process $Id: xxx $ $Xinfo: User Name : firstline $ $ get-with-headers.py localhost:$HGPORT 'annotate/tip/a/?style=raw' 200 Script output follows user@1: expand $Id$ user@1: do not process $Id: user@1: xxx $ user@2: $Xinfo$ $ get-with-headers.py localhost:$HGPORT 'rev/tip/?style=raw' 200 Script output follows # HG changeset patch # User User Name # Date 3 0 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83 xa diff -r bb948857c743 -r b4560182a3f9 x/a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000 @@ -0,0 +1,4 @@ +expand $Id$ +do not process $Id: +xxx $ +$Xinfo$ $ get-with-headers.py localhost:$HGPORT 'diff/bb948857c743/a?style=raw' 200 Script output follows diff -r ef63ca68695b -r bb948857c743 a --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:02 1970 +0000 @@ -1,3 +1,4 @@ expand $Id$ do not process $Id: xxx $ +$Xinfo$ $ get-with-headers.py localhost:$HGPORT 'comparison/bb948857c743/a' | grep '\$[a-zA-Z]' 1 expand $Id$ 1 expand $Id$ 2 do not process $Id: 2 do not process $Id: 4 $Xinfo$ (check "kwweb_skip"-ed webcommand doesn't suppress expanding keywords at subsequent webcommands) $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw' 200 Script output follows expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ do not process $Id: xxx $ $Xinfo: User Name : firstline $ $ killdaemons.py $ cat errors.log #endif Prepare merge and resolve tests $ echo '$Id$' > m $ hg add m $ hg commit -m 4kw $ echo foo >> m $ hg commit -m 5foo simplemerge $ hg update 4 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo foo >> m $ hg commit -m 6foo created new head $ hg merge 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg commit -m simplemerge $ cat m $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $ foo conflict: keyword should stay outside conflict zone $ hg update 4 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo bar >> m $ hg commit -m 8bar created new head $ hg merge merging m warning: conflicts while merging m! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ cat m $Id$ <<<<<<< working copy: 88a80c8d172e - test: 8bar bar ======= foo >>>>>>> merge rev: 85d2d2d732a5 - test: simplemerge resolve to local, m must contain hash of last change (local parent) $ hg resolve -t internal:local -a (no more unresolved files) $ hg commit -m localresolve $ cat m $Id: m 88a80c8d172e Thu, 01 Jan 1970 00:00:00 +0000 test $ bar Test restricted mode with transplant -b $ hg update 6 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg branch foo marked working directory as branch foo (branches are permanent and global, did you want a bookmark?) $ mv a a.bak $ echo foobranch > a $ cat a.bak >> a $ rm a.bak $ hg commit -m 9foobranch $ hg update default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -y transplant -b foo tip applying 4aa30d025d50 4aa30d025d50 transplanted to e00abbf63521 Expansion in changeset but not in file $ hg tip -p changeset: 11:e00abbf63521 tag: tip parent: 9:800511b3a22d user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 9foobranch diff -r 800511b3a22d -r e00abbf63521 a --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +1,4 @@ +foobranch expand $Id$ do not process $Id: xxx $ $ head -n 2 a foobranch expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $ Turn off expansion $ hg -q rollback $ hg -q update -C kwshrink with unknown file u $ cp a u $ hg --verbose kwshrink overwriting a shrinking keywords overwriting m shrinking keywords overwriting x/a shrinking keywords Keywords shrunk in working directory, but not yet disabled - cat shows unexpanded keywords - hg cat shows expanded keywords $ cat a b expand $Id$ do not process $Id: xxx $ $Xinfo$ ignore $Id$ $ hg cat sym a b && echo expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ do not process $Id: xxx $ $Xinfo: User Name : firstline $ ignore $Id$ a Now disable keyword expansion $ cp $HGRCPATH $HGRCPATH.backup $ rm "$HGRCPATH" $ cat a b expand $Id$ do not process $Id: xxx $ $Xinfo$ ignore $Id$ $ hg cat sym a b && echo expand $Id$ do not process $Id: xxx $ $Xinfo$ ignore $Id$ a enable keyword expansion again $ cat $HGRCPATH.backup >> $HGRCPATH Test restricted mode with unshelve $ cat <> $HGRCPATH > [extensions] > shelve = > EOF $ echo xxxx >> a $ hg diff diff -r 800511b3a22d a --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ b/a * (glob) @@ -2,3 +2,4 @@ do not process $Id: xxx $ $Xinfo$ +xxxx $ hg shelve -q --name tmp $ hg shelve --list --patch tmp (*)* changes to: localresolve (glob) diff --git a/a b/a --- a/a +++ b/a @@ -2,3 +2,4 @@ do not process $Id: xxx $ $Xinfo$ +xxxx $ hg update -q -C 10 $ hg unshelve -q tmp $ hg diff diff -r 4aa30d025d50 a --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ b/a * (glob) @@ -3,3 +3,4 @@ do not process $Id: xxx $ $Xinfo$ +xxxx Test restricted mode with rebase $ cat <> $HGRCPATH > [extensions] > rebase = > EOF $ hg update -q -C 9 $ echo xxxx >> a $ hg commit -m '#11' $ hg diff -c 11 diff -r 800511b3a22d -r b07670694489 a --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:00 1970 +0000 @@ -2,3 +2,4 @@ do not process $Id: xxx $ $Xinfo$ +xxxx $ hg diff -c 10 diff -r 27d48ee14f67 -r 4aa30d025d50 a --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +1,4 @@ +foobranch expand $Id$ do not process $Id: xxx $ $ hg rebase -q -s 10 -d 11 --keep $ hg diff -r 9 -r 12 a diff -r 800511b3a22d -r 1939b927726c a --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +1,6 @@ +foobranch expand $Id$ do not process $Id: xxx $ $Xinfo$ +xxxx Test restricted mode with graft $ hg graft -q 10 $ hg diff -r 9 -r 13 a diff -r 800511b3a22d -r 01a68de1003a a --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +1,6 @@ +foobranch expand $Id$ do not process $Id: xxx $ $Xinfo$ +xxxx Test restricted mode with backout $ hg backout -q 11 --no-commit $ hg diff a diff -r 01a68de1003a a --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ b/a * (glob) @@ -3,4 +3,3 @@ do not process $Id: xxx $ $Xinfo$ -xxxx Test restricted mode with histedit $ cat <> $HGRCPATH > [extensions] > histedit = > EOF $ hg commit -m 'backout #11' $ hg histedit -q --command - 13 < pick 49f5f2d940c3 14 backout #11 > pick 01a68de1003a 13 9foobranch > EOF Test restricted mode with fetch (with merge) $ cat <> $HGRCPATH > [extensions] > fetch = > EOF $ hg clone -q -r 9 . ../fetch-merge $ cd ../fetch-merge $ hg -R ../Test export 10 | hg import -q - $ hg fetch -q -r 11 $ hg diff -r 9 a diff -r 800511b3a22d a --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ b/a * (glob) @@ -1,4 +1,6 @@ +foobranch expand $Id$ do not process $Id: xxx $ $Xinfo$ +xxxx Test that patch.diff(), which is implied by "hg diff" or so, doesn't suppress expanding keywords at subsequent commands #if windows $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH" #else $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH" #endif $ export PYTHONPATH $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new $ mv $HGRCPATH.new $HGRCPATH >>> from __future__ import print_function >>> from hgclient import check, readchannel, runcommand >>> @check ... def check(server): ... # hello block ... readchannel(server) ... ... runcommand(server, ['cat', 'm']) ... runcommand(server, ['diff', '-c', '.', 'm']) ... runcommand(server, ['cat', 'm']) *** runcommand cat m $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ bar *** runcommand diff -c . m *** runcommand cat m $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ bar $ cd .. #if serve Test that keywords are expanded only in repositories, which enable keyword extension, even if multiple repositories are served in a process $ cat >> fetch-merge/.hg/hgrc < [extensions] > keyword = ! > EOF $ cat > paths.conf < [paths] > enabled=Test > disabled=fetch-merge > EOF $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log --webdir-conf paths.conf $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw' 200 Script output follows $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ bar $ get-with-headers.py localhost:$HGPORT 'disabled/file/tip/m/?style=raw' 200 Script output follows $Id$ bar (check expansion again, for safety) $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw' 200 Script output follows $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ bar $ killdaemons.py #endif mercurial-4.5.3/tests/test-docker-packaging.t0000644015407300116100000000176513261161234021103 0ustar augieeng00000000000000#require test-repo slow docker $ . "$TESTDIR/helpers-testrepo.sh" $ testrepohgenv Ensure debuild doesn't run the testsuite, as that could get silly. $ DEB_BUILD_OPTIONS=nocheck $ export DEB_BUILD_OPTIONS $ OUTPUTDIR=`pwd` $ export OUTPUTDIR $ cd "$TESTDIR"/.. $ make docker-debian-jessie > $OUTPUTDIR/build.log 2>&1 $ cd $OUTPUTDIR $ ls *.deb mercurial-common_*.deb (glob) mercurial_*.deb (glob) We check debian package contents with portable tools so that when we're on non-debian machines we can still test the packages that are built using docker. main deb should have .so but no .py $ ar x mercurial_*.deb $ tar tf data.tar* | egrep '(localrepo|parsers)' ./usr/lib/python2.7/dist-packages/mercurial/parsers*.so (glob) mercurial-common should have .py but no .so or .pyc $ ar x mercurial-common_*.deb $ tar tf data.tar* | egrep '(localrepo|parsers)' ./usr/lib/python2.7/dist-packages/mercurial/pure/parsers.py ./usr/lib/python2.7/dist-packages/mercurial/localrepo.py mercurial-4.5.3/tests/test-context.py0000644015407300116100000001324213261161234017554 0ustar augieeng00000000000000from __future__ import absolute_import, print_function import os from mercurial.node import hex from mercurial import ( context, encoding, hg, scmutil, ui as uimod, ) u = uimod.ui.load() repo = hg.repository(u, 'test1', create=1) os.chdir('test1') # create 'foo' with fixed time stamp f = open('foo', 'wb') f.write(b'foo\n') f.close() os.utime('foo', (1000, 1000)) # add+commit 'foo' repo[None].add(['foo']) repo.commit(text='commit1', date="0 0") d = repo[None]['foo'].date() if os.name == 'nt': d = d[:2] print("workingfilectx.date = (%d, %d)" % d) # test memctx with non-ASCII commit message def filectxfn(repo, memctx, path): return context.memfilectx(repo, memctx, "foo", "") ctx = context.memctx(repo, ['tip', None], encoding.tolocal("Gr\xc3\xbcezi!"), ["foo"], filectxfn) ctx.commit() for enc in "ASCII", "Latin-1", "UTF-8": encoding.encoding = enc print("%-8s: %s" % (enc, repo["tip"].description())) # test performing a status def getfilectx(repo, memctx, f): fctx = memctx.parents()[0][f] data, flags = fctx.data(), fctx.flags() if f == 'foo': data += 'bar\n' return context.memfilectx(repo, memctx, f, data, 'l' in flags, 'x' in flags) ctxa = repo.changectx(0) ctxb = context.memctx(repo, [ctxa.node(), None], "test diff", ["foo"], getfilectx, ctxa.user(), ctxa.date()) print(ctxb.status(ctxa)) # test performing a diff on a memctx for d in ctxb.diff(ctxa, git=True): print(d, end='') # test safeness and correctness of "ctx.status()" print('= checking context.status():') # ancestor "wcctx ~ 2" actx2 = repo['.'] repo.wwrite('bar-m', 'bar-m\n', '') repo.wwrite('bar-r', 'bar-r\n', '') repo[None].add(['bar-m', 'bar-r']) repo.commit(text='add bar-m, bar-r', date="0 0") # ancestor "wcctx ~ 1" actx1 = repo['.'] repo.wwrite('bar-m', 'bar-m bar-m\n', '') repo.wwrite('bar-a', 'bar-a\n', '') repo[None].add(['bar-a']) repo[None].forget(['bar-r']) # status at this point: # M bar-m # A bar-a # R bar-r # C foo from mercurial import scmutil print('== checking workingctx.status:') wctx = repo[None] print('wctx._status=%s' % (str(wctx._status))) print('=== with "pattern match":') print(actx1.status(other=wctx, match=scmutil.matchfiles(repo, ['bar-m', 'foo']))) print('wctx._status=%s' % (str(wctx._status))) print(actx2.status(other=wctx, match=scmutil.matchfiles(repo, ['bar-m', 'foo']))) print('wctx._status=%s' % (str(wctx._status))) print('=== with "always match" and "listclean=True":') print(actx1.status(other=wctx, listclean=True)) print('wctx._status=%s' % (str(wctx._status))) print(actx2.status(other=wctx, listclean=True)) print('wctx._status=%s' % (str(wctx._status))) print("== checking workingcommitctx.status:") wcctx = context.workingcommitctx(repo, scmutil.status(['bar-m'], ['bar-a'], [], [], [], [], []), text='', date='0 0') print('wcctx._status=%s' % (str(wcctx._status))) print('=== with "always match":') print(actx1.status(other=wcctx)) print('wcctx._status=%s' % (str(wcctx._status))) print(actx2.status(other=wcctx)) print('wcctx._status=%s' % (str(wcctx._status))) print('=== with "always match" and "listclean=True":') print(actx1.status(other=wcctx, listclean=True)) print('wcctx._status=%s' % (str(wcctx._status))) print(actx2.status(other=wcctx, listclean=True)) print('wcctx._status=%s' % (str(wcctx._status))) print('=== with "pattern match":') print(actx1.status(other=wcctx, match=scmutil.matchfiles(repo, ['bar-m', 'foo']))) print('wcctx._status=%s' % (str(wcctx._status))) print(actx2.status(other=wcctx, match=scmutil.matchfiles(repo, ['bar-m', 'foo']))) print('wcctx._status=%s' % (str(wcctx._status))) print('=== with "pattern match" and "listclean=True":') print(actx1.status(other=wcctx, match=scmutil.matchfiles(repo, ['bar-r', 'foo']), listclean=True)) print('wcctx._status=%s' % (str(wcctx._status))) print(actx2.status(other=wcctx, match=scmutil.matchfiles(repo, ['bar-r', 'foo']), listclean=True)) print('wcctx._status=%s' % (str(wcctx._status))) os.chdir('..') # test manifestlog being changed print('== commit with manifestlog invalidated') repo = hg.repository(u, 'test2', create=1) os.chdir('test2') # make some commits for i in [b'1', b'2', b'3']: with open(i, 'wb') as f: f.write(i) status = scmutil.status([], [i], [], [], [], [], []) ctx = context.workingcommitctx(repo, status, text=i, user=b'test@test.com', date=(0, 0)) ctx.p1().manifest() # side effect: cache manifestctx n = repo.commitctx(ctx) print('commit %s: %s' % (i, hex(n))) # touch 00manifest.i mtime so storecache could expire. # repo.__dict__['manifestlog'] is deleted by transaction releasefn. st = repo.svfs.stat('00manifest.i') repo.svfs.utime('00manifest.i', (st.st_mtime + 1, st.st_mtime + 1)) # read the file just committed try: if repo[n][i].data() != i: print('data mismatch') except Exception as ex: print('cannot read data: %r' % ex) with repo.wlock(), repo.lock(), repo.transaction('test'): with open(b'4', 'wb') as f: f.write(b'4') repo.dirstate.normal('4') repo.commit('4') revsbefore = len(repo.changelog) repo.invalidate(clearfilecache=True) revsafter = len(repo.changelog) if revsbefore != revsafter: print('changeset lost by repo.invalidate()') mercurial-4.5.3/tests/test-treediscovery.t0000644015407300116100000004621213261161234020575 0ustar augieeng00000000000000#require killdaemons Tests discovery against servers without getbundle support: $ CAP="getbundle bundle2" $ . "$TESTDIR/notcapable" $ cat >> $HGRCPATH < [ui] > logtemplate="{rev} {node|short}: {desc} {branches}\n" > EOF Setup HTTP server control: $ remote=http://localhost:$HGPORT/ $ export remote $ tstart() { > echo '[web]' > $1/.hg/hgrc > echo 'push_ssl = false' >> $1/.hg/hgrc > echo 'allow_push = *' >> $1/.hg/hgrc > hg serve -R $1 -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log > cat hg.pid >> $DAEMON_PIDS > } $ tstop() { > killdaemons.py > [ "$1" ] && cut -d' ' -f6- access.log && cat errors.log > rm access.log errors.log > } Both are empty: $ hg init empty1 $ hg init empty2 $ tstart empty2 $ hg incoming -R empty1 $remote comparing with http://localhost:$HGPORT/ no changes found [1] $ hg outgoing -R empty1 $remote comparing with http://localhost:$HGPORT/ no changes found [1] $ hg pull -R empty1 $remote pulling from http://localhost:$HGPORT/ no changes found $ hg push -R empty1 $remote pushing to http://localhost:$HGPORT/ no changes found [1] $ tstop Base repo: $ hg init main $ cd main $ hg debugbuilddag -mo '+2:tbase @name1 +3:thead1 f $ echo "line 2" >> f $ echo "line 3" >> f $ hg ci -Am "revision 0" adding f $ cat f line 1 line 2 line 3 Branch 1: editing line 1: $ sed 's/line 1/first line/' f > f.new $ mv f.new f $ hg ci -Am "edited first line" Branch 2: editing line 3: $ hg update 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ sed 's/line 3/third line/' f > f.new $ mv f.new f $ hg ci -Am "edited third line" created new head Merge using internal:fail tool: $ echo "[merge-patterns]" > .hg/hgrc $ echo "* = internal:fail" >> .hg/hgrc $ hg merge 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ cat f line 1 line 2 third line $ hg stat M f Merge using internal:local tool: $ hg update -C 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ sed 's/internal:fail/internal:local/' .hg/hgrc > .hg/hgrc.new $ mv .hg/hgrc.new .hg/hgrc $ hg merge 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f line 1 line 2 third line $ hg stat M f Merge using internal:other tool: $ hg update -C 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ sed 's/internal:local/internal:other/' .hg/hgrc > .hg/hgrc.new $ mv .hg/hgrc.new .hg/hgrc $ hg merge 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f first line line 2 line 3 $ hg stat M f Merge using default tool: $ hg update -C 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ rm .hg/hgrc $ hg merge merging f 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f first line line 2 third line $ hg stat M f Merge using internal:union tool: $ hg update -C 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo "line 4a" >>f $ hg ci -Am "Adding fourth line (commit 4)" $ hg update 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo "line 4b" >>f $ hg ci -Am "Adding fourth line v2 (commit 5)" created new head $ echo "[merge-patterns]" > .hg/hgrc $ echo "* = internal:union" >> .hg/hgrc $ hg merge 3 merging f 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat f line 1 line 2 third line line 4b line 4a mercurial-4.5.3/tests/test-grep.t0000644015407300116100000002030413261161234016635 0ustar augieeng00000000000000 $ hg init t $ cd t $ echo import > port $ hg add port $ hg commit -m 0 -u spam -d '0 0' $ echo export >> port $ hg commit -m 1 -u eggs -d '1 0' $ echo export > port $ echo vaportight >> port $ echo 'import/export' >> port $ hg commit -m 2 -u spam -d '2 0' $ echo 'import/export' >> port $ hg commit -m 3 -u eggs -d '3 0' $ head -n 3 port > port1 $ mv port1 port $ hg commit -m 4 -u spam -d '4 0' pattern error $ hg grep '**test**' grep: invalid match pattern: nothing to repeat [1] simple $ hg grep '.*' port:4:export port:4:vaportight port:4:import/export $ hg grep port port port:4:export port:4:vaportight port:4:import/export simple with color $ hg --config extensions.color= grep --config color.mode=ansi \ > --color=always port port \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;32m4\x1b[0m\x1b[0;36m:\x1b[0mex\x1b[0;31;1mport\x1b[0m (esc) \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;32m4\x1b[0m\x1b[0;36m:\x1b[0mva\x1b[0;31;1mport\x1b[0might (esc) \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;32m4\x1b[0m\x1b[0;36m:\x1b[0mim\x1b[0;31;1mport\x1b[0m/ex\x1b[0;31;1mport\x1b[0m (esc) simple templated $ hg grep port \ > -T '{file}:{rev}:{node|short}:{texts % "{if(matched, text|upper, text)}"}\n' port:4:914fa752cdea:exPORT port:4:914fa752cdea:vaPORTight port:4:914fa752cdea:imPORT/exPORT simple JSON (no "change" field) $ hg grep -Tjson port [ { "date": [4.0, 0], "file": "port", "line_number": 1, "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", "rev": 4, "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}], "user": "spam" }, { "date": [4.0, 0], "file": "port", "line_number": 2, "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", "rev": 4, "texts": [{"matched": false, "text": "va"}, {"matched": true, "text": "port"}, {"matched": false, "text": "ight"}], "user": "spam" }, { "date": [4.0, 0], "file": "port", "line_number": 3, "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", "rev": 4, "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}], "user": "spam" } ] simple JSON without matching lines $ hg grep -Tjson -l port [ { "date": [4.0, 0], "file": "port", "line_number": 1, "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", "rev": 4, "user": "spam" } ] all $ hg grep --traceback --all -nu port port port:4:4:-:spam:import/export port:3:4:+:eggs:import/export port:2:1:-:spam:import port:2:2:-:spam:export port:2:1:+:spam:export port:2:2:+:spam:vaportight port:2:3:+:spam:import/export port:1:2:+:eggs:export port:0:1:+:spam:import all JSON $ hg grep --all -Tjson port port [ { "change": "-", "date": [4.0, 0], "file": "port", "line_number": 4, "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", "rev": 4, "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}], "user": "spam" }, { "change": "+", "date": [3.0, 0], "file": "port", "line_number": 4, "node": "95040cfd017d658c536071c6290230a613c4c2a6", "rev": 3, "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}], "user": "eggs" }, { "change": "-", "date": [2.0, 0], "file": "port", "line_number": 1, "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", "rev": 2, "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}], "user": "spam" }, { "change": "-", "date": [2.0, 0], "file": "port", "line_number": 2, "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", "rev": 2, "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}], "user": "spam" }, { "change": "+", "date": [2.0, 0], "file": "port", "line_number": 1, "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", "rev": 2, "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}], "user": "spam" }, { "change": "+", "date": [2.0, 0], "file": "port", "line_number": 2, "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", "rev": 2, "texts": [{"matched": false, "text": "va"}, {"matched": true, "text": "port"}, {"matched": false, "text": "ight"}], "user": "spam" }, { "change": "+", "date": [2.0, 0], "file": "port", "line_number": 3, "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", "rev": 2, "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}], "user": "spam" }, { "change": "+", "date": [1.0, 0], "file": "port", "line_number": 2, "node": "8b20f75c158513ff5ac80bd0e5219bfb6f0eb587", "rev": 1, "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}], "user": "eggs" }, { "change": "+", "date": [0.0, 0], "file": "port", "line_number": 1, "node": "f31323c9217050ba245ee8b537c713ec2e8ab226", "rev": 0, "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}], "user": "spam" } ] other $ hg grep -l port port port:4 $ hg grep import port port:4:import/export $ hg cp port port2 $ hg commit -m 4 -u spam -d '5 0' follow $ hg grep --traceback -f 'import\n\Z' port2 port:0:import $ echo deport >> port2 $ hg commit -m 5 -u eggs -d '6 0' $ hg grep -f --all -nu port port2 port2:6:4:+:eggs:deport port:4:4:-:spam:import/export port:3:4:+:eggs:import/export port:2:1:-:spam:import port:2:2:-:spam:export port:2:1:+:spam:export port:2:2:+:spam:vaportight port:2:3:+:spam:import/export port:1:2:+:eggs:export port:0:1:+:spam:import $ hg up -q null $ hg grep -f port [1] $ cd .. $ hg init t2 $ cd t2 $ hg grep foobar foo [1] $ hg grep foobar [1] $ echo blue >> color $ echo black >> color $ hg add color $ hg ci -m 0 $ echo orange >> color $ hg ci -m 1 $ echo black > color $ hg ci -m 2 $ echo orange >> color $ echo blue >> color $ hg ci -m 3 $ hg grep orange color:3:orange $ hg grep --all orange color:3:+:orange color:2:-:orange color:1:+:orange test substring match: '^' should only match at the beginning $ hg grep '^.' --config extensions.color= --color debug [grep.filename|color][grep.sep|:][grep.rev|3][grep.sep|:][grep.match|b]lack [grep.filename|color][grep.sep|:][grep.rev|3][grep.sep|:][grep.match|o]range [grep.filename|color][grep.sep|:][grep.rev|3][grep.sep|:][grep.match|b]lue match in last "line" without newline $ $PYTHON -c 'fp = open("noeol", "wb"); fp.write("no infinite loop"); fp.close();' $ hg ci -Amnoeol adding noeol $ hg grep loop noeol:4:no infinite loop $ cd .. Issue685: traceback in grep -r after rename Got a traceback when using grep on a single revision with renamed files. $ hg init issue685 $ cd issue685 $ echo octarine > color $ hg ci -Amcolor adding color $ hg rename color colour $ hg ci -Am rename $ hg grep octarine colour:1:octarine color:0:octarine Used to crash here $ hg grep -r 1 octarine colour:1:octarine $ cd .. Issue337: test that grep follows parent-child relationships instead of just using revision numbers. $ hg init issue337 $ cd issue337 $ echo white > color $ hg commit -A -m "0 white" adding color $ echo red > color $ hg commit -A -m "1 red" $ hg update 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo black > color $ hg commit -A -m "2 black" created new head $ hg update --clean 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo blue > color $ hg commit -A -m "3 blue" $ hg grep --all red color:3:-:red color:1:+:red $ cd .. $ hg init a $ cd a $ cp "$TESTDIR/binfile.bin" . $ hg add binfile.bin $ hg ci -m 'add binfile.bin' $ hg grep "MaCam" --all binfile.bin:0:+: Binary file matches $ cd .. mercurial-4.5.3/tests/check-gendoc0000755015407300116100000000051613261161234017001 0ustar augieeng00000000000000#!/bin/sh HGENCODING=UTF-8 export HGENCODING echo ".. -*- coding: utf-8 -*-" > gendoc.txt echo "" >> gendoc.txt LANGUAGE=$1 python "$TESTDIR/../doc/gendoc.py" >> gendoc.txt 2> /dev/null || exit echo "checking for parse errors" python "$TESTDIR/../doc/docchecker" gendoc.txt python "$TESTDIR/../doc/runrst" html gendoc.txt /dev/null mercurial-4.5.3/tests/histedit-helpers.sh0000644015407300116100000000034513261161234020352 0ustar augieeng00000000000000fixbundle() { grep -v 'saving bundle' | grep -v 'saved backup' | \ grep -v added | grep -v adding | \ grep -v "unable to find 'e' for patching" | \ grep -v "e: No such file or directory" | \ cat } mercurial-4.5.3/tests/test-convert-bzr-114.t0000644015407300116100000000162413261161234020462 0ustar augieeng00000000000000#require bzr bzr114 $ . "$TESTDIR/bzr-definitions" The file/directory replacement can only be reproduced on bzr >= 1.4. Merge it back in test-convert-bzr-directories once this version becomes mainstream. replace file with dir $ mkdir test-replace-file-with-dir $ cd test-replace-file-with-dir $ bzr init -q source $ cd source $ echo d > d $ bzr add -q d $ bzr commit -q -m 'add d file' $ rm d $ mkdir d $ bzr add -q d $ bzr commit -q -m 'replace with d dir' $ echo a > d/a $ bzr add -q d/a $ bzr commit -q -m 'add d/a' $ cd .. $ hg convert source source-hg initializing destination source-hg repository scanning source... sorting... converting... 2 add d file 1 replace with d dir 0 add d/a $ manifest source-hg tip % manifest of tip 644 d/a $ cd source-hg $ hg update 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ../.. mercurial-4.5.3/tests/test-ancestor.py0000644015407300116100000002133713261161234017712 0ustar augieeng00000000000000from __future__ import absolute_import, print_function import binascii import getopt import math import os import random import sys import time from mercurial.node import nullrev from mercurial import ( ancestor, debugcommands, hg, pycompat, ui as uimod, util, ) if pycompat.ispy3: long = int xrange = range def buildgraph(rng, nodes=100, rootprob=0.05, mergeprob=0.2, prevprob=0.7): '''nodes: total number of nodes in the graph rootprob: probability that a new node (not 0) will be a root mergeprob: probability that, excluding a root a node will be a merge prevprob: probability that p1 will be the previous node return value is a graph represented as an adjacency list. ''' graph = [None] * nodes for i in xrange(nodes): if i == 0 or rng.random() < rootprob: graph[i] = [nullrev] elif i == 1: graph[i] = [0] elif rng.random() < mergeprob: if i == 2 or rng.random() < prevprob: # p1 is prev p1 = i - 1 else: p1 = rng.randrange(i - 1) p2 = rng.choice(list(range(0, p1)) + list(range(p1 + 1, i))) graph[i] = [p1, p2] elif rng.random() < prevprob: graph[i] = [i - 1] else: graph[i] = [rng.randrange(i - 1)] return graph def buildancestorsets(graph): ancs = [None] * len(graph) for i in xrange(len(graph)): ancs[i] = {i} if graph[i] == [nullrev]: continue for p in graph[i]: ancs[i].update(ancs[p]) return ancs class naiveincrementalmissingancestors(object): def __init__(self, ancs, bases): self.ancs = ancs self.bases = set(bases) def addbases(self, newbases): self.bases.update(newbases) def removeancestorsfrom(self, revs): for base in self.bases: if base != nullrev: revs.difference_update(self.ancs[base]) revs.discard(nullrev) def missingancestors(self, revs): res = set() for rev in revs: if rev != nullrev: res.update(self.ancs[rev]) for base in self.bases: if base != nullrev: res.difference_update(self.ancs[base]) return sorted(res) def test_missingancestors(seed, rng): # empirically observed to take around 1 second graphcount = 100 testcount = 10 inccount = 10 nerrs = [0] # the default mu and sigma give us a nice distribution of mostly # single-digit counts (including 0) with some higher ones def lognormrandom(mu, sigma): return int(math.floor(rng.lognormvariate(mu, sigma))) def samplerevs(nodes, mu=1.1, sigma=0.8): count = min(lognormrandom(mu, sigma), len(nodes)) return rng.sample(nodes, count) def err(seed, graph, bases, seq, output, expected): if nerrs[0] == 0: print('seed:', hex(seed)[:-1], file=sys.stderr) if gerrs[0] == 0: print('graph:', graph, file=sys.stderr) print('* bases:', bases, file=sys.stderr) print('* seq: ', seq, file=sys.stderr) print('* output: ', output, file=sys.stderr) print('* expected:', expected, file=sys.stderr) nerrs[0] += 1 gerrs[0] += 1 for g in xrange(graphcount): graph = buildgraph(rng) ancs = buildancestorsets(graph) gerrs = [0] for _ in xrange(testcount): # start from nullrev to include it as a possibility graphnodes = range(nullrev, len(graph)) bases = samplerevs(graphnodes) # fast algorithm inc = ancestor.incrementalmissingancestors(graph.__getitem__, bases) # reference slow algorithm naiveinc = naiveincrementalmissingancestors(ancs, bases) seq = [] revs = [] for _ in xrange(inccount): if rng.random() < 0.2: newbases = samplerevs(graphnodes) seq.append(('addbases', newbases)) inc.addbases(newbases) naiveinc.addbases(newbases) if rng.random() < 0.4: # larger set so that there are more revs to remove from revs = samplerevs(graphnodes, mu=1.5) seq.append(('removeancestorsfrom', revs)) hrevs = set(revs) rrevs = set(revs) inc.removeancestorsfrom(hrevs) naiveinc.removeancestorsfrom(rrevs) if hrevs != rrevs: err(seed, graph, bases, seq, sorted(hrevs), sorted(rrevs)) else: revs = samplerevs(graphnodes) seq.append(('missingancestors', revs)) h = inc.missingancestors(revs) r = naiveinc.missingancestors(revs) if h != r: err(seed, graph, bases, seq, h, r) # graph is a dict of child->parent adjacency lists for this graph: # o 13 # | # | o 12 # | | # | | o 11 # | | |\ # | | | | o 10 # | | | | | # | o---+ | 9 # | | | | | # o | | | | 8 # / / / / # | | o | 7 # | | | | # o---+ | 6 # / / / # | | o 5 # | |/ # | o 4 # | | # o | 3 # | | # | o 2 # |/ # o 1 # | # o 0 graph = {0: [-1], 1: [0], 2: [1], 3: [1], 4: [2], 5: [4], 6: [4], 7: [4], 8: [-1], 9: [6, 7], 10: [5], 11: [3, 7], 12: [9], 13: [8]} def genlazyancestors(revs, stoprev=0, inclusive=False): print(("%% lazy ancestor set for %s, stoprev = %s, inclusive = %s" % (revs, stoprev, inclusive))) return ancestor.lazyancestors(graph.get, revs, stoprev=stoprev, inclusive=inclusive) def printlazyancestors(s, l): print('membership: %r' % [n for n in l if n in s]) print('iteration: %r' % list(s)) def test_lazyancestors(): # Empty revs s = genlazyancestors([]) printlazyancestors(s, [3, 0, -1]) # Standard example s = genlazyancestors([11, 13]) printlazyancestors(s, [11, 13, 7, 9, 8, 3, 6, 4, 1, -1, 0]) # Standard with ancestry in the initial set (1 is ancestor of 3) s = genlazyancestors([1, 3]) printlazyancestors(s, [1, -1, 0]) # Including revs s = genlazyancestors([11, 13], inclusive=True) printlazyancestors(s, [11, 13, 7, 9, 8, 3, 6, 4, 1, -1, 0]) # Test with stoprev s = genlazyancestors([11, 13], stoprev=6) printlazyancestors(s, [11, 13, 7, 9, 8, 3, 6, 4, 1, -1, 0]) s = genlazyancestors([11, 13], stoprev=6, inclusive=True) printlazyancestors(s, [11, 13, 7, 9, 8, 3, 6, 4, 1, -1, 0]) # The C gca algorithm requires a real repo. These are textual descriptions of # DAGs that have been known to be problematic, and, optionally, known pairs # of revisions and their expected ancestor list. dagtests = [ ('+2*2*2/*3/2', {}), ('+3*3/*2*2/*4*4/*4/2*4/2*2', {}), ('+2*2*/2*4*/4*/3*2/4', {(6, 7): [3, 5]}), ] def test_gca(): u = uimod.ui.load() for i, (dag, tests) in enumerate(dagtests): repo = hg.repository(u, b'gca%d' % i, create=1) cl = repo.changelog if not util.safehasattr(cl.index, 'ancestors'): # C version not available return debugcommands.debugbuilddag(u, repo, dag) # Compare the results of the Python and C versions. This does not # include choosing a winner when more than one gca exists -- we make # sure both return exactly the same set of gcas. # Also compare against expected results, if available. for a in cl: for b in cl: cgcas = sorted(cl.index.ancestors(a, b)) pygcas = sorted(ancestor.ancestors(cl.parentrevs, a, b)) expected = None if (a, b) in tests: expected = tests[(a, b)] if cgcas != pygcas or (expected and cgcas != expected): print("test_gca: for dag %s, gcas for %d, %d:" % (dag, a, b)) print(" C returned: %s" % cgcas) print(" Python returned: %s" % pygcas) if expected: print(" expected: %s" % expected) def main(): seed = None opts, args = getopt.getopt(sys.argv[1:], 's:', ['seed=']) for o, a in opts: if o in ('-s', '--seed'): seed = long(a, base=0) # accepts base 10 or 16 strings if seed is None: try: seed = long(binascii.hexlify(os.urandom(16)), 16) except AttributeError: seed = long(time.time() * 1000) rng = random.Random(seed) test_missingancestors(seed, rng) test_lazyancestors() test_gca() if __name__ == '__main__': main() mercurial-4.5.3/tests/test-wireproto.py.out0000644015407300116100000000006113261161234020723 0ustar augieeng00000000000000Hello, Foobar ['Hello, Fo, =;: a $ echo 0 > b $ hg ci -A -m m adding a adding b $ hg rm a $ hg cat a 0 $ hg cat --decode a # more tests in test-encode 0 $ echo 1 > b $ hg ci -m m $ echo 2 > b $ hg cat -r 0 a 0 $ hg cat -r 0 b 0 $ hg cat -r 1 a a: no such file in rev 7040230c159c [1] $ hg cat -r 1 b 1 Test multiple files $ echo 3 > c $ hg ci -Am addmore c $ hg cat b c 1 3 $ hg cat . 1 3 $ hg cat . c 1 3 Test fileset $ hg cat 'set:not(b) or a' 3 $ hg cat 'set:c or b' 1 3 $ mkdir tmp $ hg cat --output tmp/HH_%H c $ hg cat --output tmp/RR_%R c $ hg cat --output tmp/h_%h c $ hg cat --output tmp/r_%r c $ hg cat --output tmp/%s_s c $ hg cat --output tmp/%d%%_d c $ hg cat --output tmp/%p_p c $ hg log -r . --template "{rev}: {node|short}\n" 2: 45116003780e $ find tmp -type f | sort tmp/.%_d tmp/HH_45116003780e3678b333fb2c99fa7d559c8457e9 tmp/RR_2 tmp/c_p tmp/c_s tmp/h_45116003780e tmp/r_2 Test template output $ hg --cwd tmp cat ../b ../c -T '== {path} ({abspath}) ==\n{data}' == ../b (b) == 1 == ../c (c) == 3 $ hg cat b c -Tjson --output - [ { "abspath": "b", "data": "1\n", "path": "b" }, { "abspath": "c", "data": "3\n", "path": "c" } ] $ hg cat b c -Tjson --output 'tmp/%p.json' $ cat tmp/b.json [ { "abspath": "b", "data": "1\n", "path": "b" } ] $ cat tmp/c.json [ { "abspath": "c", "data": "3\n", "path": "c" } ] Test working directory $ echo b-wdir > b $ hg cat -r 'wdir()' b b-wdir Environment variables are not visible by default $ PATTERN='t4' hg log -r '.' -T "{ifcontains('PATTERN', envvars, 'yes', 'no')}\n" no Environment variable visibility can be explicit $ PATTERN='t4' hg log -r '.' -T "{envvars % '{key} -> {value}\n'}" \ > --config "experimental.exportableenviron=PATTERN" PATTERN -> t4 Test behavior of output when directory structure does not already exist $ mkdir foo $ echo a > foo/a $ hg add foo/a $ hg commit -qm "add foo/a" $ hg cat --output "output/%p" foo/a $ cat output/foo/a a mercurial-4.5.3/tests/test-pager.t0000644015407300116100000002225113261161234017001 0ustar augieeng00000000000000 $ cat >> fakepager.py < import sys > printed = False > for line in sys.stdin: > sys.stdout.write('paged! %r\n' % line) > printed = True > if not printed: > sys.stdout.write('paged empty output!\n') > EOF Enable ui.formatted because pager won't fire without it, and set up pager and tell it to use our fake pager that lets us see when the pager was running. $ cat >> $HGRCPATH < [ui] > formatted = yes > color = no > [pager] > pager = $PYTHON $TESTTMP/fakepager.py > EOF $ hg init repo $ cd repo $ echo a >> a $ hg add a $ hg ci -m 'add a' $ for x in `$PYTHON $TESTDIR/seq.py 1 10`; do > echo a $x >> a > hg ci -m "modify a $x" > done By default diff and log are paged, but id is not: $ hg diff -c 2 --pager=yes paged! 'diff -r f4be7687d414 -r bce265549556 a\n' paged! '--- a/a\tThu Jan 01 00:00:00 1970 +0000\n' paged! '+++ b/a\tThu Jan 01 00:00:00 1970 +0000\n' paged! '@@ -1,2 +1,3 @@\n' paged! ' a\n' paged! ' a 1\n' paged! '+a 2\n' $ hg log --limit 2 paged! 'changeset: 10:46106edeeb38\n' paged! 'tag: tip\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 10\n' paged! '\n' paged! 'changeset: 9:6dd8ea7dd621\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 9\n' paged! '\n' $ hg id 46106edeeb38 tip We can control the pager from the config $ hg log --limit 1 --config 'ui.paginate=False' changeset: 10:46106edeeb38 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modify a 10 $ hg log --limit 1 --config 'ui.paginate=0' changeset: 10:46106edeeb38 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modify a 10 $ hg log --limit 1 --config 'ui.paginate=1' paged! 'changeset: 10:46106edeeb38\n' paged! 'tag: tip\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 10\n' paged! '\n' explicit --pager=on should take precedence over other configurations (issue5580) $ cat >> $HGRCPATH < [ui] > paginate = false > EOF $ hg log --limit 1 --pager=on paged! 'changeset: 10:46106edeeb38\n' paged! 'tag: tip\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 10\n' paged! '\n' $ cat >> $HGRCPATH < [ui] > # true is default value of ui.paginate > paginate = true > EOF $ hg log --limit 1 --pager=off changeset: 10:46106edeeb38 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modify a 10 We can enable the pager on id: BROKEN: should be paged $ hg --config pager.attend-id=yes id 46106edeeb38 tip Setting attend-$COMMAND to a false value works, even with pager in core: $ hg --config pager.attend-diff=no diff -c 2 diff -r f4be7687d414 -r bce265549556 a --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +1,3 @@ a a 1 +a 2 Command aliases should have same behavior as main command $ hg history --limit 2 paged! 'changeset: 10:46106edeeb38\n' paged! 'tag: tip\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 10\n' paged! '\n' paged! 'changeset: 9:6dd8ea7dd621\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 9\n' paged! '\n' Abbreviated command alias should also be paged $ hg hist -l 1 paged! 'changeset: 10:46106edeeb38\n' paged! 'tag: tip\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 10\n' paged! '\n' Attend for an abbreviated command does not work $ hg --config pager.attend-ident=true ident 46106edeeb38 tip $ hg --config extensions.pager= --config pager.attend-ident=true ident 46106edeeb38 tip Pager should not start if stdout is not a tty. $ hg log -l1 -q --config ui.formatted=False 10:46106edeeb38 Pager should be disabled if pager.pager is empty (otherwise the output would be silently lost.) $ hg log -l1 -q --config pager.pager= 10:46106edeeb38 Pager with color enabled allows colors to come through by default, even though stdout is no longer a tty. $ cat >> $HGRCPATH < [ui] > color = always > [color] > mode = ansi > EOF $ hg log --limit 3 paged! '\x1b[0;33mchangeset: 10:46106edeeb38\x1b[0m\n' paged! 'tag: tip\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 10\n' paged! '\n' paged! '\x1b[0;33mchangeset: 9:6dd8ea7dd621\x1b[0m\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 9\n' paged! '\n' paged! '\x1b[0;33mchangeset: 8:cff05a6312fe\x1b[0m\n' paged! 'user: test\n' paged! 'date: Thu Jan 01 00:00:00 1970 +0000\n' paged! 'summary: modify a 8\n' paged! '\n' #if no-chg An invalid pager command name is reported sensibly if we don't have to use shell=True in the subprocess call: $ hg log --limit 3 --config pager.pager=this-command-better-never-exist missing pager command 'this-command-better-never-exist', skipping pager \x1b[0;33mchangeset: 10:46106edeeb38\x1b[0m (esc) tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modify a 10 \x1b[0;33mchangeset: 9:6dd8ea7dd621\x1b[0m (esc) user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modify a 9 \x1b[0;33mchangeset: 8:cff05a6312fe\x1b[0m (esc) user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modify a 8 #endif A complicated pager command gets worse behavior. Bonus points if you can improve this. $ hg log --limit 3 \ > --config pager.pager='this-command-better-never-exist --seriously' \ > 2>/dev/null || true Pager works with shell aliases. $ cat >> $HGRCPATH < [alias] > echoa = !echo a > EOF $ hg echoa a BROKEN: should be paged $ hg --config pager.attend-echoa=yes echoa a Pager works with hg aliases including environment variables. $ cat >> $HGRCPATH <<'EOF' > [alias] > printa = log -T "$A\n" -r 0 > EOF $ A=1 hg --config pager.attend-printa=yes printa paged! '1\n' $ A=2 hg --config pager.attend-printa=yes printa paged! '2\n' Something that's explicitly attended is still not paginated if the pager is globally set to off using a flag: $ A=2 hg --config pager.attend-printa=yes printa --pager=no 2 Pager should not override the exit code of other commands $ cat >> $TESTTMP/fortytwo.py <<'EOF' > from mercurial import commands, registrar > cmdtable = {} > command = registrar.command(cmdtable) > @command(b'fortytwo', [], 'fortytwo', norepo=True) > def fortytwo(ui, *opts): > ui.write('42\n') > return 42 > EOF $ cat >> $HGRCPATH <<'EOF' > [extensions] > fortytwo = $TESTTMP/fortytwo.py > EOF $ hg fortytwo --pager=on paged! '42\n' [42] A command that asks for paging using ui.pager() directly works: $ hg blame a paged! ' 0: a\n' paged! ' 1: a 1\n' paged! ' 2: a 2\n' paged! ' 3: a 3\n' paged! ' 4: a 4\n' paged! ' 5: a 5\n' paged! ' 6: a 6\n' paged! ' 7: a 7\n' paged! ' 8: a 8\n' paged! ' 9: a 9\n' paged! '10: a 10\n' but not with HGPLAIN $ HGPLAIN=1 hg blame a 0: a 1: a 1 2: a 2 3: a 3 4: a 4 5: a 5 6: a 6 7: a 7 8: a 8 9: a 9 10: a 10 explicit flags work too: $ hg blame --pager=no a 0: a 1: a 1 2: a 2 3: a 3 4: a 4 5: a 5 6: a 6 7: a 7 8: a 8 9: a 9 10: a 10 A command with --output option: $ hg cat -r0 a paged! 'a\n' $ hg cat -r0 a --output=- paged! 'a\n' $ hg cat -r0 a --output=out $ rm out Put annotate in the ignore list for pager: $ cat >> $HGRCPATH < [pager] > ignore = annotate > EOF $ hg blame a 0: a 1: a 1 2: a 2 3: a 3 4: a 4 5: a 5 6: a 6 7: a 7 8: a 8 9: a 9 10: a 10 During pushbuffer, pager should not start: $ cat > $TESTTMP/pushbufferpager.py < def uisetup(ui): > ui.pushbuffer() > ui.pager('mycmd') > ui.write('content\n') > ui.write(ui.popbuffer()) > EOF $ echo append >> a $ hg --config extensions.pushbuffer=$TESTTMP/pushbufferpager.py status --color=off content paged! 'M a\n' Environment variables like LESS and LV are set automatically: $ cat > $TESTTMP/printlesslv.py < from __future__ import absolute_import > import os > import sys > sys.stdin.read() > for name in ['LESS', 'LV']: > sys.stdout.write(('%s=%s\n') % (name, os.environ.get(name, '-'))) > sys.stdout.flush() > EOF $ cat >> $HGRCPATH < [alias] > noop = log -r 0 -T '' > [ui] > formatted=1 > [pager] > pager = $PYTHON $TESTTMP/printlesslv.py > EOF $ unset LESS $ unset LV $ hg noop --pager=on LESS=FRX LV=-c $ LESS=EFGH hg noop --pager=on LESS=EFGH LV=-c mercurial-4.5.3/tests/test-hgweb-annotate-whitespace.t0000644015407300116100000004470513261161234022750 0ustar augieeng00000000000000#require serve Create a repo with whitespace only changes $ hg init repo-with-whitespace $ cd repo-with-whitespace $ cat > foo << EOF > line 0 > line 1 > line 2 > line 3 > EOF $ hg -q commit -A -m 'commit 0' $ cat > foo << EOF > line 0 > line 1 modified by 1 > line 2 > line 3 > EOF $ hg commit -m 'commit 1' $ cat > foo << EOF > line 0 > line 1 modified by 1 > line 2 > line 3 > EOF $ hg commit -m 'commit 2 (leading whitespace on line 2)' $ cat > foo << EOF > line 0 > line 1 modified by 1 > line 2 > EOF Need to use printf to avoid check-code complaining about trailing whitespace. $ printf 'line 3 \n' >> foo $ hg commit -m 'commit 3 (trailing whitespace on line 3)' $ cat > foo << EOF > line 0 > line 1 modified by 1 > line 2 > EOF $ printf 'line 3 \n' >> foo $ hg commit -m 'commit 4 (intra whitespace on line 0)' $ cat > foo << EOF > line 0 > > line 1 modified by 1 > line 2 > EOF $ printf 'line 3 \n' >> foo $ hg commit -m 'commit 5 (add blank line between line 0 and 1)' $ cat > foo << EOF > line 0 > > > line 1 modified by 1 > line 2 > EOF $ printf 'line 3 \n' >> foo $ hg commit -m 'commit 6 (add another blank line between line 0 and 1)' $ hg log -G -T '{rev}:{node|short} {desc}' @ 6:9d1b2c7db017 commit 6 (add another blank line between line 0 and 1) | o 5:400ef1d40470 commit 5 (add blank line between line 0 and 1) | o 4:08adbe269f24 commit 4 (intra whitespace on line 0) | o 3:dcb62cfbfc9b commit 3 (trailing whitespace on line 3) | o 2:6bdb694e7b8c commit 2 (leading whitespace on line 2) | o 1:23e1e37387dc commit 1 | o 0:b9c578134d72 commit 0 $ hg serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid >> $DAEMON_PIDS $ hg serve --config annotate.ignorews=true -p $HGPORT1 -d --pid-file hg.pid $ cat hg.pid >> $DAEMON_PIDS $ cd .. Annotate works $ get-with-headers.py --json $LOCALIP:$HGPORT 'json-annotate/9d1b2c7db017/foo' 200 Script output follows { "abspath": "foo", "annotate": [ { "abspath": "foo", "author": "test", "desc": "commit 4 (intra whitespace on line 0)", "line": "line 0\n", "lineno": 1, "node": "08adbe269f24cf22d975eadeec16790c5b22f558", "revdate": [ 0.0, 0 ], "targetline": 1 }, { "abspath": "foo", "author": "test", "desc": "commit 5 (add blank line between line 0 and 1)", "line": "\n", "lineno": 2, "node": "400ef1d404706cfb48afd2b78ce6addf641ced25", "revdate": [ 0.0, 0 ], "targetline": 2 }, { "abspath": "foo", "author": "test", "desc": "commit 6 (add another blank line between line 0 and 1)", "line": "\n", "lineno": 3, "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5", "revdate": [ 0.0, 0 ], "targetline": 3 }, { "abspath": "foo", "author": "test", "desc": "commit 1", "line": "line 1 modified by 1\n", "lineno": 4, "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a", "revdate": [ 0.0, 0 ], "targetline": 2 }, { "abspath": "foo", "author": "test", "desc": "commit 2 (leading whitespace on line 2)", "line": " line 2\n", "lineno": 5, "node": "6bdb694e7b8cebb68d5b6b27b4bcc2a49d62c602", "revdate": [ 0.0, 0 ], "targetline": 3 }, { "abspath": "foo", "author": "test", "desc": "commit 3 (trailing whitespace on line 3)", "line": "line 3 \n", "lineno": 6, "node": "dcb62cfbfc9b3ab995a5cbbaff6e1971c3e4f865", "revdate": [ 0.0, 0 ], "targetline": 4 } ], "author": "test", "children": [], "date": [ 0.0, 0 ], "desc": "commit 6 (add another blank line between line 0 and 1)", "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5", "parents": [ "400ef1d404706cfb48afd2b78ce6addf641ced25" ], "permissions": "" } annotate.ignorews=1 config option is honored $ get-with-headers.py --json $LOCALIP:$HGPORT1 'json-annotate/9d1b2c7db017/foo' 200 Script output follows { "abspath": "foo", "annotate": [ { "abspath": "foo", "author": "test", "desc": "commit 0", "line": "line 0\n", "lineno": 1, "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc", "revdate": [ 0.0, 0 ], "targetline": 1 }, { "abspath": "foo", "author": "test", "desc": "commit 5 (add blank line between line 0 and 1)", "line": "\n", "lineno": 2, "node": "400ef1d404706cfb48afd2b78ce6addf641ced25", "revdate": [ 0.0, 0 ], "targetline": 2 }, { "abspath": "foo", "author": "test", "desc": "commit 6 (add another blank line between line 0 and 1)", "line": "\n", "lineno": 3, "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5", "revdate": [ 0.0, 0 ], "targetline": 3 }, { "abspath": "foo", "author": "test", "desc": "commit 1", "line": "line 1 modified by 1\n", "lineno": 4, "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a", "revdate": [ 0.0, 0 ], "targetline": 2 }, { "abspath": "foo", "author": "test", "desc": "commit 0", "line": " line 2\n", "lineno": 5, "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc", "revdate": [ 0.0, 0 ], "targetline": 3 }, { "abspath": "foo", "author": "test", "desc": "commit 0", "line": "line 3 \n", "lineno": 6, "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc", "revdate": [ 0.0, 0 ], "targetline": 4 } ], "author": "test", "children": [], "date": [ 0.0, 0 ], "desc": "commit 6 (add another blank line between line 0 and 1)", "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5", "parents": [ "400ef1d404706cfb48afd2b78ce6addf641ced25" ], "permissions": "" } ignorews=1 query string argument enables whitespace skipping $ get-with-headers.py --json $LOCALIP:$HGPORT 'json-annotate/9d1b2c7db017/foo?ignorews=1' 200 Script output follows { "abspath": "foo", "annotate": [ { "abspath": "foo", "author": "test", "desc": "commit 0", "line": "line 0\n", "lineno": 1, "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc", "revdate": [ 0.0, 0 ], "targetline": 1 }, { "abspath": "foo", "author": "test", "desc": "commit 5 (add blank line between line 0 and 1)", "line": "\n", "lineno": 2, "node": "400ef1d404706cfb48afd2b78ce6addf641ced25", "revdate": [ 0.0, 0 ], "targetline": 2 }, { "abspath": "foo", "author": "test", "desc": "commit 6 (add another blank line between line 0 and 1)", "line": "\n", "lineno": 3, "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5", "revdate": [ 0.0, 0 ], "targetline": 3 }, { "abspath": "foo", "author": "test", "desc": "commit 1", "line": "line 1 modified by 1\n", "lineno": 4, "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a", "revdate": [ 0.0, 0 ], "targetline": 2 }, { "abspath": "foo", "author": "test", "desc": "commit 0", "line": " line 2\n", "lineno": 5, "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc", "revdate": [ 0.0, 0 ], "targetline": 3 }, { "abspath": "foo", "author": "test", "desc": "commit 0", "line": "line 3 \n", "lineno": 6, "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc", "revdate": [ 0.0, 0 ], "targetline": 4 } ], "author": "test", "children": [], "date": [ 0.0, 0 ], "desc": "commit 6 (add another blank line between line 0 and 1)", "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5", "parents": [ "400ef1d404706cfb48afd2b78ce6addf641ced25" ], "permissions": "" } ignorews=0 query string argument disables when config defaults to enabled $ get-with-headers.py --json $LOCALIP:$HGPORT1 'json-annotate/9d1b2c7db017/foo?ignorews=0' 200 Script output follows { "abspath": "foo", "annotate": [ { "abspath": "foo", "author": "test", "desc": "commit 4 (intra whitespace on line 0)", "line": "line 0\n", "lineno": 1, "node": "08adbe269f24cf22d975eadeec16790c5b22f558", "revdate": [ 0.0, 0 ], "targetline": 1 }, { "abspath": "foo", "author": "test", "desc": "commit 5 (add blank line between line 0 and 1)", "line": "\n", "lineno": 2, "node": "400ef1d404706cfb48afd2b78ce6addf641ced25", "revdate": [ 0.0, 0 ], "targetline": 2 }, { "abspath": "foo", "author": "test", "desc": "commit 6 (add another blank line between line 0 and 1)", "line": "\n", "lineno": 3, "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5", "revdate": [ 0.0, 0 ], "targetline": 3 }, { "abspath": "foo", "author": "test", "desc": "commit 1", "line": "line 1 modified by 1\n", "lineno": 4, "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a", "revdate": [ 0.0, 0 ], "targetline": 2 }, { "abspath": "foo", "author": "test", "desc": "commit 2 (leading whitespace on line 2)", "line": " line 2\n", "lineno": 5, "node": "6bdb694e7b8cebb68d5b6b27b4bcc2a49d62c602", "revdate": [ 0.0, 0 ], "targetline": 3 }, { "abspath": "foo", "author": "test", "desc": "commit 3 (trailing whitespace on line 3)", "line": "line 3 \n", "lineno": 6, "node": "dcb62cfbfc9b3ab995a5cbbaff6e1971c3e4f865", "revdate": [ 0.0, 0 ], "targetline": 4 } ], "author": "test", "children": [], "date": [ 0.0, 0 ], "desc": "commit 6 (add another blank line between line 0 and 1)", "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5", "parents": [ "400ef1d404706cfb48afd2b78ce6addf641ced25" ], "permissions": "" } ignorewsamount=1 query string enables whitespace amount skipping $ get-with-headers.py --json $LOCALIP:$HGPORT 'json-annotate/9d1b2c7db017/foo?ignorewsamount=1' 200 Script output follows { "abspath": "foo", "annotate": [ { "abspath": "foo", "author": "test", "desc": "commit 0", "line": "line 0\n", "lineno": 1, "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc", "revdate": [ 0.0, 0 ], "targetline": 1 }, { "abspath": "foo", "author": "test", "desc": "commit 5 (add blank line between line 0 and 1)", "line": "\n", "lineno": 2, "node": "400ef1d404706cfb48afd2b78ce6addf641ced25", "revdate": [ 0.0, 0 ], "targetline": 2 }, { "abspath": "foo", "author": "test", "desc": "commit 6 (add another blank line between line 0 and 1)", "line": "\n", "lineno": 3, "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5", "revdate": [ 0.0, 0 ], "targetline": 3 }, { "abspath": "foo", "author": "test", "desc": "commit 1", "line": "line 1 modified by 1\n", "lineno": 4, "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a", "revdate": [ 0.0, 0 ], "targetline": 2 }, { "abspath": "foo", "author": "test", "desc": "commit 2 (leading whitespace on line 2)", "line": " line 2\n", "lineno": 5, "node": "6bdb694e7b8cebb68d5b6b27b4bcc2a49d62c602", "revdate": [ 0.0, 0 ], "targetline": 3 }, { "abspath": "foo", "author": "test", "desc": "commit 0", "line": "line 3 \n", "lineno": 6, "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc", "revdate": [ 0.0, 0 ], "targetline": 4 } ], "author": "test", "children": [], "date": [ 0.0, 0 ], "desc": "commit 6 (add another blank line between line 0 and 1)", "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5", "parents": [ "400ef1d404706cfb48afd2b78ce6addf641ced25" ], "permissions": "" } ignorewseol=1 query string enables whitespace end of line skipping $ get-with-headers.py --json $LOCALIP:$HGPORT 'json-annotate/9d1b2c7db017/foo?ignorewseol=1' 200 Script output follows { "abspath": "foo", "annotate": [ { "abspath": "foo", "author": "test", "desc": "commit 4 (intra whitespace on line 0)", "line": "line 0\n", "lineno": 1, "node": "08adbe269f24cf22d975eadeec16790c5b22f558", "revdate": [ 0.0, 0 ], "targetline": 1 }, { "abspath": "foo", "author": "test", "desc": "commit 5 (add blank line between line 0 and 1)", "line": "\n", "lineno": 2, "node": "400ef1d404706cfb48afd2b78ce6addf641ced25", "revdate": [ 0.0, 0 ], "targetline": 2 }, { "abspath": "foo", "author": "test", "desc": "commit 6 (add another blank line between line 0 and 1)", "line": "\n", "lineno": 3, "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5", "revdate": [ 0.0, 0 ], "targetline": 3 }, { "abspath": "foo", "author": "test", "desc": "commit 1", "line": "line 1 modified by 1\n", "lineno": 4, "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a", "revdate": [ 0.0, 0 ], "targetline": 2 }, { "abspath": "foo", "author": "test", "desc": "commit 2 (leading whitespace on line 2)", "line": " line 2\n", "lineno": 5, "node": "6bdb694e7b8cebb68d5b6b27b4bcc2a49d62c602", "revdate": [ 0.0, 0 ], "targetline": 3 }, { "abspath": "foo", "author": "test", "desc": "commit 0", "line": "line 3 \n", "lineno": 6, "node": "b9c578134d72b3a9d26afde8ddd76c0a93c5adbc", "revdate": [ 0.0, 0 ], "targetline": 4 } ], "author": "test", "children": [], "date": [ 0.0, 0 ], "desc": "commit 6 (add another blank line between line 0 and 1)", "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5", "parents": [ "400ef1d404706cfb48afd2b78ce6addf641ced25" ], "permissions": "" } ignoreblanklines=1 query string enables whitespace blank line skipping $ get-with-headers.py --json $LOCALIP:$HGPORT 'json-annotate/9d1b2c7db017/foo?ignoreblanklines=1' 200 Script output follows { "abspath": "foo", "annotate": [ { "abspath": "foo", "author": "test", "desc": "commit 4 (intra whitespace on line 0)", "line": "line 0\n", "lineno": 1, "node": "08adbe269f24cf22d975eadeec16790c5b22f558", "revdate": [ 0.0, 0 ], "targetline": 1 }, { "abspath": "foo", "author": "test", "desc": "commit 5 (add blank line between line 0 and 1)", "line": "\n", "lineno": 2, "node": "400ef1d404706cfb48afd2b78ce6addf641ced25", "revdate": [ 0.0, 0 ], "targetline": 2 }, { "abspath": "foo", "author": "test", "desc": "commit 6 (add another blank line between line 0 and 1)", "line": "\n", "lineno": 3, "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5", "revdate": [ 0.0, 0 ], "targetline": 3 }, { "abspath": "foo", "author": "test", "desc": "commit 1", "line": "line 1 modified by 1\n", "lineno": 4, "node": "23e1e37387dcfca4c0ed0cc568d1e4b9bfed241a", "revdate": [ 0.0, 0 ], "targetline": 2 }, { "abspath": "foo", "author": "test", "desc": "commit 2 (leading whitespace on line 2)", "line": " line 2\n", "lineno": 5, "node": "6bdb694e7b8cebb68d5b6b27b4bcc2a49d62c602", "revdate": [ 0.0, 0 ], "targetline": 3 }, { "abspath": "foo", "author": "test", "desc": "commit 3 (trailing whitespace on line 3)", "line": "line 3 \n", "lineno": 6, "node": "dcb62cfbfc9b3ab995a5cbbaff6e1971c3e4f865", "revdate": [ 0.0, 0 ], "targetline": 4 } ], "author": "test", "children": [], "date": [ 0.0, 0 ], "desc": "commit 6 (add another blank line between line 0 and 1)", "node": "9d1b2c7db0175870a950f8c48c9c4ead1058f2c5", "parents": [ "400ef1d404706cfb48afd2b78ce6addf641ced25" ], "permissions": "" } mercurial-4.5.3/tests/test-backwards-remove.t0000644015407300116100000000043013261161234021132 0ustar augieeng00000000000000 $ hg init $ echo This is file a1 > a $ hg add a $ hg commit -m "commit #0" $ ls a $ echo This is file b1 > b $ hg add b $ hg commit -m "commit #1" $ hg co 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved B should disappear $ ls a mercurial-4.5.3/tests/blackbox-readonly-dispatch.py0000644015407300116100000000201013261161234022277 0ustar augieeng00000000000000from __future__ import absolute_import, print_function import os from mercurial import ( dispatch, ) def testdispatch(cmd): """Simple wrapper around dispatch.dispatch() Prints command and result value, but does not handle quoting. """ print("running: %s" % (cmd,)) req = dispatch.request(cmd.split()) result = dispatch.dispatch(req) print("result: %r" % (result,)) # create file 'foo', add and commit f = open('foo', 'wb') f.write('foo\n') f.close() testdispatch("--debug add foo") testdispatch("--debug commit -m commit1 -d 2000-01-01 foo") # append to file 'foo' and commit f = open('foo', 'ab') f.write('bar\n') f.close() # remove blackbox.log directory (proxy for readonly log file) os.rmdir(".hg/blackbox.log") # replace it with the real blackbox.log file os.rename(".hg/blackbox.log-", ".hg/blackbox.log") testdispatch("--debug commit -m commit2 -d 2000-01-02 foo") # check 88803a69b24 (fancyopts modified command table) testdispatch("--debug log -r 0") testdispatch("--debug log -r tip") mercurial-4.5.3/tests/test-mq-git.t0000644015407300116100000001124313261161234017100 0ustar augieeng00000000000000# Test the plumbing of mq.git option # Automatic upgrade itself is tested elsewhere. $ cat <> $HGRCPATH > [extensions] > mq = > [diff] > nodates = 1 > EOF $ hg init repo-auto $ cd repo-auto git=auto: regular patch creation: $ echo a > a $ hg add a $ hg qnew -d '0 0' -f adda $ cat .hg/patches/adda # HG changeset patch # Date 0 0 # Parent 0000000000000000000000000000000000000000 diff -r 000000000000 -r ef8dafc9fa4c a --- /dev/null +++ b/a @@ -0,0 +1,1 @@ +a git=auto: git patch creation with copy: $ hg cp a b $ hg qnew -d '0 0' -f copy $ cat .hg/patches/copy # HG changeset patch # Date 0 0 # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4 diff --git a/a b/b copy from a copy to b git=auto: git patch when using --git: $ echo regular > regular $ hg add regular $ hg qnew -d '0 0' --git -f git $ cat .hg/patches/git # HG changeset patch # Date 0 0 # Parent 99586d5f048c399e20f81cee41fbb3809c0e735d diff --git a/regular b/regular new file mode 100644 --- /dev/null +++ b/regular @@ -0,0 +1,1 @@ +regular git=auto: regular patch after qrefresh without --git: $ hg qrefresh -d '0 0' $ cat .hg/patches/git # HG changeset patch # Date 0 0 # Parent 99586d5f048c399e20f81cee41fbb3809c0e735d diff -r 99586d5f048c regular --- /dev/null +++ b/regular @@ -0,0 +1,1 @@ +regular $ cd .. $ hg init repo-keep $ cd repo-keep $ echo '[mq]' > .hg/hgrc $ echo 'git = KEEP' >> .hg/hgrc git=keep: git patch with --git: $ echo a > a $ hg add a $ hg qnew -d '0 0' -f --git git $ cat .hg/patches/git # HG changeset patch # Date 0 0 # Parent 0000000000000000000000000000000000000000 diff --git a/a b/a new file mode 100644 --- /dev/null +++ b/a @@ -0,0 +1,1 @@ +a git=keep: git patch after qrefresh without --git: $ echo a >> a $ hg qrefresh -d '0 0' $ cat .hg/patches/git # HG changeset patch # Date 0 0 # Parent 0000000000000000000000000000000000000000 diff --git a/a b/a new file mode 100644 --- /dev/null +++ b/a @@ -0,0 +1,2 @@ +a +a $ cd .. $ hg init repo-yes $ cd repo-yes $ echo '[mq]' > .hg/hgrc $ echo 'git = yes' >> .hg/hgrc git=yes: git patch: $ echo a > a $ hg add a $ hg qnew -d '0 0' -f git $ cat .hg/patches/git # HG changeset patch # Date 0 0 # Parent 0000000000000000000000000000000000000000 diff --git a/a b/a new file mode 100644 --- /dev/null +++ b/a @@ -0,0 +1,1 @@ +a git=yes: git patch after qrefresh: $ echo a >> a $ hg qrefresh -d '0 0' $ cat .hg/patches/git # HG changeset patch # Date 0 0 # Parent 0000000000000000000000000000000000000000 diff --git a/a b/a new file mode 100644 --- /dev/null +++ b/a @@ -0,0 +1,2 @@ +a +a $ cd .. $ hg init repo-no $ cd repo-no $ echo '[diff]' > .hg/hgrc $ echo 'git = True' >> .hg/hgrc $ echo '[mq]' > .hg/hgrc $ echo 'git = False' >> .hg/hgrc git=no: regular patch with copy: $ echo a > a $ hg add a $ hg qnew -d '0 0' -f adda $ hg cp a b $ hg qnew -d '0 0' -f regular $ cat .hg/patches/regular # HG changeset patch # Date 0 0 # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4 diff -r ef8dafc9fa4c -r a70404f79ba3 b --- /dev/null +++ b/b @@ -0,0 +1,1 @@ +a git=no: regular patch after qrefresh with copy: $ hg cp a c $ hg qrefresh -d '0 0' $ cat .hg/patches/regular # HG changeset patch # Date 0 0 # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4 diff -r ef8dafc9fa4c b --- /dev/null +++ b/b @@ -0,0 +1,1 @@ +a diff -r ef8dafc9fa4c c --- /dev/null +++ b/c @@ -0,0 +1,1 @@ +a Test how [diff] configuration influence and cause invalid or lossy patches: $ cat <> .hg/hgrc > [mq] > git = AUTO > [diff] > nobinary = True > noprefix = True > showfunc = True > ignorews = True > ignorewsamount = True > ignoreblanklines = True > unified = 1 > EOF $ echo ' a' > a $ hg qnew prepare -d '0 0' $ echo ' a' > a $ printf '\0' > b $ echo >> c $ hg qnew diff -d '0 0' $ cat .hg/patches/prepare # HG changeset patch # Date 0 0 # Parent cf0bfe72686a47d8d7d7b4529a3adb8b0b449a9f diff -r cf0bfe72686a -r fb9c4422b0f3 a --- a/a +++ b/a @@ -1,1 +1,1 @@ -a + a $ cat .hg/patches/diff # HG changeset patch # Date 0 0 # Parent fb9c4422b0f37dd576522dd9a3f99b825c177efe diff --git a/a b/a --- a/a +++ b/a @@ -1,1 +1,1 @@ - a + a diff --git a/b b/b index 78981922613b2afb6025042ff6bd878ac1994e85..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 Ic${MZ000310RR91 diff --git a/c b/c --- a/c +++ b/c @@ -1,1 +1,2 @@ a + $ cd .. mercurial-4.5.3/tests/test-eol-patch.t0000644015407300116100000001576313261161234017571 0ustar augieeng00000000000000Test EOL patching $ cat >> $HGRCPATH < [diff] > git = 1 > EOF Set up helpers $ seteol () { > if [ $1 = "LF" ]; then > EOL='\n' > else > EOL='\r\n' > fi > } $ makerepo () { > seteol $1 > echo > echo "# ==== setup $1 repository ====" > echo '% hg init' > hg init repo > cd repo > cat > .hgeol < [repository] > native = $1 > [patterns] > unix.txt = LF > win.txt = CRLF > **.txt = native > EOF > printf "first\r\nsecond\r\nthird\r\n" > win.txt > printf "first\nsecond\nthird\n" > unix.txt > printf "first${EOL}second${EOL}third${EOL}" > native.txt > hg commit --addremove -m 'checkin' > cd .. > } $ dotest () { > seteol $1 > echo > echo "% hg clone repo repo-$1" > hg clone --noupdate repo repo-$1 > cd repo-$1 > cat > .hg/hgrc < [extensions] > eol = > [eol] > native = $1 > EOF > hg update > echo '% native.txt' > cat native.txt > echo '% unix.txt' > cat unix.txt > echo '% win.txt' > cat win.txt > printf "first${EOL}third${EOL}" > native.txt > printf "first\r\nthird\r\n" > win.txt > printf "first\nthird\n" > unix.txt > echo '% hg diff' > hg diff > p > cat p > echo '% hg revert' > hg revert --all > echo '% hg import' > hg import -m 'patch' p > echo '% native.txt' > cat native.txt > echo '% unix.txt' > cat unix.txt > echo '% win.txt' > cat win.txt > echo '% hg diff -c tip' > hg diff -c tip > cd .. > rm -r repo-$1 > } Run tests $ makerepo LF # ==== setup LF repository ==== % hg init adding .hgeol adding native.txt adding unix.txt adding win.txt $ dotest LF % hg clone repo repo-LF 4 files updated, 0 files merged, 0 files removed, 0 files unresolved % native.txt first second third % unix.txt first second third % win.txt first\r (esc) second\r (esc) third\r (esc) % hg diff diff --git a/native.txt b/native.txt --- a/native.txt +++ b/native.txt @@ -1,3 +1,2 @@ first -second third diff --git a/unix.txt b/unix.txt --- a/unix.txt +++ b/unix.txt @@ -1,3 +1,2 @@ first -second third diff --git a/win.txt b/win.txt --- a/win.txt +++ b/win.txt @@ -1,3 +1,2 @@ first\r (esc) -second\r (esc) third\r (esc) % hg revert reverting native.txt reverting unix.txt reverting win.txt % hg import applying p % native.txt first third % unix.txt first third % win.txt first\r (esc) third\r (esc) % hg diff -c tip diff --git a/native.txt b/native.txt --- a/native.txt +++ b/native.txt @@ -1,3 +1,2 @@ first -second third diff --git a/unix.txt b/unix.txt --- a/unix.txt +++ b/unix.txt @@ -1,3 +1,2 @@ first -second third diff --git a/win.txt b/win.txt --- a/win.txt +++ b/win.txt @@ -1,3 +1,2 @@ first\r (esc) -second\r (esc) third\r (esc) $ dotest CRLF % hg clone repo repo-CRLF 4 files updated, 0 files merged, 0 files removed, 0 files unresolved % native.txt first\r (esc) second\r (esc) third\r (esc) % unix.txt first second third % win.txt first\r (esc) second\r (esc) third\r (esc) % hg diff diff --git a/native.txt b/native.txt --- a/native.txt +++ b/native.txt @@ -1,3 +1,2 @@ first -second third diff --git a/unix.txt b/unix.txt --- a/unix.txt +++ b/unix.txt @@ -1,3 +1,2 @@ first -second third diff --git a/win.txt b/win.txt --- a/win.txt +++ b/win.txt @@ -1,3 +1,2 @@ first\r (esc) -second\r (esc) third\r (esc) % hg revert reverting native.txt reverting unix.txt reverting win.txt % hg import applying p % native.txt first\r (esc) third\r (esc) % unix.txt first third % win.txt first\r (esc) third\r (esc) % hg diff -c tip diff --git a/native.txt b/native.txt --- a/native.txt +++ b/native.txt @@ -1,3 +1,2 @@ first -second third diff --git a/unix.txt b/unix.txt --- a/unix.txt +++ b/unix.txt @@ -1,3 +1,2 @@ first -second third diff --git a/win.txt b/win.txt --- a/win.txt +++ b/win.txt @@ -1,3 +1,2 @@ first\r (esc) -second\r (esc) third\r (esc) $ rm -r repo $ makerepo CRLF # ==== setup CRLF repository ==== % hg init adding .hgeol adding native.txt adding unix.txt adding win.txt $ dotest LF % hg clone repo repo-LF 4 files updated, 0 files merged, 0 files removed, 0 files unresolved % native.txt first second third % unix.txt first second third % win.txt first\r (esc) second\r (esc) third\r (esc) % hg diff diff --git a/native.txt b/native.txt --- a/native.txt +++ b/native.txt @@ -1,3 +1,2 @@ first\r (esc) -second\r (esc) third\r (esc) diff --git a/unix.txt b/unix.txt --- a/unix.txt +++ b/unix.txt @@ -1,3 +1,2 @@ first -second third diff --git a/win.txt b/win.txt --- a/win.txt +++ b/win.txt @@ -1,3 +1,2 @@ first\r (esc) -second\r (esc) third\r (esc) % hg revert reverting native.txt reverting unix.txt reverting win.txt % hg import applying p % native.txt first third % unix.txt first third % win.txt first\r (esc) third\r (esc) % hg diff -c tip diff --git a/native.txt b/native.txt --- a/native.txt +++ b/native.txt @@ -1,3 +1,2 @@ first\r (esc) -second\r (esc) third\r (esc) diff --git a/unix.txt b/unix.txt --- a/unix.txt +++ b/unix.txt @@ -1,3 +1,2 @@ first -second third diff --git a/win.txt b/win.txt --- a/win.txt +++ b/win.txt @@ -1,3 +1,2 @@ first\r (esc) -second\r (esc) third\r (esc) $ dotest CRLF % hg clone repo repo-CRLF 4 files updated, 0 files merged, 0 files removed, 0 files unresolved % native.txt first\r (esc) second\r (esc) third\r (esc) % unix.txt first second third % win.txt first\r (esc) second\r (esc) third\r (esc) % hg diff diff --git a/native.txt b/native.txt --- a/native.txt +++ b/native.txt @@ -1,3 +1,2 @@ first\r (esc) -second\r (esc) third\r (esc) diff --git a/unix.txt b/unix.txt --- a/unix.txt +++ b/unix.txt @@ -1,3 +1,2 @@ first -second third diff --git a/win.txt b/win.txt --- a/win.txt +++ b/win.txt @@ -1,3 +1,2 @@ first\r (esc) -second\r (esc) third\r (esc) % hg revert reverting native.txt reverting unix.txt reverting win.txt % hg import applying p % native.txt first\r (esc) third\r (esc) % unix.txt first third % win.txt first\r (esc) third\r (esc) % hg diff -c tip diff --git a/native.txt b/native.txt --- a/native.txt +++ b/native.txt @@ -1,3 +1,2 @@ first\r (esc) -second\r (esc) third\r (esc) diff --git a/unix.txt b/unix.txt --- a/unix.txt +++ b/unix.txt @@ -1,3 +1,2 @@ first -second third diff --git a/win.txt b/win.txt --- a/win.txt +++ b/win.txt @@ -1,3 +1,2 @@ first\r (esc) -second\r (esc) third\r (esc) $ rm -r repo mercurial-4.5.3/tests/test-https.t0000644015407300116100000010764213261161234017055 0ustar augieeng00000000000000#require serve ssl Proper https client requires the built-in ssl from Python 2.6. Make server certificates: $ CERTSDIR="$TESTDIR/sslcerts" $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub.pem" >> server.pem $ PRIV=`pwd`/server.pem $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub-not-yet.pem" > server-not-yet.pem $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub-expired.pem" > server-expired.pem $ hg init test $ cd test $ echo foo>foo $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg $ echo foo>foo.d/foo $ echo bar>foo.d/bAr.hg.d/BaR $ echo bar>foo.d/baR.d.hg/bAR $ hg commit -A -m 1 adding foo adding foo.d/bAr.hg.d/BaR adding foo.d/baR.d.hg/bAR adding foo.d/foo $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV $ cat ../hg0.pid >> $DAEMON_PIDS cacert not found $ hg in --config web.cacerts=no-such.pem https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) abort: could not find web.cacerts: no-such.pem [255] Test server address cannot be reused $ hg serve -p $HGPORT --certificate=$PRIV 2>&1 abort: cannot start server at 'localhost:$HGPORT': $EADDRINUSE$ [255] $ cd .. Our test cert is not signed by a trusted CA. It should fail to verify if we are able to load CA certs. #if sslcontext defaultcacerts no-defaultcacertsloaded $ hg clone https://localhost:$HGPORT/ copy-pull (an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error) abort: error: *certificate verify failed* (glob) [255] #endif #if no-sslcontext defaultcacerts $ hg clone https://localhost:$HGPORT/ copy-pull warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) (using CA certificates from *; if you see this message, your Mercurial install is not properly configured; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) (glob) (?) abort: error: *certificate verify failed* (glob) [255] #endif #if no-sslcontext windows $ hg clone https://localhost:$HGPORT/ copy-pull warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (unable to load Windows CA certificates; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) abort: error: *certificate verify failed* (glob) [255] #endif #if no-sslcontext osx $ hg clone https://localhost:$HGPORT/ copy-pull warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (unable to load CA certificates; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) abort: localhost certificate error: no certificate received (set hostsecurity.localhost:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely) [255] #endif #if defaultcacertsloaded $ hg clone https://localhost:$HGPORT/ copy-pull warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) (using CA certificates from *; if you see this message, your Mercurial install is not properly configured; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) (glob) (?) (the full certificate chain may not be available locally; see "hg help debugssl") (windows !) abort: error: *certificate verify failed* (glob) [255] #endif #if no-defaultcacerts $ hg clone https://localhost:$HGPORT/ copy-pull warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) (unable to load * certificates; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) (glob) (?) abort: localhost certificate error: no certificate received (set hostsecurity.localhost:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely) [255] #endif Specifying a per-host certificate file that doesn't exist will abort. The full C:/path/to/msysroot will print on Windows. $ hg --config hostsecurity.localhost:verifycertsfile=/does/not/exist clone https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) abort: path specified by hostsecurity.localhost:verifycertsfile does not exist: */does/not/exist (glob) [255] A malformed per-host certificate file will raise an error $ echo baddata > badca.pem #if sslcontext $ hg --config hostsecurity.localhost:verifycertsfile=badca.pem clone https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) abort: error loading CA file badca.pem: * (glob) (file is empty or malformed?) [255] #else $ hg --config hostsecurity.localhost:verifycertsfile=badca.pem clone https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) abort: error: * (glob) [255] #endif A per-host certificate mismatching the server will fail verification (modern ssl is able to discern whether the loaded cert is a CA cert) #if sslcontext $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) (an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error) (the full certificate chain may not be available locally; see "hg help debugssl") (windows !) abort: error: *certificate verify failed* (glob) [255] #else $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) abort: error: *certificate verify failed* (glob) [255] #endif A per-host certificate matching the server's cert will be accepted $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem" clone -U https://localhost:$HGPORT/ perhostgood1 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 4 changes to 4 files new changesets 8b6053c928fe A per-host certificate with multiple certs and one matching will be accepted $ cat "$CERTSDIR/client-cert.pem" "$CERTSDIR/pub.pem" > perhost.pem $ hg --config hostsecurity.localhost:verifycertsfile=perhost.pem clone -U https://localhost:$HGPORT/ perhostgood2 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 4 changes to 4 files new changesets 8b6053c928fe Defining both per-host certificate and a fingerprint will print a warning $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem" --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 clone -U https://localhost:$HGPORT/ caandfingerwarning warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) (hostsecurity.localhost:verifycertsfile ignored when host fingerprints defined; using host fingerprints for verification) requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 4 changes to 4 files new changesets 8b6053c928fe $ DISABLECACERTS="--config devel.disableloaddefaultcerts=true" Inability to verify peer certificate will result in abort $ hg clone https://localhost:$HGPORT/ copy-pull $DISABLECACERTS warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) abort: unable to verify security of localhost (no loaded CA certificates); refusing to connect (see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error or set hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e to trust this server) [255] $ hg clone --insecure https://localhost:$HGPORT/ copy-pull warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 4 changes to 4 files new changesets 8b6053c928fe updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg verify -R copy-pull checking changesets checking manifests crosschecking files in changesets and manifests checking files 4 files, 1 changesets, 4 total revisions $ cd test $ echo bar > bar $ hg commit -A -d '1 0' -m 2 adding bar $ cd .. pull without cacert $ cd copy-pull $ cat >> .hg/hgrc < [hooks] > changegroup = sh -c "printenv.py changegroup" > EOF $ hg pull $DISABLECACERTS pulling from https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) abort: unable to verify security of localhost (no loaded CA certificates); refusing to connect (see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error or set hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e to trust this server) [255] $ hg pull --insecure pulling from https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 5fed3813f7f5 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=https://localhost:$HGPORT/ (run 'hg update' to get a working copy) $ cd .. cacert configured in local repo $ cp copy-pull/.hg/hgrc copy-pull/.hg/hgrc.bu $ echo "[web]" >> copy-pull/.hg/hgrc $ echo "cacerts=$CERTSDIR/pub.pem" >> copy-pull/.hg/hgrc $ hg -R copy-pull pull pulling from https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) searching for changes no changes found $ mv copy-pull/.hg/hgrc.bu copy-pull/.hg/hgrc cacert configured globally, also testing expansion of environment variables in the filename $ echo "[web]" >> $HGRCPATH $ echo 'cacerts=$P/pub.pem' >> $HGRCPATH $ P="$CERTSDIR" hg -R copy-pull pull pulling from https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) searching for changes no changes found $ P="$CERTSDIR" hg -R copy-pull pull --insecure pulling from https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering searching for changes no changes found empty cacert file $ touch emptycafile #if sslcontext $ hg --config web.cacerts=emptycafile -R copy-pull pull pulling from https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) abort: error loading CA file emptycafile: * (glob) (file is empty or malformed?) [255] #else $ hg --config web.cacerts=emptycafile -R copy-pull pull pulling from https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) abort: error: * (glob) [255] #endif cacert mismatch $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \ > https://$LOCALIP:$HGPORT/ pulling from https://*:$HGPORT/ (glob) warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) abort: $LOCALIP certificate error: certificate is for localhost (glob) (set hostsecurity.$LOCALIP:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely) [255] $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \ > https://$LOCALIP:$HGPORT/ --insecure pulling from https://*:$HGPORT/ (glob) warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) warning: connection security to $LOCALIP is disabled per current settings; communication is susceptible to eavesdropping and tampering (glob) searching for changes no changes found $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-other.pem" pulling from https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) (the full certificate chain may not be available locally; see "hg help debugssl") (windows !) abort: error: *certificate verify failed* (glob) [255] $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-other.pem" \ > --insecure pulling from https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering searching for changes no changes found Test server cert which isn't valid yet $ hg serve -R test -p $HGPORT1 -d --pid-file=hg1.pid --certificate=server-not-yet.pem $ cat hg1.pid >> $DAEMON_PIDS $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-not-yet.pem" \ > https://localhost:$HGPORT1/ pulling from https://localhost:$HGPORT1/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) (the full certificate chain may not be available locally; see "hg help debugssl") (windows !) abort: error: *certificate verify failed* (glob) [255] Test server cert which no longer is valid $ hg serve -R test -p $HGPORT2 -d --pid-file=hg2.pid --certificate=server-expired.pem $ cat hg2.pid >> $DAEMON_PIDS $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-expired.pem" \ > https://localhost:$HGPORT2/ pulling from https://localhost:$HGPORT2/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) (the full certificate chain may not be available locally; see "hg help debugssl") (windows !) abort: error: *certificate verify failed* (glob) [255] Disabling the TLS 1.0 warning works $ hg -R copy-pull id https://localhost:$HGPORT/ \ > --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 \ > --config hostsecurity.disabletls10warning=true 5fed3813f7f5 Error message for setting ciphers is different depending on SSLContext support #if no-sslcontext $ P="$CERTSDIR" hg --config hostsecurity.ciphers=invalid -R copy-pull id https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info abort: *No cipher can be selected. (glob) [255] $ P="$CERTSDIR" hg --config hostsecurity.ciphers=HIGH -R copy-pull id https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info 5fed3813f7f5 #endif #if sslcontext Setting ciphers to an invalid value aborts $ P="$CERTSDIR" hg --config hostsecurity.ciphers=invalid -R copy-pull id https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) abort: could not set ciphers: No cipher can be selected. (change cipher string (invalid) in config) [255] $ P="$CERTSDIR" hg --config hostsecurity.localhost:ciphers=invalid -R copy-pull id https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) abort: could not set ciphers: No cipher can be selected. (change cipher string (invalid) in config) [255] Changing the cipher string works $ P="$CERTSDIR" hg --config hostsecurity.ciphers=HIGH -R copy-pull id https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) 5fed3813f7f5 #endif Fingerprints - works without cacerts (hostfingerprints) $ hg -R copy-pull id https://localhost:$HGPORT/ --insecure --config hostfingerprints.localhost=ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e) 5fed3813f7f5 - works without cacerts (hostsecurity) $ hg -R copy-pull id https://localhost:$HGPORT/ --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) 5fed3813f7f5 $ hg -R copy-pull id https://localhost:$HGPORT/ --config hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) 5fed3813f7f5 - multiple fingerprints specified and first matches $ hg --config 'hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03, deadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --insecure warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e) 5fed3813f7f5 $ hg --config 'hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03, sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) 5fed3813f7f5 - multiple fingerprints specified and last matches $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03' -R copy-pull id https://localhost:$HGPORT/ --insecure warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e) 5fed3813f7f5 $ hg --config 'hostsecurity.localhost:fingerprints=sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03' -R copy-pull id https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) 5fed3813f7f5 - multiple fingerprints specified and none match $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, aeadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --insecure warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) abort: certificate for localhost has unexpected fingerprint ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03 (check hostfingerprint configuration) [255] $ hg --config 'hostsecurity.localhost:fingerprints=sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, sha1:aeadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) abort: certificate for localhost has unexpected fingerprint sha1:ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03 (check hostsecurity configuration) [255] - fails when cert doesn't match hostname (port is ignored) $ hg -R copy-pull id https://localhost:$HGPORT1/ --config hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) abort: certificate for localhost has unexpected fingerprint f4:2f:5a:0c:3e:52:5b:db:e7:24:a8:32:1d:18:97:6d:69:b5:87:84 (check hostfingerprint configuration) [255] - ignores that certificate doesn't match hostname $ hg -R copy-pull id https://$LOCALIP:$HGPORT/ --config hostfingerprints.$LOCALIP=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) (SHA-1 fingerprint for $LOCALIP found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: $LOCALIP:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e) 5fed3813f7f5 Ports used by next test. Kill servers. $ killdaemons.py hg0.pid $ killdaemons.py hg1.pid $ killdaemons.py hg2.pid #if sslcontext tls1.2 Start servers running supported TLS versions $ cd test $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV \ > --config devel.serverexactprotocol=tls1.0 $ cat ../hg0.pid >> $DAEMON_PIDS $ hg serve -p $HGPORT1 -d --pid-file=../hg1.pid --certificate=$PRIV \ > --config devel.serverexactprotocol=tls1.1 $ cat ../hg1.pid >> $DAEMON_PIDS $ hg serve -p $HGPORT2 -d --pid-file=../hg2.pid --certificate=$PRIV \ > --config devel.serverexactprotocol=tls1.2 $ cat ../hg2.pid >> $DAEMON_PIDS $ cd .. Clients talking same TLS versions work $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.0 id https://localhost:$HGPORT/ 5fed3813f7f5 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 id https://localhost:$HGPORT1/ 5fed3813f7f5 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT2/ 5fed3813f7f5 Clients requiring newer TLS version than what server supports fail $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ (could not negotiate a common security protocol (tls1.1+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) (see https://mercurial-scm.org/wiki/SecureConnections for more info) abort: error: *unsupported protocol* (glob) [255] $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 id https://localhost:$HGPORT/ (could not negotiate a common security protocol (tls1.1+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) (see https://mercurial-scm.org/wiki/SecureConnections for more info) abort: error: *unsupported protocol* (glob) [255] $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT/ (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) (see https://mercurial-scm.org/wiki/SecureConnections for more info) abort: error: *unsupported protocol* (glob) [255] $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT1/ (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) (see https://mercurial-scm.org/wiki/SecureConnections for more info) abort: error: *unsupported protocol* (glob) [255] --insecure will allow TLS 1.0 connections and override configs $ hg --config hostsecurity.minimumprotocol=tls1.2 id --insecure https://localhost:$HGPORT1/ warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering 5fed3813f7f5 The per-host config option overrides the default $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \ > --config hostsecurity.minimumprotocol=tls1.2 \ > --config hostsecurity.localhost:minimumprotocol=tls1.0 5fed3813f7f5 The per-host config option by itself works $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \ > --config hostsecurity.localhost:minimumprotocol=tls1.2 (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) (see https://mercurial-scm.org/wiki/SecureConnections for more info) abort: error: *unsupported protocol* (glob) [255] .hg/hgrc file [hostsecurity] settings are applied to remote ui instances (issue5305) $ cat >> copy-pull/.hg/hgrc << EOF > [hostsecurity] > localhost:minimumprotocol=tls1.2 > EOF $ P="$CERTSDIR" hg -R copy-pull id https://localhost:$HGPORT/ (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support) (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server) (see https://mercurial-scm.org/wiki/SecureConnections for more info) abort: error: *unsupported protocol* (glob) [255] $ killdaemons.py hg0.pid $ killdaemons.py hg1.pid $ killdaemons.py hg2.pid #endif Prepare for connecting through proxy $ hg serve -R test -p $HGPORT -d --pid-file=hg0.pid --certificate=$PRIV $ cat hg0.pid >> $DAEMON_PIDS $ hg serve -R test -p $HGPORT2 -d --pid-file=hg2.pid --certificate=server-expired.pem $ cat hg2.pid >> $DAEMON_PIDS tinyproxy.py doesn't fully detach, so killing it may result in extra output from the shell. So don't kill it. $ tinyproxy.py $HGPORT1 localhost >proxy.log &1 & $ while [ ! -f proxy.pid ]; do sleep 0; done $ cat proxy.pid >> $DAEMON_PIDS $ echo "[http_proxy]" >> copy-pull/.hg/hgrc $ echo "always=True" >> copy-pull/.hg/hgrc $ echo "[hostfingerprints]" >> copy-pull/.hg/hgrc $ echo "localhost =" >> copy-pull/.hg/hgrc Test unvalidated https through proxy $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull --insecure pulling from https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering searching for changes no changes found Test https with cacert and fingerprint through proxy $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \ > --config web.cacerts="$CERTSDIR/pub.pem" pulling from https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) searching for changes no changes found $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull https://localhost:$HGPORT/ --config hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 --trace pulling from https://*:$HGPORT/ (glob) warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e) searching for changes no changes found Test https with cert problems through proxy $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \ > --config web.cacerts="$CERTSDIR/pub-other.pem" pulling from https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) (the full certificate chain may not be available locally; see "hg help debugssl") (windows !) abort: error: *certificate verify failed* (glob) [255] $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \ > --config web.cacerts="$CERTSDIR/pub-expired.pem" https://localhost:$HGPORT2/ pulling from https://localhost:$HGPORT2/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) (the full certificate chain may not be available locally; see "hg help debugssl") (windows !) abort: error: *certificate verify failed* (glob) [255] $ killdaemons.py hg0.pid #if sslcontext $ cd test Missing certificate file(s) are detected $ hg serve -p $HGPORT --certificate=/missing/certificate \ > --config devel.servercafile=$PRIV --config devel.serverrequirecert=true abort: referenced certificate file (*/missing/certificate) does not exist (glob) [255] $ hg serve -p $HGPORT --certificate=$PRIV \ > --config devel.servercafile=/missing/cafile --config devel.serverrequirecert=true abort: referenced certificate file (*/missing/cafile) does not exist (glob) [255] Start hgweb that requires client certificates: $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV \ > --config devel.servercafile=$PRIV --config devel.serverrequirecert=true $ cat ../hg0.pid >> $DAEMON_PIDS $ cd .. without client certificate: $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) abort: error: *handshake failure* (glob) [255] with client certificate: $ cat << EOT >> $HGRCPATH > [auth] > l.prefix = localhost > l.cert = $CERTSDIR/client-cert.pem > l.key = $CERTSDIR/client-key.pem > EOT $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \ > --config auth.l.key="$CERTSDIR/client-key-decrypted.pem" warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) 5fed3813f7f5 $ printf '1234\n' | env P="$CERTSDIR" hg id https://localhost:$HGPORT/ \ > --config ui.interactive=True --config ui.nontty=True warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) passphrase for */client-key.pem: 5fed3813f7f5 (glob) $ env P="$CERTSDIR" hg id https://localhost:$HGPORT/ warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) abort: error: * (glob) [255] Missing certficate and key files result in error $ hg id https://localhost:$HGPORT/ --config auth.l.cert=/missing/cert abort: certificate file (*/missing/cert) does not exist; cannot connect to localhost (glob) (restore missing file or fix references in Mercurial config) [255] $ hg id https://localhost:$HGPORT/ --config auth.l.key=/missing/key abort: certificate file (*/missing/key) does not exist; cannot connect to localhost (glob) (restore missing file or fix references in Mercurial config) [255] #endif mercurial-4.5.3/tests/test-requires.t0000644015407300116100000000444413261161234017546 0ustar augieeng00000000000000 $ hg init t $ cd t $ echo a > a $ hg add a $ hg commit -m test $ rm .hg/requires $ hg tip abort: unknown version (2) in revlog 00changelog.i! [255] $ echo indoor-pool > .hg/requires $ hg tip abort: repository requires features unknown to this Mercurial: indoor-pool! (see https://mercurial-scm.org/wiki/MissingRequirement for more information) [255] $ echo outdoor-pool >> .hg/requires $ hg tip abort: repository requires features unknown to this Mercurial: indoor-pool outdoor-pool! (see https://mercurial-scm.org/wiki/MissingRequirement for more information) [255] $ cd .. Test checking between features supported locally and ones required in another repository of push/pull/clone on localhost: $ mkdir supported-locally $ cd supported-locally $ hg init supported $ echo a > supported/a $ hg -R supported commit -Am '#0 at supported' adding a $ echo 'featuresetup-test' >> supported/.hg/requires $ cat > $TESTTMP/supported-locally/supportlocally.py < from __future__ import absolute_import > from mercurial import extensions, localrepo > def featuresetup(ui, supported): > for name, module in extensions.extensions(ui): > if __name__ == module.__name__: > # support specific feature locally > supported |= {'featuresetup-test'} > return > def uisetup(ui): > localrepo.localrepository.featuresetupfuncs.add(featuresetup) > EOF $ cat > supported/.hg/hgrc < [extensions] > # enable extension locally > supportlocally = $TESTTMP/supported-locally/supportlocally.py > EOF $ hg -R supported status $ hg init push-dst $ hg -R supported push push-dst pushing to push-dst abort: required features are not supported in the destination: featuresetup-test [255] $ hg init pull-src $ hg -R pull-src pull supported pulling from supported abort: required features are not supported in the destination: featuresetup-test [255] $ hg clone supported clone-dst abort: repository requires features unknown to this Mercurial: featuresetup-test! (see https://mercurial-scm.org/wiki/MissingRequirement for more information) [255] $ hg clone --pull supported clone-dst abort: required features are not supported in the destination: featuresetup-test [255] $ cd .. mercurial-4.5.3/tests/test-lfs-pointer.py.out0000644015407300116100000000135713261161234021144 0ustar augieeng00000000000000missed keys: oid, size ok unexpected value: version='https://unknown.github.com/spec/v1' cannot parse git-lfs text: 'version https://git-lfs.github.com/spec/v1\n\noid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393\nsize 12345\nx-foo extra-information\n' unexpected value: oid='ahs256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393' unexpected value: oid='4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393' unexpected value: size='0x12345' ok cannot parse git-lfs text: 'version https://git-lfs.github.com/spec/v1\noid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393\nsize 12345\nx-foo extra\ninformation\n' unexpected key: x_foo missed keys: oid missed keys: oid, size mercurial-4.5.3/tests/test-archive.t0000644015407300116100000003461013261161234017326 0ustar augieeng00000000000000#require serve $ hg init test $ cd test $ echo foo>foo $ hg commit -Am 1 -d '1 0' adding foo $ echo bar>bar $ hg commit -Am 2 -d '2 0' adding bar $ mkdir baz $ echo bletch>baz/bletch $ hg commit -Am 3 -d '1000000000 0' adding baz/bletch $ hg init subrepo $ touch subrepo/sub $ hg -q -R subrepo ci -Am "init subrepo" $ echo "subrepo = subrepo" > .hgsub $ hg add .hgsub $ hg ci -m "add subrepo" $ cat >> $HGRCPATH < [extensions] > share = > EOF hg subrepos are shared when the parent repo is shared $ cd .. $ hg share test shared1 updating working directory sharing subrepo subrepo from $TESTTMP/test/subrepo 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat shared1/subrepo/.hg/sharedpath $TESTTMP/test/subrepo/.hg (no-eol) hg subrepos are shared into existence on demand if the parent was shared $ hg clone -qr 1 test clone1 $ hg share clone1 share2 updating working directory 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R clone1 -q pull $ hg -R share2 update tip sharing subrepo subrepo from $TESTTMP/test/subrepo 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat share2/subrepo/.hg/sharedpath $TESTTMP/test/subrepo/.hg (no-eol) $ echo 'mod' > share2/subrepo/sub $ hg -R share2 ci -Sqm 'subrepo mod' $ hg -R clone1 update -C tip cloning subrepo subrepo from $TESTTMP/test/subrepo 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ find share2 | egrep 'sharedpath|00.+\.i' | sort share2/.hg/sharedpath share2/subrepo/.hg/sharedpath $ hg -R share2 unshare unsharing subrepo 'subrepo' $ find share2 | egrep 'sharedpath|00.+\.i' | sort share2/.hg/00changelog.i share2/.hg/sharedpath.old share2/.hg/store/00changelog.i share2/.hg/store/00manifest.i share2/subrepo/.hg/00changelog.i share2/subrepo/.hg/sharedpath.old share2/subrepo/.hg/store/00changelog.i share2/subrepo/.hg/store/00manifest.i $ hg -R share2/subrepo log -r tip -T compact 1[tip] 559dcc9bfa65 1970-01-01 00:00 +0000 test subrepo mod $ rm -rf clone1 $ hg clone -qr 1 test clone1 $ hg share clone1 shared3 updating working directory 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R clone1 -q pull $ hg -R shared3 archive --config ui.archivemeta=False -r tip -S archive sharing subrepo subrepo from $TESTTMP/test/subrepo $ cat shared3/subrepo/.hg/sharedpath $TESTTMP/test/subrepo/.hg (no-eol) $ diff -r archive test Only in test: .hg Common subdirectories: archive/baz and test/baz (?) Common subdirectories: archive/subrepo and test/subrepo (?) Only in test/subrepo: .hg [1] $ rm -rf archive $ cd test $ echo "[web]" >> .hg/hgrc $ echo "name = test-archive" >> .hg/hgrc $ echo "archivesubrepos = True" >> .hg/hgrc $ cp .hg/hgrc .hg/hgrc-base > test_archtype() { > echo "allow_archive = $1" >> .hg/hgrc > test_archtype_run "$@" > } > test_archtype_deprecated() { > echo "allow$1 = True" >> .hg/hgrc > test_archtype_run "$@" > } > test_archtype_run() { > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log \ > --config extensions.blackbox= --config blackbox.track=develwarn > cat hg.pid >> $DAEMON_PIDS > echo % $1 allowed should give 200 > get-with-headers.py localhost:$HGPORT "archive/tip.$2" | head -n 1 > echo % $3 and $4 disallowed should both give 403 > get-with-headers.py localhost:$HGPORT "archive/tip.$3" | head -n 1 > get-with-headers.py localhost:$HGPORT "archive/tip.$4" | head -n 1 > killdaemons.py > cat errors.log > hg blackbox --config extensions.blackbox= --config blackbox.track= > cp .hg/hgrc-base .hg/hgrc > } check http return codes $ test_archtype gz tar.gz tar.bz2 zip % gz allowed should give 200 200 Script output follows % tar.bz2 and zip disallowed should both give 403 403 Archive type not allowed: bz2 403 Archive type not allowed: zip $ test_archtype bz2 tar.bz2 zip tar.gz % bz2 allowed should give 200 200 Script output follows % zip and tar.gz disallowed should both give 403 403 Archive type not allowed: zip 403 Archive type not allowed: gz $ test_archtype zip zip tar.gz tar.bz2 % zip allowed should give 200 200 Script output follows % tar.gz and tar.bz2 disallowed should both give 403 403 Archive type not allowed: gz 403 Archive type not allowed: bz2 check http return codes (with deprecated option) $ test_archtype_deprecated gz tar.gz tar.bz2 zip % gz allowed should give 200 200 Script output follows % tar.bz2 and zip disallowed should both give 403 403 Archive type not allowed: bz2 403 Archive type not allowed: zip $ test_archtype_deprecated bz2 tar.bz2 zip tar.gz % bz2 allowed should give 200 200 Script output follows % zip and tar.gz disallowed should both give 403 403 Archive type not allowed: zip 403 Archive type not allowed: gz $ test_archtype_deprecated zip zip tar.gz tar.bz2 % zip allowed should give 200 200 Script output follows % tar.gz and tar.bz2 disallowed should both give 403 403 Archive type not allowed: gz 403 Archive type not allowed: bz2 $ echo "allow_archive = gz bz2 zip" >> .hg/hgrc $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log $ cat hg.pid >> $DAEMON_PIDS check archive links' order $ get-with-headers.py localhost:$HGPORT "?revcount=1" | grep '/archive/tip.' zip gz bz2 invalid arch type should give 404 $ get-with-headers.py localhost:$HGPORT "archive/tip.invalid" | head -n 1 404 Unsupported archive type: None $ TIP=`hg id -v | cut -f1 -d' '` $ QTIP=`hg id -q` $ cat > getarchive.py < from __future__ import absolute_import > import os > import sys > from mercurial import ( > util, > ) > try: > # Set stdout to binary mode for win32 platforms > import msvcrt > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) > except ImportError: > pass > if len(sys.argv) <= 3: > node, archive = sys.argv[1:] > requeststr = 'cmd=archive;node=%s;type=%s' % (node, archive) > else: > node, archive, file = sys.argv[1:] > requeststr = 'cmd=archive;node=%s;type=%s;file=%s' % (node, archive, file) > try: > stdout = sys.stdout.buffer > except AttributeError: > stdout = sys.stdout > try: > f = util.urlreq.urlopen('http://$LOCALIP:%s/?%s' > % (os.environ['HGPORT'], requeststr)) > stdout.write(f.read()) > except util.urlerr.httperror as e: > sys.stderr.write(str(e) + '\n') > EOF $ $PYTHON getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null test-archive-1701ef1f1510/.hg_archival.txt test-archive-1701ef1f1510/.hgsub test-archive-1701ef1f1510/.hgsubstate test-archive-1701ef1f1510/bar test-archive-1701ef1f1510/baz/bletch test-archive-1701ef1f1510/foo test-archive-1701ef1f1510/subrepo/sub $ $PYTHON getarchive.py "$TIP" bz2 | bunzip2 | tar tf - 2>/dev/null test-archive-1701ef1f1510/.hg_archival.txt test-archive-1701ef1f1510/.hgsub test-archive-1701ef1f1510/.hgsubstate test-archive-1701ef1f1510/bar test-archive-1701ef1f1510/baz/bletch test-archive-1701ef1f1510/foo test-archive-1701ef1f1510/subrepo/sub $ $PYTHON getarchive.py "$TIP" zip > archive.zip $ unzip -t archive.zip Archive: archive.zip testing: test-archive-1701ef1f1510/.hg_archival.txt*OK (glob) testing: test-archive-1701ef1f1510/.hgsub*OK (glob) testing: test-archive-1701ef1f1510/.hgsubstate*OK (glob) testing: test-archive-1701ef1f1510/bar*OK (glob) testing: test-archive-1701ef1f1510/baz/bletch*OK (glob) testing: test-archive-1701ef1f1510/foo*OK (glob) testing: test-archive-1701ef1f1510/subrepo/sub*OK (glob) No errors detected in compressed data of archive.zip. test that we can download single directories and files $ $PYTHON getarchive.py "$TIP" gz baz | gunzip | tar tf - 2>/dev/null test-archive-1701ef1f1510/baz/bletch $ $PYTHON getarchive.py "$TIP" gz foo | gunzip | tar tf - 2>/dev/null test-archive-1701ef1f1510/foo test that we detect file patterns that match no files $ $PYTHON getarchive.py "$TIP" gz foobar HTTP Error 404: file(s) not found: foobar test that we reject unsafe patterns $ $PYTHON getarchive.py "$TIP" gz relre:baz HTTP Error 404: file(s) not found: relre:baz $ killdaemons.py $ hg archive -t tar test.tar $ tar tf test.tar test/.hg_archival.txt test/.hgsub test/.hgsubstate test/bar test/baz/bletch test/foo $ hg archive --debug -t tbz2 -X baz test.tar.bz2 --config progress.debug=true archiving: 0/4 files (0.00%) archiving: .hgsub 1/4 files (25.00%) archiving: .hgsubstate 2/4 files (50.00%) archiving: bar 3/4 files (75.00%) archiving: foo 4/4 files (100.00%) $ bunzip2 -dc test.tar.bz2 | tar tf - 2>/dev/null test/.hg_archival.txt test/.hgsub test/.hgsubstate test/bar test/foo $ hg archive -t tgz -p %b-%h test-%h.tar.gz $ gzip -dc test-$QTIP.tar.gz | tar tf - 2>/dev/null test-1701ef1f1510/.hg_archival.txt test-1701ef1f1510/.hgsub test-1701ef1f1510/.hgsubstate test-1701ef1f1510/bar test-1701ef1f1510/baz/bletch test-1701ef1f1510/foo $ hg archive autodetected_test.tar $ tar tf autodetected_test.tar autodetected_test/.hg_archival.txt autodetected_test/.hgsub autodetected_test/.hgsubstate autodetected_test/bar autodetected_test/baz/bletch autodetected_test/foo The '-t' should override autodetection $ hg archive -t tar autodetect_override_test.zip $ tar tf autodetect_override_test.zip autodetect_override_test.zip/.hg_archival.txt autodetect_override_test.zip/.hgsub autodetect_override_test.zip/.hgsubstate autodetect_override_test.zip/bar autodetect_override_test.zip/baz/bletch autodetect_override_test.zip/foo $ for ext in tar tar.gz tgz tar.bz2 tbz2 zip; do > hg archive auto_test.$ext > if [ -d auto_test.$ext ]; then > echo "extension $ext was not autodetected." > fi > done $ cat > md5comp.py < from __future__ import absolute_import, print_function > import hashlib > import sys > f1, f2 = sys.argv[1:3] > h1 = hashlib.md5(open(f1, 'rb').read()).hexdigest() > h2 = hashlib.md5(open(f2, 'rb').read()).hexdigest() > print(h1 == h2 or "md5 differ: " + repr((h1, h2))) > EOF archive name is stored in the archive, so create similar archives and rename them afterwards. $ hg archive -t tgz tip.tar.gz $ mv tip.tar.gz tip1.tar.gz $ sleep 1 $ hg archive -t tgz tip.tar.gz $ mv tip.tar.gz tip2.tar.gz $ $PYTHON md5comp.py tip1.tar.gz tip2.tar.gz True $ hg archive -t zip -p /illegal test.zip abort: archive prefix contains illegal components [255] $ hg archive -t zip -p very/../bad test.zip $ hg archive --config ui.archivemeta=false -t zip -r 2 test.zip $ unzip -t test.zip Archive: test.zip testing: test/bar*OK (glob) testing: test/baz/bletch*OK (glob) testing: test/foo*OK (glob) No errors detected in compressed data of test.zip. $ hg archive -t tar - | tar tf - 2>/dev/null test-1701ef1f1510/.hg_archival.txt test-1701ef1f1510/.hgsub test-1701ef1f1510/.hgsubstate test-1701ef1f1510/bar test-1701ef1f1510/baz/bletch test-1701ef1f1510/foo $ hg archive -r 0 -t tar rev-%r.tar $ [ -f rev-0.tar ] test .hg_archival.txt $ hg archive ../test-tags $ cat ../test-tags/.hg_archival.txt repo: daa7f7c60e0a224faa4ff77ca41b2760562af264 node: 1701ef1f151069b8747038e93b5186bb43a47504 branch: default latesttag: null latesttagdistance: 4 changessincelatesttag: 4 $ hg tag -r 2 mytag $ hg tag -r 2 anothertag $ hg archive -r 2 ../test-lasttag $ cat ../test-lasttag/.hg_archival.txt repo: daa7f7c60e0a224faa4ff77ca41b2760562af264 node: 2c0277f05ed49d1c8328fb9ba92fba7a5ebcb33e branch: default tag: anothertag tag: mytag $ hg archive -t bogus test.bogus abort: unknown archive type 'bogus' [255] enable progress extension: $ cp $HGRCPATH $HGRCPATH.no-progress $ cat >> $HGRCPATH < [progress] > assume-tty = 1 > format = topic bar number > delay = 0 > refresh = 0 > width = 60 > EOF $ hg archive ../with-progress \r (no-eol) (esc) archiving [ ] 0/6\r (no-eol) (esc) archiving [======> ] 1/6\r (no-eol) (esc) archiving [=============> ] 2/6\r (no-eol) (esc) archiving [====================> ] 3/6\r (no-eol) (esc) archiving [===========================> ] 4/6\r (no-eol) (esc) archiving [==================================> ] 5/6\r (no-eol) (esc) archiving [==========================================>] 6/6\r (no-eol) (esc) \r (no-eol) (esc) cleanup after progress extension test: $ cp $HGRCPATH.no-progress $HGRCPATH server errors $ cat errors.log empty repo $ hg init ../empty $ cd ../empty $ hg archive ../test-empty abort: no working directory: please specify a revision [255] old file -- date clamped to 1980 $ touch -t 197501010000 old $ hg add old $ hg commit -m old $ hg archive ../old.zip $ unzip -l ../old.zip | grep -v -- ----- | egrep -v files$ Archive: ../old.zip \s*Length.* (re) *172*80*00:00*old/.hg_archival.txt (glob) *0*80*00:00*old/old (glob) show an error when a provided pattern matches no files $ hg archive -I file_that_does_not_exist.foo ../empty.zip abort: no files match the archive pattern [255] $ hg archive -X * ../empty.zip abort: no files match the archive pattern [255] $ cd .. issue3600: check whether "hg archive" can create archive files which are extracted with expected timestamp, even though TZ is not configured as GMT. $ mkdir issue3600 $ cd issue3600 $ hg init repo $ echo a > repo/a $ hg -R repo add repo/a $ hg -R repo commit -m '#0' -d '456789012 21600' $ cat > show_mtime.py < from __future__ import absolute_import, print_function > import os > import sys > print(int(os.stat(sys.argv[1]).st_mtime)) > EOF $ hg -R repo archive --prefix tar-extracted archive.tar $ (TZ=UTC-3; export TZ; tar xf archive.tar) $ $PYTHON show_mtime.py tar-extracted/a 456789012 $ hg -R repo archive --prefix zip-extracted archive.zip $ (TZ=UTC-3; export TZ; unzip -q archive.zip) $ $PYTHON show_mtime.py zip-extracted/a 456789012 $ cd .. mercurial-4.5.3/tests/test-issue1089.t0000644015407300116100000000045213261161234017354 0ustar augieeng00000000000000https://bz.mercurial-scm.org/1089 $ hg init $ mkdir a $ echo a > a/b $ hg ci -Am m adding a/b $ hg rm a removing a/b $ hg ci -m m a $ mkdir a b $ echo a > a/b $ hg ci -Am m adding a/b $ hg rm a removing a/b $ cd b Relative delete: $ hg ci -m m ../a $ cd .. mercurial-4.5.3/tests/test-git-export.t0000644015407300116100000002730413261161234020011 0ustar augieeng00000000000000 $ hg init $ echo start > start $ hg ci -Amstart adding start New file: $ mkdir dir1 $ echo new > dir1/new $ hg ci -Amnew adding dir1/new $ hg diff --git -r 0 diff --git a/dir1/new b/dir1/new new file mode 100644 --- /dev/null +++ b/dir1/new @@ -0,0 +1,1 @@ +new Copy: $ mkdir dir2 $ hg cp dir1/new dir1/copy $ echo copy1 >> dir1/copy $ hg cp dir1/new dir2/copy $ echo copy2 >> dir2/copy $ hg ci -mcopy $ hg diff --git -r 1:tip diff --git a/dir1/new b/dir1/copy copy from dir1/new copy to dir1/copy --- a/dir1/new +++ b/dir1/copy @@ -1,1 +1,2 @@ new +copy1 diff --git a/dir1/new b/dir2/copy copy from dir1/new copy to dir2/copy --- a/dir1/new +++ b/dir2/copy @@ -1,1 +1,2 @@ new +copy2 Cross and same-directory copies with a relative root: $ hg diff --git --root .. -r 1:tip abort: .. not under root '$TESTTMP' [255] $ hg diff --git --root doesnotexist -r 1:tip $ hg diff --git --root . -r 1:tip diff --git a/dir1/new b/dir1/copy copy from dir1/new copy to dir1/copy --- a/dir1/new +++ b/dir1/copy @@ -1,1 +1,2 @@ new +copy1 diff --git a/dir1/new b/dir2/copy copy from dir1/new copy to dir2/copy --- a/dir1/new +++ b/dir2/copy @@ -1,1 +1,2 @@ new +copy2 $ hg diff --git --root dir1 -r 1:tip diff --git a/new b/copy copy from new copy to copy --- a/new +++ b/copy @@ -1,1 +1,2 @@ new +copy1 $ hg diff --git --root dir2/ -r 1:tip diff --git a/copy b/copy new file mode 100644 --- /dev/null +++ b/copy @@ -0,0 +1,2 @@ +new +copy2 $ hg diff --git --root dir1 -r 1:tip -I '**/copy' diff --git a/new b/copy copy from new copy to copy --- a/new +++ b/copy @@ -1,1 +1,2 @@ new +copy1 $ hg diff --git --root dir1 -r 1:tip dir2 warning: dir2 not inside relative root dir1 $ hg diff --git --root dir1 -r 1:tip 'dir2/{copy}' warning: dir2/{copy} not inside relative root dir1 $ cd dir1 $ hg diff --git --root .. -r 1:tip diff --git a/dir1/new b/dir1/copy copy from dir1/new copy to dir1/copy --- a/dir1/new +++ b/dir1/copy @@ -1,1 +1,2 @@ new +copy1 diff --git a/dir1/new b/dir2/copy copy from dir1/new copy to dir2/copy --- a/dir1/new +++ b/dir2/copy @@ -1,1 +1,2 @@ new +copy2 $ hg diff --git --root ../.. -r 1:tip abort: ../.. not under root '$TESTTMP' [255] $ hg diff --git --root ../doesnotexist -r 1:tip $ hg diff --git --root .. -r 1:tip diff --git a/dir1/new b/dir1/copy copy from dir1/new copy to dir1/copy --- a/dir1/new +++ b/dir1/copy @@ -1,1 +1,2 @@ new +copy1 diff --git a/dir1/new b/dir2/copy copy from dir1/new copy to dir2/copy --- a/dir1/new +++ b/dir2/copy @@ -1,1 +1,2 @@ new +copy2 $ hg diff --git --root . -r 1:tip diff --git a/new b/copy copy from new copy to copy --- a/new +++ b/copy @@ -1,1 +1,2 @@ new +copy1 $ hg diff --git --root . -r 1:tip copy diff --git a/new b/copy copy from new copy to copy --- a/new +++ b/copy @@ -1,1 +1,2 @@ new +copy1 $ hg diff --git --root . -r 1:tip ../dir2 warning: ../dir2 not inside relative root . $ hg diff --git --root . -r 1:tip '../dir2/*' warning: ../dir2/* not inside relative root . (glob) $ cd .. Rename: $ hg mv dir1/copy dir1/rename1 $ echo rename1 >> dir1/rename1 $ hg mv dir2/copy dir1/rename2 $ echo rename2 >> dir1/rename2 $ hg ci -mrename $ hg diff --git -r 2:tip diff --git a/dir1/copy b/dir1/rename1 rename from dir1/copy rename to dir1/rename1 --- a/dir1/copy +++ b/dir1/rename1 @@ -1,2 +1,3 @@ new copy1 +rename1 diff --git a/dir2/copy b/dir1/rename2 rename from dir2/copy rename to dir1/rename2 --- a/dir2/copy +++ b/dir1/rename2 @@ -1,2 +1,3 @@ new copy2 +rename2 Cross and same-directory renames with a relative root: $ hg diff --root dir1 --git -r 2:tip diff --git a/copy b/rename1 rename from copy rename to rename1 --- a/copy +++ b/rename1 @@ -1,2 +1,3 @@ new copy1 +rename1 diff --git a/rename2 b/rename2 new file mode 100644 --- /dev/null +++ b/rename2 @@ -0,0 +1,3 @@ +new +copy2 +rename2 $ hg diff --root dir2 --git -r 2:tip diff --git a/copy b/copy deleted file mode 100644 --- a/copy +++ /dev/null @@ -1,2 +0,0 @@ -new -copy2 $ hg diff --root dir1 --git -r 2:tip -I '**/copy' diff --git a/copy b/copy deleted file mode 100644 --- a/copy +++ /dev/null @@ -1,2 +0,0 @@ -new -copy1 $ hg diff --root dir1 --git -r 2:tip -I '**/rename*' diff --git a/copy b/rename1 copy from copy copy to rename1 --- a/copy +++ b/rename1 @@ -1,2 +1,3 @@ new copy1 +rename1 diff --git a/rename2 b/rename2 new file mode 100644 --- /dev/null +++ b/rename2 @@ -0,0 +1,3 @@ +new +copy2 +rename2 Delete: $ hg rm dir1/* $ hg ci -mdelete $ hg diff --git -r 3:tip diff --git a/dir1/new b/dir1/new deleted file mode 100644 --- a/dir1/new +++ /dev/null @@ -1,1 +0,0 @@ -new diff --git a/dir1/rename1 b/dir1/rename1 deleted file mode 100644 --- a/dir1/rename1 +++ /dev/null @@ -1,3 +0,0 @@ -new -copy1 -rename1 diff --git a/dir1/rename2 b/dir1/rename2 deleted file mode 100644 --- a/dir1/rename2 +++ /dev/null @@ -1,3 +0,0 @@ -new -copy2 -rename2 $ cat > src < 1 > 2 > 3 > 4 > 5 > EOF $ hg ci -Amsrc adding src #if execbit chmod 644: $ chmod +x src $ hg ci -munexec $ hg diff --git -r 5:tip diff --git a/src b/src old mode 100644 new mode 100755 Rename+mod+chmod: $ hg mv src dst $ chmod -x dst $ echo a >> dst $ hg ci -mrenamemod $ hg diff --git -r 6:tip diff --git a/src b/dst old mode 100755 new mode 100644 rename from src rename to dst --- a/src +++ b/dst @@ -3,3 +3,4 @@ 3 4 5 +a Nonexistent in tip+chmod: $ hg diff --git -r 5:6 diff --git a/src b/src old mode 100644 new mode 100755 #else Dummy changes when no exec bit, mocking the execbit commit structure $ echo change >> src $ hg ci -munexec $ hg mv src dst $ hg ci -mrenamemod #endif Binary diff: $ cp "$TESTDIR/binfile.bin" . $ hg add binfile.bin $ hg diff --git > b.diff $ cat b.diff diff --git a/binfile.bin b/binfile.bin new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9 GIT binary patch literal 593 zc$@)I0W$NUkd zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT zLdYlXB*ODN003Z&P17_@)3Pi=i0wb04> start $ hg ci -m 'change start' $ hg revert -r -2 start $ hg mv dst2 dst3 $ hg ci -m 'mv dst2 dst3; revert start' $ hg diff --git -r 9:11 diff --git a/dst2 b/dst3 rename from dst2 rename to dst3 Reversed: $ hg diff --git -r 11:9 diff --git a/dst3 b/dst2 rename from dst3 rename to dst2 $ echo a >> foo $ hg add foo $ hg ci -m 'add foo' $ echo b >> foo $ hg ci -m 'change foo' $ hg mv foo bar $ hg ci -m 'mv foo bar' $ echo c >> bar $ hg ci -m 'change bar' File created before r1 and renamed before r2: $ hg diff --git -r -3:-1 diff --git a/foo b/bar rename from foo rename to bar --- a/foo +++ b/bar @@ -1,2 +1,3 @@ a b +c Reversed: $ hg diff --git -r -1:-3 diff --git a/bar b/foo rename from bar rename to foo --- a/bar +++ b/foo @@ -1,3 +1,2 @@ a b -c File created in r1 and renamed before r2: $ hg diff --git -r -4:-1 diff --git a/foo b/bar rename from foo rename to bar --- a/foo +++ b/bar @@ -1,1 +1,3 @@ a +b +c Reversed: $ hg diff --git -r -1:-4 diff --git a/bar b/foo rename from bar rename to foo --- a/bar +++ b/foo @@ -1,3 +1,1 @@ a -b -c File created after r1 and renamed before r2: $ hg diff --git -r -5:-1 diff --git a/bar b/bar new file mode 100644 --- /dev/null +++ b/bar @@ -0,0 +1,3 @@ +a +b +c Reversed: $ hg diff --git -r -1:-5 diff --git a/bar b/bar deleted file mode 100644 --- a/bar +++ /dev/null @@ -1,3 +0,0 @@ -a -b -c Comparing with the working dir: $ echo >> start $ hg ci -m 'change start again' $ echo > created $ hg add created $ hg ci -m 'add created' $ hg mv created created2 $ hg ci -m 'mv created created2' $ hg mv created2 created3 There's a copy in the working dir: $ hg diff --git diff --git a/created2 b/created3 rename from created2 rename to created3 There's another copy between the original rev and the wd: $ hg diff --git -r -2 diff --git a/created b/created3 rename from created rename to created3 The source of the copy was created after the original rev: $ hg diff --git -r -3 diff --git a/created3 b/created3 new file mode 100644 --- /dev/null +++ b/created3 @@ -0,0 +1,1 @@ + $ hg ci -m 'mv created2 created3' $ echo > brand-new $ hg add brand-new $ hg ci -m 'add brand-new' $ hg mv brand-new brand-new2 Created in parent of wd; renamed in the wd: $ hg diff --git diff --git a/brand-new b/brand-new2 rename from brand-new rename to brand-new2 Created between r1 and parent of wd; renamed in the wd: $ hg diff --git -r -2 diff --git a/brand-new2 b/brand-new2 new file mode 100644 --- /dev/null +++ b/brand-new2 @@ -0,0 +1,1 @@ + $ hg ci -m 'mv brand-new brand-new2' One file is copied to many destinations and removed: $ hg cp brand-new2 brand-new3 $ hg mv brand-new2 brand-new3-2 $ hg ci -m 'multiple renames/copies' $ hg diff --git -r -2 -r -1 diff --git a/brand-new2 b/brand-new3 rename from brand-new2 rename to brand-new3 diff --git a/brand-new2 b/brand-new3-2 copy from brand-new2 copy to brand-new3-2 Reversed: $ hg diff --git -r -1 -r -2 diff --git a/brand-new3-2 b/brand-new2 rename from brand-new3-2 rename to brand-new2 diff --git a/brand-new3 b/brand-new3 deleted file mode 100644 --- a/brand-new3 +++ /dev/null @@ -1,1 +0,0 @@ - There should be a trailing TAB if there are spaces in the file name: $ echo foo > 'with spaces' $ hg add 'with spaces' $ hg diff --git diff --git a/with spaces b/with spaces new file mode 100644 --- /dev/null +++ b/with spaces @@ -0,0 +1,1 @@ +foo $ hg ci -m 'add filename with spaces' Additions should be properly marked even in the middle of a merge $ hg up -r -2 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo "New File" >> inmerge $ hg add inmerge $ hg ci -m "file in merge" created new head $ hg up 23 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg diff -g diff --git a/inmerge b/inmerge new file mode 100644 --- /dev/null +++ b/inmerge @@ -0,0 +1,1 @@ +New File mercurial-4.5.3/tests/test-batching.py0000644015407300116100000001404713261161234017653 0ustar augieeng00000000000000# test-batching.py - tests for transparent command batching # # Copyright 2011 Peter Arrenbrecht # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__ import absolute_import, print_function from mercurial import ( error, peer, util, wireproto, ) # equivalent of repo.repository class thing(object): def hello(self): return "Ready." # equivalent of localrepo.localrepository class localthing(thing): def foo(self, one, two=None): if one: return "%s and %s" % (one, two,) return "Nope" def bar(self, b, a): return "%s und %s" % (b, a,) def greet(self, name=None): return "Hello, %s" % name def batchiter(self): '''Support for local batching.''' return peer.localiterbatcher(self) # usage of "thing" interface def use(it): # Direct call to base method shared between client and server. print(it.hello()) # Direct calls to proxied methods. They cause individual roundtrips. print(it.foo("Un", two="Deux")) print(it.bar("Eins", "Zwei")) # Batched call to a couple of proxied methods. batch = it.batchiter() # The calls return futures to eventually hold results. foo = batch.foo(one="One", two="Two") bar = batch.bar("Eins", "Zwei") bar2 = batch.bar(b="Uno", a="Due") # Future shouldn't be set until we submit(). assert isinstance(foo, peer.future) assert not util.safehasattr(foo, 'value') assert not util.safehasattr(bar, 'value') batch.submit() # Call results() to obtain results as a generator. results = batch.results() # Future results shouldn't be set until we consume a value. assert not util.safehasattr(foo, 'value') foovalue = next(results) assert util.safehasattr(foo, 'value') assert foovalue == foo.value print(foo.value) next(results) print(bar.value) next(results) print(bar2.value) # We should be at the end of the results generator. try: next(results) except StopIteration: print('proper end of results generator') else: print('extra emitted element!') # Attempting to call a non-batchable method inside a batch fails. batch = it.batchiter() try: batch.greet(name='John Smith') except error.ProgrammingError as e: print(e) # Attempting to call a local method inside a batch fails. batch = it.batchiter() try: batch.hello() except error.ProgrammingError as e: print(e) # local usage mylocal = localthing() print() print("== Local") use(mylocal) # demo remoting; mimicks what wireproto and HTTP/SSH do # shared def escapearg(plain): return (plain .replace(':', '::') .replace(',', ':,') .replace(';', ':;') .replace('=', ':=')) def unescapearg(escaped): return (escaped .replace(':=', '=') .replace(':;', ';') .replace(':,', ',') .replace('::', ':')) # server side # equivalent of wireproto's global functions class server(object): def __init__(self, local): self.local = local def _call(self, name, args): args = dict(arg.split('=', 1) for arg in args) return getattr(self, name)(**args) def perform(self, req): print("REQ:", req) name, args = req.split('?', 1) args = args.split('&') vals = dict(arg.split('=', 1) for arg in args) res = getattr(self, name)(**vals) print(" ->", res) return res def batch(self, cmds): res = [] for pair in cmds.split(';'): name, args = pair.split(':', 1) vals = {} for a in args.split(','): if a: n, v = a.split('=') vals[n] = unescapearg(v) res.append(escapearg(getattr(self, name)(**vals))) return ';'.join(res) def foo(self, one, two): return mangle(self.local.foo(unmangle(one), unmangle(two))) def bar(self, b, a): return mangle(self.local.bar(unmangle(b), unmangle(a))) def greet(self, name): return mangle(self.local.greet(unmangle(name))) myserver = server(mylocal) # local side # equivalent of wireproto.encode/decodelist, that is, type-specific marshalling # here we just transform the strings a bit to check we're properly en-/decoding def mangle(s): return ''.join(chr(ord(c) + 1) for c in s) def unmangle(s): return ''.join(chr(ord(c) - 1) for c in s) # equivalent of wireproto.wirerepository and something like http's wire format class remotething(thing): def __init__(self, server): self.server = server def _submitone(self, name, args): req = name + '?' + '&'.join(['%s=%s' % (n, v) for n, v in args]) return self.server.perform(req) def _submitbatch(self, cmds): req = [] for name, args in cmds: args = ','.join(n + '=' + escapearg(v) for n, v in args) req.append(name + ':' + args) req = ';'.join(req) res = self._submitone('batch', [('cmds', req,)]) for r in res.split(';'): yield r def batchiter(self): return wireproto.remoteiterbatcher(self) @peer.batchable def foo(self, one, two=None): encargs = [('one', mangle(one),), ('two', mangle(two),)] encresref = peer.future() yield encargs, encresref yield unmangle(encresref.value) @peer.batchable def bar(self, b, a): encresref = peer.future() yield [('b', mangle(b),), ('a', mangle(a),)], encresref yield unmangle(encresref.value) # greet is coded directly. It therefore does not support batching. If it # does appear in a batch, the batch is split around greet, and the call to # greet is done in its own roundtrip. def greet(self, name=None): return unmangle(self._submitone('greet', [('name', mangle(name),)])) # demo remote usage myproxy = remotething(myserver) print() print("== Remote") use(myproxy) mercurial-4.5.3/tests/helpers-testrepo.sh0000644015407300116100000000337213261161234020405 0ustar augieeng00000000000000# In most cases, the mercurial repository can be read by the bundled hg, but # that isn't always true because third-party extensions may change the store # format, for example. In which case, the system hg installation is used. # # We want to use the hg version being tested when interacting with the test # repository, and the system hg when interacting with the mercurial source code # repository. # # The mercurial source repository was typically orignally cloned with the # system mercurial installation, and may require extensions or settings from # the system installation. syshg () { ( syshgenv exec hg "$@" ) } # Revert the environment so that running "hg" runs the system hg # rather than the test hg installation. syshgenv () { . "$HGTEST_RESTOREENV" HGPLAIN=1 export HGPLAIN } # The test-repo is a live hg repository which may have evolution markers # created, e.g. when a ~/.hgrc enabled evolution. # # Tests may be run using a custom HGRCPATH, which do not enable evolution # markers by default. # # If test-repo includes evolution markers, and we do not enable evolution # markers, hg will occasionally complain when it notices them, which disrupts # tests resulting in sporadic failures. # # Since we aren't performing any write operations on the test-repo, there's # no harm in telling hg that we support evolution markers, which is what the # following lines for the hgrc file do: cat >> "$HGRCPATH" << EOF [experimental] evolution = createmarkers EOF # Use the system hg command if the bundled hg can't read the repository with # no warning nor error. if [ -n "`hg id -R "$TESTDIR/.." 2>&1 >/dev/null`" ]; then alias testrepohg=syshg alias testrepohgenv=syshgenv else alias testrepohg=hg alias testrepohgenv=: fi mercurial-4.5.3/tests/test-status-inprocess.py.out0000644015407300116100000000007613261161234022225 0ustar augieeng00000000000000% creating repo % add and commit C test.py % change M test.py mercurial-4.5.3/tests/test-lock-badness.t0000644015407300116100000001016713261161234020253 0ustar augieeng00000000000000#require unix-permissions no-root no-windows Prepare $ hg init a $ echo a > a/a $ hg -R a ci -A -m a adding a $ hg clone a b updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Test that raising an exception in the release function doesn't cause the lock to choke $ cat > testlock.py << EOF > from mercurial import error, registrar > > cmdtable = {} > command = registrar.command(cmdtable) > > def acquiretestlock(repo, releaseexc): > def unlock(): > if releaseexc: > raise error.Abort('expected release exception') > l = repo._lock(repo.vfs, 'testlock', False, unlock, None, 'test lock') > return l > > @command(b'testlockexc') > def testlockexc(ui, repo): > testlock = acquiretestlock(repo, True) > try: > testlock.release() > finally: > try: > testlock = acquiretestlock(repo, False) > except error.LockHeld: > raise error.Abort('lockfile on disk even after releasing!') > testlock.release() > EOF $ cat >> $HGRCPATH << EOF > [extensions] > testlock=$TESTTMP/testlock.py > EOF $ hg -R b testlockexc abort: expected release exception [255] One process waiting for another $ cat > hooks.py << EOF > import time > def sleepone(**x): time.sleep(1) > def sleephalf(**x): time.sleep(0.5) > EOF $ echo b > b/b $ hg -R b ci -A -m b --config hooks.precommit="python:`pwd`/hooks.py:sleepone" > stdout & $ hg -R b up -q --config hooks.pre-update="python:`pwd`/hooks.py:sleephalf" \ > > preup-stdout 2>preup-stderr $ wait $ cat preup-stdout $ cat preup-stderr waiting for lock on working directory of b held by process '*' on host '*' (glob) got lock after * seconds (glob) $ cat stdout adding b On processs waiting on another, warning after a long time. $ echo b > b/c $ hg -R b ci -A -m b --config hooks.precommit="python:`pwd`/hooks.py:sleepone" > stdout & $ hg -R b up -q --config hooks.pre-update="python:`pwd`/hooks.py:sleephalf" \ > --config ui.timeout.warn=250 \ > > preup-stdout 2>preup-stderr $ wait $ cat preup-stdout $ cat preup-stderr $ cat stdout adding c On processs waiting on another, warning disabled. $ echo b > b/d $ hg -R b ci -A -m b --config hooks.precommit="python:`pwd`/hooks.py:sleepone" > stdout & $ hg -R b up -q --config hooks.pre-update="python:`pwd`/hooks.py:sleephalf" \ > --config ui.timeout.warn=-1 \ > > preup-stdout 2>preup-stderr $ wait $ cat preup-stdout $ cat preup-stderr $ cat stdout adding d check we still print debug output On processs waiting on another, warning after a long time (debug output on) $ echo b > b/e $ hg -R b ci -A -m b --config hooks.precommit="python:`pwd`/hooks.py:sleepone" > stdout & $ hg -R b up --config hooks.pre-update="python:`pwd`/hooks.py:sleephalf" \ > --config ui.timeout.warn=250 --debug\ > > preup-stdout 2>preup-stderr $ wait $ cat preup-stdout calling hook pre-update: hghook_pre-update.sleephalf waiting for lock on working directory of b held by process '*' on host '*' (glob) got lock after * seconds (glob) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat preup-stderr $ cat stdout adding e On processs waiting on another, warning disabled, (debug output on) $ echo b > b/f $ hg -R b ci -A -m b --config hooks.precommit="python:`pwd`/hooks.py:sleepone" > stdout & $ hg -R b up --config hooks.pre-update="python:`pwd`/hooks.py:sleephalf" \ > --config ui.timeout.warn=-1 --debug\ > > preup-stdout 2>preup-stderr $ wait $ cat preup-stdout calling hook pre-update: hghook_pre-update.sleephalf waiting for lock on working directory of b held by process '*' on host '*' (glob) got lock after * seconds (glob) 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat preup-stderr $ cat stdout adding f Pushing to a local read-only repo that can't be locked $ chmod 100 a/.hg/store $ hg -R b push a pushing to a searching for changes abort: could not lock repository a: Permission denied [255] $ chmod 700 a/.hg/store mercurial-4.5.3/tests/test-filelog.py.out0000644015407300116100000000012613261161234020314 0ustar augieeng00000000000000ERROR: FIXME: This is a known failure of filelog.size for data starting with \1\n OK. mercurial-4.5.3/tests/test-pull.t0000644015407300116100000000731313261161234016661 0ustar augieeng00000000000000#require serve $ hg init test $ cd test $ echo foo>foo $ hg addremove adding foo $ hg commit -m 1 $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 1 changesets, 1 total revisions $ hg serve -p $HGPORT -d --pid-file=hg.pid $ cat hg.pid >> $DAEMON_PIDS $ cd .. $ hg clone --pull http://foo:bar@localhost:$HGPORT/ copy requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 340e38bdcde4 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd copy $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 1 changesets, 1 total revisions $ hg co 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat foo foo $ hg manifest --debug 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo $ hg pull pulling from http://foo@localhost:$HGPORT/ searching for changes no changes found $ hg rollback --dry-run --verbose repository tip rolled back to revision -1 (undo pull: http://foo:***@localhost:$HGPORT/) Test pull of non-existing 20 character revision specification, making sure plain ascii identifiers not are encoded like a node: $ hg pull -r 'xxxxxxxxxxxxxxxxxxxy' pulling from http://foo@localhost:$HGPORT/ abort: unknown revision 'xxxxxxxxxxxxxxxxxxxy'! [255] $ hg pull -r 'xxxxxxxxxxxxxxxxxx y' pulling from http://foo@localhost:$HGPORT/ abort: unknown revision '7878787878787878787878787878787878782079'! [255] Issue622: hg init && hg pull -u URL doesn't checkout default branch $ cd .. $ hg init empty $ cd empty $ hg pull -u ../test pulling from ../test requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 340e38bdcde4 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Test 'file:' uri handling: $ hg pull -q file://../test-does-not-exist abort: file:// URLs can only refer to localhost [255] $ hg pull -q file://../test abort: file:// URLs can only refer to localhost [255] MSYS changes 'file:' into 'file;' #if no-msys $ hg pull -q file:../test # no-msys #endif It's tricky to make file:// URLs working on every platform with regular shell commands. $ URL=`$PYTHON -c "import os; print 'file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test'"` $ hg pull -q "$URL" abort: file:// URLs can only refer to localhost [255] $ URL=`$PYTHON -c "import os; print 'file://localhost' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test'"` $ hg pull -q "$URL" SEC: check for unsafe ssh url $ cat >> $HGRCPATH << EOF > [ui] > ssh = sh -c "read l; read l; read l" > EOF $ hg pull 'ssh://-oProxyCommand=touch${IFS}owned/path' pulling from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' [255] $ hg pull 'ssh://%2DoProxyCommand=touch${IFS}owned/path' pulling from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' [255] $ hg pull 'ssh://fakehost|touch${IFS}owned/path' pulling from ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path abort: no suitable response from remote hg! [255] $ hg pull 'ssh://fakehost%7Ctouch%20owned/path' pulling from ssh://fakehost%7Ctouch%20owned/path abort: no suitable response from remote hg! [255] $ [ ! -f owned ] || echo 'you got owned' $ cd .. mercurial-4.5.3/tests/test-incoming-outgoing.t0000644015407300116100000003073613261161234021346 0ustar augieeng00000000000000#require serve $ hg init test $ cd test $ for i in 0 1 2 3 4 5 6 7 8; do > echo $i >> foo > hg commit -A -m $i > done adding foo $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 9 changesets, 9 total revisions $ hg serve -p $HGPORT -d --pid-file=hg.pid $ cat hg.pid >> $DAEMON_PIDS $ cd .. $ hg init new http incoming $ hg -R new incoming http://localhost:$HGPORT/ comparing with http://localhost:$HGPORT/ changeset: 0:00a43fa82f62 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 0 changeset: 1:5460a410df01 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 1 changeset: 2:d9f42cd1a1ec user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 2 changeset: 3:376476025137 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 3 changeset: 4:70d7eb252d49 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 4 changeset: 5:ad284ee3b5ee user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 5 changeset: 6:e9229f2de384 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 6 changeset: 7:d152815bb8db user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 7 changeset: 8:e4feb4ac9035 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 8 $ hg -R new incoming -r 4 http://localhost:$HGPORT/ comparing with http://localhost:$HGPORT/ changeset: 0:00a43fa82f62 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 0 changeset: 1:5460a410df01 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 1 changeset: 2:d9f42cd1a1ec user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 2 changeset: 3:376476025137 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 3 changeset: 4:70d7eb252d49 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 4 local incoming $ hg -R new incoming test comparing with test changeset: 0:00a43fa82f62 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 0 changeset: 1:5460a410df01 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 1 changeset: 2:d9f42cd1a1ec user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 2 changeset: 3:376476025137 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 3 changeset: 4:70d7eb252d49 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 4 changeset: 5:ad284ee3b5ee user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 5 changeset: 6:e9229f2de384 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 6 changeset: 7:d152815bb8db user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 7 changeset: 8:e4feb4ac9035 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 8 $ hg -R new incoming -r 4 test comparing with test changeset: 0:00a43fa82f62 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 0 changeset: 1:5460a410df01 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 1 changeset: 2:d9f42cd1a1ec user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 2 changeset: 3:376476025137 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 3 changeset: 4:70d7eb252d49 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 4 limit to 2 changesets $ hg -R new incoming -l 2 test comparing with test changeset: 0:00a43fa82f62 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 0 changeset: 1:5460a410df01 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 1 limit to 2 changesets, test with -p --git $ hg -R new incoming -l 2 -p --git test comparing with test changeset: 0:00a43fa82f62 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 0 diff --git a/foo b/foo new file mode 100644 --- /dev/null +++ b/foo @@ -0,0 +1,1 @@ +0 changeset: 1:5460a410df01 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 1 diff --git a/foo b/foo --- a/foo +++ b/foo @@ -1,1 +1,2 @@ 0 +1 test with --bundle $ hg -R new incoming --bundle test.hg http://localhost:$HGPORT/ comparing with http://localhost:$HGPORT/ changeset: 0:00a43fa82f62 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 0 changeset: 1:5460a410df01 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 1 changeset: 2:d9f42cd1a1ec user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 2 changeset: 3:376476025137 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 3 changeset: 4:70d7eb252d49 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 4 changeset: 5:ad284ee3b5ee user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 5 changeset: 6:e9229f2de384 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 6 changeset: 7:d152815bb8db user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 7 changeset: 8:e4feb4ac9035 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 8 $ hg -R new incoming --bundle test2.hg test comparing with test changeset: 0:00a43fa82f62 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 0 changeset: 1:5460a410df01 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 1 changeset: 2:d9f42cd1a1ec user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 2 changeset: 3:376476025137 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 3 changeset: 4:70d7eb252d49 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 4 changeset: 5:ad284ee3b5ee user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 5 changeset: 6:e9229f2de384 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 6 changeset: 7:d152815bb8db user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 7 changeset: 8:e4feb4ac9035 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 8 test the resulting bundles $ hg init temp $ hg init temp2 $ hg -R temp unbundle test.hg adding changesets adding manifests adding file changes added 9 changesets with 9 changes to 1 files new changesets 00a43fa82f62:e4feb4ac9035 (run 'hg update' to get a working copy) $ hg -R temp2 unbundle test2.hg adding changesets adding manifests adding file changes added 9 changesets with 9 changes to 1 files new changesets 00a43fa82f62:e4feb4ac9035 (run 'hg update' to get a working copy) $ hg -R temp tip changeset: 8:e4feb4ac9035 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 8 $ hg -R temp2 tip changeset: 8:e4feb4ac9035 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 8 $ rm -r temp temp2 new test outgoing $ hg clone test test-dev updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd test-dev $ for i in 9 10 11 12 13; do > echo $i >> foo > hg commit -A -m $i > done $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 14 changesets, 14 total revisions $ cd .. $ hg -R test-dev outgoing test comparing with test searching for changes changeset: 9:d89d4abea5bc user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 9 changeset: 10:820095aa7158 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 10 changeset: 11:09ede2f3a638 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 11 changeset: 12:e576b1bed305 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 12 changeset: 13:96bbff09a7cc tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 13 test outgoing with secret changesets $ hg -R test-dev phase --force --secret 9 $ hg -R test-dev outgoing test comparing with test searching for changes no changes found (ignored 5 secret changesets) [1] $ hg -R test-dev phase --draft -r 'head()' limit to 3 changesets $ hg -R test-dev outgoing -l 3 test comparing with test searching for changes changeset: 9:d89d4abea5bc user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 9 changeset: 10:820095aa7158 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 10 changeset: 11:09ede2f3a638 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 11 $ hg -R test-dev outgoing http://localhost:$HGPORT/ comparing with http://localhost:$HGPORT/ searching for changes changeset: 9:d89d4abea5bc user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 9 changeset: 10:820095aa7158 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 10 changeset: 11:09ede2f3a638 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 11 changeset: 12:e576b1bed305 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 12 changeset: 13:96bbff09a7cc tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 13 $ hg -R test-dev outgoing -r 11 http://localhost:$HGPORT/ comparing with http://localhost:$HGPORT/ searching for changes changeset: 9:d89d4abea5bc user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 9 changeset: 10:820095aa7158 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 10 changeset: 11:09ede2f3a638 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 11 incoming from empty remote repository $ hg init r1 $ hg init r2 $ echo a > r1/foo $ hg -R r1 ci -Ama adding foo $ hg -R r1 incoming r2 --bundle x.hg comparing with r2 searching for changes no changes found [1] Create a "split" repo that pulls from r1 and pushes to r2, using default-push $ hg clone r1 split updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat > split/.hg/hgrc << EOF > [paths] > default = $TESTTMP/r3 > default-push = $TESTTMP/r2 > EOF $ hg -R split outgoing comparing with $TESTTMP/r2 searching for changes changeset: 0:3e92d79f743a tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a Use default:pushurl instead of default-push Windows needs a leading slash to make a URL that passes all of the checks $ WD=`pwd` #if windows $ WD="/$WD" #endif $ cat > split/.hg/hgrc << EOF > [paths] > default = $WD/r3 > default:pushurl = file://$WD/r2 > EOF $ hg -R split outgoing comparing with file:/*/$TESTTMP/r2 (glob) searching for changes changeset: 0:3e92d79f743a tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a Push and then double-check outgoing $ echo a >> split/foo $ hg -R split commit -Ama $ hg -R split push pushing to file:/*/$TESTTMP/r2 (glob) searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files $ hg -R split outgoing comparing with file:/*/$TESTTMP/r2 (glob) searching for changes no changes found [1] mercurial-4.5.3/tests/test-exchange-obsmarkers-case-A5.t0000644015407300116100000001127213261161234023010 0ustar augieeng00000000000000============================================ Testing obsolescence markers push: Cases A.5 ============================================ Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of all changesets that requested to be "in sync" after the push (even if they are already on both side). This test belongs to a series of tests checking such set is properly computed and applied. This does not tests "obsmarkers" discovery capabilities. Category A: simple cases TestCase 5: partial reordering A.5 partial reordering ====================== .. .. {{{ .. B ø⇠⇠ .. | ⇡ .. A ø⇠⇠⇠○ A' .. | ⇡/ .. | â—‹ B' .. |/ .. â— O .. }}} .. .. Marker exist from: .. .. * `Aø⇠○ A'` .. * `Bø⇠○ B'` .. .. Command run: .. .. * hg push -r B .. .. Expected exchange: .. .. * `Bø⇠○ B'` .. .. Expected Exclude: .. .. * `Aø⇠○ A'` Setup ----- $ . $TESTDIR/testlib/exchange-obsmarker-util.sh initial $ setuprepos A.5 creating test repo for test case A.5 - pulldest - main - pushdest cd into `main` and proceed with env setup $ cd main $ mkcommit A0 $ mkcommit B0 $ hg update 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ mkcommit B1 created new head $ mkcommit A1 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid 'desc(A0)'` $ hg debugobsolete `getid 'desc(B0)'` `getid 'desc(B1)'` obsoleted 1 changesets $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'` obsoleted 1 changesets $ hg log -G --hidden @ 8c0a98c83722 (draft): A1 | o f6298a8ac3a4 (draft): B1 | | x 6e72f0a95b5e (draft): B0 | | | x 28b51eb45704 (draft): A0 |/ o a9bdc8b26820 (public): O $ inspect_obsmarkers obsstore content ================ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 8c0a98c8372212c6efde4bfdcef006f27ff759d3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ cd .. $ cd .. Actual Test ----------- $ dotest A.5 B1 ## Running testcase A.5 # testing echange of "B1" (f6298a8ac3a4) ## initial state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 8c0a98c8372212c6efde4bfdcef006f27ff759d3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest ## pushing "B1" from main to pushdest pushing to pushdest searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files remote: 1 new obsolescence markers ## post push state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 8c0a98c8372212c6efde4bfdcef006f27ff759d3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest ## pulling "f6298a8ac3a4" from main into pulldest pulling from main searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files 1 new obsolescence markers new changesets f6298a8ac3a4 (run 'hg update' to get a working copy) ## post pull state # obstore: main 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 8c0a98c8372212c6efde4bfdcef006f27ff759d3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} mercurial-4.5.3/tests/test-mq-qimport-fail-cleanup.t0000644015407300116100000000140413261161234022344 0ustar augieeng00000000000000Failed qimport of patches from files should cleanup by recording successfully imported patches in series file. $ echo "[extensions]" >> $HGRCPATH $ echo "mq=" >> $HGRCPATH $ hg init repo $ cd repo $ echo a > a $ hg ci -Am'add a' adding a $ cat >b.patch< diff --git a/a b/a > --- a/a > +++ b/a > @@ -1,1 +1,2 @@ > a > +b > EOF empty series $ hg qseries qimport valid patch followed by invalid patch $ hg qimport b.patch fakepatch adding b.patch to series file abort: unable to read file fakepatch [255] valid patches before fail added to series $ hg qseries b.patch $ hg pull -q -r 0 . # update phase $ hg qimport -r 0 abort: revision 0 is not mutable (see 'hg help phases' for details) [255] $ cd .. mercurial-4.5.3/tests/list-tree.py0000644015407300116100000000125413261161234017023 0ustar augieeng00000000000000from __future__ import ( absolute_import, print_function, ) import argparse import os ap = argparse.ArgumentParser() ap.add_argument('path', nargs='+') opts = ap.parse_args() def gather(): for p in opts.path: if not os.path.exists(p): return if os.path.isdir(p): yield p + os.path.sep for dirpath, dirs, files in os.walk(p): for d in dirs: yield os.path.join(dirpath, d) + os.path.sep for f in files: yield os.path.join(dirpath, f) else: yield p print('\n'.join(sorted(gather(), key=lambda x: x.replace(os.path.sep, '/')))) mercurial-4.5.3/tests/test-gpg.t0000644015407300116100000000213113261161234016453 0ustar augieeng00000000000000#require gpg Test the GPG extension $ cat <> $HGRCPATH > [extensions] > gpg= > > [gpg] > cmd=gpg --no-permission-warning --no-secmem-warning --no-auto-check-trustdb > EOF $ GNUPGHOME="$TESTTMP/gpg"; export GNUPGHOME $ cp -R "$TESTDIR/gpg" "$GNUPGHOME" Start gpg-agent, which is required by GnuPG v2 #if gpg21 $ gpg-connect-agent -q --subst /serverpid '/echo ${get serverpid}' /bye \ > >> $DAEMON_PIDS #endif and migrate secret keys #if gpg2 $ gpg --no-permission-warning --no-secmem-warning --list-secret-keys \ > > /dev/null 2>&1 #endif $ hg init r $ cd r $ echo foo > foo $ hg ci -Amfoo adding foo $ hg sigs $ HGEDITOR=cat hg sign -e 0 signing 0:e63c23eaa88a Added signature for changeset e63c23eaa88a HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: test HG: branch 'default' HG: added .hgsigs $ hg sigs hgtest 0:e63c23eaa88ae77967edcf4ea194d31167c478b0 $ hg sigcheck 0 e63c23eaa88a is signed by: hgtest $ cd .. mercurial-4.5.3/tests/test-merge7.t0000644015407300116100000001027013261161234017067 0ustar augieeng00000000000000initial $ hg init test-a $ cd test-a $ cat >test.txt <<"EOF" > 1 > 2 > 3 > EOF $ hg add test.txt $ hg commit -m "Initial" clone $ cd .. $ hg clone test-a test-b updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved change test-a $ cd test-a $ cat >test.txt <<"EOF" > one > two > three > EOF $ hg commit -m "Numbers as words" change test-b $ cd ../test-b $ cat >test.txt <<"EOF" > 1 > 2.5 > 3 > EOF $ hg commit -m "2 -> 2.5" now pull and merge from test-a $ hg pull ../test-a pulling from ../test-a searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 96b70246a118 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg merge merging test.txt warning: conflicts while merging test.txt! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] resolve conflict $ cat >test.txt <<"EOF" > one > two-point-five > three > EOF $ rm -f *.orig $ hg resolve -m test.txt (no more unresolved files) $ hg commit -m "Merge 1" change test-a again $ cd ../test-a $ cat >test.txt <<"EOF" > one > two-point-one > three > EOF $ hg commit -m "two -> two-point-one" pull and merge from test-a again $ cd ../test-b $ hg pull ../test-a pulling from ../test-a searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 40d11a4173a8 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg merge --debug searching for copies back to rev 1 resolving manifests branchmerge: True, force: False, partial: False ancestor: 96b70246a118, local: 50c3a7e29886+, remote: 40d11a4173a8 preserving test.txt for resolve of test.txt starting 4 threads for background file closing (?) test.txt: versions differ -> m (premerge) picked tool ':merge' for test.txt (binary False symlink False changedelete False) merging test.txt my test.txt@50c3a7e29886+ other test.txt@40d11a4173a8 ancestor test.txt@96b70246a118 test.txt: versions differ -> m (merge) picked tool ':merge' for test.txt (binary False symlink False changedelete False) my test.txt@50c3a7e29886+ other test.txt@40d11a4173a8 ancestor test.txt@96b70246a118 warning: conflicts while merging test.txt! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ cat test.txt one <<<<<<< working copy: 50c3a7e29886 - test: Merge 1 two-point-five ======= two-point-one >>>>>>> merge rev: 40d11a4173a8 - test: two -> two-point-one three $ hg debugindex test.txt rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 7 ..... 0 01365c4cca56 000000000000 000000000000 (re) 1 7 9 ..... 1 7b013192566a 01365c4cca56 000000000000 (re) 2 16 15 ..... 2 8fe46a3eb557 01365c4cca56 000000000000 (re) 3 31 2. ..... 3 fc3148072371 7b013192566a 8fe46a3eb557 (re) 4 5. 25 ..... 4 d40249267ae3 8fe46a3eb557 000000000000 (re) $ hg log changeset: 4:40d11a4173a8 tag: tip parent: 2:96b70246a118 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: two -> two-point-one changeset: 3:50c3a7e29886 parent: 1:d1e159716d41 parent: 2:96b70246a118 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Merge 1 changeset: 2:96b70246a118 parent: 0:b1832b9d912a user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Numbers as words changeset: 1:d1e159716d41 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 2 -> 2.5 changeset: 0:b1832b9d912a user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Initial $ cd .. mercurial-4.5.3/tests/test-hgrc.t0000644015407300116100000001447613261161234016640 0ustar augieeng00000000000000hide outer repo $ hg init Use hgrc within $TESTTMP $ HGRCPATH=`pwd`/hgrc $ export HGRCPATH Use an alternate var for scribbling on hgrc to keep check-code from complaining about the important settings we may be overwriting: $ HGRC=`pwd`/hgrc $ export HGRC Basic syntax error $ echo "invalid" > $HGRC $ hg version hg: parse error at $TESTTMP/hgrc:1: invalid [255] $ echo "" > $HGRC Issue1199: Can't use '%' in hgrc (eg url encoded username) $ hg init "foo%bar" $ hg clone "foo%bar" foobar updating to branch default 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd foobar $ cat .hg/hgrc # example repository config (see 'hg help config' for more info) [paths] default = $TESTTMP/foo%bar # path aliases to other clones of this repo in URLs or filesystem paths # (see 'hg help config.paths' for more info) # # default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork # my-fork = ssh://jdoe@example.net/hg/jdoes-fork # my-clone = /home/jdoe/jdoes-clone [ui] # name and email (local to this repository, optional), e.g. # username = Jane Doe $ hg paths default = $TESTTMP/foo%bar $ hg showconfig bundle.mainreporoot=$TESTTMP/foobar paths.default=$TESTTMP/foo%bar $ cd .. issue1829: wrong indentation $ echo '[foo]' > $HGRC $ echo ' x = y' >> $HGRC $ hg version hg: parse error at $TESTTMP/hgrc:2: x = y unexpected leading whitespace [255] $ $PYTHON -c "print '[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n'" \ > > $HGRC $ hg showconfig foo foo.bar=a\nb\nc\nde\nfg foo.baz=bif cb $ FAKEPATH=/path/to/nowhere $ export FAKEPATH $ echo '%include $FAKEPATH/no-such-file' > $HGRC $ hg version Mercurial Distributed SCM (version *) (glob) (see https://mercurial-scm.org for more information) Copyright (C) 2005-* Matt Mackall and others (glob) This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ unset FAKEPATH make sure global options given on the cmdline take precedence $ hg showconfig --config ui.verbose=True --quiet bundle.mainreporoot=$TESTTMP ui.verbose=False ui.debug=False ui.quiet=True $ touch foobar/untracked $ cat >> foobar/.hg/hgrc < [ui] > verbose=True > EOF $ hg -R foobar st -q username expansion $ olduser=$HGUSER $ unset HGUSER $ FAKEUSER='John Doe' $ export FAKEUSER $ echo '[ui]' > $HGRC $ echo 'username = $FAKEUSER' >> $HGRC $ hg init usertest $ cd usertest $ touch bar $ hg commit --addremove --quiet -m "added bar" $ hg log --template "{author}\n" John Doe $ cd .. $ hg showconfig bundle.mainreporoot=$TESTTMP ui.username=$FAKEUSER $ unset FAKEUSER $ HGUSER=$olduser $ export HGUSER showconfig with multiple arguments $ echo "[alias]" > $HGRC $ echo "log = log -g" >> $HGRC $ echo "[defaults]" >> $HGRC $ echo "identify = -n" >> $HGRC $ hg showconfig alias defaults alias.log=log -g defaults.identify=-n $ hg showconfig alias defaults.identify abort: only one config item permitted [255] $ hg showconfig alias.log defaults.identify abort: only one config item permitted [255] HGPLAIN $ echo "[ui]" > $HGRC $ echo "debug=true" >> $HGRC $ echo "fallbackencoding=ASCII" >> $HGRC $ echo "quiet=true" >> $HGRC $ echo "slash=true" >> $HGRC $ echo "traceback=true" >> $HGRC $ echo "verbose=true" >> $HGRC $ echo "style=~/.hgstyle" >> $HGRC $ echo "logtemplate={node}" >> $HGRC $ echo "[defaults]" >> $HGRC $ echo "identify=-n" >> $HGRC $ echo "[alias]" >> $HGRC $ echo "log=log -g" >> $HGRC customized hgrc $ hg showconfig read config from: $TESTTMP/hgrc $TESTTMP/hgrc:13: alias.log=log -g repo: bundle.mainreporoot=$TESTTMP $TESTTMP/hgrc:11: defaults.identify=-n $TESTTMP/hgrc:2: ui.debug=true $TESTTMP/hgrc:3: ui.fallbackencoding=ASCII $TESTTMP/hgrc:4: ui.quiet=true $TESTTMP/hgrc:5: ui.slash=true $TESTTMP/hgrc:6: ui.traceback=true $TESTTMP/hgrc:7: ui.verbose=true $TESTTMP/hgrc:8: ui.style=~/.hgstyle $TESTTMP/hgrc:9: ui.logtemplate={node} plain hgrc $ HGPLAIN=; export HGPLAIN $ hg showconfig --config ui.traceback=True --debug read config from: $TESTTMP/hgrc repo: bundle.mainreporoot=$TESTTMP --config: ui.traceback=True --verbose: ui.verbose=False --debug: ui.debug=True --quiet: ui.quiet=False with environment variables $ PAGER=p1 EDITOR=e1 VISUAL=e2 hg showconfig --debug set config by: $EDITOR set config by: $VISUAL set config by: $PAGER read config from: $TESTTMP/hgrc repo: bundle.mainreporoot=$TESTTMP $PAGER: pager.pager=p1 $VISUAL: ui.editor=e2 --verbose: ui.verbose=False --debug: ui.debug=True --quiet: ui.quiet=False plain mode with exceptions $ cat > plain.py < from mercurial import commands, extensions > def _config(orig, ui, repo, *values, **opts): > ui.write('plain: %r\n' % ui.plain()) > return orig(ui, repo, *values, **opts) > def uisetup(ui): > extensions.wrapcommand(commands.table, 'config', _config) > EOF $ echo "[extensions]" >> $HGRC $ echo "plain=./plain.py" >> $HGRC $ HGPLAINEXCEPT=; export HGPLAINEXCEPT $ hg showconfig --config ui.traceback=True --debug plain: True read config from: $TESTTMP/hgrc repo: bundle.mainreporoot=$TESTTMP $TESTTMP/hgrc:15: extensions.plain=./plain.py --config: ui.traceback=True --verbose: ui.verbose=False --debug: ui.debug=True --quiet: ui.quiet=False $ unset HGPLAIN $ hg showconfig --config ui.traceback=True --debug plain: True read config from: $TESTTMP/hgrc repo: bundle.mainreporoot=$TESTTMP $TESTTMP/hgrc:15: extensions.plain=./plain.py --config: ui.traceback=True --verbose: ui.verbose=False --debug: ui.debug=True --quiet: ui.quiet=False $ HGPLAINEXCEPT=i18n; export HGPLAINEXCEPT $ hg showconfig --config ui.traceback=True --debug plain: True read config from: $TESTTMP/hgrc repo: bundle.mainreporoot=$TESTTMP $TESTTMP/hgrc:15: extensions.plain=./plain.py --config: ui.traceback=True --verbose: ui.verbose=False --debug: ui.debug=True --quiet: ui.quiet=False source of paths is not mangled $ cat >> $HGRCPATH < [paths] > foo = bar > EOF $ hg showconfig --debug paths plain: True read config from: $TESTTMP/hgrc $TESTTMP/hgrc:17: paths.foo=$TESTTMP/bar mercurial-4.5.3/tests/test-bdiff.py0000644015407300116100000001221113261161234017135 0ustar augieeng00000000000000from __future__ import absolute_import, print_function import collections import struct import unittest from mercurial import ( mdiff, ) class diffreplace( collections.namedtuple('diffreplace', 'start end from_ to')): def __repr__(self): return 'diffreplace(%r, %r, %r, %r)' % self class BdiffTests(unittest.TestCase): def assert_bdiff_applies(self, a, b): d = mdiff.textdiff(a, b) c = a if d: c = mdiff.patches(a, [d]) self.assertEqual( c, b, ("bad diff+patch result from\n %r to\n " "%r: \nbdiff: %r\npatched: %r" % (a, b, d, c[:200]))) def assert_bdiff(self, a, b): self.assert_bdiff_applies(a, b) self.assert_bdiff_applies(b, a) def test_bdiff_basic(self): cases = [ ("a\nc\n\n\n\n", "a\nb\n\n\n"), ("a\nb\nc\n", "a\nc\n"), ("", ""), ("a\nb\nc", "a\nb\nc"), ("a\nb\nc\nd\n", "a\nd\n"), ("a\nb\nc\nd\n", "a\nc\ne\n"), ("a\nb\nc\n", "a\nc\n"), ("a\n", "c\na\nb\n"), ("a\n", ""), ("a\n", "b\nc\n"), ("a\n", "c\na\n"), ("", "adjfkjdjksdhfksj"), ("", "ab"), ("", "abc"), ("a", "a"), ("ab", "ab"), ("abc", "abc"), ("a\n", "a\n"), ("a\nb", "a\nb"), ] for a, b in cases: self.assert_bdiff(a, b) def showdiff(self, a, b): bin = mdiff.textdiff(a, b) pos = 0 q = 0 actions = [] while pos < len(bin): p1, p2, l = struct.unpack(">lll", bin[pos:pos + 12]) pos += 12 if p1: actions.append(a[q:p1]) actions.append(diffreplace(p1, p2, a[p1:p2], bin[pos:pos + l])) pos += l q = p2 if q < len(a): actions.append(a[q:]) return actions def test_issue1295(self): cases = [ ("x\n\nx\n\nx\n\nx\n\nz\n", "x\n\nx\n\ny\n\nx\n\nx\n\nz\n", ['x\n\nx\n\n', diffreplace(6, 6, '', 'y\n\n'), 'x\n\nx\n\nz\n']), ("x\n\nx\n\nx\n\nx\n\nz\n", "x\n\nx\n\ny\n\nx\n\ny\n\nx\n\nz\n", ['x\n\nx\n\n', diffreplace(6, 6, '', 'y\n\n'), 'x\n\n', diffreplace(9, 9, '', 'y\n\n'), 'x\n\nz\n']), ] for old, new, want in cases: self.assertEqual(self.showdiff(old, new), want) def test_issue1295_varies_on_pure(self): # we should pick up abbbc. rather than bc.de as the longest match got = self.showdiff("a\nb\nb\nb\nc\n.\nd\ne\n.\nf\n", "a\nb\nb\na\nb\nb\nb\nc\n.\nb\nc\n.\nd\ne\nf\n") want_c = ['a\nb\nb\n', diffreplace(6, 6, '', 'a\nb\nb\nb\nc\n.\n'), 'b\nc\n.\nd\ne\n', diffreplace(16, 18, '.\n', ''), 'f\n'] want_pure = [diffreplace(0, 0, '', 'a\nb\nb\n'), 'a\nb\nb\nb\nc\n.\n', diffreplace(12, 12, '', 'b\nc\n.\n'), 'd\ne\n', diffreplace(16, 18, '.\n', ''), 'f\n'] self.assert_(got in (want_c, want_pure), 'got: %r, wanted either %r or %r' % ( got, want_c, want_pure)) def test_fixws(self): cases = [ (" \ta\r b\t\n", "ab\n", 1), (" \ta\r b\t\n", " a b\n", 0), ("", "", 1), ("", "", 0), ] for a, b, allws in cases: c = mdiff.fixws(a, allws) self.assertEqual( c, b, 'fixws(%r) want %r got %r (allws=%r)' % (a, b, c, allws)) def test_nice_diff_for_trivial_change(self): self.assertEqual(self.showdiff( ''.join('<%s\n-\n' % i for i in range(5)), ''.join('>%s\n-\n' % i for i in range(5))), [diffreplace(0, 3, '<0\n', '>0\n'), '-\n', diffreplace(5, 8, '<1\n', '>1\n'), '-\n', diffreplace(10, 13, '<2\n', '>2\n'), '-\n', diffreplace(15, 18, '<3\n', '>3\n'), '-\n', diffreplace(20, 23, '<4\n', '>4\n'), '-\n']) def test_prefer_appending(self): # 1 line to 3 lines self.assertEqual(self.showdiff('a\n', 'a\n' * 3), ['a\n', diffreplace(2, 2, '', 'a\na\n')]) # 1 line to 5 lines self.assertEqual(self.showdiff('a\n', 'a\n' * 5), ['a\n', diffreplace(2, 2, '', 'a\na\na\na\n')]) def test_prefer_removing_trailing(self): # 3 lines to 1 line self.assertEqual(self.showdiff('a\n' * 3, 'a\n'), ['a\n', diffreplace(2, 6, 'a\na\n', '')]) # 5 lines to 1 line self.assertEqual(self.showdiff('a\n' * 5, 'a\n'), ['a\n', diffreplace(2, 10, 'a\na\na\na\n', '')]) if __name__ == '__main__': import silenttestrunner silenttestrunner.main(__name__) mercurial-4.5.3/tests/test-extdata.t0000644015407300116100000000420213261161234017331 0ustar augieeng00000000000000 $ hg init repo $ cd repo $ for n in 0 1 2 3 4 5 6 7 8 9 10 11; do > echo $n > $n > hg ci -qAm $n > done test revset support $ cat <<'EOF' >> .hg/hgrc > [extdata] > filedata = file:extdata.txt > notes = notes.txt > shelldata = shell:cat extdata.txt | grep 2 > emptygrep = shell:cat extdata.txt | grep empty > EOF $ cat <<'EOF' > extdata.txt > 2 another comment on 2 > 3 > EOF $ cat <<'EOF' > notes.txt > f6ed this change is great! > e834 this is buggy :( > 0625 first post > bogusnode gives no error > a ambiguous node gives no error > EOF $ hg log -qr "extdata(filedata)" 2:f6ed99a58333 3:9de260b1e88e $ hg log -qr "extdata(shelldata)" 2:f6ed99a58333 test weight of extdata() revset $ hg debugrevspec -p optimized "extdata(filedata) & 3" * optimized: (andsmally (func (symbol 'extdata') (symbol 'filedata')) (symbol '3')) 3 test non-zero exit of shell command $ hg log -qr "extdata(emptygrep)" abort: extdata command 'cat extdata.txt | grep empty' failed: exited with status 1 [255] test bad extdata() revset source $ hg log -qr "extdata()" hg: parse error: extdata takes at least 1 string argument [255] $ hg log -qr "extdata(unknown)" abort: unknown extdata source 'unknown' [255] test template support: $ hg log -r:3 -T "{node|short}{if(extdata('notes'), ' # {extdata('notes')}')}\n" 06254b906311 # first post e8342c9a2ed1 # this is buggy :( f6ed99a58333 # this change is great! 9de260b1e88e test template cache: $ hg log -r:3 -T '{rev} "{extdata("notes")}" "{extdata("shelldata")}"\n' 0 "first post" "" 1 "this is buggy :(" "" 2 "this change is great!" "another comment on 2" 3 "" "" test bad extdata() template source $ hg log -T "{extdata()}\n" hg: parse error: extdata expects one argument [255] $ hg log -T "{extdata('unknown')}\n" abort: unknown extdata source 'unknown' [255] we don't fix up relative file URLs, but we do run shell commands in repo root $ mkdir sub $ cd sub $ hg log -qr "extdata(filedata)" abort: error: $ENOENT$ [255] $ hg log -qr "extdata(shelldata)" 2:f6ed99a58333 $ cd .. mercurial-4.5.3/tests/test-mq-qfold.t0000644015407300116100000001122513261161234017422 0ustar augieeng00000000000000 $ cat <> $HGRCPATH > [extensions] > mq = > [mq] > git = keep > [diff] > nodates = 1 > EOF init: $ hg init repo $ cd repo $ echo a > a $ hg ci -Am adda adding a $ echo a >> a $ hg qnew -f p1 $ echo b >> a $ hg qnew -f p2 $ echo c >> a $ hg qnew -f p3 Fold in the middle of the queue: (this tests also that editor is not invoked if '--edit' is not specified) $ hg qpop p1 popping p3 popping p2 now at: p1 $ hg qdiff diff -r 07f494440405 a --- a/a +++ b/a @@ -1,1 +1,2 @@ a +a $ HGEDITOR=cat hg qfold p2 $ grep git .hg/patches/p1 && echo 'git patch found!' [1] $ hg qser p1 p3 $ hg qdiff diff -r 07f494440405 a --- a/a +++ b/a @@ -1,1 +1,3 @@ a +a +b Fold with local changes: $ echo d >> a $ hg qfold p3 abort: local changes found, qrefresh first [255] $ hg diff -c . diff -r 07f494440405 -r ???????????? a (glob) --- a/a +++ b/a @@ -1,1 +1,3 @@ a +a +b $ hg revert -a --no-backup reverting a Fold git patch into a regular patch, expect git patch: $ echo a >> a $ hg qnew -f regular $ hg cp a aa $ hg qnew --git -f git $ hg qpop popping git now at: regular $ hg qfold git $ cat .hg/patches/regular # HG changeset patch # Parent ???????????????????????????????????????? (glob) diff --git a/a b/a --- a/a +++ b/a @@ -1,3 +1,4 @@ a a b +a diff --git a/a b/aa copy from a copy to aa --- a/a +++ b/aa @@ -1,3 +1,4 @@ a a b +a $ hg qpop popping regular now at: p1 $ hg qdel regular Fold regular patch into a git patch, expect git patch: $ hg cp a aa $ hg qnew --git -f git $ echo b >> aa $ hg qnew -f regular $ hg qpop popping regular now at: git $ hg qfold regular $ cat .hg/patches/git # HG changeset patch # Parent ???????????????????????????????????????? (glob) diff --git a/a b/aa copy from a copy to aa --- a/a +++ b/aa @@ -1,3 +1,4 @@ a a b +b Test saving last-message.txt: $ hg qrefresh -m "original message" $ cat > $TESTTMP/commitfailure.py < from mercurial import error > def reposetup(ui, repo): > class commitfailure(repo.__class__): > def commit(self, *args, **kwargs): > raise error.Abort('emulating unexpected abort') > repo.__class__ = commitfailure > EOF $ cat >> .hg/hgrc < [extensions] > # this failure occurs before editor invocation > commitfailure = $TESTTMP/commitfailure.py > EOF $ cat > $TESTTMP/editor.sh << EOF > echo "==== before editing" > cat \$1 > echo "====" > (echo; echo "test saving last-message.txt") >> \$1 > EOF $ hg qapplied p1 git $ hg tip --template "{files}\n" aa (test that editor is not invoked before transaction starting, and that combination of '--edit' and '--message' doesn't abort execution) $ rm -f .hg/last-message.txt $ HGEDITOR="sh $TESTTMP/editor.sh" hg qfold -e -m MESSAGE p3 qrefresh interrupted while patch was popped! (revert --all, qpush to recover) abort: emulating unexpected abort [255] $ test -f .hg/last-message.txt [1] (reset applied patches and directory status) $ cat >> .hg/hgrc < [extensions] > # this failure occurs after editor invocation > commitfailure = ! > EOF $ hg qapplied p1 $ hg status -A aa ? aa $ rm aa $ hg status -m M a $ hg revert --no-backup -q a $ hg qpush -q git now at: git (test that editor is invoked and commit message is saved into "last-message.txt") $ cat >> .hg/hgrc < [hooks] > # this failure occurs after editor invocation > pretxncommit.unexpectedabort = false > EOF $ rm -f .hg/last-message.txt $ HGEDITOR="sh $TESTTMP/editor.sh" hg qfold -e p3 ==== before editing original message HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to use default message. HG: -- HG: user: test HG: branch 'default' HG: added aa HG: changed a ==== note: commit message saved in .hg/last-message.txt transaction abort! rollback completed qrefresh interrupted while patch was popped! (revert --all, qpush to recover) abort: pretxncommit.unexpectedabort hook exited with status 1 [255] $ cat .hg/last-message.txt original message test saving last-message.txt (confirm whether files listed up in the commit message editing are correct) $ cat >> .hg/hgrc < [hooks] > pretxncommit.unexpectedabort = > EOF $ hg status -u | while read f; do rm ${f}; done $ hg revert --no-backup -q --all $ hg qpush -q git now at: git $ hg qpush -q --move p3 now at: p3 $ hg status --rev "git^1" --rev . -arm M a A aa $ cd .. mercurial-4.5.3/tests/pdiff0000755015407300116100000000362613261161234015564 0ustar augieeng00000000000000#!/bin/sh # Script to get stable diff output on any platform. # # Output of this script is almost equivalent to GNU diff with "-Nru". # # Use this script as "hg pdiff" via extdiff extension with preparation # below in test scripts: # # $ cat >> $HGRCPATH < [extdiff] # > pdiff = sh "$RUNTESTDIR/pdiff" # > EOF filediff(){ # USAGE: filediff file1 file2 [header] # compare with /dev/null if file doesn't exist (as "-N" option) file1="$1" if test ! -f "$file1"; then file1=/dev/null fi file2="$2" if test ! -f "$file2"; then file2=/dev/null fi if cmp -s "$file1" "$file2" 2> /dev/null; then # Return immediately, because comparison isn't needed. This # also avoids redundant message of diff like "No differences # encountered" (on Solaris) return fi if test -n "$3"; then # show header only in recursive case echo "$3" fi # replace "/dev/null" by corresponded filename (as "-N" option) diff -u "$file1" "$file2" | sed "s@^--- /dev/null\(.*\)\$@--- $1\1@" | sed "s@^\+\+\+ /dev/null\(.*\)\$@+++ $2\1@" # in this case, files differ from each other return 1 } if test -d "$1" -o -d "$2"; then # ensure comparison in dictionary order ( if test -d "$1"; then (cd "$1" && find . -type f); fi if test -d "$2"; then (cd "$2" && find . -type f); fi ) | sed 's@^\./@@g' | sort | uniq | while read file; do filediff "$1/$file" "$2/$file" "diff -Nru $1/$file $2/$file" done # TODO: there is no portable way for current while-read based # implementation to return 1 at detecting changes. # # On bash and dash, assignment to variable inside while-block # doesn't affect outside, because inside while-block is executed # in sub-shell. BTW, it affects outside while-block on ksh (as sh # on Solaris). else filediff "$1" "$2" fi mercurial-4.5.3/tests/test-sparse-verbose-json.t0000644015407300116100000000332313261161234021611 0ustar augieeng00000000000000test sparse with --verbose and -T json $ hg init myrepo $ cd myrepo $ cat > .hg/hgrc < [extensions] > sparse= > strip= > EOF $ echo a > show $ echo x > hide $ hg ci -Aqm 'initial' $ echo b > show $ echo y > hide $ echo aa > show2 $ echo xx > hide2 $ hg ci -Aqm 'two' Verify basic --include and --reset $ hg up -q 0 $ hg debugsparse --include 'hide' -Tjson [ { "exclude_rules_added": 0, "files_added": 0, "files_conflicting": 0, "files_dropped": 1, "include_rules_added": 1, "profiles_added": 0 } ] $ hg debugsparse --clear-rules $ hg debugsparse --include 'hide' --verbose removing show Profiles changed: 0 Include rules changed: 1 Exclude rules changed: 0 $ hg debugsparse --reset -Tjson [ { "exclude_rules_added": 0, "files_added": 1, "files_conflicting": 0, "files_dropped": 0, "include_rules_added": -1, "profiles_added": 0 } ] $ hg debugsparse --include 'hide' $ hg debugsparse --reset --verbose getting show Profiles changed: 0 Include rules changed: -1 Exclude rules changed: 0 Verifying that problematic files still allow us to see the deltas when forcing: $ hg debugsparse --include 'show*' $ touch hide $ hg debugsparse --delete 'show*' --force -Tjson pending changes to 'hide' [ { "exclude_rules_added": 0, "files_added": 0, "files_conflicting": 1, "files_dropped": 0, "include_rules_added": -1, "profiles_added": 0 } ] $ hg debugsparse --include 'show*' --force pending changes to 'hide' $ hg debugsparse --delete 'show*' --force --verbose pending changes to 'hide' Profiles changed: 0 Include rules changed: -1 Exclude rules changed: 0 mercurial-4.5.3/tests/hgterm.ti0000644015407300116100000000241013261161234016360 0ustar augieeng00000000000000hgterm, am, km, mir, msgr, xenl, colors#8, cols#80, it#8, lines#24, pairs#64, acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, bel=^G, bold=\E[1m, clear=\E[H\E[2J, cr=\r, csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=\b, cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, enacs=\E)0, home=\E[H, ht=\t, hts=\EH, il=\E[%p1%dL, il1=\E[L, ind=\n, is2=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8, kbs=\b, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kdch1=\E[3~, kf1=\E[11~, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, kf2=\E[12~, kf20=\E[34~, kf3=\E[13~, kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, kfnd=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, kslt=\E[4~, op=\E[m, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m, rs2=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8, sc=\E7, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, sgr0=\E[m, smacs=^N, smcup=\E7\E[?47h, smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c, mercurial-4.5.3/tests/test-abort-checkin.t0000644015407300116100000000154613261161234020420 0ustar augieeng00000000000000 $ cat > abortcommit.py < from mercurial import error > def hook(**args): > raise error.Abort("no commits allowed") > def reposetup(ui, repo): > repo.ui.setconfig("hooks", "pretxncommit.nocommits", hook) > EOF $ abspath=`pwd`/abortcommit.py $ cat <> $HGRCPATH > [extensions] > mq = > abortcommit = $abspath > EOF $ hg init foo $ cd foo $ echo foo > foo $ hg add foo mq may keep a reference to the repository so __del__ will not be called and .hg/journal.dirstate will not be deleted: $ hg ci -m foo error: pretxncommit.nocommits hook failed: no commits allowed transaction abort! rollback completed abort: no commits allowed [255] $ hg ci -m foo error: pretxncommit.nocommits hook failed: no commits allowed transaction abort! rollback completed abort: no commits allowed [255] $ cd .. mercurial-4.5.3/tests/test-convert-bzr-ghosts.t0000644015407300116100000000170413261161234021463 0ustar augieeng00000000000000#require bzr $ . "$TESTDIR/bzr-definitions" $ cat > ghostcreator.py < import sys > from bzrlib import workingtree > wt = workingtree.WorkingTree.open('.') > > message, ghostrev = sys.argv[1:] > wt.set_parent_ids(wt.get_parent_ids() + [ghostrev]) > wt.commit(message) > EOF ghost revisions $ mkdir test-ghost-revisions $ cd test-ghost-revisions $ bzr init -q source $ cd source $ echo content > somefile $ bzr add -q somefile $ bzr commit -q -m 'Initial layout setup' $ echo morecontent >> somefile $ $PYTHON ../../ghostcreator.py 'Commit with ghost revision' ghostrev $ cd .. $ hg convert source source-hg initializing destination source-hg repository scanning source... sorting... converting... 1 Initial layout setup 0 Commit with ghost revision $ glog -R source-hg o 1@source "Commit with ghost revision" files: somefile | o 0@source "Initial layout setup" files: somefile $ cd .. mercurial-4.5.3/tests/test-clone-pull-corruption.t0000644015407300116100000000235413261161234022161 0ustar augieeng00000000000000Corrupt an hg repo with a pull started during an aborted commit Create two repos, so that one of them can pull from the other one. $ hg init source $ cd source $ touch foo $ hg add foo $ hg ci -m 'add foo' $ hg clone . ../corrupted updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo >> foo $ hg ci -m 'change foo' Add a hook to wait 5 seconds and then abort the commit $ cd ../corrupted $ echo "[hooks]" >> .hg/hgrc $ echo 'pretxncommit = sh -c "sleep 5; exit 1"' >> .hg/hgrc start a commit... $ touch bar $ hg add bar $ hg ci -m 'add bar' & ... and start a pull while the commit is still running $ sleep 1 $ hg pull ../source 2>/dev/null pulling from ../source transaction abort! rollback completed abort: pretxncommit hook exited with status 1 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 52998019f625 (run 'hg update' to get a working copy) see what happened $ wait $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files 1 files, 2 changesets, 2 total revisions $ cd .. mercurial-4.5.3/tests/test-status-color.t0000644015407300116100000003404113261161234020342 0ustar augieeng00000000000000 $ cat <> $HGRCPATH > [ui] > color = always > [color] > mode = ansi > EOF Terminfo codes compatibility fix $ echo "color.none=0" >> $HGRCPATH $ hg init repo1 $ cd repo1 $ mkdir a b a/1 b/1 b/2 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2 hg status in repo root: $ hg status \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc) $ hg status --color=debug [status.unknown|? ][status.unknown|a/1/in_a_1] [status.unknown|? ][status.unknown|a/in_a] [status.unknown|? ][status.unknown|b/1/in_b_1] [status.unknown|? ][status.unknown|b/2/in_b_2] [status.unknown|? ][status.unknown|b/in_b] [status.unknown|? ][status.unknown|in_root] HGPLAIN disables color $ HGPLAIN=1 hg status --color=debug ? a/1/in_a_1 (glob) ? a/in_a (glob) ? b/1/in_b_1 (glob) ? b/2/in_b_2 (glob) ? b/in_b (glob) ? in_root HGPLAINEXCEPT=color does not disable color $ HGPLAINEXCEPT=color hg status --color=debug [status.unknown|? ][status.unknown|a/1/in_a_1] (glob) [status.unknown|? ][status.unknown|a/in_a] (glob) [status.unknown|? ][status.unknown|b/1/in_b_1] (glob) [status.unknown|? ][status.unknown|b/2/in_b_2] (glob) [status.unknown|? ][status.unknown|b/in_b] (glob) [status.unknown|? ][status.unknown|in_root] hg status with template $ hg status -T "{label('red', path)}\n" --color=debug [red|a/1/in_a_1] [red|a/in_a] [red|b/1/in_b_1] [red|b/2/in_b_2] [red|b/in_b] [red|in_root] hg status . in repo root: $ hg status . \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc) $ hg status --cwd a \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc) $ hg status --cwd a . \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc) $ hg status --cwd a .. \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/1/in_b_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/2/in_b_2\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/in_b\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc) $ hg status --cwd b \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc) $ hg status --cwd b . \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc) $ hg status --cwd b .. \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/1/in_a_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/in_a\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc) $ hg status --cwd a/1 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc) $ hg status --cwd a/1 . \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc) $ hg status --cwd a/1 .. \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_a\x1b[0m (esc) $ hg status --cwd b/1 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc) $ hg status --cwd b/1 . \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc) $ hg status --cwd b/1 .. \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../2/in_b_2\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc) $ hg status --cwd b/2 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc) $ hg status --cwd b/2 . \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc) $ hg status --cwd b/2 .. \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../1/in_b_1\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc) Make sure --color=never works $ hg status --color=never ? a/1/in_a_1 ? a/in_a ? b/1/in_b_1 ? b/2/in_b_2 ? b/in_b ? in_root Make sure ui.formatted=False works $ hg status --color=auto --config ui.formatted=False ? a/1/in_a_1 ? a/in_a ? b/1/in_b_1 ? b/2/in_b_2 ? b/in_b ? in_root $ cd .. $ hg init repo2 $ cd repo2 $ touch modified removed deleted ignored $ echo "^ignored$" > .hgignore $ hg ci -A -m 'initial checkin' adding .hgignore adding deleted adding modified adding removed $ hg log --color=debug [log.changeset changeset.draft|changeset: 0:389aef86a55e] [log.tag|tag: tip] [log.user|user: test] [log.date|date: Thu Jan 01 00:00:00 1970 +0000] [log.summary|summary: initial checkin] $ hg log -Tcompact --color=debug [log.changeset changeset.draft|0][tip] [log.node|389aef86a55e] [log.date|1970-01-01 00:00 +0000] [log.user|test] [ui.note log.description|initial checkin] Labels on empty strings should not be displayed, labels on custom templates should be. $ hg log --color=debug -T '{label("my.label",author)}\n{label("skipped.label","")}' [my.label|test] $ touch modified added unknown ignored $ hg add added $ hg remove removed $ rm deleted hg status: $ hg status \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc) \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc) \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc) hg status modified added removed deleted unknown never-existed ignored: $ hg status modified added removed deleted unknown never-existed ignored never-existed: * (glob) \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc) \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc) \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc) $ hg copy modified copied hg status -C: $ hg status -C \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc) \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc) \x1b[0;0m modified\x1b[0m (esc) \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc) \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc) hg status -A: $ hg status -A \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc) \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc) \x1b[0;0m modified\x1b[0m (esc) \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc) \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc) \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignored\x1b[0m (esc) \x1b[0;0mC \x1b[0m\x1b[0;0m.hgignore\x1b[0m (esc) \x1b[0;0mC \x1b[0m\x1b[0;0mmodified\x1b[0m (esc) hg status -A (with terminfo color): #if tic $ mkdir "$TESTTMP/terminfo" $ TERMINFO="$TESTTMP/terminfo" tic "$TESTDIR/hgterm.ti" $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo -A \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1madded\x1b[30m (esc) \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1mcopied\x1b[30m (esc) \x1b[30m\x1b[30m modified\x1b[30m (esc) \x1b[30m\x1b[31m\x1b[1mR \x1b[30m\x1b[30m\x1b[31m\x1b[1mremoved\x1b[30m (esc) \x1b[30m\x1b[36m\x1b[1m\x1b[4m! \x1b[30m\x1b[30m\x1b[36m\x1b[1m\x1b[4mdeleted\x1b[30m (esc) \x1b[30m\x1b[35m\x1b[1m\x1b[4m? \x1b[30m\x1b[30m\x1b[35m\x1b[1m\x1b[4munknown\x1b[30m (esc) \x1b[30m\x1b[30m\x1b[1mI \x1b[30m\x1b[30m\x1b[30m\x1b[1mignored\x1b[30m (esc) \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30m.hgignore\x1b[30m (esc) \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30mmodified\x1b[30m (esc) The user can define effects with raw terminfo codes: $ cat <> $HGRCPATH > # Completely bogus code for dim > terminfo.dim = \E[88m > # We can override what's in the terminfo database, too > terminfo.bold = \E[2m > EOF $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo --config color.status.clean=dim -A \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2madded\x1b[30m (esc) \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2mcopied\x1b[30m (esc) \x1b[30m\x1b[30m modified\x1b[30m (esc) \x1b[30m\x1b[31m\x1b[2mR \x1b[30m\x1b[30m\x1b[31m\x1b[2mremoved\x1b[30m (esc) \x1b[30m\x1b[36m\x1b[2m\x1b[4m! \x1b[30m\x1b[30m\x1b[36m\x1b[2m\x1b[4mdeleted\x1b[30m (esc) \x1b[30m\x1b[35m\x1b[2m\x1b[4m? \x1b[30m\x1b[30m\x1b[35m\x1b[2m\x1b[4munknown\x1b[30m (esc) \x1b[30m\x1b[30m\x1b[2mI \x1b[30m\x1b[30m\x1b[30m\x1b[2mignored\x1b[30m (esc) \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88m.hgignore\x1b[30m (esc) \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88mmodified\x1b[30m (esc) #endif $ echo "^ignoreddir$" > .hgignore $ mkdir ignoreddir $ touch ignoreddir/file hg status ignoreddir/file: $ hg status ignoreddir/file hg status -i ignoreddir/file: $ hg status -i ignoreddir/file \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignoreddir/file\x1b[0m (esc) $ cd .. check 'status -q' and some combinations $ hg init repo3 $ cd repo3 $ touch modified removed deleted ignored $ echo "^ignored$" > .hgignore $ hg commit -A -m 'initial checkin' adding .hgignore adding deleted adding modified adding removed $ touch added unknown ignored $ hg add added $ echo "test" >> modified $ hg remove removed $ rm deleted $ hg copy modified copied test unknown color $ hg --config color.status.modified=periwinkle status ignoring unknown color/effect 'periwinkle' (configured in color.status.modified) ignoring unknown color/effect 'periwinkle' (configured in color.status.modified) ignoring unknown color/effect 'periwinkle' (configured in color.status.modified) M modified \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc) \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc) \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc) \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc) \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc) Run status with 2 different flags. Check if result is the same or different. If result is not as expected, raise error $ assert() { > hg status $1 > ../a > hg status $2 > ../b > if diff ../a ../b > /dev/null; then > out=0 > else > out=1 > fi > if [ $3 -eq 0 ]; then > df="same" > else > df="different" > fi > if [ $out -ne $3 ]; then > echo "Error on $1 and $2, should be $df." > fi > } assert flag1 flag2 [0-same | 1-different] $ assert "-q" "-mard" 0 $ assert "-A" "-marduicC" 0 $ assert "-qA" "-mardcC" 0 $ assert "-qAui" "-A" 0 $ assert "-qAu" "-marducC" 0 $ assert "-qAi" "-mardicC" 0 $ assert "-qu" "-u" 0 $ assert "-q" "-u" 1 $ assert "-m" "-a" 1 $ assert "-r" "-d" 1 $ cd .. test 'resolve -l' $ hg init repo4 $ cd repo4 $ echo "file a" > a $ echo "file b" > b $ hg add a b $ hg commit -m "initial" $ echo "file a change 1" > a $ echo "file b change 1" > b $ hg commit -m "head 1" $ hg update 0 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo "file a change 2" > a $ echo "file b change 2" > b $ hg commit -m "head 2" created new head $ hg merge merging a merging b warning: conflicts while merging a! (edit, then use 'hg resolve --mark') warning: conflicts while merging b! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 2 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ hg resolve -m b hg resolve with one unresolved, one resolved: $ hg resolve -l \x1b[0;31;1mU \x1b[0m\x1b[0;31;1ma\x1b[0m (esc) \x1b[0;32;1mR \x1b[0m\x1b[0;32;1mb\x1b[0m (esc) color coding of error message with current availability of curses $ hg unknowncommand > /dev/null hg: unknown command 'unknowncommand' [255] color coding of error message without curses $ echo 'raise ImportError' > curses.py $ PYTHONPATH=`pwd`:$PYTHONPATH hg unknowncommand > /dev/null hg: unknown command 'unknowncommand' [255] $ cd .. mercurial-4.5.3/tests/test-convert-authormap.t0000644015407300116100000000233013261161234021355 0ustar augieeng00000000000000 $ cat >> $HGRCPATH < [extensions] > convert= > EOF Prepare orig repo $ hg init orig $ cd orig $ echo foo > foo $ HGUSER='user name' hg ci -qAm 'foo' $ cd .. Explicit --authors $ cat > authormap.txt < user name = Long User Name > > # comment > this line is ignored > EOF $ hg convert --authors authormap.txt orig new initializing destination new repository ignoring bad line in author map file authormap.txt: this line is ignored scanning source... sorting... converting... 0 foo writing author map file $TESTTMP/new/.hg/authormap $ cat new/.hg/authormap user name=Long User Name $ hg -Rnew log changeset: 0:d89716e88087 tag: tip user: Long User Name date: Thu Jan 01 00:00:00 1970 +0000 summary: foo $ rm -rf new Implicit .hg/authormap $ hg init new $ mv authormap.txt new/.hg/authormap $ hg convert orig new ignoring bad line in author map file $TESTTMP/new/.hg/authormap: this line is ignored scanning source... sorting... converting... 0 foo $ hg -Rnew log changeset: 0:d89716e88087 tag: tip user: Long User Name date: Thu Jan 01 00:00:00 1970 +0000 summary: foo mercurial-4.5.3/tests/test-show-work.t0000644015407300116100000001210413261161234017637 0ustar augieeng00000000000000 $ cat >> $HGRCPATH << EOF > [extensions] > show = > EOF $ hg init repo0 $ cd repo0 Command works on an empty repo $ hg show work Single draft changeset shown $ echo 0 > foo $ hg -q commit -A -m 'commit 0' $ hg show work @ 9f17 commit 0 Even when it isn't the wdir $ hg -q up null $ hg show work o 9f17 commit 0 Single changeset is still there when public because it is a head $ hg phase --public -r 0 $ hg show work o 9f17 commit 0 A draft child will show both it and public parent $ hg -q up 0 $ echo 1 > foo $ hg commit -m 'commit 1' $ hg show work @ 181c commit 1 o 9f17 commit 0 Multiple draft children will be shown $ echo 2 > foo $ hg commit -m 'commit 2' $ hg show work @ 128c commit 2 o 181c commit 1 o 9f17 commit 0 Bumping first draft changeset to public will hide its parent $ hg phase --public -r 1 $ hg show work @ 128c commit 2 o 181c commit 1 | ~ Multiple DAG heads will be shown $ hg -q up -r 1 $ echo 3 > foo $ hg commit -m 'commit 3' created new head $ hg show work @ f0ab commit 3 | o 128c commit 2 |/ o 181c commit 1 | ~ Even when wdir is something else $ hg -q up null $ hg show work o f0ab commit 3 | o 128c commit 2 |/ o 181c commit 1 | ~ Draft child shows public head (multiple heads) $ hg -q up 0 $ echo 4 > foo $ hg commit -m 'commit 4' created new head $ hg show work @ 668c commit 4 | o f0ab commit 3 | | o 128c commit 2 | |/ | o 181c commit 1 |/ o 9f17 commit 0 $ cd .. Branch name appears in output $ hg init branches $ cd branches $ echo 0 > foo $ hg -q commit -A -m 'commit 0' $ echo 1 > foo $ hg commit -m 'commit 1' $ echo 2 > foo $ hg commit -m 'commit 2' $ hg phase --public -r . $ hg -q up -r 1 $ hg branch mybranch marked working directory as branch mybranch (branches are permanent and global, did you want a bookmark?) $ echo 3 > foo $ hg commit -m 'commit 3' $ echo 4 > foo $ hg commit -m 'commit 4' $ hg show work @ f8dd (mybranch) commit 4 o 90cf (mybranch) commit 3 | o 128c commit 2 |/ o 181c commit 1 | ~ $ cd .. Bookmark name appears in output $ hg init bookmarks $ cd bookmarks $ echo 0 > foo $ hg -q commit -A -m 'commit 0' $ echo 1 > foo $ hg commit -m 'commit 1' $ echo 2 > foo $ hg commit -m 'commit 2' $ hg phase --public -r . $ hg bookmark @ $ hg -q up -r 1 $ echo 3 > foo $ hg commit -m 'commit 3' created new head $ echo 4 > foo $ hg commit -m 'commit 4' $ hg bookmark mybook $ hg show work @ cac8 (mybook) commit 4 o f0ab commit 3 | o 128c (@) commit 2 |/ o 181c commit 1 | ~ $ cd .. Tags are rendered $ hg init tags $ cd tags $ echo 0 > foo $ hg -q commit -A -m 'commit 1' $ echo 1 > foo $ hg commit -m 'commit 2' $ hg tag 0.1 $ hg phase --public -r . $ echo 2 > foo $ hg commit -m 'commit 3' $ hg tag 0.2 $ hg show work @ 3758 Added tag 0.2 for changeset 6379c25b76f1 o 6379 (0.2) commit 3 o a2ad Added tag 0.1 for changeset 6a75536ea0b1 | ~ $ cd .. Multiple names on same changeset render properly $ hg init multiplenames $ cd multiplenames $ echo 0 > foo $ hg -q commit -A -m 'commit 1' $ hg phase --public -r . $ hg branch mybranch marked working directory as branch mybranch (branches are permanent and global, did you want a bookmark?) $ hg bookmark mybook $ echo 1 > foo $ hg commit -m 'commit 2' $ hg show work @ 3483 (mybook) (mybranch) commit 2 o 97fc commit 1 Multiple bookmarks on same changeset render properly $ hg book mybook2 $ hg show work @ 3483 (mybook mybook2) (mybranch) commit 2 o 97fc commit 1 $ cd .. Extra namespaces are rendered $ hg init extranamespaces $ cd extranamespaces $ echo 0 > foo $ hg -q commit -A -m 'commit 1' $ hg phase --public -r . $ echo 1 > foo $ hg commit -m 'commit 2' $ echo 2 > foo $ hg commit -m 'commit 3' $ hg --config extensions.revnames=$TESTDIR/revnamesext.py show work @ 32f3 (r2) commit 3 o 6a75 (r1) commit 2 o 97fc (r0) commit 1 Obsolescence information appears in labels. $ cat >> .hg/hgrc << EOF > [experimental] > evolution=createmarkers > EOF $ hg debugobsolete `hg log -r 'desc("commit 2")' -T "{node}"` obsoleted 1 changesets 1 new orphan changesets $ hg show work --color=debug @ [log.changeset changeset.draft changeset.unstable instability.orphan|32f3] [log.description|commit 3] x [log.changeset changeset.draft changeset.obsolete|6a75] [log.description|commit 2] | ~ $ cd .. Prefix collision on hashes increases shortest node length $ hg init hashcollision $ cd hashcollision $ echo 0 > a $ hg -q commit -Am 0 $ for i in 17 1057 2857 4025; do > hg -q up 0 > echo $i > a > hg -q commit -m $i > echo 0 > a > hg commit -m "$i commit 2" > done $ hg show work @ cfd04 4025 commit 2 o c562d 4025 | o 08048 2857 commit 2 | o c5623 2857 |/ | o 6a6b6 1057 commit 2 | o c5625 1057 |/ | o 96b4e 17 commit 2 | o 11424 17 |/ o b4e73 0 $ cd .. mercurial-4.5.3/tests/test-revlog-ancestry.py.out0000644015407300116100000000045213261161234022021 0ustar augieeng00000000000000Ancestors of 5 4 2 0 Ancestors of 6 and 5 3 4 2 1 0 Ancestors of 5 and 4 4 2 0 Ancestors of 7, stop at 6 6 Ancestors of 7, including revs 7 6 5 3 4 2 1 0 Ancestors of 7, 5 and 3, including revs 7 5 3 6 4 2 1 0 Descendants of 5 7 8 Descendants of 5 and 3 6 7 8 Descendants of 5 and 4 5 7 8 mercurial-4.5.3/tests/test-patchbomb.t0000644015407300116100000026552513261161234017657 0ustar augieeng00000000000000Note for future hackers of patchbomb: this file is a bit heavy on wildcards in test expectations due to how many things like hostnames tend to make it into outputs. As a result, you may need to perform the following regular expression substitutions: @$HOSTNAME> -> @*> (glob) Mercurial-patchbomb/.* -> Mercurial-patchbomb/* (glob) /mixed; boundary="===+[0-9]+==" -> /mixed; boundary="===*== (glob)" --===+[0-9]+=+--$ -> --===*=-- (glob) --===+[0-9]+=+$ -> --===*= (glob) $ cat > prune-blank-after-boundary.py < from __future__ import absolute_import, print_function > import sys > skipblank = False > trim = lambda x: x.strip(' \r\n') > for l in sys.stdin: > if trim(l).endswith('=--') or trim(l).endswith('=='): > skipblank = True > print(l, end='') > continue > if not trim(l) and skipblank: > continue > skipblank = False > print(l, end='') > EOF $ FILTERBOUNDARY="$PYTHON `pwd`/prune-blank-after-boundary.py" $ echo "[format]" >> $HGRCPATH $ echo "usegeneraldelta=yes" >> $HGRCPATH $ echo "[extensions]" >> $HGRCPATH $ echo "patchbomb=" >> $HGRCPATH $ hg init t $ cd t $ echo a > a $ hg commit -Ama -d '1 0' adding a $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -r tip this patch series consists of 1 patches. displaying [PATCH] a ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH] a X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: <8580ff50825a50c8f716.60@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.60@*> (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff -r 000000000000 -r 8580ff50825a a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,1 @@ +a If --to is specified on the command line, it should override any email.to config setting. Same for --cc: $ hg email --date '1970-1-1 0:1' -n -f quux --to foo --cc bar -r tip \ > --config email.to=bob@example.com --config email.cc=alice@example.com this patch series consists of 1 patches. displaying [PATCH] a ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH] a X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: <*@*> (glob) X-Mercurial-Series-Id: <*@*> (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff -r 000000000000 -r 8580ff50825a a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,1 @@ +a $ hg --config ui.interactive=1 email --confirm -n -f quux -t foo -c bar -r tip< n > EOF this patch series consists of 1 patches. Final summary: From: quux To: foo Cc: bar Subject: [PATCH] a a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) are you sure you want to send (yn)? n abort: patchbomb canceled [255] $ hg --config ui.interactive=1 --config patchbomb.confirm=true email -n -f quux -t foo -c bar -r tip< n > EOF this patch series consists of 1 patches. Final summary: From: quux To: foo Cc: bar Subject: [PATCH] a a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) are you sure you want to send (yn)? n abort: patchbomb canceled [255] Test diff.git is respected $ hg --config diff.git=True email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -r tip this patch series consists of 1 patches. displaying [PATCH] a ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH] a X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: <8580ff50825a50c8f716.60@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.60@*> (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff --git a/a b/a new file mode 100644 --- /dev/null +++ b/a @@ -0,0 +1,1 @@ +a Test breaking format changes aren't $ hg --config diff.noprefix=True email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -r tip this patch series consists of 1 patches. displaying [PATCH] a ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH] a X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: <8580ff50825a50c8f716.60@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.60@*> (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff -r 000000000000 -r 8580ff50825a a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,1 @@ +a $ echo b > b $ hg commit -Amb -d '2 0' adding b $ hg email --date '1970-1-1 0:2' -n -f quux -t foo -c bar -s test -r 0:tip this patch series consists of 2 patches. Write the introductory message for the patch series. displaying [PATCH 0 of 2] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 0 of 2] test Message-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:02:00 +0000 From: quux To: foo Cc: bar displaying [PATCH 1 of 2] a ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 1 of 2] a X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 2 Message-Id: <8580ff50825a50c8f716.121@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.121@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:02:01 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff -r 000000000000 -r 8580ff50825a a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,1 @@ +a displaying [PATCH 2 of 2] b ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 2 of 2] b X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9 X-Mercurial-Series-Index: 2 X-Mercurial-Series-Total: 2 Message-Id: <97d72e5f12c7e84f8506.122@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.121@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:02:02 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 2 0 # Thu Jan 01 00:00:02 1970 +0000 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab b diff -r 8580ff50825a -r 97d72e5f12c7 b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/b Thu Jan 01 00:00:02 1970 +0000 @@ -0,0 +1,1 @@ +b .hg/last-email.txt $ cat > editor.sh << '__EOF__' > echo "a precious introductory message" > "$1" > __EOF__ $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg email -n -t foo -s test -r 0:tip > /dev/null $ cat .hg/last-email.txt a precious introductory message $ hg email -m test.mbox -f quux -t foo -c bar -s test 0:tip \ > --config extensions.progress= --config progress.assume-tty=1 \ > --config progress.delay=0 --config progress.refresh=0 \ > --config progress.width=60 \ > --config extensions.mocktime=$TESTDIR/mocktime.py this patch series consists of 2 patches. Write the introductory message for the patch series. \r (no-eol) (esc) sending [ ] 0/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) sending [============> ] 1/3 01s\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) sending [==========================> ] 2/3 01s\r (no-eol) (esc) \r (esc) sending [PATCH 0 of 2] test ... sending [PATCH 1 of 2] a ... sending [PATCH 2 of 2] b ... $ cd .. $ hg clone -q t t2 $ cd t2 $ echo c > c $ hg commit -Amc -d '3 0' adding c $ cat > description < a multiline > > description > EOF test bundle and description: $ hg email --date '1970-1-1 0:3' -n -f quux -t foo \ > -c bar -s test -r tip -b --desc description | $FILTERBOUNDARY searching for changes 1 changesets found displaying test ... Content-Type: multipart/mixed; boundary="===*==" (glob) MIME-Version: 1.0 Subject: test Message-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:03:00 +0000 From: quux To: foo Cc: bar --===*= (glob) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit a multiline description --===*= (glob) Content-Type: application/x-mercurial-bundle MIME-Version: 1.0 Content-Disposition: attachment; filename="bundle.hg" Content-Transfer-Encoding: base64 SEcyMAAAAA5Db21wcmVzc2lvbj1CWkJaaDkxQVkmU1nYvy2xAAAJf//7vFYQXD1/4H7R09C/470I Ak0E4pe4SIIIgQSgGEQOcLAA5VBKqeppMxTI0YjQNBgQMQDI0GgMhtR6I0GI2p6I0yeSEVT9MiYn qjCYQwCBtARptARgBNDEwAGiDCMA40NGjQaNA0AAAAADIAAAA0BkABktCk6qObVxZ2A/33KHibLr UQ4BwkgcPcmuCUAQZCztIWgR1SpBS6IqbIij4UFwhnnMkElcFTqoucIWbsBPK3l+6c+xYaVBWsJo aT0OV/YAOvLrziifDQMJOMIaaYce9agtI2EwQBAq089UiRU+evFHSLRBT7Wa/D/YBaUtU5ezvtr3 6yrIS4Iyp9VWESdWPEi6VjRjdcEY4HvbmDIVEAEVJIUrHNIBx/MmnBBRkw8tSlCQ8ABZxf5ejgBI pP5TSQPLVMYbq1qbBPmWN0LYVlAvRbP4X512kDQZ9y4TQbvoZmhe+54sRsEJ8GW3hMJjERh0NNlg aB+3Cw/4u5IpwoSGxfltiA== --===============*==-- (glob) with a specific bundle type (binary part must be different) $ hg email --date '1970-1-1 0:3' -n -f quux -t foo \ > -c bar -s test -r tip -b --desc description \ > --config patchbomb.bundletype=gzip-v1 | $FILTERBOUNDARY searching for changes 1 changesets found displaying test ... Content-Type: multipart/mixed; boundary="===*==" (glob) MIME-Version: 1.0 Subject: test Message-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:03:00 +0000 From: quux To: foo Cc: bar --===*= (glob) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit a multiline description --===*= (glob) Content-Type: application/x-mercurial-bundle MIME-Version: 1.0 Content-Disposition: attachment; filename="bundle.hg" Content-Transfer-Encoding: base64 SEcxMEdaeJxjYGBY8V9n/iLGbtFfJZuNk/euDCpWfrRy/vTrevFCx1/4t7J5LdeL0ix0Opx3kwEL wKYXKqUJwqnG5sYWSWmmJsaWlqYWaRaWJpaWiWamZpYWRgZGxolJiabmSQbmZqlcQMV6QGwCxGzG CgZcySARUyA2A2LGZKiZ3Y+Lu786z4z4MWXmsrAZCsqrl1az5y21PMcjpbThzWeXGT+/nutbmvvz zXYS3BoGxdrJDIYmlimJJiZpRokmqYYmaSYWFknmSSkmhqbmliamiZYWxuYmBhbJBgZcUBNZQe5K Epm7xF/LT+RLx/a9juFTomaYO/Rgsx4rwBN+IMCUDLOKAQBrsmti --===============*==-- (glob) utf-8 patch: $ $PYTHON -c 'fp = open("utf", "wb"); fp.write("h\xC3\xB6mma!\n"); fp.close();' $ hg commit -A -d '4 0' -m 'utf-8 content' adding description adding utf no mime encoding for email --test: $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n this patch series consists of 1 patches. displaying [PATCH] utf-8 content ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8bit Subject: [PATCH] utf-8 content X-Mercurial-Node: 909a00e13e9d78b575aeee23dddbada46d5a143f X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: <909a00e13e9d78b575ae.240@*> (glob) X-Mercurial-Series-Id: <909a00e13e9d78b575ae.240@*> (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:04:00 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 4 0 # Thu Jan 01 00:00:04 1970 +0000 # Node ID 909a00e13e9d78b575aeee23dddbada46d5a143f # Parent ff2c9fa2018b15fa74b33363bda9527323e2a99f utf-8 content diff -r ff2c9fa2018b -r 909a00e13e9d description --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/description Thu Jan 01 00:00:04 1970 +0000 @@ -0,0 +1,3 @@ +a multiline + +description diff -r ff2c9fa2018b -r 909a00e13e9d utf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utf Thu Jan 01 00:00:04 1970 +0000 @@ -0,0 +1,1 @@ +h\xc3\xb6mma! (esc) mime encoded mbox (base64): $ hg email --date '1970-1-1 0:4' -f 'Q ' -t foo -c bar -r tip -m mbox this patch series consists of 1 patches. sending [PATCH] utf-8 content ... $ cat mbox From quux ... ... .. ..:..:.. .... (re) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Subject: [PATCH] utf-8 content X-Mercurial-Node: 909a00e13e9d78b575aeee23dddbada46d5a143f X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: <909a00e13e9d78b575ae.240@*> (glob) X-Mercurial-Series-Id: <909a00e13e9d78b575ae.240@*> (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:04:00 +0000 From: Q To: foo Cc: bar IyBIRyBjaGFuZ2VzZXQgcGF0Y2gKIyBVc2VyIHRlc3QKIyBEYXRlIDQgMAojICAgICAgVGh1IEph biAwMSAwMDowMDowNCAxOTcwICswMDAwCiMgTm9kZSBJRCA5MDlhMDBlMTNlOWQ3OGI1NzVhZWVl MjNkZGRiYWRhNDZkNWExNDNmCiMgUGFyZW50ICBmZjJjOWZhMjAxOGIxNWZhNzRiMzMzNjNiZGE5 NTI3MzIzZTJhOTlmCnV0Zi04IGNvbnRlbnQKCmRpZmYgLXIgZmYyYzlmYTIwMThiIC1yIDkwOWEw MGUxM2U5ZCBkZXNjcmlwdGlvbgotLS0gL2Rldi9udWxsCVRodSBKYW4gMDEgMDA6MDA6MDAgMTk3 MCArMDAwMAorKysgYi9kZXNjcmlwdGlvbglUaHUgSmFuIDAxIDAwOjAwOjA0IDE5NzAgKzAwMDAK QEAgLTAsMCArMSwzIEBACithIG11bHRpbGluZQorCitkZXNjcmlwdGlvbgpkaWZmIC1yIGZmMmM5 ZmEyMDE4YiAtciA5MDlhMDBlMTNlOWQgdXRmCi0tLSAvZGV2L251bGwJVGh1IEphbiAwMSAwMDow MDowMCAxOTcwICswMDAwCisrKyBiL3V0ZglUaHUgSmFuIDAxIDAwOjAwOjA0IDE5NzAgKzAwMDAK QEAgLTAsMCArMSwxIEBACitow7ZtbWEhCg== $ $PYTHON -c 'print open("mbox").read().split("\n\n")[1].decode("base64")' # HG changeset patch # User test # Date 4 0 # Thu Jan 01 00:00:04 1970 +0000 # Node ID 909a00e13e9d78b575aeee23dddbada46d5a143f # Parent ff2c9fa2018b15fa74b33363bda9527323e2a99f utf-8 content diff -r ff2c9fa2018b -r 909a00e13e9d description --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/description Thu Jan 01 00:00:04 1970 +0000 @@ -0,0 +1,3 @@ +a multiline + +description diff -r ff2c9fa2018b -r 909a00e13e9d utf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utf Thu Jan 01 00:00:04 1970 +0000 @@ -0,0 +1,1 @@ +h\xc3\xb6mma! (esc) $ rm mbox mime encoded mbox (quoted-printable): $ $PYTHON -c 'fp = open("long", "wb"); fp.write("%s\nfoo\n\nbar\n" % ("x" * 1024)); fp.close();' $ hg commit -A -d '4 0' -m 'long line' adding long no mime encoding for email --test: $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -n this patch series consists of 1 patches. displaying [PATCH] long line ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: [PATCH] long line X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1 X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: (glob) X-Mercurial-Series-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:04:00 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 4 0 # Thu Jan 01 00:00:04 1970 +0000 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f long line diff -r 909a00e13e9d -r a2ea8fc83dd8 long --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/long Thu Jan 01 00:00:04 1970 +0000 @@ -0,0 +1,4 @@ +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +foo + +bar mime encoded mbox (quoted-printable): $ hg email --date '1970-1-1 0:4' -f quux -t foo -c bar -r tip -m mbox this patch series consists of 1 patches. sending [PATCH] long line ... $ cat mbox From quux ... ... .. ..:..:.. .... (re) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: [PATCH] long line X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1 X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: (glob) X-Mercurial-Series-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:04:00 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 4 0 # Thu Jan 01 00:00:04 1970 +0000 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f long line diff -r 909a00e13e9d -r a2ea8fc83dd8 long --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/long Thu Jan 01 00:00:04 1970 +0000 @@ -0,0 +1,4 @@ +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +foo + +bar $ rm mbox iso-8859-1 patch: $ $PYTHON -c 'fp = open("isolatin", "wb"); fp.write("h\xF6mma!\n"); fp.close();' $ hg commit -A -d '5 0' -m 'isolatin 8-bit encoding' adding isolatin iso-8859-1 mbox: $ hg email --date '1970-1-1 0:5' -f quux -t foo -c bar -r tip -m mbox this patch series consists of 1 patches. sending [PATCH] isolatin 8-bit encoding ... $ cat mbox From quux ... ... .. ..:..:.. .... (re) MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: [PATCH] isolatin 8-bit encoding X-Mercurial-Node: 240fb913fc1b7ff15ddb9f33e73d82bf5277c720 X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: <240fb913fc1b7ff15ddb.300@*> (glob) X-Mercurial-Series-Id: <240fb913fc1b7ff15ddb.300@*> (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:05:00 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 5 0 # Thu Jan 01 00:00:05 1970 +0000 # Node ID 240fb913fc1b7ff15ddb9f33e73d82bf5277c720 # Parent a2ea8fc83dd8b93cfd86ac97b28287204ab806e1 isolatin 8-bit encoding diff -r a2ea8fc83dd8 -r 240fb913fc1b isolatin --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/isolatin Thu Jan 01 00:00:05 1970 +0000 @@ -0,0 +1,1 @@ +h=F6mma! test diffstat for single patch: $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y -r 2 this patch series consists of 1 patches. Final summary: From: quux To: foo Cc: bar Subject: [PATCH] test c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) are you sure you want to send (yn)? y displaying [PATCH] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH] test X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: (glob) X-Mercurial-Series-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) # HG changeset patch # User test # Date 3 0 # Thu Jan 01 00:00:03 1970 +0000 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9 c diff -r 97d72e5f12c7 -r ff2c9fa2018b c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:03 1970 +0000 @@ -0,0 +1,1 @@ +c test diffstat for multiple patches: $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -d -y \ > -r 0:1 this patch series consists of 2 patches. Write the introductory message for the patch series. Final summary: From: quux To: foo Cc: bar Subject: [PATCH 0 of 2] test a | 1 + b | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) Subject: [PATCH 1 of 2] a a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) Subject: [PATCH 2 of 2] b b | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) are you sure you want to send (yn)? y displaying [PATCH 0 of 2] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 0 of 2] test Message-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar a | 1 + b | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) displaying [PATCH 1 of 2] a ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 1 of 2] a X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 2 Message-Id: <8580ff50825a50c8f716.61@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:01 +0000 From: quux To: foo Cc: bar a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff -r 000000000000 -r 8580ff50825a a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,1 @@ +a displaying [PATCH 2 of 2] b ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 2 of 2] b X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9 X-Mercurial-Series-Index: 2 X-Mercurial-Series-Total: 2 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:02 +0000 From: quux To: foo Cc: bar b | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) # HG changeset patch # User test # Date 2 0 # Thu Jan 01 00:00:02 1970 +0000 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab b diff -r 8580ff50825a -r 97d72e5f12c7 b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/b Thu Jan 01 00:00:02 1970 +0000 @@ -0,0 +1,1 @@ +b test inline for single patch: $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 2 | $FILTERBOUNDARY this patch series consists of 1 patches. displaying [PATCH] test ... Content-Type: multipart/mixed; boundary="===*==" (glob) MIME-Version: 1.0 Subject: [PATCH] test X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: (glob) X-Mercurial-Series-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar --===*= (glob) MIME-Version: 1.0 Content-Type: text/x-patch; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename=t2.patch # HG changeset patch # User test # Date 3 0 # Thu Jan 01 00:00:03 1970 +0000 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9 c diff -r 97d72e5f12c7 -r ff2c9fa2018b c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:03 1970 +0000 @@ -0,0 +1,1 @@ +c --===*=-- (glob) test inline for single patch (quoted-printable): $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i -r 4 | $FILTERBOUNDARY this patch series consists of 1 patches. displaying [PATCH] test ... Content-Type: multipart/mixed; boundary="===*==" (glob) MIME-Version: 1.0 Subject: [PATCH] test X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1 X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: (glob) X-Mercurial-Series-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar --===*= (glob) MIME-Version: 1.0 Content-Type: text/x-patch; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename=t2.patch # HG changeset patch # User test # Date 4 0 # Thu Jan 01 00:00:04 1970 +0000 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f long line diff -r 909a00e13e9d -r a2ea8fc83dd8 long --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/long Thu Jan 01 00:00:04 1970 +0000 @@ -0,0 +1,4 @@ +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +foo + +bar --===*=-- (glob) test inline for multiple patches: $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i \ > -r 0:1 -r 4 | $FILTERBOUNDARY this patch series consists of 3 patches. Write the introductory message for the patch series. displaying [PATCH 0 of 3] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 0 of 3] test Message-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar displaying [PATCH 1 of 3] a ... Content-Type: multipart/mixed; boundary="===*==" (glob) MIME-Version: 1.0 Subject: [PATCH 1 of 3] a X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 3 Message-Id: <8580ff50825a50c8f716.61@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:01 +0000 From: quux To: foo Cc: bar --===*= (glob) MIME-Version: 1.0 Content-Type: text/x-patch; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename=t2-1.patch # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff -r 000000000000 -r 8580ff50825a a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,1 @@ +a --===*=-- (glob) displaying [PATCH 2 of 3] b ... Content-Type: multipart/mixed; boundary="===*==" (glob) MIME-Version: 1.0 Subject: [PATCH 2 of 3] b X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9 X-Mercurial-Series-Index: 2 X-Mercurial-Series-Total: 3 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:02 +0000 From: quux To: foo Cc: bar --===*= (glob) MIME-Version: 1.0 Content-Type: text/x-patch; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename=t2-2.patch # HG changeset patch # User test # Date 2 0 # Thu Jan 01 00:00:02 1970 +0000 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab b diff -r 8580ff50825a -r 97d72e5f12c7 b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/b Thu Jan 01 00:00:02 1970 +0000 @@ -0,0 +1,1 @@ +b --===*=-- (glob) displaying [PATCH 3 of 3] long line ... Content-Type: multipart/mixed; boundary="===*==" (glob) MIME-Version: 1.0 Subject: [PATCH 3 of 3] long line X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1 X-Mercurial-Series-Index: 3 X-Mercurial-Series-Total: 3 Message-Id: (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:03 +0000 From: quux To: foo Cc: bar --===*= (glob) MIME-Version: 1.0 Content-Type: text/x-patch; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename=t2-3.patch # HG changeset patch # User test # Date 4 0 # Thu Jan 01 00:00:04 1970 +0000 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f long line diff -r 909a00e13e9d -r a2ea8fc83dd8 long --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/long Thu Jan 01 00:00:04 1970 +0000 @@ -0,0 +1,4 @@ +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +foo + +bar --===*=-- (glob) test attach for single patch: $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 2 | $FILTERBOUNDARY this patch series consists of 1 patches. displaying [PATCH] test ... Content-Type: multipart/mixed; boundary="===*==" (glob) MIME-Version: 1.0 Subject: [PATCH] test X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: (glob) X-Mercurial-Series-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar --===*= (glob) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Patch subject is complete summary. --===*= (glob) MIME-Version: 1.0 Content-Type: text/x-patch; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=t2.patch # HG changeset patch # User test # Date 3 0 # Thu Jan 01 00:00:03 1970 +0000 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9 c diff -r 97d72e5f12c7 -r ff2c9fa2018b c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:03 1970 +0000 @@ -0,0 +1,1 @@ +c --===*=-- (glob) test attach for single patch (quoted-printable): $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a -r 4 | $FILTERBOUNDARY this patch series consists of 1 patches. displaying [PATCH] test ... Content-Type: multipart/mixed; boundary="===*==" (glob) MIME-Version: 1.0 Subject: [PATCH] test X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1 X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: (glob) X-Mercurial-Series-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar --===*= (glob) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Patch subject is complete summary. --===*= (glob) MIME-Version: 1.0 Content-Type: text/x-patch; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=t2.patch # HG changeset patch # User test # Date 4 0 # Thu Jan 01 00:00:04 1970 +0000 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f long line diff -r 909a00e13e9d -r a2ea8fc83dd8 long --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/long Thu Jan 01 00:00:04 1970 +0000 @@ -0,0 +1,4 @@ +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +foo + +bar --===*=-- (glob) test attach and body for single patch: $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a --body -r 2 | $FILTERBOUNDARY this patch series consists of 1 patches. displaying [PATCH] test ... Content-Type: multipart/mixed; boundary="===*==" (glob) MIME-Version: 1.0 Subject: [PATCH] test X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: (glob) X-Mercurial-Series-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar --===*= (glob) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit # HG changeset patch # User test # Date 3 0 # Thu Jan 01 00:00:03 1970 +0000 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9 c diff -r 97d72e5f12c7 -r ff2c9fa2018b c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:03 1970 +0000 @@ -0,0 +1,1 @@ +c --===*= (glob) MIME-Version: 1.0 Content-Type: text/x-patch; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=t2.patch # HG changeset patch # User test # Date 3 0 # Thu Jan 01 00:00:03 1970 +0000 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9 c diff -r 97d72e5f12c7 -r ff2c9fa2018b c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:03 1970 +0000 @@ -0,0 +1,1 @@ +c --===*=-- (glob) test attach for multiple patches: $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -a \ > -r 0:1 -r 4 | $FILTERBOUNDARY this patch series consists of 3 patches. Write the introductory message for the patch series. displaying [PATCH 0 of 3] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 0 of 3] test Message-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar displaying [PATCH 1 of 3] a ... Content-Type: multipart/mixed; boundary="===*==" (glob) MIME-Version: 1.0 Subject: [PATCH 1 of 3] a X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 3 Message-Id: <8580ff50825a50c8f716.61@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:01 +0000 From: quux To: foo Cc: bar --===*= (glob) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Patch subject is complete summary. --===*= (glob) MIME-Version: 1.0 Content-Type: text/x-patch; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=t2-1.patch # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff -r 000000000000 -r 8580ff50825a a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,1 @@ +a --===*=-- (glob) displaying [PATCH 2 of 3] b ... Content-Type: multipart/mixed; boundary="===*==" (glob) MIME-Version: 1.0 Subject: [PATCH 2 of 3] b X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9 X-Mercurial-Series-Index: 2 X-Mercurial-Series-Total: 3 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:02 +0000 From: quux To: foo Cc: bar --===*= (glob) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Patch subject is complete summary. --===*= (glob) MIME-Version: 1.0 Content-Type: text/x-patch; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=t2-2.patch # HG changeset patch # User test # Date 2 0 # Thu Jan 01 00:00:02 1970 +0000 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab b diff -r 8580ff50825a -r 97d72e5f12c7 b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/b Thu Jan 01 00:00:02 1970 +0000 @@ -0,0 +1,1 @@ +b --===*=-- (glob) displaying [PATCH 3 of 3] long line ... Content-Type: multipart/mixed; boundary="===*==" (glob) MIME-Version: 1.0 Subject: [PATCH 3 of 3] long line X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1 X-Mercurial-Series-Index: 3 X-Mercurial-Series-Total: 3 Message-Id: (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:03 +0000 From: quux To: foo Cc: bar --===*= (glob) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Patch subject is complete summary. --===*= (glob) MIME-Version: 1.0 Content-Type: text/x-patch; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=t2-3.patch # HG changeset patch # User test # Date 4 0 # Thu Jan 01 00:00:04 1970 +0000 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f long line diff -r 909a00e13e9d -r a2ea8fc83dd8 long --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/long Thu Jan 01 00:00:04 1970 +0000 @@ -0,0 +1,4 @@ +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +foo + +bar --===*=-- (glob) test intro for single patch: $ hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \ > -r 2 this patch series consists of 1 patches. Write the introductory message for the patch series. displaying [PATCH 0 of 1] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 0 of 1] test Message-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar displaying [PATCH 1 of 1] c ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 1 of 1] c X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: (glob) X-Mercurial-Series-Id: (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:01 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 3 0 # Thu Jan 01 00:00:03 1970 +0000 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9 c diff -r 97d72e5f12c7 -r ff2c9fa2018b c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:03 1970 +0000 @@ -0,0 +1,1 @@ +c test --desc without --intro for a single patch: $ echo foo > intro.text $ hg email --date '1970-1-1 0:1' -n --desc intro.text -f quux -t foo -c bar \ > -s test -r 2 this patch series consists of 1 patches. displaying [PATCH 0 of 1] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 0 of 1] test Message-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar foo displaying [PATCH 1 of 1] c ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 1 of 1] c X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: (glob) X-Mercurial-Series-Id: (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:01 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 3 0 # Thu Jan 01 00:00:03 1970 +0000 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9 c diff -r 97d72e5f12c7 -r ff2c9fa2018b c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:03 1970 +0000 @@ -0,0 +1,1 @@ +c test intro for multiple patches: $ hg email --date '1970-1-1 0:1' -n --intro -f quux -t foo -c bar -s test \ > -r 0:1 this patch series consists of 2 patches. Write the introductory message for the patch series. displaying [PATCH 0 of 2] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 0 of 2] test Message-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar displaying [PATCH 1 of 2] a ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 1 of 2] a X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 2 Message-Id: <8580ff50825a50c8f716.61@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:01 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff -r 000000000000 -r 8580ff50825a a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,1 @@ +a displaying [PATCH 2 of 2] b ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 2 of 2] b X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9 X-Mercurial-Series-Index: 2 X-Mercurial-Series-Total: 2 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:02 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 2 0 # Thu Jan 01 00:00:02 1970 +0000 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab b diff -r 8580ff50825a -r 97d72e5f12c7 b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/b Thu Jan 01 00:00:02 1970 +0000 @@ -0,0 +1,1 @@ +b test reply-to via config: $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -r 2 \ > --config patchbomb.reply-to='baz@example.com' this patch series consists of 1 patches. displaying [PATCH] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH] test X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: (glob) X-Mercurial-Series-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar Reply-To: baz@example.com # HG changeset patch # User test # Date 3 0 # Thu Jan 01 00:00:03 1970 +0000 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9 c diff -r 97d72e5f12c7 -r ff2c9fa2018b c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:03 1970 +0000 @@ -0,0 +1,1 @@ +c test reply-to via command line: $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -r 2 \ > --reply-to baz --reply-to fred this patch series consists of 1 patches. displaying [PATCH] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH] test X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: (glob) X-Mercurial-Series-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar Reply-To: baz, fred # HG changeset patch # User test # Date 3 0 # Thu Jan 01 00:00:03 1970 +0000 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9 c diff -r 97d72e5f12c7 -r ff2c9fa2018b c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:03 1970 +0000 @@ -0,0 +1,1 @@ +c tagging csets: $ hg tag -r0 zero zero.foo $ hg tag -r1 one one.patch $ hg tag -r2 two two.diff test inline for single named patch: $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i \ > -r 2 | $FILTERBOUNDARY this patch series consists of 1 patches. displaying [PATCH] test ... Content-Type: multipart/mixed; boundary="===*==" (glob) MIME-Version: 1.0 Subject: [PATCH] test X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: (glob) X-Mercurial-Series-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar --===*= (glob) MIME-Version: 1.0 Content-Type: text/x-patch; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename=two.diff # HG changeset patch # User test # Date 3 0 # Thu Jan 01 00:00:03 1970 +0000 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9 c diff -r 97d72e5f12c7 -r ff2c9fa2018b c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:03 1970 +0000 @@ -0,0 +1,1 @@ +c --===*=-- (glob) test inline for multiple named/unnamed patches: $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar -s test -i \ > -r 0:1 | $FILTERBOUNDARY this patch series consists of 2 patches. Write the introductory message for the patch series. displaying [PATCH 0 of 2] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 0 of 2] test Message-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar displaying [PATCH 1 of 2] a ... Content-Type: multipart/mixed; boundary="===*==" (glob) MIME-Version: 1.0 Subject: [PATCH 1 of 2] a X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 2 Message-Id: <8580ff50825a50c8f716.61@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:01 +0000 From: quux To: foo Cc: bar --===*= (glob) MIME-Version: 1.0 Content-Type: text/x-patch; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename=t2-1.patch # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff -r 000000000000 -r 8580ff50825a a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,1 @@ +a --===*=-- (glob) displaying [PATCH 2 of 2] b ... Content-Type: multipart/mixed; boundary="===*==" (glob) MIME-Version: 1.0 Subject: [PATCH 2 of 2] b X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9 X-Mercurial-Series-Index: 2 X-Mercurial-Series-Total: 2 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:02 +0000 From: quux To: foo Cc: bar --===*= (glob) MIME-Version: 1.0 Content-Type: text/x-patch; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename=one.patch # HG changeset patch # User test # Date 2 0 # Thu Jan 01 00:00:02 1970 +0000 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab b diff -r 8580ff50825a -r 97d72e5f12c7 b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/b Thu Jan 01 00:00:02 1970 +0000 @@ -0,0 +1,1 @@ +b --===*=-- (glob) test inreplyto: $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \ > -r tip this patch series consists of 1 patches. displaying [PATCH] Added tag two, two.diff for changeset ff2c9fa2018b ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH] Added tag two, two.diff for changeset ff2c9fa2018b X-Mercurial-Node: 7aead2484924c445ad8ce2613df91f52f9e502ed X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: <7aead2484924c445ad8c.60@*> (glob) X-Mercurial-Series-Id: <7aead2484924c445ad8c.60@*> (glob) In-Reply-To: References: User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 7aead2484924c445ad8ce2613df91f52f9e502ed # Parent 045ca29b1ea20e4940411e695e20e521f2f0f98e Added tag two, two.diff for changeset ff2c9fa2018b diff -r 045ca29b1ea2 -r 7aead2484924 .hgtags --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 @@ -2,3 +2,5 @@ 8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo 97d72e5f12c7e84f85064aa72e5a297142c36ed9 one 97d72e5f12c7e84f85064aa72e5a297142c36ed9 one.patch +ff2c9fa2018b15fa74b33363bda9527323e2a99f two +ff2c9fa2018b15fa74b33363bda9527323e2a99f two.diff no intro message in non-interactive mode $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \ > -r 0:1 this patch series consists of 2 patches. (optional) Subject: [PATCH 0 of 2] displaying [PATCH 1 of 2] a ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 1 of 2] a X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 2 Message-Id: <8580ff50825a50c8f716.60@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.60@*> (glob) In-Reply-To: References: User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff -r 000000000000 -r 8580ff50825a a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,1 @@ +a displaying [PATCH 2 of 2] b ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 2 of 2] b X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9 X-Mercurial-Series-Index: 2 X-Mercurial-Series-Total: 2 Message-Id: <97d72e5f12c7e84f8506.61@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.60@*> (glob) In-Reply-To: References: User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:01 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 2 0 # Thu Jan 01 00:00:02 1970 +0000 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab b diff -r 8580ff50825a -r 97d72e5f12c7 b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/b Thu Jan 01 00:00:02 1970 +0000 @@ -0,0 +1,1 @@ +b $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -c bar --in-reply-to baz \ > -s test -r 0:1 this patch series consists of 2 patches. Write the introductory message for the patch series. displaying [PATCH 0 of 2] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 0 of 2] test Message-Id: (glob) In-Reply-To: References: User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar displaying [PATCH 1 of 2] a ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 1 of 2] a X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 2 Message-Id: <8580ff50825a50c8f716.61@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:01 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff -r 000000000000 -r 8580ff50825a a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,1 @@ +a displaying [PATCH 2 of 2] b ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 2 of 2] b X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9 X-Mercurial-Series-Index: 2 X-Mercurial-Series-Total: 2 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:02 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 2 0 # Thu Jan 01 00:00:02 1970 +0000 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab b diff -r 8580ff50825a -r 97d72e5f12c7 b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/b Thu Jan 01 00:00:02 1970 +0000 @@ -0,0 +1,1 @@ +b test single flag for single patch (and no warning when not mailing dirty rev): $ hg up -qr1 $ echo dirt > a $ hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \ > -r 2 | $FILTERBOUNDARY this patch series consists of 1 patches. displaying [PATCH fooFlag] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH fooFlag] test X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: (glob) X-Mercurial-Series-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 3 0 # Thu Jan 01 00:00:03 1970 +0000 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9 c diff -r 97d72e5f12c7 -r ff2c9fa2018b c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:03 1970 +0000 @@ -0,0 +1,1 @@ +c test single flag for multiple patches (and warning when mailing dirty rev): $ hg email --date '1970-1-1 0:1' -n --flag fooFlag -f quux -t foo -c bar -s test \ > -r 0:1 warning: working directory has uncommitted changes this patch series consists of 2 patches. Write the introductory message for the patch series. displaying [PATCH 0 of 2 fooFlag] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 0 of 2 fooFlag] test Message-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar displaying [PATCH 1 of 2 fooFlag] a ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 1 of 2 fooFlag] a X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 2 Message-Id: <8580ff50825a50c8f716.61@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:01 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff -r 000000000000 -r 8580ff50825a a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,1 @@ +a displaying [PATCH 2 of 2 fooFlag] b ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 2 of 2 fooFlag] b X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9 X-Mercurial-Series-Index: 2 X-Mercurial-Series-Total: 2 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:02 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 2 0 # Thu Jan 01 00:00:02 1970 +0000 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab b diff -r 8580ff50825a -r 97d72e5f12c7 b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/b Thu Jan 01 00:00:02 1970 +0000 @@ -0,0 +1,1 @@ +b $ hg revert --no-b a $ hg up -q test multiple flags for single patch: $ hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \ > -c bar -s test -r 2 this patch series consists of 1 patches. displaying [PATCH fooFlag barFlag] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH fooFlag barFlag] test X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: (glob) X-Mercurial-Series-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 3 0 # Thu Jan 01 00:00:03 1970 +0000 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9 c diff -r 97d72e5f12c7 -r ff2c9fa2018b c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:03 1970 +0000 @@ -0,0 +1,1 @@ +c test multiple flags for multiple patches: $ hg email --date '1970-1-1 0:1' -n --flag fooFlag --flag barFlag -f quux -t foo \ > -c bar -s test -r 0:1 this patch series consists of 2 patches. Write the introductory message for the patch series. displaying [PATCH 0 of 2 fooFlag barFlag] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 0 of 2 fooFlag barFlag] test Message-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo Cc: bar displaying [PATCH 1 of 2 fooFlag barFlag] a ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 1 of 2 fooFlag barFlag] a X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 2 Message-Id: <8580ff50825a50c8f716.61@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:01 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff -r 000000000000 -r 8580ff50825a a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,1 @@ +a displaying [PATCH 2 of 2 fooFlag barFlag] b ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 2 of 2 fooFlag barFlag] b X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9 X-Mercurial-Series-Index: 2 X-Mercurial-Series-Total: 2 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:02 +0000 From: quux To: foo Cc: bar # HG changeset patch # User test # Date 2 0 # Thu Jan 01 00:00:02 1970 +0000 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab b diff -r 8580ff50825a -r 97d72e5f12c7 b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/b Thu Jan 01 00:00:02 1970 +0000 @@ -0,0 +1,1 @@ +b test multi-address parsing: $ hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t 'spam' \ > -t toast -c 'foo,bar@example.com' -c '"A, B <>" ' -s test -r 0 \ > --config email.bcc='"Quux, A." ' this patch series consists of 1 patches. sending [PATCH] test ... $ cat < tmp.mbox From quux ... ... .. ..:..:.. .... (re) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH] test X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: <8580ff50825a50c8f716.315532860@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.315532860@*> (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Tue, 01 Jan 1980 00:01:00 +0000 From: quux To: spam , eggs, toast Cc: foo, bar@example.com, "A, B <>" Bcc: "Quux, A." # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff -r 000000000000 -r 8580ff50825a a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,1 @@ +a test flag template: $ echo foo > intro.text $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -r 0:1 \ > --desc intro.text --subject test \ > --config patchbomb.flagtemplate='R{rev}' this patch series consists of 2 patches. Cc: displaying [PATCH 0 of 2 R1] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 0 of 2 R1] test Message-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo foo displaying [PATCH 1 of 2 R0] a ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 1 of 2 R0] a X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 2 Message-Id: <8580ff50825a50c8f716.61@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:01 +0000 From: quux To: foo # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff -r 000000000000 -r 8580ff50825a a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,1 @@ +a displaying [PATCH 2 of 2 R1] b ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 2 of 2 R1] b X-Mercurial-Node: 97d72e5f12c7e84f85064aa72e5a297142c36ed9 X-Mercurial-Series-Index: 2 X-Mercurial-Series-Total: 2 Message-Id: <97d72e5f12c7e84f8506.62@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.61@*> (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:02 +0000 From: quux To: foo # HG changeset patch # User test # Date 2 0 # Thu Jan 01 00:00:02 1970 +0000 # Node ID 97d72e5f12c7e84f85064aa72e5a297142c36ed9 # Parent 8580ff50825a50c8f716709acdf8de0deddcd6ab b diff -r 8580ff50825a -r 97d72e5f12c7 b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/b Thu Jan 01 00:00:02 1970 +0000 @@ -0,0 +1,1 @@ +b test flag template plus --flag: $ hg email --date '1970-1-1 0:1' -n -f quux -t foo -r 0 --flag 'V2' \ > --config patchbomb.flagtemplate='{branch} {flags}' this patch series consists of 1 patches. Cc: displaying [PATCH default V2] a ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH default V2] a X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: <8580ff50825a50c8f716.60@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.60@*> (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Thu, 01 Jan 1970 00:01:00 +0000 From: quux To: foo # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff -r 000000000000 -r 8580ff50825a a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,1 @@ +a test multi-byte domain parsing: $ UUML=`$PYTHON -c 'import sys; sys.stdout.write("\374")'` $ HGENCODING=iso-8859-1 $ export HGENCODING $ hg email --date '1980-1-1 0:1' -m tmp.mbox -f quux -t "bar@${UUML}nicode.com" -s test -r 0 this patch series consists of 1 patches. Cc: sending [PATCH] test ... $ cat tmp.mbox From quux ... ... .. ..:..:.. .... (re) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH] test X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: <8580ff50825a50c8f716.315532860@*> (glob) X-Mercurial-Series-Id: <8580ff50825a50c8f716.315532860@*> (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Tue, 01 Jan 1980 00:01:00 +0000 From: quux To: bar@xn--nicode-2ya.com # HG changeset patch # User test # Date 1 0 # Thu Jan 01 00:00:01 1970 +0000 # Node ID 8580ff50825a50c8f716709acdf8de0deddcd6ab # Parent 0000000000000000000000000000000000000000 a diff -r 000000000000 -r 8580ff50825a a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:01 1970 +0000 @@ -0,0 +1,1 @@ +a test outgoing: $ hg up 1 0 files updated, 0 files merged, 6 files removed, 0 files unresolved $ hg branch test marked working directory as branch test (branches are permanent and global, did you want a bookmark?) $ echo d > d $ hg add d $ hg ci -md -d '4 0' $ echo d >> d $ hg ci -mdd -d '5 0' $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n" @ 10:3b6f1ec9dde9 dd | o 9:2f9fa9b998c5 d | | o 8:7aead2484924 Added tag two, two.diff for changeset ff2c9fa2018b | | | o 7:045ca29b1ea2 Added tag one, one.patch for changeset 97d72e5f12c7 | | | o 6:5d5ef15dfe5e Added tag zero, zero.foo for changeset 8580ff50825a | | | o 5:240fb913fc1b isolatin 8-bit encoding | | | o 4:a2ea8fc83dd8 long line | | | o 3:909a00e13e9d utf-8 content | | | o 2:ff2c9fa2018b c |/ o 1:97d72e5f12c7 b | o 0:8580ff50825a a $ hg phase --force --secret -r 10 $ hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t -r 'rev(10) or rev(6)' comparing with ../t From [test]: test this patch series consists of 6 patches. Write the introductory message for the patch series. Cc: displaying [PATCH 0 of 6] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 0 of 6] test Message-Id: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Tue, 01 Jan 1980 00:01:00 +0000 From: test To: foo displaying [PATCH 1 of 6] c ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 1 of 6] c X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 6 Message-Id: (glob) X-Mercurial-Series-Id: (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Tue, 01 Jan 1980 00:01:01 +0000 From: test To: foo # HG changeset patch # User test # Date 3 0 # Thu Jan 01 00:00:03 1970 +0000 # Node ID ff2c9fa2018b15fa74b33363bda9527323e2a99f # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9 c diff -r 97d72e5f12c7 -r ff2c9fa2018b c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:03 1970 +0000 @@ -0,0 +1,1 @@ +c displaying [PATCH 2 of 6] utf-8 content ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8bit Subject: [PATCH 2 of 6] utf-8 content X-Mercurial-Node: 909a00e13e9d78b575aeee23dddbada46d5a143f X-Mercurial-Series-Index: 2 X-Mercurial-Series-Total: 6 Message-Id: <909a00e13e9d78b575ae.315532862@*> (glob) X-Mercurial-Series-Id: (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Tue, 01 Jan 1980 00:01:02 +0000 From: test To: foo # HG changeset patch # User test # Date 4 0 # Thu Jan 01 00:00:04 1970 +0000 # Node ID 909a00e13e9d78b575aeee23dddbada46d5a143f # Parent ff2c9fa2018b15fa74b33363bda9527323e2a99f utf-8 content diff -r ff2c9fa2018b -r 909a00e13e9d description --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/description Thu Jan 01 00:00:04 1970 +0000 @@ -0,0 +1,3 @@ +a multiline + +description diff -r ff2c9fa2018b -r 909a00e13e9d utf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utf Thu Jan 01 00:00:04 1970 +0000 @@ -0,0 +1,1 @@ +h\xc3\xb6mma! (esc) displaying [PATCH 3 of 6] long line ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: [PATCH 3 of 6] long line X-Mercurial-Node: a2ea8fc83dd8b93cfd86ac97b28287204ab806e1 X-Mercurial-Series-Index: 3 X-Mercurial-Series-Total: 6 Message-Id: (glob) X-Mercurial-Series-Id: (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Tue, 01 Jan 1980 00:01:03 +0000 From: test To: foo # HG changeset patch # User test # Date 4 0 # Thu Jan 01 00:00:04 1970 +0000 # Node ID a2ea8fc83dd8b93cfd86ac97b28287204ab806e1 # Parent 909a00e13e9d78b575aeee23dddbada46d5a143f long line diff -r 909a00e13e9d -r a2ea8fc83dd8 long --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/long Thu Jan 01 00:00:04 1970 +0000 @@ -0,0 +1,4 @@ +xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +foo + +bar displaying [PATCH 4 of 6] isolatin 8-bit encoding ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8bit Subject: [PATCH 4 of 6] isolatin 8-bit encoding X-Mercurial-Node: 240fb913fc1b7ff15ddb9f33e73d82bf5277c720 X-Mercurial-Series-Index: 4 X-Mercurial-Series-Total: 6 Message-Id: <240fb913fc1b7ff15ddb.315532864@*> (glob) X-Mercurial-Series-Id: (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Tue, 01 Jan 1980 00:01:04 +0000 From: test To: foo # HG changeset patch # User test # Date 5 0 # Thu Jan 01 00:00:05 1970 +0000 # Node ID 240fb913fc1b7ff15ddb9f33e73d82bf5277c720 # Parent a2ea8fc83dd8b93cfd86ac97b28287204ab806e1 isolatin 8-bit encoding diff -r a2ea8fc83dd8 -r 240fb913fc1b isolatin --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/isolatin Thu Jan 01 00:00:05 1970 +0000 @@ -0,0 +1,1 @@ +h\xf6mma! (esc) displaying [PATCH 5 of 6] Added tag zero, zero.foo for changeset 8580ff50825a ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 5 of 6] Added tag zero, zero.foo for changeset 8580ff50825a X-Mercurial-Node: 5d5ef15dfe5e7bd3a4ee154b5fff76c7945ec433 X-Mercurial-Series-Index: 5 X-Mercurial-Series-Total: 6 Message-Id: <5d5ef15dfe5e7bd3a4ee.315532865@*> (glob) X-Mercurial-Series-Id: (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Tue, 01 Jan 1980 00:01:05 +0000 From: test To: foo # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 5d5ef15dfe5e7bd3a4ee154b5fff76c7945ec433 # Parent 240fb913fc1b7ff15ddb9f33e73d82bf5277c720 Added tag zero, zero.foo for changeset 8580ff50825a diff -r 240fb913fc1b -r 5d5ef15dfe5e .hgtags --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,2 @@ +8580ff50825a50c8f716709acdf8de0deddcd6ab zero +8580ff50825a50c8f716709acdf8de0deddcd6ab zero.foo displaying [PATCH 6 of 6] d ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH 6 of 6] d X-Mercurial-Node: 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268 X-Mercurial-Series-Index: 6 X-Mercurial-Series-Total: 6 Message-Id: <2f9fa9b998c5fe3ac2bd.315532866@*> (glob) X-Mercurial-Series-Id: (glob) In-Reply-To: (glob) References: (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Tue, 01 Jan 1980 00:01:06 +0000 From: test To: foo # HG changeset patch # User test # Date 4 0 # Thu Jan 01 00:00:04 1970 +0000 # Branch test # Node ID 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9 d diff -r 97d72e5f12c7 -r 2f9fa9b998c5 d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/d Thu Jan 01 00:00:04 1970 +0000 @@ -0,0 +1,1 @@ +d Don't prompt for a CC header. $ echo "[email]" >> $HGRCPATH $ echo "cc=" >> $HGRCPATH dest#branch URIs: $ hg email --date '1980-1-1 0:1' -n -t foo -s test -o ../t#test comparing with ../t From [test]: test this patch series consists of 1 patches. displaying [PATCH] test ... MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH] test X-Mercurial-Node: 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268 X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: <2f9fa9b998c5fe3ac2bd.315532860@*> (glob) X-Mercurial-Series-Id: <2f9fa9b998c5fe3ac2bd.315532860@*> (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Tue, 01 Jan 1980 00:01:00 +0000 From: test To: foo # HG changeset patch # User test # Date 4 0 # Thu Jan 01 00:00:04 1970 +0000 # Branch test # Node ID 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268 # Parent 97d72e5f12c7e84f85064aa72e5a297142c36ed9 d diff -r 97d72e5f12c7 -r 2f9fa9b998c5 d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/d Thu Jan 01 00:00:04 1970 +0000 @@ -0,0 +1,1 @@ +d #if no-windows Set up a fake sendmail program $ cat > pretendmail.sh << 'EOF' > #!/bin/sh > echo "$@" > cat > EOF $ chmod +x pretendmail.sh $ echo '[email]' >> $HGRCPATH $ echo "method=`pwd`/pretendmail.sh" >> $HGRCPATH Test introduction configuration ================================= $ echo '[patchbomb]' >> $HGRCPATH "auto" setting ---------------- $ echo 'intro=auto' >> $HGRCPATH single rev $ hg email --date '1980-1-1 0:1' -t foo -s test -r '10' | grep "Write the introductory message for the patch series." [1] single rev + flag $ hg email --date '1980-1-1 0:1' -t foo -s test -r '10' --intro | grep "Write the introductory message for the patch series." Write the introductory message for the patch series. Multi rev $ hg email --date '1980-1-1 0:1' -t foo -s test -r '9::' | grep "Write the introductory message for the patch series." Write the introductory message for the patch series. "never" setting ----------------- $ echo 'intro=never' >> $HGRCPATH single rev $ hg email --date '1980-1-1 0:1' -t foo -s test -r '10' | grep "Write the introductory message for the patch series." [1] single rev + flag $ hg email --date '1980-1-1 0:1' -t foo -s test -r '10' --intro | grep "Write the introductory message for the patch series." Write the introductory message for the patch series. Multi rev $ hg email --date '1980-1-1 0:1' -t foo -s test -r '9::' | grep "Write the introductory message for the patch series." [1] Multi rev + flag $ hg email --date '1980-1-1 0:1' -t foo -s test -r '9::' --intro | grep "Write the introductory message for the patch series." Write the introductory message for the patch series. "always" setting ----------------- $ echo 'intro=always' >> $HGRCPATH single rev $ hg email --date '1980-1-1 0:1' -t foo -s test -r '10' | grep "Write the introductory message for the patch series." Write the introductory message for the patch series. single rev + flag $ hg email --date '1980-1-1 0:1' -t foo -s test -r '10' --intro | grep "Write the introductory message for the patch series." Write the introductory message for the patch series. Multi rev $ hg email --date '1980-1-1 0:1' -t foo -s test -r '9::' | grep "Write the introductory message for the patch series." Write the introductory message for the patch series. Multi rev + flag $ hg email --date '1980-1-1 0:1' -t foo -s test -r '9::' --intro | grep "Write the introductory message for the patch series." Write the introductory message for the patch series. bad value setting ----------------- $ echo 'intro=mpmwearaclownnose' >> $HGRCPATH single rev $ hg email --date '1980-1-1 0:1' -v -t foo -s test -r '10' From [test]: test this patch series consists of 1 patches. warning: invalid patchbomb.intro value "mpmwearaclownnose" (should be one of always, never, auto) -f test foo MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: [PATCH] test X-Mercurial-Node: 3b6f1ec9dde933a40a115a7990f8b320477231af X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: <3b6f1ec9dde933a40a11*> (glob) X-Mercurial-Series-Id: <3b6f1ec9dde933a40a11.*> (glob) User-Agent: Mercurial-patchbomb/* (glob) Date: Tue, 01 Jan 1980 00:01:00 +0000 From: test To: foo # HG changeset patch # User test # Date 5 0 # Thu Jan 01 00:00:05 1970 +0000 # Branch test # Node ID 3b6f1ec9dde933a40a115a7990f8b320477231af # Parent 2f9fa9b998c5fe3ac2bd9a2b14bfcbeecbc7c268 dd diff -r 2f9fa9b998c5 -r 3b6f1ec9dde9 d --- a/d Thu Jan 01 00:00:04 1970 +0000 +++ b/d Thu Jan 01 00:00:05 1970 +0000 @@ -1,1 +1,2 @@ d +d sending [PATCH] test ... sending mail: $TESTTMP/t2/pretendmail.sh -f test foo Test pull url header ================================= basic version $ echo 'intro=auto' >> $HGRCPATH $ echo "publicurl=$TESTTMP/t2" >> $HGRCPATH $ hg email --date '1980-1-1 0:1' -t foo -s test -r '10' | grep '^#' abort: public url $TESTTMP/t2 is missing 3b6f1ec9dde9 (use 'hg push $TESTTMP/t2 -r 3b6f1ec9dde9') [1] public missing $ echo 'publicurl=$TESTTMP/missing' >> $HGRCPATH $ hg email --date '1980-1-1 0:1' -t foo -s test -r '10' unable to access public repo: $TESTTMP/missing abort: repository $TESTTMP/missing not found! [255] node missing at public $ hg clone -r '9' . ../t3 adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 3 files new changesets 8580ff50825a:2f9fa9b998c5 updating to branch test 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 'publicurl=$TESTTMP/t3' >> $HGRCPATH $ hg email --date '1980-1-1 0:1' -t foo -s test -r '10' abort: public url $TESTTMP/t3 is missing 3b6f1ec9dde9 (use 'hg push $TESTTMP/t3 -r 3b6f1ec9dde9') [255] multiple heads are missing at public $ hg email --date '1980-1-1 0:1' -t foo -s test -r '2+10' abort: public "$TESTTMP/t3" is missing ff2c9fa2018b and 1 others (use 'hg push $TESTTMP/t3 -r ff2c9fa2018b -r 3b6f1ec9dde9') [255] #endif mercurial-4.5.3/tests/fakedirstatewritetime.py0000644015407300116100000000476413261161234021524 0ustar augieeng00000000000000# extension to emulate invoking 'dirstate.write()' at the time # specified by '[fakedirstatewritetime] fakenow', only when # 'dirstate.write()' is invoked via functions below: # # - 'workingctx._poststatusfixup()' (= 'repo.status()') # - 'committablectx.markcommitted()' from __future__ import absolute_import from mercurial import ( context, dirstate, extensions, policy, registrar, util, ) configtable = {} configitem = registrar.configitem(configtable) configitem('fakedirstatewritetime', 'fakenow', default=None, ) parsers = policy.importmod(r'parsers') def pack_dirstate(fakenow, orig, dmap, copymap, pl, now): # execute what original parsers.pack_dirstate should do actually # for consistency actualnow = int(now) for f, e in dmap.iteritems(): if e[0] == 'n' and e[3] == actualnow: e = parsers.dirstatetuple(e[0], e[1], e[2], -1) dmap[f] = e return orig(dmap, copymap, pl, fakenow) def fakewrite(ui, func): # fake "now" of 'pack_dirstate' only if it is invoked while 'func' fakenow = ui.config('fakedirstatewritetime', 'fakenow') if not fakenow: # Execute original one, if fakenow isn't configured. This is # useful to prevent subrepos from executing replaced one, # because replacing 'parsers.pack_dirstate' is also effective # in subrepos. return func() # parsing 'fakenow' in YYYYmmddHHMM format makes comparison between # 'fakenow' value and 'touch -t YYYYmmddHHMM' argument easy fakenow = util.parsedate(fakenow, ['%Y%m%d%H%M'])[0] orig_pack_dirstate = parsers.pack_dirstate orig_dirstate_getfsnow = dirstate._getfsnow wrapper = lambda *args: pack_dirstate(fakenow, orig_pack_dirstate, *args) parsers.pack_dirstate = wrapper dirstate._getfsnow = lambda *args: fakenow try: return func() finally: parsers.pack_dirstate = orig_pack_dirstate dirstate._getfsnow = orig_dirstate_getfsnow def _poststatusfixup(orig, workingctx, status, fixup): ui = workingctx.repo().ui return fakewrite(ui, lambda : orig(workingctx, status, fixup)) def markcommitted(orig, committablectx, node): ui = committablectx.repo().ui return fakewrite(ui, lambda : orig(committablectx, node)) def extsetup(ui): extensions.wrapfunction(context.workingctx, '_poststatusfixup', _poststatusfixup) extensions.wrapfunction(context.committablectx, 'markcommitted', markcommitted) mercurial-4.5.3/tests/test-gendoc-sv.t0000644015407300116100000000012413261161234017563 0ustar augieeng00000000000000#require docutils gettext $ $TESTDIR/check-gendoc sv checking for parse errors mercurial-4.5.3/tests/test-revset2.t0000644015407300116100000010167413261161234017304 0ustar augieeng00000000000000 $ HGENCODING=utf-8 $ export HGENCODING $ cat >> $HGRCPATH << EOF > [extensions] > drawdag=$TESTDIR/drawdag.py > EOF $ try() { > hg debugrevspec --debug "$@" > } $ log() { > hg log --template '{rev}\n' -r "$1" > } $ hg init repo $ cd repo $ echo a > a $ hg branch a marked working directory as branch a (branches are permanent and global, did you want a bookmark?) $ hg ci -Aqm0 $ echo b > b $ hg branch b marked working directory as branch b $ hg ci -Aqm1 $ rm a $ hg branch a-b-c- marked working directory as branch a-b-c- $ hg ci -Aqm2 -u Bob $ hg log -r "extra('branch', 'a-b-c-')" --template '{rev}\n' 2 $ hg log -r "extra('branch')" --template '{rev}\n' 0 1 2 $ hg log -r "extra('branch', 're:a')" --template '{rev} {branch}\n' 0 a 2 a-b-c- $ hg co 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg branch +a+b+c+ marked working directory as branch +a+b+c+ $ hg ci -Aqm3 $ hg co 2 # interleave 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo bb > b $ hg branch -- -a-b-c- marked working directory as branch -a-b-c- $ hg ci -Aqm4 -d "May 12 2005" $ hg co 3 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg branch !a/b/c/ marked working directory as branch !a/b/c/ $ hg ci -Aqm"5 bug" $ hg merge 4 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg branch _a_b_c_ marked working directory as branch _a_b_c_ $ hg ci -Aqm"6 issue619" $ hg branch .a.b.c. marked working directory as branch .a.b.c. $ hg ci -Aqm7 $ hg branch all marked working directory as branch all $ hg co 4 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg branch é marked working directory as branch \xc3\xa9 (esc) $ hg ci -Aqm9 $ hg tag -r6 1.0 $ hg bookmark -r6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx $ hg clone --quiet -U -r 7 . ../remote1 $ hg clone --quiet -U -r 8 . ../remote2 $ echo "[paths]" >> .hg/hgrc $ echo "default = ../remote1" >> .hg/hgrc test subtracting something from an addset $ log '(outgoing() or removes(a)) - removes(a)' 8 9 test intersecting something with an addset $ log 'parents(outgoing() or removes(a))' 1 4 5 8 test that `or` operation combines elements in the right order: $ log '3:4 or 2:5' 3 4 2 5 $ log '3:4 or 5:2' 3 4 5 2 $ log 'sort(3:4 or 2:5)' 2 3 4 5 $ log 'sort(3:4 or 5:2)' 2 3 4 5 test that more than one `-r`s are combined in the right order and deduplicated: $ hg log -T '{rev}\n' -r 3 -r 3 -r 4 -r 5:2 -r 'ancestors(4)' 3 4 5 2 0 1 test that `or` operation skips duplicated revisions from right-hand side $ try 'reverse(1::5) or ancestors(4)' (or (list (func (symbol 'reverse') (dagrange (symbol '1') (symbol '5'))) (func (symbol 'ancestors') (symbol '4')))) * set: , > 5 3 1 0 2 4 $ try 'sort(ancestors(4) or reverse(1::5))' (func (symbol 'sort') (or (list (func (symbol 'ancestors') (symbol '4')) (func (symbol 'reverse') (dagrange (symbol '1') (symbol '5')))))) * set: , > 0 1 2 3 4 5 test optimization of trivial `or` operation $ try --optimize '0|(1)|"2"|-2|tip|null' (or (list (symbol '0') (group (symbol '1')) (string '2') (negate (symbol '2')) (symbol 'tip') (symbol 'null'))) * optimized: (func (symbol '_list') (string '0\x001\x002\x00-2\x00tip\x00null')) * set: 0 1 2 8 9 -1 $ try --optimize '0|1|2:3' (or (list (symbol '0') (symbol '1') (range (symbol '2') (symbol '3')))) * optimized: (or (list (func (symbol '_list') (string '0\x001')) (range (symbol '2') (symbol '3')))) * set: , > 0 1 2 3 $ try --optimize '0:1|2|3:4|5|6' (or (list (range (symbol '0') (symbol '1')) (symbol '2') (range (symbol '3') (symbol '4')) (symbol '5') (symbol '6'))) * optimized: (or (list (range (symbol '0') (symbol '1')) (symbol '2') (range (symbol '3') (symbol '4')) (func (symbol '_list') (string '5\x006')))) * set: , >, , >> 0 1 2 3 4 5 6 unoptimized `or` looks like this $ try --no-optimized -p analyzed '0|1|2|3|4' * analyzed: (or (list (symbol '0') (symbol '1') (symbol '2') (symbol '3') (symbol '4'))) * set: , >, , , >>> 0 1 2 3 4 test that `_list` should be narrowed by provided `subset` $ log '0:2 and (null|1|2|3)' 1 2 test that `_list` should remove duplicates $ log '0|1|2|1|2|-1|tip' 0 1 2 9 test unknown revision in `_list` $ log '0|unknown' abort: unknown revision 'unknown'! [255] test integer range in `_list` $ log '-1|-10' 9 0 $ log '-10|-11' abort: unknown revision '-11'! [255] $ log '9|10' abort: unknown revision '10'! [255] test '0000' != '0' in `_list` $ log '0|0000' 0 -1 test ',' in `_list` $ log '0,1' hg: parse error: can't use a list in this context (see hg help "revsets.x or y") [255] $ try '0,1,2' (list (symbol '0') (symbol '1') (symbol '2')) hg: parse error: can't use a list in this context (see hg help "revsets.x or y") [255] test that chained `or` operations make balanced addsets $ try '0:1|1:2|2:3|3:4|4:5' (or (list (range (symbol '0') (symbol '1')) (range (symbol '1') (symbol '2')) (range (symbol '2') (symbol '3')) (range (symbol '3') (symbol '4')) (range (symbol '4') (symbol '5')))) * set: , >, , , >>> 0 1 2 3 4 5 no crash by empty group "()" while optimizing `or` operations $ try --optimize '0|()' (or (list (symbol '0') (group None))) * optimized: (or (list (symbol '0') None)) hg: parse error: missing argument [255] test that chained `or` operations never eat up stack (issue4624) (uses `0:1` instead of `0` to avoid future optimization of trivial revisions) $ hg log -T '{rev}\n' -r `$PYTHON -c "print '+'.join(['0:1'] * 500)"` 0 1 test that repeated `-r` options never eat up stack (issue4565) (uses `-r 0::1` to avoid possible optimization at old-style parser) $ hg log -T '{rev}\n' `$PYTHON -c "for i in xrange(500): print '-r 0::1 ',"` 0 1 check that conversion to only works $ try --optimize '::3 - ::1' (minus (dagrangepre (symbol '3')) (dagrangepre (symbol '1'))) * optimized: (func (symbol 'only') (list (symbol '3') (symbol '1'))) * set: 3 $ try --optimize 'ancestors(1) - ancestors(3)' (minus (func (symbol 'ancestors') (symbol '1')) (func (symbol 'ancestors') (symbol '3'))) * optimized: (func (symbol 'only') (list (symbol '1') (symbol '3'))) * set: $ try --optimize 'not ::2 and ::6' (and (not (dagrangepre (symbol '2'))) (dagrangepre (symbol '6'))) * optimized: (func (symbol 'only') (list (symbol '6') (symbol '2'))) * set: 3 4 5 6 $ try --optimize 'ancestors(6) and not ancestors(4)' (and (func (symbol 'ancestors') (symbol '6')) (not (func (symbol 'ancestors') (symbol '4')))) * optimized: (func (symbol 'only') (list (symbol '6') (symbol '4'))) * set: 3 5 6 no crash by empty group "()" while optimizing to "only()" $ try --optimize '::1 and ()' (and (dagrangepre (symbol '1')) (group None)) * optimized: (andsmally (func (symbol 'ancestors') (symbol '1')) None) hg: parse error: missing argument [255] optimization to only() works only if ancestors() takes only one argument $ hg debugrevspec -p optimized 'ancestors(6) - ancestors(4, 1)' * optimized: (difference (func (symbol 'ancestors') (symbol '6')) (func (symbol 'ancestors') (list (symbol '4') (symbol '1')))) 0 1 3 5 6 $ hg debugrevspec -p optimized 'ancestors(6, 1) - ancestors(4)' * optimized: (difference (func (symbol 'ancestors') (list (symbol '6') (symbol '1'))) (func (symbol 'ancestors') (symbol '4'))) 5 6 optimization disabled if keyword arguments passed (because we're too lazy to support it) $ hg debugrevspec -p optimized 'ancestors(set=6) - ancestors(set=4)' * optimized: (difference (func (symbol 'ancestors') (keyvalue (symbol 'set') (symbol '6'))) (func (symbol 'ancestors') (keyvalue (symbol 'set') (symbol '4')))) 3 5 6 invalid function call should not be optimized to only() $ log '"ancestors"(6) and not ancestors(4)' hg: parse error: not a symbol [255] $ log 'ancestors(6) and not "ancestors"(4)' hg: parse error: not a symbol [255] we can use patterns when searching for tags $ log 'tag("1..*")' abort: tag '1..*' does not exist! [255] $ log 'tag("re:1..*")' 6 $ log 'tag("re:[0-9].[0-9]")' 6 $ log 'tag("literal:1.0")' 6 $ log 'tag("re:0..*")' $ log 'tag(unknown)' abort: tag 'unknown' does not exist! [255] $ log 'tag("re:unknown")' $ log 'present(tag("unknown"))' $ log 'present(tag("re:unknown"))' $ log 'branch(unknown)' abort: unknown revision 'unknown'! [255] $ log 'branch("literal:unknown")' abort: branch 'unknown' does not exist! [255] $ log 'branch("re:unknown")' $ log 'present(branch("unknown"))' $ log 'present(branch("re:unknown"))' $ log 'user(bob)' 2 $ log '4::8' 4 8 $ log '4:8' 4 5 6 7 8 $ log 'sort(!merge() & (modifies(b) | user(bob) | keyword(bug) | keyword(issue) & 1::9), "-date")' 4 2 5 $ log 'not 0 and 0:2' 1 2 $ log 'not 1 and 0:2' 0 2 $ log 'not 2 and 0:2' 0 1 $ log '(1 and 2)::' $ log '(1 and 2):' $ log '(1 and 2):3' $ log 'sort(head(), -rev)' 9 7 6 5 4 3 2 1 0 $ log '4::8 - 8' 4 matching() should preserve the order of the input set: $ log '(2 or 3 or 1) and matching(1 or 2 or 3)' 2 3 1 $ log 'named("unknown")' abort: namespace 'unknown' does not exist! [255] $ log 'named("re:unknown")' abort: no namespace exists that match 'unknown'! [255] $ log 'present(named("unknown"))' $ log 'present(named("re:unknown"))' $ log 'tag()' 6 $ log 'named("tags")' 6 issue2437 $ log '3 and p1(5)' 3 $ log '4 and p2(6)' 4 $ log '1 and parents(:2)' 1 $ log '2 and children(1:)' 2 $ log 'roots(all()) or roots(all())' 0 $ hg debugrevspec 'roots(all()) or roots(all())' 0 $ log 'heads(branch(é)) or heads(branch(é))' 9 $ log 'ancestors(8) and (heads(branch("-a-b-c-")) or heads(branch(é)))' 4 issue2654: report a parse error if the revset was not completely parsed $ log '1 OR 2' hg: parse error at 2: invalid token [255] or operator should preserve ordering: $ log 'reverse(2::4) or tip' 4 2 9 parentrevspec $ log 'merge()^0' 6 $ log 'merge()^' 5 $ log 'merge()^1' 5 $ log 'merge()^2' 4 $ log '(not merge())^2' $ log 'merge()^^' 3 $ log 'merge()^1^' 3 $ log 'merge()^^^' 1 $ hg debugrevspec -s '(merge() | 0)~-1' * set: 1 7 $ log 'merge()~-1' 7 $ log 'tip~-1' $ log '(tip | merge())~-1' 7 $ log 'merge()~0' 6 $ log 'merge()~1' 5 $ log 'merge()~2' 3 $ log 'merge()~2^1' 1 $ log 'merge()~3' 1 $ log '(-3:tip)^' 4 6 8 $ log 'tip^foo' hg: parse error: ^ expects a number 0, 1, or 2 [255] $ log 'branchpoint()~-1' abort: revision in set has more than one child! [255] Bogus function gets suggestions $ log 'add()' hg: parse error: unknown identifier: add (did you mean adds?) [255] $ log 'added()' hg: parse error: unknown identifier: added (did you mean adds?) [255] $ log 'remo()' hg: parse error: unknown identifier: remo (did you mean one of remote, removes?) [255] $ log 'babar()' hg: parse error: unknown identifier: babar [255] Bogus function with a similar internal name doesn't suggest the internal name $ log 'matches()' hg: parse error: unknown identifier: matches (did you mean matching?) [255] Undocumented functions aren't suggested as similar either $ log 'tagged2()' hg: parse error: unknown identifier: tagged2 [255] multiple revspecs $ hg log -r 'tip~1:tip' -r 'tip~2:tip~1' --template '{rev}\n' 8 9 4 5 6 7 test usage in revpair (with "+") (real pair) $ hg diff -r 'tip^^' -r 'tip' diff -r 2326846efdab -r 24286f4ae135 .hgtags --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 $ hg diff -r 'tip^^::tip' diff -r 2326846efdab -r 24286f4ae135 .hgtags --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 (single rev) $ hg diff -r 'tip^' -r 'tip^' $ hg diff -r 'tip^:tip^' (single rev that does not looks like a range) $ hg diff -r 'tip^::tip^ or tip^' diff -r d5d0dcbdc4d9 .hgtags --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgtags * (glob) @@ -0,0 +1,1 @@ +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 $ hg diff -r 'tip^ or tip^' diff -r d5d0dcbdc4d9 .hgtags --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgtags * (glob) @@ -0,0 +1,1 @@ +e0cc66ef77e8b6f711815af4e001a6594fde3ba5 1.0 (no rev) $ hg diff -r 'author("babar") or author("celeste")' abort: empty revision range [255] aliases: $ echo '[revsetalias]' >> .hg/hgrc $ echo 'm = merge()' >> .hg/hgrc (revset aliases can override builtin revsets) $ echo 'p2($1) = p1($1)' >> .hg/hgrc $ echo 'sincem = descendants(m)' >> .hg/hgrc $ echo 'd($1) = reverse(sort($1, date))' >> .hg/hgrc $ echo 'rs(ARG1, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc $ echo 'rs4(ARG1, ARGA, ARGB, ARG2) = reverse(sort(ARG1, ARG2))' >> .hg/hgrc $ try m (symbol 'm') * expanded: (func (symbol 'merge') None) * set: , > 6 $ HGPLAIN=1 $ export HGPLAIN $ try m (symbol 'm') abort: unknown revision 'm'! [255] $ HGPLAINEXCEPT=revsetalias $ export HGPLAINEXCEPT $ try m (symbol 'm') * expanded: (func (symbol 'merge') None) * set: , > 6 $ unset HGPLAIN $ unset HGPLAINEXCEPT $ try 'p2(.)' (func (symbol 'p2') (symbol '.')) * expanded: (func (symbol 'p1') (symbol '.')) * set: 8 $ HGPLAIN=1 $ export HGPLAIN $ try 'p2(.)' (func (symbol 'p2') (symbol '.')) * set: $ HGPLAINEXCEPT=revsetalias $ export HGPLAINEXCEPT $ try 'p2(.)' (func (symbol 'p2') (symbol '.')) * expanded: (func (symbol 'p1') (symbol '.')) * set: 8 $ unset HGPLAIN $ unset HGPLAINEXCEPT test alias recursion $ try sincem (symbol 'sincem') * expanded: (func (symbol 'descendants') (func (symbol 'merge') None)) * set: 6 7 test infinite recursion $ echo 'recurse1 = recurse2' >> .hg/hgrc $ echo 'recurse2 = recurse1' >> .hg/hgrc $ try recurse1 (symbol 'recurse1') hg: parse error: infinite expansion of revset alias "recurse1" detected [255] $ echo 'level1($1, $2) = $1 or $2' >> .hg/hgrc $ echo 'level2($1, $2) = level1($2, $1)' >> .hg/hgrc $ try "level2(level1(1, 2), 3)" (func (symbol 'level2') (list (func (symbol 'level1') (list (symbol '1') (symbol '2'))) (symbol '3'))) * expanded: (or (list (symbol '3') (or (list (symbol '1') (symbol '2'))))) * set: , > 3 1 2 test nesting and variable passing $ echo 'nested($1) = nested2($1)' >> .hg/hgrc $ echo 'nested2($1) = nested3($1)' >> .hg/hgrc $ echo 'nested3($1) = max($1)' >> .hg/hgrc $ try 'nested(2:5)' (func (symbol 'nested') (range (symbol '2') (symbol '5'))) * expanded: (func (symbol 'max') (range (symbol '2') (symbol '5'))) * set: , >> 5 test chained `or` operations are flattened at parsing phase $ echo 'chainedorops($1, $2, $3) = $1|$2|$3' >> .hg/hgrc $ try 'chainedorops(0:1, 1:2, 2:3)' (func (symbol 'chainedorops') (list (range (symbol '0') (symbol '1')) (range (symbol '1') (symbol '2')) (range (symbol '2') (symbol '3')))) * expanded: (or (list (range (symbol '0') (symbol '1')) (range (symbol '1') (symbol '2')) (range (symbol '2') (symbol '3')))) * set: , , >> 0 1 2 3 test variable isolation, variable placeholders are rewritten as string then parsed and matched again as string. Check they do not leak too far away. $ echo 'injectparamasstring = max("$1")' >> .hg/hgrc $ echo 'callinjection($1) = descendants(injectparamasstring)' >> .hg/hgrc $ try 'callinjection(2:5)' (func (symbol 'callinjection') (range (symbol '2') (symbol '5'))) * expanded: (func (symbol 'descendants') (func (symbol 'max') (string '$1'))) abort: unknown revision '$1'! [255] test scope of alias expansion: 'universe' is expanded prior to 'shadowall(0)', but 'all()' should never be substituted to '0()'. $ echo 'universe = all()' >> .hg/hgrc $ echo 'shadowall(all) = all and universe' >> .hg/hgrc $ try 'shadowall(0)' (func (symbol 'shadowall') (symbol '0')) * expanded: (and (symbol '0') (func (symbol 'all') None)) * set: , > 0 test unknown reference: $ try "unknownref(0)" --config 'revsetalias.unknownref($1)=$1:$2' (func (symbol 'unknownref') (symbol '0')) abort: bad definition of revset alias "unknownref": invalid symbol '$2' [255] $ hg debugrevspec --debug --config revsetalias.anotherbadone='branch(' "tip" (symbol 'tip') warning: bad definition of revset alias "anotherbadone": at 7: not a prefix: end * set: 9 $ try 'tip' (symbol 'tip') * set: 9 $ hg debugrevspec --debug --config revsetalias.'bad name'='tip' "tip" (symbol 'tip') warning: bad declaration of revset alias "bad name": at 4: invalid token * set: 9 $ echo 'strictreplacing($1, $10) = $10 or desc("$1")' >> .hg/hgrc $ try 'strictreplacing("foo", tip)' (func (symbol 'strictreplacing') (list (string 'foo') (symbol 'tip'))) * expanded: (or (list (symbol 'tip') (func (symbol 'desc') (string '$1')))) * set: , , >> 9 $ try 'd(2:5)' (func (symbol 'd') (range (symbol '2') (symbol '5'))) * expanded: (func (symbol 'reverse') (func (symbol 'sort') (list (range (symbol '2') (symbol '5')) (symbol 'date')))) * set: 4 5 3 2 $ try 'rs(2 or 3, date)' (func (symbol 'rs') (list (or (list (symbol '2') (symbol '3'))) (symbol 'date'))) * expanded: (func (symbol 'reverse') (func (symbol 'sort') (list (or (list (symbol '2') (symbol '3'))) (symbol 'date')))) * set: 3 2 $ try 'rs()' (func (symbol 'rs') None) hg: parse error: invalid number of arguments: 0 [255] $ try 'rs(2)' (func (symbol 'rs') (symbol '2')) hg: parse error: invalid number of arguments: 1 [255] $ try 'rs(2, data, 7)' (func (symbol 'rs') (list (symbol '2') (symbol 'data') (symbol '7'))) hg: parse error: invalid number of arguments: 3 [255] $ try 'rs4(2 or 3, x, x, date)' (func (symbol 'rs4') (list (or (list (symbol '2') (symbol '3'))) (symbol 'x') (symbol 'x') (symbol 'date'))) * expanded: (func (symbol 'reverse') (func (symbol 'sort') (list (or (list (symbol '2') (symbol '3'))) (symbol 'date')))) * set: 3 2 issue4553: check that revset aliases override existing hash prefix $ hg log -qr e 6:e0cc66ef77e8 $ hg log -qr e --config revsetalias.e="all()" 0:2785f51eece5 1:d75937da8da0 2:5ed5505e9f1c 3:8528aa5637f2 4:2326846efdab 5:904fa392b941 6:e0cc66ef77e8 7:013af1973af4 8:d5d0dcbdc4d9 9:24286f4ae135 $ hg log -qr e: --config revsetalias.e="0" 0:2785f51eece5 1:d75937da8da0 2:5ed5505e9f1c 3:8528aa5637f2 4:2326846efdab 5:904fa392b941 6:e0cc66ef77e8 7:013af1973af4 8:d5d0dcbdc4d9 9:24286f4ae135 $ hg log -qr :e --config revsetalias.e="9" 0:2785f51eece5 1:d75937da8da0 2:5ed5505e9f1c 3:8528aa5637f2 4:2326846efdab 5:904fa392b941 6:e0cc66ef77e8 7:013af1973af4 8:d5d0dcbdc4d9 9:24286f4ae135 $ hg log -qr e: 6:e0cc66ef77e8 7:013af1973af4 8:d5d0dcbdc4d9 9:24286f4ae135 $ hg log -qr :e 0:2785f51eece5 1:d75937da8da0 2:5ed5505e9f1c 3:8528aa5637f2 4:2326846efdab 5:904fa392b941 6:e0cc66ef77e8 issue2549 - correct optimizations $ try 'limit(1 or 2 or 3, 2) and not 2' (and (func (symbol 'limit') (list (or (list (symbol '1') (symbol '2') (symbol '3'))) (symbol '2'))) (not (symbol '2'))) * set: , >> 1 $ try 'max(1 or 2) and not 2' (and (func (symbol 'max') (or (list (symbol '1') (symbol '2')))) (not (symbol '2'))) * set: , >>, >> $ try 'min(1 or 2) and not 1' (and (func (symbol 'min') (or (list (symbol '1') (symbol '2')))) (not (symbol '1'))) * set: , >>, >> $ try 'last(1 or 2, 1) and not 2' (and (func (symbol 'last') (list (or (list (symbol '1') (symbol '2'))) (symbol '1'))) (not (symbol '2'))) * set: , >> issue4289 - ordering of built-ins $ hg log -M -q -r 3:2 3:8528aa5637f2 2:5ed5505e9f1c test revsets started with 40-chars hash (issue3669) $ ISSUE3669_TIP=`hg tip --template '{node}'` $ hg log -r "${ISSUE3669_TIP}" --template '{rev}\n' 9 $ hg log -r "${ISSUE3669_TIP}^" --template '{rev}\n' 8 test or-ed indirect predicates (issue3775) $ log '6 or 6^1' | sort 5 6 $ log '6^1 or 6' | sort 5 6 $ log '4 or 4~1' | sort 2 4 $ log '4~1 or 4' | sort 2 4 $ log '(0 or 2):(4 or 6) or 0 or 6' | sort 0 1 2 3 4 5 6 $ log '0 or 6 or (0 or 2):(4 or 6)' | sort 0 1 2 3 4 5 6 tests for 'remote()' predicate: #. (csets in remote) (id) (remote) 1. less than local current branch "default" 2. same with local specified "default" 3. more than local specified specified $ hg clone --quiet -U . ../remote3 $ cd ../remote3 $ hg update -q 7 $ echo r > r $ hg ci -Aqm 10 $ log 'remote()' 7 $ log 'remote("a-b-c-")' 2 $ cd ../repo $ log 'remote(".a.b.c.", "../remote3")' tests for concatenation of strings/symbols by "##" $ try "278 ## '5f5' ## 1ee ## 'ce5'" (_concat (_concat (_concat (symbol '278') (string '5f5')) (symbol '1ee')) (string 'ce5')) * concatenated: (string '2785f51eece5') * set: 0 $ echo 'cat4($1, $2, $3, $4) = $1 ## $2 ## $3 ## $4' >> .hg/hgrc $ try "cat4(278, '5f5', 1ee, 'ce5')" (func (symbol 'cat4') (list (symbol '278') (string '5f5') (symbol '1ee') (string 'ce5'))) * expanded: (_concat (_concat (_concat (symbol '278') (string '5f5')) (symbol '1ee')) (string 'ce5')) * concatenated: (string '2785f51eece5') * set: 0 (check concatenation in alias nesting) $ echo 'cat2($1, $2) = $1 ## $2' >> .hg/hgrc $ echo 'cat2x2($1, $2, $3, $4) = cat2($1 ## $2, $3 ## $4)' >> .hg/hgrc $ log "cat2x2(278, '5f5', 1ee, 'ce5')" 0 (check operator priority) $ echo 'cat2n2($1, $2, $3, $4) = $1 ## $2 or $3 ## $4~2' >> .hg/hgrc $ log "cat2n2(2785f5, 1eece5, 24286f, 4ae135)" 0 4 $ cd .. prepare repository that has "default" branches of multiple roots $ hg init namedbranch $ cd namedbranch $ echo default0 >> a $ hg ci -Aqm0 $ echo default1 >> a $ hg ci -m1 $ hg branch -q stable $ echo stable2 >> a $ hg ci -m2 $ echo stable3 >> a $ hg ci -m3 $ hg update -q null $ echo default4 >> a $ hg ci -Aqm4 $ echo default5 >> a $ hg ci -m5 "null" revision belongs to "default" branch (issue4683) $ log 'branch(null)' 0 1 4 5 "null" revision belongs to "default" branch, but it shouldn't appear in set unless explicitly specified (issue4682) $ log 'children(branch(default))' 1 2 5 $ cd .. test author/desc/keyword in problematic encoding # unicode: cp932: # u30A2 0x83 0x41(= 'A') # u30C2 0x83 0x61(= 'a') $ hg init problematicencoding $ cd problematicencoding $ $PYTHON > setup.sh < print u''' > echo a > text > hg add text > hg --encoding utf-8 commit -u '\u30A2' -m none > echo b > text > hg --encoding utf-8 commit -u '\u30C2' -m none > echo c > text > hg --encoding utf-8 commit -u none -m '\u30A2' > echo d > text > hg --encoding utf-8 commit -u none -m '\u30C2' > '''.encode('utf-8') > EOF $ sh < setup.sh test in problematic encoding $ $PYTHON > test.sh < print u''' > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30A2)' > echo ==== > hg --encoding cp932 log --template '{rev}\\n' -r 'author(\u30C2)' > echo ==== > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30A2)' > echo ==== > hg --encoding cp932 log --template '{rev}\\n' -r 'desc(\u30C2)' > echo ==== > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30A2)' > echo ==== > hg --encoding cp932 log --template '{rev}\\n' -r 'keyword(\u30C2)' > '''.encode('cp932') > EOF $ sh < test.sh 0 ==== 1 ==== 2 ==== 3 ==== 0 2 ==== 1 3 test error message of bad revset $ hg log -r 'foo\\' hg: parse error at 3: syntax error in revset 'foo\\' [255] $ cd .. Test that revset predicate of extension isn't loaded at failure of loading it $ cd repo $ cat < $TESTTMP/custompredicate.py > from mercurial import error, registrar, revset > > revsetpredicate = registrar.revsetpredicate() > > @revsetpredicate('custom1()') > def custom1(repo, subset, x): > return revset.baseset([1]) > > raise error.Abort('intentional failure of loading extension') > EOF $ cat < .hg/hgrc > [extensions] > custompredicate = $TESTTMP/custompredicate.py > EOF $ hg debugrevspec "custom1()" *** failed to import extension custompredicate from $TESTTMP/custompredicate.py: intentional failure of loading extension hg: parse error: unknown identifier: custom1 [255] Test repo.anyrevs with customized revset overrides $ cat > $TESTTMP/printprevset.py < from mercurial import encoding, registrar > cmdtable = {} > command = registrar.command(cmdtable) > @command('printprevset') > def printprevset(ui, repo): > alias = {} > p = encoding.environ.get('P') > if p: > alias['P'] = p > revs = repo.anyrevs(['P'], user=True, localalias=alias) > ui.write('P=%r\n' % list(revs)) > EOF $ cat >> .hg/hgrc < custompredicate = ! > printprevset = $TESTTMP/printprevset.py > EOF $ hg --config revsetalias.P=1 printprevset P=[1] $ P=3 hg --config revsetalias.P=2 printprevset P=[3] $ cd .. Test obsstore related revsets $ hg init repo1 $ cd repo1 $ cat <> .hg/hgrc > [experimental] > evolution.createmarkers=True > EOF $ hg debugdrawdag <<'EOS' > F G > |/ # split: B -> E, F > B C D E # amend: B -> C -> D > \|/ | # amend: F -> G > A A Z # amend: A -> Z > EOS 3 new orphan changesets 3 new content-divergent changesets $ hg log -r 'successors(Z)' -T '{desc}\n' Z $ hg log -r 'successors(F)' -T '{desc}\n' F G $ hg tag --remove --local C D E F G $ hg log -r 'successors(B)' -T '{desc}\n' B D E G $ hg log -r 'successors(B)' -T '{desc}\n' --hidden B C D E F G $ hg log -r 'successors(B)-obsolete()' -T '{desc}\n' --hidden D E G $ hg log -r 'successors(B+A)-contentdivergent()' -T '{desc}\n' A Z B $ hg log -r 'successors(B+A)-contentdivergent()-obsolete()' -T '{desc}\n' Z Test `draft() & ::x` optimization $ hg init $TESTTMP/repo2 $ cd $TESTTMP/repo2 $ hg debugdrawdag <<'EOS' > P5 S1 > | | > S2 | D3 > \|/ > P4 > | > P3 D2 > | | > P2 D1 > |/ > P1 > | > P0 > EOS $ hg phase --public -r P5 $ hg phase --force --secret -r S1+S2 $ hg log -G -T '{rev} {desc} {phase}' -r 'sort(all(), topo, topo.firstbranch=P5)' o 8 P5 public | | o 10 S1 secret | | | o 7 D3 draft |/ | o 9 S2 secret |/ o 6 P4 public | o 5 P3 public | o 3 P2 public | | o 4 D2 draft | | | o 2 D1 draft |/ o 1 P1 public | o 0 P0 public $ hg debugrevspec --verify -p analyzed -p optimized 'draft() & ::(((S1+D1+P5)-D3)+S2)' * analyzed: (and (func (symbol 'draft') None) (func (symbol 'ancestors') (or (list (and (or (list (symbol 'S1') (symbol 'D1') (symbol 'P5'))) (not (symbol 'D3'))) (symbol 'S2'))))) * optimized: (func (symbol '_phaseandancestors') (list (symbol 'draft') (or (list (difference (func (symbol '_list') (string 'S1\x00D1\x00P5')) (symbol 'D3')) (symbol 'S2'))))) $ hg debugrevspec --verify -p analyzed -p optimized 'secret() & ::9' * analyzed: (and (func (symbol 'secret') None) (func (symbol 'ancestors') (symbol '9'))) * optimized: (func (symbol '_phaseandancestors') (list (symbol 'secret') (symbol '9'))) $ hg debugrevspec --verify -p analyzed -p optimized '7 & ( (not public()) & ::(tag()) )' * analyzed: (and (symbol '7') (and (not (func (symbol 'public') None)) (func (symbol 'ancestors') (func (symbol 'tag') None)))) * optimized: (and (symbol '7') (func (symbol '_phaseandancestors') (list (symbol '_notpublic') (func (symbol 'tag') None)))) $ hg debugrevspec --verify -p optimized '(not public()) & ancestors(S1+D2+P5, 1)' * optimized: (and (func (symbol '_notpublic') None) (func (symbol 'ancestors') (list (func (symbol '_list') (string 'S1\x00D2\x00P5')) (symbol '1')))) $ hg debugrevspec --verify -p optimized '(not public()) & ancestors(S1+D2+P5, depth=1)' * optimized: (and (func (symbol '_notpublic') None) (func (symbol 'ancestors') (list (func (symbol '_list') (string 'S1\x00D2\x00P5')) (keyvalue (symbol 'depth') (symbol '1'))))) mercurial-4.5.3/tests/test-histedit-bookmark-motion.t0000644015407300116100000001133613261161234022630 0ustar augieeng00000000000000 $ . "$TESTDIR/histedit-helpers.sh" $ cat >> $HGRCPATH < [extensions] > histedit= > EOF $ hg init r $ cd r $ for x in a b c d e f ; do > echo $x > $x > hg add $x > hg ci -m $x > done $ hg book -r 1 will-move-backwards $ hg book -r 2 two $ hg book -r 2 also-two $ hg book -r 3 three $ hg book -r 4 four $ hg book -r tip five $ hg log --graph @ changeset: 5:652413bf663e | bookmark: five | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: f | o changeset: 4:e860deea161a | bookmark: four | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: e | o changeset: 3:055a42cdd887 | bookmark: three | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: d | o changeset: 2:177f92b77385 | bookmark: also-two | bookmark: two | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: c | o changeset: 1:d2ae7f538514 | bookmark: will-move-backwards | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: b | o changeset: 0:cb9a9f314b8b user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a $ HGEDITOR=cat hg histedit 1 pick d2ae7f538514 1 b pick 177f92b77385 2 c pick 055a42cdd887 3 d pick e860deea161a 4 e pick 652413bf663e 5 f # Edit history between d2ae7f538514 and 652413bf663e # # Commits are listed from least to most recent # # You can reorder changesets by reordering the lines # # Commands: # # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date # $ hg histedit 1 --commands - --verbose << EOF | grep histedit > pick 177f92b77385 2 c > drop d2ae7f538514 1 b > pick 055a42cdd887 3 d > fold e860deea161a 4 e > pick 652413bf663e 5 f > EOF saved backup bundle to $TESTTMP/r/.hg/strip-backup/96e494a2d553-45c027ab-histedit.hg $ hg log --graph @ changeset: 3:cacdfd884a93 | bookmark: five | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: f | o changeset: 2:59d9f330561f | bookmark: four | bookmark: three | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: d | o changeset: 1:b346ab9a313d | bookmark: also-two | bookmark: two | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: c | o changeset: 0:cb9a9f314b8b bookmark: will-move-backwards user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a $ HGEDITOR=cat hg histedit 1 pick b346ab9a313d 1 c pick 59d9f330561f 2 d pick cacdfd884a93 3 f # Edit history between b346ab9a313d and cacdfd884a93 # # Commits are listed from least to most recent # # You can reorder changesets by reordering the lines # # Commands: # # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date # $ hg histedit 1 --commands - --verbose << EOF | grep histedit > pick b346ab9a313d 1 c > pick cacdfd884a93 3 f > pick 59d9f330561f 2 d > EOF saved backup bundle to $TESTTMP/r/.hg/strip-backup/59d9f330561f-073008af-histedit.hg We expect 'five' to stay at tip, since the tipmost bookmark is most likely the useful signal. $ hg log --graph @ changeset: 3:c04e50810e4b | bookmark: five | bookmark: four | bookmark: three | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: d | o changeset: 2:c13eb81022ca | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: f | o changeset: 1:b346ab9a313d | bookmark: also-two | bookmark: two | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: c | o changeset: 0:cb9a9f314b8b bookmark: will-move-backwards user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: a mercurial-4.5.3/tests/test-histedit-templates.t0000644015407300116100000000317213261161234021515 0ustar augieeng00000000000000Testing templating for histedit command Setup $ cat >> $HGRCPATH < [extensions] > histedit= > [experimental] > evolution=createmarkers > EOF $ hg init repo $ cd repo $ for ch in a b c d; do echo foo > $ch; hg commit -Aqm "Added "$ch; done $ hg log -G -T "{rev}:{node|short} {desc}" @ 3:62615734edd5 Added d | o 2:28ad74487de9 Added c | o 1:29becc82797a Added b | o 0:18d04c59bb5d Added a Getting the JSON output for nodechanges $ hg histedit -Tjson --commands - 2>&1 < pick 28ad74487de9 Added c > pick 62615734edd5 Added d > pick 18d04c59bb5d Added a > pick 29becc82797a Added b > EOF [ { "nodechanges": {"18d04c59bb5d2d4090ad9a5b59bd6274adb63add": ["109f8ec895447f81b380ba8d4d8b66539ccdcb94"], "28ad74487de9599d00d81085be739c61fc340652": ["bff9e07c1807942b161dab768aa793b48e9a7f9d"], "29becc82797a4bc11ec8880b58eaecd2ab3e7760": ["f5dcf3b4db23f31f1aacf46c33d1393de303d26f"], "62615734edd52f06b6fb9c2beb429e4fe30d57b8": ["201423b441c84d9e6858daed653e0d22485c1cfa"]} } ] $ hg log -G -T "{rev}:{node|short} {desc}" @ 7:f5dcf3b4db23 Added b | o 6:109f8ec89544 Added a | o 5:201423b441c8 Added d | o 4:bff9e07c1807 Added c $ hg histedit -T "{nodechanges|json}" --commands - 2>&1 < pick bff9e07c1807 Added c > pick 201423b441c8 Added d > pick 109f8ec89544 Added a > roll f5dcf3b4db23 Added b > EOF {"109f8ec895447f81b380ba8d4d8b66539ccdcb94": ["8d01470bfeab64d3de13c49adb79d88790d38396"], "f3ec56a374bdbdf1953cacca505161442c6f3a3e": [], "f5dcf3b4db23f31f1aacf46c33d1393de303d26f": ["8d01470bfeab64d3de13c49adb79d88790d38396"]} (no-eol) mercurial-4.5.3/tests/test-conflict.t0000644015407300116100000001367613261161234017517 0ustar augieeng00000000000000 $ hg init $ cat << EOF > a > Small Mathematical Series. > One > Two > Three > Four > Five > Hop we are done. > EOF $ hg add a $ hg commit -m ancestor $ cat << EOF > a > Small Mathematical Series. > 1 > 2 > 3 > 4 > 5 > Hop we are done. > EOF $ hg commit -m branch1 $ hg co 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat << EOF > a > Small Mathematical Series. > 1 > 2 > 3 > 6 > 8 > Hop we are done. > EOF $ hg commit -m branch2 created new head $ hg merge 1 merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ hg id 618808747361+c0c68e4fe667+ tip $ echo "[commands]" >> $HGRCPATH $ echo "status.verbose=true" >> $HGRCPATH $ hg status M a ? a.orig # The repository is in an unfinished *merge* state. # Unresolved merge conflicts: # # a # # To mark files as resolved: hg resolve --mark FILE # To continue: hg commit # To abort: hg update --clean . (warning: this will discard uncommitted changes) $ cat a Small Mathematical Series. 1 2 3 <<<<<<< working copy: 618808747361 - test: branch2 6 8 ======= 4 5 >>>>>>> merge rev: c0c68e4fe667 - test: branch1 Hop we are done. $ hg status --config commands.status.verbose=0 M a ? a.orig Verify custom conflict markers $ hg up -q --clean . $ cat <> .hg/hgrc > [ui] > mergemarkertemplate = '{author} {rev}' > EOF $ hg merge 1 merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ cat a Small Mathematical Series. 1 2 3 <<<<<<< working copy: test 2 6 8 ======= 4 5 >>>>>>> merge rev: test 1 Hop we are done. Verify line splitting of custom conflict marker which causes multiple lines $ hg up -q --clean . $ cat >> .hg/hgrc < [ui] > mergemarkertemplate={author} {rev}\nfoo\nbar\nbaz > EOF $ hg -q merge 1 warning: conflicts while merging a! (edit, then use 'hg resolve --mark') [1] $ cat a Small Mathematical Series. 1 2 3 <<<<<<< working copy: test 2 6 8 ======= 4 5 >>>>>>> merge rev: test 1 Hop we are done. Verify line trimming of custom conflict marker using multi-byte characters $ hg up -q --clean . $ $PYTHON < fp = open('logfile', 'w') > fp.write('12345678901234567890123456789012345678901234567890' + > '1234567890') # there are 5 more columns for 80 columns > > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8')) > > fp.close() > EOF $ hg add logfile $ hg --encoding utf-8 commit --logfile logfile $ cat >> .hg/hgrc < [ui] > mergemarkertemplate={desc|firstline} > EOF $ hg -q --encoding utf-8 merge 1 warning: conflicts while merging a! (edit, then use 'hg resolve --mark') [1] $ cat a Small Mathematical Series. 1 2 3 <<<<<<< working copy: 1234567890123456789012345678901234567890123456789012345... 6 8 ======= 4 5 >>>>>>> merge rev: branch1 Hop we are done. Verify basic conflict markers $ hg up -q --clean 2 $ printf "\n[ui]\nmergemarkers=basic\n" >> .hg/hgrc $ hg merge 1 merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ cat a Small Mathematical Series. 1 2 3 <<<<<<< working copy 6 8 ======= 4 5 >>>>>>> merge rev Hop we are done. internal:merge3 $ hg up -q --clean . $ hg merge 1 --tool internal:merge3 merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ cat a Small Mathematical Series. <<<<<<< working copy 1 2 3 6 8 ||||||| base One Two Three Four Five ======= 1 2 3 4 5 >>>>>>> merge rev Hop we are done. Add some unconflicting changes on each head, to make sure we really are merging, unlike :local and :other $ hg up -C 2 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to "e0693e20f496: 123456789012345678901234567890123456789012345678901234567890????" 1 other heads for branch "default" $ printf "\n\nEnd of file\n" >> a $ hg ci -m "Add some stuff at the end" $ hg up -r 1 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ printf "Start of file\n\n\n" > tmp $ cat a >> tmp $ mv tmp a $ hg ci -m "Add some stuff at the beginning" Now test :merge-other and :merge-local $ hg merge merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') 1 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ hg resolve --tool :merge-other a merging a (no more unresolved files) $ cat a Start of file Small Mathematical Series. 1 2 3 6 8 Hop we are done. End of file $ hg up -C 1 files updated, 0 files merged, 1 files removed, 0 files unresolved updated to "18b51d585961: Add some stuff at the beginning" 1 other heads for branch "default" $ hg merge --tool :merge-local merging a 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat a Start of file Small Mathematical Series. 1 2 3 4 5 Hop we are done. End of file mercurial-4.5.3/tests/test-mq-qrefresh-interactive.t0000644015407300116100000002030113261161234022442 0ustar augieeng00000000000000Create configuration $ echo "[ui]" >> $HGRCPATH $ echo "interactive=true" >> $HGRCPATH help qrefresh (no record) $ echo "[extensions]" >> $HGRCPATH $ echo "mq=" >> $HGRCPATH $ hg help qrefresh hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]... update the current patch 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. If -s/--short is specified, files currently included in the patch will be refreshed just like matched files and remain in the patch. 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 ".hg/last-message.txt". 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. Returns 0 on success. options ([+] can be repeated): -e --edit invoke editor on commit messages -g --git use git extended diff format -s --short refresh only files already in the patch and specified files -U --currentuser add/update author field in patch with current user -u --user USER add/update author field in patch with given user -D --currentdate add/update date field in patch with current date -d --date DATE add/update date field in patch with given date -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -m --message TEXT use text as commit message -l --logfile FILE read commit message from file (some details hidden, use --verbose to show complete help) help qrefresh (record) $ echo "record=" >> $HGRCPATH $ hg help qrefresh hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]... update the current patch 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. If -s/--short is specified, files currently included in the patch will be refreshed just like matched files and remain in the patch. 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 ".hg/last-message.txt". 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. Returns 0 on success. options ([+] can be repeated): -e --edit invoke editor on commit messages -g --git use git extended diff format -s --short refresh only files already in the patch and specified files -U --currentuser add/update author field in patch with current user -u --user USER add/update author field in patch with given user -D --currentdate add/update date field in patch with current date -d --date DATE add/update date field in patch with given date -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -m --message TEXT use text as commit message -l --logfile FILE read commit message from file -i --interactive interactively select changes to refresh (some details hidden, use --verbose to show complete help) $ hg init a $ cd a Base commit $ cat > 1.txt < 1 > 2 > 3 > 4 > 5 > EOF $ cat > 2.txt < a > b > c > d > e > f > EOF $ mkdir dir $ cat > dir/a.txt < hello world > > someone > up > there > loves > me > EOF $ hg add 1.txt 2.txt dir/a.txt $ hg commit -m aaa $ hg qrecord --config ui.interactive=false patch abort: running non-interactively, use qnew instead [255] $ hg qnew -i --config ui.interactive=false patch abort: running non-interactively [255] $ hg qnew -d '0 0' patch Changing files $ sed -e 's/2/2 2/;s/4/4 4/' 1.txt > 1.txt.new $ sed -e 's/b/b b/' 2.txt > 2.txt.new $ sed -e 's/hello world/hello world!/' dir/a.txt > dir/a.txt.new $ mv -f 1.txt.new 1.txt $ mv -f 2.txt.new 2.txt $ mv -f dir/a.txt.new dir/a.txt Whole diff $ hg diff --nodates diff -r ed27675cb5df 1.txt --- a/1.txt +++ b/1.txt @@ -1,5 +1,5 @@ 1 -2 +2 2 3 -4 +4 4 5 diff -r ed27675cb5df 2.txt --- a/2.txt +++ b/2.txt @@ -1,5 +1,5 @@ a -b +b b c d e diff -r ed27675cb5df dir/a.txt --- a/dir/a.txt +++ b/dir/a.txt @@ -1,4 +1,4 @@ -hello world +hello world! someone up partial qrefresh $ hg qrefresh -i --config ui.interactive=false abort: running non-interactively [255] $ hg qrefresh -i -d '0 0' < y > y > n > y > y > n > EOF diff --git a/1.txt b/1.txt 2 hunks, 2 lines changed examine changes to '1.txt'? [Ynesfdaq?] y @@ -1,3 +1,3 @@ 1 -2 +2 2 3 record change 1/4 to '1.txt'? [Ynesfdaq?] y @@ -3,3 +3,3 @@ 3 -4 +4 4 5 record change 2/4 to '1.txt'? [Ynesfdaq?] n diff --git a/2.txt b/2.txt 1 hunks, 1 lines changed examine changes to '2.txt'? [Ynesfdaq?] y @@ -1,5 +1,5 @@ a -b +b b c d e record change 3/4 to '2.txt'? [Ynesfdaq?] y diff --git a/dir/a.txt b/dir/a.txt 1 hunks, 1 lines changed examine changes to 'dir/a.txt'? [Ynesfdaq?] n After partial qrefresh 'tip' $ hg tip -p changeset: 1:0738af1a8211 tag: patch tag: qbase tag: qtip tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: [mq]: patch diff -r 1fd39ab63a33 -r 0738af1a8211 1.txt --- a/1.txt Thu Jan 01 00:00:00 1970 +0000 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +1,5 @@ 1 -2 +2 2 3 4 5 diff -r 1fd39ab63a33 -r 0738af1a8211 2.txt --- a/2.txt Thu Jan 01 00:00:00 1970 +0000 +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +1,5 @@ a -b +b b c d e After partial qrefresh 'diff' $ hg diff --nodates diff -r 0738af1a8211 1.txt --- a/1.txt +++ b/1.txt @@ -1,5 +1,5 @@ 1 2 2 3 -4 +4 4 5 diff -r 0738af1a8211 dir/a.txt --- a/dir/a.txt +++ b/dir/a.txt @@ -1,4 +1,4 @@ -hello world +hello world! someone up qrefresh interactively everything else $ hg qrefresh -i -d '0 0' < y > y > y > y > EOF diff --git a/1.txt b/1.txt 1 hunks, 1 lines changed examine changes to '1.txt'? [Ynesfdaq?] y @@ -1,5 +1,5 @@ 1 2 2 3 -4 +4 4 5 record change 1/2 to '1.txt'? [Ynesfdaq?] y diff --git a/dir/a.txt b/dir/a.txt 1 hunks, 1 lines changed examine changes to 'dir/a.txt'? [Ynesfdaq?] y @@ -1,4 +1,4 @@ -hello world +hello world! someone up record change 2/2 to 'dir/a.txt'? [Ynesfdaq?] y After final qrefresh 'tip' $ hg tip -p changeset: 1:2c3f66afeed9 tag: patch tag: qbase tag: qtip tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: [mq]: patch diff -r 1fd39ab63a33 -r 2c3f66afeed9 1.txt --- a/1.txt Thu Jan 01 00:00:00 1970 +0000 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +1,5 @@ 1 -2 +2 2 3 -4 +4 4 5 diff -r 1fd39ab63a33 -r 2c3f66afeed9 2.txt --- a/2.txt Thu Jan 01 00:00:00 1970 +0000 +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +1,5 @@ a -b +b b c d e diff -r 1fd39ab63a33 -r 2c3f66afeed9 dir/a.txt --- a/dir/a.txt Thu Jan 01 00:00:00 1970 +0000 +++ b/dir/a.txt Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +1,4 @@ -hello world +hello world! someone up After qrefresh 'diff' $ hg diff --nodates $ cd .. mercurial-4.5.3/tests/test-log-linerange.t0000644015407300116100000003251313261161234020430 0ustar augieeng00000000000000 $ cat >> $HGRCPATH << EOF > [diff] > git = true > EOF $ hg init $ cat > foo << EOF > 0 > 1 > 2 > 3 > 4 > EOF $ hg ci -Am init adding foo $ cat > foo << EOF > 0 > 0 > 0 > 0 > 1 > 2 > 3 > 4 > EOF $ hg ci -m 'more 0' $ sed 's/2/2+/' foo > foo.new $ mv foo.new foo $ cat > bar << EOF > a > b > c > d > e > EOF $ hg add bar $ hg ci -Am "2 -> 2+; added bar" $ cat >> foo << EOF > 5 > 6 > 7 > 8 > 9 > 10 > 11 > EOF $ hg ci -m "to 11" Add some changes with two diff hunks $ sed 's/^1$/ 1/' foo > foo.new $ mv foo.new foo $ sed 's/^11$/11+/' foo > foo.new $ mv foo.new foo $ hg ci -m '11 -> 11+; leading space before "1"' (make sure there are two hunks in "foo") $ hg diff -c . diff --git a/foo b/foo --- a/foo +++ b/foo @@ -2,7 +2,7 @@ 0 0 0 -1 + 1 2+ 3 4 @@ -12,4 +12,4 @@ 8 9 10 -11 +11+ $ sed 's/3/3+/' foo > foo.new $ mv foo.new foo $ sed 's/^11+$/11-/' foo > foo.new $ mv foo.new foo $ sed 's/a/a+/' bar > bar.new $ mv bar.new bar $ hg ci -m 'foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+' (make sure there are two hunks in "foo") $ hg diff -c . foo diff --git a/foo b/foo --- a/foo +++ b/foo @@ -4,7 +4,7 @@ 0 1 2+ -3 +3+ 4 5 6 @@ -12,4 +12,4 @@ 8 9 10 -11+ +11- $ hg log -f -L foo,5:7 -p changeset: 5:cfdf972b3971 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+ diff --git a/foo b/foo --- a/foo +++ b/foo @@ -4,7 +4,7 @@ 0 1 2+ -3 +3+ 4 5 6 changeset: 4:eaec41c1a0c9 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 11 -> 11+; leading space before "1" diff --git a/foo b/foo --- a/foo +++ b/foo @@ -2,7 +2,7 @@ 0 0 0 -1 + 1 2+ 3 4 changeset: 2:63a884426fd0 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 2 -> 2+; added bar diff --git a/foo b/foo --- a/foo +++ b/foo @@ -3,6 +3,6 @@ 0 0 1 -2 +2+ 3 4 changeset: 0:5ae1f82b9a00 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: init diff --git a/foo b/foo new file mode 100644 --- /dev/null +++ b/foo @@ -0,0 +1,5 @@ +0 +1 +2 +3 +4 With --template. $ hg log -f -L foo,5:7 -T '{rev}:{node|short} {desc|firstline}\n' 5:cfdf972b3971 foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+ 4:eaec41c1a0c9 11 -> 11+; leading space before "1" 2:63a884426fd0 2 -> 2+; added bar 0:5ae1f82b9a00 init $ hg log -f -L foo,5:7 -T json [ { "rev": 5, "node": "cfdf972b3971a2a59638bf9583c0debbffee5404", "branch": "default", "phase": "draft", "user": "test", "date": [0, 0], "desc": "foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+", "bookmarks": [], "tags": ["tip"], "parents": ["eaec41c1a0c9ad0a5e999611d0149d171beffb8c"] }, { "rev": 4, "node": "eaec41c1a0c9ad0a5e999611d0149d171beffb8c", "branch": "default", "phase": "draft", "user": "test", "date": [0, 0], "desc": "11 -> 11+; leading space before \"1\"", "bookmarks": [], "tags": [], "parents": ["730a61fbaecf426c17c2c66bc42d195b5d5b0ba8"] }, { "rev": 2, "node": "63a884426fd0b277fcd55895bbb2f230434576eb", "branch": "default", "phase": "draft", "user": "test", "date": [0, 0], "desc": "2 -> 2+; added bar", "bookmarks": [], "tags": [], "parents": ["29a1e7c6b80024f63f310a2d71de979e9d2996d7"] }, { "rev": 0, "node": "5ae1f82b9a000ff1e0967d0dac1c58b9d796e1b4", "branch": "default", "phase": "draft", "user": "test", "date": [0, 0], "desc": "init", "bookmarks": [], "tags": [], "parents": ["0000000000000000000000000000000000000000"] } ] With some white-space diff option, respective revisions are skipped. $ hg log -f -L foo,5:7 -p --config diff.ignorews=true changeset: 5:cfdf972b3971 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+ diff --git a/foo b/foo --- a/foo +++ b/foo @@ -4,7 +4,7 @@ 0 1 2+ -3 +3+ 4 5 6 changeset: 2:63a884426fd0 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 2 -> 2+; added bar diff --git a/foo b/foo --- a/foo +++ b/foo @@ -3,6 +3,6 @@ 0 0 1 -2 +2+ 3 4 changeset: 0:5ae1f82b9a00 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: init diff --git a/foo b/foo new file mode 100644 --- /dev/null +++ b/foo @@ -0,0 +1,5 @@ +0 +1 +2 +3 +4 Regular file patterns are not allowed. $ hg log -f -L foo,5:7 -p bar abort: FILE arguments are not compatible with --line-range option [255] Option --rev acts as a restriction. $ hg log -f -L foo,5:7 -p -r 'desc(2)' changeset: 2:63a884426fd0 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 2 -> 2+; added bar diff --git a/foo b/foo --- a/foo +++ b/foo @@ -3,6 +3,6 @@ 0 0 1 -2 +2+ 3 4 changeset: 0:5ae1f82b9a00 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: init diff --git a/foo b/foo new file mode 100644 --- /dev/null +++ b/foo @@ -0,0 +1,5 @@ +0 +1 +2 +3 +4 With several -L patterns, changes touching any files in their respective line range are show. $ hg log -f -L foo,5:7 -L bar,1:2 -p changeset: 5:cfdf972b3971 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+ diff --git a/bar b/bar --- a/bar +++ b/bar @@ -1,4 +1,4 @@ -a +a+ b c d diff --git a/foo b/foo --- a/foo +++ b/foo @@ -4,7 +4,7 @@ 0 1 2+ -3 +3+ 4 5 6 changeset: 4:eaec41c1a0c9 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 11 -> 11+; leading space before "1" diff --git a/foo b/foo --- a/foo +++ b/foo @@ -2,7 +2,7 @@ 0 0 0 -1 + 1 2+ 3 4 changeset: 2:63a884426fd0 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 2 -> 2+; added bar diff --git a/bar b/bar new file mode 100644 --- /dev/null +++ b/bar @@ -0,0 +1,5 @@ +a +b +c +d +e diff --git a/foo b/foo --- a/foo +++ b/foo @@ -3,6 +3,6 @@ 0 0 1 -2 +2+ 3 4 changeset: 0:5ae1f82b9a00 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: init diff --git a/foo b/foo new file mode 100644 --- /dev/null +++ b/foo @@ -0,0 +1,5 @@ +0 +1 +2 +3 +4 Multiple -L options with the same file yields changes touching any of specified line ranges. $ hg log -f -L foo,5:7 -L foo,14:15 -p changeset: 5:cfdf972b3971 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+ diff --git a/foo b/foo --- a/foo +++ b/foo @@ -4,7 +4,7 @@ 0 1 2+ -3 +3+ 4 5 6 @@ -12,4 +12,4 @@ 8 9 10 -11+ +11- changeset: 4:eaec41c1a0c9 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 11 -> 11+; leading space before "1" diff --git a/foo b/foo --- a/foo +++ b/foo @@ -2,7 +2,7 @@ 0 0 0 -1 + 1 2+ 3 4 @@ -12,4 +12,4 @@ 8 9 10 -11 +11+ changeset: 3:730a61fbaecf user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: to 11 diff --git a/foo b/foo --- a/foo +++ b/foo @@ -6,3 +6,10 @@ 2+ 3 4 +5 +6 +7 +8 +9 +10 +11 changeset: 2:63a884426fd0 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 2 -> 2+; added bar diff --git a/foo b/foo --- a/foo +++ b/foo @@ -3,6 +3,6 @@ 0 0 1 -2 +2+ 3 4 changeset: 0:5ae1f82b9a00 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: init diff --git a/foo b/foo new file mode 100644 --- /dev/null +++ b/foo @@ -0,0 +1,5 @@ +0 +1 +2 +3 +4 A file with a comma in its name. $ cat > ba,z << EOF > q > w > e > r > t > y > EOF $ hg ci -Am 'querty' adding ba,z $ cat >> ba,z << EOF > u > i > o > p > EOF $ hg ci -m 'more keys' $ cat > ba,z << EOF > a > z > e > r > t > y > u > i > o > p > EOF $ hg ci -m 'azerty' $ hg log -f -L ba,z,1:2 -p changeset: 8:52373265138b tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: azerty diff --git a/ba,z b/ba,z --- a/ba,z +++ b/ba,z @@ -1,5 +1,5 @@ -q -w +a +z e r t changeset: 6:96ba8850f316 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: querty diff --git a/ba,z b/ba,z new file mode 100644 --- /dev/null +++ b/ba,z @@ -0,0 +1,6 @@ +q +w +e +r +t +y Exact prefix kinds work in -L options. $ mkdir dir $ cd dir $ hg log -f -L path:foo,5:7 -p changeset: 5:cfdf972b3971 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+ diff --git a/foo b/foo --- a/foo +++ b/foo @@ -4,7 +4,7 @@ 0 1 2+ -3 +3+ 4 5 6 changeset: 4:eaec41c1a0c9 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 11 -> 11+; leading space before "1" diff --git a/foo b/foo --- a/foo +++ b/foo @@ -2,7 +2,7 @@ 0 0 0 -1 + 1 2+ 3 4 changeset: 2:63a884426fd0 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 2 -> 2+; added bar diff --git a/foo b/foo --- a/foo +++ b/foo @@ -3,6 +3,6 @@ 0 0 1 -2 +2+ 3 4 changeset: 0:5ae1f82b9a00 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: init diff --git a/foo b/foo new file mode 100644 --- /dev/null +++ b/foo @@ -0,0 +1,5 @@ +0 +1 +2 +3 +4 Renames are followed. $ hg mv ../foo baz $ sed 's/1/1+/' baz > baz.new $ mv baz.new baz $ hg ci -m 'foo -> dir/baz; 1-1+' $ hg diff -c . diff --git a/foo b/dir/baz rename from foo rename to dir/baz --- a/foo +++ b/dir/baz @@ -2,7 +2,7 @@ 0 0 0 - 1 + 1+ 2+ 3+ 4 @@ -11,5 +11,5 @@ 7 8 9 -10 -11- +1+0 +1+1- $ hg log -f -L relpath:baz,5:7 -p changeset: 9:6af29c3a778f tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: foo -> dir/baz; 1-1+ diff --git a/foo b/dir/baz copy from foo copy to dir/baz --- a/foo +++ b/dir/baz @@ -2,7 +2,7 @@ 0 0 0 - 1 + 1+ 2+ 3+ 4 changeset: 5:cfdf972b3971 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+ diff --git a/foo b/foo --- a/foo +++ b/foo @@ -4,7 +4,7 @@ 0 1 2+ -3 +3+ 4 5 6 changeset: 4:eaec41c1a0c9 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 11 -> 11+; leading space before "1" diff --git a/foo b/foo --- a/foo +++ b/foo @@ -2,7 +2,7 @@ 0 0 0 -1 + 1 2+ 3 4 changeset: 2:63a884426fd0 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 2 -> 2+; added bar diff --git a/foo b/foo --- a/foo +++ b/foo @@ -3,6 +3,6 @@ 0 0 1 -2 +2+ 3 4 changeset: 0:5ae1f82b9a00 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: init diff --git a/foo b/foo new file mode 100644 --- /dev/null +++ b/foo @@ -0,0 +1,5 @@ +0 +1 +2 +3 +4 Binary files work but without diff hunks filtering. (Checking w/ and w/o diff.git option.) >>> open('binary', 'wb').write('this\nis\na\nbinary\0') $ hg add binary $ hg ci -m 'add a binary file' --quiet $ hg log -f -L binary,1:2 -p changeset: 10:c96381c229df tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add a binary file diff --git a/dir/binary b/dir/binary new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..c2e1fbed209fe919b3f189a6a31950e9adf61e45 GIT binary patch literal 17 Wc$_QA$SmdpqC~Ew%)G>+N(KNlNClYy $ hg log -f -L binary,1:2 -p --config diff.git=false changeset: 10:c96381c229df tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add a binary file diff -r 6af29c3a778f -r c96381c229df dir/binary Binary file dir/binary has changed Option --follow is required. $ hg log -L foo,5:7 abort: --line-range requires --follow [255] Non-exact pattern kinds are not allowed. $ cd .. $ hg log -f -L glob:*a*,1:2 hg: parse error: line range pattern 'glob:*a*' must match exactly one file [255] We get an error for removed files. $ hg rm dir/baz $ hg ci -m 'remove baz' --quiet $ hg log -f -L dir/baz,5:7 -p abort: cannot follow file not in parent revision: "dir/baz" [255] Graph log does work yet. $ hg log -f -L dir/baz,5:7 --graph abort: graph not supported with line range patterns [255] mercurial-4.5.3/tests/test-check-execute.t0000644015407300116100000000116613261161234020422 0ustar augieeng00000000000000#require test-repo execbit $ . "$TESTDIR/helpers-testrepo.sh" $ cd "`dirname "$TESTDIR"`" look for python scripts without the execute bit $ testrepohg files 'set:**.py and not exec() and grep(r"^#!.*?python")' [1] look for python scripts with execute bit but not shebang $ testrepohg files 'set:**.py and exec() and not grep(r"^#!.*?python")' [1] look for shell scripts with execute bit but not shebang $ testrepohg files 'set:**.sh and exec() and not grep(r"^#!.*(ba)?sh")' [1] look for non scripts with no shebang $ testrepohg files 'set:exec() and not **.sh and not **.py and not grep(r"^#!")' [1] mercurial-4.5.3/tests/test-mq-qpush-exact.t0000644015407300116100000001266713261161234020572 0ustar augieeng00000000000000 $ echo "[extensions]" >> $HGRCPATH $ echo "mq=" >> $HGRCPATH make a test repository that looks like this: o 2:28bc7b1afd6a | | @ 1:d7fe2034f71b |/ o 0/62ecad8b70e5 $ hg init r0 $ cd r0 $ touch f0 $ hg ci -m0 -Aq $ touch f1 $ hg ci -m1 -Aq $ hg update 0 -q $ touch f2 $ hg ci -m2 -Aq $ hg update 1 -q make some patches with a parent: 1:d7fe2034f71b -> p0 -> p1 $ echo cp0 >> fp0 $ hg add fp0 $ hg ci -m p0 -d "0 0" $ hg export -r. > p0 $ hg strip -qn . $ hg qimport p0 adding p0 to series file $ hg qpush applying p0 now at: p0 $ echo cp1 >> fp1 $ hg add fp1 $ hg qnew p1 -d "0 0" $ hg qpop -aq patch queue now empty qpush --exact when at the parent $ hg update 1 -q $ hg qpush -e applying p0 now at: p0 $ hg parents -qr qbase 1:d7fe2034f71b $ hg qpop -aq patch queue now empty $ hg qpush -e p0 applying p0 now at: p0 $ hg parents -qr qbase 1:d7fe2034f71b $ hg qpop -aq patch queue now empty $ hg qpush -e p1 applying p0 applying p1 now at: p1 $ hg parents -qr qbase 1:d7fe2034f71b $ hg qpop -aq patch queue now empty qpush --exact when at another rev $ hg update 0 -q $ hg qpush -e 1 files updated, 0 files merged, 0 files removed, 0 files unresolved applying p0 now at: p0 $ hg parents -qr qbase 1:d7fe2034f71b $ hg qpop -aq patch queue now empty $ hg update 0 -q $ hg qpush -e p0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved applying p0 now at: p0 $ hg parents -qr qbase 1:d7fe2034f71b $ hg qpop -aq patch queue now empty $ hg update 0 -q $ hg qpush -e p1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved applying p0 applying p1 now at: p1 $ hg parents -qr qbase 1:d7fe2034f71b $ hg qpop -aq patch queue now empty $ hg update 0 -q $ hg qpush -ea 1 files updated, 0 files merged, 0 files removed, 0 files unresolved applying p0 applying p1 now at: p1 $ hg parents -qr qbase 1:d7fe2034f71b $ hg qpop -aq patch queue now empty qpush --exact while crossing branches $ hg update 2 -q $ hg qpush -e 1 files updated, 0 files merged, 1 files removed, 0 files unresolved applying p0 now at: p0 $ hg parents -qr qbase 1:d7fe2034f71b $ hg qpop -aq patch queue now empty $ hg update 2 -q $ hg qpush -e p0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved applying p0 now at: p0 $ hg parents -qr qbase 1:d7fe2034f71b $ hg qpop -aq patch queue now empty $ hg update 2 -q $ hg qpush -e p1 1 files updated, 0 files merged, 1 files removed, 0 files unresolved applying p0 applying p1 now at: p1 $ hg parents -qr qbase 1:d7fe2034f71b $ hg qpop -aq patch queue now empty $ hg update 2 -q $ hg qpush -ea 1 files updated, 0 files merged, 1 files removed, 0 files unresolved applying p0 applying p1 now at: p1 $ hg parents -qr qbase 1:d7fe2034f71b $ hg qpop -aq patch queue now empty qpush --exact --force with changes to an unpatched file $ hg update 1 -q $ echo c0 >> f0 $ hg qpush -e abort: local changes found [255] $ hg qpush -ef applying p0 now at: p0 $ cat f0 c0 $ rm f0 $ touch f0 $ hg qpop -aq patch queue now empty $ hg update 1 -q $ echo c0 >> f0 $ hg qpush -e p1 abort: local changes found [255] $ hg qpush -e p1 -f applying p0 applying p1 now at: p1 $ cat f0 c0 $ rm f0 $ touch f0 $ hg qpop -aq patch queue now empty qpush --exact --force with changes to a patched file $ hg update 1 -q $ echo cp0-bad >> fp0 $ hg add fp0 $ hg qpush -e abort: local changes found [255] $ hg qpush -ef applying p0 file fp0 already exists 1 out of 1 hunks FAILED -- saving rejects to file fp0.rej patch failed, unable to continue (try -v) patch failed, rejects left in working directory errors during apply, please fix and qrefresh p0 [2] $ cat fp0 cp0-bad $ cat fp0.rej --- fp0 +++ fp0 @@ -0,0 +1,1 @@ +cp0 $ hg qpop -aqf patch queue now empty $ rm fp0 $ rm fp0.rej $ hg update 1 -q $ echo cp1-bad >> fp1 $ hg add fp1 $ hg qpush -e p1 abort: local changes found [255] $ hg qpush -e p1 -f applying p0 applying p1 file fp1 already exists 1 out of 1 hunks FAILED -- saving rejects to file fp1.rej patch failed, unable to continue (try -v) patch failed, rejects left in working directory errors during apply, please fix and qrefresh p1 [2] $ cat fp1 cp1-bad $ cat fp1.rej --- fp1 +++ fp1 @@ -0,0 +1,1 @@ +cp1 $ hg qpop -aqf patch queue now empty $ hg forget fp1 $ rm fp1 $ rm fp1.rej qpush --exact when already at a patch $ hg update 1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg qpush -e p0 applying p0 now at: p0 $ hg qpush -e p1 abort: cannot push --exact with applied patches [255] $ hg qpop -aq patch queue now empty qpush --exact --move should fail $ hg qpush -e --move p1 abort: cannot use --exact and --move together [255] qpush --exact a patch without a parent recorded $ hg qpush -q now at: p0 $ grep -v '# Parent' .hg/patches/p0 > p0.new $ mv p0.new .hg/patches/p0 $ hg qpop -aq patch queue now empty $ hg qpush -e abort: p0 does not have a parent recorded [255] $ hg qpush -e p0 abort: p0 does not have a parent recorded [255] $ hg qpush -e p1 abort: p0 does not have a parent recorded [255] $ hg qpush -ea abort: p0 does not have a parent recorded [255] $ cd .. mercurial-4.5.3/tests/md5sum.py0000755015407300116100000000166013261161234016331 0ustar augieeng00000000000000#!/usr/bin/env python # # Based on python's Tools/scripts/md5sum.py # # This software may be used and distributed according to the terms # of the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2, which is # GPL-compatible. from __future__ import absolute_import import hashlib import os import sys try: import msvcrt msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) except ImportError: pass for filename in sys.argv[1:]: try: fp = open(filename, 'rb') except IOError as msg: sys.stderr.write('%s: Can\'t open: %s\n' % (filename, msg)) sys.exit(1) m = hashlib.md5() try: for data in iter(lambda: fp.read(8192), b''): m.update(data) except IOError as msg: sys.stderr.write('%s: I/O error: %s\n' % (filename, msg)) sys.exit(1) sys.stdout.write('%s %s\n' % (m.hexdigest(), filename)) sys.exit(0) mercurial-4.5.3/tests/test-merge-changedelete.t0000644015407300116100000011124313261161234021410 0ustar augieeng00000000000000Tests for change/delete conflicts, including: b5605d88dc27: Make ui.prompt repeat on "unrecognized response" again (issue897) 840e2b315c1f: Fix misleading error and prompts during update/merge (issue556) Make sure HGMERGE doesn't interfere with the test $ unset HGMERGE $ status() { > echo "--- status ---" > hg st -A file1 file2 file3 > echo "--- resolve --list ---" > hg resolve --list file1 file2 file3 > echo "--- debugmergestate ---" > hg debugmergestate > for file in file1 file2 file3; do > if [ -f $file ]; then > echo "--- $file ---" > cat $file > else > echo "*** $file does not exist" > fi > done > } $ hg init repo $ cd repo $ echo 1 > file1 $ echo 2 > file2 $ echo 3 > file3 $ hg ci -Am 'added files' adding file1 adding file2 adding file3 $ hg rm file1 $ echo changed >> file2 $ echo changed1 >> file3 $ hg ci -m 'removed file1, changed file2, changed file3' $ hg co 0 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo changed >> file1 $ hg rm file2 $ echo changed2 >> file3 $ hg ci -m 'changed file1, removed file2, changed file3' created new head Non-interactive merge: $ hg merge -y local [working copy] changed file1 which other [merge rev] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? u other [merge rev] changed file2 which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u merging file3 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 3 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ status --- status --- M file2 M file3 C file1 --- resolve --list --- U file1 U file2 U file3 --- debugmergestate --- * version 2 records local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 other: 10f9a0a634e82080907e62f075ab119cbc565ea6 labels: local: working copy other: merge rev file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) local path: file1 (flags "") ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) other path: file1 (node null) file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file2 (record type "C", state "u", hash null) local path: file2 (flags "") ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) local path: file3 (flags "") ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) --- file1 --- 1 changed --- file2 --- 2 changed --- file3 --- 3 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan... changed2 ======= changed1 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan... Interactive merge: $ hg co -C 1 files updated, 0 files merged, 1 files removed, 0 files unresolved updated to "13910f48cf7b: changed file1, removed file2, changed file3" 1 other heads for branch "default" $ hg merge --config ui.interactive=true < c > d > EOF local [working copy] changed file1 which other [merge rev] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? c other [merge rev] changed file2 which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? d merging file3 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark') 0 files updated, 2 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ status --- status --- file2: * (glob) M file3 C file1 --- resolve --list --- R file1 R file2 U file3 --- debugmergestate --- * version 2 records local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 other: 10f9a0a634e82080907e62f075ab119cbc565ea6 labels: local: working copy other: merge rev file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390) local path: file1 (flags "") ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) other path: file1 (node null) file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file2 (record type "C", state "r", hash null) local path: file2 (flags "") ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) local path: file3 (flags "") ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) --- file1 --- 1 changed *** file2 does not exist --- file3 --- 3 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan... changed2 ======= changed1 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan... Interactive merge with bad input: $ hg co -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to "13910f48cf7b: changed file1, removed file2, changed file3" 1 other heads for branch "default" $ hg merge --config ui.interactive=true < foo > bar > d > baz > c > EOF local [working copy] changed file1 which other [merge rev] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? foo unrecognized response local [working copy] changed file1 which other [merge rev] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? bar unrecognized response local [working copy] changed file1 which other [merge rev] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? d other [merge rev] changed file2 which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? baz unrecognized response other [merge rev] changed file2 which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c merging file3 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark') 0 files updated, 1 files merged, 1 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ status --- status --- M file2 M file3 R file1 --- resolve --list --- R file1 R file2 U file3 --- debugmergestate --- * version 2 records local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 other: 10f9a0a634e82080907e62f075ab119cbc565ea6 labels: local: working copy other: merge rev file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390) local path: file1 (flags "") ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) other path: file1 (node null) file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file2 (record type "C", state "r", hash null) local path: file2 (flags "") ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) local path: file3 (flags "") ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) *** file1 does not exist --- file2 --- 2 changed --- file3 --- 3 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan... changed2 ======= changed1 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan... Interactive merge with not enough input: $ hg co -C 2 files updated, 0 files merged, 1 files removed, 0 files unresolved updated to "13910f48cf7b: changed file1, removed file2, changed file3" 1 other heads for branch "default" $ hg merge --config ui.interactive=true < d > EOF local [working copy] changed file1 which other [merge rev] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? d other [merge rev] changed file2 which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? merging file3 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 1 files removed, 2 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ status --- status --- M file2 M file3 R file1 --- resolve --list --- R file1 U file2 U file3 --- debugmergestate --- * version 2 records local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 other: 10f9a0a634e82080907e62f075ab119cbc565ea6 labels: local: working copy other: merge rev file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390) local path: file1 (flags "") ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) other path: file1 (node null) file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file2 (record type "C", state "u", hash null) local path: file2 (flags "") ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) local path: file3 (flags "") ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) *** file1 does not exist --- file2 --- 2 changed --- file3 --- 3 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan... changed2 ======= changed1 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan... Choose local versions of files $ hg co -C 2 files updated, 0 files merged, 1 files removed, 0 files unresolved updated to "13910f48cf7b: changed file1, removed file2, changed file3" 1 other heads for branch "default" $ hg merge --tool :local 0 files updated, 3 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ status 2>&1 | tee $TESTTMP/local.status --- status --- file2: * (glob) M file3 C file1 --- resolve --list --- R file1 R file2 R file3 --- debugmergestate --- * version 2 records local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 other: 10f9a0a634e82080907e62f075ab119cbc565ea6 labels: local: working copy other: merge rev file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390) local path: file1 (flags "") ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) other path: file1 (node null) file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file2 (record type "C", state "r", hash null) local path: file2 (flags "") ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file3 (record type "F", state "r", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) local path: file3 (flags "") ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) --- file1 --- 1 changed *** file2 does not exist --- file3 --- 3 changed2 Choose other versions of files $ hg co -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to "13910f48cf7b: changed file1, removed file2, changed file3" 1 other heads for branch "default" $ hg merge --tool :other 0 files updated, 2 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ status 2>&1 | tee $TESTTMP/other.status --- status --- M file2 M file3 R file1 --- resolve --list --- R file1 R file2 R file3 --- debugmergestate --- * version 2 records local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 other: 10f9a0a634e82080907e62f075ab119cbc565ea6 labels: local: working copy other: merge rev file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390) local path: file1 (flags "") ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) other path: file1 (node null) file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file2 (record type "C", state "r", hash null) local path: file2 (flags "") ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file3 (record type "F", state "r", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) local path: file3 (flags "") ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) *** file1 does not exist --- file2 --- 2 changed --- file3 --- 3 changed1 Fail $ hg co -C 2 files updated, 0 files merged, 1 files removed, 0 files unresolved updated to "13910f48cf7b: changed file1, removed file2, changed file3" 1 other heads for branch "default" $ hg merge --tool :fail 0 files updated, 0 files merged, 0 files removed, 3 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ status 2>&1 | tee $TESTTMP/fail.status --- status --- M file2 M file3 C file1 --- resolve --list --- U file1 U file2 U file3 --- debugmergestate --- * version 2 records local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 other: 10f9a0a634e82080907e62f075ab119cbc565ea6 labels: local: working copy other: merge rev file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) local path: file1 (flags "") ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) other path: file1 (node null) file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file2 (record type "C", state "u", hash null) local path: file2 (flags "") ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) local path: file3 (flags "") ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) --- file1 --- 1 changed --- file2 --- 2 changed --- file3 --- 3 changed2 Force prompts with no input (should be similar to :fail) $ hg co -C 1 files updated, 0 files merged, 1 files removed, 0 files unresolved updated to "13910f48cf7b: changed file1, removed file2, changed file3" 1 other heads for branch "default" $ hg merge --config ui.interactive=True --tool :prompt local [working copy] changed file1 which other [merge rev] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? other [merge rev] changed file2 which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3? 0 files updated, 0 files merged, 0 files removed, 3 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ status 2>&1 | tee $TESTTMP/prompt.status --- status --- M file2 M file3 C file1 --- resolve --list --- U file1 U file2 U file3 --- debugmergestate --- * version 2 records local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 other: 10f9a0a634e82080907e62f075ab119cbc565ea6 labels: local: working copy other: merge rev file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) local path: file1 (flags "") ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) other path: file1 (node null) file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file2 (record type "C", state "u", hash null) local path: file2 (flags "") ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) local path: file3 (flags "") ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) --- file1 --- 1 changed --- file2 --- 2 changed --- file3 --- 3 changed2 $ cmp $TESTTMP/fail.status $TESTTMP/prompt.status || diff -U8 $TESTTMP/fail.status $TESTTMP/prompt.status Force prompts $ hg co -C 1 files updated, 0 files merged, 1 files removed, 0 files unresolved updated to "13910f48cf7b: changed file1, removed file2, changed file3" 1 other heads for branch "default" $ hg merge --tool :prompt local [working copy] changed file1 which other [merge rev] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? u other [merge rev] changed file2 which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3? u 0 files updated, 0 files merged, 0 files removed, 3 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ status --- status --- M file2 M file3 C file1 --- resolve --list --- U file1 U file2 U file3 --- debugmergestate --- * version 2 records local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 other: 10f9a0a634e82080907e62f075ab119cbc565ea6 labels: local: working copy other: merge rev file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) local path: file1 (flags "") ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) other path: file1 (node null) file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file2 (record type "C", state "u", hash null) local path: file2 (flags "") ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) local path: file3 (flags "") ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) --- file1 --- 1 changed --- file2 --- 2 changed --- file3 --- 3 changed2 Choose to merge all files $ hg co -C 1 files updated, 0 files merged, 1 files removed, 0 files unresolved updated to "13910f48cf7b: changed file1, removed file2, changed file3" 1 other heads for branch "default" $ hg merge --tool :merge3 local [working copy] changed file1 which other [merge rev] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? u other [merge rev] changed file2 which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u merging file3 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 3 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ status --- status --- M file2 M file3 C file1 --- resolve --list --- U file1 U file2 U file3 --- debugmergestate --- * version 2 records local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 other: 10f9a0a634e82080907e62f075ab119cbc565ea6 labels: local: working copy other: merge rev file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) local path: file1 (flags "") ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) other path: file1 (node null) file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file2 (record type "C", state "u", hash null) local path: file2 (flags "") ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) local path: file3 (flags "") ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) --- file1 --- 1 changed --- file2 --- 2 changed --- file3 --- 3 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan... changed2 ||||||| base ======= changed1 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan... Exercise transitions between local, other, fail and prompt, and make sure the dirstate stays consistent. (Compare with each other and to the above invocations.) $ testtransitions() { > # this traversal order covers every transition > tools="local other prompt local fail other local prompt other fail prompt fail local" > lasttool="merge3" > for tool in $tools; do > echo "=== :$lasttool -> :$tool ===" > ref="$TESTTMP/$tool.status" > hg resolve --unmark --all > hg resolve --tool ":$tool" --all --config ui.interactive=True > status > "$TESTTMP/compare.status" 2>&1 > echo '--- diff of status ---' > if cmp "$TESTTMP/$tool.status" "$TESTTMP/compare.status" || diff -U8 "$TESTTMP/$tool.status" "$TESTTMP/compare.status"; then > echo '(status identical)' > fi > lasttool="$tool" > echo > done > } $ testtransitions === :merge3 -> :local === (no more unresolved files) --- diff of status --- (status identical) === :local -> :other === (no more unresolved files) --- diff of status --- (status identical) === :other -> :prompt === local [working copy] changed file1 which other [merge rev] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? other [merge rev] changed file2 which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3? --- diff of status --- (status identical) === :prompt -> :local === (no more unresolved files) --- diff of status --- (status identical) === :local -> :fail === --- diff of status --- (status identical) === :fail -> :other === (no more unresolved files) --- diff of status --- (status identical) === :other -> :local === (no more unresolved files) --- diff of status --- (status identical) === :local -> :prompt === local [working copy] changed file1 which other [merge rev] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? other [merge rev] changed file2 which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3? --- diff of status --- (status identical) === :prompt -> :other === (no more unresolved files) --- diff of status --- (status identical) === :other -> :fail === --- diff of status --- (status identical) === :fail -> :prompt === local [working copy] changed file1 which other [merge rev] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? other [merge rev] changed file2 which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3? --- diff of status --- (status identical) === :prompt -> :fail === --- diff of status --- (status identical) === :fail -> :local === (no more unresolved files) --- diff of status --- (status identical) Non-interactive linear update $ hg co -C 0 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo changed >> file1 $ hg rm file2 $ hg update 1 -y local [working copy] changed file1 which other [destination] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? u other [destination] changed file2 which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u 1 files updated, 0 files merged, 0 files removed, 2 files unresolved use 'hg resolve' to retry unresolved file merges [1] $ status --- status --- A file1 C file2 C file3 --- resolve --list --- U file1 U file2 --- debugmergestate --- * version 2 records local: ab57bf49aa276a22d35a473592d4c34b5abc3eff other: 10f9a0a634e82080907e62f075ab119cbc565ea6 labels: local: working copy other: destination file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) local path: file1 (flags "") ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) other path: file1 (node null) file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file2 (record type "C", state "u", hash null) local path: file2 (flags "") ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) --- file1 --- 1 changed --- file2 --- 2 changed --- file3 --- 3 changed1 Choose local versions of files $ hg co -C 0 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo changed >> file1 $ hg rm file2 $ hg update 1 --tool :local 1 files updated, 2 files merged, 0 files removed, 0 files unresolved $ status 2>&1 | tee $TESTTMP/local.status --- status --- file2: * (glob) A file1 C file3 --- resolve --list --- R file1 R file2 --- debugmergestate --- * version 2 records local: ab57bf49aa276a22d35a473592d4c34b5abc3eff other: 10f9a0a634e82080907e62f075ab119cbc565ea6 labels: local: working copy other: destination file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390) local path: file1 (flags "") ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) other path: file1 (node null) file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file2 (record type "C", state "r", hash null) local path: file2 (flags "") ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) --- file1 --- 1 changed *** file2 does not exist --- file3 --- 3 changed1 Choose other versions of files $ hg co -C 0 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo changed >> file1 $ hg rm file2 $ hg update 1 --tool :other 1 files updated, 1 files merged, 1 files removed, 0 files unresolved $ status 2>&1 | tee $TESTTMP/other.status --- status --- file1: * (glob) C file2 C file3 --- resolve --list --- R file1 R file2 --- debugmergestate --- * version 2 records local: ab57bf49aa276a22d35a473592d4c34b5abc3eff other: 10f9a0a634e82080907e62f075ab119cbc565ea6 labels: local: working copy other: destination file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390) local path: file1 (flags "") ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) other path: file1 (node null) file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file2 (record type "C", state "r", hash null) local path: file2 (flags "") ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) *** file1 does not exist --- file2 --- 2 changed --- file3 --- 3 changed1 Fail $ hg co -C 0 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo changed >> file1 $ hg rm file2 $ hg update 1 --tool :fail 1 files updated, 0 files merged, 0 files removed, 2 files unresolved use 'hg resolve' to retry unresolved file merges [1] $ status 2>&1 | tee $TESTTMP/fail.status --- status --- A file1 C file2 C file3 --- resolve --list --- U file1 U file2 --- debugmergestate --- * version 2 records local: ab57bf49aa276a22d35a473592d4c34b5abc3eff other: 10f9a0a634e82080907e62f075ab119cbc565ea6 labels: local: working copy other: destination file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) local path: file1 (flags "") ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) other path: file1 (node null) file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file2 (record type "C", state "u", hash null) local path: file2 (flags "") ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) --- file1 --- 1 changed --- file2 --- 2 changed --- file3 --- 3 changed1 Force prompts with no input $ hg co -C 0 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo changed >> file1 $ hg rm file2 $ hg update 1 --config ui.interactive=True --tool :prompt local [working copy] changed file1 which other [destination] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? other [destination] changed file2 which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? 1 files updated, 0 files merged, 0 files removed, 2 files unresolved use 'hg resolve' to retry unresolved file merges [1] $ status 2>&1 | tee $TESTTMP/prompt.status --- status --- A file1 C file2 C file3 --- resolve --list --- U file1 U file2 --- debugmergestate --- * version 2 records local: ab57bf49aa276a22d35a473592d4c34b5abc3eff other: 10f9a0a634e82080907e62f075ab119cbc565ea6 labels: local: working copy other: destination file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) local path: file1 (flags "") ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) other path: file1 (node null) file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file2 (record type "C", state "u", hash null) local path: file2 (flags "") ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) --- file1 --- 1 changed --- file2 --- 2 changed --- file3 --- 3 changed1 $ cmp $TESTTMP/fail.status $TESTTMP/prompt.status || diff -U8 $TESTTMP/fail.status $TESTTMP/prompt.status Choose to merge all files $ hg co -C 0 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo changed >> file1 $ hg rm file2 $ hg update 1 --tool :merge3 local [working copy] changed file1 which other [destination] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? u other [destination] changed file2 which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u 1 files updated, 0 files merged, 0 files removed, 2 files unresolved use 'hg resolve' to retry unresolved file merges [1] $ status --- status --- A file1 C file2 C file3 --- resolve --list --- U file1 U file2 --- debugmergestate --- * version 2 records local: ab57bf49aa276a22d35a473592d4c34b5abc3eff other: 10f9a0a634e82080907e62f075ab119cbc565ea6 labels: local: working copy other: destination file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390) local path: file1 (flags "") ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be) other path: file1 (node null) file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff) file: file2 (record type "C", state "u", hash null) local path: file2 (flags "") ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e) other path: file2 (node e7c1328648519852e723de86c0c0525acd779257) --- file1 --- 1 changed --- file2 --- 2 changed --- file3 --- 3 changed1 Test transitions between different merge tools $ testtransitions === :merge3 -> :local === (no more unresolved files) --- diff of status --- (status identical) === :local -> :other === (no more unresolved files) --- diff of status --- (status identical) === :other -> :prompt === local [working copy] changed file1 which other [destination] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? other [destination] changed file2 which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? --- diff of status --- (status identical) === :prompt -> :local === (no more unresolved files) --- diff of status --- (status identical) === :local -> :fail === --- diff of status --- (status identical) === :fail -> :other === (no more unresolved files) --- diff of status --- (status identical) === :other -> :local === (no more unresolved files) --- diff of status --- (status identical) === :local -> :prompt === local [working copy] changed file1 which other [destination] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? other [destination] changed file2 which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? --- diff of status --- (status identical) === :prompt -> :other === (no more unresolved files) --- diff of status --- (status identical) === :other -> :fail === --- diff of status --- (status identical) === :fail -> :prompt === local [working copy] changed file1 which other [destination] deleted use (c)hanged version, (d)elete, or leave (u)nresolved? other [destination] changed file2 which local [working copy] deleted use (c)hanged version, leave (d)eleted, or leave (u)nresolved? --- diff of status --- (status identical) === :prompt -> :fail === --- diff of status --- (status identical) === :fail -> :local === (no more unresolved files) --- diff of status --- (status identical) mercurial-4.5.3/tests/test-push-checkheads-unpushed-D4.t0000644015407300116100000000615713261161234023047 0ustar augieeng00000000000000==================================== Testing head checking code: Case D-4 ==================================== Mercurial checks for the introduction of new heads on push. Evolution comes into play to detect if existing branches on the server are being replaced by some of the new one we push. This case is part of a series of tests checking this behavior. Category D: remote head is "obs-affected" locally, but result is not part of the push TestCase 4: multi-changeset branch, split on multiple other, (base on its own new branch) .. old-state: .. .. * 2 branch (1 changeset, and 2 changesets) .. .. new-state: .. .. * 1 new branch superceeding the base of the old-2-changesets-branch, .. * 1 new changesets on the old-1-changeset-branch superceeding the head of the other .. .. expected-result: .. .. * push the new branch only -> push denied (variant a) .. * push the existing branch only -> push allowed (variant b) .. (pushing all is tested as case A-7) .. .. graph-summary: .. .. (variant a) .. .. B'○⇢ø B .. | | .. A | ø⇠◔ A' .. | |/ .. C â— | .. \| .. â— .. .. or (variant b) .. .. B'◔⇢ø B .. | | .. A | ø⇠○ A' .. | |/ .. C â— | .. \| .. â— $ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir D4 $ cd D4 $ setuprepos creating basic server and client repo updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd server $ mkcommit B0 $ hg up 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ mkcommit C0 created new head $ cd ../client $ hg pull pulling from $TESTTMP/D4/server searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files (+1 heads) new changesets d73caddc5533:0f88766e02d6 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit A1 created new head $ hg up 'desc(C0)' 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ mkcommit B1 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` obsoleted 1 changesets $ hg log -G --hidden @ d70a1f75a020 (draft): B1 | | o f6082bc4ffef (draft): A1 | | o | 0f88766e02d6 (draft): C0 |/ | x d73caddc5533 (draft): B0 | | | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): root Actual testing (new branch only) -------------------------------- $ hg push --rev 'desc(A1)' pushing to $TESTTMP/D4/server searching for changes abort: push creates new remote head f6082bc4ffef! (merge or see 'hg help push' for details about pushing new heads) [255] Actual testing (existing branch only) ------------------------------------ $ hg push --rev 'desc(B1)' pushing to $TESTTMP/D4/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files 1 new obsolescence markers obsoleted 1 changesets $ cd ../.. mercurial-4.5.3/tests/test-convert-tla.t0000644015407300116100000000777613261161234020160 0ustar augieeng00000000000000#require tla symlink $ tla my-id "mercurial " $ echo "[extensions]" >> $HGRCPATH $ echo "convert=" >> $HGRCPATH create tla archive $ tla make-archive tla@mercurial--convert `pwd`/hg-test-convert-tla initialize tla repo $ mkdir tla-repo $ cd tla-repo/ $ tla init-tree tla@mercurial--convert/tla--test--0 $ tla import * creating version tla@mercurial--convert/tla--test--0 * imported tla@mercurial--convert/tla--test--0 create initial files $ echo 'this is a file' > a $ tla add a $ mkdir src $ tla add src $ cd src $ dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null $ tla add b $ tla commit -s "added a file, src and src/b (binary)" A/ .arch-ids A/ src A/ src/.arch-ids A .arch-ids/a.id A a A src/.arch-ids/=id A src/.arch-ids/b.id A src/b * update pristine tree (tla@mercurial--convert/tla--test--0--base-0 => tla--test--0--patch-1) * committed tla@mercurial--convert/tla--test--0--patch-1 create link file and modify a $ ln -s ../a a-link $ tla add a-link $ echo 'this a modification to a' >> ../a $ tla commit -s "added link to a and modify a" A src/.arch-ids/a-link.id A src/a-link M a * update pristine tree (tla@mercurial--convert/tla--test--0--patch-1 => tla--test--0--patch-2) * committed tla@mercurial--convert/tla--test--0--patch-2 create second link and modify b $ ln -s ../a a-link-2 $ tla add a-link-2 $ dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null $ tla commit -s "added second link and modify b" A src/.arch-ids/a-link-2.id A src/a-link-2 Mb src/b * update pristine tree (tla@mercurial--convert/tla--test--0--patch-2 => tla--test--0--patch-3) * committed tla@mercurial--convert/tla--test--0--patch-3 b file to link and a-link-2 to regular file $ rm -f a-link-2 $ echo 'this is now a regular file' > a-link-2 $ ln -sf ../a b $ tla commit -s "file to link and link to file test" fl src/b lf src/a-link-2 * update pristine tree (tla@mercurial--convert/tla--test--0--patch-3 => tla--test--0--patch-4) * committed tla@mercurial--convert/tla--test--0--patch-4 move a-link-2 file and src directory $ cd .. $ tla mv src/a-link-2 c $ tla mv src test $ tla commit -s "move and rename a-link-2 file and src directory" D/ src/.arch-ids A/ test/.arch-ids /> src test => src/.arch-ids/a-link-2.id .arch-ids/c.id => src/a-link-2 c => src/.arch-ids/=id test/.arch-ids/=id => src/.arch-ids/a-link.id test/.arch-ids/a-link.id => src/.arch-ids/b.id test/.arch-ids/b.id * update pristine tree (tla@mercurial--convert/tla--test--0--patch-4 => tla--test--0--patch-5) * committed tla@mercurial--convert/tla--test--0--patch-5 $ cd .. converting tla repo to Mercurial $ hg convert tla-repo tla-repo-hg initializing destination tla-repo-hg repository analyzing tree version tla@mercurial--convert/tla--test--0... scanning source... sorting... converting... 5 initial import 4 added a file, src and src/b (binary) 3 added link to a and modify a 2 added second link and modify b 1 file to link and link to file test 0 move and rename a-link-2 file and src directory $ tla register-archive -d tla@mercurial--convert $ glog() > { > hg log -G --template '{rev} "{desc|firstline}" files: {files}\n' "$@" > } show graph log $ glog -R tla-repo-hg o 5 "move and rename a-link-2 file and src directory" files: c src/a-link src/a-link-2 src/b test/a-link test/b | o 4 "file to link and link to file test" files: src/a-link-2 src/b | o 3 "added second link and modify b" files: src/a-link-2 src/b | o 2 "added link to a and modify a" files: a src/a-link | o 1 "added a file, src and src/b (binary)" files: a src/b | o 0 "initial import" files: $ hg up -q -R tla-repo-hg $ hg -R tla-repo-hg manifest --debug c4072c4b72e1cabace081888efa148ee80ca3cbb 644 a 0201ac32a3a8e86e303dff60366382a54b48a72e 644 c c0067ba5ff0b7c9a3eb17270839d04614c435623 644 @ test/a-link 375f4263d86feacdea7e3c27100abd1560f2a973 644 @ test/b mercurial-4.5.3/tests/test-glog-topological.t0000644015407300116100000000262413261161234021147 0ustar augieeng00000000000000This test file aims at test topological iteration and the various configuration it can has. $ cat >> $HGRCPATH << EOF > [ui] > logtemplate={rev}\n > EOF On this simple example, all topological branch are displayed in turn until we can finally display 0. this implies skipping from 8 to 3 and coming back to 7 later. $ hg init test01 $ cd test01 $ hg unbundle $TESTDIR/bundles/remote.hg adding changesets adding manifests adding file changes added 9 changesets with 7 changes to 4 files (+1 heads) new changesets bfaf4b5cbf01:916f1afdef90 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg log -G o 8 | | o 7 | | | o 6 | | | o 5 | | | o 4 | | o | 3 | | o | 2 | | o | 1 |/ o 0 (display all nodes) $ hg log -G -r 'sort(all(), topo)' o 8 | o 3 | o 2 | o 1 | | o 7 | | | o 6 | | | o 5 | | | o 4 |/ o 0 (display nodes filtered by log options) $ hg log -G -r 'sort(all(), topo)' -k '.3' o 8 | o 3 | ~ o 7 | o 6 | ~ (revset skipping nodes) $ hg log -G --rev 'sort(not (2+6), topo)' o 8 | o 3 : o 1 | | o 7 | : | o 5 | | | o 4 |/ o 0 (begin) from the other branch $ hg log -G -r 'sort(all(), topo, topo.firstbranch=5)' o 7 | o 6 | o 5 | o 4 | | o 8 | | | o 3 | | | o 2 | | | o 1 |/ o 0 mercurial-4.5.3/tests/test-encoding-align.t0000644015407300116100000001226713261161234020567 0ustar augieeng00000000000000Test alignment of multibyte characters $ HGENCODING=utf-8 $ export HGENCODING $ hg init t $ cd t $ $PYTHON << EOF > # (byte, width) = (6, 4) > s = "\xe7\x9f\xad\xe5\x90\x8d" > # (byte, width) = (7, 7): odd width is good for alignment test > m = "MIDDLE_" > # (byte, width) = (18, 12) > l = "\xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d" > f = file('s', 'w'); f.write(s); f.close() > f = file('m', 'w'); f.write(m); f.close() > f = file('l', 'w'); f.write(l); f.close() > # instant extension to show list of options > f = file('showoptlist.py', 'w'); f.write("""# encoding: utf-8 > from mercurial import registrar > cmdtable = {} > command = registrar.command(cmdtable) > > @command(b'showoptlist', > [('s', 'opt1', '', 'short width' + ' %(s)s' * 8, '%(s)s'), > ('m', 'opt2', '', 'middle width' + ' %(m)s' * 8, '%(m)s'), > ('l', 'opt3', '', 'long width' + ' %(l)s' * 8, '%(l)s')], > '') > def showoptlist(ui, repo, *pats, **opts): > '''dummy command to show option descriptions''' > return 0 > """ % globals()) > f.close() > EOF $ S=`cat s` $ M=`cat m` $ L=`cat l` alignment of option descriptions in help $ cat < .hg/hgrc > [extensions] > ja_ext = `pwd`/showoptlist.py > EOF check alignment of option descriptions in help $ hg help showoptlist hg showoptlist dummy command to show option descriptions options: -s --opt1 \xe7\x9f\xad\xe5\x90\x8d short width \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d \xe7\x9f\xad\xe5\x90\x8d (esc) -m --opt2 MIDDLE_ middle width MIDDLE_ MIDDLE_ MIDDLE_ MIDDLE_ MIDDLE_ MIDDLE_ MIDDLE_ MIDDLE_ -l --opt3 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d long width \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc) \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc) \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc) (some details hidden, use --verbose to show complete help) $ rm -f s; touch s $ rm -f m; touch m $ rm -f l; touch l add files $ cp s $S $ hg add $S $ cp m $M $ hg add $M $ cp l $L $ hg add $L commit(1) $ echo 'first line(1)' >> s; cp s $S $ echo 'first line(2)' >> m; cp m $M $ echo 'first line(3)' >> l; cp l $L $ hg commit -m 'first commit' -u $S commit(2) $ echo 'second line(1)' >> s; cp s $S $ echo 'second line(2)' >> m; cp m $M $ echo 'second line(3)' >> l; cp l $L $ hg commit -m 'second commit' -u $M commit(3) $ echo 'third line(1)' >> s; cp s $S $ echo 'third line(2)' >> m; cp m $M $ echo 'third line(3)' >> l; cp l $L $ hg commit -m 'third commit' -u $L check alignment of user names in annotate $ hg annotate -u $M \xe7\x9f\xad\xe5\x90\x8d: first line(2) (esc) MIDDLE_: second line(2) \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d: third line(2) (esc) check alignment of filenames in diffstat $ hg diff -c tip --stat MIDDLE_ | 1 + \xe7\x9f\xad\xe5\x90\x8d | 1 + (esc) \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d | 1 + (esc) 3 files changed, 3 insertions(+), 0 deletions(-) add branches/tags $ hg branch $S marked working directory as branch \xe7\x9f\xad\xe5\x90\x8d (esc) (branches are permanent and global, did you want a bookmark?) $ hg tag $S $ hg book -f $S $ hg branch $M marked working directory as branch MIDDLE_ $ hg tag $M $ hg book -f $M $ hg branch $L marked working directory as branch \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc) $ hg tag $L $ hg book -f $L check alignment of branches $ hg branches \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d 5:d745ff46155b (esc) MIDDLE_ 4:9259be597f19 (inactive) \xe7\x9f\xad\xe5\x90\x8d 3:b06c5b6def9e (inactive) (esc) default 2:64a70663cee8 (inactive) check alignment of tags $ hg tags tip 5:d745ff46155b \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d 4:9259be597f19 (esc) MIDDLE_ 3:b06c5b6def9e \xe7\x9f\xad\xe5\x90\x8d 2:64a70663cee8 (esc) check alignment of bookmarks $ hg book MIDDLE_ 5:d745ff46155b \xe7\x9f\xad\xe5\x90\x8d 4:9259be597f19 (esc) * \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d 5:d745ff46155b (esc) mercurial-4.5.3/tests/test-glog.t0000644015407300116100000031362613261161234016644 0ustar augieeng00000000000000@ (34) head | | o (33) head | | o | (32) expand |\ \ | o \ (31) expand | |\ \ | | o \ (30) expand | | |\ \ | | | o | (29) regular commit | | | | | | | o | | (28) merge zero known | | |\ \ \ o | | | | | (27) collapse |/ / / / / | | o---+ (26) merge one known; far right | | | | | +---o | | (25) merge one known; far left | | | | | | | o | | (24) merge one known; immediate right | | |\| | | | o | | (23) merge one known; immediate left | |/| | | +---o---+ (22) merge two known; one far left, one far right | | / / o | | | (21) expand |\ \ \ \ | o---+-+ (20) merge two known; two far right | / / / o | | | (19) expand |\ \ \ \ +---+---o (18) merge two known; two far left | | | | | o | | (17) expand | |\ \ \ | | o---+ (16) merge two known; one immediate right, one near right | | |/ / o | | | (15) expand |\ \ \ \ | o-----+ (14) merge two known; one immediate right, one far right | |/ / / o | | | (13) expand |\ \ \ \ +---o | | (12) merge two known; one immediate right, one far left | | |/ / | o | | (11) expand | |\ \ \ | | o---+ (10) merge two known; one immediate left, one near right | |/ / / o | | | (9) expand |\ \ \ \ | o-----+ (8) merge two known; one immediate left, one far right |/ / / / o | | | (7) expand |\ \ \ \ +---o | | (6) merge two known; one immediate left, one far left | |/ / / | o | | (5) expand | |\ \ \ | | o | | (4) merge two known; one immediate left, one immediate right | |/|/ / | o / / (3) collapse |/ / / o / / (2) collapse |/ / o / (1) collapse |/ o (0) root $ commit() > { > rev=$1 > msg=$2 > shift 2 > if [ "$#" -gt 0 ]; then > hg debugsetparents "$@" > fi > echo $rev > a > hg commit -Aqd "$rev 0" -m "($rev) $msg" > } $ cat > printrevset.py < from __future__ import absolute_import > from mercurial import ( > cmdutil, > commands, > extensions, > revsetlang, > smartset, > ) > > def logrevset(repo, pats, opts): > revs = cmdutil._logrevs(repo, opts) > if not revs: > return None > match, pats, slowpath = cmdutil._makelogmatcher(repo, revs, pats, opts) > return cmdutil._makelogrevset(repo, match, pats, slowpath, opts) > > def uisetup(ui): > def printrevset(orig, repo, pats, opts): > revs, filematcher = orig(repo, pats, opts) > if opts.get('print_revset'): > expr = logrevset(repo, pats, opts) > if expr: > tree = revsetlang.parse(expr) > tree = revsetlang.analyze(tree) > else: > tree = [] > ui = repo.ui > ui.write('%r\n' % (opts.get('rev', []),)) > ui.write(revsetlang.prettyformat(tree) + '\n') > ui.write(smartset.prettyformat(revs) + '\n') > revs = smartset.baseset() # display no revisions > return revs, filematcher > extensions.wrapfunction(cmdutil, 'getlogrevs', printrevset) > aliases, entry = cmdutil.findcmd('log', commands.table) > entry[1].append(('', 'print-revset', False, > 'print generated revset and exit (DEPRECATED)')) > EOF $ echo "[extensions]" >> $HGRCPATH $ echo "printrevset=`pwd`/printrevset.py" >> $HGRCPATH $ hg init repo $ cd repo Empty repo: $ hg log -G Building DAG: $ commit 0 "root" $ commit 1 "collapse" 0 $ commit 2 "collapse" 1 $ commit 3 "collapse" 2 $ commit 4 "merge two known; one immediate left, one immediate right" 1 3 $ commit 5 "expand" 3 4 $ commit 6 "merge two known; one immediate left, one far left" 2 5 $ commit 7 "expand" 2 5 $ commit 8 "merge two known; one immediate left, one far right" 0 7 $ commit 9 "expand" 7 8 $ commit 10 "merge two known; one immediate left, one near right" 0 6 $ commit 11 "expand" 6 10 $ commit 12 "merge two known; one immediate right, one far left" 1 9 $ commit 13 "expand" 9 11 $ commit 14 "merge two known; one immediate right, one far right" 0 12 $ commit 15 "expand" 13 14 $ commit 16 "merge two known; one immediate right, one near right" 0 1 $ commit 17 "expand" 12 16 $ commit 18 "merge two known; two far left" 1 15 $ commit 19 "expand" 15 17 $ commit 20 "merge two known; two far right" 0 18 $ commit 21 "expand" 19 20 $ commit 22 "merge two known; one far left, one far right" 18 21 $ commit 23 "merge one known; immediate left" 1 22 $ commit 24 "merge one known; immediate right" 0 23 $ commit 25 "merge one known; far left" 21 24 $ commit 26 "merge one known; far right" 18 25 $ commit 27 "collapse" 21 $ commit 28 "merge zero known" 1 26 $ commit 29 "regular commit" 0 $ commit 30 "expand" 28 29 $ commit 31 "expand" 21 30 $ commit 32 "expand" 27 31 $ commit 33 "head" 18 $ commit 34 "head" 32 $ hg log -G -q @ 34:fea3ac5810e0 | | o 33:68608f5145f9 | | o | 32:d06dffa21a31 |\ \ | o \ 31:621d83e11f67 | |\ \ | | o \ 30:6e11cd4b648f | | |\ \ | | | o | 29:cd9bb2be7593 | | | | | | | o | | 28:44ecd0b9ae99 | | |\ \ \ o | | | | | 27:886ed638191b |/ / / / / | | o---+ 26:7f25b6c2f0b9 | | | | | +---o | | 25:91da8ed57247 | | | | | | | o | | 24:a9c19a3d96b7 | | |\| | | | o | | 23:a01cddf0766d | |/| | | +---o---+ 22:e0d9cccacb5d | | / / o | | | 21:d42a756af44d |\ \ \ \ | o---+-+ 20:d30ed6450e32 | / / / o | | | 19:31ddc2c1573b |\ \ \ \ +---+---o 18:1aa84d96232a | | | | | o | | 17:44765d7c06e0 | |\ \ \ | | o---+ 16:3677d192927d | | |/ / o | | | 15:1dda3f72782d |\ \ \ \ | o-----+ 14:8eac370358ef | |/ / / o | | | 13:22d8966a97e3 |\ \ \ \ +---o | | 12:86b91144a6e9 | | |/ / | o | | 11:832d76e6bdf2 | |\ \ \ | | o---+ 10:74c64d036d72 | |/ / / o | | | 9:7010c0af0a35 |\ \ \ \ | o-----+ 8:7a0b11f71937 |/ / / / o | | | 7:b632bb1b1224 |\ \ \ \ +---o | | 6:b105a072e251 | |/ / / | o | | 5:4409d547b708 | |\ \ \ | | o | | 4:26a8bac39d9f | |/|/ / | o / / 3:27eef8ed80b4 |/ / / o / / 2:3d9a33b8d1e1 |/ / o / 1:6db2ef61d156 |/ o 0:e6eb3150255d $ hg log -G @ changeset: 34:fea3ac5810e0 | tag: tip | parent: 32:d06dffa21a31 | user: test | date: Thu Jan 01 00:00:34 1970 +0000 | summary: (34) head | | o changeset: 33:68608f5145f9 | | parent: 18:1aa84d96232a | | user: test | | date: Thu Jan 01 00:00:33 1970 +0000 | | summary: (33) head | | o | changeset: 32:d06dffa21a31 |\ \ parent: 27:886ed638191b | | | parent: 31:621d83e11f67 | | | user: test | | | date: Thu Jan 01 00:00:32 1970 +0000 | | | summary: (32) expand | | | | o | changeset: 31:621d83e11f67 | |\ \ parent: 21:d42a756af44d | | | | parent: 30:6e11cd4b648f | | | | user: test | | | | date: Thu Jan 01 00:00:31 1970 +0000 | | | | summary: (31) expand | | | | | | o | changeset: 30:6e11cd4b648f | | |\ \ parent: 28:44ecd0b9ae99 | | | | | parent: 29:cd9bb2be7593 | | | | | user: test | | | | | date: Thu Jan 01 00:00:30 1970 +0000 | | | | | summary: (30) expand | | | | | | | | o | changeset: 29:cd9bb2be7593 | | | | | parent: 0:e6eb3150255d | | | | | user: test | | | | | date: Thu Jan 01 00:00:29 1970 +0000 | | | | | summary: (29) regular commit | | | | | | | o | | changeset: 28:44ecd0b9ae99 | | |\ \ \ parent: 1:6db2ef61d156 | | | | | | parent: 26:7f25b6c2f0b9 | | | | | | user: test | | | | | | date: Thu Jan 01 00:00:28 1970 +0000 | | | | | | summary: (28) merge zero known | | | | | | o | | | | | changeset: 27:886ed638191b |/ / / / / parent: 21:d42a756af44d | | | | | user: test | | | | | date: Thu Jan 01 00:00:27 1970 +0000 | | | | | summary: (27) collapse | | | | | | | o---+ changeset: 26:7f25b6c2f0b9 | | | | | parent: 18:1aa84d96232a | | | | | parent: 25:91da8ed57247 | | | | | user: test | | | | | date: Thu Jan 01 00:00:26 1970 +0000 | | | | | summary: (26) merge one known; far right | | | | | +---o | | changeset: 25:91da8ed57247 | | | | | parent: 21:d42a756af44d | | | | | parent: 24:a9c19a3d96b7 | | | | | user: test | | | | | date: Thu Jan 01 00:00:25 1970 +0000 | | | | | summary: (25) merge one known; far left | | | | | | | o | | changeset: 24:a9c19a3d96b7 | | |\| | parent: 0:e6eb3150255d | | | | | parent: 23:a01cddf0766d | | | | | user: test | | | | | date: Thu Jan 01 00:00:24 1970 +0000 | | | | | summary: (24) merge one known; immediate right | | | | | | | o | | changeset: 23:a01cddf0766d | |/| | | parent: 1:6db2ef61d156 | | | | | parent: 22:e0d9cccacb5d | | | | | user: test | | | | | date: Thu Jan 01 00:00:23 1970 +0000 | | | | | summary: (23) merge one known; immediate left | | | | | +---o---+ changeset: 22:e0d9cccacb5d | | | | parent: 18:1aa84d96232a | | / / parent: 21:d42a756af44d | | | | user: test | | | | date: Thu Jan 01 00:00:22 1970 +0000 | | | | summary: (22) merge two known; one far left, one far right | | | | o | | | changeset: 21:d42a756af44d |\ \ \ \ parent: 19:31ddc2c1573b | | | | | parent: 20:d30ed6450e32 | | | | | user: test | | | | | date: Thu Jan 01 00:00:21 1970 +0000 | | | | | summary: (21) expand | | | | | | o---+-+ changeset: 20:d30ed6450e32 | | | | parent: 0:e6eb3150255d | / / / parent: 18:1aa84d96232a | | | | user: test | | | | date: Thu Jan 01 00:00:20 1970 +0000 | | | | summary: (20) merge two known; two far right | | | | o | | | changeset: 19:31ddc2c1573b |\ \ \ \ parent: 15:1dda3f72782d | | | | | parent: 17:44765d7c06e0 | | | | | user: test | | | | | date: Thu Jan 01 00:00:19 1970 +0000 | | | | | summary: (19) expand | | | | | +---+---o changeset: 18:1aa84d96232a | | | | parent: 1:6db2ef61d156 | | | | parent: 15:1dda3f72782d | | | | user: test | | | | date: Thu Jan 01 00:00:18 1970 +0000 | | | | summary: (18) merge two known; two far left | | | | | o | | changeset: 17:44765d7c06e0 | |\ \ \ parent: 12:86b91144a6e9 | | | | | parent: 16:3677d192927d | | | | | user: test | | | | | date: Thu Jan 01 00:00:17 1970 +0000 | | | | | summary: (17) expand | | | | | | | o---+ changeset: 16:3677d192927d | | | | | parent: 0:e6eb3150255d | | |/ / parent: 1:6db2ef61d156 | | | | user: test | | | | date: Thu Jan 01 00:00:16 1970 +0000 | | | | summary: (16) merge two known; one immediate right, one near right | | | | o | | | changeset: 15:1dda3f72782d |\ \ \ \ parent: 13:22d8966a97e3 | | | | | parent: 14:8eac370358ef | | | | | user: test | | | | | date: Thu Jan 01 00:00:15 1970 +0000 | | | | | summary: (15) expand | | | | | | o-----+ changeset: 14:8eac370358ef | | | | | parent: 0:e6eb3150255d | |/ / / parent: 12:86b91144a6e9 | | | | user: test | | | | date: Thu Jan 01 00:00:14 1970 +0000 | | | | summary: (14) merge two known; one immediate right, one far right | | | | o | | | changeset: 13:22d8966a97e3 |\ \ \ \ parent: 9:7010c0af0a35 | | | | | parent: 11:832d76e6bdf2 | | | | | user: test | | | | | date: Thu Jan 01 00:00:13 1970 +0000 | | | | | summary: (13) expand | | | | | +---o | | changeset: 12:86b91144a6e9 | | |/ / parent: 1:6db2ef61d156 | | | | parent: 9:7010c0af0a35 | | | | user: test | | | | date: Thu Jan 01 00:00:12 1970 +0000 | | | | summary: (12) merge two known; one immediate right, one far left | | | | | o | | changeset: 11:832d76e6bdf2 | |\ \ \ parent: 6:b105a072e251 | | | | | parent: 10:74c64d036d72 | | | | | user: test | | | | | date: Thu Jan 01 00:00:11 1970 +0000 | | | | | summary: (11) expand | | | | | | | o---+ changeset: 10:74c64d036d72 | | | | | parent: 0:e6eb3150255d | |/ / / parent: 6:b105a072e251 | | | | user: test | | | | date: Thu Jan 01 00:00:10 1970 +0000 | | | | summary: (10) merge two known; one immediate left, one near right | | | | o | | | changeset: 9:7010c0af0a35 |\ \ \ \ parent: 7:b632bb1b1224 | | | | | parent: 8:7a0b11f71937 | | | | | user: test | | | | | date: Thu Jan 01 00:00:09 1970 +0000 | | | | | summary: (9) expand | | | | | | o-----+ changeset: 8:7a0b11f71937 | | | | | parent: 0:e6eb3150255d |/ / / / parent: 7:b632bb1b1224 | | | | user: test | | | | date: Thu Jan 01 00:00:08 1970 +0000 | | | | summary: (8) merge two known; one immediate left, one far right | | | | o | | | changeset: 7:b632bb1b1224 |\ \ \ \ parent: 2:3d9a33b8d1e1 | | | | | parent: 5:4409d547b708 | | | | | user: test | | | | | date: Thu Jan 01 00:00:07 1970 +0000 | | | | | summary: (7) expand | | | | | +---o | | changeset: 6:b105a072e251 | |/ / / parent: 2:3d9a33b8d1e1 | | | | parent: 5:4409d547b708 | | | | user: test | | | | date: Thu Jan 01 00:00:06 1970 +0000 | | | | summary: (6) merge two known; one immediate left, one far left | | | | | o | | changeset: 5:4409d547b708 | |\ \ \ parent: 3:27eef8ed80b4 | | | | | parent: 4:26a8bac39d9f | | | | | user: test | | | | | date: Thu Jan 01 00:00:05 1970 +0000 | | | | | summary: (5) expand | | | | | | | o | | changeset: 4:26a8bac39d9f | |/|/ / parent: 1:6db2ef61d156 | | | | parent: 3:27eef8ed80b4 | | | | user: test | | | | date: Thu Jan 01 00:00:04 1970 +0000 | | | | summary: (4) merge two known; one immediate left, one immediate right | | | | | o | | changeset: 3:27eef8ed80b4 |/ / / user: test | | | date: Thu Jan 01 00:00:03 1970 +0000 | | | summary: (3) collapse | | | o | | changeset: 2:3d9a33b8d1e1 |/ / user: test | | date: Thu Jan 01 00:00:02 1970 +0000 | | summary: (2) collapse | | o | changeset: 1:6db2ef61d156 |/ user: test | date: Thu Jan 01 00:00:01 1970 +0000 | summary: (1) collapse | o changeset: 0:e6eb3150255d user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: (0) root File glog: $ hg log -G a @ changeset: 34:fea3ac5810e0 | tag: tip | parent: 32:d06dffa21a31 | user: test | date: Thu Jan 01 00:00:34 1970 +0000 | summary: (34) head | | o changeset: 33:68608f5145f9 | | parent: 18:1aa84d96232a | | user: test | | date: Thu Jan 01 00:00:33 1970 +0000 | | summary: (33) head | | o | changeset: 32:d06dffa21a31 |\ \ parent: 27:886ed638191b | | | parent: 31:621d83e11f67 | | | user: test | | | date: Thu Jan 01 00:00:32 1970 +0000 | | | summary: (32) expand | | | | o | changeset: 31:621d83e11f67 | |\ \ parent: 21:d42a756af44d | | | | parent: 30:6e11cd4b648f | | | | user: test | | | | date: Thu Jan 01 00:00:31 1970 +0000 | | | | summary: (31) expand | | | | | | o | changeset: 30:6e11cd4b648f | | |\ \ parent: 28:44ecd0b9ae99 | | | | | parent: 29:cd9bb2be7593 | | | | | user: test | | | | | date: Thu Jan 01 00:00:30 1970 +0000 | | | | | summary: (30) expand | | | | | | | | o | changeset: 29:cd9bb2be7593 | | | | | parent: 0:e6eb3150255d | | | | | user: test | | | | | date: Thu Jan 01 00:00:29 1970 +0000 | | | | | summary: (29) regular commit | | | | | | | o | | changeset: 28:44ecd0b9ae99 | | |\ \ \ parent: 1:6db2ef61d156 | | | | | | parent: 26:7f25b6c2f0b9 | | | | | | user: test | | | | | | date: Thu Jan 01 00:00:28 1970 +0000 | | | | | | summary: (28) merge zero known | | | | | | o | | | | | changeset: 27:886ed638191b |/ / / / / parent: 21:d42a756af44d | | | | | user: test | | | | | date: Thu Jan 01 00:00:27 1970 +0000 | | | | | summary: (27) collapse | | | | | | | o---+ changeset: 26:7f25b6c2f0b9 | | | | | parent: 18:1aa84d96232a | | | | | parent: 25:91da8ed57247 | | | | | user: test | | | | | date: Thu Jan 01 00:00:26 1970 +0000 | | | | | summary: (26) merge one known; far right | | | | | +---o | | changeset: 25:91da8ed57247 | | | | | parent: 21:d42a756af44d | | | | | parent: 24:a9c19a3d96b7 | | | | | user: test | | | | | date: Thu Jan 01 00:00:25 1970 +0000 | | | | | summary: (25) merge one known; far left | | | | | | | o | | changeset: 24:a9c19a3d96b7 | | |\| | parent: 0:e6eb3150255d | | | | | parent: 23:a01cddf0766d | | | | | user: test | | | | | date: Thu Jan 01 00:00:24 1970 +0000 | | | | | summary: (24) merge one known; immediate right | | | | | | | o | | changeset: 23:a01cddf0766d | |/| | | parent: 1:6db2ef61d156 | | | | | parent: 22:e0d9cccacb5d | | | | | user: test | | | | | date: Thu Jan 01 00:00:23 1970 +0000 | | | | | summary: (23) merge one known; immediate left | | | | | +---o---+ changeset: 22:e0d9cccacb5d | | | | parent: 18:1aa84d96232a | | / / parent: 21:d42a756af44d | | | | user: test | | | | date: Thu Jan 01 00:00:22 1970 +0000 | | | | summary: (22) merge two known; one far left, one far right | | | | o | | | changeset: 21:d42a756af44d |\ \ \ \ parent: 19:31ddc2c1573b | | | | | parent: 20:d30ed6450e32 | | | | | user: test | | | | | date: Thu Jan 01 00:00:21 1970 +0000 | | | | | summary: (21) expand | | | | | | o---+-+ changeset: 20:d30ed6450e32 | | | | parent: 0:e6eb3150255d | / / / parent: 18:1aa84d96232a | | | | user: test | | | | date: Thu Jan 01 00:00:20 1970 +0000 | | | | summary: (20) merge two known; two far right | | | | o | | | changeset: 19:31ddc2c1573b |\ \ \ \ parent: 15:1dda3f72782d | | | | | parent: 17:44765d7c06e0 | | | | | user: test | | | | | date: Thu Jan 01 00:00:19 1970 +0000 | | | | | summary: (19) expand | | | | | +---+---o changeset: 18:1aa84d96232a | | | | parent: 1:6db2ef61d156 | | | | parent: 15:1dda3f72782d | | | | user: test | | | | date: Thu Jan 01 00:00:18 1970 +0000 | | | | summary: (18) merge two known; two far left | | | | | o | | changeset: 17:44765d7c06e0 | |\ \ \ parent: 12:86b91144a6e9 | | | | | parent: 16:3677d192927d | | | | | user: test | | | | | date: Thu Jan 01 00:00:17 1970 +0000 | | | | | summary: (17) expand | | | | | | | o---+ changeset: 16:3677d192927d | | | | | parent: 0:e6eb3150255d | | |/ / parent: 1:6db2ef61d156 | | | | user: test | | | | date: Thu Jan 01 00:00:16 1970 +0000 | | | | summary: (16) merge two known; one immediate right, one near right | | | | o | | | changeset: 15:1dda3f72782d |\ \ \ \ parent: 13:22d8966a97e3 | | | | | parent: 14:8eac370358ef | | | | | user: test | | | | | date: Thu Jan 01 00:00:15 1970 +0000 | | | | | summary: (15) expand | | | | | | o-----+ changeset: 14:8eac370358ef | | | | | parent: 0:e6eb3150255d | |/ / / parent: 12:86b91144a6e9 | | | | user: test | | | | date: Thu Jan 01 00:00:14 1970 +0000 | | | | summary: (14) merge two known; one immediate right, one far right | | | | o | | | changeset: 13:22d8966a97e3 |\ \ \ \ parent: 9:7010c0af0a35 | | | | | parent: 11:832d76e6bdf2 | | | | | user: test | | | | | date: Thu Jan 01 00:00:13 1970 +0000 | | | | | summary: (13) expand | | | | | +---o | | changeset: 12:86b91144a6e9 | | |/ / parent: 1:6db2ef61d156 | | | | parent: 9:7010c0af0a35 | | | | user: test | | | | date: Thu Jan 01 00:00:12 1970 +0000 | | | | summary: (12) merge two known; one immediate right, one far left | | | | | o | | changeset: 11:832d76e6bdf2 | |\ \ \ parent: 6:b105a072e251 | | | | | parent: 10:74c64d036d72 | | | | | user: test | | | | | date: Thu Jan 01 00:00:11 1970 +0000 | | | | | summary: (11) expand | | | | | | | o---+ changeset: 10:74c64d036d72 | | | | | parent: 0:e6eb3150255d | |/ / / parent: 6:b105a072e251 | | | | user: test | | | | date: Thu Jan 01 00:00:10 1970 +0000 | | | | summary: (10) merge two known; one immediate left, one near right | | | | o | | | changeset: 9:7010c0af0a35 |\ \ \ \ parent: 7:b632bb1b1224 | | | | | parent: 8:7a0b11f71937 | | | | | user: test | | | | | date: Thu Jan 01 00:00:09 1970 +0000 | | | | | summary: (9) expand | | | | | | o-----+ changeset: 8:7a0b11f71937 | | | | | parent: 0:e6eb3150255d |/ / / / parent: 7:b632bb1b1224 | | | | user: test | | | | date: Thu Jan 01 00:00:08 1970 +0000 | | | | summary: (8) merge two known; one immediate left, one far right | | | | o | | | changeset: 7:b632bb1b1224 |\ \ \ \ parent: 2:3d9a33b8d1e1 | | | | | parent: 5:4409d547b708 | | | | | user: test | | | | | date: Thu Jan 01 00:00:07 1970 +0000 | | | | | summary: (7) expand | | | | | +---o | | changeset: 6:b105a072e251 | |/ / / parent: 2:3d9a33b8d1e1 | | | | parent: 5:4409d547b708 | | | | user: test | | | | date: Thu Jan 01 00:00:06 1970 +0000 | | | | summary: (6) merge two known; one immediate left, one far left | | | | | o | | changeset: 5:4409d547b708 | |\ \ \ parent: 3:27eef8ed80b4 | | | | | parent: 4:26a8bac39d9f | | | | | user: test | | | | | date: Thu Jan 01 00:00:05 1970 +0000 | | | | | summary: (5) expand | | | | | | | o | | changeset: 4:26a8bac39d9f | |/|/ / parent: 1:6db2ef61d156 | | | | parent: 3:27eef8ed80b4 | | | | user: test | | | | date: Thu Jan 01 00:00:04 1970 +0000 | | | | summary: (4) merge two known; one immediate left, one immediate right | | | | | o | | changeset: 3:27eef8ed80b4 |/ / / user: test | | | date: Thu Jan 01 00:00:03 1970 +0000 | | | summary: (3) collapse | | | o | | changeset: 2:3d9a33b8d1e1 |/ / user: test | | date: Thu Jan 01 00:00:02 1970 +0000 | | summary: (2) collapse | | o | changeset: 1:6db2ef61d156 |/ user: test | date: Thu Jan 01 00:00:01 1970 +0000 | summary: (1) collapse | o changeset: 0:e6eb3150255d user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: (0) root File glog per revset: $ hg log -G -r 'file("a")' @ changeset: 34:fea3ac5810e0 | tag: tip | parent: 32:d06dffa21a31 | user: test | date: Thu Jan 01 00:00:34 1970 +0000 | summary: (34) head | | o changeset: 33:68608f5145f9 | | parent: 18:1aa84d96232a | | user: test | | date: Thu Jan 01 00:00:33 1970 +0000 | | summary: (33) head | | o | changeset: 32:d06dffa21a31 |\ \ parent: 27:886ed638191b | | | parent: 31:621d83e11f67 | | | user: test | | | date: Thu Jan 01 00:00:32 1970 +0000 | | | summary: (32) expand | | | | o | changeset: 31:621d83e11f67 | |\ \ parent: 21:d42a756af44d | | | | parent: 30:6e11cd4b648f | | | | user: test | | | | date: Thu Jan 01 00:00:31 1970 +0000 | | | | summary: (31) expand | | | | | | o | changeset: 30:6e11cd4b648f | | |\ \ parent: 28:44ecd0b9ae99 | | | | | parent: 29:cd9bb2be7593 | | | | | user: test | | | | | date: Thu Jan 01 00:00:30 1970 +0000 | | | | | summary: (30) expand | | | | | | | | o | changeset: 29:cd9bb2be7593 | | | | | parent: 0:e6eb3150255d | | | | | user: test | | | | | date: Thu Jan 01 00:00:29 1970 +0000 | | | | | summary: (29) regular commit | | | | | | | o | | changeset: 28:44ecd0b9ae99 | | |\ \ \ parent: 1:6db2ef61d156 | | | | | | parent: 26:7f25b6c2f0b9 | | | | | | user: test | | | | | | date: Thu Jan 01 00:00:28 1970 +0000 | | | | | | summary: (28) merge zero known | | | | | | o | | | | | changeset: 27:886ed638191b |/ / / / / parent: 21:d42a756af44d | | | | | user: test | | | | | date: Thu Jan 01 00:00:27 1970 +0000 | | | | | summary: (27) collapse | | | | | | | o---+ changeset: 26:7f25b6c2f0b9 | | | | | parent: 18:1aa84d96232a | | | | | parent: 25:91da8ed57247 | | | | | user: test | | | | | date: Thu Jan 01 00:00:26 1970 +0000 | | | | | summary: (26) merge one known; far right | | | | | +---o | | changeset: 25:91da8ed57247 | | | | | parent: 21:d42a756af44d | | | | | parent: 24:a9c19a3d96b7 | | | | | user: test | | | | | date: Thu Jan 01 00:00:25 1970 +0000 | | | | | summary: (25) merge one known; far left | | | | | | | o | | changeset: 24:a9c19a3d96b7 | | |\| | parent: 0:e6eb3150255d | | | | | parent: 23:a01cddf0766d | | | | | user: test | | | | | date: Thu Jan 01 00:00:24 1970 +0000 | | | | | summary: (24) merge one known; immediate right | | | | | | | o | | changeset: 23:a01cddf0766d | |/| | | parent: 1:6db2ef61d156 | | | | | parent: 22:e0d9cccacb5d | | | | | user: test | | | | | date: Thu Jan 01 00:00:23 1970 +0000 | | | | | summary: (23) merge one known; immediate left | | | | | +---o---+ changeset: 22:e0d9cccacb5d | | | | parent: 18:1aa84d96232a | | / / parent: 21:d42a756af44d | | | | user: test | | | | date: Thu Jan 01 00:00:22 1970 +0000 | | | | summary: (22) merge two known; one far left, one far right | | | | o | | | changeset: 21:d42a756af44d |\ \ \ \ parent: 19:31ddc2c1573b | | | | | parent: 20:d30ed6450e32 | | | | | user: test | | | | | date: Thu Jan 01 00:00:21 1970 +0000 | | | | | summary: (21) expand | | | | | | o---+-+ changeset: 20:d30ed6450e32 | | | | parent: 0:e6eb3150255d | / / / parent: 18:1aa84d96232a | | | | user: test | | | | date: Thu Jan 01 00:00:20 1970 +0000 | | | | summary: (20) merge two known; two far right | | | | o | | | changeset: 19:31ddc2c1573b |\ \ \ \ parent: 15:1dda3f72782d | | | | | parent: 17:44765d7c06e0 | | | | | user: test | | | | | date: Thu Jan 01 00:00:19 1970 +0000 | | | | | summary: (19) expand | | | | | +---+---o changeset: 18:1aa84d96232a | | | | parent: 1:6db2ef61d156 | | | | parent: 15:1dda3f72782d | | | | user: test | | | | date: Thu Jan 01 00:00:18 1970 +0000 | | | | summary: (18) merge two known; two far left | | | | | o | | changeset: 17:44765d7c06e0 | |\ \ \ parent: 12:86b91144a6e9 | | | | | parent: 16:3677d192927d | | | | | user: test | | | | | date: Thu Jan 01 00:00:17 1970 +0000 | | | | | summary: (17) expand | | | | | | | o---+ changeset: 16:3677d192927d | | | | | parent: 0:e6eb3150255d | | |/ / parent: 1:6db2ef61d156 | | | | user: test | | | | date: Thu Jan 01 00:00:16 1970 +0000 | | | | summary: (16) merge two known; one immediate right, one near right | | | | o | | | changeset: 15:1dda3f72782d |\ \ \ \ parent: 13:22d8966a97e3 | | | | | parent: 14:8eac370358ef | | | | | user: test | | | | | date: Thu Jan 01 00:00:15 1970 +0000 | | | | | summary: (15) expand | | | | | | o-----+ changeset: 14:8eac370358ef | | | | | parent: 0:e6eb3150255d | |/ / / parent: 12:86b91144a6e9 | | | | user: test | | | | date: Thu Jan 01 00:00:14 1970 +0000 | | | | summary: (14) merge two known; one immediate right, one far right | | | | o | | | changeset: 13:22d8966a97e3 |\ \ \ \ parent: 9:7010c0af0a35 | | | | | parent: 11:832d76e6bdf2 | | | | | user: test | | | | | date: Thu Jan 01 00:00:13 1970 +0000 | | | | | summary: (13) expand | | | | | +---o | | changeset: 12:86b91144a6e9 | | |/ / parent: 1:6db2ef61d156 | | | | parent: 9:7010c0af0a35 | | | | user: test | | | | date: Thu Jan 01 00:00:12 1970 +0000 | | | | summary: (12) merge two known; one immediate right, one far left | | | | | o | | changeset: 11:832d76e6bdf2 | |\ \ \ parent: 6:b105a072e251 | | | | | parent: 10:74c64d036d72 | | | | | user: test | | | | | date: Thu Jan 01 00:00:11 1970 +0000 | | | | | summary: (11) expand | | | | | | | o---+ changeset: 10:74c64d036d72 | | | | | parent: 0:e6eb3150255d | |/ / / parent: 6:b105a072e251 | | | | user: test | | | | date: Thu Jan 01 00:00:10 1970 +0000 | | | | summary: (10) merge two known; one immediate left, one near right | | | | o | | | changeset: 9:7010c0af0a35 |\ \ \ \ parent: 7:b632bb1b1224 | | | | | parent: 8:7a0b11f71937 | | | | | user: test | | | | | date: Thu Jan 01 00:00:09 1970 +0000 | | | | | summary: (9) expand | | | | | | o-----+ changeset: 8:7a0b11f71937 | | | | | parent: 0:e6eb3150255d |/ / / / parent: 7:b632bb1b1224 | | | | user: test | | | | date: Thu Jan 01 00:00:08 1970 +0000 | | | | summary: (8) merge two known; one immediate left, one far right | | | | o | | | changeset: 7:b632bb1b1224 |\ \ \ \ parent: 2:3d9a33b8d1e1 | | | | | parent: 5:4409d547b708 | | | | | user: test | | | | | date: Thu Jan 01 00:00:07 1970 +0000 | | | | | summary: (7) expand | | | | | +---o | | changeset: 6:b105a072e251 | |/ / / parent: 2:3d9a33b8d1e1 | | | | parent: 5:4409d547b708 | | | | user: test | | | | date: Thu Jan 01 00:00:06 1970 +0000 | | | | summary: (6) merge two known; one immediate left, one far left | | | | | o | | changeset: 5:4409d547b708 | |\ \ \ parent: 3:27eef8ed80b4 | | | | | parent: 4:26a8bac39d9f | | | | | user: test | | | | | date: Thu Jan 01 00:00:05 1970 +0000 | | | | | summary: (5) expand | | | | | | | o | | changeset: 4:26a8bac39d9f | |/|/ / parent: 1:6db2ef61d156 | | | | parent: 3:27eef8ed80b4 | | | | user: test | | | | date: Thu Jan 01 00:00:04 1970 +0000 | | | | summary: (4) merge two known; one immediate left, one immediate right | | | | | o | | changeset: 3:27eef8ed80b4 |/ / / user: test | | | date: Thu Jan 01 00:00:03 1970 +0000 | | | summary: (3) collapse | | | o | | changeset: 2:3d9a33b8d1e1 |/ / user: test | | date: Thu Jan 01 00:00:02 1970 +0000 | | summary: (2) collapse | | o | changeset: 1:6db2ef61d156 |/ user: test | date: Thu Jan 01 00:00:01 1970 +0000 | summary: (1) collapse | o changeset: 0:e6eb3150255d user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: (0) root File glog per revset (only merges): $ hg log -G -r 'file("a")' -m o changeset: 32:d06dffa21a31 |\ parent: 27:886ed638191b | : parent: 31:621d83e11f67 | : user: test | : date: Thu Jan 01 00:00:32 1970 +0000 | : summary: (32) expand | : o : changeset: 31:621d83e11f67 |\: parent: 21:d42a756af44d | : parent: 30:6e11cd4b648f | : user: test | : date: Thu Jan 01 00:00:31 1970 +0000 | : summary: (31) expand | : o : changeset: 30:6e11cd4b648f |\ \ parent: 28:44ecd0b9ae99 | ~ : parent: 29:cd9bb2be7593 | : user: test | : date: Thu Jan 01 00:00:30 1970 +0000 | : summary: (30) expand | / o : changeset: 28:44ecd0b9ae99 |\ \ parent: 1:6db2ef61d156 | ~ : parent: 26:7f25b6c2f0b9 | : user: test | : date: Thu Jan 01 00:00:28 1970 +0000 | : summary: (28) merge zero known | / o : changeset: 26:7f25b6c2f0b9 |\ \ parent: 18:1aa84d96232a | | : parent: 25:91da8ed57247 | | : user: test | | : date: Thu Jan 01 00:00:26 1970 +0000 | | : summary: (26) merge one known; far right | | : | o : changeset: 25:91da8ed57247 | |\: parent: 21:d42a756af44d | | : parent: 24:a9c19a3d96b7 | | : user: test | | : date: Thu Jan 01 00:00:25 1970 +0000 | | : summary: (25) merge one known; far left | | : | o : changeset: 24:a9c19a3d96b7 | |\ \ parent: 0:e6eb3150255d | | ~ : parent: 23:a01cddf0766d | | : user: test | | : date: Thu Jan 01 00:00:24 1970 +0000 | | : summary: (24) merge one known; immediate right | | / | o : changeset: 23:a01cddf0766d | |\ \ parent: 1:6db2ef61d156 | | ~ : parent: 22:e0d9cccacb5d | | : user: test | | : date: Thu Jan 01 00:00:23 1970 +0000 | | : summary: (23) merge one known; immediate left | | / | o : changeset: 22:e0d9cccacb5d |/:/ parent: 18:1aa84d96232a | : parent: 21:d42a756af44d | : user: test | : date: Thu Jan 01 00:00:22 1970 +0000 | : summary: (22) merge two known; one far left, one far right | : | o changeset: 21:d42a756af44d | |\ parent: 19:31ddc2c1573b | | | parent: 20:d30ed6450e32 | | | user: test | | | date: Thu Jan 01 00:00:21 1970 +0000 | | | summary: (21) expand | | | +---o changeset: 20:d30ed6450e32 | | | parent: 0:e6eb3150255d | | ~ parent: 18:1aa84d96232a | | user: test | | date: Thu Jan 01 00:00:20 1970 +0000 | | summary: (20) merge two known; two far right | | | o changeset: 19:31ddc2c1573b | |\ parent: 15:1dda3f72782d | | | parent: 17:44765d7c06e0 | | | user: test | | | date: Thu Jan 01 00:00:19 1970 +0000 | | | summary: (19) expand | | | o | | changeset: 18:1aa84d96232a |\| | parent: 1:6db2ef61d156 ~ | | parent: 15:1dda3f72782d | | user: test | | date: Thu Jan 01 00:00:18 1970 +0000 | | summary: (18) merge two known; two far left / / | o changeset: 17:44765d7c06e0 | |\ parent: 12:86b91144a6e9 | | | parent: 16:3677d192927d | | | user: test | | | date: Thu Jan 01 00:00:17 1970 +0000 | | | summary: (17) expand | | | | | o changeset: 16:3677d192927d | | |\ parent: 0:e6eb3150255d | | ~ ~ parent: 1:6db2ef61d156 | | user: test | | date: Thu Jan 01 00:00:16 1970 +0000 | | summary: (16) merge two known; one immediate right, one near right | | o | changeset: 15:1dda3f72782d |\ \ parent: 13:22d8966a97e3 | | | parent: 14:8eac370358ef | | | user: test | | | date: Thu Jan 01 00:00:15 1970 +0000 | | | summary: (15) expand | | | | o | changeset: 14:8eac370358ef | |\| parent: 0:e6eb3150255d | ~ | parent: 12:86b91144a6e9 | | user: test | | date: Thu Jan 01 00:00:14 1970 +0000 | | summary: (14) merge two known; one immediate right, one far right | / o | changeset: 13:22d8966a97e3 |\ \ parent: 9:7010c0af0a35 | | | parent: 11:832d76e6bdf2 | | | user: test | | | date: Thu Jan 01 00:00:13 1970 +0000 | | | summary: (13) expand | | | +---o changeset: 12:86b91144a6e9 | | | parent: 1:6db2ef61d156 | | ~ parent: 9:7010c0af0a35 | | user: test | | date: Thu Jan 01 00:00:12 1970 +0000 | | summary: (12) merge two known; one immediate right, one far left | | | o changeset: 11:832d76e6bdf2 | |\ parent: 6:b105a072e251 | | | parent: 10:74c64d036d72 | | | user: test | | | date: Thu Jan 01 00:00:11 1970 +0000 | | | summary: (11) expand | | | | | o changeset: 10:74c64d036d72 | |/| parent: 0:e6eb3150255d | | ~ parent: 6:b105a072e251 | | user: test | | date: Thu Jan 01 00:00:10 1970 +0000 | | summary: (10) merge two known; one immediate left, one near right | | o | changeset: 9:7010c0af0a35 |\ \ parent: 7:b632bb1b1224 | | | parent: 8:7a0b11f71937 | | | user: test | | | date: Thu Jan 01 00:00:09 1970 +0000 | | | summary: (9) expand | | | | o | changeset: 8:7a0b11f71937 |/| | parent: 0:e6eb3150255d | ~ | parent: 7:b632bb1b1224 | | user: test | | date: Thu Jan 01 00:00:08 1970 +0000 | | summary: (8) merge two known; one immediate left, one far right | / o | changeset: 7:b632bb1b1224 |\ \ parent: 2:3d9a33b8d1e1 | ~ | parent: 5:4409d547b708 | | user: test | | date: Thu Jan 01 00:00:07 1970 +0000 | | summary: (7) expand | / | o changeset: 6:b105a072e251 |/| parent: 2:3d9a33b8d1e1 | ~ parent: 5:4409d547b708 | user: test | date: Thu Jan 01 00:00:06 1970 +0000 | summary: (6) merge two known; one immediate left, one far left | o changeset: 5:4409d547b708 |\ parent: 3:27eef8ed80b4 | ~ parent: 4:26a8bac39d9f | user: test | date: Thu Jan 01 00:00:05 1970 +0000 | summary: (5) expand | o changeset: 4:26a8bac39d9f |\ parent: 1:6db2ef61d156 ~ ~ parent: 3:27eef8ed80b4 user: test date: Thu Jan 01 00:00:04 1970 +0000 summary: (4) merge two known; one immediate left, one immediate right Empty revision range - display nothing: $ hg log -G -r 1..0 $ cd .. #if no-outer-repo From outer space: $ hg log -G -l1 repo @ changeset: 34:fea3ac5810e0 | tag: tip ~ parent: 32:d06dffa21a31 user: test date: Thu Jan 01 00:00:34 1970 +0000 summary: (34) head $ hg log -G -l1 repo/a @ changeset: 34:fea3ac5810e0 | tag: tip ~ parent: 32:d06dffa21a31 user: test date: Thu Jan 01 00:00:34 1970 +0000 summary: (34) head $ hg log -G -l1 repo/missing #endif File log with revs != cset revs: $ hg init flog $ cd flog $ echo one >one $ hg add one $ hg commit -mone $ echo two >two $ hg add two $ hg commit -mtwo $ echo more >two $ hg commit -mmore $ hg log -G two @ changeset: 2:12c28321755b | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: more | o changeset: 1:5ac72c0599bf | user: test ~ date: Thu Jan 01 00:00:00 1970 +0000 summary: two Issue1896: File log with explicit style $ hg log -G --style=default one o changeset: 0:3d578b4a1f53 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: one Issue2395: glog --style header and footer $ hg log -G --style=xml one o test 1970-01-01T00:00:00+00:00 one $ cd .. Incoming and outgoing: $ hg clone -U -r31 repo repo2 adding changesets adding manifests adding file changes added 31 changesets with 31 changes to 1 files new changesets e6eb3150255d:621d83e11f67 $ cd repo2 $ hg incoming --graph ../repo comparing with ../repo searching for changes o changeset: 34:fea3ac5810e0 | tag: tip | parent: 32:d06dffa21a31 | user: test | date: Thu Jan 01 00:00:34 1970 +0000 | summary: (34) head | | o changeset: 33:68608f5145f9 | parent: 18:1aa84d96232a | user: test | date: Thu Jan 01 00:00:33 1970 +0000 | summary: (33) head | o changeset: 32:d06dffa21a31 | parent: 27:886ed638191b | parent: 31:621d83e11f67 | user: test | date: Thu Jan 01 00:00:32 1970 +0000 | summary: (32) expand | o changeset: 27:886ed638191b parent: 21:d42a756af44d user: test date: Thu Jan 01 00:00:27 1970 +0000 summary: (27) collapse $ cd .. $ hg -R repo outgoing --graph repo2 comparing with repo2 searching for changes @ changeset: 34:fea3ac5810e0 | tag: tip | parent: 32:d06dffa21a31 | user: test | date: Thu Jan 01 00:00:34 1970 +0000 | summary: (34) head | | o changeset: 33:68608f5145f9 | parent: 18:1aa84d96232a | user: test | date: Thu Jan 01 00:00:33 1970 +0000 | summary: (33) head | o changeset: 32:d06dffa21a31 | parent: 27:886ed638191b | parent: 31:621d83e11f67 | user: test | date: Thu Jan 01 00:00:32 1970 +0000 | summary: (32) expand | o changeset: 27:886ed638191b parent: 21:d42a756af44d user: test date: Thu Jan 01 00:00:27 1970 +0000 summary: (27) collapse File + limit with revs != cset revs: $ cd repo $ touch b $ hg ci -Aqm0 $ hg log -G -l2 a o changeset: 34:fea3ac5810e0 | parent: 32:d06dffa21a31 ~ user: test date: Thu Jan 01 00:00:34 1970 +0000 summary: (34) head o changeset: 33:68608f5145f9 | parent: 18:1aa84d96232a ~ user: test date: Thu Jan 01 00:00:33 1970 +0000 summary: (33) head File + limit + -ra:b, (b - a) < limit: $ hg log -G -l3000 -r32:tip a o changeset: 34:fea3ac5810e0 | parent: 32:d06dffa21a31 | user: test | date: Thu Jan 01 00:00:34 1970 +0000 | summary: (34) head | | o changeset: 33:68608f5145f9 | | parent: 18:1aa84d96232a | ~ user: test | date: Thu Jan 01 00:00:33 1970 +0000 | summary: (33) head | o changeset: 32:d06dffa21a31 |\ parent: 27:886ed638191b ~ ~ parent: 31:621d83e11f67 user: test date: Thu Jan 01 00:00:32 1970 +0000 summary: (32) expand Point out a common and an uncommon unshown parent $ hg log -G -r 'rev(8) or rev(9)' o changeset: 9:7010c0af0a35 |\ parent: 7:b632bb1b1224 | ~ parent: 8:7a0b11f71937 | user: test | date: Thu Jan 01 00:00:09 1970 +0000 | summary: (9) expand | o changeset: 8:7a0b11f71937 |\ parent: 0:e6eb3150255d ~ ~ parent: 7:b632bb1b1224 user: test date: Thu Jan 01 00:00:08 1970 +0000 summary: (8) merge two known; one immediate left, one far right File + limit + -ra:b, b < tip: $ hg log -G -l1 -r32:34 a o changeset: 34:fea3ac5810e0 | parent: 32:d06dffa21a31 ~ user: test date: Thu Jan 01 00:00:34 1970 +0000 summary: (34) head file(File) + limit + -ra:b, b < tip: $ hg log -G -l1 -r32:34 -r 'file("a")' o changeset: 34:fea3ac5810e0 | parent: 32:d06dffa21a31 ~ user: test date: Thu Jan 01 00:00:34 1970 +0000 summary: (34) head limit(file(File) and a::b), b < tip: $ hg log -G -r 'limit(file("a") and 32::34, 1)' o changeset: 32:d06dffa21a31 |\ parent: 27:886ed638191b ~ ~ parent: 31:621d83e11f67 user: test date: Thu Jan 01 00:00:32 1970 +0000 summary: (32) expand File + limit + -ra:b, b < tip: $ hg log -G -r 'limit(file("a") and 34::32, 1)' File + limit + -ra:b, b < tip, (b - a) < limit: $ hg log -G -l10 -r33:34 a o changeset: 34:fea3ac5810e0 | parent: 32:d06dffa21a31 ~ user: test date: Thu Jan 01 00:00:34 1970 +0000 summary: (34) head o changeset: 33:68608f5145f9 | parent: 18:1aa84d96232a ~ user: test date: Thu Jan 01 00:00:33 1970 +0000 summary: (33) head Do not crash or produce strange graphs if history is buggy $ hg branch branch marked working directory as branch branch (branches are permanent and global, did you want a bookmark?) $ commit 36 "buggy merge: identical parents" 35 35 $ hg log -G -l5 @ changeset: 36:08a19a744424 | branch: branch | tag: tip | parent: 35:9159c3644c5e | parent: 35:9159c3644c5e | user: test | date: Thu Jan 01 00:00:36 1970 +0000 | summary: (36) buggy merge: identical parents | o changeset: 35:9159c3644c5e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: 0 | o changeset: 34:fea3ac5810e0 | parent: 32:d06dffa21a31 | user: test | date: Thu Jan 01 00:00:34 1970 +0000 | summary: (34) head | | o changeset: 33:68608f5145f9 | | parent: 18:1aa84d96232a | ~ user: test | date: Thu Jan 01 00:00:33 1970 +0000 | summary: (33) head | o changeset: 32:d06dffa21a31 |\ parent: 27:886ed638191b ~ ~ parent: 31:621d83e11f67 user: test date: Thu Jan 01 00:00:32 1970 +0000 summary: (32) expand Test log -G options $ testlog() { > hg log -G --print-revset "$@" > hg log --template 'nodetag {rev}\n' "$@" | grep nodetag \ > | sed 's/.*nodetag/nodetag/' > log.nodes > hg log -G --template 'nodetag {rev}\n' "$@" | grep nodetag \ > | sed 's/.*nodetag/nodetag/' > glog.nodes > (cmp log.nodes glog.nodes || diff -u log.nodes glog.nodes) \ > | grep '^[-+@ ]' || : > } glog always reorders nodes which explains the difference with log $ testlog -r 27 -r 25 -r 21 -r 34 -r 32 -r 31 ['27', '25', '21', '34', '32', '31'] [] --- log.nodes * (glob) +++ glog.nodes * (glob) @@ -1,6 +1,6 @@ -nodetag 27 -nodetag 25 -nodetag 21 nodetag 34 nodetag 32 nodetag 31 +nodetag 27 +nodetag 25 +nodetag 21 $ testlog -u test -u not-a-user [] (or (list (func (symbol 'user') (string 'test')) (func (symbol 'user') (string 'not-a-user')))) , , >, , >>> $ testlog -b not-a-branch abort: unknown revision 'not-a-branch'! abort: unknown revision 'not-a-branch'! abort: unknown revision 'not-a-branch'! $ testlog -b 35 -b 36 --only-branch branch [] (or (list (func (symbol 'branch') (string 'default')) (or (list (func (symbol 'branch') (string 'branch')) (func (symbol 'branch') (string 'branch')))))) , , >, , >, , >>>> $ testlog -k expand -k merge [] (or (list (func (symbol 'keyword') (string 'expand')) (func (symbol 'keyword') (string 'merge')))) , , >, , >>> $ testlog --only-merges [] (func (symbol 'merge') None) , > $ testlog --no-merges [] (not (func (symbol 'merge') None)) , , >>> $ testlog --date '2 0 to 4 0' [] (func (symbol 'date') (string '2 0 to 4 0')) , > $ hg log -G -d 'brace ) in a date' hg: parse error: invalid date: 'brace ) in a date' [255] $ testlog --prune 31 --prune 32 [] (not (or (list (func (symbol 'ancestors') (string '31')) (func (symbol 'ancestors') (string '32'))))) , , >, , >>>> Dedicated repo for --follow and paths filtering. The g is crafted to have 2 filelog topological heads in a linear changeset graph. $ cd .. $ hg init follow $ cd follow $ testlog --follow [] [] $ testlog -rnull ['null'] [] $ echo a > a $ echo aa > aa $ echo f > f $ hg ci -Am "add a" a aa f $ hg cp a b $ hg cp f g $ hg ci -m "copy a b" $ mkdir dir $ hg mv b dir $ echo g >> g $ echo f >> f $ hg ci -m "mv b dir/b" $ hg mv a b $ hg cp -f f g $ echo a > d $ hg add d $ hg ci -m "mv a b; add d" $ hg mv dir/b e $ hg ci -m "mv dir/b e" $ hg log -G --template '({rev}) {desc|firstline}\n' @ (4) mv dir/b e | o (3) mv a b; add d | o (2) mv b dir/b | o (1) copy a b | o (0) add a $ testlog a [] (func (symbol 'filelog') (string 'a')) , set([0])> $ testlog a b [] (or (list (func (symbol 'filelog') (string 'a')) (func (symbol 'filelog') (string 'b')))) , , >> Test falling back to slow path for non-existing files $ testlog a c [] (func (symbol '_matchfiles') (list (string 'r:') (string 'd:relpath') (string 'p:a') (string 'p:c'))) , > Test multiple --include/--exclude/paths $ testlog --include a --include e --exclude b --exclude e a e [] (func (symbol '_matchfiles') (list (string 'r:') (string 'd:relpath') (string 'p:a') (string 'p:e') (string 'i:a') (string 'i:e') (string 'x:b') (string 'x:e'))) , > Test glob expansion of pats $ expandglobs=`$PYTHON -c "import mercurial.util; \ > print(mercurial.util.expandglobs and 'true' or 'false')"` $ if [ $expandglobs = "true" ]; then > testlog 'a*'; > else > testlog a*; > fi; [] (func (symbol 'filelog') (string 'aa')) , set([0])> Test --follow on a non-existent directory $ testlog -f dir abort: cannot follow file not in parent revision: "dir" abort: cannot follow file not in parent revision: "dir" abort: cannot follow file not in parent revision: "dir" Test --follow on a directory $ hg up -q '.^' $ testlog -f dir [] (func (symbol '_matchfiles') (list (string 'r:') (string 'd:relpath') (string 'p:dir'))) , > $ hg up -q tip Test --follow on file not in parent revision $ testlog -f a abort: cannot follow file not in parent revision: "a" abort: cannot follow file not in parent revision: "a" abort: cannot follow file not in parent revision: "a" Test --follow and patterns $ testlog -f 'glob:*' [] (func (symbol '_matchfiles') (list (string 'r:') (string 'd:relpath') (string 'p:glob:*'))) , > Test --follow on a single rename $ hg up -q 2 $ testlog -f a [] [] Test --follow and multiple renames $ hg up -q tip $ testlog -f e [] [] Test --follow and multiple filelog heads $ hg up -q 2 $ testlog -f g [] [] $ cat log.nodes nodetag 2 nodetag 1 nodetag 0 $ hg up -q tip $ testlog -f g [] [] $ cat log.nodes nodetag 3 nodetag 2 nodetag 0 Test --follow and multiple files $ testlog -f g e [] [] $ cat log.nodes nodetag 4 nodetag 3 nodetag 2 nodetag 1 nodetag 0 Test --follow null parent $ hg up -q null $ testlog -f [] [] Test --follow-first $ hg up -q 3 $ echo ee > e $ hg ci -Am "add another e" e created new head $ hg merge --tool internal:other 4 0 files updated, 1 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ echo merge > e $ hg ci -m "merge 5 and 4" $ testlog --follow-first [] [] Cannot compare with log --follow-first FILE as it never worked $ hg log -G --print-revset --follow-first e [] [] $ hg log -G --follow-first e --template '{rev} {desc|firstline}\n' @ 6 merge 5 and 4 |\ | ~ o 5 add another e | ~ Test --copies $ hg log -G --copies --template "{rev} {desc|firstline} \ > copies: {file_copies_switch}\n" @ 6 merge 5 and 4 copies: |\ | o 5 add another e copies: | | o | 4 mv dir/b e copies: e (dir/b) |/ o 3 mv a b; add d copies: b (a)g (f) | o 2 mv b dir/b copies: dir/b (b) | o 1 copy a b copies: b (a)g (f) | o 0 add a copies: Test "set:..." and parent revision $ hg up -q 4 $ testlog "set:copied()" [] (func (symbol '_matchfiles') (list (string 'r:') (string 'd:relpath') (string 'p:set:copied()'))) , > $ testlog --include "set:copied()" [] (func (symbol '_matchfiles') (list (string 'r:') (string 'd:relpath') (string 'i:set:copied()'))) , > $ testlog -r "sort(file('set:copied()'), -rev)" ["sort(file('set:copied()'), -rev)"] [] , > Test --removed $ testlog --removed [] [] $ testlog --removed a [] (func (symbol '_matchfiles') (list (string 'r:') (string 'd:relpath') (string 'p:a'))) , > $ testlog --removed --follow a [] (func (symbol '_matchfiles') (list (string 'r:') (string 'd:relpath') (string 'p:a'))) , > Test --patch and --stat with --follow and --follow-first $ hg up -q 3 $ hg log -G --git --patch b o changeset: 1:216d4c92cf98 | user: test ~ date: Thu Jan 01 00:00:00 1970 +0000 summary: copy a b diff --git a/a b/b copy from a copy to b $ hg log -G --git --stat b o changeset: 1:216d4c92cf98 | user: test ~ date: Thu Jan 01 00:00:00 1970 +0000 summary: copy a b b | 0 1 files changed, 0 insertions(+), 0 deletions(-) $ hg log -G --git --patch --follow b o changeset: 1:216d4c92cf98 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: copy a b | | diff --git a/a b/b | copy from a | copy to b | o changeset: 0:f8035bb17114 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add a diff --git a/a b/a new file mode 100644 --- /dev/null +++ b/a @@ -0,0 +1,1 @@ +a $ hg log -G --git --stat --follow b o changeset: 1:216d4c92cf98 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: copy a b | | b | 0 | 1 files changed, 0 insertions(+), 0 deletions(-) | o changeset: 0:f8035bb17114 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add a a | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) $ hg up -q 6 $ hg log -G --git --patch --follow-first e @ changeset: 6:fc281d8ff18d |\ tag: tip | ~ parent: 5:99b31f1c2782 | parent: 4:17d952250a9d | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: merge 5 and 4 | | diff --git a/e b/e | --- a/e | +++ b/e | @@ -1,1 +1,1 @@ | -ee | +merge | o changeset: 5:99b31f1c2782 | parent: 3:5918b8d165d1 ~ user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add another e diff --git a/e b/e new file mode 100644 --- /dev/null +++ b/e @@ -0,0 +1,1 @@ +ee Test old-style --rev $ hg tag 'foo-bar' $ testlog -r 'foo-bar' ['foo-bar'] [] Test --follow and forward --rev $ hg up -q 6 $ echo g > g $ hg ci -Am 'add g' g created new head $ hg up -q 2 $ hg log -G --template "{rev} {desc|firstline}\n" o 8 add g | | o 7 Added tag foo-bar for changeset fc281d8ff18d |/ o 6 merge 5 and 4 |\ | o 5 add another e | | o | 4 mv dir/b e |/ o 3 mv a b; add d | @ 2 mv b dir/b | o 1 copy a b | o 0 add a $ hg archive -r 7 archive $ grep changessincelatesttag archive/.hg_archival.txt changessincelatesttag: 1 $ rm -r archive changessincelatesttag with no prior tag $ hg archive -r 4 archive $ grep changessincelatesttag archive/.hg_archival.txt changessincelatesttag: 5 $ hg export 'all()' # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID f8035bb17114da16215af3436ec5222428ace8ee # Parent 0000000000000000000000000000000000000000 add a diff -r 000000000000 -r f8035bb17114 a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +a diff -r 000000000000 -r f8035bb17114 aa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/aa Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +aa diff -r 000000000000 -r f8035bb17114 f --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/f Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +f # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 216d4c92cf98ff2b4641d508b76b529f3d424c92 # Parent f8035bb17114da16215af3436ec5222428ace8ee copy a b diff -r f8035bb17114 -r 216d4c92cf98 b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/b Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +a diff -r f8035bb17114 -r 216d4c92cf98 g --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/g Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +f # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID bb573313a9e8349099b6ea2b2fb1fc7f424446f3 # Parent 216d4c92cf98ff2b4641d508b76b529f3d424c92 mv b dir/b diff -r 216d4c92cf98 -r bb573313a9e8 b --- a/b Thu Jan 01 00:00:00 1970 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -a diff -r 216d4c92cf98 -r bb573313a9e8 dir/b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dir/b Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +a diff -r 216d4c92cf98 -r bb573313a9e8 f --- a/f Thu Jan 01 00:00:00 1970 +0000 +++ b/f Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,2 @@ f +f diff -r 216d4c92cf98 -r bb573313a9e8 g --- a/g Thu Jan 01 00:00:00 1970 +0000 +++ b/g Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,2 @@ f +g # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 5918b8d165d1364e78a66d02e66caa0133c5d1ed # Parent bb573313a9e8349099b6ea2b2fb1fc7f424446f3 mv a b; add d diff -r bb573313a9e8 -r 5918b8d165d1 a --- a/a Thu Jan 01 00:00:00 1970 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -a diff -r bb573313a9e8 -r 5918b8d165d1 b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/b Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +a diff -r bb573313a9e8 -r 5918b8d165d1 d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/d Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +a diff -r bb573313a9e8 -r 5918b8d165d1 g --- a/g Thu Jan 01 00:00:00 1970 +0000 +++ b/g Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +1,2 @@ f -g +f # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 17d952250a9d03cc3dc77b199ab60e959b9b0260 # Parent 5918b8d165d1364e78a66d02e66caa0133c5d1ed mv dir/b e diff -r 5918b8d165d1 -r 17d952250a9d dir/b --- a/dir/b Thu Jan 01 00:00:00 1970 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -a diff -r 5918b8d165d1 -r 17d952250a9d e --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +a # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 99b31f1c2782e2deb1723cef08930f70fc84b37b # Parent 5918b8d165d1364e78a66d02e66caa0133c5d1ed add another e diff -r 5918b8d165d1 -r 99b31f1c2782 e --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/e Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +ee # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID fc281d8ff18d999ad6497b3d27390bcd695dcc73 # Parent 99b31f1c2782e2deb1723cef08930f70fc84b37b # Parent 17d952250a9d03cc3dc77b199ab60e959b9b0260 merge 5 and 4 diff -r 99b31f1c2782 -r fc281d8ff18d dir/b --- a/dir/b Thu Jan 01 00:00:00 1970 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -a diff -r 99b31f1c2782 -r fc281d8ff18d e --- a/e Thu Jan 01 00:00:00 1970 +0000 +++ b/e Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -ee +merge # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 02dbb8e276b8ab7abfd07cab50c901647e75c2dd # Parent fc281d8ff18d999ad6497b3d27390bcd695dcc73 Added tag foo-bar for changeset fc281d8ff18d diff -r fc281d8ff18d -r 02dbb8e276b8 .hgtags --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +fc281d8ff18d999ad6497b3d27390bcd695dcc73 foo-bar # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 24c2e826ddebf80f9dcd60b856bdb8e6715c5449 # Parent fc281d8ff18d999ad6497b3d27390bcd695dcc73 add g diff -r fc281d8ff18d -r 24c2e826ddeb g --- a/g Thu Jan 01 00:00:00 1970 +0000 +++ b/g Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +1,1 @@ -f -f +g $ testlog --follow -r6 -r8 -r5 -r7 -r4 ['6', '8', '5', '7', '4'] [] Test --follow-first and forward --rev $ testlog --follow-first -r6 -r8 -r5 -r7 -r4 ['6', '8', '5', '7', '4'] [] Test --follow and backward --rev $ testlog --follow -r6 -r5 -r7 -r8 -r4 ['6', '5', '7', '8', '4'] [] Test --follow-first and backward --rev $ testlog --follow-first -r6 -r5 -r7 -r8 -r4 ['6', '5', '7', '8', '4'] [] Test --follow with --rev of graphlog extension $ hg --config extensions.graphlog= glog -qfr1 o 1:216d4c92cf98 | o 0:f8035bb17114 Test subdir $ hg up -q 3 $ cd dir $ testlog . [] (func (symbol '_matchfiles') (list (string 'r:') (string 'd:relpath') (string 'p:.'))) , > $ testlog ../b [] (func (symbol 'filelog') (string '../b')) , set([1])> $ testlog -f ../b [] [] $ cd .. Test --hidden (enable obsolete) $ cat >> $HGRCPATH << EOF > [experimental] > evolution.createmarkers=True > EOF $ hg debugobsolete `hg id --debug -i -r 8` obsoleted 1 changesets $ testlog [] [] $ testlog --hidden [] [] $ hg log -G --template '{rev} {desc}\n' o 7 Added tag foo-bar for changeset fc281d8ff18d | o 6 merge 5 and 4 |\ | o 5 add another e | | o | 4 mv dir/b e |/ @ 3 mv a b; add d | o 2 mv b dir/b | o 1 copy a b | o 0 add a A template without trailing newline should do something sane $ hg log -G -r ::2 --template '{rev} {desc}' o 2 mv b dir/b | o 1 copy a b | o 0 add a Extra newlines must be preserved $ hg log -G -r ::2 --template '\n{rev} {desc}\n\n' o | 2 mv b dir/b | o | 1 copy a b | o 0 add a The almost-empty template should do something sane too ... $ hg log -G -r ::2 --template '\n' o | o | o issue3772 $ hg log -G -r :null o changeset: 0:f8035bb17114 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: add a | o changeset: -1:000000000000 user: date: Thu Jan 01 00:00:00 1970 +0000 $ hg log -G -r null:null o changeset: -1:000000000000 user: date: Thu Jan 01 00:00:00 1970 +0000 should not draw line down to null due to the magic of fullreposet $ hg log -G -r 'all()' | tail -6 | o changeset: 0:f8035bb17114 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add a $ hg log -G -r 'branch(default)' | tail -6 | o changeset: 0:f8035bb17114 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add a working-directory revision $ hg log -G -qr '. + wdir()' o 2147483647:ffffffffffff | @ 3:5918b8d165d1 | ~ node template with changeset_printer: $ hg log -Gqr 5:7 --config ui.graphnodetemplate='"{rev}"' 7 7:02dbb8e276b8 | 6 6:fc281d8ff18d |\ | ~ 5 5:99b31f1c2782 | ~ node template with changeset_templater (shared cache variable): $ hg log -Gr 5:7 -T '{latesttag % "{rev} {tag}+{distance}"}\n' \ > --config ui.graphnodetemplate='{ifeq(latesttagdistance, 0, "#", graphnode)}' o 7 foo-bar+1 | # 6 foo-bar+0 |\ | ~ o 5 null+5 | ~ label() should just work in node template: $ hg log -Gqr 7 --config extensions.color= --color=debug \ > --config ui.graphnodetemplate='{label("branch.{branch}", rev)}' [branch.default|7] [log.node|7:02dbb8e276b8] | ~ $ cd .. change graph edge styling $ cd repo $ cat << EOF >> $HGRCPATH > [experimental] > graphstyle.parent = | > graphstyle.grandparent = : > graphstyle.missing = > EOF $ hg log -G -r 'file("a")' -m @ changeset: 36:08a19a744424 : branch: branch : tag: tip : parent: 35:9159c3644c5e : parent: 35:9159c3644c5e : user: test : date: Thu Jan 01 00:00:36 1970 +0000 : summary: (36) buggy merge: identical parents : o changeset: 32:d06dffa21a31 |\ parent: 27:886ed638191b | : parent: 31:621d83e11f67 | : user: test | : date: Thu Jan 01 00:00:32 1970 +0000 | : summary: (32) expand | : o : changeset: 31:621d83e11f67 |\: parent: 21:d42a756af44d | : parent: 30:6e11cd4b648f | : user: test | : date: Thu Jan 01 00:00:31 1970 +0000 | : summary: (31) expand | : o : changeset: 30:6e11cd4b648f |\ \ parent: 28:44ecd0b9ae99 | ~ : parent: 29:cd9bb2be7593 | : user: test | : date: Thu Jan 01 00:00:30 1970 +0000 | : summary: (30) expand | / o : changeset: 28:44ecd0b9ae99 |\ \ parent: 1:6db2ef61d156 | ~ : parent: 26:7f25b6c2f0b9 | : user: test | : date: Thu Jan 01 00:00:28 1970 +0000 | : summary: (28) merge zero known | / o : changeset: 26:7f25b6c2f0b9 |\ \ parent: 18:1aa84d96232a | | : parent: 25:91da8ed57247 | | : user: test | | : date: Thu Jan 01 00:00:26 1970 +0000 | | : summary: (26) merge one known; far right | | : | o : changeset: 25:91da8ed57247 | |\: parent: 21:d42a756af44d | | : parent: 24:a9c19a3d96b7 | | : user: test | | : date: Thu Jan 01 00:00:25 1970 +0000 | | : summary: (25) merge one known; far left | | : | o : changeset: 24:a9c19a3d96b7 | |\ \ parent: 0:e6eb3150255d | | ~ : parent: 23:a01cddf0766d | | : user: test | | : date: Thu Jan 01 00:00:24 1970 +0000 | | : summary: (24) merge one known; immediate right | | / | o : changeset: 23:a01cddf0766d | |\ \ parent: 1:6db2ef61d156 | | ~ : parent: 22:e0d9cccacb5d | | : user: test | | : date: Thu Jan 01 00:00:23 1970 +0000 | | : summary: (23) merge one known; immediate left | | / | o : changeset: 22:e0d9cccacb5d |/:/ parent: 18:1aa84d96232a | : parent: 21:d42a756af44d | : user: test | : date: Thu Jan 01 00:00:22 1970 +0000 | : summary: (22) merge two known; one far left, one far right | : | o changeset: 21:d42a756af44d | |\ parent: 19:31ddc2c1573b | | | parent: 20:d30ed6450e32 | | | user: test | | | date: Thu Jan 01 00:00:21 1970 +0000 | | | summary: (21) expand | | | +---o changeset: 20:d30ed6450e32 | | | parent: 0:e6eb3150255d | | ~ parent: 18:1aa84d96232a | | user: test | | date: Thu Jan 01 00:00:20 1970 +0000 | | summary: (20) merge two known; two far right | | | o changeset: 19:31ddc2c1573b | |\ parent: 15:1dda3f72782d | | | parent: 17:44765d7c06e0 | | | user: test | | | date: Thu Jan 01 00:00:19 1970 +0000 | | | summary: (19) expand | | | o | | changeset: 18:1aa84d96232a |\| | parent: 1:6db2ef61d156 ~ | | parent: 15:1dda3f72782d | | user: test | | date: Thu Jan 01 00:00:18 1970 +0000 | | summary: (18) merge two known; two far left / / | o changeset: 17:44765d7c06e0 | |\ parent: 12:86b91144a6e9 | | | parent: 16:3677d192927d | | | user: test | | | date: Thu Jan 01 00:00:17 1970 +0000 | | | summary: (17) expand | | | | | o changeset: 16:3677d192927d | | |\ parent: 0:e6eb3150255d | | ~ ~ parent: 1:6db2ef61d156 | | user: test | | date: Thu Jan 01 00:00:16 1970 +0000 | | summary: (16) merge two known; one immediate right, one near right | | o | changeset: 15:1dda3f72782d |\ \ parent: 13:22d8966a97e3 | | | parent: 14:8eac370358ef | | | user: test | | | date: Thu Jan 01 00:00:15 1970 +0000 | | | summary: (15) expand | | | | o | changeset: 14:8eac370358ef | |\| parent: 0:e6eb3150255d | ~ | parent: 12:86b91144a6e9 | | user: test | | date: Thu Jan 01 00:00:14 1970 +0000 | | summary: (14) merge two known; one immediate right, one far right | / o | changeset: 13:22d8966a97e3 |\ \ parent: 9:7010c0af0a35 | | | parent: 11:832d76e6bdf2 | | | user: test | | | date: Thu Jan 01 00:00:13 1970 +0000 | | | summary: (13) expand | | | +---o changeset: 12:86b91144a6e9 | | | parent: 1:6db2ef61d156 | | ~ parent: 9:7010c0af0a35 | | user: test | | date: Thu Jan 01 00:00:12 1970 +0000 | | summary: (12) merge two known; one immediate right, one far left | | | o changeset: 11:832d76e6bdf2 | |\ parent: 6:b105a072e251 | | | parent: 10:74c64d036d72 | | | user: test | | | date: Thu Jan 01 00:00:11 1970 +0000 | | | summary: (11) expand | | | | | o changeset: 10:74c64d036d72 | |/| parent: 0:e6eb3150255d | | ~ parent: 6:b105a072e251 | | user: test | | date: Thu Jan 01 00:00:10 1970 +0000 | | summary: (10) merge two known; one immediate left, one near right | | o | changeset: 9:7010c0af0a35 |\ \ parent: 7:b632bb1b1224 | | | parent: 8:7a0b11f71937 | | | user: test | | | date: Thu Jan 01 00:00:09 1970 +0000 | | | summary: (9) expand | | | | o | changeset: 8:7a0b11f71937 |/| | parent: 0:e6eb3150255d | ~ | parent: 7:b632bb1b1224 | | user: test | | date: Thu Jan 01 00:00:08 1970 +0000 | | summary: (8) merge two known; one immediate left, one far right | / o | changeset: 7:b632bb1b1224 |\ \ parent: 2:3d9a33b8d1e1 | ~ | parent: 5:4409d547b708 | | user: test | | date: Thu Jan 01 00:00:07 1970 +0000 | | summary: (7) expand | / | o changeset: 6:b105a072e251 |/| parent: 2:3d9a33b8d1e1 | ~ parent: 5:4409d547b708 | user: test | date: Thu Jan 01 00:00:06 1970 +0000 | summary: (6) merge two known; one immediate left, one far left | o changeset: 5:4409d547b708 |\ parent: 3:27eef8ed80b4 | ~ parent: 4:26a8bac39d9f | user: test | date: Thu Jan 01 00:00:05 1970 +0000 | summary: (5) expand | o changeset: 4:26a8bac39d9f |\ parent: 1:6db2ef61d156 ~ ~ parent: 3:27eef8ed80b4 user: test date: Thu Jan 01 00:00:04 1970 +0000 summary: (4) merge two known; one immediate left, one immediate right Setting HGPLAIN ignores graphmod styling: $ HGPLAIN=1 hg log -G -r 'file("a")' -m @ changeset: 36:08a19a744424 | branch: branch | tag: tip | parent: 35:9159c3644c5e | parent: 35:9159c3644c5e | user: test | date: Thu Jan 01 00:00:36 1970 +0000 | summary: (36) buggy merge: identical parents | o changeset: 32:d06dffa21a31 |\ parent: 27:886ed638191b | | parent: 31:621d83e11f67 | | user: test | | date: Thu Jan 01 00:00:32 1970 +0000 | | summary: (32) expand | | o | changeset: 31:621d83e11f67 |\| parent: 21:d42a756af44d | | parent: 30:6e11cd4b648f | | user: test | | date: Thu Jan 01 00:00:31 1970 +0000 | | summary: (31) expand | | o | changeset: 30:6e11cd4b648f |\ \ parent: 28:44ecd0b9ae99 | | | parent: 29:cd9bb2be7593 | | | user: test | | | date: Thu Jan 01 00:00:30 1970 +0000 | | | summary: (30) expand | | | o | | changeset: 28:44ecd0b9ae99 |\ \ \ parent: 1:6db2ef61d156 | | | | parent: 26:7f25b6c2f0b9 | | | | user: test | | | | date: Thu Jan 01 00:00:28 1970 +0000 | | | | summary: (28) merge zero known | | | | o | | | changeset: 26:7f25b6c2f0b9 |\ \ \ \ parent: 18:1aa84d96232a | | | | | parent: 25:91da8ed57247 | | | | | user: test | | | | | date: Thu Jan 01 00:00:26 1970 +0000 | | | | | summary: (26) merge one known; far right | | | | | | o-----+ changeset: 25:91da8ed57247 | | | | | parent: 21:d42a756af44d | | | | | parent: 24:a9c19a3d96b7 | | | | | user: test | | | | | date: Thu Jan 01 00:00:25 1970 +0000 | | | | | summary: (25) merge one known; far left | | | | | | o | | | changeset: 24:a9c19a3d96b7 | |\ \ \ \ parent: 0:e6eb3150255d | | | | | | parent: 23:a01cddf0766d | | | | | | user: test | | | | | | date: Thu Jan 01 00:00:24 1970 +0000 | | | | | | summary: (24) merge one known; immediate right | | | | | | | o---+ | | changeset: 23:a01cddf0766d | | | | | | parent: 1:6db2ef61d156 | | | | | | parent: 22:e0d9cccacb5d | | | | | | user: test | | | | | | date: Thu Jan 01 00:00:23 1970 +0000 | | | | | | summary: (23) merge one known; immediate left | | | | | | | o-------+ changeset: 22:e0d9cccacb5d | | | | | | parent: 18:1aa84d96232a |/ / / / / parent: 21:d42a756af44d | | | | | user: test | | | | | date: Thu Jan 01 00:00:22 1970 +0000 | | | | | summary: (22) merge two known; one far left, one far right | | | | | | | | | o changeset: 21:d42a756af44d | | | | |\ parent: 19:31ddc2c1573b | | | | | | parent: 20:d30ed6450e32 | | | | | | user: test | | | | | | date: Thu Jan 01 00:00:21 1970 +0000 | | | | | | summary: (21) expand | | | | | | +-+-------o changeset: 20:d30ed6450e32 | | | | | parent: 0:e6eb3150255d | | | | | parent: 18:1aa84d96232a | | | | | user: test | | | | | date: Thu Jan 01 00:00:20 1970 +0000 | | | | | summary: (20) merge two known; two far right | | | | | | | | | o changeset: 19:31ddc2c1573b | | | | |\ parent: 15:1dda3f72782d | | | | | | parent: 17:44765d7c06e0 | | | | | | user: test | | | | | | date: Thu Jan 01 00:00:19 1970 +0000 | | | | | | summary: (19) expand | | | | | | o---+---+ | changeset: 18:1aa84d96232a | | | | | parent: 1:6db2ef61d156 / / / / / parent: 15:1dda3f72782d | | | | | user: test | | | | | date: Thu Jan 01 00:00:18 1970 +0000 | | | | | summary: (18) merge two known; two far left | | | | | | | | | o changeset: 17:44765d7c06e0 | | | | |\ parent: 12:86b91144a6e9 | | | | | | parent: 16:3677d192927d | | | | | | user: test | | | | | | date: Thu Jan 01 00:00:17 1970 +0000 | | | | | | summary: (17) expand | | | | | | +-+-------o changeset: 16:3677d192927d | | | | | parent: 0:e6eb3150255d | | | | | parent: 1:6db2ef61d156 | | | | | user: test | | | | | date: Thu Jan 01 00:00:16 1970 +0000 | | | | | summary: (16) merge two known; one immediate right, one near right | | | | | | | | o | changeset: 15:1dda3f72782d | | | |\ \ parent: 13:22d8966a97e3 | | | | | | parent: 14:8eac370358ef | | | | | | user: test | | | | | | date: Thu Jan 01 00:00:15 1970 +0000 | | | | | | summary: (15) expand | | | | | | +-------o | changeset: 14:8eac370358ef | | | | |/ parent: 0:e6eb3150255d | | | | | parent: 12:86b91144a6e9 | | | | | user: test | | | | | date: Thu Jan 01 00:00:14 1970 +0000 | | | | | summary: (14) merge two known; one immediate right, one far right | | | | | | | | o | changeset: 13:22d8966a97e3 | | | |\ \ parent: 9:7010c0af0a35 | | | | | | parent: 11:832d76e6bdf2 | | | | | | user: test | | | | | | date: Thu Jan 01 00:00:13 1970 +0000 | | | | | | summary: (13) expand | | | | | | | +---+---o changeset: 12:86b91144a6e9 | | | | | parent: 1:6db2ef61d156 | | | | | parent: 9:7010c0af0a35 | | | | | user: test | | | | | date: Thu Jan 01 00:00:12 1970 +0000 | | | | | summary: (12) merge two known; one immediate right, one far left | | | | | | | | | o changeset: 11:832d76e6bdf2 | | | | |\ parent: 6:b105a072e251 | | | | | | parent: 10:74c64d036d72 | | | | | | user: test | | | | | | date: Thu Jan 01 00:00:11 1970 +0000 | | | | | | summary: (11) expand | | | | | | +---------o changeset: 10:74c64d036d72 | | | | |/ parent: 0:e6eb3150255d | | | | | parent: 6:b105a072e251 | | | | | user: test | | | | | date: Thu Jan 01 00:00:10 1970 +0000 | | | | | summary: (10) merge two known; one immediate left, one near right | | | | | | | | o | changeset: 9:7010c0af0a35 | | | |\ \ parent: 7:b632bb1b1224 | | | | | | parent: 8:7a0b11f71937 | | | | | | user: test | | | | | | date: Thu Jan 01 00:00:09 1970 +0000 | | | | | | summary: (9) expand | | | | | | +-------o | changeset: 8:7a0b11f71937 | | | |/ / parent: 0:e6eb3150255d | | | | | parent: 7:b632bb1b1224 | | | | | user: test | | | | | date: Thu Jan 01 00:00:08 1970 +0000 | | | | | summary: (8) merge two known; one immediate left, one far right | | | | | | | | o | changeset: 7:b632bb1b1224 | | | |\ \ parent: 2:3d9a33b8d1e1 | | | | | | parent: 5:4409d547b708 | | | | | | user: test | | | | | | date: Thu Jan 01 00:00:07 1970 +0000 | | | | | | summary: (7) expand | | | | | | | | | +---o changeset: 6:b105a072e251 | | | | |/ parent: 2:3d9a33b8d1e1 | | | | | parent: 5:4409d547b708 | | | | | user: test | | | | | date: Thu Jan 01 00:00:06 1970 +0000 | | | | | summary: (6) merge two known; one immediate left, one far left | | | | | | | | o | changeset: 5:4409d547b708 | | | |\ \ parent: 3:27eef8ed80b4 | | | | | | parent: 4:26a8bac39d9f | | | | | | user: test | | | | | | date: Thu Jan 01 00:00:05 1970 +0000 | | | | | | summary: (5) expand | | | | | | | +---o | | changeset: 4:26a8bac39d9f | | | |/ / parent: 1:6db2ef61d156 | | | | | parent: 3:27eef8ed80b4 | | | | | user: test | | | | | date: Thu Jan 01 00:00:04 1970 +0000 | | | | | summary: (4) merge two known; one immediate left, one immediate right | | | | | .. unless HGPLAINEXCEPT=graph is set: $ HGPLAIN=1 HGPLAINEXCEPT=graph hg log -G -r 'file("a")' -m @ changeset: 36:08a19a744424 : branch: branch : tag: tip : parent: 35:9159c3644c5e : parent: 35:9159c3644c5e : user: test : date: Thu Jan 01 00:00:36 1970 +0000 : summary: (36) buggy merge: identical parents : o changeset: 32:d06dffa21a31 |\ parent: 27:886ed638191b | : parent: 31:621d83e11f67 | : user: test | : date: Thu Jan 01 00:00:32 1970 +0000 | : summary: (32) expand | : o : changeset: 31:621d83e11f67 |\: parent: 21:d42a756af44d | : parent: 30:6e11cd4b648f | : user: test | : date: Thu Jan 01 00:00:31 1970 +0000 | : summary: (31) expand | : o : changeset: 30:6e11cd4b648f |\ \ parent: 28:44ecd0b9ae99 | ~ : parent: 29:cd9bb2be7593 | : user: test | : date: Thu Jan 01 00:00:30 1970 +0000 | : summary: (30) expand | / o : changeset: 28:44ecd0b9ae99 |\ \ parent: 1:6db2ef61d156 | ~ : parent: 26:7f25b6c2f0b9 | : user: test | : date: Thu Jan 01 00:00:28 1970 +0000 | : summary: (28) merge zero known | / o : changeset: 26:7f25b6c2f0b9 |\ \ parent: 18:1aa84d96232a | | : parent: 25:91da8ed57247 | | : user: test | | : date: Thu Jan 01 00:00:26 1970 +0000 | | : summary: (26) merge one known; far right | | : | o : changeset: 25:91da8ed57247 | |\: parent: 21:d42a756af44d | | : parent: 24:a9c19a3d96b7 | | : user: test | | : date: Thu Jan 01 00:00:25 1970 +0000 | | : summary: (25) merge one known; far left | | : | o : changeset: 24:a9c19a3d96b7 | |\ \ parent: 0:e6eb3150255d | | ~ : parent: 23:a01cddf0766d | | : user: test | | : date: Thu Jan 01 00:00:24 1970 +0000 | | : summary: (24) merge one known; immediate right | | / | o : changeset: 23:a01cddf0766d | |\ \ parent: 1:6db2ef61d156 | | ~ : parent: 22:e0d9cccacb5d | | : user: test | | : date: Thu Jan 01 00:00:23 1970 +0000 | | : summary: (23) merge one known; immediate left | | / | o : changeset: 22:e0d9cccacb5d |/:/ parent: 18:1aa84d96232a | : parent: 21:d42a756af44d | : user: test | : date: Thu Jan 01 00:00:22 1970 +0000 | : summary: (22) merge two known; one far left, one far right | : | o changeset: 21:d42a756af44d | |\ parent: 19:31ddc2c1573b | | | parent: 20:d30ed6450e32 | | | user: test | | | date: Thu Jan 01 00:00:21 1970 +0000 | | | summary: (21) expand | | | +---o changeset: 20:d30ed6450e32 | | | parent: 0:e6eb3150255d | | ~ parent: 18:1aa84d96232a | | user: test | | date: Thu Jan 01 00:00:20 1970 +0000 | | summary: (20) merge two known; two far right | | | o changeset: 19:31ddc2c1573b | |\ parent: 15:1dda3f72782d | | | parent: 17:44765d7c06e0 | | | user: test | | | date: Thu Jan 01 00:00:19 1970 +0000 | | | summary: (19) expand | | | o | | changeset: 18:1aa84d96232a |\| | parent: 1:6db2ef61d156 ~ | | parent: 15:1dda3f72782d | | user: test | | date: Thu Jan 01 00:00:18 1970 +0000 | | summary: (18) merge two known; two far left / / | o changeset: 17:44765d7c06e0 | |\ parent: 12:86b91144a6e9 | | | parent: 16:3677d192927d | | | user: test | | | date: Thu Jan 01 00:00:17 1970 +0000 | | | summary: (17) expand | | | | | o changeset: 16:3677d192927d | | |\ parent: 0:e6eb3150255d | | ~ ~ parent: 1:6db2ef61d156 | | user: test | | date: Thu Jan 01 00:00:16 1970 +0000 | | summary: (16) merge two known; one immediate right, one near right | | o | changeset: 15:1dda3f72782d |\ \ parent: 13:22d8966a97e3 | | | parent: 14:8eac370358ef | | | user: test | | | date: Thu Jan 01 00:00:15 1970 +0000 | | | summary: (15) expand | | | | o | changeset: 14:8eac370358ef | |\| parent: 0:e6eb3150255d | ~ | parent: 12:86b91144a6e9 | | user: test | | date: Thu Jan 01 00:00:14 1970 +0000 | | summary: (14) merge two known; one immediate right, one far right | / o | changeset: 13:22d8966a97e3 |\ \ parent: 9:7010c0af0a35 | | | parent: 11:832d76e6bdf2 | | | user: test | | | date: Thu Jan 01 00:00:13 1970 +0000 | | | summary: (13) expand | | | +---o changeset: 12:86b91144a6e9 | | | parent: 1:6db2ef61d156 | | ~ parent: 9:7010c0af0a35 | | user: test | | date: Thu Jan 01 00:00:12 1970 +0000 | | summary: (12) merge two known; one immediate right, one far left | | | o changeset: 11:832d76e6bdf2 | |\ parent: 6:b105a072e251 | | | parent: 10:74c64d036d72 | | | user: test | | | date: Thu Jan 01 00:00:11 1970 +0000 | | | summary: (11) expand | | | | | o changeset: 10:74c64d036d72 | |/| parent: 0:e6eb3150255d | | ~ parent: 6:b105a072e251 | | user: test | | date: Thu Jan 01 00:00:10 1970 +0000 | | summary: (10) merge two known; one immediate left, one near right | | o | changeset: 9:7010c0af0a35 |\ \ parent: 7:b632bb1b1224 | | | parent: 8:7a0b11f71937 | | | user: test | | | date: Thu Jan 01 00:00:09 1970 +0000 | | | summary: (9) expand | | | | o | changeset: 8:7a0b11f71937 |/| | parent: 0:e6eb3150255d | ~ | parent: 7:b632bb1b1224 | | user: test | | date: Thu Jan 01 00:00:08 1970 +0000 | | summary: (8) merge two known; one immediate left, one far right | / o | changeset: 7:b632bb1b1224 |\ \ parent: 2:3d9a33b8d1e1 | ~ | parent: 5:4409d547b708 | | user: test | | date: Thu Jan 01 00:00:07 1970 +0000 | | summary: (7) expand | / | o changeset: 6:b105a072e251 |/| parent: 2:3d9a33b8d1e1 | ~ parent: 5:4409d547b708 | user: test | date: Thu Jan 01 00:00:06 1970 +0000 | summary: (6) merge two known; one immediate left, one far left | o changeset: 5:4409d547b708 |\ parent: 3:27eef8ed80b4 | ~ parent: 4:26a8bac39d9f | user: test | date: Thu Jan 01 00:00:05 1970 +0000 | summary: (5) expand | o changeset: 4:26a8bac39d9f |\ parent: 1:6db2ef61d156 ~ ~ parent: 3:27eef8ed80b4 user: test date: Thu Jan 01 00:00:04 1970 +0000 summary: (4) merge two known; one immediate left, one immediate right Draw only part of a grandparent line differently with ""; only the last N lines (for positive N) or everything but the first N lines (for negative N) along the current node use the style, the rest of the edge uses the parent edge styling. Last 3 lines: $ cat << EOF >> $HGRCPATH > [experimental] > graphstyle.parent = ! > graphstyle.grandparent = 3. > graphstyle.missing = > EOF $ hg log -G -r '36:18 & file("a")' -m @ changeset: 36:08a19a744424 ! branch: branch ! tag: tip ! parent: 35:9159c3644c5e ! parent: 35:9159c3644c5e ! user: test . date: Thu Jan 01 00:00:36 1970 +0000 . summary: (36) buggy merge: identical parents . o changeset: 32:d06dffa21a31 !\ parent: 27:886ed638191b ! ! parent: 31:621d83e11f67 ! ! user: test ! . date: Thu Jan 01 00:00:32 1970 +0000 ! . summary: (32) expand ! . o ! changeset: 31:621d83e11f67 !\! parent: 21:d42a756af44d ! ! parent: 30:6e11cd4b648f ! ! user: test ! ! date: Thu Jan 01 00:00:31 1970 +0000 ! ! summary: (31) expand ! ! o ! changeset: 30:6e11cd4b648f !\ \ parent: 28:44ecd0b9ae99 ! ~ ! parent: 29:cd9bb2be7593 ! ! user: test ! ! date: Thu Jan 01 00:00:30 1970 +0000 ! ! summary: (30) expand ! / o ! changeset: 28:44ecd0b9ae99 !\ \ parent: 1:6db2ef61d156 ! ~ ! parent: 26:7f25b6c2f0b9 ! ! user: test ! ! date: Thu Jan 01 00:00:28 1970 +0000 ! ! summary: (28) merge zero known ! / o ! changeset: 26:7f25b6c2f0b9 !\ \ parent: 18:1aa84d96232a ! ! ! parent: 25:91da8ed57247 ! ! ! user: test ! ! ! date: Thu Jan 01 00:00:26 1970 +0000 ! ! ! summary: (26) merge one known; far right ! ! ! ! o ! changeset: 25:91da8ed57247 ! !\! parent: 21:d42a756af44d ! ! ! parent: 24:a9c19a3d96b7 ! ! ! user: test ! ! ! date: Thu Jan 01 00:00:25 1970 +0000 ! ! ! summary: (25) merge one known; far left ! ! ! ! o ! changeset: 24:a9c19a3d96b7 ! !\ \ parent: 0:e6eb3150255d ! ! ~ ! parent: 23:a01cddf0766d ! ! ! user: test ! ! ! date: Thu Jan 01 00:00:24 1970 +0000 ! ! ! summary: (24) merge one known; immediate right ! ! / ! o ! changeset: 23:a01cddf0766d ! !\ \ parent: 1:6db2ef61d156 ! ! ~ ! parent: 22:e0d9cccacb5d ! ! ! user: test ! ! ! date: Thu Jan 01 00:00:23 1970 +0000 ! ! ! summary: (23) merge one known; immediate left ! ! / ! o ! changeset: 22:e0d9cccacb5d !/!/ parent: 18:1aa84d96232a ! ! parent: 21:d42a756af44d ! ! user: test ! ! date: Thu Jan 01 00:00:22 1970 +0000 ! ! summary: (22) merge two known; one far left, one far right ! ! ! o changeset: 21:d42a756af44d ! !\ parent: 19:31ddc2c1573b ! ! ! parent: 20:d30ed6450e32 ! ! ! user: test ! ! ! date: Thu Jan 01 00:00:21 1970 +0000 ! ! ! summary: (21) expand ! ! ! +---o changeset: 20:d30ed6450e32 ! ! | parent: 0:e6eb3150255d ! ! ~ parent: 18:1aa84d96232a ! ! user: test ! ! date: Thu Jan 01 00:00:20 1970 +0000 ! ! summary: (20) merge two known; two far right ! ! ! o changeset: 19:31ddc2c1573b ! |\ parent: 15:1dda3f72782d ! ~ ~ parent: 17:44765d7c06e0 ! user: test ! date: Thu Jan 01 00:00:19 1970 +0000 ! summary: (19) expand ! o changeset: 18:1aa84d96232a |\ parent: 1:6db2ef61d156 ~ ~ parent: 15:1dda3f72782d user: test date: Thu Jan 01 00:00:18 1970 +0000 summary: (18) merge two known; two far left All but the first 3 lines: $ cat << EOF >> $HGRCPATH > [experimental] > graphstyle.parent = ! > graphstyle.grandparent = -3. > graphstyle.missing = > EOF $ hg log -G -r '36:18 & file("a")' -m @ changeset: 36:08a19a744424 ! branch: branch ! tag: tip . parent: 35:9159c3644c5e . parent: 35:9159c3644c5e . user: test . date: Thu Jan 01 00:00:36 1970 +0000 . summary: (36) buggy merge: identical parents . o changeset: 32:d06dffa21a31 !\ parent: 27:886ed638191b ! ! parent: 31:621d83e11f67 ! . user: test ! . date: Thu Jan 01 00:00:32 1970 +0000 ! . summary: (32) expand ! . o ! changeset: 31:621d83e11f67 !\! parent: 21:d42a756af44d ! ! parent: 30:6e11cd4b648f ! ! user: test ! ! date: Thu Jan 01 00:00:31 1970 +0000 ! ! summary: (31) expand ! ! o ! changeset: 30:6e11cd4b648f !\ \ parent: 28:44ecd0b9ae99 ! ~ ! parent: 29:cd9bb2be7593 ! ! user: test ! ! date: Thu Jan 01 00:00:30 1970 +0000 ! ! summary: (30) expand ! / o ! changeset: 28:44ecd0b9ae99 !\ \ parent: 1:6db2ef61d156 ! ~ ! parent: 26:7f25b6c2f0b9 ! ! user: test ! ! date: Thu Jan 01 00:00:28 1970 +0000 ! ! summary: (28) merge zero known ! / o ! changeset: 26:7f25b6c2f0b9 !\ \ parent: 18:1aa84d96232a ! ! ! parent: 25:91da8ed57247 ! ! ! user: test ! ! ! date: Thu Jan 01 00:00:26 1970 +0000 ! ! ! summary: (26) merge one known; far right ! ! ! ! o ! changeset: 25:91da8ed57247 ! !\! parent: 21:d42a756af44d ! ! ! parent: 24:a9c19a3d96b7 ! ! ! user: test ! ! ! date: Thu Jan 01 00:00:25 1970 +0000 ! ! ! summary: (25) merge one known; far left ! ! ! ! o ! changeset: 24:a9c19a3d96b7 ! !\ \ parent: 0:e6eb3150255d ! ! ~ ! parent: 23:a01cddf0766d ! ! ! user: test ! ! ! date: Thu Jan 01 00:00:24 1970 +0000 ! ! ! summary: (24) merge one known; immediate right ! ! / ! o ! changeset: 23:a01cddf0766d ! !\ \ parent: 1:6db2ef61d156 ! ! ~ ! parent: 22:e0d9cccacb5d ! ! ! user: test ! ! ! date: Thu Jan 01 00:00:23 1970 +0000 ! ! ! summary: (23) merge one known; immediate left ! ! / ! o ! changeset: 22:e0d9cccacb5d !/!/ parent: 18:1aa84d96232a ! ! parent: 21:d42a756af44d ! ! user: test ! ! date: Thu Jan 01 00:00:22 1970 +0000 ! ! summary: (22) merge two known; one far left, one far right ! ! ! o changeset: 21:d42a756af44d ! !\ parent: 19:31ddc2c1573b ! ! ! parent: 20:d30ed6450e32 ! ! ! user: test ! ! ! date: Thu Jan 01 00:00:21 1970 +0000 ! ! ! summary: (21) expand ! ! ! +---o changeset: 20:d30ed6450e32 ! ! | parent: 0:e6eb3150255d ! ! ~ parent: 18:1aa84d96232a ! ! user: test ! ! date: Thu Jan 01 00:00:20 1970 +0000 ! ! summary: (20) merge two known; two far right ! ! ! o changeset: 19:31ddc2c1573b ! |\ parent: 15:1dda3f72782d ! ~ ~ parent: 17:44765d7c06e0 ! user: test ! date: Thu Jan 01 00:00:19 1970 +0000 ! summary: (19) expand ! o changeset: 18:1aa84d96232a |\ parent: 1:6db2ef61d156 ~ ~ parent: 15:1dda3f72782d user: test date: Thu Jan 01 00:00:18 1970 +0000 summary: (18) merge two known; two far left $ cd .. Change graph shorten, test better with graphstyle.missing not none $ cd repo $ cat << EOF >> $HGRCPATH > [experimental] > graphstyle.parent = | > graphstyle.grandparent = : > graphstyle.missing = ' > graphshorten = true > EOF $ hg log -G -r 'file("a")' -m -T '{rev} {desc}' @ 36 (36) buggy merge: identical parents o 32 (32) expand |\ o : 31 (31) expand |\: o : 30 (30) expand |\ \ o \ \ 28 (28) merge zero known |\ \ \ o \ \ \ 26 (26) merge one known; far right |\ \ \ \ | o-----+ 25 (25) merge one known; far left | o ' ' : 24 (24) merge one known; immediate right | |\ \ \ \ | o---+ ' : 23 (23) merge one known; immediate left | o-------+ 22 (22) merge two known; one far left, one far right |/ / / / / | ' ' ' o 21 (21) expand | ' ' ' |\ +-+-------o 20 (20) merge two known; two far right | ' ' ' o 19 (19) expand | ' ' ' |\ o---+---+ | 18 (18) merge two known; two far left / / / / / ' ' ' | o 17 (17) expand ' ' ' | |\ +-+-------o 16 (16) merge two known; one immediate right, one near right ' ' ' o | 15 (15) expand ' ' ' |\ \ +-------o | 14 (14) merge two known; one immediate right, one far right ' ' ' | |/ ' ' ' o | 13 (13) expand ' ' ' |\ \ ' +---+---o 12 (12) merge two known; one immediate right, one far left ' ' ' | o 11 (11) expand ' ' ' | |\ +---------o 10 (10) merge two known; one immediate left, one near right ' ' ' | |/ ' ' ' o | 9 (9) expand ' ' ' |\ \ +-------o | 8 (8) merge two known; one immediate left, one far right ' ' ' |/ / ' ' ' o | 7 (7) expand ' ' ' |\ \ ' ' ' +---o 6 (6) merge two known; one immediate left, one far left ' ' ' | '/ ' ' ' o ' 5 (5) expand ' ' ' |\ \ ' +---o ' ' 4 (4) merge two known; one immediate left, one immediate right ' ' ' '/ / behavior with newlines $ hg log -G -r ::2 -T '{rev} {desc}' o 2 (2) collapse o 1 (1) collapse o 0 (0) root $ hg log -G -r ::2 -T '{rev} {desc}\n' o 2 (2) collapse o 1 (1) collapse o 0 (0) root $ hg log -G -r ::2 -T '{rev} {desc}\n\n' o 2 (2) collapse | o 1 (1) collapse | o 0 (0) root $ hg log -G -r ::2 -T '\n{rev} {desc}' o | 2 (2) collapse o | 1 (1) collapse o 0 (0) root $ hg log -G -r ::2 -T '{rev} {desc}\n\n\n' o 2 (2) collapse | | o 1 (1) collapse | | o 0 (0) root $ cd .. When inserting extra line nodes to handle more than 2 parents, ensure that the right node styles are used (issue5174): $ hg init repo-issue5174 $ cd repo-issue5174 $ echo a > f0 $ hg ci -Aqm 0 $ echo a > f1 $ hg ci -Aqm 1 $ echo a > f2 $ hg ci -Aqm 2 $ hg co ".^" 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo a > f3 $ hg ci -Aqm 3 $ hg co ".^^" 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo a > f4 $ hg ci -Aqm 4 $ hg merge -r 2 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -qm 5 $ hg merge -r 3 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -qm 6 $ hg log -G -r '0 | 1 | 2 | 6' @ changeset: 6:851fe89689ad :\ tag: tip : : parent: 5:4f1e3cf15f5d : : parent: 3:b74ba7084d2d : : user: test : : date: Thu Jan 01 00:00:00 1970 +0000 : : summary: 6 : : : \ : :\ : o : changeset: 2:3e6599df4cce : :/ user: test : : date: Thu Jan 01 00:00:00 1970 +0000 : : summary: 2 : : : o changeset: 1:bd9a55143933 :/ user: test : date: Thu Jan 01 00:00:00 1970 +0000 : summary: 1 : o changeset: 0:870a5edc339c user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 0 $ cd .. Multiple roots (issue5440): $ hg init multiroots $ cd multiroots $ cat < .hg/hgrc > [ui] > logtemplate = '{rev} {desc}\n\n' > EOF $ touch foo $ hg ci -Aqm foo $ hg co -q null $ touch bar $ hg ci -Aqm bar $ hg log -Gr null: @ 1 bar | | o 0 foo |/ o -1 $ hg log -Gr null+0 o 0 foo | o -1 $ hg log -Gr null+1 @ 1 bar | o -1 $ cd .. mercurial-4.5.3/tests/test-pathconflicts-basic.t0000644015407300116100000000504113261161234021621 0ustar augieeng00000000000000Path conflict checking is currently disabled by default because of issue5716. Turn it on for this test. $ cat >> $HGRCPATH << EOF > [experimental] > merge.checkpathconflicts=True > EOF $ hg init repo $ cd repo $ echo base > base $ hg add base $ hg commit -m "base" $ hg bookmark -i base $ echo 1 > a $ hg add a $ hg commit -m "file" $ hg bookmark -i file $ echo 2 > a $ hg commit -m "file2" $ hg bookmark -i file2 $ hg up -q 0 $ mkdir a $ echo 2 > a/b $ hg add a/b $ hg commit -m "dir" created new head $ hg bookmark -i dir Basic merge - local file conflicts with remote directory $ hg up -q file $ hg bookmark -i $ hg merge --verbose dir resolving manifests a: path conflict - a file or link has the same name as a directory the local file has been renamed to a~853701544ac3 resolve manually then use 'hg resolve --mark a' moving a to a~853701544ac3 getting a/b 1 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ hg update --clean . 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ rm a~853701544ac3 Basic update - local directory conflicts with remote file $ hg up -q 0 $ mkdir a $ echo 3 > a/b $ hg up file a: untracked directory conflicts with file abort: untracked files in working directory differ from files in requested revision [255] $ hg up --clean file 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (activating bookmark file) Repo state is ok $ hg sum parent: 1:853701544ac3 file branch: default bookmarks: *file commit: (clean) update: 2 new changesets (update) phases: 4 draft Basic update - untracked file conflicts with remote directory $ hg up -q 0 $ echo untracked > a $ hg up --config merge.checkunknown=warn dir a: replacing untracked file 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (activating bookmark dir) $ cat a.orig untracked $ rm -f a.orig Basic clean update - local directory conflicts with changed remote file $ hg up -q file $ rm a $ mkdir a $ echo 4 > a/b $ hg up file2 abort: *: '$TESTTMP/repo/a' (glob) [255] $ hg up --clean file2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (activating bookmark file2) Repo state is ok $ hg sum parent: 2:f64e09fac717 file2 branch: default bookmarks: *file2 commit: (clean) update: 1 new changesets, 2 branch heads (merge) phases: 4 draft mercurial-4.5.3/tests/test-http-bundle1.t0000644015407300116100000003601513261161234020215 0ustar augieeng00000000000000#require serve This test is a duplicate of 'test-http.t', feel free to factor out parts that are not bundle1/bundle2 specific. $ cat << EOF >> $HGRCPATH > [devel] > # This test is dedicated to interaction through old bundle > legacy.exchange = bundle1 > EOF $ hg init test $ cd test $ echo foo>foo $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg $ echo foo>foo.d/foo $ echo bar>foo.d/bAr.hg.d/BaR $ echo bar>foo.d/baR.d.hg/bAR $ hg commit -A -m 1 adding foo adding foo.d/bAr.hg.d/BaR adding foo.d/baR.d.hg/bAR adding foo.d/foo $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid Test server address cannot be reused $ hg serve -p $HGPORT1 2>&1 abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$ [255] $ cd .. $ cat hg1.pid hg2.pid >> $DAEMON_PIDS clone via stream $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1 streaming all changes 6 files to transfer, 606 bytes of data transferred * bytes in * seconds (*/sec) (glob) searching for changes no changes found updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg verify -R copy checking changesets checking manifests crosschecking files in changesets and manifests checking files 4 files, 1 changesets, 4 total revisions try to clone via stream, should use pull instead $ hg clone --stream http://localhost:$HGPORT1/ copy2 warning: stream clone requested but server has them disabled requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 4 changes to 4 files new changesets 8b6053c928fe updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved try to clone via stream but missing requirements, so should use pull instead $ cat > $TESTTMP/removesupportedformat.py << EOF > from mercurial import localrepo > def extsetup(ui): > localrepo.localrepository.supportedformats.remove('generaldelta') > EOF $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3 warning: stream clone requested but client is missing requirements: generaldelta (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information) requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 4 changes to 4 files new changesets 8b6053c928fe updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved clone via pull $ hg clone http://localhost:$HGPORT1/ copy-pull requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 4 changes to 4 files new changesets 8b6053c928fe updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg verify -R copy-pull checking changesets checking manifests crosschecking files in changesets and manifests checking files 4 files, 1 changesets, 4 total revisions $ cd test $ echo bar > bar $ hg commit -A -d '1 0' -m 2 adding bar $ cd .. clone over http with --update $ hg clone http://localhost:$HGPORT1/ updated --update 0 requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 5 changes to 5 files new changesets 8b6053c928fe:5fed3813f7f5 updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg log -r . -R updated changeset: 0:8b6053c928fe user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 1 $ rm -rf updated incoming via HTTP $ hg clone http://localhost:$HGPORT1/ --rev 0 partial adding changesets adding manifests adding file changes added 1 changesets with 4 changes to 4 files new changesets 8b6053c928fe updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd partial $ touch LOCAL $ hg ci -qAm LOCAL $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' comparing with http://localhost:$HGPORT1/ searching for changes 2 $ cd .. pull $ cd copy-pull $ cat >> .hg/hgrc < [hooks] > changegroup = sh -c "printenv.py changegroup" > EOF $ hg pull pulling from http://localhost:$HGPORT1/ searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 5fed3813f7f5 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT1/ (run 'hg update' to get a working copy) $ cd .. clone from invalid URL $ hg clone http://localhost:$HGPORT/bad abort: HTTP Error 404: Not Found [255] test http authentication + use the same server to test server side streaming preference $ cd test $ cat << EOT > userpass.py > import base64 > from mercurial.hgweb import common > def perform_authentication(hgweb, req, op): > auth = req.env.get('HTTP_AUTHORIZATION') > if not auth: > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') > def extsetup(): > common.permhooks.insert(0, perform_authentication) > EOT $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \ > --config server.preferuncompressed=True \ > --config web.push_ssl=False --config web.allow_push=* -A ../access.log $ cat pid >> $DAEMON_PIDS $ cat << EOF > get_pass.py > import getpass > def newgetpass(arg): > return "pass" > getpass.getpass = newgetpass > EOF $ hg id http://localhost:$HGPORT2/ abort: http authorization required for http://localhost:$HGPORT2/ [255] $ hg id http://localhost:$HGPORT2/ abort: http authorization required for http://localhost:$HGPORT2/ [255] $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ http authorization required for http://localhost:$HGPORT2/ realm: mercurial user: user password: 5fed3813f7f5 $ hg id http://user:pass@localhost:$HGPORT2/ 5fed3813f7f5 $ echo '[auth]' >> .hg/hgrc $ echo 'l.schemes=http' >> .hg/hgrc $ echo 'l.prefix=lo' >> .hg/hgrc $ echo 'l.username=user' >> .hg/hgrc $ echo 'l.password=pass' >> .hg/hgrc $ hg id http://localhost:$HGPORT2/ 5fed3813f7f5 $ hg id http://localhost:$HGPORT2/ 5fed3813f7f5 $ hg id http://user@localhost:$HGPORT2/ 5fed3813f7f5 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 streaming all changes 7 files to transfer, 916 bytes of data transferred * bytes in * seconds (*/sec) (glob) searching for changes no changes found updating to branch default 5 files updated, 0 files merged, 0 files removed, 0 files unresolved --pull should override server's preferuncompressed $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 5 changes to 5 files new changesets 8b6053c928fe:5fed3813f7f5 updating to branch default 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id http://user2@localhost:$HGPORT2/ abort: http authorization required for http://localhost:$HGPORT2/ [255] $ hg id http://user:pass2@localhost:$HGPORT2/ abort: HTTP Error 403: no [255] $ hg -R dest tag -r tip top $ hg -R dest push http://user:pass@localhost:$HGPORT2/ pushing to http://user:***@localhost:$HGPORT2/ searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files $ hg rollback -q $ sed 's/.*] "/"/' < ../access.log "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 403 - "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+5eb5abfefeea63c80dd7553bcc3783f37e0c5524* (glob) "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ $ cd .. clone of serve with repo in root and unserved subrepo (issue2970) $ hg --cwd test init sub $ echo empty > test/sub/empty $ hg --cwd test/sub add empty $ hg --cwd test/sub commit -qm 'add empty' $ hg --cwd test/sub tag -r 0 something $ echo sub = sub > test/.hgsub $ hg --cwd test add .hgsub $ hg --cwd test commit -qm 'add subrepo' $ hg clone http://localhost:$HGPORT noslash-clone requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 7 changes to 7 files new changesets 8b6053c928fe:56f9bc90cce6 updating to branch default abort: HTTP Error 404: Not Found [255] $ hg clone http://localhost:$HGPORT/ slash-clone requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 7 changes to 7 files new changesets 8b6053c928fe:56f9bc90cce6 updating to branch default abort: HTTP Error 404: Not Found [255] check error log $ cat error.log Check error reporting while pulling/cloning $ $RUNTESTDIR/killdaemons.py $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py $ cat hg3.pid >> $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ abort-clone requesting all changes abort: remote error: this is an exercise [255] $ cat error.log disable pull-based clones $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True $ cat hg4.pid >> $DAEMON_PIDS $ hg clone http://localhost:$HGPORT1/ disable-pull-clone requesting all changes abort: remote error: server has pull-based clones disabled [255] ... but keep stream clones working $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone streaming all changes * files to transfer, * of data (glob) transferred * in * seconds (* KB/sec) (glob) searching for changes no changes found ... and also keep partial clones and pulls working $ hg clone http://localhost:$HGPORT1 --rev 0 test-partial-clone adding changesets adding manifests adding file changes added 1 changesets with 4 changes to 4 files new changesets 8b6053c928fe updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg pull -R test-partial-clone pulling from http://localhost:$HGPORT1/ searching for changes adding changesets adding manifests adding file changes added 2 changesets with 3 changes to 3 files new changesets 5fed3813f7f5:56f9bc90cce6 (run 'hg update' to get a working copy) $ cat error.log mercurial-4.5.3/tests/test-update-branches.t0000644015407300116100000003616213261161234020756 0ustar augieeng00000000000000# Construct the following history tree: # # @ 5:e1bb631146ca b1 # | # o 4:a4fdb3b883c4 0:b608b9236435 b1 # | # | o 3:4b57d2520816 1:44592833ba9f # | | # | | o 2:063f31070f65 # | |/ # | o 1:44592833ba9f # |/ # o 0:b608b9236435 $ mkdir b1 $ cd b1 $ hg init $ echo foo > foo $ echo zero > a $ hg init sub $ echo suba > sub/suba $ hg --cwd sub ci -Am addsuba adding suba $ echo 'sub = sub' > .hgsub $ hg ci -qAm0 $ echo one > a ; hg ci -m1 $ echo two > a ; hg ci -m2 $ hg up -q 1 $ echo three > a ; hg ci -qm3 $ hg up -q 0 $ hg branch -q b1 $ echo four > a ; hg ci -qm4 $ echo five > a ; hg ci -qm5 Initial repo state: $ hg log -G --template '{rev}:{node|short} {parents} {branches}\n' @ 5:ff252e8273df b1 | o 4:d047485b3896 0:60829823a42a b1 | | o 3:6efa171f091b 1:0786582aa4b1 | | | | o 2:bd10386d478c | |/ | o 1:0786582aa4b1 |/ o 0:60829823a42a Make sure update doesn't assume b1 is a repository if invoked from outside: $ cd .. $ hg update b1 abort: no repository found in '$TESTTMP' (.hg not found)! [255] $ cd b1 Test helper functions: $ revtest () { > msg=$1 > dirtyflag=$2 # 'clean', 'dirty' or 'dirtysub' > startrev=$3 > targetrev=$4 > opt=$5 > hg up -qC $startrev > test $dirtyflag = dirty && echo dirty > foo > test $dirtyflag = dirtysub && echo dirty > sub/suba > hg up $opt $targetrev > hg parent --template 'parent={rev}\n' > hg stat -S > } $ norevtest () { > msg=$1 > dirtyflag=$2 # 'clean', 'dirty' or 'dirtysub' > startrev=$3 > opt=$4 > hg up -qC $startrev > test $dirtyflag = dirty && echo dirty > foo > test $dirtyflag = dirtysub && echo dirty > sub/suba > hg up $opt > hg parent --template 'parent={rev}\n' > hg stat -S > } Test cases are documented in a table in the update function of merge.py. Cases are run as shown in that table, row by row. $ norevtest 'none clean linear' clean 4 1 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=5 $ norevtest 'none clean same' clean 2 0 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to "bd10386d478c: 2" 1 other heads for branch "default" parent=2 $ revtest 'none clean linear' clean 1 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=2 $ revtest 'none clean same' clean 2 3 1 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=3 $ revtest 'none clean cross' clean 3 4 1 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=4 $ revtest 'none dirty linear' dirty 1 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=2 M foo $ revtest 'none dirtysub linear' dirtysub 1 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=2 M sub/suba $ revtest 'none dirty same' dirty 2 3 abort: uncommitted changes (commit or update --clean to discard changes) parent=2 M foo $ revtest 'none dirtysub same' dirtysub 2 3 abort: uncommitted changes (commit or update --clean to discard changes) parent=2 M sub/suba $ revtest 'none dirty cross' dirty 3 4 abort: uncommitted changes (commit or update --clean to discard changes) parent=3 M foo $ norevtest 'none dirty cross' dirty 2 0 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to "bd10386d478c: 2" 1 other heads for branch "default" parent=2 M foo $ revtest 'none dirtysub cross' dirtysub 3 4 abort: uncommitted changes (commit or update --clean to discard changes) parent=3 M sub/suba $ revtest '-C dirty linear' dirty 1 2 -C 2 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=2 $ revtest '-c dirty linear' dirty 1 2 -c abort: uncommitted changes parent=1 M foo $ revtest '-m dirty linear' dirty 1 2 -m 1 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=2 M foo $ revtest '-m dirty cross' dirty 3 4 -m 1 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=4 M foo $ revtest '-c dirtysub linear' dirtysub 1 2 -c abort: uncommitted changes in subrepository "sub" parent=1 M sub/suba $ norevtest '-c clean same' clean 2 -c 0 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to "bd10386d478c: 2" 1 other heads for branch "default" parent=2 $ revtest '-cC dirty linear' dirty 1 2 -cC abort: can only specify one of -C/--clean, -c/--check, or -m/--merge parent=1 M foo $ revtest '-mc dirty linear' dirty 1 2 -mc abort: can only specify one of -C/--clean, -c/--check, or -m/--merge parent=1 M foo $ revtest '-mC dirty linear' dirty 1 2 -mC abort: can only specify one of -C/--clean, -c/--check, or -m/--merge parent=1 M foo $ echo '[commands]' >> .hg/hgrc $ echo 'update.check = abort' >> .hg/hgrc $ revtest 'none dirty linear' dirty 1 2 abort: uncommitted changes parent=1 M foo $ revtest 'none dirty linear' dirty 1 2 -c abort: uncommitted changes parent=1 M foo $ revtest 'none dirty linear' dirty 1 2 -C 2 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=2 $ echo 'update.check = none' >> .hg/hgrc $ revtest 'none dirty cross' dirty 3 4 1 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=4 M foo $ revtest 'none dirty linear' dirty 1 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=2 M foo $ revtest 'none dirty linear' dirty 1 2 -c abort: uncommitted changes parent=1 M foo $ revtest 'none dirty linear' dirty 1 2 -C 2 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=2 $ hg co -qC 3 $ echo dirty >> a $ hg co --tool :merge3 4 merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges [1] $ hg st M a ? a.orig $ cat a <<<<<<< working copy: 6efa171f091b - test: 3 three dirty ||||||| base three ======= four >>>>>>> destination: d047485b3896 b1 - test: 4 $ rm a.orig $ echo 'update.check = noconflict' >> .hg/hgrc $ revtest 'none dirty cross' dirty 3 4 1 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=4 M foo $ revtest 'none dirty linear' dirty 1 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=2 M foo $ revtest 'none dirty linear' dirty 1 2 -c abort: uncommitted changes parent=1 M foo $ revtest 'none dirty linear' dirty 1 2 -C 2 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=2 Locally added file is allowed $ hg up -qC 3 $ echo a > bar $ hg add bar $ hg up -q 4 $ hg st A bar $ hg forget bar $ rm bar Locally removed file is allowed $ hg up -qC 3 $ hg rm foo $ hg up -q 4 File conflict is not allowed $ hg up -qC 3 $ echo dirty >> a $ hg up -q 4 abort: conflicting changes (commit or update --clean to discard changes) [255] $ hg up -m 4 merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') 0 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges [1] $ rm a.orig Change/delete conflict is not allowed $ hg up -qC 3 $ hg rm foo $ hg up -q 4 Uses default value of "linear" when value is misspelled $ echo 'update.check = linyar' >> .hg/hgrc $ revtest 'dirty cross' dirty 3 4 abort: uncommitted changes (commit or update --clean to discard changes) parent=3 M foo Setup for later tests $ revtest 'none dirty linear' dirty 1 2 -c abort: uncommitted changes parent=1 M foo $ cd .. Test updating to null revision $ hg init null-repo $ cd null-repo $ echo a > a $ hg add a $ hg ci -m a $ hg up -qC 0 $ echo b > b $ hg add b $ hg up null 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg st A b $ hg up -q 0 $ hg st A b $ hg up -qC null $ hg st ? b $ cd .. Test updating with closed head --------------------------------------------------------------------- $ hg clone -U -q b1 closed-heads $ cd closed-heads Test updating if at least one non-closed branch head exists if on the closed branch head: - update to "." - "updated to a closed branch head ...." message is displayed - "N other heads for ...." message is displayed $ hg update -q -C 3 $ hg commit --close-branch -m 6 $ norevtest "on closed branch head" clean 6 0 files updated, 0 files merged, 0 files removed, 0 files unresolved no open descendant heads on branch "default", updating to a closed head (committing will reopen the head, use 'hg heads .' to see 1 other heads) parent=6 if descendant non-closed branch head exists, and it is only one branch head: - update to it, even if its revision is less than closed one - "N other heads for ...." message isn't displayed $ norevtest "non-closed 2 should be chosen" clean 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=2 if all descendant branch heads are closed, but there is another branch head: - update to the tipmost descendant head - "updated to a closed branch head ...." message is displayed - "N other heads for ...." message is displayed $ norevtest "all descendant branch heads are closed" clean 3 0 files updated, 0 files merged, 0 files removed, 0 files unresolved no open descendant heads on branch "default", updating to a closed head (committing will reopen the head, use 'hg heads .' to see 1 other heads) parent=6 Test updating if all branch heads are closed if on the closed branch head: - update to "." - "updated to a closed branch head ...." message is displayed - "all heads of branch ...." message is displayed $ hg update -q -C 2 $ hg commit --close-branch -m 7 $ norevtest "all heads of branch default are closed" clean 6 0 files updated, 0 files merged, 0 files removed, 0 files unresolved no open descendant heads on branch "default", updating to a closed head (committing will reopen branch "default") parent=6 if not on the closed branch head: - update to the tipmost descendant (closed) head - "updated to a closed branch head ...." message is displayed - "all heads of branch ...." message is displayed $ norevtest "all heads of branch default are closed" clean 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved no open descendant heads on branch "default", updating to a closed head (committing will reopen branch "default") parent=7 $ cd .. Test updating if "default" branch doesn't exist and no revision is checked out (= "default" is used as current branch) $ hg init no-default-branch $ cd no-default-branch $ hg branch foobar marked working directory as branch foobar (branches are permanent and global, did you want a bookmark?) $ echo a > a $ hg commit -m "#0" -A adding a $ echo 1 >> a $ hg commit -m "#1" $ hg update -q 0 $ echo 3 >> a $ hg commit -m "#2" created new head $ hg commit --close-branch -m "#3" if there is at least one non-closed branch head: - update to the tipmost branch head $ norevtest "non-closed 1 should be chosen" clean null 1 files updated, 0 files merged, 0 files removed, 0 files unresolved parent=1 if all branch heads are closed - update to "tip" - "updated to a closed branch head ...." message is displayed - "all heads for branch "XXXX" are closed" message is displayed $ hg update -q -C 1 $ hg commit --close-branch -m "#4" $ norevtest "all branches are closed" clean null 1 files updated, 0 files merged, 0 files removed, 0 files unresolved no open descendant heads on branch "foobar", updating to a closed head (committing will reopen branch "foobar") parent=4 $ cd ../b1 Test obsolescence behavior --------------------------------------------------------------------- successors should be taken in account when checking head destination $ cat << EOF >> $HGRCPATH > [ui] > logtemplate={rev}:{node|short} {desc|firstline} > [experimental] > evolution.createmarkers=True > EOF Test no-argument update to a successor of an obsoleted changeset $ hg log -G o 5:ff252e8273df 5 | o 4:d047485b3896 4 | | o 3:6efa171f091b 3 | | | | o 2:bd10386d478c 2 | |/ | @ 1:0786582aa4b1 1 |/ o 0:60829823a42a 0 $ hg book bm -r 3 $ hg status M foo We add simple obsolescence marker between 3 and 4 (indirect successors) $ hg id --debug -i -r 3 6efa171f091b00a3c35edc15d48c52a498929953 $ hg id --debug -i -r 4 d047485b3896813b2a624e86201983520f003206 $ hg debugobsolete 6efa171f091b00a3c35edc15d48c52a498929953 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa obsoleted 1 changesets $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa d047485b3896813b2a624e86201983520f003206 Test that 5 is detected as a valid destination from 3 and also accepts moving the bookmark (issue4015) $ hg up --quiet --hidden 3 $ hg up 5 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg book bm moving bookmark 'bm' forward from 6efa171f091b $ hg bookmarks * bm 5:ff252e8273df Test that 4 is detected as the no-argument destination from 3 and also moves the bookmark with it $ hg up --quiet 0 # we should be able to update to 3 directly $ hg up --quiet --hidden 3 # but not implemented yet. updating to a hidden changeset 6efa171f091b (hidden revision '6efa171f091b' was rewritten as: d047485b3896) $ hg book -f bm $ hg up 1 files updated, 0 files merged, 0 files removed, 0 files unresolved updating bookmark bm $ hg book * bm 4:d047485b3896 Test that 5 is detected as a valid destination from 1 $ hg up --quiet 0 # we should be able to update to 3 directly $ hg up --quiet --hidden 3 # but not implemented yet. updating to a hidden changeset 6efa171f091b (hidden revision '6efa171f091b' was rewritten as: d047485b3896) $ hg up 5 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Test that 5 is not detected as a valid destination from 2 $ hg up --quiet 0 $ hg up --quiet 2 $ hg up 5 abort: uncommitted changes (commit or update --clean to discard changes) [255] Test that we don't crash when updating from a pruned changeset (i.e. has no successors). Behavior should probably be that we update to the first non-obsolete parent but that will be decided later. $ hg id --debug -r 2 bd10386d478cd5a9faf2e604114c8e6da62d3889 $ hg up --quiet 0 $ hg up --quiet 2 $ hg debugobsolete bd10386d478cd5a9faf2e604114c8e6da62d3889 obsoleted 1 changesets $ hg up 0 files updated, 0 files merged, 0 files removed, 0 files unresolved Test experimental revset support $ hg log -r '_destupdate()' 2:bd10386d478c 2 (no-eol) Test that boolean flags allow --no-flag specification to override [defaults] $ cat >> $HGRCPATH < [defaults] > update = --check > EOF $ hg co 2 abort: uncommitted changes [255] $ hg co --no-check 2 0 files updated, 0 files merged, 0 files removed, 0 files unresolved mercurial-4.5.3/tests/test-convert-tagsbranch-topology.t0000644015407300116100000000443713261161234023355 0ustar augieeng00000000000000#require git $ echo "[core]" >> $HOME/.gitconfig $ echo "autocrlf = false" >> $HOME/.gitconfig $ echo "[core]" >> $HOME/.gitconfig $ echo "autocrlf = false" >> $HOME/.gitconfig $ cat <> $HGRCPATH > [extensions] > convert = > [convert] > hg.usebranchnames = True > hg.tagsbranch = tags-update > EOF $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE $ count=10 $ action() > { > GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000" > GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" > git "$@" >/dev/null 2>/dev/null || echo "git command error" > count=`expr $count + 1` > } $ glog() > { > hg log -G --template '{rev} "{desc|firstline}" files: {files}\n' "$@" > } $ convertrepo() > { > hg convert --datesort git-repo hg-repo > } Build a GIT repo with at least 1 tag $ mkdir git-repo $ cd git-repo $ git init >/dev/null 2>&1 $ echo a > a $ git add a $ action commit -m "rev1" $ action tag -m "tag1" tag1 $ cd .. Convert without tags $ hg convert git-repo hg-repo --config convert.skiptags=True initializing destination hg-repo repository scanning source... sorting... converting... 0 rev1 updating bookmarks $ hg -R hg-repo tags tip 0:d98c8ad3a4cf $ rm -rf hg-repo Do a first conversion $ convertrepo initializing destination hg-repo repository scanning source... sorting... converting... 0 rev1 updating tags updating bookmarks Simulate upstream updates after first conversion $ cd git-repo $ echo b > a $ git add a $ action commit -m "rev2" $ action tag -m "tag2" tag2 $ cd .. Perform an incremental conversion $ convertrepo scanning source... sorting... converting... 0 rev2 updating tags updating bookmarks Print the log $ cd hg-repo $ glog o 3 "update tags" files: .hgtags | | o 2 "rev2" files: a | | o | 1 "update tags" files: .hgtags / o 0 "rev1" files: a $ cd .. mercurial-4.5.3/tests/test-mq-qpush-fail.t0000644015407300116100000002276613261161234020402 0ustar augieeng00000000000000Test that qpush cleans things up if it doesn't complete $ echo "[extensions]" >> $HGRCPATH $ echo "mq=" >> $HGRCPATH $ hg init repo $ cd repo $ echo foo > foo $ hg ci -Am 'add foo' adding foo $ touch untracked-file $ echo 'syntax: glob' > .hgignore $ echo '.hgignore' >> .hgignore $ hg qinit test qpush on empty series $ hg qpush no patches in series $ hg qnew patch1 $ echo >> foo $ hg qrefresh -m 'patch 1' $ hg qnew patch2 $ echo bar > bar $ hg add bar $ hg qrefresh -m 'patch 2' $ hg qnew --config 'mq.plain=true' -U bad-patch $ echo >> foo $ hg qrefresh $ hg qpop -a popping bad-patch popping patch2 popping patch1 patch queue now empty $ $PYTHON -c 'print "\xe9"' > message $ cat .hg/patches/bad-patch >> message $ mv message .hg/patches/bad-patch $ cat > $TESTTMP/wrapplayback.py < import os > from mercurial import extensions, transaction > def wrapplayback(orig, > journal, report, opener, vfsmap, entries, backupentries, > unlink=True, checkambigfiles=None): > orig(journal, report, opener, vfsmap, entries, backupentries, unlink, > checkambigfiles) > # Touching files truncated at "transaction.abort" causes > # forcible re-loading invalidated filecache properties > # (including repo.changelog) > for f, o, _ignore in entries: > if o or not unlink: > os.utime(opener.join(f), (0.0, 0.0)) > def extsetup(ui): > extensions.wrapfunction(transaction, '_playback', wrapplayback) > EOF $ hg qpush -a --config extensions.wrapplayback=$TESTTMP/wrapplayback.py && echo 'qpush succeeded?!' applying patch1 applying patch2 applying bad-patch transaction abort! rollback completed cleaning up working directory... reverting foo done abort: decoding near '\xe9': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)! (esc) [255] $ hg parents changeset: 0:bbd179dfa0a7 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add foo test corrupt status file $ hg qpush applying patch1 now at: patch1 $ cp .hg/patches/status .hg/patches/status.orig $ hg qpop popping patch1 patch queue now empty $ cp .hg/patches/status.orig .hg/patches/status $ hg qpush abort: working directory revision is not qtip [255] $ rm .hg/patches/status .hg/patches/status.orig bar should be gone; other unknown/ignored files should still be around $ hg status -A ? untracked-file I .hgignore C foo preparing qpush of a missing patch $ hg qpop -a no patches applied $ hg qpush applying patch1 now at: patch1 $ rm .hg/patches/patch2 now we expect the push to fail, but it should NOT complain about patch1 $ hg qpush applying patch2 unable to read patch2 now at: patch1 [1] preparing qpush of missing patch with no patch applied $ hg qpop -a popping patch1 patch queue now empty $ rm .hg/patches/patch1 qpush should fail the same way as below $ hg qpush applying patch1 unable to read patch1 [1] Test qpush to a patch below the currently applied patch. $ hg qq -c guardedseriesorder $ hg qnew a $ hg qguard +block $ hg qnew b $ hg qnew c $ hg qpop -a popping c popping b popping a patch queue now empty try to push and pop while a is guarded $ hg qpush a cannot push 'a' - guarded by '+block' [1] $ hg qpush -a applying b patch b is empty applying c patch c is empty now at: c now try it when a is unguarded, and we're at the top of the queue $ hg qapplied -v 0 G a 1 A b 2 A c $ hg qsel block $ hg qpush b abort: cannot push to a previous patch: b [255] $ hg qpush a abort: cannot push to a previous patch: a [255] and now we try it one more time with a unguarded, while we're not at the top of the queue $ hg qpop b popping c now at: b $ hg qpush a abort: cannot push to a previous patch: a [255] test qpop --force and backup files $ hg qpop -a popping b patch queue now empty $ hg qq --create force $ echo a > a $ echo b > b $ echo c > c $ hg ci -Am add a b c $ echo a >> a $ hg rm b $ hg rm c $ hg qnew p1 $ echo a >> a $ echo bb > b $ hg add b $ echo cc > c $ hg add c $ hg qpop --force --verbose saving current version of a as a.orig saving current version of b as b.orig saving current version of c as c.orig popping p1 patch queue now empty $ hg st ? a.orig ? b.orig ? c.orig ? untracked-file $ cat a.orig a a a $ cat b.orig bb $ cat c.orig cc test qpop --force --no-backup $ hg qpush applying p1 now at: p1 $ rm a.orig $ echo a >> a $ hg qpop --force --no-backup --verbose popping p1 patch queue now empty $ test -f a.orig && echo 'error: backup with --no-backup' [1] test qpop --keep-changes $ hg qpush applying p1 now at: p1 $ hg qpop --keep-changes --force abort: cannot use both --force and --keep-changes [255] $ echo a >> a $ hg qpop --keep-changes abort: local changes found, qrefresh first [255] $ hg revert -qa a $ rm a $ hg qpop --keep-changes abort: local changes found, qrefresh first [255] $ hg rm -A a $ hg qpop --keep-changes abort: local changes found, qrefresh first [255] $ hg revert -qa a $ echo b > b $ hg add b $ hg qpop --keep-changes abort: local changes found, qrefresh first [255] $ hg forget b $ echo d > d $ hg add d $ hg qpop --keep-changes popping p1 patch queue now empty $ hg forget d $ rm d test qpush --force and backup files $ echo a >> a $ hg qnew p2 $ echo b >> b $ echo d > d $ echo e > e $ hg add d e $ hg rm c $ hg qnew p3 $ hg qpop -a popping p3 popping p2 patch queue now empty $ echo a >> a $ echo b1 >> b $ echo d1 > d $ hg add d $ echo e1 > e $ hg qpush -a --force --verbose applying p2 saving current version of a as a.orig patching file a committing files: a committing manifest committing changelog applying p3 saving current version of b as b.orig saving current version of d as d.orig patching file b patching file c patching file d file d already exists 1 out of 1 hunks FAILED -- saving rejects to file d.rej patching file e file e already exists 1 out of 1 hunks FAILED -- saving rejects to file e.rej patch failed to apply committing files: b committing manifest committing changelog patch failed, rejects left in working directory errors during apply, please fix and qrefresh p3 [2] $ cat a.orig a a $ cat b.orig b b1 $ cat d.orig d1 test qpush --force --no-backup $ hg revert -qa $ hg qpop -a popping p3 popping p2 patch queue now empty $ echo a >> a $ rm a.orig $ hg qpush --force --no-backup --verbose applying p2 patching file a committing files: a committing manifest committing changelog now at: p2 $ test -f a.orig && echo 'error: backup with --no-backup' [1] test qgoto --force --no-backup $ hg qpop popping p2 patch queue now empty $ echo a >> a $ hg qgoto --force --no-backup p2 --verbose applying p2 patching file a committing files: a committing manifest committing changelog now at: p2 $ test -f a.orig && echo 'error: backup with --no-backup' [1] test qpush --keep-changes $ hg qpush --keep-changes --force abort: cannot use both --force and --keep-changes [255] $ hg qpush --keep-changes --exact abort: cannot use --exact and --keep-changes together [255] $ echo b >> b $ hg qpush --keep-changes applying p3 abort: conflicting local changes found (did you forget to qrefresh?) [255] $ rm b $ hg qpush --keep-changes applying p3 abort: conflicting local changes found (did you forget to qrefresh?) [255] $ hg rm -A b $ hg qpush --keep-changes applying p3 abort: conflicting local changes found (did you forget to qrefresh?) [255] $ hg revert -aq b $ echo d > d $ hg add d $ hg qpush --keep-changes applying p3 abort: conflicting local changes found (did you forget to qrefresh?) [255] $ hg forget d $ rm d $ hg qpop popping p2 patch queue now empty $ echo b >> b $ hg qpush -a --keep-changes applying p2 applying p3 abort: conflicting local changes found (did you forget to qrefresh?) [255] $ hg qtop p2 $ hg parents --template "{rev} {desc}\n" 2 imported patch p2 $ hg st b M b $ cat b b b test qgoto --keep-changes $ hg revert -aq b $ rm e $ hg qgoto --keep-changes --force p3 abort: cannot use both --force and --keep-changes [255] $ echo a >> a $ hg qgoto --keep-changes p3 applying p3 now at: p3 $ hg st a M a $ hg qgoto --keep-changes p2 popping p3 now at: p2 $ hg st a M a test mq.keepchanges setting $ hg --config mq.keepchanges=1 qpush applying p3 now at: p3 $ hg st a M a $ hg --config mq.keepchanges=1 qpop popping p3 now at: p2 $ hg st a M a $ hg --config mq.keepchanges=1 qgoto p3 applying p3 now at: p3 $ hg st a M a $ echo b >> b $ hg --config mq.keepchanges=1 qpop --force --config 'ui.origbackuppath=.hg/origbackups' popping p3 now at: p2 $ hg st b $ hg --config mq.keepchanges=1 qpush --exact abort: local changes found, qrefresh first [255] $ hg revert -qa a $ hg qpop popping p2 patch queue now empty $ echo a >> a $ hg --config mq.keepchanges=1 qpush --force applying p2 now at: p2 $ hg st a test previous qpop (with --force and --config) saved .orig files to where user wants them $ ls .hg/origbackups b $ rm -rf .hg/origbackups $ cd .. mercurial-4.5.3/tests/test-subrepo-git.t0000644015407300116100000007015013261161234020144 0ustar augieeng00000000000000#require git make git commits repeatable $ cat >> $HGRCPATH < [defaults] > commit = -d "0 0" > EOF $ echo "[core]" >> $HOME/.gitconfig $ echo "autocrlf = false" >> $HOME/.gitconfig $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL $ GIT_AUTHOR_DATE='1234567891 +0000'; export GIT_AUTHOR_DATE $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE $ GIT_CONFIG_NOSYSTEM=1; export GIT_CONFIG_NOSYSTEM root hg repo $ hg init t $ cd t $ echo a > a $ hg add a $ hg commit -m a $ cd .. new external git repo $ mkdir gitroot $ cd gitroot $ git init -q $ echo g > g $ git add g $ git commit -q -m g add subrepo clone $ cd ../t $ echo 's = [git]../gitroot' > .hgsub $ git clone -q ../gitroot s $ hg add .hgsub git subrepo is disabled by default $ hg commit -m 'new git subrepo' abort: git subrepos not allowed (see 'hg help config.subrepos' for details) [255] so enable it $ cat >> $HGRCPATH < [subrepos] > git:allowed = true > EOF $ hg commit -m 'new git subrepo' $ hg debugsub path s source ../gitroot revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 record a new commit from upstream from a different branch $ cd ../gitroot $ git checkout -q -b testing $ echo gg >> g $ git commit -q -a -m gg $ cd ../t/s $ git pull -q >/dev/null 2>/dev/null $ git checkout -q -b testing origin/testing >/dev/null $ cd .. $ hg status --subrepos M s/g $ hg commit -m 'update git subrepo' $ hg debugsub path s source ../gitroot revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a make $GITROOT pushable, by replacing it with a clone with nothing checked out $ cd .. $ git clone gitroot gitrootbare --bare -q $ rm -rf gitroot $ mv gitrootbare gitroot clone root $ cd t $ hg clone . ../tc 2> /dev/null updating to branch default cloning subrepo s from $TESTTMP/gitroot 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ../tc $ hg debugsub path s source ../gitroot revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a $ cd .. clone with subrepo disabled (update should fail) $ hg clone t -U tc2 --config subrepos.allowed=false $ hg update -R tc2 --config subrepos.allowed=false abort: subrepos not enabled (see 'hg help config.subrepos' for details) [255] $ ls tc2 a $ hg clone t tc3 --config subrepos.allowed=false updating to branch default abort: subrepos not enabled (see 'hg help config.subrepos' for details) [255] $ ls tc3 a update to previous substate $ cd tc $ hg update 1 -q $ cat s/g g $ hg debugsub path s source ../gitroot revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 clone root, make local change $ cd ../t $ hg clone . ../ta 2> /dev/null updating to branch default cloning subrepo s from $TESTTMP/gitroot 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ../ta $ echo ggg >> s/g $ hg status --subrepos M s/g $ hg diff --subrepos diff --git a/s/g b/s/g index 089258f..85341ee 100644 --- a/s/g +++ b/s/g @@ -1,2 +1,3 @@ g gg +ggg $ hg commit --subrepos -m ggg committing subrepository s $ hg debugsub path s source ../gitroot revision 79695940086840c99328513acbe35f90fcd55e57 clone root separately, make different local change $ cd ../t $ hg clone . ../tb 2> /dev/null updating to branch default cloning subrepo s from $TESTTMP/gitroot 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ../tb/s $ hg status --subrepos $ echo f > f $ hg status --subrepos ? s/f $ hg add . adding f $ git add f $ cd .. $ hg status --subrepos A s/f $ hg commit --subrepos -m f committing subrepository s $ hg debugsub path s source ../gitroot revision aa84837ccfbdfedcdcdeeedc309d73e6eb069edc user b push changes $ hg push 2>/dev/null pushing to $TESTTMP/t pushing branch testing of subrepository "s" searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files user a pulls, merges, commits $ cd ../ta $ hg pull pulling from $TESTTMP/t searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 089416c11d73 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg merge 2>/dev/null subrepository s diverged (local revision: 7969594, remote revision: aa84837) (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m pulling subrepo s from $TESTTMP/gitroot 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg st --subrepos s A s/f $ cat s/f f $ cat s/g g gg ggg $ hg commit --subrepos -m 'merge' committing subrepository s $ hg status --subrepos --rev 1:5 M .hgsubstate M s/g A s/f $ hg debugsub path s source ../gitroot revision f47b465e1bce645dbf37232a00574aa1546ca8d3 $ hg push 2>/dev/null pushing to $TESTTMP/t pushing branch testing of subrepository "s" searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files make upstream git changes $ cd .. $ git clone -q gitroot gitclone $ cd gitclone $ echo ff >> f $ git commit -q -a -m ff $ echo fff >> f $ git commit -q -a -m fff $ git push origin testing 2>/dev/null make and push changes to hg without updating the subrepo $ cd ../t $ hg clone . ../td 2>&1 | egrep -v '^Cloning into|^done\.' updating to branch default cloning subrepo s from $TESTTMP/gitroot checking out detached HEAD in subrepository "s" check out a git branch if you intend to make changes 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ../td $ echo aa >> a $ hg commit -m aa $ hg push pushing to $TESTTMP/t searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files sync to upstream git, distribute changes $ cd ../ta $ hg pull -u -q $ cd s $ git pull -q >/dev/null 2>/dev/null $ cd .. $ hg commit -m 'git upstream sync' $ hg debugsub path s source ../gitroot revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc $ hg push -q $ cd ../tb $ hg pull -q $ hg update 2>/dev/null pulling subrepo s from $TESTTMP/gitroot 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg debugsub path s source ../gitroot revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc create a new git branch $ cd s $ git checkout -b b2 Switched to a new branch 'b2' $ echo a>a $ git add a $ git commit -qm 'add a' $ cd .. $ hg commit -m 'add branch in s' pulling new git branch should not create tracking branch named 'origin/b2' (issue3870) $ cd ../td/s $ git remote set-url origin $TESTTMP/tb/s $ git branch --no-track oldtesting $ cd .. $ hg pull -q ../tb $ hg up From $TESTTMP/tb/s * [new branch] b2 -> origin/b2 Previous HEAD position was f47b465* merge (glob) Switched to a new branch 'b2' pulling subrepo s from $TESTTMP/tb/s 1 files updated, 0 files merged, 0 files removed, 0 files unresolved update to a revision without the subrepo, keeping the local git repository $ cd ../t $ hg up 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ ls -a s . .. .git $ hg up 2 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ ls -a s . .. .git g archive subrepos $ cd ../tc $ hg pull -q $ hg archive --subrepos -r 5 ../archive 2>/dev/null pulling subrepo s from $TESTTMP/gitroot $ cd ../archive $ cat s/f f $ cat s/g g gg ggg $ hg -R ../tc archive --subrepo -r 5 -X ../tc/**f ../archive_x 2>/dev/null $ find ../archive_x | sort | grep -v pax_global_header ../archive_x ../archive_x/.hg_archival.txt ../archive_x/.hgsub ../archive_x/.hgsubstate ../archive_x/a ../archive_x/s ../archive_x/s/g $ hg -R ../tc archive -S ../archive.tgz --prefix '.' 2>/dev/null $ tar -tzf ../archive.tgz | sort | grep -v pax_global_header .hg_archival.txt .hgsub .hgsubstate a s/g create nested repo $ cd .. $ hg init outer $ cd outer $ echo b>b $ hg add b $ hg commit -m b $ hg clone ../t inner 2> /dev/null updating to branch default cloning subrepo s from $TESTTMP/gitroot 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo inner = inner > .hgsub $ hg add .hgsub $ hg commit -m 'nested sub' nested commit $ echo ffff >> inner/s/f $ hg status --subrepos M inner/s/f $ hg commit --subrepos -m nested committing subrepository inner committing subrepository inner/s nested archive $ hg archive --subrepos ../narchive $ ls ../narchive/inner/s | grep -v pax_global_header f g relative source expansion $ cd .. $ mkdir d $ hg clone t d/t 2> /dev/null updating to branch default cloning subrepo s from $TESTTMP/gitroot 3 files updated, 0 files merged, 0 files removed, 0 files unresolved Don't crash if the subrepo is missing $ hg clone t missing -q $ cd missing $ rm -rf s $ hg status -S $ hg sum | grep commit commit: 1 subrepos $ hg push -q abort: subrepo s is missing (in subrepository "s") [255] $ hg commit --subrepos -qm missing abort: subrepo s is missing (in subrepository "s") [255] #if symlink Don't crash if subrepo is a broken symlink $ ln -s broken s $ hg status -S abort: subrepo 's' traverses symbolic link [255] $ hg push -q abort: subrepo 's' traverses symbolic link [255] $ hg commit --subrepos -qm missing abort: subrepo 's' traverses symbolic link [255] $ rm s #endif $ hg update -C 2> /dev/null cloning subrepo s from $TESTTMP/gitroot 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg sum | grep commit commit: (clean) Don't crash if the .hgsubstate entry is missing $ hg update 1 -q $ hg rm .hgsubstate $ hg commit .hgsubstate -m 'no substate' nothing changed [1] $ hg tag -l nosubstate $ hg manifest .hgsub .hgsubstate a $ hg status -S R .hgsubstate $ hg sum | grep commit commit: 1 removed, 1 subrepos (new branch head) $ hg commit -m 'restore substate' nothing changed [1] $ hg manifest .hgsub .hgsubstate a $ hg sum | grep commit commit: 1 removed, 1 subrepos (new branch head) $ hg update -qC nosubstate $ ls s g issue3109: false positives in git diff-index $ hg update -q $ touch -t 200001010000 s/g $ hg status --subrepos $ touch -t 200001010000 s/g $ hg sum | grep commit commit: (clean) Check hg update --clean $ cd $TESTTMP/ta $ echo > s/g $ cd s $ echo c1 > f1 $ echo c1 > f2 $ git add f1 $ cd .. $ hg status -S M s/g A s/f1 ? s/f2 $ ls s f f1 f2 g $ hg update --clean 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg status -S ? s/f1 ? s/f2 $ ls s f f1 f2 g Sticky subrepositories, no changes $ cd $TESTTMP/ta $ hg id -n 7 $ cd s $ git rev-parse HEAD 32a343883b74769118bb1d3b4b1fbf9156f4dddc $ cd .. $ hg update 1 > /dev/null 2>&1 $ hg id -n 1 $ cd s $ git rev-parse HEAD da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 $ cd .. Sticky subrepositories, file changes $ touch s/f1 $ cd s $ git add f1 $ cd .. $ hg id -n 1+ $ cd s $ git rev-parse HEAD da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 $ cd .. $ hg update 4 subrepository s diverged (local revision: da5f5b1, remote revision: aa84837) (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m subrepository sources for s differ use (l)ocal source (da5f5b1) or (r)emote source (aa84837)? l 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id -n 4+ $ cd s $ git rev-parse HEAD da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 $ cd .. $ hg update --clean tip > /dev/null 2>&1 Sticky subrepository, revision updates $ hg id -n 7 $ cd s $ git rev-parse HEAD 32a343883b74769118bb1d3b4b1fbf9156f4dddc $ cd .. $ cd s $ git checkout aa84837ccfbdfedcdcdeeedc309d73e6eb069edc Previous HEAD position was 32a3438* fff (glob) HEAD is now at aa84837* f (glob) $ cd .. $ hg update 1 subrepository s diverged (local revision: 32a3438, remote revision: da5f5b1) (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m subrepository sources for s differ (in checked out version) use (l)ocal source (32a3438) or (r)emote source (da5f5b1)? l 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id -n 1+ $ cd s $ git rev-parse HEAD aa84837ccfbdfedcdcdeeedc309d73e6eb069edc $ cd .. Sticky subrepository, file changes and revision updates $ touch s/f1 $ cd s $ git add f1 $ git rev-parse HEAD aa84837ccfbdfedcdcdeeedc309d73e6eb069edc $ cd .. $ hg id -n 1+ $ hg update 7 subrepository s diverged (local revision: 32a3438, remote revision: 32a3438) (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m subrepository sources for s differ use (l)ocal source (32a3438) or (r)emote source (32a3438)? l 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id -n 7+ $ cd s $ git rev-parse HEAD aa84837ccfbdfedcdcdeeedc309d73e6eb069edc $ cd .. Sticky repository, update --clean $ hg update --clean tip 2>/dev/null 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id -n 7 $ cd s $ git rev-parse HEAD 32a343883b74769118bb1d3b4b1fbf9156f4dddc $ cd .. Test subrepo already at intended revision: $ cd s $ git checkout 32a343883b74769118bb1d3b4b1fbf9156f4dddc HEAD is now at 32a3438* fff (glob) $ cd .. $ hg update 1 Previous HEAD position was 32a3438* fff (glob) HEAD is now at da5f5b1* g (glob) 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id -n 1 $ cd s $ git rev-parse HEAD da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 $ cd .. Test forgetting files, not implemented in git subrepo, used to traceback #if no-windows $ hg forget 'notafile*' notafile*: $ENOENT$ [1] #else error: The filename, directory name, or volume label syntax is incorrect $ hg forget 'notafile' notafile: * (glob) [1] #endif $ cd .. Test sanitizing ".hg/hgrc" in subrepo $ cd t $ hg tip -q 7:af6d2edbb0d3 $ hg update -q -C af6d2edbb0d3 $ cd s $ git checkout -q -b sanitize-test $ mkdir .hg $ echo '.hg/hgrc in git repo' > .hg/hgrc $ mkdir -p sub/.hg $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc $ git add .hg sub $ git commit -qm 'add .hg/hgrc to be sanitized at hg update' $ git push -q origin sanitize-test $ cd .. $ grep ' s$' .hgsubstate 32a343883b74769118bb1d3b4b1fbf9156f4dddc s $ hg commit -qm 'commit with git revision including .hg/hgrc' $ hg parents -q 8:3473d20bddcf $ grep ' s$' .hgsubstate c4069473b459cf27fd4d7c2f50c4346b4e936599 s $ cd .. $ hg -R tc pull -q $ hg -R tc update -q -C 3473d20bddcf 2>&1 | sort warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' $ cd tc $ hg parents -q 8:3473d20bddcf $ grep ' s$' .hgsubstate c4069473b459cf27fd4d7c2f50c4346b4e936599 s $ test -f s/.hg/hgrc [1] $ test -f s/sub/.hg/hgrc [1] $ cd .. additional test for "git merge --ff" route: $ cd t $ hg tip -q 8:3473d20bddcf $ hg update -q -C af6d2edbb0d3 $ cd s $ git checkout -q testing $ mkdir .hg $ echo '.hg/hgrc in git repo' > .hg/hgrc $ mkdir -p sub/.hg $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc $ git add .hg sub $ git commit -qm 'add .hg/hgrc to be sanitized at hg update (git merge --ff)' $ git push -q origin testing $ cd .. $ grep ' s$' .hgsubstate 32a343883b74769118bb1d3b4b1fbf9156f4dddc s $ hg commit -qm 'commit with git revision including .hg/hgrc' $ hg parents -q 9:ed23f7fe024e $ grep ' s$' .hgsubstate f262643c1077219fbd3858d54e78ef050ef84fbf s $ cd .. $ cd tc $ hg update -q -C af6d2edbb0d3 $ test -f s/.hg/hgrc [1] $ test -f s/sub/.hg/hgrc [1] $ cd .. $ hg -R tc pull -q $ hg -R tc update -q -C ed23f7fe024e 2>&1 | sort warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' $ cd tc $ hg parents -q 9:ed23f7fe024e $ grep ' s$' .hgsubstate f262643c1077219fbd3858d54e78ef050ef84fbf s $ test -f s/.hg/hgrc [1] $ test -f s/sub/.hg/hgrc [1] Test that sanitizing is omitted in meta data area: $ mkdir s/.git/.hg $ echo '.hg/hgrc in git metadata area' > s/.git/.hg/hgrc $ hg update -q -C af6d2edbb0d3 checking out detached HEAD in subrepository "s" check out a git branch if you intend to make changes check differences made by most recent change $ cd s $ cat > foobar << EOF > woopwoop > > foo > bar > EOF $ git add foobar $ cd .. $ hg diff --subrepos diff --git a/s/foobar b/s/foobar new file mode 100644 index 0000000..8a5a5e2 --- /dev/null +++ b/s/foobar @@ -0,0 +1,4 @@ +woopwoop + +foo +bar $ hg commit --subrepos -m "Added foobar" committing subrepository s created new head $ hg diff -c . --subrepos --nodates diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,1 +1,1 @@ -32a343883b74769118bb1d3b4b1fbf9156f4dddc s +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s diff --git a/s/foobar b/s/foobar new file mode 100644 index 0000000..8a5a5e2 --- /dev/null +++ b/s/foobar @@ -0,0 +1,4 @@ +woopwoop + +foo +bar check output when only diffing the subrepository $ hg diff -c . --subrepos s diff --git a/s/foobar b/s/foobar new file mode 100644 index 0000000..8a5a5e2 --- /dev/null +++ b/s/foobar @@ -0,0 +1,4 @@ +woopwoop + +foo +bar check output when diffing something else $ hg diff -c . --subrepos .hgsubstate --nodates diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,1 +1,1 @@ -32a343883b74769118bb1d3b4b1fbf9156f4dddc s +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s add new changes, including whitespace $ cd s $ cat > foobar << EOF > woop woop > > foo > bar > EOF $ echo foo > barfoo $ git add barfoo $ cd .. $ hg diff --subrepos --ignore-all-space diff --git a/s/barfoo b/s/barfoo new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/s/barfoo @@ -0,0 +1* @@ (glob) +foo $ hg diff --subrepos s/foobar diff --git a/s/foobar b/s/foobar index 8a5a5e2..bd5812a 100644 --- a/s/foobar +++ b/s/foobar @@ -1,4 +1,4 @@ -woopwoop +woop woop foo bar execute a diffstat the output contains a regex, because git 1.7.10 and 1.7.11 change the amount of whitespace $ hg diff --subrepos --stat \s*barfoo \|\s+1 \+ (re) \s*foobar \|\s+2 \+- (re) 2 files changed, 2 insertions\(\+\), 1 deletions?\(-\) (re) adding an include should ignore the other elements $ hg diff --subrepos -I s/foobar diff --git a/s/foobar b/s/foobar index 8a5a5e2..bd5812a 100644 --- a/s/foobar +++ b/s/foobar @@ -1,4 +1,4 @@ -woopwoop +woop woop foo bar adding an exclude should ignore this element $ hg diff --subrepos -X s/foobar diff --git a/s/barfoo b/s/barfoo new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/s/barfoo @@ -0,0 +1* @@ (glob) +foo moving a file should show a removal and an add $ hg revert --all reverting subrepo ../gitroot $ cd s $ git mv foobar woop $ cd .. $ hg diff --subrepos diff --git a/s/foobar b/s/foobar deleted file mode 100644 index 8a5a5e2..0000000 --- a/s/foobar +++ /dev/null @@ -1,4 +0,0 @@ -woopwoop - -foo -bar diff --git a/s/woop b/s/woop new file mode 100644 index 0000000..8a5a5e2 --- /dev/null +++ b/s/woop @@ -0,0 +1,4 @@ +woopwoop + +foo +bar $ rm s/woop revert the subrepository $ hg revert --all reverting subrepo ../gitroot $ hg status --subrepos ? s/barfoo ? s/foobar.orig $ mv s/foobar.orig s/foobar $ hg revert --no-backup s reverting subrepo ../gitroot $ hg status --subrepos ? s/barfoo revert moves orig files to the right place $ echo 'bloop' > s/foobar $ hg revert --all --verbose --config 'ui.origbackuppath=.hg/origbackups' reverting subrepo ../gitroot creating directory: $TESTTMP/tc/.hg/origbackups saving current version of foobar as $TESTTMP/tc/.hg/origbackups/foobar $ ls .hg/origbackups foobar $ rm -rf .hg/origbackups show file at specific revision $ cat > s/foobar << EOF > woop woop > fooo bar > EOF $ hg commit --subrepos -m "updated foobar" committing subrepository s $ cat > s/foobar << EOF > current foobar > (should not be visible using hg cat) > EOF $ hg cat -r . s/foobar woop woop fooo bar (no-eol) $ hg cat -r "parents(.)" s/foobar > catparents $ mkdir -p tmp/s $ hg cat -r "parents(.)" --output tmp/%% s/foobar $ diff tmp/% catparents $ hg cat -r "parents(.)" --output tmp/%s s/foobar $ diff tmp/foobar catparents $ hg cat -r "parents(.)" --output tmp/%d/otherfoobar s/foobar $ diff tmp/s/otherfoobar catparents $ hg cat -r "parents(.)" --output tmp/%p s/foobar $ diff tmp/s/foobar catparents $ hg cat -r "parents(.)" --output tmp/%H s/foobar $ diff tmp/255ee8cf690ec86e99b1e80147ea93ece117cd9d catparents $ hg cat -r "parents(.)" --output tmp/%R s/foobar $ diff tmp/10 catparents $ hg cat -r "parents(.)" --output tmp/%h s/foobar $ diff tmp/255ee8cf690e catparents $ rm tmp/10 $ hg cat -r "parents(.)" --output tmp/%r s/foobar $ diff tmp/10 catparents $ mkdir tmp/tc $ hg cat -r "parents(.)" --output tmp/%b/foobar s/foobar $ diff tmp/tc/foobar catparents cleanup $ rm -r tmp $ rm catparents add git files, using either files or patterns $ echo "hsss! hsssssssh!" > s/snake.python $ echo "ccc" > s/c.c $ echo "cpp" > s/cpp.cpp $ hg add s/snake.python s/c.c s/cpp.cpp $ hg st --subrepos s M s/foobar A s/c.c A s/cpp.cpp A s/snake.python ? s/barfoo $ hg revert s reverting subrepo ../gitroot $ hg add --subrepos "glob:**.python" adding s/snake.python $ hg st --subrepos s A s/snake.python ? s/barfoo ? s/c.c ? s/cpp.cpp ? s/foobar.orig $ hg revert s reverting subrepo ../gitroot $ hg add --subrepos s adding s/barfoo adding s/c.c adding s/cpp.cpp adding s/foobar.orig adding s/snake.python $ hg st --subrepos s A s/barfoo A s/c.c A s/cpp.cpp A s/foobar.orig A s/snake.python $ hg revert s reverting subrepo ../gitroot make sure everything is reverted correctly $ hg st --subrepos s ? s/barfoo ? s/c.c ? s/cpp.cpp ? s/foobar.orig ? s/snake.python $ hg add --subrepos --exclude "path:s/c.c" adding s/barfoo adding s/cpp.cpp adding s/foobar.orig adding s/snake.python $ hg st --subrepos s A s/barfoo A s/cpp.cpp A s/foobar.orig A s/snake.python ? s/c.c $ hg revert --all -q .hgignore should not have influence in subrepos $ cat > .hgignore << EOF > syntax: glob > *.python > EOF $ hg add .hgignore $ hg add --subrepos "glob:**.python" s/barfoo adding s/snake.python $ hg st --subrepos s A s/barfoo A s/snake.python ? s/c.c ? s/cpp.cpp ? s/foobar.orig $ hg revert --all -q .gitignore should have influence, except for explicitly added files (no patterns) $ cat > s/.gitignore << EOF > *.python > EOF $ hg add s/.gitignore $ hg st --subrepos s A s/.gitignore ? s/barfoo ? s/c.c ? s/cpp.cpp ? s/foobar.orig $ hg st --subrepos s --all A s/.gitignore ? s/barfoo ? s/c.c ? s/cpp.cpp ? s/foobar.orig I s/snake.python C s/f C s/foobar C s/g $ hg add --subrepos "glob:**.python" $ hg st --subrepos s A s/.gitignore ? s/barfoo ? s/c.c ? s/cpp.cpp ? s/foobar.orig $ hg add --subrepos s/snake.python $ hg st --subrepos s A s/.gitignore A s/snake.python ? s/barfoo ? s/c.c ? s/cpp.cpp ? s/foobar.orig correctly do a dry run $ hg add --subrepos s --dry-run adding s/barfoo adding s/c.c adding s/cpp.cpp adding s/foobar.orig $ hg st --subrepos s A s/.gitignore A s/snake.python ? s/barfoo ? s/c.c ? s/cpp.cpp ? s/foobar.orig error given when adding an already tracked file $ hg add s/.gitignore s/.gitignore already tracked! [1] $ hg add s/g s/g already tracked! [1] removed files can be re-added removing files using 'rm' or 'git rm' has the same effect, since we ignore the staging area $ hg ci --subrepos -m 'snake' committing subrepository s $ cd s $ rm snake.python (remove leftover .hg so Mercurial doesn't look for a root here) $ rm -rf .hg $ hg status --subrepos --all . R snake.python ? barfoo ? c.c ? cpp.cpp ? foobar.orig C .gitignore C f C foobar C g $ git rm snake.python rm 'snake.python' $ hg status --subrepos --all . R snake.python ? barfoo ? c.c ? cpp.cpp ? foobar.orig C .gitignore C f C foobar C g $ touch snake.python $ cd .. $ hg add s/snake.python $ hg status -S M s/snake.python ? .hgignore ? s/barfoo ? s/c.c ? s/cpp.cpp ? s/foobar.orig $ hg revert --all -q make sure we show changed files, rather than changed subtrees $ mkdir s/foo $ touch s/foo/bwuh $ hg add s/foo/bwuh $ hg commit -S -m "add bwuh" committing subrepository s $ hg status -S --change . M .hgsubstate A s/foo/bwuh ? s/barfoo ? s/c.c ? s/cpp.cpp ? s/foobar.orig ? s/snake.python.orig #if git19 test for Git CVE-2016-3068 $ hg init malicious-subrepository $ cd malicious-subrepository $ echo "s = [git]ext::sh -c echo% pwned:% \$PWNED_MSG% >pwned.txt" > .hgsub $ git init s Initialized empty Git repository in $TESTTMP/tc/malicious-subrepository/s/.git/ $ cd s $ git commit --allow-empty -m 'empty' [master (root-commit) 153f934] empty $ cd .. $ hg add .hgsub $ hg commit -m "add subrepo" $ cd .. $ rm -f pwned.txt $ unset GIT_ALLOW_PROTOCOL $ PWNED_MSG="your git is too old or mercurial has regressed" hg clone \ > malicious-subrepository malicious-subrepository-protected Cloning into '$TESTTMP/tc/malicious-subrepository-protected/s'... fatal: transport 'ext' not allowed updating to branch default cloning subrepo s from ext::sh -c echo% pwned:% $PWNED_MSG% >pwned.txt abort: git clone error 128 in s (in subrepository "s") [255] $ f -Dq pwned.txt pwned.txt: file not found whitelisting of ext should be respected (that's the git submodule behaviour) $ rm -f pwned.txt $ env GIT_ALLOW_PROTOCOL=ext PWNED_MSG="you asked for it" hg clone \ > malicious-subrepository malicious-subrepository-clone-allowed Cloning into '$TESTTMP/tc/malicious-subrepository-clone-allowed/s'... fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. updating to branch default cloning subrepo s from ext::sh -c echo% pwned:% $PWNED_MSG% >pwned.txt abort: git clone error 128 in s (in subrepository "s") [255] $ f -Dq pwned.txt pwned: you asked for it #endif test for ssh exploit with git subrepos 2017-07-25 $ hg init malicious-proxycommand $ cd malicious-proxycommand $ echo 's = [git]ssh://-oProxyCommand=rm${IFS}non-existent/path' > .hgsub $ git init s Initialized empty Git repository in $TESTTMP/tc/malicious-proxycommand/s/.git/ $ cd s $ git commit --allow-empty -m 'empty' [master (root-commit) 153f934] empty $ cd .. $ hg add .hgsub $ hg ci -m 'add subrepo' $ cd .. $ hg clone malicious-proxycommand malicious-proxycommand-clone updating to branch default abort: potentially unsafe url: 'ssh://-oProxyCommand=rm${IFS}non-existent/path' (in subrepository "s") [255] also check that a percent encoded '-' (%2D) doesn't work $ cd malicious-proxycommand $ echo 's = [git]ssh://%2DoProxyCommand=rm${IFS}non-existent/path' > .hgsub $ hg ci -m 'change url to percent encoded' $ cd .. $ rm -r malicious-proxycommand-clone $ hg clone malicious-proxycommand malicious-proxycommand-clone updating to branch default abort: potentially unsafe url: 'ssh://-oProxyCommand=rm${IFS}non-existent/path' (in subrepository "s") [255] mercurial-4.5.3/tests/missing-comment.hg0000644015407300116100000000206513261161234020173 0ustar augieeng00000000000000HG10BZh91AY&SY¨ï!ÿÿü–ÇcßÿýÓ—Øÿïÿôìyï2 Cè3M>c‰ç¶ßÐ^Sƒk )&€õ2¡  SFšz™Ð 2€mi¦ši¦ÉÈ0š040&ŒŒ ɦ#CÄÓ&˜Œ#hфШ&È™L1¨ 4h 2hi¦ši¦ÉÈ0š040&ŒŒ ɦ#CÄÓ&˜Œ#hфР)5<†šÒS=M2ÐhÐi¦FŒ†#@hѧ©ê4=@ôLšiêÔÓØöúõŒ+[ô†ªÁÝüWv,f ”X žBÿ[Â÷|E„àÆ¸Õˆ=`˜0J; ¢r!’ß²Îâ¢ÎÎÉñŠ÷ÖÄ‚FÁ°«¡)0–’—ýÁ·æ:, Ì5ÁÁL™`ņ3Â:!¨4!`Ÿ6Âý‰e°Ñ~AÁÀÅF8xM'š%8È BxéŠBµ"JíT‰¸Ã°C‰è´Ïë’µ=ØSÐv•êÒ…#|Vë0~Ü^®ßŒR¡d|Ú´„"Ji’å£ ©ÚÜ 4Éb¤d—+¤‡BÈ+nì Á3 .”âÖvÄGX<È'™oŽ-XÖšL¶Y 6’_93,º$q-Ò+Rˆâi°%«Y›@dϽŠ 1LeNv­QÒM)[BlÄJ3¯ºeT@K i¶2y‹rOmм ä 9…”*+4RAy ²$lb°­íÀd=âkà^ÿ >z5$0ɹE‰‚^ÿœ‰rv«ùØÅÙïOC5‘˜A9f [ dãØ¹Gx\OA{»fÏ&MNÕ0Xê$ÌS%H ¿´‰c°WÍp¢€ê. Äa9À8$Ém–½I#¬Äâ…°[9ñÙQ]¼­ Y‚AŒ SUˆ"vWãÄ™ï 2ÚañY‘wL˜ À0Á•HV|†µ>’æý• а;­7Q"I 82I)ÃlðjÈ`m ¡^&ÊÀ’š BO‚bS$`¥óX¨­ר†4 M¦›ÔÓä8±¥R!êb‰ù##̆}é>z3Ê„ÅíS\D…H«7*r#ÄOœcJ¾¦96ŠÖÑ¢XØÑ)Ë`ˆiÑàí"ŒŸ¡Ð)PÚž‰f8Y §úž³]™D0‚©º#£ðŒ£tŒ RÙª]¡”U™FI–uÇåº0ÌÓ¤c´:ZìÈþe!êφá±pˆ(·åŸ Î3 ¢W#ò}ËÛQ ~·5¢ pöYCô$n‚ÇYb (oÌ}á rÉ .Qlˆƒ¯ñw$S… !JŽðmercurial-4.5.3/tests/test-branch-change.t0000644015407300116100000001677113261161234020375 0ustar augieeng00000000000000Testing changing branch on commits ================================== Setup $ cat >> $HGRCPATH << EOF > [alias] > glog = log -G -T "{rev}:{node|short} {desc}\n{branch} ({bookmarks})" > [experimental] > evolution = createmarkers > [extensions] > rebase= > EOF $ hg init repo $ cd repo $ for ch in a b c d e; do echo foo >> $ch; hg ci -Aqm "Added "$ch; done $ hg glog @ 4:aa98ab95a928 Added e | default () o 3:62615734edd5 Added d | default () o 2:28ad74487de9 Added c | default () o 1:29becc82797a Added b | default () o 0:18d04c59bb5d Added a default () $ hg branches default 4:aa98ab95a928 Try without passing a new branch name $ hg branch -r . abort: no branch name specified for the revisions [255] Setting an invalid branch name $ hg branch -r . a:b abort: ':' cannot be used in a name [255] $ hg branch -r . tip abort: the name 'tip' is reserved [255] $ hg branch -r . 1234 abort: cannot use an integer as a name [255] Change on non-linear set of commits $ hg branch -r 2 -r 4 foo abort: cannot change branch of non-linear revisions [255] Change in middle of the stack (linear commits) $ hg branch -r 1::3 foo abort: cannot change branch of changeset with children [255] Change with dirty working directory $ echo bar > a $ hg branch -r . foo abort: uncommitted changes [255] $ hg revert --all reverting a Change on empty revision set $ hg branch -r 'draft() - all()' foo abort: empty revision set [255] Changing branch on linear set of commits from head Without obsmarkers $ hg branch -r 3:4 foo --config experimental.evolution=! changed branch on 2 changesets saved backup bundle to $TESTTMP/repo/.hg/strip-backup/62615734edd5-e86bd13a-branch-change.hg $ hg glog @ 4:3938acfb5c0f Added e | foo () o 3:9435da006bdc Added d | foo () o 2:28ad74487de9 Added c | default () o 1:29becc82797a Added b | default () o 0:18d04c59bb5d Added a default () $ hg branches foo 4:3938acfb5c0f default 2:28ad74487de9 (inactive) With obsmarkers $ hg branch -r 3::4 bar changed branch on 2 changesets $ hg glog @ 6:7c1991464886 Added e | bar () o 5:1ea05e93925f Added d | bar () o 2:28ad74487de9 Added c | default () o 1:29becc82797a Added b | default () o 0:18d04c59bb5d Added a default () $ hg branches bar 6:7c1991464886 default 2:28ad74487de9 (inactive) Change branch name to an existing branch $ hg branch -r . default abort: a branch of the same name already exists [255] Changing on a branch head which is not topological head $ hg branch -r 2 stable abort: cannot change branch of changeset with children [255] Enabling the allowunstable config and trying to change branch on a branch head which is not a topological head $ echo "[experimental]" >> .hg/hgrc $ echo "evolution.allowunstable=yes" >> .hg/hgrc $ hg branch -r 2 foo changed branch on 1 changesets 2 new orphan changesets Changing branch of an obsoleted changeset $ hg branch -r 4 foobar abort: hidden revision '4' was rewritten as: 7c1991464886! (use --hidden to access hidden revisions) [255] $ hg branch -r 4 --hidden foobar abort: cannot change branch of a obsolete changeset [255] Make sure bookmark movement is correct $ hg bookmark b1 $ hg glog -r '.^::' @ 6:7c1991464886 Added e | bar (b1) * 5:1ea05e93925f Added d | bar () ~ $ hg branch -r '(.^)::' wat --debug changing branch of '1ea05e93925f806d875a2163f9b76764be644636' from 'bar' to 'wat' committing files: d committing manifest committing changelog new node id is 343660ccab7400da637bd6a211d07f413536d718 changing branch of '7c19914648869f5b02fc7fed31ddee9783fdd680' from 'bar' to 'wat' committing files: e committing manifest committing changelog new node id is de1404b45a69f8cc6437d7679033ee33e9efb4ba moving bookmarks ['b1'] from 7c19914648869f5b02fc7fed31ddee9783fdd680 to de1404b45a69f8cc6437d7679033ee33e9efb4ba resolving manifests branchmerge: False, force: False, partial: False ancestor: 7c1991464886, local: 7c1991464886+, remote: de1404b45a69 starting 4 threads for background file closing (?) changed branch on 2 changesets updating the branch cache invalid branchheads cache (served): tip differs $ hg glog -r '(.^)::' @ 9:de1404b45a69 Added e | wat (b1) * 8:343660ccab74 Added d | wat () ~ Make sure phase handling is correct $ echo foo >> bar $ hg ci -Aqm "added bar" --secret 1 new orphan changesets $ hg glog -r . @ 10:8ad1294c1660 added bar | wat (b1) ~ $ hg branch -r . secret changed branch on 1 changesets $ hg phase -r . 11: secret $ hg branches secret 11:38a9b2d53f98 foo 7:8a4729a5e2b8 wat 9:de1404b45a69 (inactive) default 2:28ad74487de9 (inactive) $ hg branch secret Changing branch of another head, different from one on which we are $ hg glog @ 11:38a9b2d53f98 added bar | secret (b1) * 9:de1404b45a69 Added e | wat () * 8:343660ccab74 Added d | wat () | o 7:8a4729a5e2b8 Added c | | foo () x | 2:28ad74487de9 Added c |/ default () o 1:29becc82797a Added b | default () o 0:18d04c59bb5d Added a default () $ hg branch secret $ hg branch -r 7 foobar changed branch on 1 changesets The current branch must be preserved $ hg branch secret Changing branch on multiple heads at once $ hg rebase -s 8 -d 12 --keepbranches -q $ hg rebase -s 14 -d 1 --keepbranches -q $ hg branch -r 0: stable changed branch on 6 changesets $ hg glog @ 23:6a5ddbcfb870 added bar | stable (b1) o 22:baedc6e98a67 Added e | stable () | o 21:99ac7bf8aad1 Added d | | stable () | o 20:0ecb4d39c4bd Added c |/ stable () o 19:fd45b986b109 Added b | stable () o 18:204d2769eca2 Added a stable () $ hg branches stable 23:6a5ddbcfb870 $ hg branch stable Changing to same branch is no-op $ hg branch -r 19::21 stable changed branch on 0 changesets Changing branch name to existing branch name if the branch of parent of root of revs is same as the new branch name $ hg branch -r 20::21 bugfix changed branch on 2 changesets $ hg glog o 25:714defe1cf34 Added d | bugfix () o 24:98394def28fc Added c | bugfix () | @ 23:6a5ddbcfb870 added bar | | stable (b1) | o 22:baedc6e98a67 Added e |/ stable () o 19:fd45b986b109 Added b | stable () o 18:204d2769eca2 Added a stable () $ hg branch -r 24:25 stable changed branch on 2 changesets $ hg glog o 27:4ec342341562 Added d | stable () o 26:83f48859c2de Added c | stable () | @ 23:6a5ddbcfb870 added bar | | stable (b1) | o 22:baedc6e98a67 Added e |/ stable () o 19:fd45b986b109 Added b | stable () o 18:204d2769eca2 Added a stable () Testing on merge $ hg merge -r 26 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg branch -r . abcd abort: outstanding uncommitted merge [255] $ hg ci -m "Merge commit" $ hg branch -r '(.^)::' def abort: cannot change branch of a merge commit [255] Changing branch on public changeset $ hg phase -r 27 -p $ hg branch -r 27 def abort: cannot change branch of public changesets (see 'hg help phases' for details) [255] mercurial-4.5.3/tests/test-convert-svn-encoding.t0000644015407300116100000001336313261161234021757 0ustar augieeng00000000000000#require svn svn-bindings $ cat >> $HGRCPATH < [extensions] > convert = > EOF $ svnadmin create svn-repo $ svnadmin load -q svn-repo < "$TESTDIR/svn/encoding.svndump" Convert while testing all possible outputs $ hg --debug convert svn-repo A-hg --config progress.debug=1 initializing destination A-hg repository reparent to file:/*/$TESTTMP/svn-repo (glob) run hg sink pre-conversion action scanning source... found trunk at 'trunk' found tags at 'tags' found branches at 'branches' found branch branch\xc3\xa9 at 5 (esc) found branch branch\xc3\xa9e at 6 (esc) scanning: 1/4 revisions (25.00%) reparent to file:/*/$TESTTMP/svn-repo/trunk (glob) fetching revision log for "/trunk" from 4 to 0 parsing revision 4 (2 changes) parsing revision 3 (4 changes) parsing revision 2 (3 changes) parsing revision 1 (3 changes) no copyfrom path, don't know what to do. '/branches' is not under '/trunk', ignoring '/tags' is not under '/trunk', ignoring scanning: 2/4 revisions (50.00%) reparent to file:/*/$TESTTMP/svn-repo/branches/branch%C3%A9 (glob) fetching revision log for "/branches/branch\xc3\xa9" from 5 to 0 (esc) parsing revision 5 (1 changes) reparent to file:/*/$TESTTMP/svn-repo (glob) reparent to file:/*/$TESTTMP/svn-repo/branches/branch%C3%A9 (glob) found parent of branch /branches/branch\xc3\xa9 at 4: /trunk (esc) scanning: 3/4 revisions (75.00%) reparent to file:/*/$TESTTMP/svn-repo/branches/branch%C3%A9e (glob) fetching revision log for "/branches/branch\xc3\xa9e" from 6 to 0 (esc) parsing revision 6 (1 changes) reparent to file:/*/$TESTTMP/svn-repo (glob) reparent to file:/*/$TESTTMP/svn-repo/branches/branch%C3%A9e (glob) found parent of branch /branches/branch\xc3\xa9e at 5: /branches/branch\xc3\xa9 (esc) scanning: 4/4 revisions (100.00%) scanning: 5/4 revisions (125.00%) scanning: 6/4 revisions (150.00%) sorting... converting... 5 init projA source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@1 converting: 0/6 revisions (0.00%) committing changelog updating the branch cache 4 hello source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@2 converting: 1/6 revisions (16.67%) reparent to file:/*/$TESTTMP/svn-repo/trunk (glob) scanning paths: /trunk/\xc3\xa0 0/3 paths (0.00%) (esc) scanning paths: /trunk/\xc3\xa0/e\xcc\x81 1/3 paths (33.33%) (esc) scanning paths: /trunk/\xc3\xa9 2/3 paths (66.67%) (esc) committing files: \xc3\xa0/e\xcc\x81 (esc) getting files: \xc3\xa0/e\xcc\x81 1/2 files (50.00%) (esc) \xc3\xa9 (esc) getting files: \xc3\xa9 2/2 files (100.00%) (esc) committing manifest committing changelog updating the branch cache 3 copy files source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@3 converting: 2/6 revisions (33.33%) scanning paths: /trunk/\xc3\xa0 0/4 paths (0.00%) (esc) gone from -1 reparent to file:/*/$TESTTMP/svn-repo (glob) reparent to file:/*/$TESTTMP/svn-repo/trunk (glob) scanning paths: /trunk/\xc3\xa8 1/4 paths (25.00%) (esc) copied to \xc3\xa8 from \xc3\xa9@2 (esc) scanning paths: /trunk/\xc3\xa9 2/4 paths (50.00%) (esc) gone from -1 reparent to file:/*/$TESTTMP/svn-repo (glob) reparent to file:/*/$TESTTMP/svn-repo/trunk (glob) scanning paths: /trunk/\xc3\xb9 3/4 paths (75.00%) (esc) mark /trunk/\xc3\xb9 came from \xc3\xa0:2 (esc) getting files: \xc3\xa0/e\xcc\x81 1/4 files (25.00%) (esc) getting files: \xc3\xa9 2/4 files (50.00%) (esc) committing files: \xc3\xa8 (esc) getting files: \xc3\xa8 3/4 files (75.00%) (esc) \xc3\xa8: copy \xc3\xa9:6b67ccefd5ce6de77e7ead4f5292843a0255329f (esc) \xc3\xb9/e\xcc\x81 (esc) getting files: \xc3\xb9/e\xcc\x81 4/4 files (100.00%) (esc) \xc3\xb9/e\xcc\x81: copy \xc3\xa0/e\xcc\x81:a9092a3d84a37b9993b5c73576f6de29b7ea50f6 (esc) committing manifest committing changelog updating the branch cache 2 remove files source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@4 converting: 3/6 revisions (50.00%) scanning paths: /trunk/\xc3\xa8 0/2 paths (0.00%) (esc) gone from -1 reparent to file:/*/$TESTTMP/svn-repo (glob) reparent to file:/*/$TESTTMP/svn-repo/trunk (glob) scanning paths: /trunk/\xc3\xb9 1/2 paths (50.00%) (esc) gone from -1 reparent to file:/*/$TESTTMP/svn-repo (glob) reparent to file:/*/$TESTTMP/svn-repo/trunk (glob) getting files: \xc3\xa8 1/2 files (50.00%) (esc) getting files: \xc3\xb9/e\xcc\x81 2/2 files (100.00%) (esc) committing files: committing manifest committing changelog updating the branch cache 1 branch to branch? source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/branches/branch?@5 converting: 4/6 revisions (66.67%) reparent to file:/*/$TESTTMP/svn-repo/branches/branch%C3%A9 (glob) scanning paths: /branches/branch\xc3\xa9 0/1 paths (0.00%) (esc) committing changelog updating the branch cache 0 branch to branch?e source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/branches/branch?e@6 converting: 5/6 revisions (83.33%) reparent to file:/*/$TESTTMP/svn-repo/branches/branch%C3%A9e (glob) scanning paths: /branches/branch\xc3\xa9e 0/1 paths (0.00%) (esc) committing changelog updating the branch cache reparent to file:/*/$TESTTMP/svn-repo (glob) reparent to file:/*/$TESTTMP/svn-repo/branches/branch%C3%A9e (glob) reparent to file:/*/$TESTTMP/svn-repo (glob) reparent to file:/*/$TESTTMP/svn-repo/branches/branch%C3%A9e (glob) updating tags committing files: .hgtags committing manifest committing changelog updating the branch cache run hg sink post-conversion action $ cd A-hg $ hg up 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Check tags are in UTF-8 $ cat .hgtags e94e4422020e715add80525e8f0f46c9968689f1 branch\xc3\xa9e (esc) f7e66f98380ed1e53a797c5c7a7a2616a7ab377d branch\xc3\xa9 (esc) $ cd .. mercurial-4.5.3/tests/test-mq-qrename.t0000644015407300116100000000350613261161234017750 0ustar augieeng00000000000000 $ echo "[extensions]" >> $HGRCPATH $ echo "mq=" >> $HGRCPATH $ hg init a $ cd a $ echo 'base' > base $ hg ci -Ambase adding base $ hg qnew -mmqbase mqbase $ hg qrename mqbase renamed $ mkdir .hg/patches/foo $ hg qrename renamed foo $ hg qseries foo/renamed $ ls .hg/patches/foo renamed $ mkdir .hg/patches/bar $ hg qrename foo/renamed bar $ hg qseries bar/renamed $ ls .hg/patches/bar renamed $ hg qrename bar/renamed baz $ hg qseries baz $ ls .hg/patches/baz .hg/patches/baz $ hg qrename baz new/dir $ hg qseries new/dir $ ls .hg/patches/new/dir .hg/patches/new/dir $ cd .. Test patch being renamed before committed: $ hg init b $ cd b $ hg qinit -c $ hg qnew x $ hg qrename y $ hg qcommit -m rename $ cd .. Test overlapping renames (issue2388) $ hg init c $ cd c $ hg qinit -c $ echo a > a $ hg add adding a $ hg qnew patcha $ echo b > b $ hg add adding b $ hg qnew patchb $ hg ci --mq -m c1 $ hg qrename patchb patchc $ hg qrename patcha patchb $ hg st --mq M patchb M series A patchc R patcha $ cd .. Test renames with mq repo (issue2097) $ hg init issue2097 $ cd issue2097 $ hg qnew p0 $ (cd .hg/patches && hg init) $ hg qren p0 p1 $ hg debugstate --mq $ hg ci --mq -mq0 nothing changed [1] $ cd .. Test renaming to a folded patch (issue3058) $ hg init issue3058 $ cd issue3058 $ hg init --mq $ echo a > a $ hg add a $ hg qnew adda $ echo b >> a $ hg qnew addb $ hg qpop popping addb now at: adda $ hg ci --mq -m "save mq" $ hg qfold addb $ hg qmv addb $ cat .hg/patches/addb # HG changeset patch # Parent 0000000000000000000000000000000000000000 diff -r 000000000000 a --- /dev/null * (glob) +++ b/a * (glob) @@ -0,0 +1,2 @@ +a +b $ cd .. mercurial-4.5.3/tests/test-http.t0000644015407300116100000005404313261161234016666 0ustar augieeng00000000000000#require killdaemons serve $ hg init test $ cd test $ echo foo>foo $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg $ echo foo>foo.d/foo $ echo bar>foo.d/bAr.hg.d/BaR $ echo bar>foo.d/baR.d.hg/bAR $ hg commit -A -m 1 adding foo adding foo.d/bAr.hg.d/BaR adding foo.d/baR.d.hg/bAR adding foo.d/foo $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid Test server address cannot be reused $ hg serve -p $HGPORT1 2>&1 abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$ [255] $ cd .. $ cat hg1.pid hg2.pid >> $DAEMON_PIDS clone via stream $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1 streaming all changes 6 files to transfer, 606 bytes of data transferred * bytes in * seconds (*/sec) (glob) searching for changes no changes found updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg verify -R copy checking changesets checking manifests crosschecking files in changesets and manifests checking files 4 files, 1 changesets, 4 total revisions try to clone via stream, should use pull instead $ hg clone --stream http://localhost:$HGPORT1/ copy2 warning: stream clone requested but server has them disabled requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 4 changes to 4 files new changesets 8b6053c928fe updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved try to clone via stream but missing requirements, so should use pull instead $ cat > $TESTTMP/removesupportedformat.py << EOF > from mercurial import localrepo > def extsetup(ui): > localrepo.localrepository.supportedformats.remove('generaldelta') > EOF $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3 warning: stream clone requested but client is missing requirements: generaldelta (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information) requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 4 changes to 4 files new changesets 8b6053c928fe updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved clone via pull $ hg clone http://localhost:$HGPORT1/ copy-pull requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 4 changes to 4 files new changesets 8b6053c928fe updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg verify -R copy-pull checking changesets checking manifests crosschecking files in changesets and manifests checking files 4 files, 1 changesets, 4 total revisions $ cd test $ echo bar > bar $ hg commit -A -d '1 0' -m 2 adding bar $ cd .. clone over http with --update $ hg clone http://localhost:$HGPORT1/ updated --update 0 requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 5 changes to 5 files new changesets 8b6053c928fe:5fed3813f7f5 updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg log -r . -R updated changeset: 0:8b6053c928fe user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 1 $ rm -rf updated incoming via HTTP $ hg clone http://localhost:$HGPORT1/ --rev 0 partial adding changesets adding manifests adding file changes added 1 changesets with 4 changes to 4 files new changesets 8b6053c928fe updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd partial $ touch LOCAL $ hg ci -qAm LOCAL $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n' comparing with http://localhost:$HGPORT1/ searching for changes 2 $ cd .. pull $ cd copy-pull $ cat >> .hg/hgrc < [hooks] > changegroup = sh -c "printenv.py changegroup" > EOF $ hg pull pulling from http://localhost:$HGPORT1/ searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 5fed3813f7f5 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT1/ (run 'hg update' to get a working copy) $ cd .. clone from invalid URL $ hg clone http://localhost:$HGPORT/bad abort: HTTP Error 404: Not Found [255] test http authentication + use the same server to test server side streaming preference $ cd test $ cat << EOT > userpass.py > import base64 > from mercurial.hgweb import common > def perform_authentication(hgweb, req, op): > auth = req.env.get('HTTP_AUTHORIZATION') > if not auth: > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who', > [('WWW-Authenticate', 'Basic Realm="mercurial"')]) > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']: > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no') > def extsetup(): > common.permhooks.insert(0, perform_authentication) > EOT $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \ > --config server.preferuncompressed=True \ > --config web.push_ssl=False --config web.allow_push=* -A ../access.log $ cat pid >> $DAEMON_PIDS $ cat << EOF > get_pass.py > import getpass > def newgetpass(arg): > return "pass" > getpass.getpass = newgetpass > EOF $ hg id http://localhost:$HGPORT2/ abort: http authorization required for http://localhost:$HGPORT2/ [255] $ hg id http://localhost:$HGPORT2/ abort: http authorization required for http://localhost:$HGPORT2/ [255] $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/ http authorization required for http://localhost:$HGPORT2/ realm: mercurial user: user password: 5fed3813f7f5 $ hg id http://user:pass@localhost:$HGPORT2/ 5fed3813f7f5 $ echo '[auth]' >> .hg/hgrc $ echo 'l.schemes=http' >> .hg/hgrc $ echo 'l.prefix=lo' >> .hg/hgrc $ echo 'l.username=user' >> .hg/hgrc $ echo 'l.password=pass' >> .hg/hgrc $ hg id http://localhost:$HGPORT2/ 5fed3813f7f5 $ hg id http://localhost:$HGPORT2/ 5fed3813f7f5 $ hg id http://user@localhost:$HGPORT2/ 5fed3813f7f5 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 streaming all changes 7 files to transfer, 916 bytes of data transferred * bytes in * seconds (*/sec) (glob) searching for changes no changes found updating to branch default 5 files updated, 0 files merged, 0 files removed, 0 files unresolved --pull should override server's preferuncompressed $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 5 changes to 5 files new changesets 8b6053c928fe:5fed3813f7f5 updating to branch default 5 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id http://user2@localhost:$HGPORT2/ abort: http authorization required for http://localhost:$HGPORT2/ [255] $ hg id http://user:pass2@localhost:$HGPORT2/ abort: HTTP Error 403: no [255] $ hg -R dest tag -r tip top $ hg -R dest push http://user:pass@localhost:$HGPORT2/ pushing to http://user:***@localhost:$HGPORT2/ searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files $ hg rollback -q $ hg -R dest push http://user:pass@localhost:$HGPORT2/ --debug --config devel.debug.peer-request=yes pushing to http://user:***@localhost:$HGPORT2/ using http://localhost:$HGPORT2/ http auth: user user, password **** sending capabilities command devel-peer-request: GET http://localhost:$HGPORT2/?cmd=capabilities http auth: user user, password **** devel-peer-request: finished in *.???? seconds (200) (glob) query 1; heads sending batch command devel-peer-request: GET http://localhost:$HGPORT2/?cmd=batch devel-peer-request: Vary X-HgArg-1,X-HgProto-1 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ devel-peer-request: 68 bytes of commands arguments in headers devel-peer-request: finished in *.???? seconds (200) (glob) searching for changes all remote heads known locally preparing listkeys for "phases" sending listkeys command devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys devel-peer-request: Vary X-HgArg-1,X-HgProto-1 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ devel-peer-request: 16 bytes of commands arguments in headers devel-peer-request: finished in *.???? seconds (200) (glob) received listkey for "phases": 58 bytes checking for updated bookmarks preparing listkeys for "bookmarks" sending listkeys command devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys devel-peer-request: Vary X-HgArg-1,X-HgProto-1 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ devel-peer-request: 19 bytes of commands arguments in headers devel-peer-request: finished in *.???? seconds (200) (glob) received listkey for "bookmarks": 0 bytes sending branchmap command devel-peer-request: GET http://localhost:$HGPORT2/?cmd=branchmap devel-peer-request: Vary X-HgProto-1 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ devel-peer-request: finished in *.???? seconds (200) (glob) sending branchmap command devel-peer-request: GET http://localhost:$HGPORT2/?cmd=branchmap devel-peer-request: Vary X-HgProto-1 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ devel-peer-request: finished in *.???? seconds (200) (glob) preparing listkeys for "bookmarks" sending listkeys command devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys devel-peer-request: Vary X-HgArg-1,X-HgProto-1 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ devel-peer-request: 19 bytes of commands arguments in headers devel-peer-request: finished in *.???? seconds (200) (glob) received listkey for "bookmarks": 0 bytes 1 changesets found list of changesets: 7f4e523d01f2cc3765ac8934da3d14db775ff872 bundle2-output-bundle: "HG20", 5 parts total bundle2-output-part: "replycaps" 188 bytes payload bundle2-output-part: "check:phases" 24 bytes payload bundle2-output-part: "check:heads" streamed payload bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload bundle2-output-part: "phase-heads" 24 bytes payload sending unbundle command sending 996 bytes devel-peer-request: POST http://localhost:$HGPORT2/?cmd=unbundle devel-peer-request: Content-length 996 devel-peer-request: Content-type application/mercurial-0.1 devel-peer-request: Vary X-HgArg-1,X-HgProto-1 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ devel-peer-request: 16 bytes of commands arguments in headers devel-peer-request: 996 bytes of data devel-peer-request: finished in *.???? seconds (200) (glob) bundle2-input-bundle: no-transaction bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported bundle2-input-part: "output" (advisory) (params: 0 advisory) supported bundle2-input-part: total payload size 100 remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files bundle2-input-part: "output" (advisory) supported bundle2-input-bundle: 2 parts total preparing listkeys for "phases" sending listkeys command devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys devel-peer-request: Vary X-HgArg-1,X-HgProto-1 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ devel-peer-request: 16 bytes of commands arguments in headers devel-peer-request: finished in *.???? seconds (200) (glob) received listkey for "phases": 15 bytes $ hg rollback -q $ sed 's/.*] "/"/' < ../access.log "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 403 - "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob) "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=capabilities HTTP/1.1" 401 - "GET /?cmd=capabilities HTTP/1.1" 200 - "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ $ cd .. clone of serve with repo in root and unserved subrepo (issue2970) $ hg --cwd test init sub $ echo empty > test/sub/empty $ hg --cwd test/sub add empty $ hg --cwd test/sub commit -qm 'add empty' $ hg --cwd test/sub tag -r 0 something $ echo sub = sub > test/.hgsub $ hg --cwd test add .hgsub $ hg --cwd test commit -qm 'add subrepo' $ hg clone http://localhost:$HGPORT noslash-clone requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 7 changes to 7 files new changesets 8b6053c928fe:56f9bc90cce6 updating to branch default abort: HTTP Error 404: Not Found [255] $ hg clone http://localhost:$HGPORT/ slash-clone requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 7 changes to 7 files new changesets 8b6053c928fe:56f9bc90cce6 updating to branch default abort: HTTP Error 404: Not Found [255] check error log $ cat error.log check abort error reporting while pulling/cloning $ $RUNTESTDIR/killdaemons.py $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py $ cat hg3.pid >> $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ abort-clone requesting all changes remote: abort: this is an exercise abort: pull failed on remote [255] $ cat error.log disable pull-based clones $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True $ cat hg4.pid >> $DAEMON_PIDS $ hg clone http://localhost:$HGPORT1/ disable-pull-clone requesting all changes remote: abort: server has pull-based clones disabled abort: pull failed on remote (remove --pull if specified or upgrade Mercurial) [255] ... but keep stream clones working $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone streaming all changes * files to transfer, * of data (glob) transferred * in * seconds (*/sec) (glob) searching for changes no changes found $ cat error.log ... and also keep partial clones and pulls working $ hg clone http://localhost:$HGPORT1 --rev 0 test-partial-clone adding changesets adding manifests adding file changes added 1 changesets with 4 changes to 4 files new changesets 8b6053c928fe updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg pull -R test-partial-clone pulling from http://localhost:$HGPORT1/ searching for changes adding changesets adding manifests adding file changes added 2 changesets with 3 changes to 3 files new changesets 5fed3813f7f5:56f9bc90cce6 (run 'hg update' to get a working copy) corrupt cookies file should yield a warning $ cat > $TESTTMP/cookies.txt << EOF > bad format > EOF $ hg --config auth.cookiefile=$TESTTMP/cookies.txt id http://localhost:$HGPORT/ (error loading cookie file $TESTTMP/cookies.txt: '*/cookies.txt' does not look like a Netscape format cookies file; continuing without cookies) (glob) 56f9bc90cce6 $ killdaemons.py Create dummy authentication handler that looks for cookies. It doesn't do anything useful. It just raises an HTTP 500 with details about the Cookie request header. We raise HTTP 500 because its message is printed in the abort message. $ cat > cookieauth.py << EOF > from mercurial import util > from mercurial.hgweb import common > def perform_authentication(hgweb, req, op): > cookie = req.env.get('HTTP_COOKIE') > if not cookie: > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'no-cookie') > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'Cookie: %s' % cookie) > def extsetup(): > common.permhooks.insert(0, perform_authentication) > EOF $ hg serve --config extensions.cookieauth=cookieauth.py -R test -p $HGPORT -d --pid-file=pid $ cat pid > $DAEMON_PIDS Request without cookie sent should fail due to lack of cookie $ hg id http://localhost:$HGPORT abort: HTTP Error 500: no-cookie [255] Populate a cookies file $ cat > cookies.txt << EOF > # HTTP Cookie File > # Expiration is 2030-01-01 at midnight > .example.com TRUE / FALSE 1893456000 hgkey examplevalue > EOF Should not send a cookie for another domain $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/ abort: HTTP Error 500: no-cookie [255] Add a cookie entry for our test server and verify it is sent $ cat >> cookies.txt << EOF > localhost.local FALSE / FALSE 1893456000 hgkey localhostvalue > EOF $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/ abort: HTTP Error 500: Cookie: hgkey=localhostvalue [255] mercurial-4.5.3/tests/test-fetch.t0000644015407300116100000003137113261161234016777 0ustar augieeng00000000000000#require serve $ echo "[extensions]" >> $HGRCPATH $ echo "fetch=" >> $HGRCPATH test fetch with default branches only $ hg init a $ echo a > a/a $ hg --cwd a commit -Ama adding a $ hg clone a b updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg clone a c updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo b > a/b $ hg --cwd a commit -Amb adding b $ hg --cwd a parents -q 1:d2ae7f538514 should pull one change $ hg --cwd b fetch ../a pulling from ../a searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets d2ae7f538514 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg --cwd b parents -q 1:d2ae7f538514 $ echo c > c/c $ hg --cwd c commit -Amc adding c $ hg clone c d updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg clone c e updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved We cannot use the default commit message if fetching from a local repo, because the path of the repo will be included in the commit message, making every commit appear different. should merge c into a $ hg --cwd c fetch -d '0 0' -m 'automated merge' ../a pulling from ../a searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets d2ae7f538514 updating to 2:d2ae7f538514 1 files updated, 0 files merged, 1 files removed, 0 files unresolved merging with 1:d36c0562f908 1 files updated, 0 files merged, 0 files removed, 0 files unresolved new changeset 3:a323a0c43ec4 merges remote changes with local $ ls c a b c $ hg serve --cwd a -a localhost -p $HGPORT -d --pid-file=hg.pid $ cat a/hg.pid >> "$DAEMON_PIDS" fetch over http, no auth (this also tests that editor is invoked if '--edit' is specified) $ HGEDITOR=cat hg --cwd d fetch --edit http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets d2ae7f538514 updating to 2:d2ae7f538514 1 files updated, 0 files merged, 1 files removed, 0 files unresolved merging with 1:d36c0562f908 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Automated merge with http://localhost:$HGPORT/ HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: test HG: branch merge HG: branch 'default' HG: changed c new changeset 3:* merges remote changes with local (glob) $ hg --cwd d tip --template '{desc}\n' Automated merge with http://localhost:$HGPORT/ $ hg --cwd d status --rev 'tip^1' --rev tip A c $ hg --cwd d status --rev 'tip^2' --rev tip A b fetch over http with auth (should be hidden in desc) (this also tests that editor is not invoked if '--edit' is not specified, even though commit message is not specified explicitly) $ HGEDITOR=cat hg --cwd e fetch http://user:password@localhost:$HGPORT/ pulling from http://user:***@localhost:$HGPORT/ searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets d2ae7f538514 updating to 2:d2ae7f538514 1 files updated, 0 files merged, 1 files removed, 0 files unresolved merging with 1:d36c0562f908 1 files updated, 0 files merged, 0 files removed, 0 files unresolved new changeset 3:* merges remote changes with local (glob) $ hg --cwd e tip --template '{desc}\n' Automated merge with http://localhost:$HGPORT/ $ hg clone a f updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg clone a g updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo f > f/f $ hg --cwd f ci -Amf adding f $ echo g > g/g $ hg --cwd g ci -Amg adding g $ hg clone -q f h $ hg clone -q g i should merge f into g $ hg --cwd g fetch -d '0 0' --switch -m 'automated merge' ../f pulling from ../f searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 6343ca3eff20 0 files updated, 0 files merged, 0 files removed, 0 files unresolved merging with 3:6343ca3eff20 1 files updated, 0 files merged, 0 files removed, 0 files unresolved new changeset 4:f7faa0b7d3c6 merges remote changes with local $ rm i/g should abort, because i is modified $ hg --cwd i fetch ../h abort: uncommitted changes [255] test fetch with named branches $ hg init nbase $ echo base > nbase/a $ hg -R nbase ci -Am base adding a $ hg -R nbase branch a marked working directory as branch a (branches are permanent and global, did you want a bookmark?) $ echo a > nbase/a $ hg -R nbase ci -m a $ hg -R nbase up -C 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R nbase branch b marked working directory as branch b $ echo b > nbase/b $ hg -R nbase ci -Am b adding b pull in change on foreign branch $ hg clone nbase n1 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg clone nbase n2 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R n1 up -C a 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo aa > n1/a $ hg -R n1 ci -m a1 $ hg -R n2 up -C b 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R n2 fetch -m 'merge' n1 pulling from n1 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 8fdc9284bbc5 parent should be 2 (no automatic update) $ hg -R n2 parents --template '{rev}\n' 2 $ rm -fr n1 n2 pull in changes on both foreign and local branches $ hg clone nbase n1 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg clone nbase n2 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R n1 up -C a 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo aa > n1/a $ hg -R n1 ci -m a1 $ hg -R n1 up -C b 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo bb > n1/b $ hg -R n1 ci -m b1 $ hg -R n2 up -C b 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R n2 fetch -m 'merge' n1 pulling from n1 searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files new changesets 8fdc9284bbc5:3c4a837a864f 1 files updated, 0 files merged, 0 files removed, 0 files unresolved parent should be 4 (fast forward) $ hg -R n2 parents --template '{rev}\n' 4 $ rm -fr n1 n2 pull changes on foreign (2 new heads) and local (1 new head) branches with a local change $ hg clone nbase n1 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg clone nbase n2 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R n1 up -C a 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo a1 > n1/a $ hg -R n1 ci -m a1 $ hg -R n1 up -C b 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo bb > n1/b $ hg -R n1 ci -m b1 $ hg -R n1 up -C 1 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo a2 > n1/a $ hg -R n1 ci -m a2 created new head $ hg -R n2 up -C b 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo change >> n2/c $ hg -R n2 ci -A -m local adding c $ hg -R n2 fetch -d '0 0' -m 'merge' n1 pulling from n1 searching for changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 2 files (+2 heads) new changesets d05ce59ff88d:a7954de24e4c updating to 5:3c4a837a864f 1 files updated, 0 files merged, 1 files removed, 0 files unresolved merging with 3:1267f84a9ea5 1 files updated, 0 files merged, 0 files removed, 0 files unresolved new changeset 7:2cf2a1261f21 merges remote changes with local parent should be 7 (new merge changeset) $ hg -R n2 parents --template '{rev}\n' 7 $ rm -fr n1 n2 pull in changes on foreign (merge of local branch) and local (2 new heads) with a local change $ hg clone nbase n1 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg clone nbase n2 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R n1 up -C a 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R n1 merge b 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg -R n1 ci -m merge $ hg -R n1 up -C 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo c > n1/a $ hg -R n1 ci -m c $ hg -R n1 up -C 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo cc > n1/a $ hg -R n1 ci -m cc created new head $ hg -R n2 up -C b 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo change >> n2/b $ hg -R n2 ci -A -m local $ hg -R n2 fetch -m 'merge' n1 pulling from n1 searching for changes adding changesets adding manifests adding file changes added 3 changesets with 2 changes to 1 files (+2 heads) new changesets b84e8d0f020f:3d3bf54f99c0 not merging with 1 other new branch heads (use "hg heads ." and "hg merge" to merge them) [1] parent should be 3 (fetch did not merge anything) $ hg -R n2 parents --template '{rev}\n' 3 $ rm -fr n1 n2 pull in change on different branch than dirstate $ hg init n1 $ echo a > n1/a $ hg -R n1 ci -Am initial adding a $ hg clone n1 n2 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo b > n1/a $ hg -R n1 ci -m next $ hg -R n2 branch topic marked working directory as branch topic (branches are permanent and global, did you want a bookmark?) $ hg -R n2 fetch -m merge n1 abort: working directory not at branch tip (use 'hg update' to check out branch tip) [255] parent should be 0 (fetch did not update or merge anything) $ hg -R n2 parents --template '{rev}\n' 0 $ rm -fr n1 n2 test fetch with inactive branches $ hg init ib1 $ echo a > ib1/a $ hg --cwd ib1 ci -Am base adding a $ hg --cwd ib1 branch second marked working directory as branch second (branches are permanent and global, did you want a bookmark?) $ echo b > ib1/b $ hg --cwd ib1 ci -Am onsecond adding b $ hg --cwd ib1 branch -f default marked working directory as branch default $ echo c > ib1/c $ hg --cwd ib1 ci -Am newdefault adding c created new head $ hg clone ib1 ib2 updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved fetch should succeed $ hg --cwd ib2 fetch ../ib1 pulling from ../ib1 searching for changes no changes found $ rm -fr ib1 ib2 test issue1726 $ hg init i1726r1 $ echo a > i1726r1/a $ hg --cwd i1726r1 ci -Am base adding a $ hg clone i1726r1 i1726r2 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo b > i1726r1/a $ hg --cwd i1726r1 ci -m second $ echo c > i1726r2/a $ hg --cwd i1726r2 ci -m third $ HGMERGE=true hg --cwd i1726r2 fetch ../i1726r1 pulling from ../i1726r1 searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets 7837755a2789 updating to 2:7837755a2789 1 files updated, 0 files merged, 0 files removed, 0 files unresolved merging with 1:d1f0c6c48ebd merging a 0 files updated, 1 files merged, 0 files removed, 0 files unresolved new changeset 3:* merges remote changes with local (glob) $ hg --cwd i1726r2 heads default --template '{rev}\n' 3 test issue2047 $ hg -q init i2047a $ cd i2047a $ echo a > a $ hg -q ci -Am a $ hg -q branch stable $ echo b > b $ hg -q ci -Am b $ cd .. $ hg -q clone -r 0 i2047a i2047b $ cd i2047b $ hg fetch ../i2047a pulling from ../i2047a searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets c8735224de5c $ cd .. mercurial-4.5.3/tests/test-nested-repo.t0000644015407300116100000000105713261161234020131 0ustar augieeng00000000000000 $ hg init a $ cd a $ hg init b $ echo x > b/x Should print nothing: $ hg add b $ hg st $ echo y > b/y $ hg st Should fail: $ hg st b/x abort: path 'b/x' is inside nested repo 'b' [255] $ hg add b/x abort: path 'b/x' is inside nested repo 'b' [255] Should fail: $ hg add b b/x abort: path 'b/x' is inside nested repo 'b' [255] $ hg st Should arguably print nothing: $ hg st b $ echo a > a $ hg ci -Ama a Should fail: $ hg mv a b abort: path 'b/a' is inside nested repo 'b' [255] $ hg st $ cd .. mercurial-4.5.3/tests/test-log-exthook.t0000644015407300116100000000304213261161234020140 0ustar augieeng00000000000000Test hg log changeset printer external hook ------------------------------------------- $ cat > $TESTTMP/logexthook.py < from __future__ import absolute_import > from mercurial import ( > cmdutil, > commands, > repair, > ) > def rot13description(self, ctx): > summary = "summary".encode('rot13') > description = ctx.description().strip().splitlines()[0].encode('rot13') > self.ui.write("%s: %s\n" % (summary, description)) > def reposetup(ui, repo): > cmdutil.changeset_printer._exthook = rot13description > EOF Prepare the repository $ hg init empty $ cd empty $ touch ROOT $ hg commit -A -m "Root" ROOT $ touch a b c $ hg commit -A -m "Add A, B, C" a b c Check the log $ hg log --config extensions.t=$TESTTMP/logexthook.py changeset: 1:70fc82b23320 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 fhzznel: Nqq N, O, P summary: Add A, B, C changeset: 0:b00443a54871 user: test date: Thu Jan 01 00:00:00 1970 +0000 fhzznel: Ebbg summary: Root Check that exthook is working with graph log too $ hg log -G --config extensions.t=$TESTTMP/logexthook.py @ changeset: 1:70fc82b23320 | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | fhzznel: Nqq N, O, P | summary: Add A, B, C | o changeset: 0:b00443a54871 user: test date: Thu Jan 01 00:00:00 1970 +0000 fhzznel: Ebbg summary: Root mercurial-4.5.3/tests/test-commit-unresolved.t0000644015407300116100000000654713261161234021371 0ustar augieeng00000000000000 $ addcommit () { > echo $1 > $1 > hg add $1 > hg commit -d "${2} 0" -m $1 > } $ commit () { > hg commit -d "${2} 0" -m $1 > } $ hg init a $ cd a $ addcommit "A" 0 $ addcommit "B" 1 $ echo "C" >> A $ commit "C" 2 $ hg update -C 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo "D" >> A $ commit "D" 3 created new head State before the merge $ hg status $ hg id e45016d2b3d3 tip $ hg summary parent: 3:e45016d2b3d3 tip D branch: default commit: (clean) update: 2 new changesets, 2 branch heads (merge) phases: 4 draft Testing the abort functionality first in case of conflicts $ hg merge --abort abort: no merge in progress [255] $ hg merge merging A warning: conflicts while merging A! (edit, then use 'hg resolve --mark') 1 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ hg merge --abort e4501 abort: cannot specify a node with --abort [255] $ hg merge --abort --rev e4501 abort: cannot specify both --rev and --abort [255] $ hg merge --abort aborting the merge, updating back to e45016d2b3d3 1 files updated, 0 files merged, 1 files removed, 0 files unresolved Checking that we got back in the same state $ hg status ? A.orig $ hg id e45016d2b3d3 tip $ hg summary parent: 3:e45016d2b3d3 tip D branch: default commit: 1 unknown (clean) update: 2 new changesets, 2 branch heads (merge) phases: 4 draft Merging a conflict araises $ hg merge merging A warning: conflicts while merging A! (edit, then use 'hg resolve --mark') 1 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] Correct the conflict without marking the file as resolved $ echo "ABCD" > A $ hg commit -m "Merged" abort: unresolved merge conflicts (see 'hg help resolve') [255] Mark the conflict as resolved and commit $ hg resolve -m A (no more unresolved files) $ hg commit -m "Merged" Test that if a file is removed but not marked resolved, the commit still fails (issue4972) $ hg up ".^" 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg merge 2 merging A warning: conflicts while merging A! (edit, then use 'hg resolve --mark') 1 files updated, 0 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon [1] $ hg rm --force A $ hg commit -m merged abort: unresolved merge conflicts (see 'hg help resolve') [255] $ hg resolve -ma (no more unresolved files) $ hg commit -m merged created new head Testing the abort functionality in case of no conflicts $ hg update -C 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ addcommit "E" 4 created new head $ hg id 68352a18a7c4 tip $ hg merge -r 4 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg merge --preview --abort abort: cannot specify --preview with --abort [255] $ hg merge --abort aborting the merge, updating back to 68352a18a7c4 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg id 68352a18a7c4 tip $ cd .. mercurial-4.5.3/tests/test-bookmarks-rebase.t0000644015407300116100000000471113261161234021133 0ustar augieeng00000000000000 $ echo "[extensions]" >> $HGRCPATH $ echo "rebase=" >> $HGRCPATH initialize repository $ hg init $ echo 'a' > a $ hg ci -A -m "0" adding a $ echo 'b' > b $ hg ci -A -m "1" adding b $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo 'c' > c $ hg ci -A -m "2" adding c created new head $ echo 'd' > d $ hg ci -A -m "3" adding d $ hg bookmark -r 1 one $ hg bookmark -r 3 two $ hg up -q two bookmark list $ hg bookmark one 1:925d80f479bb * two 3:2ae46b1d99a7 rebase $ hg rebase -s two -d one rebasing 3:2ae46b1d99a7 "3" (two tip) saved backup bundle to $TESTTMP/.hg/strip-backup/2ae46b1d99a7-e6b057bc-rebase.hg $ hg log changeset: 3:42e5ed2cdcf4 bookmark: two tag: tip parent: 1:925d80f479bb user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 3 changeset: 2:db815d6d32e6 parent: 0:f7b1eb17ad24 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 2 changeset: 1:925d80f479bb bookmark: one user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 1 changeset: 0:f7b1eb17ad24 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 0 aborted rebase should restore active bookmark. $ hg up 1 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (leaving bookmark two) $ echo 'e' > d $ hg ci -A -m "4" adding d created new head $ hg bookmark three $ hg rebase -s three -d two rebasing 4:dd7c838e8362 "4" (three tip) merging d warning: conflicts while merging d! (edit, then use 'hg resolve --mark') unresolved conflicts (see hg resolve, then hg rebase --continue) [1] $ hg rebase --abort rebase aborted $ hg bookmark one 1:925d80f479bb * three 4:dd7c838e8362 two 3:42e5ed2cdcf4 after aborted rebase, restoring a bookmark that has been removed should not fail $ hg rebase -s three -d two rebasing 4:dd7c838e8362 "4" (three tip) merging d warning: conflicts while merging d! (edit, then use 'hg resolve --mark') unresolved conflicts (see hg resolve, then hg rebase --continue) [1] $ hg bookmark -d three $ hg rebase --abort rebase aborted $ hg bookmark one 1:925d80f479bb two 3:42e5ed2cdcf4 mercurial-4.5.3/tests/hghave0000755015407300116100000000353313261161234015733 0ustar augieeng00000000000000#!/usr/bin/env python """Test the running system for features availability. Exit with zero if all features are there, non-zero otherwise. If a feature name is prefixed with "no-", the absence of feature is tested. """ from __future__ import absolute_import, print_function import hghave import optparse import os import sys checks = hghave.checks def list_features(): for name, feature in sorted(checks.items()): desc = feature[1] print(name + ':', desc) def test_features(): failed = 0 for name, feature in checks.items(): check, _ = feature try: check() except Exception as e: print("feature %s failed: %s" % (name, e)) failed += 1 return failed parser = optparse.OptionParser("%prog [options] [features]") parser.add_option("--test-features", action="store_true", help="test available features") parser.add_option("--list-features", action="store_true", help="list available features") def _loadaddon(): if 'TESTDIR' in os.environ: # loading from '.' isn't needed, because `hghave` should be # running at TESTTMP in this case path = os.environ['TESTDIR'] else: path = '.' if not os.path.exists(os.path.join(path, 'hghaveaddon.py')): return sys.path.insert(0, path) try: import hghaveaddon assert hghaveaddon # silence pyflakes except BaseException as inst: sys.stderr.write('failed to import hghaveaddon.py from %r: %s\n' % (path, inst)) sys.exit(2) sys.path.pop(0) if __name__ == '__main__': options, args = parser.parse_args() _loadaddon() if options.list_features: list_features() sys.exit(0) if options.test_features: sys.exit(test_features()) hghave.require(args) mercurial-4.5.3/tests/test-exchange-obsmarkers-case-C4.t0000644015407300116100000001151013261161234023004 0ustar augieeng00000000000000============================================ Testing obsolescence markers push: Cases C.4 ============================================ Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of all changesets that requested to be "in sync" after the push (even if they are already on both side). This test belongs to a series of tests checking such set is properly computed and applied. This does not tests "obsmarkers" discovery capabilities. Category C: advanced case TestCase 4: multiple successors, one is pruned C.4 multiple successors, one is pruned ====================================== .. (A similarish situation can appends with split markers see the Z section) .. .. {{{ .. A .. B ○⇢ø⇠⊗ C .. \|/ .. â— O .. }}} .. .. Marker exist from: .. .. * `A ø⇠○ B` .. * `A ø⇠○ C` .. * C (prune) .. .. Command run: .. .. * hg push -r O .. .. Expected exchange: .. .. * `A ø⇠○ C` .. * C (prune) .. .. Expected exclude: .. .. * `A ø⇠○ B` Setup ----- $ . $TESTDIR/testlib/exchange-obsmarker-util.sh Implemented as the non-split version $ setuprepos C.4 creating test repo for test case C.4 - pulldest - main - pushdest cd into `main` and proceed with env setup $ cd main $ mkcommit A $ hg update -q 0 $ mkcommit B created new head $ hg update -q 0 $ mkcommit C created new head $ hg debugobsolete --hidden `getid 'desc(A)'` `getid 'desc(B)'` obsoleted 1 changesets $ hg debugobsolete --hidden `getid 'desc(A)'` `getid 'desc(C)'` 2 new content-divergent changesets $ hg prune -qd '0 0' . $ hg log -G --hidden x 7f7f229b13a6 (draft): C | | o 35b183996678 (draft): B |/ | x f5bc6836db60 (draft): A |/ @ a9bdc8b26820 (public): O $ inspect_obsmarkers obsstore content ================ f5bc6836db60e308a17ba08bf050154ba9c4fad7 35b1839966785d5703a01607229eea932db42f87 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ cd .. $ cd .. Actual Test ----------- $ dotest C.4 O ## Running testcase C.4 # testing echange of "O" (a9bdc8b26820) ## initial state # obstore: main 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f5bc6836db60e308a17ba08bf050154ba9c4fad7 35b1839966785d5703a01607229eea932db42f87 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest # obstore: pulldest ## pushing "O" from main to pushdest pushing to pushdest searching for changes no changes found remote: 2 new obsolescence markers ## post push state # obstore: main 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f5bc6836db60e308a17ba08bf050154ba9c4fad7 35b1839966785d5703a01607229eea932db42f87 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest ## pulling "a9bdc8b26820" from main into pulldest pulling from main no changes found 2 new obsolescence markers ## post pull state # obstore: main 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f5bc6836db60e308a17ba08bf050154ba9c4fad7 35b1839966785d5703a01607229eea932db42f87 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f5bc6836db60e308a17ba08bf050154ba9c4fad7 7f7f229b13a629a5b20581c6cb723f4e2ca54bed 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} mercurial-4.5.3/tests/test-sparse-requirement.t0000644015407300116100000000204213261161234021532 0ustar augieeng00000000000000 $ hg init repo $ cd repo $ touch a.html b.html c.py d.py $ cat > frontend.sparse << EOF > [include] > *.html > EOF $ hg -q commit -A -m initial $ echo 1 > a.html $ echo 1 > c.py $ hg commit -m 'commit 1' Enable sparse profile $ cat .hg/requires dotencode fncache generaldelta revlogv1 store $ hg debugsparse --config extensions.sparse= --enable-profile frontend.sparse $ ls a.html b.html Requirement for sparse added when sparse is enabled $ cat .hg/requires dotencode exp-sparse fncache generaldelta revlogv1 store Client without sparse enabled reacts properly $ hg files abort: repository is using sparse feature but sparse is not enabled; enable the "sparse" extensions to access! [255] Requirement for sparse is removed when sparse is disabled $ hg debugsparse --reset --config extensions.sparse= $ cat .hg/requires dotencode fncache generaldelta revlogv1 store And client without sparse can access $ hg files a.html b.html c.py d.py frontend.sparse mercurial-4.5.3/tests/test-run-tests.py0000644015407300116100000000551013261161234020033 0ustar augieeng00000000000000"""test line matching with some failing examples and some which warn run-test.t only checks positive matches and can not see warnings (both by design) """ from __future__ import absolute_import, print_function import doctest import os import re # this is hack to make sure no escape characters are inserted into the output if 'TERM' in os.environ: del os.environ['TERM'] run_tests = __import__('run-tests') def prn(ex): m = ex.args[0] if isinstance(m, str): print(m) else: print(m.decode('utf-8')) def lm(expected, output): r"""check if output matches expected does it generally work? >>> lm(b'H*e (glob)\n', b'Here\n') True fail on bad test data >>> try: lm(b'a\n',b'a') ... except AssertionError as ex: print(ex) missing newline >>> try: lm(b'single backslash\n', b'single \backslash\n') ... except AssertionError as ex: prn(ex) single backslash or unknown char """ assert (expected.endswith(b'\n') and output.endswith(b'\n')), 'missing newline' assert not re.search(br'[^ \w\\/\r\n()*?]', expected + output), \ b'single backslash or unknown char' test = run_tests.TTest(b'test-run-test.t', b'.', b'.') match = test.linematch(expected, output) if isinstance(match, str): return 'special: ' + match elif isinstance(match, bytes): return 'special: ' + match.decode('utf-8') else: return bool(match) # do not return match object def wintests(): r"""test matching like running on windows enable windows matching on any os >>> _osaltsep = os.altsep >>> os.altsep = True >>> _osname = os.name >>> os.name = 'nt' valid match on windows >>> lm(b'g/a*/d (glob)\n', b'g\\abc/d\n') True direct matching, glob unnecessary >>> lm(b'g/b (glob)\n', b'g/b\n') 'special: -glob' missing glob >>> lm(b'/g/c/d/fg\n', b'\\g\\c\\d/fg\n') True >>> lm(b'/g/c/d/fg\n', b'\\g\\c\\d\\fg\r\n') True restore os.altsep >>> os.altsep = _osaltsep >>> os.name = _osname """ pass def otherostests(): r"""test matching like running on non-windows os disable windows matching on any os >>> _osaltsep = os.altsep >>> os.altsep = False >>> _osname = os.name >>> os.name = 'nt' backslash does not match slash >>> lm(b'h/a* (glob)\n', b'h\\ab\n') False direct matching glob can not be recognized >>> lm(b'h/b (glob)\n', b'h/b\n') True missing glob can not not be recognized >>> lm(b'/h/c/df/g/\n', b'\\h/c\\df/g\\\n') False restore os.altsep >>> os.altsep = _osaltsep >>> os.name = _osname """ pass if __name__ == '__main__': doctest.testmod() mercurial-4.5.3/tests/test-pathencode.py0000644015407300116100000001457113261161234020210 0ustar augieeng00000000000000# This is a randomized test that generates different pathnames every # time it is invoked, and tests the encoding of those pathnames. # # It uses a simple probabilistic model to generate valid pathnames # that have proven likely to expose bugs and divergent behavior in # different encoding implementations. from __future__ import absolute_import, print_function import binascii import collections import itertools import math import os import random import sys import time from mercurial import ( store, ) try: xrange except NameError: xrange = range validchars = set(map(chr, range(0, 256))) alphanum = range(ord('A'), ord('Z')) for c in '\0/': validchars.remove(c) winreserved = ('aux con prn nul'.split() + ['com%d' % i for i in xrange(1, 10)] + ['lpt%d' % i for i in xrange(1, 10)]) def casecombinations(names): '''Build all case-diddled combinations of names.''' combos = set() for r in names: for i in xrange(len(r) + 1): for c in itertools.combinations(xrange(len(r)), i): d = r for j in c: d = ''.join((d[:j], d[j].upper(), d[j + 1:])) combos.add(d) return sorted(combos) def buildprobtable(fp, cmd='hg manifest tip'): '''Construct and print a table of probabilities for path name components. The numbers are percentages.''' counts = collections.defaultdict(lambda: 0) for line in os.popen(cmd).read().splitlines(): if line[-2:] in ('.i', '.d'): line = line[:-2] if line.startswith('data/'): line = line[5:] for c in line: counts[c] += 1 for c in '\r/\n': counts.pop(c, None) t = sum(counts.itervalues()) / 100.0 fp.write('probtable = (') for i, (k, v) in enumerate(sorted(counts.iteritems(), key=lambda x: x[1], reverse=True)): if (i % 5) == 0: fp.write('\n ') vt = v / t if vt < 0.0005: break fp.write('(%r, %.03f), ' % (k, vt)) fp.write('\n )\n') # A table of character frequencies (as percentages), gleaned by # looking at filelog names from a real-world, very large repo. probtable = ( ('t', 9.828), ('e', 9.042), ('s', 8.011), ('a', 6.801), ('i', 6.618), ('g', 5.053), ('r', 5.030), ('o', 4.887), ('p', 4.363), ('n', 4.258), ('l', 3.830), ('h', 3.693), ('_', 3.659), ('.', 3.377), ('m', 3.194), ('u', 2.364), ('d', 2.296), ('c', 2.163), ('b', 1.739), ('f', 1.625), ('6', 0.666), ('j', 0.610), ('y', 0.554), ('x', 0.487), ('w', 0.477), ('k', 0.476), ('v', 0.473), ('3', 0.336), ('1', 0.335), ('2', 0.326), ('4', 0.310), ('5', 0.305), ('9', 0.302), ('8', 0.300), ('7', 0.299), ('q', 0.298), ('0', 0.250), ('z', 0.223), ('-', 0.118), ('C', 0.095), ('T', 0.087), ('F', 0.085), ('B', 0.077), ('S', 0.076), ('P', 0.076), ('L', 0.059), ('A', 0.058), ('N', 0.051), ('D', 0.049), ('M', 0.046), ('E', 0.039), ('I', 0.035), ('R', 0.035), ('G', 0.028), ('U', 0.026), ('W', 0.025), ('O', 0.017), ('V', 0.015), ('H', 0.013), ('Q', 0.011), ('J', 0.007), ('K', 0.005), ('+', 0.004), ('X', 0.003), ('Y', 0.001), ) for c, _ in probtable: validchars.remove(c) validchars = list(validchars) def pickfrom(rng, table): c = 0 r = rng.random() * sum(i[1] for i in table) for i, p in table: c += p if c >= r: return i reservedcombos = casecombinations(winreserved) # The first component of a name following a slash. firsttable = ( (lambda rng: pickfrom(rng, probtable), 90), (lambda rng: rng.choice(validchars), 5), (lambda rng: rng.choice(reservedcombos), 5), ) # Components of a name following the first. resttable = firsttable[:-1] # Special suffixes. internalsuffixcombos = casecombinations('.hg .i .d'.split()) # The last component of a path, before a slash or at the end of a name. lasttable = resttable + ( (lambda rng: '', 95), (lambda rng: rng.choice(internalsuffixcombos), 5), ) def makepart(rng, k): '''Construct a part of a pathname, without slashes.''' p = pickfrom(rng, firsttable)(rng) l = len(p) ps = [p] maxl = rng.randint(1, k) while l < maxl: p = pickfrom(rng, resttable)(rng) l += len(p) ps.append(p) ps.append(pickfrom(rng, lasttable)(rng)) return ''.join(ps) def makepath(rng, j, k): '''Construct a complete pathname.''' return ('data/' + '/'.join(makepart(rng, k) for _ in xrange(j)) + rng.choice(['.d', '.i'])) def genpath(rng, count): '''Generate random pathnames with gradually increasing lengths.''' mink, maxk = 1, 4096 def steps(): for i in xrange(count): yield mink + int(round(math.sqrt((maxk - mink) * float(i) / count))) for k in steps(): x = rng.randint(1, k) y = rng.randint(1, k) yield makepath(rng, x, y) def runtests(rng, seed, count): nerrs = 0 for p in genpath(rng, count): h = store._pathencode(p) # uses C implementation, if available r = store._hybridencode(p, True) # reference implementation in Python if h != r: if nerrs == 0: print('seed:', hex(seed)[:-1], file=sys.stderr) print("\np: '%s'" % p.encode("string_escape"), file=sys.stderr) print("h: '%s'" % h.encode("string_escape"), file=sys.stderr) print("r: '%s'" % r.encode("string_escape"), file=sys.stderr) nerrs += 1 return nerrs def main(): import getopt # Empirically observed to take about a second to run count = 100 seed = None opts, args = getopt.getopt(sys.argv[1:], 'c:s:', ['build', 'count=', 'seed=']) for o, a in opts: if o in ('-c', '--count'): count = int(a) elif o in ('-s', '--seed'): seed = int(a, base=0) # accepts base 10 or 16 strings elif o == '--build': buildprobtable(sys.stdout, 'find .hg/store/data -type f && ' 'cat .hg/store/fncache 2>/dev/null') sys.exit(0) if seed is None: try: seed = int(binascii.hexlify(os.urandom(16)), 16) except AttributeError: seed = int(time.time() * 1000) rng = random.Random(seed) if runtests(rng, seed, count): sys.exit(1) if __name__ == '__main__': main() mercurial-4.5.3/tests/test-revlog-packentry.t0000644015407300116100000000111713261161234021175 0ustar augieeng00000000000000 $ hg init repo $ cd repo $ touch foo $ hg ci -Am 'add foo' adding foo $ hg up -C null 0 files updated, 0 files merged, 1 files removed, 0 files unresolved this should be stored as a delta against rev 0 $ echo foo bar baz > foo $ hg ci -Am 'add foo again' adding foo created new head $ hg debugindex foo rev offset length ..... linkrev nodeid p1 p2 (re) 0 0 0 ..... 0 b80de5d13875 000000000000 000000000000 (re) 1 0 13 ..... 1 0376abec49b8 000000000000 000000000000 (re) $ cd .. mercurial-4.5.3/tests/test-hgwebdir.t0000644015407300116100000015151413261161234017503 0ustar augieeng00000000000000#require serve hide outer repo and work in dir without '.hg' $ hg init $ mkdir dir $ cd dir Tests some basic hgwebdir functionality. Tests setting up paths and collection, different forms of 404s and the subdirectory support. $ mkdir webdir $ cd webdir $ hg init a $ echo a > a/a $ hg --cwd a ci -Ama -d'1 0' adding a create a mercurial queue repository $ hg --cwd a qinit --config extensions.hgext.mq= -c $ hg init b $ echo b > b/b $ hg --cwd b ci -Amb -d'2 0' adding b create a nested repository $ cd b $ hg init d $ echo d > d/d $ hg --cwd d ci -Amd -d'3 0' adding d $ cd .. $ hg init c $ echo c > c/c $ hg --cwd c ci -Amc -d'3 0' adding c create a subdirectory containing repositories and subrepositories $ mkdir notrepo $ cd notrepo $ hg init e $ echo e > e/e $ hg --cwd e ci -Ame -d'4 0' adding e $ hg init e/e2 $ echo e2 > e/e2/e2 $ hg --cwd e/e2 ci -Ame2 -d '4 0' adding e2 $ hg init f $ echo f > f/f $ hg --cwd f ci -Amf -d'4 0' adding f $ hg init f/f2 $ echo f2 > f/f2/f2 $ hg --cwd f/f2 ci -Amf2 -d '4 0' adding f2 $ echo 'f2 = f2' > f/.hgsub $ hg -R f ci -Am 'add subrepo' -d'4 0' adding .hgsub $ cat >> f/.hg/hgrc << EOF > [web] > name = fancy name for repo f > labels = foo, bar > EOF $ cd .. create repository without .hg/store $ hg init nostore $ rm -R nostore/.hg/store $ root=`pwd` $ cd .. serve $ cat > paths.conf < [paths] > a=$root/a > b=$root/b > EOF $ hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf paths.conf \ > -A access-paths.log -E error-paths-1.log $ cat hg.pid >> $DAEMON_PIDS should give a 404 - file does not exist $ get-with-headers.py localhost:$HGPORT 'a/file/tip/bork?style=raw' 404 Not Found error: bork@8580ff50825a: not found in manifest [1] should succeed $ get-with-headers.py localhost:$HGPORT '?style=raw' 200 Script output follows /a/ /b/ $ get-with-headers.py localhost:$HGPORT '?style=json' 200 Script output follows { "entries": [{ "name": "a", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "b", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }] } (no-eol) $ get-with-headers.py localhost:$HGPORT 'a/file/tip/a?style=raw' 200 Script output follows a $ get-with-headers.py localhost:$HGPORT 'b/file/tip/b?style=raw' 200 Script output follows b should give a 404 - repo is not published $ get-with-headers.py localhost:$HGPORT 'c/file/tip/c?style=raw' 404 Not Found error: repository c/file/tip/c not found [1] atom-log without basedir $ get-with-headers.py localhost:$HGPORT 'a/atom-log' | grep ' (glob) (glob) (glob) rss-log without basedir $ get-with-headers.py localhost:$HGPORT 'a/rss-log' | grep 'http://*:$HGPORT/a/rev/8580ff50825a (glob) $ cat > paths.conf < [paths] > t/a/=$root/a > b=$root/b > coll=$root/* > rcoll=$root/** > star=* > starstar=** > astar=webdir/a/* > EOF $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ > -A access-paths.log -E error-paths-2.log $ cat hg.pid >> $DAEMON_PIDS should succeed, slashy names $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows /t/a/ /b/ /coll/a/ /coll/a/.hg/patches/ /coll/b/ /coll/c/ /coll/notrepo/e/ /coll/notrepo/f/ /rcoll/a/ /rcoll/a/.hg/patches/ /rcoll/b/ /rcoll/b/d/ /rcoll/c/ /rcoll/notrepo/e/ /rcoll/notrepo/e/e2/ /rcoll/notrepo/f/ /rcoll/notrepo/f/f2/ /star/webdir/a/ /star/webdir/a/.hg/patches/ /star/webdir/b/ /star/webdir/c/ /star/webdir/notrepo/e/ /star/webdir/notrepo/f/ /starstar/webdir/a/ /starstar/webdir/a/.hg/patches/ /starstar/webdir/b/ /starstar/webdir/b/d/ /starstar/webdir/c/ /starstar/webdir/notrepo/e/ /starstar/webdir/notrepo/e/e2/ /starstar/webdir/notrepo/f/ /starstar/webdir/notrepo/f/f2/ /astar/ /astar/.hg/patches/ $ get-with-headers.py localhost:$HGPORT1 '?style=json' 200 Script output follows { "entries": [{ "name": "t/a", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "b", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "coll/a", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "coll/a/.hg/patches", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "coll/b", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "coll/c", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "coll/notrepo/e", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "fancy name for repo f", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": ["foo", "bar"] }, { "name": "rcoll/a", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "rcoll/a/.hg/patches", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "rcoll/b", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "rcoll/b/d", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "rcoll/c", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "rcoll/notrepo/e", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "rcoll/notrepo/e/e2", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "fancy name for repo f", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": ["foo", "bar"] }, { "name": "rcoll/notrepo/f/f2", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "star/webdir/a", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "star/webdir/a/.hg/patches", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "star/webdir/b", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "star/webdir/c", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "star/webdir/notrepo/e", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "fancy name for repo f", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": ["foo", "bar"] }, { "name": "starstar/webdir/a", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "starstar/webdir/a/.hg/patches", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "starstar/webdir/b", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "starstar/webdir/b/d", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "starstar/webdir/c", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "starstar/webdir/notrepo/e", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "starstar/webdir/notrepo/e/e2", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "fancy name for repo f", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": ["foo", "bar"] }, { "name": "starstar/webdir/notrepo/f/f2", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "astar", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }, { "name": "astar/.hg/patches", "description": "unknown", "contact": "Foo Bar \u003cfoo.bar@example.com\u003e", "lastchange": [*, *], (glob) "labels": [] }] } (no-eol) $ get-with-headers.py localhost:$HGPORT1 '?style=paper' 200 Script output follows Mercurial repositories index
    (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob) (glob)
    Name Description Contact Last modified    
    t/a unknown Foo Bar <foo.bar@example.com> *
    b unknown Foo Bar <foo.bar@example.com> *
    coll/a unknown Foo Bar <foo.bar@example.com> *
    coll/a/.hg/patches unknown Foo Bar <foo.bar@example.com> *
    coll/b unknown Foo Bar <foo.bar@example.com> *
    coll/c unknown Foo Bar <foo.bar@example.com> *
    coll/notrepo/e unknown Foo Bar <foo.bar@example.com> *
    fancy name for repo f unknown Foo Bar <foo.bar@example.com> *
    rcoll/a unknown Foo Bar <foo.bar@example.com> *
    rcoll/a/.hg/patches unknown Foo Bar <foo.bar@example.com> *
    rcoll/b unknown Foo Bar <foo.bar@example.com> *
    rcoll/b/d unknown Foo Bar <foo.bar@example.com> *
    rcoll/c unknown Foo Bar <foo.bar@example.com> *
    rcoll/notrepo/e unknown Foo Bar <foo.bar@example.com> *
    rcoll/notrepo/e/e2 unknown Foo Bar <foo.bar@example.com> *
    fancy name for repo f unknown Foo Bar <foo.bar@example.com> *
    rcoll/notrepo/f/f2 unknown Foo Bar <foo.bar@example.com> *
    star/webdir/a unknown Foo Bar <foo.bar@example.com> *
    star/webdir/a/.hg/patches unknown Foo Bar <foo.bar@example.com> *
    star/webdir/b unknown Foo Bar <foo.bar@example.com> *
    star/webdir/c unknown Foo Bar <foo.bar@example.com> *
    star/webdir/notrepo/e unknown Foo Bar <foo.bar@example.com> *
    fancy name for repo f unknown Foo Bar <foo.bar@example.com> *
    starstar/webdir/a unknown Foo Bar <foo.bar@example.com> *
    starstar/webdir/a/.hg/patches unknown Foo Bar <foo.bar@example.com> *
    starstar/webdir/b unknown Foo Bar <foo.bar@example.com> *
    starstar/webdir/b/d unknown Foo Bar <foo.bar@example.com> *
    starstar/webdir/c unknown Foo Bar <foo.bar@example.com> *
    starstar/webdir/notrepo/e unknown Foo Bar <foo.bar@example.com> *
    starstar/webdir/notrepo/e/e2 unknown Foo Bar <foo.bar@example.com> *
    fancy name for repo f unknown Foo Bar <foo.bar@example.com> *
    starstar/webdir/notrepo/f/f2 unknown Foo Bar <foo.bar@example.com> *
    astar unknown Foo Bar <foo.bar@example.com> *
    astar/.hg/patches unknown Foo Bar <foo.bar@example.com> *
    $ get-with-headers.py localhost:$HGPORT1 't?style=raw' 200 Script output follows /t/a/ $ get-with-headers.py localhost:$HGPORT1 't/?style=raw' 200 Script output follows /t/a/ $ get-with-headers.py localhost:$HGPORT1 't/?style=paper' 200 Script output follows Mercurial repositories index
    (glob)
    Name Description Contact Last modified    
    a unknown Foo Bar <foo.bar@example.com> *
    $ get-with-headers.py localhost:$HGPORT1 't/a?style=atom' 200 Script output follows http://*:$HGPORT1/t/a/ (glob) (glob) (glob) t/a Changelog 1970-01-01T00:00:01+00:00 [default] a http://*:$HGPORT1/t/a/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab (glob) (glob) test test 1970-01-01T00:00:01+00:00 1970-01-01T00:00:01+00:00
    changeset 8580ff50825a
    branch default
    bookmark
    tag tip
    user test
    description a
    files a
    $ get-with-headers.py localhost:$HGPORT1 't/a/?style=atom' 200 Script output follows http://*:$HGPORT1/t/a/ (glob) (glob) (glob) t/a Changelog 1970-01-01T00:00:01+00:00 [default] a http://*:$HGPORT1/t/a/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab (glob) (glob) test test 1970-01-01T00:00:01+00:00 1970-01-01T00:00:01+00:00
    changeset 8580ff50825a
    branch default
    bookmark
    tag tip
    user test
    description a
    files a
    $ get-with-headers.py localhost:$HGPORT1 't/a/file/tip/a?style=raw' 200 Script output follows a Test [paths] '*' extension $ get-with-headers.py localhost:$HGPORT1 'coll/?style=raw' 200 Script output follows /coll/a/ /coll/a/.hg/patches/ /coll/b/ /coll/c/ /coll/notrepo/e/ /coll/notrepo/f/ $ get-with-headers.py localhost:$HGPORT1 'coll/a/file/tip/a?style=raw' 200 Script output follows a Test [paths] '**' extension $ get-with-headers.py localhost:$HGPORT1 'rcoll/?style=raw' 200 Script output follows /rcoll/a/ /rcoll/a/.hg/patches/ /rcoll/b/ /rcoll/b/d/ /rcoll/c/ /rcoll/notrepo/e/ /rcoll/notrepo/e/e2/ /rcoll/notrepo/f/ /rcoll/notrepo/f/f2/ $ get-with-headers.py localhost:$HGPORT1 'rcoll/b/d/file/tip/d?style=raw' 200 Script output follows d Test collapse = True $ killdaemons.py $ cat >> paths.conf < [web] > collapse=true > descend = true > EOF $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ > -A access-paths.log -E error-paths-3.log $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT1 'coll/?style=raw' 200 Script output follows /coll/a/ /coll/a/.hg/patches/ /coll/b/ /coll/c/ /coll/notrepo/ $ get-with-headers.py localhost:$HGPORT1 'coll/a/file/tip/a?style=raw' 200 Script output follows a $ get-with-headers.py localhost:$HGPORT1 'rcoll/?style=raw' 200 Script output follows /rcoll/a/ /rcoll/a/.hg/patches/ /rcoll/b/ /rcoll/b/d/ /rcoll/c/ /rcoll/notrepo/ $ get-with-headers.py localhost:$HGPORT1 'rcoll/b/d/file/tip/d?style=raw' 200 Script output follows d Test intermediate directories Hide the subrepo parent $ cp $root/notrepo/f/.hg/hgrc $root/notrepo/f/.hg/hgrc.bak $ cat >> $root/notrepo/f/.hg/hgrc << EOF > [web] > hidden = True > EOF $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/?style=raw' 200 Script output follows /rcoll/notrepo/e/ /rcoll/notrepo/e/e2/ Subrepo parent not hidden $ mv $root/notrepo/f/.hg/hgrc.bak $root/notrepo/f/.hg/hgrc $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/?style=raw' 200 Script output follows /rcoll/notrepo/e/ /rcoll/notrepo/e/e2/ /rcoll/notrepo/f/ /rcoll/notrepo/f/f2/ Test repositories inside intermediate directories $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/e/file/tip/e?style=raw' 200 Script output follows e Test subrepositories inside intermediate directories $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/f/f2/file/tip/f2?style=raw' 200 Script output follows f2 Test descend = False $ killdaemons.py $ cat >> paths.conf < descend=false > EOF $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ > -A access-paths.log -E error-paths-4.log $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT1 'coll/?style=raw' 200 Script output follows /coll/a/ /coll/b/ /coll/c/ $ get-with-headers.py localhost:$HGPORT1 'coll/a/file/tip/a?style=raw' 200 Script output follows a $ get-with-headers.py localhost:$HGPORT1 'rcoll/?style=raw' 200 Script output follows /rcoll/a/ /rcoll/b/ /rcoll/c/ $ get-with-headers.py localhost:$HGPORT1 'rcoll/b/d/file/tip/d?style=raw' 200 Script output follows d Test intermediate directories $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/?style=raw' 200 Script output follows /rcoll/notrepo/e/ /rcoll/notrepo/f/ Test repositories inside intermediate directories $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/e/file/tip/e?style=raw' 200 Script output follows e Test subrepositories inside intermediate directories $ get-with-headers.py localhost:$HGPORT1 'rcoll/notrepo/f/f2/file/tip/f2?style=raw' 200 Script output follows f2 Test [paths] '*' in a repo root $ hg id http://localhost:$HGPORT1/astar 8580ff50825a $ killdaemons.py $ cat > paths.conf < [paths] > t/a = $root/a > t/b = $root/b > c = $root/c > EOF $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ > -A access-paths.log -E error-paths-5.log $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows /t/a/ /t/b/ /c/ $ get-with-headers.py localhost:$HGPORT1 't/?style=raw' 200 Script output follows /t/a/ /t/b/ Test collapse = True $ killdaemons.py $ cat >> paths.conf < [web] > collapse=true > EOF $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ > -A access-paths.log -E error-paths-6.log $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows /t/ /c/ $ get-with-headers.py localhost:$HGPORT1 't/?style=raw' 200 Script output follows /t/a/ /t/b/ test descend = False $ killdaemons.py $ cat >> paths.conf < descend=false > EOF $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ > -A access-paths.log -E error-paths-7.log $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows /c/ $ get-with-headers.py localhost:$HGPORT1 't/?style=raw' 200 Script output follows /t/a/ /t/b/ $ killdaemons.py $ cat > paths.conf < [paths] > nostore = $root/nostore > inexistent = $root/inexistent > EOF $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \ > -A access-paths.log -E error-paths-8.log $ cat hg.pid >> $DAEMON_PIDS test inexistent and inaccessible repo should be ignored silently $ get-with-headers.py localhost:$HGPORT1 '' 200 Script output follows Mercurial repositories index test listening address/port specified by web-conf (issue4699): $ killdaemons.py $ cat >> paths.conf < [web] > address = localhost > port = $HGPORT1 > EOF $ hg serve -d --pid-file=hg.pid --web-conf paths.conf \ > -A access-paths.log -E error-paths-9.log listening at http://*:$HGPORT1/ (bound to *$LOCALIP*:$HGPORT1) (glob) (?) $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows test --port option overrides web.port: $ killdaemons.py $ hg serve -p $HGPORT2 -d -v --pid-file=hg.pid --web-conf paths.conf \ > -A access-paths.log -E error-paths-10.log listening at http://*:$HGPORT2/ (bound to *$LOCALIP*:$HGPORT2) (glob) (?) $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT2 '?style=raw' 200 Script output follows $ killdaemons.py $ cat > collections.conf < [collections] > $root=$root > EOF $ hg serve --config web.baseurl=http://hg.example.com:8080/ -p $HGPORT2 -d \ > --pid-file=hg.pid --webdir-conf collections.conf \ > -A access-collections.log -E error-collections.log $ cat hg.pid >> $DAEMON_PIDS collections: should succeed $ get-with-headers.py localhost:$HGPORT2 '?style=raw' 200 Script output follows /a/ /a/.hg/patches/ /b/ /c/ /notrepo/e/ /notrepo/f/ $ get-with-headers.py localhost:$HGPORT2 'a/file/tip/a?style=raw' 200 Script output follows a $ get-with-headers.py localhost:$HGPORT2 'b/file/tip/b?style=raw' 200 Script output follows b $ get-with-headers.py localhost:$HGPORT2 'c/file/tip/c?style=raw' 200 Script output follows c atom-log with basedir / $ get-with-headers.py localhost:$HGPORT2 'a/atom-log' | grep ' rss-log with basedir / $ get-with-headers.py localhost:$HGPORT2 'a/rss-log' | grep 'http://hg.example.com:8080/a/rev/8580ff50825a $ killdaemons.py $ hg serve --config web.baseurl=http://hg.example.com:8080/foo/ -p $HGPORT2 -d \ > --pid-file=hg.pid --webdir-conf collections.conf \ > -A access-collections-2.log -E error-collections-2.log $ cat hg.pid >> $DAEMON_PIDS atom-log with basedir /foo/ $ get-with-headers.py localhost:$HGPORT2 'a/atom-log' | grep ' rss-log with basedir /foo/ $ get-with-headers.py localhost:$HGPORT2 'a/rss-log' | grep 'http://hg.example.com:8080/foo/a/rev/8580ff50825a Path refreshing works as expected $ killdaemons.py $ mkdir $root/refreshtest $ hg init $root/refreshtest/a $ cat > paths.conf << EOF > [paths] > / = $root/refreshtest/* > EOF $ hg serve -p $HGPORT1 -d --pid-file hg.pid --webdir-conf paths.conf $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows /a/ By default refreshing occurs every 20s and a new repo won't be listed immediately. $ hg init $root/refreshtest/b $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows /a/ Restart the server with no refresh interval. New repo should appear immediately. $ killdaemons.py $ cat > paths.conf << EOF > [web] > refreshinterval = -1 > [paths] > / = $root/refreshtest/* > EOF $ hg serve -p $HGPORT1 -d --pid-file hg.pid --webdir-conf paths.conf $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows /a/ /b/ $ hg init $root/refreshtest/c $ get-with-headers.py localhost:$HGPORT1 '?style=raw' 200 Script output follows /a/ /b/ /c/ $ killdaemons.py $ cat > paths.conf << EOF > [paths] > /dir1/a_repo = $root/a > /dir1/a_repo/b_repo = $root/b > /dir1/dir2/index = $root/b > EOF $ hg serve -p $HGPORT1 -d --pid-file hg.pid --webdir-conf paths.conf $ cat hg.pid >> $DAEMON_PIDS $ echo 'index file' > $root/a/index $ hg --cwd $root/a ci -Am 'add index file' adding index $ get-with-headers.py localhost:$HGPORT1 '' | grep 'a_repo' dir1/a_repo dir1/a_repo/b_repo $ get-with-headers.py localhost:$HGPORT1 'index' | grep 'a_repo' dir1/a_repo dir1/a_repo/b_repo $ get-with-headers.py localhost:$HGPORT1 'dir1' | grep 'a_repo' a_repo a_repo/b_repo $ get-with-headers.py localhost:$HGPORT1 'dir1/index' | grep 'a_repo' a_repo a_repo/b_repo $ get-with-headers.py localhost:$HGPORT1 'dir1/a_repo' | grep 'a_repo' dir1/a_repo: log href="/dir1/a_repo/atom-log" title="Atom feed for dir1/a_repo" /> href="/dir1/a_repo/rss-log" title="RSS feed for dir1/a_repo" /> mercurial
  • graph
  • tags
  • bookmarks
  • branches
  • changeset
  • browse
  • help