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

Mads Kiilerich mads at kiilerich.com
Fri Jun 8 16:40:35 CDT 2012


alexandrul.ct at gmail.com wrote, On 06/08/2012 05:23 PM:
> # 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)

Why is this needed now ... or why is it only needed on windows?

> +  >             os.remove(path)
> +  >             break
> +  >         except:
> +  >             continue

Why this blank except/continue? What problem will it hide ... and why is 
that not a problem?

>     > EOF
>     $ python damage.py
>     $ hg convert git-repo4 git-repo4-broken-hg 2>&1 | \
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel




More information about the Mercurial-devel mailing list