hgkw/keyword.py
changeset 230 9fe9a9839387
parent 229 8e5ba738e36d
child 231 95fa2165e4eb
equal deleted inserted replaced
229:8e5ba738e36d 230:9fe9a9839387
   456             if kwfmatcher(f):
   456             if kwfmatcher(f):
   457                 kwt = kwtemplater(ui, self, kwexp, path=f)
   457                 kwt = kwtemplater(ui, self, kwexp, path=f)
   458                 return kwfilelog(self.sopener, f, kwt, kwcnt)
   458                 return kwfilelog(self.sopener, f, kwt, kwcnt)
   459             return filelog.filelog(self.sopener, f)
   459             return filelog.filelog(self.sopener, f)
   460 
   460 
       
   461         def _commit(self, files, text, user, date, match, force, lock, wlock,
       
   462                     force_editor, p1, p2, extra):
       
   463             '''Private commit wrapper for backwards compatibility.'''
       
   464             try:
       
   465                 return super(kwrepo, self).commit(files=files, text=text,
       
   466                                                   user=user, date=date,
       
   467                                                   match=match, force=force,
       
   468                                                   lock=lock, wlock=wlock,
       
   469                                                   force_editor=force_editor,
       
   470                                                   p1=p1, p2=p2, extra=extra)
       
   471             except TypeError:
       
   472                 return super(kwrepo, self).commit(files=files, text=text,
       
   473                                                   user=user, date=date,
       
   474                                                   match=match, force=force,
       
   475                                                   force_editor=force_editor,
       
   476                                                   p1=p1, p2=p2, extra=extra)
       
   477 
   461         def commit(self, files=None, text='', user=None, date=None,
   478         def commit(self, files=None, text='', user=None, date=None,
   462                    match=util.always, force=False, lock=None, wlock=None,
   479                    match=util.always, force=False, lock=None, wlock=None,
   463                    force_editor=False, p1=None, p2=None, extra={}):
   480                    force_editor=False, p1=None, p2=None, extra={}):
   464             # (w)lock arguments removed in 126f527b3ba3
   481             # (w)lock arguments removed in 126f527b3ba3
   465             # so they are None or what was passed to commit
   482             # so they are None or what was passed to commit
   470             try:
   487             try:
   471                 if not _wlock:
   488                 if not _wlock:
   472                     _wlock = self.wlock()
   489                     _wlock = self.wlock()
   473                 if not _lock:
   490                 if not _lock:
   474                     _lock = self.lock()
   491                     _lock = self.lock()
   475                 try:
   492                 node = self._commit(files, text, user, date, match, force,
   476                     node = super(kwrepo,
   493                                     _lock, _wlock, force_editor, p1, p2, extra)
   477                                  self).commit(files=files, text=text,
       
   478                                               user=user, date=date,
       
   479                                               match=match, force=force,
       
   480                                               lock=_lock, wlock=_wlock,
       
   481                                               force_editor=force_editor,
       
   482                                               p1=p1, p2=p2, extra=extra)
       
   483                 except TypeError:
       
   484                     node = super(kwrepo,
       
   485                                  self).commit(files=files, text=text,
       
   486                                               user=user, date=date,
       
   487                                               match=match, force=force,
       
   488                                               force_editor=force_editor,
       
   489                                               p1=p1, p2=p2, extra=extra)
       
   490                 if node is not None:
   494                 if node is not None:
   491                     cl = self.changelog.read(node)
   495                     cl = self.changelog.read(node)
   492                     mn = self.manifest.read(cl[0])
   496                     mn = self.manifest.read(cl[0])
   493                     candidates = _weedcandidates(mn, kwfmatcher, cl[3])
   497                     candidates = _weedcandidates(mn, kwfmatcher, cl[3])
   494                     if candidates:
   498                     if candidates: