mercurial-5.3.1/0000755015407300116100000000000013627755445013415 5ustar augieeng00000000000000mercurial-5.3.1/PKG-INFO0000644015407300116100000000246013627755445014514 0ustar augieeng00000000000000Metadata-Version: 1.1 Name: mercurial Version: 5.3.1 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-5.3.1/.arcconfig0000644015407300116100000000031613627755404015344 0ustar augieeng00000000000000{ "conduit_uri": "https://phab.mercurial-scm.org/api", "phabricator.uri": "https://phab.mercurial-scm.org/", "repository.callsign": "HG", "arc.land.onto.default": "@", "base": "hg:.^" } mercurial-5.3.1/hgweb.cgi0000755015407300116100000000125313627755404015174 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-5.3.1/.hgsigs0000644015407300116100000030611013627755407014701 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 7de7bd407251af2bc98e5b809c8598ee95830daf 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlrE4p0QHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91c4UD/4tC+mBWxBw/JYm4vlFTKWLHopLEa1/uhFRK/uGsdgcCyexbCDbisjJpl3JTQb+wQDlZnUorm8zB206y418YqhJ7lCauRgcoqKka0e3kvKnwmklwmuGkwOIoruWxxhCcgRCT4C+jZ/ZE3Kre0CKnUvlASsHtbkqrCqFClEcIlPVohlccmjbpQXN+akB40tkMF5Xf0AMBPYG7UievmeHhz3pO/yex/Uc6RhgWAqD4zjA1bh+3REGs3CaoYgKUTXZw/XYI9cqAI0FobRuXSVbq2dqkXCFLfD+WizxUz55rZA+CP4pqLndwxGm4fLy4gk2iLHxKfrHsAul7n5e4tHmxDcOOa1K0fIJDBijuXoNfXN7nF4NQUlfpmtOxUxfniVohvXJeYV8ecepsDMSFqDtEtbdhsep5QDx85lGLNLQAA1f36swJzLBSqGw688Hjql2c9txK2eVrVxNp+M8tqn9qU/h2/firgu9a2DxQB45M7ISfkutmpizN5TNlEyElH0htHnKG7+AIbRAm4novCXfSzP8eepk0kVwj9QMIx/rw4aeicRdPWBTcDIG0gWELb0skunTQqeZwPPESwimntdmwCxfFksgT0t79ZEDAWWfxNLhJP/HWO2mYG5GUJOzNQ4rj/YXLcye6A4KkhvuZlVCaKAbnm60ivoG082HYuozV4qPOQ== ed5448edcbfa747b9154099e18630e49024fd47b 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlrXnuoQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91fSHEACBVg4FsCE2nN5aEKAQb7l7rG4XTQ9FbvoTYB3tkvmsLQSRfh2GB2ZDBOI7Vswo2UxXupr4qSkUQbeHrwrk9A1s5b/T5e4wSKZuFJOrkwLVZDFfUHumKomqdoVj/D8+LDt7Rz+Wm7OClO/4dTAsl2E4rkl7XPtqjC3jESGad8IBANlPVBhNUMER4eFcPZzq1qi2MrlJKEKpdeZEWJ/ow7gka/aTLqHMfRwhA3kS5X34Yai17kLQZGQdWISWYiM9Zd2b/FSTHZGy8rf9cvjXs3EXfEB5nePveDrFOfmuubVRDplO+/naJjNBqwxeB99jb7Fk3sekPZNW/NqR/w1jvQFA3OP9fS2g1OwfXMWyx6DvBJNfQwppNH3JUvA5PEiorul4GJ2nuubXk+Or1yzoRJtwOGz/GQi2BcsPKaL6niewrInFw18jMVhx/4Jbpu+glaim4EvT/PfJ5KdSwF7pJxsoiqvw7A2C2/DsZRbCeal9GrTulkNf/hgpCJOBK1DqVVq1O5MI/oYQ69HxgMq9Ip1OGJJhse3qjevBJbpNCosCpjb3htlo4go29H8yyGJb09i05WtNW2EQchrTHrlruFr7mKJ5h1mAYket74QQyaGzqwgD5kwSVnIcwHpfb8oiJTwA5R+LtbAQXWC/fFu1g1KEp/4hGOQoRU04+mYuPsrzaA== 1ec874717d8a93b19e0d50628443e0ee5efab3a9 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlraM3wQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91RAJEACSnf/HWwS0/OZaqz4Hfh0UBgkXDmH1IC90Pc/kczf//WuXu5AVnnRHDziOlCYYZAnZ2iKu0EQI6GT2K2garaWkaEhukOnjz4WADVys6DAzJyw5iOXeEpIOlZH6hbYbsW3zVcPjiMPo8cY5tIYEy4E/8RcVly1SDtWxvt/nWYQd2MxObLrpU7bPP6a2Db4Vy8WpGRbZRJmOvDNworld5rB5M/OGgHyMa9hg2Hjn+cLtQSEJY4O92A6h2hix9xpDC7zzfoluD2piDslocTm/gyeln2BJJBAtr+aRoHO9hI0baq5yFRQLO8aqQRJJP8dXgYZIWgSU/9oVGPZoGotJyw24iiB37R/YCisKE+cEUjfVclHTDFCkzmYP2ZMbGaktohJeF7EMau0ZJ8II5F0ja3bj6GrwfpGGY5OOcQrzIYW7nB0msFWTljb34qN3nd7m+hQ5hji3Hp9CFXEbCboVmm46LqwukSDWTmnfcP8knxWbBlJ4xDxySwTtcHAJhnUmKxu7oe3D/0Ttdv7HscI40eeMdr01pLQ0Ee3a4OumQ1hn+oL+o+tlqg8PKT20q528CMHgSJp6aIlU7pEK81b+Zj6B57us4P97qSL6XLNUIfubADCaf/KUDwh1HvKhHXV2aRli1GX1REFsy0ItGZn0yhQxIDJKc/FKsEMBKvlVIHGQFw== 6614cac550aea66d19c601e45efd1b7bd08d7c40 0 iQJVBAABCAA/FiEEOoFVFj0OIKUw/LeGR6Z/+qNGqs4FAlruOCQhHGtidWxsb2NrK21lcmN1cmlhbEByaW5nd29ybGQub3JnAAoJEEemf/qjRqrOENQQAI1ttaffqYucUEyBARP1GDlZMIGDJgNG7smPMU4Sw7YEzB9mcmxnBFlPx/9n973ucEnLJVONBSZq0VWIKJwPp1RMBpAHuGrMlhkMvYIAukg5EBN3YpA1UogHYycwLj2Ye7fNgiN5FIkaodt9++c4d1Lfu658A2pAeg8qUn5uJ77vVcZRp988u9eVDQfubS8P6bB4KZc87VDAUUeXy+AcS9KHGBmdRAabwU4m09VPZ4h8NEj3+YUPnKXBaNK9pXK5pnkmB8uFePayimnw6St6093oylQTVw/tfxGLBImnHw+6KCu2ut9r5PxXEVxVYpranGbS4jYqpzRtpQBxyo/Igu7fqrioR2rGLQL5NcHsoUEdOC7VW+0HgHjXKtRy7agmcFcgjFco47D3hor7Y16lwgm+RV2EWQ/u2M4Bbo1EWj1oxQ/0j5DOM5UeAJ3Jh64gb4sCDqJfADR8NQaxh7QiqYhn69IcjsEfzU/11VuqWXlQgghJhEEP/bojRyM0qee87CKLiTescafIfnRsNQhyhsKqdHU1QAp29cCqh3mzNxJH3PDYg4fjRaGW4PM7K5gmSXFn/Ifeza0cuZ4XLdYZ76Z1BG80pqBpKZy1unGob+RpItlSmO5jQw7OoRuf0q3Id92gawUDDLuQ7Xg3zOVqV8/wJBlHM7ZUz162bnNsO5Hn 9c5ced5276d6e7d54f7c3dadf5247b7ee98ec79c 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlsYGdAQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91S3fEACmrG3S5eAUhnKqkXFe+HZUwmUvLKRhyWDLlWQzEHaJZQCFWxqSM1ag7JtAx3WkWwmWrOZ0+T/w/xMv81h9JAv9RsoszUT/RH4RsnWoc2ddcK93Q/PrNJ29kFjvC8j3LF42WfHEIeNqAki5c3GbprUL86KG7XVYuMvpPI/SeNSz8siPaKjXo6sg6bAupPCyapisTmeRHcCUc5UfeTTq4YQdS9UI0p9Fo8/vcqmnWY6XnQCRYs2U8Y2I2QCJBHBE5p4KrxrFsAdPWMCg0dJT0goSbzpfDjukPHQaAnUKjCtXCwrzA/KY8fDH9hm5tt1FnC6nl6BRpEHRoHqTfE1ag2QktJZTn5+JWpzz85qFDl5ktmxj1gS80jkOUJ2699RykBy7NACu+TtLJdBk+E1TN0pAU+zsrTSGiteuikEBjQP/8i4whUZCFIHLPgVlxrHWwn0/oszj1Q/u86sCxnYTflR2GLZs3fbSGBEKDDrjqwetxMlwi/3Qhf0PN9aAI7S13YnA89tGLGRLTsVsOoKiQoTExQaCUpE5jFYBLVjsTPh2AjPhG3Zaf7R5ZIvW4CbVYORNTMaYhFNnFyczILJLRid+INHLVifNiJuaLiAFD5Izq9Me4H+GpwB5AI7aG1r+01Si2KbqqpdfoK430UeDV+U/MvEU7v0RoeF30M7uVYv+kg== 0b63a6743010dfdbf8a8154186e119949bdaa1cc 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAls7n+0QHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91XVGEAC1aPuUmW9R0QjWUmyY4vMO7AOT4F1sHKrkgNaoG/RCvczuZOCz/fGliEKQ52pkvThrOgOvNfJlIGOu91noLKsYUybO8eeTksCzc7agUjk6/Xsed35D8gNEPuiVTNu379sTQRnOA2T/plQnVCY2PjMzBe6nQ2DJYnggJelCUxuqUsLM76OvMEeNlXvyxZmyAcFT5dfSBYbjAt0kklRRQWgaug3GwLJY/+0tmXhq0tCpAF6myXoVQm/ynSxjR+5+2/+F5nudOQmDnL0zGayOAQU97RLAAxf1L+3DTRfbtxams9ZrGfRzQGcI1d4I4ernfnFYI19kSzMPcW4qI7gQQlTfOzs8X5d2fKiqUFjlgOO42hgM6cQv2Hx3u+bxF00sAvrW8sWRjfMQACuNH3FJoeIubpohN5o1Madv4ayGAZkcyskYRCs9X40gn+Q9gv34uknjaF/mep7BBl08JC9zFqwGaLyCssSsHV7ncekkUZfcWfq4TNNEUZFIu7UtsnZYz0aYrueAKMp+4udTjfKKnSZL2o0n1g11iH9KTQO/dWP7rVbu/OIbLeE+D87oXOWGfDNBRyHLItrM70Vum0HxtFuWc1clj8qzF61Mx0umFfUmdGQcl9DGivmc7TLNzBKG11ElDuDIey6Yxc6nwWiAJ6v1H5bO3WBi/klbT2fWguOo5w== e90130af47ce8dd53a3109aed9d15876b3e7dee8 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAltQ1bUQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91RQVD/9NA5t2mlt7pFc0Sswktc5dI8GaSYxgeknacLkEdkYx9L+mzg77G7TGueeu5duovjdI/vDIzdadGtJJ+zJE5icCqeUFDfNZNZLQ+7StuC8/f+4i/DaCzjHJ4tDYd0x6R5efisLWRKkWoodI1Iit7gCL493gj1HZaIzRLaqYkbOk3PhOEkTcov2cnhb4h54OKm07qlg6PYH507WGmmTDDnhL9SwdfBXHA2ps9dCe52NzPMyebXoZYA9T5Yz67eQ8D+YCh9bLauA59dW0Iyx59yGJ0tmLwVKBgbUkynAknwk/hdNlF7r6wLqbR00NLKmAZl8crdVSqFUU/vAsPQLn3BkbtpzqjmisIq2BWEt/YWYZOHUvJoK81cRcsVpPuAOIQM/rTm9pprTq7RFtuVnCj+QnmWwEPZJcS/7pnnIXte3gQt76ovLuFxr7dq99anEA7gnTbSdADIzgZhJMM8hJcrcgvbI4xz0H1qKn3webTNl/jPgTsNjAPYcmRZcoU2wUIR+OPhZvfwhvreRX0dGUV6gqxWnx3u3dsWE9jcBIGlNfYnIkLXyqBdOL6f4yQoxaVjRg/ScEt3hU17TknuPIDOXE/iMgWnYpnTqKBolt/Vbx7qB1OiK7AmQvXY1bnhtkIfOoIwZ9X1Zi2vmV1Wz4G0a5Vxq5eNKpQgACA2HE0MS2HQ== 33ac6a72308a215e6086fbced347ec10aa963b0a 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlthwaIQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91atOD/0de4nA55WJpiQzAqTg4xWIRZB6y0pkQ8D4cKNQkNiwPQAdDEPf85RuYmoPusNxhM40qfJlmHOw8sbRaqqabhVBPEzL1DpKe4GBucagLZqoL3pycyMzhkhzMka2RJT6nekCchTKJTIs2gx4FOA/QwaFYNkXFfguAEvi01isVdMo0GFLQ7pf7wU8UO1PPdkYphH0xPUvsreQ3pR3+6WwMLovk4JYW4cSaM4YkLlqJQPSO2YAlyXAwiQRvu2A227ydVqHOgLeV5zMQPy2v2zTgl2AoMdWp8+g2lJrYwclkNR+LAk5OlGYamyZwlmsTO7OX3n7xJYtfjbqdoqEKhO1igMi3ZSjqwkaBxxkXxArrteD19bpUyInTjbwTRO3mSe5aNkEDGoOYWn8UOn5ZkeEo7NyhP4OTXqyxQs9rwjD79xZk+6fGB777vuZDUdLZYRQFOPEximpmCGJDrZWj5PeIALWkrRGWBl2eFJ5sl6/pFlUJDjDEstnrsfosp6NJ3VFiD9EunFWsTlV2qXaueh9+TfaSRmGHVuwFCDt7nATVEzTt8l74xsL3xUPS4u9EcNPuEhCRu1zLojCGjemEA29R9tJS8oWd6SwXKryzjo8SyN7yQVSM/yl212IOiOHTQF8vVZuJnailtcWc3D4NoOxntnnv8fnd1nr8M5QSjYQVzSkHw== ede3bf31fe63677fdf5bd8db687977d4e3d792ed 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAluOq84QHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91ao3D/oC9zKNbk+MMUP0cSfl+ESRbP/sAI466IYDkr9f1klooIFMsdqCd16eS36DVwIwrBYapRaNszC6Pg0KCFKCdeAWJLcgeIawwOkZPrLKQmS3I9GTl9gxtExeFvRryaAdP1DAPEU6JkyHo3xmURkJB58VjuBquZz4cYnL2aE1ag04CWAoRFiLu6bt1hEZ8pONU6cbDpHaJVyUZmJRB+llpybgdLnlBTrhfWjNofTh8MM6+vz67lIienYoSbepY+029J98phBTV+UEfWSBWw1hcNT/+QmOBGWWTLfBARsNDZFeYgQQOo3gRghKO7qUA/hqzDTmMG4/a2obs0LGsBlcMZ1Ky//zhdAJ/EN7uH9svM1t1fkw1RgvftmybptK5KiusZ9AWhnggHSwZtj1I6i/sojqsj9MrtdrD+1LfiKuAv/FtcMHSeff8IfItrd2B67JIj4wCzU8vDrAbAAqODHx7AnssvNbYrH2iOigSINFMNJoLU/xLxBhTxitU2Zf8puHA4CQ3+BybgOH9HPqCtGcVAB7bcp4hiezGrachM+2oec2YwcGCpIobMPl43cmWkLhtGF5qfl7APVfbo18UXk8ZGmBY8YAYwEyksk2SBMJV6+XHw9J7uaaugc3uN8PuMVLqvSMpWN1ZdRsSkxrOJK+UNW7kbUi0wHnsV1rN0U0BIfVOQ== 5405cb1a79010ac50c58cd84e6f50c4556bf2a4c 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAluyfokQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91eWpD/0eu/JfD6SfaT4Ozd2767ojNIW4M9BgcRH/FehFBd/3iQ/YQmaMVd6GmdaagM5YUpD9U+rDK95l8rUstuTglXeKD2SVcDM4Oq9ToyZyp5aizWjkxRxHT60W95G5FQO/tBbs63jfNrVDWDElbkpcn/gUG6JbX+q/S/mKd6WsuwNQC1N4VOWp0OWCmFGBWN7t/DqxGLGEajJM0NB97/r/IV6TzrGtaPf1CXaepDVvZwIIeas/eQgGInyqry7WBSn5sCUq4opIh1UigMABUAgzIZbgTg8NLGSmEgRgk0Vb4K+pLejLLDb5YD7ZwuUCkbd8oJImKQfU6++Ajd70TbNQRvVhMtd15iCtOOjLR+VNkUiDXm0g1U53sREMLdj/+SMJZB6Z18DotdgpaeCmwA/wWijXOdt76xwUKjByioxyQilPrzrWGaoSG4ynjiD2Y+eSRS1DxbpDgt4YEuiVA6U3ay99oW7KkhFjQsUtKl4SJ5SQWiEofvgtb2maNrXkPtKOtNRHhc61v73zYnsxtl2qduC99YOTin90FykD80XvgJZfyow/LICb77MNGwYBsJJMDQ3jG1YyUC2CQsb8wyrWM4TO3tspKAQPyMegUaVtBqw7ZhgiC3OXEes+z+AL5YRSZXALfurXPYbja8M8uGL2TYB3/5bKYvBXxvfmSGIeY6VieQ== 956ec6f1320df26f3133ec40f3de866ea0695fd7 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlvOG20QHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91eZ+EACb/XfPWaMkwIX54JaFWtL/nVkDcaL8xLVzlI+PxL0ZtHdQTGVQNp5f1BnZU9RKPZ9QOuz+QKNvb4hOOXBwmCi2AAjmTYUqtKThHmOT50ZRICkllY+YlZ3tI6JXRDhh7pSXaus8jBFG/VwuUlVmK5sA2TP+lIJijOgV9rThszfS4Q2I8sBTIaeZS1hyujFxGRO++tjYR+jPuo/98FhqJ5EylVYvKmnflWkOYLFNFqgDI6DQs7Dl+u2nrNAzZJQlgk+1ekd66T3WyK8U3tcFLZGRQ+gpzINH0Syn6USaaE+0nGi4we1hJS8JK0txWyHXJGNZYaWQAC2l1hIBfA38azwVLSe2w9JatXhS3HWByILy8JkEQ2kSo1xTD4mBkszZo/kWZpZRsAWydxCnzhNgKmTJYxASFTTX1mpdX4EzJBOs/++52y1OjVc0Ko0+6vSwxsC6zgIGJx1Os7vVgWHql0XbDmJ1NDdNmz7q5HjFcbNOWScKf6UGcBKV4dpW1w+7CvdoMFHUsVTa2zn6YOki3NEt0GWLXq+0aXbHSw8XETcyunQKjDi9ddKOw0rYGip6EKUKhOILZimQ0lgYRE23RDdT5Tl2D8s66SUuipgP9vGjbMaE/FhO3OAb7406jyCrOVfDis7sK0Hvw074GhIfZUjA4W4Ey2TeExCZHHhBdoPTrg== a91a2837150bdcb27ae76b3646e6c93cd6a15904 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlvclPMQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91fc0EADF/62jqCARFaQRRcKpobPNBZupwSbnQ7E296ZRwHdZvT8CVGfkWBUIStyh+r8bfmBzzea6d9/SUoRqCoV9rwCXuRbeCZZRMMkqx9IblV3foaIOxyQi0KE2lpzGJAHxPiNxD3czZV4B+P6X2wNmG9OLjmHyQ7o64GvPAJ+Ko/EsND1tkx4qB16mEuEHVxtfaG6hbjgpLekIA3+3xur3E8cWBsNO28HtQBK83r2qURwv6eG3TfkbmiE+Ie5TNC15LPVhAOHVSD7miZdI82uk2063puCKZxIJXsy7EMjHfChTM9c7B4+TdEBjms3y+Byz2EV7kRfjplGOnBbYvfY7qiteTn/22+rLrTTQNkndDN/Sqr1DjwsvxKDeIfsqgXzGQPupLOrGdGf4ILAtA0Reme7VKNN5Px6dNxnjKKwsnSrKTQ7ZcmD+W1LKlL63lBEQvEy+TLmmFLfM2xvvBxL5177AKZrj/8gMUzEi1K2MelDGrasA7OSjTlABoleDvZzVOf1nC0Bv83tFc8FeMHLwNOxkFSsjORvZuIH/G9BYUTAd96iLwQRBxXLOVNitxAOQT+s3hs7JEaUzTHlAY+lNeFAxUujb4H0V40Xgr20O1u7PJ53tzApIrg9JQPgvUXntmRs8fpNo6f3P6Sg8XtaCCHIUAB6qTHiose56llf6bzl66A== 1c8c54cf97256f4468da2eb4dbee24f7f3888e71 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlwG+eIQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91YqSD/9IAwdaPrOeiT+DVBW2x33oFeY1X1f5CBG/vCJptalOd2QDIsD0ANEzQHmzV25RKD851v155Txt/BPlkuBfO/kg0BbOoqTpGZk+5CcoFWeyhJct2CxtCLdEpyZ/98/htMR4VfWprCX2GHXPjS813l9pebsN3WgBUOc2VaUdHNRoAGsMVgWC5BWwNP4XSA9oixFL/O4aGLQ6pPfP3vmMFySWXWnIN8gUZ4sm53eKaT0QCICAgzFh+GzRd81uACDfoJn1d8RS9GK+h6j8x0crLY5CpQQy8lRVkokvc0h6XK44ofc57p9GHAOfprHY3DbBhD9H6fLAf5raUsqPkLRYVGqhg8bOsBr3vJ56hiXJYOYPZSYXGjnHRcUrgfPVrY+6mPTeCIQMPmWBHwYH5Tc5TLrPuxxCL4wVywqGbfmIVP+WFUikkykAAwuPOZAswxJJOB0gsnnxcApmTeXRznBXyvzscMlWVZiMjzflKRRJ9V5RI4Fdc6n1wQ4vuLSO4AUnIypIsV6ZFAOBuFKH7x6nPG0tP3FYzcICaMOPbxEx3LStnuU+UuEs6TIxM6IiR3LPiiDGZ2BA2gjJhDxQFV8hAl8KDO3LsYuyUQCv3RTAP+YejH21bIXdnwDlNqy8Hrd53rq7jZsdb2pMVvOZZ3VmIu64f+jVkD/r5msDUkQL3M9jwg== 197f092b2cd9691e2a55d198f717b231af9be6f9 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlwz6DUQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91SbtD/47TJkSFuDJrvrpLuZROeR48opM8kPtMdbFKZxmeUtap/1q1ahBcA8cnkf5t5iEna57OkPfx0FVw7zupFZSD970q8KeQa1C1oRf+DV83rkOqMEzTLmDYZ5YWWILyDb2NrSkBzArhLNhEtWrFFo9uoigwJWiyNGXUkjVd7XUaYvxVYvnHJcmr98l9sW+RxgV2Cm/6ImeW6BkSUjfrJpZlHUecxcHIaDVniSCVzVF7T+tgG0+CxpehmRrPE/qlPTY2DVHuG6ogwjmu7pWr4kW3M6pTmOYICKjkojIhPTAfNDZGNYruJMukEeB2JyxSz+J9jhjPe//9x4JznpCzm/JzCHFO9CfONjHIcUqLa9qxqhmBFpr1U5J7vRir4ch7v8TGtGbcR3833HTUA7EEMu/Ca48XVfGNDmySQs8zgGpj1yzf/lBGbiAzTSp7Zp+ANLu+R3NjeiDUYQbgf3vcpoHL44duk4dzhD+ofFD75PF1SMTluWbeLCSENH9io2pxVDj3I5VhlNxHdbqY1WXb+sDBVr4niIGzQiKqVOV33ghyRpzVJFZ7SaQG7VR/mLL3UnvJuapLYtUV9+/7Si/CHl7m8NntPMvx1nM/Z4t/BN8Z5cdhPn2PLxp9f5VCmCqLlCQDSv94cCTLlatiCTfF7axgE0u7+CWiOUNyyqg/vu0pjTwIA== 593718ff5844cad7a27ee3eb5adad89ac8550949 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlxCG6EQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91YptD/9DG76IvubjzVsfX1UiQcV1mqWuSgz/idpeFCrc6Z1dyFB5UmbHKfAaZnrPBR7ly6bGD9+NZupB9A8QRxX92koiq0Hw2ywbwR5oWVrBaDiinIDLiTQTUCPnNMH0FSNrt4Kf9Gj4RqMufZvL+dR0pDYV0n6HP3aGOeTnowNhv0lUbw/Gx20YrcCU9uf3GbgRvMQiFNv9cTJAdQlH++98C8MVLfRU4ZxP11hI7sR8mp1q6ruJoozd0Cta67E6MyC/L2Rp3W89psvvY7DSTg9RwQwoS8I6U9iyQJ16Bb6UgZVV6jqQqOSxWUaPfKUhJLl2ENHH5f3rzoi3NH6jHuy5rq2v9XuvOpQ7LqSi1Ev0oq1xllZiyD4Zm69Z/Is0mxwqPskZGWR5Lh6Uq3Dh0zJW7O5M2m1IHdAYqffHpUr2NgEQVST4VDvO4fR2d7n6+ZNXYbZrpmQ1j4bpOZCEMqWXPfl4HY7a60hWa884mWxtVLGvhYycxnN8r1o5ouS0pAMAI6qEFFW1XFFN4eNDDWl83BkuDa32DTEthoyi15JM5jS7VPDYACdHE3IVqsTsZq7nn60uoFCGpdMcSqrD2mlUd9Z12x8NnCIrxKhlHLkq89OrQAcz8/0bbluGuzm3FHKb+8VQWr0MgkvOLTqqvOqn97oBdKqo0eyT0IPz8QeVYPbZfQ== 83377b4b4ae0e9a6b8e579f7b0a693b8cf5c3b10 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlxUk3gQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91aT7EACaycWeal53ShxaNyTNOa5IPZ71+iyWA9xEh7hK6cDDirpItarWLRVWoWqBlWRBBs6uU4BxnpPSCLFkJLu6ts/5p4R6/0Z04Pasd6sFi14bCGslmPJFlwrpfFDpQvFR6xZAtv1xGb8n+rjpK+wfstjRgyf84zn4//0dOdylY5EUXOk4/3zcXKAzPgZHBRper+PlQ0ICgYHiKQUlyDWrFrdSEis6OqBa+PbxdmgzLYbhXi0bvS5XRWM9EVJZa+5ITEVOEGPClRcoA7SJE5DiapMYlwNnB3U6TEazJoj5yuvGhrJzj9lx7/jx9tzZ/mhdOVsSRiSCBu46B/E63fnUDqaMw8KKlFKBRuzKnqnByZD8fuD34YJ6A82hta56W4SJ4pusa/X2nAJn1QbRjESY4wN4FEaNdYiMbpgbG2uBDhmEowAyhXtiuQAPCUra5o42a+E+tAgV5uNUAal8vk0DcPRmzc4UntQiQGwxL0fsTEpMQtG5ryxWRmOIBq6aKGuLVELllPCwOh8UIGLlpAoEynlNi9qJNT6kHpSmwquiU6TG6R1dA/ckBK2H90hewtb/jwLlenGugpylLQ2U/NsDdoWRyHNrdB4eUJiWD/BBPXktZQJVja97Js+Vn44ctCkNjui/53xcBQfIYdHGLttIEq56v/yZiSviCcTUhBPRSEdoUg== 4ea21df312ec7159c5b3633096b6ecf68750b0dd 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlyQ7VYQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91aziD/4uI/Nr+UJgOri1zfa6ObXuMVO2FeadAolKemMDE/c4ddPUN2AwysZyJaOHmqj5VR0nf4a9CpTBc8Ciq9tfaFSWN6XFIJ2s3GPHhsnyhsPbF56c2bpl2W/csxor9eDGpv9TrQOK0qgI4wGxSQVFW0uUgHtZ5Yd6JWupHuyDfWopJf3oonissKI9ykRLeZEQ3sPIP6vTWMM3pdavAmDii3qKVEaCEGWmXgnM/vfBJ/tA1U5LSXpxwkJB7Pi/6Xc6OnGHWmCpsA4L6TSRkoyho4a6tLUA1Qlqm6sMxJjXAer8dmDLpmXL7gF3JhZgkiX74i2zDZnM4i42E6EhO52l3uorF5gtsw85dY20MSoBOmn5bM7k40TCA+vriNZJgmDrTYgY3B00mNysioEuSpDkILPJIV4U9LTazsxR49h3/mH2D1Sdxu6YtCIPE8ggThmveW/dZQy6W1xLfS66pFmDvq8ND0WjDa/Fi9dmjMcQtzA9CZL8AMlSc2aLJs++KjCuN+t6tn/tLhLz1nHaSitqgsIoJmBWb00QjOilnAQq7H8gUpUqMdLyEeL2B9HfJobQx6A8Op2xohjI7qD5gLGAxh+QMmuUmf7wx1h2UuQvrNW5di7S3k3nxfhm87Gkth3j0M/aMy0P6irPOKcKns55r6eOzItC+ezQayXc4A10F+x6Ew== 4a8d9ed864754837a185a642170cde24392f9abf 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAly3aLkQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91bpXD/0Qdx3lNv6230rl369PnGM7o56BFywJtGtQ0FjBj81/Q6IKNJkAus/FXA02MevAxnKhyCMPHbiWQn4cn+Fpt9Y7FOFl3MTdoY5v4rGDAbAaJsjyK3BNqSwWD1uFaOnFDzA/112MJ6nDciVaOzeD7qakMj8zdVhvyEfFszN7f7xT1JyGc+cOWfbvcIv/IXWZNrSZC0EzcZspfwxYQwFscgDL3AHeKeYqihJ6vgWxgEg4V8ZnJ6roJeERTp2wwvIj/pKSEpgzfLQfHiEwvH9MKMaJHGx4huzWJxYX2DB83LaK7cgkKqzyQ+z8rsb27oFPMVgb1Kg78+6sRujFdkahFWYYGPT6sFBDWkRQ/J7DRnBzHH2wbBoyNkApmLEfaRGJpxX8wojPFGJkNr6GF12uF7E+djsuE8ZL7l4p2YD33NBSzcEjNTlgruRauj/7SoSC3BgDlrqCypCkNgn5nDDjvf6oJx16qGqZsglHJOl0S2LRiGaMQTpBhpDWAyVIAQBRW/vF1IRnNJaQ+dX7M9VqlVsXnfh8WD+FPKDgpiSLO8hIuvlYlcrtU9rXyWu1njKvCs744G836k4SNBoi+y6bi6XbmU0Uv0GSCLyj1BIsqglfXuac0QHlz5RNmS6LVf7z13ZIn/ePXehYoKHu+PNDmbVGGwAVoZP4HLEqonD3SVpVcQ== 07e479ef7c9639be0029f00e6a722b96dcc05fee 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlzJ5QYQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91U0QD/4xQ00Suo+XNM/2v01NEALJA8pFxSaUcz1fBVQDwIQbApAHbjVDgIShuFlAXu7Jf582+C5wJu0J8L5Rb+Q9WJuM9sM+6cxUWclT3D3gB326LuQg86y5MYbzmwsSCOnBdRn/MY18on2XTa8t4Mxf0jAaHPUXEadmuwkOw4ds62eUD81lkakGoxgXrD1GUhAlGItNPOb0rp2XFj7i+LvazMX2mWOEXMXA5KPQrOvLsKnoESiPfONXumBfZNVSxVA7fJ3Vl1+PldBax+w9LQMgVGo+BkqPt7i+lPTcnlh2Nbf8y3zERTcItFBzrBxmuG6pINfNpZY/fi+9VL7mpMYlzlxs7VcLF8bVnpYpxpHfDR4hPjP0sq6+/nSSGUfzQXmfGHq0ZdoVGSzrDEv8UzYE9ehWUhHNE+sIU3MpwjC+WiW2YhYzPYN2KOlfSog3LuWLAcn3ZghWg1S4crsPt9CeE0vKxkNWNz9dzvhbniW7VGorXJKFCJzMu6pGaP/UjwpHxR+C6J1MGUW2TQwdIUyhPA8HfHJSVbifFJV+1CYEDcqRcFETpxm4YNrLJNL/Ns7zoWmdmEUXT1NEnK1r3Pe2Xi1o56FHGPffOWASmqFnF/coZCq6b4vmBWK/n8mI/JF1yxltfwacaY+1pEor92ztK34Lme1A+R7zyObGYNDcWiGZgA== c3484ddbdb9621256d597ed86b90d229c59c2af9 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlz3zjsQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91XWVEACnlQCHCF7dMrvTHwE4nA+i/I1l8UfRwR3ufXhBxjVUqxS75mHMcCsOwClAa2HaqNP97IGbk2fi9y53SOKH67imNVm8NY8yIook1C8T7nKsFmyM3l63FdVQDgUF6AJ0krDt6iJo4vjk8CyRHowAcmL942jcfBU9U5/Jli11Sx33MKF/eMXnuXYRBNESh97f1bDgwydp7QT8dj/T23YvuIVtfq9h8D46qXWkpwbgtnXMnaz21kqcN6A5aKbadG4ELf9175cBlfe+ZpOqpy+OSuQBByOP5eBNl5d0vq/i4WQyJZs8GoVd5Bh559+HjKIKv11Y+gXoaQMf4VSp2JZwwPlTR5Me5N6AJNViXW1Bm108ZWeXR81Hu2+t2eQv6EelcQxnW0e/mTCUot8TaewYFJ+4VWwAAca81FP0X8J0YcdIkvvNmrU9V62B3WYK3iYgbwm7IlR3+7ilQUz3NZCZOqJpo+c7k/yhuoj4ZMDq8JzaqBnBnARbvUF61B4iVhto4xpruUQw8FwFLUuZLohsESCNCCgqdoiyJHnVQVitoNJlCeEPl+W+UUeFfwf9fzrS6nj9xWkNm9lBOahaH+fV69msi5Ex/gy8y4H+4T8z0f3gFO7kp9eKr5C7hoGyKQWv5D61H1qEZOFUZjXHBhMxbe+og40G0apMm3qmsj2KsCNDdQ== 97ada9b8d51bef24c5cb4cdca4243f0db694ab6e 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAl0kn6UQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91RwND/9uZ3Avf0jXYzGT5t+HhlAeWeqA3wrQOmk0if7ttUholoHYmCbc7V9ufgiQ1jTX/58EhOXHt4L1zlLDf2OMJ7YQz9pfiGjW3vLvVKU7eeQ5epG8J8Hp4BcbEU5gfQBwzZmRMqVfZ9QbNgENysfQxhVT0ONPC5TBUsamAysRQVVPeEQFlW1mSf03LYF1UDjXgquHoIFnnPCZyNUGVRSajW9mDe0OQI95lXE6lISlBkeoTmVs9mR+OeLO3+Dgn2ai8d4gHxdCSU5iDnifSp4aaThfNxueSRFzNI1Q6R6MQrIplqFYZGhAOOXQzZWqThQld6/58IvaBP4aCGs1VxE/qBKNp8txm1QeL/ukOWPgVS9z7Iw5uRuET95aEn/Khisv78lrVGOD5wigt2bb4UiysIgk8+du7HNMqPmS31fCS1vsoJ+y2XoJP2q8bNDiwuVihDWJDlF091HH2+ItmopHGUGeHaxNyRoiSvE7fCBi/u3rleiMsMai8r1QDgBpalUPbaLzBelEKhn2JcDhU5NrG8a+SKRCzpmXkkFPhxrzT1dvEAnoNI0LbmekTDWilp0sZbwdsn2rO51IJ4PU8CgbYROP8Z4DuNMfVyVIpxAEb2zbnIA4YqJ3qcQ3e+qEIw8h9m/ot9YYJ/wCQjIIXN6CUHXLYO30HubNOEDVS4Gem93Gcw== e386b5f4f8360dbb43a576dd9b1368e386fefa5b 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAl01+7cQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91ZM6D/9iWw0AyhcDFI7nEVcSlqDNABQvCnHoNB79UYrTf3GOjuUiyVUTwZ4CIOS+o2wchZXBRWx+T3aHJ1x6qTpXvA3oa9bgerNWFfmVmTuWWMlbQszXS5Lpv5u1lwCoLPDi4sa/gKBSIzt/CMu7zuPzO2yLEnWvR6ljOzjY9LfUx80u1zc899MEEsNuVStkfw9f37lAu+udMRgvQDZeLh+j3Qg5uh3GV3/8Q/I/YFNRHeKSLBkdp5CD3CkUtteBuZfIje/BwttxHG6MdbXMjOe0QmGMNzcSstnVqsENhEa0ZKLxM6NxfwcsxbeKA1uFoTvzT1sFyXXS3NV0noMQBwMrxipzKv4WrjuctmUms6n+VW/w4GMg8gzeUvu7rzqVIehWIBTxV8yWwkWiS9ge6Upiki5vCG+aeMLrwsNqsptOh4BEcsvcpd2ZZtUDRHYFVUK4z/RRlpKb6CdzkGeMWwP6oWAv4N0veD73Y7wPz76ZFNU2yvqViRPxrU2A2P44R8dLFvEOmcO5MHVNwHP0kpaj9dpGwBI0t2A32vDF8LEsnd86LQBm6X5ZWWJ5hGmtZotp4blkH1oFKt+ZeccHcwueIMU3v9e02ElhM4Mo2nD3yyQvMkzDqp5lZEfNqEK8rlj2TNfc8XyjAsp1hKpnjDa1olKKfdq8OniUpsaYDTku4+vuGw== e91930d712e8507d1bc1b2dffd96c83edc4cbed3 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAl1DD/sQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91bvmD/4/QDZZGVe+WiMUxbT+grfFjwjX4nkg7Vt+6vQbjN68NC5XpSiCzW8uu0LRemX0KJKoOfQxqHk3YKkZZHIk10Fe6RSLWt8dqlfa2J9B2U8DwMEBykCOuxcLlDe7DGaaMXlXXRhNXebRheNPLeNe+r7beMAAjwchTIIJD5xcFnPRFR0nN7Vj7eRUdWIQ9H/s7TolPz1Mf7IWqapLjPtofiwSgtRoXfIAkuuabnE4eMVJ8rsLwcuMhxWP2zjEfEg68YkiGBAFmlnRk+3lJpiB9kVapB3cWcsWv2OBhz0D3NgGp82eWkjJCZZhZ+zHHrQ6L9zbiArzW9NVvPEAKLbl3XUhFUzFTUD+S38wsYLYL5RkzhlCI2/K1LJLOtj7r0Seen0v8X842p0cXmxTg/o1Vg3JOm04l9AwzCsnqwIqV7Ru//KPqH91MFFH6T6tbfjtLHRmjxRjMZmVt7ZQjS84opVCZwgUTZZJB2kd1goROjdowQVK6qsEonlzGjWb9zc3el5L9uzDeim3e5t2GNRVt8veQaLc+U2hHWniVsDJMvqp2Hr9IWUKp+bu/35B1nElvooS40gj2WhkfkCbbXSg9qnVLwGxxcGdF28Z0nhQcfKiJAc+8l9l19GNhdKxOi4zUXlp90opPWfT7wGQmysvTjQeFL2zX9ziuHUZZwlW1YbeMQ== a4e32fd539ab41489a51b2aa88bda9a73b839562 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAl1xTxUQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91ZQgD/96mViQ6fEh84l4XyAlY6Dq3SgMqEXttsUpk/GPoW4ykDFKN6VoiOaPoyNODO/46V3yeAjYjy3vX7Ua4/MY1NlnNoliQcTYtRV3SlDdoueTPOLfO6YSV27LG+dX/HYvPc/htCVmIVItU1JL+KEpXnv+bT50Bk+m6OgzfJMDzdHQ5ICImT8gW7UXlH/mlNtWMOrJDk3cArGhGs/pTFVrfgRTfDfDGSA9xW0/QvsNI5iwZHgMYaqoPFDnw6d/NXWRlk77KNiXkBEOKHf6UEWecMKmiSCm8RePSiX9ezqdcBAHygOg4KUeiR2kPNl4QJtskyG4CwWxlmGlfgKx07s7rGafE+DWLEYC9Wa8qK6/LPiowm17m/UlAYxdFXaBCiN0wgEw7oNmjcx/791ez+CL1+h6pd0+iSVI4bO9/YZ8LPROYef18MFm+IFIDIOgZU4eUbpBrzBb3IM1a519xgnmWXAjtRtGWEZMuHaSoLJf2pDXvaUPX6YpJeqCBFO3q/swbiJsQsy6xRW0Dwtn7umU1PGdmMoTnskTRKy9Kgzv7lf/nsUuRbzzM4ut9m1TOo27AulObMrmQB4YvLi/LEnYaRNx18yaqOceMxb/mS0tHLgcZToy9rTV+vtC21vgwfzGia2neLLe50tnIsBPP/AdTOw9ZDMRfXMCajWM22hPxvnGcw== 181e52f2b62f4768aa0d988936c929dc7c4a41a0 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAl2UzlMQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91SDzD/0YZqtN+LK5AusJjWaTa61DRIPhJQoZD+HKg4kAzjL8zw8SxBGLxMZkGmve9QFMNzqIr5kkPk6yEKrEWYqyPtpwrv5Xh5D4d8AKfphdzwSr+BvMk4fBEvwnBhrUJtKDEiuYQdbh4+OQfQs1c3xhtinjXn30160uzFvLQY6/h4hxai2XWj4trgoNXqPHDHlQKc6kRfPpmNO2UZhG+2Xfsava2JpcP4xA2R0XkI10be5MDoGU4AFCMUcXZzIto0DYT+HOezowoNpdC1EWVHfa+bdrlzHHO7WPaTLzEPy44/IhXmNhbwFKOk5RZ/qBADQvs9BDfmIDczOoZKTC5+ESZM0PR2np5t7+JFMUeeRcINqBdSc4Aszw3iHjgNbJJ3viU72JZvGGGd9MglP590tA0proVGxQgvXDq3mtq3Se5yOLAjmRnktW5Tnt8/Z3ycuZz+QsTEMXR5uIZvgz63ibfsCGTXFYUz9h7McGgmhfKWvQw9+MH6kRbE9U8qaUumgf4zi4HNzmf8AyaMJo07DIMwWVgjlVUdWUlN/Eg61fU3wC79mV8mLVsi5/TZ986obz4csoYSYXyyez5ScRji+znSw8vUx0YhoiOQbDms/y2QZR/toyon554tHkDZsya2lhpwXs8T0IFZhERXsmz/XmT3fWnhSzyrUe6VjBMep1zn6lvQ== 59338f9561099de77c684c00f76507f11e46ebe8 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAl2ty1MQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91XBUD/wJqwW0cuMCUvuUODLIfWa7ZxNl1mV9eW3tFQEuLGry97s12KDwBe0Erdjj7DASl4/6Xpc4PYxelZwSw4xT1UQg7wd/C3daCq/cDXrAkl7ZNTAHu6iAnHh25mOpIBfhMbh4j3YD0A2OoI17QGScU6S7Uv0Gz1CY20lJmEqsMzuuDPm2zrdPnTWffRUuPgskAg3czaw45Na7nUBeaxN1On0O5WqMYZsCGyi14g5S0Z0LHMKRJzc/s48JUTDjTbbzJ6HBxrxWTW2v8gN2J6QDYykcLBB9kV6laal9jhWs9n/w0yWwHfBfJ+E4EiMXeRdZgGA55OCOuDxnmmONs1/Z0WwPo+vQlowEnjDMT0jPrPePZ5P4BDXZD3tGsmdXDHM7j+VfDyPh1FBFpcaej44t84X1OWtAnLZ3VMPLwobz9MOzz4wr9UuHq23hus0Fen+FJYOAlTx9qPAqBrCTpGl+h1DMKD62D7lF8Z1CxTlqg9PPBB7IZNCXoN7FZ4Wfhv1AarMVNNUgBx6m0r6OScCXrluuFklYDSIZrfgiwosXxsHW27RjxktrV4O+J1GT/chLBJFViTZg/gX/9UC3eLkzp1t6gC6T9SQ+lq0/I+1/rHQkxNaywLycBPOG1yb/59mibEwB9+Mu9anRYKFNHEktNoEmyw5G9UoZhD+1tHt4tkJCwA== ca3dca416f8d5863ca6f5a4a6a6bb835dcd5feeb 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAl3BrQ4QHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91ZXjEACfBdZczf0a4bmeaaxRwxXAniSS4rVkF790g22fsvSZFvQEpmwqNtsvbTt3N1V2QSDSZyhBa+/qfpuZ689VXMlR3rcJOVjo/7193QLXHOPfRn7sDeeCxjsbtXXLbLa8UT56gtT5gUa4i0LC2kHBEi+UhV9EGgSaDTBxWUFJ9RY2sosy1XFiOUlkUoHUbqUF28J3/CxEXzULWkqTOPwh94JYsgXSSS69WNZEfsuEBSPCzn8Gd7z7lWudZ/VTZBTpTji7HQxpFtSZxNzpwmcmVOH9HlEKoA1K4JoR+1TMHqSytQXlz3FMF6c6Z1G+OPpwTGCjGTkB9ZAusP3gU8KIZTTEXthiEluRtnRq1yu4K2LTyY172JPJvANAWpVEvBvn4k5c9tDOEt9RCAPqCrgNGzDTrw02+gZyyNkjcS6hPn+cDJ6OQ1j2eCQtHlqfHLSc7FsRjUSTiKSEUTdWvHbNfOYe6Yth/tnQ7TnpnS9S0eiugFzZs2f8P85Gfa3uTFQIDm67Ud+8Yu1uOxa6bhECLaXEACnLofzz8sioLsJMiOoG2HmwhyPyfZUHXlb2zdsSP3LC+gKN39VvzSxhhjrIUJoM4ulP0GP1/lkMVzOady66iLaEwDvEn4FLmu395SubHwbre1Jx83hiCQpZfPkI0PhKnh4yVm+BRGUpX97rMTGjzw== a50fecefa691c9b72a99e49aa6fe9dd13943c2bf 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAl3pEYIQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91duiD/9fwJbyrXXdpoBCeW3pgiz/xKZRQq0N3UqC/5m3PGl2qPfDqTi1GA6J+O24Cpy/FXYLEKlrEG2jy/iBZnGgTpb2sgycHFlWCT7VbuS8SDE3FFloTE8ZOGy5eJRo1UXYu4vsvNtmarN1xJQPrVK4l/Co5XWXFx15H/oMXLaHzS0kzQ/rHsMr7UXM0QwtmLC0S9IMetg5EUQx9GtHHaRnh1PIyP5NxP9VQ9RK4hmT6F2g60bcsMfpgF0I/RgL3tcdUn1RNIZ2OXHBhKYL+xOUe+wadDPIyPDqLXNEqPH7xqi0MQm/jOG++AvUPM7AdVc9Y2eRFOIIBIY0nkU5LL4yVVdqoc8kgwz14xhJXGTpMDRD54F6WrQtxhbHcb+JF7QDe3i9wI1LvurW4IIA5e4DC1q9yKKxNx9cDUOMF5q9ehiW9V120LTXJnYOUwfB7D4bIhe2mpOw8yYABU3gZ0Q6iVBTH+9rZYZ9TETX6vkf/DnJXteo39OhKrZ1Z4Gj6MSAjPJLARnYGnRMgvsyHSbV0TsGA4tdEaBs3dZmUV7maxLbs70sO6r9WwUY37TcYYHGdRplD9AreDLcxvjXA73Iluoy9WBGxRWF8wftQjaE9XR4KkDFrAoqqYZwN2AwHiTjVD1lQx+xvxZeEQ3ZBDprH3Uy6TwqUo5jbvHgR2+HqaZlTg== b4c82b70418022e67cc0e69b1aa3c3aa43aa1d29 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAl4TkWgQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91aV6D/4xzlluOwsBhLXWUi7bDp4HtYnyDhq4XuDORAMO5mCZ7I7J6uqGoViqH4AhXoo3yPp1cDiRzzl172xpec38uTL8C5zHhARKuAl5Pn1A8rYORvYzT9nsDh4MAtfTokhg81awRzhun9xtPUT2nETAOgampW0g7r241MSR1j0myAkC7zqO3yf+1rYo7kiv7fh+74MkrSn4HEmEaLsI5gW05tFR+ip6vpm6eikFinqeVJegDCuyTPMvH0D9ZeBNlyoOfdEd6DDYsWvWAmLSO9FGbb03R5aOFRp7RmQRFH/qcueeePa/9Z1zO+YyCeBy0wvWCkjfLMY99HhNhdNfy/qC/69V5RGQYvaapy6BEAi4eCH73hsxzCQpKopUl9VrpwhNasJ41KWc90RsPO91bkTdDddF7e2qjq762aNgm7ysEzIHMgSsMgsE9w8hz70RE7bk/gYn26ak3XP4nCOY0OJQ8mgaElN/FP1kxqqT7MM7WeMiNMFTD1gvWwEAu9Y47AwUedkTrykQsAFzc+CyaIaW+/Kuyv0j5E7v8zAcVTTX4xIyqR4yL2Nwe1rYE4MZgs0L9gQ3rcdyft6899gAiiq96MPR3gLJUPbBz2azH/e0CzNXvDJa39jIm2ez0qC7c88NhTKhFjHE9EW5GI3g8mhS5dJXCnUSq4spgtrJdfGenL3vLw== 84a0102c05c7852c8215ef6cf21d809927586b69 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAl4nP/4QHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91VaHD/93dVKKFMJtclNMIG2AK3yZjfQ3HaqIuK1CqOuZyVQmk5fbnLydbi5RjIQMkaYPSKjDz0OKlfzDYo6kQrZrZUzIxzPBOz8/NMRSHGAWqvzQMbQGjYILsqDQ+wbol9wk8IDoyFzIcB4gPED1U5kWVCBTEqRrYiGP4siiycXVO5334Q5zOrvcjze0ksufbKQhL6SEUovfLtpX+DW6Z841LmR53aquEH8iBGswHKRt4ukyvmXTQAgea4lWXZXj3DH6oZqe0yzg5ogF4vFaoIgZDpBh2LZKuh6gwJtvA9jsFj5HVOzYDcllkgpaOTV1g/xKPo1EkLpt0W0vd/4vnjSKNo0fmOTvZzI9vCCXLlRSUhoboY6AFHN7XtL9gYWI0rj81p/WrnnQQ7Iv2YHS1KCLr765HW6mjREwFMLD9RrLLDQ0DWIyNuGq8/yrqoruAhidEE9ifITnNh38wVISdiPxORj3onZkAn7VbOWQnlJtYkynlk2t3HnHWfduLGc2G0BkLvg4YfEDsZBA+ssr+TspkZ1dVAq8kf4JKNR01sfjBF6Fj1zRPkoexV40/pPiW55ikfOI9LRHxRiOUyndLviIBv1Mbm90PZ89lT4OTMejD8hhb4omlVxH3HFv4j7TozuPFOuouH7ARRwbPFl/0ldPlESoGvFiyOrqNzlql+JvyLUSbg== e4344e463c0c888a2f437b78b5982ecdf3f6650a 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAl4rFTIQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91eStD/wNSk7/07dvzItYmxg9LuUInYH17pZrXm8+jGEejoYZw74R1BHusFBcnmB1URldbq4IdzlxXNKrcnmJH/lgYCdbZ8OG0MaQrEIyLz0WmY27ARb/AwDuiy/dn0X3NgvQjqPffLHrYHmdqvqBsb0+qG3v7b0xt+BGDkebt1TXCy9wjIa1iqCOQ0EJi2dcuD2dWlhPM2kuslMjKlqe57D5bwaHBDS6K9Sd4VABRdv7mExrMBSr1SnkasrBsvb47UVXYUJRI3GGyA/wYYAi3fW9ZxG25x2SA0rjF5U68c5rmQMD94FLmaSoaqSvigkSBDOF/DIwlRO5vB4NlP7/+TjNOo92r4GbTZyMTnrsORqQJKcMrpfVbM8gRngPTJz2FxBSoz86HQ3wVXnS0gVUJNM+ctWdvzvtrv1Np3wF0/zWHddrtfYdNgnuyKjQL3chpJs7y5aQxdgU1vHdf4X2NwhA77Cf/U6bSemhR+MfZlp4it7pZiu96b8jKsEbKrCi998tKCKVv70WhGXce3gebKPY3Gn/qUL6X3rx4Uj5CPrIjWZNhwRJJ3BXSTnKog2eUIWJC0rXXrGRV6Sf6514zbi0MCOexnAjZM1xs5NUd/wrugDnMp4+P+ZPZyseeVB51NSnGhxlYLwD9EN+4ocjyBzMINOcQw1GPkB5Rrqwh+19q5SnvA== 7f5410dfc8a64bb587d19637deb95d378fd1eb5c 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAl44RUUQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91WcUD/9em14ckTP9APTrSpe6y4FLS6cIUZabNN6wDXjTrHmS26hoNvWrT+RpWQ5XSOOJhZdhjkR1k87EOw9+m6+36ZaL+RXYnjrbku9fxbbFBraGTFy0JZHAT6v57uQ8P7XwqN4dGvXXpgE5UuY5sp1uDRbtIPNts3iWJKAnIazxUnyotHNtJQNESHySomzR1s93z1oOMpHapAqUmPbcZywg4otWjrOnkhOok3Sa3TgGthpHbM0qmh6J9ZaRBXsKEpLkjCRNggdvqww1w4omcAJzY4V5tG8WfhW+Xl8zBBe0K5m/ug3e25sWR5Dqm4+qUO0HZWQ3m3/M7CCuQrWFXTkr7nKac50vtFzsqHlHNoaiKnvQKoruQs3266TGsrzCCOSy8BqmpysD6sB79owLKoh0LfFOcSwG9kZ8sovEvTfrRn8g3YAp7XbXkDxbcLMijr7P4gWq8sC1NZJn1yhLXitcCfAAuVrVQfPVdt2pp8Ry2NdGnHjikQjOn/wAKlYJ5F8JMdn6eEI/Gveg2g8uR9kp/9zaXRx6rU3ccuZQ7cBQbBlBsmmpd7gJRp2v0NKsV8hXtCPnBvcfCqgYHLg7FQVq1wKe5glvtmx9uPZNsl/S++fSxGoXfp9wVi048J42KyEH6yvoySCvbYeSFQvMfAoD1xJ4xWtT8ZEj6oiHvzHw1u/zgw== mercurial-5.3.1/hgdemandimport/0000755015407300116100000000000013627755444016416 5ustar augieeng00000000000000mercurial-5.3.1/hgdemandimport/tracing.py0000644015407300116100000000322413627755404020414 0ustar augieeng00000000000000# Support code for event tracing in Mercurial. Lives in demandimport # so it can also be used in demandimport. # # Copyright 2018 Google LLC. # # 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 import contextlib import os _pipe = None _checked = False _session = 'none' def _isactive(): global _pipe, _session, _checked if _pipe is None: if _checked: return False _checked = True if 'HGCATAPULTSERVERPIPE' not in os.environ: return False _pipe = open(os.environ['HGCATAPULTSERVERPIPE'], 'w', 1) _session = os.environ.get('HGCATAPULTSESSION', 'none') return True @contextlib.contextmanager def log(whencefmt, *whenceargs): if not _isactive(): yield return whence = whencefmt % whenceargs try: # Both writes to the pipe are wrapped in try/except to ignore # errors, as we can see mysterious errors in here if the pager # is active. Presumably other conditions could trigger # problems too. try: _pipe.write('START %s %s\n' % (_session, whence)) except IOError: pass yield finally: try: _pipe.write('END %s %s\n' % (_session, whence)) except IOError: pass def counter(label, amount, *labelargs): if not _isactive(): return l = label % labelargs # See above in log() for why this is in a try/except. try: _pipe.write('COUNTER %s %d %s\n' % (_session, amount, l)) except IOError: pass mercurial-5.3.1/hgdemandimport/__init__.py0000644015407300116100000000463413627755404020532 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 # Full module names which can't be lazy imported. # Extensions can add to this set. IGNORES = { '__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: # _ctypes.pointer is shadowed by "from ... import pointer" (PyPy 5) IGNORES.add('_ctypes.pointer') demandimport.init(IGNORES) # 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-5.3.1/hgdemandimport/demandimportpy3.py0000644015407300116100000001223113627755404022102 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.util import sys from . import tracing _deactivated = False # Python 3.5's LazyLoader doesn't work for some reason. # https://bugs.python.org/issue26186 is a known issue with extension # importing. But it appears to not have a meaningful effect with # Mercurial. _supported = sys.version_info[0:2] >= (3, 6) 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.""" with tracing.log('demandimport %s', module): if _deactivated or module.__name__ in ignores: self.loader.exec_module(module) else: super().exec_module(module) class LazyFinder(object): """A wrapper around a ``MetaPathFinder`` that makes loaders lazy. ``sys.meta_path`` finders have their ``find_spec()`` called to locate a module. This returns a ``ModuleSpec`` if found or ``None``. The ``ModuleSpec`` has a ``loader`` attribute, which is called to actually load a module. Our class wraps an existing finder and overloads its ``find_spec()`` to replace the ``loader`` with our lazy loader proxy. We have to use __getattribute__ to proxy the instance because some meta path finders don't support monkeypatching. """ __slots__ = ("_finder",) def __init__(self, finder): object.__setattr__(self, "_finder", finder) def __repr__(self): return "" % object.__getattribute__(self, "_finder") # __bool__ is canonical Python 3. But check-code insists on __nonzero__ being # defined via `def`. def __nonzero__(self): return bool(object.__getattribute__(self, "_finder")) __bool__ = __nonzero__ def __getattribute__(self, name): if name in ("_finder", "find_spec"): return object.__getattribute__(self, name) return getattr(object.__getattribute__(self, "_finder"), name) def __delattr__(self, name): return delattr(object.__getattribute__(self, "_finder")) def __setattr__(self, name, value): return setattr(object.__getattribute__(self, "_finder"), name, value) def find_spec(self, *args, **kwargs): finder = object.__getattribute__(self, "_finder") spec = finder.find_spec(*args, **kwargs) # Lazy loader requires exec_module(). if ( spec is not None and spec.loader is not None and getattr(spec.loader, "exec_module") ): spec.loader = _lazyloaderex(spec.loader) return spec ignores = set() def init(ignoreset): global ignores ignores = ignoreset def isenabled(): return not _deactivated and any( isinstance(finder, LazyFinder) for finder in sys.meta_path ) def disable(): new_finders = [] for finder in sys.meta_path: new_finders.append( finder._finder if isinstance(finder, LazyFinder) else finder ) sys.meta_path[:] = new_finders def enable(): if not _supported: return new_finders = [] for finder in sys.meta_path: new_finders.append( LazyFinder(finder) if not isinstance(finder, LazyFinder) else finder ) sys.meta_path[:] = new_finders @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-5.3.1/hgdemandimport/demandimportpy2.py0000644015407300116100000002573613627755404022117 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 from . import tracing 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, "_data", (head, globals, locals, after, level, set()) ) object.__setattr__(self, "_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: with tracing.log('demandimport %s', self._data[0]): 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 + 'mod') is self: locals[head + '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, "_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 ignores 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 ignores: 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 ignores = set() def init(ignoreset): global ignores ignores = ignoreset 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-5.3.1/Makefile0000644015407300116100000002104713627755404015054 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= PYFILESCMD=find mercurial hgext doc -name '*.py' PYFILES:=$(shell $(PYFILESCMD)) DOCFILES=mercurial/helptext/*.txt export LANGUAGE=C export LC_ALL=C TESTFLAGS ?= $(shell echo $$HGTESTFLAGS) OSXVERSIONFLAGS ?= $(shell echo $$OSXVERSIONFLAGS) CARGO = cargo # 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 rm -rf rust/target rm -f mercurial/rustext.so 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: # Run Rust tests if cargo is installed if command -v $(CARGO) >/dev/null 2>&1; then \ $(MAKE) rust-tests; \ fi 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) rust-tests: py_feature = $(shell $(PYTHON) -c \ 'import sys; print(["python27-bin", "python3-bin"][sys.version_info[0] >= 3])') rust-tests: cd $(HGROOT)/rust/hg-cpython \ && $(CARGO) test --quiet --all \ --no-default-features --features "$(py_feature)" 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-ignorelist"'` 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/templatefuncs.py \ mercurial/templatekw.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. $(PYFILESCMD) | 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 packaging_targets := \ centos5 \ centos6 \ centos7 \ centos8 \ deb \ docker-centos5 \ docker-centos6 \ docker-centos7 \ docker-centos8 \ docker-debian-bullseye \ docker-debian-buster \ docker-debian-stretch \ docker-fedora \ docker-ubuntu-trusty \ docker-ubuntu-trusty-ppa \ docker-ubuntu-xenial \ docker-ubuntu-xenial-ppa \ docker-ubuntu-artful \ docker-ubuntu-artful-ppa \ docker-ubuntu-bionic \ docker-ubuntu-bionic-ppa \ fedora \ linux-wheels \ linux-wheels-x86_64 \ linux-wheels-i686 \ ppa # Forward packaging targets for convenience. $(packaging_targets): $(MAKE) -C contrib/packaging $@ 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/packaging/macosx/distribution.xml \ --package-path build/ \ --version "$${HGVER}" \ --resources contrib/packaging/macosx/ \ "$${OUTPUTDIR:-dist/}"/Mercurial-"$${HGVER}"-macosx"$${OSXVER}".pkg .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 rust-tests check-code format-c \ update-pot \ $(packaging_targets) \ osx mercurial-5.3.1/CONTRIBUTING0000644015407300116100000000113013627755404015235 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-5.3.1/.hgignore0000644015407300116100000000156013627755404015215 0ustar augieeng00000000000000syntax: glob *.elc *.tmp *.orig *.rej *~ *.mergebackup *.o *.so *.dll *.exe *.pyd *.pyc *.pyo *$py.class *.swp *.prof *.zip \#*\# .\#* tests/artifacts/cache/big-file-churn.hg 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 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/* .pytype/* i18n/hg.pot locale/*/LC_MESSAGES/hg.mo hgext/__index__.py rust/target/ rust/*/target/ # Generated wheels wheelhouse/ syntax: regexp ^\.pc/ ^\.(pydev)?project # hackable windows distribution additions ^hg-python ^hg.py$ mercurial-5.3.1/.hgtags0000644015407300116100000002267413627755407014704 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 7de7bd407251af2bc98e5b809c8598ee95830daf 4.5.3 ed5448edcbfa747b9154099e18630e49024fd47b 4.6rc0 1ec874717d8a93b19e0d50628443e0ee5efab3a9 4.6rc1 6614cac550aea66d19c601e45efd1b7bd08d7c40 4.6 9c5ced5276d6e7d54f7c3dadf5247b7ee98ec79c 4.6.1 0b63a6743010dfdbf8a8154186e119949bdaa1cc 4.6.2 e90130af47ce8dd53a3109aed9d15876b3e7dee8 4.7rc0 33ac6a72308a215e6086fbced347ec10aa963b0a 4.7 ede3bf31fe63677fdf5bd8db687977d4e3d792ed 4.7.1 5405cb1a79010ac50c58cd84e6f50c4556bf2a4c 4.7.2 956ec6f1320df26f3133ec40f3de866ea0695fd7 4.8rc0 a91a2837150bdcb27ae76b3646e6c93cd6a15904 4.8 1c8c54cf97256f4468da2eb4dbee24f7f3888e71 4.8.1 197f092b2cd9691e2a55d198f717b231af9be6f9 4.8.2 593718ff5844cad7a27ee3eb5adad89ac8550949 4.9rc0 83377b4b4ae0e9a6b8e579f7b0a693b8cf5c3b10 4.9 4ea21df312ec7159c5b3633096b6ecf68750b0dd 4.9.1 4a8d9ed864754837a185a642170cde24392f9abf 5.0rc0 07e479ef7c9639be0029f00e6a722b96dcc05fee 5.0 c3484ddbdb9621256d597ed86b90d229c59c2af9 5.0.1 97ada9b8d51bef24c5cb4cdca4243f0db694ab6e 5.0.2 e386b5f4f8360dbb43a576dd9b1368e386fefa5b 5.1rc0 e91930d712e8507d1bc1b2dffd96c83edc4cbed3 5.1 a4e32fd539ab41489a51b2aa88bda9a73b839562 5.1.1 181e52f2b62f4768aa0d988936c929dc7c4a41a0 5.1.2 59338f9561099de77c684c00f76507f11e46ebe8 5.2rc0 ca3dca416f8d5863ca6f5a4a6a6bb835dcd5feeb 5.2 a50fecefa691c9b72a99e49aa6fe9dd13943c2bf 5.2.1 b4c82b70418022e67cc0e69b1aa3c3aa43aa1d29 5.2.2 84a0102c05c7852c8215ef6cf21d809927586b69 5.3rc0 e4344e463c0c888a2f437b78b5982ecdf3f6650a 5.3rc1 7f5410dfc8a64bb587d19637deb95d378fd1eb5c 5.3 mercurial-5.3.1/hgeditor0000755015407300116100000000231213627755404015141 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-5.3.1/rust/0000755015407300116100000000000013627755444014411 5ustar augieeng00000000000000mercurial-5.3.1/rust/chg/0000755015407300116100000000000013627755444015152 5ustar augieeng00000000000000mercurial-5.3.1/rust/chg/Cargo.toml0000644015407300116100000000076513627755405017107 0ustar augieeng00000000000000[package] name = "chg" version = "0.1.0" authors = ["Yuya Nishihara "] description = "Client for Mercurial command server with cHg extension" license = "GPL-2.0+" [dependencies] bytes = "0.4" futures = "0.1" libc = "0.2" log = { version = "0.4", features = ["std"] } tokio = "0.1" tokio-hglib = "0.2" # TODO: "^0.2.3" once released. we need AsRawFd support. tokio-process = { git = "https://github.com/alexcrichton/tokio-process" } tokio-timer = "0.2" [build-dependencies] cc = "1.0" mercurial-5.3.1/rust/chg/Cargo.lock0000644015407300116100000010054313627755405017057 0ustar augieeng00000000000000[[package]] name = "arrayvec" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "bitflags" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "byteorder" version = "1.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "bytes" version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cc" version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cfg-if" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "chg" version = "0.1.0" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-hglib 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-process 0.2.2 (git+https://github.com/alexcrichton/tokio-process)", "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cloudabi" version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-deque" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-epoch" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-utils" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "fuchsia-zircon" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "fuchsia-zircon-sys" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "futures" version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "iovec" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[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 = "lazy_static" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "lazycell" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" version = "0.2.43" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "lock_api" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "log" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "memoffset" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "mio" version = "0.6.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "mio-named-pipes" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "mio-uds" version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "miow" version = "0.2.1" 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)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "miow" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "socket2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "net2" version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "nodrop" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "num_cpus" version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "owning_ref" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "parking_lot" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "parking_lot_core" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand" version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_core" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "redox_syscall" version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "rustc_version" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "scopeguard" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "semver" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "semver-parser" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "slab" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "smallvec" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "socket2" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "stable_deref_trait" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "tokio" version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-fs 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-threadpool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-udp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-uds 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-codec" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-current-thread" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-executor" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-fs" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-threadpool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-hglib" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-process 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-uds 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-io" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-process" version = "0.2.2" source = "git+https://github.com/alexcrichton/tokio-process#2e805aad57e2639246cbf7394899bf7a27c18ebd" dependencies = [ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "mio-named-pipes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-signal 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-process" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "mio-named-pipes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-signal 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-reactor" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-signal" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-tcp" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-threadpool" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-timer" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-udp" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-uds" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "unreachable" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "version_check" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "void" version = "1.0.2" 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" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-x86_64-pc-windows-gnu 0.4.0 (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" [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ws2_32-sys" version = "0.2.1" 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)", ] [metadata] "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" "checksum byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "90492c5858dd7d2e78691cfb89f90d273a2800fc11d98f60786e5d87e2f83781" "checksum bytes 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0ce55bd354b095246fc34caf4e9e242f5297a7fd938b090cadfea6eee614aa62" "checksum cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f159dfd43363c4d08055a07703eb7a3406b0dac4d0584d96965a3262db3c9d16" "checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3486aefc4c0487b9cb52372c97df0a48b8c249514af1ee99703bf70d2f2ceda1" "checksum crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30fecfcac6abfef8771151f8be4abc9e4edc112c2bcb233314cafde2680536e9" "checksum crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "677d453a17e8bd2b913fa38e8b9cf04bcdbb5be790aa294f2389661d72036015" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" "checksum futures 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "0c84b40c7e2de99ffd70602db314a7a8c26b2b3d830e6f7f7a142a8860ab3ca4" "checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7" "checksum lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddba4c30a78328befecec92fc94970e53b3ae385827d28620f0f5bb2493081e0" "checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d" "checksum lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775751a3e69bde4df9b38dd00a1b5d6ac13791e4223d4a0506577f0dd27cfb7a" "checksum log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fcce5fa49cc693c312001daf1d13411c4a5283796bac1084299ea3e567113f" "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" "checksum mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)" = "71646331f2619b1026cc302f87a2b8b648d5c6dd6937846a16cc8ce0f347f432" "checksum mio-named-pipes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f5e374eff525ce1c5b7687c4cef63943e7686524a387933ad27ca7ec43779cb3" "checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" "checksum miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "396aa0f2003d7df8395cb93e09871561ccc3e785f0acb369170e8cc74ddf9226" "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" "checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5" "checksum parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad7f7e6ebdc79edff6fdcb87a55b620174f7a989e3eb31b65231f4af57f00b8c" "checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c" "checksum rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2" "checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5f9776d6b986f77b35c6cf846c11ad986ff128fe0b2b63a3628e3755e8d3102d" "checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d" "checksum socket2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c4d11a52082057d87cb5caa31ad812f4504b97ab44732cd8359df2e9ff9f48e7" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "6e93c78d23cc61aa245a8acd2c4a79c4d7fa7fb5c3ca90d5737029f043a84895" "checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" "checksum tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f90fcd90952f0a496d438a976afba8e5c205fb12123f813d8ab3aa1c8436638c" "checksum tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c117b6cf86bb730aab4834f10df96e4dd586eff2c3c27d3781348da49e255bde" "checksum tokio-fs 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b5cbe4ca6e71cb0b62a66e4e6f53a8c06a6eefe46cc5f665ad6f274c9906f135" "checksum tokio-hglib 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a138c3cb866c8a95ceddae44634bb159eefeebcdba45aec2158f8ad6c201e6d" "checksum tokio-io 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "8b8a85fffbec3c5ab1ab62324570230dcd37ee5996a7859da5caf7b9d45e3e8c" "checksum tokio-process 0.2.2 (git+https://github.com/alexcrichton/tokio-process)" = "" "checksum tokio-process 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0832648d1ff7ca42c06ca45dc76797b92c56500de828e33c77276fa1449947b6" "checksum tokio-reactor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4b26fd37f1125738b2170c80b551f69ff6fecb277e6e5ca885e53eec2b005018" "checksum tokio-signal 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b6893092932264944edee8486d54b578c7098bea794aedaf9bd7947b49e6b7bf" "checksum tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7ad235e9dadd126b2d47f6736f65aa1fdcd6420e66ca63f44177bc78df89f912" "checksum tokio-threadpool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bbd8a8b911301c60cbfaa2a6588fb210e5c1038375b8bdecc47aa09a94c3c05f" "checksum tokio-timer 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "3a52f00c97fedb6d535d27f65cccb7181c8dd4c6edc3eda9ea93f6d45d05168e" "checksum tokio-udp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "da941144b816d0dcda4db3a1ba87596e4df5e860a72b70783fe435891f80601c" "checksum tokio-uds 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "22e3aa6d1fcc19e635418dc0a30ab5bd65d347973d6f43f1a37bf8d9d1335fc9" "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" mercurial-5.3.1/rust/chg/build.rs0000644015407300116100000000025513627755404016615 0ustar augieeng00000000000000extern crate cc; fn main() { cc::Build::new() .warnings(true) .file("src/sendfds.c") .file("src/sighandlers.c") .compile("procutil"); } mercurial-5.3.1/rust/chg/src/0000755015407300116100000000000013627755444015741 5ustar augieeng00000000000000mercurial-5.3.1/rust/chg/src/message.rs0000644015407300116100000000750313627755405017735 0ustar augieeng00000000000000// Copyright 2018 Yuya Nishihara // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Utility for parsing and building command-server messages. use bytes::Bytes; use std::error; use std::ffi::{OsStr, OsString}; use std::io; use std::os::unix::ffi::OsStrExt; pub use tokio_hglib::message::*; // re-exports /// Shell command type requested by the server. #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum CommandType { /// Pager should be spawned. Pager, /// Shell command should be executed to send back the result code. System, } /// Shell command requested by the server. #[derive(Clone, Debug, Eq, PartialEq)] pub struct CommandSpec { pub command: OsString, pub current_dir: OsString, pub envs: Vec<(OsString, OsString)>, } /// Parses "S" channel request into command type and spec. pub fn parse_command_spec(data: Bytes) -> io::Result<(CommandType, CommandSpec)> { let mut split = data.split(|&c| c == b'\0'); let ctype = parse_command_type(split.next().ok_or(new_parse_error("missing type"))?)?; let command = split.next().ok_or(new_parse_error("missing command"))?; let current_dir = split.next().ok_or(new_parse_error("missing current dir"))?; let mut envs = Vec::new(); for l in split { let mut s = l.splitn(2, |&c| c == b'='); let k = s.next().unwrap(); let v = s.next().ok_or(new_parse_error("malformed env"))?; envs.push(( OsStr::from_bytes(k).to_owned(), OsStr::from_bytes(v).to_owned(), )); } let spec = CommandSpec { command: OsStr::from_bytes(command).to_owned(), current_dir: OsStr::from_bytes(current_dir).to_owned(), envs: envs, }; Ok((ctype, spec)) } fn parse_command_type(value: &[u8]) -> io::Result { match value { b"pager" => Ok(CommandType::Pager), b"system" => Ok(CommandType::System), _ => Err(new_parse_error(format!( "unknown command type: {}", decode_latin1(value) ))), } } fn decode_latin1(s: S) -> String where S: AsRef<[u8]>, { s.as_ref().iter().map(|&c| c as char).collect() } fn new_parse_error(error: E) -> io::Error where E: Into>, { io::Error::new(io::ErrorKind::InvalidData, error) } #[cfg(test)] mod tests { use super::*; use std::os::unix::ffi::OsStringExt; #[test] fn parse_command_spec_good() { let src = [ b"pager".as_ref(), b"less -FRX".as_ref(), b"/tmp".as_ref(), b"LANG=C".as_ref(), b"HGPLAIN=".as_ref(), ] .join(&0); let spec = CommandSpec { command: os_string_from(b"less -FRX"), current_dir: os_string_from(b"/tmp"), envs: vec![ (os_string_from(b"LANG"), os_string_from(b"C")), (os_string_from(b"HGPLAIN"), os_string_from(b"")), ], }; assert_eq!( parse_command_spec(Bytes::from(src)).unwrap(), (CommandType::Pager, spec) ); } #[test] fn parse_command_spec_too_short() { assert!(parse_command_spec(Bytes::from_static(b"")).is_err()); assert!(parse_command_spec(Bytes::from_static(b"pager")).is_err()); assert!(parse_command_spec(Bytes::from_static(b"pager\0less")).is_err()); } #[test] fn parse_command_spec_malformed_env() { assert!(parse_command_spec(Bytes::from_static(b"pager\0less\0/tmp\0HOME")).is_err()); } #[test] fn parse_command_spec_unknown_type() { assert!(parse_command_spec(Bytes::from_static(b"paper\0less")).is_err()); } fn os_string_from(s: &[u8]) -> OsString { OsString::from_vec(s.to_vec()) } } mercurial-5.3.1/rust/chg/src/locator.rs0000644015407300116100000001001213627755404017740 0ustar augieeng00000000000000// Copyright 2011, 2018 Yuya Nishihara // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Utility for locating command-server process. use std::env; use std::ffi::{OsStr, OsString}; use std::fs::{self, DirBuilder}; use std::io; use std::os::unix::ffi::{OsStrExt, OsStringExt}; use std::os::unix::fs::{DirBuilderExt, MetadataExt}; use std::path::{Path, PathBuf}; use std::process; use std::time::Duration; use super::procutil; /// Helper to connect to and spawn a server process. #[derive(Clone, Debug)] pub struct Locator { hg_command: OsString, current_dir: PathBuf, env_vars: Vec<(OsString, OsString)>, process_id: u32, base_sock_path: PathBuf, timeout: Duration, } impl Locator { /// Creates locator capturing the current process environment. /// /// If no `$CHGSOCKNAME` is specified, the socket directory will be /// created as necessary. pub fn prepare_from_env() -> io::Result { Ok(Locator { hg_command: default_hg_command(), current_dir: env::current_dir()?, env_vars: env::vars_os().collect(), process_id: process::id(), base_sock_path: prepare_server_socket_path()?, timeout: default_timeout(), }) } /// Temporary socket path for this client process. fn temp_sock_path(&self) -> PathBuf { let src = self.base_sock_path.as_os_str().as_bytes(); let mut buf = Vec::with_capacity(src.len() + 6); buf.extend_from_slice(src); buf.extend_from_slice(format!(".{}", self.process_id).as_bytes()); OsString::from_vec(buf).into() } } /// Determines the server socket to connect to. /// /// If no `$CHGSOCKNAME` is specified, the socket directory will be created /// as necessary. pub fn prepare_server_socket_path() -> io::Result { if let Some(s) = env::var_os("CHGSOCKNAME") { Ok(PathBuf::from(s)) } else { let mut path = default_server_socket_dir(); create_secure_dir(&path)?; path.push("server"); Ok(path) } } /// Determines the default server socket path as follows. /// /// 1. `$XDG_RUNTIME_DIR/chg` /// 2. `$TMPDIR/chg$UID` /// 3. `/tmp/chg$UID` pub fn default_server_socket_dir() -> PathBuf { // XDG_RUNTIME_DIR should be ignored if it has an insufficient permission. // https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html if let Some(Ok(s)) = env::var_os("XDG_RUNTIME_DIR").map(check_secure_dir) { let mut path = PathBuf::from(s); path.push("chg"); path } else { let mut path = env::temp_dir(); path.push(format!("chg{}", procutil::get_effective_uid())); path } } /// Determines the default hg command. pub fn default_hg_command() -> OsString { // TODO: maybe allow embedding the path at compile time (or load from hgrc) env::var_os("CHGHG") .or(env::var_os("HG")) .unwrap_or(OsStr::new("hg").to_owned()) } fn default_timeout() -> Duration { let secs = env::var("CHGTIMEOUT") .ok() .and_then(|s| s.parse().ok()) .unwrap_or(60); Duration::from_secs(secs) } /// Creates a directory which the other users cannot access to. /// /// If the directory already exists, tests its permission. fn create_secure_dir

(path: P) -> io::Result<()> where P: AsRef, { DirBuilder::new() .mode(0o700) .create(path.as_ref()) .or_else(|err| { if err.kind() == io::ErrorKind::AlreadyExists { check_secure_dir(path).map(|_| ()) } else { Err(err) } }) } fn check_secure_dir

(path: P) -> io::Result

where P: AsRef, { let a = fs::symlink_metadata(path.as_ref())?; if a.is_dir() && a.uid() == procutil::get_effective_uid() && (a.mode() & 0o777) == 0o700 { Ok(path) } else { Err(io::Error::new(io::ErrorKind::Other, "insecure directory")) } } mercurial-5.3.1/rust/chg/src/procutil.rs0000644015407300116100000000475513627755405020160 0ustar augieeng00000000000000// Copyright 2018 Yuya Nishihara // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Low-level utility for signal and process handling. use libc::{self, c_int, pid_t, size_t, ssize_t}; use std::io; use std::os::unix::io::RawFd; use std::sync; #[link(name = "procutil", kind = "static")] extern "C" { // sendfds.c fn sendfds(sockfd: c_int, fds: *const c_int, fdlen: size_t) -> ssize_t; // sighandlers.c fn setupsignalhandler(pid: pid_t, pgid: pid_t) -> c_int; fn restoresignalhandler() -> c_int; } /// Returns the effective uid of the current process. pub fn get_effective_uid() -> u32 { unsafe { libc::geteuid() } } /// Changes the given fd to blocking mode. pub fn set_blocking_fd(fd: RawFd) -> io::Result<()> { let flags = unsafe { libc::fcntl(fd, libc::F_GETFL) }; if flags < 0 { return Err(io::Error::last_os_error()); } let r = unsafe { libc::fcntl(fd, libc::F_SETFL, flags & !libc::O_NONBLOCK) }; if r < 0 { return Err(io::Error::last_os_error()); } Ok(()) } /// Sends file descriptors via the given socket. pub fn send_raw_fds(sock_fd: RawFd, fds: &[RawFd]) -> io::Result<()> { let r = unsafe { sendfds(sock_fd, fds.as_ptr(), fds.len() as size_t) }; if r < 0 { return Err(io::Error::last_os_error()); } Ok(()) } static SETUP_SIGNAL_HANDLER: sync::Once = sync::Once::new(); static RESTORE_SIGNAL_HANDLER: sync::Once = sync::Once::new(); /// Installs signal handlers to forward signals to the server. /// /// # Safety /// /// This touches global states, and thus synchronized as a one-time /// initialization function. pub fn setup_signal_handler_once(pid: u32, pgid: Option) -> io::Result<()> { let pid_signed = pid as i32; let pgid_signed = pgid.map(|n| n as i32).unwrap_or(0); let mut r = 0; SETUP_SIGNAL_HANDLER.call_once(|| { r = unsafe { setupsignalhandler(pid_signed, pgid_signed) }; }); if r < 0 { return Err(io::Error::last_os_error()); } Ok(()) } /// Restores the original signal handlers. /// /// # Safety /// /// This touches global states, and thus synchronized as a one-time /// initialization function. pub fn restore_signal_handler_once() -> io::Result<()> { let mut r = 0; RESTORE_SIGNAL_HANDLER.call_once(|| { r = unsafe { restoresignalhandler() }; }); if r < 0 { return Err(io::Error::last_os_error()); } Ok(()) } mercurial-5.3.1/rust/chg/src/uihandler.rs0000644015407300116100000000563313627755405020266 0ustar augieeng00000000000000// Copyright 2018 Yuya Nishihara // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. use futures::future::IntoFuture; use futures::Future; use std::io; use std::os::unix::io::AsRawFd; use std::os::unix::process::ExitStatusExt; use std::process::{Command, Stdio}; use tokio; use tokio_process::{ChildStdin, CommandExt}; use super::message::CommandSpec; use super::procutil; /// Callback to process shell command requests received from server. pub trait SystemHandler: Sized { type PagerStdin: AsRawFd; type SpawnPagerResult: IntoFuture; type RunSystemResult: IntoFuture; /// Handles pager command request. /// /// Returns the pipe to be attached to the server if the pager is spawned. fn spawn_pager(self, spec: CommandSpec) -> Self::SpawnPagerResult; /// Handles system command request. /// /// Returns command exit code (positive) or signal number (negative). fn run_system(self, spec: CommandSpec) -> Self::RunSystemResult; } /// Default cHg implementation to process requests received from server. pub struct ChgUiHandler {} impl ChgUiHandler { pub fn new() -> ChgUiHandler { ChgUiHandler {} } } impl SystemHandler for ChgUiHandler { type PagerStdin = ChildStdin; type SpawnPagerResult = io::Result<(Self, Self::PagerStdin)>; type RunSystemResult = Box + Send>; fn spawn_pager(self, spec: CommandSpec) -> Self::SpawnPagerResult { let mut pager = new_shell_command(&spec) .stdin(Stdio::piped()) .spawn_async()?; let pin = pager.stdin().take().unwrap(); procutil::set_blocking_fd(pin.as_raw_fd())?; // TODO: if pager exits, notify the server with SIGPIPE immediately. // otherwise the server won't get SIGPIPE if it does not write // anything. (issue5278) // kill(peerpid, SIGPIPE); tokio::spawn(pager.map(|_| ()).map_err(|_| ())); // just ignore errors Ok((self, pin)) } fn run_system(self, spec: CommandSpec) -> Self::RunSystemResult { let fut = new_shell_command(&spec) .spawn_async() .into_future() .flatten() .map(|status| { let code = status .code() .or_else(|| status.signal().map(|n| -n)) .expect("either exit code or signal should be set"); (self, code) }); Box::new(fut) } } fn new_shell_command(spec: &CommandSpec) -> Command { let mut builder = Command::new("/bin/sh"); builder .arg("-c") .arg(&spec.command) .current_dir(&spec.current_dir) .env_clear() .envs(spec.envs.iter().cloned()); builder } mercurial-5.3.1/rust/chg/src/runcommand.rs0000644015407300116100000001343313627755404020452 0ustar augieeng00000000000000// Copyright 2018 Yuya Nishihara // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Functions to run Mercurial command in cHg-aware command server. use bytes::Bytes; use futures::future::IntoFuture; use futures::{Async, Future, Poll}; use std::io; use std::mem; use std::os::unix::io::AsRawFd; use tokio_hglib::codec::ChannelMessage; use tokio_hglib::protocol::MessageLoop; use tokio_hglib::{Client, Connection}; use super::attachio::AttachIo; use super::message::{self, CommandType}; use super::uihandler::SystemHandler; enum AsyncS { Ready(R), NotReady(S), PollAgain(S), } enum CommandState where C: Connection, H: SystemHandler, { Running(MessageLoop, H), SpawningPager(Client, ::Future), AttachingPager(AttachIo, H), WaitingSystem(Client, ::Future), Finished, } type CommandPoll = io::Result<(AsyncS<(Client, H, i32), CommandState>)>; /// Future resolves to `(exit_code, client)`. #[must_use = "futures do nothing unless polled"] pub struct ChgRunCommand where C: Connection, H: SystemHandler, { state: CommandState, } impl ChgRunCommand where C: Connection + AsRawFd, H: SystemHandler, { pub fn with_client(client: Client, handler: H, packed_args: Bytes) -> ChgRunCommand { let msg_loop = MessageLoop::start_with_args(client, b"runcommand", packed_args); ChgRunCommand { state: CommandState::Running(msg_loop, handler), } } } impl Future for ChgRunCommand where C: Connection + AsRawFd, H: SystemHandler, { type Item = (Client, H, i32); type Error = io::Error; fn poll(&mut self) -> Poll { loop { let state = mem::replace(&mut self.state, CommandState::Finished); match state.poll()? { AsyncS::Ready((client, handler, code)) => { return Ok(Async::Ready((client, handler, code))); } AsyncS::NotReady(newstate) => { self.state = newstate; return Ok(Async::NotReady); } AsyncS::PollAgain(newstate) => { self.state = newstate; } } } } } impl CommandState where C: Connection + AsRawFd, H: SystemHandler, { fn poll(self) -> CommandPoll { match self { CommandState::Running(mut msg_loop, handler) => { if let Async::Ready((client, msg)) = msg_loop.poll()? { process_message(client, handler, msg) } else { Ok(AsyncS::NotReady(CommandState::Running(msg_loop, handler))) } } CommandState::SpawningPager(client, mut fut) => { if let Async::Ready((handler, pin)) = fut.poll()? { let fut = AttachIo::with_client(client, io::stdin(), pin, None); Ok(AsyncS::PollAgain(CommandState::AttachingPager( fut, handler, ))) } else { Ok(AsyncS::NotReady(CommandState::SpawningPager(client, fut))) } } CommandState::AttachingPager(mut fut, handler) => { if let Async::Ready(client) = fut.poll()? { let msg_loop = MessageLoop::start(client, b""); // terminator Ok(AsyncS::PollAgain(CommandState::Running(msg_loop, handler))) } else { Ok(AsyncS::NotReady(CommandState::AttachingPager(fut, handler))) } } CommandState::WaitingSystem(client, mut fut) => { if let Async::Ready((handler, code)) = fut.poll()? { let data = message::pack_result_code(code); let msg_loop = MessageLoop::resume_with_data(client, data); Ok(AsyncS::PollAgain(CommandState::Running(msg_loop, handler))) } else { Ok(AsyncS::NotReady(CommandState::WaitingSystem(client, fut))) } } CommandState::Finished => panic!("poll ChgRunCommand after it's done"), } } } fn process_message(client: Client, handler: H, msg: ChannelMessage) -> CommandPoll where C: Connection, H: SystemHandler, { match msg { ChannelMessage::Data(b'r', data) => { let code = message::parse_result_code(data)?; Ok(AsyncS::Ready((client, handler, code))) } ChannelMessage::Data(..) => { // just ignores data sent to optional channel let msg_loop = MessageLoop::resume(client); Ok(AsyncS::PollAgain(CommandState::Running(msg_loop, handler))) } ChannelMessage::InputRequest(..) | ChannelMessage::LineRequest(..) => Err(io::Error::new( io::ErrorKind::InvalidData, "unsupported request", )), ChannelMessage::SystemRequest(data) => { let (cmd_type, cmd_spec) = message::parse_command_spec(data)?; match cmd_type { CommandType::Pager => { let fut = handler.spawn_pager(cmd_spec).into_future(); Ok(AsyncS::PollAgain(CommandState::SpawningPager(client, fut))) } CommandType::System => { let fut = handler.run_system(cmd_spec).into_future(); Ok(AsyncS::PollAgain(CommandState::WaitingSystem(client, fut))) } } } } } mercurial-5.3.1/rust/chg/src/lib.rs0000644015407300116100000000102713627755405017052 0ustar augieeng00000000000000// Copyright 2018 Yuya Nishihara // // 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 bytes; #[macro_use] extern crate futures; extern crate libc; extern crate tokio; extern crate tokio_hglib; extern crate tokio_process; mod attachio; mod clientext; pub mod locator; pub mod message; pub mod procutil; mod runcommand; mod uihandler; pub use clientext::ChgClientExt; pub use uihandler::{ChgUiHandler, SystemHandler}; mercurial-5.3.1/rust/chg/src/clientext.rs0000644015407300116100000000373613627755405020314 0ustar augieeng00000000000000// Copyright 2018 Yuya Nishihara // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! cHg extensions to command server client. use std::ffi::OsStr; use std::os::unix::ffi::OsStrExt; use std::os::unix::io::AsRawFd; use std::path::Path; use tokio_hglib::protocol::OneShotRequest; use tokio_hglib::{Client, Connection}; use super::attachio::AttachIo; use super::message; use super::runcommand::ChgRunCommand; use super::uihandler::SystemHandler; pub trait ChgClientExt where C: Connection + AsRawFd, { /// Attaches the client file descriptors to the server. fn attach_io(self, stdin: I, stdout: O, stderr: E) -> AttachIo where I: AsRawFd, O: AsRawFd, E: AsRawFd; /// Changes the working directory of the server. fn set_current_dir

(self, dir: P) -> OneShotRequest where P: AsRef; /// Runs the specified Mercurial command with cHg extension. fn run_command_chg(self, handler: H, args: I) -> ChgRunCommand where I: IntoIterator, P: AsRef, H: SystemHandler; } impl ChgClientExt for Client where C: Connection + AsRawFd, { fn attach_io(self, stdin: I, stdout: O, stderr: E) -> AttachIo where I: AsRawFd, O: AsRawFd, E: AsRawFd, { AttachIo::with_client(self, stdin, stdout, Some(stderr)) } fn set_current_dir

(self, dir: P) -> OneShotRequest where P: AsRef, { OneShotRequest::start_with_args(self, b"chdir", dir.as_ref().as_os_str().as_bytes()) } fn run_command_chg(self, handler: H, args: I) -> ChgRunCommand where I: IntoIterator, P: AsRef, H: SystemHandler, { ChgRunCommand::with_client(self, handler, message::pack_args_os(args)) } } mercurial-5.3.1/rust/chg/src/sendfds.c0000644015407300116100000000246713627755404017540 0ustar augieeng00000000000000/* * Utility to send fds via Unix domain socket * * Copyright 2011, 2018 Yuya Nishihara * * This software may be used and distributed according to the terms of the * GNU General Public License version 2 or any later version. */ #include #include #include #include #include #define MAX_FD_LEN 10 /* * Sends the given fds with 1-byte dummy payload. * * Returns the number of bytes sent on success, -1 on error and errno is set * appropriately. */ ssize_t sendfds(int sockfd, const int *fds, size_t fdlen) { char dummy[1] = {0}; struct iovec iov = {dummy, sizeof(dummy)}; char fdbuf[CMSG_SPACE(sizeof(fds[0]) * MAX_FD_LEN)]; struct msghdr msgh; struct cmsghdr *cmsg; /* just use a fixed-size buffer since we'll never send tons of fds */ if (fdlen > MAX_FD_LEN) { errno = EINVAL; return -1; } memset(&msgh, 0, sizeof(msgh)); msgh.msg_iov = &iov; msgh.msg_iovlen = 1; msgh.msg_control = fdbuf; msgh.msg_controllen = CMSG_SPACE(sizeof(fds[0]) * fdlen); cmsg = CMSG_FIRSTHDR(&msgh); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; cmsg->cmsg_len = CMSG_LEN(sizeof(fds[0]) * fdlen); memcpy(CMSG_DATA(cmsg), fds, sizeof(fds[0]) * fdlen); msgh.msg_controllen = cmsg->cmsg_len; return sendmsg(sockfd, &msgh, 0); } mercurial-5.3.1/rust/chg/src/attachio.rs0000644015407300116100000000726613627755404020112 0ustar augieeng00000000000000// Copyright 2018 Yuya Nishihara // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Functions to send client-side fds over the command server channel. use futures::{Async, Future, Poll}; use std::io; use std::os::unix::io::AsRawFd; use tokio_hglib::codec::ChannelMessage; use tokio_hglib::protocol::MessageLoop; use tokio_hglib::{Client, Connection}; use super::message; use super::procutil; /// Future to send client-side fds over the command server channel. /// /// This works as follows: /// 1. Client sends "attachio" request. /// 2. Server sends back 1-byte input request. /// 3. Client sends fds with 1-byte dummy payload in response. /// 4. Server returns the number of the fds received. /// /// If the stderr is omitted, it will be redirected to the stdout. This /// allows us to attach the pager stdin to both stdout and stderr, and /// dispose of the client-side handle once attached. #[must_use = "futures do nothing unless polled"] pub struct AttachIo where C: Connection, { msg_loop: MessageLoop, stdin: I, stdout: O, stderr: Option, } impl AttachIo where C: Connection + AsRawFd, I: AsRawFd, O: AsRawFd, E: AsRawFd, { pub fn with_client( client: Client, stdin: I, stdout: O, stderr: Option, ) -> AttachIo { let msg_loop = MessageLoop::start(client, b"attachio"); AttachIo { msg_loop, stdin, stdout, stderr, } } } impl Future for AttachIo where C: Connection + AsRawFd, I: AsRawFd, O: AsRawFd, E: AsRawFd, { type Item = Client; type Error = io::Error; fn poll(&mut self) -> Poll { loop { let (client, msg) = try_ready!(self.msg_loop.poll()); match msg { ChannelMessage::Data(b'r', data) => { let fd_cnt = message::parse_result_code(data)?; if fd_cnt == 3 { return Ok(Async::Ready(client)); } else { return Err(io::Error::new( io::ErrorKind::InvalidData, "unexpected attachio result", )); } } ChannelMessage::Data(..) => { // just ignore data sent to uninteresting (optional) channel self.msg_loop = MessageLoop::resume(client); } ChannelMessage::InputRequest(1) => { // this may fail with EWOULDBLOCK in theory, but the // payload is quite small, and the send buffer should // be empty so the operation will complete immediately let sock_fd = client.as_raw_fd(); let ifd = self.stdin.as_raw_fd(); let ofd = self.stdout.as_raw_fd(); let efd = self.stderr.as_ref().map_or(ofd, |f| f.as_raw_fd()); procutil::send_raw_fds(sock_fd, &[ifd, ofd, efd])?; self.msg_loop = MessageLoop::resume(client); } ChannelMessage::InputRequest(..) | ChannelMessage::LineRequest(..) | ChannelMessage::SystemRequest(..) => { return Err(io::Error::new( io::ErrorKind::InvalidData, "unsupported request while attaching io", )); } } } } } mercurial-5.3.1/rust/chg/src/sighandlers.c0000644015407300116100000000734713627755405020420 0ustar augieeng00000000000000/* * Signal handlers for cHg * * Copyright 2011, 2018 Yuya Nishihara * * This software may be used and distributed according to the terms of the * GNU General Public License version 2 or any later version. */ #include #include #include #include #include static pid_t peerpgid = 0; static pid_t peerpid = 0; static void forwardsignal(int sig) { assert(peerpid > 0); (void)kill(peerpid, sig); } static void forwardsignaltogroup(int sig) { /* prefer kill(-pgid, sig), fallback to pid if pgid is invalid */ pid_t killpid = peerpgid > 1 ? -peerpgid : peerpid; (void)kill(killpid, sig); } static void handlestopsignal(int sig) { sigset_t unblockset, oldset; struct sigaction sa, oldsa; if (sigemptyset(&unblockset) < 0) { return; } if (sigaddset(&unblockset, sig) < 0) { return; } memset(&sa, 0, sizeof(sa)); sa.sa_handler = SIG_DFL; sa.sa_flags = SA_RESTART; if (sigemptyset(&sa.sa_mask) < 0) { return; } forwardsignal(sig); if (raise(sig) < 0) { /* resend to self */ return; } if (sigaction(sig, &sa, &oldsa) < 0) { return; } if (sigprocmask(SIG_UNBLOCK, &unblockset, &oldset) < 0) { return; } /* resent signal will be handled before sigprocmask() returns */ if (sigprocmask(SIG_SETMASK, &oldset, NULL) < 0) { return; } if (sigaction(sig, &oldsa, NULL) < 0) { return; } } /* * Installs signal handlers. * * Returns 0 on success, -1 on error and errno is set appropriately. * Installed handlers wouldn't be cleaned up on error. */ int setupsignalhandler(pid_t pid, pid_t pgid) { if (pid <= 0) { errno = EINVAL; return -1; } peerpid = pid; peerpgid = (pgid <= 1 ? 0 : pgid); struct sigaction sa; memset(&sa, 0, sizeof(sa)); /* deadly signals meant to be sent to a process group: * - SIGHUP: usually generated by the kernel, when termination of a * process causes that process group to become orphaned * - SIGINT: usually generated by the terminal */ sa.sa_handler = forwardsignaltogroup; sa.sa_flags = SA_RESTART; if (sigemptyset(&sa.sa_mask) < 0) { return -1; } if (sigaction(SIGHUP, &sa, NULL) < 0) { return -1; } if (sigaction(SIGINT, &sa, NULL) < 0) { return -1; } /* terminate frontend by double SIGTERM in case of server freeze */ sa.sa_handler = forwardsignal; sa.sa_flags |= SA_RESETHAND; if (sigaction(SIGTERM, &sa, NULL) < 0) { return -1; } /* notify the worker about window resize events */ sa.sa_flags = SA_RESTART; if (sigaction(SIGWINCH, &sa, NULL) < 0) { return -1; } /* forward user-defined signals */ if (sigaction(SIGUSR1, &sa, NULL) < 0) { return -1; } if (sigaction(SIGUSR2, &sa, NULL) < 0) { return -1; } /* propagate job control requests to worker */ sa.sa_handler = forwardsignal; sa.sa_flags = SA_RESTART; if (sigaction(SIGCONT, &sa, NULL) < 0) { return -1; } sa.sa_handler = handlestopsignal; sa.sa_flags = SA_RESTART; if (sigaction(SIGTSTP, &sa, NULL) < 0) { return -1; } return 0; } /* * Restores signal handlers to the default, and masks SIGINT. * * Returns 0 on success, -1 on error and errno is set appropriately. */ int restoresignalhandler(void) { struct sigaction sa; memset(&sa, 0, sizeof(sa)); sa.sa_handler = SIG_DFL; sa.sa_flags = SA_RESTART; if (sigemptyset(&sa.sa_mask) < 0) { return -1; } if (sigaction(SIGHUP, &sa, NULL) < 0) { return -1; } if (sigaction(SIGTERM, &sa, NULL) < 0) { return -1; } if (sigaction(SIGWINCH, &sa, NULL) < 0) { return -1; } if (sigaction(SIGCONT, &sa, NULL) < 0) { return -1; } if (sigaction(SIGTSTP, &sa, NULL) < 0) { return -1; } /* ignore Ctrl+C while shutting down to make pager exits cleanly */ sa.sa_handler = SIG_IGN; if (sigaction(SIGINT, &sa, NULL) < 0) { return -1; } peerpid = 0; return 0; } mercurial-5.3.1/rust/chg/src/main.rs0000644015407300116100000000555313627755404017237 0ustar augieeng00000000000000// Copyright 2018 Yuya Nishihara // // 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 chg; extern crate futures; extern crate log; extern crate tokio; extern crate tokio_hglib; use chg::locator; use chg::procutil; use chg::{ChgClientExt, ChgUiHandler}; use futures::sync::oneshot; use std::env; use std::io; use std::process; use std::time::Instant; use tokio::prelude::*; use tokio_hglib::UnixClient; struct DebugLogger { start: Instant, } impl DebugLogger { pub fn new() -> DebugLogger { DebugLogger { start: Instant::now(), } } } impl log::Log for DebugLogger { fn enabled(&self, metadata: &log::Metadata) -> bool { metadata.target().starts_with("chg::") } fn log(&self, record: &log::Record) { if self.enabled(record.metadata()) { // just make the output looks similar to chg of C let l = format!("{}", record.level()).to_lowercase(); let t = self.start.elapsed(); writeln!( io::stderr(), "chg: {}: {}.{:06} {}", l, t.as_secs(), t.subsec_micros(), record.args() ) .unwrap_or(()); } } fn flush(&self) {} } fn main() { if env::var_os("CHGDEBUG").is_some() { log::set_boxed_logger(Box::new(DebugLogger::new())) .expect("any logger should not be installed yet"); log::set_max_level(log::LevelFilter::Debug); } let code = run().unwrap_or_else(|err| { writeln!(io::stderr(), "chg: abort: {}", err).unwrap_or(()); 255 }); process::exit(code); } fn run() -> io::Result { let current_dir = env::current_dir()?; let sock_path = locator::prepare_server_socket_path()?; let handler = ChgUiHandler::new(); let (result_tx, result_rx) = oneshot::channel(); let fut = UnixClient::connect(sock_path) .and_then(|client| client.set_current_dir(current_dir)) .and_then(|client| client.attach_io(io::stdin(), io::stdout(), io::stderr())) .and_then(|client| { let pid = client.server_spec().process_id.unwrap(); let pgid = client.server_spec().process_group_id; procutil::setup_signal_handler_once(pid, pgid)?; Ok(client) }) .and_then(|client| client.run_command_chg(handler, env::args_os().skip(1))) .map(|(_client, _handler, code)| { procutil::restore_signal_handler_once()?; Ok(code) }) .or_else(|err| Ok(Err(err))) // pass back error to caller .map(|res| result_tx.send(res).unwrap()); tokio::run(fut); result_rx.wait().unwrap_or(Err(io::Error::new( io::ErrorKind::Other, "no exit code set", ))) } mercurial-5.3.1/rust/Cargo.toml0000644015407300116100000000013413627755404016333 0ustar augieeng00000000000000[workspace] members = ["hg-core", "hg-direct-ffi", "hg-cpython"] exclude = ["chg", "hgcli"] mercurial-5.3.1/rust/hg-direct-ffi/0000755015407300116100000000000013627755444017021 5ustar augieeng00000000000000mercurial-5.3.1/rust/hg-direct-ffi/Cargo.toml0000644015407300116100000000043613627755405020751 0ustar augieeng00000000000000[package] name = "hgdirectffi" version = "0.1.0" authors = ["Georges Racinet "] description = "Low level Python bindings for hg-core, going through existing C extensions" [dependencies] libc = "*" hg-core = { path = "../hg-core" } [lib] crate-type = ["staticlib"] mercurial-5.3.1/rust/hg-direct-ffi/rustfmt.toml0000644015407300116100000000010213627755404021407 0ustar augieeng00000000000000max_width = 79 wrap_comments = true error_on_line_overflow = true mercurial-5.3.1/rust/hg-direct-ffi/src/0000755015407300116100000000000013627755444017610 5ustar augieeng00000000000000mercurial-5.3.1/rust/hg-direct-ffi/src/ancestors.rs0000644015407300116100000001632513627755405022163 0ustar augieeng00000000000000// Copyright 2018 Georges Racinet // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Bindings for CPython extension code //! //! This exposes methods to build and use a `rustlazyancestors` iterator //! from C code, using an index and its parents function that are passed //! from the caller at instantiation. use hg::AncestorsIterator; use hg::{Graph, GraphError, Revision, NULL_REVISION}; use libc::{c_int, c_long, c_void, ssize_t}; use std::ptr::null_mut; use std::slice; type IndexPtr = *mut c_void; extern "C" { fn HgRevlogIndex_GetParents( op: IndexPtr, rev: c_int, parents: *mut [c_int; 2], ) -> c_int; } /// A Graph backed up by objects and functions from revlog.c /// /// This implementation of the Graph trait, relies on (pointers to) /// - the C index object (`index` member) /// - the `index_get_parents()` function (`parents` member) pub struct Index { index: IndexPtr, } impl Index { pub fn new(index: IndexPtr) -> Self { Index { index: index } } } impl Graph for Index { /// wrap a call to the C extern parents function fn parents(&self, rev: Revision) -> Result<[Revision; 2], GraphError> { let mut res: [c_int; 2] = [0; 2]; let code = unsafe { HgRevlogIndex_GetParents( self.index, rev, &mut res as *mut [c_int; 2], ) }; match code { 0 => Ok(res), _ => Err(GraphError::ParentOutOfRange(rev)), } } } /// Wrapping of AncestorsIterator constructor, for C callers. /// /// Besides `initrevs`, `stoprev` and `inclusive`, that are converted /// we receive the index and the parents function as pointers #[no_mangle] pub extern "C" fn rustlazyancestors_init( index: IndexPtr, initrevslen: ssize_t, initrevs: *mut c_long, stoprev: c_long, inclusive: c_int, ) -> *mut AncestorsIterator { assert!(initrevslen >= 0); unsafe { raw_init( Index::new(index), initrevslen as usize, initrevs, stoprev, inclusive, ) } } /// Testable (for any Graph) version of rustlazyancestors_init #[inline] unsafe fn raw_init( graph: G, initrevslen: usize, initrevs: *mut c_long, stoprev: c_long, inclusive: c_int, ) -> *mut AncestorsIterator { let inclb = match inclusive { 0 => false, 1 => true, _ => { return null_mut(); } }; let slice = slice::from_raw_parts(initrevs, initrevslen); Box::into_raw(Box::new( match AncestorsIterator::new( graph, slice.into_iter().map(|&r| r as Revision), stoprev as Revision, inclb, ) { Ok(it) => it, Err(_) => { return null_mut(); } }, )) } /// Deallocator to be called from C code #[no_mangle] pub extern "C" fn rustlazyancestors_drop( raw_iter: *mut AncestorsIterator, ) { raw_drop(raw_iter); } /// Testable (for any Graph) version of rustlazayancestors_drop #[inline] fn raw_drop(raw_iter: *mut AncestorsIterator) { unsafe { Box::from_raw(raw_iter); } } /// Iteration main method to be called from C code /// /// We convert the end of iteration into NULL_REVISION, /// it will be up to the C wrapper to convert that back into a Python end of /// iteration #[no_mangle] pub extern "C" fn rustlazyancestors_next( raw: *mut AncestorsIterator, ) -> c_long { raw_next(raw) } /// Testable (for any Graph) version of rustlazayancestors_next #[inline] fn raw_next(raw: *mut AncestorsIterator) -> c_long { let as_ref = unsafe { &mut *raw }; let rev = match as_ref.next() { Some(Ok(rev)) => rev, Some(Err(_)) | None => NULL_REVISION, }; rev as c_long } #[no_mangle] pub extern "C" fn rustlazyancestors_contains( raw: *mut AncestorsIterator, target: c_long, ) -> c_int { raw_contains(raw, target) } /// Testable (for any Graph) version of rustlazayancestors_next #[inline] fn raw_contains( raw: *mut AncestorsIterator, target: c_long, ) -> c_int { let as_ref = unsafe { &mut *raw }; match as_ref.contains(target as Revision) { Ok(r) => r as c_int, Err(_) => -1, } } #[cfg(test)] mod tests { use super::*; use std::thread; #[derive(Clone, Debug)] struct Stub; impl Graph for Stub { fn parents(&self, r: Revision) -> Result<[Revision; 2], GraphError> { match r { 25 => Err(GraphError::ParentOutOfRange(25)), _ => Ok([1, 2]), } } } /// Helper for test_init_next() fn stub_raw_init( initrevslen: usize, initrevs: usize, stoprev: c_long, inclusive: c_int, ) -> usize { unsafe { raw_init( Stub, initrevslen, initrevs as *mut c_long, stoprev, inclusive, ) as usize } } fn stub_raw_init_from_vec( mut initrevs: Vec, stoprev: c_long, inclusive: c_int, ) -> *mut AncestorsIterator { unsafe { raw_init( Stub, initrevs.len(), initrevs.as_mut_ptr(), stoprev, inclusive, ) } } #[test] // Test what happens when we init an Iterator as with the exposed C ABI // and try to use it afterwards // We spawn new threads, in order to make memory consistency harder // but this forces us to convert the pointers into shareable usizes. fn test_init_next() { let mut initrevs: Vec = vec![11, 13]; let initrevs_len = initrevs.len(); let initrevs_ptr = initrevs.as_mut_ptr() as usize; let handler = thread::spawn(move || { stub_raw_init(initrevs_len, initrevs_ptr, 0, 1) }); let raw = handler.join().unwrap() as *mut AncestorsIterator; assert_eq!(raw_next(raw), 13); assert_eq!(raw_next(raw), 11); assert_eq!(raw_next(raw), 2); assert_eq!(raw_next(raw), 1); assert_eq!(raw_next(raw), NULL_REVISION as c_long); raw_drop(raw); } #[test] fn test_init_wrong_bool() { assert_eq!(stub_raw_init_from_vec(vec![11, 13], 0, 2), null_mut()); } #[test] fn test_empty() { let raw = stub_raw_init_from_vec(vec![], 0, 1); assert_eq!(raw_next(raw), NULL_REVISION as c_long); raw_drop(raw); } #[test] fn test_init_err_out_of_range() { assert!(stub_raw_init_from_vec(vec![25], 0, 0).is_null()); } #[test] fn test_contains() { let raw = stub_raw_init_from_vec(vec![5, 6], 0, 1); assert_eq!(raw_contains(raw, 5), 1); assert_eq!(raw_contains(raw, 2), 1); } #[test] fn test_contains_exclusive() { let raw = stub_raw_init_from_vec(vec![5, 6], 0, 0); assert_eq!(raw_contains(raw, 5), 0); assert_eq!(raw_contains(raw, 2), 1); } } mercurial-5.3.1/rust/hg-direct-ffi/src/lib.rs0000644015407300116100000000114113627755405020716 0ustar augieeng00000000000000// Copyright 2018 Georges Racinet // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Bindings for CPython extension code //! //! This exposes methods to build and use a `rustlazyancestors` iterator //! from C code, using an index and its parents function that are passed //! from the caller at instantiation. extern crate hg; extern crate libc; mod ancestors; pub use ancestors::{ rustlazyancestors_contains, rustlazyancestors_drop, rustlazyancestors_init, rustlazyancestors_next, }; mercurial-5.3.1/rust/Cargo.lock0000644015407300116100000005525013627755405016322 0ustar augieeng00000000000000# This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] name = "aho-corasick" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "arrayvec" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "autocfg" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "bitflags" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "byteorder" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "c2-chacha" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cfg-if" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cloudabi" version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cpython" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "python27-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "python3-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-deque" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-epoch" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-queue" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-utils" version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "either" version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "fuchsia-cprng" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "getrandom" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)", "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "hg-core" version = "0.1.0" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "twox-hash 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "hg-cpython" version = "0.1.0" dependencies = [ "cpython 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "hg-core 0.1.0", "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "hgdirectffi" version = "0.1.0" dependencies = [ "hg-core 0.1.0", "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" version = "0.2.64" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "memchr" version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "memoffset" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "nodrop" version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "num-traits" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num_cpus" version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ppv-lite86" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "python27-sys" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "python3-sys" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_chacha" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_chacha" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_core" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_core" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_hc" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_hc" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_isaac" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_jitter" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_os" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_pcg" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_xorshift" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rayon" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "rayon-core 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rayon-core" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rdrand" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex" version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "rustc_version" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "scopeguard" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "semver" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "semver-parser" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "thread_local" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "twox-hash" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasi" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] "checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" "checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" "checksum autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875" "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" "checksum c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101" "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum cpython 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85532c648315aeb0829ad216a6a29aa3212cf9319bc7f6daf1404aa0bdd1485f" "checksum crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b18cd2e169ad86297e6bc0ad9aa679aee9daa4f19e8163860faf7c164e4f5a71" "checksum crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9" "checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" "checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" "checksum getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "473a1265acc8ff1e808cd0a1af8cee3c2ee5200916058a2ca113c29f2d903571" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" "checksum libc 0.2.64 (registry+https://github.com/rust-lang/crates.io-index)" = "74dfca3d9957906e8d1e6a0b641dc9a59848e793f1da2165889fd4f62d10d79c" "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" "checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f" "checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" "checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32" "checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273" "checksum ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b" "checksum python27-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "372555e88a6bc8109eb641380240dc8d25a128fc48363ec9075664daadffdd5b" "checksum python3-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f3a8ebed3f1201fda179f3960609dbbc10cd8c75e9f2afcb03788278f367d8ea" "checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" "checksum rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412" "checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" "checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" "checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" "checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" "checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" "checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" "checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" "checksum rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" "checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" "checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" "checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" "checksum rayon 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "83a27732a533a1be0a0035a111fe76db89ad312f6f0347004c220c57f209a123" "checksum rayon-core 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "98dcf634205083b17d0861252431eb2acbfb698ab7478a2d20de07954f47ec7b" "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd" "checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" "checksum twox-hash 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bfd5b7557925ce778ff9b9ef90e3ade34c524b5ff10e239c69a42d546d2af56" "checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" mercurial-5.3.1/rust/hg-cpython/0000755015407300116100000000000013627755444016471 5ustar augieeng00000000000000mercurial-5.3.1/rust/hg-cpython/Cargo.toml0000644015407300116100000000131413627755404020414 0ustar augieeng00000000000000[package] name = "hg-cpython" version = "0.1.0" authors = ["Georges Racinet "] edition = "2018" [lib] name='rusthg' crate-type = ["cdylib"] [features] default = ["python27"] # Features to build an extension module: python27 = ["cpython/python27-sys", "cpython/extension-module-2-7"] python3 = ["cpython/python3-sys", "cpython/extension-module"] # Enable one of these features to build a test executable linked to libpython: # e.g. cargo test --no-default-features --features python27-bin python27-bin = ["cpython/python27-sys"] python3-bin = ["cpython/python3-sys"] [dependencies] hg-core = { path = "../hg-core" } libc = '*' [dependencies.cpython] version = "0.3" default-features = false mercurial-5.3.1/rust/hg-cpython/rustfmt.toml0000644015407300116100000000010213627755404021057 0ustar augieeng00000000000000max_width = 79 wrap_comments = true error_on_line_overflow = true mercurial-5.3.1/rust/hg-cpython/src/0000755015407300116100000000000013627755444017260 5ustar augieeng00000000000000mercurial-5.3.1/rust/hg-cpython/src/parsers.rs0000644015407300116100000001230113627755405021277 0ustar augieeng00000000000000// parsers.rs // // Copyright 2019 Raphaël Gomès // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Bindings for the `hg::dirstate::parsers` module provided by the //! `hg-core` package. //! //! From Python, this will be seen as `mercurial.rustext.parsers` use cpython::{ exc, PyBytes, PyDict, PyErr, PyInt, PyModule, PyResult, PyTuple, Python, PythonObject, ToPyObject, }; use hg::{ pack_dirstate, parse_dirstate, utils::hg_path::HgPathBuf, DirstatePackError, DirstateParents, DirstateParseError, FastHashMap, PARENT_SIZE, }; use std::convert::TryInto; use crate::dirstate::{extract_dirstate, make_dirstate_tuple}; use std::time::Duration; fn parse_dirstate_wrapper( py: Python, dmap: PyDict, copymap: PyDict, st: PyBytes, ) -> PyResult { let mut dirstate_map = FastHashMap::default(); let mut copies = FastHashMap::default(); match parse_dirstate(&mut dirstate_map, &mut copies, st.data(py)) { Ok(parents) => { for (filename, entry) in &dirstate_map { dmap.set_item( py, PyBytes::new(py, filename.as_ref()), make_dirstate_tuple(py, entry)?, )?; } for (path, copy_path) in copies { copymap.set_item( py, PyBytes::new(py, path.as_ref()), PyBytes::new(py, copy_path.as_ref()), )?; } Ok( (PyBytes::new(py, &parents.p1), PyBytes::new(py, &parents.p2)) .to_py_object(py), ) } Err(e) => Err(PyErr::new::( py, match e { DirstateParseError::TooLittleData => { "too little data for parents".to_string() } DirstateParseError::Overflow => { "overflow in dirstate".to_string() } DirstateParseError::CorruptedEntry(e) => e, DirstateParseError::Damaged => { "dirstate appears to be damaged".to_string() } }, )), } } fn pack_dirstate_wrapper( py: Python, dmap: PyDict, copymap: PyDict, pl: PyTuple, now: PyInt, ) -> PyResult { let p1 = pl.get_item(py, 0).extract::(py)?; let p1: &[u8] = p1.data(py); let p2 = pl.get_item(py, 1).extract::(py)?; let p2: &[u8] = p2.data(py); let mut dirstate_map = extract_dirstate(py, &dmap)?; let copies: Result, PyErr> = copymap .items(py) .iter() .map(|(key, value)| { Ok(( HgPathBuf::from_bytes(key.extract::(py)?.data(py)), HgPathBuf::from_bytes(value.extract::(py)?.data(py)), )) }) .collect(); if p1.len() != PARENT_SIZE || p2.len() != PARENT_SIZE { return Err(PyErr::new::( py, "expected a 20-byte hash".to_string(), )); } match pack_dirstate( &mut dirstate_map, &copies?, DirstateParents { p1: p1.try_into().unwrap(), p2: p2.try_into().unwrap(), }, Duration::from_secs(now.as_object().extract::(py)?), ) { Ok(packed) => { for (filename, entry) in &dirstate_map { dmap.set_item( py, PyBytes::new(py, filename.as_ref()), make_dirstate_tuple(py, entry)?, )?; } Ok(PyBytes::new(py, &packed)) } Err(error) => Err(PyErr::new::( py, match error { DirstatePackError::CorruptedParent => { "expected a 20-byte hash".to_string() } DirstatePackError::CorruptedEntry(e) => e, DirstatePackError::BadSize(expected, actual) => { format!("bad dirstate size: {} != {}", actual, expected) } }, )), } } /// Create the module, with `__package__` given from parent pub fn init_parsers_module(py: Python, package: &str) -> PyResult { let dotted_name = &format!("{}.parsers", package); let m = PyModule::new(py, dotted_name)?; m.add(py, "__package__", package)?; m.add(py, "__doc__", "Parsers - Rust implementation")?; m.add( py, "parse_dirstate", py_fn!( py, parse_dirstate_wrapper(dmap: PyDict, copymap: PyDict, st: PyBytes) ), )?; m.add( py, "pack_dirstate", py_fn!( py, pack_dirstate_wrapper( dmap: PyDict, copymap: PyDict, pl: PyTuple, now: PyInt ) ), )?; let sys = PyModule::import(py, "sys")?; let sys_modules: PyDict = sys.get(py, "modules")?.extract(py)?; sys_modules.set_item(py, dotted_name, &m)?; Ok(m) } mercurial-5.3.1/rust/hg-cpython/src/ref_sharing.rs0000644015407300116100000005103313627755405022114 0ustar augieeng00000000000000// ref_sharing.rs // // Copyright 2019 Raphaël Gomès // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. //! Macros for use in the `hg-cpython` bridge library. use crate::exceptions::AlreadyBorrowed; use cpython::{exc, PyClone, PyErr, PyObject, PyResult, Python}; use std::cell::{Ref, RefCell, RefMut}; use std::ops::{Deref, DerefMut}; use std::sync::atomic::{AtomicUsize, Ordering}; /// Manages the shared state between Python and Rust /// /// `PySharedState` is owned by `PySharedRefCell`, and is shared across its /// derived references. The consistency of these references are guaranteed /// as follows: /// /// - The immutability of `py_class!` object fields. Any mutation of /// `PySharedRefCell` is allowed only through its `borrow_mut()`. /// - The `py: Python<'_>` token, which makes sure that any data access is /// synchronized by the GIL. /// - The underlying `RefCell`, which prevents `PySharedRefCell` data from /// being directly borrowed or leaked while it is mutably borrowed. /// - The `borrow_count`, which is the number of references borrowed from /// `PyLeaked`. Just like `RefCell`, mutation is prohibited while `PyLeaked` /// is borrowed. /// - The `generation` counter, which increments on `borrow_mut()`. `PyLeaked` /// reference is valid only if the `current_generation()` equals to the /// `generation` at the time of `leak_immutable()`. #[derive(Debug, Default)] struct PySharedState { // The counter variable could be Cell since any operation on // PySharedState is synchronized by the GIL, but being "atomic" makes // PySharedState inherently Sync. The ordering requirement doesn't // matter thanks to the GIL. borrow_count: AtomicUsize, generation: AtomicUsize, } impl PySharedState { fn borrow_mut<'a, T>( &'a self, py: Python<'a>, pyrefmut: RefMut<'a, T>, ) -> PyResult> { match self.current_borrow_count(py) { 0 => { // Note that this wraps around to the same value if mutably // borrowed more than usize::MAX times, which wouldn't happen // in practice. self.generation.fetch_add(1, Ordering::Relaxed); Ok(pyrefmut) } _ => Err(AlreadyBorrowed::new( py, "Cannot borrow mutably while immutably borrowed", )), } } /// Return a reference to the wrapped data and its state with an /// artificial static lifetime. /// We need to be protected by the GIL for thread-safety. /// /// # Safety /// /// This is highly unsafe since the lifetime of the given data can be /// extended. Do not call this function directly. unsafe fn leak_immutable( &self, _py: Python, data: Ref, ) -> (&'static T, &'static PySharedState) { let ptr: *const T = &*data; let state_ptr: *const PySharedState = self; (&*ptr, &*state_ptr) } fn current_borrow_count(&self, _py: Python) -> usize { self.borrow_count.load(Ordering::Relaxed) } fn increase_borrow_count(&self, _py: Python) { // Note that this wraps around if there are more than usize::MAX // borrowed references, which shouldn't happen due to memory limit. self.borrow_count.fetch_add(1, Ordering::Relaxed); } fn decrease_borrow_count(&self, _py: Python) { let prev_count = self.borrow_count.fetch_sub(1, Ordering::Relaxed); assert!(prev_count > 0); } fn current_generation(&self, _py: Python) -> usize { self.generation.load(Ordering::Relaxed) } } /// Helper to keep the borrow count updated while the shared object is /// immutably borrowed without using the `RefCell` interface. struct BorrowPyShared<'a> { py: Python<'a>, py_shared_state: &'a PySharedState, } impl<'a> BorrowPyShared<'a> { fn new( py: Python<'a>, py_shared_state: &'a PySharedState, ) -> BorrowPyShared<'a> { py_shared_state.increase_borrow_count(py); BorrowPyShared { py, py_shared_state, } } } impl Drop for BorrowPyShared<'_> { fn drop(&mut self) { self.py_shared_state.decrease_borrow_count(self.py); } } /// `RefCell` wrapper to be safely used in conjunction with `PySharedState`. /// /// This object can be stored in a `py_class!` object as a data field. Any /// operation is allowed through the `PySharedRef` interface. #[derive(Debug)] pub struct PySharedRefCell { inner: RefCell, py_shared_state: PySharedState, } impl PySharedRefCell { pub fn new(value: T) -> PySharedRefCell { Self { inner: RefCell::new(value), py_shared_state: PySharedState::default(), } } fn borrow<'a>(&'a self, _py: Python<'a>) -> Ref<'a, T> { // py_shared_state isn't involved since // - inner.borrow() would fail if self is mutably borrowed, // - and inner.borrow_mut() would fail while self is borrowed. self.inner.borrow() } // TODO: maybe this should be named as try_borrow_mut(), and use // inner.try_borrow_mut(). The current implementation panics if // self.inner has been borrowed, but returns error if py_shared_state // refuses to borrow. fn borrow_mut<'a>(&'a self, py: Python<'a>) -> PyResult> { self.py_shared_state.borrow_mut(py, self.inner.borrow_mut()) } } /// Sharable data member of type `T` borrowed from the `PyObject`. pub struct PySharedRef<'a, T> { py: Python<'a>, owner: &'a PyObject, data: &'a PySharedRefCell, } impl<'a, T> PySharedRef<'a, T> { /// # Safety /// /// The `data` must be owned by the `owner`. Otherwise, the leak count /// would get wrong. pub unsafe fn new( py: Python<'a>, owner: &'a PyObject, data: &'a PySharedRefCell, ) -> Self { Self { py, owner, data } } pub fn borrow(&self) -> Ref<'a, T> { self.data.borrow(self.py) } pub fn borrow_mut(&self) -> PyResult> { self.data.borrow_mut(self.py) } /// Returns a leaked reference. /// /// # Panics /// /// Panics if this is mutably borrowed. pub fn leak_immutable(&self) -> PyLeaked<&'static T> { let state = &self.data.py_shared_state; // make sure self.data isn't mutably borrowed; otherwise the // generation number can't be trusted. let data_ref = self.borrow(); unsafe { let (static_ref, static_state_ref) = state.leak_immutable(self.py, data_ref); PyLeaked::new(self.py, self.owner, static_ref, static_state_ref) } } } /// Allows a `py_class!` generated struct to share references to one of its /// data members with Python. /// /// # Parameters /// /// * `$name` is the same identifier used in for `py_class!` macro call. /// * `$inner_struct` is the identifier of the underlying Rust struct /// * `$data_member` is the identifier of the data member of `$inner_struct` /// that will be shared. /// * `$shared_accessor` is the function name to be generated, which allows /// safe access to the data member. /// /// # Safety /// /// `$data_member` must persist while the `$name` object is alive. In other /// words, it must be an accessor to a data field of the Python object. /// /// # Example /// /// ``` /// struct MyStruct { /// inner: Vec; /// } /// /// py_class!(pub class MyType |py| { /// data inner: PySharedRefCell; /// }); /// /// py_shared_ref!(MyType, MyStruct, inner, inner_shared); /// ``` macro_rules! py_shared_ref { ( $name: ident, $inner_struct: ident, $data_member: ident, $shared_accessor: ident ) => { impl $name { /// Returns a safe reference to the shared `$data_member`. /// /// This function guarantees that `PySharedRef` is created with /// the valid `self` and `self.$data_member(py)` pair. fn $shared_accessor<'a>( &'a self, py: Python<'a>, ) -> $crate::ref_sharing::PySharedRef<'a, $inner_struct> { use cpython::PythonObject; use $crate::ref_sharing::PySharedRef; let owner = self.as_object(); let data = self.$data_member(py); unsafe { PySharedRef::new(py, owner, data) } } } }; } /// Manage immutable references to `PyObject` leaked into Python iterators. /// /// This reference will be invalidated once the original value is mutably /// borrowed. pub struct PyLeaked { inner: PyObject, data: Option, py_shared_state: &'static PySharedState, /// Generation counter of data `T` captured when PyLeaked is created. generation: usize, } // DO NOT implement Deref for PyLeaked! Dereferencing PyLeaked // without taking Python GIL wouldn't be safe. Also, the underling reference // is invalid if generation != py_shared_state.generation. impl PyLeaked { /// # Safety /// /// The `py_shared_state` must be owned by the `inner` Python object. fn new( py: Python, inner: &PyObject, data: T, py_shared_state: &'static PySharedState, ) -> Self { Self { inner: inner.clone_ref(py), data: Some(data), py_shared_state, generation: py_shared_state.current_generation(py), } } /// Immutably borrows the wrapped value. /// /// Borrowing fails if the underlying reference has been invalidated. pub fn try_borrow<'a>( &'a self, py: Python<'a>, ) -> PyResult> { self.validate_generation(py)?; Ok(PyLeakedRef { _borrow: BorrowPyShared::new(py, self.py_shared_state), data: self.data.as_ref().unwrap(), }) } /// Mutably borrows the wrapped value. /// /// Borrowing fails if the underlying reference has been invalidated. /// /// Typically `T` is an iterator. If `T` is an immutable reference, /// `get_mut()` is useless since the inner value can't be mutated. pub fn try_borrow_mut<'a>( &'a mut self, py: Python<'a>, ) -> PyResult> { self.validate_generation(py)?; Ok(PyLeakedRefMut { _borrow: BorrowPyShared::new(py, self.py_shared_state), data: self.data.as_mut().unwrap(), }) } /// Converts the inner value by the given function. /// /// Typically `T` is a static reference to a container, and `U` is an /// iterator of that container. /// /// # Panics /// /// Panics if the underlying reference has been invalidated. /// /// This is typically called immediately after the `PyLeaked` is obtained. /// In which case, the reference must be valid and no panic would occur. /// /// # Safety /// /// The lifetime of the object passed in to the function `f` is cheated. /// It's typically a static reference, but is valid only while the /// corresponding `PyLeaked` is alive. Do not copy it out of the /// function call. pub unsafe fn map( mut self, py: Python, f: impl FnOnce(T) -> U, ) -> PyLeaked { // Needs to test the generation value to make sure self.data reference // is still intact. self.validate_generation(py) .expect("map() over invalidated leaked reference"); // f() could make the self.data outlive. That's why map() is unsafe. // In order to make this function safe, maybe we'll need a way to // temporarily restrict the lifetime of self.data and translate the // returned object back to Something<'static>. let new_data = f(self.data.take().unwrap()); PyLeaked { inner: self.inner.clone_ref(py), data: Some(new_data), py_shared_state: self.py_shared_state, generation: self.generation, } } fn validate_generation(&self, py: Python) -> PyResult<()> { if self.py_shared_state.current_generation(py) == self.generation { Ok(()) } else { Err(PyErr::new::( py, "Cannot access to leaked reference after mutation", )) } } } /// Immutably borrowed reference to a leaked value. pub struct PyLeakedRef<'a, T> { _borrow: BorrowPyShared<'a>, data: &'a T, } impl Deref for PyLeakedRef<'_, T> { type Target = T; fn deref(&self) -> &T { self.data } } /// Mutably borrowed reference to a leaked value. pub struct PyLeakedRefMut<'a, T> { _borrow: BorrowPyShared<'a>, data: &'a mut T, } impl Deref for PyLeakedRefMut<'_, T> { type Target = T; fn deref(&self) -> &T { self.data } } impl DerefMut for PyLeakedRefMut<'_, T> { fn deref_mut(&mut self) -> &mut T { self.data } } /// Defines a `py_class!` that acts as a Python iterator over a Rust iterator. /// /// TODO: this is a bit awkward to use, and a better (more complicated) /// procedural macro would simplify the interface a lot. /// /// # Parameters /// /// * `$name` is the identifier to give to the resulting Rust struct. /// * `$leaked` corresponds to `$leaked` in the matching `py_shared_ref!` call. /// * `$iterator_type` is the type of the Rust iterator. /// * `$success_func` is a function for processing the Rust `(key, value)` /// tuple on iteration success, turning it into something Python understands. /// * `$success_func` is the return type of `$success_func` /// /// # Example /// /// ``` /// struct MyStruct { /// inner: HashMap, Vec>; /// } /// /// py_class!(pub class MyType |py| { /// data inner: PySharedRefCell; /// /// def __iter__(&self) -> PyResult { /// let leaked_ref = self.inner_shared(py).leak_immutable(); /// MyTypeItemsIterator::from_inner( /// py, /// unsafe { leaked_ref.map(py, |o| o.iter()) }, /// ) /// } /// }); /// /// impl MyType { /// fn translate_key_value( /// py: Python, /// res: (&Vec, &Vec), /// ) -> PyResult> { /// let (f, entry) = res; /// Ok(Some(( /// PyBytes::new(py, f), /// PyBytes::new(py, entry), /// ))) /// } /// } /// /// py_shared_ref!(MyType, MyStruct, inner, MyTypeLeakedRef); /// /// py_shared_iterator!( /// MyTypeItemsIterator, /// PyLeaked, Vec>>, /// MyType::translate_key_value, /// Option<(PyBytes, PyBytes)> /// ); /// ``` macro_rules! py_shared_iterator { ( $name: ident, $leaked: ty, $success_func: expr, $success_type: ty ) => { py_class!(pub class $name |py| { data inner: RefCell<$leaked>; def __next__(&self) -> PyResult<$success_type> { let mut leaked = self.inner(py).borrow_mut(); let mut iter = leaked.try_borrow_mut(py)?; match iter.next() { None => Ok(None), Some(res) => $success_func(py, res), } } def __iter__(&self) -> PyResult { Ok(self.clone_ref(py)) } }); impl $name { pub fn from_inner( py: Python, leaked: $leaked, ) -> PyResult { Self::create_instance( py, RefCell::new(leaked), ) } } }; } #[cfg(test)] #[cfg(any(feature = "python27-bin", feature = "python3-bin"))] mod test { use super::*; use cpython::{GILGuard, Python}; py_class!(class Owner |py| { data string: PySharedRefCell; }); py_shared_ref!(Owner, String, string, string_shared); fn prepare_env() -> (GILGuard, Owner) { let gil = Python::acquire_gil(); let py = gil.python(); let owner = Owner::create_instance(py, PySharedRefCell::new("new".to_owned())) .unwrap(); (gil, owner) } #[test] fn test_leaked_borrow() { let (gil, owner) = prepare_env(); let py = gil.python(); let leaked = owner.string_shared(py).leak_immutable(); let leaked_ref = leaked.try_borrow(py).unwrap(); assert_eq!(*leaked_ref, "new"); } #[test] fn test_leaked_borrow_mut() { let (gil, owner) = prepare_env(); let py = gil.python(); let leaked = owner.string_shared(py).leak_immutable(); let mut leaked_iter = unsafe { leaked.map(py, |s| s.chars()) }; let mut leaked_ref = leaked_iter.try_borrow_mut(py).unwrap(); assert_eq!(leaked_ref.next(), Some('n')); assert_eq!(leaked_ref.next(), Some('e')); assert_eq!(leaked_ref.next(), Some('w')); assert_eq!(leaked_ref.next(), None); } #[test] fn test_leaked_borrow_after_mut() { let (gil, owner) = prepare_env(); let py = gil.python(); let leaked = owner.string_shared(py).leak_immutable(); owner.string_shared(py).borrow_mut().unwrap().clear(); assert!(leaked.try_borrow(py).is_err()); } #[test] fn test_leaked_borrow_mut_after_mut() { let (gil, owner) = prepare_env(); let py = gil.python(); let leaked = owner.string_shared(py).leak_immutable(); let mut leaked_iter = unsafe { leaked.map(py, |s| s.chars()) }; owner.string_shared(py).borrow_mut().unwrap().clear(); assert!(leaked_iter.try_borrow_mut(py).is_err()); } #[test] #[should_panic(expected = "map() over invalidated leaked reference")] fn test_leaked_map_after_mut() { let (gil, owner) = prepare_env(); let py = gil.python(); let leaked = owner.string_shared(py).leak_immutable(); owner.string_shared(py).borrow_mut().unwrap().clear(); let _leaked_iter = unsafe { leaked.map(py, |s| s.chars()) }; } #[test] fn test_borrow_mut_while_leaked_ref() { let (gil, owner) = prepare_env(); let py = gil.python(); assert!(owner.string_shared(py).borrow_mut().is_ok()); let leaked = owner.string_shared(py).leak_immutable(); { let _leaked_ref = leaked.try_borrow(py).unwrap(); assert!(owner.string_shared(py).borrow_mut().is_err()); { let _leaked_ref2 = leaked.try_borrow(py).unwrap(); assert!(owner.string_shared(py).borrow_mut().is_err()); } assert!(owner.string_shared(py).borrow_mut().is_err()); } assert!(owner.string_shared(py).borrow_mut().is_ok()); } #[test] fn test_borrow_mut_while_leaked_ref_mut() { let (gil, owner) = prepare_env(); let py = gil.python(); assert!(owner.string_shared(py).borrow_mut().is_ok()); let leaked = owner.string_shared(py).leak_immutable(); let mut leaked_iter = unsafe { leaked.map(py, |s| s.chars()) }; { let _leaked_ref = leaked_iter.try_borrow_mut(py).unwrap(); assert!(owner.string_shared(py).borrow_mut().is_err()); } assert!(owner.string_shared(py).borrow_mut().is_ok()); } #[test] #[should_panic(expected = "mutably borrowed")] fn test_leak_while_borrow_mut() { let (gil, owner) = prepare_env(); let py = gil.python(); let _mut_ref = owner.string_shared(py).borrow_mut(); owner.string_shared(py).leak_immutable(); } } mercurial-5.3.1/rust/hg-cpython/src/ancestors.rs0000644015407300116100000002024013627755405021622 0ustar augieeng00000000000000// ancestors.rs // // Copyright 2018 Georges Racinet // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Bindings for the `hg::ancestors` module provided by the //! `hg-core` crate. From Python, this will be seen as `rustext.ancestor` //! and can be used as replacement for the the pure `ancestor` Python module. //! //! # Classes visible from Python: //! - [`LazyAncestors`] is the Rust implementation of //! `mercurial.ancestor.lazyancestors`. The only difference is that it is //! instantiated with a C `parsers.index` instance instead of a parents //! function. //! //! - [`MissingAncestors`] is the Rust implementation of //! `mercurial.ancestor.incrementalmissingancestors`. //! //! API differences: //! + it is instantiated with a C `parsers.index` //! instance instead of a parents function. //! + `MissingAncestors.bases` is a method returning a tuple instead of //! a set-valued attribute. We could return a Python set easily if our //! [PySet PR](https://github.com/dgrunwald/rust-cpython/pull/165) //! is accepted. //! //! - [`AncestorsIterator`] is the Rust counterpart of the //! `ancestor._lazyancestorsiter` Python generator. From Python, instances of //! this should be mainly obtained by calling `iter()` on a [`LazyAncestors`] //! instance. //! //! [`LazyAncestors`]: struct.LazyAncestors.html //! [`MissingAncestors`]: struct.MissingAncestors.html //! [`AncestorsIterator`]: struct.AncestorsIterator.html use crate::revlog::pyindex_to_graph; use crate::{ cindex::Index, conversion::rev_pyiter_collect, exceptions::GraphError, }; use cpython::{ ObjectProtocol, PyClone, PyDict, PyList, PyModule, PyObject, PyResult, Python, PythonObject, ToPyObject, }; use hg::Revision; use hg::{ AncestorsIterator as CoreIterator, LazyAncestors as CoreLazy, MissingAncestors as CoreMissing, }; use std::cell::RefCell; use std::collections::HashSet; py_class!(pub class AncestorsIterator |py| { data inner: RefCell>>; def __next__(&self) -> PyResult> { match self.inner(py).borrow_mut().next() { Some(Err(e)) => Err(GraphError::pynew(py, e)), None => Ok(None), Some(Ok(r)) => Ok(Some(r)), } } def __contains__(&self, rev: Revision) -> PyResult { self.inner(py).borrow_mut().contains(rev) .map_err(|e| GraphError::pynew(py, e)) } def __iter__(&self) -> PyResult { Ok(self.clone_ref(py)) } def __new__(_cls, index: PyObject, initrevs: PyObject, stoprev: Revision, inclusive: bool) -> PyResult { let initvec: Vec = rev_pyiter_collect(py, &initrevs)?; let ait = CoreIterator::new( pyindex_to_graph(py, index)?, initvec, stoprev, inclusive, ) .map_err(|e| GraphError::pynew(py, e))?; AncestorsIterator::from_inner(py, ait) } }); impl AncestorsIterator { pub fn from_inner(py: Python, ait: CoreIterator) -> PyResult { Self::create_instance(py, RefCell::new(Box::new(ait))) } } py_class!(pub class LazyAncestors |py| { data inner: RefCell>>; def __contains__(&self, rev: Revision) -> PyResult { self.inner(py) .borrow_mut() .contains(rev) .map_err(|e| GraphError::pynew(py, e)) } def __iter__(&self) -> PyResult { AncestorsIterator::from_inner(py, self.inner(py).borrow().iter()) } def __bool__(&self) -> PyResult { Ok(!self.inner(py).borrow().is_empty()) } def __new__(_cls, index: PyObject, initrevs: PyObject, stoprev: Revision, inclusive: bool) -> PyResult { let initvec: Vec = rev_pyiter_collect(py, &initrevs)?; let lazy = CoreLazy::new(pyindex_to_graph(py, index)?, initvec, stoprev, inclusive) .map_err(|e| GraphError::pynew(py, e))?; Self::create_instance(py, RefCell::new(Box::new(lazy))) } }); py_class!(pub class MissingAncestors |py| { data inner: RefCell>>; def __new__(_cls, index: PyObject, bases: PyObject) -> PyResult { let bases_vec: Vec = rev_pyiter_collect(py, &bases)?; let inner = CoreMissing::new(pyindex_to_graph(py, index)?, bases_vec); MissingAncestors::create_instance(py, RefCell::new(Box::new(inner))) } def hasbases(&self) -> PyResult { Ok(self.inner(py).borrow().has_bases()) } def addbases(&self, bases: PyObject) -> PyResult { let mut inner = self.inner(py).borrow_mut(); let bases_vec: Vec = rev_pyiter_collect(py, &bases)?; inner.add_bases(bases_vec); // cpython doc has examples with PyResult<()> but this gives me // the trait `cpython::ToPyObject` is not implemented for `()` // so let's return an explicit None Ok(py.None()) } def bases(&self) -> PyResult> { Ok(self.inner(py).borrow().get_bases().clone()) } def basesheads(&self) -> PyResult> { let inner = self.inner(py).borrow(); inner.bases_heads().map_err(|e| GraphError::pynew(py, e)) } def removeancestorsfrom(&self, revs: PyObject) -> PyResult { let mut inner = self.inner(py).borrow_mut(); // this is very lame: we convert to a Rust set, update it in place // and then convert back to Python, only to have Python remove the // excess (thankfully, Python is happy with a list or even an iterator) // Leads to improve this: // - have the CoreMissing instead do something emit revisions to // discard // - define a trait for sets of revisions in the core and implement // it for a Python set rewrapped with the GIL marker let mut revs_pyset: HashSet = rev_pyiter_collect(py, &revs)?; inner.remove_ancestors_from(&mut revs_pyset) .map_err(|e| GraphError::pynew(py, e))?; // convert as Python list let mut remaining_pyint_vec: Vec = Vec::with_capacity( revs_pyset.len()); for rev in revs_pyset { remaining_pyint_vec.push(rev.to_py_object(py).into_object()); } let remaining_pylist = PyList::new(py, remaining_pyint_vec.as_slice()); revs.call_method(py, "intersection_update", (remaining_pylist, ), None) } def missingancestors(&self, revs: PyObject) -> PyResult { let mut inner = self.inner(py).borrow_mut(); let revs_vec: Vec = rev_pyiter_collect(py, &revs)?; let missing_vec = match inner.missing_ancestors(revs_vec) { Ok(missing) => missing, Err(e) => { return Err(GraphError::pynew(py, e)); } }; // convert as Python list let mut missing_pyint_vec: Vec = Vec::with_capacity( missing_vec.len()); for rev in missing_vec { missing_pyint_vec.push(rev.to_py_object(py).into_object()); } Ok(PyList::new(py, missing_pyint_vec.as_slice())) } }); /// Create the module, with __package__ given from parent pub fn init_module(py: Python, package: &str) -> PyResult { let dotted_name = &format!("{}.ancestor", package); let m = PyModule::new(py, dotted_name)?; m.add(py, "__package__", package)?; m.add( py, "__doc__", "Generic DAG ancestor algorithms - Rust implementation", )?; m.add_class::(py)?; m.add_class::(py)?; m.add_class::(py)?; let sys = PyModule::import(py, "sys")?; let sys_modules: PyDict = sys.get(py, "modules")?.extract(py)?; sys_modules.set_item(py, dotted_name, &m)?; // Example C code (see pyexpat.c and import.c) will "give away the // reference", but we won't because it will be consumed once the // Rust PyObject is dropped. Ok(m) } mercurial-5.3.1/rust/hg-cpython/src/conversion.rs0000644015407300116100000000202513627755404022006 0ustar augieeng00000000000000// conversion.rs // // Copyright 2019 Georges Racinet // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Bindings for the hg::ancestors module provided by the //! `hg-core` crate. From Python, this will be seen as `rustext.ancestor` use cpython::{ObjectProtocol, PyObject, PyResult, Python}; use hg::Revision; use std::iter::FromIterator; /// Utility function to convert a Python iterable into various collections /// /// We need this in particular to feed to various methods of inner objects /// with `impl IntoIterator` arguments, because /// a `PyErr` can arise at each step of iteration, whereas these methods /// expect iterables over `Revision`, not over some `Result` pub fn rev_pyiter_collect(py: Python, revs: &PyObject) -> PyResult where C: FromIterator, { revs.iter(py)? .map(|r| r.and_then(|o| o.extract::(py))) .collect() } mercurial-5.3.1/rust/hg-cpython/src/discovery.rs0000644015407300116100000001324313627755404021634 0ustar augieeng00000000000000// discovery.rs // // Copyright 2018 Georges Racinet // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Bindings for the `hg::discovery` module provided by the //! `hg-core` crate. From Python, this will be seen as `rustext.discovery` //! //! # Classes visible from Python: //! - [`PartialDiscover`] is the Rust implementation of //! `mercurial.setdiscovery.partialdiscovery`. use crate::{ cindex::Index, conversion::rev_pyiter_collect, exceptions::GraphError, }; use cpython::{ ObjectProtocol, PyDict, PyModule, PyObject, PyResult, PyTuple, Python, PythonObject, ToPyObject, }; use hg::discovery::PartialDiscovery as CorePartialDiscovery; use hg::Revision; use std::collections::HashSet; use std::cell::RefCell; use crate::revlog::pyindex_to_graph; py_class!(pub class PartialDiscovery |py| { data inner: RefCell>>; // `_respectsize` is currently only here to replicate the Python API and // will be used in future patches inside methods that are yet to be // implemented. def __new__( _cls, repo: PyObject, targetheads: PyObject, respectsize: bool, randomize: bool = true ) -> PyResult { let index = repo.getattr(py, "changelog")?.getattr(py, "index")?; Self::create_instance( py, RefCell::new(Box::new(CorePartialDiscovery::new( pyindex_to_graph(py, index)?, rev_pyiter_collect(py, &targetheads)?, respectsize, randomize, ))) ) } def addcommons(&self, commons: PyObject) -> PyResult { let mut inner = self.inner(py).borrow_mut(); let commons_vec: Vec = rev_pyiter_collect(py, &commons)?; inner.add_common_revisions(commons_vec) .map_err(|e| GraphError::pynew(py, e))?; Ok(py.None()) } def addmissings(&self, missings: PyObject) -> PyResult { let mut inner = self.inner(py).borrow_mut(); let missings_vec: Vec = rev_pyiter_collect(py, &missings)?; inner.add_missing_revisions(missings_vec) .map_err(|e| GraphError::pynew(py, e))?; Ok(py.None()) } def addinfo(&self, sample: PyObject) -> PyResult { let mut missing: Vec = Vec::new(); let mut common: Vec = Vec::new(); for info in sample.iter(py)? { // info is a pair (Revision, bool) let mut revknown = info?.iter(py)?; let rev: Revision = revknown.next().unwrap()?.extract(py)?; let known: bool = revknown.next().unwrap()?.extract(py)?; if known { common.push(rev); } else { missing.push(rev); } } let mut inner = self.inner(py).borrow_mut(); inner.add_common_revisions(common) .map_err(|e| GraphError::pynew(py, e))?; inner.add_missing_revisions(missing) .map_err(|e| GraphError::pynew(py, e))?; Ok(py.None()) } def hasinfo(&self) -> PyResult { Ok(self.inner(py).borrow().has_info()) } def iscomplete(&self) -> PyResult { Ok(self.inner(py).borrow().is_complete()) } def stats(&self) -> PyResult { let stats = self.inner(py).borrow().stats(); let as_dict: PyDict = PyDict::new(py); as_dict.set_item(py, "undecided", stats.undecided.map( |l| l.to_py_object(py).into_object()) .unwrap_or_else(|| py.None()))?; Ok(as_dict) } def commonheads(&self) -> PyResult> { self.inner(py).borrow().common_heads() .map_err(|e| GraphError::pynew(py, e)) } def takefullsample(&self, _headrevs: PyObject, size: usize) -> PyResult { let mut inner = self.inner(py).borrow_mut(); let sample = inner.take_full_sample(size) .map_err(|e| GraphError::pynew(py, e))?; let as_vec: Vec = sample .iter() .map(|rev| rev.to_py_object(py).into_object()) .collect(); Ok(PyTuple::new(py, as_vec.as_slice()).into_object()) } def takequicksample(&self, headrevs: PyObject, size: usize) -> PyResult { let mut inner = self.inner(py).borrow_mut(); let revsvec: Vec = rev_pyiter_collect(py, &headrevs)?; let sample = inner.take_quick_sample(revsvec, size) .map_err(|e| GraphError::pynew(py, e))?; let as_vec: Vec = sample .iter() .map(|rev| rev.to_py_object(py).into_object()) .collect(); Ok(PyTuple::new(py, as_vec.as_slice()).into_object()) } }); /// Create the module, with __package__ given from parent pub fn init_module(py: Python, package: &str) -> PyResult { let dotted_name = &format!("{}.discovery", package); let m = PyModule::new(py, dotted_name)?; m.add(py, "__package__", package)?; m.add( py, "__doc__", "Discovery of common node sets - Rust implementation", )?; m.add_class::(py)?; let sys = PyModule::import(py, "sys")?; let sys_modules: PyDict = sys.get(py, "modules")?.extract(py)?; sys_modules.set_item(py, dotted_name, &m)?; // Example C code (see pyexpat.c and import.c) will "give away the // reference", but we won't because it will be consumed once the // Rust PyObject is dropped. Ok(m) } mercurial-5.3.1/rust/hg-cpython/src/lib.rs0000644015407300116100000000450313627755405020373 0ustar augieeng00000000000000// lib.rs // // Copyright 2018 Georges Racinet // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Python bindings of `hg-core` objects using the `cpython` crate. //! Once compiled, the resulting single shared library object can be placed in //! the `mercurial` package directly as `rustext.so` or `rustext.dll`. //! It holds several modules, so that from the point of view of Python, //! it behaves as the `cext` package. //! //! Example: //! //! ```text //! >>> from mercurial.rustext import ancestor //! >>> ancestor.__doc__ //! 'Generic DAG ancestor algorithms - Rust implementation' //! ``` /// This crate uses nested private macros, `extern crate` is still needed in /// 2018 edition. #[macro_use] extern crate cpython; pub mod ancestors; mod cindex; mod conversion; #[macro_use] pub mod ref_sharing; pub mod dagops; pub mod dirstate; pub mod discovery; pub mod exceptions; pub mod filepatterns; pub mod parsers; pub mod revlog; pub mod utils; py_module_initializer!(rustext, initrustext, PyInit_rustext, |py, m| { m.add( py, "__doc__", "Mercurial core concepts - Rust implementation", )?; let dotted_name: String = m.get(py, "__name__")?.extract(py)?; m.add(py, "ancestor", ancestors::init_module(py, &dotted_name)?)?; m.add(py, "dagop", dagops::init_module(py, &dotted_name)?)?; m.add(py, "discovery", discovery::init_module(py, &dotted_name)?)?; m.add(py, "dirstate", dirstate::init_module(py, &dotted_name)?)?; m.add(py, "revlog", revlog::init_module(py, &dotted_name)?)?; m.add( py, "filepatterns", filepatterns::init_module(py, &dotted_name)?, )?; m.add( py, "parsers", parsers::init_parsers_module(py, &dotted_name)?, )?; m.add(py, "GraphError", py.get_type::())?; m.add( py, "PatternFileError", py.get_type::(), )?; m.add( py, "PatternError", py.get_type::(), )?; Ok(()) }); #[cfg(not(any(feature = "python27-bin", feature = "python3-bin")))] #[test] #[ignore] fn libpython_must_be_linked_to_run_tests() { // stub function to tell that some tests wouldn't run } mercurial-5.3.1/rust/hg-cpython/src/filepatterns.rs0000644015407300116100000001035113627755405022323 0ustar augieeng00000000000000// filepatterns.rs // // Copyright 2019, Georges Racinet , // Raphaël Gomès // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Bindings for the `hg::filepatterns` module provided by the //! `hg-core` crate. From Python, this will be seen as `rustext.filepatterns` //! and can be used as replacement for the the pure `filepatterns` Python //! module. use crate::exceptions::{PatternError, PatternFileError}; use cpython::{ PyBytes, PyDict, PyModule, PyObject, PyResult, PyTuple, Python, ToPyObject, }; use hg::utils::files; use hg::{build_single_regex, read_pattern_file, LineNumber, PatternTuple}; use std::path::PathBuf; /// Rust does not like functions with different return signatures. /// The 3-tuple version is always returned by the hg-core function, /// the (potential) conversion is handled at this level since it is not likely /// to have any measurable impact on performance. /// /// The Python implementation passes a function reference for `warn` instead /// of a boolean that is used to emit warnings while parsing. The Rust /// implementation chooses to accumulate the warnings and propagate them to /// Python upon completion. See the `readpatternfile` function in `match.py` /// for more details. fn read_pattern_file_wrapper( py: Python, file_path: PyObject, warn: bool, source_info: bool, ) -> PyResult { let bytes = file_path.extract::(py)?; let path = files::get_path_from_bytes(bytes.data(py)); match read_pattern_file(path, warn) { Ok((patterns, warnings)) => { if source_info { let itemgetter = |x: &PatternTuple| { (PyBytes::new(py, &x.0), x.1, PyBytes::new(py, &x.2)) }; let results: Vec<(PyBytes, LineNumber, PyBytes)> = patterns.iter().map(itemgetter).collect(); return Ok((results, warnings_to_py_bytes(py, &warnings)) .to_py_object(py)); } let itemgetter = |x: &PatternTuple| PyBytes::new(py, &x.0); let results: Vec = patterns.iter().map(itemgetter).collect(); Ok( (results, warnings_to_py_bytes(py, &warnings)) .to_py_object(py), ) } Err(e) => Err(PatternFileError::pynew(py, e)), } } fn warnings_to_py_bytes( py: Python, warnings: &[(PathBuf, Vec)], ) -> Vec<(PyBytes, PyBytes)> { warnings .iter() .map(|(path, syn)| { ( PyBytes::new(py, &files::get_bytes_from_path(path)), PyBytes::new(py, syn), ) }) .collect() } fn build_single_regex_wrapper( py: Python, kind: PyObject, pat: PyObject, globsuffix: PyObject, ) -> PyResult { match build_single_regex( kind.extract::(py)?.data(py), pat.extract::(py)?.data(py), globsuffix.extract::(py)?.data(py), ) { Ok(regex) => Ok(PyBytes::new(py, ®ex)), Err(e) => Err(PatternError::pynew(py, e)), } } pub fn init_module(py: Python, package: &str) -> PyResult { let dotted_name = &format!("{}.filepatterns", package); let m = PyModule::new(py, dotted_name)?; m.add(py, "__package__", package)?; m.add( py, "__doc__", "Patterns files parsing - Rust implementation", )?; m.add( py, "build_single_regex", py_fn!( py, build_single_regex_wrapper( kind: PyObject, pat: PyObject, globsuffix: PyObject ) ), )?; m.add( py, "read_pattern_file", py_fn!( py, read_pattern_file_wrapper( file_path: PyObject, warn: bool, source_info: bool ) ), )?; m.add(py, "PatternError", py.get_type::())?; let sys = PyModule::import(py, "sys")?; let sys_modules: PyDict = sys.get(py, "modules")?.extract(py)?; sys_modules.set_item(py, dotted_name, &m)?; Ok(m) } mercurial-5.3.1/rust/hg-cpython/src/dirstate/0000755015407300116100000000000013627755444021077 5ustar augieeng00000000000000mercurial-5.3.1/rust/hg-cpython/src/dirstate/dirs_multiset.rs0000644015407300116100000001062013627755404024327 0ustar augieeng00000000000000// dirs_multiset.rs // // Copyright 2019 Raphaël Gomès // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Bindings for the `hg::dirstate::dirs_multiset` file provided by the //! `hg-core` package. use std::cell::RefCell; use std::convert::TryInto; use cpython::{ exc, ObjectProtocol, PyBytes, PyClone, PyDict, PyErr, PyObject, PyResult, Python, }; use crate::dirstate::extract_dirstate; use crate::ref_sharing::{PyLeaked, PySharedRefCell}; use hg::{ utils::hg_path::{HgPath, HgPathBuf}, DirsMultiset, DirsMultisetIter, DirstateMapError, DirstateParseError, EntryState, }; py_class!(pub class Dirs |py| { data inner: PySharedRefCell; // `map` is either a `dict` or a flat iterator (usually a `set`, sometimes // a `list`) def __new__( _cls, map: PyObject, skip: Option = None ) -> PyResult { let mut skip_state: Option = None; if let Some(skip) = skip { skip_state = Some( skip.extract::(py)?.data(py)[0] .try_into() .map_err(|e: DirstateParseError| { PyErr::new::(py, e.to_string()) })?, ); } let inner = if let Ok(map) = map.cast_as::(py) { let dirstate = extract_dirstate(py, &map)?; DirsMultiset::from_dirstate(&dirstate, skip_state) .map_err(|e| { PyErr::new::(py, e.to_string()) })? } else { let map: Result, PyErr> = map .iter(py)? .map(|o| { Ok(HgPathBuf::from_bytes( o?.extract::(py)?.data(py), )) }) .collect(); DirsMultiset::from_manifest(&map?) .map_err(|e| { PyErr::new::(py, e.to_string()) })? }; Self::create_instance( py, PySharedRefCell::new(inner), ) } def addpath(&self, path: PyObject) -> PyResult { self.inner_shared(py).borrow_mut()?.add_path( HgPath::new(path.extract::(py)?.data(py)), ).and(Ok(py.None())).or_else(|e| { match e { DirstateMapError::EmptyPath => { Ok(py.None()) }, e => { Err(PyErr::new::( py, e.to_string(), )) } } }) } def delpath(&self, path: PyObject) -> PyResult { self.inner_shared(py).borrow_mut()?.delete_path( HgPath::new(path.extract::(py)?.data(py)), ) .and(Ok(py.None())) .or_else(|e| { match e { DirstateMapError::EmptyPath => { Ok(py.None()) }, e => { Err(PyErr::new::( py, e.to_string(), )) } } }) } def __iter__(&self) -> PyResult { let leaked_ref = self.inner_shared(py).leak_immutable(); DirsMultisetKeysIterator::from_inner( py, unsafe { leaked_ref.map(py, |o| o.iter()) }, ) } def __contains__(&self, item: PyObject) -> PyResult { Ok(self.inner_shared(py).borrow().contains(HgPath::new( item.extract::(py)?.data(py).as_ref(), ))) } }); py_shared_ref!(Dirs, DirsMultiset, inner, inner_shared); impl Dirs { pub fn from_inner(py: Python, d: DirsMultiset) -> PyResult { Self::create_instance(py, PySharedRefCell::new(d)) } fn translate_key( py: Python, res: &HgPathBuf, ) -> PyResult> { Ok(Some(PyBytes::new(py, res.as_ref()))) } } py_shared_iterator!( DirsMultisetKeysIterator, PyLeaked>, Dirs::translate_key, Option ); mercurial-5.3.1/rust/hg-cpython/src/dirstate/dirstate_map.rs0000644015407300116100000004423413627755405024125 0ustar augieeng00000000000000// dirstate_map.rs // // Copyright 2019 Raphaël Gomès // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Bindings for the `hg::dirstate::dirstate_map` file provided by the //! `hg-core` package. use std::cell::{Ref, RefCell}; use std::convert::TryInto; use std::time::Duration; use cpython::{ exc, ObjectProtocol, PyBool, PyBytes, PyClone, PyDict, PyErr, PyList, PyObject, PyResult, PyString, PyTuple, Python, PythonObject, ToPyObject, }; use crate::{ dirstate::copymap::{CopyMap, CopyMapItemsIterator, CopyMapKeysIterator}, dirstate::non_normal_entries::NonNormalEntries, dirstate::{dirs_multiset::Dirs, make_dirstate_tuple}, ref_sharing::{PyLeaked, PySharedRefCell}, }; use hg::{ utils::hg_path::{HgPath, HgPathBuf}, DirsMultiset, DirstateEntry, DirstateMap as RustDirstateMap, DirstateMapError, DirstateParents, DirstateParseError, EntryState, StateMapIter, PARENT_SIZE, }; // TODO // This object needs to share references to multiple members of its Rust // inner struct, namely `copy_map`, `dirs` and `all_dirs`. // Right now `CopyMap` is done, but it needs to have an explicit reference // to `RustDirstateMap` which itself needs to have an encapsulation for // every method in `CopyMap` (copymapcopy, etc.). // This is ugly and hard to maintain. // The same logic applies to `dirs` and `all_dirs`, however the `Dirs` // `py_class!` is already implemented and does not mention // `RustDirstateMap`, rightfully so. // All attributes also have to have a separate refcount data attribute for // leaks, with all methods that go along for reference sharing. py_class!(pub class DirstateMap |py| { data inner: PySharedRefCell; def __new__(_cls, _root: PyObject) -> PyResult { let inner = RustDirstateMap::default(); Self::create_instance( py, PySharedRefCell::new(inner), ) } def clear(&self) -> PyResult { self.inner_shared(py).borrow_mut()?.clear(); Ok(py.None()) } def get( &self, key: PyObject, default: Option = None ) -> PyResult> { let key = key.extract::(py)?; match self.inner_shared(py).borrow().get(HgPath::new(key.data(py))) { Some(entry) => { Ok(Some(make_dirstate_tuple(py, entry)?)) }, None => Ok(default) } } def addfile( &self, f: PyObject, oldstate: PyObject, state: PyObject, mode: PyObject, size: PyObject, mtime: PyObject ) -> PyResult { self.inner_shared(py).borrow_mut()?.add_file( HgPath::new(f.extract::(py)?.data(py)), oldstate.extract::(py)?.data(py)[0] .try_into() .map_err(|e: DirstateParseError| { PyErr::new::(py, e.to_string()) })?, DirstateEntry { state: state.extract::(py)?.data(py)[0] .try_into() .map_err(|e: DirstateParseError| { PyErr::new::(py, e.to_string()) })?, mode: mode.extract(py)?, size: size.extract(py)?, mtime: mtime.extract(py)?, }, ).and(Ok(py.None())).or_else(|e: DirstateMapError| { Err(PyErr::new::(py, e.to_string())) }) } def removefile( &self, f: PyObject, oldstate: PyObject, size: PyObject ) -> PyResult { self.inner_shared(py).borrow_mut()? .remove_file( HgPath::new(f.extract::(py)?.data(py)), oldstate.extract::(py)?.data(py)[0] .try_into() .map_err(|e: DirstateParseError| { PyErr::new::(py, e.to_string()) })?, size.extract(py)?, ) .or_else(|_| { Err(PyErr::new::( py, "Dirstate error".to_string(), )) })?; Ok(py.None()) } def dropfile( &self, f: PyObject, oldstate: PyObject ) -> PyResult { self.inner_shared(py).borrow_mut()? .drop_file( HgPath::new(f.extract::(py)?.data(py)), oldstate.extract::(py)?.data(py)[0] .try_into() .map_err(|e: DirstateParseError| { PyErr::new::(py, e.to_string()) })?, ) .and_then(|b| Ok(b.to_py_object(py))) .or_else(|_| { Err(PyErr::new::( py, "Dirstate error".to_string(), )) }) } def clearambiguoustimes( &self, files: PyObject, now: PyObject ) -> PyResult { let files: PyResult> = files .iter(py)? .map(|filename| { Ok(HgPathBuf::from_bytes( filename?.extract::(py)?.data(py), )) }) .collect(); self.inner_shared(py).borrow_mut()? .clear_ambiguous_times(files?, now.extract(py)?); Ok(py.None()) } def other_parent_entries(&self) -> PyResult { let mut inner_shared = self.inner_shared(py).borrow_mut()?; let (_, other_parent) = inner_shared.get_non_normal_other_parent_entries(); let locals = PyDict::new(py); locals.set_item( py, "other_parent", other_parent.as_ref() .unwrap() .iter() .map(|v| PyBytes::new(py, v.as_ref())) .collect::>() .to_py_object(py), )?; py.eval("set(other_parent)", None, Some(&locals)) } def non_normal_entries(&self) -> PyResult { NonNormalEntries::from_inner(py, self.clone_ref(py)) } def non_normal_entries_contains(&self, key: PyObject) -> PyResult { let key = key.extract::(py)?; Ok(self .inner_shared(py) .borrow_mut()? .get_non_normal_other_parent_entries().0 .as_ref() .unwrap() .contains(HgPath::new(key.data(py)))) } def non_normal_entries_display(&self) -> PyResult { Ok( PyString::new( py, &format!( "NonNormalEntries: {:?}", self .inner_shared(py) .borrow_mut()? .get_non_normal_other_parent_entries().0 .as_ref() .unwrap().iter().map(|o| o)) ) ) } def non_normal_entries_remove(&self, key: PyObject) -> PyResult { let key = key.extract::(py)?; self .inner_shared(py) .borrow_mut()? .non_normal_entries_remove(HgPath::new(key.data(py))); Ok(py.None()) } def non_normal_entries_union(&self, other: PyObject) -> PyResult { let other: PyResult<_> = other.iter(py)? .map(|f| { Ok(HgPathBuf::from_bytes( f?.extract::(py)?.data(py), )) }) .collect(); let res = self .inner_shared(py) .borrow_mut()? .non_normal_entries_union(other?); let ret = PyList::new(py, &[]); for (i, filename) in res.iter().enumerate() { let as_pystring = PyBytes::new(py, filename.as_bytes()); ret.insert_item(py, i, as_pystring.into_object()); } Ok(ret) } def hastrackeddir(&self, d: PyObject) -> PyResult { let d = d.extract::(py)?; Ok(self.inner_shared(py).borrow_mut()? .has_tracked_dir(HgPath::new(d.data(py))) .map_err(|e| { PyErr::new::(py, e.to_string()) })? .to_py_object(py)) } def hasdir(&self, d: PyObject) -> PyResult { let d = d.extract::(py)?; Ok(self.inner_shared(py).borrow_mut()? .has_dir(HgPath::new(d.data(py))) .map_err(|e| { PyErr::new::(py, e.to_string()) })? .to_py_object(py)) } def parents(&self, st: PyObject) -> PyResult { self.inner_shared(py).borrow_mut()? .parents(st.extract::(py)?.data(py)) .and_then(|d| { Ok((PyBytes::new(py, &d.p1), PyBytes::new(py, &d.p2)) .to_py_object(py)) }) .or_else(|_| { Err(PyErr::new::( py, "Dirstate error".to_string(), )) }) } def setparents(&self, p1: PyObject, p2: PyObject) -> PyResult { let p1 = extract_node_id(py, &p1)?; let p2 = extract_node_id(py, &p2)?; self.inner_shared(py).borrow_mut()? .set_parents(&DirstateParents { p1, p2 }); Ok(py.None()) } def read(&self, st: PyObject) -> PyResult> { match self.inner_shared(py).borrow_mut()? .read(st.extract::(py)?.data(py)) { Ok(Some(parents)) => Ok(Some( (PyBytes::new(py, &parents.p1), PyBytes::new(py, &parents.p2)) .to_py_object(py) .into_object(), )), Ok(None) => Ok(Some(py.None())), Err(_) => Err(PyErr::new::( py, "Dirstate error".to_string(), )), } } def write( &self, p1: PyObject, p2: PyObject, now: PyObject ) -> PyResult { let now = Duration::new(now.extract(py)?, 0); let parents = DirstateParents { p1: extract_node_id(py, &p1)?, p2: extract_node_id(py, &p2)?, }; match self.inner_shared(py).borrow_mut()?.pack(parents, now) { Ok(packed) => Ok(PyBytes::new(py, &packed)), Err(_) => Err(PyErr::new::( py, "Dirstate error".to_string(), )), } } def filefoldmapasdict(&self) -> PyResult { let dict = PyDict::new(py); for (key, value) in self.inner_shared(py).borrow_mut()?.build_file_fold_map().iter() { dict.set_item(py, key.as_ref().to_vec(), value.as_ref().to_vec())?; } Ok(dict) } def __len__(&self) -> PyResult { Ok(self.inner_shared(py).borrow().len()) } def __contains__(&self, key: PyObject) -> PyResult { let key = key.extract::(py)?; Ok(self.inner_shared(py).borrow().contains_key(HgPath::new(key.data(py)))) } def __getitem__(&self, key: PyObject) -> PyResult { let key = key.extract::(py)?; let key = HgPath::new(key.data(py)); match self.inner_shared(py).borrow().get(key) { Some(entry) => { Ok(make_dirstate_tuple(py, entry)?) }, None => Err(PyErr::new::( py, String::from_utf8_lossy(key.as_bytes()), )), } } def keys(&self) -> PyResult { let leaked_ref = self.inner_shared(py).leak_immutable(); DirstateMapKeysIterator::from_inner( py, unsafe { leaked_ref.map(py, |o| o.iter()) }, ) } def items(&self) -> PyResult { let leaked_ref = self.inner_shared(py).leak_immutable(); DirstateMapItemsIterator::from_inner( py, unsafe { leaked_ref.map(py, |o| o.iter()) }, ) } def __iter__(&self) -> PyResult { let leaked_ref = self.inner_shared(py).leak_immutable(); DirstateMapKeysIterator::from_inner( py, unsafe { leaked_ref.map(py, |o| o.iter()) }, ) } def getdirs(&self) -> PyResult { // TODO don't copy, share the reference self.inner_shared(py).borrow_mut()?.set_dirs() .map_err(|e| { PyErr::new::(py, e.to_string()) })?; Dirs::from_inner( py, DirsMultiset::from_dirstate( &self.inner_shared(py).borrow(), Some(EntryState::Removed), ) .map_err(|e| { PyErr::new::(py, e.to_string()) })?, ) } def getalldirs(&self) -> PyResult { // TODO don't copy, share the reference self.inner_shared(py).borrow_mut()?.set_all_dirs() .map_err(|e| { PyErr::new::(py, e.to_string()) })?; Dirs::from_inner( py, DirsMultiset::from_dirstate( &self.inner_shared(py).borrow(), None, ).map_err(|e| { PyErr::new::(py, e.to_string()) })?, ) } // TODO all copymap* methods, see docstring above def copymapcopy(&self) -> PyResult { let dict = PyDict::new(py); for (key, value) in self.inner_shared(py).borrow().copy_map.iter() { dict.set_item( py, PyBytes::new(py, key.as_ref()), PyBytes::new(py, value.as_ref()), )?; } Ok(dict) } def copymapgetitem(&self, key: PyObject) -> PyResult { let key = key.extract::(py)?; match self.inner_shared(py).borrow().copy_map.get(HgPath::new(key.data(py))) { Some(copy) => Ok(PyBytes::new(py, copy.as_ref())), None => Err(PyErr::new::( py, String::from_utf8_lossy(key.data(py)), )), } } def copymap(&self) -> PyResult { CopyMap::from_inner(py, self.clone_ref(py)) } def copymaplen(&self) -> PyResult { Ok(self.inner_shared(py).borrow().copy_map.len()) } def copymapcontains(&self, key: PyObject) -> PyResult { let key = key.extract::(py)?; Ok(self .inner_shared(py) .borrow() .copy_map .contains_key(HgPath::new(key.data(py)))) } def copymapget( &self, key: PyObject, default: Option ) -> PyResult> { let key = key.extract::(py)?; match self .inner_shared(py) .borrow() .copy_map .get(HgPath::new(key.data(py))) { Some(copy) => Ok(Some( PyBytes::new(py, copy.as_ref()).into_object(), )), None => Ok(default), } } def copymapsetitem( &self, key: PyObject, value: PyObject ) -> PyResult { let key = key.extract::(py)?; let value = value.extract::(py)?; self.inner_shared(py).borrow_mut()?.copy_map.insert( HgPathBuf::from_bytes(key.data(py)), HgPathBuf::from_bytes(value.data(py)), ); Ok(py.None()) } def copymappop( &self, key: PyObject, default: Option ) -> PyResult> { let key = key.extract::(py)?; match self .inner_shared(py) .borrow_mut()? .copy_map .remove(HgPath::new(key.data(py))) { Some(_) => Ok(None), None => Ok(default), } } def copymapiter(&self) -> PyResult { let leaked_ref = self.inner_shared(py).leak_immutable(); CopyMapKeysIterator::from_inner( py, unsafe { leaked_ref.map(py, |o| o.copy_map.iter()) }, ) } def copymapitemsiter(&self) -> PyResult { let leaked_ref = self.inner_shared(py).leak_immutable(); CopyMapItemsIterator::from_inner( py, unsafe { leaked_ref.map(py, |o| o.copy_map.iter()) }, ) } }); impl DirstateMap { pub fn get_inner<'a>( &'a self, py: Python<'a>, ) -> Ref<'a, RustDirstateMap> { self.inner_shared(py).borrow() } fn translate_key( py: Python, res: (&HgPathBuf, &DirstateEntry), ) -> PyResult> { Ok(Some(PyBytes::new(py, res.0.as_ref()))) } fn translate_key_value( py: Python, res: (&HgPathBuf, &DirstateEntry), ) -> PyResult> { let (f, entry) = res; Ok(Some(( PyBytes::new(py, f.as_ref()), make_dirstate_tuple(py, entry)?, ))) } } py_shared_ref!(DirstateMap, RustDirstateMap, inner, inner_shared); py_shared_iterator!( DirstateMapKeysIterator, PyLeaked>, DirstateMap::translate_key, Option ); py_shared_iterator!( DirstateMapItemsIterator, PyLeaked>, DirstateMap::translate_key_value, Option<(PyBytes, PyObject)> ); fn extract_node_id(py: Python, obj: &PyObject) -> PyResult<[u8; PARENT_SIZE]> { let bytes = obj.extract::(py)?; match bytes.data(py).try_into() { Ok(s) => Ok(s), Err(e) => Err(PyErr::new::(py, e.to_string())), } } mercurial-5.3.1/rust/hg-cpython/src/dirstate/non_normal_entries.rs0000644015407300116100000000324713627755405025343 0ustar augieeng00000000000000// non_normal_other_parent_entries.rs // // Copyright 2020 Raphaël Gomès // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. use cpython::{ exc::NotImplementedError, CompareOp, ObjectProtocol, PyErr, PyList, PyObject, PyResult, PyString, Python, PythonObject, ToPyObject, }; use crate::dirstate::DirstateMap; py_class!(pub class NonNormalEntries |py| { data dmap: DirstateMap; def __contains__(&self, key: PyObject) -> PyResult { self.dmap(py).non_normal_entries_contains(py, key) } def remove(&self, key: PyObject) -> PyResult { self.dmap(py).non_normal_entries_remove(py, key) } def union(&self, other: PyObject) -> PyResult { self.dmap(py).non_normal_entries_union(py, other) } def __richcmp__(&self, other: PyObject, op: CompareOp) -> PyResult { match op { CompareOp::Eq => self.is_equal_to(py, other), CompareOp::Ne => Ok(!self.is_equal_to(py, other)?), _ => Err(PyErr::new::(py, "")) } } def __repr__(&self) -> PyResult { self.dmap(py).non_normal_entries_display(py) } }); impl NonNormalEntries { pub fn from_inner(py: Python, dm: DirstateMap) -> PyResult { Self::create_instance(py, dm) } fn is_equal_to(&self, py: Python, other: PyObject) -> PyResult { for item in other.iter(py)? { if !self.dmap(py).non_normal_entries_contains(py, item?)? { return Ok(false); } } Ok(true) } } mercurial-5.3.1/rust/hg-cpython/src/dirstate/copymap.rs0000644015407300116100000000607513627755405023122 0ustar augieeng00000000000000// copymap.rs // // Copyright 2019 Raphaël Gomès // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Bindings for `hg::dirstate::dirstate_map::CopyMap` provided by the //! `hg-core` package. use cpython::{PyBytes, PyClone, PyDict, PyObject, PyResult, Python}; use std::cell::RefCell; use crate::dirstate::dirstate_map::DirstateMap; use crate::ref_sharing::PyLeaked; use hg::{utils::hg_path::HgPathBuf, CopyMapIter}; py_class!(pub class CopyMap |py| { data dirstate_map: DirstateMap; def __getitem__(&self, key: PyObject) -> PyResult { (*self.dirstate_map(py)).copymapgetitem(py, key) } def __len__(&self) -> PyResult { self.dirstate_map(py).copymaplen(py) } def __contains__(&self, key: PyObject) -> PyResult { self.dirstate_map(py).copymapcontains(py, key) } def get( &self, key: PyObject, default: Option = None ) -> PyResult> { self.dirstate_map(py).copymapget(py, key, default) } def pop( &self, key: PyObject, default: Option = None ) -> PyResult> { self.dirstate_map(py).copymappop(py, key, default) } def __iter__(&self) -> PyResult { self.dirstate_map(py).copymapiter(py) } // Python's `dict()` builtin works with either a subclass of dict // or an abstract mapping. Said mapping needs to implement `__getitem__` // and `keys`. def keys(&self) -> PyResult { self.dirstate_map(py).copymapiter(py) } def items(&self) -> PyResult { self.dirstate_map(py).copymapitemsiter(py) } def iteritems(&self) -> PyResult { self.dirstate_map(py).copymapitemsiter(py) } def __setitem__( &self, key: PyObject, item: PyObject ) -> PyResult<()> { self.dirstate_map(py).copymapsetitem(py, key, item)?; Ok(()) } def copy(&self) -> PyResult { self.dirstate_map(py).copymapcopy(py) } }); impl CopyMap { pub fn from_inner(py: Python, dm: DirstateMap) -> PyResult { Self::create_instance(py, dm) } fn translate_key( py: Python, res: (&HgPathBuf, &HgPathBuf), ) -> PyResult> { Ok(Some(PyBytes::new(py, res.0.as_ref()))) } fn translate_key_value( py: Python, res: (&HgPathBuf, &HgPathBuf), ) -> PyResult> { let (k, v) = res; Ok(Some(( PyBytes::new(py, k.as_ref()), PyBytes::new(py, v.as_ref()), ))) } } py_shared_iterator!( CopyMapKeysIterator, PyLeaked>, CopyMap::translate_key, Option ); py_shared_iterator!( CopyMapItemsIterator, PyLeaked>, CopyMap::translate_key_value, Option<(PyBytes, PyBytes)> ); mercurial-5.3.1/rust/hg-cpython/src/dirstate/status.rs0000644015407300116100000000772713627755405023002 0ustar augieeng00000000000000// status.rs // // Copyright 2019, Raphaël Gomès // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Bindings for the `hg::status` module provided by the //! `hg-core` crate. From Python, this will be seen as //! `rustext.dirstate.status`. use crate::dirstate::DirstateMap; use cpython::exc::ValueError; use cpython::{ ObjectProtocol, PyBytes, PyErr, PyList, PyObject, PyResult, PyTuple, Python, PythonObject, ToPyObject, }; use hg::utils::hg_path::HgPathBuf; use hg::{ matchers::{AlwaysMatcher, FileMatcher}, status, utils::{files::get_path_from_bytes, hg_path::HgPath}, StatusResult, }; use std::borrow::Borrow; /// This will be useless once trait impls for collection are added to `PyBytes` /// upstream. fn collect_pybytes_list>( py: Python, collection: &[P], ) -> PyList { let list = PyList::new(py, &[]); for (i, path) in collection.iter().enumerate() { list.insert_item( py, i, PyBytes::new(py, path.as_ref().as_bytes()).into_object(), ) } list } pub fn status_wrapper( py: Python, dmap: DirstateMap, matcher: PyObject, root_dir: PyObject, list_clean: bool, last_normal_time: i64, check_exec: bool, ) -> PyResult<(PyList, PyList, PyList, PyList, PyList, PyList, PyList)> { let bytes = root_dir.extract::(py)?; let root_dir = get_path_from_bytes(bytes.data(py)); let dmap: DirstateMap = dmap.to_py_object(py); let dmap = dmap.get_inner(py); match matcher.get_type(py).name(py).borrow() { "alwaysmatcher" => { let matcher = AlwaysMatcher; let (lookup, status_res) = status( &dmap, &matcher, &root_dir, list_clean, last_normal_time, check_exec, ) .map_err(|e| PyErr::new::(py, e.to_string()))?; build_response(lookup, status_res, py) } "exactmatcher" => { let files = matcher.call_method( py, "files", PyTuple::new(py, &[]), None, )?; let files: PyList = files.cast_into(py)?; let files: PyResult> = files .iter(py) .map(|f| { Ok(HgPathBuf::from_bytes( f.extract::(py)?.data(py), )) }) .collect(); let files = files?; let matcher = FileMatcher::new(&files) .map_err(|e| PyErr::new::(py, e.to_string()))?; let (lookup, status_res) = status( &dmap, &matcher, &root_dir, list_clean, last_normal_time, check_exec, ) .map_err(|e| PyErr::new::(py, e.to_string()))?; build_response(lookup, status_res, py) } e => { return Err(PyErr::new::( py, format!("Unsupported matcher {}", e), )); } } } fn build_response( lookup: Vec<&HgPath>, status_res: StatusResult, py: Python, ) -> PyResult<(PyList, PyList, PyList, PyList, PyList, PyList, PyList)> { let modified = collect_pybytes_list(py, status_res.modified.as_ref()); let added = collect_pybytes_list(py, status_res.added.as_ref()); let removed = collect_pybytes_list(py, status_res.removed.as_ref()); let deleted = collect_pybytes_list(py, status_res.deleted.as_ref()); let clean = collect_pybytes_list(py, status_res.clean.as_ref()); let lookup = collect_pybytes_list(py, lookup.as_ref()); let unknown = PyList::new(py, &[]); Ok((lookup, modified, added, removed, deleted, unknown, clean)) } mercurial-5.3.1/rust/hg-cpython/src/dagops.rs0000644015407300116100000000350713627755404021104 0ustar augieeng00000000000000// dagops.rs // // Copyright 2019 Georges Racinet // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Bindings for the `hg::dagops` module provided by the //! `hg-core` package. //! //! From Python, this will be seen as `mercurial.rustext.dagop` use crate::{conversion::rev_pyiter_collect, exceptions::GraphError}; use cpython::{PyDict, PyModule, PyObject, PyResult, Python}; use hg::dagops; use hg::Revision; use std::collections::HashSet; use crate::revlog::pyindex_to_graph; /// Using the the `index`, return heads out of any Python iterable of Revisions /// /// This is the Rust counterpart for `mercurial.dagop.headrevs` pub fn headrevs( py: Python, index: PyObject, revs: PyObject, ) -> PyResult> { let mut as_set: HashSet = rev_pyiter_collect(py, &revs)?; dagops::retain_heads(&pyindex_to_graph(py, index)?, &mut as_set) .map_err(|e| GraphError::pynew(py, e))?; Ok(as_set) } /// Create the module, with `__package__` given from parent pub fn init_module(py: Python, package: &str) -> PyResult { let dotted_name = &format!("{}.dagop", package); let m = PyModule::new(py, dotted_name)?; m.add(py, "__package__", package)?; m.add(py, "__doc__", "DAG operations - Rust implementation")?; m.add( py, "headrevs", py_fn!(py, headrevs(index: PyObject, revs: PyObject)), )?; let sys = PyModule::import(py, "sys")?; let sys_modules: PyDict = sys.get(py, "modules")?.extract(py)?; sys_modules.set_item(py, dotted_name, &m)?; // Example C code (see pyexpat.c and import.c) will "give away the // reference", but we won't because it will be consumed once the // Rust PyObject is dropped. Ok(m) } mercurial-5.3.1/rust/hg-cpython/src/exceptions.rs0000644015407300116100000000433013627755404022003 0ustar augieeng00000000000000// ancestors.rs // // Copyright 2018 Georges Racinet // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Bindings for Rust errors //! //! [`GraphError`] exposes `hg::GraphError` as a subclass of `ValueError` //! but some variants of `hg::GraphError` can be converted directly to other //! existing Python exceptions if appropriate. //! //! [`GraphError`]: struct.GraphError.html use cpython::{ exc::{IOError, RuntimeError, ValueError}, py_exception, PyErr, Python, }; use hg; py_exception!(rustext, GraphError, ValueError); impl GraphError { pub fn pynew(py: Python, inner: hg::GraphError) -> PyErr { match inner { hg::GraphError::ParentOutOfRange(r) => { GraphError::new(py, ("ParentOutOfRange", r)) } hg::GraphError::WorkingDirectoryUnsupported => { match py .import("mercurial.error") .and_then(|m| m.get(py, "WdirUnsupported")) { Err(e) => e, Ok(cls) => PyErr::from_instance(py, cls), } } } } } py_exception!(rustext, PatternError, RuntimeError); py_exception!(rustext, PatternFileError, RuntimeError); py_exception!(rustext, HgPathPyError, RuntimeError); impl PatternError { pub fn pynew(py: Python, inner: hg::PatternError) -> PyErr { match inner { hg::PatternError::UnsupportedSyntax(m) => { PatternError::new(py, ("PatternError", m)) } } } } impl PatternFileError { pub fn pynew(py: Python, inner: hg::PatternFileError) -> PyErr { match inner { hg::PatternFileError::IO(e) => { let value = (e.raw_os_error().unwrap_or(2), e.to_string()); PyErr::new::(py, value) } hg::PatternFileError::Pattern(e, l) => match e { hg::PatternError::UnsupportedSyntax(m) => { PatternFileError::new(py, ("PatternFileError", m, l)) } }, } } } py_exception!(shared_ref, AlreadyBorrowed, RuntimeError); mercurial-5.3.1/rust/hg-cpython/src/cindex.rs0000644015407300116100000001021013627755405021067 0ustar augieeng00000000000000// cindex.rs // // Copyright 2018 Georges Racinet // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Bindings to use the Index defined by the parsers C extension //! //! Ideally, we should use an Index entirely implemented in Rust, //! but this will take some time to get there. use cpython::{exc::ImportError, PyClone, PyErr, PyObject, PyResult, Python}; use hg::{Graph, GraphError, Revision, WORKING_DIRECTORY_REVISION}; use libc::c_int; const REVLOG_CABI_VERSION: c_int = 1; #[repr(C)] pub struct Revlog_CAPI { abi_version: c_int, index_parents: unsafe extern "C" fn( index: *mut revlog_capi::RawPyObject, rev: c_int, ps: *mut [c_int; 2], ) -> c_int, } py_capsule!( from mercurial.cext.parsers import revlog_CAPI as revlog_capi for Revlog_CAPI); /// A `Graph` backed up by objects and functions from revlog.c /// /// This implementation of the `Graph` trait, relies on (pointers to) /// - the C index object (`index` member) /// - the `index_get_parents()` function (`parents` member) /// /// # Safety /// /// The C index itself is mutable, and this Rust exposition is **not /// protected by the GIL**, meaning that this construct isn't safe with respect /// to Python threads. /// /// All callers of this `Index` must acquire the GIL and must not release it /// while working. /// /// # TODO find a solution to make it GIL safe again. /// /// This is non trivial, and can wait until we have a clearer picture with /// more Rust Mercurial constructs. /// /// One possibility would be to a `GILProtectedIndex` wrapper enclosing /// a `Python<'p>` marker and have it be the one implementing the /// `Graph` trait, but this would mean the `Graph` implementor would become /// likely to change between subsequent method invocations of the `hg-core` /// objects (a serious change of the `hg-core` API): /// either exposing ways to mutate the `Graph`, or making it a non persistent /// parameter in the relevant methods that need one. /// /// Another possibility would be to introduce an abstract lock handle into /// the core API, that would be tied to `GILGuard` / `Python<'p>` /// in the case of the `cpython` crate bindings yet could leave room for other /// mechanisms in other contexts. pub struct Index { index: PyObject, capi: &'static Revlog_CAPI, } impl Index { pub fn new(py: Python, index: PyObject) -> PyResult { let capi = unsafe { revlog_capi::retrieve(py)? }; if capi.abi_version != REVLOG_CABI_VERSION { return Err(PyErr::new::( py, format!( "ABI version mismatch: the C ABI revlog version {} \ does not match the {} expected by Rust hg-cpython", capi.abi_version, REVLOG_CABI_VERSION ), )); } Ok(Index { index: index, capi: capi, }) } /// return a reference to the CPython Index object in this Struct pub fn inner(&self) -> &PyObject { &self.index } } impl Clone for Index { fn clone(&self) -> Self { let guard = Python::acquire_gil(); Index { index: self.index.clone_ref(guard.python()), capi: self.capi, } } } impl PyClone for Index { fn clone_ref(&self, py: Python) -> Self { Index { index: self.index.clone_ref(py), capi: self.capi, } } } impl Graph for Index { /// wrap a call to the C extern parents function fn parents(&self, rev: Revision) -> Result<[Revision; 2], GraphError> { if rev == WORKING_DIRECTORY_REVISION { return Err(GraphError::WorkingDirectoryUnsupported); } let mut res: [c_int; 2] = [0; 2]; let code = unsafe { (self.capi.index_parents)( self.index.as_ptr(), rev as c_int, &mut res as *mut [c_int; 2], ) }; match code { 0 => Ok(res), _ => Err(GraphError::ParentOutOfRange(rev)), } } } mercurial-5.3.1/rust/hg-cpython/src/dirstate.rs0000644015407300116100000001023313627755405021441 0ustar augieeng00000000000000// dirstate.rs // // Copyright 2019 Raphaël Gomès // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Bindings for the `hg::dirstate` module provided by the //! `hg-core` package. //! //! From Python, this will be seen as `mercurial.rustext.dirstate` mod copymap; mod dirs_multiset; mod dirstate_map; mod non_normal_entries; mod status; use crate::dirstate::{ dirs_multiset::Dirs, dirstate_map::DirstateMap, status::status_wrapper, }; use cpython::{ exc, PyBytes, PyDict, PyErr, PyModule, PyObject, PyResult, PySequence, Python, }; use hg::{ utils::hg_path::HgPathBuf, DirstateEntry, DirstateParseError, EntryState, StateMap, }; use libc::{c_char, c_int}; use std::convert::TryFrom; // C code uses a custom `dirstate_tuple` type, checks in multiple instances // for this type, and raises a Python `Exception` if the check does not pass. // Because this type differs only in name from the regular Python tuple, it // would be a good idea in the near future to remove it entirely to allow // for a pure Python tuple of the same effective structure to be used, // rendering this type and the capsule below useless. py_capsule_fn!( from mercurial.cext.parsers import make_dirstate_tuple_CAPI as make_dirstate_tuple_capi signature ( state: c_char, mode: c_int, size: c_int, mtime: c_int, ) -> *mut RawPyObject ); pub fn make_dirstate_tuple( py: Python, entry: &DirstateEntry, ) -> PyResult { // might be silly to retrieve capsule function in hot loop let make = make_dirstate_tuple_capi::retrieve(py)?; let &DirstateEntry { state, mode, size, mtime, } = entry; // Explicitly go through u8 first, then cast to platform-specific `c_char` // because Into has a specific implementation while `as c_char` would // just do a naive enum cast. let state_code: u8 = state.into(); let maybe_obj = unsafe { let ptr = make(state_code as c_char, mode, size, mtime); PyObject::from_owned_ptr_opt(py, ptr) }; maybe_obj.ok_or_else(|| PyErr::fetch(py)) } pub fn extract_dirstate(py: Python, dmap: &PyDict) -> Result { dmap.items(py) .iter() .map(|(filename, stats)| { let stats = stats.extract::(py)?; let state = stats.get_item(py, 0)?.extract::(py)?; let state = EntryState::try_from(state.data(py)[0]).map_err( |e: DirstateParseError| { PyErr::new::(py, e.to_string()) }, )?; let mode = stats.get_item(py, 1)?.extract(py)?; let size = stats.get_item(py, 2)?.extract(py)?; let mtime = stats.get_item(py, 3)?.extract(py)?; let filename = filename.extract::(py)?; let filename = filename.data(py); Ok(( HgPathBuf::from(filename.to_owned()), DirstateEntry { state, mode, size, mtime, }, )) }) .collect() } /// Create the module, with `__package__` given from parent pub fn init_module(py: Python, package: &str) -> PyResult { let dotted_name = &format!("{}.dirstate", package); let m = PyModule::new(py, dotted_name)?; m.add(py, "__package__", package)?; m.add(py, "__doc__", "Dirstate - Rust implementation")?; m.add_class::(py)?; m.add_class::(py)?; m.add( py, "status", py_fn!( py, status_wrapper( dmap: DirstateMap, root_dir: PyObject, matcher: PyObject, list_clean: bool, last_normal_time: i64, check_exec: bool ) ), )?; let sys = PyModule::import(py, "sys")?; let sys_modules: PyDict = sys.get(py, "modules")?.extract(py)?; sys_modules.set_item(py, dotted_name, &m)?; Ok(m) } mercurial-5.3.1/rust/hg-cpython/src/utils.rs0000644015407300116100000000103213627755405020757 0ustar augieeng00000000000000use cpython::{PyDict, PyObject, PyResult, PyTuple, Python}; #[allow(unused)] pub fn print_python_trace(py: Python) -> PyResult { eprintln!("==============================="); eprintln!("Printing Python stack from Rust"); eprintln!("==============================="); let traceback = py.import("traceback")?; let sys = py.import("sys")?; let kwargs = PyDict::new(py); kwargs.set_item(py, "file", sys.get(py, "stderr")?)?; traceback.call(py, "print_stack", PyTuple::new(py, &[]), Some(&kwargs)) } mercurial-5.3.1/rust/hg-cpython/src/revlog.rs0000644015407300116100000001707613627755405021134 0ustar augieeng00000000000000// revlog.rs // // Copyright 2019 Georges Racinet // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. use crate::cindex; use cpython::{ ObjectProtocol, PyClone, PyDict, PyModule, PyObject, PyResult, PyTuple, Python, PythonObject, ToPyObject, }; use hg::Revision; use std::cell::RefCell; /// Return a Struct implementing the Graph trait pub(crate) fn pyindex_to_graph( py: Python, index: PyObject, ) -> PyResult { match index.extract::(py) { Ok(midx) => Ok(midx.clone_cindex(py)), Err(_) => cindex::Index::new(py, index), } } py_class!(pub class MixedIndex |py| { data cindex: RefCell; def __new__(_cls, cindex: PyObject) -> PyResult { Self::create_instance(py, RefCell::new( cindex::Index::new(py, cindex)?)) } /// Compatibility layer used for Python consumers needing access to the C index /// /// Only use case so far is `scmutil.shortesthexnodeidprefix`, /// that may need to build a custom `nodetree`, based on a specified revset. /// With a Rust implementation of the nodemap, we will be able to get rid of /// this, by exposing our own standalone nodemap class, /// ready to accept `MixedIndex`. def get_cindex(&self) -> PyResult { Ok(self.cindex(py).borrow().inner().clone_ref(py)) } // Reforwarded C index API // index_methods (tp_methods). Same ordering as in revlog.c /// return the gca set of the given revs def ancestors(&self, *args, **kw) -> PyResult { self.call_cindex(py, "ancestors", args, kw) } /// return the heads of the common ancestors of the given revs def commonancestorsheads(&self, *args, **kw) -> PyResult { self.call_cindex(py, "commonancestorsheads", args, kw) } /// clear the index caches def clearcaches(&self, *args, **kw) -> PyResult { self.call_cindex(py, "clearcaches", args, kw) } /// get an index entry def get(&self, *args, **kw) -> PyResult { self.call_cindex(py, "get", args, kw) } /// return `rev` associated with a node or None def get_rev(&self, *args, **kw) -> PyResult { self.call_cindex(py, "get_rev", args, kw) } /// return True if the node exist in the index def has_node(&self, *args, **kw) -> PyResult { self.call_cindex(py, "has_node", args, kw) } /// return `rev` associated with a node or raise RevlogError def rev(&self, *args, **kw) -> PyResult { self.call_cindex(py, "rev", args, kw) } /// compute phases def computephasesmapsets(&self, *args, **kw) -> PyResult { self.call_cindex(py, "computephasesmapsets", args, kw) } /// reachableroots def reachableroots2(&self, *args, **kw) -> PyResult { self.call_cindex(py, "reachableroots2", args, kw) } /// get head revisions def headrevs(&self, *args, **kw) -> PyResult { self.call_cindex(py, "headrevs", args, kw) } /// get filtered head revisions def headrevsfiltered(&self, *args, **kw) -> PyResult { self.call_cindex(py, "headrevsfiltered", args, kw) } /// True if the object is a snapshot def issnapshot(&self, *args, **kw) -> PyResult { self.call_cindex(py, "issnapshot", args, kw) } /// Gather snapshot data in a cache dict def findsnapshots(&self, *args, **kw) -> PyResult { self.call_cindex(py, "findsnapshots", args, kw) } /// determine revisions with deltas to reconstruct fulltext def deltachain(&self, *args, **kw) -> PyResult { self.call_cindex(py, "deltachain", args, kw) } /// slice planned chunk read to reach a density threshold def slicechunktodensity(&self, *args, **kw) -> PyResult { self.call_cindex(py, "slicechunktodensity", args, kw) } /// append an index entry def append(&self, *args, **kw) -> PyResult { self.call_cindex(py, "append", args, kw) } /// match a potentially ambiguous node ID def partialmatch(&self, *args, **kw) -> PyResult { self.call_cindex(py, "partialmatch", args, kw) } /// find length of shortest hex nodeid of a binary ID def shortest(&self, *args, **kw) -> PyResult { self.call_cindex(py, "shortest", args, kw) } /// stats for the index def stats(&self, *args, **kw) -> PyResult { self.call_cindex(py, "stats", args, kw) } // index_sequence_methods and index_mapping_methods. // // Since we call back through the high level Python API, // there's no point making a distinction between index_get // and index_getitem. def __len__(&self) -> PyResult { self.cindex(py).borrow().inner().len(py) } def __getitem__(&self, key: PyObject) -> PyResult { // this conversion seems needless, but that's actually because // `index_getitem` does not handle conversion from PyLong, // which expressions such as [e for e in index] internally use. // Note that we don't seem to have a direct way to call // PySequence_GetItem (does the job), which would be better for // for performance let key = match key.extract::(py) { Ok(rev) => rev.to_py_object(py).into_object(), Err(_) => key, }; self.cindex(py).borrow().inner().get_item(py, key) } def __setitem__(&self, key: PyObject, value: PyObject) -> PyResult<()> { self.cindex(py).borrow().inner().set_item(py, key, value) } def __delitem__(&self, key: PyObject) -> PyResult<()> { self.cindex(py).borrow().inner().del_item(py, key) } def __contains__(&self, item: PyObject) -> PyResult { // ObjectProtocol does not seem to provide contains(), so // this is an equivalent implementation of the index_contains() // defined in revlog.c let cindex = self.cindex(py).borrow(); match item.extract::(py) { Ok(rev) => { Ok(rev >= -1 && rev < cindex.inner().len(py)? as Revision) } Err(_) => { cindex.inner().call_method( py, "has_node", PyTuple::new(py, &[item]), None)? .extract(py) } } } }); impl MixedIndex { /// forward a method call to the underlying C index fn call_cindex( &self, py: Python, name: &str, args: &PyTuple, kwargs: Option<&PyDict>, ) -> PyResult { self.cindex(py) .borrow() .inner() .call_method(py, name, args, kwargs) } pub fn clone_cindex(&self, py: Python) -> cindex::Index { self.cindex(py).borrow().clone_ref(py) } } /// Create the module, with __package__ given from parent pub fn init_module(py: Python, package: &str) -> PyResult { let dotted_name = &format!("{}.revlog", package); let m = PyModule::new(py, dotted_name)?; m.add(py, "__package__", package)?; m.add(py, "__doc__", "RevLog - Rust implementations")?; m.add_class::(py)?; let sys = PyModule::import(py, "sys")?; let sys_modules: PyDict = sys.get(py, "modules")?.extract(py)?; sys_modules.set_item(py, dotted_name, &m)?; Ok(m) } mercurial-5.3.1/rust/.cargo/0000755015407300116100000000000013627755444015562 5ustar augieeng00000000000000mercurial-5.3.1/rust/.cargo/config0000644015407300116100000000061713627755405016753 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-5.3.1/rust/README.rst0000644015407300116100000000331613627755404016077 0ustar augieeng00000000000000=================== Mercurial Rust Code =================== This directory contains various Rust code for the Mercurial project. Rust is not required to use (or build) Mercurial, but using it improves performance in some areas. There are currently three independent rust projects: - chg. An implementation of chg, in rust instead of C. - hgcli. A experiment for starting hg in rust rather than in python, by linking with the python runtime. Probably meant to be replaced by PyOxidizer at some point. - hg-core (and hg-cpython/hg-directffi): implementation of some functionality of mercurial in rust, e.g. ancestry computations in revision graphs or pull discovery. The top-level ``Cargo.toml`` file defines a workspace containing these crates. Using hg-core ============= Local use (you need to clean previous build artifacts if you have built without rust previously):: $ HGWITHRUSTEXT=cpython make local # to use ./hg $ HGWITHRUSTEXT=cpython make tests # to run all tests $ (cd tests; HGWITHRUSTEXT=cpython ./run-tests.py) # only the .t $ ./hg debuginstall | grep rust # to validate rust is in use checking module policy (rust+c-allow) Setting ``HGWITHRUSTEXT`` to other values like ``true`` is deprecated and enables only a fraction of the rust code. Developing hg-core ================== Simply run:: $ cargo build --release It is possible to build without ``--release``, but it is not recommended if performance is of any interest: there can be an order of magnitude of degradation when removing ``--release``. For faster builds, you may want to skip code generation:: $ cargo check You can run only the rust-specific tests (as opposed to tests of mercurial as a whole) with:: $ cargo test --all mercurial-5.3.1/rust/hgcli/0000755015407300116100000000000013627755444015477 5ustar augieeng00000000000000mercurial-5.3.1/rust/hgcli/Cargo.toml0000644015407300116100000000160213627755405017423 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-5.3.1/rust/hgcli/Cargo.lock0000644015407300116100000001373213627755405017407 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.45 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.43 (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.45 (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.45" 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.45 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" version = "0.2.6" 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.45 (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.45 (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.45 (registry+https://github.com/rust-lang/crates.io-index)" = "2d2857ec59fadc0773853c664d2d18e7198e83883e7060b63c924cb077bd5c74" "checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" "checksum num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" "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-5.3.1/rust/hgcli/build.rs0000644015407300116100000000670313627755405017147 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-5.3.1/rust/hgcli/README.rst0000644015407300116100000000345113627755405017166 0ustar augieeng00000000000000Features -------- 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-5.3.1/rust/hgcli/src/0000755015407300116100000000000013627755444016266 5ustar augieeng00000000000000mercurial-5.3.1/rust/hgcli/src/main.rs0000644015407300116100000001611713627755405017563 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 cpython; extern crate libc; extern crate python27_sys; use cpython::{NoArgs, ObjectProtocol, PyModule, PyResult, Python}; use libc::{c_char, c_int}; use std::env; use std::ffi::{CString, OsStr}; #[cfg(target_family = "unix")] use std::os::unix::ffi::{OsStrExt, OsStringExt}; use std::path::PathBuf; #[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_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_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-5.3.1/rust/hg-core/0000755015407300116100000000000013627755444015735 5ustar augieeng00000000000000mercurial-5.3.1/rust/hg-core/Cargo.toml0000644015407300116100000000060313627755404017660 0ustar augieeng00000000000000[package] name = "hg-core" version = "0.1.0" authors = ["Georges Racinet "] description = "Mercurial pure Rust core library, with no assumption on Python bindings (FFI)" edition = "2018" [lib] name = "hg" [dependencies] byteorder = "1.3.1" lazy_static = "1.3.0" memchr = "2.2.0" rand = "0.6.5" rand_pcg = "0.1.1" rayon = "1.2.0" regex = "1.1.0" twox-hash = "1.5.0" mercurial-5.3.1/rust/hg-core/rustfmt.toml0000644015407300116100000000010213627755404020323 0ustar augieeng00000000000000max_width = 79 wrap_comments = true error_on_line_overflow = true mercurial-5.3.1/rust/hg-core/tests/0000755015407300116100000000000013627755444017077 5ustar augieeng00000000000000mercurial-5.3.1/rust/hg-core/tests/test_missing_ancestors.rs0000644015407300116100000002606313627755405024242 0ustar augieeng00000000000000use hg::testing::VecGraph; use hg::Revision; use hg::*; use rand::distributions::{Distribution, LogNormal, Uniform}; use rand::{thread_rng, Rng, RngCore, SeedableRng}; use std::cmp::min; use std::collections::HashSet; use std::env; use std::fmt::Debug; fn build_random_graph( nodes_opt: Option, rootprob_opt: Option, mergeprob_opt: Option, prevprob_opt: Option, ) -> VecGraph { let nodes = nodes_opt.unwrap_or(100); let rootprob = rootprob_opt.unwrap_or(0.05); let mergeprob = mergeprob_opt.unwrap_or(0.2); let prevprob = prevprob_opt.unwrap_or(0.7); let mut rng = thread_rng(); let mut vg: VecGraph = Vec::with_capacity(nodes); for i in 0..nodes { if i == 0 || rng.gen_bool(rootprob) { vg.push([NULL_REVISION, NULL_REVISION]) } else if i == 1 { vg.push([0, NULL_REVISION]) } else if rng.gen_bool(mergeprob) { let p1 = { if i == 2 || rng.gen_bool(prevprob) { (i - 1) as Revision } else { rng.gen_range(0, i - 1) as Revision } }; // p2 is a random revision lower than i and different from p1 let mut p2 = rng.gen_range(0, i - 1) as Revision; if p2 >= p1 { p2 = p2 + 1; } vg.push([p1, p2]); } else if rng.gen_bool(prevprob) { vg.push([(i - 1) as Revision, NULL_REVISION]) } else { vg.push([rng.gen_range(0, i - 1) as Revision, NULL_REVISION]) } } vg } /// Compute the ancestors set of all revisions of a VecGraph fn ancestors_sets(vg: &VecGraph) -> Vec> { let mut ancs: Vec> = Vec::new(); for i in 0..vg.len() { let mut ancs_i = HashSet::new(); ancs_i.insert(i as Revision); for p in vg[i].iter().cloned() { if p != NULL_REVISION { ancs_i.extend(&ancs[p as usize]); } } ancs.push(ancs_i); } ancs } #[derive(Clone, Debug)] enum MissingAncestorsAction { InitialBases(HashSet), AddBases(HashSet), RemoveAncestorsFrom(HashSet), MissingAncestors(HashSet), } /// An instrumented naive yet obviously correct implementation /// /// It also records all its actions for easy reproduction for replay /// of problematic cases struct NaiveMissingAncestors<'a> { ancestors_sets: &'a Vec>, graph: &'a VecGraph, // used for error reporting only bases: HashSet, history: Vec, // for error reporting, assuming we are in a random test random_seed: String, } impl<'a> NaiveMissingAncestors<'a> { fn new( graph: &'a VecGraph, ancestors_sets: &'a Vec>, bases: &HashSet, random_seed: &str, ) -> Self { Self { ancestors_sets: ancestors_sets, bases: bases.clone(), graph: graph, history: vec![MissingAncestorsAction::InitialBases(bases.clone())], random_seed: random_seed.into(), } } fn add_bases(&mut self, new_bases: HashSet) { self.bases.extend(&new_bases); self.history .push(MissingAncestorsAction::AddBases(new_bases)) } fn remove_ancestors_from(&mut self, revs: &mut HashSet) { revs.remove(&NULL_REVISION); self.history .push(MissingAncestorsAction::RemoveAncestorsFrom(revs.clone())); for base in self.bases.iter().cloned() { if base != NULL_REVISION { for rev in &self.ancestors_sets[base as usize] { revs.remove(&rev); } } } } fn missing_ancestors( &mut self, revs: impl IntoIterator, ) -> Vec { let revs_as_set: HashSet = revs.into_iter().collect(); let mut missing: HashSet = HashSet::new(); for rev in revs_as_set.iter().cloned() { if rev != NULL_REVISION { missing.extend(&self.ancestors_sets[rev as usize]) } } self.history .push(MissingAncestorsAction::MissingAncestors(revs_as_set)); for base in self.bases.iter().cloned() { if base != NULL_REVISION { for rev in &self.ancestors_sets[base as usize] { missing.remove(&rev); } } } let mut res: Vec = missing.iter().cloned().collect(); res.sort(); res } fn assert_eq(&self, left: T, right: T) where T: PartialEq + Debug, { if left == right { return; } panic!(format!( "Equality assertion failed (left != right) left={:?} right={:?} graph={:?} current bases={:?} history={:?} random seed={} ", left, right, self.graph, self.bases, self.history, self.random_seed, )); } } /// Choose a set of random revisions /// /// The size of the set is taken from a LogNormal distribution /// with default mu=1.1 and default sigma=0.8. Quoting the Python /// test this is taken from: /// the default mu and sigma give us a nice distribution of mostly /// single-digit counts (including 0) with some higher ones /// The sample may include NULL_REVISION fn sample_revs( rng: &mut R, maxrev: Revision, mu_opt: Option, sigma_opt: Option, ) -> HashSet { let mu = mu_opt.unwrap_or(1.1); let sigma = sigma_opt.unwrap_or(0.8); let log_normal = LogNormal::new(mu, sigma); let nb = min(maxrev as usize, log_normal.sample(rng).floor() as usize); let dist = Uniform::from(NULL_REVISION..maxrev); return rng.sample_iter(&dist).take(nb).collect(); } /// Produces the hexadecimal representation of a slice of bytes fn hex_bytes(bytes: &[u8]) -> String { let mut s = String::with_capacity(bytes.len() * 2); for b in bytes { s.push_str(&format!("{:x}", b)); } s } /// Fill a random seed from its hexadecimal representation. /// /// This signature is meant to be consistent with `RngCore::fill_bytes` fn seed_parse_in(hex: &str, seed: &mut [u8]) { if hex.len() != 32 { panic!("Seed {} is too short for 128 bits hex", hex); } for i in 0..8 { seed[i] = u8::from_str_radix(&hex[2 * i..2 * (i + 1)], 16) .unwrap_or_else(|_e| panic!("Seed {} is not 128 bits hex", hex)); } } /// Parse the parameters for `test_missing_ancestors()` /// /// Returns (graphs, instances, calls per instance) fn parse_test_missing_ancestors_params(var: &str) -> (usize, usize, usize) { let err_msg = "TEST_MISSING_ANCESTORS format: GRAPHS,INSTANCES,CALLS"; let params: Vec = var .split(',') .map(|n| n.trim().parse().expect(err_msg)) .collect(); if params.len() != 3 { panic!(err_msg); } (params[0], params[1], params[2]) } #[test] /// This test creates lots of random VecGraphs, /// and compare a bunch of MissingAncestors for them with /// NaiveMissingAncestors that rely on precomputed transitive closures of /// these VecGraphs (ancestors_sets). /// /// For each generater graph, several instances of `MissingAncestors` are /// created, whose methods are called and checked a given number of times. /// /// This test can be parametrized by two environment variables: /// /// - TEST_RANDOM_SEED: must be 128 bits in hexadecimal /// - TEST_MISSING_ANCESTORS: "GRAPHS,INSTANCES,CALLS". The default is /// "100,10,10" /// /// This is slow: it runs on my workstation in about 5 seconds with the /// default parameters with a plain `cargo --test`. /// /// If you want to run it faster, especially if you're changing the /// parameters, use `cargo test --release`. /// For me, that gets it down to 0.15 seconds with the default parameters fn test_missing_ancestors_compare_naive() { let (graphcount, testcount, inccount) = match env::var("TEST_MISSING_ANCESTORS") { Err(env::VarError::NotPresent) => (100, 10, 10), Ok(val) => parse_test_missing_ancestors_params(&val), Err(env::VarError::NotUnicode(_)) => { panic!("TEST_MISSING_ANCESTORS is invalid"); } }; let mut seed: [u8; 16] = [0; 16]; match env::var("TEST_RANDOM_SEED") { Ok(val) => { seed_parse_in(&val, &mut seed); } Err(env::VarError::NotPresent) => { thread_rng().fill_bytes(&mut seed); } Err(env::VarError::NotUnicode(_)) => { panic!("TEST_RANDOM_SEED must be 128 bits in hex"); } } let hex_seed = hex_bytes(&seed); eprintln!("Random seed: {}", hex_seed); let mut rng = rand_pcg::Pcg32::from_seed(seed); eprint!("Checking MissingAncestors against brute force implementation "); eprint!("for {} random graphs, ", graphcount); eprintln!( "with {} instances for each and {} calls per instance", testcount, inccount, ); for g in 0..graphcount { if g != 0 && g % 100 == 0 { eprintln!("Tested with {} graphs", g); } let graph = build_random_graph(None, None, None, None); let graph_len = graph.len() as Revision; let ancestors_sets = ancestors_sets(&graph); for _testno in 0..testcount { let bases: HashSet = sample_revs(&mut rng, graph_len, None, None); let mut inc = MissingAncestors::::new( graph.clone(), bases.clone(), ); let mut naive = NaiveMissingAncestors::new( &graph, &ancestors_sets, &bases, &hex_seed, ); for _m in 0..inccount { if rng.gen_bool(0.2) { let new_bases = sample_revs(&mut rng, graph_len, None, None); inc.add_bases(new_bases.iter().cloned()); naive.add_bases(new_bases); } if rng.gen_bool(0.4) { // larger set so that there are more revs to remove from let mut hrevs = sample_revs(&mut rng, graph_len, Some(1.5), None); let mut rrevs = hrevs.clone(); inc.remove_ancestors_from(&mut hrevs).unwrap(); naive.remove_ancestors_from(&mut rrevs); naive.assert_eq(hrevs, rrevs); } else { let revs = sample_revs(&mut rng, graph_len, None, None); let hm = inc.missing_ancestors(revs.iter().cloned()).unwrap(); let rm = naive.missing_ancestors(revs.iter().cloned()); naive.assert_eq(hm, rm); } } } } } mercurial-5.3.1/rust/hg-core/src/0000755015407300116100000000000013627755444016524 5ustar augieeng00000000000000mercurial-5.3.1/rust/hg-core/src/ancestors.rs0000644015407300116100000006303413627755405021076 0ustar augieeng00000000000000// ancestors.rs // // Copyright 2018 Georges Racinet // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Rust versions of generic DAG ancestors algorithms for Mercurial use super::{Graph, GraphError, Revision, NULL_REVISION}; use crate::dagops; use std::cmp::max; use std::collections::{BinaryHeap, HashSet}; /// Iterator over the ancestors of a given list of revisions /// This is a generic type, defined and implemented for any Graph, so that /// it's easy to /// /// - unit test in pure Rust /// - bind to main Mercurial code, potentially in several ways and have these /// bindings evolve over time pub struct AncestorsIterator { graph: G, visit: BinaryHeap, seen: HashSet, stoprev: Revision, } /// Lazy ancestors set, backed by AncestorsIterator pub struct LazyAncestors { graph: G, containsiter: AncestorsIterator, initrevs: Vec, stoprev: Revision, inclusive: bool, } pub struct MissingAncestors { graph: G, bases: HashSet, max_base: Revision, } impl AncestorsIterator { /// Constructor. /// /// if `inclusive` is true, then the init revisions are emitted in /// particular, otherwise iteration starts from their parents. pub fn new( graph: G, initrevs: impl IntoIterator, stoprev: Revision, inclusive: bool, ) -> Result { let filtered_initrevs = initrevs.into_iter().filter(|&r| r >= stoprev); if inclusive { let visit: BinaryHeap = filtered_initrevs.collect(); let seen = visit.iter().map(|&x| x).collect(); return Ok(AncestorsIterator { visit: visit, seen: seen, stoprev: stoprev, graph: graph, }); } let mut this = AncestorsIterator { visit: BinaryHeap::new(), seen: HashSet::new(), stoprev: stoprev, graph: graph, }; this.seen.insert(NULL_REVISION); for rev in filtered_initrevs { for parent in this.graph.parents(rev)?.iter().cloned() { this.conditionally_push_rev(parent); } } Ok(this) } #[inline] fn conditionally_push_rev(&mut self, rev: Revision) { if self.stoprev <= rev && self.seen.insert(rev) { self.visit.push(rev); } } /// Consumes partially the iterator to tell if the given target /// revision /// is in the ancestors it emits. /// This is meant for iterators actually dedicated to that kind of /// purpose pub fn contains(&mut self, target: Revision) -> Result { if self.seen.contains(&target) && target != NULL_REVISION { return Ok(true); } for item in self { let rev = item?; if rev == target { return Ok(true); } if rev < target { return Ok(false); } } Ok(false) } pub fn peek(&self) -> Option { self.visit.peek().map(|&r| r) } /// Tell if the iterator is about an empty set /// /// The result does not depend whether the iterator has been consumed /// or not. /// This is mostly meant for iterators backing a lazy ancestors set pub fn is_empty(&self) -> bool { if self.visit.len() > 0 { return false; } if self.seen.len() > 1 { return false; } // at this point, the seen set is at most a singleton. // If not `self.inclusive`, it's still possible that it has only // the null revision self.seen.is_empty() || self.seen.contains(&NULL_REVISION) } } /// Main implementation for the iterator /// /// The algorithm is the same as in `_lazyancestorsiter()` from `ancestors.py` /// with a few non crucial differences: /// /// - there's no filtering of invalid parent revisions. Actually, it should be /// consistent and more efficient to filter them from the end caller. /// - we don't have the optimization for adjacent revisions (i.e., the case /// where `p1 == rev - 1`), because it amounts to update the first element of /// the heap without sifting, which Rust's BinaryHeap doesn't let us do. /// - we save a few pushes by comparing with `stoprev` before pushing impl Iterator for AncestorsIterator { type Item = Result; fn next(&mut self) -> Option { let current = match self.visit.peek() { None => { return None; } Some(c) => *c, }; let [p1, p2] = match self.graph.parents(current) { Ok(ps) => ps, Err(e) => return Some(Err(e)), }; if p1 < self.stoprev || !self.seen.insert(p1) { self.visit.pop(); } else { *(self.visit.peek_mut().unwrap()) = p1; }; self.conditionally_push_rev(p2); Some(Ok(current)) } } impl LazyAncestors { pub fn new( graph: G, initrevs: impl IntoIterator, stoprev: Revision, inclusive: bool, ) -> Result { let v: Vec = initrevs.into_iter().collect(); Ok(LazyAncestors { graph: graph.clone(), containsiter: AncestorsIterator::new( graph, v.iter().cloned(), stoprev, inclusive, )?, initrevs: v, stoprev: stoprev, inclusive: inclusive, }) } pub fn contains(&mut self, rev: Revision) -> Result { self.containsiter.contains(rev) } pub fn is_empty(&self) -> bool { self.containsiter.is_empty() } pub fn iter(&self) -> AncestorsIterator { // the arguments being the same as for self.containsiter, we know // for sure that AncestorsIterator constructor can't fail AncestorsIterator::new( self.graph.clone(), self.initrevs.iter().cloned(), self.stoprev, self.inclusive, ) .unwrap() } } impl MissingAncestors { pub fn new(graph: G, bases: impl IntoIterator) -> Self { let mut created = MissingAncestors { graph: graph, bases: HashSet::new(), max_base: NULL_REVISION, }; created.add_bases(bases); created } pub fn has_bases(&self) -> bool { !self.bases.is_empty() } /// Return a reference to current bases. /// /// This is useful in unit tests, but also setdiscovery.py does /// read the bases attribute of a ancestor.missingancestors instance. pub fn get_bases<'a>(&'a self) -> &'a HashSet { &self.bases } /// Computes the relative heads of current bases. /// /// The object is still usable after this. pub fn bases_heads(&self) -> Result, GraphError> { dagops::heads(&self.graph, self.bases.iter()) } /// Consumes the object and returns the relative heads of its bases. pub fn into_bases_heads( mut self, ) -> Result, GraphError> { dagops::retain_heads(&self.graph, &mut self.bases)?; Ok(self.bases) } /// Add some revisions to `self.bases` /// /// Takes care of keeping `self.max_base` up to date. pub fn add_bases( &mut self, new_bases: impl IntoIterator, ) { let mut max_base = self.max_base; self.bases.extend( new_bases .into_iter() .filter(|&rev| rev != NULL_REVISION) .map(|r| { if r > max_base { max_base = r; } r }), ); self.max_base = max_base; } /// Remove all ancestors of self.bases from the revs set (in place) pub fn remove_ancestors_from( &mut self, revs: &mut HashSet, ) -> Result<(), GraphError> { revs.retain(|r| !self.bases.contains(r)); // the null revision is always an ancestor. Logically speaking // it's debatable in case bases is empty, but the Python // implementation always adds NULL_REVISION to bases, making it // unconditionnally true. revs.remove(&NULL_REVISION); if revs.is_empty() { return Ok(()); } // anything in revs > start is definitely not an ancestor of bases // revs <= start need to be investigated if self.max_base == NULL_REVISION { return Ok(()); } // whatever happens, we'll keep at least keepcount of them // knowing this gives us a earlier stop condition than // going all the way to the root let keepcount = revs.iter().filter(|r| **r > self.max_base).count(); let mut curr = self.max_base; while curr != NULL_REVISION && revs.len() > keepcount { if self.bases.contains(&curr) { revs.remove(&curr); self.add_parents(curr)?; } curr -= 1; } Ok(()) } /// Add the parents of `rev` to `self.bases` /// /// This has no effect on `self.max_base` #[inline] fn add_parents(&mut self, rev: Revision) -> Result<(), GraphError> { if rev == NULL_REVISION { return Ok(()); } for p in self.graph.parents(rev)?.iter().cloned() { // No need to bother the set with inserting NULL_REVISION over and // over if p != NULL_REVISION { self.bases.insert(p); } } Ok(()) } /// Return all the ancestors of revs that are not ancestors of self.bases /// /// This may include elements from revs. /// /// Equivalent to the revset (::revs - ::self.bases). Revs are returned in /// revision number order, which is a topological order. pub fn missing_ancestors( &mut self, revs: impl IntoIterator, ) -> Result, GraphError> { // just for convenience and comparison with Python version let bases_visit = &mut self.bases; let mut revs: HashSet = revs .into_iter() .filter(|r| !bases_visit.contains(r)) .collect(); let revs_visit = &mut revs; let mut both_visit: HashSet = revs_visit.intersection(&bases_visit).cloned().collect(); if revs_visit.is_empty() { return Ok(Vec::new()); } let max_revs = revs_visit.iter().cloned().max().unwrap(); let start = max(self.max_base, max_revs); // TODO heuristics for with_capacity()? let mut missing: Vec = Vec::new(); for curr in (0..=start).rev() { if revs_visit.is_empty() { break; } if both_visit.remove(&curr) { // curr's parents might have made it into revs_visit through // another path for p in self.graph.parents(curr)?.iter().cloned() { if p == NULL_REVISION { continue; } revs_visit.remove(&p); bases_visit.insert(p); both_visit.insert(p); } } else if revs_visit.remove(&curr) { missing.push(curr); for p in self.graph.parents(curr)?.iter().cloned() { if p == NULL_REVISION { continue; } if bases_visit.contains(&p) { // p is already known to be an ancestor of revs_visit revs_visit.remove(&p); both_visit.insert(p); } else if both_visit.contains(&p) { // p should have been in bases_visit revs_visit.remove(&p); bases_visit.insert(p); } else { // visit later revs_visit.insert(p); } } } else if bases_visit.contains(&curr) { for p in self.graph.parents(curr)?.iter().cloned() { if p == NULL_REVISION { continue; } if revs_visit.remove(&p) || both_visit.contains(&p) { // p is an ancestor of bases_visit, and is implicitly // in revs_visit, which means p is ::revs & ::bases. bases_visit.insert(p); both_visit.insert(p); } else { bases_visit.insert(p); } } } } missing.reverse(); Ok(missing) } } #[cfg(test)] mod tests { use super::*; use crate::testing::{SampleGraph, VecGraph}; use std::iter::FromIterator; fn list_ancestors( graph: G, initrevs: Vec, stoprev: Revision, inclusive: bool, ) -> Vec { AncestorsIterator::new(graph, initrevs, stoprev, inclusive) .unwrap() .map(|res| res.unwrap()) .collect() } #[test] /// Same tests as test-ancestor.py, without membership /// (see also test-ancestor.py.out) fn test_list_ancestor() { assert_eq!(list_ancestors(SampleGraph, vec![], 0, false), vec![]); assert_eq!( list_ancestors(SampleGraph, vec![11, 13], 0, false), vec![8, 7, 4, 3, 2, 1, 0] ); assert_eq!( list_ancestors(SampleGraph, vec![1, 3], 0, false), vec![1, 0] ); assert_eq!( list_ancestors(SampleGraph, vec![11, 13], 0, true), vec![13, 11, 8, 7, 4, 3, 2, 1, 0] ); assert_eq!( list_ancestors(SampleGraph, vec![11, 13], 6, false), vec![8, 7] ); assert_eq!( list_ancestors(SampleGraph, vec![11, 13], 6, true), vec![13, 11, 8, 7] ); assert_eq!( list_ancestors(SampleGraph, vec![11, 13], 11, true), vec![13, 11] ); assert_eq!( list_ancestors(SampleGraph, vec![11, 13], 12, true), vec![13] ); assert_eq!( list_ancestors(SampleGraph, vec![10, 1], 0, true), vec![10, 5, 4, 2, 1, 0] ); } #[test] /// Corner case that's not directly in test-ancestors.py, but /// that happens quite often, as demonstrated by running the whole /// suite. /// For instance, run tests/test-obsolete-checkheads.t fn test_nullrev_input() { let mut iter = AncestorsIterator::new(SampleGraph, vec![-1], 0, false).unwrap(); assert_eq!(iter.next(), None) } #[test] fn test_contains() { let mut lazy = AncestorsIterator::new(SampleGraph, vec![10, 1], 0, true).unwrap(); assert!(lazy.contains(1).unwrap()); assert!(!lazy.contains(3).unwrap()); let mut lazy = AncestorsIterator::new(SampleGraph, vec![0], 0, false).unwrap(); assert!(!lazy.contains(NULL_REVISION).unwrap()); } #[test] fn test_peek() { let mut iter = AncestorsIterator::new(SampleGraph, vec![10], 0, true).unwrap(); // peek() gives us the next value assert_eq!(iter.peek(), Some(10)); // but it's not been consumed assert_eq!(iter.next(), Some(Ok(10))); // and iteration resumes normally assert_eq!(iter.next(), Some(Ok(5))); // let's drain the iterator to test peek() at the end while iter.next().is_some() {} assert_eq!(iter.peek(), None); } #[test] fn test_empty() { let mut iter = AncestorsIterator::new(SampleGraph, vec![10], 0, true).unwrap(); assert!(!iter.is_empty()); while iter.next().is_some() {} assert!(!iter.is_empty()); let iter = AncestorsIterator::new(SampleGraph, vec![], 0, true).unwrap(); assert!(iter.is_empty()); // case where iter.seen == {NULL_REVISION} let iter = AncestorsIterator::new(SampleGraph, vec![0], 0, false).unwrap(); assert!(iter.is_empty()); } /// A corrupted Graph, supporting error handling tests #[derive(Clone, Debug)] struct Corrupted; impl Graph for Corrupted { fn parents(&self, rev: Revision) -> Result<[Revision; 2], GraphError> { match rev { 1 => Ok([0, -1]), r => Err(GraphError::ParentOutOfRange(r)), } } } #[test] fn test_initrev_out_of_range() { // inclusive=false looks up initrev's parents right away match AncestorsIterator::new(SampleGraph, vec![25], 0, false) { Ok(_) => panic!("Should have been ParentOutOfRange"), Err(e) => assert_eq!(e, GraphError::ParentOutOfRange(25)), } } #[test] fn test_next_out_of_range() { // inclusive=false looks up initrev's parents right away let mut iter = AncestorsIterator::new(Corrupted, vec![1], 0, false).unwrap(); assert_eq!(iter.next(), Some(Err(GraphError::ParentOutOfRange(0)))); } #[test] fn test_lazy_iter_contains() { let mut lazy = LazyAncestors::new(SampleGraph, vec![11, 13], 0, false).unwrap(); let revs: Vec = lazy.iter().map(|r| r.unwrap()).collect(); // compare with iterator tests on the same initial revisions assert_eq!(revs, vec![8, 7, 4, 3, 2, 1, 0]); // contains() results are correct, unaffected by the fact that // we consumed entirely an iterator out of lazy assert_eq!(lazy.contains(2), Ok(true)); assert_eq!(lazy.contains(9), Ok(false)); } #[test] fn test_lazy_contains_iter() { let mut lazy = LazyAncestors::new(SampleGraph, vec![11, 13], 0, false).unwrap(); // reminder: [8, 7, 4, 3, 2, 1, 0] assert_eq!(lazy.contains(2), Ok(true)); assert_eq!(lazy.contains(6), Ok(false)); // after consumption of 2 by the inner iterator, results stay // consistent assert_eq!(lazy.contains(2), Ok(true)); assert_eq!(lazy.contains(5), Ok(false)); // iter() still gives us a fresh iterator let revs: Vec = lazy.iter().map(|r| r.unwrap()).collect(); assert_eq!(revs, vec![8, 7, 4, 3, 2, 1, 0]); } #[test] /// Test constructor, add/get bases and heads fn test_missing_bases() -> Result<(), GraphError> { let mut missing_ancestors = MissingAncestors::new(SampleGraph, [5, 3, 1, 3].iter().cloned()); let mut as_vec: Vec = missing_ancestors.get_bases().iter().cloned().collect(); as_vec.sort(); assert_eq!(as_vec, [1, 3, 5]); assert_eq!(missing_ancestors.max_base, 5); missing_ancestors.add_bases([3, 7, 8].iter().cloned()); as_vec = missing_ancestors.get_bases().iter().cloned().collect(); as_vec.sort(); assert_eq!(as_vec, [1, 3, 5, 7, 8]); assert_eq!(missing_ancestors.max_base, 8); as_vec = missing_ancestors.bases_heads()?.iter().cloned().collect(); as_vec.sort(); assert_eq!(as_vec, [3, 5, 7, 8]); Ok(()) } fn assert_missing_remove( bases: &[Revision], revs: &[Revision], expected: &[Revision], ) { let mut missing_ancestors = MissingAncestors::new(SampleGraph, bases.iter().cloned()); let mut revset: HashSet = revs.iter().cloned().collect(); missing_ancestors .remove_ancestors_from(&mut revset) .unwrap(); let mut as_vec: Vec = revset.into_iter().collect(); as_vec.sort(); assert_eq!(as_vec.as_slice(), expected); } #[test] fn test_missing_remove() { assert_missing_remove( &[1, 2, 3, 4, 7], Vec::from_iter(1..10).as_slice(), &[5, 6, 8, 9], ); assert_missing_remove(&[10], &[11, 12, 13, 14], &[11, 12, 13, 14]); assert_missing_remove(&[7], &[1, 2, 3, 4, 5], &[3, 5]); } fn assert_missing_ancestors( bases: &[Revision], revs: &[Revision], expected: &[Revision], ) { let mut missing_ancestors = MissingAncestors::new(SampleGraph, bases.iter().cloned()); let missing = missing_ancestors .missing_ancestors(revs.iter().cloned()) .unwrap(); assert_eq!(missing.as_slice(), expected); } #[test] fn test_missing_ancestors() { // examples taken from test-ancestors.py by having it run // on the same graph (both naive and fast Python algs) assert_missing_ancestors(&[10], &[11], &[3, 7, 11]); assert_missing_ancestors(&[11], &[10], &[5, 10]); assert_missing_ancestors(&[7], &[9, 11], &[3, 6, 9, 11]); } /// An interesting case found by a random generator similar to /// the one in test-ancestor.py. An early version of Rust MissingAncestors /// failed this, yet none of the integration tests of the whole suite /// catched it. #[test] fn test_remove_ancestors_from_case1() { let graph: VecGraph = vec![ [NULL_REVISION, NULL_REVISION], [0, NULL_REVISION], [1, 0], [2, 1], [3, NULL_REVISION], [4, NULL_REVISION], [5, 1], [2, NULL_REVISION], [7, NULL_REVISION], [8, NULL_REVISION], [9, NULL_REVISION], [10, 1], [3, NULL_REVISION], [12, NULL_REVISION], [13, NULL_REVISION], [14, NULL_REVISION], [4, NULL_REVISION], [16, NULL_REVISION], [17, NULL_REVISION], [18, NULL_REVISION], [19, 11], [20, NULL_REVISION], [21, NULL_REVISION], [22, NULL_REVISION], [23, NULL_REVISION], [2, NULL_REVISION], [3, NULL_REVISION], [26, 24], [27, NULL_REVISION], [28, NULL_REVISION], [12, NULL_REVISION], [1, NULL_REVISION], [1, 9], [32, NULL_REVISION], [33, NULL_REVISION], [34, 31], [35, NULL_REVISION], [36, 26], [37, NULL_REVISION], [38, NULL_REVISION], [39, NULL_REVISION], [40, NULL_REVISION], [41, NULL_REVISION], [42, 26], [0, NULL_REVISION], [44, NULL_REVISION], [45, 4], [40, NULL_REVISION], [47, NULL_REVISION], [36, 0], [49, NULL_REVISION], [NULL_REVISION, NULL_REVISION], [51, NULL_REVISION], [52, NULL_REVISION], [53, NULL_REVISION], [14, NULL_REVISION], [55, NULL_REVISION], [15, NULL_REVISION], [23, NULL_REVISION], [58, NULL_REVISION], [59, NULL_REVISION], [2, NULL_REVISION], [61, 59], [62, NULL_REVISION], [63, NULL_REVISION], [NULL_REVISION, NULL_REVISION], [65, NULL_REVISION], [66, NULL_REVISION], [67, NULL_REVISION], [68, NULL_REVISION], [37, 28], [69, 25], [71, NULL_REVISION], [72, NULL_REVISION], [50, 2], [74, NULL_REVISION], [12, NULL_REVISION], [18, NULL_REVISION], [77, NULL_REVISION], [78, NULL_REVISION], [79, NULL_REVISION], [43, 33], [81, NULL_REVISION], [82, NULL_REVISION], [83, NULL_REVISION], [84, 45], [85, NULL_REVISION], [86, NULL_REVISION], [NULL_REVISION, NULL_REVISION], [88, NULL_REVISION], [NULL_REVISION, NULL_REVISION], [76, 83], [44, NULL_REVISION], [92, NULL_REVISION], [93, NULL_REVISION], [9, NULL_REVISION], [95, 67], [96, NULL_REVISION], [97, NULL_REVISION], [NULL_REVISION, NULL_REVISION], ]; let problem_rev = 28 as Revision; let problem_base = 70 as Revision; // making the problem obvious: problem_rev is a parent of problem_base assert_eq!(graph.parents(problem_base).unwrap()[1], problem_rev); let mut missing_ancestors: MissingAncestors = MissingAncestors::new( graph, [60, 26, 70, 3, 96, 19, 98, 49, 97, 47, 1, 6] .iter() .cloned(), ); assert!(missing_ancestors.bases.contains(&problem_base)); let mut revs: HashSet = [4, 12, 41, 28, 68, 38, 1, 30, 56, 44] .iter() .cloned() .collect(); missing_ancestors.remove_ancestors_from(&mut revs).unwrap(); assert!(!revs.contains(&problem_rev)); } } mercurial-5.3.1/rust/hg-core/src/discovery.rs0000644015407300116100000005555513627755404021114 0ustar augieeng00000000000000// discovery.rs // // Copyright 2019 Georges Racinet // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Discovery operations //! //! This is a Rust counterpart to the `partialdiscovery` class of //! `mercurial.setdiscovery` use super::{Graph, GraphError, Revision, NULL_REVISION}; use crate::{ancestors::MissingAncestors, dagops, FastHashMap}; use rand::seq::SliceRandom; use rand::{thread_rng, RngCore, SeedableRng}; use std::cmp::{max, min}; use std::collections::{HashSet, VecDeque}; type Rng = rand_pcg::Pcg32; type Seed = [u8; 16]; pub struct PartialDiscovery { target_heads: Option>, graph: G, // plays the role of self._repo common: MissingAncestors, undecided: Option>, children_cache: Option>>, missing: HashSet, rng: Rng, respect_size: bool, randomize: bool, } pub struct DiscoveryStats { pub undecided: Option, } /// Update an existing sample to match the expected size /// /// The sample is updated with revisions exponentially distant from each /// element of `heads`. /// /// If a target size is specified, the sampling will stop once this size is /// reached. Otherwise sampling will happen until roots of the set are /// reached. /// /// - `revs`: set of revs we want to discover (if None, `assume` the whole dag /// represented by `parentfn` /// - `heads`: set of DAG head revs /// - `sample`: a sample to update /// - `parentfn`: a callable to resolve parents for a revision /// - `quicksamplesize`: optional target size of the sample fn update_sample( revs: Option<&HashSet>, heads: impl IntoIterator, sample: &mut HashSet, parentsfn: impl Fn(Revision) -> Result, quicksamplesize: Option, ) -> Result<(), GraphError> where I: Iterator, { let mut distances: FastHashMap = FastHashMap::default(); let mut visit: VecDeque = heads.into_iter().collect(); let mut factor: u32 = 1; let mut seen: HashSet = HashSet::new(); while let Some(current) = visit.pop_front() { if !seen.insert(current) { continue; } let d = *distances.entry(current).or_insert(1); if d > factor { factor *= 2; } if d == factor { sample.insert(current); if let Some(sz) = quicksamplesize { if sample.len() >= sz { return Ok(()); } } } for p in parentsfn(current)? { if let Some(revs) = revs { if !revs.contains(&p) { continue; } } distances.entry(p).or_insert(d + 1); visit.push_back(p); } } Ok(()) } struct ParentsIterator { parents: [Revision; 2], cur: usize, } impl ParentsIterator { fn graph_parents( graph: &impl Graph, r: Revision, ) -> Result { Ok(ParentsIterator { parents: graph.parents(r)?, cur: 0, }) } } impl Iterator for ParentsIterator { type Item = Revision; fn next(&mut self) -> Option { if self.cur > 1 { return None; } let rev = self.parents[self.cur]; self.cur += 1; if rev == NULL_REVISION { return self.next(); } Some(rev) } } impl PartialDiscovery { /// Create a PartialDiscovery object, with the intent /// of comparing our `::` revset to the contents of another /// repo. /// /// For now `target_heads` is passed as a vector, and will be used /// at the first call to `ensure_undecided()`. /// /// If we want to make the signature more flexible, /// we'll have to make it a type argument of `PartialDiscovery` or a trait /// object since we'll keep it in the meanwhile /// /// The `respect_size` boolean controls how the sampling methods /// will interpret the size argument requested by the caller. If it's /// `false`, they are allowed to produce a sample whose size is more /// appropriate to the situation (typically bigger). /// /// The `randomize` boolean affects sampling, and specifically how /// limiting or last-minute expanding is been done: /// /// If `true`, both will perform random picking from `self.undecided`. /// This is currently the best for actual discoveries. /// /// If `false`, a reproductible picking strategy is performed. This is /// useful for integration tests. pub fn new( graph: G, target_heads: Vec, respect_size: bool, randomize: bool, ) -> Self { let mut seed = [0; 16]; if randomize { thread_rng().fill_bytes(&mut seed); } Self::new_with_seed(graph, target_heads, seed, respect_size, randomize) } pub fn new_with_seed( graph: G, target_heads: Vec, seed: Seed, respect_size: bool, randomize: bool, ) -> Self { PartialDiscovery { undecided: None, children_cache: None, target_heads: Some(target_heads), graph: graph.clone(), common: MissingAncestors::new(graph, vec![]), missing: HashSet::new(), rng: Rng::from_seed(seed), respect_size: respect_size, randomize: randomize, } } /// Extract at most `size` random elements from sample and return them /// as a vector fn limit_sample( &mut self, mut sample: Vec, size: usize, ) -> Vec { if !self.randomize { sample.sort(); sample.truncate(size); return sample; } let sample_len = sample.len(); if sample_len <= size { return sample; } let rng = &mut self.rng; let dropped_size = sample_len - size; let limited_slice = if size < dropped_size { sample.partial_shuffle(rng, size).0 } else { sample.partial_shuffle(rng, dropped_size).1 }; limited_slice.to_owned() } /// Register revisions known as being common pub fn add_common_revisions( &mut self, common: impl IntoIterator, ) -> Result<(), GraphError> { let before_len = self.common.get_bases().len(); self.common.add_bases(common); if self.common.get_bases().len() == before_len { return Ok(()); } if let Some(ref mut undecided) = self.undecided { self.common.remove_ancestors_from(undecided)?; } Ok(()) } /// Register revisions known as being missing /// /// # Performance note /// /// Except in the most trivial case, the first call of this method has /// the side effect of computing `self.undecided` set for the first time, /// and the related caches it might need for efficiency of its internal /// computation. This is typically faster if more information is /// available in `self.common`. Therefore, for good performance, the /// caller should avoid calling this too early. pub fn add_missing_revisions( &mut self, missing: impl IntoIterator, ) -> Result<(), GraphError> { let mut tovisit: VecDeque = missing.into_iter().collect(); if tovisit.is_empty() { return Ok(()); } self.ensure_children_cache()?; self.ensure_undecided()?; // for safety of possible future refactors let children = self.children_cache.as_ref().unwrap(); let mut seen: HashSet = HashSet::new(); let undecided_mut = self.undecided.as_mut().unwrap(); while let Some(rev) = tovisit.pop_front() { if !self.missing.insert(rev) { // either it's known to be missing from a previous // invocation, and there's no need to iterate on its // children (we now they are all missing) // or it's from a previous iteration of this loop // and its children have already been queued continue; } undecided_mut.remove(&rev); match children.get(&rev) { None => { continue; } Some(this_children) => { for child in this_children.iter().cloned() { if seen.insert(child) { tovisit.push_back(child); } } } } } Ok(()) } /// Do we have any information about the peer? pub fn has_info(&self) -> bool { self.common.has_bases() } /// Did we acquire full knowledge of our Revisions that the peer has? pub fn is_complete(&self) -> bool { self.undecided.as_ref().map_or(false, |s| s.is_empty()) } /// Return the heads of the currently known common set of revisions. /// /// If the discovery process is not complete (see `is_complete()`), the /// caller must be aware that this is an intermediate state. /// /// On the other hand, if it is complete, then this is currently /// the only way to retrieve the end results of the discovery process. /// /// We may introduce in the future an `into_common_heads` call that /// would be more appropriate for normal Rust callers, dropping `self` /// if it is complete. pub fn common_heads(&self) -> Result, GraphError> { self.common.bases_heads() } /// Force first computation of `self.undecided` /// /// After this, `self.undecided.as_ref()` and `.as_mut()` can be /// unwrapped to get workable immutable or mutable references without /// any panic. /// /// This is an imperative call instead of an access with added lazyness /// to reduce easily the scope of mutable borrow for the caller, /// compared to undecided(&'a mut self) -> &'a… that would keep it /// as long as the resulting immutable one. fn ensure_undecided(&mut self) -> Result<(), GraphError> { if self.undecided.is_some() { return Ok(()); } let tgt = self.target_heads.take().unwrap(); self.undecided = Some(self.common.missing_ancestors(tgt)?.into_iter().collect()); Ok(()) } fn ensure_children_cache(&mut self) -> Result<(), GraphError> { if self.children_cache.is_some() { return Ok(()); } self.ensure_undecided()?; let mut children: FastHashMap> = FastHashMap::default(); for &rev in self.undecided.as_ref().unwrap() { for p in ParentsIterator::graph_parents(&self.graph, rev)? { children.entry(p).or_insert_with(|| Vec::new()).push(rev); } } self.children_cache = Some(children); Ok(()) } /// Provide statistics about the current state of the discovery process pub fn stats(&self) -> DiscoveryStats { DiscoveryStats { undecided: self.undecided.as_ref().map(|s| s.len()), } } pub fn take_quick_sample( &mut self, headrevs: impl IntoIterator, size: usize, ) -> Result, GraphError> { self.ensure_undecided()?; let mut sample = { let undecided = self.undecided.as_ref().unwrap(); if undecided.len() <= size { return Ok(undecided.iter().cloned().collect()); } dagops::heads(&self.graph, undecided.iter())? }; if sample.len() >= size { return Ok(self.limit_sample(sample.into_iter().collect(), size)); } update_sample( None, headrevs, &mut sample, |r| ParentsIterator::graph_parents(&self.graph, r), Some(size), )?; Ok(sample.into_iter().collect()) } /// Extract a sample from `self.undecided`, going from its heads and roots. /// /// The `size` parameter is used to avoid useless computations if /// it turns out to be bigger than the whole set of undecided Revisions. /// /// The sample is taken by using `update_sample` from the heads, then /// from the roots, working on the reverse DAG, /// expressed by `self.children_cache`. /// /// No effort is being made to complete or limit the sample to `size` /// but this method returns another interesting size that it derives /// from its knowledge of the structure of the various sets, leaving /// to the caller the decision to use it or not. fn bidirectional_sample( &mut self, size: usize, ) -> Result<(HashSet, usize), GraphError> { self.ensure_undecided()?; { // we don't want to compute children_cache before this // but doing it after extracting self.undecided takes a mutable // ref to self while a shareable one is still active. let undecided = self.undecided.as_ref().unwrap(); if undecided.len() <= size { return Ok((undecided.clone(), size)); } } self.ensure_children_cache()?; let revs = self.undecided.as_ref().unwrap(); let mut sample: HashSet = revs.clone(); // it's possible that leveraging the children cache would be more // efficient here dagops::retain_heads(&self.graph, &mut sample)?; let revsheads = sample.clone(); // was again heads(revs) in python // update from heads update_sample( Some(revs), revsheads.iter().cloned(), &mut sample, |r| ParentsIterator::graph_parents(&self.graph, r), None, )?; // update from roots let revroots: HashSet = dagops::roots(&self.graph, revs)?.into_iter().collect(); let prescribed_size = max(size, min(revroots.len(), revsheads.len())); let children = self.children_cache.as_ref().unwrap(); let empty_vec: Vec = Vec::new(); update_sample( Some(revs), revroots, &mut sample, |r| Ok(children.get(&r).unwrap_or(&empty_vec).iter().cloned()), None, )?; Ok((sample, prescribed_size)) } /// Fill up sample up to the wished size with random undecided Revisions. /// /// This is intended to be used as a last resort completion if the /// regular sampling algorithm returns too few elements. fn random_complete_sample( &mut self, sample: &mut Vec, size: usize, ) { let sample_len = sample.len(); if size <= sample_len { return; } let take_from: Vec = self .undecided .as_ref() .unwrap() .iter() .filter(|&r| !sample.contains(r)) .cloned() .collect(); sample.extend(self.limit_sample(take_from, size - sample_len)); } pub fn take_full_sample( &mut self, size: usize, ) -> Result, GraphError> { let (sample_set, prescribed_size) = self.bidirectional_sample(size)?; let size = if self.respect_size { size } else { prescribed_size }; let mut sample = self.limit_sample(sample_set.into_iter().collect(), size); self.random_complete_sample(&mut sample, size); Ok(sample) } } #[cfg(test)] mod tests { use super::*; use crate::testing::SampleGraph; /// A PartialDiscovery as for pushing all the heads of `SampleGraph` /// /// To avoid actual randomness in these tests, we give it a fixed /// random seed, but by default we'll test the random version. fn full_disco() -> PartialDiscovery { PartialDiscovery::new_with_seed( SampleGraph, vec![10, 11, 12, 13], [0; 16], true, true, ) } /// A PartialDiscovery as for pushing the 12 head of `SampleGraph` /// /// To avoid actual randomness in tests, we give it a fixed random seed. fn disco12() -> PartialDiscovery { PartialDiscovery::new_with_seed( SampleGraph, vec![12], [0; 16], true, true, ) } fn sorted_undecided( disco: &PartialDiscovery, ) -> Vec { let mut as_vec: Vec = disco.undecided.as_ref().unwrap().iter().cloned().collect(); as_vec.sort(); as_vec } fn sorted_missing(disco: &PartialDiscovery) -> Vec { let mut as_vec: Vec = disco.missing.iter().cloned().collect(); as_vec.sort(); as_vec } fn sorted_common_heads( disco: &PartialDiscovery, ) -> Result, GraphError> { let mut as_vec: Vec = disco.common_heads()?.iter().cloned().collect(); as_vec.sort(); Ok(as_vec) } #[test] fn test_add_common_get_undecided() -> Result<(), GraphError> { let mut disco = full_disco(); assert_eq!(disco.undecided, None); assert!(!disco.has_info()); assert_eq!(disco.stats().undecided, None); disco.add_common_revisions(vec![11, 12])?; assert!(disco.has_info()); assert!(!disco.is_complete()); assert!(disco.missing.is_empty()); // add_common_revisions did not trigger a premature computation // of `undecided`, let's check that and ask for them assert_eq!(disco.undecided, None); disco.ensure_undecided()?; assert_eq!(sorted_undecided(&disco), vec![5, 8, 10, 13]); assert_eq!(disco.stats().undecided, Some(4)); Ok(()) } /// in this test, we pretend that our peer misses exactly (8+10):: /// and we're comparing all our repo to it (as in a bare push) #[test] fn test_discovery() -> Result<(), GraphError> { let mut disco = full_disco(); disco.add_common_revisions(vec![11, 12])?; disco.add_missing_revisions(vec![8, 10])?; assert_eq!(sorted_undecided(&disco), vec![5]); assert_eq!(sorted_missing(&disco), vec![8, 10, 13]); assert!(!disco.is_complete()); disco.add_common_revisions(vec![5])?; assert_eq!(sorted_undecided(&disco), vec![]); assert_eq!(sorted_missing(&disco), vec![8, 10, 13]); assert!(disco.is_complete()); assert_eq!(sorted_common_heads(&disco)?, vec![5, 11, 12]); Ok(()) } #[test] fn test_add_missing_early_continue() -> Result<(), GraphError> { eprintln!("test_add_missing_early_stop"); let mut disco = full_disco(); disco.add_common_revisions(vec![13, 3, 4])?; disco.ensure_children_cache()?; // 12 is grand-child of 6 through 9 // passing them in this order maximizes the chances of the // early continue to do the wrong thing disco.add_missing_revisions(vec![6, 9, 12])?; assert_eq!(sorted_undecided(&disco), vec![5, 7, 10, 11]); assert_eq!(sorted_missing(&disco), vec![6, 9, 12]); assert!(!disco.is_complete()); Ok(()) } #[test] fn test_limit_sample_no_need_to() { let sample = vec![1, 2, 3, 4]; assert_eq!(full_disco().limit_sample(sample, 10), vec![1, 2, 3, 4]); } #[test] fn test_limit_sample_less_than_half() { assert_eq!(full_disco().limit_sample((1..6).collect(), 2), vec![4, 2]); } #[test] fn test_limit_sample_more_than_half() { assert_eq!(full_disco().limit_sample((1..4).collect(), 2), vec![3, 2]); } #[test] fn test_limit_sample_no_random() { let mut disco = full_disco(); disco.randomize = false; assert_eq!( disco.limit_sample(vec![1, 8, 13, 5, 7, 3], 4), vec![1, 3, 5, 7] ); } #[test] fn test_quick_sample_enough_undecided_heads() -> Result<(), GraphError> { let mut disco = full_disco(); disco.undecided = Some((1..=13).collect()); let mut sample_vec = disco.take_quick_sample(vec![], 4)?; sample_vec.sort(); assert_eq!(sample_vec, vec![10, 11, 12, 13]); Ok(()) } #[test] fn test_quick_sample_climbing_from_12() -> Result<(), GraphError> { let mut disco = disco12(); disco.ensure_undecided()?; let mut sample_vec = disco.take_quick_sample(vec![12], 4)?; sample_vec.sort(); // r12's only parent is r9, whose unique grand-parent through the // diamond shape is r4. This ends there because the distance from r4 // to the root is only 3. assert_eq!(sample_vec, vec![4, 9, 12]); Ok(()) } #[test] fn test_children_cache() -> Result<(), GraphError> { let mut disco = full_disco(); disco.ensure_children_cache()?; let cache = disco.children_cache.unwrap(); assert_eq!(cache.get(&2).cloned(), Some(vec![4])); assert_eq!(cache.get(&10).cloned(), None); let mut children_4 = cache.get(&4).cloned().unwrap(); children_4.sort(); assert_eq!(children_4, vec![5, 6, 7]); let mut children_7 = cache.get(&7).cloned().unwrap(); children_7.sort(); assert_eq!(children_7, vec![9, 11]); Ok(()) } #[test] fn test_complete_sample() { let mut disco = full_disco(); let undecided: HashSet = [4, 7, 9, 2, 3].iter().cloned().collect(); disco.undecided = Some(undecided); let mut sample = vec![0]; disco.random_complete_sample(&mut sample, 3); assert_eq!(sample.len(), 3); let mut sample = vec![2, 4, 7]; disco.random_complete_sample(&mut sample, 1); assert_eq!(sample.len(), 3); } #[test] fn test_bidirectional_sample() -> Result<(), GraphError> { let mut disco = full_disco(); disco.undecided = Some((0..=13).into_iter().collect()); let (sample_set, size) = disco.bidirectional_sample(7)?; assert_eq!(size, 7); let mut sample: Vec = sample_set.into_iter().collect(); sample.sort(); // our DAG is a bit too small for the results to be really interesting // at least it shows that // - we went both ways // - we didn't take all Revisions (6 is not in the sample) assert_eq!(sample, vec![0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13]); Ok(()) } } mercurial-5.3.1/rust/hg-core/src/lib.rs0000644015407300116100000000750313627755405017642 0ustar augieeng00000000000000// Copyright 2018-2020 Georges Racinet // and Mercurial contributors // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. mod ancestors; pub mod dagops; pub use ancestors::{AncestorsIterator, LazyAncestors, MissingAncestors}; mod dirstate; pub mod discovery; pub mod testing; // unconditionally built, for use from integration tests pub use dirstate::{ dirs_multiset::{DirsMultiset, DirsMultisetIter}, dirstate_map::DirstateMap, parsers::{pack_dirstate, parse_dirstate, PARENT_SIZE}, status::{status, StatusResult}, CopyMap, CopyMapIter, DirstateEntry, DirstateParents, EntryState, StateMap, StateMapIter, }; mod filepatterns; pub mod matchers; pub mod revlog; pub use revlog::*; pub mod utils; use crate::utils::hg_path::HgPathBuf; pub use filepatterns::{ build_single_regex, read_pattern_file, PatternSyntax, PatternTuple, }; use std::collections::HashMap; use twox_hash::RandomXxHashBuilder64; pub type LineNumber = usize; /// Rust's default hasher is too slow because it tries to prevent collision /// attacks. We are not concerned about those: if an ill-minded person has /// write access to your repository, you have other issues. pub type FastHashMap = HashMap; #[derive(Clone, Debug, PartialEq)] pub enum DirstateParseError { TooLittleData, Overflow, CorruptedEntry(String), Damaged, } impl From for DirstateParseError { fn from(e: std::io::Error) -> Self { DirstateParseError::CorruptedEntry(e.to_string()) } } impl ToString for DirstateParseError { fn to_string(&self) -> String { use crate::DirstateParseError::*; match self { TooLittleData => "Too little data for dirstate.".to_string(), Overflow => "Overflow in dirstate.".to_string(), CorruptedEntry(e) => format!("Corrupted entry: {:?}.", e), Damaged => "Dirstate appears to be damaged.".to_string(), } } } #[derive(Debug, PartialEq)] pub enum DirstatePackError { CorruptedEntry(String), CorruptedParent, BadSize(usize, usize), } impl From for DirstatePackError { fn from(e: std::io::Error) -> Self { DirstatePackError::CorruptedEntry(e.to_string()) } } #[derive(Debug, PartialEq)] pub enum DirstateMapError { PathNotFound(HgPathBuf), EmptyPath, ConsecutiveSlashes, } impl ToString for DirstateMapError { fn to_string(&self) -> String { use crate::DirstateMapError::*; match self { PathNotFound(_) => "expected a value, found none".to_string(), EmptyPath => "Overflow in dirstate.".to_string(), ConsecutiveSlashes => { "found invalid consecutive slashes in path".to_string() } } } } pub enum DirstateError { Parse(DirstateParseError), Pack(DirstatePackError), Map(DirstateMapError), IO(std::io::Error), } impl From for DirstateError { fn from(e: DirstateParseError) -> Self { DirstateError::Parse(e) } } impl From for DirstateError { fn from(e: DirstatePackError) -> Self { DirstateError::Pack(e) } } #[derive(Debug)] pub enum PatternError { UnsupportedSyntax(String), } #[derive(Debug)] pub enum PatternFileError { IO(std::io::Error), Pattern(PatternError, LineNumber), } impl From for PatternFileError { fn from(e: std::io::Error) -> Self { PatternFileError::IO(e) } } impl From for DirstateError { fn from(e: DirstateMapError) -> Self { DirstateError::Map(e) } } impl From for DirstateError { fn from(e: std::io::Error) -> Self { DirstateError::IO(e) } } mercurial-5.3.1/rust/hg-core/src/filepatterns.rs0000644015407300116100000002707513627755405021602 0ustar augieeng00000000000000// filepatterns.rs // // Copyright 2019 Raphaël Gomès // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Handling of Mercurial-specific patterns. use crate::{ utils::SliceExt, FastHashMap, LineNumber, PatternError, PatternFileError, }; use lazy_static::lazy_static; use regex::bytes::{NoExpand, Regex}; use std::fs::File; use std::io::Read; use std::path::{Path, PathBuf}; use std::vec::Vec; lazy_static! { static ref RE_ESCAPE: Vec> = { let mut v: Vec> = (0..=255).map(|byte| vec![byte]).collect(); let to_escape = b"()[]{}?*+-|^$\\.&~# \t\n\r\x0b\x0c"; for byte in to_escape { v[*byte as usize].insert(0, b'\\'); } v }; } /// These are matched in order const GLOB_REPLACEMENTS: &[(&[u8], &[u8])] = &[(b"*/", b"(?:.*/)?"), (b"*", b".*"), (b"", b"[^/]*")]; #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum PatternSyntax { Regexp, /// Glob that matches at the front of the path RootGlob, /// Glob that matches at any suffix of the path (still anchored at /// slashes) Glob, Path, RelPath, RelGlob, RelRegexp, RootFiles, } /// Transforms a glob pattern into a regex fn glob_to_re(pat: &[u8]) -> Vec { let mut input = pat; let mut res: Vec = vec![]; let mut group_depth = 0; while let Some((c, rest)) = input.split_first() { input = rest; match c { b'*' => { for (source, repl) in GLOB_REPLACEMENTS { if let Some(rest) = input.drop_prefix(source) { input = rest; res.extend(*repl); break; } } } b'?' => res.extend(b"."), b'[' => { match input.iter().skip(1).position(|b| *b == b']') { None => res.extend(b"\\["), Some(end) => { // Account for the one we skipped let end = end + 1; res.extend(b"["); for (i, b) in input[..end].iter().enumerate() { if *b == b'!' && i == 0 { res.extend(b"^") } else if *b == b'^' && i == 0 { res.extend(b"\\^") } else if *b == b'\\' { res.extend(b"\\\\") } else { res.push(*b) } } res.extend(b"]"); input = &input[end + 1..]; } } } b'{' => { group_depth += 1; res.extend(b"(?:") } b'}' if group_depth > 0 => { group_depth -= 1; res.extend(b")"); } b',' if group_depth > 0 => res.extend(b"|"), b'\\' => { let c = { if let Some((c, rest)) = input.split_first() { input = rest; c } else { c } }; res.extend(&RE_ESCAPE[*c as usize]) } _ => res.extend(&RE_ESCAPE[*c as usize]), } } res } fn escape_pattern(pattern: &[u8]) -> Vec { pattern .iter() .flat_map(|c| RE_ESCAPE[*c as usize].clone()) .collect() } fn parse_pattern_syntax(kind: &[u8]) -> Result { match kind { b"re" => Ok(PatternSyntax::Regexp), b"path" => Ok(PatternSyntax::Path), b"relpath" => Ok(PatternSyntax::RelPath), b"rootfilesin" => Ok(PatternSyntax::RootFiles), b"relglob" => Ok(PatternSyntax::RelGlob), b"relre" => Ok(PatternSyntax::RelRegexp), b"glob" => Ok(PatternSyntax::Glob), b"rootglob" => Ok(PatternSyntax::RootGlob), _ => Err(PatternError::UnsupportedSyntax( String::from_utf8_lossy(kind).to_string(), )), } } /// Builds the regex that corresponds to the given pattern. /// If within a `syntax: regexp` context, returns the pattern, /// otherwise, returns the corresponding regex. fn _build_single_regex( syntax: PatternSyntax, pattern: &[u8], globsuffix: &[u8], ) -> Vec { if pattern.is_empty() { return vec![]; } match syntax { PatternSyntax::Regexp => pattern.to_owned(), PatternSyntax::RelRegexp => { if pattern[0] == b'^' { return pattern.to_owned(); } [b".*", pattern].concat() } PatternSyntax::Path | PatternSyntax::RelPath => { if pattern == b"." { return vec![]; } [escape_pattern(pattern).as_slice(), b"(?:/|$)"].concat() } PatternSyntax::RootFiles => { let mut res = if pattern == b"." { vec![] } else { // Pattern is a directory name. [escape_pattern(pattern).as_slice(), b"/"].concat() }; // Anything after the pattern must be a non-directory. res.extend(b"[^/]+$"); res } PatternSyntax::RelGlob => { let glob_re = glob_to_re(pattern); if let Some(rest) = glob_re.drop_prefix(b"[^/]*") { [b".*", rest, globsuffix].concat() } else { [b"(?:|.*/)", glob_re.as_slice(), globsuffix].concat() } } PatternSyntax::Glob | PatternSyntax::RootGlob => { [glob_to_re(pattern).as_slice(), globsuffix].concat() } } } const GLOB_SPECIAL_CHARACTERS: [u8; 7] = [b'*', b'?', b'[', b']', b'{', b'}', b'\\']; /// Wrapper function to `_build_single_regex` that short-circuits 'exact' globs /// that don't need to be transformed into a regex. pub fn build_single_regex( kind: &[u8], pat: &[u8], globsuffix: &[u8], ) -> Result, PatternError> { let enum_kind = parse_pattern_syntax(kind)?; if enum_kind == PatternSyntax::RootGlob && !pat.iter().any(|b| GLOB_SPECIAL_CHARACTERS.contains(b)) { let mut escaped = escape_pattern(pat); escaped.extend(b"(?:/|$)"); Ok(escaped) } else { Ok(_build_single_regex(enum_kind, pat, globsuffix)) } } lazy_static! { static ref SYNTAXES: FastHashMap<&'static [u8], &'static [u8]> = { let mut m = FastHashMap::default(); m.insert(b"re".as_ref(), b"relre:".as_ref()); m.insert(b"regexp".as_ref(), b"relre:".as_ref()); m.insert(b"glob".as_ref(), b"relglob:".as_ref()); m.insert(b"rootglob".as_ref(), b"rootglob:".as_ref()); m.insert(b"include".as_ref(), b"include".as_ref()); m.insert(b"subinclude".as_ref(), b"subinclude".as_ref()); m }; } pub type PatternTuple = (Vec, LineNumber, Vec); type WarningTuple = (PathBuf, Vec); pub fn parse_pattern_file_contents>( lines: &[u8], file_path: P, warn: bool, ) -> (Vec, Vec) { let comment_regex = Regex::new(r"((?:^|[^\\])(?:\\\\)*)#.*").unwrap(); let comment_escape_regex = Regex::new(r"\\#").unwrap(); let mut inputs: Vec = vec![]; let mut warnings: Vec = vec![]; let mut current_syntax = b"relre:".as_ref(); for (line_number, mut line) in lines.split(|c| *c == b'\n').enumerate() { let line_number = line_number + 1; let line_buf; if line.contains(&b'#') { if let Some(cap) = comment_regex.captures(line) { line = &line[..cap.get(1).unwrap().end()] } line_buf = comment_escape_regex.replace_all(line, NoExpand(b"#")); line = &line_buf; } let mut line = line.trim_end(); if line.is_empty() { continue; } if let Some(syntax) = line.drop_prefix(b"syntax:") { let syntax = syntax.trim(); if let Some(rel_syntax) = SYNTAXES.get(syntax) { current_syntax = rel_syntax; } else if warn { warnings .push((file_path.as_ref().to_owned(), syntax.to_owned())); } continue; } let mut line_syntax: &[u8] = ¤t_syntax; for (s, rels) in SYNTAXES.iter() { if let Some(rest) = line.drop_prefix(rels) { line_syntax = rels; line = rest; break; } if let Some(rest) = line.drop_prefix(&[s, &b":"[..]].concat()) { line_syntax = rels; line = rest; break; } } inputs.push(( [line_syntax, line].concat(), line_number, line.to_owned(), )); } (inputs, warnings) } pub fn read_pattern_file>( file_path: P, warn: bool, ) -> Result<(Vec, Vec), PatternFileError> { let mut f = File::open(file_path.as_ref())?; let mut contents = Vec::new(); f.read_to_end(&mut contents)?; Ok(parse_pattern_file_contents(&contents, file_path, warn)) } #[cfg(test)] mod tests { use super::*; #[test] fn escape_pattern_test() { let untouched = br#"!"%',/0123456789:;<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ_`abcdefghijklmnopqrstuvwxyz"#; assert_eq!(escape_pattern(untouched), untouched.to_vec()); // All escape codes assert_eq!( escape_pattern(br#"()[]{}?*+-|^$\\.&~# \t\n\r\v\f"#), br#"\(\)\[\]\{\}\?\*\+\-\|\^\$\\\\\.\&\~\#\ \\t\\n\\r\\v\\f"# .to_vec() ); } #[test] fn glob_test() { assert_eq!(glob_to_re(br#"?"#), br#"."#); assert_eq!(glob_to_re(br#"*"#), br#"[^/]*"#); assert_eq!(glob_to_re(br#"**"#), br#".*"#); assert_eq!(glob_to_re(br#"**/a"#), br#"(?:.*/)?a"#); assert_eq!(glob_to_re(br#"a/**/b"#), br#"a/(?:.*/)?b"#); assert_eq!(glob_to_re(br#"[a*?!^][^b][!c]"#), br#"[a*?!^][\^b][^c]"#); assert_eq!(glob_to_re(br#"{a,b}"#), br#"(?:a|b)"#); assert_eq!(glob_to_re(br#".\*\?"#), br#"\.\*\?"#); } #[test] fn test_parse_pattern_file_contents() { let lines = b"syntax: glob\n*.elc"; assert_eq!( vec![(b"relglob:*.elc".to_vec(), 2, b"*.elc".to_vec())], parse_pattern_file_contents(lines, Path::new("file_path"), false) .0, ); let lines = b"syntax: include\nsyntax: glob"; assert_eq!( parse_pattern_file_contents(lines, Path::new("file_path"), false) .0, vec![] ); let lines = b"glob:**.o"; assert_eq!( parse_pattern_file_contents(lines, Path::new("file_path"), false) .0, vec![(b"relglob:**.o".to_vec(), 1, b"**.o".to_vec())] ); } #[test] fn test_build_single_regex_shortcut() { assert_eq!( br"(?:/|$)".to_vec(), build_single_regex(b"rootglob", b"", b"").unwrap() ); assert_eq!( br"whatever(?:/|$)".to_vec(), build_single_regex(b"rootglob", b"whatever", b"").unwrap() ); assert_eq!( br"[^/]*\.o".to_vec(), build_single_regex(b"rootglob", b"*.o", b"").unwrap() ); } } mercurial-5.3.1/rust/hg-core/src/utils/0000755015407300116100000000000013627755444017664 5ustar augieeng00000000000000mercurial-5.3.1/rust/hg-core/src/utils/hg_path.rs0000644015407300116100000003513413627755404021646 0ustar augieeng00000000000000// hg_path.rs // // Copyright 2019 Raphaël Gomès // // 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::borrow::Borrow; use std::ffi::{OsStr, OsString}; use std::fmt; use std::ops::Deref; use std::path::{Path, PathBuf}; #[derive(Debug, Eq, PartialEq)] pub enum HgPathError { /// Bytes from the invalid `HgPath` LeadingSlash(Vec), /// Bytes and index of the second slash ConsecutiveSlashes(Vec, usize), /// Bytes and index of the null byte ContainsNullByte(Vec, usize), /// Bytes DecodeError(Vec), } impl ToString for HgPathError { fn to_string(&self) -> String { match self { HgPathError::LeadingSlash(bytes) => { format!("Invalid HgPath '{:?}': has a leading slash.", bytes) } HgPathError::ConsecutiveSlashes(bytes, pos) => format!( "Invalid HgPath '{:?}': consecutive slahes at pos {}.", bytes, pos ), HgPathError::ContainsNullByte(bytes, pos) => format!( "Invalid HgPath '{:?}': contains null byte at pos {}.", bytes, pos ), HgPathError::DecodeError(bytes) => { format!("Invalid HgPath '{:?}': could not be decoded.", bytes) } } } } impl From for std::io::Error { fn from(e: HgPathError) -> Self { std::io::Error::new(std::io::ErrorKind::InvalidData, e.to_string()) } } /// This is a repository-relative path (or canonical path): /// - no null characters /// - `/` separates directories /// - no consecutive slashes /// - no leading slash, /// - no `.` nor `..` of special meaning /// - stored in repository and shared across platforms /// /// Note: there is no guarantee of any `HgPath` being well-formed at any point /// in its lifetime for performance reasons and to ease ergonomics. It is /// however checked using the `check_state` method before any file-system /// operation. /// /// This allows us to be encoding-transparent as much as possible, until really /// needed; `HgPath` can be transformed into a platform-specific path (`OsStr` /// or `Path`) whenever more complex operations are needed: /// On Unix, it's just byte-to-byte conversion. On Windows, it has to be /// decoded from MBCS to WTF-8. If WindowsUTF8Plan is implemented, the source /// character encoding will be determined on a per-repository basis. // // FIXME: (adapted from a comment in the stdlib) // `HgPath::new()` current implementation relies on `Slice` being // layout-compatible with `[u8]`. // When attribute privacy is implemented, `Slice` should be annotated as // `#[repr(transparent)]`. // Anyway, `Slice` representation and layout are considered implementation // detail, are not documented and must not be relied upon. #[derive(Eq, Ord, PartialEq, PartialOrd, Hash)] pub struct HgPath { inner: [u8], } impl HgPath { pub fn new + ?Sized>(s: &S) -> &Self { unsafe { &*(s.as_ref() as *const [u8] as *const Self) } } pub fn is_empty(&self) -> bool { self.inner.is_empty() } pub fn len(&self) -> usize { self.inner.len() } fn to_hg_path_buf(&self) -> HgPathBuf { HgPathBuf { inner: self.inner.to_owned(), } } pub fn bytes(&self) -> std::slice::Iter { self.inner.iter() } pub fn to_ascii_uppercase(&self) -> HgPathBuf { HgPathBuf::from(self.inner.to_ascii_uppercase()) } pub fn to_ascii_lowercase(&self) -> HgPathBuf { HgPathBuf::from(self.inner.to_ascii_lowercase()) } pub fn as_bytes(&self) -> &[u8] { &self.inner } pub fn contains(&self, other: u8) -> bool { self.inner.contains(&other) } pub fn starts_with(&self, needle: impl AsRef) -> bool { self.inner.starts_with(needle.as_ref().as_bytes()) } pub fn join>(&self, other: &T) -> HgPathBuf { let mut inner = self.inner.to_owned(); if inner.len() != 0 && inner.last() != Some(&b'/') { inner.push(b'/'); } inner.extend(other.as_ref().bytes()); HgPathBuf::from_bytes(&inner) } /// Given a base directory, returns the slice of `self` relative to the /// base directory. If `base` is not a directory (does not end with a /// `b'/'`), returns `None`. pub fn relative_to(&self, base: impl AsRef) -> Option<&HgPath> { let base = base.as_ref(); if base.is_empty() { return Some(self); } let is_dir = base.as_bytes().ends_with(b"/"); if is_dir && self.starts_with(base) { Some(HgPath::new(&self.inner[base.len()..])) } else { None } } /// Checks for errors in the path, short-circuiting at the first one. /// This generates fine-grained errors useful for debugging. /// To simply check if the path is valid during tests, use `is_valid`. pub fn check_state(&self) -> Result<(), HgPathError> { if self.len() == 0 { return Ok(()); } let bytes = self.as_bytes(); let mut previous_byte = None; if bytes[0] == b'/' { return Err(HgPathError::LeadingSlash(bytes.to_vec())); } for (index, byte) in bytes.iter().enumerate() { match byte { 0 => { return Err(HgPathError::ContainsNullByte( bytes.to_vec(), index, )) } b'/' => { if previous_byte.is_some() && previous_byte == Some(b'/') { return Err(HgPathError::ConsecutiveSlashes( bytes.to_vec(), index, )); } } _ => (), }; previous_byte = Some(*byte); } Ok(()) } #[cfg(test)] /// Only usable during tests to force developers to handle invalid states fn is_valid(&self) -> bool { self.check_state().is_ok() } } impl fmt::Debug for HgPath { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "HgPath({:?})", String::from_utf8_lossy(&self.inner)) } } impl fmt::Display for HgPath { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", String::from_utf8_lossy(&self.inner)) } } #[derive(Eq, Ord, Clone, PartialEq, PartialOrd, Hash)] pub struct HgPathBuf { inner: Vec, } impl HgPathBuf { pub fn new() -> Self { Self { inner: Vec::new() } } pub fn push(&mut self, byte: u8) { self.inner.push(byte); } pub fn from_bytes(s: &[u8]) -> HgPathBuf { HgPath::new(s).to_owned() } pub fn into_vec(self) -> Vec { self.inner } pub fn as_ref(&self) -> &[u8] { self.inner.as_ref() } } impl fmt::Debug for HgPathBuf { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "HgPathBuf({:?})", String::from_utf8_lossy(&self.inner)) } } impl fmt::Display for HgPathBuf { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", String::from_utf8_lossy(&self.inner)) } } impl Deref for HgPathBuf { type Target = HgPath; #[inline] fn deref(&self) -> &HgPath { &HgPath::new(&self.inner) } } impl From> for HgPathBuf { fn from(vec: Vec) -> Self { Self { inner: vec } } } impl> From<&T> for HgPathBuf { fn from(s: &T) -> HgPathBuf { s.as_ref().to_owned() } } impl Into> for HgPathBuf { fn into(self) -> Vec { self.inner } } impl Borrow for HgPathBuf { fn borrow(&self) -> &HgPath { &HgPath::new(self.as_bytes()) } } impl ToOwned for HgPath { type Owned = HgPathBuf; fn to_owned(&self) -> HgPathBuf { self.to_hg_path_buf() } } impl AsRef for HgPath { fn as_ref(&self) -> &HgPath { self } } impl AsRef for HgPathBuf { fn as_ref(&self) -> &HgPath { self } } impl Extend for HgPathBuf { fn extend>(&mut self, iter: T) { self.inner.extend(iter); } } /// TODO: Once https://www.mercurial-scm.org/wiki/WindowsUTF8Plan is /// implemented, these conversion utils will have to work differently depending /// on the repository encoding: either `UTF-8` or `MBCS`. pub fn hg_path_to_os_string>( hg_path: P, ) -> Result { hg_path.as_ref().check_state()?; let os_str; #[cfg(unix)] { use std::os::unix::ffi::OsStrExt; os_str = std::ffi::OsStr::from_bytes(&hg_path.as_ref().as_bytes()); } // TODO Handle other platforms // TODO: convert from WTF8 to Windows MBCS (ANSI encoding). Ok(os_str.to_os_string()) } pub fn hg_path_to_path_buf>( hg_path: P, ) -> Result { Ok(Path::new(&hg_path_to_os_string(hg_path)?).to_path_buf()) } pub fn os_string_to_hg_path_buf>( os_string: S, ) -> Result { let buf; #[cfg(unix)] { use std::os::unix::ffi::OsStrExt; buf = HgPathBuf::from_bytes(&os_string.as_ref().as_bytes()); } // TODO Handle other platforms // TODO: convert from WTF8 to Windows MBCS (ANSI encoding). buf.check_state()?; Ok(buf) } pub fn path_to_hg_path_buf>( path: P, ) -> Result { let buf; let os_str = path.as_ref().as_os_str(); #[cfg(unix)] { use std::os::unix::ffi::OsStrExt; buf = HgPathBuf::from_bytes(&os_str.as_bytes()); } // TODO Handle other platforms // TODO: convert from WTF8 to Windows MBCS (ANSI encoding). buf.check_state()?; Ok(buf) } #[cfg(test)] mod tests { use super::*; #[test] fn test_path_states() { assert_eq!( Err(HgPathError::LeadingSlash(b"/".to_vec())), HgPath::new(b"/").check_state() ); assert_eq!( Err(HgPathError::ConsecutiveSlashes(b"a/b//c".to_vec(), 4)), HgPath::new(b"a/b//c").check_state() ); assert_eq!( Err(HgPathError::ContainsNullByte(b"a/b/\0c".to_vec(), 4)), HgPath::new(b"a/b/\0c").check_state() ); // TODO test HgPathError::DecodeError for the Windows implementation. assert_eq!(true, HgPath::new(b"").is_valid()); assert_eq!(true, HgPath::new(b"a/b/c").is_valid()); // Backslashes in paths are not significant, but allowed assert_eq!(true, HgPath::new(br"a\b/c").is_valid()); // Dots in paths are not significant, but allowed assert_eq!(true, HgPath::new(b"a/b/../c/").is_valid()); assert_eq!(true, HgPath::new(b"./a/b/../c/").is_valid()); } #[test] fn test_iter() { let path = HgPath::new(b"a"); let mut iter = path.bytes(); assert_eq!(Some(&b'a'), iter.next()); assert_eq!(None, iter.next_back()); assert_eq!(None, iter.next()); let path = HgPath::new(b"a"); let mut iter = path.bytes(); assert_eq!(Some(&b'a'), iter.next_back()); assert_eq!(None, iter.next_back()); assert_eq!(None, iter.next()); let path = HgPath::new(b"abc"); let mut iter = path.bytes(); assert_eq!(Some(&b'a'), iter.next()); assert_eq!(Some(&b'c'), iter.next_back()); assert_eq!(Some(&b'b'), iter.next_back()); assert_eq!(None, iter.next_back()); assert_eq!(None, iter.next()); let path = HgPath::new(b"abc"); let mut iter = path.bytes(); assert_eq!(Some(&b'a'), iter.next()); assert_eq!(Some(&b'b'), iter.next()); assert_eq!(Some(&b'c'), iter.next()); assert_eq!(None, iter.next_back()); assert_eq!(None, iter.next()); let path = HgPath::new(b"abc"); let iter = path.bytes(); let mut vec = Vec::new(); vec.extend(iter); assert_eq!(vec![b'a', b'b', b'c'], vec); let path = HgPath::new(b"abc"); let mut iter = path.bytes(); assert_eq!(Some(2), iter.rposition(|c| *c == b'c')); let path = HgPath::new(b"abc"); let mut iter = path.bytes(); assert_eq!(None, iter.rposition(|c| *c == b'd')); } #[test] fn test_join() { let path = HgPathBuf::from_bytes(b"a").join(HgPath::new(b"b")); assert_eq!(b"a/b", path.as_bytes()); let path = HgPathBuf::from_bytes(b"a/").join(HgPath::new(b"b/c")); assert_eq!(b"a/b/c", path.as_bytes()); // No leading slash if empty before join let path = HgPathBuf::new().join(HgPath::new(b"b/c")); assert_eq!(b"b/c", path.as_bytes()); // The leading slash is an invalid representation of an `HgPath`, but // it can happen. This creates another invalid representation of // consecutive bytes. // TODO What should be done in this case? Should we silently remove // the extra slash? Should we change the signature to a problematic // `Result`, or should we just keep it so and // let the error happen upon filesystem interaction? let path = HgPathBuf::from_bytes(b"a/").join(HgPath::new(b"/b")); assert_eq!(b"a//b", path.as_bytes()); let path = HgPathBuf::from_bytes(b"a").join(HgPath::new(b"/b")); assert_eq!(b"a//b", path.as_bytes()); } #[test] fn test_relative_to() { let path = HgPath::new(b""); let base = HgPath::new(b""); assert_eq!(Some(path), path.relative_to(base)); let path = HgPath::new(b"path"); let base = HgPath::new(b""); assert_eq!(Some(path), path.relative_to(base)); let path = HgPath::new(b"a"); let base = HgPath::new(b"b"); assert_eq!(None, path.relative_to(base)); let path = HgPath::new(b"a/b"); let base = HgPath::new(b"a"); assert_eq!(None, path.relative_to(base)); let path = HgPath::new(b"a/b"); let base = HgPath::new(b"a/"); assert_eq!(Some(HgPath::new(b"b")), path.relative_to(base)); let path = HgPath::new(b"nested/path/to/b"); let base = HgPath::new(b"nested/path/"); assert_eq!(Some(HgPath::new(b"to/b")), path.relative_to(base)); let path = HgPath::new(b"ends/with/dir/"); let base = HgPath::new(b"ends/"); assert_eq!(Some(HgPath::new(b"with/dir/")), path.relative_to(base)); } } mercurial-5.3.1/rust/hg-core/src/utils/files.rs0000644015407300116100000000723713627755404021341 0ustar augieeng00000000000000// files.rs // // Copyright 2019 // Raphaël Gomès , // Yuya Nishihara // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Functions for fiddling with files. use crate::utils::hg_path::{HgPath, HgPathBuf}; use std::iter::FusedIterator; use std::fs::Metadata; use std::path::Path; pub fn get_path_from_bytes(bytes: &[u8]) -> &Path { let os_str; #[cfg(unix)] { use std::os::unix::ffi::OsStrExt; os_str = std::ffi::OsStr::from_bytes(bytes); } // TODO Handle other platforms // TODO: convert from WTF8 to Windows MBCS (ANSI encoding). // Perhaps, the return type would have to be Result. Path::new(os_str) } // TODO: need to convert from WTF8 to MBCS bytes on Windows. // that's why Vec is returned. #[cfg(unix)] pub fn get_bytes_from_path(path: impl AsRef) -> Vec { use std::os::unix::ffi::OsStrExt; path.as_ref().as_os_str().as_bytes().to_vec() } /// An iterator over repository path yielding itself and its ancestors. #[derive(Copy, Clone, Debug)] pub struct Ancestors<'a> { next: Option<&'a HgPath>, } impl<'a> Iterator for Ancestors<'a> { type Item = &'a HgPath; fn next(&mut self) -> Option { let next = self.next; self.next = match self.next { Some(s) if s.is_empty() => None, Some(s) => { let p = s.bytes().rposition(|c| *c == b'/').unwrap_or(0); Some(HgPath::new(&s.as_bytes()[..p])) } None => None, }; next } } impl<'a> FusedIterator for Ancestors<'a> {} /// Returns an iterator yielding ancestor directories of the given repository /// path. /// /// The path is separated by '/', and must not start with '/'. /// /// The path itself isn't included unless it is b"" (meaning the root /// directory.) pub fn find_dirs<'a>(path: &'a HgPath) -> Ancestors<'a> { let mut dirs = Ancestors { next: Some(path) }; if !path.is_empty() { dirs.next(); // skip itself } dirs } /// TODO more than ASCII? pub fn normalize_case(path: &HgPath) -> HgPathBuf { #[cfg(windows)] // NTFS compares via upper() return path.to_ascii_uppercase(); #[cfg(unix)] path.to_ascii_lowercase() } #[derive(Eq, PartialEq, Ord, PartialOrd, Copy, Clone)] pub struct HgMetadata { pub st_dev: u64, pub st_mode: u32, pub st_nlink: u64, pub st_size: u64, pub st_mtime: i64, pub st_ctime: i64, } // TODO support other plaforms #[cfg(unix)] impl HgMetadata { pub fn from_metadata(metadata: Metadata) -> Self { use std::os::unix::fs::MetadataExt; Self { st_dev: metadata.dev(), st_mode: metadata.mode(), st_nlink: metadata.nlink(), st_size: metadata.size(), st_mtime: metadata.mtime(), st_ctime: metadata.ctime(), } } } #[cfg(test)] mod tests { use super::*; #[test] fn find_dirs_some() { let mut dirs = super::find_dirs(HgPath::new(b"foo/bar/baz")); assert_eq!(dirs.next(), Some(HgPath::new(b"foo/bar"))); assert_eq!(dirs.next(), Some(HgPath::new(b"foo"))); assert_eq!(dirs.next(), Some(HgPath::new(b""))); assert_eq!(dirs.next(), None); assert_eq!(dirs.next(), None); } #[test] fn find_dirs_empty() { // looks weird, but mercurial.pathutil.finddirs(b"") yields b"" let mut dirs = super::find_dirs(HgPath::new(b"")); assert_eq!(dirs.next(), Some(HgPath::new(b""))); assert_eq!(dirs.next(), None); assert_eq!(dirs.next(), None); } } mercurial-5.3.1/rust/hg-core/src/utils/path.rs0000644015407300116100000002320713627755405021167 0ustar augieeng00000000000000/* * Copyright (c) Facebook, Inc. and its affiliates. * * This software may be used and distributed according to the terms of the * GNU General Public License version 2. */ //! Path-related utilities. use std::env; #[cfg(not(unix))] use std::fs::rename; use std::fs::{self, remove_file as fs_remove_file}; use std::io::{self, ErrorKind}; use std::path::{Component, Path, PathBuf}; use anyhow::Result; #[cfg(not(unix))] use tempfile::Builder; /// Normalize a canonicalized Path for display. /// /// This removes the UNC prefix `\\?\` on Windows. pub fn normalize_for_display(path: &str) -> &str { if cfg!(windows) && path.starts_with(r"\\?\") { &path[4..] } else { path } } /// Similar to [`normalize_for_display`]. But work on bytes. pub fn normalize_for_display_bytes(path: &[u8]) -> &[u8] { if cfg!(windows) && path.starts_with(br"\\?\") { &path[4..] } else { path } } /// Return the absolute and normalized path without accessing the filesystem. /// /// Unlike [`fs::canonicalize`], do not follow symlinks. /// /// This function does not access the filesystem. Therefore it can behave /// differently from the kernel or other library functions in corner cases. /// For example: /// /// - On some systems with symlink support, `foo/bar/..` and `foo` can be /// different as seen by the kernel, if `foo/bar` is a symlink. This function /// always returns `foo` in this case. /// - On Windows, the official normalization rules are much more complicated. /// See https://github.com/rust-lang/rust/pull/47363#issuecomment-357069527. /// For example, this function cannot translate "drive relative" path like /// "X:foo" to an absolute path. /// /// Return an error if `std::env::current_dir()` fails or if this function /// fails to produce an absolute path. pub fn absolute(path: impl AsRef) -> io::Result { let path = path.as_ref(); let path = if path.is_absolute() { path.to_path_buf() } else { std::env::current_dir()?.join(path) }; if !path.is_absolute() { return Err(io::Error::new( io::ErrorKind::Other, format!("cannot get absoltue path from {:?}", path), )); } let mut result = PathBuf::new(); for component in path.components() { match component { Component::Normal(_) | Component::RootDir | Component::Prefix(_) => { result.push(component); } Component::ParentDir => { result.pop(); } Component::CurDir => (), } } Ok(result) } /// Remove the file pointed by `path`. #[cfg(unix)] pub fn remove_file>(path: P) -> Result<()> { fs_remove_file(path)?; Ok(()) } /// Remove the file pointed by `path`. /// /// On Windows, removing a file can fail for various reasons, including if the /// file is memory mapped. This can happen when the repository is accessed /// concurrently while a background task is trying to remove a packfile. To /// solve this, we can rename the file before trying to remove it. /// If the remove operation fails, a future repack will clean it up. #[cfg(not(unix))] pub fn remove_file>(path: P) -> Result<()> { let path = path.as_ref(); let extension = path .extension() .and_then(|ext| ext.to_str()) .map_or(".to-delete".to_owned(), |ext| ".".to_owned() + ext + "-tmp"); let dest_path = Builder::new() .prefix("") .suffix(&extension) .rand_bytes(8) .tempfile_in(path.parent().unwrap())? .into_temp_path(); rename(path, &dest_path)?; // Ignore errors when removing the file, it will be cleaned up at a later // time. let _ = fs_remove_file(dest_path); Ok(()) } /// Create the directory and ignore failures when a directory of the same name /// already exists. pub fn create_dir(path: impl AsRef) -> io::Result<()> { match fs::create_dir(path.as_ref()) { Ok(()) => Ok(()), Err(e) => { if e.kind() == ErrorKind::AlreadyExists && path.as_ref().is_dir() { Ok(()) } else { Err(e) } } } } /// Expand the user's home directory and any environment variables references /// in the given path. /// /// This function is designed to emulate the behavior of Mercurial's /// `util.expandpath` function, which in turn uses Python's /// `os.path.expand{user,vars}` functions. This results in behavior that is /// notably different from the default expansion behavior of the `shellexpand` /// crate. In particular: /// /// - If a reference to an environment variable is missing or invalid, the /// reference is left unchanged in the resulting path rather than emitting an /// error. /// /// - Home directory expansion explicitly happens after environment variable /// expansion, meaning that if an environment variable is expanded into a /// string starting with a tilde (`~`), the tilde will be expanded into the /// user's home directory. pub fn expand_path(path: impl AsRef) -> PathBuf { expand_path_impl(path.as_ref(), |k| env::var(k).ok(), dirs::home_dir) } /// Same as `expand_path` but explicitly takes closures for environment /// variable and home directory lookup for the sake of testability. fn expand_path_impl(path: &str, getenv: E, homedir: H) -> PathBuf where E: FnMut(&str) -> Option, H: FnOnce() -> Option, { // The shellexpand crate does not expand Windows environment variables // like `%PROGRAMDATA%`. We'd like to expand them too. So let's do some // pre-processing. // // XXX: Doing this preprocessing has the unfortunate side-effect that // if an environment variable fails to expand on Windows, the resulting // string will contain a UNIX-style environment variable reference. // // e.g., "/foo/%MISSING%/bar" will expand to "/foo/${MISSING}/bar" // // The current approach is good enough for now, but likely needs to // be improved later for correctness. let path = { let mut new_path = String::new(); let mut is_starting = true; for ch in path.chars() { if ch == '%' { if is_starting { new_path.push_str("${"); } else { new_path.push('}'); } is_starting = !is_starting; } else if cfg!(windows) && ch == '/' { // Only on Windows, change "/" to "\" automatically. // This makes sure "%include /foo" works as expected. new_path.push('\\') } else { new_path.push(ch); } } new_path }; let path = shellexpand::env_with_context_no_errors(&path, getenv); shellexpand::tilde_with_context(&path, homedir) .as_ref() .into() } #[cfg(test)] mod tests { use super::*; use std::fs::File; use tempfile::TempDir; #[cfg(windows)] mod windows { use super::*; #[test] fn test_absolute_fullpath() { assert_eq!(absolute("C:/foo").unwrap(), Path::new("C:\\foo")); assert_eq!( absolute("x:\\a/b\\./.\\c").unwrap(), Path::new("x:\\a\\b\\c") ); assert_eq!( absolute("y:/a/b\\../..\\c\\../d\\./.").unwrap(), Path::new("y:\\d") ); assert_eq!( absolute("z:/a/b\\../..\\../..\\..").unwrap(), Path::new("z:\\") ); } } #[cfg(unix)] mod unix { use super::*; #[test] fn test_absolute_fullpath() { assert_eq!( absolute("/a/./b\\c/../d/.").unwrap(), Path::new("/a/d") ); assert_eq!(absolute("/a/../../../../b").unwrap(), Path::new("/b")); assert_eq!(absolute("/../../..").unwrap(), Path::new("/")); assert_eq!(absolute("/../../../").unwrap(), Path::new("/")); assert_eq!( absolute("//foo///bar//baz").unwrap(), Path::new("/foo/bar/baz") ); assert_eq!(absolute("//").unwrap(), Path::new("/")); } } #[test] fn test_create_dir_non_exist() -> Result<()> { let tempdir = TempDir::new()?; let mut path = tempdir.path().to_path_buf(); path.push("dir"); create_dir(&path)?; assert!(path.is_dir()); Ok(()) } #[test] fn test_create_dir_exist() -> Result<()> { let tempdir = TempDir::new()?; let mut path = tempdir.path().to_path_buf(); path.push("dir"); create_dir(&path)?; assert!(&path.is_dir()); create_dir(&path)?; assert!(&path.is_dir()); Ok(()) } #[test] fn test_create_dir_file_exist() -> Result<()> { let tempdir = TempDir::new()?; let mut path = tempdir.path().to_path_buf(); path.push("dir"); File::create(&path)?; let err = create_dir(&path).unwrap_err(); assert_eq!(err.kind(), ErrorKind::AlreadyExists); Ok(()) } #[test] fn test_path_expansion() { fn getenv(key: &str) -> Option { match key { "foo" => Some("~/a".into()), "bar" => Some("b".into()), _ => None, } } fn homedir() -> Option { Some(PathBuf::from("/home/user")) } let path = "$foo/${bar}/$baz"; let expected = PathBuf::from("/home/user/a/b/$baz"); assert_eq!(expand_path_impl(&path, getenv, homedir), expected); } } mercurial-5.3.1/rust/hg-core/src/dirstate/0000755015407300116100000000000013627755444020343 5ustar augieeng00000000000000mercurial-5.3.1/rust/hg-core/src/dirstate/parsers.rs0000644015407300116100000003323013627755405022366 0ustar augieeng00000000000000// Copyright 2019 Raphaël Gomès // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. use crate::utils::hg_path::HgPath; use crate::{ dirstate::{CopyMap, EntryState, StateMap}, DirstateEntry, DirstatePackError, DirstateParents, DirstateParseError, }; use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; use std::convert::{TryFrom, TryInto}; use std::io::Cursor; use std::time::Duration; /// Parents are stored in the dirstate as byte hashes. pub const PARENT_SIZE: usize = 20; /// Dirstate entries have a static part of 8 + 32 + 32 + 32 + 32 bits. const MIN_ENTRY_SIZE: usize = 17; // TODO parse/pack: is mutate-on-loop better for performance? pub fn parse_dirstate( state_map: &mut StateMap, copy_map: &mut CopyMap, contents: &[u8], ) -> Result { if contents.len() < PARENT_SIZE * 2 { return Err(DirstateParseError::TooLittleData); } let mut curr_pos = PARENT_SIZE * 2; let parents = DirstateParents { p1: contents[..PARENT_SIZE].try_into().unwrap(), p2: contents[PARENT_SIZE..curr_pos].try_into().unwrap(), }; while curr_pos < contents.len() { if curr_pos + MIN_ENTRY_SIZE > contents.len() { return Err(DirstateParseError::Overflow); } let entry_bytes = &contents[curr_pos..]; let mut cursor = Cursor::new(entry_bytes); let state = EntryState::try_from(cursor.read_u8()?)?; let mode = cursor.read_i32::()?; let size = cursor.read_i32::()?; let mtime = cursor.read_i32::()?; let path_len = cursor.read_i32::()? as usize; if path_len > contents.len() - curr_pos { return Err(DirstateParseError::Overflow); } // Slice instead of allocating a Vec needed for `read_exact` let path = &entry_bytes[MIN_ENTRY_SIZE..MIN_ENTRY_SIZE + (path_len)]; let (path, copy) = match memchr::memchr(0, path) { None => (path, None), Some(i) => (&path[..i], Some(&path[(i + 1)..])), }; if let Some(copy_path) = copy { copy_map.insert( HgPath::new(path).to_owned(), HgPath::new(copy_path).to_owned(), ); }; state_map.insert( HgPath::new(path).to_owned(), DirstateEntry { state, mode, size, mtime, }, ); curr_pos = curr_pos + MIN_ENTRY_SIZE + (path_len); } Ok(parents) } /// `now` is the duration in seconds since the Unix epoch pub fn pack_dirstate( state_map: &mut StateMap, copy_map: &CopyMap, parents: DirstateParents, now: Duration, ) -> Result, DirstatePackError> { // TODO move away from i32 before 2038. let now: i32 = now.as_secs().try_into().expect("time overflow"); let expected_size: usize = state_map .iter() .map(|(filename, _)| { let mut length = MIN_ENTRY_SIZE + filename.len(); if let Some(copy) = copy_map.get(filename) { length += copy.len() + 1; } length }) .sum(); let expected_size = expected_size + PARENT_SIZE * 2; let mut packed = Vec::with_capacity(expected_size); let mut new_state_map = vec![]; packed.extend(&parents.p1); packed.extend(&parents.p2); for (filename, entry) in state_map.iter() { let new_filename = filename.to_owned(); let mut new_mtime: i32 = entry.mtime; if entry.state == EntryState::Normal && entry.mtime == now { // The file was last modified "simultaneously" with the current // write to dirstate (i.e. within the same second for file- // systems with a granularity of 1 sec). This commonly happens // for at least a couple of files on 'update'. // The user could change the file without changing its size // within the same second. Invalidate the file's mtime in // dirstate, forcing future 'status' calls to compare the // contents of the file if the size is the same. This prevents // mistakenly treating such files as clean. new_mtime = -1; new_state_map.push(( filename.to_owned(), DirstateEntry { mtime: new_mtime, ..*entry }, )); } let mut new_filename = new_filename.into_vec(); if let Some(copy) = copy_map.get(filename) { new_filename.push('\0' as u8); new_filename.extend(copy.bytes()); } packed.write_u8(entry.state.into())?; packed.write_i32::(entry.mode)?; packed.write_i32::(entry.size)?; packed.write_i32::(new_mtime)?; packed.write_i32::(new_filename.len() as i32)?; packed.extend(new_filename) } if packed.len() != expected_size { return Err(DirstatePackError::BadSize(expected_size, packed.len())); } state_map.extend(new_state_map); Ok(packed) } #[cfg(test)] mod tests { use super::*; use crate::{utils::hg_path::HgPathBuf, FastHashMap}; #[test] fn test_pack_dirstate_empty() { let mut state_map: StateMap = FastHashMap::default(); let copymap = FastHashMap::default(); let parents = DirstateParents { p1: *b"12345678910111213141", p2: *b"00000000000000000000", }; let now = Duration::new(15000000, 0); let expected = b"1234567891011121314100000000000000000000".to_vec(); assert_eq!( expected, pack_dirstate(&mut state_map, ©map, parents, now).unwrap() ); assert!(state_map.is_empty()) } #[test] fn test_pack_dirstate_one_entry() { let expected_state_map: StateMap = [( HgPathBuf::from_bytes(b"f1"), DirstateEntry { state: EntryState::Normal, mode: 0o644, size: 0, mtime: 791231220, }, )] .iter() .cloned() .collect(); let mut state_map = expected_state_map.clone(); let copymap = FastHashMap::default(); let parents = DirstateParents { p1: *b"12345678910111213141", p2: *b"00000000000000000000", }; let now = Duration::new(15000000, 0); let expected = [ 49, 50, 51, 52, 53, 54, 55, 56, 57, 49, 48, 49, 49, 49, 50, 49, 51, 49, 52, 49, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 110, 0, 0, 1, 164, 0, 0, 0, 0, 47, 41, 58, 244, 0, 0, 0, 2, 102, 49, ] .to_vec(); assert_eq!( expected, pack_dirstate(&mut state_map, ©map, parents, now).unwrap() ); assert_eq!(expected_state_map, state_map); } #[test] fn test_pack_dirstate_one_entry_with_copy() { let expected_state_map: StateMap = [( HgPathBuf::from_bytes(b"f1"), DirstateEntry { state: EntryState::Normal, mode: 0o644, size: 0, mtime: 791231220, }, )] .iter() .cloned() .collect(); let mut state_map = expected_state_map.clone(); let mut copymap = FastHashMap::default(); copymap.insert( HgPathBuf::from_bytes(b"f1"), HgPathBuf::from_bytes(b"copyname"), ); let parents = DirstateParents { p1: *b"12345678910111213141", p2: *b"00000000000000000000", }; let now = Duration::new(15000000, 0); let expected = [ 49, 50, 51, 52, 53, 54, 55, 56, 57, 49, 48, 49, 49, 49, 50, 49, 51, 49, 52, 49, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 110, 0, 0, 1, 164, 0, 0, 0, 0, 47, 41, 58, 244, 0, 0, 0, 11, 102, 49, 0, 99, 111, 112, 121, 110, 97, 109, 101, ] .to_vec(); assert_eq!( expected, pack_dirstate(&mut state_map, ©map, parents, now).unwrap() ); assert_eq!(expected_state_map, state_map); } #[test] fn test_parse_pack_one_entry_with_copy() { let mut state_map: StateMap = [( HgPathBuf::from_bytes(b"f1"), DirstateEntry { state: EntryState::Normal, mode: 0o644, size: 0, mtime: 791231220, }, )] .iter() .cloned() .collect(); let mut copymap = FastHashMap::default(); copymap.insert( HgPathBuf::from_bytes(b"f1"), HgPathBuf::from_bytes(b"copyname"), ); let parents = DirstateParents { p1: *b"12345678910111213141", p2: *b"00000000000000000000", }; let now = Duration::new(15000000, 0); let result = pack_dirstate(&mut state_map, ©map, parents.clone(), now) .unwrap(); let mut new_state_map: StateMap = FastHashMap::default(); let mut new_copy_map: CopyMap = FastHashMap::default(); let new_parents = parse_dirstate( &mut new_state_map, &mut new_copy_map, result.as_slice(), ) .unwrap(); assert_eq!( (parents, state_map, copymap), (new_parents, new_state_map, new_copy_map) ) } #[test] fn test_parse_pack_multiple_entries_with_copy() { let mut state_map: StateMap = [ ( HgPathBuf::from_bytes(b"f1"), DirstateEntry { state: EntryState::Normal, mode: 0o644, size: 0, mtime: 791231220, }, ), ( HgPathBuf::from_bytes(b"f2"), DirstateEntry { state: EntryState::Merged, mode: 0o777, size: 1000, mtime: 791231220, }, ), ( HgPathBuf::from_bytes(b"f3"), DirstateEntry { state: EntryState::Removed, mode: 0o644, size: 234553, mtime: 791231220, }, ), ( HgPathBuf::from_bytes(b"f4\xF6"), DirstateEntry { state: EntryState::Added, mode: 0o644, size: -1, mtime: -1, }, ), ] .iter() .cloned() .collect(); let mut copymap = FastHashMap::default(); copymap.insert( HgPathBuf::from_bytes(b"f1"), HgPathBuf::from_bytes(b"copyname"), ); copymap.insert( HgPathBuf::from_bytes(b"f4\xF6"), HgPathBuf::from_bytes(b"copyname2"), ); let parents = DirstateParents { p1: *b"12345678910111213141", p2: *b"00000000000000000000", }; let now = Duration::new(15000000, 0); let result = pack_dirstate(&mut state_map, ©map, parents.clone(), now) .unwrap(); let mut new_state_map: StateMap = FastHashMap::default(); let mut new_copy_map: CopyMap = FastHashMap::default(); let new_parents = parse_dirstate( &mut new_state_map, &mut new_copy_map, result.as_slice(), ) .unwrap(); assert_eq!( (parents, state_map, copymap), (new_parents, new_state_map, new_copy_map) ) } #[test] /// https://www.mercurial-scm.org/repo/hg/rev/af3f26b6bba4 fn test_parse_pack_one_entry_with_copy_and_time_conflict() { let mut state_map: StateMap = [( HgPathBuf::from_bytes(b"f1"), DirstateEntry { state: EntryState::Normal, mode: 0o644, size: 0, mtime: 15000000, }, )] .iter() .cloned() .collect(); let mut copymap = FastHashMap::default(); copymap.insert( HgPathBuf::from_bytes(b"f1"), HgPathBuf::from_bytes(b"copyname"), ); let parents = DirstateParents { p1: *b"12345678910111213141", p2: *b"00000000000000000000", }; let now = Duration::new(15000000, 0); let result = pack_dirstate(&mut state_map, ©map, parents.clone(), now) .unwrap(); let mut new_state_map: StateMap = FastHashMap::default(); let mut new_copy_map: CopyMap = FastHashMap::default(); let new_parents = parse_dirstate( &mut new_state_map, &mut new_copy_map, result.as_slice(), ) .unwrap(); assert_eq!( ( parents, [( HgPathBuf::from_bytes(b"f1"), DirstateEntry { state: EntryState::Normal, mode: 0o644, size: 0, mtime: -1 } )] .iter() .cloned() .collect::(), copymap, ), (new_parents, new_state_map, new_copy_map) ) } } mercurial-5.3.1/rust/hg-core/src/dirstate/dirs_multiset.rs0000644015407300116100000002556713627755404023613 0ustar augieeng00000000000000// dirs_multiset.rs // // Copyright 2019 Raphaël Gomès // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! A multiset of directory names. //! //! Used to counts the references to directories in a manifest or dirstate. use crate::utils::hg_path::{HgPath, HgPathBuf}; use crate::{ dirstate::EntryState, utils::files, DirstateEntry, DirstateMapError, FastHashMap, }; use std::collections::hash_map::{self, Entry}; // could be encapsulated if we care API stability more seriously pub type DirsMultisetIter<'a> = hash_map::Keys<'a, HgPathBuf, u32>; #[derive(PartialEq, Debug)] pub struct DirsMultiset { inner: FastHashMap, } impl DirsMultiset { /// Initializes the multiset from a dirstate. /// /// If `skip_state` is provided, skips dirstate entries with equal state. pub fn from_dirstate( dirstate: &FastHashMap, skip_state: Option, ) -> Result { let mut multiset = DirsMultiset { inner: FastHashMap::default(), }; for (filename, DirstateEntry { state, .. }) in dirstate { // This `if` is optimized out of the loop if let Some(skip) = skip_state { if skip != *state { multiset.add_path(filename)?; } } else { multiset.add_path(filename)?; } } Ok(multiset) } /// Initializes the multiset from a manifest. pub fn from_manifest( manifest: &[impl AsRef], ) -> Result { let mut multiset = DirsMultiset { inner: FastHashMap::default(), }; for filename in manifest { multiset.add_path(filename.as_ref())?; } Ok(multiset) } /// Increases the count of deepest directory contained in the path. /// /// If the directory is not yet in the map, adds its parents. pub fn add_path( &mut self, path: impl AsRef, ) -> Result<(), DirstateMapError> { for subpath in files::find_dirs(path.as_ref()) { if subpath.as_bytes().last() == Some(&b'/') { // TODO Remove this once PathAuditor is certified // as the only entrypoint for path data return Err(DirstateMapError::ConsecutiveSlashes); } if let Some(val) = self.inner.get_mut(subpath) { *val += 1; break; } self.inner.insert(subpath.to_owned(), 1); } Ok(()) } /// Decreases the count of deepest directory contained in the path. /// /// If it is the only reference, decreases all parents until one is /// removed. /// If the directory is not in the map, something horrible has happened. pub fn delete_path( &mut self, path: impl AsRef, ) -> Result<(), DirstateMapError> { for subpath in files::find_dirs(path.as_ref()) { match self.inner.entry(subpath.to_owned()) { Entry::Occupied(mut entry) => { let val = entry.get().clone(); if val > 1 { entry.insert(val - 1); break; } entry.remove(); } Entry::Vacant(_) => { return Err(DirstateMapError::PathNotFound( path.as_ref().to_owned(), )) } }; } Ok(()) } pub fn contains(&self, key: impl AsRef) -> bool { self.inner.contains_key(key.as_ref()) } pub fn iter(&self) -> DirsMultisetIter { self.inner.keys() } pub fn len(&self) -> usize { self.inner.len() } } #[cfg(test)] mod tests { use super::*; #[test] fn test_delete_path_path_not_found() { let manifest: Vec = vec![]; let mut map = DirsMultiset::from_manifest(&manifest).unwrap(); let path = HgPathBuf::from_bytes(b"doesnotexist/"); assert_eq!( Err(DirstateMapError::PathNotFound(path.to_owned())), map.delete_path(&path) ); } #[test] fn test_delete_path_empty_path() { let mut map = DirsMultiset::from_manifest(&vec![HgPathBuf::new()]).unwrap(); let path = HgPath::new(b""); assert_eq!(Ok(()), map.delete_path(path)); assert_eq!( Err(DirstateMapError::PathNotFound(path.to_owned())), map.delete_path(path) ); } #[test] fn test_delete_path_successful() { let mut map = DirsMultiset { inner: [("", 5), ("a", 3), ("a/b", 2), ("a/c", 1)] .iter() .map(|(k, v)| (HgPathBuf::from_bytes(k.as_bytes()), *v)) .collect(), }; assert_eq!(Ok(()), map.delete_path(HgPath::new(b"a/b/"))); eprintln!("{:?}", map); assert_eq!(Ok(()), map.delete_path(HgPath::new(b"a/b/"))); eprintln!("{:?}", map); assert_eq!( Err(DirstateMapError::PathNotFound(HgPathBuf::from_bytes( b"a/b/" ))), map.delete_path(HgPath::new(b"a/b/")) ); assert_eq!(2, *map.inner.get(HgPath::new(b"a")).unwrap()); assert_eq!(1, *map.inner.get(HgPath::new(b"a/c")).unwrap()); eprintln!("{:?}", map); assert_eq!(Ok(()), map.delete_path(HgPath::new(b"a/"))); eprintln!("{:?}", map); assert_eq!(Ok(()), map.delete_path(HgPath::new(b"a/c/"))); assert_eq!( Err(DirstateMapError::PathNotFound(HgPathBuf::from_bytes( b"a/c/" ))), map.delete_path(HgPath::new(b"a/c/")) ); } #[test] fn test_add_path_empty_path() { let manifest: Vec = vec![]; let mut map = DirsMultiset::from_manifest(&manifest).unwrap(); let path = HgPath::new(b""); map.add_path(path).unwrap(); assert_eq!(1, map.len()); } #[test] fn test_add_path_successful() { let manifest: Vec = vec![]; let mut map = DirsMultiset::from_manifest(&manifest).unwrap(); map.add_path(HgPath::new(b"a/")).unwrap(); assert_eq!(1, *map.inner.get(HgPath::new(b"a")).unwrap()); assert_eq!(1, *map.inner.get(HgPath::new(b"")).unwrap()); assert_eq!(2, map.len()); // Non directory should be ignored map.add_path(HgPath::new(b"a")).unwrap(); assert_eq!(1, *map.inner.get(HgPath::new(b"a")).unwrap()); assert_eq!(2, map.len()); // Non directory will still add its base map.add_path(HgPath::new(b"a/b")).unwrap(); assert_eq!(2, *map.inner.get(HgPath::new(b"a")).unwrap()); assert_eq!(2, map.len()); // Duplicate path works map.add_path(HgPath::new(b"a/")).unwrap(); assert_eq!(3, *map.inner.get(HgPath::new(b"a")).unwrap()); // Nested dir adds to its base map.add_path(HgPath::new(b"a/b/")).unwrap(); assert_eq!(4, *map.inner.get(HgPath::new(b"a")).unwrap()); assert_eq!(1, *map.inner.get(HgPath::new(b"a/b")).unwrap()); // but not its base's base, because it already existed map.add_path(HgPath::new(b"a/b/c/")).unwrap(); assert_eq!(4, *map.inner.get(HgPath::new(b"a")).unwrap()); assert_eq!(2, *map.inner.get(HgPath::new(b"a/b")).unwrap()); map.add_path(HgPath::new(b"a/c/")).unwrap(); assert_eq!(1, *map.inner.get(HgPath::new(b"a/c")).unwrap()); let expected = DirsMultiset { inner: [("", 2), ("a", 5), ("a/b", 2), ("a/b/c", 1), ("a/c", 1)] .iter() .map(|(k, v)| (HgPathBuf::from_bytes(k.as_bytes()), *v)) .collect(), }; assert_eq!(map, expected); } #[test] fn test_dirsmultiset_new_empty() { let manifest: Vec = vec![]; let new = DirsMultiset::from_manifest(&manifest).unwrap(); let expected = DirsMultiset { inner: FastHashMap::default(), }; assert_eq!(expected, new); let new = DirsMultiset::from_dirstate(&FastHashMap::default(), None) .unwrap(); let expected = DirsMultiset { inner: FastHashMap::default(), }; assert_eq!(expected, new); } #[test] fn test_dirsmultiset_new_no_skip() { let input_vec: Vec = ["a/", "b/", "a/c", "a/d/"] .iter() .map(|e| HgPathBuf::from_bytes(e.as_bytes())) .collect(); let expected_inner = [("", 2), ("a", 3), ("b", 1), ("a/d", 1)] .iter() .map(|(k, v)| (HgPathBuf::from_bytes(k.as_bytes()), *v)) .collect(); let new = DirsMultiset::from_manifest(&input_vec).unwrap(); let expected = DirsMultiset { inner: expected_inner, }; assert_eq!(expected, new); let input_map = ["a/", "b/", "a/c", "a/d/"] .iter() .map(|f| { ( HgPathBuf::from_bytes(f.as_bytes()), DirstateEntry { state: EntryState::Normal, mode: 0, mtime: 0, size: 0, }, ) }) .collect(); let expected_inner = [("", 2), ("a", 3), ("b", 1), ("a/d", 1)] .iter() .map(|(k, v)| (HgPathBuf::from_bytes(k.as_bytes()), *v)) .collect(); let new = DirsMultiset::from_dirstate(&input_map, None).unwrap(); let expected = DirsMultiset { inner: expected_inner, }; assert_eq!(expected, new); } #[test] fn test_dirsmultiset_new_skip() { let input_map = [ ("a/", EntryState::Normal), ("a/b/", EntryState::Normal), ("a/c", EntryState::Removed), ("a/d/", EntryState::Merged), ] .iter() .map(|(f, state)| { ( HgPathBuf::from_bytes(f.as_bytes()), DirstateEntry { state: *state, mode: 0, mtime: 0, size: 0, }, ) }) .collect(); // "a" incremented with "a/c" and "a/d/" let expected_inner = [("", 1), ("a", 2), ("a/d", 1)] .iter() .map(|(k, v)| (HgPathBuf::from_bytes(k.as_bytes()), *v)) .collect(); let new = DirsMultiset::from_dirstate(&input_map, Some(EntryState::Normal)) .unwrap(); let expected = DirsMultiset { inner: expected_inner, }; assert_eq!(expected, new); } } mercurial-5.3.1/rust/hg-core/src/dirstate/dirstate_map.rs0000644015407300116100000003501513627755405023366 0ustar augieeng00000000000000// dirstate_map.rs // // Copyright 2019 Raphaël Gomès // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. use crate::{ dirstate::{parsers::PARENT_SIZE, EntryState, SIZE_FROM_OTHER_PARENT}, pack_dirstate, parse_dirstate, utils::{ files::normalize_case, hg_path::{HgPath, HgPathBuf}, }, CopyMap, DirsMultiset, DirstateEntry, DirstateError, DirstateMapError, DirstateParents, DirstateParseError, FastHashMap, StateMap, }; use core::borrow::Borrow; use std::collections::HashSet; use std::convert::TryInto; use std::iter::FromIterator; use std::ops::Deref; use std::time::Duration; pub type FileFoldMap = FastHashMap; const NULL_ID: [u8; 20] = [0; 20]; const MTIME_UNSET: i32 = -1; #[derive(Default)] pub struct DirstateMap { state_map: StateMap, pub copy_map: CopyMap, file_fold_map: Option, pub dirs: Option, pub all_dirs: Option, non_normal_set: Option>, other_parent_set: Option>, parents: Option, dirty_parents: bool, } /// Should only really be used in python interface code, for clarity impl Deref for DirstateMap { type Target = StateMap; fn deref(&self) -> &Self::Target { &self.state_map } } impl FromIterator<(HgPathBuf, DirstateEntry)> for DirstateMap { fn from_iter>( iter: I, ) -> Self { Self { state_map: iter.into_iter().collect(), ..Self::default() } } } impl DirstateMap { pub fn new() -> Self { Self::default() } pub fn clear(&mut self) { self.state_map.clear(); self.copy_map.clear(); self.file_fold_map = None; self.non_normal_set = None; self.other_parent_set = None; self.set_parents(&DirstateParents { p1: NULL_ID, p2: NULL_ID, }) } /// Add a tracked file to the dirstate pub fn add_file( &mut self, filename: &HgPath, old_state: EntryState, entry: DirstateEntry, ) -> Result<(), DirstateMapError> { if old_state == EntryState::Unknown || old_state == EntryState::Removed { if let Some(ref mut dirs) = self.dirs { dirs.add_path(filename)?; } } if old_state == EntryState::Unknown { if let Some(ref mut all_dirs) = self.all_dirs { all_dirs.add_path(filename)?; } } self.state_map.insert(filename.to_owned(), entry.to_owned()); if entry.state != EntryState::Normal || entry.mtime == MTIME_UNSET { self.get_non_normal_other_parent_entries() .0 .as_mut() .unwrap() .insert(filename.to_owned()); } if entry.size == SIZE_FROM_OTHER_PARENT { self.get_non_normal_other_parent_entries() .1 .as_mut() .unwrap() .insert(filename.to_owned()); } Ok(()) } /// Mark a file as removed in the dirstate. /// /// The `size` parameter is used to store sentinel values that indicate /// the file's previous state. In the future, we should refactor this /// to be more explicit about what that state is. pub fn remove_file( &mut self, filename: &HgPath, old_state: EntryState, size: i32, ) -> Result<(), DirstateMapError> { if old_state != EntryState::Unknown && old_state != EntryState::Removed { if let Some(ref mut dirs) = self.dirs { dirs.delete_path(filename)?; } } if old_state == EntryState::Unknown { if let Some(ref mut all_dirs) = self.all_dirs { all_dirs.add_path(filename)?; } } if let Some(ref mut file_fold_map) = self.file_fold_map { file_fold_map.remove(&normalize_case(filename)); } self.state_map.insert( filename.to_owned(), DirstateEntry { state: EntryState::Removed, mode: 0, size, mtime: 0, }, ); self.get_non_normal_other_parent_entries() .0 .as_mut() .unwrap() .insert(filename.to_owned()); Ok(()) } /// Remove a file from the dirstate. /// Returns `true` if the file was previously recorded. pub fn drop_file( &mut self, filename: &HgPath, old_state: EntryState, ) -> Result { let exists = self.state_map.remove(filename).is_some(); if exists { if old_state != EntryState::Removed { if let Some(ref mut dirs) = self.dirs { dirs.delete_path(filename)?; } } if let Some(ref mut all_dirs) = self.all_dirs { all_dirs.delete_path(filename)?; } } if let Some(ref mut file_fold_map) = self.file_fold_map { file_fold_map.remove(&normalize_case(filename)); } self.get_non_normal_other_parent_entries() .0 .as_mut() .unwrap() .remove(filename); Ok(exists) } pub fn clear_ambiguous_times( &mut self, filenames: Vec, now: i32, ) { for filename in filenames { let mut changed = false; self.state_map .entry(filename.to_owned()) .and_modify(|entry| { if entry.state == EntryState::Normal && entry.mtime == now { changed = true; *entry = DirstateEntry { mtime: MTIME_UNSET, ..*entry }; } }); if changed { self.get_non_normal_other_parent_entries() .0 .as_mut() .unwrap() .insert(filename.to_owned()); } } } pub fn non_normal_entries_remove( &mut self, key: impl AsRef, ) -> bool { self.get_non_normal_other_parent_entries() .0 .as_mut() .unwrap() .remove(key.as_ref()) } pub fn non_normal_entries_union( &mut self, other: HashSet, ) -> Vec { self.get_non_normal_other_parent_entries() .0 .as_mut() .unwrap() .union(&other) .map(|e| e.to_owned()) .collect() } pub fn get_non_normal_other_parent_entries( &mut self, ) -> ( &mut Option>, &mut Option>, ) { self.set_non_normal_other_parent_entries(false); (&mut self.non_normal_set, &mut self.other_parent_set) } pub fn set_non_normal_other_parent_entries(&mut self, force: bool) { if !force && self.non_normal_set.is_some() && self.other_parent_set.is_some() { return; } let mut non_normal = HashSet::new(); let mut other_parent = HashSet::new(); for ( filename, DirstateEntry { state, size, mtime, .. }, ) in self.state_map.iter() { if *state != EntryState::Normal || *mtime == MTIME_UNSET { non_normal.insert(filename.to_owned()); } if *state == EntryState::Normal && *size == SIZE_FROM_OTHER_PARENT { other_parent.insert(filename.to_owned()); } } self.non_normal_set = Some(non_normal); self.other_parent_set = Some(other_parent); } /// Both of these setters and their uses appear to be the simplest way to /// emulate a Python lazy property, but it is ugly and unidiomatic. /// TODO One day, rewriting this struct using the typestate might be a /// good idea. pub fn set_all_dirs(&mut self) -> Result<(), DirstateMapError> { if self.all_dirs.is_none() { self.all_dirs = Some(DirsMultiset::from_dirstate(&self.state_map, None)?); } Ok(()) } pub fn set_dirs(&mut self) -> Result<(), DirstateMapError> { if self.dirs.is_none() { self.dirs = Some(DirsMultiset::from_dirstate( &self.state_map, Some(EntryState::Removed), )?); } Ok(()) } pub fn has_tracked_dir( &mut self, directory: &HgPath, ) -> Result { self.set_dirs()?; Ok(self.dirs.as_ref().unwrap().contains(directory)) } pub fn has_dir( &mut self, directory: &HgPath, ) -> Result { self.set_all_dirs()?; Ok(self.all_dirs.as_ref().unwrap().contains(directory)) } pub fn parents( &mut self, file_contents: &[u8], ) -> Result<&DirstateParents, DirstateError> { if let Some(ref parents) = self.parents { return Ok(parents); } let parents; if file_contents.len() == PARENT_SIZE * 2 { parents = DirstateParents { p1: file_contents[..PARENT_SIZE].try_into().unwrap(), p2: file_contents[PARENT_SIZE..PARENT_SIZE * 2] .try_into() .unwrap(), }; } else if file_contents.is_empty() { parents = DirstateParents { p1: NULL_ID, p2: NULL_ID, }; } else { return Err(DirstateError::Parse(DirstateParseError::Damaged)); } self.parents = Some(parents); Ok(self.parents.as_ref().unwrap()) } pub fn set_parents(&mut self, parents: &DirstateParents) { self.parents = Some(parents.clone()); self.dirty_parents = true; } pub fn read( &mut self, file_contents: &[u8], ) -> Result, DirstateError> { if file_contents.is_empty() { return Ok(None); } let parents = parse_dirstate( &mut self.state_map, &mut self.copy_map, file_contents, )?; if !self.dirty_parents { self.set_parents(&parents); } Ok(Some(parents)) } pub fn pack( &mut self, parents: DirstateParents, now: Duration, ) -> Result, DirstateError> { let packed = pack_dirstate(&mut self.state_map, &self.copy_map, parents, now)?; self.dirty_parents = false; self.set_non_normal_other_parent_entries(true); Ok(packed) } pub fn build_file_fold_map(&mut self) -> &FileFoldMap { if let Some(ref file_fold_map) = self.file_fold_map { return file_fold_map; } let mut new_file_fold_map = FileFoldMap::default(); for (filename, DirstateEntry { state, .. }) in self.state_map.borrow() { if *state == EntryState::Removed { new_file_fold_map .insert(normalize_case(filename), filename.to_owned()); } } self.file_fold_map = Some(new_file_fold_map); self.file_fold_map.as_ref().unwrap() } } #[cfg(test)] mod tests { use super::*; #[test] fn test_dirs_multiset() { let mut map = DirstateMap::new(); assert!(map.dirs.is_none()); assert!(map.all_dirs.is_none()); assert_eq!(map.has_dir(HgPath::new(b"nope")).unwrap(), false); assert!(map.all_dirs.is_some()); assert!(map.dirs.is_none()); assert_eq!(map.has_tracked_dir(HgPath::new(b"nope")).unwrap(), false); assert!(map.dirs.is_some()); } #[test] fn test_add_file() { let mut map = DirstateMap::new(); assert_eq!(0, map.len()); map.add_file( HgPath::new(b"meh"), EntryState::Normal, DirstateEntry { state: EntryState::Normal, mode: 1337, mtime: 1337, size: 1337, }, ) .unwrap(); assert_eq!(1, map.len()); assert_eq!( 0, map.get_non_normal_other_parent_entries() .0 .as_ref() .unwrap() .len() ); assert_eq!( 0, map.get_non_normal_other_parent_entries() .1 .as_ref() .unwrap() .len() ); } #[test] fn test_non_normal_other_parent_entries() { let mut map: DirstateMap = [ (b"f1", (EntryState::Removed, 1337, 1337, 1337)), (b"f2", (EntryState::Normal, 1337, 1337, -1)), (b"f3", (EntryState::Normal, 1337, 1337, 1337)), (b"f4", (EntryState::Normal, 1337, -2, 1337)), (b"f5", (EntryState::Added, 1337, 1337, 1337)), (b"f6", (EntryState::Added, 1337, 1337, -1)), (b"f7", (EntryState::Merged, 1337, 1337, -1)), (b"f8", (EntryState::Merged, 1337, 1337, 1337)), (b"f9", (EntryState::Merged, 1337, -2, 1337)), (b"fa", (EntryState::Added, 1337, -2, 1337)), (b"fb", (EntryState::Removed, 1337, -2, 1337)), ] .iter() .map(|(fname, (state, mode, size, mtime))| { ( HgPathBuf::from_bytes(fname.as_ref()), DirstateEntry { state: *state, mode: *mode, size: *size, mtime: *mtime, }, ) }) .collect(); let non_normal = [ b"f1", b"f2", b"f5", b"f6", b"f7", b"f8", b"f9", b"fa", b"fb", ] .iter() .map(|x| HgPathBuf::from_bytes(x.as_ref())) .collect(); let mut other_parent = HashSet::new(); other_parent.insert(HgPathBuf::from_bytes(b"f4")); let entries = map.get_non_normal_other_parent_entries(); assert_eq!( (Some(non_normal), Some(other_parent)), (entries.0.to_owned(), entries.1.to_owned()) ); } } mercurial-5.3.1/rust/hg-core/src/dirstate/status.rs0000644015407300116100000002300213627755404022225 0ustar augieeng00000000000000// status.rs // // Copyright 2019 Raphaël Gomès // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Rust implementation of dirstate.status (dirstate.py). //! It is currently missing a lot of functionality compared to the Python one //! and will only be triggered in narrow cases. use crate::{ dirstate::SIZE_FROM_OTHER_PARENT, matchers::Matcher, utils::{ files::HgMetadata, hg_path::{hg_path_to_path_buf, HgPath}, }, CopyMap, DirstateEntry, DirstateMap, EntryState, }; use rayon::prelude::*; use std::collections::HashSet; use std::path::Path; /// Marker enum used to dispatch new status entries into the right collections. /// Is similar to `crate::EntryState`, but represents the transient state of /// entries during the lifetime of a command. enum Dispatch { Unsure, Modified, Added, Removed, Deleted, Clean, Unknown, } type IoResult = std::io::Result; /// Dates and times that are outside the 31-bit signed range are compared /// modulo 2^31. This should prevent hg from behaving badly with very large /// files or corrupt dates while still having a high probability of detecting /// changes. (issue2608) /// TODO I haven't found a way of having `b` be `Into`, since `From` /// is not defined for `i32`, and there is no `As` trait. This forces the /// caller to cast `b` as `i32`. fn mod_compare(a: i32, b: i32) -> bool { a & i32::max_value() != b & i32::max_value() } /// The file corresponding to the dirstate entry was found on the filesystem. fn dispatch_found( filename: impl AsRef, entry: DirstateEntry, metadata: HgMetadata, copy_map: &CopyMap, check_exec: bool, list_clean: bool, last_normal_time: i64, ) -> Dispatch { let DirstateEntry { state, mode, mtime, size, } = entry; let HgMetadata { st_mode, st_size, st_mtime, .. } = metadata; match state { EntryState::Normal => { let size_changed = mod_compare(size, st_size as i32); let mode_changed = (mode ^ st_mode as i32) & 0o100 != 0o000 && check_exec; let metadata_changed = size >= 0 && (size_changed || mode_changed); let other_parent = size == SIZE_FROM_OTHER_PARENT; if metadata_changed || other_parent || copy_map.contains_key(filename.as_ref()) { Dispatch::Modified } else if mod_compare(mtime, st_mtime as i32) { Dispatch::Unsure } else if st_mtime == last_normal_time { // the file may have just been marked as normal and // it may have changed in the same second without // changing its size. This can happen if we quickly // do multiple commits. Force lookup, so we don't // miss such a racy file change. Dispatch::Unsure } else if list_clean { Dispatch::Clean } else { Dispatch::Unknown } } EntryState::Merged => Dispatch::Modified, EntryState::Added => Dispatch::Added, EntryState::Removed => Dispatch::Removed, EntryState::Unknown => Dispatch::Unknown, } } /// The file corresponding to this Dirstate entry is missing. fn dispatch_missing(state: EntryState) -> Dispatch { match state { // File was removed from the filesystem during commands EntryState::Normal | EntryState::Merged | EntryState::Added => { Dispatch::Deleted } // File was removed, everything is normal EntryState::Removed => Dispatch::Removed, // File is unknown to Mercurial, everything is normal EntryState::Unknown => Dispatch::Unknown, } } /// Get stat data about the files explicitly specified by match. /// TODO subrepos fn walk_explicit<'a>( files: &'a HashSet<&HgPath>, dmap: &'a DirstateMap, root_dir: impl AsRef + Sync + Send, check_exec: bool, list_clean: bool, last_normal_time: i64, ) -> impl ParallelIterator> { files.par_iter().filter_map(move |filename| { // TODO normalization let normalized = filename.as_ref(); let buf = match hg_path_to_path_buf(normalized) { Ok(x) => x, Err(e) => return Some(Err(e.into())), }; let target = root_dir.as_ref().join(buf); let st = target.symlink_metadata(); match st { Ok(meta) => { let file_type = meta.file_type(); if file_type.is_file() || file_type.is_symlink() { if let Some(entry) = dmap.get(normalized) { return Some(Ok(( normalized, dispatch_found( &normalized, *entry, HgMetadata::from_metadata(meta), &dmap.copy_map, check_exec, list_clean, last_normal_time, ), ))); } } else { if dmap.contains_key(normalized) { return Some(Ok((normalized, Dispatch::Removed))); } } } Err(_) => { if let Some(entry) = dmap.get(normalized) { return Some(Ok(( normalized, dispatch_missing(entry.state), ))); } } }; None }) } /// Stat all entries in the `DirstateMap` and mark them for dispatch into /// the relevant collections. fn stat_dmap_entries( dmap: &DirstateMap, root_dir: impl AsRef + Sync + Send, check_exec: bool, list_clean: bool, last_normal_time: i64, ) -> impl ParallelIterator> { dmap.par_iter().map(move |(filename, entry)| { let filename: &HgPath = filename; let filename_as_path = hg_path_to_path_buf(filename)?; let meta = root_dir.as_ref().join(filename_as_path).symlink_metadata(); match meta { Ok(ref m) if !(m.file_type().is_file() || m.file_type().is_symlink()) => { Ok((filename, dispatch_missing(entry.state))) } Ok(m) => Ok(( filename, dispatch_found( filename, *entry, HgMetadata::from_metadata(m), &dmap.copy_map, check_exec, list_clean, last_normal_time, ), )), Err(ref e) if e.kind() == std::io::ErrorKind::NotFound || e.raw_os_error() == Some(20) => { // Rust does not yet have an `ErrorKind` for // `NotADirectory` (errno 20) // It happens if the dirstate contains `foo/bar` and // foo is not a directory Ok((filename, dispatch_missing(entry.state))) } Err(e) => Err(e), } }) } pub struct StatusResult<'a> { pub modified: Vec<&'a HgPath>, pub added: Vec<&'a HgPath>, pub removed: Vec<&'a HgPath>, pub deleted: Vec<&'a HgPath>, pub clean: Vec<&'a HgPath>, /* TODO ignored * TODO unknown */ } fn build_response<'a>( results: impl IntoIterator>, ) -> IoResult<(Vec<&'a HgPath>, StatusResult<'a>)> { let mut lookup = vec![]; let mut modified = vec![]; let mut added = vec![]; let mut removed = vec![]; let mut deleted = vec![]; let mut clean = vec![]; for res in results.into_iter() { let (filename, dispatch) = res?; match dispatch { Dispatch::Unknown => {} Dispatch::Unsure => lookup.push(filename), Dispatch::Modified => modified.push(filename), Dispatch::Added => added.push(filename), Dispatch::Removed => removed.push(filename), Dispatch::Deleted => deleted.push(filename), Dispatch::Clean => clean.push(filename), } } Ok(( lookup, StatusResult { modified, added, removed, deleted, clean, }, )) } pub fn status<'a: 'c, 'b: 'c, 'c>( dmap: &'a DirstateMap, matcher: &'b (impl Matcher), root_dir: impl AsRef + Sync + Send + Copy, list_clean: bool, last_normal_time: i64, check_exec: bool, ) -> IoResult<(Vec<&'c HgPath>, StatusResult<'c>)> { let files = matcher.file_set(); let mut results = vec![]; if let Some(files) = files { results.par_extend(walk_explicit( &files, &dmap, root_dir, check_exec, list_clean, last_normal_time, )); } if !matcher.is_exact() { let stat_results = stat_dmap_entries( &dmap, root_dir, check_exec, list_clean, last_normal_time, ); results.par_extend(stat_results); } build_response(results) } mercurial-5.3.1/rust/hg-core/src/matchers.rs0000644015407300116100000001374713627755404020710 0ustar augieeng00000000000000// matchers.rs // // Copyright 2019 Raphaël Gomès // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Structs and types for matching files and directories. use crate::{utils::hg_path::HgPath, DirsMultiset, DirstateMapError}; use std::collections::HashSet; use std::iter::FromIterator; pub enum VisitChildrenSet<'a> { /// Don't visit anything Empty, /// Only visit this directory This, /// Visit this directory and these subdirectories /// TODO Should we implement a `NonEmptyHashSet`? Set(HashSet<&'a HgPath>), /// Visit this directory and all subdirectories Recursive, } pub trait Matcher { /// Explicitly listed files fn file_set(&self) -> Option<&HashSet<&HgPath>>; /// Returns whether `filename` is in `file_set` fn exact_match(&self, filename: impl AsRef) -> bool; /// Returns whether `filename` is matched by this matcher fn matches(&self, filename: impl AsRef) -> bool; /// Decides whether a directory should be visited based on whether it /// has potential matches in it or one of its subdirectories, and /// potentially lists which subdirectories of that directory should be /// visited. This is based on the match's primary, included, and excluded /// patterns. /// /// # Example /// /// Assume matchers `['path:foo/bar', 'rootfilesin:qux']`, we would /// return the following values (assuming the implementation of /// visit_children_set is capable of recognizing this; some implementations /// are not). /// /// ```text /// ```ignore /// '' -> {'foo', 'qux'} /// 'baz' -> set() /// 'foo' -> {'bar'} /// // Ideally this would be `Recursive`, but since the prefix nature of /// // matchers is applied to the entire matcher, we have to downgrade this /// // to `This` due to the (yet to be implemented in Rust) non-prefix /// // `RootFilesIn'-kind matcher being mixed in. /// 'foo/bar' -> 'this' /// 'qux' -> 'this' /// ``` /// # Important /// /// Most matchers do not know if they're representing files or /// directories. They see `['path:dir/f']` and don't know whether `f` is a /// file or a directory, so `visit_children_set('dir')` for most matchers /// will return `HashSet{ HgPath { "f" } }`, but if the matcher knows it's /// a file (like the yet to be implemented in Rust `ExactMatcher` does), /// it may return `VisitChildrenSet::This`. /// Do not rely on the return being a `HashSet` indicating that there are /// no files in this dir to investigate (or equivalently that if there are /// files to investigate in 'dir' that it will always return /// `VisitChildrenSet::This`). fn visit_children_set( &self, directory: impl AsRef, ) -> VisitChildrenSet; /// Matcher will match everything and `files_set()` will be empty: /// optimization might be possible. fn matches_everything(&self) -> bool; /// Matcher will match exactly the files in `files_set()`: optimization /// might be possible. fn is_exact(&self) -> bool; } /// Matches everything. ///``` /// use hg::{ matchers::{Matcher, AlwaysMatcher}, utils::hg_path::HgPath }; /// /// let matcher = AlwaysMatcher; /// /// assert_eq!(matcher.matches(HgPath::new(b"whatever")), true); /// assert_eq!(matcher.matches(HgPath::new(b"b.txt")), true); /// assert_eq!(matcher.matches(HgPath::new(b"main.c")), true); /// assert_eq!(matcher.matches(HgPath::new(br"re:.*\.c$")), true); /// ``` #[derive(Debug)] pub struct AlwaysMatcher; impl Matcher for AlwaysMatcher { fn file_set(&self) -> Option<&HashSet<&HgPath>> { None } fn exact_match(&self, _filename: impl AsRef) -> bool { false } fn matches(&self, _filename: impl AsRef) -> bool { true } fn visit_children_set( &self, _directory: impl AsRef, ) -> VisitChildrenSet { VisitChildrenSet::Recursive } fn matches_everything(&self) -> bool { true } fn is_exact(&self) -> bool { false } } /// Matches the input files exactly. They are interpreted as paths, not /// patterns. /// ///``` /// use hg::{ matchers::{Matcher, FileMatcher}, utils::hg_path::HgPath }; /// /// let files = [HgPath::new(b"a.txt"), HgPath::new(br"re:.*\.c$")]; /// let matcher = FileMatcher::new(&files).unwrap(); /// /// assert_eq!(matcher.matches(HgPath::new(b"a.txt")), true); /// assert_eq!(matcher.matches(HgPath::new(b"b.txt")), false); /// assert_eq!(matcher.matches(HgPath::new(b"main.c")), false); /// assert_eq!(matcher.matches(HgPath::new(br"re:.*\.c$")), true); /// ``` #[derive(Debug)] pub struct FileMatcher<'a> { files: HashSet<&'a HgPath>, dirs: DirsMultiset, } impl<'a> FileMatcher<'a> { pub fn new( files: &'a [impl AsRef], ) -> Result { Ok(Self { files: HashSet::from_iter(files.iter().map(|f| f.as_ref())), dirs: DirsMultiset::from_manifest(files)?, }) } fn inner_matches(&self, filename: impl AsRef) -> bool { self.files.contains(filename.as_ref()) } } impl<'a> Matcher for FileMatcher<'a> { fn file_set(&self) -> Option<&HashSet<&HgPath>> { Some(&self.files) } fn exact_match(&self, filename: impl AsRef) -> bool { self.inner_matches(filename) } fn matches(&self, filename: impl AsRef) -> bool { self.inner_matches(filename) } fn visit_children_set( &self, _directory: impl AsRef, ) -> VisitChildrenSet { // TODO implement once we have `status.traverse` // This is useless until unknown files are taken into account // Which will not need to happen before the `IncludeMatcher`. unimplemented!() } fn matches_everything(&self) -> bool { false } fn is_exact(&self) -> bool { true } } mercurial-5.3.1/rust/hg-core/src/dagops.rs0000644015407300116100000002150713627755405020351 0ustar augieeng00000000000000// dagops.rs // // Copyright 2019 Georges Racinet // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Miscellaneous DAG operations //! //! # Terminology //! - By *relative heads* of a collection of revision numbers (`Revision`), we //! mean those revisions that have no children among the collection. //! - Similarly *relative roots* of a collection of `Revision`, we mean those //! whose parents, if any, don't belong to the collection. use super::{Graph, GraphError, Revision, NULL_REVISION}; use crate::ancestors::AncestorsIterator; use std::collections::{BTreeSet, HashSet}; fn remove_parents( graph: &impl Graph, rev: Revision, set: &mut HashSet, ) -> Result<(), GraphError> { for parent in graph.parents(rev)?.iter() { if *parent != NULL_REVISION { set.remove(parent); } } Ok(()) } /// Relative heads out of some revisions, passed as an iterator. /// /// These heads are defined as those revisions that have no children /// among those emitted by the iterator. /// /// # Performance notes /// Internally, this clones the iterator, and builds a `HashSet` out of it. /// /// This function takes an `Iterator` instead of `impl IntoIterator` to /// guarantee that cloning the iterator doesn't result in cloning the full /// construct it comes from. pub fn heads<'a>( graph: &impl Graph, iter_revs: impl Clone + Iterator, ) -> Result, GraphError> { let mut heads: HashSet = iter_revs.clone().cloned().collect(); heads.remove(&NULL_REVISION); for rev in iter_revs { if *rev != NULL_REVISION { remove_parents(graph, *rev, &mut heads)?; } } Ok(heads) } /// Retain in `revs` only its relative heads. /// /// This is an in-place operation, so that control of the incoming /// set is left to the caller. /// - a direct Python binding would probably need to build its own `HashSet` /// from an incoming iterable, even if its sole purpose is to extract the /// heads. /// - a Rust caller can decide whether cloning beforehand is appropriate /// /// # Performance notes /// Internally, this function will store a full copy of `revs` in a `Vec`. pub fn retain_heads( graph: &impl Graph, revs: &mut HashSet, ) -> Result<(), GraphError> { revs.remove(&NULL_REVISION); // we need to construct an iterable copy of revs to avoid itering while // mutating let as_vec: Vec = revs.iter().cloned().collect(); for rev in as_vec { if rev != NULL_REVISION { remove_parents(graph, rev, revs)?; } } Ok(()) } /// Roots of `revs`, passed as a `HashSet` /// /// They are returned in arbitrary order pub fn roots( graph: &G, revs: &HashSet, ) -> Result, GraphError> { let mut roots: Vec = Vec::new(); for rev in revs { if graph .parents(*rev)? .iter() .filter(|p| **p != NULL_REVISION) .all(|p| !revs.contains(p)) { roots.push(*rev); } } Ok(roots) } /// Compute the topological range between two collections of revisions /// /// This is equivalent to the revset `::`. /// /// Currently, the given `Graph` has to implement `Clone`, which means /// actually cloning just a reference-counted Python pointer if /// it's passed over through `rust-cpython`. This is due to the internal /// use of `AncestorsIterator` /// /// # Algorithmic details /// /// This is a two-pass swipe inspired from what `reachableroots2` from /// `mercurial.cext.parsers` does to obtain the same results. /// /// - first, we climb up the DAG from `heads` in topological order, keeping /// them in the vector `heads_ancestors` vector, and adding any element of /// `roots` we find among them to the resulting range. /// - Then, we iterate on that recorded vector so that a revision is always /// emitted after its parents and add all revisions whose parents are already /// in the range to the results. /// /// # Performance notes /// /// The main difference with the C implementation is that /// the latter uses a flat array with bit flags, instead of complex structures /// like `HashSet`, making it faster in most scenarios. In theory, it's /// possible that the present implementation could be more memory efficient /// for very large repositories with many branches. pub fn range( graph: &(impl Graph + Clone), roots: impl IntoIterator, heads: impl IntoIterator, ) -> Result, GraphError> { let mut range = BTreeSet::new(); let roots: HashSet = roots.into_iter().collect(); let min_root: Revision = match roots.iter().cloned().min() { None => { return Ok(range); } Some(r) => r, }; // Internally, AncestorsIterator currently maintains a `HashSet` // of all seen revision, which is also what we record, albeit in an ordered // way. There's room for improvement on this duplication. let ait = AncestorsIterator::new(graph.clone(), heads, min_root, true)?; let mut heads_ancestors: Vec = Vec::new(); for revres in ait { let rev = revres?; if roots.contains(&rev) { range.insert(rev); } heads_ancestors.push(rev); } for rev in heads_ancestors.into_iter().rev() { for parent in graph.parents(rev)?.iter() { if *parent != NULL_REVISION && range.contains(parent) { range.insert(rev); } } } Ok(range) } #[cfg(test)] mod tests { use super::*; use crate::testing::SampleGraph; /// Apply `retain_heads()` to the given slice and return as a sorted `Vec` fn retain_heads_sorted( graph: &impl Graph, revs: &[Revision], ) -> Result, GraphError> { let mut revs: HashSet = revs.iter().cloned().collect(); retain_heads(graph, &mut revs)?; let mut as_vec: Vec = revs.iter().cloned().collect(); as_vec.sort(); Ok(as_vec) } #[test] fn test_retain_heads() -> Result<(), GraphError> { assert_eq!(retain_heads_sorted(&SampleGraph, &[4, 5, 6])?, vec![5, 6]); assert_eq!( retain_heads_sorted(&SampleGraph, &[4, 1, 6, 12, 0])?, vec![1, 6, 12] ); assert_eq!( retain_heads_sorted(&SampleGraph, &[1, 2, 3, 4, 5, 6, 7, 8, 9])?, vec![3, 5, 8, 9] ); Ok(()) } /// Apply `heads()` to the given slice and return as a sorted `Vec` fn heads_sorted( graph: &impl Graph, revs: &[Revision], ) -> Result, GraphError> { let heads = heads(graph, revs.iter())?; let mut as_vec: Vec = heads.iter().cloned().collect(); as_vec.sort(); Ok(as_vec) } #[test] fn test_heads() -> Result<(), GraphError> { assert_eq!(heads_sorted(&SampleGraph, &[4, 5, 6])?, vec![5, 6]); assert_eq!( heads_sorted(&SampleGraph, &[4, 1, 6, 12, 0])?, vec![1, 6, 12] ); assert_eq!( heads_sorted(&SampleGraph, &[1, 2, 3, 4, 5, 6, 7, 8, 9])?, vec![3, 5, 8, 9] ); Ok(()) } /// Apply `roots()` and sort the result for easier comparison fn roots_sorted( graph: &impl Graph, revs: &[Revision], ) -> Result, GraphError> { let mut as_vec = roots(graph, &revs.iter().cloned().collect())?; as_vec.sort(); Ok(as_vec) } #[test] fn test_roots() -> Result<(), GraphError> { assert_eq!(roots_sorted(&SampleGraph, &[4, 5, 6])?, vec![4]); assert_eq!( roots_sorted(&SampleGraph, &[4, 1, 6, 12, 0])?, vec![0, 4, 12] ); assert_eq!( roots_sorted(&SampleGraph, &[1, 2, 3, 4, 5, 6, 7, 8, 9])?, vec![1, 8] ); Ok(()) } /// Apply `range()` and convert the result into a Vec for easier comparison fn range_vec( graph: impl Graph + Clone, roots: &[Revision], heads: &[Revision], ) -> Result, GraphError> { range(&graph, roots.iter().cloned(), heads.iter().cloned()) .map(|bs| bs.into_iter().collect()) } #[test] fn test_range() -> Result<(), GraphError> { assert_eq!(range_vec(SampleGraph, &[0], &[4])?, vec![0, 1, 2, 4]); assert_eq!(range_vec(SampleGraph, &[0], &[8])?, vec![]); assert_eq!( range_vec(SampleGraph, &[5, 6], &[10, 11, 13])?, vec![5, 10] ); assert_eq!( range_vec(SampleGraph, &[5, 6], &[10, 12])?, vec![5, 6, 9, 10, 12] ); Ok(()) } } mercurial-5.3.1/rust/hg-core/src/testing.rs0000644015407300116100000000335113627755405020546 0ustar augieeng00000000000000// testing.rs // // Copyright 2018 Georges Racinet // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. use crate::{Graph, GraphError, Revision, NULL_REVISION}; /// A stub `Graph`, same as the one from `test-ancestor.py` /// /// 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 #[derive(Clone, Debug)] pub struct SampleGraph; impl Graph for SampleGraph { fn parents(&self, rev: Revision) -> Result<[Revision; 2], GraphError> { match rev { 0 => Ok([NULL_REVISION, NULL_REVISION]), 1 => Ok([0, NULL_REVISION]), 2 => Ok([1, NULL_REVISION]), 3 => Ok([1, NULL_REVISION]), 4 => Ok([2, NULL_REVISION]), 5 => Ok([4, NULL_REVISION]), 6 => Ok([4, NULL_REVISION]), 7 => Ok([4, NULL_REVISION]), 8 => Ok([NULL_REVISION, NULL_REVISION]), 9 => Ok([6, 7]), 10 => Ok([5, NULL_REVISION]), 11 => Ok([3, 7]), 12 => Ok([9, NULL_REVISION]), 13 => Ok([8, NULL_REVISION]), r => Err(GraphError::ParentOutOfRange(r)), } } } // A Graph represented by a vector whose indices are revisions // and values are parents of the revisions pub type VecGraph = Vec<[Revision; 2]>; impl Graph for VecGraph { fn parents(&self, rev: Revision) -> Result<[Revision; 2], GraphError> { Ok(self[rev as usize]) } } mercurial-5.3.1/rust/hg-core/src/dirstate.rs0000644015407300116100000000436113627755404020711 0ustar augieeng00000000000000// dirstate module // // Copyright 2019 Raphaël Gomès // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. use crate::{utils::hg_path::HgPathBuf, DirstateParseError, FastHashMap}; use std::collections::hash_map; use std::convert::TryFrom; pub mod dirs_multiset; pub mod dirstate_map; pub mod parsers; pub mod status; #[derive(Debug, PartialEq, Clone)] pub struct DirstateParents { pub p1: [u8; 20], pub p2: [u8; 20], } /// The C implementation uses all signed types. This will be an issue /// either when 4GB+ source files are commonplace or in 2038, whichever /// comes first. #[derive(Debug, PartialEq, Copy, Clone)] pub struct DirstateEntry { pub state: EntryState, pub mode: i32, pub mtime: i32, pub size: i32, } /// A `DirstateEntry` with a size of `-2` means that it was merged from the /// other parent. This allows revert to pick the right status back during a /// merge. pub const SIZE_FROM_OTHER_PARENT: i32 = -2; pub type StateMap = FastHashMap; pub type StateMapIter<'a> = hash_map::Iter<'a, HgPathBuf, DirstateEntry>; pub type CopyMap = FastHashMap; pub type CopyMapIter<'a> = hash_map::Iter<'a, HgPathBuf, HgPathBuf>; #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum EntryState { Normal, Added, Removed, Merged, Unknown, } impl TryFrom for EntryState { type Error = DirstateParseError; fn try_from(value: u8) -> Result { match value { b'n' => Ok(EntryState::Normal), b'a' => Ok(EntryState::Added), b'r' => Ok(EntryState::Removed), b'm' => Ok(EntryState::Merged), b'?' => Ok(EntryState::Unknown), _ => Err(DirstateParseError::CorruptedEntry(format!( "Incorrect entry state {}", value ))), } } } impl Into for EntryState { fn into(self) -> u8 { match self { EntryState::Normal => b'n', EntryState::Added => b'a', EntryState::Removed => b'r', EntryState::Merged => b'm', EntryState::Unknown => b'?', } } } mercurial-5.3.1/rust/hg-core/src/utils.rs0000644015407300116100000000527113627755405020234 0ustar augieeng00000000000000// utils module // // Copyright 2019 Raphaël Gomès // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Contains useful functions, traits, structs, etc. for use in core. pub mod files; pub mod hg_path; /// Useful until rust/issues/56345 is stable /// /// # Examples /// /// ``` /// use crate::hg::utils::find_slice_in_slice; /// /// let haystack = b"This is the haystack".to_vec(); /// assert_eq!(find_slice_in_slice(&haystack, b"the"), Some(8)); /// assert_eq!(find_slice_in_slice(&haystack, b"not here"), None); /// ``` pub fn find_slice_in_slice(slice: &[T], needle: &[T]) -> Option where for<'a> &'a [T]: PartialEq, { slice .windows(needle.len()) .position(|window| window == needle) } /// Replaces the `from` slice with the `to` slice inside the `buf` slice. /// /// # Examples /// /// ``` /// use crate::hg::utils::replace_slice; /// let mut line = b"I hate writing tests!".to_vec(); /// replace_slice(&mut line, b"hate", b"love"); /// assert_eq!( /// line, /// b"I love writing tests!".to_vec() /// ); /// ``` pub fn replace_slice(buf: &mut [T], from: &[T], to: &[T]) where T: Clone + PartialEq, { if buf.len() < from.len() || from.len() != to.len() { return; } for i in 0..=buf.len() - from.len() { if buf[i..].starts_with(from) { buf[i..(i + from.len())].clone_from_slice(to); } } } pub trait SliceExt { fn trim_end(&self) -> &Self; fn trim_start(&self) -> &Self; fn trim(&self) -> &Self; fn drop_prefix(&self, needle: &Self) -> Option<&Self>; } fn is_not_whitespace(c: &u8) -> bool { !(*c as char).is_whitespace() } impl SliceExt for [u8] { fn trim_end(&self) -> &[u8] { if let Some(last) = self.iter().rposition(is_not_whitespace) { &self[..last + 1] } else { &[] } } fn trim_start(&self) -> &[u8] { if let Some(first) = self.iter().position(is_not_whitespace) { &self[first..] } else { &[] } } /// ``` /// use hg::utils::SliceExt; /// assert_eq!( /// b" to trim ".trim(), /// b"to trim" /// ); /// assert_eq!( /// b"to trim ".trim(), /// b"to trim" /// ); /// assert_eq!( /// b" to trim".trim(), /// b"to trim" /// ); /// ``` fn trim(&self) -> &[u8] { self.trim_start().trim_end() } fn drop_prefix(&self, needle: &Self) -> Option<&Self> { if self.starts_with(needle) { Some(&self[needle.len()..]) } else { None } } } mercurial-5.3.1/rust/hg-core/src/revlog.rs0000644015407300116100000000250613627755404020367 0ustar augieeng00000000000000// Copyright 2018-2020 Georges Racinet // and Mercurial contributors // // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. //! Mercurial concepts for handling revision history /// Mercurial revision numbers /// /// As noted in revlog.c, revision numbers are actually encoded in /// 4 bytes, and are liberally converted to ints, whence the i32 pub type Revision = i32; /// Marker expressing the absence of a parent /// /// Independently of the actual representation, `NULL_REVISION` is guaranteed /// to be smaller than all existing revisions. pub const NULL_REVISION: Revision = -1; /// Same as `mercurial.node.wdirrev` /// /// This is also equal to `i32::max_value()`, but it's better to spell /// it out explicitely, same as in `mercurial.node` pub const WORKING_DIRECTORY_REVISION: Revision = 0x7fffffff; /// The simplest expression of what we need of Mercurial DAGs. pub trait Graph { /// Return the two parents of the given `Revision`. /// /// Each of the parents can be independently `NULL_REVISION` fn parents(&self, rev: Revision) -> Result<[Revision; 2], GraphError>; } #[derive(Clone, Debug, PartialEq)] pub enum GraphError { ParentOutOfRange(Revision), WorkingDirectoryUnsupported, } mercurial-5.3.1/hgext3rd/0000755015407300116100000000000013627755444015144 5ustar augieeng00000000000000mercurial-5.3.1/hgext3rd/__init__.py0000644015407300116100000000023613627755404017252 0ustar augieeng00000000000000# name space package to host third party extensions from __future__ import absolute_import import pkgutil __path__ = pkgutil.extend_path(__path__, __name__) mercurial-5.3.1/tests/0000755015407300116100000000000013627755445014557 5ustar augieeng00000000000000mercurial-5.3.1/tests/test-trusted.py0000644015407300116100000002164413627755405017603 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 import sys from mercurial import ( error, pycompat, ui as uimod, util, ) from mercurial.utils import stringutil hgrc = os.environ['HGRCPATH'] f = open(hgrc, 'rb') basehgrc = f.read() f.close() def _maybesysstr(v): if isinstance(v, bytes): return pycompat.sysstr(v) return pycompat.sysstr(stringutil.pprint(v)) def bprint(*args, **kwargs): print( *[_maybesysstr(a) for a in args], **{k: _maybesysstr(v) for k, v in kwargs.items()} ) # avoid awkward interleaving with ui object's output sys.stdout.flush() def testui( user=b'foo', group=b'bar', tusers=(), tgroups=(), cuser=b'foo', cgroup=b'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, 'wb') f.write(basehgrc) f.write(b'\n[paths]\n') f.write(b'global = /some/path\n\n') if tusers or tgroups: f.write(b'[trusted]\n') if tusers: f.write(b'users = %s\n' % b', '.join(tusers)) if tgroups: f.write(b'groups = %s\n' % b', '.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 b'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 = (b'different', b'same') who = (b'', b'user', b'group', b'user and the group') trusted = who[(user in tusers) + 2 * (group in tgroups)] if trusted: trusted = b', but we trust the ' + trusted bprint( b'# %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(b'devel', b'warn-config-unknown', False, b'test') u.setconfig(b'devel', b'all-warnings', False, b'test') u.setconfig(b'ui', b'debug', pycompat.bytestr(bool(debug))) u.setconfig(b'ui', b'report_untrusted', pycompat.bytestr(bool(report))) u.readconfig(b'.hg/hgrc') if silent: return u bprint(b'trusted') for name, path in u.configitems(b'paths'): bprint(b' ', name, b'=', util.pconvert(path)) bprint(b'untrusted') for name, path in u.configitems(b'paths', untrusted=True): bprint(b'.', end=b' ') u.config(b'paths', name) # warning with debug=True bprint(b'.', end=b' ') u.config(b'paths', name, untrusted=True) # no warnings bprint(name, b'=', util.pconvert(path)) print() return u os.mkdir(b'repo') os.chdir(b'repo') os.mkdir(b'.hg') f = open(b'.hg/hgrc', 'wb') f.write(b'[paths]\n') f.write(b'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=b'def') # different user, same group testui(user=b'abc') # ... but we trust the group testui(user=b'abc', tgroups=[b'bar']) # different user, different group testui(user=b'abc', group=b'def') # ... but we trust the user testui(user=b'abc', group=b'def', tusers=[b'abc']) # ... but we trust the group testui(user=b'abc', group=b'def', tgroups=[b'def']) # ... but we trust the user and the group testui(user=b'abc', group=b'def', tusers=[b'abc'], tgroups=[b'def']) # ... but we trust all users bprint(b'# we trust all users') testui(user=b'abc', group=b'def', tusers=[b'*']) # ... but we trust all groups bprint(b'# we trust all groups') testui(user=b'abc', group=b'def', tgroups=[b'*']) # ... but we trust the whole universe bprint(b'# we trust all users and groups') testui(user=b'abc', group=b'def', tusers=[b'*'], tgroups=[b'*']) # ... check that users and groups are in different namespaces bprint(b"# we don't get confused by users and groups with the same name") testui(user=b'abc', group=b'def', tusers=[b'def'], tgroups=[b'abc']) # ... lists of user names work bprint(b"# list of user names") testui( user=b'abc', group=b'def', tusers=[b'foo', b'xyz', b'abc', b'bleh'], tgroups=[b'bar', b'baz', b'qux'], ) # ... lists of group names work bprint(b"# list of group names") testui( user=b'abc', group=b'def', tusers=[b'foo', b'xyz', b'bleh'], tgroups=[b'bar', b'def', b'baz', b'qux'], ) bprint(b"# Can't figure out the name of the user running this process") testui(user=b'abc', group=b'def', cuser=None) bprint(b"# prints debug warnings") u = testui(user=b'abc', group=b'def', cuser=b'foo', debug=True) bprint(b"# report_untrusted enabled without debug hides warnings") u = testui(user=b'abc', group=b'def', cuser=b'foo', report=False) bprint(b"# report_untrusted enabled with debug shows warnings") u = testui(user=b'abc', group=b'def', cuser=b'foo', debug=True, report=False) bprint(b"# ui.readconfig sections") filename = b'foobar' f = open(filename, 'wb') f.write(b'[foobar]\n') f.write(b'baz = quux\n') f.close() u.readconfig(filename, sections=[b'foobar']) bprint(u.config(b'foobar', b'baz')) print() bprint(b"# 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(b'devel', b'warn-config-unknown', False, b'test') u.setconfig(b'devel', b'all-warnings', False, b'test') u.setconfig(b'ui', b'debug', b'on') u.readconfig(filename) u2 = u.copy() def username(uid=None): return b'foo' util.username = username u2.readconfig(b'.hg/hgrc') bprint(b'trusted:') bprint(u2.config(b'foobar', b'baz')) bprint(b'untrusted:') bprint(u2.config(b'foobar', b'baz', untrusted=True)) print() bprint(b"# error handling") def assertraises(f, exc=error.Abort): try: f() except exc as inst: bprint(b'raised', inst.__class__.__name__) else: bprint(b'no exception?!') bprint(b"# file doesn't exist") os.unlink(b'.hg/hgrc') assert not os.path.exists(b'.hg/hgrc') testui(debug=True, silent=True) testui(user=b'abc', group=b'def', debug=True, silent=True) print() bprint(b"# parse error") f = open(b'.hg/hgrc', 'wb') f.write(b'foo') f.close() # This is a hack to remove b'' prefixes from ParseError.__bytes__ on # Python 3. def normalizeparseerror(e): if pycompat.ispy3: args = [a.decode('utf-8') for a in e.args] else: args = e.args return error.ParseError(*args) try: testui(user=b'abc', group=b'def', silent=True) except error.ParseError as inst: bprint(normalizeparseerror(inst)) try: testui(debug=True, silent=True) except error.ParseError as inst: bprint(normalizeparseerror(inst)) print() bprint(b'# access typed information') with open(b'.hg/hgrc', 'wb') as f: f.write( b'''\ [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=b'abc', group=b'def', cuser=b'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) bprint(b'# suboptions, trusted and untrusted') trusted = u.configsuboptions(b'foo', b'sub') untrusted = u.configsuboptions(b'foo', b'sub', untrusted=True) bprint( (trusted[0], sorted(trusted[1].items())), (untrusted[0], sorted(untrusted[1].items())), ) bprint(b'# path, trusted and untrusted') bprint(configpath(b'foo', b'path'), configpath(b'foo', b'path', untrusted=True)) bprint(b'# bool, trusted and untrusted') bprint( u.configbool(b'foo', b'bool'), u.configbool(b'foo', b'bool', untrusted=True) ) bprint(b'# int, trusted and untrusted') bprint( u.configint(b'foo', b'int', 0), u.configint(b'foo', b'int', 0, untrusted=True), ) bprint(b'# bytes, trusted and untrusted') bprint( u.configbytes(b'foo', b'bytes', 0), u.configbytes(b'foo', b'bytes', 0, untrusted=True), ) bprint(b'# list, trusted and untrusted') bprint( u.configlist(b'foo', b'list', []), u.configlist(b'foo', b'list', [], untrusted=True), ) mercurial-5.3.1/tests/test-imports-checker.t0000644015407300116100000001244213627755405021017 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/stdlibfrom.py << EOF > from __future__ import absolute_import > from collections import abc > 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/stdlibfrom.py:2: direct symbol import abc from collections 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-5.3.1/tests/test-extension-timing.t0000644015407300116100000001010013627755405021206 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(b'tests', b'foo', default=b"Foo") > def uisetup(ui): > ui.debug(b"uisetup called [debug]\\n") > ui.write(b"uisetup called\\n") > ui.status(b"uisetup called [status]\\n") > ui.flush() > def reposetup(ui, repo): > ui.write(b"reposetup called for %s\\n" % os.path.basename(repo.root)) > ui.write(b"ui %s= repo.ui\\n" % (ui == repo.ui and b"=" or b"!")) > ui.flush() > @command(b'foo', [], b'hg foo') > def foo(ui, *args, **kwargs): > foo = ui.config(b'tests', b'foo') > ui.write(foo) > ui.write(b"\\n") > @command(b'bar', [], b'hg bar', norepo=True) > def bar(ui, *args, **kwargs): > ui.write(b"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 $ filterlog () { > sed -e 's!^[0-9/]* [0-9:]* ([0-9]*)>!YYYY/MM/DD HH:MM:SS (PID)>!' > } Test extension setup timings $ hg foo --traceback --config devel.debug.extensions=yes --debug 2>&1 | filterlog YYYY/MM/DD HH:MM:SS (PID)> loading extensions YYYY/MM/DD HH:MM:SS (PID)> - processing 1 entries YYYY/MM/DD HH:MM:SS (PID)> - loading extension: foobar YYYY/MM/DD HH:MM:SS (PID)> > foobar extension loaded in * (glob) YYYY/MM/DD HH:MM:SS (PID)> - validating extension tables: foobar YYYY/MM/DD HH:MM:SS (PID)> - invoking registered callbacks: foobar YYYY/MM/DD HH:MM:SS (PID)> > callbacks completed in * (glob) YYYY/MM/DD HH:MM:SS (PID)> > loaded 1 extensions, total time * (glob) YYYY/MM/DD HH:MM:SS (PID)> - loading configtable attributes YYYY/MM/DD HH:MM:SS (PID)> - executing uisetup hooks YYYY/MM/DD HH:MM:SS (PID)> - running uisetup for foobar uisetup called [debug] uisetup called uisetup called [status] YYYY/MM/DD HH:MM:SS (PID)> > uisetup for foobar took * (glob) YYYY/MM/DD HH:MM:SS (PID)> > all uisetup took * (glob) YYYY/MM/DD HH:MM:SS (PID)> - executing extsetup hooks YYYY/MM/DD HH:MM:SS (PID)> - running extsetup for foobar YYYY/MM/DD HH:MM:SS (PID)> > extsetup for foobar took * (glob) YYYY/MM/DD HH:MM:SS (PID)> > all extsetup took * (glob) YYYY/MM/DD HH:MM:SS (PID)> - executing remaining aftercallbacks YYYY/MM/DD HH:MM:SS (PID)> > remaining aftercallbacks completed in * (glob) YYYY/MM/DD HH:MM:SS (PID)> - loading extension registration objects YYYY/MM/DD HH:MM:SS (PID)> > extension registration object loading took * (glob) YYYY/MM/DD HH:MM:SS (PID)> > extension foobar take a total of * to load (glob) YYYY/MM/DD HH:MM:SS (PID)> extension loading complete YYYY/MM/DD HH:MM:SS (PID)> loading additional extensions YYYY/MM/DD HH:MM:SS (PID)> - processing 1 entries YYYY/MM/DD HH:MM:SS (PID)> > loaded 0 extensions, total time * (glob) YYYY/MM/DD HH:MM:SS (PID)> - loading configtable attributes YYYY/MM/DD HH:MM:SS (PID)> - executing uisetup hooks YYYY/MM/DD HH:MM:SS (PID)> > all uisetup took * (glob) YYYY/MM/DD HH:MM:SS (PID)> - executing extsetup hooks YYYY/MM/DD HH:MM:SS (PID)> > all extsetup took * (glob) YYYY/MM/DD HH:MM:SS (PID)> - executing remaining aftercallbacks YYYY/MM/DD HH:MM:SS (PID)> > remaining aftercallbacks completed in * (glob) YYYY/MM/DD HH:MM:SS (PID)> - loading extension registration objects YYYY/MM/DD HH:MM:SS (PID)> > extension registration object loading took * (glob) YYYY/MM/DD HH:MM:SS (PID)> extension loading complete YYYY/MM/DD HH:MM:SS (PID)> - executing reposetup hooks YYYY/MM/DD HH:MM:SS (PID)> - running reposetup for foobar reposetup called for a ui == repo.ui YYYY/MM/DD HH:MM:SS (PID)> > reposetup for foobar took * (glob) YYYY/MM/DD HH:MM:SS (PID)> > all reposetup took * (glob) Foo $ cd .. $ echo 'foobar = !' >> $HGRCPATH mercurial-5.3.1/tests/simplestorerepo.py0000644015407300116100000004630713627755405020373 0ustar augieeng00000000000000# simplestorerepo.py - Extension that swaps in alternate repository storage. # # Copyright 2018 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. # To use this with the test suite: # # $ HGREPOFEATURES="simplestore" ./run-tests.py \ # --extra-config-opt extensions.simplestore=`pwd`/simplestorerepo.py from __future__ import absolute_import import stat from mercurial.i18n import _ from mercurial.node import ( bin, hex, nullid, nullrev, ) from mercurial.thirdparty import attr from mercurial import ( ancestor, bundlerepo, error, extensions, localrepo, mdiff, pycompat, revlog, store, verify, ) from mercurial.interfaces import ( repository, util as interfaceutil, ) from mercurial.utils import ( cborutil, storageutil, ) from mercurial.revlogutils import flagutil # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should # be specifying the version(s) of Mercurial they are tested with, or # leave the attribute unspecified. testedwith = b'ships-with-hg-core' REQUIREMENT = b'testonly-simplestore' def validatenode(node): if isinstance(node, int): raise ValueError('expected node; got int') if len(node) != 20: raise ValueError('expected 20 byte node') def validaterev(rev): if not isinstance(rev, int): raise ValueError('expected int') class simplestoreerror(error.StorageError): pass @interfaceutil.implementer(repository.irevisiondelta) @attr.s(slots=True) class simplestorerevisiondelta(object): node = attr.ib() p1node = attr.ib() p2node = attr.ib() basenode = attr.ib() flags = attr.ib() baserevisionsize = attr.ib() revision = attr.ib() delta = attr.ib() linknode = attr.ib(default=None) @interfaceutil.implementer(repository.iverifyproblem) @attr.s(frozen=True) class simplefilestoreproblem(object): warning = attr.ib(default=None) error = attr.ib(default=None) node = attr.ib(default=None) @interfaceutil.implementer(repository.ifilestorage) class filestorage(object): """Implements storage for a tracked path. Data is stored in the VFS in a directory corresponding to the tracked path. Index data is stored in an ``index`` file using CBOR. Fulltext data is stored in files having names of the node. """ _flagserrorclass = simplestoreerror def __init__(self, svfs, path): self._svfs = svfs self._path = path self._storepath = b'/'.join([b'data', path]) self._indexpath = b'/'.join([self._storepath, b'index']) indexdata = self._svfs.tryread(self._indexpath) if indexdata: indexdata = cborutil.decodeall(indexdata) self._indexdata = indexdata or [] self._indexbynode = {} self._indexbyrev = {} self._index = [] self._refreshindex() self._flagprocessors = dict(flagutil.flagprocessors) def _refreshindex(self): self._indexbynode.clear() self._indexbyrev.clear() self._index = [] for i, entry in enumerate(self._indexdata): self._indexbynode[entry[b'node']] = entry self._indexbyrev[i] = entry self._indexbynode[nullid] = { b'node': nullid, b'p1': nullid, b'p2': nullid, b'linkrev': nullrev, b'flags': 0, } self._indexbyrev[nullrev] = { b'node': nullid, b'p1': nullid, b'p2': nullid, b'linkrev': nullrev, b'flags': 0, } for i, entry in enumerate(self._indexdata): p1rev, p2rev = self.parentrevs(self.rev(entry[b'node'])) # start, length, rawsize, chainbase, linkrev, p1, p2, node self._index.append( (0, 0, 0, -1, entry[b'linkrev'], p1rev, p2rev, entry[b'node']) ) self._index.append((0, 0, 0, -1, -1, -1, -1, nullid)) def __len__(self): return len(self._indexdata) def __iter__(self): return iter(range(len(self))) def revs(self, start=0, stop=None): step = 1 if stop is not None: if start > stop: step = -1 stop += step else: stop = len(self) return range(start, stop, step) def parents(self, node): validatenode(node) if node not in self._indexbynode: raise KeyError('unknown node') entry = self._indexbynode[node] return entry[b'p1'], entry[b'p2'] def parentrevs(self, rev): p1, p2 = self.parents(self._indexbyrev[rev][b'node']) return self.rev(p1), self.rev(p2) def rev(self, node): validatenode(node) try: self._indexbynode[node] except KeyError: raise error.LookupError(node, self._indexpath, _('no node')) for rev, entry in self._indexbyrev.items(): if entry[b'node'] == node: return rev raise error.ProgrammingError(b'this should not occur') def node(self, rev): validaterev(rev) return self._indexbyrev[rev][b'node'] def hasnode(self, node): validatenode(node) return node in self._indexbynode def censorrevision(self, tr, censornode, tombstone=b''): raise NotImplementedError('TODO') def lookup(self, node): if isinstance(node, int): return self.node(node) if len(node) == 20: self.rev(node) return node try: rev = int(node) if '%d' % rev != node: raise ValueError if rev < 0: rev = len(self) + rev if rev < 0 or rev >= len(self): raise ValueError return self.node(rev) except (ValueError, OverflowError): pass if len(node) == 40: try: rawnode = bin(node) self.rev(rawnode) return rawnode except TypeError: pass raise error.LookupError(node, self._path, _('invalid lookup input')) def linkrev(self, rev): validaterev(rev) return self._indexbyrev[rev][b'linkrev'] def _flags(self, rev): validaterev(rev) return self._indexbyrev[rev][b'flags'] def _candelta(self, baserev, rev): validaterev(baserev) validaterev(rev) if (self._flags(baserev) & revlog.REVIDX_RAWTEXT_CHANGING_FLAGS) or ( self._flags(rev) & revlog.REVIDX_RAWTEXT_CHANGING_FLAGS ): return False return True def checkhash(self, text, node, p1=None, p2=None, rev=None): if p1 is None and p2 is None: p1, p2 = self.parents(node) if node != storageutil.hashrevisionsha1(text, p1, p2): raise simplestoreerror( _("integrity check failed on %s") % self._path ) def revision(self, nodeorrev, raw=False): if isinstance(nodeorrev, int): node = self.node(nodeorrev) else: node = nodeorrev validatenode(node) if node == nullid: return b'' rev = self.rev(node) flags = self._flags(rev) path = b'/'.join([self._storepath, hex(node)]) rawtext = self._svfs.read(path) if raw: validatehash = flagutil.processflagsraw(self, rawtext, flags) text = rawtext else: r = flagutil.processflagsread(self, rawtext, flags) text, validatehash, sidedata = r if validatehash: self.checkhash(text, node, rev=rev) return text def rawdata(self, nodeorrev): return self.revision(raw=True) def read(self, node): validatenode(node) revision = self.revision(node) if not revision.startswith(b'\1\n'): return revision start = revision.index(b'\1\n', 2) return revision[start + 2 :] def renamed(self, node): validatenode(node) if self.parents(node)[0] != nullid: return False fulltext = self.revision(node) m = storageutil.parsemeta(fulltext)[0] if m and 'copy' in m: return m['copy'], bin(m['copyrev']) return False def cmp(self, node, text): validatenode(node) t = text if text.startswith(b'\1\n'): t = b'\1\n\1\n' + text p1, p2 = self.parents(node) if storageutil.hashrevisionsha1(t, p1, p2) == node: return False if self.iscensored(self.rev(node)): return text != b'' if self.renamed(node): t2 = self.read(node) return t2 != text return True def size(self, rev): validaterev(rev) node = self._indexbyrev[rev][b'node'] if self.renamed(node): return len(self.read(node)) if self.iscensored(rev): return 0 return len(self.revision(node)) def iscensored(self, rev): validaterev(rev) return self._flags(rev) & repository.REVISION_FLAG_CENSORED def commonancestorsheads(self, a, b): validatenode(a) validatenode(b) a = self.rev(a) b = self.rev(b) ancestors = ancestor.commonancestorsheads(self.parentrevs, a, b) return pycompat.maplist(self.node, ancestors) def descendants(self, revs): # This is a copy of revlog.descendants() first = min(revs) if first == nullrev: for i in self: yield i return seen = set(revs) for i in self.revs(start=first + 1): for x in self.parentrevs(i): if x != nullrev and x in seen: seen.add(i) yield i break # Required by verify. def files(self): entries = self._svfs.listdir(self._storepath) # Strip out undo.backup.* files created as part of transaction # recording. entries = [f for f in entries if not f.startswith('undo.backup.')] return [b'/'.join((self._storepath, f)) for f in entries] def storageinfo( self, exclusivefiles=False, sharedfiles=False, revisionscount=False, trackedsize=False, storedsize=False, ): # TODO do a real implementation of this return { 'exclusivefiles': [], 'sharedfiles': [], 'revisionscount': len(self), 'trackedsize': 0, 'storedsize': None, } def verifyintegrity(self, state): state['skipread'] = set() for rev in self: node = self.node(rev) try: self.revision(node) except Exception as e: yield simplefilestoreproblem( error='unpacking %s: %s' % (node, e), node=node ) state['skipread'].add(node) def emitrevisions( self, nodes, nodesorder=None, revisiondata=False, assumehaveparentrevisions=False, deltamode=repository.CG_DELTAMODE_STD, ): # TODO this will probably break on some ordering options. nodes = [n for n in nodes if n != nullid] if not nodes: return for delta in storageutil.emitrevisions( self, nodes, nodesorder, simplestorerevisiondelta, revisiondata=revisiondata, assumehaveparentrevisions=assumehaveparentrevisions, deltamode=deltamode, ): yield delta def add(self, text, meta, transaction, linkrev, p1, p2): if meta or text.startswith(b'\1\n'): text = storageutil.packmeta(meta, text) return self.addrevision(text, transaction, linkrev, p1, p2) def addrevision( self, text, transaction, linkrev, p1, p2, node=None, flags=revlog.REVIDX_DEFAULT_FLAGS, cachedelta=None, ): validatenode(p1) validatenode(p2) if flags: node = node or storageutil.hashrevisionsha1(text, p1, p2) rawtext, validatehash = flagutil.processflagswrite(self, text, flags) node = node or storageutil.hashrevisionsha1(text, p1, p2) if node in self._indexbynode: return node if validatehash: self.checkhash(rawtext, node, p1=p1, p2=p2) return self._addrawrevision( node, rawtext, transaction, linkrev, p1, p2, flags ) def _addrawrevision(self, node, rawtext, transaction, link, p1, p2, flags): transaction.addbackup(self._indexpath) path = b'/'.join([self._storepath, hex(node)]) self._svfs.write(path, rawtext) self._indexdata.append( { b'node': node, b'p1': p1, b'p2': p2, b'linkrev': link, b'flags': flags, } ) self._reflectindexupdate() return node def _reflectindexupdate(self): self._refreshindex() self._svfs.write( self._indexpath, ''.join(cborutil.streamencode(self._indexdata)) ) def addgroup( self, deltas, linkmapper, transaction, addrevisioncb=None, maybemissingparents=False, ): if maybemissingparents: raise error.Abort( _('simple store does not support missing parents ' 'write mode') ) nodes = [] transaction.addbackup(self._indexpath) for node, p1, p2, linknode, deltabase, delta, flags in deltas: linkrev = linkmapper(linknode) flags = flags or revlog.REVIDX_DEFAULT_FLAGS nodes.append(node) if node in self._indexbynode: continue # Need to resolve the fulltext from the delta base. if deltabase == nullid: text = mdiff.patch(b'', delta) else: text = mdiff.patch(self.revision(deltabase), delta) self._addrawrevision( node, text, transaction, linkrev, p1, p2, flags ) if addrevisioncb: addrevisioncb(self, node) return nodes def _headrevs(self): # Assume all revisions are heads by default. revishead = {rev: True for rev in self._indexbyrev} for rev, entry in self._indexbyrev.items(): # Unset head flag for all seen parents. revishead[self.rev(entry[b'p1'])] = False revishead[self.rev(entry[b'p2'])] = False return [rev for rev, ishead in sorted(revishead.items()) if ishead] def heads(self, start=None, stop=None): # This is copied from revlog.py. if start is None and stop is None: if not len(self): return [nullid] return [self.node(r) for r in self._headrevs()] if start is None: start = nullid if stop is None: stop = [] stoprevs = set([self.rev(n) for n in stop]) startrev = self.rev(start) reachable = {startrev} heads = {startrev} parentrevs = self.parentrevs for r in self.revs(start=startrev + 1): for p in parentrevs(r): if p in reachable: if r not in stoprevs: reachable.add(r) heads.add(r) if p in heads and p not in stoprevs: heads.remove(p) return [self.node(r) for r in heads] def children(self, node): validatenode(node) # This is a copy of revlog.children(). c = [] p = self.rev(node) for r in self.revs(start=p + 1): prevs = [pr for pr in self.parentrevs(r) if pr != nullrev] if prevs: for pr in prevs: if pr == p: c.append(self.node(r)) elif p == nullrev: c.append(self.node(r)) return c def getstrippoint(self, minlink): return storageutil.resolvestripinfo( minlink, len(self) - 1, self._headrevs(), self.linkrev, self.parentrevs, ) def strip(self, minlink, transaction): if not len(self): return rev, _ignored = self.getstrippoint(minlink) if rev == len(self): return # Purge index data starting at the requested revision. self._indexdata[rev:] = [] self._reflectindexupdate() def issimplestorefile(f, kind, st): if kind != stat.S_IFREG: return False if store.isrevlog(f, kind, st): return False # Ignore transaction undo files. if f.startswith('undo.'): return False # Otherwise assume it belongs to the simple store. return True class simplestore(store.encodedstore): def datafiles(self): for x in super(simplestore, self).datafiles(): yield x # Supplement with non-revlog files. extrafiles = self._walk('data', True, filefilter=issimplestorefile) for unencoded, encoded, size in extrafiles: try: unencoded = store.decodefilename(unencoded) except KeyError: unencoded = None yield unencoded, encoded, size def reposetup(ui, repo): if not repo.local(): return if isinstance(repo, bundlerepo.bundlerepository): raise error.Abort(_('cannot use simple store with bundlerepo')) class simplestorerepo(repo.__class__): def file(self, f): return filestorage(self.svfs, f) repo.__class__ = simplestorerepo def featuresetup(ui, supported): supported.add(REQUIREMENT) def newreporequirements(orig, ui, createopts): """Modifies default requirements for new repos to use the simple store.""" requirements = orig(ui, createopts) # These requirements are only used to affect creation of the store # object. We have our own store. So we can remove them. # TODO do this once we feel like taking the test hit. # if 'fncache' in requirements: # requirements.remove('fncache') # if 'dotencode' in requirements: # requirements.remove('dotencode') requirements.add(REQUIREMENT) return requirements def makestore(orig, requirements, path, vfstype): if REQUIREMENT not in requirements: return orig(requirements, path, vfstype) return simplestore(path, vfstype) def verifierinit(orig, self, *args, **kwargs): orig(self, *args, **kwargs) # We don't care that files in the store don't align with what is # advertised. So suppress these warnings. self.warnorphanstorefiles = False def extsetup(ui): localrepo.featuresetupfuncs.add(featuresetup) extensions.wrapfunction( localrepo, 'newreporequirements', newreporequirements ) extensions.wrapfunction(localrepo, 'makestore', makestore) extensions.wrapfunction(verify.verifier, '__init__', verifierinit) mercurial-5.3.1/tests/get-with-headers.py0000755015407300116100000000632313627755405020275 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 import argparse import json import os import sys from mercurial import ( pycompat, 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 stdout = getattr(sys.stdout, 'buffer', sys.stdout) 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() stdout.write( b'%d %s\n' % (response.status, response.reason.encode('ascii')) ) 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: stdout.write( b"%s: %s\n" % (h.encode('ascii'), response.getheader(h).encode('ascii')) ) if not headeronly: stdout.write(b'\n') data = response.read() if args.bodyfile: bodyfh = open(args.bodyfile, 'wb') else: bodyfh = 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 = pycompat.json_loads(data) lines = json.dumps(data, sort_keys=True, indent=2).splitlines() for line in lines: bodyfh.write(pycompat.sysbytes(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-5.3.1/tests/test-copy.t0000644015407300116100000001410713627755405016672 0ustar augieeng00000000000000 $ 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 linkrev nodeid p1 p2 0 0 b789fdd96dc2 000000000000 000000000000 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 linkrev nodeid p1 p2 0 1 37d9b5d994ea 000000000000 000000000000 this should show the rename information in the metadata $ hg debugdata b 0 | head -3 | tail -2 copy: a copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 #if reporevlogstore $ md5sum.py .hg/store/data/b.i 44913824c8f5890ae218f9829535922e .hg/store/data/b.i #endif $ 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 checked 2 changesets with 2 changes to 2 files $ 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 respects ui.relative-paths $ mkdir dir $ cd dir $ hg mv ../foo ../bar ../foo: not copying - file is not managed abort: no files to copy [255] $ hg mv ../foo ../bar --config ui.relative-paths=yes ../foo: not copying - file is not managed abort: no files to copy [255] $ hg mv ../foo ../bar --config ui.relative-paths=no foo: not copying - file is not managed abort: no files to copy [255] $ cd .. $ rmdir dir $ 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 [1] 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 linkrev nodeid p1 p2 0 0 2ed2a3912a0b 000000000000 000000000000 $ 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 linkrev nodeid p1 p2 0 1 7711d36246cc 000000000000 000000000000 1 2 bdf70a2b8d03 7711d36246cc 000000000000 2 3 b2558327ea8d 000000000000 000000000000 should match $ hg debugindex foo rev linkrev nodeid p1 p2 0 0 2ed2a3912a0b 000000000000 000000000000 1 2 dd12c926cf16 2ed2a3912a0b 000000000000 $ 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) [1] 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) [1] 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) [1] $ cd .. mercurial-5.3.1/tests/test-largefiles-small-disk.t0000644015407300116100000000403113627755405022066 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 b'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-5.3.1/tests/ls-l.py0000755015407300116100000000164013627755405016000 0ustar augieeng00000000000000#!/usr/bin/env python # like ls -l, but do not print date, user, or non-common mode bit, to avoid # using globs in tests. from __future__ import absolute_import, print_function import os import stat import sys def modestr(st): mode = st.st_mode result = '' if mode & stat.S_IFDIR: result += 'd' else: result += '-' for owner in ['USR', 'GRP', 'OTH']: for action in ['R', 'W', 'X']: if mode & getattr(stat, 'S_I%s%s' % (action, owner)): result += action.lower() else: result += '-' return result def sizestr(st): if st.st_mode & stat.S_IFREG: return '%7d' % st.st_size else: # do not show size for non regular files return ' ' * 7 os.chdir((sys.argv[1:] + ['.'])[0]) for name in sorted(os.listdir('.')): st = os.stat(name) print('%s %s %s' % (modestr(st), sizestr(st), name)) mercurial-5.3.1/tests/test-remotefilelog-gcrepack.t0000644015407300116100000001165013627755405022332 0ustar augieeng00000000000000#require no-windows $ . "$TESTDIR/remotefilelog-library.sh" $ hg init master $ cd master $ cat >> .hg/hgrc < [remotefilelog] > server=True > EOF $ echo x > x $ hg commit -qAm x $ echo y > y $ rm x $ hg commit -qAm DxAy $ echo yy > y $ hg commit -qAm y $ cd .. $ hgcloneshallow ssh://user@dummy/master shallow -q 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) # Set the prefetchdays config to zero so that all commits are prefetched # no matter what their creation date is. $ cd shallow $ cat >> .hg/hgrc < [remotefilelog] > prefetchdays=0 > EOF $ cd .. # Prefetch all data and repack $ cd shallow $ cat >> .hg/hgrc < [remotefilelog] > bgprefetchrevs=all() > EOF $ hg prefetch 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) $ hg repack $ find $CACHEDIR | sort | egrep ".datapack|.histpack" $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack # Ensure that all file versions were prefetched $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1` $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37: x: Node Delta Base Delta Length Blob Size 1406e7411862 000000000000 2 2 Total: 2 2 (0.0% bigger) y: Node Delta Base Delta Length Blob Size 50dbc4572b8e 000000000000 3 3 076f5e2225b3 50dbc4572b8e 14 2 Total: 17 5 (240.0% bigger) # Test garbage collection during repack $ cat >> .hg/hgrc < [remotefilelog] > bgprefetchrevs=tip > gcrepack=True > nodettl=86400 > EOF $ hg repack $ find $CACHEDIR | sort | egrep ".datapack|.histpack" $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack $TESTTMP/hgcache/master/packs/a4e1d094ec2aee8a08a4d6d95a13c634cc7d7394.datapack # Ensure that file 'x' was garbage collected. It should be GCed because it is not in the keepset # and is old (commit date is 0.0 in tests). Ensure that file 'y' is present as it is in the keepset. $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1` $TESTTMP/hgcache/master/packs/a4e1d094ec2aee8a08a4d6d95a13c634cc7d7394: y: Node Delta Base Delta Length Blob Size 50dbc4572b8e 000000000000 3 3 Total: 3 3 (0.0% bigger) # Prefetch all data again and repack for later garbage collection $ cat >> .hg/hgrc < [remotefilelog] > bgprefetchrevs=all() > EOF $ hg prefetch 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) $ hg repack $ find $CACHEDIR | sort | egrep ".datapack|.histpack" $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack # Ensure that all file versions were prefetched $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1` $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37: x: Node Delta Base Delta Length Blob Size 1406e7411862 000000000000 2 2 Total: 2 2 (0.0% bigger) y: Node Delta Base Delta Length Blob Size 50dbc4572b8e 000000000000 3 3 076f5e2225b3 50dbc4572b8e 14 2 Total: 17 5 (240.0% bigger) # Test garbage collection during repack. Ensure that new files are not removed even though they are not in the keepset # For the purposes of the test the TTL of a file is set to current time + 100 seconds. i.e. all commits in tests have # a date of 1970 and therefore to prevent garbage collection we have to set nodettl to be farther from 1970 than we are now. $ cat >> .hg/hgrc < [remotefilelog] > bgprefetchrevs= > nodettl=$(($(date +%s) + 100)) > EOF $ hg repack $ find $CACHEDIR | sort | egrep ".datapack|.histpack" $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack # Ensure that all file versions were prefetched $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1` $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37: x: Node Delta Base Delta Length Blob Size 1406e7411862 000000000000 2 2 Total: 2 2 (0.0% bigger) y: Node Delta Base Delta Length Blob Size 50dbc4572b8e 000000000000 3 3 076f5e2225b3 50dbc4572b8e 14 2 Total: 17 5 (240.0% bigger) mercurial-5.3.1/tests/test-rebase-parameters.t0000644015407300116100000002404613627755405021325 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 (8 drafts) (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 specify both --abort and --continue [255] $ hg rebase --continue --collapse abort: cannot use collapse with continue or abort [255] $ hg rebase --continue --dest 4 abort: cannot specify both --continue and --dest [255] $ hg rebase --base 5 --source 4 abort: cannot specify both --source and --base [255] $ hg rebase --rev 5 --source 4 abort: cannot specify both --rev and --source [255] $ hg rebase --base 5 --rev 4 abort: cannot specify both --rev and --base [255] $ hg rebase --base 6 abort: branch 'default' has 3 heads - please rebase to an explicit rev (run 'hg heads .' to see heads, specify destination with -d) [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: not rebasing 2:e4e3f3546619 "c2b" (tip), its destination already has all its changes 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: not rebasing 2:e4e3f3546619 "c2b" (tip), its destination already has all its changes 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-5.3.1/tests/test-newcgi.t0000644015407300116100000000322213627755405017170 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(b"test", b"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(b"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-5.3.1/tests/test-gendoc-ja.t0000644015407300116100000000262213627755405017546 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-5.3.1/tests/test-merge6.t0000644015407300116100000000362413627755405017107 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 1 local changesets published (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-5.3.1/tests/test-bundle-type.t0000644015407300116100000001307413627755405020152 0ustar augieeng00000000000000bundle 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 unbundle ../b1 adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets c35a0f9217e6 (1 drafts) (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 unbundle ../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} (mandatory: True) c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf cache:rev-branch-cache -- {} (mandatory: False) 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} (mandatory: True) c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf cache:rev-branch-cache -- {} (mandatory: False) 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} (mandatory: True) c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf cache:rev-branch-cache -- {} (mandatory: False) gzip-v2 % test bundle type none-v2 searching for changes 1 changesets found HG20\x00\x00 (esc) Stream params: {} changegroup -- {nbchanges: 1, version: 02} (mandatory: True) c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf cache:rev-branch-cache -- {} (mandatory: False) 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} (mandatory: True) c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf cache:rev-branch-cache -- {} (mandatory: False) 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=468 $ 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=475 $ hg --config experimental.bundlecomplevel.gzip=1 --config experimental.bundlelevel=9 bundle -a -t gzip-v2 gzip-v2-level1.hg 1 changesets found $ f --size gzip-v2-level1.hg gzip-v2-level1.hg: size=475 $ 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} (mandatory: True) c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf cache:rev-branch-cache -- {} (mandatory: False) 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} (mandatory: True) c35a0f9217e65d1fdb90c936ffa7dbe679f83ddf cache:rev-branch-cache -- {} (mandatory: False) 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-5.3.1/tests/test-exchange-obsmarkers-case-A4.t0000644015407300116100000001042313627755405023020 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)'` 1 new obsolescence markers $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'` 1 new obsolescence markers 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 (2 drafts) (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-5.3.1/tests/test-no-symlinks.t0000644015407300116100000000235313627755405020203 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 (2 drafts) (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-5.3.1/tests/test-remotefilelog-gc.t0000644015407300116100000000732513627755405021150 0ustar augieeng00000000000000#require no-windows $ . "$TESTDIR/remotefilelog-library.sh" $ hg init master $ cd master $ cat >> .hg/hgrc < [remotefilelog] > server=True > serverexpiration=-1 > EOF $ echo x > x $ hg commit -qAm x $ cd .. $ hgcloneshallow ssh://user@dummy/master shallow -q 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) # Set the prefetchdays config to zero so that all commits are prefetched # no matter what their creation date is. $ cd shallow $ cat >> .hg/hgrc < [remotefilelog] > prefetchdays=0 > EOF $ cd .. # commit a new version of x so we can gc the old one $ cd master $ echo y > x $ hg commit -qAm y $ cd .. $ cd shallow $ hg pull -q $ hg update -q 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) $ cd .. # gc client cache $ lastweek=`$PYTHON -c 'import datetime,time; print(datetime.datetime.fromtimestamp(time.time() - (86400 * 7)).strftime("%y%m%d%H%M"))'` $ find $CACHEDIR -type f -exec touch -t $lastweek {} \; $ find $CACHEDIR -type f | sort $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0 (glob) $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/48023ec064c1d522f0d792a5a912bb1bf7859a4a (glob) $TESTTMP/hgcache/repos (glob) $ hg gc finished: removed 1 of 2 files (0.00 GB to 0.00 GB) $ find $CACHEDIR -type f | sort $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/48023ec064c1d522f0d792a5a912bb1bf7859a4a (glob) $TESTTMP/hgcache/repos # gc server cache $ find master/.hg/remotefilelogcache -type f | sort master/.hg/remotefilelogcache/x/1406e74118627694268417491f018a4a883152f0 (glob) master/.hg/remotefilelogcache/x/48023ec064c1d522f0d792a5a912bb1bf7859a4a (glob) $ hg gc master finished: removed 0 of 1 files (0.00 GB to 0.00 GB) $ find master/.hg/remotefilelogcache -type f | sort master/.hg/remotefilelogcache/x/48023ec064c1d522f0d792a5a912bb1bf7859a4a (glob) # Test that GC keepset includes pullprefetch revset if it is configured $ cd shallow $ cat >> .hg/hgrc < [remotefilelog] > pullprefetch=all() > EOF $ hg prefetch 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) $ cd .. $ hg gc finished: removed 0 of 2 files (0.00 GB to 0.00 GB) # Ensure that there are 2 versions of the file in cache $ find $CACHEDIR -type f | sort $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0 (glob) $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/48023ec064c1d522f0d792a5a912bb1bf7859a4a (glob) $TESTTMP/hgcache/repos (glob) # Test that if garbage collection on repack and repack on hg gc flags are set then incremental repack with garbage collector is run $ hg gc --config remotefilelog.gcrepack=True --config remotefilelog.repackonhggc=True # Ensure that loose files are repacked $ find $CACHEDIR -type f | sort $TESTTMP/hgcache/master/packs/320dab99b7e3f60512b97f347689625263d22cf5.dataidx $TESTTMP/hgcache/master/packs/320dab99b7e3f60512b97f347689625263d22cf5.datapack $TESTTMP/hgcache/master/packs/837b83c1ef6485a336eb4421ac5973c0ec130fbb.histidx $TESTTMP/hgcache/master/packs/837b83c1ef6485a336eb4421ac5973c0ec130fbb.histpack $TESTTMP/hgcache/repos # Test that warning is displayed when there are no valid repos in repofile $ cp $CACHEDIR/repos $CACHEDIR/repos.bak $ echo " " > $CACHEDIR/repos $ hg gc warning: no valid repos in repofile $ mv $CACHEDIR/repos.bak $CACHEDIR/repos # Test that warning is displayed when the repo path is malformed $ printf "asdas\0das" >> $CACHEDIR/repos $ hg gc abort: invalid path asdas\x00da: .*(null|NULL).* (re) [255] mercurial-5.3.1/tests/test-hgweb-bundle.t0000644015407300116100000000142413627755405020261 0ustar augieeng00000000000000#require serve repobundlerepo $ 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-5.3.1/tests/svn/0000755015407300116100000000000013627755445015365 5ustar augieeng00000000000000mercurial-5.3.1/tests/svn/svndump-startrev.sh0000755015407300116100000000133413627755405021265 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-5.3.1/tests/svn/svndump-tags.sh0000755015407300116100000000225413627755405020353 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-5.3.1/tests/svn/branches.svndump0000644015407300116100000001306613627755405020572 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-5.3.1/tests/svn/encoding.svndump0000644015407300116100000000666213627755405020577 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-5.3.1/tests/svn/startrev.svndump0000644015407300116100000000545713627755405020664 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-5.3.1/tests/svn/svndump-branches.sh0000755015407300116100000000272113627755405021201 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-5.3.1/tests/svn/svndump-encoding.sh0000755015407300116100000000203713627755405021202 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-5.3.1/tests/svn/empty.svndump0000644015407300116100000000302413627755405020134 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-5.3.1/tests/svn/svndump-replace.sh0000755015407300116100000000273013627755405021027 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-5.3.1/tests/svn/move.svndump0000644015407300116100000001704313627755405017752 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-5.3.1/tests/svn/tags.svndump0000644015407300116100000001064613627755405017744 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-5.3.1/tests/svn/svndump-move.sh0000755015407300116100000000441413627755405020363 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-5.3.1/tests/svn/replace.svndump0000644015407300116100000001177713627755405020427 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-5.3.1/tests/svn/svndump-empty.sh0000755015407300116100000000154213627755405020552 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-5.3.1/tests/test-largefiles.t0000644015407300116100000014625513627755405020047 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 --no-dates 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 --no-dates 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(b'.', b'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 (4 drafts) 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 checked 8 changesets with 24 changes to 10 files 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 (2 drafts) 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 (6 drafts) (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 changesets 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 (6 drafts) 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 (1 drafts) 0 largefiles cached 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 $ [ -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 (1 drafts) (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 forgetting .hglf/sub2/large8 reverting normal3 undeleting .hglf/sub2/large6 $ 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 checked 10 changesets with 28 changes to 10 files 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 checked 10 changesets with 28 changes to 10 files 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 (8 drafts) 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 (2 drafts) (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 you can keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928. what do you want to do? 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 (9 drafts) 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 (1 drafts) $ 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) $ hg revert new-largefile $ hg --config ui.large-file-limit=22M add --normal new-largefile 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-5.3.1/tests/test-commit-interactive.t0000644015407300116100000011677313627755405021537 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 abort: empty commit message [255] $ 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 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 > EOF diff --git a/empty-rw b/empty-rw new file mode 100644 $ 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'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [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 @@ -0,0 +1,10 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 record this change to 'plain'? (enter ? for help) [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 @@ -8,3 +8,4 @@ 7 8 9 10 +11 record this change to 'plain'? (enter ? for help) [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 @@ -9,3 +9,4 @@ 8 9 10 11 +7264f99c5f5ff3261504828afa4fb4d406c3af54 \ No newline at end of file record this change to 'plain'? (enter ? for help) [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: > NO_CHECK_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: > NO_CHECK_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'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [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 @@ -9,4 +9,4 @@ 8 9 10 11 -7264f99c5f5ff3261504828afa4fb4d406c3af54 \ No newline at end of file +7264f99c5f5ff3261504828afa4fb4d406c3af54 record change 1/2 to 'plain'? (enter ? for help) [Ynesfdaq?] y diff --git a/plain2 b/plain2 new file mode 100644 @@ -0,0 +1,1 @@ +1 record change 2/2 to 'plain2'? (enter ? for help) [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 @@ -1,4 +1,4 @@ -1 +2 2 3 4 record change 1/3 to 'plain'? (enter ? for help) [Ynesfdaq?] y @@ -8,5 +8,3 @@ 7 8 9 10 -11 -7264f99c5f5ff3261504828afa4fb4d406c3af54 record change 2/3 to 'plain'? (enter ? for help) [Ynesfdaq?] y diff --git a/plain2 b/plain2 1 hunks, 1 lines changed @@ -1,1 +1,2 @@ 1 +2 record change 3/3 to 'plain2'? (enter ? for help) [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 < n > y > EOF diff --git a/plain b/plain 2 hunks, 4 lines changed @@ -1,9 +1,6 @@ -2 -2 -3 4 5 6 7 8 9 record change 1/2 to 'plain'? (enter ? for help) [Ynesfdaq?] n @@ -4,7 +1,7 @@ 4 5 6 7 8 9 -10 +10.new record change 2/2 to 'plain'? (enter ? for help) [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 @@ -1,6 +1,3 @@ -2 -2 -3 4 5 6 record this change to 'plain'? (enter ? for help) [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< n > y > EOF diff --git a/plain b/plain 2 hunks, 4 lines changed @@ -1,6 +1,9 @@ +1 +2 +3 4 5 6 7 8 9 record change 1/2 to 'plain'? (enter ? for help) [Ynesfdaq?] n @@ -1,7 +4,6 @@ 4 5 6 7 8 9 -10.new record change 2/2 to 'plain'? (enter ? for help) [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 > n > EOF diff --git a/plain b/plain 3 hunks, 7 lines changed @@ -1,2 +1,5 @@ +1 +2 +3 4 5 record change 1/3 to 'plain'? (enter ? for help) [Ynesfdaq?] y @@ -1,6 +4,8 @@ 4 5 +5.new +5.reallynew 6 7 8 9 record change 2/3 to 'plain'? (enter ? for help) [Ynesfdaq?] y @@ -3,4 +8,6 @@ 6 7 8 9 +10 +11 record change 3/3 to 'plain'? (enter ? for help) [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 @@ -9,3 +9,5 @@ 6 7 8 9 +10 +11 record this change to 'plain'? (enter ? for help) [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 Interactive commit can name a directory instead of files (issue6131) $ mkdir subdir $ echo a > subdir/a $ hg ci -d '16 0' -i subdir -Amsubdir < y > y > EOF adding subdir/a diff --git a/subdir/a b/subdir/a new file mode 100644 examine changes to 'subdir/a'? (enter ? for help) [Ynesfdaq?] y @@ -0,0 +1,1 @@ +a record this change to 'subdir/a'? (enter ? for help) [Ynesfdaq?] y $ cd subdir $ 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 @@ -1,1 +1,2 @@ a +a record this change to 'subdir/a'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] q abort: user quit [255] Patterns $ hg commit -i 'glob:f*' << EOF > y > n > y > n > EOF diff --git a/subdir/f1 b/subdir/f1 1 hunks, 1 lines changed examine changes to 'subdir/f1'? (enter ? for help) [Ynesfdaq?] y @@ -1,1 +1,2 @@ a +a record change 1/2 to 'subdir/f1'? (enter ? for help) [Ynesfdaq?] n diff --git a/subdir/f2 b/subdir/f2 1 hunks, 1 lines changed examine changes to 'subdir/f2'? (enter ? for help) [Ynesfdaq?] y @@ -1,1 +1,2 @@ b +b record change 2/2 to 'subdir/f2'? (enter ? for help) [Ynesfdaq?] n no changes to record [1] #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 > from mercurial import ( > pycompat, > ) > from mercurial.utils import ( > procutil, > ) > def escape(c): > o = ord(c) > if o < 0x80: > return c > else: > return br'\x%02x' % o # escape char setting MSB > for l in procutil.stdin: > procutil.stdout.write( > b''.join(escape(c) for c in pycompat.iterbytestr(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'? (enter ? for help) [Ynesfdaq?] s diff --git a/subdir/f2 b/subdir/f2 1 hunks, 1 lines changed examine changes to 'subdir/f2'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] n diff --git a/subdir/f2 b/subdir/f2 1 hunks, 1 lines changed examine changes to 'subdir/f2'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] f diff --git a/subdir/f2 b/subdir/f2 1 hunks, 1 lines changed examine changes to 'subdir/f2'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] s diff --git a/subdir/f2 b/subdir/f2 1 hunks, 1 lines changed examine changes to 'subdir/f2'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] y @@ -1,2 +1,3 @@ a a +a record this change to 'subdir/f1'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] y @@ -1,3 +1,4 @@ a a a +b record this change to 'subdir/f1'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] y @@ -2,3 +2,4 @@ a a a b +c record this change to 'subdir/f1'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] y @@ -1,2 +1,3 @@ a a +a record this change to 'subdir/f1'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] y @@ -1,3 +1,4 @@ a a a +b record this change to 'subdir/f1'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] y @@ -2,3 +2,4 @@ a a a b +c record this change to 'subdir/f1'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] e cannot edit patch for whole file examine changes to 'editedfile'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] e editor exited with exit code 1 record this change to 'editedfile'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] y @@ -3,3 +3,4 @@ a a b c +d record this change to 'subdir/f1'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] y @@ -4,3 +4,4 @@ a b c d +e record this change to 'subdir/f1'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] y @@ -11,3 +11,4 @@ 8 9 10 11 +somechange record this change to 'plain3'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] y @@ -0,0 +1,1 @@ +foo record this change to 'folder/bar'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] y @@ -1,6 +1,6 @@ -a +A a a b c d record change 1/2 to 'subdir/f1'? (enter ? for help) [Ynesfdaq?] y @@ -2,6 +2,6 @@ a a b c d -e +E record change 2/2 to 'subdir/f1'? (enter ? for help) [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 Test commands.commit.interactive.unified=0 $ hg init $TESTTMP/b $ cd $TESTTMP/b $ cat > foo < 1 > 2 > 3 > 4 > 5 > EOF $ hg ci -qAm initial $ cat > foo < 1 > change1 > 2 > 3 > change2 > 4 > 5 > EOF $ printf 'y\ny\ny\n' | hg ci -im initial --config commands.commit.interactive.unified=0 diff --git a/foo b/foo 2 hunks, 2 lines changed examine changes to 'foo'? (enter ? for help) [Ynesfdaq?] y @@ -1,0 +2,1 @@ 1 +change1 record change 1/2 to 'foo'? (enter ? for help) [Ynesfdaq?] y @@ -3,0 +5,1 @@ 3 +change2 record change 2/2 to 'foo'? (enter ? for help) [Ynesfdaq?] y $ cd $TESTTMP Test diff.ignoreblanklines=1 $ hg init c $ cd c $ cat > foo < 1 > 2 > 3 > 4 > 5 > EOF $ hg ci -qAm initial $ cat > foo < 1 > > 2 > 3 > change2 > 4 > 5 > EOF $ printf 'y\ny\ny\n' | hg ci -im initial --config diff.ignoreblanklines=1 diff --git a/foo b/foo 2 hunks, 2 lines changed examine changes to 'foo'? (enter ? for help) [Ynesfdaq?] y @@ -1,3 +1,4 @@ 1 + 2 3 record change 1/2 to 'foo'? (enter ? for help) [Ynesfdaq?] y @@ -2,4 +3,5 @@ 2 3 +change2 4 5 record change 2/2 to 'foo'? (enter ? for help) [Ynesfdaq?] y mercurial-5.3.1/tests/test-subrepo-recursion.t0000644015407300116100000006205213627755405021410 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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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) linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 12\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 13\r (no-eol) (esc) (reposimplestore !) \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) linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 12\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 13\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 14\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 15\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 16\r (no-eol) (esc) (reposimplestore !) \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) linking [ <=> ] 7\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 8\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !) \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 with missing local subrepos (i.e. it was never updated from null) works because the default path is copied from the source repo, whereas clone should fail. $ hg --config progress.disable=True clone -U ../empty ../empty2 $ hg --config extensions.share= --config progress.disable=True \ > share ../empty2 ../empty_share updating working directory sharing subrepo foo from $TESTTMP/empty/foo sharing subrepo foo/bar from $TESTTMP/empty/foo/bar 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg --config progress.disable=True clone ../empty2 ../empty_clone updating to branch default cloning subrepo foo from $TESTTMP/empty2/foo 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-5.3.1/tests/test-push-checkheads-unpushed-D5.t0000644015407300116100000000602713627755405023060 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 (2 drafts) (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)"` 1 new obsolescence markers obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` 1 new obsolescence markers 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-5.3.1/tests/test-issue586.t0000644015407300116100000000374713627755405017323 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-5.3.1/tests/test-http-permissions.t0000644015407300116100000010714313627755405021253 0ustar augieeng00000000000000 $ cat > fakeremoteuser.py << EOF > import os > from mercurial.hgweb import hgweb_mod > from mercurial import wireprotov1server > 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 > > @wireprotov1server.wireprotocommand(b'customreadnoperm') > def customread(repo, proto): > return b'read-only command no defined permissions\n' > @wireprotov1server.wireprotocommand(b'customwritenoperm') > def customwritenoperm(repo, proto): > return b'write command no defined permissions\n' > @wireprotov1server.wireprotocommand(b'customreadwithperm', permission=b'pull') > def customreadwithperm(repo, proto): > return b'read-only command w/ defined permissions\n' > @wireprotov1server.wireprotocommand(b'customwritewithperm', permission=b'push') > 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-5.3.1/tests/test-hgweb-removed.t0000644015407300116100000001602013627755405020447 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-5.3.1/tests/test-merge-default.t0000644015407300116100000001134413627755405020441 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, specify rev with -r) [255] Should succeed (we're specifying commands.merge.require-rev=True just to test that it allows merge to succeed if we specify a revision): $ hg merge 2 --config commands.merge.require-rev=True 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": "f25cbe84d8b320e298e7703f18a25a3959518c23+2d95304fed5d89bc9d70b2a0d02f0d567469c3ab+", "node": "ffffffffffffffffffffffffffffffffffffffff", "parents": ["f25cbe84d8b320e298e7703f18a25a3959518c23", "2d95304fed5d89bc9d70b2a0d02f0d567469c3ab"], "tags": ["tip"] } ] $ hg commit -mm1 Should fail because we didn't specify a revision (even though it would have succeeded without this): $ hg merge --config commands.merge.require-rev=True abort: configuration requires specifying revision to merge with [255] 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": "1846eede8b6886d8cc8a88c96a687b7fe8f3b9d1", "node": "1846eede8b6886d8cc8a88c96a687b7fe8f3b9d1", "tags": [] } ] Should fail because we didn't specify a revision (even though it would have failed without this due to being on tip, but this check comes first): $ hg merge --config commands.merge.require-rev=True abort: configuration requires specifying revision to merge with [255] 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, specify rev with -r) [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, specify rev with -r) [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, specify rev with -r) [255] mercurial-5.3.1/tests/test-subrepo-relative-path.t0000644015407300116100000001552113627755405022143 0ustar augieeng00000000000000Preparing 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://user:pass@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://user@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 Ensure that subrepos pay attention to default:pushurl $ cat > cloned/.hg/hgrc << EOF > [paths] > default:pushurl = http://user:pass@localhost:$HGPORT/main > EOF $ hg -R cloned out -S --config paths.default=bogus://invalid comparing with http://user:***@localhost:$HGPORT/main searching for changes no changes found comparing with http://user:***@localhost:$HGPORT/sub searching for changes no changes found [1] TODO: Figure out why, if the password is left out of the default:pushurl URL, this says "no changes made to subrepo sub since last push". It looks like from the original clone command above, the password is getting stripped off, not just masked out, and that would make the hashed URL different. $ hg -R cloned push --config paths.default=bogus://invalid pushing to http://user:***@localhost:$HGPORT/main pushing subrepo sub to http://user:***@localhost:$HGPORT/sub searching for changes no changes found searching for changes no changes found abort: HTTP Error 403: ssl required [255] 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-5.3.1/tests/test-rebase-bookmarks.t0000644015407300116100000001262013627755405021145 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-5.3.1/tests/revnamesext.py0000644015407300116100000000110013627755405017456 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 = {b'r%d' % rev: repo[rev].node() for rev in repo} namemap = lambda r, name: names.get(name) nodemap = lambda r, node: [b'r%d' % repo[node].rev()] ns = namespaces.namespace( b'revnames', templatename=b'revname', logname=b'revname', listnames=lambda r: names.keys(), namemap=namemap, nodemap=nodemap, ) repo.names.addnamespace(ns) mercurial-5.3.1/tests/test-cappedreader.py0000644015407300116100000000512213627755405020521 0ustar augieeng00000000000000from __future__ import absolute_import, print_function import io import unittest from mercurial import util class CappedReaderTests(unittest.TestCase): def testreadfull(self): source = io.BytesIO(b'x' * 100) reader = util.cappedreader(source, 10) res = reader.read(10) self.assertEqual(res, b'x' * 10) self.assertEqual(source.tell(), 10) source.seek(0) reader = util.cappedreader(source, 15) res = reader.read(16) self.assertEqual(res, b'x' * 15) self.assertEqual(source.tell(), 15) source.seek(0) reader = util.cappedreader(source, 100) res = reader.read(100) self.assertEqual(res, b'x' * 100) self.assertEqual(source.tell(), 100) source.seek(0) reader = util.cappedreader(source, 50) res = reader.read() self.assertEqual(res, b'x' * 50) self.assertEqual(source.tell(), 50) source.seek(0) def testreadnegative(self): source = io.BytesIO(b'x' * 100) reader = util.cappedreader(source, 20) res = reader.read(-1) self.assertEqual(res, b'x' * 20) self.assertEqual(source.tell(), 20) source.seek(0) reader = util.cappedreader(source, 100) res = reader.read(-1) self.assertEqual(res, b'x' * 100) self.assertEqual(source.tell(), 100) source.seek(0) def testreadmultiple(self): source = io.BytesIO(b'x' * 100) reader = util.cappedreader(source, 10) for i in range(10): res = reader.read(1) self.assertEqual(res, b'x') self.assertEqual(source.tell(), i + 1) self.assertEqual(source.tell(), 10) res = reader.read(1) self.assertEqual(res, b'') self.assertEqual(source.tell(), 10) source.seek(0) reader = util.cappedreader(source, 45) for i in range(4): res = reader.read(10) self.assertEqual(res, b'x' * 10) self.assertEqual(source.tell(), (i + 1) * 10) res = reader.read(10) self.assertEqual(res, b'x' * 5) self.assertEqual(source.tell(), 45) def readlimitpasteof(self): source = io.BytesIO(b'x' * 100) reader = util.cappedreader(source, 1024) res = reader.read(1000) self.assertEqual(res, b'x' * 100) self.assertEqual(source.tell(), 100) res = reader.read(1000) self.assertEqual(res, b'') self.assertEqual(source.tell(), 100) if __name__ == '__main__': import silenttestrunner silenttestrunner.main(__name__) mercurial-5.3.1/tests/test-schemes.t0000644015407300116100000000271413627755405017350 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 (sent 2 HTTP requests and * bytes; received * bytes in responses) (glob) [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-5.3.1/tests/common-pattern.py0000644015407300116100000001542113627755405020073 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'rev-branch-cache%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'rev-branch-cache%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%0A' br'rev-branch-cache', # (replacement patterns) br'$USUAL_BUNDLE2_CAPS_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'pushkey%0A' br'remote-changegroup%3Dhttp%2Chttps%0A' br'rev-branch-cache%0A' br'stream%3Dv2', # (replacement patterns) br'$USUAL_BUNDLE2_CAPS_NO_PHASES$', ), # HTTP access log dates ( br' - - \[\d\d/.../2\d\d\d \d\d:\d\d:\d\d] "(GET|PUT|POST)', lambda m: br' - - [$LOGDATE$] "' + m.group(1), ), # HTTP error log dates ( br' - - \[\d\d/.../2\d\d\d \d\d:\d\d:\d\d] (HG error:|Exception)', lambda m: br' - - [$ERRDATE$] ' + m.group(1), ), # HTTP header dates- RFC 1123 ( br'([Dd]ate): [A-Za-z]{3}, \d\d [A-Za-z]{3} \d{4} \d\d:\d\d:\d\d GMT', lambda m: br'%s: $HTTP_DATE$' % m.group(1), ), # LFS expiration value ( br'"expires_at": "\d{4}-\d\d-\d\dT\d\d:\d\d:\d\dZ"', br'"expires_at": "$ISO_8601_DATE_TIME$"', ), # 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$': ( # IOError in Python does not have the same error message # than in Rust, and automatic conversion is not possible # because of module member privacy. br'No such file or directory \(os error 2\)', # 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', ), br'$EADDRNOTAVAIL$': ( # strerror() br'Cannot assign requested address', # FormatMessage(WSAEADDRNOTAVAIL) ), } 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-5.3.1/tests/test-import-merge.t0000644015407300116100000001060213627755405020323 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(b"".join(open("out", 'rb').readlines()[7:])) and None $ 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 checked 2 changesets with 2 changes to 1 files mercurial-5.3.1/tests/test-convert-bzr-directories.t0000644015407300116100000001052213627755405022502 0ustar augieeng00000000000000#require bzr $ . "$TESTDIR/bzr-definitions" Work around https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=944379 $ mkdir -p "${HOME}/.config/breezy" 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-5.3.1/tests/test-eol-add.t0000644015407300116100000000462713627755405017233 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-5.3.1/tests/test-convert-bzr-merges.t0000644015407300116100000001734313627755405021460 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 $ echo text > rename_me $ bzr add -q file rename_me $ bzr commit -q -m 'Initial add' '--commit-time=2009-10-10 08:00:00 +0100' $ 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' '--commit-time=2009-10-10 08:00:01 +0100' $ cd ../source $ sleep 1 $ echo content > file-parent $ bzr add -q file-parent $ bzr commit -q -m 'Added parent file' '--commit-time=2009-10-10 08:00:02 +0100' $ cd .. $ bzr branch -q source source-branch2 $ cd source-branch2 $ echo somecontent > file-branch2 $ bzr add -q file-branch2 $ bzr mv -q rename_me renamed $ echo change > renamed $ bzr commit -q -m 'Added brach2 file' '--commit-time=2009-10-10 08:00:03 +0100' $ sleep 1 $ cd ../source $ bzr merge -q ../source-branch1 $ bzr merge -q --force ../source-branch2 $ bzr commit -q -m 'Merged branches' '--commit-time=2009-10-10 08:00:04 +0100' $ cd .. BUG: file-branch2 should not be added in rev 4, and the rename_me -> renamed move should be recorded in the fixup merge. $ hg convert --datesort --config convert.bzr.saverev=False 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 warning: can't find ancestor for 'renamed' copied from 'rename_me'! $ glog -R source-hg o 5@source "(octopus merge fixup)" files+: [], files-: [], files: [renamed] |\ | o 4@source "Merged branches" files+: [file-branch2 renamed], files-: [rename_me], files: [] | |\ o---+ 3@source-branch2 "Added brach2 file" files+: [file-branch2 renamed], files-: [rename_me], files: [] / / | o 2@source "Added parent file" files+: [file-parent], files-: [], files: [] | | o | 1@source-branch1 "Added branch1 file" files+: [file-branch1], files-: [], files: [file] |/ o 0@source "Initial add" files+: [file rename_me], files-: [], files: [] $ manifest source-hg tip % manifest of tip 644 file 644 file-branch1 644 file-branch2 644 file-parent 644 renamed $ hg convert source-hg hg2hg initializing destination hg2hg repository scanning source... sorting... converting... 5 Initial add 4 Added branch1 file 3 Added parent file 2 Added brach2 file 1 Merged branches 0 (octopus merge fixup) BUG: The manifest entries should be the same for matching revisions, and nothing should be outgoing $ hg -R source-hg manifest --debug -r tip | grep renamed 67109fdebf6c556eb0a9d5696dd98c8420520405 644 renamed $ hg -R hg2hg manifest --debug -r tip | grep renamed 27c968376d7c3afd095ecb9c7697919b933448c8 644 renamed $ hg -R source-hg manifest --debug -r 'tip^' | grep renamed 27c968376d7c3afd095ecb9c7697919b933448c8 644 renamed $ hg -R hg2hg manifest --debug -r 'tip^' | grep renamed 27c968376d7c3afd095ecb9c7697919b933448c8 644 renamed BUG: The revisions found should be the same in both repos $ hg --cwd source-hg log -r 'file("renamed")' -G -Tcompact o 5[tip]:4,3 6652429c300a 2009-10-10 08:00 +0100 foo |\ (octopus merge fixup) | | | o 4:2,1 e0ae8af3503a 2009-10-10 08:00 +0100 foo | |\ Merged branches | ~ ~ o 3 138bed2e14be 2009-10-10 08:00 +0100 foo | Added brach2 file ~ $ hg --cwd hg2hg log -r 'file("renamed")' -G -Tcompact o 4:2,1 e0ae8af3503a 2009-10-10 08:00 +0100 foo |\ Merged branches ~ ~ o 3 138bed2e14be 2009-10-10 08:00 +0100 foo | Added brach2 file ~ BUG(?): The move seems to be recorded in rev 4, so it should probably show up there. It's not recorded as a move in rev 5, even in source-hg. $ hg -R source-hg up -q tip $ hg -R hg2hg up -q tip $ hg --cwd source-hg log -r 'follow("renamed")' -G -Tcompact @ 5[tip]:4,3 6652429c300a 2009-10-10 08:00 +0100 foo |\ (octopus merge fixup) | : o : 3 138bed2e14be 2009-10-10 08:00 +0100 foo :/ Added brach2 file : o 0 18b86f5df51b 2009-10-10 08:00 +0100 foo Initial add $ hg --cwd hg2hg log -r 'follow("renamed")' -G -Tcompact o 3 138bed2e14be 2009-10-10 08:00 +0100 foo : Added brach2 file : o 0 18b86f5df51b 2009-10-10 08:00 +0100 foo Initial add $ hg -R hg2hg out source-hg -T compact comparing with source-hg searching for changes 5[tip]:4,3 3be2299ccd31 2009-10-10 08:00 +0100 foo (octopus merge fixup) $ glog -R hg2hg @ 5@source "(octopus merge fixup)" files+: [], files-: [], files: [] |\ | o 4@source "Merged branches" files+: [file-branch2 renamed], files-: [rename_me], files: [] | |\ o---+ 3@source-branch2 "Added brach2 file" files+: [file-branch2 renamed], files-: [rename_me], files: [] / / | o 2@source "Added parent file" files+: [file-parent], files-: [], files: [] | | o | 1@source-branch1 "Added branch1 file" files+: [file-branch1], files-: [], files: [file] |/ o 0@source "Initial add" files+: [file rename_me], files-: [], files: [] $ hg -R source-hg log --debug -r tip changeset: 5:6652429c300ab66fdeaf2e730945676a00b53231 branch: source tag: tip phase: draft parent: 4:e0ae8af3503af9bbffb0b29268a02744cc61a561 parent: 3:138bed2e14be415a2692b02e41405b2864f758b4 manifest: 5:1eabd5f5d4b985784cf2c45c717ff053eca14b0d user: Foo Bar date: Sat Oct 10 08:00:04 2009 +0100 files: renamed extra: branch=source description: (octopus merge fixup) $ hg -R hg2hg log --debug -r tip changeset: 5:3be2299ccd315ff9aab2b49bdb0d14e3244435e8 branch: source tag: tip phase: draft parent: 4:e0ae8af3503af9bbffb0b29268a02744cc61a561 parent: 3:138bed2e14be415a2692b02e41405b2864f758b4 manifest: 4:3ece3c7f2cc6df15b3cbbf3273c69869fc7c3ab0 user: Foo Bar date: Sat Oct 10 08:00:04 2009 +0100 extra: branch=source description: (octopus merge fixup) $ hg -R source-hg manifest --debug -r tip cdf31ed9242b209cd94697112160e2c5b37a667d 644 file 5108144f585149b29779d7c7e51d61dd22303ffe 644 file-branch1 80753c4a9ac3806858405b96b24a907b309e3616 644 file-branch2 7108421418404a937c684d2479a34a24d2ce4757 644 file-parent 67109fdebf6c556eb0a9d5696dd98c8420520405 644 renamed $ hg -R source-hg manifest --debug -r 'tip^' cdf31ed9242b209cd94697112160e2c5b37a667d 644 file 5108144f585149b29779d7c7e51d61dd22303ffe 644 file-branch1 80753c4a9ac3806858405b96b24a907b309e3616 644 file-branch2 7108421418404a937c684d2479a34a24d2ce4757 644 file-parent 27c968376d7c3afd095ecb9c7697919b933448c8 644 renamed $ hg -R hg2hg manifest --debug -r tip cdf31ed9242b209cd94697112160e2c5b37a667d 644 file 5108144f585149b29779d7c7e51d61dd22303ffe 644 file-branch1 80753c4a9ac3806858405b96b24a907b309e3616 644 file-branch2 7108421418404a937c684d2479a34a24d2ce4757 644 file-parent 27c968376d7c3afd095ecb9c7697919b933448c8 644 renamed $ hg -R hg2hg manifest --debug -r 'tip^' cdf31ed9242b209cd94697112160e2c5b37a667d 644 file 5108144f585149b29779d7c7e51d61dd22303ffe 644 file-branch1 80753c4a9ac3806858405b96b24a907b309e3616 644 file-branch2 7108421418404a937c684d2479a34a24d2ce4757 644 file-parent 27c968376d7c3afd095ecb9c7697919b933448c8 644 renamed $ cd .. mercurial-5.3.1/tests/test-flags.t0000644015407300116100000000733613627755405017022 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 1 local changesets published (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 linkrev nodeid p1 p2 0 0 b80de5d13875 000000000000 000000000000 $ hg debugindex -R ../test2 a rev linkrev nodeid p1 p2 0 0 b80de5d13875 000000000000 000000000000 $ hg debugindex -R ../test1 a rev linkrev nodeid p1 p2 0 0 b80de5d13875 000000000000 000000000000 1 1 7fe919cc0336 b80de5d13875 000000000000 $ cd .. mercurial-5.3.1/tests/test-check-pyflakes.t0000644015407300116100000000171413627755405020611 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 \ > -X mercurial/thirdparty/cbor \ > -X mercurial/thirdparty/concurrent \ > -X mercurial/thirdparty/zope \ > 2>/dev/null \ > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py" contrib/perf.py:*: undefined name 'xrange' (glob) (?) mercurial/hgweb/server.py:*: undefined name 'reload' (glob) (?) mercurial/util.py:*: undefined name 'file' (glob) (?) mercurial/encoding.py:*: undefined name 'localstr' (glob) (?) mercurial-5.3.1/tests/filtertraceback.py0000755015407300116100000000107013627755405020253 0ustar augieeng00000000000000#!/usr/bin/env python # Filters traceback lines from stdin. from __future__ import absolute_import, print_function import sys state = 'none' for line in sys.stdin: if state == 'none': if line.startswith('Traceback '): state = 'tb' elif state == 'tb': if line.startswith(' File '): state = 'file' continue elif not line.startswith(' '): state = 'none' elif state == 'file': # Ignore lines after " File " state = 'tb' continue print(line, end='') mercurial-5.3.1/tests/crashgetbundler.py0000644015407300116100000000043713627755405020305 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-5.3.1/tests/test-hgweb-no-path-info.t0000644015407300116100000000766113627755405021320 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 import ( > hgweb, > 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') > sys.stdout.flush() > 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): > try: > stdout = sys.stdout.buffer > except AttributeError: > stdout = sys.stdout > content = app(env, startrsp) > stdout.write(output.getvalue()) > stdout.write(b''.join(content)) > stdout.flush() > getattr(content, 'close', lambda : None)() > if errors.getvalue(): > print('---- ERRORS') > print(errors.getvalue()) > sys.stdout.flush() > > output = stringio() > env['QUERY_STRING'] = 'style=atom' > process(hgweb.hgweb(b'.', name=b'repo')) > > output = stringio() > env['QUERY_STRING'] = 'style=raw' > process(hgweb.hgwebdir({b'repo': b'.'})) > 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
---- STATUS 200 Script output follows ---- HEADERS [('Content-Type', 'text/plain; charset=ascii')] ---- DATA /repo/ $ cd .. mercurial-5.3.1/tests/test-sshserver.py0000644015407300116100000000306513627755405020132 0ustar augieeng00000000000000from __future__ import absolute_import, print_function import io import unittest import silenttestrunner from mercurial import ( wireprotoserver, wireprotov1server, ) from mercurial.utils import procutil class SSHServerGetArgsTests(unittest.TestCase): def testparseknown(self): tests = [ (b'* 0\nnodes 0\n', [b'', {}]), ( b'* 0\nnodes 40\n1111111111111111111111111111111111111111\n', [b'1111111111111111111111111111111111111111', {}], ), ] for input, expected in tests: self.assertparse(b'known', input, expected) def assertparse(self, cmd, input, expected): server = mockserver(input) proto = wireprotoserver.sshv1protocolhandler( server._ui, server._fin, server._fout ) _func, spec = wireprotov1server.commands[cmd] self.assertEqual(proto.getargs(spec), expected) def mockserver(inbytes): ui = mockui(inbytes) repo = mockrepo(ui) return wireprotoserver.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() def protectfinout(self): return self.fin, self.fout def restorefinout(self, fin, fout): pass if __name__ == '__main__': # Don't call into msvcrt to set BytesIO to binary mode procutil.setbinary = lambda fp: True silenttestrunner.main(__name__) mercurial-5.3.1/tests/test-merge-symlinks.t0000644015407300116100000000311513627755405020663 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 unbundle "$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-5.3.1/tests/test-revert-interactive.t0000644015407300116100000002217613627755405021547 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(b"1\n2\n3\n4\n5\n") and None $ 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(b"a\n1\n2\n3\n4\n5\nb\n") and None $ hg commit -m "modifying f" >>> open('folder1/g', 'wb').write(b"c\n1\n2\n3\n4\n5\nd\n") and None $ hg commit -m "modifying folder1/g" >>> open('folder2/h', 'wb').write(b"e\n1\n2\n3\n4\n5\nf\n") and None $ 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 remove added file folder1/i (Yn)? y removing folder1/i diff --git a/f b/f 2 hunks, 2 lines changed examine changes to 'f'? (enter ? for help) [Ynesfdaq?] y @@ -1,6 +1,5 @@ -a 1 2 3 4 5 apply change 1/6 to 'f'? (enter ? for help) [Ynesfdaq?] y @@ -2,6 +1,5 @@ 1 2 3 4 5 -b apply change 2/6 to 'f'? (enter ? for help) [Ynesfdaq?] y diff --git a/folder1/g b/folder1/g 2 hunks, 2 lines changed examine changes to 'folder1/g'? (enter ? for help) [Ynesfdaq?] y @@ -1,6 +1,5 @@ -c 1 2 3 4 5 apply change 3/6 to 'folder1/g'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] y @@ -2,6 +1,5 @@ 1 2 3 4 5 -d apply change 4/6 to 'folder1/g'? (enter ? for help) [Ynesfdaq?] n diff --git a/folder2/h b/folder2/h 2 hunks, 2 lines changed examine changes to 'folder2/h'? (enter ? for help) [Ynesfdaq?] n reverting f reverting folder1/g $ 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 diff --git a/folder1/g b/folder1/g 1 hunks, 1 lines changed examine changes to 'folder1/g'? (enter ? for help) [Ynesfdaq?] q abort: user quit [255] $ ls folder1/ g Test that a noop revert doesn't do an unnecessary backup $ (echo n) | hg revert -i -r 2 folder1/g diff --git a/folder1/g b/folder1/g 1 hunks, 1 lines changed @@ -3,4 +3,3 @@ 3 4 5 -d apply this change to 'folder1/g'? (enter ? for help) [Ynesfdaq?] n $ ls folder1/ g Test --no-backup $ (echo y) | hg revert -i -C -r 2 folder1/g diff --git a/folder1/g b/folder1/g 1 hunks, 1 lines changed @@ -3,4 +3,3 @@ 3 4 5 -d apply this change to 'folder1/g'? (enter ? for help) [Ynesfdaq?] y $ ls folder1/ g >>> open('folder1/g', 'wb').write(b"1\n2\n3\n4\n5\nd\n") and None $ 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 remove added file folder1/i (Yn)? n diff --git a/f b/f 2 hunks, 2 lines changed examine changes to 'f'? (enter ? for help) [Ynesfdaq?] y @@ -1,6 +1,5 @@ -a 1 2 3 4 5 apply change 1/6 to 'f'? (enter ? for help) [Ynesfdaq?] y @@ -2,6 +1,5 @@ 1 2 3 4 5 -b apply change 2/6 to 'f'? (enter ? for help) [Ynesfdaq?] y diff --git a/folder1/g b/folder1/g 2 hunks, 2 lines changed examine changes to 'folder1/g'? (enter ? for help) [Ynesfdaq?] y @@ -1,6 +1,5 @@ -c 1 2 3 4 5 apply change 3/6 to 'folder1/g'? (enter ? for help) [Ynesfdaq?] y @@ -2,6 +1,5 @@ 1 2 3 4 5 -d apply change 4/6 to 'folder1/g'? (enter ? for help) [Ynesfdaq?] n diff --git a/folder2/h b/folder2/h 2 hunks, 2 lines changed examine changes to 'folder2/h'? (enter ? for help) [Ynesfdaq?] n reverting f reverting folder1/g $ 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 > n > n > EOF diff --git a/f b/f 2 hunks, 2 lines changed @@ -1,6 +1,5 @@ -a 1 2 3 4 5 discard change 1/2 to 'f'? (enter ? for help) [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'? (enter ? for help) [Ynesfdaq?] y @@ -2,6 +1,5 @@ 1 2 3 4 5 -b discard change 2/2 to 'f'? (enter ? for help) [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 Patterns $ hg revert -i 'glob:f*' << EOF > y > n > EOF diff --git a/f b/f 1 hunks, 1 lines changed examine changes to 'f'? (enter ? for help) [Ynesfdaq?] y @@ -4,4 +4,3 @@ 3 4 5 -b discard this change to 'f'? (enter ? for help) [Ynesfdaq?] n $ 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 diff --git a/k b/k 1 hunks, 2 lines changed examine changes to 'k'? (enter ? for help) [Ynesfdaq?] y @@ -1,1 +1,2 @@ -1 +0 +2 discard this change to 'k'? (enter ? for help) [Ynesfdaq?] e reverting k $ 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 forget added file newfile (Yn)? n $ hg status A newfile $ hg revert -i < y > EOF forget added file newfile (Yn)? y forgetting newfile $ 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 diff --git a/a b/a 1 hunks, 1 lines changed examine changes to 'a'? (enter ? for help) [Ynesfdaq?] y @@ -1,2 +1,1 @@ 0 -1 \ No newline at end of file apply this change to 'a'? (enter ? for help) [Ynesfdaq?] y reverting a $ cat a 0 When specified pattern does not exist, we should exit early (issue5789). $ hg files a $ hg rev b b: no such file in rev b40d1912accf $ hg rev -i b b: no such file in rev b40d1912accf $ cd .. Prompt before undeleting file(issue6008) $ hg init repo $ cd repo $ echo a > a $ hg ci -qAm a $ hg rm a $ hg revert -i< y > EOF add back removed file a (Yn)? y undeleting a $ ls a $ hg rm a $ hg revert -i< n > EOF add back removed file a (Yn)? n $ ls $ hg revert -a undeleting a $ cd .. Test "keep" mode $ cat <> $HGRCPATH > [experimental] > revert.interactive.select-to-keep = true > EOF $ cd repo $ printf "x\na\ny\n" > a $ hg diff diff -r cb9a9f314b8b 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 @@ +x a +y $ cat > $TESTTMP/editor.sh << '__EOF__' > echo "+new line" >> "$1" > __EOF__ $ HGEDITOR="\"sh\" \"${TESTTMP}/editor.sh\"" hg revert -i < y > n > e > EOF diff --git a/a b/a 2 hunks, 2 lines changed examine changes to 'a'? (enter ? for help) [Ynesfdaq?] y @@ -1,1 +1,2 @@ +x a keep change 1/2 to 'a'? (enter ? for help) [Ynesfdaq?] n @@ -1,1 +2,2 @@ a +y keep change 2/2 to 'a'? (enter ? for help) [Ynesfdaq?] e reverting a $ cat a a y new line mercurial-5.3.1/tests/test-largefiles-update.t0000644015407300116100000005742613627755405021330 0ustar augieeng00000000000000#require no-reposimplestore This file focuses mainly on updating largefiles in the working directory (and ".hg/largefiles/dirstate") $ cat >> $HGRCPATH < [ui] > merge = internal:merge > [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 you can keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5. what do you want to do? 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 you can keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5. what do you want to do? 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 you can keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b. what do you want to do? 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 you can keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b. what do you want to do? 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 --no-dates | 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 --no-dates | 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 (3 drafts) 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 you can keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b. what do you want to do? 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 (3 drafts) 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 you can keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b. what do you want to do? 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) you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination]. what do you want to do? m subrepository sources for sub differ (in checked out version) you can use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9). what do you want to do? 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 you can keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b. what do you want to do? 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 you can keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5. what do you want to do? 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" file '.hglf/large1' was deleted in other [source] but was modified in local [dest]. You can use (c)hanged version, (d)elete, or leave (u)nresolved. What do you want to do? 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-5.3.1/tests/httpserverauth.py0000644015407300116100000000750713627755405020226 0ustar augieeng00000000000000from __future__ import absolute_import import base64 import hashlib from mercurial.hgweb import common from mercurial import node def parse_keqv_list(req, l): """Parse list of key=value strings where keys are not duplicated.""" parsed = {} for elt in l: k, v = elt.split(b'=', 1) if v[0:1] == b'"' and v[-1:] == b'"': v = v[1:-1] parsed[k] = v return parsed class digestauthserver(object): def __init__(self): self._user_hashes = {} def gethashers(self): def _md5sum(x): m = hashlib.md5() m.update(x) return node.hex(m.digest()) h = _md5sum kd = lambda s, d, h=h: h(b"%s:%s" % (s, d)) return h, kd def adduser(self, user, password, realm): h, kd = self.gethashers() a1 = h(b'%s:%s:%s' % (user, realm, password)) self._user_hashes[(user, realm)] = a1 def makechallenge(self, realm): # We aren't testing the protocol here, just that the bytes make the # proper round trip. So hardcoded seems fine. nonce = b'064af982c5b571cea6450d8eda91c20d' return b'realm="%s", nonce="%s", algorithm=MD5, qop="auth"' % ( realm, nonce, ) def checkauth(self, req, header): log = req.rawenv[b'wsgi.errors'] h, kd = self.gethashers() resp = parse_keqv_list(req, header.split(b', ')) if resp.get(b'algorithm', b'MD5').upper() != b'MD5': log.write(b'Unsupported algorithm: %s' % resp.get(b'algorithm')) raise common.ErrorResponse( common.HTTP_FORBIDDEN, b"unknown algorithm" ) user = resp[b'username'] realm = resp[b'realm'] nonce = resp[b'nonce'] ha1 = self._user_hashes.get((user, realm)) if not ha1: log.write(b'No hash found for user/realm "%s/%s"' % (user, realm)) raise common.ErrorResponse(common.HTTP_FORBIDDEN, b"bad user") qop = resp.get(b'qop', b'auth') if qop != b'auth': log.write(b"Unsupported qop: %s" % qop) raise common.ErrorResponse(common.HTTP_FORBIDDEN, b"bad qop") cnonce, ncvalue = resp.get(b'cnonce'), resp.get(b'nc') if not cnonce or not ncvalue: log.write(b'No cnonce (%s) or ncvalue (%s)' % (cnonce, ncvalue)) raise common.ErrorResponse(common.HTTP_FORBIDDEN, b"no cnonce") a2 = b'%s:%s' % (req.method, resp[b'uri']) noncebit = b"%s:%s:%s:%s:%s" % (nonce, ncvalue, cnonce, qop, h(a2)) respdig = kd(ha1, noncebit) if respdig != resp[b'response']: log.write( b'User/realm "%s/%s" gave %s, but expected %s' % (user, realm, resp[b'response'], respdig) ) return False return True digest = digestauthserver() def perform_authentication(hgweb, req, op): auth = req.headers.get(b'Authorization') if req.headers.get(b'X-HgTest-AuthType') == b'Digest': if not auth: challenge = digest.makechallenge(b'mercurial') raise common.ErrorResponse( common.HTTP_UNAUTHORIZED, b'who', [(b'WWW-Authenticate', b'Digest %s' % challenge)], ) if not digest.checkauth(req, auth[7:]): raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no') return if not auth: raise common.ErrorResponse( common.HTTP_UNAUTHORIZED, b'who', [(b'WWW-Authenticate', b'Basic Realm="mercurial"')], ) if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', b'pass']: raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no') def extsetup(ui): common.permhooks.insert(0, perform_authentication) digest.adduser(b'user', b'pass', b'mercurial') mercurial-5.3.1/tests/test-drawdag.t0000644015407300116100000001057513627755405017336 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-5.3.1/tests/test-exchange-obsmarkers-case-C1.t0000644015407300116100000001433613627755405023026 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-5.3.1/tests/test-debugbuilddag.t0000644015407300116100000001254013627755405020501 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-5.3.1/tests/test-fastannotate-perfhack.t0000644015407300116100000000662113627755405022172 0ustar augieeng00000000000000 $ cat >> $HGRCPATH << EOF > [extensions] > fastannotate= > [fastannotate] > perfhack=1 > EOF $ hg init repo $ cd repo a simple merge case $ echo 1 > a $ hg commit -qAm 'append 1' $ echo 2 >> a $ hg commit -m 'append 2' $ echo 3 >> a $ hg commit -m 'append 3' $ hg up 1 -q $ cat > a << EOF > 0 > 1 > 2 > EOF $ hg commit -qm 'insert 0' $ hg merge 2 -q $ echo 4 >> a $ hg commit -m merge $ hg log -G -T '{rev}: {desc}' @ 4: merge |\ | o 3: insert 0 | | o | 2: append 3 |/ o 1: append 2 | o 0: append 1 $ hg fastannotate a 3: 0 0: 1 1: 2 2: 3 4: 4 $ hg fastannotate -r 0 a 0: 1 $ hg fastannotate -r 1 a 0: 1 1: 2 $ hg fastannotate -udnclf a test 3 d641cb51f61e Thu Jan 01 00:00:00 1970 +0000 a:1: 0 test 0 4994017376d3 Thu Jan 01 00:00:00 1970 +0000 a:1: 1 test 1 e940cb6d9a06 Thu Jan 01 00:00:00 1970 +0000 a:2: 2 test 2 26162a884ba6 Thu Jan 01 00:00:00 1970 +0000 a:3: 3 test 4 3ad7bcd2815f Thu Jan 01 00:00:00 1970 +0000 a:5: 4 $ hg fastannotate --linear a 3: 0 0: 1 1: 2 4: 3 4: 4 incrementally updating $ hg fastannotate -r 0 a --debug fastannotate: a: using fast path (resolved fctx: True) 0: 1 $ hg fastannotate -r 0 a --debug --rebuild fastannotate: a: 1 new changesets in the main branch 0: 1 $ hg fastannotate -r 1 a --debug fastannotate: a: 1 new changesets in the main branch 0: 1 1: 2 $ hg fastannotate -r 3 a --debug fastannotate: a: 1 new changesets in the main branch 3: 0 0: 1 1: 2 $ hg fastannotate -r 4 a --debug fastannotate: a: 1 new changesets in the main branch 3: 0 0: 1 1: 2 2: 3 4: 4 $ hg fastannotate -r 1 a --debug fastannotate: a: using fast path (resolved fctx: True) 0: 1 1: 2 rebuild happens automatically if unable to update $ hg fastannotate -r 2 a --debug fastannotate: a: cache broken and deleted fastannotate: a: 3 new changesets in the main branch 0: 1 1: 2 2: 3 config option "fastannotate.mainbranch" $ hg fastannotate -r 1 --rebuild --config fastannotate.mainbranch=tip a --debug fastannotate: a: 4 new changesets in the main branch 0: 1 1: 2 $ hg fastannotate -r 4 a --debug fastannotate: a: using fast path (resolved fctx: True) 3: 0 0: 1 1: 2 2: 3 4: 4 rename $ hg mv a b $ cat > b << EOF > 0 > 11 > 3 > 44 > EOF $ hg commit -m b -q $ hg fastannotate -ncf --long-hash b 3 d641cb51f61e331c44654104301f8154d7865c89 a: 0 5 d44dade239915bc82b91e4556b1257323f8e5824 b: 11 2 26162a884ba60e8c87bf4e0d6bb8efcc6f711a4e a: 3 5 d44dade239915bc82b91e4556b1257323f8e5824 b: 44 $ hg fastannotate -r 26162a884ba60e8c87bf4e0d6bb8efcc6f711a4e a 0: 1 1: 2 2: 3 fastannotate --deleted $ hg fastannotate --deleted -nf b 3 a: 0 5 b: 11 0 a: -1 1 a: -2 2 a: 3 5 b: 44 4 a: -4 $ hg fastannotate --deleted -r 3 -nf a 3 a: 0 0 a: 1 1 a: 2 file and directories with ".l", ".m" suffixes $ cd .. $ hg init repo2 $ cd repo2 $ mkdir a.l b.m c.lock a.l.hg b.hg $ for i in a b c d d.l d.m a.l/a b.m/a c.lock/a a.l.hg/a b.hg/a; do > echo $i > $i > done $ hg add . -q $ hg commit -m init $ hg fastannotate a.l/a b.m/a c.lock/a a.l.hg/a b.hg/a d.l d.m a b c d 0: a 0: a.l.hg/a 0: a.l/a 0: b 0: b.hg/a 0: b.m/a 0: c 0: c.lock/a 0: d 0: d.l 0: d.m empty file $ touch empty $ hg commit -A empty -m empty $ hg fastannotate empty mercurial-5.3.1/tests/test-convert-splicemap.t0000644015407300116100000001462713627755405021362 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-5.3.1/tests/test-remotefilelog-sparse.t0000644015407300116100000000512013627755405022043 0ustar augieeng00000000000000#require no-windows $ . "$TESTDIR/remotefilelog-library.sh" $ hg init master $ cd master $ cat >> .hg/hgrc < [remotefilelog] > server=True > EOF $ echo x > x $ echo z > z $ hg commit -qAm x1 $ echo x2 > x $ echo z2 > z $ hg commit -qAm x2 $ hg bookmark foo $ cd .. # prefetch a revision w/ a sparse checkout $ hgcloneshallow ssh://user@dummy/master shallow --noupdate streaming all changes 2 files to transfer, 527 bytes of data transferred 527 bytes in 0.* seconds (*/sec) (glob) searching for changes no changes found $ cd shallow $ printf "[extensions]\nsparse=\n" >> .hg/hgrc $ hg debugsparse -I x $ hg prefetch -r 0 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) $ hg cat -r 0 x x $ hg debugsparse -I z $ hg prefetch -r 0 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) $ hg cat -r 0 z z # prefetch sparse only on pull when configured $ printf "[remotefilelog]\npullprefetch=bookmark()\n" >> .hg/hgrc $ hg strip tip saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/876b1317060d-b2e91d8d-backup.hg (glob) $ hg debugsparse --delete z $ clearcache $ hg pull pulling from ssh://user@dummy/master searching for changes adding changesets adding manifests adding file changes updating bookmark foo added 1 changesets with 0 changes to 0 files new changesets 876b1317060d (run 'hg update' to get a working copy) prefetching file contents 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) # Dont consider filtered files when doing copy tracing ## Push an unrelated commit $ cd ../ $ hgcloneshallow ssh://user@dummy/master shallow2 streaming all changes 2 files to transfer, 527 bytes of data transferred 527 bytes in 0.* seconds (*) (glob) searching for changes no changes found updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) $ cd shallow2 $ printf "[extensions]\nsparse=\n" >> .hg/hgrc $ hg up -q 0 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) $ touch a $ hg ci -Aqm a $ hg push -q -f ## Pull the unrelated commit and rebase onto it - verify unrelated file was not pulled $ cd ../shallow $ hg up -q 1 $ hg pull -q $ hg debugsparse -I z $ clearcache $ hg prefetch -r '. + .^' -I x -I z 4 files fetched over 1 fetches - (4 misses, 0.00% hit ratio) over * (glob) $ hg rebase -d 2 --keep rebasing 1:876b1317060d "x2" (foo) mercurial-5.3.1/tests/test-rebase-obsolete.t0000644015407300116100000014717013627755405021002 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 > strip= > 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 (8 drafts) (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: not rebasing 1:42ccdea3bb16 "B", its destination already has all its changes rebasing 2:5fddd98957c8 "C" rebasing 3:32af7686d403 "D" note: not rebasing 3:32af7686d403 "D", its destination already has all its changes $ 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())' updated to 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', 'fold-id': '6fb65cdc', 'fold-idx': '1', 'fold-size': '3', 'operation': 'rebase', 'user': 'test'} 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'fold-id': '6fb65cdc', 'fold-idx': '2', 'fold-size': '3', 'operation': 'rebase', 'user': 'test'} 32af7686d403cf45b5d95f2d70cebea587ac806a 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'fold-id': '6fb65cdc', 'fold-idx': '3', 'fold-size': '3', '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 $ cd .. $ cp -R hidden stabilize $ cd stabilize $ hg rebase --auto-orphans '0::' -d 10 abort: cannot specify both --auto-orphans and --dest [255] $ hg rebase --auto-orphans '0::' rebasing 9:cf44d2f5a9f4 "D" $ hg log -G o 12:7e3935feaa68 D | o 11:0d8f238b634c C | o 10:7c6027df6a99 B | @ 7:02de42196ebe H | | o 6:eea13746799a G |/| o | 5:24b6387c8c8c F | | | o 4:9520eea781bc E |/ o 0:cd010b8cd998 A $ cd ../hidden $ rm -r ../stabilize 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 (8 drafts) (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 3 files updated, 0 files merged, 1 files removed, 0 files unresolved updated to hidden changeset 4bde274eefcf (hidden revision '4bde274eefcf' was rewritten as: acd174b7ab39) $ echo J > J $ hg add J $ hg commit -m J 1 new orphan changesets $ hg debugobsolete `hg log --rev . -T '{node}'` 1 new obsolescence markers 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)' 0 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to hidden changeset a8b11f55fb19 (hidden revision 'a8b11f55fb19' was rewritten as: 261e70097290) $ 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)' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved updated to hidden changeset a8b11f55fb19 (hidden revision 'a8b11f55fb19' was rewritten as: 261e70097290) $ 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 1 new obsolescence markers 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 1 new obsolescence markers 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 0 files updated, 0 files merged, 1 files removed, 0 files unresolved updated to hidden changeset 121d9e3bc4c6 (hidden revision '121d9e3bc4c6' was rewritten as: 77d874d096a2) $ 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 1 new obsolescence markers 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: $ 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 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 issue5782 $ hg strip -r 0: $ hg debugdrawdag < d > | > c1 c # replace: c -> c1 > \ / > b > | > a > EOF 1 new orphan changesets $ hg debugobsolete `hg log -T "{node}" --hidden -r 'desc("c1")'` 1 new obsolescence markers obsoleted 1 changesets $ hg log -G -r 'a': --hidden * 4:76be324c128b d | | x 3:ef8a456de8fa c1 (pruned) | | x | 2:a82ac2b38757 c (rewritten using replace as 3:ef8a456de8fa) |/ o 1:488e1b7e7341 b | o 0:b173517d0057 a $ hg rebase -d 0 -r 2 rebasing 2:a82ac2b38757 "c" (c) $ hg log -G -r 'a': --hidden o 5:69ad416a4a26 c | | * 4:76be324c128b d | | | | x 3:ef8a456de8fa c1 (pruned) | | | | x | 2:a82ac2b38757 c (rewritten using replace as 3:ef8a456de8fa rewritten using rebase as 5:69ad416a4a26) | |/ | o 1:488e1b7e7341 b |/ 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: not rebasing 5:66f1a38021c9 "F" (F tip), its destination already has all its changes $ 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: not rebasing 5:66f1a38021c9 "F" (F tip), its destination already has all its changes $ 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 extinct node has successor that is not an ancestor of destination $ hg init extinct-with-succ-not-in-dest $ cd extinct-with-succ-not-in-dest $ hg debugdrawdag < E C # replace: C -> E > | | > D B > |/ > A > EOF $ hg rebase -d D -s B rebasing 1:112478962961 "B" (B) note: not rebasing 3:26805aba1e60 "C" (C) and its descendants as this would cause divergence $ cd .. $ hg init p2-succ-in-dest-c $ cd p2-succ-in-dest-c The scenario here was that B::D were developed on default. B was queued on stable, but amended before being push to hg-committed. C was queued on default, along with unrelated J. $ hg debugdrawdag < J > | > F > | > E > | D > | | > | C # replace: C -> F > | | H I # replace: B -> H -> I > | B |/ > |/ G > A > EOF 1 new orphan changesets This strip seems to be the key to avoid an early divergence warning. $ hg --config extensions.strip= --hidden strip -qr H 1 new orphan changesets $ hg rebase -b 'desc("D")' -d 'desc("J")' abort: this rebase will cause divergences from: 112478962961 (to force the rebase please set experimental.evolution.allowdivergence=True) [255] 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 updated to 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 ==================== Test --stop option | ==================== $ cd .. $ hg init rbstop $ cd rbstop $ echo a>a $ hg ci -Aqma $ echo b>b $ hg ci -Aqmb $ echo c>c $ hg ci -Aqmc $ echo d>d $ hg ci -Aqmd $ hg up 0 -q $ echo f>f $ hg ci -Aqmf $ echo D>d $ hg ci -Aqm "conflict with d" $ hg up 3 -q $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" o 5:00bfc9898aeb test | conflict with d | o 4:dafd40200f93 test | f | | @ 3:055a42cdd887 test | | d | | | o 2:177f92b77385 test | | c | | | o 1:d2ae7f538514 test |/ b | o 0:cb9a9f314b8b test a $ hg rebase -s 1 -d 5 rebasing 1:d2ae7f538514 "b" rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" 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 --stop 1 new orphan changesets $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" o 7:7fffad344617 test | c | o 6:b15528633407 test | b | o 5:00bfc9898aeb test | conflict with d | o 4:dafd40200f93 test | f | | @ 3:055a42cdd887 test | | d | | | x 2:177f92b77385 test | | c | | | x 1:d2ae7f538514 test |/ b | o 0:cb9a9f314b8b test a Test it aborts if unstable csets is not allowed: =============================================== $ cat >> $HGRCPATH << EOF > [experimental] > evolution.allowunstable=False > EOF $ hg strip 6 --no-backup -q $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" o 5:00bfc9898aeb test | conflict with d | o 4:dafd40200f93 test | f | | @ 3:055a42cdd887 test | | d | | | o 2:177f92b77385 test | | c | | | o 1:d2ae7f538514 test |/ b | o 0:cb9a9f314b8b test a $ hg rebase -s 1 -d 5 rebasing 1:d2ae7f538514 "b" rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" 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 --stop abort: cannot remove original changesets with unrebased descendants (either enable obsmarkers to allow unstable revisions or use --keep to keep original changesets) [255] $ hg rebase --abort saved backup bundle to $TESTTMP/rbstop/.hg/strip-backup/b15528633407-6eb72b6f-backup.hg rebase aborted Test --stop when --keep is passed: ================================== $ hg rebase -s 1 -d 5 --keep rebasing 1:d2ae7f538514 "b" rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" 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 --stop $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" o 7:7fffad344617 test | c | o 6:b15528633407 test | b | o 5:00bfc9898aeb test | conflict with d | o 4:dafd40200f93 test | f | | @ 3:055a42cdd887 test | | d | | | o 2:177f92b77385 test | | c | | | o 1:d2ae7f538514 test |/ b | o 0:cb9a9f314b8b test a Test --stop aborts when --collapse was passed: ============================================= $ cat >> $HGRCPATH << EOF > [experimental] > evolution.allowunstable=True > EOF $ hg strip 6 saved backup bundle to $TESTTMP/rbstop/.hg/strip-backup/b15528633407-6eb72b6f-backup.hg $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" o 5:00bfc9898aeb test | conflict with d | o 4:dafd40200f93 test | f | | @ 3:055a42cdd887 test | | d | | | o 2:177f92b77385 test | | c | | | o 1:d2ae7f538514 test |/ b | o 0:cb9a9f314b8b test a $ hg rebase -s 1 -d 5 --collapse -m "collapsed b c d" rebasing 1:d2ae7f538514 "b" rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" 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 --stop abort: cannot stop in --collapse session [255] $ hg rebase --abort rebase aborted $ hg diff $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" o 5:00bfc9898aeb test | conflict with d | o 4:dafd40200f93 test | f | | @ 3:055a42cdd887 test | | d | | | o 2:177f92b77385 test | | c | | | o 1:d2ae7f538514 test |/ b | o 0:cb9a9f314b8b test a Test --stop raise errors with conflicting options: ================================================= $ hg rebase -s 3 -d 5 rebasing 3:055a42cdd887 "d" 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 --stop --dry-run abort: cannot specify both --stop and --dry-run [255] $ hg rebase -s 3 -d 5 abort: rebase in progress (use 'hg rebase --continue' or 'hg rebase --abort') [255] $ hg rebase --stop --continue abort: cannot specify both --stop and --continue [255] Test --stop moves bookmarks of original revisions to new rebased nodes: ====================================================================== $ cd .. $ hg init repo $ cd repo $ 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 $ echo d > d $ hg ci -Am D adding d $ hg up 0 -q $ echo e > e $ hg ci -Am E adding e created new head $ echo doubt > d $ hg ci -Am "conflict with d" adding d $ hg log -GT "{rev}: {node|short} '{desc}' bookmarks: {bookmarks}\n" @ 5: 39adf30bc1be 'conflict with d' bookmarks: | o 4: 9c1e55f411b6 'E' bookmarks: | | o 3: 67a385d4e6f2 'D' bookmarks: Z | | | o 2: 49cb3485fa0c 'C' bookmarks: Y | | | o 1: 6c81ed0049f8 'B' bookmarks: X |/ o 0: 1994f17a630e 'A' bookmarks: $ hg rebase -s 1 -d 5 rebasing 1:6c81ed0049f8 "B" (X) rebasing 2:49cb3485fa0c "C" (Y) rebasing 3:67a385d4e6f2 "D" (Z) 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 --stop 1 new orphan changesets $ hg log -GT "{rev}: {node|short} '{desc}' bookmarks: {bookmarks}\n" o 7: 9c86c650b686 'C' bookmarks: Y | o 6: 9b87b54e5fd8 'B' bookmarks: X | @ 5: 39adf30bc1be 'conflict with d' bookmarks: | o 4: 9c1e55f411b6 'E' bookmarks: | | * 3: 67a385d4e6f2 'D' bookmarks: Z | | | x 2: 49cb3485fa0c 'C' bookmarks: | | | x 1: 6c81ed0049f8 'B' bookmarks: |/ o 0: 1994f17a630e 'A' bookmarks: mercurial-5.3.1/tests/test-archive-symlinks.t0000644015407300116100000000123113627755405021202 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-5.3.1/tests/test-gendoc-pt_BR.t0000644015407300116100000000012713627755405020160 0ustar augieeng00000000000000#require docutils gettext $ $TESTDIR/check-gendoc pt_BR checking for parse errors mercurial-5.3.1/tests/test-rebase-rename.t0000644015407300116100000001736113627755405020433 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-5.3.1/tests/test-check-pylint.t0000644015407300116100000000115013627755405020304 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 | sed 's/\r$//' Using config file *fakerc (glob) (?) (?) ------------------------------------ (?) Your code has been rated at 10.00/10 (?) (?) mercurial-5.3.1/tests/test-bookmarks-corner-case.t0000644015407300116100000001513113627755405022105 0ustar augieeng00000000000000================================ Test corner case around bookmark ================================ This test file is meant to gather test around bookmark that are specific enough to not find a place elsewhere. Test bookmark/changelog race condition ====================================== The data from the bookmark file are filtered to only contains bookmark with node known to the changelog. If the cache invalidation between these two bits goes wrong, bookmark can be dropped. global setup ------------ $ cat >> $HGRCPATH << EOF > [ui] > ssh = "$PYTHON" "$TESTDIR/dummyssh" > [server] > concurrent-push-mode=check-related > EOF Setup ----- initial repository setup $ hg init bookrace-server $ cd bookrace-server $ echo a > a $ hg add a $ hg commit -m root $ echo a >> a $ hg bookmark book-A $ hg commit -m A0 $ hg up 'desc(root)' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (leaving bookmark book-A) $ echo b > b $ hg add b $ hg bookmark book-B $ hg commit -m B0 created new head $ hg up null 0 files updated, 0 files merged, 2 files removed, 0 files unresolved (leaving bookmark book-B) $ hg phase --public --rev 'all()' $ hg log -G o changeset: 2:c79985706978 | bookmark: book-B | tag: tip | parent: 0:6569b5a81c7e | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: B0 | | o changeset: 1:39c28d785860 |/ bookmark: book-A | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 0:6569b5a81c7e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: root $ hg book book-A 1:39c28d785860 book-B 2:c79985706978 $ cd .. Add new changeset on each bookmark in distinct clones $ hg clone ssh://user@dummy/bookrace-server client-A requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 2 files (+1 heads) new changesets 6569b5a81c7e:c79985706978 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R client-A update book-A 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (activating bookmark book-A) $ echo a >> client-A/a $ hg -R client-A commit -m A1 $ hg clone ssh://user@dummy/bookrace-server client-B requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 2 files (+1 heads) new changesets 6569b5a81c7e:c79985706978 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -R client-B update book-B 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (activating bookmark book-B) $ echo b >> client-B/b $ hg -R client-B commit -m B1 extension to reproduce the race ------------------------------- If two process are pushing we want to make sure the following happens: * process A read changelog * process B to its full push * process A read bookmarks * process A proceed with rest of the push We build a server side extension for this purpose $ cat > bookrace.py << EOF > import atexit > import os > import time > from mercurial import bookmarks, error, extensions > > def wait(repo): > if not os.path.exists('push-A-started'): > assert repo._currentlock(repo._lockref) is None > assert repo._currentlock(repo._wlockref) is None > repo.ui.status(b'setting raced push up\n') > with open('push-A-started', 'w'): > pass > clock = 300 > while not os.path.exists('push-B-done'): > clock -= 1 > if clock <= 0: > raise error.Abort("race scenario timed out") > time.sleep(0.1) > > def reposetup(ui, repo): > class racedrepo(repo.__class__): > @property > def _bookmarks(self): > wait(self) > return super(racedrepo, self)._bookmarks > repo.__class__ = racedrepo > > def e(): > with open('push-A-done', 'w'): > pass > atexit.register(e) > EOF Actual test ----------- Start the raced push. $ cat >> bookrace-server/.hg/hgrc << EOF > [extensions] > bookrace=$TESTTMP/bookrace.py > EOF $ hg push -R client-A -r book-A >push-output.txt 2>&1 & Wait up to 30 seconds for that push to start. $ clock=30 $ while [ ! -f push-A-started ] && [ $clock -gt 0 ] ; do > clock=`expr $clock - 1` > sleep 1 > done Do the other push. $ cat >> bookrace-server/.hg/hgrc << EOF > [extensions] > bookrace=! > EOF $ hg push -R client-B -r book-B pushing to ssh://user@dummy/bookrace-server searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files updating bookmark book-B Signal the raced put that we are done (it waits up to 30 seconds). $ touch push-B-done Wait for the raced push to finish (with the remaning of the initial 30 seconds). $ while [ ! -f push-A-done ] && [ $clock -gt 0 ] ; do > clock=`expr $clock - 1` > sleep 1 > done Check raced push output. $ cat push-output.txt pushing to ssh://user@dummy/bookrace-server searching for changes remote: setting raced push up remote has heads on branch 'default' that are not known locally: f26c3b5167d1 remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files updating bookmark book-A Check result of the push. $ hg -R bookrace-server log -G o changeset: 4:9ce3b28c16de | bookmark: book-A | tag: tip | parent: 1:39c28d785860 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A1 | | o changeset: 3:f26c3b5167d1 | | bookmark: book-B | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | summary: B1 | | | o changeset: 2:c79985706978 | | parent: 0:6569b5a81c7e | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | summary: B0 | | o | changeset: 1:39c28d785860 |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: A0 | o changeset: 0:6569b5a81c7e user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: root $ hg -R bookrace-server book book-A 4:9ce3b28c16de book-B 3:f26c3b5167d1 mercurial-5.3.1/tests/test-filecache.py.out0000644015407300116100000000212413627755405020612 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-5.3.1/tests/heredoctest.py0000644015407300116100000000121013627755405017430 0ustar augieeng00000000000000from __future__ import absolute_import, print_function import sys def flush(): sys.stdout.flush() sys.stderr.flush() 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: flush() exec(c, globalvars) flush() except Exception as inst: flush() print(repr(inst)) mercurial-5.3.1/tests/test-copies-unrelated.t0000644015407300116100000002440513627755405021165 0ustar augieeng00000000000000#testcases filelog compatibility changeset sidedata $ cat >> $HGRCPATH << EOF > [extensions] > rebase= > [alias] > l = log -G -T '{rev} {desc}\n{files}\n' > EOF #if compatibility $ cat >> $HGRCPATH << EOF > [experimental] > copies.read-from = compatibility > EOF #endif #if changeset $ cat >> $HGRCPATH << EOF > [experimental] > copies.read-from = changeset-only > copies.write-to = changeset-only > EOF #endif #if sidedata $ cat >> $HGRCPATH << EOF > [format] > exp-use-copies-side-data-changeset = yes > EOF #endif $ REPONUM=0 $ newrepo() { > cd $TESTTMP > REPONUM=`expr $REPONUM + 1` > hg init repo-$REPONUM > cd repo-$REPONUM > } Copy a file, then delete destination, then copy again. This does not create a new filelog entry. $ newrepo $ echo x > x $ hg ci -Aqm 'add x' $ echo x2 > x $ hg ci -m 'modify x' $ hg co -q 0 $ hg cp x y $ hg ci -qm 'copy x to y' $ hg rm y $ hg ci -m 'remove y' $ hg cp -f x y $ hg ci -m 'copy x onto y (again)' $ hg l @ 4 copy x onto y (again) | y o 3 remove y | y o 2 copy x to y | y | o 1 modify x |/ x o 0 add x x $ hg debugp1copies -r 4 x -> y $ hg debugpathcopies 0 4 x -> y $ hg graft -r 1 grafting 1:* "modify x" (glob) merging y and x to y $ hg co -qC 1 $ hg graft -r 4 grafting 4:* "copy x onto y (again)" (glob) merging x and y to y Copy x to y, then remove y, then add back y. With copy metadata in the changeset, this could easily end up reporting y as copied from x (if we don't unmark it as a copy when it's removed). Despite x and y not being related, we want grafts to propagate across the rename. $ newrepo $ echo x > x $ hg ci -Aqm 'add x' $ echo x2 > x $ hg ci -m 'modify x' $ hg co -q 0 $ hg mv x y $ hg ci -qm 'rename x to y' $ hg rm y $ hg ci -qm 'remove y' $ echo x > y $ hg ci -Aqm 'add back y' $ hg l @ 4 add back y | y o 3 remove y | y o 2 rename x to y | x y | o 1 modify x |/ x o 0 add x x $ hg debugpathcopies 0 4 BROKEN: This should succeed and merge the changes from x into y $ hg graft -r 1 grafting 1:* "modify x" (glob) file 'x' was deleted in local [local] but was modified in other [graft]. You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved. What do you want to do? u abort: unresolved conflicts, can't continue (use 'hg resolve' and 'hg graft --continue') [255] Add x, remove it, then add it back, then rename x to y. Similar to the case above, but here the break in history is before the rename. $ newrepo $ echo x > x $ hg ci -Aqm 'add x' $ echo x2 > x $ hg ci -m 'modify x' $ hg co -q 0 $ hg rm x $ hg ci -qm 'remove x' $ echo x > x $ hg ci -Aqm 'add x again' $ hg mv x y $ hg ci -m 'rename x to y' $ hg l @ 4 rename x to y | x y o 3 add x again | x o 2 remove x | x | o 1 modify x |/ x o 0 add x x $ hg debugpathcopies 0 4 x -> y $ hg graft -r 1 grafting 1:* "modify x" (glob) merging y and x to y $ hg co -qC 1 $ hg graft -r 4 grafting 4:* "rename x to y" (glob) merging x and y to y Add x, modify it, remove it, then add it back, then rename x to y. Similar to the case above, but here the re-added file's nodeid is different from before the break. $ newrepo $ echo x > x $ hg ci -Aqm 'add x' $ echo x2 > x $ hg ci -m 'modify x' $ echo x3 > x $ hg ci -qm 'modify x again' $ hg co -q 1 $ hg rm x $ hg ci -qm 'remove x' # Same content to avoid conflicts $ hg revert -r 1 x $ hg ci -Aqm 'add x again' $ hg mv x y $ hg ci -m 'rename x to y' $ hg l @ 5 rename x to y | x y o 4 add x again | x o 3 remove x | x | o 2 modify x again |/ x o 1 modify x | x o 0 add x x $ hg debugpathcopies 0 5 x -> y (no-filelog !) #if no-filelog $ hg graft -r 2 grafting 2:* "modify x again" (glob) merging y and x to y #else BROKEN: This should succeed and merge the changes from x into y $ hg graft -r 2 grafting 2:* "modify x again" (glob) file 'x' was deleted in local [local] but was modified in other [graft]. You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved. What do you want to do? u abort: unresolved conflicts, can't continue (use 'hg resolve' and 'hg graft --continue') [255] #endif $ hg co -qC 2 BROKEN: This should succeed and merge the changes from x into y $ hg graft -r 5 grafting 5:* "rename x to y"* (glob) file 'x' was deleted in other [graft] but was modified in local [local]. You can use (c)hanged version, (d)elete, or leave (u)nresolved. What do you want to do? u abort: unresolved conflicts, can't continue (use 'hg resolve' and 'hg graft --continue') [255] Add x, remove it, then add it back, rename x to y from the first commit. Similar to the case above, but here the break in history is parallel to the rename. $ newrepo $ echo x > x $ hg ci -Aqm 'add x' $ hg rm x $ hg ci -qm 'remove x' $ echo x > x $ hg ci -Aqm 'add x again' $ echo x2 > x $ hg ci -m 'modify x' $ hg co -q 0 $ hg mv x y $ hg ci -qm 'rename x to y' $ hg l @ 4 rename x to y | x y | o 3 modify x | | x | o 2 add x again | | x | o 1 remove x |/ x o 0 add x x $ hg debugpathcopies 2 4 x -> y $ hg graft -r 3 grafting 3:* "modify x" (glob) merging y and x to y $ hg co -qC 3 $ hg graft -r 4 grafting 4:* "rename x to y" (glob) merging x and y to y Add x, remove it, then add it back, rename x to y from the first commit. Similar to the case above, but here the re-added file's nodeid is different from the base. $ newrepo $ echo x > x $ hg ci -Aqm 'add x' $ hg rm x $ hg ci -qm 'remove x' $ echo x2 > x $ hg ci -Aqm 'add x again with different content' $ hg co -q 0 $ hg mv x y $ hg ci -qm 'rename x to y' $ hg l @ 3 rename x to y | x y | o 2 add x again with different content | | x | o 1 remove x |/ x o 0 add x x $ hg debugpathcopies 2 3 x -> y BROKEN: This should merge the changes from x into y $ hg graft -r 2 grafting 2:* "add x again with different content" (glob) $ hg co -qC 2 BROKEN: This should succeed and merge the changes from x into y $ hg graft -r 3 grafting 3:* "rename x to y" (glob) file 'x' was deleted in other [graft] but was modified in local [local]. You can use (c)hanged version, (d)elete, or leave (u)nresolved. What do you want to do? u abort: unresolved conflicts, can't continue (use 'hg resolve' and 'hg graft --continue') [255] Add x on two branches, then rename x to y on one side. Similar to the case above, but here the break in history is via the base commit. $ newrepo $ echo a > a $ hg ci -Aqm 'base' $ echo x > x $ hg ci -Aqm 'add x' $ echo x2 > x $ hg ci -m 'modify x' $ hg co -q 0 $ echo x > x $ hg ci -Aqm 'add x again' $ hg mv x y $ hg ci -qm 'rename x to y' $ hg l @ 4 rename x to y | x y o 3 add x again | x | o 2 modify x | | x | o 1 add x |/ x o 0 base a $ hg debugpathcopies 1 4 x -> y $ hg graft -r 2 grafting 2:* "modify x" (glob) merging y and x to y $ hg co -qC 2 $ hg graft -r 4 grafting 4:* "rename x to y"* (glob) merging x and y to y Add x on two branches, with same content but different history, then rename x to y on one side. Similar to the case above, here the file's nodeid is different between the branches. $ newrepo $ echo a > a $ hg ci -Aqm 'base' $ echo x > x $ hg ci -Aqm 'add x' $ echo x2 > x $ hg ci -m 'modify x' $ hg co -q 0 $ touch x $ hg ci -Aqm 'add empty x' # Same content to avoid conflicts $ hg revert -r 1 x $ hg ci -m 'modify x to match commit 1' $ hg mv x y $ hg ci -qm 'rename x to y' $ hg l @ 5 rename x to y | x y o 4 modify x to match commit 1 | x o 3 add empty x | x | o 2 modify x | | x | o 1 add x |/ x o 0 base a $ hg debugpathcopies 1 5 x -> y (no-filelog !) #if no-filelog $ hg graft -r 2 grafting 2:* "modify x" (glob) merging y and x to y #else BROKEN: This should succeed and merge the changes from x into y $ hg graft -r 2 grafting 2:* "modify x" (glob) file 'x' was deleted in local [local] but was modified in other [graft]. You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved. What do you want to do? u abort: unresolved conflicts, can't continue (use 'hg resolve' and 'hg graft --continue') [255] #endif $ hg co -qC 2 BROKEN: This should succeed and merge the changes from x into y $ hg graft -r 5 grafting 5:* "rename x to y"* (glob) file 'x' was deleted in other [graft] but was modified in local [local]. You can use (c)hanged version, (d)elete, or leave (u)nresolved. What do you want to do? u abort: unresolved conflicts, can't continue (use 'hg resolve' and 'hg graft --continue') [255] Copies via null revision (there shouldn't be any) $ newrepo $ echo x > x $ hg ci -Aqm 'add x' $ hg cp x y $ hg ci -m 'copy x to y' $ hg co -q null $ echo x > x $ hg ci -Aqm 'add x (again)' $ hg l @ 2 add x (again) x o 1 copy x to y | y o 0 add x x $ hg debugpathcopies 1 2 $ hg debugpathcopies 2 1 $ hg graft -r 1 grafting 1:* "copy x to y" (glob) Copies involving a merge of multiple roots. $ newrepo $ echo a > a $ hg ci -Aqm 'add a' $ echo a >> a $ hg ci -Aqm 'update a' $ echo a >> a $ hg ci -Aqm 'update a' $ hg up null 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo b > a $ hg ci -Aqm 'add a' $ hg mv a b $ hg ci -Aqm 'move a to b' $ echo b >> b $ hg ci -Aqm 'update b' $ hg merge 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m "merge with other branch" $ echo a >> a $ echo a >> a $ echo b >> b $ hg ci -Aqm 'update a and b' $ hg l @ 7 update a and b | a b o 6 merge with other branch |\ | o 5 update b | | b | o 4 move a to b | | a b | o 3 add a | a | o 2 update a | | a | o 1 update a |/ a o 0 add a a $ hg cat a -r 7 a a a $ hg cat a -r 2 a a a $ hg cat a -r 0 a $ hg debugpathcopies 7 2 $ hg debugpathcopies 2 7 $ hg merge 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) mercurial-5.3.1/tests/test-wireproto-command-changesetdata.t0000644015407300116100000004256413627755405024167 0ustar augieeng00000000000000 $ . $TESTDIR/wireprotohelpers.sh $ hg init server $ enablehttpv2 server $ cd server $ cat >> .hg/hgrc << EOF > [phases] > publish = false > EOF $ echo a0 > a $ echo b0 > b $ hg -q commit -A -m 'commit 0' $ echo a1 > a $ echo b1 > b $ hg commit -m 'commit 1' $ echo b2 > b $ hg commit -m 'commit 2' $ hg phase --public -r . $ hg -q up -r 0 $ echo a2 > a $ hg commit -m 'commit 3' created new head $ hg log -G -T '{rev}:{node} {desc}\n' @ 3:eae5f82c2e622368d27daecb76b7e393d0f24211 commit 3 | | o 2:0bb8ad894a15b15380b2a2a5b183e20f2a4b28dd commit 2 | | | o 1:7592917e1c3e82677cb0a4bc715ca25dd12d28c1 commit 1 |/ o 0:3390ef850073fbc2f0dfff2244342c8e9229013a commit 0 $ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS No arguments is an invalid request $ sendhttpv2peer << EOF > command changesetdata > EOF creating http peer for wire protocol version 2 sending changesetdata command abort: missing required arguments: revisions! [255] Missing nodes for changesetexplicit results in error $ sendhttpv2peer << EOF > command changesetdata > revisions eval:[{b'type': b'changesetexplicit'}] > EOF creating http peer for wire protocol version 2 sending changesetdata command abort: nodes key not present in changesetexplicit revision specifier! [255] changesetexplicitdepth requires nodes and depth keys $ sendhttpv2peer << EOF > command changesetdata > revisions eval:[{b'type': b'changesetexplicitdepth'}] > EOF creating http peer for wire protocol version 2 sending changesetdata command abort: nodes key not present in changesetexplicitdepth revision specifier! [255] $ sendhttpv2peer << EOF > command changesetdata > revisions eval:[{b'type': b'changesetexplicitdepth', b'nodes': []}] > EOF creating http peer for wire protocol version 2 sending changesetdata command abort: depth key not present in changesetexplicitdepth revision specifier! [255] $ sendhttpv2peer << EOF > command changesetdata > revisions eval:[{b'type': b'changesetexplicitdepth', b'depth': 42}] > EOF creating http peer for wire protocol version 2 sending changesetdata command abort: nodes key not present in changesetexplicitdepth revision specifier! [255] changesetdagrange requires roots and heads keys $ sendhttpv2peer << EOF > command changesetdata > revisions eval:[{b'type': b'changesetdagrange'}] > EOF creating http peer for wire protocol version 2 sending changesetdata command abort: roots key not present in changesetdagrange revision specifier! [255] $ sendhttpv2peer << EOF > command changesetdata > revisions eval:[{b'type': b'changesetdagrange', b'roots': []}] > EOF creating http peer for wire protocol version 2 sending changesetdata command abort: heads key not present in changesetdagrange revision specifier! [255] $ sendhttpv2peer << EOF > command changesetdata > revisions eval:[{b'type': b'changesetdagrange', b'heads': [b'dummy']}] > EOF creating http peer for wire protocol version 2 sending changesetdata command abort: roots key not present in changesetdagrange revision specifier! [255] Empty changesetdagrange heads results in an error $ sendhttpv2peer << EOF > command changesetdata > revisions eval:[{b'type': b'changesetdagrange', b'heads': [], b'roots': []}] > EOF creating http peer for wire protocol version 2 sending changesetdata command abort: heads key in changesetdagrange cannot be empty! [255] Sending just dagrange heads sends all revisions $ sendhttpv2peer << EOF > command changesetdata > revisions eval:[{ > b'type': b'changesetdagrange', > b'roots': [], > b'heads': [ > b'\x0b\xb8\xad\x89\x4a\x15\xb1\x53\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f\x2a\x4b\x28\xdd', > b'\xea\xe5\xf8\x2c\x2e\x62\x23\x68\xd2\x7d\xae\xcb\x76\xb7\xe3\x93\xd0\xf2\x42\x11', > ]}] > EOF creating http peer for wire protocol version 2 sending changesetdata command response: gen[ { b'totalitems': 4 }, { b'node': b'3\x90\xef\x85\x00s\xfb\xc2\xf0\xdf\xff"D4,\x8e\x92)\x01:' }, { b'node': b'u\x92\x91~\x1c>\x82g|\xb0\xa4\xbcq\\\xa2]\xd1-(\xc1' }, { b'node': b'\x0b\xb8\xad\x89J\x15\xb1S\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f*K(\xdd' }, { b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11' } ] Sending root nodes limits what data is sent $ sendhttpv2peer << EOF > command changesetdata > revisions eval:[{ > b'type': b'changesetdagrange', > b'roots': [b'\x33\x90\xef\x85\x00\x73\xfb\xc2\xf0\xdf\xff\x22\x44\x34\x2c\x8e\x92\x29\x01\x3a'], > b'heads': [ > b'\x0b\xb8\xad\x89\x4a\x15\xb1\x53\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f\x2a\x4b\x28\xdd', > ]}] > EOF creating http peer for wire protocol version 2 sending changesetdata command response: gen[ { b'totalitems': 2 }, { b'node': b'u\x92\x91~\x1c>\x82g|\xb0\xa4\xbcq\\\xa2]\xd1-(\xc1' }, { b'node': b'\x0b\xb8\xad\x89J\x15\xb1S\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f*K(\xdd' } ] Requesting data on a single node by node works $ sendhttpv2peer << EOF > command changesetdata > revisions eval:[{ > b'type': b'changesetexplicit', > b'nodes': [b'\x33\x90\xef\x85\x00\x73\xfb\xc2\xf0\xdf\xff\x22\x44\x34\x2c\x8e\x92\x29\x01\x3a']}] > EOF creating http peer for wire protocol version 2 sending changesetdata command response: gen[ { b'totalitems': 1 }, { b'node': b'3\x90\xef\x85\x00s\xfb\xc2\xf0\xdf\xff"D4,\x8e\x92)\x01:' } ] Specifying a noderange and nodes takes union $ sendhttpv2peer << EOF > command changesetdata > revisions eval:[ > { > b'type': b'changesetexplicit', > b'nodes': [b'\xea\xe5\xf8\x2c\x2e\x62\x23\x68\xd2\x7d\xae\xcb\x76\xb7\xe3\x93\xd0\xf2\x42\x11'], > }, > { > b'type': b'changesetdagrange', > b'roots': [b'\x75\x92\x91\x7e\x1c\x3e\x82\x67\x7c\xb0\xa4\xbc\x71\x5c\xa2\x5d\xd1\x2d\x28\xc1'], > b'heads': [b'\x0b\xb8\xad\x89\x4a\x15\xb1\x53\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f\x2a\x4b\x28\xdd'], > }] > EOF creating http peer for wire protocol version 2 sending changesetdata command response: gen[ { b'totalitems': 2 }, { b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11' }, { b'node': b'\x0b\xb8\xad\x89J\x15\xb1S\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f*K(\xdd' } ] nodesdepth of 1 limits to exactly requested nodes $ sendhttpv2peer << EOF > command changesetdata > revisions eval:[{ > b'type': b'changesetexplicitdepth', > b'nodes': [b'\xea\xe5\xf8\x2c\x2e\x62\x23\x68\xd2\x7d\xae\xcb\x76\xb7\xe3\x93\xd0\xf2\x42\x11'], > b'depth': 1}] > EOF creating http peer for wire protocol version 2 sending changesetdata command response: gen[ { b'totalitems': 1 }, { b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11' } ] nodesdepth of 2 limits to first ancestor $ sendhttpv2peer << EOF > command changesetdata > revisions eval:[{ > b'type': b'changesetexplicitdepth', > b'nodes': [b'\xea\xe5\xf8\x2c\x2e\x62\x23\x68\xd2\x7d\xae\xcb\x76\xb7\xe3\x93\xd0\xf2\x42\x11'], > b'depth': 2}] > EOF creating http peer for wire protocol version 2 sending changesetdata command response: gen[ { b'totalitems': 2 }, { b'node': b'3\x90\xef\x85\x00s\xfb\xc2\xf0\xdf\xff"D4,\x8e\x92)\x01:' }, { b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11' } ] nodesdepth with multiple nodes $ sendhttpv2peer << EOF > command changesetdata > revisions eval:[{ > b'type': b'changesetexplicitdepth', > b'nodes': [b'\xea\xe5\xf8\x2c\x2e\x62\x23\x68\xd2\x7d\xae\xcb\x76\xb7\xe3\x93\xd0\xf2\x42\x11', b'\x0b\xb8\xad\x89\x4a\x15\xb1\x53\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f\x2a\x4b\x28\xdd'], > b'depth': 2}] > EOF creating http peer for wire protocol version 2 sending changesetdata command response: gen[ { b'totalitems': 4 }, { b'node': b'3\x90\xef\x85\x00s\xfb\xc2\xf0\xdf\xff"D4,\x8e\x92)\x01:' }, { b'node': b'u\x92\x91~\x1c>\x82g|\xb0\xa4\xbcq\\\xa2]\xd1-(\xc1' }, { b'node': b'\x0b\xb8\xad\x89J\x15\xb1S\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f*K(\xdd' }, { b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11' } ] Parents data is transferred upon request $ sendhttpv2peer << EOF > command changesetdata > fields eval:[b'parents'] > revisions eval:[{ > b'type': b'changesetexplicit', > b'nodes': [ > b'\xea\xe5\xf8\x2c\x2e\x62\x23\x68\xd2\x7d\xae\xcb\x76\xb7\xe3\x93\xd0\xf2\x42\x11', > ]}] > EOF creating http peer for wire protocol version 2 sending changesetdata command response: gen[ { b'totalitems': 1 }, { b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11', b'parents': [ b'3\x90\xef\x85\x00s\xfb\xc2\xf0\xdf\xff"D4,\x8e\x92)\x01:', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' ] } ] Phase data is transferred upon request $ sendhttpv2peer << EOF > command changesetdata > fields eval:[b'phase'] > revisions eval:[{ > b'type': b'changesetexplicit', > b'nodes': [ > b'\x0b\xb8\xad\x89\x4a\x15\xb1\x53\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f\x2a\x4b\x28\xdd', > ]}] > EOF creating http peer for wire protocol version 2 sending changesetdata command response: gen[ { b'totalitems': 1 }, { b'node': b'\x0b\xb8\xad\x89J\x15\xb1S\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f*K(\xdd', b'phase': b'public' } ] Revision data is transferred upon request $ sendhttpv2peer << EOF > command changesetdata > fields eval:[b'revision'] > revisions eval:[{ > b'type': b'changesetexplicit', > b'nodes': [ > b'\xea\xe5\xf8\x2c\x2e\x62\x23\x68\xd2\x7d\xae\xcb\x76\xb7\xe3\x93\xd0\xf2\x42\x11', > ]}] > EOF creating http peer for wire protocol version 2 sending changesetdata command response: gen[ { b'totalitems': 1 }, { b'fieldsfollowing': [ [ b'revision', 61 ] ], b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11' }, b'1b74476799ec8318045db759b1b4bcc9b839d0aa\ntest\n0 0\na\n\ncommit 3' ] Bookmarks key isn't present if no bookmarks data $ sendhttpv2peer << EOF > command changesetdata > fields eval:[b'bookmarks'] > revisions eval:[{ > b'type': b'changesetdagrange', > b'roots': [], > b'heads': [ > b'\x0b\xb8\xad\x89\x4a\x15\xb1\x53\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f\x2a\x4b\x28\xdd', > b'\xea\xe5\xf8\x2c\x2e\x62\x23\x68\xd2\x7d\xae\xcb\x76\xb7\xe3\x93\xd0\xf2\x42\x11', > ]}] > EOF creating http peer for wire protocol version 2 sending changesetdata command response: gen[ { b'totalitems': 4 }, { b'node': b'3\x90\xef\x85\x00s\xfb\xc2\xf0\xdf\xff"D4,\x8e\x92)\x01:' }, { b'node': b'u\x92\x91~\x1c>\x82g|\xb0\xa4\xbcq\\\xa2]\xd1-(\xc1' }, { b'node': b'\x0b\xb8\xad\x89J\x15\xb1S\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f*K(\xdd' }, { b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11' } ] Bookmarks are sent when requested $ hg -R ../server bookmark -r 0bb8ad894a15b15380b2a2a5b183e20f2a4b28dd book-1 $ hg -R ../server bookmark -r eae5f82c2e622368d27daecb76b7e393d0f24211 book-2 $ hg -R ../server bookmark -r eae5f82c2e622368d27daecb76b7e393d0f24211 book-3 $ sendhttpv2peer << EOF > command changesetdata > fields eval:[b'bookmarks'] > revisions eval:[{ > b'type': b'changesetdagrange', > b'roots': [], > b'heads': [ > b'\x0b\xb8\xad\x89\x4a\x15\xb1\x53\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f\x2a\x4b\x28\xdd', > b'\xea\xe5\xf8\x2c\x2e\x62\x23\x68\xd2\x7d\xae\xcb\x76\xb7\xe3\x93\xd0\xf2\x42\x11', > ]}] > EOF creating http peer for wire protocol version 2 sending changesetdata command response: gen[ { b'totalitems': 4 }, { b'node': b'3\x90\xef\x85\x00s\xfb\xc2\xf0\xdf\xff"D4,\x8e\x92)\x01:' }, { b'node': b'u\x92\x91~\x1c>\x82g|\xb0\xa4\xbcq\\\xa2]\xd1-(\xc1' }, { b'bookmarks': [ b'book-1' ], b'node': b'\x0b\xb8\xad\x89J\x15\xb1S\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f*K(\xdd' }, { b'bookmarks': [ b'book-2', b'book-3' ], b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11' } ] Bookmarks are sent when we make a no-new-revisions request $ sendhttpv2peer << EOF > command changesetdata > fields eval:[b'bookmarks', b'revision'] > revisions eval:[{ > b'type': b'changesetdagrange', > b'roots': [b'\xea\xe5\xf8\x2c\x2e\x62\x23\x68\xd2\x7d\xae\xcb\x76\xb7\xe3\x93\xd0\xf2\x42\x11'], > b'heads': [ > b'\x0b\xb8\xad\x89\x4a\x15\xb1\x53\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f\x2a\x4b\x28\xdd', > b'\xea\xe5\xf8\x2c\x2e\x62\x23\x68\xd2\x7d\xae\xcb\x76\xb7\xe3\x93\xd0\xf2\x42\x11', > ]}] > EOF creating http peer for wire protocol version 2 sending changesetdata command response: gen[ { b'totalitems': 2 }, { b'fieldsfollowing': [ [ b'revision', 63 ] ], b'node': b'u\x92\x91~\x1c>\x82g|\xb0\xa4\xbcq\\\xa2]\xd1-(\xc1' }, b'7f144aea0ba742713887b564d57e9d12f12ff382\ntest\n0 0\na\nb\n\ncommit 1', { b'bookmarks': [ b'book-1' ], b'fieldsfollowing': [ [ b'revision', 61 ] ], b'node': b'\x0b\xb8\xad\x89J\x15\xb1S\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f*K(\xdd' }, b'37f0a2d1c28ffe4b879109a7d1bbf8f07b3c763b\ntest\n0 0\nb\n\ncommit 2', { b'bookmarks': [ b'book-2', b'book-3' ], b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11' } ] Multiple fields can be transferred $ sendhttpv2peer << EOF > command changesetdata > fields eval:[b'parents', b'revision'] > revisions eval:[{ > b'type': b'changesetexplicit', > b'nodes': [ > b'\xea\xe5\xf8\x2c\x2e\x62\x23\x68\xd2\x7d\xae\xcb\x76\xb7\xe3\x93\xd0\xf2\x42\x11', > ]}] > EOF creating http peer for wire protocol version 2 sending changesetdata command response: gen[ { b'totalitems': 1 }, { b'fieldsfollowing': [ [ b'revision', 61 ] ], b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11', b'parents': [ b'3\x90\xef\x85\x00s\xfb\xc2\xf0\xdf\xff"D4,\x8e\x92)\x01:', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' ] }, b'1b74476799ec8318045db759b1b4bcc9b839d0aa\ntest\n0 0\na\n\ncommit 3' ] Base nodes have just their metadata (e.g. phase) transferred TODO this doesn't work $ sendhttpv2peer << EOF > command changesetdata > fields eval:[b'phase', b'parents', b'revision'] > revisions eval:[{ > b'type': b'changesetdagrange', > b'roots': [b'\x33\x90\xef\x85\x00\x73\xfb\xc2\xf0\xdf\xff\x22\x44\x34\x2c\x8e\x92\x29\x01\x3a'], > b'heads': [ > b'\x0b\xb8\xad\x89\x4a\x15\xb1\x53\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f\x2a\x4b\x28\xdd', > b'\xea\xe5\xf8\x2c\x2e\x62\x23\x68\xd2\x7d\xae\xcb\x76\xb7\xe3\x93\xd0\xf2\x42\x11', > ]}] > EOF creating http peer for wire protocol version 2 sending changesetdata command response: gen[ { b'totalitems': 3 }, { b'fieldsfollowing': [ [ b'revision', 63 ] ], b'node': b'u\x92\x91~\x1c>\x82g|\xb0\xa4\xbcq\\\xa2]\xd1-(\xc1', b'parents': [ b'3\x90\xef\x85\x00s\xfb\xc2\xf0\xdf\xff"D4,\x8e\x92)\x01:', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' ], b'phase': b'public' }, b'7f144aea0ba742713887b564d57e9d12f12ff382\ntest\n0 0\na\nb\n\ncommit 1', { b'fieldsfollowing': [ [ b'revision', 61 ] ], b'node': b'\x0b\xb8\xad\x89J\x15\xb1S\x80\xb2\xa2\xa5\xb1\x83\xe2\x0f*K(\xdd', b'parents': [ b'u\x92\x91~\x1c>\x82g|\xb0\xa4\xbcq\\\xa2]\xd1-(\xc1', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' ], b'phase': b'public' }, b'37f0a2d1c28ffe4b879109a7d1bbf8f07b3c763b\ntest\n0 0\nb\n\ncommit 2', { b'fieldsfollowing': [ [ b'revision', 61 ] ], b'node': b'\xea\xe5\xf8,.b#h\xd2}\xae\xcbv\xb7\xe3\x93\xd0\xf2B\x11', b'parents': [ b'3\x90\xef\x85\x00s\xfb\xc2\xf0\xdf\xff"D4,\x8e\x92)\x01:', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' ], b'phase': b'draft' }, b'1b74476799ec8318045db759b1b4bcc9b839d0aa\ntest\n0 0\na\n\ncommit 3' ] $ cat error.log mercurial-5.3.1/tests/test-extension.t0000644015407300116100000017473213627755405017747 0ustar augieeng00000000000000Test basic extension support $ cat > unflush.py < import sys > from mercurial import pycompat > if pycompat.ispy3: > # no changes required > sys.exit(0) > with open(sys.argv[1], 'rb') as f: > data = f.read() > with open(sys.argv[1], 'wb') as f: > f.write(data.replace(b', flush=True', b'')) > EOF $ cat > foobar.py < import os > from mercurial import commands, exthelper, registrar > > eh = exthelper.exthelper() > eh.configitem(b'tests', b'foo', default=b"Foo") > > uisetup = eh.finaluisetup > uipopulate = eh.finaluipopulate > reposetup = eh.finalreposetup > cmdtable = eh.cmdtable > configtable = eh.configtable > > @eh.uisetup > def _uisetup(ui): > ui.debug(b"uisetup called [debug]\\n") > ui.write(b"uisetup called\\n") > ui.status(b"uisetup called [status]\\n") > ui.flush() > @eh.uipopulate > def _uipopulate(ui): > ui._populatecnt = getattr(ui, "_populatecnt", 0) + 1 > ui.write(b"uipopulate called (%d times)\n" % ui._populatecnt) > @eh.reposetup > def _reposetup(ui, repo): > ui.write(b"reposetup called for %s\\n" % os.path.basename(repo.root)) > ui.write(b"ui %s= repo.ui\\n" % (ui == repo.ui and b"=" or b"!")) > ui.flush() > @eh.command(b'foo', [], b'hg foo') > def foo(ui, *args, **kwargs): > foo = ui.config(b'tests', b'foo') > ui.write(foo) > ui.write(b"\\n") > @eh.command(b'bar', [], b'hg bar', norepo=True) > def bar(ui, *args, **kwargs): > ui.write(b"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 uisetup called [status] uipopulate called (1 times) uipopulate called (1 times) uipopulate called (1 times) reposetup called for a ui == repo.ui uipopulate called (1 times) (chg !) uipopulate called (1 times) (chg !) uipopulate called (1 times) (chg !) uipopulate called (1 times) (chg !) uipopulate called (1 times) (chg !) reposetup called for a (chg !) ui == repo.ui (chg !) Foo $ hg foo --quiet uisetup called (no-chg !) uipopulate called (1 times) uipopulate called (1 times) uipopulate called (1 times) (chg !) uipopulate called (1 times) (chg !) uipopulate called (1 times) reposetup called for a ui == repo.ui Foo $ hg foo --debug uisetup called [debug] (no-chg !) uisetup called (no-chg !) uisetup called [status] (no-chg !) uipopulate called (1 times) uipopulate called (1 times) uipopulate called (1 times) (chg !) uipopulate called (1 times) (chg !) uipopulate called (1 times) reposetup called for a ui == repo.ui Foo $ cd .. $ hg clone a b uisetup called (no-chg !) uisetup called [status] (no-chg !) uipopulate called (1 times) uipopulate called (1 times) (chg !) uipopulate called (1 times) reposetup called for a ui == repo.ui uipopulate called (1 times) 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 !) uisetup called [status] (no-chg !) uipopulate called (1 times) uipopulate called (1 times) (chg !) Bar $ echo 'foobar = !' >> $HGRCPATH module/__init__.py-style $ echo "barfoo = $barfoopath" >> $HGRCPATH $ cd a $ hg foo uisetup called uisetup called [status] uipopulate called (1 times) uipopulate called (1 times) uipopulate called (1 times) reposetup called for a ui == repo.ui uipopulate called (1 times) (chg !) uipopulate called (1 times) (chg !) uipopulate called (1 times) (chg !) uipopulate called (1 times) (chg !) uipopulate called (1 times) (chg !) reposetup called for a (chg !) ui == repo.ui (chg !) Foo $ echo 'barfoo = !' >> $HGRCPATH Check that extensions are loaded in phases: $ cat > foo.py < from __future__ import print_function > import os > from mercurial import exthelper > name = os.path.basename(__file__).rsplit('.', 1)[0] > print("1) %s imported" % name, flush=True) > eh = exthelper.exthelper() > @eh.uisetup > def _uisetup(ui): > print("2) %s uisetup" % name, flush=True) > @eh.extsetup > def _extsetup(ui): > print("3) %s extsetup" % name, flush=True) > @eh.uipopulate > def _uipopulate(ui): > print("4) %s uipopulate" % name, flush=True) > @eh.reposetup > def _reposetup(ui, repo): > print("5) %s reposetup" % name, flush=True) > > extsetup = eh.finalextsetup > reposetup = eh.finalreposetup > uipopulate = eh.finaluipopulate > uisetup = eh.finaluisetup > revsetpredicate = eh.revsetpredicate > > bytesname = name.encode('utf-8') > # custom predicate to check registration of functions at loading > from mercurial import ( > smartset, > ) > @eh.revsetpredicate(bytesname, 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 $ "$PYTHON" $TESTTMP/unflush.py foo.py $ 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 uipopulate 4) bar uipopulate 4) foo uipopulate 4) bar uipopulate 4) foo uipopulate 4) bar uipopulate 5) foo reposetup 5) 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(b'.', b'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 uipopulate 4) bar uipopulate 4) foo uipopulate 4) bar uipopulate 5) foo reposetup 5) 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 (import-checker.py reports issues for some of heredoc python code fragments below, because import-checker.py does not know test specific package hierarchy. NO_CHECK_* should be used as a limit mark of heredoc, in order to make import-checker.py ignore them. For simplicity, all python code fragments below are generated with such limit mark, regardless of importing module or not.) #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, print_function > import ambig # should load "libroot/ambig.py" > s = ambig.s > NO_CHECK_EOF $ cat > loadabs.py < import mod.ambigabs as ambigabs > def extsetup(ui): > print('ambigabs.s=%s' % ambigabs.s, flush=True) > NO_CHECK_EOF $ "$PYTHON" $TESTTMP/unflush.py loadabs.py $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root) ambigabs.s=libroot/ambig.py $TESTTMP/a #if no-py3 $ cat > $TESTTMP/libroot/mod/ambigrel.py < from __future__ import print_function > import ambig # should load "libroot/mod/ambig.py" > s = ambig.s > NO_CHECK_EOF $ cat > loadrel.py < import mod.ambigrel as ambigrel > def extsetup(ui): > print('ambigrel.s=%s' % ambigrel.s, flush=True) > NO_CHECK_EOF $ "$PYTHON" $TESTTMP/unflush.py loadrel.py $ (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 = b'this is extroot.bar' > NO_CHECK_EOF $ mkdir $TESTTMP/extroot/sub1 $ cat > $TESTTMP/extroot/sub1/__init__.py < s = b'this is extroot.sub1.__init__' > NO_CHECK_EOF $ cat > $TESTTMP/extroot/sub1/baz.py < s = b'this is extroot.sub1.baz' > NO_CHECK_EOF $ cat > $TESTTMP/extroot/__init__.py < from __future__ import absolute_import > s = b'this is extroot.__init__' > from . import foo > def extsetup(ui): > ui.write(b'(extroot) ', foo.func(), b'\n') > ui.flush() > NO_CHECK_EOF $ cat > $TESTTMP/extroot/foo.py < # test absolute import > buf = [] > def func(): > # "not locals" case > import extroot.bar > buf.append(b'import extroot.bar in func(): %s' % extroot.bar.s) > return b'\n(extroot) '.join(buf) > # b"fromlist == ('*',)" case > from extroot.bar import * > buf.append(b'from extroot.bar import *: %s' % s) > # "not fromlist" and "if '.' in name" case > import extroot.sub1.baz > buf.append(b'import extroot.sub1.baz: %s' % extroot.sub1.baz.s) > # "not fromlist" and NOT "if '.' in name" case > import extroot > buf.append(b'import extroot: %s' % extroot.s) > # NOT "not fromlist" and NOT "level != -1" case > from extroot.bar import s > buf.append(b'from extroot.bar import s: %s' % s) > NO_CHECK_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-py3 $ 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) > NO_CHECK_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 b"this is extlibroot.lsub1.lsub2.called.func()" > NO_CHECK_EOF $ cat > $TESTTMP/extlibroot/lsub1/lsub2/unused.py < raise Exception("extlibroot.lsub1.lsub2.unused is loaded unintentionally") > NO_CHECK_EOF $ cat > $TESTTMP/extlibroot/lsub1/lsub2/used.py < detail = b"this is extlibroot.lsub1.lsub2.used" > NO_CHECK_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 = b"this is extlibroot.recursedown.abs.used" > NO_CHECK_EOF $ cat > $TESTTMP/extlibroot/recursedown/abs/__init__.py < from __future__ import absolute_import > from extlibroot.recursedown.abs.used import detail > NO_CHECK_EOF $ mkdir -p $TESTTMP/extlibroot/recursedown/legacy $ cat > $TESTTMP/extlibroot/recursedown/legacy/used.py < detail = b"this is extlibroot.recursedown.legacy.used" > NO_CHECK_EOF $ cat > $TESTTMP/extlibroot/recursedown/legacy/__init__.py < # legacy style (level == -1) import > from extlibroot.recursedown.legacy.used import detail > NO_CHECK_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 > NO_CHECK_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 = b"this is extlibroot.shadowing.used" > NO_CHECK_EOF $ cat > $TESTTMP/extlibroot/shadowing/proxied.py < from __future__ import absolute_import > from extlibroot.shadowing.used import detail > NO_CHECK_EOF $ cat > $TESTTMP/extlibroot/shadowing/__init__.py < from __future__ import absolute_import > from .used import detail as used > NO_CHECK_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 b"this is absextroot.xsub1.xsub2.called.func()" > NO_CHECK_EOF $ cat > $TESTTMP/absextroot/xsub1/xsub2/unused.py < raise Exception("absextroot.xsub1.xsub2.unused is loaded unintentionally") > NO_CHECK_EOF $ cat > $TESTTMP/absextroot/xsub1/xsub2/used.py < detail = b"this is absextroot.xsub1.xsub2.used" > NO_CHECK_EOF Setup extension local modules to examine whether demand importing works as expected in "level > 1" case. $ cat > $TESTTMP/absextroot/relimportee.py < detail = b"this is absextroot.relimportee" > NO_CHECK_EOF $ cat > $TESTTMP/absextroot/xsub1/xsub2/relimporter.py < from __future__ import absolute_import > from mercurial import pycompat > from ... import relimportee > detail = b"this relimporter imports %r" % ( > pycompat.bytestr(relimportee.detail)) > NO_CHECK_EOF Setup modules, which actually import extension local modules at runtime. $ cat > $TESTTMP/absextroot/absolute.py << NO_CHECK_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 > NO_CHECK_EOF $ cat > $TESTTMP/absextroot/relative.py << NO_CHECK_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 > NO_CHECK_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(b'ABS: %s\n' % b'\nABS: '.join(absolute.getresult())) > > @command(b'showrelative', [], norepo=True) > def showrelative(ui, *args, **opts): > from . import relative > ui.write(b'REL: %s\n' % b'\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(b'LIB: %s\n' % b'\nLIB: '.join(result)) > NO_CHECK_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' > NO_CHECK_EOF $ cat > $TESTTMP/checkrelativity.py < from mercurial import registrar > cmdtable = {} > command = registrar.command(cmdtable) > > # demand import avoids failure of importing notexist here, but only on > # Python 2. > 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 > NO_CHECK_EOF Python 3's lazy importer verifies modules exist before returning the lazy module stub. Our custom lazy importer for Python 2 always returns a stub. $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.checkrelativity=$TESTTMP/checkrelativity.py checkrelativity) || true *** failed to import extension checkrelativity from $TESTTMP/checkrelativity.py: No module named 'extlibroot.lsub1.lsub2.notexist' (py3 !) hg: unknown command 'checkrelativity' (py3 !) (use 'hg help' for a list of commands) (py3 !) #endif (Here, module importing tests are finished. Therefore, use other than NO_CHECK_* limit mark for heredoc python files, in order to apply import-checker.py or so on their contents) 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: * by zero (glob) *** failed to set up extension baduisetup: * by zero (glob) 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', [], b'hg debugfoobar') > def debugfoobar(ui, repo, *args, **opts): > "yet another debug command" > @command(b'foo', [], b'hg foo') > def foo(ui, repo, *args, **opts): > """yet another foo command > This command has been DEPRECATED since forever. > """ > EOF $ debugpath=`pwd`/debugextension.py $ echo "debugextension = $debugpath" >> $HGRCPATH $ hg help debugextension hg debugextensions show information about active extensions options: -T --template TEMPLATE display with template (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 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 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, unless the --per- file option is specified (see below). To pass additional options to the program, use -o/--option. These will be passed before the names of the directories or files 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. The --per-file option runs the external program repeatedly on each file to diff, instead of once on two directories. By default, this happens one by one, where the next file diff is open in the external program only once the previous external program (for the previous file diff) has exited. If the external program has a graphical interface, it can open all the file diffs at once instead of one by one. See 'hg help -e extdiff' for information about how to tell Mercurial that a given program has a graphical interface. The --confirm option will prompt the user before each invocation of the external program. It is ignored if --per-file isn't specified. (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 --per-file compare each file instead of revision snapshots --confirm prompt user before each external program invocation --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. If there is more than one file being compared and the "child" revision is the working directory, any modifications made in the external diff program will be copied back to the working directory from the temporary directory. 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 If a program has a graphical interface, it might be interesting to tell Mercurial about it. It will prevent the program from being mistakenly used in a terminal-only environment (such as an SSH terminal session), and will make 'hg extdiff --per-file' open multiple file diffs at once instead of one by one (if you still want to open file diffs one by one, you can use the --confirm option). Declaring that a tool has a graphical interface can be done with the "gui" flag next to where "diffargs" are specified: [diff-tools] kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child kdiff3.gui = true 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', [], b'ARG', norepo=True) > def multirevs(ui, repo, arg, *args, **opts): > """multirevs command""" > 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) #if no-extraextensions $ hg debugextensions mq strip #endif 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', [], b'hg dodo') > def dodo(ui, *args, **kwargs): > """Does nothing""" > ui.write(b"I do nothing. Yay\\n") > @command(b'foofoo', [], b'hg foofoo') > def foofoo(ui, *args, **kwargs): > """Writes 'Foo foo'""" > ui.write(b"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', [], b'hg something') > def something(ui, *args, **kwargs): > """Does something""" > ui.write(b"I do something. Yaaay\\n") > @command(b'beep', [], b'hg beep') > def beep(ui, *args, **kwargs): > """Writes 'Beep beep'""" > ui.write(b"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' > NO_CHECK_EOF $ cat > path.py < import os > import 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 > @command() > def f(): > pass > @command(123) > def g(): > pass > EOF $ hg --config extensions.path=./path.py help foo 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', [], b'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:b'2.2'" >> older.py $ echo "testedwith = b'1.9.3'" >> older.py $ echo "testedwith = b'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:b'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:b'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 = b'3.2'" >> throw.py $ echo "util.version = lambda:b'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: b"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 template output: $ hg version --config extensions.strip= -T'{extensions}' strip 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: b'3.5.2' > minimumhgversion = b'3.6' > EOF $ hg --config extensions.minversion=minversion1.py version (third party extension minversion requires version 3.6 or newer of Mercurial (current: 3.5.2); 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: b'3.6' > minimumhgversion = b'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 (current: 3.6); disabling) Can load version that is only off by point release $ cat > minversion2.py << EOF > from mercurial import util > util.version = lambda: b'3.6.1' > minimumhgversion = b'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: b'3.5' > minimumhgversion = b'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(b'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 !) #if no-extraextensions $ hg --cwd src debugextensions reposetup() for $TESTTMP/reposetup-test/src dodo (untested!) dudu (untested!) mq reposetuptest (untested!) strip #endif $ 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 = { > b'deprecatedcmd': (deprecatedcmd, [], b''), > } > 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' (use 'hg help' for a list of commands) [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 = b' GREPME [--foo] [-x]' > docstring = ''' > GREPME make sure that this is in the help! > ''' > extensions.wrapcommand(commands.table, b'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 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 __future__ import print_function > from mercurial import registrar > cmdtable = {} > command = registrar.command(cmdtable) > @command(b'dummy', [(b'', b'opt', u'value', u'help')], 'ext [OPTIONS]') > def ext(*args, **opts): > print(opts[b'opt'], flush=True) > EOF $ "$PYTHON" $TESTTMP/unflush.py $TESTTMP/test_unicode_default_value.py $ 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: unicode *'value' found in cmdtable.dummy (glob) *** (use b'' to make it byte string) hg: unknown command 'dummy' (did you mean summary?) [255] mercurial-5.3.1/tests/test-rebase-inmemory.t0000644015407300116100000004730213627755405021021 0ustar augieeng00000000000000#require symlink execbit $ cat << EOF >> $HGRCPATH > [phases] > publish=False > [extensions] > amend= > rebase= > debugdrawdag=$TESTDIR/drawdag.py > strip= > [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) $ cd .. 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 $ 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 in-memory rebasing 3:753feb6fd12a "c" (tip) $ hg tglog @ 3: 844a7de3e617 'c' | | o 2: 09c044d2cb43 'd' | | | o 1: fc055c3b4d33 'b' |/ o 0: b173517d0057 'a' Test reporting of path conflicts $ hg rm a $ mkdir a $ touch a/a $ hg ci -Am "a/a" adding a/a $ hg tglog @ 4: daf7dfc139cb 'a/a' | o 3: 844a7de3e617 'c' | | o 2: 09c044d2cb43 'd' | | | o 1: fc055c3b4d33 'b' |/ o 0: b173517d0057 'a' $ hg rebase -r . -d 2 rebasing 4:daf7dfc139cb "a/a" (tip) saved backup bundle to $TESTTMP/repo2/.hg/strip-backup/daf7dfc139cb-fdbfcf4f-rebase.hg $ hg tglog @ 4: c6ad37a4f250 'a/a' | | o 3: 844a7de3e617 'c' | | o | 2: 09c044d2cb43 'd' | | o | 1: fc055c3b4d33 'b' |/ o 0: b173517d0057 'a' $ echo foo > foo $ hg ci -Aqm "added foo" $ hg up '.^' 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo bar > bar $ hg ci -Aqm "added bar" $ hg rm a/a $ echo a > a $ hg ci -Aqm "added a back!" $ hg tglog @ 7: 855e9797387e 'added a back!' | o 6: d14530e5e3e6 'added bar' | | o 5: 9b94b9373deb 'added foo' |/ o 4: c6ad37a4f250 'a/a' | | o 3: 844a7de3e617 'c' | | o | 2: 09c044d2cb43 'd' | | o | 1: fc055c3b4d33 'b' |/ o 0: b173517d0057 'a' $ hg rebase -r . -d 5 rebasing 7:855e9797387e "added a back!" (tip) saved backup bundle to $TESTTMP/repo2/.hg/strip-backup/855e9797387e-81ee4c5d-rebase.hg $ hg tglog @ 7: bb3f02be2688 'added a back!' | | o 6: d14530e5e3e6 'added bar' | | o | 5: 9b94b9373deb 'added foo' |/ o 4: c6ad37a4f250 'a/a' | | o 3: 844a7de3e617 'c' | | o | 2: 09c044d2cb43 'd' | | o | 1: fc055c3b4d33 'b' |/ o 0: b173517d0057 'a' $ mkdir -p c/subdir $ echo c > c/subdir/file.txt $ hg add c/subdir/file.txt $ hg ci -m 'c/subdir/file.txt' $ hg rebase -r . -d 3 -n starting dry-run rebase; repository will not be changed rebasing 8:e147e6e3c490 "c/subdir/file.txt" (tip) abort: error: 'c/subdir/file.txt' conflicts with file 'c' in 3. [255] FIXME: shouldn't need this, but when we hit path conflicts in dryrun mode, we don't clean up rebasestate. $ hg rebase --abort rebase aborted $ hg rebase -r 3 -d . -n starting dry-run rebase; repository will not be changed rebasing 3:844a7de3e617 "c" abort: error: file 'c' cannot be written because 'c/' is a directory in e147e6e3c490 (containing 1 entries: c/subdir/file.txt) [255] $ cd .. Test path auditing (issue5818) $ mkdir lib_ $ ln -s lib_ lib $ hg init repo $ cd repo $ mkdir -p ".$TESTTMP/lib" $ touch ".$TESTTMP/lib/a" $ hg add ".$TESTTMP/lib/a" $ hg ci -m 'a' $ touch ".$TESTTMP/lib/b" $ hg add ".$TESTTMP/lib/b" $ hg ci -m 'b' $ hg up -q '.^' $ touch ".$TESTTMP/lib/c" $ hg add ".$TESTTMP/lib/c" $ hg ci -m 'c' created new head $ hg rebase -s 1 -d . rebasing 1:* "b" (glob) saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-rebase.hg (glob) $ cd .. Test dry-run rebasing $ hg init repo3 $ cd repo3 $ echo a>a $ hg ci -Aqma $ echo b>b $ hg ci -Aqmb $ echo c>c $ hg ci -Aqmc $ echo d>d $ hg ci -Aqmd $ echo e>e $ hg ci -Aqme $ hg up 1 -q $ echo f>f $ hg ci -Amf adding f created new head $ echo g>g $ hg ci -Aqmg $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" @ 6:baf10c5166d4 test | g | o 5:6343ca3eff20 test | f | | o 4:e860deea161a test | | e | | | o 3:055a42cdd887 test | | d | | | o 2:177f92b77385 test |/ c | o 1:d2ae7f538514 test | b | o 0:cb9a9f314b8b test a Make sure it throws error while passing --continue or --abort with --dry-run $ hg rebase -s 2 -d 6 -n --continue abort: cannot specify both --continue and --dry-run [255] $ hg rebase -s 2 -d 6 -n --abort abort: cannot specify both --abort and --dry-run [255] Check dryrun gives correct results when there is no conflict in rebasing $ hg rebase -s 2 -d 6 -n starting dry-run rebase; repository will not be changed rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" rebasing 4:e860deea161a "e" dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase $ hg diff $ hg status $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" @ 6:baf10c5166d4 test | g | o 5:6343ca3eff20 test | f | | o 4:e860deea161a test | | e | | | o 3:055a42cdd887 test | | d | | | o 2:177f92b77385 test |/ c | o 1:d2ae7f538514 test | b | o 0:cb9a9f314b8b test a Check dryrun working with --collapse when there is no conflict $ hg rebase -s 2 -d 6 -n --collapse starting dry-run rebase; repository will not be changed rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" rebasing 4:e860deea161a "e" dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase Check dryrun gives correct results when there is conflict in rebasing Make a conflict: $ hg up 6 -q $ echo conflict>e $ hg ci -Aqm "conflict with e" $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" @ 7:d2c195b28050 test | conflict with e | o 6:baf10c5166d4 test | g | o 5:6343ca3eff20 test | f | | o 4:e860deea161a test | | e | | | o 3:055a42cdd887 test | | d | | | o 2:177f92b77385 test |/ c | o 1:d2ae7f538514 test | b | o 0:cb9a9f314b8b test a $ hg rebase -s 2 -d 7 -n starting dry-run rebase; repository will not be changed rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" rebasing 4:e860deea161a "e" merging e transaction abort! rollback completed hit a merge conflict [1] $ hg diff $ hg status $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" @ 7:d2c195b28050 test | conflict with e | o 6:baf10c5166d4 test | g | o 5:6343ca3eff20 test | f | | o 4:e860deea161a test | | e | | | o 3:055a42cdd887 test | | d | | | o 2:177f92b77385 test |/ c | o 1:d2ae7f538514 test | b | o 0:cb9a9f314b8b test a Check dryrun working with --collapse when there is conflicts $ hg rebase -s 2 -d 7 -n --collapse starting dry-run rebase; repository will not be changed rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" rebasing 4:e860deea161a "e" merging e hit a merge conflict [1] In-memory rebase that fails due to merge conflicts $ hg rebase -s 2 -d 7 rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" rebasing 4:e860deea161a "e" merging e transaction abort! rollback completed hit merge conflicts; re-running rebase without in-memory merge rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" rebasing 4:e860deea161a "e" merging e warning: conflicts while merging e! (edit, then use 'hg resolve --mark') unresolved conflicts (see hg resolve, then hg rebase --continue) [1] $ hg rebase --abort saved backup bundle to $TESTTMP/repo3/.hg/strip-backup/c1e524d4287c-f91f82e1-backup.hg rebase aborted Retrying without in-memory merge won't lose working copy changes $ cd .. $ hg clone repo3 repo3-dirty -q $ cd repo3-dirty $ echo dirty > a $ hg rebase -s 2 -d 7 rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" rebasing 4:e860deea161a "e" merging e transaction abort! rollback completed hit merge conflicts; re-running rebase without in-memory merge abort: uncommitted changes [255] $ cat a dirty Retrying without in-memory merge won't lose merge state $ cd .. $ hg clone repo3 repo3-merge-state -q $ cd repo3-merge-state $ hg merge 4 merging e warning: conflicts while merging e! (edit, then use 'hg resolve --mark') 2 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 -l U e $ hg rebase -s 2 -d 7 abort: outstanding uncommitted merge (use 'hg commit' or 'hg merge --abort') [255] $ hg resolve -l U e ========================== Test for --confirm option| ========================== $ cd .. $ hg clone repo3 repo4 -q $ cd repo4 $ hg strip 7 -q $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" @ 6:baf10c5166d4 test | g | o 5:6343ca3eff20 test | f | | o 4:e860deea161a test | | e | | | o 3:055a42cdd887 test | | d | | | o 2:177f92b77385 test |/ c | o 1:d2ae7f538514 test | b | o 0:cb9a9f314b8b test a Check it gives error when both --dryrun and --confirm is used: $ hg rebase -s 2 -d . --confirm --dry-run abort: cannot specify both --confirm and --dry-run [255] $ hg rebase -s 2 -d . --confirm --abort abort: cannot specify both --abort and --confirm [255] $ hg rebase -s 2 -d . --confirm --continue abort: cannot specify both --continue and --confirm [255] Test --confirm option when there are no conflicts: $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF > n > EOF starting in-memory rebase rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" rebasing 4:e860deea161a "e" rebase completed successfully apply changes (yn)? n $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" @ 6:baf10c5166d4 test | g | o 5:6343ca3eff20 test | f | | o 4:e860deea161a test | | e | | | o 3:055a42cdd887 test | | d | | | o 2:177f92b77385 test |/ c | o 1:d2ae7f538514 test | b | o 0:cb9a9f314b8b test a $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF > y > EOF starting in-memory rebase rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" rebasing 4:e860deea161a "e" rebase completed successfully apply changes (yn)? y $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" o 9:9fd28f55f6dc test | e | o 8:12cbf031f469 test | d | o 7:c83b1da5b1ae test | c | @ 6:baf10c5166d4 test | g | o 5:6343ca3eff20 test | f | | o 4:e860deea161a test | | e | | | o 3:055a42cdd887 test | | d | | | o 2:177f92b77385 test |/ c | o 1:d2ae7f538514 test | b | o 0:cb9a9f314b8b test a Test --confirm option when there is a conflict $ hg up tip -q $ echo ee>e $ hg ci --amend -m "conflict with e" -q $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" @ 9:906d72f66a59 test | conflict with e | o 8:12cbf031f469 test | d | o 7:c83b1da5b1ae test | c | o 6:baf10c5166d4 test | g | o 5:6343ca3eff20 test | f | | o 4:e860deea161a test | | e | | | o 3:055a42cdd887 test | | d | | | o 2:177f92b77385 test |/ c | o 1:d2ae7f538514 test | b | o 0:cb9a9f314b8b test a $ hg rebase -s 4 -d . --keep --confirm starting in-memory rebase rebasing 4:e860deea161a "e" merging e hit a merge conflict [1] $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" @ 9:906d72f66a59 test | conflict with e | o 8:12cbf031f469 test | d | o 7:c83b1da5b1ae test | c | o 6:baf10c5166d4 test | g | o 5:6343ca3eff20 test | f | | o 4:e860deea161a test | | e | | | o 3:055a42cdd887 test | | d | | | o 2:177f92b77385 test |/ c | o 1:d2ae7f538514 test | b | o 0:cb9a9f314b8b test a Test a metadata-only in-memory merge $ cd $TESTTMP $ hg init no_exception $ cd no_exception # Produce the following graph: # o 'add +x to foo.txt' # | o r1 (adds bar.txt, just for something to rebase to) # |/ # o r0 (adds foo.txt, no +x) $ echo hi > foo.txt $ hg ci -qAm r0 $ echo hi > bar.txt $ hg ci -qAm r1 $ hg co -qr ".^" $ chmod +x foo.txt $ hg ci -qAm 'add +x to foo.txt' issue5960: this was raising an AttributeError exception $ hg rebase -r . -d 1 rebasing 2:539b93e77479 "add +x to foo.txt" (tip) saved backup bundle to $TESTTMP/no_exception/.hg/strip-backup/*.hg (glob) $ hg diff -c tip diff --git a/foo.txt b/foo.txt old mode 100644 new mode 100755 Test rebasing a commit with copy information, but no content changes $ cd .. $ hg clone -q repo1 merge-and-rename $ cd merge-and-rename $ cat << EOF >> .hg/hgrc > [experimental] > evolution.createmarkers=True > evolution.allowunstable=True > EOF $ hg co -q 1 $ hg mv d e $ hg ci -qm 'rename d to e' $ hg co -q 3 $ hg merge -q 4 $ hg ci -m 'merge' $ hg co -q 2 $ mv d e $ hg addremove -qs 0 $ hg ci -qm 'untracked rename of d to e' $ hg debugobsolete -q `hg log -T '{node}' -r 4` `hg log -T '{node}' -r .` 1 new orphan changesets $ hg tglog @ 6: 676538af172d 'untracked rename of d to e' | | * 5: 574d92ad16fc 'merge' | |\ | | x 4: 2c8b5dad7956 'rename d to e' | | | | o | 3: ca58782ad1e4 'b' |/ / o / 2: 814f6bd05178 'c' |/ o 1: 02952614a83d 'd' | o 0: b173517d0057 'a' $ hg rebase -b 5 -d tip rebasing 3:ca58782ad1e4 "b" rebasing 5:574d92ad16fc "merge" note: not rebasing 5:574d92ad16fc "merge", its destination already has all its changes $ cd .. Test rebasing a commit with copy information $ hg init rebase-rename $ cd rebase-rename $ echo a > a $ hg ci -Aqm 'add a' $ echo a2 > a $ hg ci -m 'modify a' $ hg co -q 0 $ hg mv a b $ hg ci -qm 'rename a to b' $ hg rebase -d 1 rebasing 2:b977edf6f839 "rename a to b" (tip) merging a and b to b saved backup bundle to $TESTTMP/rebase-rename/.hg/strip-backup/b977edf6f839-0864f570-rebase.hg $ hg st --copies --change . A b a R a $ cd .. Test rebasing a commit with copy information, where the target is empty $ hg init rebase-rename-empty $ cd rebase-rename-empty $ echo a > a $ hg ci -Aqm 'add a' $ cat > a $ hg ci -m 'make a empty' $ hg co -q 0 $ hg mv a b $ hg ci -qm 'rename a to b' $ hg rebase -d 1 rebasing 2:b977edf6f839 "rename a to b" (tip) merging a and b to b saved backup bundle to $TESTTMP/rebase-rename-empty/.hg/strip-backup/b977edf6f839-0864f570-rebase.hg $ hg st --copies --change . A b a R a $ cd .. Rebase across a copy with --collapse $ hg init rebase-rename-collapse $ cd rebase-rename-collapse $ echo a > a $ hg ci -Aqm 'add a' $ hg mv a b $ hg ci -m 'rename a to b' $ hg co -q 0 $ echo a2 > a $ hg ci -qm 'modify a' $ hg rebase -r . -d 1 --collapse rebasing 2:41c4ea50d4cf "modify a" (tip) merging b and a to b saved backup bundle to $TESTTMP/rebase-rename-collapse/.hg/strip-backup/41c4ea50d4cf-b90b7994-rebase.hg $ cd .. Test rebasing when the file we are merging in destination is empty $ hg init test $ cd test $ echo a > foo $ hg ci -Aqm 'added a to foo' $ rm foo $ touch foo $ hg di diff --git a/foo b/foo --- a/foo +++ b/foo @@ -1,1 +0,0 @@ -a $ hg ci -m "make foo an empty file" $ hg up '.^' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo b > foo $ hg di diff --git a/foo b/foo --- a/foo +++ b/foo @@ -1,1 +1,1 @@ -a +b $ hg ci -m "add b to foo" created new head $ hg rebase -r . -d 1 --config ui.merge=internal:merge3 rebasing 2:fb62b706688e "add b to foo" (tip) merging foo hit merge conflicts; re-running rebase without in-memory merge rebasing 2:fb62b706688e "add b to foo" (tip) merging foo warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') unresolved conflicts (see hg resolve, then hg rebase --continue) [1] $ cd $TESTTMP Test rebasing when we're in the middle of a rebase already $ hg init test_issue6214 $ cd test_issue6214 $ echo r0 > r0 $ hg ci -qAm 'r0' $ echo hi > foo $ hg ci -qAm 'hi from foo' $ hg co -q '.^' $ echo bye > foo $ hg ci -qAm 'bye from foo' $ hg co -q '.^' $ echo unrelated > some_other_file $ hg ci -qAm 'some unrelated changes' $ hg log -G -T'{rev}: {desc}\n{files%"{file}\n"}' @ 3: some unrelated changes | some_other_file | o 2: bye from foo |/ foo | o 1: hi from foo |/ foo o 0: r0 r0 $ hg rebase -r 2 -d 1 -t:merge3 rebasing 2:b4d249fbf8dd "bye from foo" merging foo hit merge conflicts; re-running rebase without in-memory merge rebasing 2:b4d249fbf8dd "bye from foo" merging foo warning: conflicts while merging foo! (edit, then use 'hg resolve --mark') unresolved conflicts (see hg resolve, then hg rebase --continue) [1] $ hg rebase -r 3 -d 1 -t:merge3 abort: rebase in progress (use 'hg rebase --continue' or 'hg rebase --abort') [255] $ hg resolve --list U foo $ hg resolve --all --re-merge -t:other (no more unresolved files) continue: hg rebase --continue $ hg rebase --continue rebasing 2:b4d249fbf8dd "bye from foo" saved backup bundle to $TESTTMP/test_issue6214/.hg/strip-backup/b4d249fbf8dd-299ec25c-rebase.hg $ hg log -G -T'{rev}: {desc}\n{files%"{file}\n"}' o 3: bye from foo | foo | @ 2: some unrelated changes | | some_other_file o | 1: hi from foo |/ foo o 0: r0 r0 mercurial-5.3.1/tests/test-util.py0000644015407300116100000001027613627755405017065 0ustar augieeng00000000000000# unit tests for mercuril.util utilities from __future__ import absolute_import import contextlib import itertools import unittest from mercurial import pycompat, util, utils @contextlib.contextmanager def mocktimer(incr=0.1, *additional_targets): """Replaces util.timer and additional_targets with a mock The timer starts at 0. On each call the time incremented by the value of incr. If incr is an iterable, then the time is incremented by the next value from that iterable, looping in a cycle when reaching the end. additional_targets must be a sequence of (object, attribute_name) tuples; the mock is set with setattr(object, attribute_name, mock). """ time = [0] try: incr = itertools.cycle(incr) except TypeError: incr = itertools.repeat(incr) def timer(): time[0] += next(incr) return time[0] # record original values orig = util.timer additional_origs = [(o, a, getattr(o, a)) for o, a in additional_targets] # mock out targets util.timer = timer for obj, attr in additional_targets: setattr(obj, attr, timer) try: yield finally: # restore originals util.timer = orig for args in additional_origs: setattr(*args) # attr.s default factory for util.timedstats.start binds the timer we # need to mock out. _start_default = (util.timedcmstats.start.default, 'factory') @contextlib.contextmanager def capturestderr(): """Replace utils.procutil.stderr with a pycompat.bytesio instance The instance is made available as the return value of __enter__. This contextmanager is reentrant. """ orig = utils.procutil.stderr utils.procutil.stderr = pycompat.bytesio() try: yield utils.procutil.stderr finally: utils.procutil.stderr = orig class timedtests(unittest.TestCase): def testtimedcmstatsstr(self): stats = util.timedcmstats() self.assertEqual(str(stats), '') self.assertEqual(bytes(stats), b'') stats.elapsed = 12.34 self.assertEqual(str(stats), pycompat.sysstr(util.timecount(12.34))) self.assertEqual(bytes(stats), util.timecount(12.34)) def testtimedcmcleanexit(self): # timestamps 1, 4, elapsed time of 4 - 1 = 3 with mocktimer([1, 3], _start_default): with util.timedcm('pass') as stats: # actual context doesn't matter pass self.assertEqual(stats.start, 1) self.assertEqual(stats.elapsed, 3) self.assertEqual(stats.level, 1) def testtimedcmnested(self): # timestamps 1, 3, 6, 10, elapsed times of 6 - 3 = 3 and 10 - 1 = 9 with mocktimer([1, 2, 3, 4], _start_default): with util.timedcm('outer') as outer_stats: with util.timedcm('inner') as inner_stats: # actual context doesn't matter pass self.assertEqual(outer_stats.start, 1) self.assertEqual(outer_stats.elapsed, 9) self.assertEqual(outer_stats.level, 1) self.assertEqual(inner_stats.start, 3) self.assertEqual(inner_stats.elapsed, 3) self.assertEqual(inner_stats.level, 2) def testtimedcmexception(self): # timestamps 1, 4, elapsed time of 4 - 1 = 3 with mocktimer([1, 3], _start_default): try: with util.timedcm('exceptional') as stats: raise ValueError() except ValueError: pass self.assertEqual(stats.start, 1) self.assertEqual(stats.elapsed, 3) self.assertEqual(stats.level, 1) def testtimeddecorator(self): @util.timed def testfunc(callcount=1): callcount -= 1 if callcount: testfunc(callcount) # timestamps 1, 2, 3, 4, elapsed time of 3 - 2 = 1 and 4 - 1 = 3 with mocktimer(1, _start_default): with capturestderr() as out: testfunc(2) self.assertEqual( out.getvalue(), (b' testfunc: 1.000 s\n' b' testfunc: 3.000 s\n'), ) if __name__ == '__main__': import silenttestrunner silenttestrunner.main(__name__) mercurial-5.3.1/tests/test-narrow-trackedcmd.t0000644015407300116100000001302213627755405021322 0ustar augieeng00000000000000#testcases flat tree $ . "$TESTDIR/narrow-library.sh" #if tree $ cat << EOF >> $HGRCPATH > [experimental] > treemanifest = 1 > EOF #endif $ hg init master $ cd master $ cat >> .hg/hgrc < [narrow] > serveellipses=True > EOF $ mkdir inside $ echo 'inside' > inside/f $ hg add inside/f $ hg commit -m 'add inside' $ mkdir widest $ echo 'widest' > widest/f $ hg add widest/f $ hg commit -m 'add widest' $ mkdir outside $ echo 'outside' > outside/f $ hg add outside/f $ hg commit -m 'add outside' $ cd .. narrow clone the inside file $ hg clone --narrow ssh://user@dummy/master narrow --include inside requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 1 changes to 1 files new changesets *:* (glob) updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd narrow $ hg tracked I path:inside $ ls inside $ cat inside/f inside $ cd .. add more upstream files which we will include in a wider narrow spec $ cd master $ mkdir wider $ echo 'wider' > wider/f $ hg add wider/f $ echo 'widest v2' > widest/f $ hg commit -m 'add wider, update widest' $ echo 'widest v3' > widest/f $ hg commit -m 'update widest v3' $ echo 'inside v2' > inside/f $ hg commit -m 'update inside' $ mkdir outside2 $ echo 'outside2' > outside2/f $ hg add outside2/f $ hg commit -m 'add outside2' $ echo 'widest v4' > widest/f $ hg commit -m 'update widest v4' $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n" 7: update widest v4 6: add outside2 5: update inside 4: update widest v3 3: add wider, update widest 2: add outside 1: add widest 0: add inside $ cd .. Testing the --import-rules flag of `hg tracked` command $ cd narrow $ hg tracked --import-rules hg tracked: option --import-rules requires argument hg tracked [OPTIONS]... [REMOTE] show or change the current narrowspec options ([+] can be repeated): --addinclude VALUE [+] new paths to include --removeinclude VALUE [+] old paths to no longer include --auto-remove-includes automatically choose unused includes to remove --addexclude VALUE [+] new paths to exclude --import-rules VALUE import narrowspecs from a file --removeexclude VALUE [+] old paths to no longer exclude --clear whether to replace the existing narrowspec --force-delete-local-changes forces deletion of local changes when narrowing --update-working-copy update working copy when the store has changed -e --ssh CMD specify ssh command to use --remotecmd CMD specify hg command to run on the remote side --insecure do not verify server certificate (ignoring web.cacerts config) (use 'hg tracked -h' to show more help) [255] $ hg tracked --import-rules doesnotexist abort: cannot read narrowspecs from '$TESTTMP/narrow/doesnotexist': $ENOENT$ [255] $ cat > specs < %include foo > [include] > path:widest/ > [exclude] > path:inside/ > EOF $ hg tracked --import-rules specs abort: including other spec files using '%include' is not supported in narrowspec [255] $ cat > specs < [include] > outisde > [exclude] > inside > EOF $ hg tracked --import-rules specs comparing with ssh://user@dummy/master searching for changes looking for local changes to affected paths deleting data/inside/f.i deleting meta/inside/00manifest.i (tree !) saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob) adding changesets adding manifests adding file changes added 2 changesets with 0 changes to 0 files $ hg tracked I path:outisde X path:inside Testing the --import-rules flag with --addinclude and --addexclude $ cat > specs < [include] > widest > EOF $ hg tracked --import-rules specs --addinclude 'wider/' comparing with ssh://user@dummy/master searching for changes saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob) adding changesets adding manifests adding file changes added 3 changesets with 1 changes to 1 files $ hg tracked I path:outisde I path:wider I path:widest X path:inside $ cat > specs < [exclude] > outside2 > EOF $ hg tracked --import-rules specs --addexclude 'widest' comparing with ssh://user@dummy/master searching for changes looking for local changes to affected paths deleting data/widest/f.i deleting meta/widest/00manifest.i (tree !) $ hg tracked I path:outisde I path:wider X path:inside X path:outside2 X path:widest $ hg tracked --import-rules specs --clear abort: the --clear option is not yet supported [255] Testing with passing a out of wdir file $ cat > ../nspecs < [include] > widest > EOF $ hg tracked --import-rules ../nspecs comparing with ssh://user@dummy/master searching for changes saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob) adding changesets adding manifests adding file changes added 3 changesets with 0 changes to 0 files $ cd .. Testing tracked command on a non-narrow repo $ hg init non-narrow $ cd non-narrow $ hg tracked --addinclude foobar abort: the tracked command is only supported on repositories cloned with --narrow [255] mercurial-5.3.1/tests/test-hgweb-non-interactive.t0000644015407300116100000000517513627755405022124 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, > encoding, > hg, > pycompat, > ui as uimod, > util, > ) > ui = uimod.ui > from mercurial.hgweb import hgweb_mod > 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_mod.hgweb(b'.') > for c in i(env, startrsp): > pass > sys.stdout.flush() > pycompat.stdout.write(b'---- ERRORS\n') > pycompat.stdout.write(b'%s\n' % 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([encoding.strfromlocal(x) for x in repo.ui.environ > if x.startswith(b'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-5.3.1/tests/test-convert-baz.t0000644015407300116100000001240313627755405020147 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-5.3.1/tests/test-diff-hashes.t0000644015407300116100000000204013627755405020072 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 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 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-5.3.1/tests/test-mv-cp-st-diff.t0000644015407300116100000005355113627755405020302 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 rename because we want to track renames. It is also important that the faulty linkrev is not only the "start" commit to ensure the linkrev will be used. $ hg mv f renamed $ hg ci -m renamed 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 and the rename. As f was untouched, we reuse the same entry and the linkrev point to the older branch. $ hg graft -q 'desc(change)' $ hg graft -q 'desc(renamed)' $ hg log -G -T '{rev} {desc}' @ 5 renamed | o 4 change f | o 3 dev | | o 2 renamed | | | o 1 change f |/ o 0 empty f The copy tracking should still reach rev 3 (branch creation). accessing the parent of 5 (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 Check debug output for copy tracing $ hg status --copies --rev 'desc(dev)' --rev . --config devel.debug.copies=yes --debug debug.copies: searching copies from a51f36ab1704 to 1f4aa1fd627b debug.copies: search mode: forward debug.copies: looking into rename from a51f36ab1704 to 1f4aa1fd627b debug.copies: missing files to search: 1 debug.copies: tracing file: renamed debug.copies: rename of: f debug.copies: time: * seconds (glob) A renamed f R f Check that merging across the rename works $ echo modified >> renamed $ hg co -m 4 merging renamed and f to f 0 files updated, 1 files merged, 0 files removed, 0 files unresolved $ cd .. mercurial-5.3.1/tests/test-manifest-merging.t0000644015407300116100000000136013627755405021151 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-5.3.1/tests/test-update-dest.t0000644015407300116100000000240713627755405020137 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-5.3.1/tests/test-push-checkheads-unpushed-D1.t0000644015407300116100000000350613627755405023053 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)"` 1 new obsolescence markers 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-5.3.1/tests/test-http-branchmap.t0000644015407300116100000000573513627755405020637 0ustar augieeng00000000000000 $ 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 threading > from mercurial import dispatch, hg, ui, wireprotoserver > > class StdoutWrapper(object): > def __init__(self, stdout): > self._file = stdout > > def write(self, data): > if data == b'47\n': > # latin1 encoding is one %xx (3 bytes) shorter > data = b'44\n' > elif data.startswith(b'%C3%A6 '): > # translate to latin1 encoding > data = b'%%E6 %s' % data[7:] > self._file.write(data) > > def __getattr__(self, name): > return getattr(self._file, name) > > dispatch.initstdio() > myui = ui.ui.load() > fout = StdoutWrapper(myui.fout) > myui.fout = myui.ferr > repo = hg.repository(myui, b'a') > wireprotoserver._runsshserver(myui, repo, myui.fin, fout, threading.Event()) > 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-5.3.1/tests/test-walkrepo.py0000644015407300116100000000404413627755405017730 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(b'.') hg.repository(u, b'top1', create=1) mkdir(b'subdir') chdir(b'subdir') hg.repository(u, b'sub1', create=1) mkdir(b'subsubdir') chdir(b'subsubdir') hg.repository(u, b'subsub1', create=1) chdir(os.path.pardir) if sym: os.symlink(os.path.pardir, b'circle') os.symlink(pjoin(b'subsubdir', b'subsub1'), b'subsub1') def runtest(): reposet = frozenset(walkrepos(b'.', 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(b'.', b'sub1'), pjoin(b'.', b'circle', b'subdir', b'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(b'.', b'subsub1'), pjoin(b'.', b'subsubdir', b'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(b'.', b'circle', b'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-5.3.1/tests/test-narrow-copies.t0000644015407300116100000000362413627755405020512 0ustar augieeng00000000000000 $ . "$TESTDIR/narrow-library.sh" create full repo $ hg init master $ cd master $ mkdir inside $ echo inside > inside/f1 $ mkdir outside $ echo outside > outside/f2 $ hg ci -Aqm 'initial' $ hg mv outside/f2 inside/f2 $ hg ci -qm 'move f2 from outside' $ echo modified > inside/f2 $ hg ci -qm 'modify inside/f2' $ mkdir outside $ echo new > outside/f3 $ hg ci -Aqm 'add outside/f3' $ cd .. $ hg clone --narrow ssh://user@dummy/master narrow --include inside -r 2 adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 2 files new changesets *:* (glob) updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd narrow $ hg co 'desc("move f2")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg status $ hg diff $ hg diff --change . --git diff --git a/inside/f2 b/inside/f2 new file mode 100644 --- /dev/null +++ b/inside/f2 @@ -0,0 +1,1 @@ +outside $ hg log --follow inside/f2 -r tip changeset: 2:bcfb756e0ca9 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: modify inside/f2 changeset: 1:5a016133b2bb user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: move f2 from outside $ echo new > inside/f4 $ hg ci -Aqm 'add inside/f4' $ hg pull -q $ hg --config extensions.rebase= rebase -d tip rebasing 3:4f84b666728c "add inside/f4" saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/4f84b666728c-4269b76e-rebase.hg $ hg co -q 0 $ echo modified > inside/f1 $ hg ci -qm 'modify inside/f1' $ echo new > inside/f5 $ hg ci -Aqm 'add inside/f5' $ hg --config extensions.rebase= rebase -d 'public()' -r . rebasing 6:610b60178c28 "add inside/f5" (tip) saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/610b60178c28-65716a78-rebase.hg mercurial-5.3.1/tests/pullext.py0000644015407300116100000000277713627755405016637 0ustar augieeng00000000000000# pullext.py - Simple extension to test pulling # # Copyright 2018 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. from __future__ import absolute_import from mercurial.i18n import _ from mercurial import ( commands, error, extensions, localrepo, ) from mercurial.interfaces import repository def clonecommand(orig, ui, repo, *args, **kwargs): if kwargs.get('include') or kwargs.get('exclude'): kwargs['narrow'] = True if kwargs.get('depth'): try: kwargs['depth'] = int(kwargs['depth']) except ValueError: raise error.Abort(_('--depth must be an integer')) return orig(ui, repo, *args, **kwargs) def featuresetup(ui, features): features.add(repository.NARROW_REQUIREMENT) def extsetup(ui): entry = extensions.wrapcommand(commands.table, b'clone', clonecommand) hasinclude = any(x[1] == b'include' for x in entry[1]) hasdepth = any(x[1] == b'depth' for x in entry[1]) if not hasinclude: entry[1].append( (b'', b'include', [], _(b'pattern of file/directory to clone')) ) entry[1].append( (b'', b'exclude', [], _(b'pattern of file/directory to not clone')) ) if not hasdepth: entry[1].append( (b'', b'depth', b'', _(b'ancestry depth of changesets to fetch')) ) localrepo.featuresetupfuncs.add(featuresetup) mercurial-5.3.1/tests/test-remotefilelog-bundle2.t0000644015407300116100000000463313627755405022111 0ustar augieeng00000000000000#require no-windows $ . "$TESTDIR/remotefilelog-library.sh" $ hg init master $ grep generaldelta master/.hg/requires generaldelta $ cd master preferuncompressed = False so that we can make both generaldelta and non-generaldelta clones $ cat >> .hg/hgrc < [remotefilelog] > server=True > [experimental] > bundle2-exp = True > [server] > preferuncompressed = False > EOF $ echo x > x $ hg commit -qAm x $ cd .. $ hgcloneshallow ssh://user@dummy/master shallow-generaldelta -q --pull --config experimental.bundle2-exp=True 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) $ grep generaldelta shallow-generaldelta/.hg/requires generaldelta $ hgcloneshallow ssh://user@dummy/master shallow-plain -q --pull --config format.usegeneraldelta=False --config format.generaldelta=False --config experimental.bundle2-exp=True $ grep generaldelta shallow-plain/.hg/requires [1] $ cd master $ echo a > a $ hg commit -qAm a pull from generaldelta to generaldelta $ cd ../shallow-generaldelta $ hg pull -u pulling from ssh://user@dummy/master searching for changes adding changesets adding manifests adding file changes added 1 changesets with 0 changes to 0 files new changesets 2fbb8bb2b903 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) push from generaldelta to generaldelta $ echo b > b $ hg commit -qAm b $ hg push pushing to ssh://user@dummy/master searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files pull from generaldelta to non-generaldelta $ cd ../shallow-plain $ hg pull -u pulling from ssh://user@dummy/master searching for changes adding changesets adding manifests adding file changes added 2 changesets with 0 changes to 0 files new changesets 2fbb8bb2b903:d6788bd632ca 2 files updated, 0 files merged, 0 files removed, 0 files unresolved 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob) push from non-generaldelta to generaldelta $ echo c > c $ hg commit -qAm c $ hg push pushing to ssh://user@dummy/master searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files mercurial-5.3.1/tests/test-hgweb-auth.py.out0000644015407300116100000001344013627755405020745 0ustar augieeng00000000000000 *** Test in-uri schemes CFG: {b'x.prefix': b'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: {b'x.prefix': b'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: {b'x.prefix': b'http://example.org', b'x.schemes': b'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: {b'x.prefix': b'https://example.org', b'x.schemes': b'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: {b'x.prefix': b'example.org', b'x.schemes': b'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: {b'x.prefix': b'example.org', b'x.schemes': b'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: {b'x.prefix': b'example.org', b'x.schemes': b'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: {b'x.prefix': b'http://example.org/foo', b'y.prefix': b'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: {b'x.prefix': b'http://example.org/foo', b'y.prefix': b'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: {b'x.prefix': b'*', b'y.prefix': b'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: {b'x.password': b'xpassword', b'x.prefix': b'http://example.org/foo', b'x.username': None} URI: http://y@example.org/foo ('y', 'xpassword') CFG: {b'x.password': b'xpassword', b'x.prefix': b'http://example.org/foo', b'x.username': None, b'y.password': b'ypassword', b'y.prefix': b'http://example.org/foo', b'y.username': b'y'} URI: http://y@example.org/foo ('y', 'ypassword') CFG: {b'x.password': b'xpassword', b'x.prefix': b'http://example.org/foo/bar', b'x.username': None, b'y.password': b'ypassword', b'y.prefix': b'http://example.org/foo', b'y.username': b'y'} URI: http://y@example.org/foo/bar ('y', 'xpassword') *** Test user matching with name in prefix CFG: {b'x.password': b'xpassword', b'x.prefix': b'https://example.org/foo', b'x.username': None, b'y.password': b'ypassword', b'y.prefix': b'http://y@example.org/foo', b'y.username': b'y'} URI: http://y@example.org/foo ('y', 'ypassword') CFG: {b'y.password': b'ypassword', b'y.prefix': b'http://z@example.org/foo', b'y.username': b'y'} URI: http://y@example.org/foo abort CFG: {b'y.password': b'ypassword', b'y.prefix': b'http://z@example.org/foo'} URI: http://y@example.org/foo abort CFG: {b'y.password': b'ypassword', b'y.prefix': b'http://y@example.org/foo', b'y.username': b'z'} URI: http://y@example.org/foo abort CFG: {b'y.password': b'ypassword', b'y.prefix': b'http://y@example.org/foo'} URI: http://y@example.org/foo ('y', 'ypassword') CFG: {b'y.password': b'ypassword', b'y.prefix': b'http://y@example.org/foo'} URI: http://example.org/foo abort *** Test urllib2 and util.url URIs: http://user@example.com:8080/foo http://example.com:8080/foo ('user', '') mercurial-5.3.1/tests/test-releasenotes-merging.t0000644015407300116100000001220713627755405022036 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-5.3.1/tests/test-histedit-non-commute-abort.t0000644015407300116100000001222513627755405023100 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 Early tree conflict doesn't leave histedit in a wedged state. Note that we don't specify --commands here: we catch the problem before we even prompt the user for rules, sidestepping any dataloss issues. $ hg rm c $ hg ci -m 'remove c' $ echo collision > c $ hg histedit e860deea161a c: untracked file differs abort: untracked files in working directory conflict with files in 055a42cdd887 [255] We should have detected the collision early enough we're not in a histedit state, and p1 is unchanged. $ hg log -r 'p1()' -T'{node}\n' 1b0954ff00fccb15a37b679e4a35e9b01dfe685e $ hg status --config ui.tweakdefaults=yes ? c ? e.orig $ cd .. mercurial-5.3.1/tests/fakemergerecord.py0000644015407300116100000000140413627755405020251 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( b'fakemergerecord', [ (b'X', b'mandatory', None, b'add a fake mandatory record'), (b'x', b'advisory', None, b'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((b'X', b'mandatory record')) if opts.get('advisory'): records.append((b'x', b'advisory record')) ms._writerecords(records) mercurial-5.3.1/tests/test-addremove-similar.t0000644015407300116100000000745713627755405021336 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-5.3.1/tests/bzr-definitions0000644015407300116100000000057313627755405017611 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+: [{file_adds}], files-: [{file_dels}], files: [{file_mods}]\n' "$@" } manifest() { echo "% manifest of $2" hg -R $1 manifest -v -r $2 } mercurial-5.3.1/tests/test-propertycache.py0000644015407300116100000001527513627755405020764 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, pycompat, ui as uimod, util, ) from mercurial.utils import procutil # 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 = pycompat.fsencode(os.path.join(os.environ['TESTTMP'], 'repo')) assert ( subprocess.call( pycompat.rapply(procutil.tonativestr, [b'hg', b'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-5.3.1/tests/test-narrow-shallow-merges.t0000644015407300116100000002501313627755405022155 0ustar augieeng00000000000000#require no-reposimplestore $ . "$TESTDIR/narrow-library.sh" create full repo $ hg init master $ cd master $ cat >> .hg/hgrc < [narrow] > serveellipses=True > EOF $ mkdir inside $ echo 1 > inside/f $ hg commit -Aqm 'initial inside' $ mkdir outside $ echo 1 > outside/f $ hg commit -Aqm 'initial outside' $ echo 2a > outside/f $ hg commit -Aqm 'outside 2a' $ echo 3 > inside/f $ hg commit -Aqm 'inside 3' $ echo 4a > outside/f $ hg commit -Aqm 'outside 4a' $ hg update '.~3' 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 2b > outside/f $ hg commit -Aqm 'outside 2b' $ echo 3 > inside/f $ hg commit -Aqm 'inside 3' $ echo 4b > outside/f $ hg commit -Aqm 'outside 4b' $ hg update '.~3' 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 2c > outside/f $ hg commit -Aqm 'outside 2c' $ echo 3 > inside/f $ hg commit -Aqm 'inside 3' $ echo 4c > outside/f $ hg commit -Aqm 'outside 4c' $ hg update '.~3' 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 2d > outside/f $ hg commit -Aqm 'outside 2d' $ echo 3 > inside/f $ hg commit -Aqm 'inside 3' $ echo 4d > outside/f $ hg commit -Aqm 'outside 4d' $ hg update -r 'desc("outside 4a")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge -r 'desc("outside 4b")' 2>&1 | egrep -v '(warning:|incomplete!)' merging outside/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 $ echo 5 > outside/f $ rm outside/f.orig $ hg resolve --mark outside/f (no more unresolved files) $ hg commit -m 'merge a/b 5' $ echo 6 > outside/f $ hg commit -Aqm 'outside 6' $ hg merge -r 'desc("outside 4c")' 2>&1 | egrep -v '(warning:|incomplete!)' merging outside/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 $ echo 7 > outside/f $ rm outside/f.orig $ hg resolve --mark outside/f (no more unresolved files) $ hg commit -Aqm 'merge a/b/c 7' $ echo 8 > outside/f $ hg commit -Aqm 'outside 8' $ hg merge -r 'desc("outside 4d")' 2>&1 | egrep -v '(warning:|incomplete!)' merging outside/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 $ echo 9 > outside/f $ rm outside/f.orig $ hg resolve --mark outside/f (no more unresolved files) $ hg commit -Aqm 'merge a/b/c/d 9' $ echo 10 > outside/f $ hg commit -Aqm 'outside 10' $ echo 11 > inside/f $ hg commit -Aqm 'inside 11' $ echo 12 > outside/f $ hg commit -Aqm 'outside 12' $ hg log -G -T '{rev} {node|short} {desc}\n' @ 21 8d874d57adea outside 12 | o 20 7ef88b4dd4fa inside 11 | o 19 2a20009de83e outside 10 | o 18 3ac1f5779de3 merge a/b/c/d 9 |\ | o 17 38a9c2f7e546 outside 8 | | | o 16 094aa62fc898 merge a/b/c 7 | |\ | | o 15 f29d083d32e4 outside 6 | | | | | o 14 2dc11382541d merge a/b 5 | | |\ o | | | 13 27d07ef97221 outside 4d | | | | o | | | 12 465567bdfb2d inside 3 | | | | o | | | 11 d1c61993ec83 outside 2d | | | | | o | | 10 56859a8e33b9 outside 4c | | | | | o | | 9 bb96a08b062a inside 3 | | | | | o | | 8 b844052e7b3b outside 2c |/ / / | | o 7 9db2d8fcc2a6 outside 4b | | | | | o 6 6418167787a6 inside 3 | | | +---o 5 77344f344d83 outside 2b | | | o 4 9cadde08dc9f outside 4a | | | o 3 019ef06f125b inside 3 | | | o 2 75e40c075a19 outside 2a |/ o 1 906d6c682641 initial outside | o 0 9f8e82b51004 initial inside Now narrow and shallow clone this and get a hopefully correct graph $ cd .. $ hg clone --narrow ssh://user@dummy/master narrow --include inside --depth 7 requesting all changes adding changesets adding manifests adding file changes added 8 changesets with 3 changes to 1 files new changesets *:* (glob) updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd narrow To make updating the tests easier, we print the emitted nodes sorted. This makes it easier to identify when the same node structure has been emitted, just in a different order. $ hg log -G -T '{rev} {node|short}{if(ellipsis,"...")} {desc}\n' @ 7 8d874d57adea... outside 12 | o 6 7ef88b4dd4fa inside 11 | o 5 2a20009de83e... outside 10 | o 4 3ac1f5779de3... merge a/b/c/d 9 |\ | o 3 465567bdfb2d inside 3 | | | o 2 d1c61993ec83... outside 2d | o 1 bb96a08b062a inside 3 | o 0 b844052e7b3b... outside 2c $ hg log -T '{if(ellipsis,"...")}{node|short} {p1node|short} {p2node|short} {desc}\n' | sort ...2a20009de83e 000000000000 3ac1f5779de3 outside 10 ...3ac1f5779de3 bb96a08b062a 465567bdfb2d merge a/b/c/d 9 ...8d874d57adea 7ef88b4dd4fa 000000000000 outside 12 ...b844052e7b3b 000000000000 000000000000 outside 2c ...d1c61993ec83 000000000000 000000000000 outside 2d 465567bdfb2d d1c61993ec83 000000000000 inside 3 7ef88b4dd4fa 2a20009de83e 000000000000 inside 11 bb96a08b062a b844052e7b3b 000000000000 inside 3 $ cd .. Incremental test case: show a pull can pull in a conflicted merge even if elided $ hg init pullmaster $ cd pullmaster $ cat >> .hg/hgrc < [narrow] > serveellipses=True > EOF $ mkdir inside outside $ echo v1 > inside/f $ echo v1 > outside/f $ hg add inside/f outside/f $ hg commit -m init $ for line in a b c d > do > hg update -r 0 > echo v2$line > outside/f > hg commit -m "outside 2$line" > echo v2$line > inside/f > hg commit -m "inside 2$line" > echo v3$line > outside/f > hg commit -m "outside 3$line" > echo v4$line > outside/f > hg commit -m "outside 4$line" > done 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 2 files updated, 0 files merged, 0 files removed, 0 files unresolved created new head 2 files updated, 0 files merged, 0 files removed, 0 files unresolved created new head 2 files updated, 0 files merged, 0 files removed, 0 files unresolved created new head $ cd .. $ hg clone --narrow ssh://user@dummy/pullmaster pullshallow \ > --include inside --depth 3 requesting all changes adding changesets adding manifests adding file changes added 12 changesets with 5 changes to 1 files (+3 heads) new changesets *:* (glob) updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd pullshallow $ hg log -G -T '{rev} {node|short}{if(ellipsis,"...")} {desc}\n' @ 11 0ebbd712a0c8... outside 4d | o 10 0d4c867aeb23 inside 2d | o 9 e932969c3961... outside 2d o 8 33d530345455... outside 4c | o 7 0ce6481bfe07 inside 2c | o 6 caa65c940632... outside 2c o 5 3df233defecc... outside 4b | o 4 7162cc6d11a4 inside 2b | o 3 f2a632f0082d... outside 2b o 2 b8a3da16ba49... outside 4a | o 1 53f543eb8e45 inside 2a | o 0 1be3e5221c6a... outside 2a $ hg log -T '{if(ellipsis,"...")}{node|short} {p1node|short} {p2node|short} {desc}\n' | sort ...0ebbd712a0c8 0d4c867aeb23 000000000000 outside 4d ...1be3e5221c6a 000000000000 000000000000 outside 2a ...33d530345455 0ce6481bfe07 000000000000 outside 4c ...3df233defecc 7162cc6d11a4 000000000000 outside 4b ...b8a3da16ba49 53f543eb8e45 000000000000 outside 4a ...caa65c940632 000000000000 000000000000 outside 2c ...e932969c3961 000000000000 000000000000 outside 2d ...f2a632f0082d 000000000000 000000000000 outside 2b 0ce6481bfe07 caa65c940632 000000000000 inside 2c 0d4c867aeb23 e932969c3961 000000000000 inside 2d 53f543eb8e45 1be3e5221c6a 000000000000 inside 2a 7162cc6d11a4 f2a632f0082d 000000000000 inside 2b $ cd ../pullmaster $ hg update -r 'desc("outside 4a")' 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge -r 'desc("outside 4b")' 2>&1 | egrep -v '(warning:|incomplete!)' merging inside/f merging outside/f 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 $ echo 3 > inside/f $ echo 5 > outside/f $ rm -f {in,out}side/f.orig $ hg resolve --mark inside/f outside/f (no more unresolved files) $ hg commit -m 'merge a/b 5' $ hg update -r 'desc("outside 4c")' 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge -r 'desc("outside 4d")' 2>&1 | egrep -v '(warning:|incomplete!)' merging inside/f merging outside/f 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 $ echo 3 > inside/f $ echo 5 > outside/f $ rm -f {in,out}side/f.orig $ hg resolve --mark inside/f outside/f (no more unresolved files) $ hg commit -m 'merge c/d 5' $ hg update -r 'desc("merge a/b 5")' 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge -r 'desc("merge c/d 5")' 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ echo 6 > outside/f $ hg commit -m 'outside 6' $ echo 7 > outside/f $ hg commit -m 'outside 7' $ echo 8 > outside/f $ hg commit -m 'outside 8' $ cd ../pullshallow $ hg pull --depth 3 pulling from ssh://user@dummy/pullmaster searching for changes adding changesets adding manifests adding file changes added 4 changesets with 3 changes to 1 files (-3 heads) new changesets *:* (glob) (run 'hg update' to get a working copy) $ hg log -T '{if(ellipsis,"...")}{node|short} {p1node|short} {p2node|short} {desc}\n' | sort ...0ebbd712a0c8 0d4c867aeb23 000000000000 outside 4d ...1be3e5221c6a 000000000000 000000000000 outside 2a ...33d530345455 0ce6481bfe07 000000000000 outside 4c ...3df233defecc 7162cc6d11a4 000000000000 outside 4b ...b8a3da16ba49 53f543eb8e45 000000000000 outside 4a ...bf545653453e 968003d40c60 000000000000 outside 8 ...caa65c940632 000000000000 000000000000 outside 2c ...e932969c3961 000000000000 000000000000 outside 2d ...f2a632f0082d 000000000000 000000000000 outside 2b 0ce6481bfe07 caa65c940632 000000000000 inside 2c 0d4c867aeb23 e932969c3961 000000000000 inside 2d 53f543eb8e45 1be3e5221c6a 000000000000 inside 2a 67d49c0bdbda b8a3da16ba49 3df233defecc merge a/b 5 7162cc6d11a4 f2a632f0082d 000000000000 inside 2b 968003d40c60 67d49c0bdbda e867021d52c2 outside 6 e867021d52c2 33d530345455 0ebbd712a0c8 merge c/d 5 mercurial-5.3.1/tests/artifacts/0000755015407300116100000000000013627755445016537 5ustar augieeng00000000000000mercurial-5.3.1/tests/artifacts/cache/0000755015407300116100000000000013627755445017602 5ustar augieeng00000000000000mercurial-5.3.1/tests/artifacts/cache/big-file-churn.hg.md50000644015407300116100000000004113627755405023370 0ustar augieeng00000000000000cb1e67ae6b17ba66dd455f9782692f4a mercurial-5.3.1/tests/artifacts/scripts/0000755015407300116100000000000013627755445020226 5ustar augieeng00000000000000mercurial-5.3.1/tests/artifacts/scripts/generate-churning-bundle.py0000755015407300116100000001055513627755405025461 0ustar augieeng00000000000000#!/usr/bin/env python # # generate-branchy-bundle - generate a branch for a "large" branchy repository # # Copyright 2018 Octobus, contact@octobus.net # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. # # This script generates a repository suitable for testing delta computation # strategies. # # The repository update a single "large" file with many updates. One fixed part # of the files always get updated while the rest of the lines get updated over # time. This update happens over many topological branches, some getting merged # back. # # Running with `chg` in your path and `CHGHG` set is recommended for speed. from __future__ import absolute_import, print_function import hashlib import os import shutil import subprocess import sys import tempfile BUNDLE_NAME = 'big-file-churn.hg' # constants for generating the repository NB_CHANGESET = 5000 PERIOD_MERGING = 8 PERIOD_BRANCHING = 7 MOVE_BACK_MIN = 3 MOVE_BACK_RANGE = 5 # constants for generating the large file we keep updating # # At each revision, the beginning on the file change, # and set of other lines changes too. FILENAME = 'SPARSE-REVLOG-TEST-FILE' NB_LINES = 10500 ALWAYS_CHANGE_LINES = 500 OTHER_CHANGES = 300 def nextcontent(previous_content): """utility to produce a new file content from the previous one""" return hashlib.md5(previous_content).hexdigest() def filecontent(iteridx, oldcontent): """generate a new file content The content is generated according the iteration index and previous content""" # initial call if iteridx is None: current = '' else: current = str(iteridx) for idx in range(NB_LINES): do_change_line = True if oldcontent is not None and ALWAYS_CHANGE_LINES < idx: do_change_line = not ((idx - iteridx) % OTHER_CHANGES) if do_change_line: to_write = current + '\n' current = nextcontent(current) else: to_write = oldcontent[idx] yield to_write def updatefile(filename, idx): """update to be at appropriate content for iteration """ existing = None if idx is not None: with open(filename, 'rb') as old: existing = old.readlines() with open(filename, 'wb') as target: for line in filecontent(idx, existing): target.write(line) def hg(command, *args): """call a mercurial command with appropriate config and argument""" env = os.environ.copy() if 'CHGHG' in env: full_cmd = ['chg'] else: full_cmd = ['hg'] full_cmd.append('--quiet') full_cmd.append(command) if command == 'commit': # reproducible commit metadata full_cmd.extend(['--date', '0 0', '--user', 'test']) elif command == 'merge': # avoid conflicts by picking the local variant full_cmd.extend(['--tool', ':merge-local']) full_cmd.extend(args) env['HGRCPATH'] = '' return subprocess.check_call(full_cmd, env=env) def run(target): tmpdir = tempfile.mkdtemp(prefix='tmp-hg-test-big-file-bundle-') try: os.chdir(tmpdir) hg('init') updatefile(FILENAME, None) hg('commit', '--addremove', '--message', 'initial commit') for idx in range(1, NB_CHANGESET + 1): if sys.stdout.isatty(): print("generating commit #%d/%d" % (idx, NB_CHANGESET)) if (idx % PERIOD_BRANCHING) == 0: move_back = MOVE_BACK_MIN + (idx % MOVE_BACK_RANGE) hg('update', ".~%d" % move_back) if (idx % PERIOD_MERGING) == 0: hg('merge', 'min(head())') updatefile(FILENAME, idx) hg('commit', '--message', 'commit #%d' % idx) hg('bundle', '--all', target, '--config', 'devel.bundle.delta=p1') with open(target, 'rb') as bundle: data = bundle.read() digest = hashlib.md5(data).hexdigest() with open(target + '.md5', 'wb') as md5file: md5file.write(digest + '\n') if sys.stdout.isatty(): print('bundle generated at "%s" md5: %s' % (target, digest)) finally: shutil.rmtree(tmpdir) return 0 if __name__ == '__main__': orig = os.path.realpath(os.path.dirname(sys.argv[0])) target = os.path.join(orig, os.pardir, 'cache', BUNDLE_NAME) sys.exit(run(target)) mercurial-5.3.1/tests/artifacts/PURPOSE0000644015407300116100000000061413627755405017614 0ustar augieeng00000000000000This directory is meant to cache artifacts useful for tests (such as bundle). Those artifacts need to be cached because they are slow to regenerate on each test but too large to be tracked within the repository. They are not expected to change between each run and can be cached. The `./scripts/` contains code to generate the artifact while the `cache` directory contains resulting artifact. mercurial-5.3.1/tests/test-single-head.t0000644015407300116100000001730113627755405020077 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 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 not 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 Test that closing heads are ignored by default ----------------------------------------------- $ hg up 'desc("c_aG0")' 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ mkcommit c_aJ0 created new head pushing the new head should fails $ hg push -f pushing to $TESTTMP/single-head-server searching for changes adding changesets adding manifests adding file changes transaction abort! rollback completed abort: rejecting multiple heads on branch "branch_A" (2 heads: 49003e504178 468bd81ccc5d) [255] closing the head and pushing should succeed $ mkcommit c_aK0 --close-branch $ hg push -f pushing to $TESTTMP/single-head-server searching for changes adding changesets adding manifests adding file changes added 4 changesets with 4 changes to 4 files (-1 heads) Test that closing heads can be explicitly accounted for ------------------------------------------------------- $ cat <> $TESTTMP/single-head-server/.hg/hgrc > [experimental] > single-head-per-branch:account-closed-heads = yes > EOF $ hg up 'desc("c_aG0")' 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ mkcommit c_aL0 created new head $ mkcommit c_aM0 --close-branch $ hg push -f pushing to $TESTTMP/single-head-server searching for changes adding changesets adding manifests adding file changes transaction abort! rollback completed abort: rejecting multiple heads on branch "branch_A" (3 heads: 49003e504178 5254bcccab93 42b9fe70a3c1) [255] Test that config can be overriden as the boolean it is ------------------------------------------------------ $ cat <> $TESTTMP/single-head-server/.hg/hgrc > [experimental] > single-head-per-branch = no > EOF Because of previous test, we'll also push c_aL0 and c_aM0. $ hg out -T "{desc}\n" comparing with $TESTTMP/single-head-server searching for changes c_aL0 c_aM0 Let's make a new head and push everythin. The server feedback will mention exactly one new head because c_aM0 is closed. $ hg up 'desc("c_aG0")' 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ mkcommit c_aN0 created new head $ hg push -f pushing to $TESTTMP/single-head-server searching for changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 3 files (+1 heads) mercurial-5.3.1/tests/test-gendoc-ro.t0000644015407300116100000000072713627755405017600 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-5.3.1/tests/test-extdiff.t0000644015407300116100000003603313627755405017353 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 " > alabalaf = > [merge-tools] > alabalaf.executable = echo > alabalaf.diffargs = diffing > 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 --per-file compare each file instead of revision snapshots --confirm prompt user before each external program invocation --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] Test --per-file option: $ hg up -q -C 3 $ echo a2 > a $ echo b2 > b $ hg ci -d '3 0' -mtestmode1 created new head $ hg falabala -c 6 --per-file diffing "*\\extdiff.*\\a.46c0e4daeb72\\a" "a.81906f2b98ac\\a" (glob) (windows !) diffing */extdiff.*/a.46c0e4daeb72/a a.81906f2b98ac/a (glob) (no-windows !) diffing "*\\extdiff.*\\a.46c0e4daeb72\\b" "a.81906f2b98ac\\b" (glob) (windows !) diffing */extdiff.*/a.46c0e4daeb72/b a.81906f2b98ac/b (glob) (no-windows !) [1] Test --per-file option for gui tool: $ hg --config extdiff.gui.alabalaf=True alabalaf -c 6 --per-file --debug diffing */extdiff.*/a.46c0e4daeb72/* a.81906f2b98ac/* (glob) diffing */extdiff.*/a.46c0e4daeb72/* a.81906f2b98ac/* (glob) making snapshot of 2 files from rev 46c0e4daeb72 a b making snapshot of 2 files from rev 81906f2b98ac a b running '* diffing * *' in * (backgrounded) (glob) running '* diffing * *' in * (backgrounded) (glob) cleaning up temp directory [1] Test --per-file option for gui tool again: $ hg --config merge-tools.alabalaf.gui=True alabalaf -c 6 --per-file --debug diffing */extdiff.*/a.46c0e4daeb72/* a.81906f2b98ac/* (glob) diffing */extdiff.*/a.46c0e4daeb72/* a.81906f2b98ac/* (glob) making snapshot of 2 files from rev 46c0e4daeb72 a b making snapshot of 2 files from rev 81906f2b98ac a b running '* diffing * *' in * (backgrounded) (glob) running '* diffing * *' in * (backgrounded) (glob) cleaning up temp directory [1] Test --per-file and --confirm options: $ hg --config ui.interactive=True falabala -c 6 --per-file --confirm < n > y > EOF diff a (1 of 2) [Yns?] n diff b (2 of 2) [Yns?] y diffing "*\\extdiff.*\\a.46c0e4daeb72\\b" "a.81906f2b98ac\\b" (glob) (windows !) diffing */extdiff.*/a.46c0e4daeb72/b a.81906f2b98ac/b (glob) (no-windows !) [1] Test --per-file and --confirm options with skipping: $ hg --config ui.interactive=True falabala -c 6 --per-file --confirm < s > EOF diff a (1 of 2) [Yns?] s [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 > open('a/a', 'ab').write(b'edited\n') > open('a/b', 'ab').write(b'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) >>> with open("u", "wb") as f: ... n = f.write(b"\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' $ cd $TESTTMP Test that diffing a single file works, even if that file is new $ hg init testsinglefile $ cd testsinglefile $ echo a > a $ hg add a $ hg falabala diffing nul "*\\a" (glob) (windows !) diffing /dev/null */a (glob) (no-windows !) [1] $ hg ci -qm a $ hg falabala -c . diffing nul "*\\a" (glob) (windows !) diffing /dev/null */a (glob) (no-windows !) [1] $ echo a >> a $ hg falabala diffing "*\\a" "*\\a" (glob) (windows !) diffing */a */a (glob) (no-windows !) [1] $ hg ci -qm 2a $ hg falabala -c . diffing "*\\a" "*\\a" (glob) (windows !) diffing */a */a (glob) (no-windows !) [1] mercurial-5.3.1/tests/test-fix-topology.t0000644015407300116100000002226713627755405020366 0ustar augieeng00000000000000A script that implements uppercasing all letters in a file. $ UPPERCASEPY="$TESTTMP/uppercase.py" $ cat > $UPPERCASEPY < import sys > from mercurial.utils.procutil import setbinary > setbinary(sys.stdin) > setbinary(sys.stdout) > sys.stdout.write(sys.stdin.read().upper()) > EOF $ TESTLINES="foo\nbar\nbaz\n" $ printf $TESTLINES | "$PYTHON" $UPPERCASEPY FOO BAR BAZ Tests for the fix extension's behavior around non-trivial history topologies. Looks for correct incremental fixing and reproduction of parent/child relationships. We indicate fixed file content by uppercasing it. $ cat >> $HGRCPATH < [extensions] > fix = > [fix] > uppercase-whole-file:command="$PYTHON" $UPPERCASEPY > uppercase-whole-file:pattern=set:** > EOF This tests the only behavior that should really be affected by obsolescence, so we'll test it with evolution off and on. This only changes the revision numbers, if all is well. #testcases obsstore-off obsstore-on #if obsstore-on $ cat >> $HGRCPATH < [experimental] > evolution.createmarkers=True > evolution.allowunstable=True > EOF #endif Setting up the test topology. Scroll down to see the graph produced. We make it clear which files were modified in each revision. It's enough to test at the file granularity, because that demonstrates which baserevs were diffed against. The computation of changed lines is orthogonal and tested separately. $ hg init repo $ cd repo $ printf "aaaa\n" > a $ hg commit -Am "change A" adding a $ printf "bbbb\n" > b $ hg commit -Am "change B" adding b $ printf "cccc\n" > c $ hg commit -Am "change C" adding c $ hg checkout 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ printf "dddd\n" > d $ hg commit -Am "change D" adding d created new head $ hg merge -r 2 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ printf "eeee\n" > e $ hg commit -Am "change E" adding e $ hg checkout 0 0 files updated, 0 files merged, 4 files removed, 0 files unresolved $ printf "ffff\n" > f $ hg commit -Am "change F" adding f created new head $ hg checkout 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ printf "gggg\n" > g $ hg commit -Am "change G" adding g created new head $ hg merge -r 5 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ printf "hhhh\n" > h $ hg commit -Am "change H" adding h $ hg merge -r 4 4 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ printf "iiii\n" > i $ hg commit -Am "change I" adding i $ hg checkout 2 0 files updated, 0 files merged, 6 files removed, 0 files unresolved $ printf "jjjj\n" > j $ hg commit -Am "change J" adding j created new head $ hg checkout 7 3 files updated, 0 files merged, 3 files removed, 0 files unresolved $ printf "kkkk\n" > k $ hg add adding k $ hg log --graph --template '{rev} {desc}\n' o 9 change J | | o 8 change I | |\ | | @ 7 change H | | |\ | | | o 6 change G | | | | | | o | 5 change F | | |/ | o | 4 change E |/| | | o | 3 change D | |/ o | 2 change C | | o | 1 change B |/ o 0 change A Fix all but the root revision and its four children. #if obsstore-on $ hg fix -r '2|4|7|8|9' --working-dir #else $ hg fix -r '2|4|7|8|9' --working-dir saved backup bundle to * (glob) #endif The five revisions remain, but the other revisions were fixed and replaced. All parent pointers have been accurately set to reproduce the previous topology (though it is rendered in a slightly different order now). #if obsstore-on $ hg log --graph --template '{rev} {desc}\n' o 14 change J | | o 13 change I | |\ | | @ 12 change H | | |\ | o | | 11 change E |/| | | o | | | 10 change C | | | | | | | o 6 change G | | | | | | o | 5 change F | | |/ | o / 3 change D | |/ o / 1 change B |/ o 0 change A $ C=10 $ E=11 $ H=12 $ I=13 $ J=14 #else $ hg log --graph --template '{rev} {desc}\n' o 9 change J | | o 8 change I | |\ | | @ 7 change H | | |\ | o | | 6 change E |/| | | o | | | 5 change C | | | | | | | o 4 change G | | | | | | o | 3 change F | | |/ | o / 2 change D | |/ o / 1 change B |/ o 0 change A $ C=5 $ E=6 $ H=7 $ I=8 $ J=9 #endif Change C is a root of the set being fixed, so all we fix is what has changed since its parent. That parent, change B, is its baserev. $ hg cat -r $C 'set:**' aaaa bbbb CCCC Change E is a merge with only one parent being fixed. Its baserevs are the unfixed parent plus the baserevs of the other parent. This evaluates to changes B and D. We now have to decide what it means to incrementally fix a merge commit. We choose to fix anything that has changed versus any baserev. Only the undisturbed content of the common ancestor, change A, is unfixed. $ hg cat -r $E 'set:**' aaaa BBBB CCCC DDDD EEEE Change H is a merge with neither parent being fixed. This is essentially equivalent to the previous case because there is still only one baserev for each parent of the merge. $ hg cat -r $H 'set:**' aaaa FFFF GGGG HHHH Change I is a merge that has four baserevs; two from each parent. We handle multiple baserevs in the same way regardless of how many came from each parent. So, fixing change H will fix any files that were not exactly the same in each baserev. $ hg cat -r $I 'set:**' aaaa BBBB CCCC DDDD EEEE FFFF GGGG HHHH IIII Change J is a simple case with one baserev, but its baserev is not its parent, change C. Its baserev is its grandparent, change B. $ hg cat -r $J 'set:**' aaaa bbbb CCCC JJJJ The working copy was dirty, so it is treated much like a revision. The baserevs for the working copy are inherited from its parent, change H, because it is also being fixed. $ cat * aaaa FFFF GGGG HHHH KKKK Change A was never a baserev because none of its children were to be fixed. $ cd .. The --all flag should fix anything that wouldn't cause a problem if you fixed it, including the working copy. Obsolete revisions are not fixed because that could cause divergence. Public revisions would cause an abort because they are immutable. We can fix orphans because their successors are still just orphans of the original obsolete parent. When obsolesence is off, we're just fixing and replacing anything that isn't public. $ hg init fixall $ cd fixall #if obsstore-on $ printf "one\n" > foo.whole $ hg commit -Aqm "first" $ hg phase --public $ hg tag --local root $ printf "two\n" > foo.whole $ hg commit -m "second" $ printf "three\n" > foo.whole $ hg commit -m "third" --secret $ hg tag --local secret $ hg checkout root 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ printf "four\n" > foo.whole $ hg commit -m "fourth" created new head $ printf "five\n" > foo.whole $ hg commit -m "fifth" $ hg tag --local replaced $ printf "six\n" > foo.whole $ hg commit -m "sixth" $ hg checkout replaced 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ printf "seven\n" > foo.whole $ hg commit --amend 1 new orphan changesets $ hg checkout secret 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ printf "uncommitted\n" > foo.whole $ hg log --graph --template '{rev} {desc} {phase}\n' o 6 fifth draft | | * 5 sixth draft | | | x 4 fifth draft |/ o 3 fourth draft | | @ 2 third secret | | | o 1 second draft |/ o 0 first public $ hg fix --all $ hg log --graph --template '{rev} {desc}\n' -r 'sort(all(), topo)' --hidden o 11 fifth | o 9 fourth | | @ 8 third | | | o 7 second |/ | * 10 sixth | | | | x 5 sixth | |/ | x 4 fifth | | | | x 6 fifth | |/ | x 3 fourth |/ | x 2 third | | | x 1 second |/ o 0 first $ hg cat -r 7 foo.whole TWO $ hg cat -r 8 foo.whole THREE $ hg cat -r 9 foo.whole FOUR $ hg cat -r 10 foo.whole SIX $ hg cat -r 11 foo.whole SEVEN $ cat foo.whole UNCOMMITTED #else $ printf "one\n" > foo.whole $ hg commit -Aqm "first" $ hg phase --public $ hg tag --local root $ printf "two\n" > foo.whole $ hg commit -m "second" $ printf "three\n" > foo.whole $ hg commit -m "third" --secret $ hg tag --local secret $ hg checkout root 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ printf "four\n" > foo.whole $ hg commit -m "fourth" created new head $ printf "uncommitted\n" > foo.whole $ hg log --graph --template '{rev} {desc} {phase}\n' @ 3 fourth draft | | o 2 third secret | | | o 1 second draft |/ o 0 first public $ hg fix --all saved backup bundle to * (glob) $ hg log --graph --template '{rev} {desc} {phase}\n' @ 3 fourth draft | | o 2 third secret | | | o 1 second draft |/ o 0 first public $ hg cat -r 0 foo.whole one $ hg cat -r 1 foo.whole TWO $ hg cat -r 2 foo.whole THREE $ hg cat -r 3 foo.whole FOUR $ cat foo.whole UNCOMMITTED #endif $ cd .. mercurial-5.3.1/tests/test-unrelated-pull.t0000644015407300116100000000160413627755405020653 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-5.3.1/tests/test-obsmarkers-effectflag.t0000644015407300116100000001033213627755405022150 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-5.3.1/tests/remotefilelog-getflogheads.py0000644015407300116100000000111713627755405022414 0ustar augieeng00000000000000from __future__ import absolute_import from mercurial.i18n import _ from mercurial import ( hg, registrar, ) cmdtable = {} command = registrar.command(cmdtable) @command(b'getflogheads', [], b'path') def getflogheads(ui, repo, path): """ Extension printing a remotefilelog's heads Used for testing purpose """ dest = repo.ui.expandpath(b'default') peer = hg.peer(repo, {}, dest) flogheads = peer.x_rfl_getflogheads(path) if flogheads: for head in flogheads: ui.write(head + b'\n') else: ui.write(_(b'EMPTY\n')) mercurial-5.3.1/tests/test-excessive-merge.t0000644015407300116100000000536013627755405021014 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 linkrev nodeid p1 p2 0 0 5e0375449e74 000000000000 000000000000 1 1 96155394af80 5e0375449e74 000000000000 2 2 92cc4c306b19 5e0375449e74 000000000000 3 3 e16a66a37edd 92cc4c306b19 96155394af80 4 4 2ee31f665a86 96155394af80 92cc4c306b19 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 linkrev nodeid p1 p2 0 0 2ed2a3912a0b 000000000000 000000000000 1 1 79d7492df40a 2ed2a3912a0b 000000000000 $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 5 changesets with 4 changes to 2 files mercurial-5.3.1/tests/test-remotefilelog-keepset.t0000644015407300116100000000175213627755405022215 0ustar augieeng00000000000000#require no-windows $ . "$TESTDIR/remotefilelog-library.sh" $ hg init master $ cd master $ cat >> .hg/hgrc < [remotefilelog] > server=True > serverexpiration=-1 > EOF $ echo x > x $ hg commit -qAm x $ echo y > y $ hg commit -qAm y $ echo z > z $ hg commit -qAm z $ cd .. $ hgcloneshallow ssh://user@dummy/master shallow -q 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob) # Compute keepset for 0th and 2nd commit, which implies that we do not process # the 1st commit, therefore we diff 2nd manifest with the 0th manifest and # populate the keepkeys from the diff $ cd shallow $ cat >> .hg/hgrc < [remotefilelog] > pullprefetch=0+2 > EOF $ hg debugkeepset # Compute keepset for all commits, which implies that we only process deltas of # manifests of commits 1 and 2 and therefore populate the keepkeys from deltas $ cat >> .hg/hgrc < [remotefilelog] > pullprefetch=all() > EOF $ hg debugkeepset mercurial-5.3.1/tests/test-diff-ignore-whitespace.t0000644015407300116100000001776113627755405022254 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-5.3.1/tests/test-merge2.t0000644015407300116100000000215413627755405017100 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-5.3.1/tests/test-clone.t0000644015407300116100000010372613627755405017026 0ustar augieeng00000000000000#testcases sshv1 sshv2 #if sshv2 $ cat >> $HGRCPATH << EOF > [experimental] > sshpeer.advertise-v2 = true > sshserver.support-v2 = true > EOF #endif Prepare 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 'open("data1", "wb").write(b"".join(b"%d\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'): #if reporevlogstore $ 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 #endif Trigger branchcache creation: $ hg branches default 10:a7949464abda $ ls .hg/cache branch2-served 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 rbc-names-v1 rbc-revs-v1 $ cat a a $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 11 changesets with 11 changes to 2 files 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 files linking: 2 files linking: 3 files linking: 4 files linking: 5 files linking: 6 files linking: 7 files linking: 8 files linked 8 files (reporevlogstore !) linking: 9 files (reposimplestore !) linking: 10 files (reposimplestore !) linking: 11 files (reposimplestore !) linking: 12 files (reposimplestore !) linking: 13 files (reposimplestore !) linking: 14 files (reposimplestore !) linking: 15 files (reposimplestore !) linking: 16 files (reposimplestore !) linking: 17 files (reposimplestore !) linking: 18 files (reposimplestore !) linked 18 files (reposimplestore !) #else $ hg --debug clone -U . ../c --config progress.debug=true linking: 1 files copying: 2 files copying: 3 files copying: 4 files copying: 5 files copying: 6 files copying: 7 files copying: 8 files copied 8 files (reporevlogstore !) copying: 9 files (reposimplestore !) copying: 10 files (reposimplestore !) copying: 11 files (reposimplestore !) copying: 12 files (reposimplestore !) copying: 13 files (reposimplestore !) copying: 14 files (reposimplestore !) copying: 15 files (reposimplestore !) copying: 16 files (reposimplestore !) copying: 17 files (reposimplestore !) copying: 18 files (reposimplestore !) copied 18 files (reposimplestore !) #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 checked 11 changesets with 11 changes to 2 files 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 checked 11 changesets with 11 changes to 2 files 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 hg, ui as uimod > myui = uimod.ui.load() > repo = hg.repository(myui, b'a') > hg.clone(myui, {}, repo, dest=b"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 extensions, hg, ui as uimod > myui = uimod.ui.load() > extensions.loadall(myui) > extensions.populateui(myui) > repo = hg.repository(myui, b'a') > hg.clone(myui, {}, repo, dest=b"ua", branch=[b"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] Invalid URL $ hg clone http://invalid:url/a b abort: error: nonnumeric port: 'url' [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: Permission denied: *$TESTTMP/fail/a/.hg* (glob) [255] Inaccessible destination $ hg init b $ cd b $ hg clone . ../a abort: Permission denied: *../a* (glob) [255] $ cd .. $ chmod 700 a $ rm -r a b #endif #if fifo Source of wrong type $ mkfifo a $ hg clone a b abort: $ENOTDIR$: *$TESTTMP/fail/a/.hg* (glob) [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 -R src debugrevlog -c | egrep 'format|flags' format : 0 flags : (none) $ hg root -R src -T json | sed 's|\\\\|\\|g' [ { "hgpath": "$TESTTMP/src/.hg", "reporoot": "$TESTTMP/src", "storepath": "$TESTTMP/src/.hg" } ] $ 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 1 new obsolescence markers 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 adding remote bookmark head1 adding remote bookmark head2 added 4 changesets with 4 changes to 1 files (+4 heads) 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 adding remote bookmark head1 adding remote bookmark head2 added 1 changesets with 1 changes to 1 files (+1 heads) 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 upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) 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 upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) 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 upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) 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 upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) 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 upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) 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-5.3.1/tests/test-wireproto-command-lookup.t0000644015407300116100000000117713627755405022700 0ustar augieeng00000000000000 $ . $TESTDIR/wireprotohelpers.sh $ hg init server $ enablehttpv2 server $ cd server $ cat >> .hg/hgrc << EOF > [web] > push_ssl = false > allow-push = * > EOF $ hg debugdrawdag << EOF > C D > |/ > B > | > A > EOF $ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS lookup for known node works $ sendhttpv2peer << EOF > command lookup > key 426bada5c67598ca65036d57d9e4b64b0c1ce7a0 > EOF creating http peer for wire protocol version 2 sending lookup command response: b'Bk\xad\xa5\xc6u\x98\xcae\x03mW\xd9\xe4\xb6K\x0c\x1c\xe7\xa0' $ cat error.log mercurial-5.3.1/tests/test-automv.t0000644015407300116100000001574113627755405017240 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-5.3.1/tests/test-sparse-merges.t0000644015407300116100000001075713627755405020504 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) $ cd .. Tests merging a file which is modified in one branch and deleted in another and file is excluded from sparse checkout $ hg init ytest $ cd ytest $ echo "syntax: glob" >> .hgignore $ echo "*.orig" >> .hgignore $ hg ci -Aqm "added .hgignore" $ for ch in a d; do echo foo > $ch; hg ci -Aqm "added "$ch; done; $ cat >> .hg/hgrc < [alias] > glog = log -GT "{rev}:{node|short} {desc}" > [extensions] > sparse = > EOF $ hg glog @ 2:f29feff37cfc added d | o 1:617125d27d6b added a | o 0:53f3774ed939 added .hgignore $ hg rm d $ hg ci -m "removed d" $ hg up '.^' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg debugsparse --reset $ echo bar >> d $ hg ci -Am "added bar to d" created new head $ hg glog @ 4:6527874a90e4 added bar to d | | o 3:372c8558de45 removed d |/ o 2:f29feff37cfc added d | o 1:617125d27d6b added a | o 0:53f3774ed939 added .hgignore $ hg debugsparse --exclude "d" $ ls a $ hg merge temporarily included 1 file(s) in the sparse checkout for merging file 'd' was deleted in other [merge rev] but was modified in local [working copy]. You can use (c)hanged version, (d)elete, or leave (u)nresolved. What do you want to do? 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] $ cd .. Testing merging of a file which is renamed+modified on one side and modified on another $ hg init mvtest $ cd mvtest $ echo "syntax: glob" >> .hgignore $ echo "*.orig" >> .hgignore $ hg ci -Aqm "added .hgignore" $ for ch in a d; do echo foo > $ch; hg ci -Aqm "added "$ch; done; $ cat >> .hg/hgrc < [alias] > glog = log -GT "{rev}:{node|short} {desc}" > [extensions] > sparse = > EOF $ hg glog @ 2:f29feff37cfc added d | o 1:617125d27d6b added a | o 0:53f3774ed939 added .hgignore $ echo babar >> a $ hg ci -m "added babar to a" $ hg up '.^' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg mv a amove $ hg ci -m "moved a to amove" created new head $ hg up 3 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg glog o 4:5d1e85955f6d moved a to amove | | @ 3:a06e41a6c16c added babar to a |/ o 2:f29feff37cfc added d | o 1:617125d27d6b added a | o 0:53f3774ed939 added .hgignore $ hg debugsparse --exclude "a" $ ls d $ hg merge temporarily included 1 file(s) in the sparse checkout for merging merging a and amove to amove 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg up -C 4 cleaned up 1 temporarily added file(s) from the sparse checkout 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge merging amove and a to amove abort: cannot add 'a' - it is outside the sparse checkout (include file with `hg debugsparse --include ` or use `hg add -s ` to include file directory while adding) [255] mercurial-5.3.1/tests/test-arbitraryfilectx.t0000644015407300116100000000513513627755405021277 0ustar augieeng00000000000000Setup: $ cat > eval.py < from __future__ import absolute_import > import filecmp > from mercurial import commands, context, pycompat, registrar > cmdtable = {} > command = registrar.command(cmdtable) > @command(b'eval', [], b'hg eval CMD') > def eval_(ui, repo, *cmds, **opts): > cmd = b" ".join(cmds) > res = pycompat.bytestr(eval(cmd, globals(), locals())) > ui.warn(b"%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(b'A', repo).cmp(repo[None][b'real_A'])" True (no-eol) $ hg eval "not filecmp.cmp(b'A', b'real_A')" True (no-eol) These files are identical and should return False (same): $ hg eval "context.arbitraryfilectx(b'A', repo).cmp(repo[None][b'A'])" False (no-eol) $ hg eval "context.arbitraryfilectx(b'A', repo).cmp(repo[None][b'B'])" False (no-eol) $ hg eval "not filecmp.cmp(b'A', b'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(b'real_A', repo).cmp(repo[None][b'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(b'real_A', b'sym_A')" True (no-eol) #else $ hg eval "not filecmp.cmp(b'real_A', b'sym_A')" False (no-eol) #endif mercurial-5.3.1/tests/test-template-functions.t0000644015407300116100000012043213627755405021540 0ustar augieeng00000000000000Test template filters and functions =================================== $ 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' 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 phase -r 5 --public $ hg phase -r 7 --secret --force 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', 'wb') >>> n = datetime.datetime.now() + datetime.timedelta(366 * 7) >>> fp.write(b'%d-%d-%d 00:00' % (n.year, n.month, n.day)) and None >>> 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| $ hg debugtemplate '{"foo/bar"|dirname}|{"foo/"|dirname}|{"foo"|dirname}|\n' foo|foo|| $ hg debugtemplate '{"foo/bar"|stripdir}|{"foo/"|stripdir}|{"foo"|stripdir}|\n' foo|foo|foo| commondir() filter: $ hg debugtemplate '{""|splitlines|commondir}\n' $ hg debugtemplate '{"foo/bar\nfoo/baz\nfoo/foobar\n"|splitlines|commondir}\n' foo $ hg debugtemplate '{"foo/bar\nfoo/bar\n"|splitlines|commondir}\n' foo $ hg debugtemplate '{"/foo/bar\n/foo/bar\n"|splitlines|commondir}\n' foo $ hg debugtemplate '{"/foo\n/foo\n"|splitlines|commondir}\n' $ hg debugtemplate '{"foo/bar\nbar/baz"|splitlines|commondir}\n' $ hg debugtemplate '{"foo/bar\nbar/baz\nbar/foo\n"|splitlines|commondir}\n' $ hg debugtemplate '{"foo/../bar\nfoo/bar"|splitlines|commondir}\n' foo $ hg debugtemplate '{"foo\n/foo"|splitlines|commondir}\n' $ hg log -r null -T '{rev|commondir}' hg: parse error: argument is not a list of text (template filter 'commondir' is not compatible with keyword 'rev') [255] 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 $ hg log -l1 -T '{termwidth|count}\n' hg: parse error: not countable (template filter 'count' is not compatible with keyword 'termwidth') [255] 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' 1000000.00 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" Pass generator object created by template function to filter $ hg log -l 1 --template '{if(author, author)|user}\n' test 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 $ hg --config diff.git=true log -r 8 -T "{diff()}" diff --git a/second b/fourth rename from second rename to fourth diff --git a/third b/third new file mode 100644 --- /dev/null +++ b/third @@ -0,0 +1,1 @@ +third $ cd .. latesttag() function: $ 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' $ hg tag -r 1 -m t1 -d '6 0' t1 $ hg tag -r 2 -m t2 -d '7 0' t2 $ hg tag -r 3 -m t3 -d '8 0' t3 $ hg tag -r 4 -m t4 -d '4 0' t4 # older than t2, but should not matter $ 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('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 .. Test filter() empty values: $ hg log -R a -r 1 -T '{filter(desc|splitlines) % "{line}\n"}' other 1 other 2 other 3 $ hg log -R a -r 0 -T '{filter(dict(a=0, b=1) % "{ifeq(key, "a", "{value}\n")}")}' 0 0 should not be falsy $ hg log -R a -r 0 -T '{filter(revset("0:2"))}\n' 0 1 2 Test filter() by expression: $ hg log -R a -r 1 -T '{filter(desc|splitlines, ifcontains("1", line, "t"))}\n' other 1 $ hg log -R a -r 0 -T '{filter(dict(a=0, b=1), ifeq(key, "b", "t"))}\n' b=1 Test filter() shouldn't crash: $ hg log -R a -r 0 -T '{filter(extras)}\n' branch=default $ hg log -R a -r 0 -T '{filter(files)}\n' a Test filter() unsupported arguments: $ hg log -R a -r 0 -T '{filter()}\n' hg: parse error: filter expects one or two arguments [255] $ hg log -R a -r 0 -T '{filter(date)}\n' hg: parse error: date is not iterable [255] $ hg log -R a -r 0 -T '{filter(rev)}\n' hg: parse error: 0 is not iterable [255] $ hg log -R a -r 0 -T '{filter(desc|firstline)}\n' hg: parse error: 'line 1' is not filterable [255] $ hg log -R a -r 0 -T '{filter(manifest)}\n' hg: parse error: '0:a0c8bcbbb45c' is not filterable [255] $ hg log -R a -r 0 -T '{filter(succsandmarkers)}\n' hg: parse error: not filterable without template [255] $ hg log -R a -r 0 -T '{filter(desc|splitlines % "{line}", "")}\n' hg: parse error: not filterable by expression [255] Test manifest/get() can be join()-ed as string, though it's silly: $ hg log -R latesttag -r tip -T '{join(manifest, ".")}\n' 1.1.:.2.b.c.6.e.9.0.0.6.c.e.2 $ hg log -R latesttag -r tip -T '{join(get(extras, "branch"), ".")}\n' d.e.f.a.u.l.t Test join() over string $ hg log -R latesttag -r tip -T '{join(rev|stringify, ".")}\n' 1.1 Test join() over uniterable $ hg log -R latesttag -r tip -T '{join(rev, "")}\n' hg: parse error: 11 is not iterable [255] 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 min/max over map operation: $ hg log -R latesttag -r3 -T '{min(tags % "{tag}")}\n' at3 $ hg log -R latesttag -r3 -T '{max(tags % "{tag}")}\n' t3 Test min/max of strings: $ hg log -R latesttag -l1 -T '{min(desc)}\n' 3 $ hg log -R latesttag -l1 -T '{max(desc)}\n' t Test min/max of non-iterable: $ hg debugtemplate '{min(1)}' hg: parse error: 1 is not iterable (min first argument should be an iterable) [255] $ hg debugtemplate '{max(2)}' hg: parse error: 2 is not iterable (max first argument should be an iterable) [255] $ hg log -R latesttag -l1 -T '{min(date)}' hg: parse error: date is not iterable (min first argument should be an iterable) [255] $ hg log -R latesttag -l1 -T '{max(date)}' hg: parse error: date is not iterable (max first argument should be an iterable) [255] Test min/max of empty sequence: $ hg debugtemplate '{min("")}' hg: parse error: empty string (min first argument should be an iterable) [255] $ hg debugtemplate '{max("")}' hg: parse error: empty string (max first argument should be an iterable) [255] $ hg debugtemplate '{min(dict())}' hg: parse error: empty sequence (min first argument should be an iterable) [255] $ hg debugtemplate '{max(dict())}' hg: parse error: empty sequence (max first argument should be an iterable) [255] $ hg debugtemplate '{min(dict() % "")}' hg: parse error: empty sequence (min first argument should be an iterable) [255] $ hg debugtemplate '{max(dict() % "")}' hg: parse error: empty sequence (max first argument should be an iterable) [255] Test min/max of if() result $ cd latesttag $ hg log -l1 -T '{min(if(true, revset("9:10"), ""))}\n' 9 $ hg log -l1 -T '{max(if(false, "", revset("9:10")))}\n' 10 $ hg log -l1 -T '{min(ifcontains("a", "aa", revset("9:10"), ""))}\n' 9 $ hg log -l1 -T '{max(ifcontains("a", "bb", "", revset("9:10")))}\n' 10 $ hg log -l1 -T '{min(ifeq(0, 0, revset("9:10"), ""))}\n' 9 $ hg log -l1 -T '{max(ifeq(0, 1, "", revset("9:10")))}\n' 10 $ cd .. Test laziness of if() then/else clause $ hg debugtemplate '{count(0)}' hg: parse error: not countable (incompatible use of template filter 'count') [255] $ hg debugtemplate '{if(true, "", count(0))}' $ hg debugtemplate '{if(false, count(0), "")}' $ hg debugtemplate '{ifcontains("a", "aa", "", count(0))}' $ hg debugtemplate '{ifcontains("a", "bb", count(0), "")}' $ hg debugtemplate '{ifeq(0, 0, "", count(0))}' $ hg debugtemplate '{ifeq(0, 1, count(0), "")}' Test search() function: $ hg log -R a -r2 -T '{desc}\n' no person $ hg log -R a -r2 -T '{search(r"p.*", desc)}\n' person as bool $ hg log -R a -r2 -T '{if(search(r"p.*", desc), "", "not ")}found\n' found $ hg log -R a -r2 -T '{if(search(r"q", desc), "", "not ")}found\n' not found match as json $ hg log -R a -r2 -T '{search(r"(no) p.*", desc)|json}\n' {"0": "no person", "1": "no"} $ hg log -R a -r2 -T '{search(r"q", desc)|json}\n' null group reference $ hg log -R a -r2 -T '{search(r"(no) (p.*)", desc) % "{1|upper} {2|hex}"}\n' NO 706572736f6e $ hg log -R a -r2 -T '{search(r"(?P[a-z]*)", desc) % "{foo}"}\n' no $ hg log -R a -r2 -T '{search(r"(?P[a-z]*)", desc).foo}\n' no group reference with no match $ hg log -R a -r2 -T '{search(r"q", desc) % "match: {0}"}\n' bad group names $ hg log -R a -r2 -T '{search(r"(?P<0>.)", desc) % "{0}"}\n' hg: parse error: search got an invalid pattern: (?P<0>.) [255] $ hg log -R a -r2 -T '{search(r"(?P.)", desc) % "{repo}"}\n' hg: parse error: invalid group 'repo' in search pattern: (?P.) [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] Set up repository containing template fragments in commit metadata: $ hg init r $ cd r $ echo a > a $ hg ci -Am '{rev}' adding a $ hg branch -q 'text.{rev}' $ echo aa >> aa $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped' 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) pad() with truncate has to strip color codes, though $ hg debugtemplate --color=always \ > '{pad(label(red, "scarlet"), 5, truncate=true)}\n' scarl 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: not a dictionary (get() expects a dict as first argument) [255] Test json filter applied to wrapped object: $ hg log -r0 -T '{files|json}\n' ["a"] $ hg log -r0 -T '{extras|json}\n' {"branch": "default"} $ hg log -r0 -T '{date|json}\n' [0, 0] Test json filter applied to map result: $ hg log -r0 -T '{json(extras % "{key}")}\n' ["branch"] 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 '{shortest(node, 1)}\n' -r null 00 $ 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 $ hg log --template '{shortest("f")}\n' -l1 f $ hg log --template '{shortest("0123456789012345678901234567890123456789")}\n' -l1 0123456789012345678901234567890123456789 $ hg log --template '{shortest("01234567890123456789012345678901234567890123456789")}\n' -l1 01234567890123456789012345678901234567890123456789 $ hg log --template '{shortest("not a hex string")}\n' -l1 not a hex string $ hg log --template '{shortest("not a hex string, but it'\''s 40 bytes long")}\n' -l1 not a hex string, but it's 40 bytes long $ hg log --template '{shortest("ffffffffffffffffffffffffffffffffffffffff")}\n' -l1 ffff $ hg log --template '{shortest("fffffff")}\n' -l1 ffff $ hg log --template '{shortest("ff")}\n' -l1 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 1 new obsolescence markers obsoleted 1 changesets $ hg debugobsolete c5623987d205cd6d9d8389bfc40fff9dbb670b48 1 new obsolescence markers obsoleted 1 changesets $ hg debugobsolete c562ddd9c94164376c20b86b0b4991636a3bf84f 1 new obsolescence markers 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 $ hg --config experimental.revisions.prefixhexnode=yes log -r 4 -T '{rev}:{shortest(node, 0)}\n' 4:x10 $ hg --config experimental.revisions.prefixhexnode=yes log -r 4 -T '{rev}:{shortest(node, 0)}\n' --hidden 4:x10 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 prefixhexnode when the first character of the hash is 0. $ hg init hashcollision2 $ cd hashcollision2 $ cat <> .hg/hgrc > [experimental] > evolution.createmarkers=True > EOF $ echo 0 > a $ hg ci -qAm 0 $ echo 21 > a $ hg ci -qm 21 $ hg up -q null $ hg log -r0: -T '{rev}:{node}\n' 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a 1:0cf177ba2b1dc3862a00fb81715fec90950201be we need the 'x' prefix to ensure we aren't colliding with rev0. We identify the collision with nullid if we aren't using disambiguatewithin, so we need to set that as well. $ hg --config experimental.revisions.disambiguatewithin='descendants(0)' \ > --config experimental.revisions.prefixhexnode=yes \ > log -r 1 -T '{rev}:{shortest(node, 0)}\n' 1:x0 $ hg debugobsolete 0cf177ba2b1dc3862a00fb81715fec90950201be 1 new obsolescence markers obsoleted 1 changesets $ hg up -q 0 $ echo 61 > a $ hg ci -m 61 $ hg log -r0: -T '{rev}:{node}\n' 0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a 2:01384dde84b3a511ae0835f35ac40bd806c99bb8 we still have the 'x' prefix because '0' is still the shortest prefix, since rev1's '0c' is hidden. $ hg --config experimental.revisions.disambiguatewithin=0:-1-0 \ > --config experimental.revisions.prefixhexnode=yes \ > log -r 0:-1-0 -T '{rev}:{shortest(node, 0)}\n' 2:x0 we don't have the 'x' prefix on 2 because '01' is not a synonym for rev1. $ hg --config experimental.revisions.disambiguatewithin=0:-1-0 \ > --config experimental.revisions.prefixhexnode=yes \ > log -r 0:-1-0 -T '{rev}:{shortest(node, 0)}\n' --hidden 1:0c 2:01 $ 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 $ hg log --template '{pad(author, 5, "-", False, True)}\n' test- {node test- $ hg log --template '{pad(author, 5, "-", True, True)}\n' -test hort} -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(min(revset(r"0")), "0 of hybriditem is also True")}\n' 0 of hybriditem is also True $ 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(revset(r"0"), "non-empty list is True")}\n' non-empty list is True $ hg log -r 0 -T '{if(revset(r"0") % "", "list of empty strings is True")}\n' list of empty strings is True $ 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 $ hg log -l1 -T '{ifcontains("branch", extras, "t", "f")}\n' t $ hg log -l1 -T '{ifcontains("branch", extras % "{key}", "t", "f")}\n' t $ hg log -l1 -T '{ifcontains("branc", extras % "{key}", "t", "f")}\n' f $ hg log -l1 -T '{ifcontains("branc", stringify(extras % "{key}"), "t", "f")}\n' t 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 $ hg log -l1 -T "{files('aa') % '{file}\n'}" aa $ hg log -l1 -T "{files('aa') % '{path}\n'}" aa $ hg rm a $ hg log -r "wdir()" -T "{rev}\n{join(files('*'), '\n')}\n" 2147483647 aa b $ hg revert a 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 Test stringify on sub expressions $ 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 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 indent with empty first line $ hg version -T "{indent('', '>> ')}\n" $ hg version -T "{indent(' > second', '>> ')}\n" >> second $ hg version -T "{indent(' > second', '>> ', ' > ')}\n" >> second Test with non-strings like dates $ hg log -T "{indent(date, ' ')}\n" -r 2:3 -R a 1200000.00 1300000.00 Test cbor filter: $ cat <<'EOF' > "$TESTTMP/decodecbor.py" > from __future__ import absolute_import > from mercurial import ( > dispatch, > pycompat, > ) > from mercurial.utils import ( > cborutil, > stringutil, > ) > dispatch.initstdio() > items = cborutil.decodeall(pycompat.stdin.read()) > pycompat.stdout.write(stringutil.pprint(items, indent=1) + b'\n') > EOF $ hg log -T "{rev|cbor}" -R a -l2 | "$PYTHON" "$TESTTMP/decodecbor.py" [ 10, 9 ] $ hg log -T "{extras|cbor}" -R a -l1 | "$PYTHON" "$TESTTMP/decodecbor.py" [ { 'branch': 'default' } ] 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" Set up repository for non-ascii encoding tests: $ hg init nonascii $ cd nonascii $ "$PYTHON" < open('latin1', 'wb').write(b'\xe9') > open('utf-8', 'wb').write(b'\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 should take input as utf-8 if it was converted from utf-8: $ HGENCODING=latin-1 hg log -T "{branch|json}\n" -r0 "\u00e9" $ HGENCODING=latin-1 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" cbor filter is bytes transparent, which should handle bytes subtypes as bytes: $ HGENCODING=ascii hg log -T "{branch|cbor}" -r0 \ > | "$PYTHON" "$TESTTMP/decodecbor.py" [ '?' ] $ HGENCODING=latin-1 hg log -T "{branch|cbor}" -r0 \ > | "$PYTHON" "$TESTTMP/decodecbor.py" [ '\xe9' ] 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 "coerced to string: {rev|utf8}\n" -r0 coerced to string: 0 pad width: $ HGENCODING=utf-8 hg debugtemplate "{pad('`cat utf-8`', 2, '-')}\n" \xc3\xa9- (esc) read config options: $ hg log -T "{config('templateconfig', 'knob', 'foo')}\n" foo $ hg log -T "{config('templateconfig', 'knob', 'foo')}\n" \ > --config templateconfig.knob=bar bar $ hg log -T "{configbool('templateconfig', 'knob', True)}\n" True $ hg log -T "{configbool('templateconfig', 'knob', True)}\n" \ > --config templateconfig.knob=0 False $ hg log -T "{configint('templateconfig', 'knob', 123)}\n" 123 $ hg log -T "{configint('templateconfig', 'knob', 123)}\n" \ > --config templateconfig.knob=456 456 $ hg log -T "{config('templateconfig', 'knob')}\n" devel-warn: config item requires an explicit default value: 'templateconfig.knob' at: * (glob) $ hg log -T "{configbool('ui', 'interactive')}\n" False $ hg log -T "{configbool('ui', 'interactive')}\n" --config ui.interactive=1 True $ hg log -T "{config('templateconfig', 'knob', if(true, 'foo', 'bar'))}\n" foo $ cd .. mercurial-5.3.1/tests/test-convert-datesort.t0000644015407300116100000000675113627755405021231 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-5.3.1/tests/test-merge8.t0000644015407300116100000000132713627755405017107 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-5.3.1/tests/test-mq-header-from.t0000644015407300116100000004737013627755405020534 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-5.3.1/tests/test-debugrename.t0000644015407300116100000000056313627755405020177 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-5.3.1/tests/dummyssh0000755015407300116100000000114213627755405016350 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.encode('latin1'))) log.write(b"\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-5.3.1/tests/test-releasenotes-formatting.t0000644015407300116100000002136113627755405022561 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 specify both --list and --rev [255] $ hg releasenotes -l -c abort: cannot specify 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. $ cd .. Using multiple admonitions in same changeset $ hg init relnotes-multiadmon $ cd relnotes-multiadmon $ touch file1 $ hg -q commit -A -l - << EOF > commit 1 > > .. feature:: > > Details about new feature. > > .. perf:: > > Improves the execution by 2x > EOF $ hg releasenotes -r . $TESTTMP/relnotes-multiple-admonitions $ cat $TESTTMP/relnotes-multiple-admonitions New Features ============ * Details about new feature. Performance Improvements ======================== * Improves the execution by 2x mercurial-5.3.1/tests/test-sparse-profiles.t0000644015407300116100000001267713627755405021050 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 2 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 2 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-5.3.1/tests/test-narrow-widen.t0000644015407300116100000002171213627755405020334 0ustar augieeng00000000000000#testcases flat tree $ . "$TESTDIR/narrow-library.sh" $ cat >> $HGRCPATH < [alias] > l = log -G -T "{if(ellipsis, '...')}{rev}: {desc}\n" > EOF #if tree $ cat << EOF >> $HGRCPATH > [experimental] > treemanifest = 1 > EOF #endif $ hg init master $ cd master $ cat >> .hg/hgrc < [narrow] > serveellipses=True > EOF $ mkdir inside $ echo 'inside' > inside/f $ hg add inside/f $ hg commit -m 'add inside' $ mkdir widest $ echo 'widest' > widest/f $ hg add widest/f $ hg commit -m 'add widest' $ mkdir outside $ echo 'outside' > outside/f $ hg add outside/f $ hg commit -m 'add outside' $ cd .. narrow clone the inside file $ hg clone --narrow ssh://user@dummy/master narrow --include inside requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 1 changes to 1 files new changesets *:* (glob) updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd narrow $ hg tracked I path:inside $ ls inside $ cat inside/f inside $ cd .. add more upstream files which we will include in a wider narrow spec $ cd master $ mkdir wider $ echo 'wider' > wider/f $ hg add wider/f $ echo 'widest v2' > widest/f $ hg commit -m 'add wider, update widest' $ echo 'widest v3' > widest/f $ hg commit -m 'update widest v3' $ echo 'inside v2' > inside/f $ hg commit -m 'update inside' $ mkdir outside2 $ echo 'outside2' > outside2/f $ hg add outside2/f $ hg commit -m 'add outside2' $ echo 'widest v4' > widest/f $ hg commit -m 'update widest v4' $ hg l @ 7: update widest v4 | o 6: add outside2 | o 5: update inside | o 4: update widest v3 | o 3: add wider, update widest | o 2: add outside | o 1: add widest | o 0: add inside $ cd .. Widen the narrow spec to see the widest file. This should not get the newly added upstream revisions. $ cd narrow $ hg l @ ...1: add outside | o 0: add inside $ hg tracked --addinclude widest/f comparing with ssh://user@dummy/master searching for changes saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob) adding changesets adding manifests adding file changes added 3 changesets with 2 changes to 2 files $ hg l @ ...2: add outside | o 1: add widest | o 0: add inside $ hg tracked I path:inside I path:widest/f $ cat widest/f widest Pull down the newly added upstream revision. $ hg pull pulling from ssh://user@dummy/master searching for changes adding changesets adding manifests adding file changes added 5 changesets with 4 changes to 2 files new changesets *:* (glob) (run 'hg update' to get a working copy) $ hg update -r 'desc("add wider")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat widest/f widest v2 $ hg update -r 'desc("update inside")' 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat widest/f widest v3 $ cat inside/f inside v2 $ hg l o 7: update widest v4 | o ...6: add outside2 | @ 5: update inside | o 4: update widest v3 | o 3: add wider, update widest | o ...2: add outside | o 1: add widest | o 0: add inside Check that widening with a newline fails $ hg tracked --addinclude 'widest > ' abort: newlines are not allowed in narrowspec paths [255] widen the narrow spec to include the wider file $ hg tracked --addinclude wider comparing with ssh://user@dummy/master searching for changes saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob) adding changesets adding manifests adding file changes added 8 changesets with 7 changes to 3 files $ hg tracked I path:inside I path:wider I path:widest/f $ hg update 'desc("add widest")' 2 files updated, 0 files merged, 1 files removed, 0 files unresolved $ cat widest/f widest $ hg update 'desc("add wider, update widest")' 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat wider/f wider $ cat widest/f widest v2 $ hg update 'desc("update widest v3")' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat widest/f widest v3 $ hg update 'desc("update widest v4")' 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat widest/f widest v4 $ hg l @ 7: update widest v4 | o ...6: add outside2 | o 5: update inside | o 4: update widest v3 | o 3: add wider, update widest | o ...2: add outside | o 1: add widest | o 0: add inside separate suite of tests: files from 0-10 modified in changes 0-10. This allows more obvious precise tests tickling particular corner cases. $ cd .. $ hg init upstream $ cd upstream $ cat >> .hg/hgrc < [narrow] > serveellipses=True > EOF $ for x in `$TESTDIR/seq.py 0 10` > do > mkdir d$x > echo $x > d$x/f > hg add d$x/f > hg commit -m "add d$x/f" > done $ hg log -T "{rev}: {desc}\n" 10: add d10/f 9: add d9/f 8: add d8/f 7: add d7/f 6: add d6/f 5: add d5/f 4: add d4/f 3: add d3/f 2: add d2/f 1: add d1/f 0: add d0/f make narrow clone with every third node. $ cd .. $ hg clone --narrow ssh://user@dummy/upstream narrow2 --include d0 --include d3 --include d6 --include d9 requesting all changes adding changesets adding manifests adding file changes added 8 changesets with 4 changes to 4 files new changesets *:* (glob) updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd narrow2 $ hg tracked I path:d0 I path:d3 I path:d6 I path:d9 $ hg verify checking changesets checking manifests checking directory manifests (tree !) crosschecking files in changesets and manifests checking files checked 8 changesets with 4 changes to 4 files $ hg l @ ...7: add d10/f | o 6: add d9/f | o ...5: add d8/f | o 4: add d6/f | o ...3: add d5/f | o 2: add d3/f | o ...1: add d2/f | o 0: add d0/f $ hg tracked --addinclude d1 comparing with ssh://user@dummy/upstream searching for changes saved backup bundle to $TESTTMP/narrow2/.hg/strip-backup/*-widen.hg (glob) adding changesets adding manifests adding file changes added 9 changesets with 5 changes to 5 files $ hg tracked I path:d0 I path:d1 I path:d3 I path:d6 I path:d9 $ hg l @ ...8: add d10/f | o 7: add d9/f | o ...6: add d8/f | o 5: add d6/f | o ...4: add d5/f | o 3: add d3/f | o ...2: add d2/f | o 1: add d1/f | o 0: add d0/f Verify shouldn't claim the repo is corrupt after a widen. $ hg verify checking changesets checking manifests checking directory manifests (tree !) crosschecking files in changesets and manifests checking files checked 9 changesets with 5 changes to 5 files Widening preserves parent of local commit $ cd .. $ hg clone -q --narrow ssh://user@dummy/upstream narrow3 --include d2 -r 2 $ cd narrow3 $ hg l @ 1: add d2/f | o ...0: add d1/f $ hg pull -q -r 3 $ hg co -q tip $ hg pull -q -r 4 $ echo local > d2/f $ hg ci -m local created new head $ hg l @ 4: local | | o ...3: add d4/f |/ o ...2: add d3/f | o 1: add d2/f | o ...0: add d1/f $ hg tracked -q --addinclude d0 --addinclude d9 $ hg l @ 5: local | | o ...4: add d4/f |/ o ...3: add d3/f | o 2: add d2/f | o ...1: add d1/f | o 0: add d0/f Widening preserves bookmarks $ cd .. $ hg clone -q --narrow ssh://user@dummy/upstream narrow-bookmarks --include d4 $ cd narrow-bookmarks $ echo local > d4/f $ hg ci -m local $ hg bookmarks bookmark $ hg bookmarks * bookmark 3:* (glob) $ hg -q tracked --addinclude d2 $ hg bookmarks * bookmark 5:* (glob) $ hg log -r bookmark -T '{desc}\n' local Widening that fails can be recovered from $ cd .. $ hg clone -q --narrow ssh://user@dummy/upstream interrupted --include d0 $ cd interrupted $ echo local > d0/f $ hg ci -m local $ hg l @ 2: local | o ...1: add d10/f | o 0: add d0/f $ hg bookmarks bookmark $ hg --config hooks.pretxnchangegroup.bad=false tracked --addinclude d1 comparing with ssh://user@dummy/upstream searching for changes saved backup bundle to $TESTTMP/interrupted/.hg/strip-backup/*-widen.hg (glob) adding changesets adding manifests adding file changes transaction abort! rollback completed abort: pretxnchangegroup.bad hook exited with status 1 [255] $ hg l $ hg bookmarks no bookmarks set $ hg unbundle .hg/strip-backup/*-widen.hg adding changesets adding manifests adding file changes added 3 changesets with 2 changes to 1 files new changesets *:* (glob) (run 'hg update' to get a working copy) $ hg l o 2: local | o ...1: add d10/f | o 0: add d0/f $ hg bookmarks * bookmark 2:* (glob) mercurial-5.3.1/tests/test-histedit-obsolete.t0000644015407300116100000003701513627755405021352 0ustar augieeng00000000000000#testcases abortcommand abortflag #if abortflag $ cat >> $HGRCPATH < [alias] > abort = histedit --abort > EOF #endif $ . "$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 $ 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 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 changesets (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 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 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] #if abortcommand when in dry-run mode $ hg abort --dry-run histedit in progress, will be aborted #endif $ hg 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-5.3.1/tests/test-newbranch.t0000644015407300116100000003016513627755405017671 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, specify rev with -r) [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, specify rev with -r) [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-5.3.1/tests/test-rust-ancestor.py0000644015407300116100000001261113627755405020714 0ustar augieeng00000000000000from __future__ import absolute_import import sys import unittest from mercurial import ( error, node, ) from mercurial.testing import revlog as revlogtesting try: from mercurial import rustext rustext.__name__ # trigger immediate actual import except ImportError: rustext = None else: # this would fail already without appropriate ancestor.__package__ from mercurial.rustext.ancestor import ( AncestorsIterator, LazyAncestors, MissingAncestors, ) from mercurial.rustext import dagop try: from mercurial.cext import parsers as cparsers except ImportError: cparsers = None @unittest.skipIf( rustext is None, 'The Rust version of the "ancestor" module is not available. It is needed' ' for this test.', ) @unittest.skipIf( rustext is None, 'The Rust or C version of the "parsers" module, which the "ancestor" module' ' relies on, is not available.', ) class rustancestorstest(revlogtesting.RevlogBasedTestBase): """Test the correctness of binding to Rust code. This test is merely for the binding to Rust itself: extraction of Python variable, giving back the results etc. It is not meant to test the algorithmic correctness of the operations on ancestors it provides. Hence the very simple embedded index data is good enough. Algorithmic correctness is asserted by the Rust unit tests. """ def testiteratorrevlist(self): idx = self.parseindex() # checking test assumption about the index binary data: self.assertEqual( {i: (r[5], r[6]) for i, r in enumerate(idx)}, {0: (-1, -1), 1: (0, -1), 2: (1, -1), 3: (2, -1)}, ) ait = AncestorsIterator(idx, [3], 0, True) self.assertEqual([r for r in ait], [3, 2, 1, 0]) ait = AncestorsIterator(idx, [3], 0, False) self.assertEqual([r for r in ait], [2, 1, 0]) def testlazyancestors(self): idx = self.parseindex() start_count = sys.getrefcount(idx) # should be 2 (see Python doc) self.assertEqual( {i: (r[5], r[6]) for i, r in enumerate(idx)}, {0: (-1, -1), 1: (0, -1), 2: (1, -1), 3: (2, -1)}, ) lazy = LazyAncestors(idx, [3], 0, True) # we have two more references to the index: # - in its inner iterator for __contains__ and __bool__ # - in the LazyAncestors instance itself (to spawn new iterators) self.assertEqual(sys.getrefcount(idx), start_count + 2) self.assertTrue(2 in lazy) self.assertTrue(bool(lazy)) self.assertEqual(list(lazy), [3, 2, 1, 0]) # a second time to validate that we spawn new iterators self.assertEqual(list(lazy), [3, 2, 1, 0]) # now let's watch the refcounts closer ait = iter(lazy) self.assertEqual(sys.getrefcount(idx), start_count + 3) del ait self.assertEqual(sys.getrefcount(idx), start_count + 2) del lazy self.assertEqual(sys.getrefcount(idx), start_count) # let's check bool for an empty one self.assertFalse(LazyAncestors(idx, [0], 0, False)) def testmissingancestors(self): idx = self.parseindex() missanc = MissingAncestors(idx, [1]) self.assertTrue(missanc.hasbases()) self.assertEqual(missanc.missingancestors([3]), [2, 3]) missanc.addbases({2}) self.assertEqual(missanc.bases(), {1, 2}) self.assertEqual(missanc.missingancestors([3]), [3]) self.assertEqual(missanc.basesheads(), {2}) def testmissingancestorsremove(self): idx = self.parseindex() missanc = MissingAncestors(idx, [1]) revs = {0, 1, 2, 3} missanc.removeancestorsfrom(revs) self.assertEqual(revs, {2, 3}) def testrefcount(self): idx = self.parseindex() start_count = sys.getrefcount(idx) # refcount increases upon iterator init... ait = AncestorsIterator(idx, [3], 0, True) self.assertEqual(sys.getrefcount(idx), start_count + 1) self.assertEqual(next(ait), 3) # and decreases once the iterator is removed del ait self.assertEqual(sys.getrefcount(idx), start_count) # and removing ref to the index after iterator init is no issue ait = AncestorsIterator(idx, [3], 0, True) del idx self.assertEqual(list(ait), [3, 2, 1, 0]) def testgrapherror(self): data = ( revlogtesting.data_non_inlined[: 64 + 27] + b'\xf2' + revlogtesting.data_non_inlined[64 + 28 :] ) idx = cparsers.parse_index2(data, False)[0] with self.assertRaises(rustext.GraphError) as arc: AncestorsIterator(idx, [1], -1, False) exc = arc.exception self.assertIsInstance(exc, ValueError) # rust-cpython issues appropriate str instances for Python 2 and 3 self.assertEqual(exc.args, ('ParentOutOfRange', 1)) def testwdirunsupported(self): # trying to access ancestors of the working directory raises # WdirUnsupported directly idx = self.parseindex() with self.assertRaises(error.WdirUnsupported): list(AncestorsIterator(idx, [node.wdirrev], -1, False)) def testheadrevs(self): idx = self.parseindex() self.assertEqual(dagop.headrevs(idx, [1, 2, 3]), {3}) if __name__ == '__main__': import silenttestrunner silenttestrunner.main(__name__) mercurial-5.3.1/tests/test-manifest.t0000644015407300116100000003077413627755405017536 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 unbundle "$TESTDIR/bundles/test-manifest.hg" adding changesets adding manifests adding file changes added 2 changesets with 3 changes to 3 files new changesets b73562a03cfe:5bdc995175ba (2 drafts) (run 'hg update' to get a working copy) 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 files -T '{path} {size} {flags}\n' a 2 b/a 2 x l 1 l $ hg files -T '{path} {node|shortest}\n' -r. a 5bdc b/a 5bdc l 5bdc $ hg manifest -v 644 a 755 * b/a 644 @ l $ hg manifest -T '{path} {rev}\n' a 1 b/a 1 l 1 $ 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] Testing the manifest full text cache utility -------------------------------------------- Reminder of the manifest log content $ hg log --debug | grep 'manifest:' manifest: 1:1e01206b1d2f72bd55f2a33fa8ccad74144825b7 manifest: 0:fce2a30dedad1eef4da95ca1dc0004157aa527cf Showing the content of the caches after the above operations $ hg debugmanifestfulltextcache cache contains 1 manifest entries, in order of most to least recent: id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes total cache data size 157 bytes, on-disk 157 bytes (Clearing the cache in case of any content) $ hg debugmanifestfulltextcache --clear Adding a new persistent entry in the cache $ hg debugmanifestfulltextcache --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7 $ hg debugmanifestfulltextcache cache contains 1 manifest entries, in order of most to least recent: id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes total cache data size 157 bytes, on-disk 157 bytes Check we don't duplicated entry (added from the debug command) $ hg debugmanifestfulltextcache --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7 $ hg debugmanifestfulltextcache cache contains 1 manifest entries, in order of most to least recent: id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes total cache data size 157 bytes, on-disk 157 bytes Adding a second entry $ hg debugmanifestfulltextcache --add fce2a30dedad1eef4da95ca1dc0004157aa527cf $ hg debugmanifestfulltextcache cache contains 2 manifest entries, in order of most to least recent: id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes total cache data size 268 bytes, on-disk 268 bytes Accessing the initial entry again, refresh their order $ hg debugmanifestfulltextcache --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7 $ hg debugmanifestfulltextcache cache contains 2 manifest entries, in order of most to least recent: id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes total cache data size 268 bytes, on-disk 268 bytes Check cache clearing $ hg debugmanifestfulltextcache --clear $ hg debugmanifestfulltextcache cache empty Check adding multiple entry in one go: $ hg debugmanifestfulltextcache --add fce2a30dedad1eef4da95ca1dc0004157aa527cf --add 1e01206b1d2f72bd55f2a33fa8ccad74144825b7 $ hg debugmanifestfulltextcache cache contains 2 manifest entries, in order of most to least recent: id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes total cache data size 268 bytes, on-disk 268 bytes $ hg debugmanifestfulltextcache --clear Test caching behavior on actual operation ----------------------------------------- Make sure we start empty $ hg debugmanifestfulltextcache cache empty Commit should have the new node cached: $ echo a >> b/a $ hg commit -m 'foo' $ hg debugmanifestfulltextcache cache contains 2 manifest entries, in order of most to least recent: id: 26b8653b67af8c1a0a0317c4ee8dac50a41fdb65, size 133 bytes id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes total cache data size 314 bytes, on-disk 314 bytes $ hg log -r 'ancestors(., 1)' --debug | grep 'manifest:' manifest: 1:1e01206b1d2f72bd55f2a33fa8ccad74144825b7 manifest: 2:26b8653b67af8c1a0a0317c4ee8dac50a41fdb65 hg update should warm the cache too (force dirstate check to avoid flackiness in manifest order) $ hg debugrebuilddirstate $ hg update 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg debugmanifestfulltextcache cache contains 3 manifest entries, in order of most to least recent: id: fce2a30dedad1eef4da95ca1dc0004157aa527cf, size 87 bytes id: 26b8653b67af8c1a0a0317c4ee8dac50a41fdb65, size 133 bytes id: 1e01206b1d2f72bd55f2a33fa8ccad74144825b7, size 133 bytes total cache data size 425 bytes, on-disk 425 bytes $ hg log -r '0' --debug | grep 'manifest:' manifest: 0:fce2a30dedad1eef4da95ca1dc0004157aa527cf Test file removal (especially with pure). The tests are crafted such that there will be contiguous spans of existing entries to ensure that is handled properly. (In this case, a.txt, aa.txt and c.txt, cc.txt, and ccc.txt) $ cat > $TESTTMP/manifest.py < from mercurial import ( > extensions, > manifest, > ) > def extsetup(ui): > manifest.FASTDELTA_TEXTDIFF_THRESHOLD = 0 > EOF $ cat >> $HGRCPATH < [extensions] > manifest = $TESTTMP/manifest.py > EOF Pure removes should actually remove all dropped entries $ hg init repo $ cd repo $ echo a > a.txt $ echo aa > aa.txt $ echo b > b.txt $ echo c > c.txt $ echo c > cc.txt $ echo c > ccc.txt $ echo b > d.txt $ echo c > e.txt $ hg ci -Aqm 'a-e' $ hg rm b.txt d.txt $ hg ci -m 'remove b and d' $ hg debugdata -m 1 a.txt\x00b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 (esc) aa.txt\x00a4bdc161c8fbb523c9a60409603f8710ff49a571 (esc) c.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc) cc.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc) ccc.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc) e.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc) $ hg up -qC . $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 2 changesets with 8 changes to 8 files $ hg rollback -q --config ui.rollback=True $ hg rm b.txt d.txt $ echo bb > bb.txt A mix of adds and removes should remove all dropped entries. $ hg ci -Aqm 'remove b and d; add bb' $ hg debugdata -m 1 a.txt\x00b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 (esc) aa.txt\x00a4bdc161c8fbb523c9a60409603f8710ff49a571 (esc) bb.txt\x0004c6faf8a9fdd848a5304dfc1704749a374dff44 (esc) c.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc) cc.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc) ccc.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc) e.txt\x00149da44f2a4e14f488b7bd4157945a9837408c00 (esc) $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 2 changesets with 9 changes to 9 files $ cd .. Test manifest cache interraction with shares ============================================ $ echo '[extensions]' >> $HGRCPATH $ echo 'share=' >> $HGRCPATH creating some history $ hg init share-source $ hg debugbuilddag .+10 -n -R share-source $ hg log --debug -r . -R share-source | grep 'manifest:' manifest: -1:0000000000000000000000000000000000000000 $ hg log -r . -R share-source changeset: -1:000000000000 user: date: Thu Jan 01 00:00:00 1970 +0000 $ hg debugmanifestfulltextcache -R share-source cache contains 4 manifest entries, in order of most to least recent: id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes id: 7d32499319983d90f97ca02a6c2057a1030bebbb, size 360 bytes total cache data size 1.76 KB, on-disk 1.76 KB $ hg -R share-source update 1 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg debugmanifestfulltextcache -R share-source cache contains 4 manifest entries, in order of most to least recent: id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes total cache data size 1.50 KB, on-disk 1.50 KB making a share out of it. It should have its manifest cache updated $ hg share share-source share-dest updating working directory 11 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg log --debug -r . -R share-dest | grep 'manifest:' manifest: 10:b264454d7033405774b9f353b9b37a082c1a8fba $ hg debugmanifestfulltextcache -R share-dest cache contains 1 manifest entries, in order of most to least recent: id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes total cache data size 520 bytes, on-disk 520 bytes update on various side should only affect the target share $ hg update -R share-dest 4 0 files updated, 0 files merged, 6 files removed, 0 files unresolved $ hg log --debug -r . -R share-dest | grep 'manifest:' manifest: 4:d45ead487afec2588272fcec88a25413c0ec7dc8 $ hg debugmanifestfulltextcache -R share-dest cache contains 2 manifest entries, in order of most to least recent: id: d45ead487afec2588272fcec88a25413c0ec7dc8, size 225 bytes id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes total cache data size 769 bytes, on-disk 769 bytes $ hg debugmanifestfulltextcache -R share-source cache contains 4 manifest entries, in order of most to least recent: id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes total cache data size 1.50 KB, on-disk 1.50 KB $ hg update -R share-source 7 6 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg log --debug -r . -R share-source | grep 'manifest:' manifest: 7:7d32499319983d90f97ca02a6c2057a1030bebbb $ hg debugmanifestfulltextcache -R share-dest cache contains 2 manifest entries, in order of most to least recent: id: d45ead487afec2588272fcec88a25413c0ec7dc8, size 225 bytes id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes total cache data size 769 bytes, on-disk 769 bytes $ hg debugmanifestfulltextcache -R share-source cache contains 4 manifest entries, in order of most to least recent: id: 7d32499319983d90f97ca02a6c2057a1030bebbb, size 360 bytes id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes total cache data size 1.46 KB, on-disk 1.46 KB $ hg update -R share-dest 8 4 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg log --debug -r . -R share-dest | grep 'manifest:' manifest: 8:8de636143b0acc5236cb47ca914bd482d82e6f35 $ hg debugmanifestfulltextcache -R share-dest cache contains 3 manifest entries, in order of most to least recent: id: 8de636143b0acc5236cb47ca914bd482d82e6f35, size 405 bytes id: d45ead487afec2588272fcec88a25413c0ec7dc8, size 225 bytes id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes total cache data size 1.17 KB, on-disk 1.17 KB $ hg debugmanifestfulltextcache -R share-source cache contains 4 manifest entries, in order of most to least recent: id: 7d32499319983d90f97ca02a6c2057a1030bebbb, size 360 bytes id: fffc37b38c401b1ab4f8b99da4b72325e31b985f, size 90 bytes id: b264454d7033405774b9f353b9b37a082c1a8fba, size 496 bytes id: c6e7b359cbbb5469e98f35acd73ac4757989c4d8, size 450 bytes total cache data size 1.46 KB, on-disk 1.46 KB mercurial-5.3.1/tests/test-subrepo-deep-nested-change.t0000644015407300116100000012776613627755405023035 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) linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !) \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 cloning subrepo sub1 from http://localhost:$HGPORT/../sub1 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) $ cat error.log $ 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) linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !) \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) linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !) updating [===========================================>] 3/3\r (no-eol) (esc) \r (no-eol) (esc) \r (no-eol) (esc) linking [ <=> ] 1\r (no-eol) (esc) (reporevlogstore !) linking [ <=> ] 2\r (no-eol) (esc) (reporevlogstore !) linking [ <=> ] 3\r (no-eol) (esc) (reporevlogstore !) linking [ <=> ] 4\r (no-eol) (esc) (reporevlogstore !) linking [ <=> ] 5\r (no-eol) (esc) (reporevlogstore !) linking [ <=> ] 6\r (no-eol) (esc) (reporevlogstore !) linking [ <=> ] 1\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 2\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 3\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 4\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 5\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 6\r (no-eol) (esc) (reposimplestore !) 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 $ grep largefiles cloned/.hg/hgrc [1] 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 [========================>] 1/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 extensions.largefiles= $ hg --config extensions.largefiles= clone -qU . ../lfclone $ grep largefiles ../lfclone/.hg/requires 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-5.3.1/tests/silenttestrunner.py0000644015407300116100000000134013627755405020553 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-5.3.1/tests/hgweberror.py0000644015407300116100000000135713627755405017301 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): '''Dummy web command that raises an uncaught Exception.''' # Simulate an error after partial response. if b'partialresponse' in web.req.qsparams: web.res.status = b'200 Script output follows' web.res.headers[b'Content-Type'] = b'text/plain' web.res.setbodywillwrite() list(web.res.sendresponse()) web.res.getbodyfile().write(b'partial content\n') raise AttributeError('I am an uncaught error!') def extsetup(ui): setattr(webcommands, 'raiseerror', raiseerror) webcommands.__all__.append(b'raiseerror') mercurial-5.3.1/tests/test-githelp.t0000644015407300116100000002061713627755405017357 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 its 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 stash list with patch $ hg githelp -- git stash list -p hg shelve -l -p githelp for stash show $ hg githelp -- git stash show hg shelve --stat githelp for stash show with patch and name $ hg githelp -- git stash show -p mystash hg shelve -p mystash githelp for stash clear $ hg githelp -- git stash clear hg shelve --cleanup 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 reuse message using HEAD $ hg githelp -- git commit --reuse-message HEAD~ hg commit -M .~1 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 githelp for apply with prefix directory $ hg githelp -- apply --directory=modules hg import --no-commit --prefix modules 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-5.3.1/tests/test-add.t0000644015407300116100000001476713627755405016464 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 forget a $ hg add --color debug [ui.addremove.added ui.status|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 excluded file shouldn't be added even if it is explicitly specified $ hg add a.orig -X '*.orig' $ 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 .. test --dry-run mode in forget $ hg init testdir_forget $ cd testdir_forget $ echo foo > foo $ hg add foo $ hg commit -m "foo" $ hg forget foo --dry-run -v removing foo $ hg diff $ hg forget not_exist -n not_exist: $ENOENT$ [1] $ cd .. test --interactive mode in forget $ hg init interactiveforget $ cd interactiveforget $ echo foo > foo $ hg commit -qAm "foo" $ echo bar > bar $ hg commit -qAm "bar" $ hg forget foo --dry-run -i abort: cannot specify both --dry-run and --interactive [255] $ hg forget foo --config ui.interactive=True -i << EOF > ? > n > EOF forget foo [Ynsa?] ? y - yes, forget this file n - no, skip this file s - skip remaining files a - include all remaining files ? - ? (display help) forget foo [Ynsa?] n $ hg forget foo bar --config ui.interactive=True -i << EOF > y > n > EOF forget bar [Ynsa?] y forget foo [Ynsa?] n removing bar $ hg status R bar $ hg up -qC . $ hg forget foo bar --config ui.interactive=True -i << EOF > s > EOF forget bar [Ynsa?] s $ hg st $ hg up -qC . $ hg forget foo bar --config ui.interactive=True -i << EOF > a > EOF forget bar [Ynsa?] a removing bar removing foo $ hg status R bar R foo $ hg up -qC . $ cd .. mercurial-5.3.1/tests/test-mq-qdelete.t0000644015407300116100000000675313627755405017766 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-5.3.1/tests/test-obsolete-bundle-strip.t0000644015407300116100000026377513627755405022163 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")'` 1 new obsolescence markers $ hg debugobsolete `getid 'desc("C-A0")'` a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 1 new obsolescence markers obsoleted 1 changesets $ hg debugobsolete a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1 `getid 'desc("C-A1")'` 1 new obsolescence markers $ 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: (1 other changesets obsolete on arrival) # 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 (1 drafts) # 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 (1 drafts) # unbundling: (1 other changesets obsolete on arrival) # 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")'` 1 new obsolescence markers $ hg debugobsolete `getid 'desc("C-A0")'` `getid 'desc("C-A1")'` 1 new obsolescence markers obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete --record-parents `getid 'desc("C-B0")'` 1 new obsolescence markers 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: (1 other changesets obsolete on arrival) # 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 (1 drafts) # 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 (1 drafts) # unbundling: (2 other changesets obsolete on arrival) # 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")'` 1 new obsolescence markers $ hg debugobsolete --record-parents `getid 'desc("C-A0")'` 1 new obsolescence markers obsoleted 1 changesets $ hg debugobsolete `getid 'desc("C-A0")'` `getid 'desc("C-A1")'` 1 new obsolescence markers $ 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: (1 other changesets obsolete on arrival) # 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 (1 drafts) # 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 (1 drafts) # unbundling: (1 other changesets obsolete on arrival) # 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")'` 1 new obsolescence markers $ hg debugobsolete `getid 'desc("C-A0")'` `getid 'desc("C-A1")'` 1 new obsolescence markers obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete --record-parents `getid 'desc("C-B0")'` 1 new obsolescence markers 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 (1 drafts) # 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")'` 1 new obsolescence markers $ hg debugobsolete --record-parents `getid 'desc("C-A0")'` 1 new obsolescence markers obsoleted 1 changesets $ hg debugobsolete `getid 'desc("C-A0")'` `getid 'desc("C-A1")'` 1 new obsolescence markers (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 (1 drafts) # 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")'` 1 new obsolescence markers $ hg debugobsolete `getid 'desc("C-A")'` `getid 'desc("C-B")'` `getid 'desc("C-C")'` # record split 1 new obsolescence markers obsoleted 1 changesets $ hg debugobsolete `getid 'desc("C-A")'` `getid 'desc("C-D")'` # other divergent 1 new obsolescence markers 3 new content-divergent changesets $ hg debugobsolete `getid 'desc("C-A")'` b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 1 new obsolescence markers $ hg debugobsolete b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0 `getid 'desc("C-E")'` 1 new obsolescence markers 1 new content-divergent changesets $ hg debugobsolete `getid 'desc("C-B")'` `getid 'desc("C-E")'` 1 new obsolescence markers obsoleted 1 changesets $ hg debugobsolete `getid 'desc("C-C")'` `getid 'desc("C-E")'` 1 new obsolescence markers obsoleted 1 changesets $ hg debugobsolete `getid 'desc("C-D")'` `getid 'desc("C-E")'` 1 new obsolescence markers obsoleted 1 changesets $ hg debugobsolete c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 `getid 'desc("C-E")'` 1 new obsolescence markers $ 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: (1 other changesets obsolete on arrival) # 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: (1 other changesets obsolete on arrival) # 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: (1 other changesets obsolete on arrival) # 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: (1 other changesets obsolete on arrival) # 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 (1 drafts) # 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: (2 other changesets obsolete on arrival) # 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 (1 drafts) # unbundling: (1 other changesets obsolete on arrival) # 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 (1 drafts) # unbundling: (1 other changesets obsolete on arrival) # 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 (1 drafts) # unbundling: (1 other changesets obsolete on arrival) # 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 (1 drafts) # unbundling: (4 other changesets obsolete on arrival) # 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")'` 1 new obsolescence markers 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: (1 other changesets obsolete on arrival) # 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 (1 drafts) # unbundling: (1 other changesets obsolete on arrival) # unbundling: (run 'hg update' to get a working copy) mercurial-5.3.1/tests/test-convert-filemap.t0000644015407300116100000005626213627755405021023 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 #if reporevlogstore $ rm source/.hg/store/data/dir/file3.i $ rm source/.hg/store/data/dir/file4.i #endif #if reposimplestore $ rm -rf source/.hg/store/data/dir/file3 $ rm -rf source/.hg/store/data/dir/file4 #endif $ hg -q convert --filemap renames.fmap --datesort source dummydest abort: data/dir/file3.i@e96dce0bc6a2: no match found! (reporevlogstore !) abort: data/dir/file3/index@e96dce0bc6a2: no node! (reposimplestore !) [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 (reporevlogstore !) ignoring: data/dir/file4.i@6edd55f559cd: no match found (reporevlogstore !) ignoring: data/dir/file3/index@e96dce0bc6a2: no node (reposimplestore !) ignoring: data/dir/file4/index@6edd55f559cd: no node (reposimplestore !) $ 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 checked 5 changesets with 7 changes to 4 files $ 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 Include directives dropped empty commits, but other directives don't $ cat > branchpruning/exclude_filemap < exclude a > EOF $ hg convert --filemap branchpruning/exclude_filemap branchpruning branchpruning-hg-exclude initializing destination branchpruning-hg-exclude repository scanning source... sorting... converting... 5 adda 4 closefoo 3 emptybranch 2 closeempty 1 addb 0 closedefault $ glog -R branchpruning-hg-exclude _ 3 "closedefault" files: | o 2 "addb" files: b _ 1 "closeempty" files: | o 0 "emptybranch" files: 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/7 revisions (14.29%) 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 e2ff merge a & b |\ - converted/a | | | 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 bbfe 3 |\ | o 33a0 2 | | - f | | o | f73e 1 |/ - f | o d681 0 - f $ hg -R .-hg mani -r tip f $ cd .. mercurial-5.3.1/tests/test-issue3084.t0000644015407300116100000002360113627755405017366 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-5.3.1/tests/test-check-help.t0000644015407300116100000000173513627755405017726 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 msvcrt > import os > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) > stdout = getattr(sys.stdout, 'buffer', sys.stdout) > topics = set() > topicre = re.compile(br':hg:`help ([a-z0-9\-.]+)`') > for fname in sys.argv: > with open(fname, 'rb') as f: > topics.update(m.group(1) for m in topicre.finditer(f.read())) > for s in sorted(topics): > stdout.write(b'%s\n' % 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 --config extensions.phabricator= > /dev/null mercurial-5.3.1/tests/test-narrow-clone-no-ellipsis.t0000644015407300116100000000676113627755405022571 0ustar augieeng00000000000000 $ . "$TESTDIR/narrow-library.sh" $ hg init master $ cd master $ mkdir dir $ mkdir dir/src $ cd dir/src $ for x in `$TESTDIR/seq.py 20`; do echo $x > "f$x"; hg add "f$x"; hg commit -m "Commit src $x"; done $ cd .. $ mkdir tests $ cd tests $ for x in `$TESTDIR/seq.py 20`; do echo $x > "t$x"; hg add "t$x"; hg commit -m "Commit test $x"; done $ cd ../../.. narrow clone a file, f10 $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/f10" requesting all changes adding changesets adding manifests adding file changes added 40 changesets with 1 changes to 1 files new changesets *:* (glob) $ cd narrow $ cat .hg/requires | grep -v generaldelta dotencode fncache narrowhg-experimental revlogv1 sparserevlog store testonly-simplestore (reposimplestore !) $ hg tracked I path:dir/src/f10 $ hg update 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ find * | sort dir dir/src dir/src/f10 $ cat dir/src/f10 10 $ cd .. narrow clone a directory, tests/, except tests/t19 $ hg clone --narrow ssh://user@dummy/master narrowdir --noupdate --include "dir/tests/" --exclude "dir/tests/t19" requesting all changes adding changesets adding manifests adding file changes added 40 changesets with 19 changes to 19 files new changesets *:* (glob) $ cd narrowdir $ hg tracked I path:dir/tests X path:dir/tests/t19 $ hg update 19 files updated, 0 files merged, 0 files removed, 0 files unresolved $ find * | sort dir dir/tests dir/tests/t1 dir/tests/t10 dir/tests/t11 dir/tests/t12 dir/tests/t13 dir/tests/t14 dir/tests/t15 dir/tests/t16 dir/tests/t17 dir/tests/t18 dir/tests/t2 dir/tests/t20 dir/tests/t3 dir/tests/t4 dir/tests/t5 dir/tests/t6 dir/tests/t7 dir/tests/t8 dir/tests/t9 $ cd .. narrow clone everything but a directory (tests/) $ hg clone --narrow ssh://user@dummy/master narrowroot --noupdate --exclude "dir/tests" requesting all changes adding changesets adding manifests adding file changes added 40 changesets with 20 changes to 20 files new changesets *:* (glob) $ cd narrowroot $ hg tracked I path:. X path:dir/tests $ hg update 20 files updated, 0 files merged, 0 files removed, 0 files unresolved $ find * | sort dir dir/src dir/src/f1 dir/src/f10 dir/src/f11 dir/src/f12 dir/src/f13 dir/src/f14 dir/src/f15 dir/src/f16 dir/src/f17 dir/src/f18 dir/src/f19 dir/src/f2 dir/src/f20 dir/src/f3 dir/src/f4 dir/src/f5 dir/src/f6 dir/src/f7 dir/src/f8 dir/src/f9 $ cd .. Testing the --narrowspec flag to clone $ cat >> narrowspecs < %include foo > [include] > path:dir/tests/ > path:dir/src/f12 > EOF $ hg clone ssh://user@dummy/master specfile --narrowspec narrowspecs reading narrowspec from '$TESTTMP/narrowspecs' abort: cannot specify other files using '%include' in narrowspec [255] $ cat > narrowspecs < [include] > path:dir/tests/ > path:dir/src/f12 > EOF $ hg clone ssh://user@dummy/master specfile --narrowspec narrowspecs reading narrowspec from '$TESTTMP/narrowspecs' requesting all changes adding changesets adding manifests adding file changes added 40 changesets with 21 changes to 21 files new changesets 681085829a73:26ce255d5b5d updating to branch default 21 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd specfile $ hg tracked I path:dir/src/f12 I path:dir/tests $ cd .. mercurial-5.3.1/tests/test-journal-exists.t0000644015407300116100000000272413627755405020711 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 checked 1 changesets with 1 changes to 1 files recover, explicit verify $ touch .hg/store/journal $ hg ci -Am0 abort: abandoned transaction found! (run 'hg recover' to clean up transaction) [255] $ hg recover --verify rolling back interrupted transaction checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 1 changesets with 1 changes to 1 files recover, no verify $ touch .hg/store/journal $ hg ci -Am0 abort: abandoned transaction found! (run 'hg recover' to clean up transaction) [255] $ hg recover --no-verify rolling back interrupted transaction (verify step skipped, run `hg verify` to check your repository content) 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-5.3.1/tests/fsmonitor-run-tests.py0000755015407300116100000001146413627755405021120 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=', # specify fsmonitor.mode=paranoid always in order to force # fsmonitor extension execute "paranoid" code path # # TODO: make fsmonitor-run-tests.py accept specific options '--extra-config', 'fsmonitor.mode=paranoid', '--blacklist', blacklist, ] ) return subprocess.call(runtestsargv) if __name__ == '__main__': sys.exit(run()) mercurial-5.3.1/tests/test-progress.t0000644015407300116100000003516213627755405017570 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', > [(b'', b'total', b'', b'override for total'), > (b'', b'nested', False, b'show nested results'), > (b'', b'parallel', False, b'show parallel sets of results')], > b'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) > > progress = ui.makeprogress(topiclabel, unit=b'loopnum', total=total) > other = ui.makeprogress(b'other', unit=b'othernum', total=total) > for i in range(loops): > progress.update(i, item=getloopitem(i)) > if opts.get('parallel'): > other.update(i, item=b'other.%d' % i) > if nested: > nested_steps = 2 > if i and i % 4 == 0: > nested_steps = 5 > nested = ui.makeprogress(b'nested', unit=b'nestnum', > total=nested_steps) > for j in range(nested_steps): > nested.update(j, item=b'nested.%d' % j) > nested.complete() > progress.complete() > > topiclabel = b'loop' > def getloopitem(i): > return b'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-5.3.1/tests/test-remote-hidden.t0000644015407300116100000000635313627755405020450 0ustar augieeng00000000000000======================================================== Test the ability to access a hidden revision on a server ======================================================== #require serve $ . $TESTDIR/testlib/obsmarker-common.sh $ cat >> $HGRCPATH << EOF > [phases] > # public changeset are not obsolete > publish=false > [experimental] > evolution=all > [ui] > logtemplate='{rev}:{node|short} {desc} [{phase}]\n' > EOF Setup a simple repository with some hidden revisions ---------------------------------------------------- Testing the `served.hidden` view $ hg init repo-with-hidden $ cd repo-with-hidden $ echo 0 > a $ hg ci -qAm "c_Public" $ hg phase --public $ echo 1 > a $ hg ci -m "c_Amend_Old" $ echo 2 > a $ hg ci -m "c_Amend_New" --amend $ hg up ".^" 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 3 > a $ hg ci -m "c_Pruned" created new head $ hg debugobsolete --record-parents `getid 'desc("c_Pruned")'` -d '0 0' 1 new obsolescence markers obsoleted 1 changesets $ hg up ".^" 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 4 > a $ hg ci -m "c_Secret" --secret created new head $ echo 5 > a $ hg ci -m "c_Secret_Pruned" --secret $ hg debugobsolete --record-parents `getid 'desc("c_Secret_Pruned")'` -d '0 0' 1 new obsolescence markers obsoleted 1 changesets $ hg up null 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg log -G -T '{rev}:{node|short} {desc} [{phase}]\n' --hidden x 5:8d28cbe335f3 c_Secret_Pruned [secret] | o 4:1c6afd79eb66 c_Secret [secret] | | x 3:5d1575e42c25 c_Pruned [draft] |/ | o 2:c33affeb3f6b c_Amend_New [draft] |/ | x 1:be215fbb8c50 c_Amend_Old [draft] |/ o 0:5f354f46e585 c_Public [public] $ hg debugobsolete be215fbb8c5090028b00154c1fe877ad1b376c61 c33affeb3f6b4e9621d1839d6175ddc07708807c 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'} 5d1575e42c25b7f2db75cd4e0b881b1c35158fae 0 {5f354f46e5853535841ec7a128423e991ca4d59b} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} 8d28cbe335f311bc89332d7bbe8a07889b6914a0 0 {1c6afd79eb6663275bbe30097e162b1c24ced0f0} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ cd .. Test the feature ================ Check cache pre-warm -------------------- $ ls -1 repo-with-hidden/.hg/cache branch2 branch2-base branch2-served branch2-served.hidden branch2-visible rbc-names-v1 rbc-revs-v1 tags2 tags2-visible Check that the `served.hidden` repoview --------------------------------------- $ hg -R repo-with-hidden serve -p $HGPORT -d --pid-file hg.pid --config web.view=served.hidden $ cat hg.pid >> $DAEMON_PIDS changesets in secret and higher phases are not visible through hgweb $ hg -R repo-with-hidden log --template "revision: {rev}\\n" --rev "reverse(not secret())" revision: 2 revision: 0 $ hg -R repo-with-hidden log --template "revision: {rev}\\n" --rev "reverse(not secret())" --hidden revision: 3 revision: 2 revision: 1 revision: 0 $ get-with-headers.py localhost:$HGPORT 'log?style=raw' | grep revision: revision: 3 revision: 2 revision: 1 revision: 0 $ killdaemons.py mercurial-5.3.1/tests/test-init.t0000644015407300116100000001653713627755405016674 0ustar augieeng00000000000000This test tries to exercise the ssh functionality with a dummy script $ 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 sparserevlog store testonly-simplestore (reposimplestore !) $ 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 testonly-simplestore (reposimplestore !) sparserevlog creating repo with format.usefncache=false $ hg --config format.usefncache=false init old2 $ checknewrepo old2 store created 00changelog.i created generaldelta revlogv1 sparserevlog store testonly-simplestore (reposimplestore !) creating repo with format.dotencode=false $ hg --config format.dotencode=false init old3 $ checknewrepo old3 store created 00changelog.i created fncache generaldelta revlogv1 sparserevlog store testonly-simplestore (reposimplestore !) creating repo with format.dotencode=false $ hg --config format.generaldelta=false --config format.usegeneraldelta=false --config format.sparse-revlog=no init old4 $ checknewrepo old4 store created 00changelog.i created dotencode fncache revlogv1 store testonly-simplestore (reposimplestore !) 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 sparserevlog store testonly-simplestore (reposimplestore !) 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 sparserevlog store testonly-simplestore (reposimplestore !) 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 sparserevlog store testonly-simplestore (reposimplestore !) 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 Check format constraint ----------------------- $ hg init issue6056 --config format.usegeneraldelta=0 --config format.sparse-revlog=0 $ cd issue6056 $ echo foo > 1 $ echo foo > 2 $ echo foo > 3 $ echo foo > 4 $ echo foo > 5 $ hg add * Build a bogus repository (sparserevlog without general delta) $ hg commit -m 'initial changesets' $ echo 'sparserevlog' >> .hg/requires $ for x in `$TESTDIR/seq.py 100`; do > echo $x >> `expr $x % 5 + 1` > hg commit -m $x > done $ cd .. mercurial-5.3.1/tests/test-update-atomic.t0000644015407300116100000000667013627755405020462 0ustar augieeng00000000000000#require execbit unix-permissions Checking that experimental.atomic-file works. $ cat > $TESTTMP/show_mode.py < from __future__ import print_function > import os > import stat > import sys > ST_MODE = stat.ST_MODE > > for file_path in sys.argv[1:]: > file_stat = os.stat(file_path) > octal_mode = oct(file_stat[ST_MODE] & 0o777).replace('o', '') > print("%s:%s" % (file_path, octal_mode)) > > EOF $ hg init repo $ cd repo $ cat > .hg/showwrites.py < from __future__ import print_function > from mercurial import pycompat > from mercurial.utils import stringutil > def uisetup(ui): > from mercurial import vfs > class newvfs(vfs.vfs): > def __call__(self, *args, **kwargs): > print(pycompat.sysstr(stringutil.pprint( > ('vfs open', args, sorted(list(kwargs.items())))))) > return super(newvfs, self).__call__(*args, **kwargs) > vfs.vfs = newvfs > EOF $ for v in a1 a2 b1 b2 c ro; do echo $v > $v; done $ chmod +x b* $ hg commit -Aqm _ # We check that # - the changes are actually atomic # - that permissions are correct (all 4 cases of (executable before) * (executable after)) # - that renames work, though they should be atomic anyway # - that it works when source files are read-only (but directories are read-write still) $ for v in a1 a2 b1 b2 ro; do echo changed-$v > $v; done $ chmod -x *1; chmod +x *2 $ hg rename c d $ hg commit -qm _ Check behavior without update.atomic-file $ hg update -r 0 -q $ hg update -r 1 --config extensions.showwrites=.hg/showwrites.py 2>&1 | grep "a1'.*wb" ('vfs open', ('a1', 'wb'), [('atomictemp', False), ('backgroundclose', True)]) $ python $TESTTMP/show_mode.py * a1:0644 a2:0755 b1:0644 b2:0755 d:0644 ro:0644 Add a second revision for the ro file so we can test update when the file is present or not $ echo "ro" > ro $ hg commit -qm _ Check behavior without update.atomic-file first $ hg update -C -r 0 -q $ hg update -r 1 6 files updated, 0 files merged, 1 files removed, 0 files unresolved $ python $TESTTMP/show_mode.py * a1:0644 a2:0755 b1:0644 b2:0755 d:0644 ro:0644 Manually reset the mode of the read-only file $ chmod a-w ro $ python $TESTTMP/show_mode.py ro ro:0444 Now the file is present, try to update and check the permissions of the file $ hg up -r 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ python $TESTTMP/show_mode.py ro ro:0644 # The file which was read-only is now writable in the default behavior Check behavior with update.atomic-files $ cat >> .hg/hgrc < [experimental] > update.atomic-file = true > EOF $ hg update -C -r 0 -q $ hg update -r 1 --config extensions.showwrites=.hg/showwrites.py 2>&1 | grep "a1'.*wb" ('vfs open', ('a1', 'wb'), [('atomictemp', True), ('backgroundclose', True)]) $ hg st -A --rev 1 C a1 C a2 C b1 C b2 C d C ro Check the file permission after update $ python $TESTTMP/show_mode.py * a1:0644 a2:0755 b1:0644 b2:0755 d:0644 ro:0644 Manually reset the mode of the read-only file $ chmod a-w ro $ python $TESTTMP/show_mode.py ro ro:0444 Now the file is present, try to update and check the permissions of the file $ hg update -r 2 --traceback 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ python $TESTTMP/show_mode.py ro ro:0644 # The behavior is the same as without atomic update mercurial-5.3.1/tests/test-import-context.t0000644015407300116100000000466313627755405020722 0ustar augieeng00000000000000Test applying context diffs $ cat > writepatterns.py < import sys > > path = sys.argv[1] > lasteol = sys.argv[2] == '1' > patterns = sys.argv[3:] > > fp = open(path, 'wb') > for i, pattern in enumerate(patterns): > count = int(pattern[0:-1]) > char = pattern[-1].encode('utf8') + b'\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 > from mercurial import pycompat > from mercurial.utils import stringutil > pycompat.stdout.write(b'%s\n' > % stringutil.pprint(open(sys.argv[1], 'rb').read())) > 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-5.3.1/tests/test-exchange-obsmarkers-case-B5.t0000644015407300116100000001327513627755405023032 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)'` 1 new obsolescence markers obsoleted 1 changesets 2 new orphan changesets $ hg debugobsolete --hidden aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid 'desc(B0)'` 1 new obsolescence markers $ hg debugobsolete --hidden `getid 'desc(B0)'` `getid 'desc(B1)'` 1 new obsolescence markers 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 (3 drafts) (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-5.3.1/tests/test-rebase-emptycommit.t0000644015407300116100000001005713627755405021526 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: not rebasing 3:e7b3f00ed42e "D" (BOOK-D), its destination already has all its changes rebasing 4:69a34c08022a "E" (BOOK-E) note: not rebasing 4:69a34c08022a "E" (BOOK-E), its destination already has all its changes $ 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: not rebasing 3:e7b3f00ed42e "D" (BOOK-D), its destination already has all its changes rebasing 4:69a34c08022a "E" (BOOK-E) note: not rebasing 4:69a34c08022a "E" (BOOK-E), its destination already has all its changes 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: not rebasing 2:dc0947a82db8 "C" (BOOK-C), its destination already has all its changes rebasing 3:b18e25de2cf5 "D" (BOOK-D) note: not rebasing 3:b18e25de2cf5 "D" (BOOK-D), its destination already has all its changes rebasing 4:86a1f6686812 "E" (BOOK-E E) note: not rebasing 4:86a1f6686812 "E" (BOOK-E E), its destination already has all its changes 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: not rebasing 2:dc0947a82db8 "C" (BOOK-C), its destination already has all its changes rebasing 3:b18e25de2cf5 "D" (BOOK-D D) rebasing 4:03ca77807e91 "E" (BOOK-E E) rebasing 5:ad6717a6a58e "F" (BOOK-F) note: not rebasing 5:ad6717a6a58e "F" (BOOK-F), its destination already has all its changes 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-5.3.1/tests/test-empty.t0000644015407300116100000000152113627755405017052 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 checked 0 changesets with 0 changes to 0 files Check the basic files created: $ ls .hg 00changelog.i cache requires store wcache 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 checked 0 changesets with 0 changes to 0 files $ ls .hg 00changelog.i hgrc requires store Should be empty: $ ls .hg/store $ cd .. mercurial-5.3.1/tests/test-push.t0000644015407300116100000002523413627755405016702 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 (9 drafts) (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 checked 1 changesets with 1 changes to 1 files 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 checked 2 changesets with 2 changes to 1 files 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 checked 3 changesets with 3 changes to 1 files 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 checked 4 changesets with 4 changes to 1 files 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 checked 2 changesets with 2 changes to 1 files 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 checked 3 changesets with 3 changes to 1 files 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 checked 4 changesets with 5 changes to 2 files 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 checked 5 changesets with 6 changes to 3 files 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 checked 5 changesets with 5 changes to 2 files $ 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 checked 9 changesets with 7 changes to 4 files $ 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 #if reporevlogstore 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 checked 2 changesets with 4 changes to 2 files 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 checked 2 changesets with 2 changes to 2 files 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 .. #endif 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 lock: user *, process * (*s) (glob) wlock: free added 1 changesets with 1 changes to 1 files $ 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 lock: user *, process * (*s) (glob) wlock: user *, process * (*s) (glob) added 1 changesets with 1 changes to 1 files 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' Test `commands.push.require-revs` --------------------------------- $ hg clone -q test-revflag test-require-revs-source $ hg init test-require-revs-dest $ cd test-require-revs-source $ cat >> .hg/hgrc << EOF > [paths] > default = ../test-require-revs-dest > [commands] > push.require-revs=1 > EOF $ hg push pushing to $TESTTMP/test-require-revs-dest abort: no revisions specified to push (did you mean "hg push -r ."?) [255] $ hg push -r 0 pushing to $TESTTMP/test-require-revs-dest searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files $ hg bookmark -r 0 push-this-bookmark (test that -B (bookmark) works for specifying "revs") $ hg push -B push-this-bookmark pushing to $TESTTMP/test-require-revs-dest searching for changes no changes found exporting bookmark push-this-bookmark [1] (test that -b (branch) works for specifying "revs") $ hg push -b default pushing to $TESTTMP/test-require-revs-dest searching for changes abort: push creates new remote head [0-9a-f]+! (re) (merge or see 'hg help push' for details about pushing new heads) [255] (demonstrate that even though we don't have anything to exchange, we're still showing the error) $ hg push pushing to $TESTTMP/test-require-revs-dest abort: no revisions specified to push (did you mean "hg push -r ."?) [255] $ hg push --config paths.default:pushrev=0 pushing to $TESTTMP/test-require-revs-dest searching for changes no changes found [1] mercurial-5.3.1/tests/test-lrucachedict.py0000644015407300116100000002514213627755405020540 0ustar augieeng00000000000000from __future__ import absolute_import, print_function import unittest import silenttestrunner from mercurial import util class testlrucachedict(unittest.TestCase): def testsimple(self): d = util.lrucachedict(4) self.assertEqual(d.capacity, 4) d.insert('a', 'va', cost=2) d['b'] = 'vb' d['c'] = 'vc' d.insert('d', 'vd', cost=42) self.assertEqual(d['a'], 'va') self.assertEqual(d['b'], 'vb') self.assertEqual(d['c'], 'vc') self.assertEqual(d['d'], 'vd') self.assertEqual(d.totalcost, 44) # 'a' should be dropped because it was least recently used. d['e'] = 've' self.assertNotIn('a', d) self.assertIsNone(d.get('a')) self.assertEqual(d.totalcost, 42) self.assertEqual(d['b'], 'vb') self.assertEqual(d['c'], 'vc') self.assertEqual(d['d'], 'vd') self.assertEqual(d['e'], 've') # Replacing item with different cost adjusts totalcost. d.insert('e', 've', cost=4) self.assertEqual(d.totalcost, 46) # Touch entries in some order (both get and set). d['e'] d['c'] = 'vc2' d['d'] d['b'] = 'vb2' # 'e' should be dropped now d['f'] = 'vf' self.assertNotIn('e', d) self.assertEqual(d['b'], 'vb2') self.assertEqual(d['c'], 'vc2') self.assertEqual(d['d'], 'vd') self.assertEqual(d['f'], 'vf') d.clear() for key in ('a', 'b', 'c', 'd', 'e', 'f'): self.assertNotIn(key, d) def testunfull(self): d = util.lrucachedict(4) d['a'] = 1 d['b'] = 2 d['a'] d['b'] for key in ('a', 'b'): self.assertIn(key, d) def testget(self): d = util.lrucachedict(4) d['a'] = 'va' d['b'] = 'vb' d['c'] = 'vc' self.assertIsNone(d.get('missing')) self.assertEqual(list(d), ['c', 'b', 'a']) self.assertEqual(d.get('a'), 'va') self.assertEqual(list(d), ['a', 'c', 'b']) def testpeek(self): d = util.lrucachedict(4) d['a'] = 'va' d['b'] = 'vb' d['c'] = 'vc' with self.assertRaises(KeyError): d.peek('missing') self.assertEqual(list(d), ['c', 'b', 'a']) self.assertIsNone(d.peek('missing', None)) self.assertEqual(list(d), ['c', 'b', 'a']) self.assertEqual(d.peek('a'), 'va') self.assertEqual(list(d), ['c', 'b', 'a']) def testpop(self): d = util.lrucachedict(4) d['a'] = 'va' d['b'] = 'vb' d['c'] = 'vc' with self.assertRaises(KeyError): d.pop('missing') self.assertEqual(list(d), ['c', 'b', 'a']) self.assertIsNone(d.pop('missing', None)) self.assertEqual(list(d), ['c', 'b', 'a']) self.assertEqual(d.pop('b'), 'vb') self.assertEqual(list(d), ['c', 'a']) def testcopypartial(self): d = util.lrucachedict(4) d.insert('a', 'va', cost=4) d.insert('b', 'vb', cost=2) dc = d.copy() self.assertEqual(len(dc), 2) self.assertEqual(dc.totalcost, 6) for key in ('a', 'b'): self.assertIn(key, dc) self.assertEqual(dc[key], 'v%s' % key) self.assertEqual(len(d), 2) for key in ('a', 'b'): self.assertIn(key, d) self.assertEqual(d[key], 'v%s' % key) d['c'] = 'vc' del d['b'] self.assertEqual(d.totalcost, 4) dc = d.copy() self.assertEqual(len(dc), 2) self.assertEqual(dc.totalcost, 4) for key in ('a', 'c'): self.assertIn(key, dc) self.assertEqual(dc[key], 'v%s' % key) def testcopyempty(self): d = util.lrucachedict(4) dc = d.copy() self.assertEqual(len(dc), 0) def testcopyfull(self): d = util.lrucachedict(4) d.insert('a', 'va', cost=42) d['b'] = 'vb' d['c'] = 'vc' d['d'] = 'vd' dc = d.copy() for key in ('a', 'b', 'c', 'd'): self.assertIn(key, dc) self.assertEqual(dc[key], 'v%s' % key) self.assertEqual(d.totalcost, 42) self.assertEqual(dc.totalcost, 42) # 'a' should be dropped because it was least recently used. dc['e'] = 've' self.assertNotIn('a', dc) for key in ('b', 'c', 'd', 'e'): self.assertIn(key, dc) self.assertEqual(dc[key], 'v%s' % key) self.assertEqual(d.totalcost, 42) self.assertEqual(dc.totalcost, 0) # Contents and order of original dict should remain unchanged. dc['b'] = 'vb_new' self.assertEqual(list(iter(d)), ['d', 'c', 'b', 'a']) for key in ('a', 'b', 'c', 'd'): self.assertEqual(d[key], 'v%s' % key) d = util.lrucachedict(4, maxcost=42) d.insert('a', 'va', cost=5) d.insert('b', 'vb', cost=4) d.insert('c', 'vc', cost=3) dc = d.copy() self.assertEqual(dc.maxcost, 42) self.assertEqual(len(dc), 3) # Max cost can be lowered as part of copy. dc = d.copy(maxcost=10) self.assertEqual(dc.maxcost, 10) self.assertEqual(len(dc), 2) self.assertEqual(dc.totalcost, 7) self.assertIn('b', dc) self.assertIn('c', dc) def testcopydecreasecapacity(self): d = util.lrucachedict(5) d.insert('a', 'va', cost=4) d.insert('b', 'vb', cost=2) d['c'] = 'vc' d['d'] = 'vd' dc = d.copy(2) self.assertEqual(dc.totalcost, 0) for key in ('a', 'b'): self.assertNotIn(key, dc) for key in ('c', 'd'): self.assertIn(key, dc) self.assertEqual(dc[key], 'v%s' % key) dc.insert('e', 've', cost=7) self.assertEqual(dc.totalcost, 7) self.assertNotIn('c', dc) for key in ('d', 'e'): self.assertIn(key, dc) self.assertEqual(dc[key], 'v%s' % key) # Original should remain unchanged. self.assertEqual(d.totalcost, 6) for key in ('a', 'b', 'c', 'd'): self.assertIn(key, d) self.assertEqual(d[key], 'v%s' % key) def testcopyincreasecapacity(self): d = util.lrucachedict(5) d['a'] = 'va' d['b'] = 'vb' d['c'] = 'vc' d['d'] = 'vd' dc = d.copy(6) for key in ('a', 'b', 'c', 'd'): self.assertIn(key, dc) self.assertEqual(dc[key], 'v%s' % key) dc['e'] = 've' dc['f'] = 'vf' for key in ('a', 'b', 'c', 'd', 'e', 'f'): self.assertIn(key, dc) self.assertEqual(dc[key], 'v%s' % key) dc['g'] = 'vg' self.assertNotIn('a', dc) for key in ('b', 'c', 'd', 'e', 'f', 'g'): self.assertIn(key, dc) self.assertEqual(dc[key], 'v%s' % key) # Original should remain unchanged. for key in ('a', 'b', 'c', 'd'): self.assertIn(key, d) self.assertEqual(d[key], 'v%s' % key) def testpopoldest(self): d = util.lrucachedict(4) d.insert('a', 'va', cost=10) d.insert('b', 'vb', cost=5) self.assertEqual(len(d), 2) self.assertEqual(d.popoldest(), ('a', 'va')) self.assertEqual(len(d), 1) self.assertEqual(d.totalcost, 5) self.assertEqual(d.popoldest(), ('b', 'vb')) self.assertEqual(len(d), 0) self.assertEqual(d.totalcost, 0) self.assertIsNone(d.popoldest()) d['a'] = 'va' d['b'] = 'vb' d['c'] = 'vc' d['d'] = 'vd' self.assertEqual(d.popoldest(), ('a', 'va')) self.assertEqual(len(d), 3) for key in ('b', 'c', 'd'): self.assertEqual(d[key], 'v%s' % key) d['a'] = 'va' self.assertEqual(d.popoldest(), ('b', 'vb')) def testmaxcost(self): # Item cost is zero by default. d = util.lrucachedict(6, maxcost=10) d['a'] = 'va' d['b'] = 'vb' d['c'] = 'vc' d['d'] = 'vd' self.assertEqual(len(d), 4) self.assertEqual(d.totalcost, 0) d.clear() # Insertion to exact cost threshold works without eviction. d.insert('a', 'va', cost=6) d.insert('b', 'vb', cost=4) self.assertEqual(len(d), 2) self.assertEqual(d['a'], 'va') self.assertEqual(d['b'], 'vb') # Inserting a new element with 0 cost works. d['c'] = 'vc' self.assertEqual(len(d), 3) # Inserting a new element with cost putting us above high # water mark evicts oldest single item. d.insert('d', 'vd', cost=1) self.assertEqual(len(d), 3) self.assertEqual(d.totalcost, 5) self.assertNotIn('a', d) for key in ('b', 'c', 'd'): self.assertEqual(d[key], 'v%s' % key) # Inserting a new element with enough room for just itself # evicts all items before. d.insert('e', 've', cost=10) self.assertEqual(len(d), 1) self.assertEqual(d.totalcost, 10) self.assertIn('e', d) # Inserting a new element with cost greater than threshold # still retains that item. d.insert('f', 'vf', cost=11) self.assertEqual(len(d), 1) self.assertEqual(d.totalcost, 11) self.assertIn('f', d) # Inserting a new element will evict the last item since it is # too large. d['g'] = 'vg' self.assertEqual(len(d), 1) self.assertEqual(d.totalcost, 0) self.assertIn('g', d) d.clear() d.insert('a', 'va', cost=7) d.insert('b', 'vb', cost=3) self.assertEqual(len(d), 2) # Replacing a value with smaller cost won't result in eviction. d.insert('b', 'vb2', cost=2) self.assertEqual(len(d), 2) # Replacing a value with a higher cost will evict when threshold # exceeded. d.insert('b', 'vb3', cost=4) self.assertEqual(len(d), 1) self.assertNotIn('a', d) def testmaxcostcomplex(self): d = util.lrucachedict(100, maxcost=100) d.insert('a', 'va', cost=9) d.insert('b', 'vb', cost=21) d.insert('c', 'vc', cost=7) d.insert('d', 'vc', cost=50) self.assertEqual(d.totalcost, 87) # Inserting new element should free multiple elements so we hit # low water mark. d.insert('e', 'vd', cost=25) self.assertEqual(len(d), 2) self.assertNotIn('a', d) self.assertNotIn('b', d) self.assertNotIn('c', d) self.assertIn('d', d) self.assertIn('e', d) if __name__ == '__main__': silenttestrunner.main(__name__) mercurial-5.3.1/tests/test-hgweb-empty.t0000644015407300116100000002662713627755405020162 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
    $ (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-5.3.1/tests/test-mq-merge.t0000644015407300116100000000666713627755405017446 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-5.3.1/tests/test-largefiles-cache.t0000644015407300116100000001743613627755405021106 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-5.3.1/tests/test-commit-amend.t0000644015407300116100000010152613627755405020274 0ustar augieeng00000000000000 $ 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:5aba7f3726e6 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:4b0631ef043e 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:06423be42d60 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:a89974a20457 tag: tip parent: 22:06423be42d60 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 Update to p1 with 'aaa' modified. 'aaa' was renamed from 'aa' in p2. 'aa' exists in p1 too, but it was recorded as copied from p2. $ echo modified >> aaa $ hg co -m '.^' -t :merge3 file 'aaa' was deleted in other [destination] but was modified in local [working copy]. You can use (c)hanged version, (d)elete, or leave (u)nresolved. What do you want to do? u 1 files updated, 0 files merged, 1 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges [1] $ hg co -C tip 2 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg mv aaa aa $ hg ci --amend -m 'merge bar again (undo rename)' $ hg log --config diff.git=1 -pr . changeset: 25:282080768800 tag: tip parent: 22:06423be42d60 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 file 'aa' was deleted in other [merge rev] but was modified in local [working copy]. You can use (c)hanged version, (d)elete, or leave (u)nresolved. What do you want to do? c $ hg ci -m 'merge bar (with conflicts)' $ hg log --config diff.git=1 -pr . changeset: 28:ed15db12298d tag: tip parent: 27:eb5adec0b43b 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:0eeafd043f63 tag: tip parent: 27:eb5adec0b43b 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: branch "silliness" has no heads to close [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 amend with --no-edit avoids the editor ------------------------------------------------ $ hg commit --amend -m "before anything happens" $ hg parents --template "{desc}\n" before anything happens $ HGEDITOR=cat hg commit --amend --no-edit -m "editor should be suppressed" $ hg parents --template "{desc}\n" editor should be suppressed (We need a file change here since we won't have a message change) $ cp foo foo.orig $ echo hi >> foo $ HGEDITOR=cat hg commit --amend --no-edit $ hg parents --template "{desc}\n" editor should be suppressed $ hg status -mar (Let's undo adding that "hi" so later tests don't need to be adjusted) $ mv foo.orig foo $ hg commit --amend --no-edit 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 0eeafd043f63 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 0eeafd043f63 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 0eeafd043f63 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 0eeafd043f63 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 0eeafd043f63 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 0eeafd043f63 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 0eeafd043f63 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 0eeafd043f63 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 0eeafd043f63 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 0eeafd043f63 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 0eeafd043f63 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 0eeafd043f63 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 0eeafd043f63 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 0eeafd043f63 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 linkrev nodeid p1 p2 0 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 linkrev nodeid p1 p2 0 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-5.3.1/tests/test-diff-subdir.t0000644015407300116100000000165713627755405020124 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-5.3.1/tests/test-push-checkheads-pruned-B5.t0000644015407300116100000000442613627755405022521 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 (2 drafts) (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)"` 1 new obsolescence markers obsoleted 1 changesets 2 new orphan changesets $ hg debugobsolete `getid "desc(B0)"` `getid "desc(B1)"` 1 new obsolescence markers obsoleted 1 changesets $ hg debugobsolete --record-parents `getid "desc(C0)"` 1 new obsolescence markers 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-5.3.1/tests/test-remotefilelog-blame.t0000644015407300116100000000132013627755405021624 0ustar augieeng00000000000000#require no-windows $ . "$TESTDIR/remotefilelog-library.sh" $ hg init master $ cd master $ cat >> .hg/hgrc < [remotefilelog] > server=True > EOF $ echo x > x $ hg commit -qAm x $ echo y >> x $ hg commit -qAm y $ echo z >> x $ hg commit -qAm z $ echo a > a $ hg commit -qAm a $ cd .. $ hgcloneshallow ssh://user@dummy/master shallow -q 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) $ cd shallow Test blame $ hg blame x 0: x 1: y 2: z 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob) Test grepping the working directory. $ hg grep --all-files x x:x $ echo foo >> x $ hg grep --all-files x x:x mercurial-5.3.1/tests/test-repo-filters-tiptoe.t0000644015407300116100000000640613627755405021640 0ustar augieeng00000000000000=================================== Test repository filtering avoidance =================================== This test file is a bit special as he does not check feature, but performance related internal code path. Right now, filtering a repository comes with a cost that might be significant. Until this get better, ther are various operation that try hard not to trigger a filtering computation. This test file make sure we don't reintroduce code that trigger the filtering for these operation: Setup ----- $ hg init test-repo $ cd test-repo $ echo "some line" > z $ echo a > a $ hg commit -Am a adding a adding z $ echo "in a" >> z $ echo b > b $ hg commit -Am b adding b $ echo "file" >> z $ echo c > c $ hg commit -Am c adding c $ hg rm a $ echo c1 > c $ hg add c c already tracked! $ echo d > d $ hg add d $ rm b $ cat << EOF >> $HGRCPATH > [devel] > debug.repo-filters = yes > [ui] > debug = yes > EOF tests ----- Getting the node of `null` $ hg log -r null -T "{node}\n" 0000000000000000000000000000000000000000 Getting basic changeset inforation about `null` $ hg log -r null -T "{node}\n{date}\n" 0000000000000000000000000000000000000000 0.00 Getting status of null $ hg status --change null Getting status of working copy $ hg status M c A d R a ! b Getting data about the working copy parent $ hg log -r '.' -T "{node}\n{date}\n" c2932ca7786be30b67154d541a8764fae5532261 0.00 Getting working copy diff $ hg diff diff -r c2932ca7786be30b67154d541a8764fae5532261 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 c2932ca7786be30b67154d541a8764fae5532261 c --- a/c Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -c +c1 diff -r c2932ca7786be30b67154d541a8764fae5532261 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 @@ +d $ hg diff --change . diff -r 05293e5dd8d1ae4f84a8520a11c6f97cad26deca -r c2932ca7786be30b67154d541a8764fae5532261 c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +c diff -r 05293e5dd8d1ae4f84a8520a11c6f97cad26deca -r c2932ca7786be30b67154d541a8764fae5532261 z --- a/z Thu Jan 01 00:00:00 1970 +0000 +++ b/z Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +1,3 @@ some line in a +file exporting the current changeset $ hg export exporting patch: # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID c2932ca7786be30b67154d541a8764fae5532261 # Parent 05293e5dd8d1ae4f84a8520a11c6f97cad26deca c diff -r 05293e5dd8d1ae4f84a8520a11c6f97cad26deca -r c2932ca7786be30b67154d541a8764fae5532261 c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +c diff -r 05293e5dd8d1ae4f84a8520a11c6f97cad26deca -r c2932ca7786be30b67154d541a8764fae5532261 z --- a/z Thu Jan 01 00:00:00 1970 +0000 +++ b/z Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +1,3 @@ some line in a +file using annotate - file with a single change $ hg annotate a 0: a - file with multiple change $ hg annotate z 0: some line 1: in a 2: file mercurial-5.3.1/tests/test-convert-svn-move.t0000644015407300116100000001740513627755405021154 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 $ SVNREPOURL="`"$PYTHON" $TESTDIR/svnurlof.py \"$SVNREPOPATH\"`" 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-5.3.1/tests/test-diffstat.t0000644015407300116100000001470613627755405017531 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") and None $ 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") and None $ 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 . --config ui.relative-paths=yes 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 . --config ui.relative-paths=yes new | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) --root trumps ui.relative-paths $ hg diff --stat --root .. --config ui.relative-paths=yes new | 1 + ../dir2/new | 1 + 2 files changed, 2 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(-) When a file is renamed, --git shouldn't loss the info about old file $ hg init issue6025 $ cd issue6025 $ echo > a $ hg ci -Am 'add a' adding a $ hg mv a b $ hg diff --git diff --git a/a b/b rename from a rename to b $ hg diff --stat a | 1 - b | 1 + 2 files changed, 1 insertions(+), 1 deletions(-) $ hg diff --stat --git a => b | 0 1 files changed, 0 insertions(+), 0 deletions(-) -- filename may contain whitespaces $ echo > c $ hg ci -Am 'add c' adding c $ hg mv c 'new c' $ hg diff --git diff --git a/c b/new c rename from c rename to new c $ hg diff --stat c | 1 - new c | 1 + 2 files changed, 1 insertions(+), 1 deletions(-) $ hg diff --stat --git c => new c | 0 1 files changed, 0 insertions(+), 0 deletions(-) Make sure `diff --stat -q --config diff.git-0` shows stat (issue4037) $ hg status A new c R c $ hg diff --stat -q c | 1 - new c | 1 + 2 files changed, 1 insertions(+), 1 deletions(-) mercurial-5.3.1/tests/test-exchange-obsmarkers-case-D4.t0000644015407300116100000001353213627755405023027 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 1 new obsolescence markers obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid 'desc(A1)'` 1 new obsolescence markers $ hg debugobsolete `getid 'desc(B0)'` bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 1 new obsolescence markers obsoleted 1 changesets $ hg debugobsolete bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb `getid 'desc(B1)'` 1 new obsolescence markers $ 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 (1 drafts) (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-5.3.1/tests/test-config.t0000644015407300116100000001752213627755405017171 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 [ { "defaultvalue": null, "name": "Section.KeY", "source": "*.hgrc:*", (glob) "value": "Case Sensitive" }, { "defaultvalue": null, "name": "Section.key", "source": "*.hgrc:*", (glob) "value": "lower case" } ] $ hg showconfig Section.KeY -Tjson [ { "defaultvalue": null, "name": "Section.KeY", "source": "*.hgrc:*", (glob) "value": "Case Sensitive" } ] $ hg showconfig -Tjson | tail -7 { "defaultvalue": null, "name": "*", (glob) "source": "*", (glob) "value": "*" (glob) } ] Test config default of various types: {"defaultvalue": ""} for -T'json(defaultvalue)' looks weird, but that's how the templater works. Unknown keywords are evaluated to "". dynamicdefault $ hg config --config alias.foo= alias -Tjson [ { "name": "alias.foo", "source": "--config", "value": "" } ] $ hg config --config alias.foo= alias -T'json(defaultvalue)' [ {"defaultvalue": ""} ] $ hg config --config alias.foo= alias -T'{defaultvalue}\n' null $ hg config --config auth.cookiefile= auth -Tjson [ { "defaultvalue": null, "name": "auth.cookiefile", "source": "--config", "value": "" } ] $ hg config --config auth.cookiefile= auth -T'json(defaultvalue)' [ {"defaultvalue": null} ] $ hg config --config auth.cookiefile= auth -T'{defaultvalue}\n' false $ hg config --config commands.commit.post-status= commands -Tjson [ { "defaultvalue": false, "name": "commands.commit.post-status", "source": "--config", "value": "" } ] $ hg config --config commands.commit.post-status= commands -T'json(defaultvalue)' [ {"defaultvalue": false} ] $ hg config --config commands.commit.post-status= commands -T'{defaultvalue}\n' False true $ hg config --config format.dotencode= format -Tjson [ { "defaultvalue": true, "name": "format.dotencode", "source": "--config", "value": "" } ] $ hg config --config format.dotencode= format -T'json(defaultvalue)' [ {"defaultvalue": true} ] $ hg config --config format.dotencode= format -T'{defaultvalue}\n' True bytes $ hg config --config commands.resolve.mark-check= commands -Tjson [ { "defaultvalue": "none", "name": "commands.resolve.mark-check", "source": "--config", "value": "" } ] $ hg config --config commands.resolve.mark-check= commands -T'json(defaultvalue)' [ {"defaultvalue": "none"} ] $ hg config --config commands.resolve.mark-check= commands -T'{defaultvalue}\n' none empty list $ hg config --config commands.show.aliasprefix= commands -Tjson [ { "defaultvalue": [], "name": "commands.show.aliasprefix", "source": "--config", "value": "" } ] $ hg config --config commands.show.aliasprefix= commands -T'json(defaultvalue)' [ {"defaultvalue": []} ] $ hg config --config commands.show.aliasprefix= commands -T'{defaultvalue}\n' nonempty list $ hg config --config progress.format= progress -Tjson [ { "defaultvalue": ["topic", "bar", "number", "estimate"], "name": "progress.format", "source": "--config", "value": "" } ] $ hg config --config progress.format= progress -T'json(defaultvalue)' [ {"defaultvalue": ["topic", "bar", "number", "estimate"]} ] $ hg config --config progress.format= progress -T'{defaultvalue}\n' topic bar number estimate int $ hg config --config profiling.freq= profiling -Tjson [ { "defaultvalue": 1000, "name": "profiling.freq", "source": "--config", "value": "" } ] $ hg config --config profiling.freq= profiling -T'json(defaultvalue)' [ {"defaultvalue": 1000} ] $ hg config --config profiling.freq= profiling -T'{defaultvalue}\n' 1000 float $ hg config --config profiling.showmax= profiling -Tjson [ { "defaultvalue": 0.999, "name": "profiling.showmax", "source": "--config", "value": "" } ] $ hg config --config profiling.showmax= profiling -T'json(defaultvalue)' [ {"defaultvalue": 0.999} ] $ hg config --config profiling.showmax= profiling -T'{defaultvalue}\n' 0.999 Test empty config source: $ cat < emptysource.py > def reposetup(ui, repo): > ui.setconfig(b'empty', b'source', b'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 [ { "defaultvalue": null, "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 .. configs should be read in lexicographical order $ mkdir configs $ for i in `$TESTDIR/seq.py 10 99`; do > printf "[section]\nkey=$i" > configs/$i.rc > done $ HGRCPATH=configs hg config section.key 99 mercurial-5.3.1/tests/test-audit-path.t0000644015407300116100000001174013627755405017760 0ustar augieeng00000000000000The simple store doesn't escape paths robustly and can't store paths with periods, etc. So much of this test fails with it. #require no-reposimplestore $ 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 (5 drafts) (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 abort: $TESTTMP/target/back/test: $ENOTDIR$ [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-5.3.1/tests/test-issue1802.t0000644015407300116100000000321213627755405017356 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 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-5.3.1/tests/test-hghave.t0000644015407300116100000000206413627755405017161 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 --with-hg=`which hg` -j 1 \ > $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t \ > ) running 1 tests using 1 parallel processes . # 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 > NO_CHECK_EOF $ hghave custom failed to import hghaveaddon.py from '.': invalid syntax (hghaveaddon.py, line 1) [2] mercurial-5.3.1/tests/test-unbundlehash.t0000644015407300116100000000256513627755405020405 0ustar augieeng00000000000000Test 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-5.3.1/tests/test-issue4074.t0000644015407300116100000000103313627755405017361 0ustar augieeng00000000000000#require no-pure A script to generate nasty diff worst-case scenarios: $ cat > s.py < import random > for x in range(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 --config worker.enabled=no time: real .* secs .user [0-9][.].* sys .* (re) mercurial-5.3.1/tests/test-trusted.py.out0000644015407300116100000001110613627755405020401 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 ignored: ('foo', '.hg/hgrc:1') # same user, same group ParseError('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-5.3.1/tests/test-branch-tag-confict.t0000644015407300116100000000311413627755405021345 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-5.3.1/tests/test-uncommit.t0000644015407300116100000003606513627755405017562 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. If no files are specified, the commit will be pruned, unless --keep is given. (use 'hg help -e uncommit' to show help for the uncommit extension) options ([+] can be repeated): --keep allow an empty commit after uncommitting --allow-dirty-working-copy allow uncommit with outstanding changes -n --note TEXT store a note on uncommit -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 -d --date DATE record the specified date as commit date -u --user USER record the specified user as committer -D --currentdate record the current date as commit date -U --currentuser record the current user as committer (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 aborts $ hg uncommit nothinghere abort: cannot uncommit "nothinghere" (file does not exist) [255] $ hg status $ hg uncommit file-abc abort: cannot uncommit "file-abc" (file was not changed in working directory parent) [255] $ 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 (requires --allow-dirty-working-copy to uncommit) [255] $ hg uncommit files abort: uncommitted changes (requires --allow-dirty-working-copy to uncommit) [255] $ cat files abcde foo $ hg commit --amend -m "files abcde + foo" Testing the 'experimental.uncommitondirtywdir' config $ echo "bar" >> files $ hg uncommit abort: uncommitted changes (requires --allow-dirty-working-copy to uncommit) [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:84beeba0ac30e19521c036e4d2dd3a5fa02586ff 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' Phase is preserved $ hg uncommit --keep --config phases.new-commit=secret note: keeping empty commit $ hg phase -r . 14: draft $ hg commit --amend -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 . 17: draft $ hg phase -r ".^" 11: public Uncommit with --keep or experimental.uncommit.keep leaves an empty changeset $ cd $TESTTMP $ hg init repo1 $ cd repo1 $ hg debugdrawdag <<'EOS' > Q > | > P > EOS $ hg up Q -q $ hg uncommit --keep note: keeping empty commit $ hg log -G -T '{desc} FILES: {files}' @ Q FILES: | | x Q FILES: Q |/ o P FILES: P $ cat >> .hg/hgrc < [experimental] > uncommit.keep=True > EOF $ hg ci --amend $ hg uncommit note: keeping empty commit $ hg log -G -T '{desc} FILES: {files}' @ Q FILES: | | x Q FILES: Q |/ o P FILES: P $ hg status A Q $ hg ci --amend $ hg uncommit --no-keep $ hg log -G -T '{desc} FILES: {files}' x Q FILES: Q | @ 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 (requires --allow-dirty-working-copy to uncommit) [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 Rename a->b, then remove b in working copy. Result should remove a. $ hg co -q 0 $ hg mv a b $ hg ci -qm 'move a to b' $ hg rm b $ hg uncommit --config experimental.uncommitondirtywdir=True $ hg st --copies R a $ hg revert a Rename a->b, then rename b->c in working copy. Result should rename a->c. $ hg co -q 0 $ hg mv a b $ hg ci -qm 'move a to b' $ hg mv b c $ hg uncommit --config experimental.uncommitondirtywdir=True $ hg st --copies A c a R a $ hg revert a $ hg forget c $ rm c Copy a->b1 and a->b2, then rename b1->c in working copy. Result should copy a->b2 and a->c. $ hg co -q 0 $ hg cp a b1 $ hg cp a b2 $ hg ci -qm 'move a to b1 and b2' $ hg mv b1 c $ hg uncommit --config experimental.uncommitondirtywdir=True $ hg st --copies A b2 a A c a $ cd .. --allow-dirty-working-copy should also work on a dirty PATH $ hg init issue5977 $ cd issue5977 $ echo 'super critical info!' > a $ hg ci -Am 'add a' adding a $ echo 'foo' > b $ hg add b $ hg status A b $ hg unc a note: keeping empty commit $ cat a super critical info! $ hg log changeset: 1:656ba143d384 tag: tip parent: -1:000000000000 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add a $ hg ci -Am 'add b' $ echo 'foo bar' > b $ hg unc b abort: uncommitted changes (requires --allow-dirty-working-copy to uncommit) [255] $ hg unc --allow-dirty-working-copy b $ hg log changeset: 3:30fa958635b2 tag: tip parent: 1:656ba143d384 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add b changeset: 1:656ba143d384 parent: -1:000000000000 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add a Removes can be uncommitted $ hg ci -m 'modified b' $ hg rm b $ hg ci -m 'remove b' $ hg uncommit b note: keeping empty commit $ hg status R b Uncommitting a directory won't run afoul of the checks that an explicit file can be uncommitted. $ mkdir dir $ echo 1 > dir/file.txt $ hg ci -Aqm 'add file in directory' $ hg uncommit dir -m 'uncommit with message' -u 'different user' \ > -d 'Jun 30 12:12:12 1980 +0000' $ hg status A dir/file.txt $ hg log -r . changeset: 8:b4dd26dc42e0 tag: tip parent: 6:2278a4c24330 user: different user date: Mon Jun 30 12:12:12 1980 +0000 summary: uncommit with message Bad option combinations $ hg rollback -q --config ui.rollback=True $ hg uncommit -U --user 'user' abort: cannot specify both --user and --currentuser [255] $ hg uncommit -D --date today abort: cannot specify both --date and --currentdate [255] `uncommit ` and `cd && uncommit .` behave the same... $ echo 2 > dir/file2.txt $ hg ci -Aqm 'add file2 in directory' $ hg uncommit dir note: keeping empty commit $ hg status A dir/file2.txt $ hg rollback -q --config ui.rollback=True $ cd dir $ hg uncommit . -n 'this is a note' note: keeping empty commit $ hg status A dir/file2.txt $ cd .. ... and errors out the same way when nothing can be uncommitted $ hg rollback -q --config ui.rollback=True $ mkdir emptydir $ hg uncommit emptydir abort: cannot uncommit "emptydir" (file was untracked in working directory parent) [255] $ cd emptydir $ hg uncommit . abort: cannot uncommit "emptydir" (file was untracked in working directory parent) [255] $ hg status $ cd .. mercurial-5.3.1/tests/test-ssh-bundle1.t0000644015407300116100000004276713627755405020062 0ustar augieeng00000000000000This test is a duplicate of 'test-http.t' feel free to factor out parts that are not bundle1/bundle2 specific. #testcases sshv1 sshv2 #if sshv2 $ cat >> $HGRCPATH << EOF > [experimental] > sshpeer.advertise-v2 = true > sshserver.support-v2 = true > EOF #endif $ cat << EOF >> $HGRCPATH > [devel] > # This test is dedicated to interaction through old bundle > legacy.exchange = bundle1 > 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 --line changegroup-in-remote 0 ../dummylog" > EOF $ cd $TESTTMP 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 #if no-msys $ 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] #endif clone remote via stream #if no-reposimplestore $ 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 checked 3 changesets with 2 changes to 2 files $ hg branches default 0:1160648e36ce $ cd $TESTTMP 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 $TESTTMP $ rm -rf local-stream stream2 #endif 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 checked 3 changesets with 2 changes to 2 files $ cat >> .hg/hgrc < [hooks] > changegroup = sh -c "printenv.py --line 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 $TESTTMP/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 checked 4 changesets with 3 changes to 2 files $ hg cat -r tip foo bleah $ echo z > z $ hg ci -A -m z z created new head test pushkeys and bookmarks $ cd $TESTTMP/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 $TESTTMP 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 $TESTTMP 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(b'local stdout\n') > return res > > def extsetup(ui): > extensions.wrapfunction(exchange, b'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 upgrade request: * proto=exp-ssh-v2-0003 (glob) (sshv2 !) sending hello command sending between command remote: 440 (sshv1 !) protocol upgraded to exp-ssh-v2-0003 (sshv2 !) remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash remote: 1 (sshv1 !) sending protocaps command 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 $TESTTMP $ 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 (no-msys !) Got arguments 1:user@dummy 2:hg -R remote serve --stdio Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio (no-reposimplestore !) Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !) Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !) 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_TXNNAME=serve remote:ssh:$LOCALIP 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_TXNNAME=serve remote:ssh:$LOCALIP 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_TXNNAME=serve remote:ssh:$LOCALIP 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(b'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: 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-5.3.1/tests/test-hgweb.t0000644015407300116100000006154113627755405017020 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
    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 "from __future__ import print_function; print(len(open('access.log', 'rb').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: 9074 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; } a.title 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; z-index: 15; } #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 { position: absolute; 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; } 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 '[up]' entry in file view when in root directory $ get-with-headers.py localhost:$HGPORT 'file/tip?style=paper' | grep -F '[up]' [1] $ get-with-headers.py localhost:$HGPORT 'file/tip/da?style=paper' | grep -F '[up]' [up] $ get-with-headers.py localhost:$HGPORT 'file/tip?style=coal' | grep -F '[up]' [1] $ get-with-headers.py localhost:$HGPORT 'file/tip/da?style=coal' | grep -F '[up]' [up] $ get-with-headers.py localhost:$HGPORT 'file/tip?style=gitweb' | grep -F '[up]' [1] $ get-with-headers.py localhost:$HGPORT 'file/tip/da?style=gitweb' | grep -F '[up]' [up] $ get-with-headers.py localhost:$HGPORT 'file/tip?style=monoblue' | grep -F '[up]' [1] $ get-with-headers.py localhost:$HGPORT 'file/tip/da?style=monoblue' | grep -F '[up]' [up] $ get-with-headers.py localhost:$HGPORT 'file/tip?style=spartan' | grep -F '[up]' [1] $ get-with-headers.py localhost:$HGPORT 'file/tip/da?style=spartan' | grep -F '[up]' [up] 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 $ killdaemons.py Test signal-safe-lock in web and non-web processes $ cat <<'EOF' > disablesig.py > import signal > from mercurial import error, extensions > def disabledsig(orig, signalnum, handler): > if signalnum == signal.SIGTERM: > raise error.Abort(b'SIGTERM cannot be replaced') > try: > return orig(signalnum, handler) > except ValueError: > raise error.Abort(b'signal.signal() called in thread?') > def uisetup(ui): > extensions.wrapfunction(signal, b'signal', disabledsig) > EOF by default, signal interrupt should be disabled while making a lock file $ hg debuglock -s --config extensions.disablesig=disablesig.py abort: SIGTERM cannot be replaced [255] but in hgweb, it isn't disabled since some WSGI servers complains about unsupported signal.signal() calls (see issue5889) $ hg serve --config extensions.disablesig=disablesig.py \ > --config web.allow-push='*' --config web.push_ssl=False \ > -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS $ hg clone -q http://localhost:$HGPORT/ repo $ hg bookmark -R repo foo push would fail if signal.signal() were called $ hg push -R repo -B foo pushing to http://localhost:$HGPORT/ searching for changes no changes found exporting bookmark foo [1] $ rm -R repo $ killdaemons.py errors $ cat errors.log | "$PYTHON" $TESTDIR/filtertraceback.py $ rm -f errors.log Uncaught exceptions result in a logged error and canned HTTP response $ 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 $ cat errors.log | "$PYTHON" $TESTDIR/filtertraceback.py .* Exception happened during processing request '/raiseerror': (re) Traceback (most recent call last): AttributeError: I am an uncaught error! 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 HTTP 304 works with hgwebdir (issue5844) $ cat > hgweb.conf << EOF > [paths] > /repo = $TESTTMP/test > EOF $ hg serve --web-conf hgweb.conf -p $HGPORT -d --pid-file hg.pid -E error.log $ cat hg.pid >> $DAEMON_PIDS $ get-with-headers.py --twice --headeronly localhost:$HGPORT 'repo/static/style.css' - date etag server 200 Script output follows content-length: 2677 content-type: text/css 304 Not Modified $ killdaemons.py $ cd .. mercurial-5.3.1/tests/test-url-rev.t0000644015407300116100000001717113627755405017320 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-5.3.1/tests/test-clone-uncompressed.t0000644015407300116100000004360213627755405021527 0ustar augieeng00000000000000#require serve no-reposimplestore no-chg #testcases stream-legacy stream-bundle2 #if stream-legacy $ cat << EOF >> $HGRCPATH > [server] > bundle2.stream = no > 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(b"%d" % i) and None $ 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 rev-branch-cache $ 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 rev-branch-cache $ 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.5 KB of data transferred 96.5 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=112262 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| 0010: 7f 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......| 0020: 05 09 04 0c 44 62 79 74 65 63 6f 75 6e 74 39 38 |....Dbytecount98| 0030: 37 37 35 66 69 6c 65 63 6f 75 6e 74 31 30 33 30 |775filecount1030| 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 70 61 72 |Crevlogv1%2Cspar| 0080: 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 65 |serevlog%2Cstore| 0090: 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 00 |....s.Bdata/0.i.| 00a0: 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 00 |................| 00b0: 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff 80 |................| 00c0: 29 63 a0 49 d3 23 87 bf ce fe 56 67 92 67 2c 69 |)c.I.#....Vg.g,i| 00d0: d1 ec 39 00 00 00 00 00 00 00 00 00 00 00 00 75 |..9............u| 00e0: 30 73 08 42 64 61 74 61 2f 31 2e 69 00 03 00 01 |0s.Bdata/1.i....| 00f0: 00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 00 |................| --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.5 KB of data transferred 96.5 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 updating the branch cache 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: 2 parts total checking for updated bookmarks (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob) #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.5 KB of data starting 4 threads for background file closing starting 4 threads for background file closing updating the branch cache transferred 96.5 KB in * seconds (* */sec) (glob) bundle2-input-part: total payload size 112094 bundle2-input-part: "listkeys" (params: 1 mandatory) supported bundle2-input-bundle: 2 parts total checking for updated bookmarks (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob) #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.5 KB of data transferred 96.5 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 #if stream-legacy With v1 of the stream protocol, changeset are always cloned as public. There's no obsolescence markers exchange in stream v1. #endif #if stream-bundle2 Stream repository with obsolescence ----------------------------------- Clone non-publishing with obsolescence $ cat >> $HGRCPATH << EOF > [experimental] > evolution=all > EOF $ cd server $ echo foo > foo $ hg -q commit -m 'about to be pruned' $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents 1 new obsolescence markers obsoleted 1 changesets $ hg up null -q $ hg log -T '{rev}: {phase}\n' 1: draft 0: draft $ hg serve -p $HGPORT -d --pid-file=hg.pid $ cat hg.pid > $DAEMON_PIDS $ cd .. $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence streaming all changes 1035 files to transfer, 97.1 KB of data transferred 97.1 KB in * seconds (* */sec) (glob) $ hg -R with-obsolescence log -T '{rev}: {phase}\n' 1: draft 0: draft $ hg debugobsolete -R with-obsolescence 50382b884f66690b7045cac93a540cba4d4c906f 0 {c17445101a72edac06facd130d14808dfbd5c7c2} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution streaming all changes remote: abort: server has obsolescence markers, but client cannot receive them via stream clone abort: pull failed on remote [255] $ killdaemons.py #endif mercurial-5.3.1/tests/test-histedit-merge-tools.t0000644015407300116100000000271113627755405021766 0ustar augieeng00000000000000Test histedit extension: Merge tools ==================================== Initialization --------------- $ . "$TESTDIR/histedit-helpers.sh" $ cat >> $HGRCPATH < [alias] > logt = log --template '{rev}:{node|short} {desc|firstline}\n' > [extensions] > histedit= > mockmakedate = $TESTDIR/mockmakedate.py > [ui] > pre-merge-tool-output-template='pre-merge message for {node}\n' > EOF Merge conflict -------------- $ hg init r $ cd r $ echo foo > file $ hg add file $ hg ci -m "First" -d "1 0" $ echo bar > file $ hg ci -m "Second" -d "2 0" $ hg logt --graph @ 1:2aa920f62fb9 Second | o 0:7181f42b8fca First Invert the order of the commits, but fail the merge. $ hg histedit --config ui.merge=false --commands - 2>&1 < pick 2aa920f62fb9 Second > pick 7181f42b8fca First > EOF merging file pre-merge message for b90fa2e91a6d11013945a5f684be45b84a8ca6ec merging file failed! Fix up the change (pick 7181f42b8fca) (hg histedit --continue to resume) $ hg histedit --abort | fixbundle 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Invert the order of the commits, and pretend the merge succeeded. $ hg histedit --config ui.merge=true --commands - 2>&1 < pick 2aa920f62fb9 Second > pick 7181f42b8fca First > EOF merging file pre-merge message for b90fa2e91a6d11013945a5f684be45b84a8ca6ec 7181f42b8fca: skipping changeset (no changes) mercurial-5.3.1/tests/test-rename-after-merge.t0000644015407300116100000000436413627755405021367 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 1 local changesets published (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-5.3.1/tests/test-revlog-group-emptyiter.t0000644015407300116100000000125513627755405022370 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-5.3.1/tests/test-symlink-placeholder.t0000644015407300116100000000363313627755405021670 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') and None $ 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) and None $ 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') and None $ 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-5.3.1/tests/test-histedit-outgoing.t0000644015407300116100000001014613627755405021365 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-5.3.1/tests/test-pathconflicts-merge.t0000644015407300116100000001073613627755405021662 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 $ 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 #if symlink $ mkdir a $ ln -s c a/b $ hg add a/b $ hg commit -m "link" created new head #else $ hg import -q --bypass - < # HG changeset patch > link > > diff --git a/a/b b/a/b > new file mode 120000 > --- /dev/null > +++ b/a/b > @@ -0,0 +1,1 @@ > +c > \ No newline at end of file > EOF $ hg up -q #endif $ 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 #if symlink $ readlink.py a/b.old a/b.old -> c #else $ cat a/b.old c (no-eol) #endif $ hg resolve --mark a/b (no more unresolved files) $ hg commit -m "merge link (rename link)" mercurial-5.3.1/tests/test-mq-qrefresh-replace-log-message.t0000644015407300116100000001712413627755405023766 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(b'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-5.3.1/tests/test-amend.t0000644015407300116100000003256313627755405017012 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: cannot specify both --message and --logfile [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'? (enter ? for help) [Ynesfdaq?] y diff --git a/G b/G new file mode 100644 examine changes to 'G'? (enter ? for help) [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 ================================= Test backup-bundle config option| ================================= $ hg init $TESTTMP/repo4 $ cd $TESTTMP/repo4 $ echo a>a $ hg ci -Aqma $ echo oops>b $ hg ci -Aqm "b" $ echo partiallyfixed > b #if obsstore-off $ hg amend saved backup bundle to $TESTTMP/repo4/.hg/strip-backup/95e899acf2ce-f11cb050-amend.hg When backup-bundle config option is set: $ cat << EOF >> $HGRCPATH > [rewrite] > backup-bundle = False > EOF $ echo fixed > b $ hg amend #else $ hg amend When backup-bundle config option is set: $ cat << EOF >> $HGRCPATH > [rewrite] > backup-bundle = False > EOF $ echo fixed > b $ hg amend #endif ========================================== Test update-timestamp config option| ========================================== $ cat >> $HGRCPATH << EOF > [extensions] > amend= > mockmakedate = $TESTDIR/mockmakedate.py > EOF $ hg init $TESTTMP/repo5 $ cd $TESTTMP/repo5 $ cat <<'EOF' >> .hg/hgrc > [ui] > logtemplate = 'user: {user} > date: {date|date} > summary: {desc|firstline}\n' > EOF $ echo a>a $ hg ci -Am 'commit 1' adding a When updatetimestamp is False $ hg amend --date '1997-1-1 0:1' $ hg log --limit 1 user: test date: Wed Jan 01 00:01:00 1997 +0000 summary: commit 1 When update-timestamp is True and no other change than the date $ hg amend --config rewrite.update-timestamp=True nothing changed [1] $ hg log --limit 1 user: test date: Wed Jan 01 00:01:00 1997 +0000 summary: commit 1 When update-timestamp is True and there is other change than the date $ hg amend --user foobar --config rewrite.update-timestamp=True $ hg log --limit 1 user: foobar date: Thu Jan 01 00:00:02 1970 +0000 summary: commit 1 When date option is applicable and update-timestamp is True $ hg amend --date '1998-1-1 0:1' --config rewrite.update-timestamp=True $ hg log --limit 1 user: foobar date: Thu Jan 01 00:01:00 1998 +0000 summary: commit 1 Unlike rewrite.update-timestamp, -D/--currentdate always updates the timestamp $ hg amend -D $ hg log --limit 1 user: foobar date: Thu Jan 01 00:00:04 1970 +0000 summary: commit 1 $ hg amend -D --config rewrite.update-timestamp=True $ hg log --limit 1 user: foobar date: Thu Jan 01 00:00:05 1970 +0000 summary: commit 1 rewrite.update-timestamp can be negated by --no-currentdate $ hg amend --config rewrite.update-timestamp=True --no-currentdate -u baz $ hg log --limit 1 user: baz date: Thu Jan 01 00:00:05 1970 +0000 summary: commit 1 Bad combination of date options: $ hg amend -D --date '0 0' abort: cannot specify both --date and --currentdate [255] Close branch $ hg amend --secret --close-branch $ hg log --limit 1 -T 'close={get(extras, "close")}\nphase={phase}\n' close=1 phase=secret $ cd .. Corner case of amend from issue6157: - working copy parent has a change to file `a` - working copy has the inverse change - we amend the working copy parent for files other than `a` hg used to include the changes to `a` anyway. $ hg init 6157; cd 6157 $ echo a > a; echo b > b; hg commit -qAm_ $ echo a2 > a; hg commit -qm_ $ hg diff --stat -c . a | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) $ echo a > a; echo b2 > b; hg amend -q b $ hg diff --stat -c . a | 2 +- b | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Modifying a file while the editor is open can cause dirstate corruption (issue6233) $ cd $TESTTMP $ hg init modify-during-amend; cd modify-during-amend $ echo r0 > foo; hg commit -qAm "r0" $ echo alpha > foo; hg commit -qm "alpha" $ echo beta >> foo $ cat > $TESTTMP/touchy_editor.sh < sleep 1 > echo delta >> "$TESTTMP/modify-during-amend/foo" > sleep 1 > echo hi > "\$1" > sleep 1 > EOF $ HGEDITOR="sh $TESTTMP/touchy_editor.sh" hg commit --amend $ if (hg diff -c . | grep 'delta' >/dev/null) || [ -n "$(hg status)" ]; then > echo "OK." > else > echo "Bug detected. 'delta' is not part of the commit OR the wdir" > echo "Diff and status before rebuild:" > hg diff > hg status > hg debugrebuilddirstate > echo "Diff and status after rebuild:" > hg diff > hg status > fi OK. mercurial-5.3.1/tests/test-issue2137.t0000644015407300116100000000305413627755405017364 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(b'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-5.3.1/tests/helper-runtests.sh0000644015407300116100000000017213627755405020253 0ustar augieeng00000000000000# # Avoid interference from actual test env: unset HGTEST_JOBS unset HGTEST_TIMEOUT unset HGTEST_PORT unset HGTEST_SHELL mercurial-5.3.1/tests/test-wireproto-command-known.t0000644015407300116100000000253613627755405022523 0ustar augieeng00000000000000 $ . $TESTDIR/wireprotohelpers.sh $ hg init server $ enablehttpv2 server $ cd server $ hg debugdrawdag << EOF > C D > |/ > B > | > A > EOF $ hg log -T '{rev}:{node} {desc}\n' 3:be0ef73c17ade3fc89dc41701eb9fc3a91b58282 D 2:26805aba1e600a82e93661149f2313866a221a7b C 1:112478962961147124edd43549aedd1a335e44bf B 0:426bada5c67598ca65036d57d9e4b64b0c1ce7a0 A $ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS No arguments returns something reasonable $ sendhttpv2peer << EOF > command known > EOF creating http peer for wire protocol version 2 sending known command response: [] Single known node works $ sendhttpv2peer << EOF > command known > nodes eval:[b'\x42\x6b\xad\xa5\xc6\x75\x98\xca\x65\x03\x6d\x57\xd9\xe4\xb6\x4b\x0c\x1c\xe7\xa0'] > EOF creating http peer for wire protocol version 2 sending known command response: [ True ] Multiple nodes works $ sendhttpv2peer << EOF > command known > nodes eval:[b'\x42\x6b\xad\xa5\xc6\x75\x98\xca\x65\x03\x6d\x57\xd9\xe4\xb6\x4b\x0c\x1c\xe7\xa0', b'00000000000000000000', b'\x11\x24\x78\x96\x29\x61\x14\x71\x24\xed\xd4\x35\x49\xae\xdd\x1a\x33\x5e\x44\xbf'] > EOF creating http peer for wire protocol version 2 sending known command response: [ True, False, True ] $ cat error.log mercurial-5.3.1/tests/test-server-view.t0000644015407300116100000000361313627755405020176 0ustar augieeng00000000000000 $ hg init test $ cd test $ hg debugbuilddag '+2' $ hg phase --public 0 $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log $ cat hg.pid >> $DAEMON_PIDS $ cd .. $ hg init test2 $ cd test2 $ hg incoming http://foo:xyzzy@localhost:$HGPORT/ comparing with http://foo:***@localhost:$HGPORT/ changeset: 0:1ea73414a91b user: debugbuilddag date: Thu Jan 01 00:00:00 1970 +0000 summary: r0 changeset: 1:66f7d451a68b tag: tip user: debugbuilddag date: Thu Jan 01 00:00:01 1970 +0000 summary: r1 $ killdaemons.py $ cd .. $ hg -R test --config server.view=immutable serve -p $HGPORT -d --pid-file=hg.pid -E errors.log $ cat hg.pid >> $DAEMON_PIDS $ hg -R test2 incoming http://foo:xyzzy@localhost:$HGPORT/ comparing with http://foo:***@localhost:$HGPORT/ changeset: 0:1ea73414a91b tag: tip user: debugbuilddag date: Thu Jan 01 00:00:00 1970 +0000 summary: r0 Check same result using `experimental.extra-filter-revs` $ hg -R test --config experimental.extra-filter-revs='not public()' serve -p $HGPORT1 -d --pid-file=hg2.pid -E errors.log $ cat hg2.pid >> $DAEMON_PIDS $ hg -R test2 incoming http://foo:xyzzy@localhost:$HGPORT1/ comparing with http://foo:***@localhost:$HGPORT1/ changeset: 0:1ea73414a91b tag: tip user: debugbuilddag date: Thu Jan 01 00:00:00 1970 +0000 summary: r0 $ hg -R test --config experimental.extra-filter-revs='not public()' debugupdatecache $ ls -1 test/.hg/cache/ branch2-base%89c45d2fa07e branch2-immutable%89c45d2fa07e branch2-served branch2-served%89c45d2fa07e branch2-served.hidden%89c45d2fa07e branch2-visible%89c45d2fa07e branch2-visible-hidden%89c45d2fa07e hgtagsfnodes1 rbc-names-v1 rbc-revs-v1 tags2 tags2-served%89c45d2fa07e cleanup $ cat errors.log $ killdaemons.py mercurial-5.3.1/tests/test-locate.t0000644015407300116100000000442313627755405017167 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 files --config ui.relative-paths=yes ../b ../dir.h/foo ../t.h ../t/e.h ../t/x $ hg files --config ui.relative-paths=no b dir.h/foo t.h t/e.h t/x $ hg files --config ui.relative-paths=legacy ../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] Fileset at null (i.e. a falsy context) shouldn't crash (issue6046) $ hg files -r null 'set:tracked()' [1] Convert native path separator to slash (issue5572) $ hg files -T '{path|relpath|slashpath}\n' ../b ../dir.h/foo ../t.h ../t/e.h ../t/x $ cd ../.. mercurial-5.3.1/tests/test-bookmarks-current.t0000644015407300116100000001257513627755405021377 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 Checks command to retrieve active bookmark ------------------------------------------ display how "{activebookmark}" template is unsuitable for the task $ hg book -T '- {activebookmark}\n' - - Y - $ hg book -r . W $ hg book -T '- {activebookmark}\n' - Y - - Y - $ hg bookmarks -ql . Y $ hg bookmarks --inactive $ hg bookmarks -ql . abort: no active bookmark! [255] mercurial-5.3.1/tests/test-empty-group.t0000644015407300116100000000613713627755405020214 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-5.3.1/tests/narrow-library.sh0000644015407300116100000000017213627755405020061 0ustar augieeng00000000000000cat >> $HGRCPATH <¼Ð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-5.3.1/tests/gpg/trustdb.gpg0000644015407300116100000000240013627755405017512 0ustar augieeng00000000000000gpgJ5\}  €ËûbG—µ5>¢- §N$ñò WÖC–™ üÁ~»>Ã+¦Ê^ymercurial-5.3.1/tests/wireprotosimplecache.py0000644015407300116100000001351413627755405021361 0ustar augieeng00000000000000# wireprotosimplecache.py - Extension providing in-memory wire protocol cache # # Copyright 2018 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. from __future__ import absolute_import from mercurial import ( extensions, registrar, util, wireprotoserver, wireprototypes, wireprotov2server, ) from mercurial.interfaces import ( repository, util as interfaceutil, ) from mercurial.utils import stringutil CACHE = None configtable = {} configitem = registrar.configitem(configtable) configitem(b'simplecache', b'cacheapi', default=False) configitem(b'simplecache', b'cacheobjects', default=False) configitem(b'simplecache', b'redirectsfile', default=None) # API handler that makes cached keys available. def handlecacherequest(rctx, req, res, checkperm, urlparts): if rctx.repo.ui.configbool(b'simplecache', b'cacheobjects'): res.status = b'500 Internal Server Error' res.setbodybytes(b'cacheobjects not supported for api server') return if not urlparts: res.status = b'200 OK' res.headers[b'Content-Type'] = b'text/plain' res.setbodybytes(b'simple cache server') return key = b'/'.join(urlparts) if key not in CACHE: res.status = b'404 Not Found' res.headers[b'Content-Type'] = b'text/plain' res.setbodybytes(b'key not found in cache') return res.status = b'200 OK' res.headers[b'Content-Type'] = b'application/mercurial-cbor' res.setbodybytes(CACHE[key]) def cachedescriptor(req, repo): return {} wireprotoserver.API_HANDLERS[b'simplecache'] = { b'config': (b'simplecache', b'cacheapi'), b'handler': handlecacherequest, b'apidescriptor': cachedescriptor, } @interfaceutil.implementer(repository.iwireprotocolcommandcacher) class memorycacher(object): def __init__( self, ui, command, encodefn, redirecttargets, redirecthashes, req ): self.ui = ui self.encodefn = encodefn self.redirecttargets = redirecttargets self.redirecthashes = redirecthashes self.req = req self.key = None self.cacheobjects = ui.configbool(b'simplecache', b'cacheobjects') self.cacheapi = ui.configbool(b'simplecache', b'cacheapi') self.buffered = [] ui.log(b'simplecache', b'cacher constructed for %s\n', command) def __enter__(self): return self def __exit__(self, exctype, excvalue, exctb): if exctype: self.ui.log(b'simplecache', b'cacher exiting due to error\n') def adjustcachekeystate(self, state): # Needed in order to make tests deterministic. Don't copy this # pattern for production caches! del state[b'repo'] def setcachekey(self, key): self.key = key return True def lookup(self): if self.key not in CACHE: self.ui.log(b'simplecache', b'cache miss for %s\n', self.key) return None entry = CACHE[self.key] self.ui.log(b'simplecache', b'cache hit for %s\n', self.key) redirectable = True if not self.cacheapi: redirectable = False elif not self.redirecttargets: redirectable = False else: clienttargets = set(self.redirecttargets) ourtargets = set(t[b'name'] for t in loadredirecttargets(self.ui)) # We only ever redirect to a single target (for now). So we don't # need to store which target matched. if not clienttargets & ourtargets: redirectable = False if redirectable: paths = self.req.dispatchparts[:-3] paths.append(b'simplecache') paths.append(self.key) url = b'%s/%s' % (self.req.baseurl, b'/'.join(paths)) # url = b'http://example.com/%s' % self.key self.ui.log( b'simplecache', b'sending content redirect for %s to ' b'%s\n', self.key, url, ) response = wireprototypes.alternatelocationresponse( url=url, mediatype=b'application/mercurial-cbor' ) return {b'objs': [response]} if self.cacheobjects: return { b'objs': entry, } else: return { b'objs': [wireprototypes.encodedresponse(entry)], } def onobject(self, obj): if self.cacheobjects: self.buffered.append(obj) else: self.buffered.extend(self.encodefn(obj)) yield obj def onfinished(self): self.ui.log(b'simplecache', b'storing cache entry for %s\n', self.key) if self.cacheobjects: CACHE[self.key] = self.buffered else: CACHE[self.key] = b''.join(self.buffered) return [] def makeresponsecacher( orig, repo, proto, command, args, objencoderfn, redirecttargets, redirecthashes, ): return memorycacher( repo.ui, command, objencoderfn, redirecttargets, redirecthashes, proto._req, ) def loadredirecttargets(ui): path = ui.config(b'simplecache', b'redirectsfile') if not path: return [] with open(path, 'rb') as fh: s = fh.read() return stringutil.evalpythonliteral(s) def getadvertisedredirecttargets(orig, repo, proto): return loadredirecttargets(repo.ui) def extsetup(ui): global CACHE CACHE = util.lrucachedict(10000) extensions.wrapfunction( wireprotov2server, b'makeresponsecacher', makeresponsecacher ) extensions.wrapfunction( wireprotov2server, b'getadvertisedredirecttargets', getadvertisedredirecttargets, ) mercurial-5.3.1/tests/test-symlink-os-yes-fs-no.py0000644015407300116100000000302613627755405022026 0ustar augieeng00000000000000from __future__ import absolute_import import os import sys import time from mercurial import ( commands, hg, pycompat, 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, {}, b'.', create=True) # unbundle with symlink support hg.peer(u, {}, b'test0', create=True) repo = hg.repository(u, b'test0') commands.unbundle(u, repo, pycompat.fsencode(BUNDLEPATH), update=True) # 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 b'test0/a.lnk', b'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, b'test0') commands.status(u, repo) # try unbundling a repo which contains symlinks u = uimod.ui.load() repo = hg.repository(u, b'test1', create=True) commands.unbundle(u, repo, pycompat.fsencode(BUNDLEPATH), update=True) mercurial-5.3.1/tests/test-confused-revert.t0000644015407300116100000000231713627755405021033 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 forgetting b undeleting a 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 forgetting b undeleting a Should show b unknown and a marked modified (merged): $ hg status M a ? b Should show foo-b: $ cat a foo-b mercurial-5.3.1/tests/test-clone-update-order.t0000644015407300116100000000664613627755405021422 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-5.3.1/tests/test-merge-combination.t0000644015407300116100000001464313627755405021324 0ustar augieeng00000000000000This file shows what hg says are "modified" files for a merge commit (hg log -T {files}), somewhat exhaustively. It shows merges that involves files contents changing, and merges that involve executable bit changing, but not merges with multiple or zero merge ancestors, nor copies/renames, and nor identical file contents with different filelog revisions. genmerges is the workhorse. Given: - a range function describing the possible values for file a - a isgood function to filter out uninteresting combination - a createfile function to actually write the values for file a on the filesystem it print a series of lines that look like: abcd C: output of -T {files} describing the file a at respectively the base, p2, p1, merge revision. "C" indicates that hg merge had conflicts. $ genmerges () { > for base in `range` -; do > for r1 in `range $base` -; do > for r2 in `range $base $r1` -; do > for m in `range $base $r1 $r2` -; do > line="$base$r1$r2$m" > isgood $line || continue > hg init repo > cd repo > make_commit () { > v=$1; msg=$2; file=$3; > if [ $v != - ]; then > createfile $v > else > if [ -f a ] > then rm a > else touch $file > fi > fi > hg commit -q -Am $msg || exit 123 > } > echo foo > foo > make_commit $base base b > make_commit $r1 r1 c > hg up -r 0 -q > make_commit $r2 r2 d > hg merge -q -r 1 > ../output 2>&1 > if [ $? -ne 0 ]; then rm -f *.orig; hg resolve -m --all -q; fi > if [ -s ../output ]; then conflicts=" C"; else conflicts=" "; fi > make_commit $m m e > if [ $m = $r1 ] && [ $m = $r2 ] > then expected= > elif [ $m = $r1 ] > then if [ $base = $r2 ] > then expected= > else expected=a > fi > elif [ $m = $r2 ] > then if [ $base = $r1 ] > then expected= > else expected=a > fi > else expected=a > fi > got=`hg log -r 3 --template '{files}\n' | tr -d 'e '` > if [ "$got" = "$expected" ] > then echo "$line$conflicts: agree on \"$got\"" > else echo "$line$conflicts: hg said \"$got\", expected \"$expected\"" > fi > cd ../ > rm -rf repo > done > done > done > done > } All the merges of various file contents. $ range () { > max=0 > for i in $@; do > if [ $i = - ]; then continue; fi > if [ $i -gt $max ]; then max=$i; fi > done > $TESTDIR/seq.py `expr $max + 1` > } $ isgood () { true; } $ createfile () { > if [ -f a ] && [ "`cat a`" = $1 ] > then touch $file > else echo $v > a > fi > } $ genmerges 1111 : agree on "" 1112 : agree on "a" 111- : agree on "a" 1121 : agree on "a" 1122 : agree on "" 1123 : agree on "a" 112- : agree on "a" 11-1 : hg said "", expected "a" 11-2 : agree on "a" 11-- : agree on "" 1211 : agree on "a" 1212 : agree on "" 1213 : agree on "a" 121- : agree on "a" 1221 : agree on "a" 1222 : agree on "" 1223 : agree on "a" 122- : agree on "a" 1231 C: agree on "a" 1232 C: agree on "a" 1233 C: agree on "a" 1234 C: agree on "a" 123- C: agree on "a" 12-1 C: agree on "a" 12-2 C: hg said "", expected "a" 12-3 C: agree on "a" 12-- C: agree on "a" 1-11 : hg said "", expected "a" 1-12 : agree on "a" 1-1- : agree on "" 1-21 C: agree on "a" 1-22 C: hg said "", expected "a" 1-23 C: agree on "a" 1-2- C: agree on "a" 1--1 : agree on "a" 1--2 : agree on "a" 1--- : agree on "" -111 : agree on "" -112 : agree on "a" -11- : agree on "a" -121 C: agree on "a" -122 C: agree on "a" -123 C: agree on "a" -12- C: agree on "a" -1-1 : agree on "" -1-2 : agree on "a" -1-- : agree on "a" --11 : agree on "" --12 : agree on "a" --1- : agree on "a" ---1 : agree on "a" ---- : agree on "" All the merges of executable bit. $ range () { > max=a > for i in $@; do > if [ $i = - ]; then continue; fi > if [ $i > $max ]; then max=$i; fi > done > if [ $max = a ]; then echo f; else echo f x; fi > } $ isgood () { case $line in *f*x*) true;; *) false;; esac; } $ createfile () { > if [ -f a ] && (([ -x a ] && [ $v = x ]) || (! [ -x a ] && [ $v != x ])) > then touch $file > else touch a; if [ $v = x ]; then chmod +x a; else chmod -x a; fi > fi > } #if execbit $ genmerges fffx : agree on "a" ffxf : agree on "a" ffxx : agree on "" ffx- : agree on "a" ff-x : hg said "", expected "a" fxff : hg said "", expected "a" fxfx : hg said "a", expected "" fxf- : agree on "a" fxxf : agree on "a" fxxx : agree on "" fxx- : agree on "a" fx-f : hg said "", expected "a" fx-x : hg said "", expected "a" fx-- : hg said "", expected "a" f-fx : agree on "a" f-xf : agree on "a" f-xx : hg said "", expected "a" f-x- : agree on "a" f--x : agree on "a" -ffx : agree on "a" -fxf C: agree on "a" -fxx C: hg said "", expected "a" -fx- C: agree on "a" -f-x : hg said "", expected "a" --fx : agree on "a" #endif Files modified or cleanly merged, with no greatest common ancestors: $ hg init repo; cd repo $ touch a0 b0; hg commit -qAm 0 $ hg up -qr null; touch a1 b1; hg commit -qAm 1 $ hg merge -qr 0; rm b*; hg commit -qAm 2 $ hg log -r . -T '{files}\n' b0 b1 $ cd ../ $ rm -rf repo A few cases of criss-cross merges involving deletions (listing all such merges is probably too much). Both gcas contain $files, so we expect the final merge to behave like a merge with a single gca containing $files. $ hg init repo; cd repo $ files="c1 u1 c2 u2" $ touch $files; hg commit -qAm '0 root' $ for f in $files; do echo f > $f; done; hg commit -qAm '1 gca1' $ hg up -qr0; hg revert -qr 1 --all; hg commit -qAm '2 gca2' $ hg up -qr 1; hg merge -qr 2; rm *1; hg commit -qAm '3 p1' $ hg up -qr 2; hg merge -qr 1; rm *2; hg commit -qAm '4 p2' $ hg merge -qr 3; echo f > u1; echo f > u2; rm -f c1 c2 $ hg commit -qAm '5 merge with two gcas' $ hg log -r . -T '{files}\n' # expecting u1 u2 $ cd ../ $ rm -rf repo mercurial-5.3.1/tests/test-convert-hg-sink.t0000644015407300116100000003427413627755405020745 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 $ echo '1234567890123456789012345678901234567890 missing_tag' >> .hgtags $ hg ci -m 'add a missing tag' $ hg log changeset: 4:3fb95ee23a66 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: add a missing tag changeset: 3:593cbf6fb2b4 tag: local-tag 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... 4 add foo and bar 3 remove foo 2 add foo/file 1 Added tag some-tag for changeset ad681a868e44 0 add a missing tag missing tag entry: "1234567890123456789012345678901234567890 missing_tag" $ cd new $ hg log -G --template '{rev} {node|short} ({phase}) "{desc}"\n' o 4 3fb95ee23a66 (public) "add a missing tag" | 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... 5 add foo and bar 4 remove foo 3 add foo/file 2 Added tag some-tag for changeset ad681a868e44 1 add a missing tag missing tag entry: "1234567890123456789012345678901234567890 missing_tag" 0 add baz $ cd new-filemap $ hg tags tip 3:7bb553f2c68a 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 Recorded {files} list does not get confused about flags on merge commits #if execbit $ cd .. $ hg init merge-flags-orig $ cd merge-flags-orig $ echo 0 > 0 $ hg ci -Aqm 'add 0' $ echo a > a $ chmod +x a $ hg ci -qAm 'add executable file' $ hg co -q 0 $ echo b > b $ hg ci -qAm 'add file' $ hg merge -q $ hg ci -m 'merge' $ hg log -G -T '{rev} {desc}\n' @ 3 merge |\ | o 2 add file | | o | 1 add executable file |/ o 0 add 0 # No files changed $ hg log -r 3 -T '{files}\n' $ cd .. $ hg convert merge-flags-orig merge-flags-new -q $ cd merge-flags-new $ hg log -G -T '{rev} {desc}\n' o 3 merge |\ | o 2 add file | | o | 1 add executable file |/ o 0 add 0 # Still no files $ hg log -r 3 -T '{files}\n' #endif mercurial-5.3.1/tests/test-rename-dir-merge.t0000644015407300116100000001504413627755405021041 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 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 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 1 local changesets published (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-5.3.1/tests/test-revlog.t0000644015407300116100000000266713627755405017226 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(b'\x00\x01\x00\x00') and None $ 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(b'\x00\x04\x00\x01') and None $ 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(b'\x00\x00\x00\x02') and None $ hg log abort: unknown version (2) in revlog 00changelog.i! [255] $ cd .. Test for CVE-2016-3630 $ hg init >>> import codecs >>> open("a.i", "wb").write(codecs.decode(codecs.decode( ... b"""eJxjYGZgZIAAYQYGxhgom+k/FMx8YKx9ZUaKSOyqo4cnuKb8mbqHV5cBCVTMWb1Cwqkhe4Gsg9AD ... Joa3dYtcYYYBAQ8Qr4OqZAYRICPTSr5WKd/42rV36d+8/VmrNpv7NP1jQAXrQE4BqQUARngwVA==""", ... "base64"), "zlib")) and None $ hg debugrevlogindex a.i rev linkrev nodeid p1 p2 0 2 99e0332bd498 000000000000 000000000000 1 3 6674f57a23d8 99e0332bd498 000000000000 >>> from mercurial import revlog, vfs >>> tvfs = vfs.vfs(b'.') >>> tvfs.options = {b'revlogv1': True} >>> rl = revlog.revlog(tvfs, b'a.i') >>> rl.revision(1) mpatchError(*'patch cannot be decoded'*) (glob) mercurial-5.3.1/tests/test-hgwebdir-paths.py0000644015407300116100000000222713627755405021015 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(b'webdir') os.chdir(b'webdir') webdir = os.path.realpath(b'.') u = uimod.ui.load() hg.repository(u, b'a', create=1) hg.repository(u, b'b', create=1) os.chdir(b'b') hg.repository(u, b'd', create=1) os.chdir(b'..') hg.repository(u, b'c', create=1) os.chdir(b'..') paths = { b't/a/': b'%s/a' % webdir, b'b': b'%s/b' % webdir, b'coll': b'%s/*' % webdir, b'rcoll': b'%s/**' % webdir, } config = os.path.join(webdir, b'hgwebdir.conf') configfile = open(config, 'wb') configfile.write(b'[paths]\n') for k, v in paths.items(): configfile.write(b'%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-5.3.1/tests/test-bundle2-format.t0000644015407300116100000015213313627755405020543 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 error.ProgrammingError as exc: > raise error.Abort(b'%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(b'missing support for %s' % exc) > except error.PushRaced as exc: > raise error.Abort(b'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: 7 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: remote 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 (8 drafts) (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 changesets: 1/4 chunks (25.00%) changesets: 2/4 chunks (50.00%) changesets: 3/4 chunks (75.00%) changesets: 4/4 chunks (100.00%) manifests: 1/4 chunks (25.00%) manifests: 2/4 chunks (50.00%) manifests: 3/4 chunks (75.00%) manifests: 4/4 chunks (100.00%) files: D 1/3 files (33.33%) files: E 2/3 files (66.67%) files: 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 -- {} (mandatory: False) 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 added 0 changesets with 0 changes to 3 files 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 37 61 64 64 69 6e 67 20 63 68 61 6e 67 65 73 |.7adding 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 00 00 00 00 00 00 00 | changes........| 00a0: 00 |.| 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 -- {} (mandatory: False) 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 -- {} (mandatory: False) 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-5.3.1/tests/test-revert.t0000644015407300116100000007737513627755405017247 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 .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 forgetting z removing d adding a 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 forgetting newdir/newfile reverting b/b $ echo foobar > b/b $ hg revert . reverting b/b respects ui.relative-paths -------------------------- $ echo foo > newdir/newfile $ hg add newdir/newfile $ hg revert --all --cwd newdir forgetting newfile $ echo foo > newdir/newfile $ hg add newdir/newfile $ hg revert --all --cwd newdir --config ui.relative-paths=True forgetting newfile $ echo foo > newdir/newfile $ hg add newdir/newfile $ hg revert --all --cwd newdir --config ui.relative-paths=False forgetting newdir/newfile 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 removing ignored adding allyour adding base $ 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 > from __future__ import print_function > 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 forgetting content1_missing_content1-tracked forgetting content1_missing_content3-tracked forgetting content1_missing_missing-tracked forgetting missing_missing_content3-tracked forgetting missing_missing_missing-tracked reverting content1_content1_content3-tracked reverting content1_content1_missing-tracked reverting content1_content2_content1-tracked reverting content1_content2_content3-tracked reverting content1_content2_missing-tracked reverting missing_content2_content3-tracked reverting missing_content2_missing-tracked 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 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)' forgetting missing_missing_content3-tracked forgetting missing_missing_missing-tracked removing missing_content2_content2-tracked removing missing_content2_content3-tracked removing missing_content2_missing-tracked reverting content1_content1_content3-tracked reverting content1_content1_missing-tracked reverting content1_content2_content2-tracked reverting content1_content2_content3-tracked reverting content1_content2_missing-tracked reverting content1_missing_content3-tracked reverting content1_missing_missing-tracked adding content1_missing_content1-untracked adding content1_missing_content3-untracked adding content1_missing_missing-untracked 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 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 removing B reverting A $ 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 removing B reverting A $ hg status --rev 1 $ cd .. mercurial-5.3.1/tests/test-hgwebdirsym.t0000644015407300116100000000316213627755405020243 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-5.3.1/tests/test-export.t0000644015407300116100000002362713627755405017250 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) Using bookmarks: $ hg book -f -r 9 @ $ hg book -f -r 11 test $ hg export -B test # 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 # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID f3acbafac161ec68f1598af38f794f28847ca5d3 # Parent 5f17a83f5fbd9414006a5e563eab4c8a00729efd foo-11 diff -r 5f17a83f5fbd -r f3acbafac161 foo --- a/foo Thu Jan 01 00:00:00 1970 +0000 +++ b/foo Thu Jan 01 00:00:00 1970 +0000 @@ -9,3 +9,4 @@ foo-8 foo-9 foo-10 +foo-11 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 Templated output to stdout: $ hg export -Tjson 0 [ { "branch": "default", "date": [0, 0], "desc": "foo-0", "diff": "diff -r 000000000000 -r 871558de6af2 foo\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n@@ -0,0 +1,1 @@\n+foo-0\n", "node": "871558de6af2e8c244222f8eea69b782c94ce3df", "parents": [], "user": "test" } ] Templated output to single file: $ hg export -Tjson 0:1 -o out.json $ cat out.json [ { "branch": "default", "date": [0, 0], "desc": "foo-0", "diff": "diff -r 000000000000 -r 871558de6af2 foo\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n@@ -0,0 +1,1 @@\n+foo-0\n", "node": "871558de6af2e8c244222f8eea69b782c94ce3df", "parents": [], "user": "test" }, { "branch": "default", "date": [0, 0], "desc": "foo-1", "diff": "diff -r 871558de6af2 -r d1c9656e973c foo\n--- a/foo\tThu Jan 01 00:00:00 1970 +0000\n+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n@@ -1,1 +1,2 @@\n foo-0\n+foo-1\n", "node": "d1c9656e973cfb5aebd5499bbd2cb350e3b12266", "parents": ["871558de6af2e8c244222f8eea69b782c94ce3df"], "user": "test" } ] Templated output to multiple files: $ hg export -Tjson 0:1 -o 'out-{rev}.json' $ cat out-0.json [ { "branch": "default", "date": [0, 0], "desc": "foo-0", "diff": "diff -r 000000000000 -r 871558de6af2 foo\n--- /dev/null\tThu Jan 01 00:00:00 1970 +0000\n+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n@@ -0,0 +1,1 @@\n+foo-0\n", "node": "871558de6af2e8c244222f8eea69b782c94ce3df", "parents": [], "user": "test" } ] $ cat out-1.json [ { "branch": "default", "date": [0, 0], "desc": "foo-1", "diff": "diff -r 871558de6af2 -r d1c9656e973c foo\n--- a/foo\tThu Jan 01 00:00:00 1970 +0000\n+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n@@ -1,1 +1,2 @@\n foo-0\n+foo-1\n", "node": "d1c9656e973cfb5aebd5499bbd2cb350e3b12266", "parents": ["871558de6af2e8c244222f8eea69b782c94ce3df"], "user": "test" } ] Template keywrods: $ hg export 0 -T '# {node|shortest}\n\n{diff}' # 8715 diff -r 000000000000 -r 871558de6af2 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 @@ +foo-0 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 Template fragments in file name: $ hg export -v -o '{node|shortest}.patch' tip exporting patch: 197e.patch Backslash should be preserved because it is a directory separator on Windows: $ mkdir out $ hg export -v -o 'out\{node|shortest}.patch' tip exporting patch: out\197e.patch Still backslash is taken as an escape character in inner template strings: $ hg export -v -o '{"out\{foo}.patch"}' tip exporting patch: out{foo}.patch Invalid pattern in file name: $ hg export -o '%x.patch' tip abort: invalid format spec '%x' in output filename [255] $ hg export -o '%' tip abort: incomplete format spec in output filename [255] $ hg export -o '%{"foo"}' tip abort: incomplete format spec in output filename [255] $ hg export -o '%m{' tip hg: parse error at 3: unterminated template expansion (%m{ ^ here) [255] $ hg export -o '%\' tip abort: invalid format spec '%\' in output filename [255] $ hg export -o '\%' tip abort: incomplete format spec in output filename [255] 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-5.3.1/tests/test-convert-cvs-synthetic.t0000644015407300116100000001131413627755405022176 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-5.3.1/tests/test-linerange.py0000644015407300116100000001671613627755405020061 0ustar augieeng00000000000000from __future__ import absolute_import import unittest from mercurial import error, mdiff from mercurial.utils import stringutil # for readability, line numbers are 0-origin text1 = b''' 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 = b''' 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], b'!'), ((3, 7, 2, 6), b'='), ([7, 12, 6, 12], b'!'), ((12, 12, 12, 12), b'='), ], 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( b'line range exceeds file size' in stringutil.forcebytestr(exc) ) else: self.fail('%s not raised' % exctype.__name__) if __name__ == '__main__': import silenttestrunner silenttestrunner.main(__name__) mercurial-5.3.1/tests/test-fileset-generated.t0000644015407300116100000001460413627755405021311 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()' forgetting content1_missing_missing-tracked forgetting missing_missing_missing-tracked reverting content1_content1_missing-tracked reverting content1_content2_missing-tracked reverting missing_content2_missing-tracked $ hg revert 'set:unknown()' $ hg revert 'set:clean()' mercurial-5.3.1/tests/test-mq-safety.t0000644015407300116100000001150713627755405017627 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-5.3.1/tests/test-issue1438.t0000644015407300116100000000055713627755405017374 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-5.3.1/tests/test-mq-qgoto.t0000644015407300116100000000267013627755405017466 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-5.3.1/tests/test-execute-bit.t0000644015407300116100000000103513627755405020132 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-5.3.1/tests/test-gendoc-el.t0000644015407300116100000000012413627755405017547 0ustar augieeng00000000000000#require docutils gettext $ $TESTDIR/check-gendoc el checking for parse errors mercurial-5.3.1/tests/test-wireproto.py0000644015407300116100000000523413627755405020140 0ustar augieeng00000000000000from __future__ import absolute_import, print_function import sys from mercurial import ( error, pycompat, ui as uimod, util, wireprototypes, wireprotov1peer, wireprotov1server, ) from mercurial.utils import stringutil stringio = util.stringio class proto(object): def __init__(self, args): self.args = args self.name = 'dummyproto' def getargs(self, spec): args = self.args args.setdefault(b'*', {}) names = spec.split() return [args[n] for n in names] def checkperm(self, perm): pass wireprototypes.TRANSPORTS['dummyproto'] = { 'transport': 'dummy', 'version': 1, } class clientpeer(wireprotov1peer.wirepeer): def __init__(self, serverrepo, ui): self.serverrepo = serverrepo self.ui = ui def url(self): return b'test' def local(self): return None def peer(self): return self def canpush(self): return True def close(self): pass def capabilities(self): return [b'batch'] def _call(self, cmd, **args): args = pycompat.byteskwargs(args) res = wireprotov1server.dispatch(self.serverrepo, proto(args), cmd) if isinstance(res, wireprototypes.bytesresponse): return res.data elif isinstance(res, bytes): return res else: raise error.Abort('dummy client does not support response type') def _callstream(self, cmd, **args): return stringio(self._call(cmd, **args)) @wireprotov1peer.batchable def greet(self, name): f = wireprotov1peer.future() yield {b'name': mangle(name)}, f yield unmangle(f.value) class serverrepo(object): def __init__(self, ui): self.ui = ui def greet(self, name): return b"Hello, " + name def filtered(self, name): return self def mangle(s): return b''.join(pycompat.bytechr(ord(c) + 1) for c in pycompat.bytestr(s)) def unmangle(s): return b''.join(pycompat.bytechr(ord(c) - 1) for c in pycompat.bytestr(s)) def greet(repo, proto, name): return mangle(repo.greet(unmangle(name))) wireprotov1server.commands[b'greet'] = (greet, b'name') srv = serverrepo(uimod.ui()) clt = clientpeer(srv, uimod.ui()) def printb(data, end=b'\n'): out = getattr(sys.stdout, 'buffer', sys.stdout) out.write(data + end) out.flush() printb(clt.greet(b"Foobar")) with clt.commandexecutor() as e: fgreet1 = e.callcommand(b'greet', {b'name': b'Fo, =;: { > "$PYTHON" $TESTDIR/run-tests.py --with-hg=`which hg` -j1 "$@" > } error paths #if symlink $ ln -s `which true` hg $ "$PYTHON" $TESTDIR/run-tests.py --with-hg=./hg warning: --with-hg should specify an hg script running 0 tests using 0 parallel processes # Ran 0 tests, 0 skipped, 0 failed. $ rm hg #endif #if execbit $ touch hg $ "$PYTHON" $TESTDIR/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 running 1 tests using 1 parallel processes . # 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 running 1 tests using 1 parallel processes . # 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 running 1 tests using 1 parallel processes --- $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 how multiple globs gets matched with lines in output $ cat > test-failure-globs.t < $ echo "context"; echo "context"; \ > echo "key: 1"; echo "value: not a"; \ > echo "key: 2"; echo "value: not b"; \ > echo "key: 3"; echo "value: c"; \ > echo "key: 4"; echo "value: d" > context > context > key: 1 > value: a > key: 2 > value: b > key: 3 > value: * (glob) > key: 4 > value: * (glob) > EOF $ rt test-failure-globs.t running 1 tests using 1 parallel processes --- $TESTTMP/test-failure-globs.t +++ $TESTTMP/test-failure-globs.t.err @@ -2,9 +2,9 @@ context context key: 1 - value: a + value: not a key: 2 - value: b + value: not b key: 3 value: * (glob) key: 4 ERROR: test-failure-globs.t output changed ! Failed test-failure-globs.t: output changed # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] $ rm test-failure-globs.t test diff colorisation #if no-windows pygments $ rt test-failure.t --color always running 1 tests using 1 parallel processes \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 running 1 tests using 1 parallel processes [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 running 1 tests using 1 parallel processes --- $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 running 3 tests using 1 parallel processes --- $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-unicode.t: output changed Failed test-failure.t: output changed # Ran 3 tests, 0 skipped, 2 failed. python hash seed: * (glob) [1] test --outputdir $ mkdir output $ rt --outputdir output running 3 tests using 1 parallel processes --- $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-unicode.t: output changed Failed test-failure.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 running 3 tests using 1 parallel processes --- $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-unicode.t: output changed Failed test-failure.t: output changed # Ran 3 tests, 0 skipped, 2 failed. python hash seed: * (glob) [1] $ cat xunit.xml (glob) (glob) (no-py38 !) (py38 !) ]]> (no-py38 !) (glob) (no-py38 !) (py38 !) ]]> (no-py38 !) $ cat .testtimes test-empty.t * (glob) test-failure-globs.t * (glob) 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 running 2 tests using 1 parallel processes --- $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 running 2 tests using 1 parallel processes --- $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 running 1 tests using 1 parallel processes . # Ran 1 tests, 0 skipped, 0 failed. success w/ keyword $ rt -k xyzzy running 2 tests using 1 parallel processes . # Ran 2 tests, 1 skipped, 0 failed. failed $ rt test-failure.t running 1 tests using 1 parallel processes --- $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 running 2 tests using 1 parallel processes --- $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 running 1 tests using 1 parallel processes --- $TESTTMP/test-serve-fail.t +++ $TESTTMP/test-serve-fail.t.err @@ -1* +1,2 @@ (glob) $ echo 'abort: child process failed to start blah' + abort: child process failed to start blah 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 =================================== Extensions aren't inherited by the invoked run-tests.py. An extension introducing a repository requirement could cause this to fail. So we force HGRCPATH to get a clean environment. $ HGRCPATH= 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 running 1 tests using 1 parallel processes . # Ran 1 tests, 0 skipped, 0 failed. $ rm test-serve-inuse.t $ killdaemons.py $DAEMON_PIDS Running In Debug Mode ====================== $ rt --debug 2>&1 | grep -v pwd running 2 tests using 1 parallel processes + alias hg=hg.exe (windows !) + echo *SALT* 0 0 (glob) *SALT* 0 0 (glob) + echo babar babar + echo *SALT* 10 0 (glob) *SALT* 10 0 (glob) .+ alias hg=hg.exe (windows !) *+ 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 running 2 tests using 2 parallel processes !! 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 running 2 tests using 2 parallel processes --- $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 multiple runs per test should be parallelized $ rt --jobs 2 --runs-per-test 2 test-success.t running 2 tests using 2 parallel processes .. # Ran 2 tests, 0 skipped, 0 failed. Interactive run =============== (backup the failing test) $ cp test-failure.t backup Refuse the fix $ echo 'n' | rt -i running 2 tests using 1 parallel processes --- $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 running 2 tests using 1 parallel processes $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 running 2 tests using 1 parallel processes $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 running 2 tests using 1 parallel processes --- $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 running 1 tests using 1 parallel processes --- $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 running 2 tests using 1 parallel processes --- $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 running 2 tests using 1 parallel processes .. # Ran 2 tests, 0 skipped, 0 failed. When using multiple dimensions of "#testcases" in .t files $ cat > test-cases.t <<'EOF' > #testcases a b > #testcases c d > #if a d > $ echo $TESTCASE > a#d > #endif > #if b c > $ echo yes > no > #endif > EOF $ rt test-cases.t running 4 tests using 1 parallel processes .. --- $TESTTMP/test-cases.t +++ $TESTTMP/test-cases.t#b#c.err @@ -6,5 +6,5 @@ #endif #if b c $ echo yes - no + yes #endif ERROR: test-cases.t#b#c output changed !. Failed test-cases.t#b#c: output changed # Ran 4 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] $ rm test-cases.t#b#c.err $ rm test-cases.t (reinstall) $ mv backup test-failure.t No Diff =============== $ rt --nodiff running 2 tests using 1 parallel processes !. 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 running 1 tests using 1 parallel processes 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 running 2 tests using 1 parallel processes 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 running 2 tests using 1 parallel processes .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 running 1 tests using 1 parallel processes . # Ran 1 tests, 0 skipped, 0 failed. # Producing time report start end cuser csys real Test \s*[\d\.]{5,8} \s*[\d\.]{5,8} \s*[\d\.]{5,8} \s*[\d\.]{5,8} \s*[\d\.]{5,8} test-success.t (re) test for --time with --job enabled ==================================== $ rt test-success.t --time --jobs 2 running 1 tests using 1 parallel processes . # Ran 1 tests, 0 skipped, 0 failed. # Producing time report start end cuser csys real Test \s*[\d\.]{5,8} \s*[\d\.]{5,8} \s*[\d\.]{5,8} \s*[\d\.]{5,8} \s*[\d\.]{5,8} test-success.t (re) Skips ================ $ cat > test-skip.t < $ echo xyzzy > #if true > #require false > #end > EOF $ cat > test-noskip.t < #if false > #require false > #endif > EOF $ rt --nodiff running 4 tests using 1 parallel processes !.s. Skipped test-skip.t: missing feature: nail clipper Failed test-failure.t: output changed # Ran 3 tests, 1 skipped, 1 failed. python hash seed: * (glob) [1] $ rm test-noskip.t $ rt --keyword xyzzy running 3 tests using 1 parallel processes .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 running 3 tests using 1 parallel processes .s Skipped test-skip.t: missing feature: nail clipper # Ran 2 tests, 2 skipped, 0 failed. $ cat xunit.xml (glob) (py38 !) (no-py38 !) (no-py38 !) 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 running 2 tests using 1 parallel processes 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 running 2 tests using 1 parallel processes 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 running 1 tests using 1 parallel processes . # Ran 1 tests, 0 skipped, 0 failed. $ echo test-bogus.t >> anothertest $ rt --test-list=onlytest --test-list=anothertest running 2 tests using 1 parallel processes s. Skipped test-bogus.t: Doesn't exist # Ran 1 tests, 1 skipped, 0 failed. $ rm onlytest anothertest test for --json ================== $ rt --json running 3 tests using 1 parallel processes --- $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+\.\d{3,4}", ? (re) "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "---.+\+\+\+.+", ? (re) "end": "\s*\d+\.\d{3,4}", ? (re) "result": "failure", ? (re) "start": "\s*\d+\.\d{3,4}", ? (re) "time": "\s*\d+\.\d{3,4}" (re) }, ? (re) "test-skip.t": { "csys": "\s*\d+\.\d{3,4}", ? (re) "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "", ? (re) "end": "\s*\d+\.\d{3,4}", ? (re) "result": "skip", ? (re) "start": "\s*\d+\.\d{3,4}", ? (re) "time": "\s*\d+\.\d{3,4}" (re) }, ? (re) "test-success.t": [\{] (re) "csys": "\s*\d+\.\d{3,4}", ? (re) "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "", ? (re) "end": "\s*\d+\.\d{3,4}", ? (re) "result": "success", ? (re) "start": "\s*\d+\.\d{3,4}", ? (re) "time": "\s*\d+\.\d{3,4}" (re) } } (no-eol) --json with --outputdir $ rm report.json $ rm -r output $ mkdir output $ rt --json --outputdir output running 3 tests using 1 parallel processes --- $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+\.\d{3,4}", ? (re) "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "---.+\+\+\+.+", ? (re) "end": "\s*\d+\.\d{3,4}", ? (re) "result": "failure", ? (re) "start": "\s*\d+\.\d{3,4}", ? (re) "time": "\s*\d+\.\d{3,4}" (re) }, ? (re) "test-skip.t": { "csys": "\s*\d+\.\d{3,4}", ? (re) "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "", ? (re) "end": "\s*\d+\.\d{3,4}", ? (re) "result": "skip", ? (re) "start": "\s*\d+\.\d{3,4}", ? (re) "time": "\s*\d+\.\d{3,4}" (re) }, ? (re) "test-success.t": [\{] (re) "csys": "\s*\d+\.\d{3,4}", ? (re) "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "", ? (re) "end": "\s*\d+\.\d{3,4}", ? (re) "result": "success", ? (re) "start": "\s*\d+\.\d{3,4}", ? (re) "time": "\s*\d+\.\d{3,4}" (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 running 3 tests using 1 parallel processes --- $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+\.\d{3,4}", ? (re) "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "", ? (re) "end": "\s*\d+\.\d{3,4}", ? (re) "result": "success", ? (re) "start": "\s*\d+\.\d{3,4}", ? (re) "time": "\s*\d+\.\d{3,4}" (re) }, ? (re) "test-skip.t": { "csys": "\s*\d+\.\d{3,4}", ? (re) "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "", ? (re) "end": "\s*\d+\.\d{3,4}", ? (re) "result": "skip", ? (re) "start": "\s*\d+\.\d{3,4}", ? (re) "time": "\s*\d+\.\d{3,4}" (re) }, ? (re) "test-success.t": [\{] (re) "csys": "\s*\d+\.\d{3,4}", ? (re) "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "", ? (re) "end": "\s*\d+\.\d{3,4}", ? (re) "result": "success", ? (re) "start": "\s*\d+\.\d{3,4}", ? (re) "time": "\s*\d+\.\d{3,4}" (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 running 1 tests using 1 parallel processes . # 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) Add support for external test formatter ======================================= $ CUSTOM_TEST_RESULT=basic_test_result "$PYTHON" $TESTDIR/run-tests.py --with-hg=`which hg` -j1 "$@" test-success.t test-failure.t running 2 tests using 1 parallel processes # Ran 2 tests, 0 skipped, 0 failed. ON_START! <__main__.TestSuite tests=[<__main__.TTest testMethod=test-failure.t>, <__main__.TTest testMethod=test-success.t>]> FAILURE! test-failure.t output changed SUCCESS! test-success.t ON_END! 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 running 1 tests using 1 parallel processes . # 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 running 1 tests using 1 parallel processes . # 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 running 1 tests using 1 parallel processes . # 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 running 1 tests using 1 parallel processes 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 running 1 tests using 1 parallel processes . # 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 running 1 tests using 1 parallel processes . # 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 running 5 tests using 1 parallel processes ..... # 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 running 2 tests using 1 parallel processes --- $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 running 1 tests using 1 parallel processes --- $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 running 1 tests using 1 parallel processes --- $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 running 1 tests using 1 parallel processes --- $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 running 5 tests using 2 parallel processes .... # 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 running 3 tests using 1 parallel processes . --- $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#B output changed !. Failed test-cases-abc.t#B: output changed # Ran 3 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] --restart works $ rt --restart running 2 tests using 1 parallel processes --- $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#B output changed !. Failed test-cases-abc.t#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 running 2 tests using 1 parallel processes --- $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#B output changed !. Failed test-cases-abc.t#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 running 2 tests using 1 parallel processes .. # Ran 2 tests, 0 skipped, 0 failed. Support running a specific test case $ rt "test-cases-abc.t#B" running 1 tests using 1 parallel processes --- $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#B output changed ! Failed test-cases-abc.t#B: output changed # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] Support running multiple test cases in the same file $ rt test-cases-abc.t#B test-cases-abc.t#C running 2 tests using 1 parallel processes --- $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#B output changed !. Failed test-cases-abc.t#B: output changed # Ran 2 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] Support ignoring invalid test cases $ rt test-cases-abc.t#B test-cases-abc.t#D running 1 tests using 1 parallel processes --- $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#B output changed ! Failed test-cases-abc.t#B: output changed # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] Support running complex test cases names $ cat > test-cases-advanced-cases.t <<'EOF' > #testcases simple case-with-dashes casewith_-.chars > $ echo $TESTCASE > simple > EOF $ cat test-cases-advanced-cases.t #testcases simple case-with-dashes casewith_-.chars $ echo $TESTCASE simple $ rt test-cases-advanced-cases.t running 3 tests using 1 parallel processes --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t#case-with-dashes.err @@ -1,3 +1,3 @@ #testcases simple case-with-dashes casewith_-.chars $ echo $TESTCASE - simple + case-with-dashes ERROR: test-cases-advanced-cases.t#case-with-dashes output changed ! --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t#casewith_-.chars.err @@ -1,3 +1,3 @@ #testcases simple case-with-dashes casewith_-.chars $ echo $TESTCASE - simple + casewith_-.chars ERROR: test-cases-advanced-cases.t#casewith_-.chars output changed !. Failed test-cases-advanced-cases.t#case-with-dashes: output changed Failed test-cases-advanced-cases.t#casewith_-.chars: output changed # Ran 3 tests, 0 skipped, 2 failed. python hash seed: * (glob) [1] $ rt "test-cases-advanced-cases.t#case-with-dashes" running 1 tests using 1 parallel processes --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t#case-with-dashes.err @@ -1,3 +1,3 @@ #testcases simple case-with-dashes casewith_-.chars $ echo $TESTCASE - simple + case-with-dashes ERROR: test-cases-advanced-cases.t#case-with-dashes output changed ! Failed test-cases-advanced-cases.t#case-with-dashes: output changed # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] $ rt "test-cases-advanced-cases.t#casewith_-.chars" running 1 tests using 1 parallel processes --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t#casewith_-.chars.err @@ -1,3 +1,3 @@ #testcases simple case-with-dashes casewith_-.chars $ echo $TESTCASE - simple + casewith_-.chars ERROR: test-cases-advanced-cases.t#casewith_-.chars output changed ! Failed test-cases-advanced-cases.t#casewith_-.chars: output changed # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] 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 running 1 tests using 1 parallel processes --- $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 running 1 tests using 1 parallel processes . # Ran 1 tests, 0 skipped, 0 failed. Test conditional output matching ================================ $ cat << EOF >> test-conditional-matching.t > #testcases foo bar > $ echo richtig > richtig (true !) > $ echo falsch > falsch (false !) > #if foo > $ echo arthur > arthur (bar !) > #endif > $ echo celeste > celeste (foo !) > $ echo zephir > zephir (bar !) > EOF $ rt test-conditional-matching.t running 2 tests using 1 parallel processes --- $TESTTMP/anothertests/cases/test-conditional-matching.t +++ $TESTTMP/anothertests/cases/test-conditional-matching.t#bar.err @@ -3,11 +3,13 @@ richtig (true !) $ echo falsch falsch (false !) + falsch #if foo $ echo arthur arthur \(bar !\) (re) #endif $ echo celeste celeste \(foo !\) (re) + celeste $ echo zephir zephir \(bar !\) (re) ERROR: test-conditional-matching.t#bar output changed ! --- $TESTTMP/anothertests/cases/test-conditional-matching.t +++ $TESTTMP/anothertests/cases/test-conditional-matching.t#foo.err @@ -3,11 +3,14 @@ richtig (true !) $ echo falsch falsch (false !) + falsch #if foo $ echo arthur arthur \(bar !\) (re) + arthur #endif $ echo celeste celeste \(foo !\) (re) $ echo zephir zephir \(bar !\) (re) + zephir ERROR: test-conditional-matching.t#foo output changed ! Failed test-conditional-matching.t#bar: output changed Failed test-conditional-matching.t#foo: output changed # Ran 2 tests, 0 skipped, 2 failed. python hash seed: * (glob) [1] mercurial-5.3.1/tests/test-repair-strip.t0000644015407300116100000001016413627755405020340 0ustar augieeng00000000000000#require unix-permissions no-root reporevlogstore $ 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 (failure reason: [Errno *] Permission denied .hg/store/data/b.i') (glob) 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 data file 'data/c.i' checked 2 changesets with 3 changes to 2 files 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 checked 2 changesets with 2 changes to 2 files $ 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 checked 4 changesets with 4 changes to 3 files % 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 (failure reason: [Errno *] Permission denied .hg/store/00manifest.i') (glob) 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 checked 2 changesets with 4 changes to 3 files 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 checked 2 changesets with 2 changes to 2 files $ cd .. mercurial-5.3.1/tests/test-sparse-clear.t0000644015407300116100000000221213627755405020273 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-5.3.1/tests/test-show-stack.t0000644015407300116100000001047613627755405020010 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-5.3.1/tests/test-merge-local.t0000644015407300116100000000655013627755405020112 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-5.3.1/tests/test-diff-issue2761.t0000644015407300116100000000067213627755405020300 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-5.3.1/tests/test-globalopts.t0000644015407300116100000003655513627755405020101 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): Traceback (most recent call last): (py3 !) #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: #if no-extraextensions $ hg -h Mercurial Distributed SCM list of commands: Repository creation: clone make a copy of an existing repository init create a new repository in the given directory Remote repository management: incoming show new changesets found in source outgoing show changesets not found in the destination paths show aliases for remote repositories pull pull changes from the specified source push push changes to the specified destination serve start stand-alone webserver Change creation: commit commit the specified files or all outstanding changes Change manipulation: backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory Change organization: bookmarks create a new bookmark or list existing bookmarks branch set or show the current branch name branches list repository named branches phase set or show the current phase name tag add one or more tags for the current or given revision tags list repository tags File content management: annotate show changeset information by line for each file cat output the current or given revision of files copy mark files as copied for the next commit diff diff repository (or selected files) grep search for a pattern in specified files Change navigation: bisect subdivision search of changesets heads show branch heads identify identify the working directory or specified revision log show revision history of entire repository or files Working directory management: add add the specified files on the next commit addremove add all new files, delete all missing files files list tracked files forget forget the specified files on the next commit 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 shelve save and set aside changes from the working directory status show changed files in the working directory summary summarize working directory state unshelve restore a shelved change to the working directory update update working directory (or switch revisions) Change import/export: archive create an unversioned archive of a repository revision bundle create a bundle file export dump the header and diffs for one or more changesets import import an ordered set of patches unbundle apply one or more bundle files Repository maintenance: manifest output the current or given revision of the project manifest recover roll back an interrupted transaction verify verify the integrity of the repository Help: config show combined config settings from all hgrc files help show help for a given topic or a help overview version output version and copyright information additional help topics: Mercurial identifiers: filesets Specifying File Sets hgignore Syntax for Mercurial Ignore Files patterns File Name Patterns revisions Specifying Revisions urls URL Paths Mercurial output: color Colorizing Outputs dates Date Formats diffs Diff Formats templating Template Usage Mercurial configuration: config Configuration Files environment Environment Variables extensions Using Additional Features flags Command-line flags hgweb Configuring hgweb merge-tools Merge Tools pager Pager Support Concepts: bundlespec Bundle File Formats glossary Glossary phases Working with Phases subrepos Subrepositories Miscellaneous: deprecated Deprecated Features internals Technical implementation topics scripting Using Mercurial from scripts and automation (use 'hg help -v' to show built-in aliases and global options) $ hg --help Mercurial Distributed SCM list of commands: Repository creation: clone make a copy of an existing repository init create a new repository in the given directory Remote repository management: incoming show new changesets found in source outgoing show changesets not found in the destination paths show aliases for remote repositories pull pull changes from the specified source push push changes to the specified destination serve start stand-alone webserver Change creation: commit commit the specified files or all outstanding changes Change manipulation: backout reverse effect of earlier changeset graft copy changes from other branches onto the current branch merge merge another revision into working directory Change organization: bookmarks create a new bookmark or list existing bookmarks branch set or show the current branch name branches list repository named branches phase set or show the current phase name tag add one or more tags for the current or given revision tags list repository tags File content management: annotate show changeset information by line for each file cat output the current or given revision of files copy mark files as copied for the next commit diff diff repository (or selected files) grep search for a pattern in specified files Change navigation: bisect subdivision search of changesets heads show branch heads identify identify the working directory or specified revision log show revision history of entire repository or files Working directory management: add add the specified files on the next commit addremove add all new files, delete all missing files files list tracked files forget forget the specified files on the next commit 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 shelve save and set aside changes from the working directory status show changed files in the working directory summary summarize working directory state unshelve restore a shelved change to the working directory update update working directory (or switch revisions) Change import/export: archive create an unversioned archive of a repository revision bundle create a bundle file export dump the header and diffs for one or more changesets import import an ordered set of patches unbundle apply one or more bundle files Repository maintenance: manifest output the current or given revision of the project manifest recover roll back an interrupted transaction verify verify the integrity of the repository Help: config show combined config settings from all hgrc files help show help for a given topic or a help overview version output version and copyright information additional help topics: Mercurial identifiers: filesets Specifying File Sets hgignore Syntax for Mercurial Ignore Files patterns File Name Patterns revisions Specifying Revisions urls URL Paths Mercurial output: color Colorizing Outputs dates Date Formats diffs Diff Formats templating Template Usage Mercurial configuration: config Configuration Files environment Environment Variables extensions Using Additional Features flags Command-line flags hgweb Configuring hgweb merge-tools Merge Tools pager Pager Support Concepts: bundlespec Bundle File Formats glossary Glossary phases Working with Phases subrepos Subrepositories Miscellaneous: deprecated Deprecated Features internals Technical implementation topics scripting Using Mercurial from scripts and automation (use 'hg help -v' to show built-in aliases and global options) #endif Not tested: --debugger mercurial-5.3.1/tests/test-status.t0000644015407300116100000002752113627755405017247 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 ? in_a ? ../b/1/in_b_1 ? ../b/2/in_b_2 ? ../b/in_b ? ../in_root (glob) relative paths can be requested $ hg status --cwd a --config ui.relative-paths=yes ? 1/in_a_1 ? in_a ? ../b/1/in_b_1 ? ../b/2/in_b_2 ? ../b/in_b ? ../in_root $ hg status --cwd a . --config ui.relative-paths=legacy ? 1/in_a_1 ? in_a $ hg status --cwd a . --config ui.relative-paths=no ? a/1/in_a_1 ? a/in_a commands.status.relative overrides ui.relative-paths $ cat >> $HGRCPATH < [ui] > relative-paths = False > [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 -T '{status} {path} {node|shortest}\n' A added ffff A copied ffff R removed ffff ! deleted ffff ? unknown ffff I ignored ffff C .hgignore ffff C modified ffff $ hg status -A -Tjson [ { "itemtype": "file", "path": "added", "status": "A" }, { "itemtype": "file", "path": "copied", "source": "modified", "status": "A" }, { "itemtype": "file", "path": "removed", "status": "R" }, { "itemtype": "file", "path": "deleted", "status": "!" }, { "itemtype": "file", "path": "unknown", "status": "?" }, { "itemtype": "file", "path": "ignored", "status": "I" }, { "itemtype": "file", "path": ".hgignore", "status": "C" }, { "itemtype": "file", "path": "modified", "status": "C" } ] $ hg status -A -Tpickle > pickle >>> from __future__ import print_function >>> from mercurial import util >>> pickle = util.pickle >>> data = sorted((x[b'status'].decode(), x[b'path'].decode()) for x in pickle.load(open("pickle", r"rb"))) >>> for s, p in data: print("%s %s" % (s, p)) ! 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(source, '{source} -> ')}{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", r"wb").write(b"\1\nfoo") and None $ hg ci -q -A -m 'initial checkin' $ hg status -A C 010a >>> open("010a", r"wb").write(b"\1\nbar") and None $ 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 = [ { 'itemtype': 'file', 'path': '1/2/3/4/5/b.txt', 'status': 'R' }, ] #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 $ hg log -GTstatus -r 'wdir()' -C o 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-5.3.1/tests/test-histedit-fold.t0000644015407300116100000003525713627755405020470 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= > mockmakedate = $TESTDIR/mockmakedate.py > 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()) == {b'c', b'd', b'f'}: > return True # abort folding commit only > ui.warn(b'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 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 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 $ hg histedit 6c795aa153cb --config hooks.commit='echo commit $HG_NODE' --config hooks.tonative.commit=True \ > --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 Test unix -> windows style variable substitution in external hooks. $ cat > $TESTTMP/tmp.hgrc <<'EOF' > [hooks] > pre-add = echo no variables > post-add = echo ran $HG_ARGS, literal \$non-var, 'also $non-var', $HG_RESULT > tonative.post-add = True > EOF $ echo "foo" > amended.txt $ HGRCPATH=$TESTTMP/tmp.hgrc hg add -v amended.txt running hook pre-add: echo no variables no variables adding amended.txt converting hook "post-add" to native (windows !) running hook post-add: echo ran %HG_ARGS%, literal $non-var, "also $non-var", %HG_RESULT% (windows !) running hook post-add: echo ran $HG_ARGS, literal \$non-var, 'also $non-var', $HG_RESULT (no-windows !) ran add -v amended.txt, literal $non-var, "also $non-var", 0 (windows !) ran add -v amended.txt, literal $non-var, also $non-var, 0 (no-windows !) $ 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 merging foo $ 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 $ cd .. ==================================== Test update-timestamp config option| ==================================== $ 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 log changeset: 5:178e35e0ce73 tag: tip user: test date: Thu Jan 01 00:00:06 1970 +0000 summary: f changeset: 4:1ddb6c90f2ee user: test date: Thu Jan 01 00:00:05 1970 +0000 summary: e changeset: 3:532247a8969b user: test date: Thu Jan 01 00:00:04 1970 +0000 summary: d changeset: 2:ff2c9fa2018b user: test date: Thu Jan 01 00:00:03 1970 +0000 summary: c changeset: 1:97d72e5f12c7 user: test date: Thu Jan 01 00:00:02 1970 +0000 summary: b changeset: 0:8580ff50825a user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: a $ hg histedit 1ddb6c90f2ee --commands - 2>&1 --config rewrite.update-timestamp=True < pick 178e35e0ce73 f > fold 1ddb6c90f2ee e > EOF log after edit observe time from f is updated $ hg log changeset: 4:f7909b1863a2 tag: tip user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: f changeset: 3:532247a8969b user: test date: Thu Jan 01 00:00:04 1970 +0000 summary: d changeset: 2:ff2c9fa2018b user: test date: Thu Jan 01 00:00:03 1970 +0000 summary: c changeset: 1:97d72e5f12c7 user: test date: Thu Jan 01 00:00:02 1970 +0000 summary: b changeset: 0:8580ff50825a user: test date: Thu Jan 01 00:00:01 1970 +0000 summary: a post-fold manifest $ hg manifest a b c d e f $ cd .. mercurial-5.3.1/tests/unwrap-message-id.py0000644015407300116100000000022413627755405020453 0ustar augieeng00000000000000from __future__ import absolute_import, print_function import re import sys print(re.sub(r"(?<=Message-Id:) \n ", " ", sys.stdin.read()), end="") mercurial-5.3.1/tests/test-push-checkheads-pruned-B1.t0000644015407300116100000000310113627755405022502 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)"` 1 new obsolescence markers 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-5.3.1/tests/test-diff-upgrade.t0000644015407300116100000001423013627755405020252 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$@> "$HGRCPATH" << EOF > [ui] > merge = :merge3 > EOF init $ hg init repo $ cd repo commit $ echo 'a' > 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 [ { "lines": [{"line": "a\n", "rev": 0}], "path": "a" } ] $ hg annotate -Tjson -cdfnul a [ { "lines": [{"date": [1.0, 0], "line": "a\n", "lineno": 1, "node": "8435f90966e442695d2ded29fdade2bac5ad8065", "path": "a", "rev": 0, "user": "nobody"}], "path": "a" } ] log-like templating $ hg annotate -T'{lines % "{rev} {node|shortest}: {line}"}' a 0 8435: a '{lineno}' field should be populated as necessary $ hg annotate -T'{lines % "{rev}:{lineno}: {line}"}' a 0:1: a $ hg annotate -Ta a \ > --config templates.a='"{lines % "{rev}:{lineno}: {line}"}"' 0:1: 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' default output of '{lines}' should be readable $ hg annotate -T'{lines}' a 0: a 1: a 1: a $ hg annotate -T'{join(lines, "\n")}' a 0: a 1: a 1: a several filters can be applied to '{lines}' $ hg annotate -T'{lines|json}\n' a [{"line": "a\n", "rev": 0}, {"line": "a\n", "rev": 1}, {"line": "a\n", "rev": 1}] $ hg annotate -T'{lines|stringify}' a 0: a 1: a 1: a $ hg annotate -T'{lines|count}\n' a 3 annotate multiple files (JSON) $ hg annotate -Tjson a b [ { "lines": [{"line": "a\n", "rev": 0}, {"line": "a\n", "rev": 1}, {"line": "a\n", "rev": 1}], "path": "a" }, { "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'== {path} ==\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 warning: conflicts while merging b! (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 b a a a <<<<<<< working copy: 5fbdc1152d97 - test: b2.1 b4 c b5 ||||||| base ======= b4 b5 b6 >>>>>>> merge rev: 37ec9f5c3d1f - test: b2 $ cat < b > a > a > a > b4 > c > b5 > EOF $ hg resolve --mark -q $ rm b.orig $ 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 Work around the pure version not resolving the conflict like native code #if pure $ hg merge merging b warning: conflicts while merging b! (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 < b > a > z > a > b4 > c > b5 > EOF $ hg resolve -m b (no more unresolved files) $ rm b.orig #else $ hg merge merging b 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) #endif $ 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, includecopymeta): > 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.copysource() > if copy and copy != 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 baz 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 baz 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 [ { "lines": [{"line": "foo\n", "node": "472b18db256d1e8282064eab4bfdaf48cbfe83cd", "rev": 11}, {"line": "foofoo\n", "node": "ffffffffffffffffffffffffffffffffffffffff", "rev": 2147483647}], "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 warning: conflicts while merging qux! (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 qux 0 0 1 baz:1 2 baz:2 <<<<<<< working copy: 863de62655ef - test: baz:3+->3- 3- baz:3 4 baz:4 ||||||| base 3+ baz:3 4 baz:4 ======= 3+ baz:3 4+ baz:4 >>>>>>> merge rev: cb8df70ae185 - test: qux:4->4+ 5 6 7 $ cat > qux < 0 > 0 > 1 baz:1 > 2 baz:2 > 3- baz:3 > 4 baz:4 > 5 > 6 > 7 > EOF $ hg resolve --mark -q $ rm qux.orig $ 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 warning: conflicts while merging qux! (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 qux 0 0 1 baz:1 2 baz:2 <<<<<<< working copy: cb8df70ae185 - test: qux:4->4+ 3+ baz:3 4+ baz:4 ||||||| base 3+ baz:3 4 baz:4 ======= 3- baz:3 4 baz:4 >>>>>>> merge rev: 863de62655ef - test: baz:3+->3- 5 6 7 $ cat > qux < 0 > 0 > 1 baz:1 > 2 baz:2 > 3+ baz:3 > 4+ baz:4 > 5 > 6 > EOF $ hg resolve --mark -q $ rm qux.orig $ 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 |\ ~ ~ An integer as a line range, which is parsed as '1:1' $ hg log -r 'followlines(baz, 1)' changeset: 22:2174d0bf352a user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: added two lines with 0 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, x)' hg: parse error: followlines expects a line number or a 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: [ (followlines(baz, 2:4, startrev=20, descend=[1]) ^ here) [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 [ { "path": "binary" }, { "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.utils import procutil > procutil.setbinary(sys.stdin) > procutil.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') and None $ hg ci -qAm0 >>> with open('a', 'wb') as f: ... f.write(b'0a\r0b\r\n1c\r1d\r\n0e\n1f\n0g') and None $ 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 warning: conflicts while merging a! (edit, then use 'hg resolve --mark') [1] $ cat a <<<<<<< working copy: 0a068f0261cf - test: 3 1 2 3 ||||||| base 1 2 ======= a >>>>>>> merge rev: 9409851bc20a - test: a $ cat > a << EOF > b > 1 > 2 > 3 > a > EOF $ hg resolve --mark -q $ rm a.orig $ hg commit -m m $ hg annotate a 4: b 0: 1 1: 2 3: 3 2: a $ cd .. mercurial-5.3.1/tests/test-bundle-r.t0000644015407300116100000002302713627755405017431 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 (9 drafts) (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 (1 drafts) (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 1 changesets with 1 changes to 1 files 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 (2 drafts) (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 2 changesets with 2 changes to 1 files 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 (3 drafts) (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 3 changesets with 3 changes to 1 files 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 (4 drafts) (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 4 changesets with 4 changes to 1 files 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 (2 drafts) (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 2 changesets with 2 changes to 1 files 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 (3 drafts) (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 3 changesets with 3 changes to 1 files 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 (4 drafts) (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 4 changesets with 5 changes to 2 files 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 (5 drafts) (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 5 changesets with 6 changes to 3 files 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 (5 drafts) (run 'hg update' to get a working copy) checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 5 changesets with 5 changes to 2 files 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 1 local changesets published (run 'hg heads' to see heads, 'hg merge' to merge) $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 9 changesets with 7 changes to 4 files $ 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 (6 drafts) (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 checked 9 changesets with 7 changes to 4 files $ 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 (2 drafts) (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 checked 5 changesets with 5 changes to 2 files $ 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 (4 drafts) (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 checked 7 changesets with 6 changes to 3 files $ 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 (2 drafts) (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 checked 5 changesets with 5 changes to 2 files $ cd ../test $ hg merge 7 note: possible conflict - afile was renamed multiple times to: adifferentfile anotherfile 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 (7 drafts) (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 checked 10 changesets with 7 changes to 4 files $ cd .. mercurial-5.3.1/tests/test-wireproto-caching.t0000644015407300116100000003116513627755405021347 0ustar augieeng00000000000000 $ . $TESTDIR/wireprotohelpers.sh $ cat >> $HGRCPATH << EOF > [extensions] > blackbox = > [blackbox] > track = simplecache > EOF $ hg init server $ enablehttpv2 server $ cd server $ cat >> .hg/hgrc << EOF > [extensions] > simplecache = $TESTDIR/wireprotosimplecache.py > EOF $ echo a0 > a $ echo b0 > b $ hg -q commit -A -m 'commit 0' $ echo a1 > a $ hg commit -m 'commit 1' $ echo b1 > b $ hg commit -m 'commit 2' $ echo a2 > a $ echo b2 > b $ hg commit -m 'commit 3' $ hg log -G -T '{rev}:{node} {desc}' @ 3:50590a86f3ff5d1e9a1624a7a6957884565cc8e8 commit 3 | o 2:4d01eda50c6ac5f7e89cbe1880143a32f559c302 commit 2 | o 1:4432d83626e8a98655f062ec1f2a43b07f7fbbb0 commit 1 | o 0:3390ef850073fbc2f0dfff2244342c8e9229013a commit 0 $ hg --debug debugindex -m rev linkrev nodeid p1 p2 0 0 992f4779029a3df8d0666d00bb924f69634e2641 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 1 1 a988fb43583e871d1ed5750ee074c6d840bbbfc8 992f4779029a3df8d0666d00bb924f69634e2641 0000000000000000000000000000000000000000 2 2 a8853dafacfca6fc807055a660d8b835141a3bb4 a988fb43583e871d1ed5750ee074c6d840bbbfc8 0000000000000000000000000000000000000000 3 3 3fe11dfbb13645782b0addafbe75a87c210ffddc a8853dafacfca6fc807055a660d8b835141a3bb4 0000000000000000000000000000000000000000 $ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS Performing the same request should result in same result, with 2nd response coming from cache. $ sendhttpv2peer << EOF > command manifestdata > nodes eval:[b'\x99\x2f\x47\x79\x02\x9a\x3d\xf8\xd0\x66\x6d\x00\xbb\x92\x4f\x69\x63\x4e\x26\x41'] > tree eval:b'' > fields eval:[b'parents'] > EOF creating http peer for wire protocol version 2 sending manifestdata command response: gen[ { b'totalitems': 1 }, { b'node': b'\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A', b'parents': [ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' ] } ] $ sendhttpv2peer << EOF > command manifestdata > nodes eval:[b'\x99\x2f\x47\x79\x02\x9a\x3d\xf8\xd0\x66\x6d\x00\xbb\x92\x4f\x69\x63\x4e\x26\x41'] > tree eval:b'' > fields eval:[b'parents'] > EOF creating http peer for wire protocol version 2 sending manifestdata command response: gen[ { b'totalitems': 1 }, { b'node': b'\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A', b'parents': [ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' ] } ] Sending different request doesn't yield cache hit. $ sendhttpv2peer << EOF > command manifestdata > nodes eval:[b'\x99\x2f\x47\x79\x02\x9a\x3d\xf8\xd0\x66\x6d\x00\xbb\x92\x4f\x69\x63\x4e\x26\x41', b'\xa9\x88\xfb\x43\x58\x3e\x87\x1d\x1e\xd5\x75\x0e\xe0\x74\xc6\xd8\x40\xbb\xbf\xc8'] > tree eval:b'' > fields eval:[b'parents'] > EOF creating http peer for wire protocol version 2 sending manifestdata command response: gen[ { b'totalitems': 2 }, { b'node': b'\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A', b'parents': [ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' ] }, { b'node': b'\xa9\x88\xfbCX>\x87\x1d\x1e\xd5u\x0e\xe0t\xc6\xd8@\xbb\xbf\xc8', b'parents': [ b'\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' ] } ] $ cat .hg/blackbox.log *> cacher constructed for manifestdata (glob) *> cache miss for 47abb8efa5f01b8964d74917793ad2464db0fa2c (glob) *> storing cache entry for 47abb8efa5f01b8964d74917793ad2464db0fa2c (glob) *> cacher constructed for manifestdata (glob) *> cache hit for 47abb8efa5f01b8964d74917793ad2464db0fa2c (glob) *> cacher constructed for manifestdata (glob) *> cache miss for 37326a83e9843f15161fce9d1e92d06b795d5e8e (glob) *> storing cache entry for 37326a83e9843f15161fce9d1e92d06b795d5e8e (glob) $ cat error.log $ killdaemons.py $ rm .hg/blackbox.log Try with object caching mode $ cat >> .hg/hgrc << EOF > [simplecache] > cacheobjects = true > EOF $ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS $ sendhttpv2peer << EOF > command manifestdata > nodes eval:[b'\x99\x2f\x47\x79\x02\x9a\x3d\xf8\xd0\x66\x6d\x00\xbb\x92\x4f\x69\x63\x4e\x26\x41'] > tree eval:b'' > fields eval:[b'parents'] > EOF creating http peer for wire protocol version 2 sending manifestdata command response: gen[ { b'totalitems': 1 }, { b'node': b'\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A', b'parents': [ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' ] } ] $ sendhttpv2peer << EOF > command manifestdata > nodes eval:[b'\x99\x2f\x47\x79\x02\x9a\x3d\xf8\xd0\x66\x6d\x00\xbb\x92\x4f\x69\x63\x4e\x26\x41'] > tree eval:b'' > fields eval:[b'parents'] > EOF creating http peer for wire protocol version 2 sending manifestdata command response: gen[ { b'totalitems': 1 }, { b'node': b'\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A', b'parents': [ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' ] } ] $ cat .hg/blackbox.log *> cacher constructed for manifestdata (glob) *> cache miss for 47abb8efa5f01b8964d74917793ad2464db0fa2c (glob) *> storing cache entry for 47abb8efa5f01b8964d74917793ad2464db0fa2c (glob) *> cacher constructed for manifestdata (glob) *> cache hit for 47abb8efa5f01b8964d74917793ad2464db0fa2c (glob) $ cat error.log $ killdaemons.py $ rm .hg/blackbox.log A non-cacheable command does not instantiate cacher $ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log $ cat hg.pid > $DAEMON_PIDS $ sendhttpv2peer << EOF > command capabilities > EOF creating http peer for wire protocol version 2 sending capabilities command response: gen[ { b'commands': { b'branchmap': { b'args': {}, b'permissions': [ b'pull' ] }, b'capabilities': { b'args': {}, b'permissions': [ b'pull' ] }, b'changesetdata': { b'args': { b'fields': { b'default': set([]), b'required': False, b'type': b'set', b'validvalues': set([ b'bookmarks', b'parents', b'phase', b'revision' ]) }, b'revisions': { b'required': True, b'type': b'list' } }, b'permissions': [ b'pull' ] }, b'filedata': { b'args': { b'fields': { b'default': set([]), b'required': False, b'type': b'set', b'validvalues': set([ b'linknode', b'parents', b'revision' ]) }, b'haveparents': { b'default': False, b'required': False, b'type': b'bool' }, b'nodes': { b'required': True, b'type': b'list' }, b'path': { b'required': True, b'type': b'bytes' } }, b'permissions': [ b'pull' ] }, b'filesdata': { b'args': { b'fields': { b'default': set([]), b'required': False, b'type': b'set', b'validvalues': set([ b'firstchangeset', b'linknode', b'parents', b'revision' ]) }, b'haveparents': { b'default': False, b'required': False, b'type': b'bool' }, b'pathfilter': { b'default': None, b'required': False, b'type': b'dict' }, b'revisions': { b'required': True, b'type': b'list' } }, b'permissions': [ b'pull' ], b'recommendedbatchsize': 50000 }, b'heads': { b'args': { b'publiconly': { b'default': False, b'required': False, b'type': b'bool' } }, b'permissions': [ b'pull' ] }, b'known': { b'args': { b'nodes': { b'default': [], b'required': False, b'type': b'list' } }, b'permissions': [ b'pull' ] }, b'listkeys': { b'args': { b'namespace': { b'required': True, b'type': b'bytes' } }, b'permissions': [ b'pull' ] }, b'lookup': { b'args': { b'key': { b'required': True, b'type': b'bytes' } }, b'permissions': [ b'pull' ] }, b'manifestdata': { b'args': { b'fields': { b'default': set([]), b'required': False, b'type': b'set', b'validvalues': set([ b'parents', b'revision' ]) }, b'haveparents': { b'default': False, b'required': False, b'type': b'bool' }, b'nodes': { b'required': True, b'type': b'list' }, b'tree': { b'required': True, b'type': b'bytes' } }, b'permissions': [ b'pull' ], b'recommendedbatchsize': 100000 }, b'pushkey': { b'args': { b'key': { b'required': True, b'type': b'bytes' }, b'namespace': { b'required': True, b'type': b'bytes' }, b'new': { b'required': True, b'type': b'bytes' }, b'old': { b'required': True, b'type': b'bytes' } }, b'permissions': [ b'push' ] }, b'rawstorefiledata': { b'args': { b'files': { b'required': True, b'type': b'list' }, b'pathfilter': { b'default': None, b'required': False, b'type': b'list' } }, b'permissions': [ b'pull' ] } }, b'framingmediatypes': [ b'application/mercurial-exp-framing-0006' ], b'pathfilterprefixes': set([ b'path:', b'rootfilesin:' ]), b'rawrepoformats': [ b'generaldelta', b'revlogv1', b'sparserevlog' ] } ] $ test -f .hg/blackbox.log [1] An error is not cached $ sendhttpv2peer << EOF > command manifestdata > nodes eval:[b'\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa'] > tree eval:b'' > fields eval:[b'parents'] > EOF creating http peer for wire protocol version 2 sending manifestdata command abort: unknown node: \xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa! (esc) [255] $ cat .hg/blackbox.log *> cacher constructed for manifestdata (glob) *> cache miss for 2cba2a7d0d1575fea2fe68f597e97a7c2ac2f705 (glob) *> cacher exiting due to error (glob) $ killdaemons.py $ rm .hg/blackbox.log mercurial-5.3.1/tests/test-push-checkheads-superceed-A4.t0000644015407300116100000000325613627755405023201 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)"` 1 new obsolescence markers 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-5.3.1/tests/test-convert-cvs.t0000644015407300116100000003241413627755405020172 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(b'%s hook: %d entries\n' % (hooktype, len(log))) > > def cvschangesets(ui, repo, hooktype, changesets): > ui.write(b'%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', 'wb') > fp.write((b''' > 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') + b''' (cp932) > @ > text > @1 > 2 > 3 > 4 > @ > > > 1.3 > log > @''' + u'\u3042'.encode('euc-jp') + b''' (euc-jp) > @ > text > @d4 1 > @ > > > 1.2 > log > @''' + u'\u3042'.encode('utf-8') + b''' (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-5.3.1/tests/badserverext.py0000644015407300116100000003025713627755405017632 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 ( pycompat, registrar, ) from mercurial.hgweb import server configtable = {} configitem = registrar.configitem(configtable) configitem( b'badserver', b'closeafteraccept', default=False, ) configitem( b'badserver', b'closeafterrecvbytes', default=b'0', ) configitem( b'badserver', b'closeaftersendbytes', default=b'0', ) configitem( b'badserver', b'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', 'sendall', '_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(b'\r', b'\\r').replace(b'\n', b'\\n') object.__getattribute__(self, '_logfp').write(msg) object.__getattribute__(self, '_logfp').write(b'\n') object.__getattribute__(self, '_logfp').flush() 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, ) def sendall(self, data, flags=0): remaining = object.__getattribute__(self, '_closeaftersendbytes') # No read limit. Call original function. if not remaining: result = object.__getattribute__(self, '_orig').sendall(data, flags) self._writelog(b'sendall(%d) -> %s' % (len(data), data)) return result if len(data) > remaining: newdata = data[0:remaining] else: newdata = data remaining -= len(newdata) result = object.__getattribute__(self, '_orig').sendall(newdata, flags) self._writelog( b'sendall(%d from %d) -> (%d) %s' % (len(newdata), len(data), remaining, newdata) ) object.__setattr__(self, '_closeaftersendbytes', remaining) if remaining <= 0: self._writelog(b'write limit reached; closing socket') object.__getattribute__(self, '_orig').shutdown(socket.SHUT_RDWR) raise Exception('connection closed after sending N bytes') return result # 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 ('_close', '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(b'\r', b'\\r').replace(b'\n', b'\\n') object.__getattribute__(self, '_logfp').write(msg) object.__getattribute__(self, '_logfp').write(b'\n') object.__getattribute__(self, '_logfp').flush() def _close(self): # Python 3 uses an io.BufferedIO instance. Python 2 uses some file # object wrapper. if pycompat.ispy3: orig = object.__getattribute__(self, '_orig') if hasattr(orig, 'raw'): orig.raw._sock.shutdown(socket.SHUT_RDWR) else: self.close() else: self._sock.shutdown(socket.SHUT_RDWR) 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( b'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( b'read(%d from %d) -> (%d) %s' % (size, origsize, len(result), result) ) object.__setattr__(self, '_closeafterrecvbytes', remaining) if remaining <= 0: self._writelog(b'read limit reached, closing socket') self._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( b'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( b'readline(%d from %d) -> (%d) %s' % (size, origsize, len(result), result) ) object.__setattr__(self, '_closeafterrecvbytes', remaining) if remaining <= 0: self._writelog(b'read limit reached; closing socket') self._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(b'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( b'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(b'write limit reached; closing socket') self._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) recvbytes = self._ui.config(b'badserver', b'closeafterrecvbytes') recvbytes = recvbytes.split(b',') self.closeafterrecvbytes = [int(v) for v in recvbytes if v] sendbytes = self._ui.config(b'badserver', b'closeaftersendbytes') sendbytes = sendbytes.split(b',') self.closeaftersendbytes = [int(v) for v in sendbytes if v] # 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(b'badserver', b'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(b'badserver', b'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. if self.closeafterrecvbytes: closeafterrecvbytes = self.closeafterrecvbytes.pop(0) else: closeafterrecvbytes = 0 if self.closeaftersendbytes: closeaftersendbytes = self.closeaftersendbytes.pop(0) else: closeaftersendbytes = 0 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-5.3.1/tests/test-convert-identity.t0000644015407300116100000000251513627755405021227 0ustar augieeng00000000000000Testing that convert.hg.preserve-hash=true can be used to make hg convert from hg repo to hg repo preserve hashes, even if the computation of the files list in commits change slightly between hg versions. $ cat <<'EOF' >> "$HGRCPATH" > [extensions] > convert = > EOF $ cat <<'EOF' > changefileslist.py > from mercurial import (changelog, extensions) > def wrap(orig, clog, manifest, files, *args, **kwargs): > return orig(clog, manifest, [b"a"], *args, **kwargs) > def extsetup(ui): > extensions.wrapfunction(changelog.changelog, 'add', wrap) > EOF $ hg init repo $ cd repo $ echo a > a; hg commit -qAm a $ echo b > a; hg commit -qAm b $ hg up -qr 0; echo c > c; hg commit -qAm c $ hg merge -qr 1 $ hg commit -m_ --config extensions.x=../changefileslist.py $ hg log -r . -T '{node|short} {files|json}\n' c085bbe93d59 ["a"] Now that we have a commit with a files list that's not what the current hg version would create, check that convert either fixes it or keeps it depending on config: $ hg convert -q . ../convert $ hg --cwd ../convert log -r tip -T '{node|short} {files|json}\n' b7c4d4bbacd3 [] $ rm -rf ../convert $ hg convert -q . ../convert --config convert.hg.preserve-hash=true $ hg --cwd ../convert log -r tip -T '{node|short} {files|json}\n' c085bbe93d59 ["a"] $ rm -rf ../convert mercurial-5.3.1/tests/test-pager-legacy.t0000644015407300116100000001653413627755405020266 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 commands, registrar > cmdtable = {} > command = registrar.command(cmdtable) > @command(b'fortytwo', [], b'fortytwo', norepo=True) > def fortytwo(ui, *opts): > ui.write(b'42\n') > return 42 > EOF $ cat >> $HGRCPATH <<'EOF' > [extensions] > fortytwo = $TESTTMP/fortytwo.py > EOF $ hg fortytwo --pager=on paged! '42\n' [42] mercurial-5.3.1/tests/test-infinitepush-ci.t0000644015407300116100000002726113627755405021023 0ustar augieeng00000000000000#require no-reposimplestore Testing the case when there is no infinitepush extension present on the client side and the server routes each push to bundlestore. This case is very much similar to CI use case. Setup ----- $ . "$TESTDIR/library-infinitepush.sh" $ cat >> $HGRCPATH < [ui] > ssh = python "$TESTDIR/dummyssh" > [alias] > glog = log -GT "{rev}:{node|short} {desc}\n{phase}" > EOF $ cp $HGRCPATH $TESTTMP/defaulthgrc $ hg init repo $ cd repo $ setupserver $ echo "pushtobundlestore = True" >> .hg/hgrc $ echo "[extensions]" >> .hg/hgrc $ echo "infinitepush=" >> .hg/hgrc $ echo initialcommit > initialcommit $ hg ci -Aqm "initialcommit" $ hg phase --public . $ cd .. $ hg clone repo client -q $ hg clone repo client2 -q $ hg clone ssh://user@dummy/repo client3 -q $ cd client Pushing a new commit from the client to the server ----------------------------------------------------- $ echo foobar > a $ hg ci -Aqm "added a" $ hg glog @ 1:6cb0989601f1 added a | draft o 0:67145f466344 initialcommit public $ hg push pushing to $TESTTMP/repo searching for changes storing changesets on the bundlestore pushing 1 commit: 6cb0989601f1 added a $ scratchnodes 6cb0989601f1fb5805238edfb16f3606713d9a0b a4c202c147a9c4bb91bbadb56321fc5f3950f7f2 Understanding how data is stored on the bundlestore in server ------------------------------------------------------------- There are two things, filebundlestore and index $ ls ../repo/.hg/scratchbranches filebundlestore index filebundlestore stores the bundles $ ls ../repo/.hg/scratchbranches/filebundlestore/a4/c2/ a4c202c147a9c4bb91bbadb56321fc5f3950f7f2 index/nodemap stores a map of node id and file in which bundle is stored in filebundlestore $ ls ../repo/.hg/scratchbranches/index/ nodemap $ ls ../repo/.hg/scratchbranches/index/nodemap/ 6cb0989601f1fb5805238edfb16f3606713d9a0b $ cd ../repo Checking that the commit was not applied to revlog on the server ------------------------------------------------------------------ $ hg glog @ 0:67145f466344 initialcommit public Applying the changeset from the bundlestore -------------------------------------------- $ hg unbundle .hg/scratchbranches/filebundlestore/a4/c2/a4c202c147a9c4bb91bbadb56321fc5f3950f7f2 adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 6cb0989601f1 (run 'hg update' to get a working copy) $ hg glog o 1:6cb0989601f1 added a | public @ 0:67145f466344 initialcommit public Pushing more changesets from the local repo -------------------------------------------- $ cd ../client $ echo b > b $ hg ci -Aqm "added b" $ echo c > c $ hg ci -Aqm "added c" $ hg glog @ 3:bf8a6e3011b3 added c | draft o 2:eaba929e866c added b | draft o 1:6cb0989601f1 added a | public o 0:67145f466344 initialcommit public $ hg push pushing to $TESTTMP/repo searching for changes storing changesets on the bundlestore pushing 2 commits: eaba929e866c added b bf8a6e3011b3 added c Checking that changesets are not applied on the server ------------------------------------------------------ $ hg glog -R ../repo o 1:6cb0989601f1 added a | public @ 0:67145f466344 initialcommit public Both of the new changesets are stored in a single bundle-file $ scratchnodes 6cb0989601f1fb5805238edfb16f3606713d9a0b a4c202c147a9c4bb91bbadb56321fc5f3950f7f2 bf8a6e3011b345146bbbedbcb1ebd4837571492a ee41a41cefb7817cbfb235b4f6e9f27dbad6ca1f eaba929e866c59bc9a6aada5a9dd2f6990db83c0 ee41a41cefb7817cbfb235b4f6e9f27dbad6ca1f Pushing more changesets to the server ------------------------------------- $ echo d > d $ hg ci -Aqm "added d" $ echo e > e $ hg ci -Aqm "added e" XXX: we should have pushed only the parts which are not in bundlestore $ hg push pushing to $TESTTMP/repo searching for changes storing changesets on the bundlestore pushing 4 commits: eaba929e866c added b bf8a6e3011b3 added c 1bb96358eda2 added d b4e4bce66051 added e Sneak peek into the bundlestore at the server $ scratchnodes 1bb96358eda285b536c6d1c66846a7cdb2336cea 57e00c0d4f26e2a2a72b751b63d9abc4f3eb28e7 6cb0989601f1fb5805238edfb16f3606713d9a0b a4c202c147a9c4bb91bbadb56321fc5f3950f7f2 b4e4bce660512ad3e71189e14588a70ac8e31fef 57e00c0d4f26e2a2a72b751b63d9abc4f3eb28e7 bf8a6e3011b345146bbbedbcb1ebd4837571492a 57e00c0d4f26e2a2a72b751b63d9abc4f3eb28e7 eaba929e866c59bc9a6aada5a9dd2f6990db83c0 57e00c0d4f26e2a2a72b751b63d9abc4f3eb28e7 Checking if `hg pull` pulls something or `hg incoming` shows something ----------------------------------------------------------------------- $ hg incoming comparing with $TESTTMP/repo searching for changes no changes found [1] $ hg pull pulling from $TESTTMP/repo searching for changes no changes found Pulling from second client which is a localpeer to test `hg pull -r ` -------------------------------------------------------------------------- Pulling the revision which is applied $ cd ../client2 $ hg pull -r 6cb0989601f1 pulling from $TESTTMP/repo searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 6cb0989601f1 (run 'hg update' to get a working copy) $ hg glog o 1:6cb0989601f1 added a | public @ 0:67145f466344 initialcommit public Pulling the revision which is in bundlestore XXX: we should support pulling revisions from a local peers bundlestore without client side wrapping $ hg pull -r b4e4bce660512ad3e71189e14588a70ac8e31fef pulling from $TESTTMP/repo abort: unknown revision 'b4e4bce660512ad3e71189e14588a70ac8e31fef'! [255] $ hg glog o 1:6cb0989601f1 added a | public @ 0:67145f466344 initialcommit public $ cd ../client Pulling from third client which is not a localpeer --------------------------------------------------- Pulling the revision which is applied $ cd ../client3 $ hg pull -r 6cb0989601f1 pulling from ssh://user@dummy/repo searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 6cb0989601f1 (run 'hg update' to get a working copy) $ hg glog o 1:6cb0989601f1 added a | public @ 0:67145f466344 initialcommit public Pulling the revision which is in bundlestore Trying to specify short hash XXX: we should support this $ hg pull -r b4e4bce660512 pulling from ssh://user@dummy/repo abort: unknown revision 'b4e4bce660512'! [255] XXX: we should show better message when the pull is happening from bundlestore $ hg pull -r b4e4bce660512ad3e71189e14588a70ac8e31fef pulling from ssh://user@dummy/repo searching for changes no changes found adding changesets adding manifests adding file changes added 4 changesets with 4 changes to 4 files new changesets eaba929e866c:b4e4bce66051 $ hg glog o 5:b4e4bce66051 added e | public o 4:1bb96358eda2 added d | public o 3:bf8a6e3011b3 added c | public o 2:eaba929e866c added b | public o 1:6cb0989601f1 added a | public @ 0:67145f466344 initialcommit public $ cd ../client Checking storage of phase information with the bundle on bundlestore --------------------------------------------------------------------- creating a draft commit $ cat >> $HGRCPATH < [phases] > publish = False > EOF $ echo f > f $ hg ci -Aqm "added f" $ hg glog -r '.^::' @ 6:9b42578d4447 added f | draft o 5:b4e4bce66051 added e | public ~ $ hg push pushing to $TESTTMP/repo searching for changes storing changesets on the bundlestore pushing 5 commits: eaba929e866c added b bf8a6e3011b3 added c 1bb96358eda2 added d b4e4bce66051 added e 9b42578d4447 added f XXX: the phase of 9b42578d4447 should not be changed here $ hg glog -r . @ 6:9b42578d4447 added f | public ~ applying the bundle on the server to check preservation of phase-information $ cd ../repo $ scratchnodes 1bb96358eda285b536c6d1c66846a7cdb2336cea 0a6e70ecd5b98d22382f69b93909f557ac6a9927 6cb0989601f1fb5805238edfb16f3606713d9a0b a4c202c147a9c4bb91bbadb56321fc5f3950f7f2 9b42578d44473575994109161430d65dd147d16d 0a6e70ecd5b98d22382f69b93909f557ac6a9927 b4e4bce660512ad3e71189e14588a70ac8e31fef 0a6e70ecd5b98d22382f69b93909f557ac6a9927 bf8a6e3011b345146bbbedbcb1ebd4837571492a 0a6e70ecd5b98d22382f69b93909f557ac6a9927 eaba929e866c59bc9a6aada5a9dd2f6990db83c0 0a6e70ecd5b98d22382f69b93909f557ac6a9927 $ hg unbundle .hg/scratchbranches/filebundlestore/0a/6e/0a6e70ecd5b98d22382f69b93909f557ac6a9927 adding changesets adding manifests adding file changes added 5 changesets with 5 changes to 5 files new changesets eaba929e866c:9b42578d4447 (1 drafts) (run 'hg update' to get a working copy) $ hg glog o 6:9b42578d4447 added f | draft o 5:b4e4bce66051 added e | public o 4:1bb96358eda2 added d | public o 3:bf8a6e3011b3 added c | public o 2:eaba929e866c added b | public o 1:6cb0989601f1 added a | public @ 0:67145f466344 initialcommit public Checking storage of obsmarkers in the bundlestore -------------------------------------------------- enabling obsmarkers and rebase extension $ cat >> $HGRCPATH << EOF > [experimental] > evolution = all > [extensions] > rebase = > EOF $ cd ../client $ hg phase -r . --draft --force $ hg rebase -r 6 -d 3 rebasing 6:9b42578d4447 "added f" (tip) $ hg glog @ 7:99949238d9ac added f | draft | o 5:b4e4bce66051 added e | | public | o 4:1bb96358eda2 added d |/ public o 3:bf8a6e3011b3 added c | public o 2:eaba929e866c added b | public o 1:6cb0989601f1 added a | public o 0:67145f466344 initialcommit public $ hg push -f pushing to $TESTTMP/repo searching for changes storing changesets on the bundlestore pushing 1 commit: 99949238d9ac added f XXX: the phase should not have changed here $ hg glog -r . @ 7:99949238d9ac added f | public ~ Unbundling on server to see obsmarkers being applied $ cd ../repo $ scratchnodes 1bb96358eda285b536c6d1c66846a7cdb2336cea 0a6e70ecd5b98d22382f69b93909f557ac6a9927 6cb0989601f1fb5805238edfb16f3606713d9a0b a4c202c147a9c4bb91bbadb56321fc5f3950f7f2 99949238d9ac7f2424a33a46dface6f866afd059 090a24fe63f31d3b4bee714447f835c8c362ff57 9b42578d44473575994109161430d65dd147d16d 0a6e70ecd5b98d22382f69b93909f557ac6a9927 b4e4bce660512ad3e71189e14588a70ac8e31fef 0a6e70ecd5b98d22382f69b93909f557ac6a9927 bf8a6e3011b345146bbbedbcb1ebd4837571492a 0a6e70ecd5b98d22382f69b93909f557ac6a9927 eaba929e866c59bc9a6aada5a9dd2f6990db83c0 0a6e70ecd5b98d22382f69b93909f557ac6a9927 $ hg glog o 6:9b42578d4447 added f | draft o 5:b4e4bce66051 added e | public o 4:1bb96358eda2 added d | public o 3:bf8a6e3011b3 added c | public o 2:eaba929e866c added b | public o 1:6cb0989601f1 added a | public @ 0:67145f466344 initialcommit public $ hg unbundle .hg/scratchbranches/filebundlestore/09/0a/090a24fe63f31d3b4bee714447f835c8c362ff57 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 new changesets 99949238d9ac (1 drafts) (run 'hg heads' to see heads, 'hg merge' to merge) $ hg glog o 7:99949238d9ac added f | draft | o 5:b4e4bce66051 added e | | public | o 4:1bb96358eda2 added d |/ public o 3:bf8a6e3011b3 added c | public o 2:eaba929e866c added b | public o 1:6cb0989601f1 added a | public @ 0:67145f466344 initialcommit public mercurial-5.3.1/tests/test-infinitepush.t0000644015407300116100000001224513627755405020426 0ustar augieeng00000000000000#require no-reposimplestore Testing infinipush extension and the confi options provided by it Setup $ . "$TESTDIR/library-infinitepush.sh" $ cp $HGRCPATH $TESTTMP/defaulthgrc $ setupcommon $ hg init repo $ cd repo $ setupserver $ echo initialcommit > initialcommit $ hg ci -Aqm "initialcommit" $ hg phase --public . $ cd .. $ hg clone ssh://user@dummy/repo client -q Create two heads. Push first head alone, then two heads together. Make sure that multihead push works. $ cd client $ echo multihead1 > multihead1 $ hg add multihead1 $ hg ci -m "multihead1" $ hg up null 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ echo multihead2 > multihead2 $ hg ci -Am "multihead2" adding multihead2 created new head $ hg push -r . --bundle-store pushing to ssh://user@dummy/repo searching for changes remote: pushing 1 commit: remote: ee4802bf6864 multihead2 $ hg push -r '1:2' --bundle-store pushing to ssh://user@dummy/repo searching for changes remote: pushing 2 commits: remote: bc22f9a30a82 multihead1 remote: ee4802bf6864 multihead2 $ scratchnodes bc22f9a30a821118244deacbd732e394ed0b686c ab1bc557aa090a9e4145512c734b6e8a828393a5 ee4802bf6864326a6b3dcfff5a03abc2a0a69b8f ab1bc557aa090a9e4145512c734b6e8a828393a5 Create two new scratch bookmarks $ hg up 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo scratchfirstpart > scratchfirstpart $ hg ci -Am "scratchfirstpart" adding scratchfirstpart created new head $ hg push -r . -B scratch/firstpart pushing to ssh://user@dummy/repo searching for changes remote: pushing 1 commit: remote: 176993b87e39 scratchfirstpart $ hg up 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo scratchsecondpart > scratchsecondpart $ hg ci -Am "scratchsecondpart" adding scratchsecondpart created new head $ hg push -r . -B scratch/secondpart pushing to ssh://user@dummy/repo searching for changes remote: pushing 1 commit: remote: 8db3891c220e scratchsecondpart Pull two bookmarks from the second client $ cd .. $ hg clone ssh://user@dummy/repo client2 -q $ cd client2 $ hg pull -B scratch/firstpart -B scratch/secondpart pulling from ssh://user@dummy/repo searching for changes adding changesets adding manifests adding file changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files (+1 heads) new changesets * (glob) (run 'hg heads' to see heads, 'hg merge' to merge) $ hg log -r scratch/secondpart -T '{node}' 8db3891c220e216f6da214e8254bd4371f55efca (no-eol) $ hg log -r scratch/firstpart -T '{node}' 176993b87e39bd88d66a2cccadabe33f0b346339 (no-eol) Make two commits to the scratch branch $ echo testpullbycommithash1 > testpullbycommithash1 $ hg ci -Am "testpullbycommithash1" adding testpullbycommithash1 created new head $ hg log -r '.' -T '{node}\n' > ../testpullbycommithash1 $ echo testpullbycommithash2 > testpullbycommithash2 $ hg ci -Aqm "testpullbycommithash2" $ hg push -r . -B scratch/mybranch -q Create third client and pull by commit hash. Make sure testpullbycommithash2 has not fetched $ cd .. $ hg clone ssh://user@dummy/repo client3 -q $ cd client3 $ hg pull -r `cat ../testpullbycommithash1` pulling from ssh://user@dummy/repo searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 33910bfe6ffe (1 drafts) (run 'hg update' to get a working copy) $ hg log -G -T '{desc} {phase} {bookmarks}' o testpullbycommithash1 draft | @ initialcommit public Make public commit in the repo and pull it. Make sure phase on the client is public. $ cd ../repo $ echo publiccommit > publiccommit $ hg ci -Aqm "publiccommit" $ hg phase --public . $ cd ../client3 $ hg pull pulling from ssh://user@dummy/repo searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) new changesets a79b6597f322 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg log -G -T '{desc} {phase} {bookmarks} {node|short}' o publiccommit public a79b6597f322 | | o testpullbycommithash1 draft 33910bfe6ffe |/ @ initialcommit public 67145f466344 $ hg up a79b6597f322 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo scratchontopofpublic > scratchontopofpublic $ hg ci -Aqm "scratchontopofpublic" $ hg push -r . -B scratch/scratchontopofpublic pushing to ssh://user@dummy/repo searching for changes remote: pushing 1 commit: remote: c70aee6da07d scratchontopofpublic $ cd ../client2 $ hg pull -B scratch/scratchontopofpublic pulling from ssh://user@dummy/repo searching for changes adding changesets adding manifests adding file changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files (+1 heads) new changesets a79b6597f322:c70aee6da07d (1 drafts) (run 'hg heads .' to see heads, 'hg merge' to merge) $ hg log -r scratch/scratchontopofpublic -T '{phase}' draft (no-eol) mercurial-5.3.1/tests/test-push-checkheads-partial-C2.t0000644015407300116100000000400513627755405022647 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 (1 drafts) (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)"` 1 new obsolescence markers 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-5.3.1/tests/test-convert-hg-svn.t0000644015407300116100000000610713627755405020601 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 $ SVNREPOURL="`"$PYTHON" $TESTDIR/svnurlof.py \"$SVNREPOPATH\"`" $ 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-5.3.1/tests/test-mq-qsave.t0000644015407300116100000000035713627755405017454 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-5.3.1/tests/test-websub.t0000644015407300116100000000220513627755405017203 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| > tickets = s|ticket(\d+)|Ticket\1|i > > [interhg] > # check that we maintain some interhg backwards compatibility... > # yes, 'x' is a weird delimiter... > markbugs = sxbugxbugx > problems = sxPROBLEMxproblemxi > EOF $ touch foo $ hg add foo $ hg commit -d '1 0' -m 'Issue123: fixed the bug! Ticket456 and problem789 too' $ 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! Ticket456 and problem789 too
    errors $ cat errors.log $ cd .. mercurial-5.3.1/tests/test-setdiscovery.t0000644015407300116100000010533013627755405020442 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 elapsed time: * seconds (glob) heads summary: total common heads: 2 also local heads: 2 also remote heads: 1 both: 1 local heads: 2 common: 2 missing: 0 remote heads: 3 common: 1 unknown: 2 local changesets: 7 common: 7 missing: 0 common heads: 01241442b3c2 b5714e113bc0 % -- a -> b set comparing with b query 1; heads searching for changes all local changesets known remotely elapsed time: * seconds (glob) heads summary: total common heads: 2 also local heads: 2 also remote heads: 1 both: 1 local heads: 2 common: 2 missing: 0 remote heads: 3 common: 1 unknown: 2 local changesets: 7 common: 7 missing: 0 common heads: 01241442b3c2 b5714e113bc0 % -- a -> b set (tip only) comparing with b query 1; heads searching for changes all local changesets known remotely elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 1 also remote heads: 0 both: 0 local heads: 2 common: 1 missing: 1 remote heads: 3 common: 0 unknown: 3 local changesets: 7 common: 6 missing: 1 common heads: b5714e113bc0 % -- b -> a tree comparing with a searching for changes unpruned common: 01241442b3c2 b5714e113bc0 elapsed time: * seconds (glob) heads summary: total common heads: 2 also local heads: 1 also remote heads: 2 both: 1 local heads: 3 common: 1 missing: 2 remote heads: 2 common: 2 unknown: 0 local changesets: 15 common: 7 missing: 8 common heads: 01241442b3c2 b5714e113bc0 % -- b -> a set comparing with a query 1; heads searching for changes all remote heads known locally elapsed time: * seconds (glob) heads summary: total common heads: 2 also local heads: 1 also remote heads: 2 both: 1 local heads: 3 common: 1 missing: 2 remote heads: 2 common: 2 unknown: 0 local changesets: 15 common: 7 missing: 8 common heads: 01241442b3c2 b5714e113bc0 % -- b -> a set (tip only) comparing with a query 1; heads searching for changes all remote heads known locally elapsed time: * seconds (glob) heads summary: total common heads: 2 also local heads: 1 also remote heads: 2 both: 1 local heads: 3 common: 1 missing: 2 remote heads: 2 common: 2 unknown: 0 local changesets: 15 common: 7 missing: 8 common heads: 01241442b3c2 b5714e113bc0 Many new: $ testdesc '-ra1 -ra2' '-rb' ' > +2:f +3:a1 +3:b > b tree comparing with b searching for changes unpruned common: bebd167eb94d elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 1 also remote heads: 0 both: 0 local heads: 2 common: 1 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 35 common: 5 missing: 30 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 1 also remote heads: 0 both: 0 local heads: 2 common: 1 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 35 common: 5 missing: 30 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 2 common: 0 missing: 2 remote heads: 1 common: 0 unknown: 1 local changesets: 35 common: 2 missing: 33 common heads: 66f7d451a68b % -- b -> a tree comparing with a searching for changes unpruned common: 66f7d451a68b bebd167eb94d elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 1 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 2 common: 1 unknown: 1 local changesets: 8 common: 5 missing: 3 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 1 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 2 common: 1 unknown: 1 local changesets: 8 common: 5 missing: 3 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 1 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 2 common: 1 unknown: 1 local changesets: 8 common: 5 missing: 3 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 elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 1 also remote heads: 0 both: 0 local heads: 2 common: 1 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 34 common: 4 missing: 30 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 1 also remote heads: 0 both: 0 local heads: 2 common: 1 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 34 common: 4 missing: 30 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 2 common: 0 missing: 2 remote heads: 1 common: 0 unknown: 1 local changesets: 34 common: 2 missing: 32 common heads: 66f7d451a68b % -- b -> a tree comparing with a searching for changes unpruned common: 2dc09a01254d 66f7d451a68b elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 1 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 2 common: 1 unknown: 1 local changesets: 34 common: 4 missing: 30 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 1 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 2 common: 1 unknown: 1 local changesets: 34 common: 4 missing: 30 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 1 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 2 common: 1 unknown: 1 local changesets: 34 common: 4 missing: 30 common heads: 2dc09a01254d Both many new: $ testdesc '-ra' '-rb' ' > +2:f +30 :b > b tree comparing with b searching for changes unpruned common: 66f7d451a68b elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 32 common: 2 missing: 30 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 32 common: 2 missing: 30 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 32 common: 2 missing: 30 common heads: 66f7d451a68b % -- b -> a tree comparing with a searching for changes unpruned common: 66f7d451a68b elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 32 common: 2 missing: 30 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 32 common: 2 missing: 30 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 32 common: 2 missing: 30 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 elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 52 common: 2 missing: 50 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 52 common: 2 missing: 50 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 52 common: 2 missing: 50 common heads: 66f7d451a68b % -- b -> a tree comparing with a searching for changes unpruned common: 66f7d451a68b elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 32 common: 2 missing: 30 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 32 common: 2 missing: 30 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 32 common: 2 missing: 30 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 elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 1050 common: 1000 missing: 50 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 1050 common: 1000 missing: 50 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 1050 common: 1000 missing: 50 common heads: 7ead0cba2838 % -- b -> a tree comparing with a searching for changes unpruned common: 7ead0cba2838 elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 1030 common: 1000 missing: 30 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 1030 common: 1000 missing: 30 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) elapsed time: * seconds (glob) heads summary: total common heads: 1 also local heads: 0 also remote heads: 0 both: 0 local heads: 1 common: 0 missing: 1 remote heads: 1 common: 0 unknown: 1 local changesets: 1030 common: 1000 missing: 30 common heads: 7ead0cba2838 One with >200 heads. We now switch to send them all in the initial roundtrip, but still do sampling for the later request. $ 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$ partial-pull "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$ partial-pull "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull $ 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 init r1 $ hg -R r1 -q unbundle $TESTDIR/bundles/issue4438-r1.hg $ hg -R r1 -q up $ hg init r2 $ hg -R r2 -q unbundle $TESTDIR/bundles/issue4438-r2.hg $ hg -R r2 -q up #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 >> r1/.hg/hgrc << EOF > [devel] > discovery.randomize = False > EOF $ hg -R r1 outgoing r2 -T'{rev} ' --config extensions.blackbox= \ > --config blackbox.track='command commandfinish discovery' 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 --config blackbox.track= * @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, 1 roundtrips in *.????s (glob) * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> -R r1 outgoing r2 *-T{rev} * --config *extensions.blackbox=* exited 0 after *.?? seconds (glob) $ cd .. mercurial-5.3.1/tests/test-check-rust-format.t0000644015407300116100000000041013627755405021246 0ustar augieeng00000000000000#require rustfmt test-repo $ . "$TESTDIR/helpers-testrepo.sh" $ cd "$TESTDIR"/.. $ RUSTFMT=$(rustup which --toolchain nightly rustfmt) $ for f in `testrepohg files 'glob:**/*.rs'` ; do > $RUSTFMT --check --unstable-features --color=never $f > done mercurial-5.3.1/tests/flagprocessorext.py0000644015407300116100000000717213627755405020526 0ustar augieeng00000000000000# coding=UTF-8 from __future__ import absolute_import import base64 import zlib from mercurial import ( changegroup, exchange, extensions, revlog, util, ) from mercurial.revlogutils import flagutil # 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, sidedata): return (text, True) def noopdonothingread(self, text): return (text, True, {}) def b64encode(self, text, sidedata): return (base64.b64encode(text), False) def b64decode(self, text): return (base64.b64decode(text), True, {}) def gzipcompress(self, text, sidedata): return (zlib.compress(text), False) def gzipdecompress(self, text): return (zlib.decompress(text), True, {}) def supportedoutgoingversions(orig, repo): versions = orig(repo) versions.discard(b'01') versions.discard(b'02') versions.add(b'03') return versions def allsupportedversions(orig, ui): versions = orig(ui) versions.add(b'03') return versions def makewrappedfile(obj): class wrappedfile(obj.__class__): def addrevision( self, text, transaction, link, p1, p2, cachedelta=None, node=None, flags=flagutil.REVIDX_DEFAULT_FLAGS, ): if b'[NOOP]' in text: flags |= REVIDX_NOOP if b'[BASE64]' in text: flags |= REVIDX_BASE64 if b'[GZIP]' in text: flags |= REVIDX_GZIP # 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 super(wrappedfile, self).addrevision( text, transaction, link, p1, p2, cachedelta=cachedelta, node=node, flags=flags, ) obj.__class__ = wrappedfile def reposetup(ui, repo): class wrappingflagprocessorrepo(repo.__class__): def file(self, f): orig = super(wrappingflagprocessorrepo, self).file(f) makewrappedfile(orig) return orig repo.__class__ = wrappingflagprocessorrepo 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] flagutil.REVIDX_KNOWN_FLAGS |= util.bitsfrom(flags) revlog.REVIDX_FLAGS_ORDER.extend(flags) # Teach exchange to use changegroup 3 for k in exchange._bundlespeccontentopts.keys(): exchange._bundlespeccontentopts[k][b"cg.version"] = b"03" # Register flag processors for each extension flagutil.addflagprocessor( REVIDX_NOOP, (noopdonothingread, noopdonothing, validatehash,) ) flagutil.addflagprocessor( REVIDX_BASE64, (b64decode, b64encode, bypass,), ) flagutil.addflagprocessor( REVIDX_GZIP, (gzipdecompress, gzipcompress, bypass) ) mercurial-5.3.1/tests/test-exchange-obsmarkers-case-B1.t0000644015407300116100000000474613627755405023031 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-5.3.1/tests/test-rebase-templates.t0000644015407300116100000000370313627755405021155 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) $ hg log -G -T "{rev}:{node|short} {desc}" o 7:f48cd65c6dc3 Added b | | @ 5:df21b32134ba Added d |/ o 4:849767420fd5 Added c | o 0:18d04c59bb5d Added a $ hg rebase -s 7 -d 5 -q --keep -T "{nodechanges % '{oldnode}:{newnodes % ' {node} '}'}" f48cd65c6dc3d2acb55da54402a5b029546e546f: 6f7dda91e55e728fb798f3e44dbecf0ebaa83267 (no-eol) $ hg log -G -T "{rev}:{node|short} {desc}" o 8:6f7dda91e55e Added b | | o 7:f48cd65c6dc3 Added b | | @ | 5:df21b32134ba Added d |/ o 4:849767420fd5 Added c | o 0:18d04c59bb5d Added a mercurial-5.3.1/tests/test-extra-filelog-entry.t0000644015407300116100000000060413627755405021616 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 linkrev nodeid p1 p2 0 0 1e88685f5dde 000000000000 000000000000 mercurial-5.3.1/tests/test-push-checkheads-unpushed-D6.t0000644015407300116100000000403013627755405023051 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)"` 1 new obsolescence markers obsoleted 1 changesets $ hg debugobsolete --record-parents `getid "desc(A1)"` 1 new obsolescence markers 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-5.3.1/tests/test-issue1175.t0000644015407300116100000000404313627755405017364 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: a1 a2 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 checked 6 changesets with 4 changes to 4 files $ 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" $ 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-5.3.1/tests/test-check-config.t0000644015407300116100000000276713627755405020251 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/helptext/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-5.3.1/tests/test-bisect3.t0000644015407300116100000001404213627755405017252 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-5.3.1/tests/test-obsolete-tag-cache.t0000644015407300116100000001132013627755405021340 0ustar augieeng00000000000000 $ cat >> $HGRCPATH << EOF > [extensions] > blackbox= > rebase= > mock=$TESTDIR/mockblackbox.py > > [blackbox] > track = command, commandfinish, tagscache > > [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 1 new obsolescence markers 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 1 new obsolescence markers obsoleted 1 changesets $ hg debugobsolete -d '0 0' 5f97d42da03fd56f3b228b03dfe48af5c0adf75b -u dummyuser 1 new obsolescence markers 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-5.3.1/tests/test-check-interfaces.py0000644015407300116100000001711713627755405021307 0ustar augieeng00000000000000# Test that certain objects conform to well-defined interfaces. from __future__ import absolute_import, print_function from mercurial import encoding encoding.environ[b'HGREALINTERFACES'] = b'1' import os import subprocess import sys # Only run if tests are run in a repo if subprocess.call( ['python', '%s/hghave' % os.environ['TESTDIR'], 'test-repo'] ): sys.exit(80) from mercurial.interfaces import ( dirstate as intdirstate, repository, ) from mercurial.thirdparty.zope import interface as zi from mercurial.thirdparty.zope.interface import verify as ziverify from mercurial import ( bundlerepo, dirstate, filelog, httppeer, localrepo, manifest, pycompat, revlog, sshpeer, statichttprepo, ui as uimod, unionrepo, vfs as vfsmod, wireprotoserver, wireprototypes, wireprotov1peer, wireprotov2server, ) testdir = os.path.dirname(__file__) rootdir = pycompat.fsencode(os.path.normpath(os.path.join(testdir, '..'))) sys.path[0:0] = [testdir] import simplestorerepo del sys.path[0] def checkzobject(o, allowextra=False): """Verify an object with a zope interface.""" ifaces = zi.providedBy(o) if not ifaces: print('%r does not provide any zope interfaces' % o) return # Run zope.interface's built-in verification routine. This verifies that # everything that is supposed to be present is present. for iface in ifaces: ziverify.verifyObject(iface, o) if allowextra: return # Now verify that the object provides no extra public attributes that # aren't declared as part of interfaces. allowed = set() for iface in ifaces: allowed |= set(iface.names(all=True)) public = {a for a in dir(o) if not a.startswith('_')} for attr in sorted(public - allowed): print( 'public attribute not declared in interfaces: %s.%s' % (o.__class__.__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 class dummyopener(object): handlers = [] # Facilitates testing sshpeer without requiring a server. class badpeer(httppeer.httppeer): def __init__(self): super(badpeer, self).__init__( None, None, None, dummyopener(), None, None ) self.badattribute = True def badmethod(self): pass class dummypipe(object): def close(self): pass def main(): ui = uimod.ui() # Needed so we can open a local repo with obsstore without a warning. ui.setconfig(b'experimental', b'evolution.createmarkers', True) checkzobject(badpeer()) ziverify.verifyClass(repository.ipeerbase, httppeer.httppeer) checkzobject(httppeer.httppeer(None, None, None, dummyopener(), None, None)) ziverify.verifyClass(repository.ipeerv2, httppeer.httpv2peer) checkzobject(httppeer.httpv2peer(None, b'', b'', None, None, None)) ziverify.verifyClass(repository.ipeerbase, localrepo.localpeer) checkzobject(localrepo.localpeer(dummyrepo())) ziverify.verifyClass( repository.ipeercommandexecutor, localrepo.localcommandexecutor ) checkzobject(localrepo.localcommandexecutor(None)) ziverify.verifyClass( repository.ipeercommandexecutor, wireprotov1peer.peerexecutor ) checkzobject(wireprotov1peer.peerexecutor(None)) ziverify.verifyClass(repository.ipeerbase, sshpeer.sshv1peer) checkzobject( sshpeer.sshv1peer( ui, b'ssh://localhost/foo', b'', dummypipe(), dummypipe(), None, None, ) ) ziverify.verifyClass(repository.ipeerbase, sshpeer.sshv2peer) checkzobject( sshpeer.sshv2peer( ui, b'ssh://localhost/foo', b'', dummypipe(), dummypipe(), None, None, ) ) ziverify.verifyClass(repository.ipeerbase, bundlerepo.bundlepeer) checkzobject(bundlerepo.bundlepeer(dummyrepo())) ziverify.verifyClass(repository.ipeerbase, statichttprepo.statichttppeer) checkzobject(statichttprepo.statichttppeer(dummyrepo())) ziverify.verifyClass(repository.ipeerbase, unionrepo.unionpeer) checkzobject(unionrepo.unionpeer(dummyrepo())) ziverify.verifyClass( repository.ilocalrepositorymain, localrepo.localrepository ) ziverify.verifyClass( repository.ilocalrepositoryfilestorage, localrepo.revlogfilestorage ) repo = localrepo.makelocalrepository(ui, rootdir) checkzobject(repo) ziverify.verifyClass( wireprototypes.baseprotocolhandler, wireprotoserver.sshv1protocolhandler ) ziverify.verifyClass( wireprototypes.baseprotocolhandler, wireprotoserver.sshv2protocolhandler ) ziverify.verifyClass( wireprototypes.baseprotocolhandler, wireprotoserver.httpv1protocolhandler, ) ziverify.verifyClass( wireprototypes.baseprotocolhandler, wireprotov2server.httpv2protocolhandler, ) sshv1 = wireprotoserver.sshv1protocolhandler(None, None, None) checkzobject(sshv1) sshv2 = wireprotoserver.sshv2protocolhandler(None, None, None) checkzobject(sshv2) httpv1 = wireprotoserver.httpv1protocolhandler(None, None, None) checkzobject(httpv1) httpv2 = wireprotov2server.httpv2protocolhandler(None, None) checkzobject(httpv2) ziverify.verifyClass(repository.ifilestorage, filelog.filelog) ziverify.verifyClass(repository.imanifestdict, manifest.manifestdict) ziverify.verifyClass( repository.imanifestrevisionstored, manifest.manifestctx ) ziverify.verifyClass( repository.imanifestrevisionwritable, manifest.memmanifestctx ) ziverify.verifyClass( repository.imanifestrevisionstored, manifest.treemanifestctx ) ziverify.verifyClass( repository.imanifestrevisionwritable, manifest.memtreemanifestctx ) ziverify.verifyClass(repository.imanifestlog, manifest.manifestlog) ziverify.verifyClass(repository.imanifeststorage, manifest.manifestrevlog) ziverify.verifyClass( repository.irevisiondelta, simplestorerepo.simplestorerevisiondelta ) ziverify.verifyClass(repository.ifilestorage, simplestorerepo.filestorage) ziverify.verifyClass( repository.iverifyproblem, simplestorerepo.simplefilestoreproblem ) ziverify.verifyClass(intdirstate.idirstate, dirstate.dirstate) vfs = vfsmod.vfs(b'.') fl = filelog.filelog(vfs, b'dummy.i') checkzobject(fl, allowextra=True) # Conforms to imanifestlog. ml = manifest.manifestlog( vfs, repo, manifest.manifestrevlog(repo.svfs), repo.narrowmatch() ) checkzobject(ml) checkzobject(repo.manifestlog) # Conforms to imanifestrevision. mctx = ml[repo[0].manifestnode()] checkzobject(mctx) # Conforms to imanifestrevisionwritable. checkzobject(mctx.new()) checkzobject(mctx.copy()) # Conforms to imanifestdict. checkzobject(mctx.read()) mrl = manifest.manifestrevlog(vfs) checkzobject(mrl) ziverify.verifyClass(repository.irevisiondelta, revlog.revlogrevisiondelta) rd = revlog.revlogrevisiondelta( node=b'', p1node=b'', p2node=b'', basenode=b'', linknode=b'', flags=b'', baserevisionsize=None, revision=b'', delta=None, ) checkzobject(rd) ziverify.verifyClass(repository.iverifyproblem, revlog.revlogproblem) checkzobject(revlog.revlogproblem()) main() mercurial-5.3.1/tests/test-addremove.t0000644015407300116100000000351613627755405017670 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 -ns 50 --color debug [ui.addremove.removed ui.status|removing a] [ui.addremove.added ui.status|adding b] [ui.addremove.removed ui.status|removing c] [ui.addremove.added ui.status|adding d] [ ui.status|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-5.3.1/tests/test-merge-tools.t0000644015407300116100000014203013627755405020152 0ustar augieeng00000000000000test merge-tools configuration - mostly exercising filemerge.py $ unset HGMERGE # make sure HGMERGE doesn't interfere with the test $ cat >> $HGRCPATH << EOF > [ui] > merge= > [commands] > merge.require-rev=True > EOF $ hg init repo $ cd repo 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="/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`:/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`:/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 executable set to python script that succeeds: $ cat > "$TESTTMP/myworkingmerge.py" < def myworkingmergefn(ui, repo, args, **kwargs): > return False > EOF $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:myworkingmergefn" 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 executable set to python script that fails: $ cat > "$TESTTMP/mybrokenmerge.py" < def mybrokenmergefn(ui, repo, args, **kwargs): > ui.write(b"some fail message\n") > return True > EOF $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/mybrokenmerge.py:mybrokenmergefn" merging f some fail message abort: $TESTTMP/mybrokenmerge.py hook failed [255] $ aftermerge # cat f revision 1 space # hg stat ? f.orig # hg resolve --list U f executable set to python script that is missing function: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:missingFunction" merging f abort: $TESTTMP/myworkingmerge.py does not have function: missingFunction [255] $ aftermerge # cat f revision 1 space # hg stat ? f.orig # hg resolve --list U f executable set to missing python script: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/missingpythonscript.py:mergefn" merging f abort: loading python merge script failed: $TESTTMP/missingpythonscript.py [255] $ aftermerge # cat f revision 1 space # hg stat ? f.orig # hg resolve --list U f executable set to python script but callable function is missing: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py" abort: invalid 'python:' syntax: python:$TESTTMP/myworkingmerge.py [255] $ aftermerge # cat f revision 1 space # hg stat # hg resolve --list U f executable set to python script but callable function is empty string: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/myworkingmerge.py:" abort: invalid 'python:' syntax: python:$TESTTMP/myworkingmerge.py: [255] $ aftermerge # cat f revision 1 space # hg stat # hg resolve --list U f executable set to python script but callable function is missing and path contains colon: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config merge-tools.true.executable="python:$TESTTMP/some:dir/myworkingmerge.py" abort: invalid 'python:' syntax: python:$TESTTMP/some:dir/myworkingmerge.py [255] $ aftermerge # cat f revision 1 space # hg stat # hg resolve --list U f executable set to python script filename that contains spaces: $ mkdir -p "$TESTTMP/my path" $ cat > "$TESTTMP/my path/my working merge with spaces in filename.py" < def myworkingmergefn(ui, repo, args, **kwargs): > return False > EOF $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ hg merge -r 2 --config "merge-tools.true.executable=python:$TESTTMP/my path/my working merge with spaces in filename.py:myworkingmergefn" 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 #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 file 'f' needs to be resolved. You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. What do you want to do? 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 file 'f' needs to be resolved. You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. What do you want to do? 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 file 'f' needs to be resolved. You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. What do you want to do? 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 file 'f' needs to be resolved. You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. What do you want to do? [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 file 'f' needs to be resolved. You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. What do you want to do? [1] $ aftermerge # cat f revision 1 space # hg stat M f # hg resolve --list U f $ hg resolve --all --config ui.merge=internal:prompt file 'f' needs to be resolved. You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. What do you want to do? 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 premerge=keep respects ui.mergemarkers=basic: $ 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 --config ui.mergemarkers=basic merging f <<<<<<< working copy revision 1 space ======= revision 4 >>>>>>> merge rev 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 revision 1 space ======= revision 4 >>>>>>> merge rev # hg stat M f # hg resolve --list R f premerge=keep ignores ui.mergemarkers=basic if true.mergemarkers=detailed: $ 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 \ > --config ui.mergemarkers=basic \ > --config merge-tools.true.mergemarkers=detailed 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 respects ui.mergemarkertemplate instead of true.mergemarkertemplate if true.mergemarkers=basic: $ 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 \ > --config ui.mergemarkertemplate='uitmpl {rev}' \ > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' merging f <<<<<<< working copy: uitmpl 1 revision 1 space ======= revision 4 >>>>>>> merge rev: uitmpl 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: uitmpl 1 revision 1 space ======= revision 4 >>>>>>> merge rev: uitmpl 4 # hg stat M f # hg resolve --list R f premerge=keep respects true.mergemarkertemplate instead of true.mergemarkertemplate if true.mergemarkers=detailed: $ 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 \ > --config ui.mergemarkertemplate='uitmpl {rev}' \ > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \ > --config merge-tools.true.mergemarkers=detailed merging f <<<<<<< working copy: tooltmpl ef83787e2614 revision 1 space ======= revision 4 >>>>>>> merge rev: tooltmpl 81448d39c9a0 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: tooltmpl ef83787e2614 revision 1 space ======= revision 4 >>>>>>> merge rev: tooltmpl 81448d39c9a0 # 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 Merge using a tool that supports labellocal, labelother, and labelbase, checking that they're quoted properly as well. This is using the default 'basic' mergemarkers even though ui.mergemarkers is 'detailed', so it's ignoring both mergemarkertemplate settings: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ cat < printargs_merge_tool > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done > EOF $ hg --config merge-tools.true.executable='sh' \ > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \ > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \ > --config ui.mergemarkertemplate='uitmpl {rev}' \ > --config ui.mergemarkers=detailed \ > merge -r 2 merging f arg: "ll:working copy" arg: "lo:" arg: "merge rev" arg: "lb:base: */f~base.*" (glob) 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ rm -f 'printargs_merge_tool' Same test with experimental.mergetempdirprefix set: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ cat < printargs_merge_tool > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done > EOF $ hg --config experimental.mergetempdirprefix=$TESTTMP/hgmerge. \ > --config merge-tools.true.executable='sh' \ > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \ > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \ > --config ui.mergemarkertemplate='uitmpl {rev}' \ > --config ui.mergemarkers=detailed \ > merge -r 2 merging f arg: "ll:working copy" arg: "lo:" arg: "merge rev" arg: "lb:base: */hgmerge.*/f~base" (glob) 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ rm -f 'printargs_merge_tool' Merge using a tool that supports labellocal, labelother, and labelbase, checking that they're quoted properly as well. This is using 'detailed' mergemarkers, even though ui.mergemarkers is 'basic', and using the tool's mergemarkertemplate: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ cat < printargs_merge_tool > while test \$# -gt 0; do echo arg: \"\$1\"; shift; done > EOF $ hg --config merge-tools.true.executable='sh' \ > --config merge-tools.true.args='./printargs_merge_tool ll:$labellocal lo: $labelother lb:$labelbase": "$base' \ > --config merge-tools.true.mergemarkers=detailed \ > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \ > --config ui.mergemarkertemplate='uitmpl {rev}' \ > --config ui.mergemarkers=basic \ > merge -r 2 merging f arg: "ll:working copy: tooltmpl ef83787e2614" arg: "lo:" arg: "merge rev: tooltmpl 0185f4e0cf02" arg: "lb:base: */f~base.*" (glob) 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ rm -f 'printargs_merge_tool' The merge tool still gets labellocal and labelother as 'basic' even when premerge=keep is used and has 'detailed' markers: $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ cat < mytool > echo labellocal: \"\$1\" > echo labelother: \"\$2\" > echo "output (arg)": \"\$3\" > echo "output (contents)": > cat "\$3" > EOF $ hg --config merge-tools.true.executable='sh' \ > --config merge-tools.true.args='mytool $labellocal $labelother $output' \ > --config merge-tools.true.premerge=keep \ > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \ > --config ui.mergemarkertemplate='uitmpl {rev}' \ > --config ui.mergemarkers=detailed \ > merge -r 2 merging f labellocal: "working copy" labelother: "merge rev" output (arg): "$TESTTMP/repo/f" output (contents): <<<<<<< working copy: uitmpl 1 revision 1 ======= revision 2 >>>>>>> merge rev: uitmpl 2 space 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ rm -f 'mytool' premerge=keep uses the *tool's* mergemarkertemplate if tool's mergemarkers=detailed; labellocal and labelother also use the tool's template $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat # hg update -C 1 $ cat < mytool > echo labellocal: \"\$1\" > echo labelother: \"\$2\" > echo "output (arg)": \"\$3\" > echo "output (contents)": > cat "\$3" > EOF $ hg --config merge-tools.true.executable='sh' \ > --config merge-tools.true.args='mytool $labellocal $labelother $output' \ > --config merge-tools.true.premerge=keep \ > --config merge-tools.true.mergemarkers=detailed \ > --config merge-tools.true.mergemarkertemplate='tooltmpl {short(node)}' \ > --config ui.mergemarkertemplate='uitmpl {rev}' \ > --config ui.mergemarkers=detailed \ > merge -r 2 merging f labellocal: "working copy: tooltmpl ef83787e2614" labelother: "merge rev: tooltmpl 0185f4e0cf02" output (arg): "$TESTTMP/repo/f" output (contents): <<<<<<< working copy: tooltmpl ef83787e2614 revision 1 ======= revision 2 >>>>>>> merge rev: tooltmpl 0185f4e0cf02 space 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ rm -f 'mytool' 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 #else Match the non-portable filename commits above for test stability $ hg import --bypass -q - << EOF > # HG changeset patch > revision 5 > > diff --git a/"; exit 1; echo " b/"; exit 1; echo " > new file mode 100644 > --- /dev/null > +++ b/"; exit 1; echo " > @@ -0,0 +1,1 @@ > +revision 5 > EOF $ hg import --bypass -q - << EOF > # HG changeset patch > revision 6 > > diff --git a/"; exit 1; echo " b/"; exit 1; echo " > new file mode 100644 > --- /dev/null > +++ b/"; exit 1; echo " > @@ -0,0 +1,1 @@ > +revision 6 > EOF #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 missingbinary is a merge-tool that doesn't exist: $ echo "missingbinary.executable=doesnotexist" >> .hg/hgrc $ beforemerge [merge-tools] false.whatever= true.priority=1 true.executable=cat missingbinary.executable=doesnotexist # hg update -C 1 $ hg merge -y -r 2 --config ui.merge=missingbinary couldn't find merge tool missingbinary (for pattern f) merging f couldn't find merge tool missingbinary (for pattern 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) $ hg update -q -C 1 $ rm f internal merge cannot handle symlinks and shouldn't try: #if symlink $ ln -s symlink f $ hg commit -qm 'f is symlink' #else $ hg import --bypass -q - << EOF > # HG changeset patch > f is symlink > > diff --git a/f b/f > old mode 100644 > new mode 120000 > --- a/f > +++ b/f > @@ -1,2 +1,1 @@ > -revision 1 > -space > +symlink > \ No newline at end of file > EOF Resolve 'other [destination] changed f which local [working copy] deleted' prompt $ hg up -q -C --config ui.interactive=True << EOF > c > EOF #endif $ 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] 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.* */f~local.*.txt */f~other.*.txt $TESTTMP/repo/f.txt (glob) 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) Verify naming of temporary files and that extension is preserved (experimental.mergetempdirprefix version): $ 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' \ > --config experimental.mergetempdirprefix=$TESTTMP/hgmerge. merging f and f.txt to f.txt $TESTTMP/hgmerge.*/f~base $TESTTMP/hgmerge.*/f~local.txt $TESTTMP/hgmerge.*/f~other.txt $TESTTMP/repo/f.txt (glob) 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) Binary files capability checking $ hg update -q -C 0 $ python < with open('b', 'wb') as fp: > fp.write(b'\x00\x01\x02\x03') > EOF $ hg add b $ hg commit -qm "add binary file (#1)" $ hg update -q -C 0 $ python < with open('b', 'wb') as fp: > fp.write(b'\x03\x02\x01\x00') > EOF $ hg add b $ hg commit -qm "add binary file (#2)" By default, binary files capability of internal merge tools is not checked strictly. (for merge-patterns, chosen unintentionally) $ hg merge 9 \ > --config merge-patterns.b=:merge-other \ > --config merge-patterns.re:[a-z]=:other warning: check merge-patterns configurations, if ':merge-other' for binary file 'b' is unintentional (see 'hg help merge-tools' for binary files capability) merging b warning: b looks like a binary file. 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] (Testing that commands.merge.require-rev doesn't break --abort) $ hg merge --abort -q (for ui.merge, ignored unintentionally) $ hg merge 9 \ > --config merge-tools.:other.binary=true \ > --config ui.merge=:other tool :other (for pattern b) can't handle binary tool true can't handle binary tool :other can't handle binary tool false can't handle binary no tool found to merge b file 'b' needs to be resolved. You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. What do you want to do? 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] $ hg merge --abort -q With merge.strict-capability-check=true, binary files capability of internal merge tools is checked strictly. $ f --hexdump b b: 0000: 03 02 01 00 |....| (for merge-patterns) $ hg merge 9 --config merge.strict-capability-check=true \ > --config merge-tools.:merge-other.binary=true \ > --config merge-patterns.b=:merge-other \ > --config merge-patterns.re:[a-z]=:other tool :merge-other (for pattern b) can't handle binary 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ f --hexdump b b: 0000: 00 01 02 03 |....| $ hg merge --abort -q (for ui.merge) $ hg merge 9 --config merge.strict-capability-check=true \ > --config ui.merge=:other 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ f --hexdump b b: 0000: 00 01 02 03 |....| $ hg merge --abort -q Check that the extra information is printed correctly $ hg merge 9 \ > --config merge-tools.testecho.executable='echo' \ > --config merge-tools.testecho.args='merge runs here ...' \ > --config merge-tools.testecho.binary=True \ > --config ui.merge=testecho \ > --config ui.pre-merge-tool-output-template='\n{label("extmerge.running_merge_tool", "Running merge tool for {path} ({toolpath}):")}\n{separate("\n", extmerge_section(local), extmerge_section(base), extmerge_section(other))}\n' \ > --config 'templatealias.extmerge_section(sect)="- {pad("{sect.name} ({sect.label})", 20, left=True)}: {revset(sect.node)%"{rev}:{shortest(node,8)} {desc|firstline} {separate(" ", tags, bookmarks, branch)}"}"' merging b Running merge tool for b ("*/bin/echo.exe"): (glob) (windows !) Running merge tool for b (*/bin/echo): (glob) (no-windows !) - local (working copy): 10:2d1f533d add binary file (#2) tip default - base (base): -1:00000000 default - other (merge rev): 9:1e7ad7d7 add binary file (#1) default merge runs here ... 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 missingbinary.executable=doesnotexist # 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 8 f.txt $ hg debugpickmergetool -r 8 f.txt = true #if symlink (symlink causes chosing :prompt) $ hg debugpickmergetool -r 6d00b3726f6e f = :prompt (by default, it is assumed that no internal merge tools has symlinks capability) $ hg debugpickmergetool \ > -r 6d00b3726f6e \ > --config merge-tools.:merge-other.symlink=true \ > --config merge-patterns.f=:merge-other \ > --config merge-patterns.re:[f]=:merge-local \ > --config merge-patterns.re:[a-z]=:other f = :prompt $ hg debugpickmergetool \ > -r 6d00b3726f6e \ > --config merge-tools.:other.symlink=true \ > --config ui.merge=:other f = :prompt (with strict-capability-check=true, actual symlink capabilities are checked striclty) $ hg debugpickmergetool --config merge.strict-capability-check=true \ > -r 6d00b3726f6e \ > --config merge-tools.:merge-other.symlink=true \ > --config merge-patterns.f=:merge-other \ > --config merge-patterns.re:[f]=:merge-local \ > --config merge-patterns.re:[a-z]=:other f = :other $ hg debugpickmergetool --config merge.strict-capability-check=true \ > -r 6d00b3726f6e \ > --config ui.merge=:other f = :other $ hg debugpickmergetool --config merge.strict-capability-check=true \ > -r 6d00b3726f6e \ > --config merge-tools.:merge-other.symlink=true \ > --config ui.merge=:merge-other 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 $ cd .. mercurial-5.3.1/tests/test-eol-clone.t0000644015407300116100000000537013627755405017577 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 Test commit of removed .hgeol and how it immediately makes the automatic changes explicit and committable. $ 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 $ touch a.txt * # ensure consistent st dirtyness checks, ignoring dirstate timing $ hg st -v --debug M a.txt R .hgeol $ hg commit -m 'remove eol' $ hg exp # HG changeset patch # User test # Date 0 0 # Thu Jan 01 00:00:00 1970 +0000 # Node ID 3c20c2d90333b6ecdc8f7aa8f9b73223c7c7a608 # Parent 90f94e2cf4e24628afddd641688dfe4cd476d6e4 remove eol diff -r 90f94e2cf4e2 -r 3c20c2d90333 .hgeol --- a/.hgeol Thu Jan 01 00:00:00 1970 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -[patterns] -**.txt = native diff -r 90f94e2cf4e2 -r 3c20c2d90333 a.txt --- a/a.txt Thu Jan 01 00:00:00 1970 +0000 +++ b/a.txt Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +1,3 @@ -first -second -third +first\r (esc) +second\r (esc) +third\r (esc) $ hg push --quiet $ cd .. Test clone of repo with .hgeol in working dir, but no .hgeol in default checkout revision tip. The repo is correctly updated to be consistent and have the exact content checked out without filtering, ignoring the current .hgeol in the source repo: $ cat repo/.hgeol [patterns] **.txt = native $ hg clone repo repo-3 -v --debug linked 7 files updating to branch default resolving manifests branchmerge: False, force: False, partial: False ancestor: 000000000000, local: 000000000000+, remote: 3c20c2d90333 calling hook preupdate.eol: hgext.eol.preupdate a.txt: remote created -> g getting a.txt 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd repo-3 $ cat a.txt first\r (esc) second\r (esc) third\r (esc) 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-5.3.1/tests/test-template-keywords.t0000644015407300116100000007730213627755405021406 0ustar augieeng00000000000000Test template keywords ====================== $ 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' 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" Working-directory revision has special identifiers, though they are still experimental: $ hg log -r 'wdir()' -T '{rev}:{node}\n' 2147483647:ffffffffffffffffffffffffffffffffffffffff $ hg log -r 'wdir()' -Tjson --debug [ { "added": [], "bookmarks": [], "branch": "default", "date": [0, 0], "desc": "", "extra": {"branch": "default"}, "manifest": "ffffffffffffffffffffffffffffffffffffffff", "modified": [], "node": "ffffffffffffffffffffffffffffffffffffffff", "parents": ["95c24699272ef57d062b8bccc32c878bf841784a"], "phase": "draft", "removed": [], "rev": 2147483647, "tags": [], "user": "test" } ] $ hg log -r 'wdir()' -T '{manifest}\n' 2147483647:ffffffffffff However, for negrev, we refuse to output anything (as well as for null) $ hg log -r 'wdir() + null' -T 'bla{negrev}nk\n' blank blank Changectx-derived keywords are disabled within {manifest} as {node} changes: $ hg log -r0 -T 'outer:{p1node} {manifest % "inner:{p1node}"}\n' outer:0000000000000000000000000000000000000000 inner: 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) 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 user; 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 user: test user: User Name user: person user: person user: person user: person user: other@place user: A. N. Other user: User Name user--verbose: test user--verbose: User Name user--verbose: person user--verbose: person user--verbose: person user--verbose: person user--verbose: other@place user--verbose: A. N. Other user--verbose: User Name user--debug: test user--debug: User Name user--debug: person user--debug: person user--debug: person user--debug: person user--debug: other@place user--debug: A. N. Other user--debug: User Name Add a dummy commit to make up for the instability of the above: $ echo a > a $ hg add a $ hg ci -m future 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" Test files list: $ hg log -l1 -T '{join(file_mods, " ")}\n' third $ hg log -l1 -T '{file_mods % "{file}\n"}' third $ hg log -l1 -T '{file_mods % "{path}\n"}' third $ hg log -l1 -T '{join(files, " ")}\n' a b fifth fourth third $ hg log -l1 -T '{files % "{file}\n"}' a b fifth fourth third $ hg log -l1 -T '{files % "{path}\n"}' a b fifth fourth third Test files lists on merge commit: $ hg co '.^' -q $ touch c $ hg add c $ hg ci -qm 'add file' $ hg merge 10 -q $ hg ci -m 'merge' $ hg log -l1 -T '{files}\n' $ hg log -l1 -T '{file_mods}\n' $ hg log -l1 -T '{file_adds}\n' $ hg log -l1 -T '{file_dels}\n' Test file copies dict: $ hg log -r8 -T '{join(file_copies, " ")}\n' fourth (second) $ hg log -r8 -T '{file_copies % "{name} <- {source}\n"}' fourth <- second $ hg log -r8 -T '{file_copies % "{path} <- {source}\n"}' fourth <- second $ hg log -r8 -T '{join(file_copies_switch, " ")}\n' $ hg log -r8 -C -T '{join(file_copies_switch, " ")}\n' fourth (second) $ hg log -r8 -C -T '{file_copies_switch % "{name} <- {source}\n"}' fourth <- second $ hg log -r8 -C -T '{file_copies_switch % "{path} <- {source}\n"}' fourth <- second Test file attributes: $ hg log -r10 -T '{files % "{status} {pad(size, 3, left=True)} {path}\n"}' R a A 0 b A 7 fifth R fourth M 13 third Test file status including clean ones: $ hg log -r9 -T '{files("**") % "{status} {path}\n"}' A a C fourth C third Test index keyword: $ hg log -r 10:9 -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 p1/p2 keywords: $ hg log -r4:7 -GT '{rev} p1:{p1} p2:{p2} p1.rev:{p1.rev} p2.node:{p2.node}\n' o 7 p1:-1:000000000000 p2:-1:000000000000 p1.rev:-1 p2.node:0000000000000000000000000000000000000000 o 6 p1:5:13207e5a10d9 p2:4:bbe44766e73d p1.rev:5 p2.node:bbe44766e73d5f11ed2177f1838de10c53ef3e74 |\ | o 5 p1:3:10e46f2dcbf4 p2:-1:000000000000 p1.rev:3 p2.node:0000000000000000000000000000000000000000 | | | ~ o 4 p1:3:10e46f2dcbf4 p2:-1:000000000000 p1.rev:3 p2.node:0000000000000000000000000000000000000000 | ~ TODO: no idea what should be displayed as a JSON representation $ hg log -r6 -T 'p1:{p1|json}\np2:{p2|json}\n' p1:{} p2:{} 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 Tags of working-directory parents (issue6055): $ hg update -q 3 $ echo a > head3 $ hg ci -qAm h3a $ hg merge -q 2 $ hg log -Gr'::wdir()' -T "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n" o 2147483647: at3+2,3 t3+2,3 |\ | @ 12: at3+1,1 t3+1,1 | | | o 3: at3+0,0 t3+0,0 | | @ | 2: t2+0,0 |/ o 1: t1+0,0 | o 0: null+1,1 $ hg ci -m merge $ hg log -Gr'::.' -T "{rev}: {latesttag % '{tag}+{distance},{changes} '}\n" @ 13: at3+2,3 t3+2,3 |\ | o 12: at3+1,1 t3+1,1 | | | o 3: at3+0,0 t3+0,0 | | o | 2: t2+0,0 |/ o 1: t1+0,0 | o 0: null+1,1 $ cd .. Set up repository containing template fragments in commit metadata: $ hg init r $ cd r $ echo a > a $ hg ci -Am '{rev}' adding a $ hg branch -q 'text.{rev}' $ echo aa >> aa $ hg ci -u '{node|short}' -m 'desc to be wrapped desc to be wrapped' Test termwidth: $ 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) Just one more commit: $ echo b > b $ hg ci -qAm b Test 'originalnode' $ hg log -r 1 -T '{revset("null") % "{node|short} {originalnode|short}"}\n' 000000000000 bcc7ff960b8e $ hg log -r 0 -T '{manifest % "{node} {originalnode}"}\n' a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 f7769ec2ab975ad19684098ad1ffd9b81ecc71a1 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 $ 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-5.3.1/tests/test-contrib-relnotes.t0000644015407300116100000003771313627755405021221 0ustar augieeng00000000000000#require test-repo py3exe $ . "$TESTDIR/helpers-testrepo.sh" $ cd $TESTDIR/.. $ python3 contrib/relnotes 4.4 --stoprev 4.5 changeset 3398603c5621: unexpected block in release notes directive feature New Features ============ revert --interactive -------------------- The revert command now accepts the flag --interactive to allow reverting only some of the changes to the specified files. Rebase with different destination per source revision ----------------------------------------------------- Previously, rebase only supports one unique destination. Now "SRC" and "ALLSRC" can be used in rebase destination revset to precisely define destination per each individual source revision. For example, the following command could move some orphaned changesets to reasonable new places so they become no longer orphaned: hg rebase -r 'orphan()-obsolete()' -d 'max((successors(max(roots(ALLSRC) & ::SRC)^)-obsolete())::)' Accessing hidden changesets --------------------------- Set config option 'experimental.directaccess = True' to access hidden changesets from read only commands. githelp extension ----------------- The "githelp" extension provides the "hg githelp" command. This command attempts to convert a "git" command to its Mercurial equivalent. The extension can be useful to Git users new to Mercurial. Other Changes ------------- * When interactive revert is run against a revision other than the working directory parent, the diff shown is the diff to *apply* to the working directory, rather than the diff to *discard* from the working copy. This is in line with related user experiences with 'git' and appears to be less confusing with 'ui.interface=curses'. * Let 'hg rebase' avoid content-divergence by skipping obsolete changesets (and their descendants) when they are present in the rebase set along with one of their successors but none of their successors is in destination. * hgweb now displays phases of non-public changesets * The "HGPLAINEXCEPT" environment variable can now include "color" to allow automatic output colorization in otherwise automated environments. * A new unamend command in uncommit extension which undoes the effect of the amend command by creating a new changeset which was there before amend and moving the changes that were amended to the working directory. * A '--abort' flag to merge command to abort the ongoing merge. * An experimental flag '--rev' to 'hg branch' which can be used to change branch of changesets. Backwards Compatibility Changes =============================== * "log --follow-first -rREV", which is deprecated, now follows the first parent of merge revisions from the specified "REV" just like "log --follow -rREV". * "log --follow -rREV FILE.." now follows file history across copies and renames. Bug Fixes ========= Issue 5165 ---------- Bookmark, whose name is longer than 255, can again be exchanged again between 4.4+ client and servers. Performance Improvements ======================== * bundle2 read I/O throughput significantly increased. * Significant memory use reductions when reading from bundle2 bundles. On the BSD repository, peak RSS during changegroup application decreased by ~185 MB from ~752 MB to ~567 MB. API Changes =========== * bundlerepo.bundlerepository.bundle and bundlerepo.bundlerepository.bundlefile are now prefixed with an underscore. * Rename bundlerepo.bundlerepository.bundlefilespos to _cgfilespos. * dirstate no longer provides a 'dirs()' method. To test for the existence of a directory in the dirstate, use 'dirstate.hasdir(dirname)'. * bundle2 parts are no longer seekable by default. * mapping does not contain all template resources. use context.resource() in template functions. * "text=False|True" option is dropped from the vfs interface because of Python 3 compatibility issue. Use "util.tonativeeol/fromnativeeol()" to convert EOL manually. * wireproto.streamres.__init__ no longer accepts a "reader" argument. Use the "gen" argument instead. * exchange.getbundlechunks() now returns a 2-tuple instead of just an iterator. === commands === * amend: do not drop missing files (Bts:issue5732) * amend: do not take untracked files as modified or clean (Bts:issue5732) * amend: update .hgsubstate before committing a memctx (Bts:issue5677) * annotate: add support to specify hidden revs if directaccess config is set * bookmark: add methods to binary encode and decode bookmark values * bookmark: deprecate direct update of a bookmark value * bookmark: introduce a 'bookmarks' part * bookmark: introduce in advance a variant of the exchange test * bookmark: run 'pushkey' hooks after bookmark move, not 'prepushkey' * bookmark: use the 'bookmarks' bundle2 part to push bookmark update (Bts:issue5165) * bookmarks: add bookmarks to hidden revs if directaccess config is set * bookmarks: calculate visibility exceptions only once * bookmarks: display the obsfate of hidden revision we create a bookmark on * bookmarks: fix pushkey compatibility mode (Bts:issue5777) * bookmarks: use context managers for lock and transaction in update() * bookmarks: use context managers for locks and transaction in pushbookmark() * branch: add a --rev flag to change branch name of given revisions * branch: allow changing branch name to existing name if possible * clone: add support for storing remotenames while cloning * clone: use utility function to write hgrc * clonebundle: make it possible to retrieve the initial bundle through largefile * commands: use the new API to access hidden changesets in various commands * commandserver: restore cwd in case of exception * commandserver: unblock SIGCHLD * fileset: do not crash by unary negate operation * help: deprecate ui.slash in favor of slashpath template filter (Bts:issue5572) * log: allow matchfn to be non-null even if both --patch/--stat are off * log: build follow-log filematcher at once * log: don't expand aliases in revset built from command options * log: follow file history across copies even with -rREV (BC) (Bts:issue4959) * log: make "slowpath" condition slightly more readable * log: make opt2revset table a module constant * log: merge getlogrevs() and getgraphlogrevs() * log: remove temporary variable 'date' used only once * log: resolve --follow thoroughly in getlogrevs() * log: resolve --follow with -rREV in cmdutil.getlogrevs() * log: rewrite --follow-first -rREV like --follow for consistency (BC) * log: simplify 'x or ancestors(x)' expression * log: translate column labels at once (Bts:issue5750) * log: use revsetlang.formatspec() thoroughly * log: use revsetlang.formatspec() to concatenate list expression * log: use smartset.slice() to limit number of revisions to be displayed * merge: cache unknown dir checks (Bts:issue5716) * merge: check created file dirs for path conflicts only once (Bts:issue5716) * patch: add within-line color diff capacity * patch: catch unexpected case in _inlinediff * patch: do not break up multibyte character when highlighting word * patch: improve heuristics to not take the word "diff" as header (Bts:issue1879) * patch: reverse _inlinediff output for consistency * pull: clarify that -u only updates linearly * pull: hold wlock for the full operation when --update is used * pull: retrieve bookmarks through the binary part when possible * pull: store binary node in pullop.remotebookmarks * push: include a 'check:bookmarks' part when possible * push: restrict common discovery to the pushed set * revert: do not reverse hunks in interactive when REV is not parent (Bts:issue5096) * revert: support reverting to hidden cset if directaccess config is set === core === * color: respect HGPLAINEXCEPT=color to allow colors while scripting (Bts:issue5749) * dirstate: add explicit methods for querying directories (API) * dispatch: abort if early boolean options can't be parsed * dispatch: add HGPLAIN=+strictflags to restrict early parsing of global options * dispatch: add option to not strip command args parsed by _earlygetopt() * dispatch: alias --repo to --repository while parsing early options * dispatch: fix early parsing of short option with value like -R=foo * dispatch: handle IOError when writing to stderr * dispatch: stop parsing of early boolean option at "--" * dispatch: verify result of early command parsing * exchange: return bundle info from getbundlechunks() (API) * filelog: add the ability to report the user facing name * localrepo: specify optional callback parameter to pathauditor as a keyword * revlog: choose between ifh and dfh once for all * revlog: don't use slicing to return parents * revlog: group delta computation methods under _deltacomputer object * revlog: group revision info into a dedicated structure * revlog: introduce 'deltainfo' to distinguish from 'delta' * revlog: rename 'rev' to 'base', as it is the base revision * revlog: separate diff computation from the collection of other info * revset: evaluate filesets against each revision for 'file()' (Bts:issue5778) * revset: parse x^:: as (x^):: (Bts:issue5764) * streamclone: add support for bundle2 based stream clone * streamclone: add support for cloning non append-only file * streamclone: also stream caches to the client * streamclone: define first iteration of version 2 of stream format * streamclone: move wire protocol status code from wireproto command * streamclone: rework canperformstreamclone * streamclone: tests phase exchange during stream clone * streamclone: use readexactly when reading stream v2 * templater: fix crash by empty group expression * templater: keep default resources per template engine (API) * templater: look up symbols/resources as if they were separated (Bts:issue5699) * transaction: register summary callbacks only at start of transaction (BC) * util: whitelist NTFS for hardlink creation (Bts:issue4580) * vfs: drop text mode flag (API) * wireproto: drop support for reader interface from streamres (API) === extensions === * convert: restore the ability to use bzr < 2.6.0 (Bts:issue5733) * histedit: add support to output nodechanges using formatter * largefiles: add a 'debuglfput' command to put largefile into the store * largefiles: add support for 'largefiles://' url scheme * largefiles: allow to run 'debugupgraderepo' on repo with largefiles * largefiles: explicitly set the source and sink types to 'hg' for lfconvert * largefiles: modernize how capabilities are added to the wire protocol * largefiles: pay attention to dropped standin files when updating largefiles * rebase: add concludememorynode(), and call it when rebasing in-memory * rebase: add the --inmemory option flag; assign a wctx object for the rebase * rebase: add ui.log calls for whether IMM used, whether rebasing WCP * rebase: disable 'inmemory' if the rebaseset contains the working copy * rebase: do not bail on uncomitted changes if rebasing in-memory * rebase: do not update if IMM; instead, set the overlaywctx's parents * rebase: don't run IMM if running rebase in a transaction * rebase: don't take out a dirstate guard for in-memory rebase * rebase: drop --style option * rebase: enable multidest by default * rebase: exclude descendants of obsoletes w/o a successor in dest (Bts:issue5300) * rebase: fix for hgsubversion * rebase: pass the wctx object (IMM or on-disk) to merge.update * rebase: pass wctx to rebasenode() * rebase: rerun a rebase on-disk if IMM merge conflicts arise * rebase: switch ui.log calls to common style * rebase: use fm.formatlist() and fm.formatdict() to support user template === hgweb === * hgweb: disable diff.noprefix option for diffstat * hgweb: drop support of browsers that don't understand (BC) * hgweb: only include graph-related data in jsdata variable on /graph pages (BC) * hgweb: stop adding strings to innerHTML of #graphnodes and #nodebgs (BC) === unsorted === * archive: add support to specify hidden revs if directaccess config is set * atomicupdate: add an experimental option to use atomictemp when updating * bundle2: don't use seekable bundle2 parts by default (Bts:issue5691) * bundle: allow bundlerepo to support alternative manifest implementations * changelog: introduce a 'tiprev' method * changelog: use 'tiprev()' in 'tip()' * completion: add support for new "amend" command * crecord: fix revert -ir '.^' crash caused by 3649c3f2cd * debugssl: convert port number to int (Bts:issue5757) * diff: disable diff.noprefix option for diffstat (Bts:issue5759) * evolution: make reporting of new unstable changesets optional * extdata: abort if external command exits with non-zero status (BC) * graphlog: add another graph node type, unstable, using character "*" (BC) * hgdemandimport: use correct hyperlink to python-bug in comments (Bts:issue5765) * httppeer: add support for tracing all http request made by the peer * identify: document -r. explicitly how to disable wdir scanning (Bts:issue5622) * lfs: register config options * match: do not weirdly include explicit files excluded by -X option * memfilectx: make changectx argument mandatory in constructor (API) * morestatus: don't crash with different drive letters for repo.root and CWD * outgoing: respect ":pushurl" paths (Bts:issue5365) * remove: print message for each file in verbose mode only while using '-A' (BC) * scmutil: don't try to delete origbackup symlinks to directories (Bts:issue5731) * sshpeer: add support for request tracing * subrepo: add config option to reject any subrepo operations (SEC) * subrepo: disable git and svn subrepos by default (BC) (SEC) * subrepo: disallow symlink traversal across subrepo mount point (SEC) * subrepo: extend config option to disable subrepos by type (SEC) * subrepo: handle 'C:' style paths on the command line (Bts:issue5770) * subrepo: use per-type config options to enable subrepos * svnsubrepo: check if subrepo is missing when checking dirty state (Bts:issue5657) * test-bookmarks-pushpull: stabilize for Windows * test-run-tests: stabilize the test (Bts:issue5735) * tests: show symlink traversal across subrepo mount point (SEC) * tr-summary: keep a weakref to the unfiltered repository * unamend: fix command summary line * uncommit: unify functions _uncommitdirstate and _unamenddirstate to one * update: fix crash on bare update when directaccess is enabled * update: support updating to hidden cset if directaccess config is set === Behavior Changes === * extdata: abort if external command exits with non-zero status (BC) * graphlog: add another graph node type, unstable, using character "*" (BC) * hgweb: drop support of browsers that don't understand (BC) * hgweb: only include graph-related data in jsdata variable on /graph pages (BC) * hgweb: stop adding strings to innerHTML of #graphnodes and #nodebgs (BC) * log: follow file history across copies even with -rREV (BC) (Bts:issue4959) * log: rewrite --follow-first -rREV like --follow for consistency (BC) * remove: print message for each file in verbose mode only while using '-A' (BC) * subrepo: disable git and svn subrepos by default (BC) (SEC) * transaction: register summary callbacks only at start of transaction (BC) === Internal API Changes === * dirstate: add explicit methods for querying directories (API) * exchange: return bundle info from getbundlechunks() (API) * memfilectx: make changectx argument mandatory in constructor (API) * templater: keep default resources per template engine (API) * vfs: drop text mode flag (API) * wireproto: drop support for reader interface from streamres (API) mercurial-5.3.1/tests/test-remove.t0000644015407300116100000004416713627755405017226 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] test dry-run for remove $ hg init testdryrun $ cd testdryrun $ echo a>a $ hg ci -qAm1 $ hg remove a -nv \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 a $ hg remove a -nv --color debug \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) [ui.addremove.removed ui.status|removing a] $ hg diff $ cat >> .hg/hgrc < [extensions] > largefiles= > EOF $ echo 'B as largefile' > B $ hg add --large B $ hg ci -m "B" $ hg remove B -nv removing B $ hg st $ cd .. mercurial-5.3.1/tests/filterpyflakes.py0000755015407300116100000000157313627755405020162 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-5.3.1/tests/test-largefiles-misc.t0000644015407300116100000010225313627755405020766 0ustar augieeng00000000000000This file contains testcases that tend to be related to special cases or less common commands affecting largefile. $ hg init requirements $ cd requirements # largefiles not loaded by default. $ hg config extensions [1] # Adding largefiles to requires file will auto-load largefiles extension. $ echo largefiles >> .hg/requires $ hg config extensions extensions.largefiles= # But only if there is no config entry for the extension already. $ cat > .hg/hgrc << EOF > [extensions] > largefiles=! > EOF $ hg config extensions abort: repository requires features unknown to this Mercurial: largefiles! (see https://mercurial-scm.org/wiki/MissingRequirement for more information) [255] $ cat > .hg/hgrc << EOF > [extensions] > largefiles= > EOF $ hg config extensions extensions.largefiles= $ cat > .hg/hgrc << EOF > [extensions] > largefiles = missing.py > EOF $ hg config extensions \*\*\* failed to import extension largefiles from missing.py: [Errno *] $ENOENT$: 'missing.py' (glob) abort: repository requires features unknown to this Mercurial: largefiles! (see https://mercurial-scm.org/wiki/MissingRequirement for more information) [255] $ cd .. 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 (1 drafts) 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 $ grep largefiles ../shared_lfrepo/.hg/requires 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 ../.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 you can keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a. what do you want to do? 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 forgetting .hglf/dir/subdir2/large.bin undeleting .hglf/dir/subdir/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 forgetting .hglf/dir2/subdir/large.bin undeleting .hglf/dir/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 (1 drafts) nothing to rebase - updating instead 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd .. mercurial-5.3.1/tests/test-hg-parseurl.py0000644015407300116100000000306413627755405020336 0ustar augieeng00000000000000from __future__ import absolute_import, print_function import unittest from mercurial import hg class ParseRequestTests(unittest.TestCase): def testparse(self): self.assertEqual( hg.parseurl(b'http://example.com/no/anchor'), (b'http://example.com/no/anchor', (None, [])), ) self.assertEqual( hg.parseurl(b'http://example.com/an/anchor#foo'), (b'http://example.com/an/anchor', (b'foo', [])), ) self.assertEqual( hg.parseurl(b'http://example.com/no/anchor/branches', [b'foo']), (b'http://example.com/no/anchor/branches', (None, [b'foo'])), ) self.assertEqual( hg.parseurl(b'http://example.com/an/anchor/branches#bar', [b'foo']), (b'http://example.com/an/anchor/branches', (b'bar', [b'foo'])), ) self.assertEqual( hg.parseurl( b'http://example.com/an/anchor/branches-None#foo', None ), (b'http://example.com/an/anchor/branches-None', (b'foo', [])), ) self.assertEqual( hg.parseurl(b'http://example.com/'), (b'http://example.com/', (None, [])), ) self.assertEqual( hg.parseurl(b'http://example.com'), (b'http://example.com/', (None, [])), ) self.assertEqual( hg.parseurl(b'http://example.com#foo'), (b'http://example.com/', (b'foo', [])), ) if __name__ == '__main__': import silenttestrunner silenttestrunner.main(__name__) mercurial-5.3.1/tests/test-hgweb-csp.t0000644015407300116100000001136513627755405017602 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' $ get-with-headers.py --twice --headeronly localhost:$HGPORT repo1/static/style.css content-security-policy 200 Script output follows content-security-policy: script-src https://example.com/ 'unsafe-inline' 304 Not Modified 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| $TESTTMP/server: error

    error

    An error occurred while processing your request:

    no such method: api

    [1] $ get-with-headers.py $LOCALIP:$HGPORT api/ 400 no such method: api $TESTTMP/server: error

    error

    An error occurred while processing your request:

    no such method: api

    [1] Restart server with support for API server $ killdaemons.py $ cat > server/.hg/hgrc << EOF > [experimental] > web.apiserver = true > EOF $ hg -R server serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS /api lists available APIs (empty since none are available by default) $ send << EOF > httprequest GET api > user-agent: test > EOF using raw connection to peer s> setsockopt(6, 1, 1) -> None (?) s> GET /api HTTP/1.1\r\n s> Accept-Encoding: identity\r\n s> user-agent: test\r\n s> host: $LOCALIP:$HGPORT\r\n (glob) s> \r\n s> makefile('rb', None) s> HTTP/1.1 200 OK\r\n s> Server: testing stub value\r\n s> Date: $HTTP_DATE$\r\n s> Content-Type: text/plain\r\n s> Content-Length: 100\r\n s> \r\n s> APIs can be accessed at /api/, where can be one of the following:\n s> \n s> (no available APIs)\n $ send << EOF > httprequest GET api/ > user-agent: test > EOF using raw connection to peer s> setsockopt(6, 1, 1) -> None (?) s> GET /api/ HTTP/1.1\r\n s> Accept-Encoding: identity\r\n s> user-agent: test\r\n s> host: $LOCALIP:$HGPORT\r\n (glob) s> \r\n s> makefile('rb', None) s> HTTP/1.1 200 OK\r\n s> Server: testing stub value\r\n s> Date: $HTTP_DATE$\r\n s> Content-Type: text/plain\r\n s> Content-Length: 100\r\n s> \r\n s> APIs can be accessed at /api/, where can be one of the following:\n s> \n s> (no available APIs)\n Accessing an unknown API yields a 404 $ send << EOF > httprequest GET api/unknown > user-agent: test > EOF using raw connection to peer s> setsockopt(6, 1, 1) -> None (?) s> GET /api/unknown HTTP/1.1\r\n s> Accept-Encoding: identity\r\n s> user-agent: test\r\n s> host: $LOCALIP:$HGPORT\r\n (glob) s> \r\n s> makefile('rb', None) s> HTTP/1.1 404 Not Found\r\n s> Server: testing stub value\r\n s> Date: $HTTP_DATE$\r\n s> Content-Type: text/plain\r\n s> Content-Length: 33\r\n s> \r\n s> Unknown API: unknown\n s> Known APIs: Accessing a known but not enabled API yields a different error $ send << EOF > httprequest GET api/exp-http-v2-0003 > user-agent: test > EOF using raw connection to peer s> setsockopt(6, 1, 1) -> None (?) s> GET /api/exp-http-v2-0003 HTTP/1.1\r\n s> Accept-Encoding: identity\r\n s> user-agent: test\r\n s> host: $LOCALIP:$HGPORT\r\n (glob) s> \r\n s> makefile('rb', None) s> HTTP/1.1 404 Not Found\r\n s> Server: testing stub value\r\n s> Date: $HTTP_DATE$\r\n s> Content-Type: text/plain\r\n s> Content-Length: 33\r\n s> \r\n s> API exp-http-v2-0003 not enabled\n Restart server with support for HTTP v2 API $ killdaemons.py $ cat > server/.hg/hgrc << EOF > [experimental] > web.apiserver = true > web.api.http-v2 = true > EOF $ hg -R server serve -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS /api lists the HTTP v2 protocol as available $ send << EOF > httprequest GET api > user-agent: test > EOF using raw connection to peer s> setsockopt(6, 1, 1) -> None (?) s> GET /api HTTP/1.1\r\n s> Accept-Encoding: identity\r\n s> user-agent: test\r\n s> host: $LOCALIP:$HGPORT\r\n (glob) s> \r\n s> makefile('rb', None) s> HTTP/1.1 200 OK\r\n s> Server: testing stub value\r\n s> Date: $HTTP_DATE$\r\n s> Content-Type: text/plain\r\n s> Content-Length: 96\r\n s> \r\n s> APIs can be accessed at /api/, where can be one of the following:\n s> \n s> exp-http-v2-0003 $ send << EOF > httprequest GET api/ > user-agent: test > EOF using raw connection to peer s> setsockopt(6, 1, 1) -> None (?) s> GET /api/ HTTP/1.1\r\n s> Accept-Encoding: identity\r\n s> user-agent: test\r\n s> host: $LOCALIP:$HGPORT\r\n (glob) s> \r\n s> makefile('rb', None) s> HTTP/1.1 200 OK\r\n s> Server: testing stub value\r\n s> Date: $HTTP_DATE$\r\n s> Content-Type: text/plain\r\n s> Content-Length: 96\r\n s> \r\n s> APIs can be accessed at /api/, where can be one of the following:\n s> \n s> exp-http-v2-0003 mercurial-5.3.1/tests/test-gendoc-zh_CN.t0000644015407300116100000000012713627755405020153 0ustar augieeng00000000000000#require docutils gettext $ $TESTDIR/check-gendoc zh_CN checking for parse errors mercurial-5.3.1/tests/test-rebase-named-branches.t0000644015407300116100000002232313627755405022025 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 (8 drafts) (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 .. $ hg clone -q -u . a a1 $ cd a1 $ hg update 3 3 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg branch dev-one marked working directory as branch dev-one (branches are permanent and global, did you want a bookmark?) $ hg ci -m 'dev-one named branch' $ hg update 7 2 files updated, 0 files merged, 3 files removed, 0 files unresolved $ hg branch dev-two marked working directory as branch dev-two $ echo x > x $ hg add x $ hg ci -m 'dev-two named branch' $ hg tglog @ 9: cb039b7cae8e 'dev-two named branch' dev-two | | o 8: 643fc9128048 'dev-one named branch' dev-one | | 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' Branch name containing a dash (issue3181) $ hg rebase -b dev-two -d dev-one --keepbranches rebasing 5:24b6387c8c8c "F" rebasing 6:eea13746799a "G" rebasing 7:02de42196ebe "H" rebasing 9:cb039b7cae8e "dev-two named branch" (tip) saved backup bundle to $TESTTMP/a1/.hg/strip-backup/24b6387c8c8c-24cb8001-rebase.hg $ hg tglog @ 9: 9e70cd31750f 'dev-two named branch' dev-two | o 8: 31d0e4ba75e6 'H' | | o 7: 4b988a958030 'G' |/| o | 6: 24de4aff8e28 'F' | | o | 5: 643fc9128048 'dev-one named branch' dev-one | | | o 4: 9520eea781bc 'E' | | o | 3: 32af7686d403 'D' | | o | 2: 5fddd98957c8 'C' | | o | 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' $ hg rebase -s dev-one -d 0 --keepbranches rebasing 5:643fc9128048 "dev-one named branch" rebasing 6:24de4aff8e28 "F" rebasing 7:4b988a958030 "G" rebasing 8:31d0e4ba75e6 "H" rebasing 9:9e70cd31750f "dev-two named branch" (tip) saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-c4ee9ef5-rebase.hg $ hg tglog @ 9: 59c2e59309fe 'dev-two named branch' dev-two | o 8: 904590360559 'H' | | o 7: 1a1e6f72ec38 'G' |/| o | 6: 42aa3cf0fa7a 'F' | | o | 5: bc8139ee757c 'dev-one named branch' dev-one | | | o 4: 9520eea781bc 'E' |/ | o 3: 32af7686d403 'D' | | | o 2: 5fddd98957c8 'C' | | | o 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' $ hg update 3 3 files updated, 0 files merged, 3 files removed, 0 files unresolved $ hg branch -f dev-one marked working directory as branch dev-one $ hg ci -m 'dev-one named branch' created new head $ hg tglog @ 10: 643fc9128048 'dev-one named branch' dev-one | | o 9: 59c2e59309fe 'dev-two named branch' dev-two | | | o 8: 904590360559 'H' | | | | o 7: 1a1e6f72ec38 'G' | |/| | o | 6: 42aa3cf0fa7a 'F' | | | | o | 5: bc8139ee757c 'dev-one named branch' dev-one | | | | | o 4: 9520eea781bc 'E' | |/ o | 3: 32af7686d403 'D' | | o | 2: 5fddd98957c8 'C' | | o | 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' $ hg rebase -b 'max(branch("dev-two"))' -d dev-one --keepbranches rebasing 5:bc8139ee757c "dev-one named branch" note: not rebasing 5:bc8139ee757c "dev-one named branch", its destination already has all its changes rebasing 6:42aa3cf0fa7a "F" rebasing 7:1a1e6f72ec38 "G" rebasing 8:904590360559 "H" rebasing 9:59c2e59309fe "dev-two named branch" saved backup bundle to $TESTTMP/a1/.hg/strip-backup/bc8139ee757c-f11c1080-rebase.hg $ hg tglog o 9: 71325f8bc082 'dev-two named branch' dev-two | o 8: 12b2bc666e20 'H' | | o 7: 549f007a9f5f 'G' |/| o | 6: 679f28760620 'F' | | @ | 5: 643fc9128048 'dev-one named branch' dev-one | | | o 4: 9520eea781bc 'E' | | o | 3: 32af7686d403 'D' | | o | 2: 5fddd98957c8 'C' | | o | 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' $ hg rebase -s 'max(branch("dev-one"))' -d 0 --keepbranches rebasing 5:643fc9128048 "dev-one named branch" rebasing 6:679f28760620 "F" rebasing 7:549f007a9f5f "G" rebasing 8:12b2bc666e20 "H" rebasing 9:71325f8bc082 "dev-two named branch" (tip) saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-6cdd1a52-rebase.hg $ hg tglog o 9: 3944801ae4ea 'dev-two named branch' dev-two | o 8: 8e279d293175 'H' | | o 7: aeefee77ab01 'G' |/| o | 6: e908b85f3729 'F' | | @ | 5: bc8139ee757c 'dev-one named branch' dev-one | | | o 4: 9520eea781bc 'E' |/ | o 3: 32af7686d403 'D' | | | o 2: 5fddd98957c8 'C' | | | o 1: 42ccdea3bb16 'B' |/ o 0: cd010b8cd998 'A' $ hg up -r 0 > /dev/null Rebasing descendant onto ancestor across different named branches $ hg rebase -s 1 -d 9 --keepbranches 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 o 9: e9f862ce8bad 'D' | o 8: a0d543090fa4 'C' | o 7: 3bdb949809d9 'B' | o 6: 3944801ae4ea 'dev-two named branch' dev-two | o 5: 8e279d293175 'H' | | o 4: aeefee77ab01 'G' |/| o | 3: e908b85f3729 'F' | | o | 2: bc8139ee757c 'dev-one named branch' dev-one | | | o 1: 9520eea781bc 'E' |/ @ 0: cd010b8cd998 'A' $ hg rebase -s 5 -d 6 abort: source and destination form a cycle [255] $ hg rebase -s 6 -d 5 rebasing 6:3944801ae4ea "dev-two named branch" rebasing 7:3bdb949809d9 "B" rebasing 8:a0d543090fa4 "C" rebasing 9:e9f862ce8bad "D" (tip) saved backup bundle to $TESTTMP/a1/.hg/strip-backup/3944801ae4ea-fb46ed74-rebase.hg $ hg tglog o 9: e522577ccdbd 'D' | o 8: 810110211f50 'C' | o 7: 160b0930ccc6 'B' | o 6: c57724c84928 'dev-two named branch' | o 5: 8e279d293175 'H' | | o 4: aeefee77ab01 'G' |/| o | 3: e908b85f3729 'F' | | o | 2: bc8139ee757c 'dev-one named branch' dev-one | | | o 1: 9520eea781bc 'E' |/ @ 0: cd010b8cd998 'A' Reopen branch by rebase $ hg up -qr3 $ hg branch -q b $ hg ci -m 'create b' $ hg ci -m 'close b' --close $ hg rebase -b 8 -d b reopening closed branch head 2b586e70108d rebasing 5:8e279d293175 "H" rebasing 6:c57724c84928 "dev-two named branch" rebasing 7:160b0930ccc6 "B" rebasing 8:810110211f50 "C" rebasing 9:e522577ccdbd "D" saved backup bundle to $TESTTMP/a1/.hg/strip-backup/8e279d293175-b023e27c-rebase.hg $ cd .. Rebase to other head on branch Set up a case: $ hg init case1 $ cd case1 $ touch f $ hg ci -qAm0 $ hg branch -q b $ echo >> f $ hg ci -qAm 'b1' $ hg up -qr -2 $ hg branch -qf b $ hg ci -qm 'b2' $ hg up -qr -3 $ hg branch -q c $ hg ci -m 'c1' $ hg tglog @ 3: c062e3ecd6c6 'c1' c | | o 2: 792845bb77ee 'b2' b |/ | o 1: 40039acb7ca5 'b1' b |/ o 0: d681519c3ea7 '0' $ hg clone -q . ../case2 rebase 'b2' to another lower branch head $ hg up -qr 2 $ hg rebase rebasing 2:792845bb77ee "b2" note: not rebasing 2:792845bb77ee "b2", its destination already has all its changes saved backup bundle to $TESTTMP/case1/.hg/strip-backup/792845bb77ee-627120ee-rebase.hg $ hg tglog o 2: c062e3ecd6c6 'c1' c | | @ 1: 40039acb7ca5 'b1' b |/ o 0: d681519c3ea7 '0' rebase 'b1' on top of the tip of the branch ('b2') - ignoring the tip branch ('c1') $ cd ../case2 $ hg up -qr 1 $ hg rebase rebasing 1:40039acb7ca5 "b1" saved backup bundle to $TESTTMP/case2/.hg/strip-backup/40039acb7ca5-342b72d1-rebase.hg $ hg tglog @ 3: 76abc1c6f8c7 'b1' b | | o 2: c062e3ecd6c6 'c1' c | | o | 1: 792845bb77ee 'b2' b |/ o 0: d681519c3ea7 '0' rebase 'c1' to the branch head 'c2' that is closed $ hg branch -qf c $ hg ci -qm 'c2 closed' --close $ hg up -qr 2 $ hg tglog _ 4: 8427af5d86f2 'c2 closed' c | o 3: 76abc1c6f8c7 'b1' b | | @ 2: c062e3ecd6c6 'c1' c | | o | 1: 792845bb77ee 'b2' b |/ o 0: d681519c3ea7 '0' $ hg rebase abort: branch 'c' has one head - please rebase to an explicit rev (run 'hg heads' to see all heads, specify destination with -d) [255] $ hg tglog _ 4: 8427af5d86f2 'c2 closed' c | o 3: 76abc1c6f8c7 'b1' b | | @ 2: c062e3ecd6c6 'c1' c | | o | 1: 792845bb77ee 'b2' b |/ o 0: d681519c3ea7 '0' $ hg up -cr 1 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg branch x marked working directory as branch x $ hg rebase -r 3:: -d . rebasing 3:76abc1c6f8c7 "b1" rebasing 4:8427af5d86f2 "c2 closed" (tip) note: not rebasing 4:8427af5d86f2 "c2 closed" (tip), its destination already has all its changes saved backup bundle to $TESTTMP/case2/.hg/strip-backup/76abc1c6f8c7-cd698d13-rebase.hg $ hg tglog o 3: 117b0ed08075 'b1' x | | o 2: c062e3ecd6c6 'c1' c | | @ | 1: 792845bb77ee 'b2' b |/ o 0: d681519c3ea7 '0' $ cd .. mercurial-5.3.1/tests/test-subrepo.t0000644015407300116100000015047613627755405017411 0ustar augieeng00000000000000Let commit recurse into subrepos by default to match pre-2.0 behavior: $ echo "[ui]" >> $HGRCPATH $ echo "commitsubrepos = Yes" >> $HGRCPATH $ hg init t $ cd t first revision, no sub $ echo a > a $ hg ci -Am0 adding a add first sub $ echo s = s > .hgsub $ hg add .hgsub $ hg init s $ echo a > s/a Issue2232: committing a subrepo without .hgsub $ hg ci -mbad s abort: can't commit subrepos without .hgsub [255] $ hg -R s add s/a $ hg files -S .hgsub a s/a `hg files` respects ui.relative-paths BROKEN: shows subrepo paths relative to the subrepo $ hg files -S --config ui.relative-paths=no .hgsub a s/a $ hg -R s ci -Ams0 $ hg sum parent: 0:f7b1eb17ad24 tip 0 branch: default commit: 1 added, 1 subrepos update: (current) phases: 1 draft $ hg ci -m1 test handling .hgsubstate "added" explicitly. $ hg parents --template '{node}\n{files}\n' 7cf8cfea66e410e8e3336508dfeec07b3192de51 .hgsub .hgsubstate $ hg rollback -q $ hg add .hgsubstate $ hg ci -m1 $ hg parents --template '{node}\n{files}\n' 7cf8cfea66e410e8e3336508dfeec07b3192de51 .hgsub .hgsubstate Subrepopath which overlaps with filepath, does not change warnings in remove() $ mkdir snot $ touch snot/file $ hg remove -S snot/file not removing snot/file: file is untracked [1] $ hg cat snot/filenot snot/filenot: no such file in rev 7cf8cfea66e4 [1] $ rm -r snot Revert subrepo and test subrepo fileset keyword: $ echo b > s/a $ hg revert --dry-run "set:subrepo('glob:s*')" reverting subrepo s reverting s/a $ cat s/a b $ hg revert "set:subrepo('glob:s*')" reverting subrepo s reverting s/a $ cat s/a a $ rm s/a.orig Revert subrepo with no backup. The "reverting s/a" line is gone since we're really running 'hg update' in the subrepo: $ echo b > s/a $ hg revert --no-backup s reverting subrepo s Issue2022: update -C $ echo b > s/a $ hg sum parent: 1:7cf8cfea66e4 tip 1 branch: default commit: 1 subrepos update: (current) phases: 2 draft $ hg co -C 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg sum parent: 1:7cf8cfea66e4 tip 1 branch: default commit: (clean) update: (current) phases: 2 draft commands that require a clean repo should respect subrepos $ echo b >> s/a $ hg backout tip abort: uncommitted changes in subrepository "s" [255] $ hg revert -C -R s s/a add sub sub $ echo ss = ss > s/.hgsub $ hg init s/ss $ echo a > s/ss/a $ hg -R s add s/.hgsub $ hg -R s/ss add s/ss/a $ hg sum parent: 1:7cf8cfea66e4 tip 1 branch: default commit: 1 subrepos update: (current) phases: 2 draft $ hg ci -m2 committing subrepository s committing subrepository s/ss $ hg sum parent: 2:df30734270ae tip 2 branch: default commit: (clean) update: (current) phases: 3 draft test handling .hgsubstate "modified" explicitly. $ hg parents --template '{node}\n{files}\n' df30734270ae757feb35e643b7018e818e78a9aa .hgsubstate $ hg rollback -q $ hg status -A .hgsubstate M .hgsubstate $ hg ci -m2 $ hg parents --template '{node}\n{files}\n' df30734270ae757feb35e643b7018e818e78a9aa .hgsubstate bump sub rev (and check it is ignored by ui.commitsubrepos) $ echo b > s/a $ hg -R s ci -ms1 $ hg --config ui.commitsubrepos=no ci -m3 leave sub dirty (and check ui.commitsubrepos=no aborts the commit) $ echo c > s/a $ hg --config ui.commitsubrepos=no ci -m4 abort: uncommitted changes in subrepository "s" (use --subrepos for recursive commit) [255] $ hg id f6affe3fbfaa+ tip $ hg -R s ci -mc $ hg id f6affe3fbfaa+ tip $ echo d > s/a $ hg ci -m4 committing subrepository s $ hg tip -R s changeset: 4:02dcf1d70411 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 4 check caching $ hg co 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg debugsub restore $ hg co 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg debugsub path s source s revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef new branch for merge tests $ hg co 1 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo t = t >> .hgsub $ hg init t $ echo t > t/t $ hg -R t add t adding t/t 5 $ hg ci -m5 # add sub committing subrepository t created new head $ echo t2 > t/t 6 $ hg st -R s $ hg ci -m6 # change sub committing subrepository t $ hg debugsub path s source s revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 path t source t revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad $ echo t3 > t/t 7 $ hg ci -m7 # change sub again for conflict test committing subrepository t $ hg rm .hgsub 8 $ hg ci -m8 # remove sub test handling .hgsubstate "removed" explicitly. $ hg parents --template '{node}\n{files}\n' 96615c1dad2dc8e3796d7332c77ce69156f7b78e .hgsub .hgsubstate $ hg rollback -q $ hg remove .hgsubstate $ hg ci -m8 $ hg parents --template '{node}\n{files}\n' 96615c1dad2dc8e3796d7332c77ce69156f7b78e .hgsub .hgsubstate merge tests $ hg co -C 3 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge 5 # test adding 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg debugsub path s source s revision fc627a69481fcbe5f1135069e8a3881c023e4cf5 path t source t revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382 $ hg ci -m9 created new head $ hg merge 6 --debug # test change resolving manifests branchmerge: True, force: False, partial: False ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4 starting 4 threads for background file closing (?) .hgsubstate: versions differ -> m (premerge) subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg getting subrepo t resolving manifests branchmerge: False, force: False, partial: False ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a t: remote is newer -> g getting t 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg debugsub path s source s revision fc627a69481fcbe5f1135069e8a3881c023e4cf5 path t source t revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad $ echo conflict > t/t $ hg ci -m10 committing subrepository t $ HGMERGE=internal:merge hg merge --debug 7 # test conflict resolving manifests branchmerge: True, force: False, partial: False ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf starting 4 threads for background file closing (?) .hgsubstate: versions differ -> m (premerge) subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4 subrepo t: both sides changed subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198) starting 4 threads for background file closing (?) you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]. what do you want to do? m merging subrepository "t" resolving manifests branchmerge: True, force: False, partial: False ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198 preserving t for resolve of t starting 4 threads for background file closing (?) t: versions differ -> m (premerge) picked tool ':merge' for t (binary False symlink False changedelete False) merging t my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a t: versions differ -> m (merge) picked tool ':merge' for t (binary False symlink False changedelete False) my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a warning: conflicts while merging t! (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 subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) should conflict $ cat t/t <<<<<<< local: 20a0db6fbf6c - test: 10 conflict ======= t3 >>>>>>> other: 7af322bc1198 - test: 7 11: remove subrepo t $ hg co -C 5 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg revert -r 4 .hgsub # remove t $ hg ci -m11 created new head $ hg debugsub path s source s revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 local removed, remote changed, keep changed $ hg merge 6 remote [merge rev] changed subrepository t which local [working copy] removed use (c)hanged version or (d)elete? c 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) BROKEN: should include subrepo t $ hg debugsub path s source s revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 $ cat .hgsubstate e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s 6747d179aa9a688023c4b0cad32e4c92bb7f34ad t $ hg ci -m 'local removed, remote changed, keep changed' BROKEN: should include subrepo t $ hg debugsub path s source s revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 BROKEN: should include subrepo t $ cat .hgsubstate e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s $ cat t/t t2 local removed, remote changed, keep removed $ hg co -C 11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge --config ui.interactive=true 6 < d > EOF remote [merge rev] changed subrepository t which local [working copy] removed use (c)hanged version or (d)elete? d 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg debugsub path s source s revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 $ cat .hgsubstate e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s $ hg ci -m 'local removed, remote changed, keep removed' created new head $ hg debugsub path s source s revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 $ cat .hgsubstate e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s local changed, remote removed, keep changed $ hg co -C 6 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge 11 local [working copy] changed subrepository t which remote [merge rev] removed use (c)hanged version or (d)elete? c 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) BROKEN: should include subrepo t $ hg debugsub path s source s revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 BROKEN: should include subrepo t $ cat .hgsubstate e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s $ hg ci -m 'local changed, remote removed, keep changed' created new head BROKEN: should include subrepo t $ hg debugsub path s source s revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 BROKEN: should include subrepo t $ cat .hgsubstate e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s $ cat t/t t2 local changed, remote removed, keep removed $ hg co -C 6 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge --config ui.interactive=true 11 < d > EOF local [working copy] changed subrepository t which remote [merge rev] removed use (c)hanged version or (d)elete? d 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg debugsub path s source s revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 $ cat .hgsubstate e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s $ hg ci -m 'local changed, remote removed, keep removed' created new head $ hg debugsub path s source s revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 $ cat .hgsubstate e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s clean up to avoid having to fix up the tests below $ hg co -C 10 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat >> $HGRCPATH < [extensions] > strip= > EOF $ hg strip -r 11:15 saved backup bundle to $TESTTMP/t/.hg/strip-backup/*-backup.hg (glob) clone $ cd .. $ hg clone t tc updating to branch default cloning subrepo s from $TESTTMP/t/s cloning subrepo s/ss from $TESTTMP/t/s/ss cloning subrepo t from $TESTTMP/t/t 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd tc $ hg debugsub path s source s revision fc627a69481fcbe5f1135069e8a3881c023e4cf5 path t source t revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e $ 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 And again with just the hg type disabled $ hg clone t -U tc4 --config subrepos.hg:allowed=false $ hg update -R tc4 --config subrepos.hg:allowed=false abort: hg subrepos not allowed (see 'hg help config.subrepos' for details) [255] $ ls tc4 a $ hg clone t tc5 --config subrepos.hg:allowed=false updating to branch default abort: hg subrepos not allowed (see 'hg help config.subrepos' for details) [255] $ ls tc5 a push $ cd tc $ echo bah > t/t $ hg ci -m11 committing subrepository t $ hg push pushing to $TESTTMP/t no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss no changes made to subrepo s since last push to $TESTTMP/t/s pushing subrepo t to $TESTTMP/t/t searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files push -f $ echo bah > s/a $ hg ci -m12 committing subrepository s $ hg push pushing to $TESTTMP/t no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss pushing subrepo s to $TESTTMP/t/s searching for changes abort: push creates new remote head 12a213df6fa9! (in subrepository "s") (merge or see 'hg help push' for details about pushing new heads) [255] $ hg push -f pushing to $TESTTMP/t pushing subrepo s/ss to $TESTTMP/t/s/ss searching for changes no changes found pushing subrepo s to $TESTTMP/t/s searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) pushing subrepo t to $TESTTMP/t/t searching for changes no changes found searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files check that unmodified subrepos are not pushed $ hg clone . ../tcc updating to branch default cloning subrepo s from $TESTTMP/tc/s cloning subrepo s/ss from $TESTTMP/tc/s/ss cloning subrepo t from $TESTTMP/tc/t 3 files updated, 0 files merged, 0 files removed, 0 files unresolved the subrepos on the new clone have nothing to push to its source $ hg push -R ../tcc . pushing to . no changes made to subrepo s/ss since last push to s/ss no changes made to subrepo s since last push to s no changes made to subrepo t since last push to t searching for changes no changes found [1] the subrepos on the source do not have a clean store versus the clone target because they were never explicitly pushed to the source $ hg push ../tcc pushing to ../tcc pushing subrepo s/ss to ../tcc/s/ss searching for changes no changes found pushing subrepo s to ../tcc/s searching for changes no changes found pushing subrepo t to ../tcc/t searching for changes no changes found searching for changes no changes found [1] after push their stores become clean $ hg push ../tcc pushing to ../tcc no changes made to subrepo s/ss since last push to ../tcc/s/ss no changes made to subrepo s since last push to ../tcc/s no changes made to subrepo t since last push to ../tcc/t searching for changes no changes found [1] updating a subrepo to a different revision or changing its working directory does not make its store dirty $ hg -R s update '.^' 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg push pushing to $TESTTMP/t no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss no changes made to subrepo s since last push to $TESTTMP/t/s no changes made to subrepo t since last push to $TESTTMP/t/t searching for changes no changes found [1] $ echo foo >> s/a $ hg push pushing to $TESTTMP/t no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss no changes made to subrepo s since last push to $TESTTMP/t/s no changes made to subrepo t since last push to $TESTTMP/t/t searching for changes no changes found [1] $ hg -R s update -C tip 1 files updated, 0 files merged, 0 files removed, 0 files unresolved committing into a subrepo makes its store (but not its parent's store) dirty $ echo foo >> s/ss/a $ hg -R s/ss commit -m 'test dirty store detection' $ hg out -S -r `hg log -r tip -T "{node|short}"` comparing with $TESTTMP/t searching for changes no changes found comparing with $TESTTMP/t/s searching for changes no changes found comparing with $TESTTMP/t/s/ss searching for changes changeset: 1:79ea5566a333 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: test dirty store detection comparing with $TESTTMP/t/t searching for changes no changes found $ hg push pushing to $TESTTMP/t pushing subrepo s/ss to $TESTTMP/t/s/ss searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files no changes made to subrepo s since last push to $TESTTMP/t/s no changes made to subrepo t since last push to $TESTTMP/t/t searching for changes no changes found [1] a subrepo store may be clean versus one repo but not versus another $ hg push pushing to $TESTTMP/t no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss no changes made to subrepo s since last push to $TESTTMP/t/s no changes made to subrepo t since last push to $TESTTMP/t/t searching for changes no changes found [1] $ hg push ../tcc pushing to ../tcc pushing subrepo s/ss to ../tcc/s/ss searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files no changes made to subrepo s since last push to ../tcc/s no changes made to subrepo t since last push to ../tcc/t searching for changes no changes found [1] update $ cd ../t $ hg up -C # discard our earlier merge 1 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to "c373c8102e68: 12" 2 other heads for branch "default" $ echo blah > t/t $ hg ci -m13 committing subrepository t backout calls revert internally with minimal opts, which should not raise KeyError $ hg backout ".^" --no-commit 0 files updated, 0 files merged, 0 files removed, 0 files unresolved changeset c373c8102e68 backed out, don't forget to commit. $ hg up -C # discard changes 1 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to "925c17564ef8: 13" 2 other heads for branch "default" pull $ cd ../tc $ 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 new changesets 925c17564ef8 (run 'hg update' to get a working copy) should pull t $ hg incoming -S -r `hg log -r tip -T "{node|short}"` comparing with $TESTTMP/t no changes found comparing with $TESTTMP/t/s searching for changes no changes found comparing with $TESTTMP/t/s/ss searching for changes no changes found comparing with $TESTTMP/t/t searching for changes changeset: 5:52c0adc0515a tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: 13 $ hg up pulling subrepo t from $TESTTMP/t/t searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 52c0adc0515a 0 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to "925c17564ef8: 13" 2 other heads for branch "default" $ cat t/t blah bogus subrepo path aborts $ echo 'bogus=[boguspath' >> .hgsub $ hg ci -m 'bogus subrepo path' abort: missing ] in subrepository source [255] Issue1986: merge aborts when trying to merge a subrepo that shouldn't need merging # subrepo layout # # o 5 br # /| # o | 4 default # | | # | o 3 br # |/| # o | 2 default # | | # | o 1 br # |/ # o 0 default $ cd .. $ rm -rf sub $ hg init main $ cd main $ hg init s $ cd s $ echo a > a $ hg ci -Am1 adding a $ hg branch br marked working directory as branch br (branches are permanent and global, did you want a bookmark?) $ echo a >> a $ hg ci -m1 $ hg up default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo b > b $ hg ci -Am1 adding b $ hg up br 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg merge tip 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m1 $ hg up 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo c > c $ hg ci -Am1 adding c $ hg up 3 1 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 -m1 # main repo layout: # # * <-- try to merge default into br again # .`| # . o 5 br --> substate = 5 # . | # o | 4 default --> substate = 4 # | | # | o 3 br --> substate = 2 # |/| # o | 2 default --> substate = 2 # | | # | o 1 br --> substate = 3 # |/ # o 0 default --> substate = 2 $ cd .. $ echo 's = s' > .hgsub $ hg -R s up 2 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg ci -Am1 adding .hgsub $ hg branch br marked working directory as branch br (branches are permanent and global, did you want a bookmark?) $ echo b > b $ hg -R s up 3 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg ci -Am1 adding b $ hg up default 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo c > c $ hg ci -Am1 adding c $ hg up 1 2 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg merge 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg ci -m1 $ hg up 2 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg -R s up 4 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo d > d $ hg ci -Am1 adding d $ hg up 3 2 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg -R s up 5 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo e > e $ hg ci -Am1 adding e $ hg up 5 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg merge 4 # try to merge default into br again subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88) you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]. what do you want to do? m 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cd .. test subrepo delete from .hgsubstate $ hg init testdelete $ mkdir testdelete/nested testdelete/nested2 $ hg init testdelete/nested $ hg init testdelete/nested2 $ echo test > testdelete/nested/foo $ echo test > testdelete/nested2/foo $ hg -R testdelete/nested add adding testdelete/nested/foo $ hg -R testdelete/nested2 add adding testdelete/nested2/foo $ hg -R testdelete/nested ci -m test $ hg -R testdelete/nested2 ci -m test $ echo nested = nested > testdelete/.hgsub $ echo nested2 = nested2 >> testdelete/.hgsub $ hg -R testdelete add adding testdelete/.hgsub $ hg -R testdelete ci -m "nested 1 & 2 added" $ echo nested = nested > testdelete/.hgsub $ hg -R testdelete ci -m "nested 2 deleted" $ cat testdelete/.hgsubstate bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested $ hg -R testdelete remove testdelete/.hgsub $ hg -R testdelete ci -m ".hgsub deleted" $ cat testdelete/.hgsubstate bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested test repository cloning $ mkdir mercurial mercurial2 $ hg init nested_absolute $ echo test > nested_absolute/foo $ hg -R nested_absolute add adding nested_absolute/foo $ hg -R nested_absolute ci -mtest $ cd mercurial $ hg init nested_relative $ echo test2 > nested_relative/foo2 $ hg -R nested_relative add adding nested_relative/foo2 $ hg -R nested_relative ci -mtest2 $ hg init main $ echo "nested_relative = ../nested_relative" > main/.hgsub $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub $ hg -R main add adding main/.hgsub $ hg -R main ci -m "add subrepos" $ cd .. $ hg clone mercurial/main mercurial2/main updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat mercurial2/main/nested_absolute/.hg/hgrc \ > mercurial2/main/nested_relative/.hg/hgrc [paths] default = $TESTTMP/mercurial/nested_absolute [paths] default = $TESTTMP/mercurial/nested_relative $ rm -rf mercurial mercurial2 Issue1977: multirepo push should fail if subrepo push fails $ hg init repo $ hg init repo/s $ echo a > repo/s/a $ hg -R repo/s ci -Am0 adding a $ echo s = s > repo/.hgsub $ hg -R repo ci -Am1 adding .hgsub $ hg clone repo repo2 updating to branch default cloning subrepo s from $TESTTMP/repo/s 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg -q -R repo2 pull -u $ echo 1 > repo2/s/a $ hg -R repo2/s ci -m2 $ hg -q -R repo2/s push $ hg -R repo2/s up -C 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 2 > repo2/s/b $ hg -R repo2/s ci -m3 -A adding b created new head $ hg -R repo2 ci -m3 $ hg -q -R repo2 push abort: push creates new remote head cc505f09a8b2! (in subrepository "s") (merge or see 'hg help push' for details about pushing new heads) [255] $ hg -R repo update 0 files updated, 0 files merged, 0 files removed, 0 files unresolved test if untracked file is not overwritten (this also tests that updated .hgsubstate is treated as "modified", when 'merge.update()' is aborted before 'merge.recordupdates()', even if none of mode, size and timestamp of it isn't changed on the filesystem (see also issue4583)) $ echo issue3276_ok > repo/s/b $ hg -R repo2 push -f -q $ touch -t 200001010000 repo/.hgsubstate $ cat >> repo/.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 -R repo update b: untracked file differs abort: untracked files in working directory differ from files in requested revision (in subrepository "s") [255] $ cat >> repo/.hg/hgrc < [extensions] > fakedirstatewritetime = ! > EOF $ cat repo/s/b issue3276_ok $ rm repo/s/b $ touch -t 200001010000 repo/.hgsubstate $ hg -R repo revert --all reverting repo/.hgsubstate reverting subrepo s $ hg -R repo update 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat repo/s/b 2 $ rm -rf repo2 repo Issue1852 subrepos with relative paths always push/pull relative to default Prepare a repo with subrepo $ hg init issue1852a $ cd issue1852a $ hg init sub/repo $ echo test > sub/repo/foo $ hg -R sub/repo add sub/repo/foo $ echo sub/repo = sub/repo > .hgsub $ hg add .hgsub $ hg ci -mtest committing subrepository sub/repo $ echo test >> sub/repo/foo $ hg ci -mtest committing subrepository sub/repo $ hg cat sub/repo/foo test test $ hg cat sub/repo/foo -Tjson | sed 's|\\\\|/|g' [ { "data": "test\ntest\n", "path": "foo" } ] non-exact match: $ hg cat -T '{path|relpath}\n' 'glob:**' .hgsub .hgsubstate sub/repo/foo $ hg cat -T '{path|relpath}\n' 're:^sub' sub/repo/foo missing subrepos in working directory: $ mkdir -p tmp/sub/repo $ hg cat -r 0 --output tmp/%p_p sub/repo/foo $ cat tmp/sub/repo/foo_p test $ mv sub/repo sub_ $ hg cat sub/repo/baz skipping missing subrepository: sub/repo [1] $ rm -rf sub/repo $ mv sub_ sub/repo $ cd .. Create repo without default path, pull top repo, and see what happens on update $ hg init issue1852b $ hg -R issue1852b pull issue1852a pulling from issue1852a requesting all changes adding changesets adding manifests adding file changes added 2 changesets with 3 changes to 2 files new changesets 19487b456929:be5eb94e7215 (run 'hg update' to get a working copy) $ hg -R issue1852b update abort: default path for subrepository not found (in subrepository "sub/repo") [255] Ensure a full traceback, not just the SubrepoAbort part $ hg -R issue1852b update --traceback 2>&1 | grep 'raise error\.Abort' raise error.Abort(_(b"default path for subrepository not found")) Pull -u now doesn't help $ hg -R issue1852b pull -u issue1852a pulling from issue1852a searching for changes no changes found Try the same, but with pull -u $ hg init issue1852c $ hg -R issue1852c pull -r0 -u issue1852a pulling from issue1852a adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files new changesets 19487b456929 cloning subrepo sub/repo from issue1852a/sub/repo 2 files updated, 0 files merged, 0 files removed, 0 files unresolved Try to push from the other side $ hg -R issue1852a push `pwd`/issue1852c pushing to $TESTTMP/issue1852c pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo searching for changes no changes found searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files Incoming and outgoing should not use the default path: $ hg clone -q issue1852a issue1852d $ hg -R issue1852d outgoing --subrepos issue1852c comparing with issue1852c searching for changes no changes found comparing with issue1852c/sub/repo searching for changes no changes found [1] $ hg -R issue1852d incoming --subrepos issue1852c comparing with issue1852c searching for changes no changes found comparing with issue1852c/sub/repo searching for changes no changes found [1] Check that merge of a new subrepo doesn't write the uncommitted state to .hgsubstate (issue4622) $ hg init issue1852a/addedsub $ echo zzz > issue1852a/addedsub/zz.txt $ hg -R issue1852a/addedsub ci -Aqm "initial ZZ" $ hg clone issue1852a/addedsub issue1852d/addedsub updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo def > issue1852a/sub/repo/foo $ hg -R issue1852a ci -SAm 'tweaked subrepo' adding tmp/sub/repo/foo_p committing subrepository sub/repo $ echo 'addedsub = addedsub' >> issue1852d/.hgsub $ echo xyz > issue1852d/sub/repo/foo $ hg -R issue1852d pull -u pulling from $TESTTMP/issue1852a searching for changes adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files new changesets c82b79fdcc5b subrepository sub/repo diverged (local revision: f42d5c7504a8, remote revision: 46cd4aac504c) you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination]. what do you want to do? m pulling subrepo sub/repo from $TESTTMP/issue1852a/sub/repo searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets 46cd4aac504c subrepository sources for sub/repo differ you can use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c). what do you want to do? l 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat issue1852d/.hgsubstate f42d5c7504a811dda50f5cf3e5e16c3330b87172 sub/repo Check status of files when none of them belong to the first subrepository: $ hg init subrepo-status $ cd subrepo-status $ hg init subrepo-1 $ hg init subrepo-2 $ cd subrepo-2 $ touch file $ hg add file $ cd .. $ echo subrepo-1 = subrepo-1 > .hgsub $ echo subrepo-2 = subrepo-2 >> .hgsub $ hg add .hgsub $ hg ci -m 'Added subrepos' committing subrepository subrepo-2 $ hg st subrepo-2/file Check that share works with subrepo $ hg --config extensions.share= share . ../shared updating working directory sharing subrepo subrepo-1 from $TESTTMP/subrepo-status/subrepo-1 sharing subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ find ../shared/* | sort ../shared/subrepo-1 ../shared/subrepo-1/.hg ../shared/subrepo-1/.hg/cache ../shared/subrepo-1/.hg/cache/storehash ../shared/subrepo-1/.hg/cache/storehash/* (glob) ../shared/subrepo-1/.hg/hgrc ../shared/subrepo-1/.hg/requires ../shared/subrepo-1/.hg/sharedpath ../shared/subrepo-1/.hg/wcache ../shared/subrepo-2 ../shared/subrepo-2/.hg ../shared/subrepo-2/.hg/branch ../shared/subrepo-2/.hg/cache ../shared/subrepo-2/.hg/cache/storehash ../shared/subrepo-2/.hg/cache/storehash/* (glob) ../shared/subrepo-2/.hg/dirstate ../shared/subrepo-2/.hg/hgrc ../shared/subrepo-2/.hg/requires ../shared/subrepo-2/.hg/sharedpath ../shared/subrepo-2/.hg/wcache ../shared/subrepo-2/.hg/wcache/checkisexec (execbit !) ../shared/subrepo-2/.hg/wcache/checklink (symlink !) ../shared/subrepo-2/.hg/wcache/checklink-target (symlink !) ../shared/subrepo-2/.hg/wcache/manifestfulltextcache (reporevlogstore !) ../shared/subrepo-2/file $ hg -R ../shared in abort: repository default not found! [255] $ hg -R ../shared/subrepo-2 showconfig paths paths.default=$TESTTMP/subrepo-status/subrepo-2 $ hg -R ../shared/subrepo-1 sum --remote parent: -1:000000000000 tip (empty repository) branch: default commit: (clean) update: (current) remote: (synced) Check hg update --clean $ cd $TESTTMP/t $ rm -r t/t.orig $ hg status -S --all C .hgsub C .hgsubstate C a C s/.hgsub C s/.hgsubstate C s/a C s/ss/a C t/t $ echo c1 > s/a $ cd s $ echo c1 > b $ echo c1 > c $ hg add b $ cd .. $ hg status -S M s/a A s/b ? s/c $ hg update -C 1 files updated, 0 files merged, 0 files removed, 0 files unresolved updated to "925c17564ef8: 13" 2 other heads for branch "default" $ hg status -S ? s/b ? s/c Sticky subrepositories, no changes $ cd $TESTTMP/t $ hg id 925c17564ef8 tip $ hg -R s id 12a213df6fa9 tip $ hg -R t id 52c0adc0515a tip $ hg update 11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id 365661e5936a $ hg -R s id fc627a69481f $ hg -R t id e95bcfa18a35 Sticky subrepositories, file changes $ touch s/f1 $ touch t/f1 $ hg add -S s/f1 $ hg add -S t/f1 $ hg id 365661e5936a+ $ hg -R s id fc627a69481f+ $ hg -R t id e95bcfa18a35+ $ hg update tip subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9) you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination]. what do you want to do? m subrepository sources for s differ you can use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9). what do you want to do? l subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a) you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination]. what do you want to do? m subrepository sources for t differ you can use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a). what do you want to do? l 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id 925c17564ef8+ tip $ hg -R s id fc627a69481f+ $ hg -R t id e95bcfa18a35+ $ hg update --clean tip 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Sticky subrepository, revision updates $ hg id 925c17564ef8 tip $ hg -R s id 12a213df6fa9 tip $ hg -R t id 52c0adc0515a tip $ cd s $ hg update -r -2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd ../t $ hg update -r 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd .. $ hg update 10 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f) you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination]. what do you want to do? m subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c) you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination]. what do you want to do? m subrepository sources for t differ (in checked out version) you can use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c). what do you want to do? l 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id e45c8b14af55+ $ hg -R s id 02dcf1d70411 $ hg -R t id 7af322bc1198 Sticky subrepository, file changes and revision updates $ touch s/f1 $ touch t/f1 $ hg add -S s/f1 $ hg add -S t/f1 $ hg id e45c8b14af55+ $ hg -R s id 02dcf1d70411+ $ hg -R t id 7af322bc1198+ $ hg update tip subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9) you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination]. what do you want to do? m subrepository sources for s differ you can use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9). what do you want to do? l subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a) you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination]. what do you want to do? m subrepository sources for t differ you can use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a). what do you want to do? l 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id 925c17564ef8+ tip $ hg -R s id 02dcf1d70411+ $ hg -R t id 7af322bc1198+ Sticky repository, update --clean $ hg update --clean tip 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id 925c17564ef8 tip $ hg -R s id 12a213df6fa9 tip $ hg -R t id 52c0adc0515a tip Test subrepo already at intended revision: $ cd s $ hg update fc627a69481f 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd .. $ hg update 11 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f) you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination]. what do you want to do? m 0 files updated, 0 files merged, 0 files removed, 0 files unresolved 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg id -n 11+ $ hg -R s id fc627a69481f $ hg -R t id e95bcfa18a35 Test that removing .hgsubstate doesn't break anything: $ hg rm -f .hgsubstate $ hg ci -mrm nothing changed [1] $ hg log -vr tip changeset: 13:925c17564ef8 tag: tip user: test date: Thu Jan 01 00:00:00 1970 +0000 files: .hgsubstate description: 13 Test that removing .hgsub removes .hgsubstate: $ hg rm .hgsub $ hg ci -mrm2 created new head $ hg log -vr tip changeset: 14:2400bccd50af tag: tip parent: 11:365661e5936a user: test date: Thu Jan 01 00:00:00 1970 +0000 files: .hgsub .hgsubstate description: rm2 Test issue3153: diff -S with deleted subrepos $ hg diff --nodates -S -c . diff -r 365661e5936a -r 2400bccd50af .hgsub --- a/.hgsub +++ /dev/null @@ -1,2 +0,0 @@ -s = s -t = t diff -r 365661e5936a -r 2400bccd50af .hgsubstate --- a/.hgsubstate +++ /dev/null @@ -1,2 +0,0 @@ -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s -e95bcfa18a358dc4936da981ebf4147b4cad1362 t Test behavior of add for explicit path in subrepo: $ cd .. $ hg init explicit $ cd explicit $ echo s = s > .hgsub $ hg add .hgsub $ hg init s $ hg ci -m0 Adding with an explicit path in a subrepo adds the file $ echo c1 > f1 $ echo c2 > s/f2 $ hg st -S ? f1 ? s/f2 $ hg add s/f2 $ hg st -S A s/f2 ? f1 $ hg ci -R s -m0 $ hg ci -Am1 adding f1 Adding with an explicit path in a subrepo with -S has the same behavior $ echo c3 > f3 $ echo c4 > s/f4 $ hg st -S ? f3 ? s/f4 $ hg add -S s/f4 $ hg st -S A s/f4 ? f3 $ hg ci -R s -m1 $ hg ci -Ama2 adding f3 Adding without a path or pattern silently ignores subrepos $ echo c5 > f5 $ echo c6 > s/f6 $ echo c7 > s/f7 $ hg st -S ? f5 ? s/f6 ? s/f7 $ hg add adding f5 $ hg st -S A f5 ? s/f6 ? s/f7 $ hg ci -R s -Am2 adding f6 adding f7 $ hg ci -m3 Adding without a path or pattern with -S also adds files in subrepos $ echo c8 > f8 $ echo c9 > s/f9 $ echo c10 > s/f10 $ hg st -S ? f8 ? s/f10 ? s/f9 $ hg add -S adding f8 adding s/f10 adding s/f9 $ hg st -S A f8 A s/f10 A s/f9 $ hg ci -R s -m3 $ hg ci -m4 Adding with a pattern silently ignores subrepos $ echo c11 > fm11 $ echo c12 > fn12 $ echo c13 > s/fm13 $ echo c14 > s/fn14 $ hg st -S ? fm11 ? fn12 ? s/fm13 ? s/fn14 $ hg add 'glob:**fm*' adding fm11 $ hg st -S A fm11 ? fn12 ? s/fm13 ? s/fn14 $ hg ci -R s -Am4 adding fm13 adding fn14 $ hg ci -Am5 adding fn12 Adding with a pattern with -S also adds matches in subrepos $ echo c15 > fm15 $ echo c16 > fn16 $ echo c17 > s/fm17 $ echo c18 > s/fn18 $ hg st -S ? fm15 ? fn16 ? s/fm17 ? s/fn18 $ hg add -S 'glob:**fm*' adding fm15 adding s/fm17 $ hg st -S A fm15 A s/fm17 ? fn16 ? s/fn18 $ hg ci -R s -Am5 adding fn18 $ hg ci -Am6 adding fn16 Test behavior of forget for explicit path in subrepo: Forgetting an explicit path in a subrepo untracks the file $ echo c19 > s/f19 $ hg add s/f19 $ hg st -S A s/f19 $ hg forget s/f19 $ hg st -S ? s/f19 $ rm s/f19 $ cd .. Courtesy phases synchronisation to publishing server does not block the push (issue3781) $ cp -R main issue3781 $ cp -R main issue3781-dest $ cd issue3781-dest/s $ hg phase tip # show we have draft changeset 5: draft $ chmod a-w .hg/store/phaseroots # prevent phase push $ cd ../../issue3781 $ cat >> .hg/hgrc << EOF > [paths] > default=../issue3781-dest/ > EOF $ hg push --config devel.legacy.exchange=bundle1 pushing to $TESTTMP/issue3781-dest pushing subrepo s to $TESTTMP/issue3781-dest/s searching for changes no changes found searching for changes no changes found [1] # clean the push cache $ rm s/.hg/cache/storehash/* $ hg push # bundle2+ pushing to $TESTTMP/issue3781-dest pushing subrepo s to $TESTTMP/issue3781-dest/s searching for changes no changes found searching for changes no changes found [1] $ cd .. Test phase choice for newly created commit with "phases.subrepochecks" configuration $ cd t $ hg update -q -r 12 $ cat >> s/ss/.hg/hgrc < [phases] > new-commit = secret > EOF $ cat >> s/.hg/hgrc < [phases] > new-commit = draft > EOF $ echo phasecheck1 >> s/ss/a $ hg -R s commit -S --config phases.checksubrepos=abort -m phasecheck1 committing subrepository ss transaction abort! rollback completed abort: can't commit in draft phase conflicting secret from subrepository ss [255] $ echo phasecheck2 >> s/ss/a $ hg -R s commit -S --config phases.checksubrepos=ignore -m phasecheck2 committing subrepository ss $ hg -R s/ss phase tip 3: secret $ hg -R s phase tip 6: draft $ echo phasecheck3 >> s/ss/a $ hg -R s commit -S -m phasecheck3 committing subrepository ss warning: changes are committed in secret phase from subrepository ss $ hg -R s/ss phase tip 4: secret $ hg -R s phase tip 7: secret $ cat >> t/.hg/hgrc < [phases] > new-commit = draft > EOF $ cat >> .hg/hgrc < [phases] > new-commit = public > EOF $ echo phasecheck4 >> s/ss/a $ echo phasecheck4 >> t/t $ hg commit -S -m phasecheck4 committing subrepository s committing subrepository s/ss warning: changes are committed in secret phase from subrepository ss committing subrepository t warning: changes are committed in secret phase from subrepository s created new head $ hg -R s/ss phase tip 5: secret $ hg -R s phase tip 8: secret $ hg -R t phase tip 6: draft $ hg phase tip 15: secret $ cd .. Test that commit --secret works on both repo and subrepo (issue4182) $ cd main $ echo secret >> b $ echo secret >> s/b $ hg commit --secret --subrepo -m "secret" committing subrepository s $ hg phase -r . 6: secret $ cd s $ hg phase -r . 6: secret $ cd ../../ Test "subrepos" template keyword $ cd t $ hg update -q 15 $ cat > .hgsub < s = s > EOF $ hg commit -m "16" warning: changes are committed in secret phase from subrepository s (addition of ".hgsub" itself) $ hg diff --nodates -c 1 .hgsubstate diff -r f7b1eb17ad24 -r 7cf8cfea66e4 .hgsubstate --- /dev/null +++ b/.hgsubstate @@ -0,0 +1,1 @@ +e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s $ hg log -r 1 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" f7b1eb17ad24 000000000000 s (modification of existing entry) $ hg diff --nodates -c 2 .hgsubstate diff -r 7cf8cfea66e4 -r df30734270ae .hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,1 +1,1 @@ -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s +dc73e2e6d2675eb2e41e33c205f4bdab4ea5111d s $ hg log -r 2 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" 7cf8cfea66e4 000000000000 s (addition of entry) $ hg diff --nodates -c 5 .hgsubstate diff -r 7cf8cfea66e4 -r 1f14a2e2d3ec .hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,1 +1,2 @@ e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t $ hg log -r 5 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" 7cf8cfea66e4 000000000000 t (removal of existing entry) $ hg diff --nodates -c 16 .hgsubstate diff -r 8bec38d2bd0b -r f2f70bc3d3c9 .hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,2 +1,1 @@ 0731af8ca9423976d3743119d0865097c07bdc1b s -e202dc79b04c88a636ea8913d9182a1346d9b3dc t $ hg log -r 16 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" 8bec38d2bd0b 000000000000 t (merging) $ hg diff --nodates -c 9 .hgsubstate diff -r f6affe3fbfaa -r f0d2028bf86d .hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,1 +1,2 @@ fc627a69481fcbe5f1135069e8a3881c023e4cf5 s +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t $ hg log -r 9 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" f6affe3fbfaa 1f14a2e2d3ec t (removal of ".hgsub" itself) $ hg diff --nodates -c 8 .hgsubstate diff -r f94576341bcf -r 96615c1dad2d .hgsubstate --- a/.hgsubstate +++ /dev/null @@ -1,2 +0,0 @@ -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s -7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4 t $ hg log -r 8 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" f94576341bcf 000000000000 Test that '[paths]' is configured correctly at subrepo creation $ cd $TESTTMP/tc $ cat > .hgsub < # to clear bogus subrepo path 'bogus=[boguspath' > s = s > t = t > EOF $ hg update -q --clean null $ rm -rf s t $ cat >> .hg/hgrc < [paths] > default-push = /foo/bar > EOF $ hg update -q $ cat s/.hg/hgrc [paths] default = $TESTTMP/t/s default-push = /foo/bar/s $ cat s/ss/.hg/hgrc [paths] default = $TESTTMP/t/s/ss default-push = /foo/bar/s/ss $ cat t/.hg/hgrc [paths] default = $TESTTMP/t/t default-push = /foo/bar/t $ cd $TESTTMP/t $ hg up -qC 0 $ echo 'bar' > bar.txt $ hg ci -Am 'branch before subrepo add' adding bar.txt created new head $ hg merge -r "first(subrepo('s'))" 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg status -S -X '.hgsub*' A s/a ? s/b ? s/c ? s/f1 $ hg status -S --rev 'p2()' A bar.txt ? s/b ? s/c ? s/f1 $ hg diff -S -X '.hgsub*' --nodates diff -r 000000000000 s/a --- /dev/null +++ b/s/a @@ -0,0 +1,1 @@ +a $ hg diff -S --rev 'p2()' --nodates diff -r 7cf8cfea66e4 bar.txt --- /dev/null +++ b/bar.txt @@ -0,0 +1,1 @@ +bar $ hg diff -X '.hgsub*' --nodates s diff -r 000000000000 s/a --- /dev/null +++ b/s/a @@ -0,0 +1,1 @@ +a $ hg diff -X '.hgsub*' --nodates s/a diff -r 000000000000 s/a --- /dev/null +++ b/s/a @@ -0,0 +1,1 @@ +a $ cd .. test for ssh exploit 2017-07-25 $ cat >> $HGRCPATH << EOF > [ui] > ssh = sh -c "read l; read l; read l" > EOF $ hg init malicious-proxycommand $ cd malicious-proxycommand $ echo 's = [hg]ssh://-oProxyCommand=touch${IFS}owned/path' > .hgsub $ hg init s $ cd s $ echo init > init $ hg add adding init $ hg commit -m init $ cd .. $ hg add .hgsub $ hg ci -m 'add subrepo' $ cd .. $ hg clone malicious-proxycommand malicious-proxycommand-clone updating to branch default cloning subrepo s from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s") [255] also check that a percent encoded '-' (%2D) doesn't work $ cd malicious-proxycommand $ echo 's = [hg]ssh://%2DoProxyCommand=touch${IFS}owned/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 cloning subrepo s from ssh://-oProxyCommand%3Dtouch%24%7BIFS%7Downed/path abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' (in subrepository "s") [255] also check for a pipe $ cd malicious-proxycommand $ echo 's = [hg]ssh://fakehost|touch${IFS}owned/path' > .hgsub $ hg ci -m 'change url to pipe' $ cd .. $ rm -r malicious-proxycommand-clone $ hg clone malicious-proxycommand malicious-proxycommand-clone updating to branch default cloning subrepo s from ssh://fakehost%7Ctouch%24%7BIFS%7Downed/path abort: no suitable response from remote hg! [255] $ [ ! -f owned ] || echo 'you got owned' also check that a percent encoded '|' (%7C) doesn't work $ cd malicious-proxycommand $ echo 's = [hg]ssh://fakehost%7Ctouch%20owned/path' > .hgsub $ hg ci -m 'change url to percent encoded pipe' $ cd .. $ rm -r malicious-proxycommand-clone $ hg clone malicious-proxycommand malicious-proxycommand-clone updating to branch default cloning subrepo s from ssh://fakehost%7Ctouch%20owned/path abort: no suitable response from remote hg! [255] $ [ ! -f owned ] || echo 'you got owned' and bad usernames: $ cd malicious-proxycommand $ echo 's = [hg]ssh://-oProxyCommand=touch owned@example.com/path' > .hgsub $ hg ci -m 'owned username' $ cd .. $ rm -r malicious-proxycommand-clone $ hg clone malicious-proxycommand malicious-proxycommand-clone updating to branch default cloning subrepo s from ssh://-oProxyCommand%3Dtouch%20owned@example.com/path abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned@example.com/path' (in subrepository "s") [255] Test convert subrepositories including merge (issue5526): $ hg init tconv $ hg convert --config extensions.convert= -q t/s tconv/s $ hg convert --config extensions.convert= -q t/s/ss tconv/s/ss $ hg convert --config extensions.convert= -q t/t tconv/t convert shouldn't fail because of pseudo filenode: $ hg convert --config extensions.convert= t tconv scanning source... sorting... converting... 17 0 16 1 15 2 14 3 13 4 12 5 11 6 10 7 9 8 8 9 7 10 6 11 5 12 4 13 3 rm2 2 phasecheck4 1 16 0 branch before subrepo add converted .hgsubstate should point to valid nodes: $ hg up -R tconv 9 3 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat tconv/.hgsubstate fc627a69481fcbe5f1135069e8a3881c023e4cf5 s 60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t mercurial-5.3.1/tests/test-exchange-obsmarkers-case-B6.t0000644015407300116100000001011713627755405023023 0ustar augieeng00000000000000============================================ Testing obsolescence markers push: Cases B.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 B: pruning case TestCase 6: Pruned changeset with precursors not in pushed set B.6 Pruned changeset with precursors not in pushed set ====================================================== .. {{{ .. B ø⇠⊗ B' .. | | .. A ○ | .. |/ .. ◠O .. }}} .. .. Marker exist from: .. .. * `B ø⇠⊗ B'` .. * B' prune .. .. Command run: .. .. * hg push -r O .. .. Expected exchange: .. .. * `B ø⇠⊗ B'` .. * B' prune Setup ----- $ . $TESTDIR/testlib/exchange-obsmarker-util.sh Initial $ setuprepos B.6 creating test repo for test case B.6 - pulldest - main - pushdest cd into `main` and proceed with env setup $ cd main $ mkcommit A $ mkcommit B0 $ hg up --quiet 0 $ mkcommit B1 created new head $ hg debugobsolete `getid 'desc(B0)'` `getid 'desc(B1)'` 1 new obsolescence markers obsoleted 1 changesets $ hg prune -qd '0 0' . $ hg log -G --hidden x f6298a8ac3a4 (draft): B1 | | x 962ecf6b1afc (draft): B0 | | | o f5bc6836db60 (draft): A |/ @ a9bdc8b26820 (public): O $ inspect_obsmarkers obsstore content ================ 962ecf6b1afc94e15c7e48fdfb76ef8abd11372b f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} $ cd .. $ cd .. Actual Test ------------------------------------- $ dotest B.6 O ## Running testcase B.6 # testing echange of "O" (a9bdc8b26820) ## initial state # obstore: main 962ecf6b1afc94e15c7e48fdfb76ef8abd11372b f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (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 962ecf6b1afc94e15c7e48fdfb76ef8abd11372b f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest 962ecf6b1afc94e15c7e48fdfb76ef8abd11372b f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (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 962ecf6b1afc94e15c7e48fdfb76ef8abd11372b f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pushdest 962ecf6b1afc94e15c7e48fdfb76ef8abd11372b f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} # obstore: pulldest 962ecf6b1afc94e15c7e48fdfb76ef8abd11372b f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 {a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} mercurial-5.3.1/tests/test-eol-hook.t0000644015407300116100000001311513627755405017433 0ustar augieeng00000000000000Test the EOL hook $ hg init main $ cat > main/.hg/hgrc < [hooks] > pretxnchangegroup = python:hgext.eol.hook > EOF $ hg clone main fork updating to branch default 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd fork Create repo $ cat > .hgeol < [patterns] > mixed.txt = BIN > crlf.txt = CRLF > **.txt = native > EOF $ hg add .hgeol $ hg commit -m 'Commit .hgeol' $ printf "first\nsecond\nthird\n" > a.txt $ hg add a.txt $ hg commit -m 'LF a.txt' $ hg push ../main pushing to ../main searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 2 files $ printf "first\r\nsecond\r\nthird\n" > a.txt $ hg commit -m 'CRLF a.txt' $ hg push ../main pushing to ../main searching for changes adding changesets adding manifests adding file changes error: pretxnchangegroup hook failed: end-of-line check failed: a.txt in a8ee6548cd86 should not have CRLF line endings transaction abort! rollback completed abort: end-of-line check failed: a.txt in a8ee6548cd86 should not have CRLF line endings [255] $ printf "first\nsecond\nthird\n" > a.txt $ hg commit -m 'LF a.txt (fixed)' $ hg push ../main pushing to ../main searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files $ printf "first\nsecond\nthird\n" > crlf.txt $ hg add crlf.txt $ hg commit -m 'LF crlf.txt' $ hg push ../main pushing to ../main searching for changes adding changesets adding manifests adding file changes error: pretxnchangegroup hook failed: end-of-line check failed: crlf.txt in 004ba2132725 should not have LF line endings transaction abort! rollback completed abort: end-of-line check failed: crlf.txt in 004ba2132725 should not have LF line endings [255] $ printf "first\r\nsecond\r\nthird\r\n" > crlf.txt $ hg commit -m 'CRLF crlf.txt (fixed)' $ hg push ../main pushing to ../main searching for changes adding changesets adding manifests adding file changes added 2 changesets with 2 changes to 1 files $ printf "first\r\nsecond" > b.txt $ hg add b.txt $ hg commit -m 'CRLF b.txt' $ hg push ../main pushing to ../main searching for changes adding changesets adding manifests adding file changes error: pretxnchangegroup hook failed: end-of-line check failed: b.txt in fbcf9b1025f5 should not have CRLF line endings transaction abort! rollback completed abort: end-of-line check failed: b.txt in fbcf9b1025f5 should not have CRLF line endings [255] $ hg up -r -2 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ printf "some\nother\nfile" > c.txt $ hg add c.txt $ hg commit -m "LF c.txt, b.txt doesn't exist here" created new head $ hg push -f ../main pushing to ../main searching for changes adding changesets adding manifests adding file changes error: pretxnchangegroup hook failed: end-of-line check failed: b.txt in fbcf9b1025f5 should not have CRLF line endings transaction abort! rollback completed abort: end-of-line check failed: b.txt in fbcf9b1025f5 should not have CRLF line endings [255] Test checkheadshook alias $ cat > ../main/.hg/hgrc < [hooks] > pretxnchangegroup = python:hgext.eol.checkheadshook > EOF $ hg push -f ../main pushing to ../main searching for changes adding changesets adding manifests adding file changes error: pretxnchangegroup hook failed: end-of-line check failed: b.txt in fbcf9b1025f5 should not have CRLF line endings transaction abort! rollback completed abort: end-of-line check failed: b.txt in fbcf9b1025f5 should not have CRLF line endings [255] We can fix the head and push again $ hg up 6 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ printf "first\nsecond" > b.txt $ hg ci -m "remove CRLF from b.txt" $ hg push -f ../main pushing to ../main searching for changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 2 files (+1 heads) $ hg -R ../main rollback repository tip rolled back to revision 5 (undo push) Test it still fails with checkallhook $ cat > ../main/.hg/hgrc < [hooks] > pretxnchangegroup = python:hgext.eol.checkallhook > EOF $ hg push -f ../main pushing to ../main searching for changes adding changesets adding manifests adding file changes error: pretxnchangegroup hook failed: end-of-line check failed: b.txt in fbcf9b1025f5 should not have CRLF line endings transaction abort! rollback completed abort: end-of-line check failed: b.txt in fbcf9b1025f5 should not have CRLF line endings [255] But we can push the clean head $ hg push -r7 -f ../main pushing to ../main searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files Test multiple files/revisions output $ printf "another\r\nbad\r\none" > d.txt $ hg add d.txt $ hg ci -m "add d.txt" $ hg push -f ../main pushing to ../main searching for changes adding changesets adding manifests adding file changes error: pretxnchangegroup hook failed: end-of-line check failed: b.txt in fbcf9b1025f5 should not have CRLF line endings d.txt in a7040e68714f should not have CRLF line endings transaction abort! rollback completed abort: end-of-line check failed: b.txt in fbcf9b1025f5 should not have CRLF line endings d.txt in a7040e68714f should not have CRLF line endings [255] $ cd .. mercurial-5.3.1/tests/test-graft-rename.t0000644015407300116100000004373013627755405020274 0ustar augieeng00000000000000 Graft from behind a move or rename ================================== NOTE: This is affected by issue5343, and will need updating when it's fixed Consider this topology for a regular graft: o c1 | | o c2 | | | o ca # stands for "common ancestor" |/ o cta # stands for "common topological ancestor" Note that in issue5343, ca==cta. The following table shows the possible cases. Here, "x->y" and, equivalently, "y<-x", where x is an ancestor of y, means that some copy happened from x to y. name | c1<-cta | cta<->ca | ca->c2 A.0 | | | A.1 | X | | A.2 | | X | A.3 | | | X A.4 | X | X | A.5 | X | | X A.6 | | X | X A.7 | X | X | X A.0 is trivial, and doesn't need copy tracking. For A.1, a forward rename is recorded in the c1 pass, to be followed later. In A.2, the rename is recorded in the c2 pass and followed backwards. A.3 is recorded in the c2 pass as a forward rename to be duplicated on target. In A.4, both passes of checkcopies record incomplete renames, which are then joined in mergecopies to record a rename to be followed. In A.5 and A.7, the c1 pass records an incomplete rename, while the c2 pass records an incomplete divergence. The incomplete rename is then joined to the appropriate side of the incomplete divergence, and the result is recorded as a divergence. The code doesn't distinguish at all between these two cases, since the end result of them is the same: an incomplete divergence joined with an incomplete rename into a divergence. Finally, A.6 records a divergence entirely in the c2 pass. A.4 has a degenerate case a<-b<-a->a, where checkcopies isn't needed at all. A.5 has a special case a<-b<-b->a, which is treated like a<-b->a in a merge. A.5 has issue5343 as a special case. A.6 has a special case a<-a<-b->a. Here, checkcopies will find a spurious incomplete divergence, which is in fact complete. This is handled later in mergecopies. A.7 has 4 special cases: a<-b<-a->b (the "ping-pong" case), a<-b<-c->b, a<-b<-a->c and a<-b<-c->a. Of these, only the "ping-pong" case is interesting, the others are fairly trivial (a<-b<-c->b and a<-b<-a->c proceed like the base case, a<-b<-c->a is treated the same as a<-b<-b->a). f5a therefore tests the "ping-pong" rename case, where a file is renamed to the same name on both branches, then the rename is backed out on one branch, and the backout is grafted to the other branch. This creates a challenging rename sequence of a<-b<-a->b in the graft target, topological CA, graft CA and graft source, respectively. Since rename detection will run on the c1 side for such a sequence (as for technical reasons, we split the c1 and c2 sides not at the graft CA, but rather at the topological CA), it will pick up a false rename, and cause a spurious merge conflict. This false rename is always exactly the reverse of the true rename that would be detected on the c2 side, so we can correct for it by detecting this condition and reversing as necessary. First, set up the repository with commits to be grafted $ hg init graftmove $ cd graftmove $ echo c1a > f1a $ echo c2a > f2a $ echo c3a > f3a $ echo c4a > f4a $ echo c5a > f5a $ hg ci -qAm A0 $ hg mv f1a f1b $ hg mv f3a f3b $ hg mv f5a f5b $ hg ci -qAm B0 $ echo c1c > f1b $ hg mv f2a f2c $ hg mv f5b f5a $ echo c5c > f5a $ hg ci -qAm C0 $ hg mv f3b f3d $ echo c4d > f4a $ hg ci -qAm D0 $ hg log -G @ changeset: 3:b69f5839d2d9 | tag: tip | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: D0 | o changeset: 2:f58c7e2b28fa | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: C0 | o changeset: 1:3d7bba921b5d | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: B0 | o changeset: 0:11f7a1b56675 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: A0 Test the cases A.2 (f1x), A.3 (f2x) and a special case of A.6 (f5x) where the two renames actually converge to the same name (thus no actual divergence). $ hg up -q 'desc("A0")' $ HGEDITOR="echo C1 >" hg graft -r 'desc("C0")' --edit grafting 2:f58c7e2b28fa "C0" merging f1a and f1b to f1a merging f5a $ hg status --change . M f1a M f5a A f2c R f2a $ hg cat f1a c1c $ hg cat f1b f1b: no such file in rev c9763722f9bd [1] Test the cases A.0 (f4x) and A.6 (f3x) $ HGEDITOR="echo D1 >" hg graft -r 'desc("D0")' --edit grafting 3:b69f5839d2d9 "D0" note: possible conflict - f3b was renamed multiple times to: f3a f3d Set up the repository for some further tests $ hg up -q "min(desc("A0"))" $ hg mv f1a f1e $ echo c2e > f2a $ hg mv f3a f3e $ hg mv f4a f4e $ hg mv f5a f5b $ hg ci -qAm "E0" $ hg up -q "min(desc("A0"))" $ hg cp f1a f1f $ hg ci -qAm "F0" $ hg up -q "min(desc("A0"))" $ hg cp f1a f1g $ echo c1g > f1g $ hg ci -qAm "G0" $ hg log -G @ changeset: 8:ba67f08fb15a | tag: tip | parent: 0:11f7a1b56675 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: G0 | | o changeset: 7:d376ab0d7fda |/ parent: 0:11f7a1b56675 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: F0 | | o changeset: 6:6bd1736cab86 |/ parent: 0:11f7a1b56675 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: E0 | | o changeset: 5:560daee679da | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | summary: D1 | | | o changeset: 4:c9763722f9bd |/ parent: 0:11f7a1b56675 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: C1 | | o changeset: 3:b69f5839d2d9 | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | summary: D0 | | | o changeset: 2:f58c7e2b28fa | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | summary: C0 | | | o changeset: 1:3d7bba921b5d |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: B0 | o changeset: 0:11f7a1b56675 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: A0 Test the cases A.4 (f1x), the "ping-pong" special case of A.7 (f5x), and A.3 with a local content change to be preserved (f2x). $ hg up -q "desc("E0")" $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit grafting 2:f58c7e2b28fa "C0" merging f1e and f1b to f1e merging f2a and f2c to f2c Test the cases A.1 (f4x) and A.7 (f3x). $ HGEDITOR="echo D2 >" hg graft -r 'desc("D0")' --edit grafting 3:b69f5839d2d9 "D0" note: possible conflict - f3b was renamed multiple times to: f3d f3e merging f4e and f4a to f4e $ hg cat f2c c2e Test the case A.5 (move case, f1x). $ hg up -q "desc("C0")" $ HGEDITOR="echo E1 >" hg graft -r 'desc("E0")' --edit grafting 6:6bd1736cab86 "E0" note: possible conflict - f1a was renamed multiple times to: f1b f1e note: possible conflict - f3a was renamed multiple times to: f3b f3e merging f2c and f2a to f2c merging f5a and f5b to f5b $ cat f1e c1a Test the case A.5 (copy case, f1x). $ hg up -q "desc("C0")" $ HGEDITOR="echo F1 >" hg graft -r 'desc("F0")' --edit grafting 7:d376ab0d7fda "F0" BROKEN: f1f should be marked a copy from f1b $ hg st --copies --change . A f1f BROKEN: f1f should have the new content from f1b (i.e. "c1c") $ cat f1f c1a Test the case A.5 (copy+modify case, f1x). $ hg up -q "desc("C0")" BROKEN: We should get a merge conflict from the 3-way merge between f1b in C0 (content "c1c") and f1g in G0 (content "c1g") with f1a in A0 as base (content "c1a") $ HGEDITOR="echo G1 >" hg graft -r 'desc("G0")' --edit grafting 8:ba67f08fb15a "G0" Check the results of the grafts tested $ hg log -CGv --patch --git @ changeset: 13:ef3adf6c20a4 | tag: tip | parent: 2:f58c7e2b28fa | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | files: f1g | description: | G1 | | | diff --git a/f1g b/f1g | new file mode 100644 | --- /dev/null | +++ b/f1g | @@ -0,0 +1,1 @@ | +c1g | | o changeset: 12:b5542d755b54 |/ parent: 2:f58c7e2b28fa | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | files: f1f | description: | F1 | | | diff --git a/f1f b/f1f | new file mode 100644 | --- /dev/null | +++ b/f1f | @@ -0,0 +1,1 @@ | +c1a | | o changeset: 11:f8a162271246 |/ parent: 2:f58c7e2b28fa | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | files: f1e f2c f3e f4a f4e f5a f5b | copies: f4e (f4a) f5b (f5a) | description: | E1 | | | diff --git a/f1e b/f1e | new file mode 100644 | --- /dev/null | +++ b/f1e | @@ -0,0 +1,1 @@ | +c1a | diff --git a/f2c b/f2c | --- a/f2c | +++ b/f2c | @@ -1,1 +1,1 @@ | -c2a | +c2e | diff --git a/f3e b/f3e | new file mode 100644 | --- /dev/null | +++ b/f3e | @@ -0,0 +1,1 @@ | +c3a | diff --git a/f4a b/f4e | rename from f4a | rename to f4e | diff --git a/f5a b/f5b | rename from f5a | rename to f5b | | o changeset: 10:93ee502e8b0a | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | files: f3d f4e | | description: | | D2 | | | | | | diff --git a/f3d b/f3d | | new file mode 100644 | | --- /dev/null | | +++ b/f3d | | @@ -0,0 +1,1 @@ | | +c3a | | diff --git a/f4e b/f4e | | --- a/f4e | | +++ b/f4e | | @@ -1,1 +1,1 @@ | | -c4a | | +c4d | | | o changeset: 9:539cf145f496 | | parent: 6:6bd1736cab86 | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | files: f1e f2a f2c f5a f5b | | copies: f2c (f2a) f5a (f5b) | | description: | | C2 | | | | | | diff --git a/f1e b/f1e | | --- a/f1e | | +++ b/f1e | | @@ -1,1 +1,1 @@ | | -c1a | | +c1c | | diff --git a/f2a b/f2c | | rename from f2a | | rename to f2c | | diff --git a/f5b b/f5a | | rename from f5b | | rename to f5a | | --- a/f5b | | +++ b/f5a | | @@ -1,1 +1,1 @@ | | -c5a | | +c5c | | | | o changeset: 8:ba67f08fb15a | | | parent: 0:11f7a1b56675 | | | user: test | | | date: Thu Jan 01 00:00:00 1970 +0000 | | | files: f1g | | | copies: f1g (f1a) | | | description: | | | G0 | | | | | | | | | diff --git a/f1a b/f1g | | | copy from f1a | | | copy to f1g | | | --- a/f1a | | | +++ b/f1g | | | @@ -1,1 +1,1 @@ | | | -c1a | | | +c1g | | | | | | o changeset: 7:d376ab0d7fda | | |/ parent: 0:11f7a1b56675 | | | user: test | | | date: Thu Jan 01 00:00:00 1970 +0000 | | | files: f1f | | | copies: f1f (f1a) | | | description: | | | F0 | | | | | | | | | diff --git a/f1a b/f1f | | | copy from f1a | | | copy to f1f | | | | o | changeset: 6:6bd1736cab86 | |/ parent: 0:11f7a1b56675 | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | files: f1a f1e f2a f3a f3e f4a f4e f5a f5b | | copies: f1e (f1a) f3e (f3a) f4e (f4a) f5b (f5a) | | description: | | E0 | | | | | | diff --git a/f1a b/f1e | | rename from f1a | | rename to f1e | | diff --git a/f2a b/f2a | | --- a/f2a | | +++ b/f2a | | @@ -1,1 +1,1 @@ | | -c2a | | +c2e | | diff --git a/f3a b/f3e | | rename from f3a | | rename to f3e | | diff --git a/f4a b/f4e | | rename from f4a | | rename to f4e | | diff --git a/f5a b/f5b | | rename from f5a | | rename to f5b | | | | o changeset: 5:560daee679da | | | user: test | | | date: Thu Jan 01 00:00:00 1970 +0000 | | | files: f3d f4a | | | description: | | | D1 | | | | | | | | | diff --git a/f3d b/f3d | | | new file mode 100644 | | | --- /dev/null | | | +++ b/f3d | | | @@ -0,0 +1,1 @@ | | | +c3a | | | diff --git a/f4a b/f4a | | | --- a/f4a | | | +++ b/f4a | | | @@ -1,1 +1,1 @@ | | | -c4a | | | +c4d | | | | | o changeset: 4:c9763722f9bd | |/ parent: 0:11f7a1b56675 | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | files: f1a f2a f2c f5a | | copies: f2c (f2a) | | description: | | C1 | | | | | | diff --git a/f1a b/f1a | | --- a/f1a | | +++ b/f1a | | @@ -1,1 +1,1 @@ | | -c1a | | +c1c | | diff --git a/f2a b/f2c | | rename from f2a | | rename to f2c | | diff --git a/f5a b/f5a | | --- a/f5a | | +++ b/f5a | | @@ -1,1 +1,1 @@ | | -c5a | | +c5c | | +---o changeset: 3:b69f5839d2d9 | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | files: f3b f3d f4a | | copies: f3d (f3b) | | description: | | D0 | | | | | | diff --git a/f3b b/f3d | | rename from f3b | | rename to f3d | | diff --git a/f4a b/f4a | | --- a/f4a | | +++ b/f4a | | @@ -1,1 +1,1 @@ | | -c4a | | +c4d | | o | changeset: 2:f58c7e2b28fa | | user: test | | date: Thu Jan 01 00:00:00 1970 +0000 | | files: f1b f2a f2c f5a f5b | | copies: f2c (f2a) f5a (f5b) | | description: | | C0 | | | | | | diff --git a/f1b b/f1b | | --- a/f1b | | +++ b/f1b | | @@ -1,1 +1,1 @@ | | -c1a | | +c1c | | diff --git a/f2a b/f2c | | rename from f2a | | rename to f2c | | diff --git a/f5b b/f5a | | rename from f5b | | rename to f5a | | --- a/f5b | | +++ b/f5a | | @@ -1,1 +1,1 @@ | | -c5a | | +c5c | | o | changeset: 1:3d7bba921b5d |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | files: f1a f1b f3a f3b f5a f5b | copies: f1b (f1a) f3b (f3a) f5b (f5a) | description: | B0 | | | diff --git a/f1a b/f1b | rename from f1a | rename to f1b | diff --git a/f3a b/f3b | rename from f3a | rename to f3b | diff --git a/f5a b/f5b | rename from f5a | rename to f5b | o changeset: 0:11f7a1b56675 user: test date: Thu Jan 01 00:00:00 1970 +0000 files: f1a f2a f3a f4a f5a description: A0 diff --git a/f1a b/f1a new file mode 100644 --- /dev/null +++ b/f1a @@ -0,0 +1,1 @@ +c1a diff --git a/f2a b/f2a new file mode 100644 --- /dev/null +++ b/f2a @@ -0,0 +1,1 @@ +c2a diff --git a/f3a b/f3a new file mode 100644 --- /dev/null +++ b/f3a @@ -0,0 +1,1 @@ +c3a diff --git a/f4a b/f4a new file mode 100644 --- /dev/null +++ b/f4a @@ -0,0 +1,1 @@ +c4a diff --git a/f5a b/f5a new file mode 100644 --- /dev/null +++ b/f5a @@ -0,0 +1,1 @@ +c5a Check superfluous filemerge of files renamed in the past but untouched by graft $ echo a > a $ hg ci -qAma $ hg mv a b $ echo b > b $ hg ci -qAmb $ echo c > c $ hg ci -qAmc $ hg up -q .~2 $ hg graft tip -qt:fail $ cd .. Graft a change into a new file previously grafted into a renamed directory $ hg init dirmovenewfile $ cd dirmovenewfile $ mkdir a $ echo a > a/a $ hg ci -qAma $ echo x > a/x $ hg ci -qAmx $ hg up -q 0 $ hg mv -q a b $ hg ci -qAmb $ hg graft -q 1 # a/x grafted as b/x, but no copy information recorded $ hg up -q 1 $ echo y > a/x $ hg ci -qAmy $ hg up -q 3 $ hg graft -q 4 $ hg status --change . M b/x Prepare for test of skipped changesets and how merges can influence it: $ hg merge -q -r 1 --tool :local $ hg ci -m m $ echo xx >> b/x $ hg ci -m xx $ hg log -G -T '{rev} {desc|firstline}' @ 7 xx | o 6 m |\ | o 5 y | | +---o 4 y | | | o 3 x | | | o 2 b | | o | 1 x |/ o 0 a Grafting of plain changes correctly detects that 3 and 5 should be skipped: $ hg up -qCr 4 $ hg graft --tool :local -r 2::5 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a) skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1) grafting 2:42127f193bcd "b" Extending the graft range to include a (skipped) merge of 3 will not prevent us from also detecting that both 3 and 5 should be skipped: $ hg up -qCr 4 $ hg graft --tool :local -r 2::7 skipping ungraftable merge revision 6 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a) skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1) grafting 2:42127f193bcd "b" grafting 7:d3c3f2b38ecc "xx" note: graft of 7:d3c3f2b38ecc created no changes to commit $ cd .. Grafted revision should be warned and skipped only once. (issue6024) $ mkdir issue6024 $ cd issue6024 $ hg init base $ cd base $ touch x $ hg commit -qAminit $ echo a > x $ hg commit -mchange $ hg update -q 0 $ hg graft -r 1 grafting 1:a0b923c546aa "change" (tip) $ cd .. $ hg clone -qr 2 base clone $ cd clone $ hg pull -q $ hg merge -q 2 $ hg commit -mmerge $ hg update -q 0 $ hg graft -r 1 grafting 1:04fc6d444368 "change" $ hg update -q 3 $ hg log -G -T '{rev}:{node|shortest} <- {extras.source|shortest}\n' o 4:4e16 <- a0b9 | | @ 3:f0ac <- | |\ +---o 2:a0b9 <- | | | o 1:04fc <- a0b9 |/ o 0:7848 <- the source of rev 4 is an ancestor of the working parent, and was also grafted as rev 1. it should be stripped from the target revisions only once. $ hg graft -r 4 skipping already grafted revision 4:4e16bab40c9c (1:04fc6d444368 also has origin 2:a0b923c546aa) [255] $ cd ../.. mercurial-5.3.1/tests/test-gendoc-fr.t0000644015407300116100000000012413627755405017556 0ustar augieeng00000000000000#require docutils gettext $ $TESTDIR/check-gendoc fr checking for parse errors mercurial-5.3.1/tests/test-upgrade-repo.t0000644015407300116100000017505313627755405020322 0ustar augieeng00000000000000#require no-reposimplestore $ cat >> $HGRCPATH << EOF > [extensions] > share = > EOF store and revlogv1 are required in source $ hg --config format.usestore=false init no-store $ hg -R no-store debugupgraderepo abort: cannot upgrade repository; requirement missing: store [255] $ hg init no-revlogv1 $ cat > no-revlogv1/.hg/requires << EOF > dotencode > fncache > generaldelta > store > EOF $ hg -R no-revlogv1 debugupgraderepo abort: cannot upgrade repository; requirement missing: revlogv1 [255] Cannot upgrade shared repositories $ hg init share-parent $ hg -q share share-parent share-child $ hg -R share-child debugupgraderepo abort: cannot upgrade repository; unsupported source requirement: shared [255] Do not yet support upgrading treemanifest repos $ hg --config experimental.treemanifest=true init treemanifest $ hg -R treemanifest debugupgraderepo abort: cannot upgrade repository; unsupported source requirement: treemanifest [255] Cannot add treemanifest requirement during upgrade $ hg init disallowaddedreq $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo abort: cannot upgrade repository; do not support adding requirement: treemanifest [255] An upgrade of a repository created with recommended settings only suggests optimizations $ hg init empty $ cd empty $ hg debugformat format-variant repo fncache: yes dotencode: yes generaldelta: yes sparserevlog: yes sidedata: no copies-sdc: no plain-cl-delta: yes compression: zlib compression-level: default $ hg debugformat --verbose format-variant repo config default fncache: yes yes yes dotencode: yes yes yes generaldelta: yes yes yes sparserevlog: yes yes yes sidedata: no no no copies-sdc: no no no plain-cl-delta: yes yes yes compression: zlib zlib zlib compression-level: default default default $ hg debugformat --verbose --config format.usefncache=no format-variant repo config default fncache: yes no yes dotencode: yes no yes generaldelta: yes yes yes sparserevlog: yes yes yes sidedata: no no no copies-sdc: no no no plain-cl-delta: yes yes yes compression: zlib zlib zlib compression-level: default default default $ hg debugformat --verbose --config format.usefncache=no --color=debug format-variant repo config default [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes] [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes] [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes] [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes] [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes] [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] [formatvariant.name.uptodate|compression-level:][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default] $ hg debugformat -Tjson [ { "config": true, "default": true, "name": "fncache", "repo": true }, { "config": true, "default": true, "name": "dotencode", "repo": true }, { "config": true, "default": true, "name": "generaldelta", "repo": true }, { "config": true, "default": true, "name": "sparserevlog", "repo": true }, { "config": false, "default": false, "name": "sidedata", "repo": false }, { "config": false, "default": false, "name": "copies-sdc", "repo": false }, { "config": true, "default": true, "name": "plain-cl-delta", "repo": true }, { "config": "zlib", "default": "zlib", "name": "compression", "repo": "zlib" }, { "config": "default", "default": "default", "name": "compression-level", "repo": "default" } ] $ hg debugupgraderepo (no feature deficiencies found in existing repository) performing an upgrade with "--run" will make the following changes: requirements preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. additional optimizations are available by specifying "--optimize ": re-delta-parent deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower re-delta-multibase deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges re-delta-all deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed re-delta-fulladd every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved. --optimize can be used to add optimizations $ hg debugupgrade --optimize redeltaparent (no feature deficiencies found in existing repository) performing an upgrade with "--run" will make the following changes: requirements preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. re-delta-parent deltas within internal storage will choose a new base revision if needed additional optimizations are available by specifying "--optimize ": re-delta-multibase deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges re-delta-all deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed re-delta-fulladd every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved. modern form of the option $ hg debugupgrade --optimize re-delta-parent (no feature deficiencies found in existing repository) performing an upgrade with "--run" will make the following changes: requirements preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. re-delta-parent deltas within internal storage will choose a new base revision if needed additional optimizations are available by specifying "--optimize ": re-delta-multibase deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges re-delta-all deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed re-delta-fulladd every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved. unknown optimization: $ hg debugupgrade --optimize foobar abort: unknown optimization action requested: foobar (run without arguments to see valid optimizations) [255] Various sub-optimal detections work $ cat > .hg/requires << EOF > revlogv1 > store > EOF $ hg debugformat format-variant repo fncache: no dotencode: no generaldelta: no sparserevlog: no sidedata: no copies-sdc: no plain-cl-delta: yes compression: zlib compression-level: default $ hg debugformat --verbose format-variant repo config default fncache: no yes yes dotencode: no yes yes generaldelta: no yes yes sparserevlog: no yes yes sidedata: no no no copies-sdc: no no no plain-cl-delta: yes yes yes compression: zlib zlib zlib compression-level: default default default $ hg debugformat --verbose --config format.usegeneraldelta=no format-variant repo config default fncache: no yes yes dotencode: no yes yes generaldelta: no no yes sparserevlog: no no yes sidedata: no no no copies-sdc: no no no plain-cl-delta: yes yes yes compression: zlib zlib zlib compression-level: default default default $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug format-variant repo config default [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes] [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes] [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes] [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes] [formatvariant.name.uptodate|sidedata: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes] [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] [formatvariant.name.uptodate|compression-level:][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default] $ hg debugupgraderepo repository lacks features recommended by current config options: fncache long and reserved filenames may not work correctly; repository performance is sub-optimal dotencode storage of filenames beginning with a period or space may not work correctly generaldelta deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower sparserevlog in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange. performing an upgrade with "--run" will make the following changes: requirements preserved: revlogv1, store added: dotencode, fncache, generaldelta, sparserevlog fncache repository will be more resilient to storing certain paths and performance of certain operations should be improved dotencode repository will be better able to store files beginning with a space or period generaldelta repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster sparserevlog Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server. sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. additional optimizations are available by specifying "--optimize ": re-delta-parent deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower re-delta-multibase deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges re-delta-all deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed re-delta-fulladd every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved. $ hg --config format.dotencode=false debugupgraderepo repository lacks features recommended by current config options: fncache long and reserved filenames may not work correctly; repository performance is sub-optimal generaldelta deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower sparserevlog in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange. repository lacks features used by the default config options: dotencode storage of filenames beginning with a period or space may not work correctly performing an upgrade with "--run" will make the following changes: requirements preserved: revlogv1, store added: fncache, generaldelta, sparserevlog fncache repository will be more resilient to storing certain paths and performance of certain operations should be improved generaldelta repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster sparserevlog Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server. sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. additional optimizations are available by specifying "--optimize ": re-delta-parent deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower re-delta-multibase deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges re-delta-all deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed re-delta-fulladd every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved. $ cd .. Upgrading a repository that is already modern essentially no-ops $ hg init modern $ hg -R modern debugupgraderepo --run upgrade will perform the following actions: requirements preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/modern/.hg/upgrade.* (glob) (it is safe to interrupt this process any time before data migration completes) data fully migrated to temporary repository marking source repository as being upgraded; clients will be unable to read from repository starting in-place swap of repository data replaced files will be backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob) replacing store... store replacement complete; repository was inconsistent for *s (glob) finalizing requirements file and making repository readable again removing temporary repository $TESTTMP/modern/.hg/upgrade.* (glob) copy of old repository backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob) the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified Upgrading a repository to generaldelta works $ hg --config format.usegeneraldelta=false init upgradegd $ cd upgradegd $ touch f0 $ hg -q commit -A -m initial $ mkdir FooBarDirectory.d $ touch FooBarDirectory.d/f1 $ hg -q commit -A -m 'add f1' $ hg -q up -r 0 >>> from __future__ import absolute_import, print_function >>> import random >>> random.seed(0) # have a reproducible content >>> with open("f2", "wb") as f: ... for i in range(100000): ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None $ hg -q commit -A -m 'add f2' make sure we have a .d file $ ls -d .hg/store/data/* .hg/store/data/_foo_bar_directory.d.hg .hg/store/data/f0.i .hg/store/data/f2.d .hg/store/data/f2.i $ hg debugupgraderepo --run --config format.sparse-revlog=false upgrade will perform the following actions: requirements preserved: dotencode, fncache, revlogv1, store added: generaldelta generaldelta repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) (it is safe to interrupt this process any time before data migration completes) migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog) migrating 519 KB in store; 1.05 MB tracked data migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data) finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data) finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data) finished migrating 3 changelog revisions; change in size: 0 bytes finished migrating 9 total revisions; total change in store size: -17 bytes copying phaseroots data fully migrated to temporary repository marking source repository as being upgraded; clients will be unable to read from repository starting in-place swap of repository data replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob) replacing store... store replacement complete; repository was inconsistent for *s (glob) finalizing requirements file and making repository readable again removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob) copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob) the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified Original requirements backed up $ cat .hg/upgradebackup.*/requires dotencode fncache revlogv1 store generaldelta added to original requirements files $ cat .hg/requires dotencode fncache generaldelta revlogv1 store store directory has files we expect $ ls .hg/store 00changelog.i 00manifest.i data fncache phaseroots undo undo.backupfiles undo.phaseroots manifest should be generaldelta $ hg debugrevlog -m | grep flags flags : inline, generaldelta verify should be happy $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 3 changesets with 3 changes to 3 files old store should be backed up $ ls -d .hg/upgradebackup.*/ .hg/upgradebackup.*/ (glob) $ ls .hg/upgradebackup.*/store 00changelog.i 00manifest.i data fncache phaseroots undo undo.backup.fncache undo.backupfiles undo.phaseroots unless --no-backup is passed $ rm -rf .hg/upgradebackup.*/ $ hg debugupgraderepo --run --no-backup upgrade will perform the following actions: requirements preserved: dotencode, fncache, generaldelta, revlogv1, store added: sparserevlog sparserevlog Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server. sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) (it is safe to interrupt this process any time before data migration completes) migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog) migrating 519 KB in store; 1.05 MB tracked data migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data) finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data) finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data) finished migrating 3 changelog revisions; change in size: 0 bytes finished migrating 9 total revisions; total change in store size: 0 bytes copying phaseroots data fully migrated to temporary repository marking source repository as being upgraded; clients will be unable to read from repository starting in-place swap of repository data replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob) replacing store... store replacement complete; repository was inconsistent for * (glob) finalizing requirements file and making repository readable again removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob) removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob) $ ls -1 .hg/ | grep upgradebackup [1] We can restrict optimization to some revlog: $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback upgrade will perform the following actions: requirements preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. re-delta-parent deltas within internal storage will choose a new base revision if needed beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) (it is safe to interrupt this process any time before data migration completes) migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog) migrating 519 KB in store; 1.05 MB tracked data migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data) blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions blindly copying data/f0.i containing 1 revisions blindly copying data/f2.i containing 1 revisions finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data) cloning 3 revisions from 00manifest.i finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data) blindly copying 00changelog.i containing 3 revisions finished migrating 3 changelog revisions; change in size: 0 bytes finished migrating 9 total revisions; total change in store size: 0 bytes copying phaseroots data fully migrated to temporary repository marking source repository as being upgraded; clients will be unable to read from repository starting in-place swap of repository data replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob) replacing store... store replacement complete; repository was inconsistent for *s (glob) finalizing requirements file and making repository readable again removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob) removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob) Check that the repo still works fine $ hg log -G --stat @ changeset: 2:76d4395f5413 (no-py3 !) @ changeset: 2:fca376863211 (py3 !) | tag: tip | parent: 0:ba592bf28da2 | user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: add f2 | | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | 1 files changed, 100000 insertions(+), 0 deletions(-) | | o changeset: 1:2029ce2354e2 |/ user: test | date: Thu Jan 01 00:00:00 1970 +0000 | summary: add f1 | | o changeset: 0:ba592bf28da2 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: initial $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 3 changesets with 3 changes to 3 files Check we can select negatively $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback upgrade will perform the following actions: requirements preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. re-delta-parent deltas within internal storage will choose a new base revision if needed beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) (it is safe to interrupt this process any time before data migration completes) migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog) migrating 519 KB in store; 1.05 MB tracked data migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data) cloning 1 revisions from data/FooBarDirectory.d/f1.i cloning 1 revisions from data/f0.i cloning 1 revisions from data/f2.i finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data) blindly copying 00manifest.i containing 3 revisions finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data) cloning 3 revisions from 00changelog.i finished migrating 3 changelog revisions; change in size: 0 bytes finished migrating 9 total revisions; total change in store size: 0 bytes copying phaseroots data fully migrated to temporary repository marking source repository as being upgraded; clients will be unable to read from repository starting in-place swap of repository data replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob) replacing store... store replacement complete; repository was inconsistent for *s (glob) finalizing requirements file and making repository readable again removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob) removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob) $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 3 changesets with 3 changes to 3 files Check that we can select changelog only $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback upgrade will perform the following actions: requirements preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. re-delta-parent deltas within internal storage will choose a new base revision if needed beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) (it is safe to interrupt this process any time before data migration completes) migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog) migrating 519 KB in store; 1.05 MB tracked data migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data) blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions blindly copying data/f0.i containing 1 revisions blindly copying data/f2.i containing 1 revisions finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data) blindly copying 00manifest.i containing 3 revisions finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data) cloning 3 revisions from 00changelog.i finished migrating 3 changelog revisions; change in size: 0 bytes finished migrating 9 total revisions; total change in store size: 0 bytes copying phaseroots data fully migrated to temporary repository marking source repository as being upgraded; clients will be unable to read from repository starting in-place swap of repository data replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob) replacing store... store replacement complete; repository was inconsistent for *s (glob) finalizing requirements file and making repository readable again removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob) removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob) $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 3 changesets with 3 changes to 3 files Check that we can select filelog only $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback upgrade will perform the following actions: requirements preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. re-delta-parent deltas within internal storage will choose a new base revision if needed beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) (it is safe to interrupt this process any time before data migration completes) migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog) migrating 519 KB in store; 1.05 MB tracked data migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data) cloning 1 revisions from data/FooBarDirectory.d/f1.i cloning 1 revisions from data/f0.i cloning 1 revisions from data/f2.i finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data) blindly copying 00manifest.i containing 3 revisions finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data) blindly copying 00changelog.i containing 3 revisions finished migrating 3 changelog revisions; change in size: 0 bytes finished migrating 9 total revisions; total change in store size: 0 bytes copying phaseroots data fully migrated to temporary repository marking source repository as being upgraded; clients will be unable to read from repository starting in-place swap of repository data replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob) replacing store... store replacement complete; repository was inconsistent for *s (glob) finalizing requirements file and making repository readable again removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob) removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob) $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 3 changesets with 3 changes to 3 files Check you can't skip revlog clone during important format downgrade $ echo "[format]" > .hg/hgrc $ echo "sparse-revlog=no" >> .hg/hgrc $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback ignoring revlogs selection flags, format requirements change: sparserevlog upgrade will perform the following actions: requirements preserved: dotencode, fncache, generaldelta, revlogv1, store removed: sparserevlog sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. re-delta-parent deltas within internal storage will choose a new base revision if needed beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) (it is safe to interrupt this process any time before data migration completes) migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog) migrating 519 KB in store; 1.05 MB tracked data migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data) cloning 1 revisions from data/FooBarDirectory.d/f1.i cloning 1 revisions from data/f0.i cloning 1 revisions from data/f2.i finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data) cloning 3 revisions from 00manifest.i finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data) cloning 3 revisions from 00changelog.i finished migrating 3 changelog revisions; change in size: 0 bytes finished migrating 9 total revisions; total change in store size: 0 bytes copying phaseroots data fully migrated to temporary repository marking source repository as being upgraded; clients will be unable to read from repository starting in-place swap of repository data replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob) replacing store... store replacement complete; repository was inconsistent for *s (glob) finalizing requirements file and making repository readable again removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob) removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob) $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 3 changesets with 3 changes to 3 files Check you can't skip revlog clone during important format upgrade $ echo "sparse-revlog=yes" >> .hg/hgrc $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback ignoring revlogs selection flags, format requirements change: sparserevlog upgrade will perform the following actions: requirements preserved: dotencode, fncache, generaldelta, revlogv1, store added: sparserevlog sparserevlog Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server. sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. re-delta-parent deltas within internal storage will choose a new base revision if needed beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) (it is safe to interrupt this process any time before data migration completes) migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog) migrating 519 KB in store; 1.05 MB tracked data migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data) cloning 1 revisions from data/FooBarDirectory.d/f1.i cloning 1 revisions from data/f0.i cloning 1 revisions from data/f2.i finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data) cloning 3 revisions from 00manifest.i finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data) cloning 3 revisions from 00changelog.i finished migrating 3 changelog revisions; change in size: 0 bytes finished migrating 9 total revisions; total change in store size: 0 bytes copying phaseroots data fully migrated to temporary repository marking source repository as being upgraded; clients will be unable to read from repository starting in-place swap of repository data replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob) replacing store... store replacement complete; repository was inconsistent for *s (glob) finalizing requirements file and making repository readable again removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob) removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob) $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 3 changesets with 3 changes to 3 files $ cd .. store files with special filenames aren't encoded during copy $ hg init store-filenames $ cd store-filenames $ touch foo $ hg -q commit -A -m initial $ touch .hg/store/.XX_special_filename $ hg debugupgraderepo --run upgrade will perform the following actions: requirements preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob) (it is safe to interrupt this process any time before data migration completes) migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog) migrating 301 bytes in store; 107 bytes tracked data migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data) finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data) finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data) finished migrating 1 changelog revisions; change in size: 0 bytes finished migrating 3 total revisions; total change in store size: 0 bytes copying .XX_special_filename copying phaseroots data fully migrated to temporary repository marking source repository as being upgraded; clients will be unable to read from repository starting in-place swap of repository data replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob) replacing store... store replacement complete; repository was inconsistent for *s (glob) finalizing requirements file and making repository readable again removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob) copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob) the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified $ hg debugupgraderepo --run --optimize redeltafulladd upgrade will perform the following actions: requirements preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. re-delta-fulladd each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob) (it is safe to interrupt this process any time before data migration completes) migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog) migrating 301 bytes in store; 107 bytes tracked data migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data) finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data) finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data) finished migrating 1 changelog revisions; change in size: 0 bytes finished migrating 3 total revisions; total change in store size: 0 bytes copying .XX_special_filename copying phaseroots data fully migrated to temporary repository marking source repository as being upgraded; clients will be unable to read from repository starting in-place swap of repository data replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob) replacing store... store replacement complete; repository was inconsistent for *s (glob) finalizing requirements file and making repository readable again removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob) copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob) the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified fncache is valid after upgrade $ hg debugrebuildfncache fncache already up to date $ cd .. Check upgrading a large file repository --------------------------------------- $ hg init largefilesrepo $ cat << EOF >> largefilesrepo/.hg/hgrc > [extensions] > largefiles = > EOF $ cd largefilesrepo $ touch foo $ hg add --large foo $ hg -q commit -m initial $ cat .hg/requires dotencode fncache generaldelta largefiles revlogv1 sparserevlog store $ hg debugupgraderepo --run upgrade will perform the following actions: requirements preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, sparserevlog, store sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob) (it is safe to interrupt this process any time before data migration completes) migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog) migrating 355 bytes in store; 160 bytes tracked data migrating 1 filelogs containing 1 revisions (106 bytes in store; 41 bytes tracked data) finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes migrating 1 manifests containing 1 revisions (116 bytes in store; 51 bytes tracked data) finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes migrating changelog containing 1 revisions (133 bytes in store; 68 bytes tracked data) finished migrating 1 changelog revisions; change in size: 0 bytes finished migrating 3 total revisions; total change in store size: 0 bytes copying phaseroots data fully migrated to temporary repository marking source repository as being upgraded; clients will be unable to read from repository starting in-place swap of repository data replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob) replacing store... store replacement complete; repository was inconsistent for *s (glob) finalizing requirements file and making repository readable again removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob) copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob) the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified $ cat .hg/requires dotencode fncache generaldelta largefiles revlogv1 sparserevlog store $ cat << EOF >> .hg/hgrc > [extensions] > lfs = > [lfs] > threshold = 10 > EOF $ echo '123456789012345' > lfs.bin $ hg ci -Am 'lfs.bin' adding lfs.bin $ grep lfs .hg/requires lfs $ find .hg/store/lfs -type f .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f $ hg debugupgraderepo --run upgrade will perform the following actions: requirements preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, sparserevlog, store sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob) (it is safe to interrupt this process any time before data migration completes) migrating 6 total revisions (2 in filelogs, 2 in manifests, 2 in changelog) migrating 801 bytes in store; 467 bytes tracked data migrating 2 filelogs containing 2 revisions (296 bytes in store; 182 bytes tracked data) finished migrating 2 filelog revisions across 2 filelogs; change in size: 0 bytes migrating 1 manifests containing 2 revisions (241 bytes in store; 151 bytes tracked data) finished migrating 2 manifest revisions across 1 manifests; change in size: 0 bytes migrating changelog containing 2 revisions (264 bytes in store; 134 bytes tracked data) finished migrating 2 changelog revisions; change in size: 0 bytes finished migrating 6 total revisions; total change in store size: 0 bytes copying phaseroots copying lfs blob d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f data fully migrated to temporary repository marking source repository as being upgraded; clients will be unable to read from repository starting in-place swap of repository data replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob) replacing store... store replacement complete; repository was inconsistent for *s (glob) finalizing requirements file and making repository readable again removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob) copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob) the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified $ grep lfs .hg/requires lfs $ find .hg/store/lfs -type f .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 2 changesets with 2 changes to 2 files $ hg debugdata lfs.bin 0 version https://git-lfs.github.com/spec/v1 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f size 16 x-is-binary 0 $ cd .. repository config is taken in account ------------------------------------- $ cat << EOF >> $HGRCPATH > [format] > maxchainlen = 1 > EOF $ hg init localconfig $ cd localconfig $ cat << EOF > file > some content > with some length > to make sure we get a delta > after changes > very long > very long > very long > very long > very long > very long > very long > very long > very long > very long > very long > EOF $ hg -q commit -A -m A $ echo "new line" >> file $ hg -q commit -m B $ echo "new line" >> file $ hg -q commit -m C $ cat << EOF >> .hg/hgrc > [format] > maxchainlen = 9001 > EOF $ hg config format format.maxchainlen=9001 $ hg debugdeltachain file rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1 $ hg debugupgraderepo --run --optimize redeltaall upgrade will perform the following actions: requirements preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store sidedata Allows storage of extra data alongside a revision. copies-sdc Allows to use more efficient algorithm to deal with copy tracing. re-delta-all deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/localconfig/.hg/upgrade.* (glob) (it is safe to interrupt this process any time before data migration completes) migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog) migrating 1019 bytes in store; 882 bytes tracked data migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data) finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data) finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data) finished migrating 3 changelog revisions; change in size: 0 bytes finished migrating 9 total revisions; total change in store size: -9 bytes copying phaseroots data fully migrated to temporary repository marking source repository as being upgraded; clients will be unable to read from repository starting in-place swap of repository data replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob) replacing store... store replacement complete; repository was inconsistent for *s (glob) finalizing requirements file and making repository readable again removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob) copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob) the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified $ hg debugdeltachain file rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1 $ cd .. $ cat << EOF >> $HGRCPATH > [format] > maxchainlen = 9001 > EOF Check upgrading a sparse-revlog repository --------------------------------------- $ hg init sparserevlogrepo --config format.sparse-revlog=no $ cd sparserevlogrepo $ touch foo $ hg add foo $ hg -q commit -m "foo" $ cat .hg/requires dotencode fncache generaldelta revlogv1 store Check that we can add the sparse-revlog format requirement $ hg --config format.sparse-revlog=yes debugupgraderepo --run >/dev/null copy of old repository backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob) the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified $ cat .hg/requires dotencode fncache generaldelta revlogv1 sparserevlog store Check that we can remove the sparse-revlog format requirement $ hg --config format.sparse-revlog=no debugupgraderepo --run >/dev/null copy of old repository backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob) the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified $ cat .hg/requires dotencode fncache generaldelta revlogv1 store #if zstd Check upgrading to a zstd revlog -------------------------------- upgrade $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup >/dev/null $ hg debugformat -v format-variant repo config default fncache: yes yes yes dotencode: yes yes yes generaldelta: yes yes yes sparserevlog: yes yes yes sidedata: no no no copies-sdc: no no no plain-cl-delta: yes yes yes compression: zstd zlib zlib compression-level: default default default $ cat .hg/requires dotencode fncache generaldelta revlog-compression-zstd revlogv1 sparserevlog store downgrade $ hg debugupgraderepo --run --no-backup > /dev/null $ hg debugformat -v format-variant repo config default fncache: yes yes yes dotencode: yes yes yes generaldelta: yes yes yes sparserevlog: yes yes yes sidedata: no no no copies-sdc: no no no plain-cl-delta: yes yes yes compression: zlib zlib zlib compression-level: default default default $ cat .hg/requires dotencode fncache generaldelta revlogv1 sparserevlog store upgrade from hgrc $ cat >> .hg/hgrc << EOF > [format] > revlog-compression=zstd > EOF $ hg debugupgraderepo --run --no-backup > /dev/null $ hg debugformat -v format-variant repo config default fncache: yes yes yes dotencode: yes yes yes generaldelta: yes yes yes sparserevlog: yes yes yes sidedata: no no no copies-sdc: no no no plain-cl-delta: yes yes yes compression: zstd zstd zlib compression-level: default default default $ cat .hg/requires dotencode fncache generaldelta revlog-compression-zstd revlogv1 sparserevlog store #endif Check upgrading to a side-data revlog ------------------------------------- upgrade $ hg --config format.exp-use-side-data=yes debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" >/dev/null $ hg debugformat -v format-variant repo config default fncache: yes yes yes dotencode: yes yes yes generaldelta: yes yes yes sparserevlog: yes yes yes sidedata: yes no no copies-sdc: no no no plain-cl-delta: yes yes yes compression: zstd zstd zlib (zstd !) compression: zlib zlib zlib (no-zstd !) compression-level: default default default $ cat .hg/requires dotencode exp-sidedata-flag fncache generaldelta revlog-compression-zstd (zstd !) revlogv1 sparserevlog store $ hg debugsidedata -c 0 2 sidedata entries entry-0001 size 4 entry-0002 size 32 downgrade $ hg debugupgraderepo --config format.exp-use-side-data=no --run --no-backup > /dev/null $ hg debugformat -v format-variant repo config default fncache: yes yes yes dotencode: yes yes yes generaldelta: yes yes yes sparserevlog: yes yes yes sidedata: no no no copies-sdc: no no no plain-cl-delta: yes yes yes compression: zstd zstd zlib (zstd !) compression: zlib zlib zlib (no-zstd !) compression-level: default default default $ cat .hg/requires dotencode fncache generaldelta revlog-compression-zstd (zstd !) revlogv1 sparserevlog store $ hg debugsidedata -c 0 upgrade from hgrc $ cat >> .hg/hgrc << EOF > [format] > exp-use-side-data=yes > EOF $ hg debugupgraderepo --run --no-backup > /dev/null $ hg debugformat -v format-variant repo config default fncache: yes yes yes dotencode: yes yes yes generaldelta: yes yes yes sparserevlog: yes yes yes sidedata: yes yes no copies-sdc: no no no plain-cl-delta: yes yes yes compression: zstd zstd zlib (zstd !) compression: zlib zlib zlib (no-zstd !) compression-level: default default default $ cat .hg/requires dotencode exp-sidedata-flag fncache generaldelta revlog-compression-zstd (zstd !) revlogv1 sparserevlog store $ hg debugsidedata -c 0 mercurial-5.3.1/tests/test-push-checkheads-pruned-B6.t0000644015407300116100000000361413627755405022520 0ustar augieeng00000000000000==================================== Testing head checking code: Case B-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 B: simple case involving pruned changesets TestCase 6: single changesets, pruned then superseeded (on a new changeset) .. old-state: .. .. * 1 changeset branch .. .. new-state: .. .. * old branch is rewritten onto another one, .. * the new version is then pruned. .. .. expected-result: .. .. * push allowed .. .. graph-summary: .. .. A ø⇠⊗ A' .. | | .. | ◔ B .. |/ .. ◠$ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir B6 $ cd B6 $ 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)"` 1 new obsolescence markers obsoleted 1 changesets $ hg debugobsolete --record-parents `getid "desc(A1)"` 1 new obsolescence markers 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/B6/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-5.3.1/tests/test-contrib-dumprevlog.t0000644015407300116100000000433213627755405021541 0ustar augieeng00000000000000#require reporevlogstore $ CONTRIBDIR="$TESTDIR/../contrib" $ hg init repo-a $ cd repo-a $ echo this is file a > a $ hg add a $ hg commit -m first $ echo adding to file a >> a $ hg commit -m second $ echo adding more to file a >> a $ hg commit -m third $ hg verify checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 3 changesets with 3 changes to 1 files Dumping revlog of file a to stdout: $ "$PYTHON" "$CONTRIBDIR/dumprevlog" .hg/store/data/a.i file: .hg/store/data/a.i node: 183d2312b35066fb6b3b449b84efc370d50993d0 linkrev: 0 parents: 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 length: 15 -start- this is file a -end- node: b1047953b6e6b633c0d8197eaa5116fbdfd3095b linkrev: 1 parents: 183d2312b35066fb6b3b449b84efc370d50993d0 0000000000000000000000000000000000000000 length: 32 -start- this is file a adding to file a -end- node: 8c4fd1f7129b8cdec6c7f58bf48fb5237a4030c1 linkrev: 2 parents: b1047953b6e6b633c0d8197eaa5116fbdfd3095b 0000000000000000000000000000000000000000 length: 54 -start- this is file a adding to file a adding more to file a -end- Dump all revlogs to file repo.dump: $ find .hg/store -name "*.i" | sort | xargs "$PYTHON" "$CONTRIBDIR/dumprevlog" > ../repo.dump $ cd .. Undumping into repo-b: $ hg init repo-b $ cd repo-b $ "$PYTHON" "$CONTRIBDIR/undumprevlog" < ../repo.dump .hg/store/00changelog.i .hg/store/00manifest.i .hg/store/data/a.i $ cd .. Rebuild fncache with clone --pull: $ hg clone --pull -U repo-b repo-c requesting all changes adding changesets adding manifests adding file changes added 3 changesets with 3 changes to 1 files new changesets de1da620e7d8:46946d278c50 Verify: $ hg -R repo-c verify checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 3 changesets with 3 changes to 1 files Compare repos: $ hg -R repo-c incoming repo-a comparing with repo-a searching for changes no changes found [1] $ hg -R repo-a incoming repo-c comparing with repo-c searching for changes no changes found [1] mercurial-5.3.1/tests/test-contrib.t0000644015407300116100000000744213627755405017364 0ustar augieeng00000000000000Set vars: $ CONTRIBDIR="$TESTDIR/../contrib" Test simplemerge command: $ cp "$CONTRIBDIR/simplemerge" . $ echo base > base $ echo local > local $ cat base >> local $ cp local orig $ cat base > other $ echo other >> other changing local directly $ "$PYTHON" simplemerge local base other && echo "merge succeeded" merge succeeded $ cat local local base other $ cp orig local printing to stdout $ "$PYTHON" simplemerge -p local base other local base other local: $ cat local local base conflicts $ cp base conflict-local $ cp other conflict-other $ echo not other >> conflict-local $ echo end >> conflict-local $ echo end >> conflict-other $ "$PYTHON" simplemerge -p conflict-local base conflict-other base <<<<<<< conflict-local not other ======= other >>>>>>> conflict-other end [1] 1 label $ "$PYTHON" simplemerge -p -L foo conflict-local base conflict-other base <<<<<<< foo not other ======= other >>>>>>> conflict-other end [1] 2 labels $ "$PYTHON" simplemerge -p -L foo -L bar conflict-local base conflict-other base <<<<<<< foo not other ======= other >>>>>>> bar end [1] 3 labels $ "$PYTHON" simplemerge -p -L foo -L bar -L base conflict-local base conflict-other base <<<<<<< foo not other end ||||||| base ======= other end >>>>>>> bar [1] too many labels $ "$PYTHON" simplemerge -p -L foo -L bar -L baz -L buz conflict-local base conflict-other abort: can only specify three labels. [255] binary file $ "$PYTHON" -c "f = open('binary-local', 'w'); f.write('\x00'); f.close()" $ cat orig >> binary-local $ "$PYTHON" simplemerge -p binary-local base other warning: binary-local looks like a binary file. [1] binary file --text $ "$PYTHON" simplemerge -a -p binary-local base other 2>&1 warning: binary-local looks like a binary file. \x00local (esc) base other help $ "$PYTHON" simplemerge --help simplemerge [OPTS] LOCAL BASE OTHER Simple three-way file merge utility with a minimal feature set. Apply to LOCAL the changes necessary to go from BASE to OTHER. By default, LOCAL is overwritten with the results of this operation. options: -L --label labels to use on conflict markers -a --text treat all files as text -p --print print results instead of overwriting LOCAL --no-minimal no effect (DEPRECATED) -h --help display help and exit -q --quiet suppress output wrong number of arguments $ "$PYTHON" simplemerge simplemerge: wrong number of arguments simplemerge [OPTS] LOCAL BASE OTHER Simple three-way file merge utility with a minimal feature set. Apply to LOCAL the changes necessary to go from BASE to OTHER. By default, LOCAL is overwritten with the results of this operation. options: -L --label labels to use on conflict markers -a --text treat all files as text -p --print print results instead of overwriting LOCAL --no-minimal no effect (DEPRECATED) -h --help display help and exit -q --quiet suppress output [1] bad option $ "$PYTHON" simplemerge --foo -p local base other simplemerge: option --foo not recognized simplemerge [OPTS] LOCAL BASE OTHER Simple three-way file merge utility with a minimal feature set. Apply to LOCAL the changes necessary to go from BASE to OTHER. By default, LOCAL is overwritten with the results of this operation. options: -L --label labels to use on conflict markers -a --text treat all files as text -p --print print results instead of overwriting LOCAL --no-minimal no effect (DEPRECATED) -h --help display help and exit -q --quiet suppress output [1] mercurial-5.3.1/tests/test-context-metadata.t0000644015407300116100000000325113627755405021160 0ustar augieeng00000000000000Tests about metadataonlyctx $ hg init $ echo A > A $ hg commit -A A -m 'Add A' $ echo B > B $ hg commit -A B -m 'Add B' $ hg rm A $ echo C > C $ echo B2 > B $ hg add C -q $ hg commit -m 'Remove A' $ cat > metaedit.py < from __future__ import absolute_import > from mercurial import context, pycompat, registrar > cmdtable = {} > command = registrar.command(cmdtable) > @command(b'metaedit') > def metaedit(ui, repo, arg): > # Modify commit message to "FOO" > with repo.wlock(), repo.lock(), repo.transaction(b'metaedit'): > old = repo[b'.'] > kwargs = dict(s.split(b'=', 1) for s in arg.split(b';')) > if b'parents' in kwargs: > kwargs[b'parents'] = map(int, kwargs[b'parents'].split(b',')) > new = context.metadataonlyctx(repo, old, > **pycompat.strkwargs(kwargs)) > new.commit() > EOF $ hg --config extensions.metaedit=$TESTTMP/metaedit.py metaedit 'text=Changed' $ hg log -r tip changeset: 3:ad83e9e00ec9 tag: tip parent: 1:3afb7afe6632 user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: Changed $ hg --config extensions.metaedit=$TESTTMP/metaedit.py metaedit 'parents=0' 2>&1 | egrep '^RuntimeError' RuntimeError: can't reuse the manifest: its p1 doesn't match the new ctx p1 $ hg --config extensions.metaedit=$TESTTMP/metaedit.py metaedit 'user=foo ' $ hg log -r tip changeset: 4:1f86eaeca92b tag: tip parent: 1:3afb7afe6632 user: foo date: Thu Jan 01 00:00:00 1970 +0000 summary: Remove A mercurial-5.3.1/tests/test-issue842.t0000644015407300116100000000132513627755405017304 0ustar augieeng00000000000000https://bz.mercurial-scm.org/842 $ hg init $ echo foo > a $ hg ci -Ama adding a $ hg up -r0000 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo bar > a Should issue new head warning: $ hg ci -Amb adding a created new head $ hg up -r0000 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo stuffy > a Should not issue new head warning: $ hg ci -q -Amc $ hg up -r0000 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo crap > a $ hg branch testing marked working directory as branch testing (branches are permanent and global, did you want a bookmark?) Should not issue warning: $ hg ci -q -Amd mercurial-5.3.1/tests/test-casecollision-merge.t0000644015407300116100000001544113627755405021646 0ustar augieeng00000000000000#require icasefs ################################ test for branch merging ################################ test for rename awareness of case-folding collision check: (1) colliding file is one renamed from collided file: this is also case for issue3370. $ hg init branch_merge_renaming $ cd branch_merge_renaming $ echo a > a $ hg add a $ echo b > b $ hg add b $ hg commit -m '#0' $ hg tag -l A $ hg rename a tmp $ hg rename tmp A $ hg commit -m '#1' $ hg tag -l B $ hg update -q 0 $ touch x $ hg add x $ hg commit -m '#2' created new head $ hg tag -l C $ hg merge -q $ hg status -A M A R a C b C x $ hg update -q --clean 1 $ hg merge -q $ hg status -A M x C A C b $ hg commit -m '(D)' $ hg tag -l D additional test for issue3452: | this assumes the history below. | | (A) -- (C) -- (E) ------- | \ \ \ | \ \ \ | (B) -- (D) -- (F) -- (G) | | A: add file 'a' | B: rename from 'a' to 'A' | C: add 'x' (or operation other than modification of 'a') | D: merge C into B | E: modify 'a' | F: modify 'A' | G: merge E into F | | issue3452 occurs when (B) is recorded before (C) $ hg update -q --clean C $ echo "modify 'a' at (E)" > a $ echo "modify 'b' at (E)" > b $ hg commit -m '(E)' created new head $ hg tag -l E $ hg update -q --clean D $ echo "modify 'A' at (F)" > A $ hg commit -m '(F)' $ hg tag -l F $ hg merge -q --tool internal:other E $ hg status -A M A a M b C x $ cat A modify 'a' at (E) test also the case that (B) is recorded after (C), to prevent regression by changes in the future. to avoid unexpected (successful) behavior by filelog unification, target file is not 'a'/'A' but 'b'/'B' in this case. $ hg update -q --clean A $ hg rename b tmp $ hg rename tmp B $ hg commit -m '(B1)' created new head $ hg tag -l B1 $ hg merge -q C $ hg status -A M x C B C a $ hg commit -m '(D1)' $ hg tag -l D1 $ echo "modify 'B' at (F1)" > B $ hg commit -m '(F1)' $ hg tag -l F1 $ hg merge -q --tool internal:other E $ hg status -A M B b M a C x $ cat B modify 'b' at (E) $ cd .. (2) colliding file is not related to collided file $ hg init branch_merge_collding $ cd branch_merge_collding $ echo a > a $ hg add a $ hg commit -m '#0' $ hg remove a $ hg commit -m '#1' $ echo A > A $ hg add A $ hg commit -m '#2' $ hg update --clean 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo x > x $ hg add x $ hg commit -m '#3' created new head $ echo 'modified at #4' > a $ hg commit -m '#4' $ hg merge abort: case-folding collision between [aA] and [Aa] (re) [255] $ hg parents --template '{rev}\n' 4 $ hg status -A C a C x $ cat a modified at #4 $ hg update --clean 2 1 files updated, 0 files merged, 2 files removed, 0 files unresolved $ hg merge abort: case-folding collision between [aA] and [Aa] (re) [255] $ hg parents --template '{rev}\n' 2 $ hg status -A C A $ cat A A test for deletion awareness of case-folding collision check (issue3648): revision '#3' doesn't change 'a', so 'a' should be recognized as safely removed in merging between #2 and #3. $ hg update --clean 3 2 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg merge 2 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (branch merge, don't forget to commit) $ hg status -A M A R a C x $ hg update --clean 2 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 status -A M x C A $ cd .. Prepare for tests of directory case-folding collisions $ hg init directory-casing $ cd directory-casing $ touch 0 # test: file without directory $ mkdir 0a $ touch 0a/f $ mkdir aA $ touch aA/a $ hg ci -Aqm0 Directory/file case-folding collision: $ hg up -q null $ touch 00 # test: starts as '0' $ mkdir 000 # test: starts as '0' $ touch 000/f $ touch Aa # test: collision with 'aA/a' $ hg ci -Aqm1 $ hg merge 0 abort: case-folding collision between Aa and directory of aA/a [255] (note: no collision between 0 and 00 or 000/f) Directory case-folding collision: $ hg up -qC null $ hg --config extensions.purge= purge $ mkdir 0A0 $ touch 0A0/f # test: starts as '0a' $ mkdir Aa $ touch Aa/b # test: collision with 'aA/a' $ hg ci -Aqm2 $ hg merge 0 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cd .. ################################ test for linear updates ################################ test for rename awareness of case-folding collision check: (1) colliding file is one renamed from collided file $ hg init linearupdate_renameaware_1 $ cd linearupdate_renameaware_1 $ echo a > a $ hg add a $ hg commit -m '#0' $ hg rename a tmp $ hg rename tmp A $ hg commit -m '#1' $ hg update 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo 'this is added line' >> a $ hg update 1 merging a and A to A 0 files updated, 1 files merged, 0 files removed, 0 files unresolved $ hg status -A M A $ cat A a this is added line $ cd .. (2) colliding file is not related to collided file $ hg init linearupdate_renameaware_2 $ cd linearupdate_renameaware_2 $ echo a > a $ hg add a $ hg commit -m '#0' $ hg remove a $ hg commit -m '#1' $ echo A > A $ hg add A $ hg commit -m '#2' $ hg update 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg parents --template '{rev}\n' 0 $ hg status -A C a $ cat A a $ hg up -qC 2 $ hg update --check 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg parents --template '{rev}\n' 0 $ hg status -A C a $ cat a a $ hg update --clean 2 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg parents --template '{rev}\n' 2 $ hg status -A C A $ cat A A $ cd .. (3) colliding file is not related to collided file: added in working dir $ hg init linearupdate_renameaware_3 $ cd linearupdate_renameaware_3 $ echo a > a $ hg add a $ hg commit -m '#0' $ hg rename a b $ hg commit -m '#1' $ hg update 0 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo B > B $ hg add B $ hg status A B $ hg update abort: case-folding collision between [bB] and [Bb] (re) [255] $ hg update --check abort: uncommitted changes [255] $ hg update --clean 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg parents --template '{rev}\n' 1 $ hg status -A C b $ cat b a $ cd .. mercurial-5.3.1/tests/test-convert-svn-branches.t0000644015407300116100000000616513627755405021774 0ustar augieeng00000000000000#require svn svn-bindings $ cat >> $HGRCPATH < [extensions] > convert = > EOF $ svnadmin create svn-repo $ svnadmin load -q svn-repo < "$TESTDIR/svn/branches.svndump" Convert trunk and branches $ cat > branchmap < old3 newbranch > > > EOF $ hg convert --branchmap=branchmap --datesort -r 10 svn-repo A-hg initializing destination A-hg repository scanning source... sorting... converting... 10 init projA 9 hello 8 branch trunk, remove c and dir 7 change a 6 change b 5 move and update c 4 move and update c 3 change b again 2 move to old2 1 move back to old 0 last change to a Test template keywords $ hg -R A-hg log --template '{rev} {svnuuid}{svnpath}@{svnrev}\n' 10 644ede6c-2b81-4367-9dc8-d786514f2cde/trunk@10 9 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old@9 8 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old2@8 7 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old@7 6 644ede6c-2b81-4367-9dc8-d786514f2cde/trunk@6 5 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old@6 4 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old@5 3 644ede6c-2b81-4367-9dc8-d786514f2cde/trunk@4 2 644ede6c-2b81-4367-9dc8-d786514f2cde/branches/old@3 1 644ede6c-2b81-4367-9dc8-d786514f2cde/trunk@2 0 644ede6c-2b81-4367-9dc8-d786514f2cde/trunk@1 Convert again $ hg convert --branchmap=branchmap --datesort svn-repo A-hg scanning source... sorting... converting... 0 branch trunk@1 into old3 $ cd A-hg $ hg log -G --template 'branch={branches} {rev} {desc|firstline} files: {files}\n' o branch=newbranch 11 branch trunk@1 into old3 files: | | o branch= 10 last change to a files: a | | | | o branch=old 9 move back to old files: | | | | | o branch=old2 8 move to old2 files: | | | | | o branch=old 7 change b again files: b | | | | o | branch= 6 move and update c files: b | | | | | o branch=old 5 move and update c files: c | | | | | o branch=old 4 change b files: b | | | | o | branch= 3 change a files: a | | | | | o branch=old 2 branch trunk, remove c and dir files: c | |/ | o branch= 1 hello files: a b c dir/e |/ o branch= 0 init projA files: $ hg branches newbranch 11:a6d7cc050ad1 default 10:6e2b33404495 old 9:1b494af68c0b old2 8:5be40b8dcbf6 (inactive) $ hg tags -q tip $ cd .. Test hg failing to call itself $ HG=foobar hg convert svn-repo B-hg 2>&1 | grep abort abort: Mercurial failed to run itself, check hg executable is in PATH Convert 'trunk' to branch other than 'default' $ cat > branchmap < default hgtrunk > > > EOF $ hg convert --branchmap=branchmap --datesort -r 10 svn-repo C-hg initializing destination C-hg repository scanning source... sorting... converting... 10 init projA 9 hello 8 branch trunk, remove c and dir 7 change a 6 change b 5 move and update c 4 move and update c 3 change b again 2 move to old2 1 move back to old 0 last change to a $ cd C-hg $ hg branches --template '{branch}\n' hgtrunk old old2 $ cd .. mercurial-5.3.1/tests/test-push-checkheads-superceed-A3.t0000644015407300116100000000427713627755405023204 0ustar augieeng00000000000000==================================== Testing head checking code: Case A-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 A: simple case involving a branch being superceeded by another. TestCase 3: multi-changeset branch with reordering Push should be allowed .. old-state: .. .. * 2 changeset branch .. .. new-state: .. .. * 2 changeset branch succeeding the old one with reordering .. .. expected-result: .. .. * push allowed .. .. graph-summary: .. .. B ø⇠⇠ .. | ⇡ .. A ø⇠⇠⇠○ A' .. | ⇡/ .. | ○ B' .. |/ .. ◠$ . $TESTDIR/testlib/push-checkheads-util.sh Test setup ---------- $ mkdir A3 $ cd A3 $ 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/A3/server searching for changes adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets d73caddc5533 (1 drafts) (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 $ mkcommit A1 $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"` 1 new obsolescence markers obsoleted 1 changesets 1 new orphan changesets $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"` 1 new obsolescence markers obsoleted 1 changesets $ hg log -G --hidden @ c1c7524e9488 (draft): A1 | o 25c56d33e4c4 (draft): B1 | | x d73caddc5533 (draft): B0 | | | x 8aaa48160adc (draft): A0 |/ o 1e4be0697311 (public): root Actual testing -------------- $ hg push pushing to $TESTTMP/A3/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-5.3.1/tests/test-check-jshint.t0000644015407300116100000000037213627755405020271 0ustar augieeng00000000000000#require test-repo jshint hg10 $ . "$TESTDIR/helpers-testrepo.sh" run jshint on all tracked files ending in .js except vendored dependencies $ cd "`dirname "$TESTDIR"`" $ testrepohg locate 'set:**.js' \ > 2>/dev/null \ > | xargs jshint mercurial-5.3.1/tests/test-lfs-test-server.t0000644015407300116100000010702613627755405020770 0ustar augieeng00000000000000#require no-reposimplestore no-chg #testcases git-server hg-server #if git-server #require lfs-test-server #else #require serve #endif #if git-server $ LFS_LISTEN="tcp://:$HGPORT" $ LFS_HOST="localhost:$HGPORT" $ LFS_PUBLIC=1 $ export LFS_LISTEN LFS_HOST LFS_PUBLIC #else $ LFS_HOST="localhost:$HGPORT/.git/info/lfs" #endif #if no-windows git-server $ lfs-test-server &> lfs-server.log & $ echo $! >> $DAEMON_PIDS #endif #if windows git-server $ cat >> $TESTTMP/spawn.py < import os > import subprocess > import sys > > for path in os.environ["PATH"].split(os.pathsep): > exe = os.path.join(path, 'lfs-test-server.exe') > if os.path.exists(exe): > with open('lfs-server.log', 'wb') as out: > p = subprocess.Popen(exe, stdout=out, stderr=out) > sys.stdout.write('%s\n' % p.pid) > sys.exit(0) > sys.exit(1) > EOF $ "$PYTHON" $TESTTMP/spawn.py >> $DAEMON_PIDS #endif $ cat >> $HGRCPATH < [extensions] > lfs= > [lfs] > url=http://foo:bar@$LFS_HOST > track=all() > [web] > push_ssl = False > allow-push = * > EOF Use a separate usercache, otherwise the server sees what the client commits, and never requests a transfer. #if hg-server $ hg init server $ hg --config "lfs.usercache=$TESTTMP/servercache" -R server serve -d \ > -p $HGPORT --pid-file=hg.pid -A $TESTTMP/access.log -E $TESTTMP/errors.log $ cat hg.pid >> $DAEMON_PIDS #endif $ hg init repo1 $ cd repo1 $ echo THIS-IS-LFS > a $ hg commit -m a -A a A push can be serviced directly from the usercache if it isn't in the local store. $ hg init ../repo2 $ mv .hg/store/lfs .hg/store/lfs_ $ hg push ../repo2 --debug http auth: user foo, password *** pushing to ../repo2 http auth: user foo, password *** http auth: user foo, password *** query 1; heads searching for changes 1 total queries in *s (glob) listing keys for "phases" checking for updated bookmarks listing keys for "bookmarks" lfs: computing set of blobs to upload Status: 200 Content-Length: 309 (git-server !) Content-Length: 350 (hg-server !) Content-Type: application/vnd.git-lfs+json Date: $HTTP_DATE$ Server: testing stub value (hg-server !) { "objects": [ { "actions": { "upload": { "expires_at": "$ISO_8601_DATE_TIME$" "header": { "Accept": "application/vnd.git-lfs" } "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (git-server !) "href": "http://localhost:$HGPORT/.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (hg-server !) } } "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" "size": 12 } ] "transfer": "basic" (hg-server !) } lfs: uploading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) Status: 200 (git-server !) Status: 201 (hg-server !) Content-Length: 0 Content-Type: text/plain; charset=utf-8 Date: $HTTP_DATE$ Server: testing stub value (hg-server !) lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b lfs: uploaded 1 files (12 bytes) 1 changesets found list of changesets: 99a7098854a3984a5c9eab0fc7a2906697b7cb5c bundle2-output-bundle: "HG20", 4 parts total bundle2-output-part: "replycaps" * bytes payload (glob) bundle2-output-part: "check:heads" streamed payload bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload bundle2-output-part: "phase-heads" 24 bytes payload bundle2-input-bundle: with-transaction bundle2-input-part: "replycaps" supported bundle2-input-part: total payload size * (glob) bundle2-input-part: "check:heads" supported bundle2-input-part: total payload size 20 bundle2-input-part: "changegroup" (params: 1 mandatory) supported adding changesets add changeset 99a7098854a3 adding manifests adding file changes adding a revisions calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs bundle2-input-part: total payload size 617 bundle2-input-part: "phase-heads" supported bundle2-input-part: total payload size 24 bundle2-input-bundle: 4 parts total updating the branch cache added 1 changesets with 1 changes to 1 files bundle2-output-bundle: "HG20", 1 parts total bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload bundle2-input-bundle: no-transaction bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported bundle2-input-bundle: 1 parts total listing keys for "phases" $ mv .hg/store/lfs_ .hg/store/lfs Clear the cache to force a download $ rm -rf `hg config lfs.usercache` $ cd ../repo2 $ hg update tip --debug http auth: user foo, password *** resolving manifests branchmerge: False, force: False, partial: False ancestor: 000000000000, local: 000000000000+, remote: 99a7098854a3 http auth: user foo, password *** Status: 200 Content-Length: 311 (git-server !) Content-Length: 352 (hg-server !) Content-Type: application/vnd.git-lfs+json Date: $HTTP_DATE$ Server: testing stub value (hg-server !) { "objects": [ { "actions": { "download": { "expires_at": "$ISO_8601_DATE_TIME$" "header": { "Accept": "application/vnd.git-lfs" } "href": "http://localhost:$HGPORT/*/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (glob) } } "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" "size": 12 } ] "transfer": "basic" (hg-server !) } lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) Status: 200 Content-Length: 12 Content-Type: text/plain; charset=utf-8 (git-server !) Content-Type: application/octet-stream (hg-server !) Date: $HTTP_DATE$ Server: testing stub value (hg-server !) lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b lfs: downloaded 1 files (12 bytes) a: remote created -> g getting a lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store 1 files updated, 0 files merged, 0 files removed, 0 files unresolved When the server has some blobs already. `hg serve` doesn't offer to upload blobs that it already knows about. Note that lfs-test-server is simply toggling the action to 'download'. The Batch API spec says it should omit the actions property completely. $ hg mv a b $ echo ANOTHER-LARGE-FILE > c $ echo ANOTHER-LARGE-FILE2 > d $ hg commit -m b-and-c -A b c d $ hg push ../repo1 --debug http auth: user foo, password *** pushing to ../repo1 http auth: user foo, password *** http auth: user foo, password *** query 1; heads searching for changes all remote heads known locally listing keys for "phases" checking for updated bookmarks listing keys for "bookmarks" listing keys for "bookmarks" lfs: computing set of blobs to upload Status: 200 Content-Length: 901 (git-server !) Content-Length: 755 (hg-server !) Content-Type: application/vnd.git-lfs+json Date: $HTTP_DATE$ Server: testing stub value (hg-server !) { "objects": [ { "actions": { (git-server !) "download": { (git-server !) "expires_at": "$ISO_8601_DATE_TIME$" (git-server !) "header": { (git-server !) "Accept": "application/vnd.git-lfs" (git-server !) } (git-server !) "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (git-server !) } (git-server !) } (git-server !) "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" "size": 12 } { "actions": { "upload": { "expires_at": "$ISO_8601_DATE_TIME$" "header": { "Accept": "application/vnd.git-lfs" } "href": "http://localhost:$HGPORT/*/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" (glob) } } "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" "size": 20 } { "actions": { "upload": { "expires_at": "$ISO_8601_DATE_TIME$" "header": { "Accept": "application/vnd.git-lfs" } "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob) } } "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" "size": 19 } ] "transfer": "basic" (hg-server !) } lfs: need to transfer 2 objects (39 bytes) lfs: uploading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) Status: 200 (git-server !) Status: 201 (hg-server !) Content-Length: 0 Content-Type: text/plain; charset=utf-8 Date: $HTTP_DATE$ Server: testing stub value (hg-server !) lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 lfs: uploading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) Status: 200 (git-server !) Status: 201 (hg-server !) Content-Length: 0 Content-Type: text/plain; charset=utf-8 Date: $HTTP_DATE$ Server: testing stub value (hg-server !) lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 lfs: uploaded 2 files (39 bytes) 1 changesets found list of changesets: dfca2c9e2ef24996aa61ba2abd99277d884b3d63 bundle2-output-bundle: "HG20", 5 parts total bundle2-output-part: "replycaps" * bytes payload (glob) 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 bundle2-input-bundle: with-transaction bundle2-input-part: "replycaps" supported bundle2-input-part: total payload size * (glob) bundle2-input-part: "check:phases" supported bundle2-input-part: total payload size 24 bundle2-input-part: "check:heads" supported bundle2-input-part: total payload size 20 bundle2-input-part: "changegroup" (params: 1 mandatory) supported adding changesets add changeset dfca2c9e2ef2 adding manifests adding file changes adding b revisions adding c revisions adding d revisions bundle2-input-part: total payload size 1315 bundle2-input-part: "phase-heads" supported bundle2-input-part: total payload size 24 bundle2-input-bundle: 5 parts total updating the branch cache added 1 changesets with 3 changes to 3 files bundle2-output-bundle: "HG20", 1 parts total bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload bundle2-input-bundle: no-transaction bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported bundle2-input-bundle: 1 parts total listing keys for "phases" Clear the cache to force a download $ rm -rf `hg config lfs.usercache` $ hg --repo ../repo1 update tip --debug http auth: user foo, password *** resolving manifests branchmerge: False, force: False, partial: False ancestor: 99a7098854a3, local: 99a7098854a3+, remote: dfca2c9e2ef2 http auth: user foo, password *** Status: 200 Content-Length: 608 (git-server !) Content-Length: 670 (hg-server !) Content-Type: application/vnd.git-lfs+json Date: $HTTP_DATE$ Server: testing stub value (hg-server !) { "objects": [ { "actions": { "download": { "expires_at": "$ISO_8601_DATE_TIME$" "header": { "Accept": "application/vnd.git-lfs" } "href": "http://localhost:$HGPORT/*/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" (glob) } } "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" "size": 20 } { "actions": { "download": { "expires_at": "$ISO_8601_DATE_TIME$" "header": { "Accept": "application/vnd.git-lfs" } "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob) } } "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" "size": 19 } ] "transfer": "basic" (hg-server !) } lfs: need to transfer 2 objects (39 bytes) lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) Status: 200 Content-Length: 20 Content-Type: text/plain; charset=utf-8 (git-server !) Content-Type: application/octet-stream (hg-server !) Date: $HTTP_DATE$ Server: testing stub value (hg-server !) lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) Status: 200 Content-Length: 19 Content-Type: text/plain; charset=utf-8 (git-server !) Content-Type: application/octet-stream (hg-server !) Date: $HTTP_DATE$ Server: testing stub value (hg-server !) lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 lfs: downloaded 2 files (39 bytes) b: remote created -> g getting b lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store c: remote created -> g getting c lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store d: remote created -> g getting d lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store 3 files updated, 0 files merged, 0 files removed, 0 files unresolved Test a corrupt file download, but clear the cache first to force a download. `hg serve` indicates a corrupt file without transferring it, unlike lfs-test-server. $ rm -rf `hg config lfs.usercache` #if git-server $ cp $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 blob $ echo 'damage' > $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 #else $ cp $TESTTMP/server/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 blob $ echo 'damage' > $TESTTMP/server/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 #endif $ rm ../repo1/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 $ rm ../repo1/* TODO: give the proper error indication from `hg serve` $ hg --repo ../repo1 update -C tip --debug http auth: user foo, password *** resolving manifests branchmerge: False, force: True, partial: False ancestor: dfca2c9e2ef2+, local: dfca2c9e2ef2+, remote: dfca2c9e2ef2 http auth: user foo, password *** Status: 200 Content-Length: 311 (git-server !) Content-Length: 183 (hg-server !) Content-Type: application/vnd.git-lfs+json Date: $HTTP_DATE$ Server: testing stub value (hg-server !) { "objects": [ { "actions": { (git-server !) "download": { (git-server !) "expires_at": "$ISO_8601_DATE_TIME$" (git-server !) "header": { (git-server !) "Accept": "application/vnd.git-lfs" (git-server !) } (git-server !) "href": "http://localhost:$HGPORT/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (git-server !) } (git-server !) "error": { (hg-server !) "code": 422 (hg-server !) "message": "The object is corrupt" (hg-server !) } "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" "size": 19 } ] "transfer": "basic" (hg-server !) } lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) (git-server !) Status: 200 (git-server !) Content-Length: 7 (git-server !) Content-Type: text/plain; charset=utf-8 (git-server !) Date: $HTTP_DATE$ (git-server !) abort: corrupt remote lfs object: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (git-server !) abort: LFS server error for "c": Validation error! (hg-server !) [255] The corrupted blob is not added to the usercache or local store $ test -f ../repo1/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 [1] $ test -f `hg config lfs.usercache`/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 [1] #if git-server $ cp blob $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 #else $ cp blob $TESTTMP/server/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 #endif Test a corrupted file upload $ echo 'another lfs blob' > b $ hg ci -m 'another blob' $ echo 'damage' > .hg/store/lfs/objects/e6/59058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0 $ hg push --debug ../repo1 http auth: user foo, password *** pushing to ../repo1 http auth: user foo, password *** http auth: user foo, password *** query 1; heads searching for changes all remote heads known locally listing keys for "phases" checking for updated bookmarks listing keys for "bookmarks" listing keys for "bookmarks" lfs: computing set of blobs to upload Status: 200 Content-Length: 309 (git-server !) Content-Length: 350 (hg-server !) Content-Type: application/vnd.git-lfs+json Date: $HTTP_DATE$ Server: testing stub value (hg-server !) { "objects": [ { "actions": { "upload": { "expires_at": "$ISO_8601_DATE_TIME$" "header": { "Accept": "application/vnd.git-lfs" } "href": "http://localhost:$HGPORT/*/e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0" (glob) } } "oid": "e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0" "size": 17 } ] "transfer": "basic" (hg-server !) } lfs: uploading e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0 (17 bytes) abort: detected corrupt lfs object: e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0 (run hg verify) [255] Archive will prefetch blobs in a group $ rm -rf .hg/store/lfs `hg config lfs.usercache` $ hg archive --debug -r 1 ../archive http auth: user foo, password *** http auth: user foo, password *** Status: 200 Content-Length: 905 (git-server !) Content-Length: 988 (hg-server !) Content-Type: application/vnd.git-lfs+json Date: $HTTP_DATE$ Server: testing stub value (hg-server !) { "objects": [ { "actions": { "download": { "expires_at": "$ISO_8601_DATE_TIME$" "header": { "Accept": "application/vnd.git-lfs" } "href": "http://localhost:$HGPORT/*/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (glob) } } "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" "size": 12 } { "actions": { "download": { "expires_at": "$ISO_8601_DATE_TIME$" "header": { "Accept": "application/vnd.git-lfs" } "href": "http://localhost:$HGPORT/*/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" (glob) } } "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" "size": 20 } { "actions": { "download": { "expires_at": "$ISO_8601_DATE_TIME$" "header": { "Accept": "application/vnd.git-lfs" } "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob) } } "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" "size": 19 } ] "transfer": "basic" (hg-server !) } lfs: need to transfer 3 objects (51 bytes) lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) Status: 200 Content-Length: 12 Content-Type: text/plain; charset=utf-8 (git-server !) Content-Type: application/octet-stream (hg-server !) Date: $HTTP_DATE$ Server: testing stub value (hg-server !) lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) Status: 200 Content-Length: 20 Content-Type: text/plain; charset=utf-8 (git-server !) Content-Type: application/octet-stream (hg-server !) Date: $HTTP_DATE$ Server: testing stub value (hg-server !) lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) Status: 200 Content-Length: 19 Content-Type: text/plain; charset=utf-8 (git-server !) Content-Type: application/octet-stream (hg-server !) Date: $HTTP_DATE$ Server: testing stub value (hg-server !) lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 lfs: downloaded 3 files (51 bytes) lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store $ find ../archive | sort ../archive ../archive/.hg_archival.txt ../archive/a ../archive/b ../archive/c ../archive/d Cat will prefetch blobs in a group $ rm -rf .hg/store/lfs `hg config lfs.usercache` $ hg cat --debug -r 1 a b c nonexistent http auth: user foo, password *** http auth: user foo, password *** Status: 200 Content-Length: 608 (git-server !) Content-Length: 670 (hg-server !) Content-Type: application/vnd.git-lfs+json Date: $HTTP_DATE$ Server: testing stub value (hg-server !) { "objects": [ { "actions": { "download": { "expires_at": "$ISO_8601_DATE_TIME$" "header": { "Accept": "application/vnd.git-lfs" } "href": "http://localhost:$HGPORT/*/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (glob) } } "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" "size": 12 } { "actions": { "download": { "expires_at": "$ISO_8601_DATE_TIME$" "header": { "Accept": "application/vnd.git-lfs" } "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob) } } "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" "size": 19 } ] "transfer": "basic" (hg-server !) } lfs: need to transfer 2 objects (31 bytes) lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) Status: 200 Content-Length: 12 Content-Type: text/plain; charset=utf-8 (git-server !) Content-Type: application/octet-stream (hg-server !) Date: $HTTP_DATE$ Server: testing stub value (hg-server !) lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) Status: 200 Content-Length: 19 Content-Type: text/plain; charset=utf-8 (git-server !) Content-Type: application/octet-stream (hg-server !) Date: $HTTP_DATE$ Server: testing stub value (hg-server !) lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 lfs: downloaded 2 files (31 bytes) lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store THIS-IS-LFS lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store THIS-IS-LFS lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store ANOTHER-LARGE-FILE nonexistent: no such file in rev dfca2c9e2ef2 Revert will prefetch blobs in a group $ rm -rf .hg/store/lfs $ rm -rf `hg config lfs.usercache` $ rm * $ hg revert --all -r 1 --debug http auth: user foo, password *** http auth: user foo, password *** Status: 200 Content-Length: 905 (git-server !) Content-Length: 988 (hg-server !) Content-Type: application/vnd.git-lfs+json Date: $HTTP_DATE$ Server: testing stub value (hg-server !) { "objects": [ { "actions": { "download": { "expires_at": "$ISO_8601_DATE_TIME$" "header": { "Accept": "application/vnd.git-lfs" } "href": "http://localhost:$HGPORT/*/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (glob) } } "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" "size": 12 } { "actions": { "download": { "expires_at": "$ISO_8601_DATE_TIME$" "header": { "Accept": "application/vnd.git-lfs" } "href": "http://localhost:$HGPORT/*/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" (glob) } } "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" "size": 20 } { "actions": { "download": { "expires_at": "$ISO_8601_DATE_TIME$" "header": { "Accept": "application/vnd.git-lfs" } "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob) } } "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" "size": 19 } ] "transfer": "basic" (hg-server !) } lfs: need to transfer 3 objects (51 bytes) lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) Status: 200 Content-Length: 12 Content-Type: text/plain; charset=utf-8 (git-server !) Content-Type: application/octet-stream (hg-server !) Date: $HTTP_DATE$ Server: testing stub value (hg-server !) lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) Status: 200 Content-Length: 20 Content-Type: text/plain; charset=utf-8 (git-server !) Content-Type: application/octet-stream (hg-server !) Date: $HTTP_DATE$ Server: testing stub value (hg-server !) lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) Status: 200 Content-Length: 19 Content-Type: text/plain; charset=utf-8 (git-server !) Content-Type: application/octet-stream (hg-server !) Date: $HTTP_DATE$ Server: testing stub value (hg-server !) lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 lfs: downloaded 3 files (51 bytes) reverting b lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store reverting c lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store reverting d lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store adding a lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store Check error message when the remote missed a blob: $ echo FFFFF > b $ hg commit -m b -A b $ echo FFFFF >> b $ hg commit -m b b $ rm -rf .hg/store/lfs $ rm -rf `hg config lfs.usercache` $ hg update -C '.^' --debug http auth: user foo, password *** resolving manifests branchmerge: False, force: True, partial: False ancestor: 62fdbaf221c6+, local: 62fdbaf221c6+, remote: ef0564edf47e http auth: user foo, password *** Status: 200 Content-Length: 308 (git-server !) Content-Length: 186 (hg-server !) Content-Type: application/vnd.git-lfs+json Date: $HTTP_DATE$ Server: testing stub value (hg-server !) { "objects": [ { "actions": { (git-server !) "upload": { (git-server !) "expires_at": "$ISO_8601_DATE_TIME$" (git-server !) "header": { (git-server !) "Accept": "application/vnd.git-lfs" (git-server !) } (git-server !) "href": "http://localhost:$HGPORT/objects/8e6ea5f6c066b44a0efa43bcce86aea73f17e6e23f0663df0251e7524e140a13" (git-server !) } (git-server !) "error": { (hg-server !) "code": 404 (hg-server !) "message": "The object does not exist" (hg-server !) } "oid": "8e6ea5f6c066b44a0efa43bcce86aea73f17e6e23f0663df0251e7524e140a13" "size": 6 } ] "transfer": "basic" (hg-server !) } abort: LFS server error for "b": The object does not exist! [255] Check error message when object does not exist: $ cd $TESTTMP $ hg init test && cd test $ echo "[extensions]" >> .hg/hgrc $ echo "lfs=" >> .hg/hgrc $ echo "[lfs]" >> .hg/hgrc $ echo "threshold=1" >> .hg/hgrc $ echo a > a $ hg add a $ hg commit -m 'test' $ echo aaaaa > a $ hg commit -m 'largefile' $ hg debugdata a 1 # verify this is no the file content but includes "oid", the LFS "pointer". version https://git-lfs.github.com/spec/v1 oid sha256:bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a size 6 x-is-binary 0 $ cd .. $ rm -rf `hg config lfs.usercache` (Restart the server in a different location so it no longer has the content) $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS #if hg-server $ cat $TESTTMP/access.log $TESTTMP/errors.log $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 201 - (glob) $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 HTTP/1.1" 201 - (glob) $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 201 - (glob) $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 200 - (glob) $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob) #endif $ mkdir $TESTTMP/lfs-server2 $ cd $TESTTMP/lfs-server2 #if no-windows git-server $ lfs-test-server &> lfs-server.log & $ echo $! >> $DAEMON_PIDS #endif #if windows git-server $ "$PYTHON" $TESTTMP/spawn.py >> $DAEMON_PIDS #endif #if hg-server $ hg init server2 $ hg --config "lfs.usercache=$TESTTMP/servercache2" -R server2 serve -d \ > -p $HGPORT --pid-file=hg.pid -A $TESTTMP/access.log -E $TESTTMP/errors.log $ cat hg.pid >> $DAEMON_PIDS #endif $ cd $TESTTMP $ hg --debug clone test test2 http auth: user foo, password *** linked 6 files http auth: user foo, password *** updating to branch default resolving manifests branchmerge: False, force: False, partial: False ancestor: 000000000000, local: 000000000000+, remote: d2a338f184a8 http auth: user foo, password *** Status: 200 Content-Length: 308 (git-server !) Content-Length: 186 (hg-server !) Content-Type: application/vnd.git-lfs+json Date: $HTTP_DATE$ Server: testing stub value (hg-server !) { "objects": [ { "actions": { (git-server !) "upload": { (git-server !) "expires_at": "$ISO_8601_DATE_TIME$" (git-server !) "header": { (git-server !) "Accept": "application/vnd.git-lfs" (git-server !) } (git-server !) "href": "http://localhost:$HGPORT/objects/bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a" (git-server !) } (git-server !) "error": { (hg-server !) "code": 404 (hg-server !) "message": "The object does not exist" (hg-server !) } "oid": "bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a" "size": 6 } ] "transfer": "basic" (hg-server !) } abort: LFS server error for "a": The object does not exist! [255] $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS mercurial-5.3.1/tests/test-mdiff.py0000644015407300116100000000120513627755405017165 0ustar augieeng00000000000000from __future__ import absolute_import from __future__ import print_function import unittest from mercurial import mdiff class splitnewlinesTests(unittest.TestCase): def test_splitnewlines(self): cases = { b'a\nb\nc\n': [b'a\n', b'b\n', b'c\n'], b'a\nb\nc': [b'a\n', b'b\n', b'c'], b'a\nb\nc\n\n': [b'a\n', b'b\n', b'c\n', b'\n'], b'': [], b'abcabc': [b'abcabc'], } for inp, want in cases.items(): self.assertEqual(mdiff.splitnewlines(inp), want) if __name__ == '__main__': import silenttestrunner silenttestrunner.main(__name__) mercurial-5.3.1/tests/test-amend-subrepo.t0000644015407300116100000000711313627755405020460 0ustar augieeng00000000000000#testcases obsstore-off obsstore-on $ cat << EOF >> $HGRCPATH > [extensions] > amend = > EOF #if obsstore-on $ cat << EOF >> $HGRCPATH > [experimental] > evolution.createmarkers = True > EOF #endif Prepare parent repo ------------------- $ hg init r $ cd r $ echo a > a $ hg ci -Am0 adding a Link first subrepo ------------------ $ echo 's = s' >> .hgsub $ hg add .hgsub $ hg init s amend without .hgsub $ hg amend s abort: can't commit subrepos without .hgsub [255] amend with subrepo $ hg amend saved backup bundle to * (glob) (obsstore-off !) $ hg status --change . A .hgsub A .hgsubstate A a $ cat .hgsubstate 0000000000000000000000000000000000000000 s Update subrepo -------------- add new commit to be amended $ echo a >> a $ hg ci -m1 amend with dirty subrepo $ echo a >> s/a $ hg add -R s adding s/a $ hg amend abort: uncommitted changes in subrepository "s" (use --subrepos for recursive commit) [255] amend with modified subrepo $ hg ci -R s -m0 $ hg amend saved backup bundle to * (glob) (obsstore-off !) $ hg status --change . M .hgsubstate M a $ cat .hgsubstate f7b1eb17ad24730a1651fccd46c43826d1bbc2ac s revert subrepo change $ hg up -R s -q null $ hg amend saved backup bundle to * (glob) (obsstore-off !) $ hg status --change . M a Link another subrepo -------------------- add new commit to be amended $ echo b >> b $ hg ci -qAm2 also checks if non-subrepo change is included $ echo a >> a amend with another subrepo $ hg init t $ echo b >> t/b $ hg ci -R t -Am0 adding b $ echo 't = t' >> .hgsub $ hg amend saved backup bundle to * (glob) (obsstore-off !) $ hg status --change . M .hgsub M .hgsubstate M a A b $ cat .hgsubstate 0000000000000000000000000000000000000000 s bfb1a4fb358498a9533dabf4f2043d94162f1fcd t Unlink one subrepo ------------------ add new commit to be amended $ echo a >> a $ hg ci -m3 $ echo 't = t' > .hgsub --interactive won't silently ignore dirty subrepos $ echo modified > t/b $ hg amend --interactive --config ui.interactive=True abort: uncommitted changes in subrepository "t" [255] $ hg amend --interactive --config ui.interactive=True --config ui.commitsubrepos=True abort: uncommitted changes in subrepository "t" [255] $ hg -R t revert -q --all --no-backup amend with one subrepo dropped $ hg amend saved backup bundle to * (glob) (obsstore-off !) $ hg status --change . M .hgsub M .hgsubstate M a $ cat .hgsubstate bfb1a4fb358498a9533dabf4f2043d94162f1fcd t Unlink subrepos completely -------------------------- add new commit to be amended $ echo a >> a $ hg ci -m3 amend with .hgsub removed $ hg rm .hgsub $ hg amend saved backup bundle to * (glob) (obsstore-off !) $ hg status --change . M a R .hgsub R .hgsubstate broken repositories will refuse to push #if obsstore-off $ hg up -q -C 2 #else $ hg up -q -C 6 #endif $ echo c >> t/b $ hg amend -q -R t $ hg init ../dest $ hg init ../dest/t $ hg init ../dest/s $ hg push -q ../dest abort: subrepo 't' is hidden in revision 04aa62396ec6 (obsstore-on !) abort: subrepo 't' not found in revision 04aa62396ec6 (obsstore-off !) [255] ... unless forced $ hg push --force -q ../dest $ hg verify -R ../dest checking changesets checking manifests crosschecking files in changesets and manifests checking files checked 5 changesets with 12 changes to 4 files checking subrepo links subrepo 't' not found in revision 04aa62396ec6 subrepo 't' not found in revision 6bce99600681 $ cd .. mercurial-5.3.1/tests/test-minirst.py.out0000644015407300116100000005153313627755405020404 0ustar augieeng00000000000000== paragraphs == 60 column format: ---------------------------------------------------------------------- This is some text in the first paragraph. A small indented paragraph. It is followed by some lines containing random whitespace. The third and final paragraph. ---------------------------------------------------------------------- 30 column format: ---------------------------------------------------------------------- This is some text in the first paragraph. A small indented paragraph. It is followed by some lines containing random whitespace. The third and final paragraph. ---------------------------------------------------------------------- html format: ----------------------------------------------------------------------

    This is some text in the first paragraph.

    A small indented paragraph. It is followed by some lines containing random whitespace.

    The third and final paragraph.

    ---------------------------------------------------------------------- == definitions == 60 column format: ---------------------------------------------------------------------- A Term Definition. The indented lines make up the definition. Another Term Another definition. The final line in the definition determines the indentation, so this will be indented with four spaces. A Nested/Indented Term Definition. ---------------------------------------------------------------------- 30 column format: ---------------------------------------------------------------------- A Term Definition. The indented lines make up the definition. Another Term Another definition. The final line in the definition determines the indentation, so this will be indented with four spaces. A Nested/Indented Term Definition. ---------------------------------------------------------------------- html format: ----------------------------------------------------------------------
    A Term
    Definition. The indented lines make up the definition.
    Another Term
    Another definition. The final line in the definition determines the indentation, so this will be indented with four spaces.
    A Nested/Indented Term
    Definition.
    ---------------------------------------------------------------------- == literals == 60 column format: ---------------------------------------------------------------------- The fully minimized form is the most convenient form: Hello literal world In the partially minimized form a paragraph simply ends with space-double-colon. //////////////////////////////////////// long un-wrapped line in a literal block \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ This literal block is started with '::', the so-called expanded form. The paragraph with '::' disappears in the final output. ---------------------------------------------------------------------- 30 column format: ---------------------------------------------------------------------- The fully minimized form is the most convenient form: Hello literal world In the partially minimized form a paragraph simply ends with space-double-colon. //////////////////////////////////////// long un-wrapped line in a literal block \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ This literal block is started with '::', the so-called expanded form. The paragraph with '::' disappears in the final output. ---------------------------------------------------------------------- html format: ----------------------------------------------------------------------

    The fully minimized form is the most convenient form:

    Hello
      literal
        world
    

    In the partially minimized form a paragraph simply ends with space-double-colon.

    ////////////////////////////////////////
    long un-wrapped line in a literal block
    \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
    
    This literal block is started with '::',
      the so-called expanded form. The paragraph
        with '::' disappears in the final output.
    
    ---------------------------------------------------------------------- == lists == 60 column format: ---------------------------------------------------------------------- - This is the first list item. Second paragraph in the first list item. - List items need not be separated by a blank line. - And will be rendered without one in any case. We can have indented lists: - This is an indented list item - Another indented list item: - A literal block in the middle of an indented list. (The above is not a list item since we are in the literal block.) Literal block with no indentation (apart from the two spaces added to all literal blocks). 1. This is an enumerated list (first item). 2. Continuing with the second item. (1) foo (2) bar 1) Another 2) List Line blocks are also a form of list: This is the first line. The line continues here. This is the second line. Bullet lists are also detected: * This is the first bullet * This is the second bullet It has 2 lines * This is the third bullet ---------------------------------------------------------------------- 30 column format: ---------------------------------------------------------------------- - This is the first list item. Second paragraph in the first list item. - List items need not be separated by a blank line. - And will be rendered without one in any case. We can have indented lists: - This is an indented list item - Another indented list item: - A literal block in the middle of an indented list. (The above is not a list item since we are in the literal block.) Literal block with no indentation (apart from the two spaces added to all literal blocks). 1. This is an enumerated list (first item). 2. Continuing with the second item. (1) foo (2) bar 1) Another 2) List Line blocks are also a form of list: This is the first line. The line continues here. This is the second line. Bullet lists are also detected: * This is the first bullet * This is the second bullet It has 2 lines * This is the third bullet ---------------------------------------------------------------------- html format: ----------------------------------------------------------------------
    • This is the first list item.

      Second paragraph in the first list item.

    • List items need not be separated by a blank line.
    • And will be rendered without one in any case.

    We can have indented lists:

    • This is an indented list item
    • Another indented list item:
      - A literal block in the middle
            of an indented list.
      
      (The above is not a list item since we are in the literal block.)
      
    Literal block with no indentation (apart from
    the two spaces added to all literal blocks).
    
    1. This is an enumerated list (first item).
    2. Continuing with the second item.
    3. foo
    4. bar
    5. Another
    6. List

    Line blocks are also a form of list:

    1. This is the first line. The line continues here.
    2. This is the second line.

    Bullet lists are also detected:

    • This is the first bullet
    • This is the second bullet It has 2 lines
    • This is the third bullet
    ---------------------------------------------------------------------- == options == 60 column format: ---------------------------------------------------------------------- There is support for simple option lists, but only with long options: -X --exclude filter an option with a short and long option with an argument -I --include an option with both a short option and a long option --all Output all. --both Output both (this description is quite long). --long Output all day long. --par This option has two paragraphs in its description. This is the first. This is the second. Blank lines may be omitted between options (as above) or left in (as here). The next paragraph looks like an option list, but lacks the two-space marker after the option. It is treated as a normal paragraph: --foo bar baz ---------------------------------------------------------------------- 30 column format: ---------------------------------------------------------------------- There is support for simple option lists, but only with long options: -X --exclude filter an option with a short and long option with an argumen t -I --include an option with both a short option and a long option --all Output all. --both Output both (this d escript ion is quite long). --long Output all day long. --par This option has two paragra phs in its des criptio n. This is the first. This is the second. Blank lines may be omitted between options (as above) or left in (as here). The next paragraph looks like an option list, but lacks the two-space marker after the option. It is treated as a normal paragraph: --foo bar baz ---------------------------------------------------------------------- html format: ----------------------------------------------------------------------

    There is support for simple option lists, but only with long options:

    -X --exclude filter
    an option with a short and long option with an argument
    -I --include
    an option with both a short option and a long option
    --all
    Output all.
    --both
    Output both (this description is quite long).
    --long
    Output all day long.
    --par
    This option has two paragraphs in its description. This is the first.

    This is the second. Blank lines may be omitted between options (as above) or left in (as here).

    The next paragraph looks like an option list, but lacks the two-space marker after the option. It is treated as a normal paragraph:

    --foo bar baz

    ---------------------------------------------------------------------- == fields == 60 column format: ---------------------------------------------------------------------- a First item. ab Second item. Indentation and wrapping is handled automatically. Next list: small The larger key below triggers full indentation here. much too large This key is big enough to get its own line. ---------------------------------------------------------------------- 30 column format: ---------------------------------------------------------------------- a First item. ab Second item. Indentation and wrapping is handled automatically. Next list: small The larger key below triggers full indentation here. much too large This key is big enough to get its own line. ---------------------------------------------------------------------- html format: ----------------------------------------------------------------------
    a
    First item.
    ab
    Second item. Indentation and wrapping is handled automatically.

    Next list:

    small
    The larger key below triggers full indentation here.
    much too large
    This key is big enough to get its own line.
    ---------------------------------------------------------------------- == containers (normal) == 60 column format: ---------------------------------------------------------------------- Normal output. ---------------------------------------------------------------------- 30 column format: ---------------------------------------------------------------------- Normal output. ---------------------------------------------------------------------- html format: ----------------------------------------------------------------------

    Normal output.

    ---------------------------------------------------------------------- == containers (verbose) == 60 column format: ---------------------------------------------------------------------- Normal output. Verbose output. ---------------------------------------------------------------------- ['debug', 'debug'] ---------------------------------------------------------------------- 30 column format: ---------------------------------------------------------------------- Normal output. Verbose output. ---------------------------------------------------------------------- ['debug', 'debug'] ---------------------------------------------------------------------- html format: ----------------------------------------------------------------------

    Normal output.

    Verbose output.

    ---------------------------------------------------------------------- ['debug', 'debug'] ---------------------------------------------------------------------- == containers (debug) == 60 column format: ---------------------------------------------------------------------- Normal output. Initial debug output. ---------------------------------------------------------------------- ['verbose'] ---------------------------------------------------------------------- 30 column format: ---------------------------------------------------------------------- Normal output. Initial debug output. ---------------------------------------------------------------------- ['verbose'] ---------------------------------------------------------------------- html format: ----------------------------------------------------------------------

    Normal output.

    Initial debug output.

    ---------------------------------------------------------------------- ['verbose'] ---------------------------------------------------------------------- == containers (verbose debug) == 60 column format: ---------------------------------------------------------------------- Normal output. Initial debug output. Verbose output. Debug output. ---------------------------------------------------------------------- [] ---------------------------------------------------------------------- 30 column format: ---------------------------------------------------------------------- Normal output. Initial debug output. Verbose output. Debug output. ---------------------------------------------------------------------- [] ---------------------------------------------------------------------- html format: ----------------------------------------------------------------------

    Normal output.

    Initial debug output.

    Verbose output.

    Debug output.

    ---------------------------------------------------------------------- [] ---------------------------------------------------------------------- == roles == 60 column format: ---------------------------------------------------------------------- Please see 'hg add'. ---------------------------------------------------------------------- 30 column format: ---------------------------------------------------------------------- Please see 'hg add'. ---------------------------------------------------------------------- html format: ----------------------------------------------------------------------

    Please see 'hg add'.

    ---------------------------------------------------------------------- == sections == 60 column format: ---------------------------------------------------------------------- Title ===== Section ------- Subsection '''''''''' Markup: "foo" and 'hg help' --------------------------- ---------------------------------------------------------------------- 30 column format: ---------------------------------------------------------------------- Title ===== Section ------- Subsection '''''''''' Markup: "foo" and 'hg help' --------------------------- ---------------------------------------------------------------------- html format: ----------------------------------------------------------------------

    Title

    Section

    Subsection

    Markup: "foo" and 'hg help'

    ---------------------------------------------------------------------- == admonitions == 60 column format: ---------------------------------------------------------------------- Note: This is a note - Bullet 1 - Bullet 2 Warning! This is a warning Second input line of warning !Danger! This is danger ---------------------------------------------------------------------- 30 column format: ---------------------------------------------------------------------- Note: This is a note - Bullet 1 - Bullet 2 Warning! This is a warning Second input line of warning !Danger! This is danger ---------------------------------------------------------------------- html format: ----------------------------------------------------------------------

    Note:

    This is a note

    • Bullet 1
    • Bullet 2

    Warning! This is a warning Second input line of warning

    !Danger! This is danger

    ---------------------------------------------------------------------- == comments == 60 column format: ---------------------------------------------------------------------- Some text. Some indented text. Empty comment above ---------------------------------------------------------------------- 30 column format: ---------------------------------------------------------------------- Some text. Some indented text. Empty comment above ---------------------------------------------------------------------- html format: ----------------------------------------------------------------------

    Some text.

    Some indented text.

    Empty comment above

    ---------------------------------------------------------------------- === === ======================================== a b c === === ======================================== 1 2 3 foo bar baz this list is very very very long man === === ======================================== == table == 60 column format: ---------------------------------------------------------------------- a b c ------------------------------------------------ 1 2 3 foo bar baz this list is very very very long man ---------------------------------------------------------------------- 30 column format: ---------------------------------------------------------------------- a b c ------------------------------ 1 2 3 foo bar baz this list is very very very long man ---------------------------------------------------------------------- html format: ----------------------------------------------------------------------
    a b c
    1 2 3
    foo bar baz this list is very very very long man
    ---------------------------------------------------------------------- = ==== ====================================== s long line goes on here xy tried to fix here by indenting = ==== ====================================== == table+nl == 60 column format: ---------------------------------------------------------------------- s long line goes on here xy tried to fix here by indenting ---------------------------------------------------------------------- 30 column format: ---------------------------------------------------------------------- s long line goes on here xy tried to fix here by indenting ---------------------------------------------------------------------- html format: ----------------------------------------------------------------------
    s long line goes on here
    xy tried to fix here by indenting
    ---------------------------------------------------------------------- mercurial-5.3.1/tests/test-contrib-perf.t0000644015407300116100000003057313627755405020317 0ustar augieeng00000000000000#require test-repo Set vars: $ . "$TESTDIR/helpers-testrepo.sh" $ CONTRIBDIR="$TESTDIR/../contrib" Prepare repo: $ hg init $ echo this is file a > a $ hg add a $ hg commit -m first $ echo adding to file a >> a $ hg commit -m second $ echo adding more to file a >> a $ hg commit -m third $ hg up -r 0 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo merge-this >> a $ hg commit -m merge-able created new head $ hg up -r 2 1 files updated, 0 files merged, 0 files removed, 0 files unresolved perfstatus $ cat >> $HGRCPATH << EOF > [extensions] > perf=$CONTRIBDIR/perf.py > [perf] > presleep=0 > stub=on > parentscount=1 > EOF $ hg help -e perf perf extension - helper extension to measure performance Configurations ============== "perf" ------ "all-timing" When set, additional statistics will be reported for each benchmark: best, worst, median average. If not set only the best timing is reported (default: off). "presleep" number of second to wait before any group of runs (default: 1) "pre-run" number of run to perform before starting measurement. "profile-benchmark" Enable profiling for the benchmarked section. (The first iteration is benchmarked) "run-limits" Control the number of runs each benchmark will perform. The option value should be a list of '