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