comparison mercurial/bundlerepo.py @ 28714:dac81729fea4

bundle: warn when update to revision existing only in a bundle (issue5004) Now its done silently, so unless user really knows what he is doing will be suprised to find that after update 'hg status' doesn't work. This commit makes also merge operation warns about missing parent when revision to merge exists only in the bundle.
author liscju <piotr.listkiewicz@gmail.com>
date Wed, 23 Mar 2016 08:55:22 +0100
parents ae53ecc47414
children 98e8313dcd9e
comparison
equal deleted inserted replaced
28713:806d260c6f3b 28714:dac81729fea4
30 exchange, 30 exchange,
31 filelog, 31 filelog,
32 localrepo, 32 localrepo,
33 manifest, 33 manifest,
34 mdiff, 34 mdiff,
35 node as nodemod,
35 pathutil, 36 pathutil,
36 phases, 37 phases,
37 revlog, 38 revlog,
38 scmutil, 39 scmutil,
39 util, 40 util,
383 return bundlepeer(self) 384 return bundlepeer(self)
384 385
385 def getcwd(self): 386 def getcwd(self):
386 return os.getcwd() # always outside the repo 387 return os.getcwd() # always outside the repo
387 388
389 # Check if parents exist in localrepo before setting
390 def setparents(self, p1, p2=nullid):
391 p1rev = self.changelog.rev(p1)
392 p2rev = self.changelog.rev(p2)
393 msg = _("setting parent to node %s that only exists in the bundle\n")
394 if self.changelog.repotiprev < p1rev:
395 self.ui.warn(msg % nodemod.hex(p1))
396 if self.changelog.repotiprev < p2rev:
397 self.ui.warn(msg % nodemod.hex(p2))
398 return super(bundlerepository, self).setparents(p1, p2)
388 399
389 def instance(ui, path, create): 400 def instance(ui, path, create):
390 if create: 401 if create:
391 raise error.Abort(_('cannot create new bundle repository')) 402 raise error.Abort(_('cannot create new bundle repository'))
392 # internal config: bundle.mainreporoot 403 # internal config: bundle.mainreporoot