tests/test-dumprevlog
author Adrian Buehlmann <adrian@cadifra.com>
Thu, 03 Apr 2008 17:17:39 +0200
changeset 6465 9b340e725c11
child 6515 f65ac37f0a15
permissions -rw-r--r--
add tests for contrib/dumprevlog and undumprevlog
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6465
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     1
#!/bin/sh
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     2
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     3
CONTRIBDIR=$TESTDIR/../contrib
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     4
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     5
mkdir repo-a
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     6
cd repo-a
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     7
hg init
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     8
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
     9
echo this is file a > a
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    10
hg add a
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    11
hg commit -m first -d '0 0'
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    12
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    13
echo adding to file a >> a
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    14
hg commit -m second -d '0 0'
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    15
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    16
echo adding more to file a >> a
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    17
hg commit -m third -d '0 0'
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    18
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    19
hg verify
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    20
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    21
echo dumping revlog of file a to stdout:
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    22
python $CONTRIBDIR/dumprevlog .hg/store/data/a.i
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    23
echo dumprevlog done
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    24
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    25
# dump all revlogs to file repo.dump
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    26
find .hg/store/ -name "*.i" | xargs python $CONTRIBDIR/dumprevlog > ../repo.dump
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    27
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    28
cd ..
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    29
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    30
mkdir repo-b
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    31
cd repo-b
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    32
hg init
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    33
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    34
echo undumping:
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    35
python $CONTRIBDIR/undumprevlog < ../repo.dump
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    36
echo undumping done
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    37
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    38
hg verify
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    39
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    40
cd ..
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    41
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    42
echo comparing repos:
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    43
hg -R repo-b incoming repo-a
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    44
hg -R repo-a incoming repo-b
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    45
echo comparing done
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    46
9b340e725c11 add tests for contrib/dumprevlog and undumprevlog
Adrian Buehlmann <adrian@cadifra.com>
parents:
diff changeset
    47
exit 0