(0.9.2compat) prefer self.func over repo.func in kwrepo 0.9.2compat
authorChristian Ebert <blacktrash@gmx.net>
Fri, 10 Jul 2009 01:52:11 +0200
branch0.9.2compat
changeset 613 cae62580bea3
parent 610 5b87f3ea105a
child 615 36de1c074e13
(0.9.2compat) prefer self.func over repo.func in kwrepo Avoid nesting by falling back on parent class member function.
hgkw/keyword.py
--- a/hgkw/keyword.py	Wed Jul 08 03:25:07 2009 +0200
+++ b/hgkw/keyword.py	Fri Jul 10 01:52:11 2009 +0200
@@ -688,7 +688,7 @@
                 if commithooks:
                     # store parents for commit hook environment
                     if p1 is None:
-                        _p1, _p2 = repo.dirstate.parents()
+                        _p1, _p2 = self.dirstate.parents()
                     else:
                         _p1, _p2 = p1, p2 or nullid
                     _p1 = hex(_p1)
@@ -705,7 +705,7 @@
                     ui.setconfig('hooks', name, cmd)
                 if n is not None:
                     kwt.overwrite(n, True, None)
-                    repo.hook('commit', node=n, parent1=_p1, parent2=_p2)
+                    self.hook('commit', node=n, parent1=_p1, parent2=_p2)
                 return n
             finally:
                 del _wlock, _lock