hgkw/keyword.py
changeset 237 0a0049700af5
parent 236 e52075167842
child 240 fb234089cc4c
equal deleted inserted replaced
236:e52075167842 237:0a0049700af5
   179             templater.common_filters['utcdate'] = utcdate
   179             templater.common_filters['utcdate'] = utcdate
   180             self.t = self._changeset_templater()
   180             self.t = self._changeset_templater()
   181 
   181 
   182     def _changeset_templater(self):
   182     def _changeset_templater(self):
   183         '''Backwards compatible cmdutil.changeset_templater.'''
   183         '''Backwards compatible cmdutil.changeset_templater.'''
       
   184         # before 1e0b94cfba0e there was an extra "brinfo" argument
   184         try:
   185         try:
   185             return cmdutil.changeset_templater(self.ui, self.repo,
   186             return cmdutil.changeset_templater(self.ui, self.repo,
   186                                                False, '', False)
   187                                                False, '', False)
   187         except TypeError:
   188         except TypeError:
   188             # depending on hg rev changeset_templater has extra "brinfo" arg
       
   189             return cmdutil.changeset_templater(self.ui, self.repo,
   189             return cmdutil.changeset_templater(self.ui, self.repo,
   190                                                False, None, '', False)
   190                                                False, None, '', False)
   191 
   191 
   192     def _wwrite(self, f, data, man):
   192     def _wwrite(self, f, data, man):
   193         '''Makes repo.wwrite backwards compatible.'''
   193         '''Makes repo.wwrite backwards compatible.'''
   198         except (AttributeError, TypeError):
   198         except (AttributeError, TypeError):
   199             self.repo.wwrite(f, data)
   199             self.repo.wwrite(f, data)
   200 
   200 
   201     def _normal(self, files):
   201     def _normal(self, files):
   202         '''Backwards compatible repo.dirstate.normal/update.'''
   202         '''Backwards compatible repo.dirstate.normal/update.'''
       
   203         # 6fd953d5faea introduced dirstate.normal()
   203         try:
   204         try:
   204             for f in files:
   205             for f in files:
   205                 self.repo.dirstate.normal(f)
   206                 self.repo.dirstate.normal(f)
   206         except AttributeError:
   207         except AttributeError:
   207             # older versions don't know about dirstate.normal
       
   208             self.repo.dirstate.update(files, 'n')
   208             self.repo.dirstate.update(files, 'n')
   209 
   209 
   210     def _ctxnode(self, node):
   210     def _ctxnode(self, node):
   211         '''Obtains missing node from file context.'''
   211         '''Obtains missing node from file context.'''
   212         if not self.node:
   212         if not self.node: