##// 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:

r8523:5b7da468 default
r12319:381f1312 stable
Show More
test-merge-commit
74 lines | 1.6 KiB | text/plain | TextLexer
#!/bin/sh
# check that renames are correctly saved by a commit after a merge
# test with the merge on 3 having the rename on the local parent
hg init a
cd a
echo line1 > foo
hg add foo
hg ci -m '0: add foo'
echo line2 >> foo
hg ci -m '1: change foo'
hg up -C 0
hg mv foo bar
rm bar
echo line0 > bar
echo line1 >> bar
hg ci -m '2: mv foo bar; change bar'
hg merge 1
echo '% contents of bar should be line0 line1 line2'
cat bar
hg ci -m '3: merge with local rename'
hg debugindex .hg/store/data/bar.i
hg debugrename bar
hg debugindex .hg/store/data/foo.i
# revert the content change from rev 2
hg up -C 2
rm bar
echo line1 > bar
hg ci -m '4: revert content change from rev 2'
hg log --template '{rev}:{node|short} {parents}\n'
echo '% this should use bar@rev2 as the ancestor'
hg --debug merge 3
echo '% contents of bar should be line1 line2'
cat bar
hg ci -m '5: merge'
hg debugindex .hg/store/data/bar.i
# same thing, but with the merge on 3 having the rename on the remote parent
echo
echo
cd ..
hg clone -U -r 1 -r 2 a b
cd b
hg up -C 1
hg merge 2
echo '% contents of bar should be line0 line1 line2'
cat bar
hg ci -m '3: merge with remote rename'
hg debugindex .hg/store/data/bar.i
hg debugrename bar
hg debugindex .hg/store/data/foo.i
# revert the content change from rev 2
hg up -C 2
rm bar
echo line1 > bar
hg ci -m '4: revert content change from rev 2'
hg log --template '{rev}:{node|short} {parents}\n'
echo '% this should use bar@rev2 as the ancestor'
hg --debug merge 3
echo '% contents of bar should be line1 line2'
cat bar
hg ci -m '5: merge'
hg debugindex .hg/store/data/bar.i