comparison hggit/overlay.py @ 1116:bd1a01f98154

cleanup: wrap to 80 chars
author Sean Farley <sean@farley.io>
date Mon, 27 Nov 2017 19:05:08 -0500
parents 8ed6c0cae9b8
children 80664524802b
comparison
equal deleted inserted replaced
1115:8ed6c0cae9b8 1116:bd1a01f98154
101 def get(self, path, default=None): 101 def get(self, path, default=None):
102 self.load() 102 self.load()
103 return self._map.get(path, default) 103 return self._map.get(path, default)
104 104
105 def diff(self, m2, match=None, clean=False): 105 def diff(self, m2, match=None, clean=False):
106 # Older mercurial clients used diff(m2, clean=False). If a caller failed 106 # Older mercurial clients used diff(m2, clean=False). If a caller
107 # to specify clean as a keyword arg, it might get passed as match here. 107 # failed to specify clean as a keyword arg, it might get passed as
108 # match here.
108 if isinstance(match, bool): 109 if isinstance(match, bool):
109 clean = match 110 clean = match
110 match = None 111 match = None
111 112
112 self.load() 113 self.load()
159 match = None 160 match = None
160 161
161 kwargs = { 162 kwargs = {
162 'clean': clean 163 'clean': clean
163 } 164 }
164 # Older versions of mercurial don't support the match arg, so only add it if 165 # Older versions of mercurial don't support the match arg, so only add it
165 # it exists. 166 # if it exists.
166 if match is not None: 167 if match is not None:
167 kwargs['match'] = match 168 kwargs['match'] = match
168 if isinstance(m2, overlaymanifest): 169 if isinstance(m2, overlaymanifest):
169 diff = m2.diff(self, **kwargs) 170 diff = m2.diff(self, **kwargs)
170 # since we calculated the diff with m2 vs m1, flip it around 171 # since we calculated the diff with m2 vs m1, flip it around