Mercurial > hg
comparison tests/test-convert-git.t @ 16893:46ccd44dd65b
test-convert-git: remove the read-only attribute of repository files
Git object files are stored read-only in the filesystem. Trying to remove a
read-only file on windows will fail with access denied, so we have to make them
writeable before they can be removed.
author | Eduard-Cristian Stefan <alexandrul.ct@gmail.com> |
---|---|
date | Fri, 08 Jun 2012 05:37:06 +0300 |
parents | cfd892b7569f |
children | 8f36806b8f6a |
comparison
equal
deleted
inserted
replaced
16892:cfd892b7569f | 16893:46ccd44dd65b |
---|---|
281 | 281 |
282 damage git repository and convert again | 282 damage git repository and convert again |
283 | 283 |
284 $ cat > damage.py <<EOF | 284 $ cat > damage.py <<EOF |
285 > import os | 285 > import os |
286 > import stat | |
286 > for root, dirs, files in os.walk('git-repo4/.git/objects'): | 287 > for root, dirs, files in os.walk('git-repo4/.git/objects'): |
287 > if files: | 288 > if files: |
288 > path = os.path.join(root, files[0]) | 289 > path = os.path.join(root, files[0]) |
290 > if os.name == 'nt': | |
291 > os.chmod(path, stat.S_IWUSR) | |
289 > os.remove(path) | 292 > os.remove(path) |
290 > break | 293 > break |
291 > EOF | 294 > EOF |
292 $ python damage.py | 295 $ python damage.py |
293 $ hg convert git-repo4 git-repo4-broken-hg 2>&1 | \ | 296 $ hg convert git-repo4 git-repo4-broken-hg 2>&1 | \ |