[issue749] rollback corrupts repo

Maxim Dounin mercurial-bugs at selenic.com
Sat Sep 22 17:28:16 CDT 2007


New submission from Maxim Dounin <mdounin at mdounin.ru>:

The first bad revision is:
changeset:   4981:e7131935fbb3
user:        Matt Mackall <mpm at selenic.com>
date:        Mon Jul 23 20:44:08 2007 -0500
summary:     revlog: simplify addrevision

After the above change, hg rollback may corrupt repo if commit being rolled 
back changed file storage model from single .i file to .i and .d files.

Here is what happens:

mkdir tt
cd tt
../hg init .
dd if=/dev/random of=tt count=1 bs=1k
1+0 records in
1+0 records out
1024 bytes transferred in 0.000407 secs (2516091 bytes/sec)
../hg ci -A -m "1"
adding tt
ls -la .hg/store/data
total 6
drwxr-xr-x  2 mdounin  mdounin   512 Sep 23 02:24 .
drwxr-xr-x  3 mdounin  mdounin   512 Sep 23 02:24 ..
-rw-r--r--  1 mdounin  mdounin  1089 Sep 23 02:24 tt.i
dd if=/dev/random of=tt count=1 bs=1M
1+0 records in
1+0 records out
1048576 bytes transferred in 0.121892 secs (8602502 bytes/sec)
../hg ci -m "2"
ls -la .hg/store/data
total 1062
drwxr-xr-x  2 mdounin  mdounin      512 Sep 23 02:24 .
drwxr-xr-x  3 mdounin  mdounin      512 Sep 23 02:24 ..
-rw-r--r--  1 mdounin  mdounin  1049613 Sep 23 02:24 tt.d
-rw-r--r--  1 mdounin  mdounin      128 Sep 23 02:24 tt.i
../hg rollback
rolling back last transaction
ls -la .hg/store/data
total 4
drwxr-xr-x  2 mdounin  mdounin  512 Sep 23 02:24 .
drwxr-xr-x  3 mdounin  mdounin  512 Sep 23 02:24 ..
-rw-r--r--  1 mdounin  mdounin    0 Sep 23 02:24 tt.d
-rw-r--r--  1 mdounin  mdounin    0 Sep 23 02:24 tt.i
../hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
node ce32b898d7443d78427794a6482935a5ec8f253f in manifests not in tt
1 files, 1 changesets, 0 total revisions
1 integrity errors encountered!

----------
messages: 4028
nosy: mdounin
priority: urgent
status: unread
title: rollback corrupts repo

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue749>
____________________________________________________



More information about the Mercurial-devel mailing list