mercurial/patch.py
changeset 5653 1b35bc1c1968
parent 5652 e90e72c6b4c7
child 5692 1127fe12202a
equal deleted inserted replaced
5652:e90e72c6b4c7 5653:1b35bc1c1968
   319             self.ui.warn(_("unable to find '%s' for patching\n") % self.fname)
   319             self.ui.warn(_("unable to find '%s' for patching\n") % self.fname)
   320 
   320 
   321         if not self.exists:
   321         if not self.exists:
   322             dirname = os.path.dirname(fname)
   322             dirname = os.path.dirname(fname)
   323             if dirname and not os.path.isdir(dirname):
   323             if dirname and not os.path.isdir(dirname):
   324                 dirs = dirname.split(os.path.sep)
   324                 os.makedirs(dirname)
   325                 d = ""
       
   326                 for x in dirs:
       
   327                     d = os.path.join(d, x)
       
   328                     if not os.path.isdir(d):
       
   329                         os.mkdir(d)
       
   330 
   325 
   331         self.hash = {}
   326         self.hash = {}
   332         self.dirty = 0
   327         self.dirty = 0
   333         self.offset = 0
   328         self.offset = 0
   334         self.rej = []
   329         self.rej = []