Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/patch.py @ 3629:4cfb72bcb978
util: add copyfile function
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 13 Nov 2006 13:26:57 -0600 |
parents | 45574a225632 |
children | eb0b4a2d70a9 |
comparison
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. |