Mercurial > hg > mercurial-source
comparison mercurial/subrepo.py @ 12210:21eb85e9ea94
subrepo: handle diff with working copy
We cannot unconditionally call bin(node2) since node2 is None when
comparing with the working copy.
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Fri, 10 Sep 2010 23:53:49 +0200 |
parents | affec9fb56ef |
children | 166b9866580a |
comparison
equal
deleted
inserted
replaced
12209:affec9fb56ef | 12210:21eb85e9ea94 |
---|---|
305 def diff(self, diffopts, node2, match, prefix, **opts): | 305 def diff(self, diffopts, node2, match, prefix, **opts): |
306 try: | 306 try: |
307 node1 = node.bin(self._state[1]) | 307 node1 = node.bin(self._state[1]) |
308 # We currently expect node2 to come from substate and be | 308 # We currently expect node2 to come from substate and be |
309 # in hex format | 309 # in hex format |
310 node2 = node.bin(node2) | 310 if node2 is not None: |
311 node2 = node.bin(node2) | |
311 cmdutil.diffordiffstat(self._repo.ui, self._repo, diffopts, | 312 cmdutil.diffordiffstat(self._repo.ui, self._repo, diffopts, |
312 node1, node2, match, | 313 node1, node2, match, |
313 prefix=os.path.join(prefix, self._path), | 314 prefix=os.path.join(prefix, self._path), |
314 listsubrepos=True, **opts) | 315 listsubrepos=True, **opts) |
315 except error.RepoLookupError, inst: | 316 except error.RepoLookupError, inst: |