mercurial/patch.py
changeset 7244 127a624406b4
parent 7200 ca5ac40949dc
child 7247 c4461ea8b4c8
equal deleted inserted replaced
7237:b9bf36905b55 7244:127a624406b4
    29     abssrc, absdst = [os.path.join(basedir, n) for n in (src, dst)]
    29     abssrc, absdst = [os.path.join(basedir, n) for n in (src, dst)]
    30     if os.path.exists(absdst):
    30     if os.path.exists(absdst):
    31         raise util.Abort(_("cannot create %s: destination already exists") %
    31         raise util.Abort(_("cannot create %s: destination already exists") %
    32                          dst)
    32                          dst)
    33 
    33 
    34     targetdir = os.path.dirname(absdst)
    34     if not os.path.isdir(basedir):
    35     if not os.path.isdir(targetdir):
    35         os.makedirs(basedir)
    36         os.makedirs(targetdir)
       
    37 
    36 
    38     util.copyfile(abssrc, absdst)
    37     util.copyfile(abssrc, absdst)
    39 
    38 
    40 # public functions
    39 # public functions
    41 
    40