##// END OF EJS Templates
subrepo: use 'self.ui' instead of 'self._repo.ui'...
Matt Harbison -
r23574:faa3d6af default
parent child Browse files
Show More
@@ -527,8 +527,8 b' class hgsubrepo(abstractsubrepo):'
527 527 for s, k in [('ui', 'commitsubrepos')]:
528 528 v = r.ui.config(s, k)
529 529 if v:
530 self._repo.ui.setconfig(s, k, v, 'subrepo')
531 self._repo.ui.setconfig('ui', '_usedassubrepo', 'True', 'subrepo')
530 self.ui.setconfig(s, k, v, 'subrepo')
531 self.ui.setconfig('ui', '_usedassubrepo', 'True', 'subrepo')
532 532 self._initrepo(r, state[0], create)
533 533
534 534 def storeclean(self, path):
@@ -606,7 +606,7 b' class hgsubrepo(abstractsubrepo):'
606 606 def addpathconfig(key, value):
607 607 if value:
608 608 lines.append('%s = %s\n' % (key, value))
609 self._repo.ui.setconfig('paths', key, value, 'subrepo')
609 self.ui.setconfig('paths', key, value, 'subrepo')
610 610
611 611 defpath = _abssource(self._repo, abort=False)
612 612 defpushpath = _abssource(self._repo, True, abort=False)
@@ -649,7 +649,7 b' class hgsubrepo(abstractsubrepo):'
649 649 ctx2 = self._repo[rev2]
650 650 return self._repo.status(ctx1, ctx2, **opts)
651 651 except error.RepoLookupError, inst:
652 self._repo.ui.warn(_('warning: error "%s" in subrepository "%s"\n')
652 self.ui.warn(_('warning: error "%s" in subrepository "%s"\n')
653 653 % (inst, subrelpath(self)))
654 654 return scmutil.status([], [], [], [], [], [], [])
655 655
@@ -666,7 +666,7 b' class hgsubrepo(abstractsubrepo):'
666 666 prefix=posixpath.join(prefix, self._path),
667 667 listsubrepos=True, **opts)
668 668 except error.RepoLookupError, inst:
669 self._repo.ui.warn(_('warning: error "%s" in subrepository "%s"\n')
669 self.ui.warn(_('warning: error "%s" in subrepository "%s"\n')
670 670 % (inst, subrelpath(self)))
671 671
672 672 @annotatesubrepoerror
@@ -705,7 +705,7 b' class hgsubrepo(abstractsubrepo):'
705 705 # updated
706 706 if not self.dirty(True):
707 707 return self._repo['.'].hex()
708 self._repo.ui.debug("committing subrepo %s\n" % subrelpath(self))
708 self.ui.debug("committing subrepo %s\n" % subrelpath(self))
709 709 n = self._repo.commit(text, user, date)
710 710 if not n:
711 711 return self._repo['.'].hex() # different version checked out
@@ -719,7 +719,7 b' class hgsubrepo(abstractsubrepo):'
719 719 def remove(self):
720 720 # we can't fully delete the repository as it may contain
721 721 # local-only history
722 self._repo.ui.note(_('removing subrepo %s\n') % subrelpath(self))
722 self.ui.note(_('removing subrepo %s\n') % subrelpath(self))
723 723 hg.clean(self._repo, node.nullid, False)
724 724
725 725 def _get(self, state):
@@ -730,7 +730,7 b' class hgsubrepo(abstractsubrepo):'
730 730 srcurl = _abssource(self._repo)
731 731 other = hg.peer(self._repo, {}, srcurl)
732 732 if len(self._repo) == 0:
733 self._repo.ui.status(_('cloning subrepo %s from %s\n')
733 self.ui.status(_('cloning subrepo %s from %s\n')
734 734 % (subrelpath(self), srcurl))
735 735 parentrepo = self._repo._subparent
736 736 shutil.rmtree(self._repo.path)
@@ -741,7 +741,7 b' class hgsubrepo(abstractsubrepo):'
741 741 self._initrepo(parentrepo, source, create=True)
742 742 self._cachestorehash(srcurl)
743 743 else:
744 self._repo.ui.status(_('pulling subrepo %s from %s\n')
744 self.ui.status(_('pulling subrepo %s from %s\n')
745 745 % (subrelpath(self), srcurl))
746 746 cleansub = self.storeclean(srcurl)
747 747 exchange.pull(self._repo, other)
@@ -775,18 +775,18 b' class hgsubrepo(abstractsubrepo):'
775 775
776 776 def mergefunc():
777 777 if anc == cur and dst.branch() == cur.branch():
778 self._repo.ui.debug("updating subrepo %s\n" % subrelpath(self))
778 self.ui.debug("updating subrepo %s\n" % subrelpath(self))
779 779 hg.update(self._repo, state[1])
780 780 elif anc == dst:
781 self._repo.ui.debug("skipping subrepo %s\n" % subrelpath(self))
781 self.ui.debug("skipping subrepo %s\n" % subrelpath(self))
782 782 else:
783 self._repo.ui.debug("merging subrepo %s\n" % subrelpath(self))
783 self.ui.debug("merging subrepo %s\n" % subrelpath(self))
784 784 hg.merge(self._repo, state[1], remind=False)
785 785
786 786 wctx = self._repo[None]
787 787 if self.dirty():
788 788 if anc != dst:
789 if _updateprompt(self._repo.ui, self, wctx.dirty(), cur, dst):
789 if _updateprompt(self.ui, self, wctx.dirty(), cur, dst):
790 790 mergefunc()
791 791 else:
792 792 mergefunc()
@@ -809,11 +809,11 b' class hgsubrepo(abstractsubrepo):'
809 809 dsturl = _abssource(self._repo, True)
810 810 if not force:
811 811 if self.storeclean(dsturl):
812 self._repo.ui.status(
812 self.ui.status(
813 813 _('no changes made to subrepo %s since last push to %s\n')
814 814 % (subrelpath(self), dsturl))
815 815 return None
816 self._repo.ui.status(_('pushing subrepo %s to %s\n') %
816 self.ui.status(_('pushing subrepo %s to %s\n') %
817 817 (subrelpath(self), dsturl))
818 818 other = hg.peer(self._repo, {'ssh': ssh}, dsturl)
819 819 res = exchange.push(self._repo, other, force, newbranch=newbranch)
General Comments 0
You need to be logged in to leave comments. Login now