Patchwork [1,of,3] context: add a repo accessor

login
register
mail settings
Submitter Matt Harbison
Date March 13, 2015, 4:03 a.m.
Message ID <217a5fae7fbda2549569.1426219388@Envy>
Download mbox | patch
Permalink /patch/8042/
State Accepted
Commit a07314472a80da4bed99cf5a755c453c8917e37c
Headers show

Comments

Matt Harbison - March 13, 2015, 4:03 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1426215293 14400
#      Thu Mar 12 22:54:53 2015 -0400
# Node ID 217a5fae7fbda2549569c27639420c5266677725
# Parent  b7add2ebef9e41b91a1cd16a0cf149f517527cf0
context: add a repo accessor

There are 29 instances of 'ctx._repo' in the code, so make the ability to access
more official.

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -152,6 +152,8 @@ 
         return hex(self.node())
     def manifest(self):
         return self._manifest
+    def repo(self):
+        return self._repo
     def phasestr(self):
         return phases.phasenames[self.phase()]
     def mutable(self):