obsutil: clarify the access to "repo"
We use the variable multiple times and we might use it even more in the
future. We use a temporary variable instead.
--- a/mercurial/obsutil.py Mon Nov 05 19:52:42 2018 -0800
+++ b/mercurial/obsutil.py Tue May 22 15:26:17 2018 +0200
@@ -397,12 +397,14 @@
This is a first and basic implementation, with many shortcoming.
"""
- diffopts = diffutil.diffallopts(leftctx.repo().ui, {'git': True})
+ # lefctx.repo() and rightctx.repo() are the same here
+ repo = leftctx.repo()
+ diffopts = diffutil.diffallopts(repo.ui, {'git': True})
# Leftctx or right ctx might be filtered, so we need to use the contexts
# with an unfiltered repository to safely compute the diff
- leftunfi = leftctx._repo.unfiltered()[leftctx.rev()]
+ leftunfi = repo.unfiltered()[leftctx.rev()]
leftdiff = leftunfi.diff(opts=diffopts)
- rightunfi = rightctx._repo.unfiltered()[rightctx.rev()]
+ rightunfi = repo.unfiltered()[rightctx.rev()]
rightdiff = rightunfi.diff(opts=diffopts)
left, right = (0, 0)