mercurial/util.py
changeset 515 03f27b1381f9
parent 508 42a660abaf75
child 521 0fb8ade0f756
equal deleted inserted replaced
514:874e577e332e 515:03f27b1381f9
    19         return "killed by signal %d" % val, val
    19         return "killed by signal %d" % val, val
    20     elif os.WIFSTOPPED(code):
    20     elif os.WIFSTOPPED(code):
    21         val = os.STOPSIG(code)
    21         val = os.STOPSIG(code)
    22         return "stopped by signal %d" % val, val
    22         return "stopped by signal %d" % val, val
    23     raise ValueError("invalid exit code")
    23     raise ValueError("invalid exit code")
    24     
    24 
    25 def system(cmd, errprefix = "abort"):
    25 def system(cmd, errprefix = "abort"):
    26     """execute a shell command that must succeed"""
    26     """execute a shell command that must succeed"""
    27     rc = os.system(cmd)
    27     rc = os.system(cmd)
    28     if rc:
    28     if rc:
    29         errmsg = "%s: %s %s" % (errprefix, os.path.basename(cmd.split(None, 1)[0]),
    29         errmsg = "%s: %s %s" % (errprefix, os.path.basename(cmd.split(None, 1)[0]),
    44     def is_exec(f, last):
    44     def is_exec(f, last):
    45         return last
    45         return last
    46 
    46 
    47     def set_exec(f, mode):
    47     def set_exec(f, mode):
    48         pass
    48         pass
    49     
    49 
    50     def pconvert(path):
    50     def pconvert(path):
    51         return path.replace("\\", "/")
    51         return path.replace("\\", "/")
    52 
    52 
    53     def makelock(info, pathname):
    53     def makelock(info, pathname):
    54         ld = os.open(pathname, os.O_CREAT | os.O_WRONLY | os.O_EXCL)
    54         ld = os.open(pathname, os.O_CREAT | os.O_WRONLY | os.O_EXCL)