tests/test-largefiles.t
changeset 21424 d13b4ecdb680
parent 21275 c7e9fb881a5a
child 21883 87aa279f7073
equal deleted inserted replaced
21423:7d408720453d 21424:d13b4ecdb680
       
     1 This file used to contains all largefile tests.
       
     2 Do not add any new tests in this file as it his already far too long to run.
       
     3 
       
     4 It contains all the testing of the basic concepts of large file in a single block.
       
     5 
     1   $ USERCACHE="$TESTTMP/cache"; export USERCACHE
     6   $ USERCACHE="$TESTTMP/cache"; export USERCACHE
     2   $ mkdir "${USERCACHE}"
     7   $ mkdir "${USERCACHE}"
     3   $ cat >> $HGRCPATH <<EOF
     8   $ cat >> $HGRCPATH <<EOF
     4   > [extensions]
     9   > [extensions]
     5   > largefiles=
    10   > largefiles=
   178   $ cat sub/normal4
   183   $ cat sub/normal4
   179   normal22
   184   normal22
   180   $ cat sub/large4
   185   $ cat sub/large4
   181   large22
   186   large22
   182 
   187 
   183 Test copies and moves from a directory other than root (issue3516)
       
   184 
       
   185   $ cd ..
       
   186   $ hg init lf_cpmv
       
   187   $ cd lf_cpmv
       
   188   $ mkdir dira
       
   189   $ mkdir dira/dirb
       
   190   $ touch dira/dirb/largefile
       
   191   $ hg add --large dira/dirb/largefile
       
   192   $ hg commit -m "added"
       
   193   Invoking status precommit hook
       
   194   A dira/dirb/largefile
       
   195   $ cd dira
       
   196   $ hg cp dirb/largefile foo/largefile
       
   197   $ hg ci -m "deep copy"
       
   198   Invoking status precommit hook
       
   199   A dira/foo/largefile
       
   200   $ find . | sort
       
   201   .
       
   202   ./dirb
       
   203   ./dirb/largefile
       
   204   ./foo
       
   205   ./foo/largefile
       
   206   $ hg mv foo/largefile baz/largefile
       
   207   $ hg ci -m "moved"
       
   208   Invoking status precommit hook
       
   209   A dira/baz/largefile
       
   210   R dira/foo/largefile
       
   211   $ find . | sort
       
   212   .
       
   213   ./baz
       
   214   ./baz/largefile
       
   215   ./dirb
       
   216   ./dirb/largefile
       
   217   $ cd ..
       
   218   $ hg mv dira dirc
       
   219   moving .hglf/dira/baz/largefile to .hglf/dirc/baz/largefile (glob)
       
   220   moving .hglf/dira/dirb/largefile to .hglf/dirc/dirb/largefile (glob)
       
   221   $ find * | sort
       
   222   dirc
       
   223   dirc/baz
       
   224   dirc/baz/largefile
       
   225   dirc/dirb
       
   226   dirc/dirb/largefile
       
   227   $ hg up -qC
       
   228   $ cd ../a
       
   229 
   188 
   230 #if serve
   189 #if serve
   231 Test display of largefiles in hgweb
   190 Test display of largefiles in hgweb
   232 
   191 
   233   $ hg serve -d -p $HGPORT --pid-file ../hg.pid
   192   $ hg serve -d -p $HGPORT --pid-file ../hg.pid
  1671   $ hg add --normal new-largefile
  1630   $ hg add --normal new-largefile
  1672   new-largefile: up to 69 MB of RAM may be required to manage this file
  1631   new-largefile: up to 69 MB of RAM may be required to manage this file
  1673   (use 'hg revert new-largefile' to cancel the pending addition)
  1632   (use 'hg revert new-largefile' to cancel the pending addition)
  1674   $ cd ..
  1633   $ cd ..
  1675 
  1634 
  1676 #if serve
  1635 
  1677 vanilla clients not locked out from largefiles servers on vanilla repos
  1636 
  1678   $ mkdir r1
       
  1679   $ cd r1
       
  1680   $ hg init
       
  1681   $ echo c1 > f1
       
  1682   $ hg add f1
       
  1683   $ hg commit -m "m1"
       
  1684   Invoking status precommit hook
       
  1685   A f1
       
  1686   $ cd ..
       
  1687   $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
       
  1688   $ cat hg.pid >> $DAEMON_PIDS
       
  1689   $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
       
  1690   requesting all changes
       
  1691   adding changesets
       
  1692   adding manifests
       
  1693   adding file changes
       
  1694   added 1 changesets with 1 changes to 1 files
       
  1695   updating to branch default
       
  1696   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
  1697 
       
  1698 largefiles clients still work with vanilla servers
       
  1699   $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
       
  1700   $ cat hg.pid >> $DAEMON_PIDS
       
  1701   $ hg clone http://localhost:$HGPORT1 r3
       
  1702   requesting all changes
       
  1703   adding changesets
       
  1704   adding manifests
       
  1705   adding file changes
       
  1706   added 1 changesets with 1 changes to 1 files
       
  1707   updating to branch default
       
  1708   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
  1709 #endif
       
  1710 
       
  1711 
       
  1712 vanilla clients locked out from largefiles http repos
       
  1713   $ mkdir r4
       
  1714   $ cd r4
       
  1715   $ hg init
       
  1716   $ echo c1 > f1
       
  1717   $ hg add --large f1
       
  1718   $ hg commit -m "m1"
       
  1719   Invoking status precommit hook
       
  1720   A f1
       
  1721   $ cd ..
       
  1722 
       
  1723 largefiles can be pushed locally (issue3583)
       
  1724   $ hg init dest
       
  1725   $ cd r4
       
  1726   $ hg outgoing ../dest
       
  1727   comparing with ../dest
       
  1728   searching for changes
       
  1729   changeset:   0:639881c12b4c
       
  1730   tag:         tip
       
  1731   user:        test
       
  1732   date:        Thu Jan 01 00:00:00 1970 +0000
       
  1733   summary:     m1
       
  1734   
       
  1735   $ hg push ../dest
       
  1736   pushing to ../dest
       
  1737   searching for changes
       
  1738   adding changesets
       
  1739   adding manifests
       
  1740   adding file changes
       
  1741   added 1 changesets with 1 changes to 1 files
       
  1742 
       
  1743 exit code with nothing outgoing (issue3611)
       
  1744   $ hg outgoing ../dest
       
  1745   comparing with ../dest
       
  1746   searching for changes
       
  1747   no changes found
       
  1748   [1]
       
  1749   $ cd ..
       
  1750 
       
  1751 #if serve
       
  1752   $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
       
  1753   $ cat hg.pid >> $DAEMON_PIDS
       
  1754   $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
       
  1755   abort: remote error:
       
  1756   
       
  1757   This repository uses the largefiles extension.
       
  1758   
       
  1759   Please enable it in your Mercurial config file.
       
  1760   [255]
       
  1761 
       
  1762 used all HGPORTs, kill all daemons
       
  1763   $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
       
  1764 #endif
       
  1765 
       
  1766 vanilla clients locked out from largefiles ssh repos
       
  1767   $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
       
  1768   abort: remote error:
       
  1769   
       
  1770   This repository uses the largefiles extension.
       
  1771   
       
  1772   Please enable it in your Mercurial config file.
       
  1773   [255]
       
  1774 
       
  1775 #if serve
       
  1776 
       
  1777 largefiles clients refuse to push largefiles repos to vanilla servers
       
  1778   $ mkdir r6
       
  1779   $ cd r6
       
  1780   $ hg init
       
  1781   $ echo c1 > f1
       
  1782   $ hg add f1
       
  1783   $ hg commit -m "m1"
       
  1784   Invoking status precommit hook
       
  1785   A f1
       
  1786   $ cat >> .hg/hgrc <<!
       
  1787   > [web]
       
  1788   > push_ssl = false
       
  1789   > allow_push = *
       
  1790   > !
       
  1791   $ cd ..
       
  1792   $ hg clone r6 r7
       
  1793   updating to branch default
       
  1794   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
  1795   $ cd r7
       
  1796   $ echo c2 > f2
       
  1797   $ hg add --large f2
       
  1798   $ hg commit -m "m2"
       
  1799   Invoking status precommit hook
       
  1800   A f2
       
  1801   $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
       
  1802   $ cat ../hg.pid >> $DAEMON_PIDS
       
  1803   $ hg push http://localhost:$HGPORT
       
  1804   pushing to http://localhost:$HGPORT/
       
  1805   searching for changes
       
  1806   abort: http://localhost:$HGPORT/ does not appear to be a largefile store
       
  1807   [255]
       
  1808   $ cd ..
       
  1809 
       
  1810 putlfile errors are shown (issue3123)
       
  1811 Corrupt the cached largefile in r7 and move it out of the servers usercache
       
  1812   $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
       
  1813   $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
       
  1814   $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
       
  1815   $ hg init empty
       
  1816   $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
       
  1817   >   --config 'web.allow_push=*' --config web.push_ssl=False
       
  1818   $ cat hg.pid >> $DAEMON_PIDS
       
  1819   $ hg push -R r7 http://localhost:$HGPORT1
       
  1820   pushing to http://localhost:$HGPORT1/
       
  1821   searching for changes
       
  1822   remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
       
  1823   abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
       
  1824   [255]
       
  1825   $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
       
  1826 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
       
  1827   $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
       
  1828   $ hg push -R r7 http://localhost:$HGPORT1
       
  1829   pushing to http://localhost:$HGPORT1/
       
  1830   searching for changes
       
  1831   remote: adding changesets
       
  1832   remote: adding manifests
       
  1833   remote: adding file changes
       
  1834   remote: added 2 changesets with 2 changes to 2 files
       
  1835   $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
       
  1836   server side corruption
       
  1837   $ rm -rf empty
       
  1838 
       
  1839 Push a largefiles repository to a served empty repository
       
  1840   $ hg init r8
       
  1841   $ echo c3 > r8/f1
       
  1842   $ hg add --large r8/f1 -R r8
       
  1843   $ hg commit -m "m1" -R r8
       
  1844   Invoking status precommit hook
       
  1845   A f1
       
  1846   $ hg init empty
       
  1847   $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
       
  1848   >   --config 'web.allow_push=*' --config web.push_ssl=False
       
  1849   $ cat hg.pid >> $DAEMON_PIDS
       
  1850   $ rm "${USERCACHE}"/*
       
  1851   $ hg push -R r8 http://localhost:$HGPORT2/#default
       
  1852   pushing to http://localhost:$HGPORT2/
       
  1853   searching for changes
       
  1854   remote: adding changesets
       
  1855   remote: adding manifests
       
  1856   remote: adding file changes
       
  1857   remote: added 1 changesets with 1 changes to 1 files
       
  1858   $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
       
  1859   $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
       
  1860 
       
  1861 Clone over http, no largefiles pulled on clone.
       
  1862 
       
  1863   $ hg clone http://localhost:$HGPORT2/#default http-clone -U
       
  1864   adding changesets
       
  1865   adding manifests
       
  1866   adding file changes
       
  1867   added 1 changesets with 1 changes to 1 files
       
  1868 
       
  1869 test 'verify' with remotestore:
       
  1870 
       
  1871   $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
       
  1872   $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
       
  1873   $ hg -R http-clone verify --large --lfa
       
  1874   checking changesets
       
  1875   checking manifests
       
  1876   crosschecking files in changesets and manifests
       
  1877   checking files
       
  1878   1 files, 1 changesets, 1 total revisions
       
  1879   searching 1 changesets for largefiles
       
  1880   changeset 0:cf03e5bb9936: f1 missing
       
  1881   verified existence of 1 revisions of 1 largefiles
       
  1882   [1]
       
  1883   $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
       
  1884   $ hg -R http-clone -q verify --large --lfa
       
  1885 
       
  1886 largefiles pulled on update - a largefile missing on the server:
       
  1887   $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
       
  1888   $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
       
  1889   getting changed largefiles
       
  1890   f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
       
  1891   0 largefiles updated, 0 removed
       
  1892   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
  1893   $ hg -R http-clone st
       
  1894   ! f1
       
  1895   $ hg -R http-clone up -Cqr null
       
  1896 
       
  1897 largefiles pulled on update - a largefile corrupted on the server:
       
  1898   $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
       
  1899   $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
       
  1900   getting changed largefiles
       
  1901   f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
       
  1902   0 largefiles updated, 0 removed
       
  1903   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
  1904   $ hg -R http-clone st
       
  1905   ! f1
       
  1906   $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
       
  1907   $ [ ! -f http-clone/f1 ]
       
  1908   $ [ ! -f http-clone-usercache ]
       
  1909   $ hg -R http-clone verify --large --lfc
       
  1910   checking changesets
       
  1911   checking manifests
       
  1912   crosschecking files in changesets and manifests
       
  1913   checking files
       
  1914   1 files, 1 changesets, 1 total revisions
       
  1915   searching 1 changesets for largefiles
       
  1916   verified contents of 1 revisions of 1 largefiles
       
  1917   $ hg -R http-clone up -Cqr null
       
  1918 
       
  1919 largefiles pulled on update - no server side problems:
       
  1920   $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
       
  1921   $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache
       
  1922   resolving manifests
       
  1923    branchmerge: False, force: False, partial: False
       
  1924    ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
       
  1925    .hglf/f1: remote created -> g
       
  1926   getting .hglf/f1
       
  1927   updating: .hglf/f1 1/1 files (100.00%)
       
  1928   getting changed largefiles
       
  1929   using http://localhost:$HGPORT2/
       
  1930   sending capabilities command
       
  1931   sending batch command
       
  1932   getting largefiles: 0/1 lfile (0.00%)
       
  1933   getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
       
  1934   sending getlfile command
       
  1935   found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
       
  1936   1 largefiles updated, 0 removed
       
  1937   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
  1938 
       
  1939   $ ls http-clone-usercache/*
       
  1940   http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
       
  1941 
       
  1942   $ rm -rf empty http-clone*
       
  1943 
       
  1944 used all HGPORTs, kill all daemons
       
  1945   $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
       
  1946 
       
  1947 #endif
       
  1948 
       
  1949 
       
  1950 #if unix-permissions
       
  1951 
       
  1952 Clone a local repository owned by another user
       
  1953 We have to simulate that here by setting $HOME and removing write permissions
       
  1954   $ ORIGHOME="$HOME"
       
  1955   $ mkdir alice
       
  1956   $ HOME="`pwd`/alice"
       
  1957   $ cd alice
       
  1958   $ hg init pubrepo
       
  1959   $ cd pubrepo
       
  1960   $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
       
  1961   $ hg add --large a-large-file
       
  1962   $ hg commit -m "Add a large file"
       
  1963   Invoking status precommit hook
       
  1964   A a-large-file
       
  1965   $ cd ..
       
  1966   $ chmod -R a-w pubrepo
       
  1967   $ cd ..
       
  1968   $ mkdir bob
       
  1969   $ HOME="`pwd`/bob"
       
  1970   $ cd bob
       
  1971   $ hg clone --pull ../alice/pubrepo pubrepo
       
  1972   requesting all changes
       
  1973   adding changesets
       
  1974   adding manifests
       
  1975   adding file changes
       
  1976   added 1 changesets with 1 changes to 1 files
       
  1977   updating to branch default
       
  1978   getting changed largefiles
       
  1979   1 largefiles updated, 0 removed
       
  1980   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
  1981   $ cd ..
       
  1982   $ chmod -R u+w alice/pubrepo
       
  1983   $ HOME="$ORIGHOME"
       
  1984 
       
  1985 #endif
       
  1986 
       
  1987 #if symlink
       
  1988 
       
  1989 Symlink to a large largefile should behave the same as a symlink to a normal file
       
  1990   $ hg init largesymlink
       
  1991   $ cd largesymlink
       
  1992   $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
       
  1993   $ hg add --large largefile
       
  1994   $ hg commit -m "commit a large file"
       
  1995   Invoking status precommit hook
       
  1996   A largefile
       
  1997   $ ln -s largefile largelink
       
  1998   $ hg add largelink
       
  1999   $ hg commit -m "commit a large symlink"
       
  2000   Invoking status precommit hook
       
  2001   A largelink
       
  2002   $ rm -f largelink
       
  2003   $ hg up >/dev/null
       
  2004   $ test -f largelink
       
  2005   [1]
       
  2006   $ test -L largelink
       
  2007   [1]
       
  2008   $ rm -f largelink # make next part of the test independent of the previous
       
  2009   $ hg up -C >/dev/null
       
  2010   $ test -f largelink
       
  2011   $ test -L largelink
       
  2012   $ cd ..
       
  2013 
       
  2014 #endif
       
  2015 
       
  2016 test for pattern matching on 'hg status':
       
  2017 to boost performance, largefiles checks whether specified patterns are
       
  2018 related to largefiles in working directory (NOT to STANDIN) or not.
       
  2019 
       
  2020   $ hg init statusmatch
       
  2021   $ cd statusmatch
       
  2022 
       
  2023   $ mkdir -p a/b/c/d
       
  2024   $ echo normal > a/b/c/d/e.normal.txt
       
  2025   $ hg add a/b/c/d/e.normal.txt
       
  2026   $ echo large > a/b/c/d/e.large.txt
       
  2027   $ hg add --large a/b/c/d/e.large.txt
       
  2028   $ mkdir -p a/b/c/x
       
  2029   $ echo normal > a/b/c/x/y.normal.txt
       
  2030   $ hg add a/b/c/x/y.normal.txt
       
  2031   $ hg commit -m 'add files'
       
  2032   Invoking status precommit hook
       
  2033   A a/b/c/d/e.large.txt
       
  2034   A a/b/c/d/e.normal.txt
       
  2035   A a/b/c/x/y.normal.txt
       
  2036 
       
  2037 (1) no pattern: no performance boost
       
  2038   $ hg status -A
       
  2039   C a/b/c/d/e.large.txt
       
  2040   C a/b/c/d/e.normal.txt
       
  2041   C a/b/c/x/y.normal.txt
       
  2042 
       
  2043 (2) pattern not related to largefiles: performance boost
       
  2044   $ hg status -A a/b/c/x
       
  2045   C a/b/c/x/y.normal.txt
       
  2046 
       
  2047 (3) pattern related to largefiles: no performance boost
       
  2048   $ hg status -A a/b/c/d
       
  2049   C a/b/c/d/e.large.txt
       
  2050   C a/b/c/d/e.normal.txt
       
  2051 
       
  2052 (4) pattern related to STANDIN (not to largefiles): performance boost
       
  2053   $ hg status -A .hglf/a
       
  2054   C .hglf/a/b/c/d/e.large.txt
       
  2055 
       
  2056 (5) mixed case: no performance boost
       
  2057   $ hg status -A a/b/c/x a/b/c/d
       
  2058   C a/b/c/d/e.large.txt
       
  2059   C a/b/c/d/e.normal.txt
       
  2060   C a/b/c/x/y.normal.txt
       
  2061 
       
  2062 verify that largefiles doesn't break filesets
       
  2063 
       
  2064   $ hg log --rev . --exclude "set:binary()"
       
  2065   changeset:   0:41bd42f10efa
       
  2066   tag:         tip
       
  2067   user:        test
       
  2068   date:        Thu Jan 01 00:00:00 1970 +0000
       
  2069   summary:     add files
       
  2070   
       
  2071 verify that large files in subrepos handled properly
       
  2072   $ hg init subrepo
       
  2073   $ echo "subrepo = subrepo" > .hgsub
       
  2074   $ hg add .hgsub
       
  2075   $ hg ci -m "add subrepo"
       
  2076   Invoking status precommit hook
       
  2077   A .hgsub
       
  2078   ? .hgsubstate
       
  2079   $ echo "rev 1" > subrepo/large.txt
       
  2080   $ hg -R subrepo add --large subrepo/large.txt
       
  2081   $ hg sum
       
  2082   parent: 1:8ee150ea2e9c tip
       
  2083    add subrepo
       
  2084   branch: default
       
  2085   commit: 1 subrepos
       
  2086   update: (current)
       
  2087   $ hg st
       
  2088   $ hg st -S
       
  2089   A subrepo/large.txt
       
  2090   $ hg ci -S -m "commit top repo"
       
  2091   committing subrepository subrepo
       
  2092   Invoking status precommit hook
       
  2093   A large.txt
       
  2094   Invoking status precommit hook
       
  2095   M .hgsubstate
       
  2096 # No differences
       
  2097   $ hg st -S
       
  2098   $ hg sum
       
  2099   parent: 2:ce4cd0c527a6 tip
       
  2100    commit top repo
       
  2101   branch: default
       
  2102   commit: (clean)
       
  2103   update: (current)
       
  2104   $ echo "rev 2" > subrepo/large.txt
       
  2105   $ hg st -S
       
  2106   M subrepo/large.txt
       
  2107   $ hg sum
       
  2108   parent: 2:ce4cd0c527a6 tip
       
  2109    commit top repo
       
  2110   branch: default
       
  2111   commit: 1 subrepos
       
  2112   update: (current)
       
  2113   $ hg ci -m "this commit should fail without -S"
       
  2114   abort: uncommitted changes in subrepo subrepo
       
  2115   (use --subrepos for recursive commit)
       
  2116   [255]
       
  2117 
       
  2118 Add a normal file to the subrepo, then test archiving
       
  2119 
       
  2120   $ echo 'normal file' > subrepo/normal.txt
       
  2121   $ hg -R subrepo add subrepo/normal.txt
       
  2122 
       
  2123 Lock in subrepo, otherwise the change isn't archived
       
  2124 
       
  2125   $ hg ci -S -m "add normal file to top level"
       
  2126   committing subrepository subrepo
       
  2127   Invoking status precommit hook
       
  2128   M large.txt
       
  2129   A normal.txt
       
  2130   Invoking status precommit hook
       
  2131   M .hgsubstate
       
  2132   $ hg archive -S ../lf_subrepo_archive
       
  2133   $ find ../lf_subrepo_archive | sort
       
  2134   ../lf_subrepo_archive
       
  2135   ../lf_subrepo_archive/.hg_archival.txt
       
  2136   ../lf_subrepo_archive/.hgsub
       
  2137   ../lf_subrepo_archive/.hgsubstate
       
  2138   ../lf_subrepo_archive/a
       
  2139   ../lf_subrepo_archive/a/b
       
  2140   ../lf_subrepo_archive/a/b/c
       
  2141   ../lf_subrepo_archive/a/b/c/d
       
  2142   ../lf_subrepo_archive/a/b/c/d/e.large.txt
       
  2143   ../lf_subrepo_archive/a/b/c/d/e.normal.txt
       
  2144   ../lf_subrepo_archive/a/b/c/x
       
  2145   ../lf_subrepo_archive/a/b/c/x/y.normal.txt
       
  2146   ../lf_subrepo_archive/subrepo
       
  2147   ../lf_subrepo_archive/subrepo/large.txt
       
  2148   ../lf_subrepo_archive/subrepo/normal.txt
       
  2149 
       
  2150 Test update with subrepos.
       
  2151 
       
  2152   $ hg update 0
       
  2153   getting changed largefiles
       
  2154   0 largefiles updated, 1 removed
       
  2155   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
  2156   $ hg status -S
       
  2157   $ hg update tip
       
  2158   getting changed largefiles
       
  2159   1 largefiles updated, 0 removed
       
  2160   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
  2161   $ hg status -S
       
  2162 # modify a large file
       
  2163   $ echo "modified" > subrepo/large.txt
       
  2164   $ hg st -S
       
  2165   M subrepo/large.txt
       
  2166 # update -C should revert the change.
       
  2167   $ hg update -C
       
  2168   getting changed largefiles
       
  2169   1 largefiles updated, 0 removed
       
  2170   getting changed largefiles
       
  2171   0 largefiles updated, 0 removed
       
  2172   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
  2173   $ hg status -S
       
  2174 
       
  2175 Test archiving a revision that references a subrepo that is not yet
       
  2176 cloned (see test-subrepo-recursion.t):
       
  2177 
       
  2178   $ hg clone -U . ../empty
       
  2179   $ cd ../empty
       
  2180   $ hg archive --subrepos -r tip ../archive.tar.gz
       
  2181   cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
       
  2182   $ cd ..
       
  2183 
       
  2184 Test that addremove picks up largefiles prior to the initial commit (issue3541)
       
  2185 
       
  2186   $ hg init addrm2
       
  2187   $ cd addrm2
       
  2188   $ touch large.dat
       
  2189   $ touch large2.dat
       
  2190   $ touch normal
       
  2191   $ hg add --large large.dat
       
  2192   $ hg addremove -v
       
  2193   adding large2.dat as a largefile
       
  2194   adding normal
       
  2195 
       
  2196 Test that forgetting all largefiles reverts to islfilesrepo() == False
       
  2197 (addremove will add *.dat as normal files now)
       
  2198   $ hg forget large.dat
       
  2199   $ hg forget large2.dat
       
  2200   $ hg addremove -v
       
  2201   adding large.dat
       
  2202   adding large2.dat
       
  2203 
       
  2204 Test commit's addremove option prior to the first commit
       
  2205   $ hg forget large.dat
       
  2206   $ hg forget large2.dat
       
  2207   $ hg add --large large.dat
       
  2208   $ hg ci -Am "commit"
       
  2209   adding large2.dat as a largefile
       
  2210   Invoking status precommit hook
       
  2211   A large.dat
       
  2212   A large2.dat
       
  2213   A normal
       
  2214   $ find .hglf | sort
       
  2215   .hglf
       
  2216   .hglf/large.dat
       
  2217   .hglf/large2.dat
       
  2218 
       
  2219 Test actions on largefiles using relative paths from subdir
       
  2220 
       
  2221   $ mkdir sub
       
  2222   $ cd sub
       
  2223   $ echo anotherlarge > anotherlarge
       
  2224   $ hg add --large anotherlarge
       
  2225   $ hg st
       
  2226   A sub/anotherlarge
       
  2227   $ hg st anotherlarge
       
  2228   A anotherlarge
       
  2229   $ hg commit -m anotherlarge anotherlarge
       
  2230   Invoking status precommit hook
       
  2231   A sub/anotherlarge
       
  2232   $ hg log anotherlarge
       
  2233   changeset:   1:9627a577c5e9
       
  2234   tag:         tip
       
  2235   user:        test
       
  2236   date:        Thu Jan 01 00:00:00 1970 +0000
       
  2237   summary:     anotherlarge
       
  2238   
       
  2239   $ hg log -G anotherlarge
       
  2240   @  changeset:   1:9627a577c5e9
       
  2241   |  tag:         tip
       
  2242   |  user:        test
       
  2243   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
  2244   |  summary:     anotherlarge
       
  2245   |
       
  2246   $ echo more >> anotherlarge
       
  2247   $ hg st .
       
  2248   M anotherlarge
       
  2249   $ hg cat anotherlarge
       
  2250   anotherlarge
       
  2251   $ hg revert anotherlarge
       
  2252   $ hg st
       
  2253   ? sub/anotherlarge.orig
       
  2254   $ cd ..
       
  2255 
       
  2256   $ cd ..
       
  2257 
       
  2258 issue3651: summary/outgoing with largefiles shows "no remote repo"
       
  2259 unexpectedly
       
  2260 
       
  2261   $ mkdir issue3651
       
  2262   $ cd issue3651
       
  2263 
       
  2264   $ hg init src
       
  2265   $ echo a > src/a
       
  2266   $ hg -R src add --large src/a
       
  2267   $ hg -R src commit -m '#0'
       
  2268   Invoking status precommit hook
       
  2269   A a
       
  2270 
       
  2271 check messages when no remote repository is specified:
       
  2272 "no remote repo" route for "hg outgoing --large" is not tested here,
       
  2273 because it can't be reproduced easily.
       
  2274 
       
  2275   $ hg init clone1
       
  2276   $ hg -R clone1 -q pull src
       
  2277   $ hg -R clone1 -q update
       
  2278   $ hg -R clone1 paths | grep default
       
  2279   [1]
       
  2280 
       
  2281   $ hg -R clone1 summary --large
       
  2282   parent: 0:fc0bd45326d3 tip
       
  2283    #0
       
  2284   branch: default
       
  2285   commit: (clean)
       
  2286   update: (current)
       
  2287   largefiles: (no remote repo)
       
  2288 
       
  2289 check messages when there is no files to upload:
       
  2290 
       
  2291   $ hg -q clone src clone2
       
  2292   $ hg -R clone2 paths | grep default
       
  2293   default = $TESTTMP/issue3651/src (glob)
       
  2294 
       
  2295   $ hg -R clone2 summary --large
       
  2296   parent: 0:fc0bd45326d3 tip
       
  2297    #0
       
  2298   branch: default
       
  2299   commit: (clean)
       
  2300   update: (current)
       
  2301   largefiles: (no files to upload)
       
  2302   $ hg -R clone2 outgoing --large
       
  2303   comparing with $TESTTMP/issue3651/src (glob)
       
  2304   searching for changes
       
  2305   no changes found
       
  2306   largefiles: no files to upload
       
  2307   [1]
       
  2308 
       
  2309   $ hg -R clone2 outgoing --large --graph --template "{rev}"
       
  2310   comparing with $TESTTMP/issue3651/src (glob)
       
  2311   searching for changes
       
  2312   no changes found
       
  2313   largefiles: no files to upload
       
  2314 
       
  2315 check messages when there are files to upload:
       
  2316 
       
  2317   $ echo b > clone2/b
       
  2318   $ hg -R clone2 add --large clone2/b
       
  2319   $ hg -R clone2 commit -m '#1'
       
  2320   Invoking status precommit hook
       
  2321   A b
       
  2322   $ hg -R clone2 summary --large
       
  2323   parent: 1:1acbe71ce432 tip
       
  2324    #1
       
  2325   branch: default
       
  2326   commit: (clean)
       
  2327   update: (current)
       
  2328   largefiles: 1 to upload
       
  2329   $ hg -R clone2 outgoing --large
       
  2330   comparing with $TESTTMP/issue3651/src (glob)
       
  2331   searching for changes
       
  2332   changeset:   1:1acbe71ce432
       
  2333   tag:         tip
       
  2334   user:        test
       
  2335   date:        Thu Jan 01 00:00:00 1970 +0000
       
  2336   summary:     #1
       
  2337   
       
  2338   largefiles to upload:
       
  2339   b
       
  2340   
       
  2341   $ hg -R clone2 outgoing --large --graph --template "{rev}"
       
  2342   comparing with $TESTTMP/issue3651/src
       
  2343   searching for changes
       
  2344   @  1
       
  2345   
       
  2346   largefiles to upload:
       
  2347   b
       
  2348   
       
  2349 
       
  2350   $ cd ..
       
  2351 
       
  2352 merge action 'd' for 'local renamed directory to d2/g' which has no filename
       
  2353 
       
  2354   $ hg init merge-action
       
  2355   $ cd merge-action
       
  2356   $ touch l
       
  2357   $ hg add --large l
       
  2358   $ mkdir d1
       
  2359   $ touch d1/f
       
  2360   $ hg ci -Aqm0
       
  2361   Invoking status precommit hook
       
  2362   A d1/f
       
  2363   A l
       
  2364   $ echo > d1/f
       
  2365   $ touch d1/g
       
  2366   $ hg ci -Aqm1
       
  2367   Invoking status precommit hook
       
  2368   M d1/f
       
  2369   A d1/g
       
  2370   $ hg up -qr0
       
  2371   $ hg mv d1 d2
       
  2372   moving d1/f to d2/f (glob)
       
  2373   $ hg ci -qm2
       
  2374   Invoking status precommit hook
       
  2375   A d2/f
       
  2376   R d1/f
       
  2377   $ hg merge
       
  2378   merging d2/f and d1/f to d2/f
       
  2379   1 files updated, 1 files merged, 0 files removed, 0 files unresolved
       
  2380   (branch merge, don't forget to commit)
       
  2381   getting changed largefiles
       
  2382   0 largefiles updated, 0 removed
       
  2383   $ cd ..
       
  2384 
       
  2385 
       
  2386 Merge conflicts:
       
  2387 
       
  2388   $ hg init merge
       
  2389   $ cd merge
       
  2390   $ echo 0 > f-different
       
  2391   $ echo 0 > f-same
       
  2392   $ echo 0 > f-unchanged-1
       
  2393   $ echo 0 > f-unchanged-2
       
  2394   $ hg add --large *
       
  2395   $ hg ci -m0
       
  2396   Invoking status precommit hook
       
  2397   A f-different
       
  2398   A f-same
       
  2399   A f-unchanged-1
       
  2400   A f-unchanged-2
       
  2401   $ echo tmp1 > f-unchanged-1
       
  2402   $ echo tmp1 > f-unchanged-2
       
  2403   $ echo tmp1 > f-same
       
  2404   $ hg ci -m1
       
  2405   Invoking status precommit hook
       
  2406   M f-same
       
  2407   M f-unchanged-1
       
  2408   M f-unchanged-2
       
  2409   $ echo 2 > f-different
       
  2410   $ echo 0 > f-unchanged-1
       
  2411   $ echo 1 > f-unchanged-2
       
  2412   $ echo 1 > f-same
       
  2413   $ hg ci -m2
       
  2414   Invoking status precommit hook
       
  2415   M f-different
       
  2416   M f-same
       
  2417   M f-unchanged-1
       
  2418   M f-unchanged-2
       
  2419   $ hg up -qr0
       
  2420   $ echo tmp2 > f-unchanged-1
       
  2421   $ echo tmp2 > f-unchanged-2
       
  2422   $ echo tmp2 > f-same
       
  2423   $ hg ci -m3
       
  2424   Invoking status precommit hook
       
  2425   M f-same
       
  2426   M f-unchanged-1
       
  2427   M f-unchanged-2
       
  2428   created new head
       
  2429   $ echo 1 > f-different
       
  2430   $ echo 1 > f-unchanged-1
       
  2431   $ echo 0 > f-unchanged-2
       
  2432   $ echo 1 > f-same
       
  2433   $ hg ci -m4
       
  2434   Invoking status precommit hook
       
  2435   M f-different
       
  2436   M f-same
       
  2437   M f-unchanged-1
       
  2438   M f-unchanged-2
       
  2439   $ hg merge
       
  2440   largefile f-different has a merge conflict
       
  2441   ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7
       
  2442   keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or
       
  2443   take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l
       
  2444   0 files updated, 4 files merged, 0 files removed, 0 files unresolved
       
  2445   (branch merge, don't forget to commit)
       
  2446   getting changed largefiles
       
  2447   1 largefiles updated, 0 removed
       
  2448   $ cat f-different
       
  2449   1
       
  2450   $ cat f-same
       
  2451   1
       
  2452   $ cat f-unchanged-1
       
  2453   1
       
  2454   $ cat f-unchanged-2
       
  2455   1
       
  2456   $ cd ..
       
  2457 
       
  2458 Check whether "largefiles" feature is supported only in repositories
       
  2459 enabling largefiles extension.
       
  2460 
       
  2461   $ mkdir individualenabling
       
  2462   $ cd individualenabling
       
  2463 
       
  2464   $ hg init enabledlocally
       
  2465   $ echo large > enabledlocally/large
       
  2466   $ hg -R enabledlocally add --large enabledlocally/large
       
  2467   $ hg -R enabledlocally commit -m '#0'
       
  2468   Invoking status precommit hook
       
  2469   A large
       
  2470 
       
  2471   $ hg init notenabledlocally
       
  2472   $ echo large > notenabledlocally/large
       
  2473   $ hg -R notenabledlocally add --large notenabledlocally/large
       
  2474   $ hg -R notenabledlocally commit -m '#0'
       
  2475   Invoking status precommit hook
       
  2476   A large
       
  2477 
       
  2478   $ cat >> $HGRCPATH <<EOF
       
  2479   > [extensions]
       
  2480   > # disable globally
       
  2481   > largefiles=!
       
  2482   > EOF
       
  2483   $ cat >> enabledlocally/.hg/hgrc <<EOF
       
  2484   > [extensions]
       
  2485   > # enable locally
       
  2486   > largefiles=
       
  2487   > EOF
       
  2488   $ hg -R enabledlocally root
       
  2489   $TESTTMP/individualenabling/enabledlocally (glob)
       
  2490   $ hg -R notenabledlocally root
       
  2491   abort: repository requires features unknown to this Mercurial: largefiles!
       
  2492   (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
       
  2493   [255]
       
  2494 
       
  2495   $ hg init push-dst
       
  2496   $ hg -R enabledlocally push push-dst
       
  2497   pushing to push-dst
       
  2498   abort: required features are not supported in the destination: largefiles
       
  2499   [255]
       
  2500 
       
  2501   $ hg init pull-src
       
  2502   $ hg -R pull-src pull enabledlocally
       
  2503   pulling from enabledlocally
       
  2504   abort: required features are not supported in the destination: largefiles
       
  2505   [255]
       
  2506 
       
  2507   $ hg clone enabledlocally clone-dst
       
  2508   abort: repository requires features unknown to this Mercurial: largefiles!
       
  2509   (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
       
  2510   [255]
       
  2511   $ test -d clone-dst
       
  2512   [1]
       
  2513   $ hg clone --pull enabledlocally clone-pull-dst
       
  2514   abort: required features are not supported in the destination: largefiles
       
  2515   [255]
       
  2516   $ test -d clone-pull-dst
       
  2517   [1]
       
  2518 
       
  2519 #if serve
       
  2520 
       
  2521 Test largefiles specific peer setup, when largefiles is enabled
       
  2522 locally (issue4109)
       
  2523 
       
  2524   $ hg showconfig extensions | grep largefiles
       
  2525   extensions.largefiles=!
       
  2526   $ mkdir -p $TESTTMP/individualenabling/usercache
       
  2527 
       
  2528   $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid
       
  2529   $ cat hg.pid >> $DAEMON_PIDS
       
  2530 
       
  2531   $ hg init pull-dst
       
  2532   $ cat > pull-dst/.hg/hgrc <<EOF
       
  2533   > [extensions]
       
  2534   > # enable locally
       
  2535   > largefiles=
       
  2536   > [largefiles]
       
  2537   > # ignore system cache to force largefiles specific wire proto access
       
  2538   > usercache=$TESTTMP/individualenabling/usercache
       
  2539   > EOF
       
  2540   $ hg -R pull-dst -q pull -u http://localhost:$HGPORT
       
  2541 
       
  2542   $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
       
  2543 #endif
       
  2544 
       
  2545   $ cd ..