##// END OF EJS Templates
subrepo: show the source that git pulls
Eric Eisner -
r13569:3ab3b892 default
parent child Browse files
Show More
@@ -714,6 +714,12 class gitsubrepo(abstractsubrepo):
714 714 current = None
715 715 return current
716 716
717 def _gitremote(self, remote):
718 out = self._gitcommand(['remote', 'show', '-n', remote])
719 line = out.split('\n')[1]
720 i = line.index('URL: ') + len('URL: ')
721 return line[i:]
722
717 723 def _githavelocally(self, revision):
718 724 out, code = self._gitdir(['cat-file', '-e', revision])
719 725 return code == 0
@@ -768,7 +774,8 class gitsubrepo(abstractsubrepo):
768 774 self._gitnodir(['clone', source, self._abspath])
769 775 if self._githavelocally(revision):
770 776 return
771 self._ui.status(_('pulling subrepo %s\n') % self._relpath)
777 self._ui.status(_('pulling subrepo %s from %s\n') %
778 (self._relpath, self._gitremote('origin')))
772 779 # try only origin: the originally cloned repo
773 780 self._gitcommand(['fetch'])
774 781 if not self._githavelocally(revision):
@@ -155,7 +155,7 user a pulls, merges, commits
155 155 added 1 changesets with 1 changes to 1 files (+1 heads)
156 156 (run 'hg heads' to see heads, 'hg merge' to merge)
157 157 $ hg merge 2>/dev/null
158 pulling subrepo s
158 pulling subrepo s from $TESTTMP/gitroot
159 159 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
160 160 (branch merge, don't forget to commit)
161 161 $ cat s/f
@@ -232,7 +232,7 sync to upstream git, distribute changes
232 232 $ cd ../tb
233 233 $ hg pull -q
234 234 $ hg update 2>/dev/null
235 pulling subrepo s
235 pulling subrepo s from $TESTTMP/gitroot
236 236 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
237 237 $ hg debugsub
238 238 path s
@@ -262,7 +262,7 archive subrepos
262 262 $ cd ../tc
263 263 $ hg pull -q
264 264 $ hg archive --subrepos -r 5 ../archive 2>/dev/null
265 pulling subrepo s
265 pulling subrepo s from $TESTTMP/gitroot
266 266 $ cd ../archive
267 267 $ cat s/f
268 268 f
General Comments 0
You need to be logged in to leave comments. Login now