##// END OF EJS Templates
archive: set date to 1980 for very old zip files...
archive: set date to 1980 for very old zip files The zip file format stores the date using "MS-DOS format" which apparently means that they use 1980 as their epoch. Python's zipfile module emits deprecation warnings of this form /usr/lib/python2.6/zipfile.py:1108: DeprecationWarning: struct integer overflow masking is deprecated self.fp.write(zinfo.FileHeader()) /usr/lib/python2.6/zipfile.py:1108: DeprecationWarning: 'H' format requires 0 <= number <= 65535 self.fp.write(zinfo.FileHeader()) /home/mg/src/mercurial-crew/mercurial/archival.py:169: DeprecationWarning: struct integer overflow masking is deprecated self.z.close() /home/mg/src/mercurial-crew/mercurial/archival.py:169: DeprecationWarning: 'H' format requires 0 <= number <= 65535 self.z.close() when it is given such old timestamps. This fixes this by silently clamping the date to 1980.

File last commit:

r11551:4484a7b6 default
r12319:381f1312 stable
Show More
test-diff-upgrade
63 lines | 1.5 KiB | text/plain | TextLexer
#!/bin/sh
echo "[extensions]" >> $HGRCPATH
echo "autodiff=$TESTDIR/autodiff.py" >> $HGRCPATH
echo "[diff]" >> $HGRCPATH
echo "nodates=1" >> $HGRCPATH
hg init repo
cd repo
echo '% make a combination of new, changed and deleted file'
echo regular > regular
echo rmregular > rmregular
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 "file('rmbinary', 'wb').write('\0')"
hg ci -Am addfiles
echo regular >> regular
echo newregular >> newregular
rm rmempty
touch newempty
rm rmregular
echo exec >> exec
echo newexec > newexec
chmod +x newexec
rm rmexec
chmod +x setexec
chmod -x unsetexec
python -c "file('binary', 'wb').write('\0\0')"
python -c "file('newbinary', 'wb').write('\0')"
rm rmbinary
hg addremove
echo '% git=no: regular diff for all files'
hg autodiff --git=no
echo '% git=no: git diff for single regular file'
hg autodiff --git=yes regular
echo '% git=auto: regular diff for regular files and removals'
hg autodiff --git=auto regular newregular rmregular rmbinary rmexec
for f in exec newexec setexec unsetexec binary newbinary newempty rmempty; do
echo '% git=auto: git diff for' $f
hg autodiff --git=auto $f
done
echo '% git=warn: regular diff with data loss warnings'
hg autodiff --git=warn
echo '% git=abort: fail on execute bit change'
hg autodiff --git=abort regular setexec
echo '% git=abort: succeed on regular file'
hg autodiff --git=abort regular
cd ..