Show More
@@ -281,24 +281,6 b' convert author committer' | |||||
281 | abort: --sourcesort is not supported by this data source |
|
281 | abort: --sourcesort is not supported by this data source | |
282 | [255] |
|
282 | [255] | |
283 |
|
283 | |||
284 | damage git repository and convert again |
|
|||
285 |
|
||||
286 | $ cat > damage.py <<EOF |
|
|||
287 | > import os |
|
|||
288 | > import stat |
|
|||
289 | > for root, dirs, files in os.walk('git-repo4/.git/objects'): |
|
|||
290 | > if files: |
|
|||
291 | > path = os.path.join(root, files[0]) |
|
|||
292 | > if os.name == 'nt': |
|
|||
293 | > os.chmod(path, stat.S_IWUSR) |
|
|||
294 | > os.remove(path) |
|
|||
295 | > break |
|
|||
296 | > EOF |
|
|||
297 | $ python damage.py |
|
|||
298 | $ hg convert git-repo4 git-repo4-broken-hg 2>&1 | \ |
|
|||
299 | > grep 'abort:' | sed 's/abort:.*/abort:/g' |
|
|||
300 | abort: |
|
|||
301 |
|
||||
302 | test sub modules |
|
284 | test sub modules | |
303 |
|
285 | |||
304 | $ mkdir git-repo5 |
|
286 | $ mkdir git-repo5 | |
@@ -345,3 +327,32 b' convert sub modules' | |||||
345 | $ cd git-repo5 |
|
327 | $ cd git-repo5 | |
346 | $ cat foo |
|
328 | $ cat foo | |
347 | sub |
|
329 | sub | |
|
330 | ||||
|
331 | $ cd ../.. | |||
|
332 | ||||
|
333 | damaged git repository tests: | |||
|
334 | In case the hard-coded hashes change, the following commands can be used to | |||
|
335 | list the hashes and their corresponding types in the repository: | |||
|
336 | cd git-repo4/.git/objects | |||
|
337 | find . -type f | cut -c 3- | sed 's_/__' | xargs -n 1 -t git cat-file -t | |||
|
338 | cd ../../.. | |||
|
339 | ||||
|
340 | damage git repository by renaming a commit object | |||
|
341 | $ COMMIT_OBJ=1c/0ce3c5886f83a1d78a7b517cdff5cf9ca17bdd | |||
|
342 | $ mv git-repo4/.git/objects/$COMMIT_OBJ git-repo4/.git/objects/$COMMIT_OBJ.tmp | |||
|
343 | $ hg convert git-repo4 git-repo4-broken-hg 2>&1 | grep 'abort:' | |||
|
344 | abort: cannot read tags from git-repo4/.git | |||
|
345 | $ mv git-repo4/.git/objects/$COMMIT_OBJ.tmp git-repo4/.git/objects/$COMMIT_OBJ | |||
|
346 | damage git repository by renaming a blob object | |||
|
347 | ||||
|
348 | $ BLOB_OBJ=8b/137891791fe96927ad78e64b0aad7bded08bdc | |||
|
349 | $ mv git-repo4/.git/objects/$BLOB_OBJ git-repo4/.git/objects/$BLOB_OBJ.tmp | |||
|
350 | $ hg convert git-repo4 git-repo4-broken-hg 2>&1 | grep 'abort:' | |||
|
351 | abort: cannot read 'blob' object at 8b137891791fe96927ad78e64b0aad7bded08bdc | |||
|
352 | $ mv git-repo4/.git/objects/$BLOB_OBJ.tmp git-repo4/.git/objects/$BLOB_OBJ | |||
|
353 | damage git repository by renaming a tree object | |||
|
354 | ||||
|
355 | $ TREE_OBJ=72/49f083d2a63a41cc737764a86981eb5f3e4635 | |||
|
356 | $ mv git-repo4/.git/objects/$TREE_OBJ git-repo4/.git/objects/$TREE_OBJ.tmp | |||
|
357 | $ hg convert git-repo4 git-repo4-broken-hg 2>&1 | grep 'abort:' | |||
|
358 | abort: cannot read changes in 1c0ce3c5886f83a1d78a7b517cdff5cf9ca17bdd |
General Comments 0
You need to be logged in to leave comments.
Login now