diff mercurial/util.py @ 6835:08d9e0f974d9

make mq and tags hardlink safe The code didn't check for modes like "r+" or "rb+". Many thanks to agriffis for noticing it.
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Wed, 23 Jul 2008 16:08:20 +0200
parents ed9b07a97587
children c016dc1a8e91 1d38f3605b20
line wrap: on
line diff
--- a/mercurial/util.py	Sun Jul 20 21:00:13 2008 +0200
+++ b/mercurial/util.py	Wed Jul 23 16:08:20 2008 +0200
@@ -1427,7 +1427,7 @@
             mode += "b" # for that other OS
 
         nlink = -1
-        if mode[0] != "r":
+        if mode not in ("r", "rb"):
             try:
                 nlink = nlinks(f)
             except OSError: