hgkw/keyword.py
branch0.9.2compat
changeset 388 05fbd226cb5c
parent 387 ecb2935f9bb8
child 397 db7cc16560d4
equal deleted inserted replaced
387:ecb2935f9bb8 388:05fbd226cb5c
   143     _patchfile_init = patchfile.__init__
   143     _patchfile_init = patchfile.__init__
   144 
   144 
   145     def _kwpatchfile_init(self, ui, fname, missing=False):
   145     def _kwpatchfile_init(self, ui, fname, missing=False):
   146         '''Monkeypatch/wrap patch.patchfile.__init__ to avoid
   146         '''Monkeypatch/wrap patch.patchfile.__init__ to avoid
   147         rejects or conflicts due to expanded keywords in working dir.'''
   147         rejects or conflicts due to expanded keywords in working dir.'''
   148         _patchfile_init(self, ui, fname, missing=missing)
   148         try:
       
   149             _patchfile_init(self, ui, fname, missing=missing)
       
   150         except TypeError:
       
   151             # "missing" arg added in e90e72c6b4c7
       
   152             _patchfile_init(self, ui, fname)
   149         if _kwtemplater.matcher(self.fname):
   153         if _kwtemplater.matcher(self.fname):
   150             # shrink keywords read from working dir
   154             # shrink keywords read from working dir
   151             kwshrunk = _kwtemplater.shrink(''.join(self.lines))
   155             kwshrunk = _kwtemplater.shrink(''.join(self.lines))
   152             self.lines = kwshrunk.splitlines(True)
   156             self.lines = kwshrunk.splitlines(True)
   153 except ImportError:
   157 except ImportError: