comparison tests/test-convert-git.t @ 19121:478a04605ce1

splicemap: improve error handling when source is git (issue2084) Implemented similar error handling that is done for hg in an earlier revision. These are: a. add checking for splicemap file format b. add checking for each revision string formats
author Ben Goswami <bengoswami@fb.com>
date Thu, 25 Apr 2013 16:02:58 -0700
parents ad5817505834
children aa9385f983fa
comparison
equal deleted inserted replaced
19120:58e782f076e7 19121:478a04605ce1
11 $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL 11 $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
12 $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE 12 $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
13 $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME 13 $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
14 $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL 14 $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
15 $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE 15 $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
16 $ INVALIDID1=afd12345af
17 $ INVALIDID2=28173x36ddd1e67bf7098d541130558ef5534a86
18 $ VALIDID1=39b3d83f9a69a9ba4ebb111461071a0af0027357
19 $ VALIDID2=8dd6476bd09d9c7776355dc454dafe38efaec5da
16 $ count=10 20 $ count=10
17 $ commit() 21 $ commit()
18 > { 22 > {
19 > GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000" 23 > GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
20 > GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" 24 > GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
296 $ git init-db >/dev/null 2>/dev/null 300 $ git init-db >/dev/null 2>/dev/null
297 $ git submodule add ${BASE} >/dev/null 2>/dev/null 301 $ git submodule add ${BASE} >/dev/null 2>/dev/null
298 $ commit -a -m 'addsubmodule' >/dev/null 2>/dev/null 302 $ commit -a -m 'addsubmodule' >/dev/null 2>/dev/null
299 $ cd .. 303 $ cd ..
300 304
305 test invalid splicemap1
306
307 $ cat > splicemap <<EOF
308 > $VALIDID1
309 > EOF
310 $ hg convert --splicemap splicemap git-repo2 git-repo2-splicemap1-hg
311 initializing destination git-repo2-splicemap1-hg repository
312 abort: syntax error in splicemap(1): child parent1[,parent2] expected
313 [255]
314
315 test invalid splicemap2
316
317 $ cat > splicemap <<EOF
318 > $VALIDID1 $VALIDID2, $VALIDID2, $VALIDID2
319 > EOF
320 $ hg convert --splicemap splicemap git-repo2 git-repo2-splicemap2-hg
321 initializing destination git-repo2-splicemap2-hg repository
322 abort: syntax error in splicemap(1): child parent1[,parent2] expected
323 [255]
324
325 test invalid splicemap3
326
327 $ cat > splicemap <<EOF
328 > $INVALIDID1 $INVALIDID2
329 > EOF
330 $ hg convert --splicemap splicemap git-repo2 git-repo2-splicemap3-hg
331 initializing destination git-repo2-splicemap3-hg repository
332 abort: splicemap entry afd12345af is not a valid revision identifier
333 [255]
334
301 convert sub modules 335 convert sub modules
302 $ hg convert git-repo6 git-repo6-hg 336 $ hg convert git-repo6 git-repo6-hg
303 initializing destination git-repo6-hg repository 337 initializing destination git-repo6-hg repository
304 scanning source... 338 scanning source...
305 sorting... 339 sorting...