Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/subrepo.py @ 14898:95ced9f5bf29 stable
subrepo: don't commit in subrepo if it's clean
If a subrepo has changed relative to the outer repo's substate, but the
subrepo itself is clean, we don't need to commit in the subrepo.
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Tue, 19 Jul 2011 13:43:53 -0500 |
parents | 7ef125fa9b35 |
children | c035f1c53e39 a115b5ee9c63 |
comparison
equal
deleted
inserted
replaced
14897:b9daa5b7a3af | 14898:95ced9f5bf29 |
---|---|
418 | 418 |
419 def checknested(self, path): | 419 def checknested(self, path): |
420 return self._repo._checknested(self._repo.wjoin(path)) | 420 return self._repo._checknested(self._repo.wjoin(path)) |
421 | 421 |
422 def commit(self, text, user, date): | 422 def commit(self, text, user, date): |
423 # don't bother committing in the subrepo if it's only been | |
424 # updated | |
425 if not self.dirty(True): | |
426 return self._repo['.'].hex() | |
423 self._repo.ui.debug("committing subrepo %s\n" % subrelpath(self)) | 427 self._repo.ui.debug("committing subrepo %s\n" % subrelpath(self)) |
424 n = self._repo.commit(text, user, date) | 428 n = self._repo.commit(text, user, date) |
425 if not n: | 429 if not n: |
426 return self._repo['.'].hex() # different version checked out | 430 return self._repo['.'].hex() # different version checked out |
427 return node.hex(n) | 431 return node.hex(n) |