comparison mercurial/subrepo.py @ 17895:17c030014ddf stable

subrepo: only do clean update when overwrite is set (issue3276) Files in a subrepo were overwritten on update. But this should only happen on a clean update (example: -C is specified). Use the overwrite parameter introduced for svn subrepos in c19b9282d3a7 to decide whether to merge changes (as update) or remove them (as clean). The new function hg.updaterepo is intruduced to keep all update calls in hg. test-subrepo.t is extended to test if an untracked file is overwritten (issue3276). (Update -C is already tested in many places.) The first two chunks are debugging output which has changed. (Because overwrite is not always true anymore for subrepos) All other tests still pass without any change.
author Simon Heimberg <simohe@besonet.ch>
date Wed, 24 Oct 2012 18:45:22 +0200
parents f4ee2e959696
children a9f4a6076740 0c10cf819146
comparison
equal deleted inserted replaced
17894:afa7e6fa820b 17895:17c030014ddf
521 521
522 def get(self, state, overwrite=False): 522 def get(self, state, overwrite=False):
523 self._get(state) 523 self._get(state)
524 source, revision, kind = state 524 source, revision, kind = state
525 self._repo.ui.debug("getting subrepo %s\n" % self._path) 525 self._repo.ui.debug("getting subrepo %s\n" % self._path)
526 hg.clean(self._repo, revision, False) 526 hg.updaterepo(self._repo, revision, overwrite)
527 527
528 def merge(self, state): 528 def merge(self, state):
529 self._get(state) 529 self._get(state)
530 cur = self._repo['.'] 530 cur = self._repo['.']
531 dst = self._repo[state[1]] 531 dst = self._repo[state[1]]