2020-01-31 05:40:49 +03:00
|
|
|
#require py2
|
2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
|
|
|
#chg-compatible
|
|
|
|
|
2018-02-21 16:55:07 +03:00
|
|
|
#testcases case-innodb case-rocksdb
|
2020-01-20 13:42:49 +03:00
|
|
|
$ disable treemanifest
|
2018-02-21 16:55:07 +03:00
|
|
|
|
|
|
|
#if case-rocksdb
|
|
|
|
$ DBENGINE=rocksdb
|
|
|
|
#else
|
|
|
|
$ DBENGINE=innodb
|
|
|
|
#endif
|
|
|
|
|
2018-01-03 17:35:21 +03:00
|
|
|
no-check-code
|
|
|
|
|
2017-03-25 02:19:13 +03:00
|
|
|
Python2 is required for its binary path handling
|
|
|
|
|
|
|
|
$ hash python2 &>/dev/null || { echo 'skipped: missing python2'; exit 80; }
|
2018-01-04 18:22:19 +03:00
|
|
|
$ . "$TESTDIR/hgsql/library.sh"
|
2017-03-25 02:19:13 +03:00
|
|
|
|
|
|
|
Create a repo with non-ascii paths
|
|
|
|
|
|
|
|
$ initclient client1
|
|
|
|
$ cd client1
|
|
|
|
|
|
|
|
..Create a file with tailing space (test the database will not eat the space)
|
|
|
|
|
|
|
|
$ echo a > 'a '
|
|
|
|
$ if [ $? -ne 0 ]; then
|
|
|
|
> echo 'skipped: filesystem does not support binary paths'
|
|
|
|
> exit 80
|
|
|
|
> fi
|
|
|
|
$ hg add . -q 2>/dev/null
|
|
|
|
$ hg commit -m 'tailing spaces' -q
|
|
|
|
|
2019-04-13 05:52:01 +03:00
|
|
|
..Create files with utf8 encoded unicode characters
|
2017-03-25 02:19:13 +03:00
|
|
|
|
|
|
|
$ python2 2>/dev/null << EOF
|
2020-03-16 20:11:19 +03:00
|
|
|
> for i in range(2, 256):
|
2017-03-25 02:19:13 +03:00
|
|
|
> if chr(i) in '/.\n\r':
|
|
|
|
> continue
|
2019-04-13 05:52:01 +03:00
|
|
|
> name = (unichr(i) * (i % 7 + 1)).encode('utf8')
|
2017-03-25 02:19:13 +03:00
|
|
|
> with open(name, 'wb') as f:
|
|
|
|
> f.write(b'foo')
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
$ if [ $? -ne 0 ]; then
|
2019-04-13 05:52:01 +03:00
|
|
|
> echo 'skipped: filesystem does not support non ascii paths'
|
2017-03-25 02:19:13 +03:00
|
|
|
> exit 80
|
|
|
|
> fi
|
|
|
|
|
|
|
|
$ hg add . -q 2>/dev/null
|
2019-04-13 05:52:01 +03:00
|
|
|
$ hg commit -m 'nonascii paths' -q
|
2017-03-25 02:19:13 +03:00
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
$ hg log -T '{node} {desc}\n'
|
|
|
|
a03fe2c5c0c917d545f5026260290c25e311871f nonascii paths
|
|
|
|
c2d59fc1ca219a78013735473161145cb4d7d7fc tailing spaces
|
2017-03-25 02:19:13 +03:00
|
|
|
|
|
|
|
$ hg bookmark nonasciipath
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Create the master repo
|
|
|
|
|
|
|
|
$ initserver master1 sqlreponame
|
|
|
|
$ cd master1
|
|
|
|
$ hg pull -q ../client1
|
|
|
|
|
2020-10-08 06:58:22 +03:00
|
|
|
$ hg log -T '{node} {desc}\n'
|
|
|
|
a03fe2c5c0c917d545f5026260290c25e311871f nonascii paths
|
|
|
|
c2d59fc1ca219a78013735473161145cb4d7d7fc tailing spaces
|
2017-03-25 02:19:13 +03:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Create another master repo, it should synchronize from the database
|
|
|
|
|
|
|
|
$ initserver master2 sqlreponame
|
|
|
|
$ cd master2
|
2020-10-08 06:58:22 +03:00
|
|
|
$ hg log -T '{node} {desc}\n'
|
|
|
|
a03fe2c5c0c917d545f5026260290c25e311871f nonascii paths
|
|
|
|
c2d59fc1ca219a78013735473161145cb4d7d7fc tailing spaces
|
2017-03-25 02:19:13 +03:00
|
|
|
|
|
|
|
$ hg bookmark
|
2020-03-16 20:11:19 +03:00
|
|
|
nonasciipath 1:a03fe2c5c0c9
|
2017-03-25 02:19:13 +03:00
|
|
|
|
|
|
|
$ hg up nonasciipath -q
|
|
|
|
$ [[ -f 'a ' ]] && echo good
|
|
|
|
good
|
|
|
|
|
|
|
|
$ hg verify
|
|
|
|
checking changesets
|
|
|
|
checking manifests
|
|
|
|
crosschecking files in changesets and manifests
|
|
|
|
checking files
|
2020-03-16 20:11:19 +03:00
|
|
|
251 files, 2 changesets, 251 total revisions
|
2017-03-25 02:19:13 +03:00
|
|
|
|
|
|
|
$ cd ..
|