mercurial/patch.py
changeset 3629 4cfb72bcb978
parent 3588 45574a225632
child 3673 eb0b4a2d70a9
equal deleted inserted replaced
3628:dc3504af7722 3629:4cfb72bcb978
    24                          dst)
    24                          dst)
    25 
    25 
    26     targetdir = os.path.dirname(absdst)
    26     targetdir = os.path.dirname(absdst)
    27     if not os.path.isdir(targetdir):
    27     if not os.path.isdir(targetdir):
    28         os.makedirs(targetdir)
    28         os.makedirs(targetdir)
    29     try:
    29 
    30         shutil.copyfile(abssrc, absdst)
    30     util.copyfile(abssrc, absdst)
    31         shutil.copymode(abssrc, absdst)
       
    32     except shutil.Error, inst:
       
    33         raise util.Abort(str(inst))
       
    34 
    31 
    35 # public functions
    32 # public functions
    36 
    33 
    37 def extract(ui, fileobj):
    34 def extract(ui, fileobj):
    38     '''extract patch from data read from fileobj.
    35     '''extract patch from data read from fileobj.