[PATCH] test-convert-git: remove the read-only attribute of repository files

Eduard-Cristian Stefan alexandrul.ct at gmail.com
Fri Jun 8 01:07:22 CDT 2012


# HG changeset patch
# User Eduard-Cristian Stefan <alexandrul.ct at gmail.com>
# Date 1339123026 -10800
# Node ID 9b91d3b4fc4cdcb28467a731e1d59adf67fccb5a
# Parent  b52a0e4efa04b7859f56c4e74b158e1563d08ae5
test-convert-git: remove the read-only attribute of repository files

diff --git a/tests/test-convert-git.t b/tests/test-convert-git.t
--- a/tests/test-convert-git.t
+++ b/tests/test-convert-git.t
@@ -283,11 +283,17 @@

   $ cat > damage.py <<EOF
   > import os
+  > import stat
   > for root, dirs, files in os.walk('git-repo4/.git/objects'):
   >     if files:
   >         path = os.path.join(root, files[0])
-  >         os.remove(path)
-  >         break
+  >         try:
+  >             if os.name == 'nt':
+  >                 os.chmod(path, stat.S_IWRITE)
+  >             os.remove(path)
+  >             break
+  >         except:
+  >             continue
   > EOF
   $ python damage.py
   $ hg convert git-repo4 git-repo4-broken-hg 2>&1 | \
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 16883.patch
Type: application/octet-stream
Size: 959 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20120608/0ac6775e/attachment.obj>


More information about the Mercurial-devel mailing list