mercurial/util.py
changeset 461 9ae0034f2772
parent 441 e8af362cfb01
child 464 50da4bb9cab6
equal deleted inserted replaced
460:6409d9a0df43 461:9ae0034f2772
    14         os.unlink(dst)
    14         os.unlink(dst)
    15         os.rename(src, dst)
    15         os.rename(src, dst)
    16 
    16 
    17 # Platfor specific varients
    17 # Platfor specific varients
    18 if os.name == 'nt':
    18 if os.name == 'nt':
       
    19     nulldev = 'NUL:'
       
    20 
    19     def is_exec(f, last):
    21     def is_exec(f, last):
    20         return last
    22         return last
    21 
    23 
    22     def set_exec(f, mode):
    24     def set_exec(f, mode):
    23         pass
    25         pass
    30         os.write(ld, info)
    32         os.write(ld, info)
    31         os.close(ld)
    33         os.close(ld)
    32 
    34 
    33     def readlock(pathname):
    35     def readlock(pathname):
    34         return file(pathname).read()
    36         return file(pathname).read()
       
    37 
    35 else:
    38 else:
       
    39     nulldev = '/dev/null'
       
    40 
    36     def is_exec(f, last):
    41     def is_exec(f, last):
    37         return (os.stat(f).st_mode & 0100 != 0)
    42         return (os.stat(f).st_mode & 0100 != 0)
    38 
    43 
    39     def set_exec(f, mode):
    44     def set_exec(f, mode):
    40         s = os.stat(f).st_mode
    45         s = os.stat(f).st_mode
    55     def makelock(info, pathname):
    60     def makelock(info, pathname):
    56         os.symlink(info, pathname)
    61         os.symlink(info, pathname)
    57 
    62 
    58     def readlock(pathname):
    63     def readlock(pathname):
    59         return os.readlink(pathname)
    64         return os.readlink(pathname)
    60 
       
    61