##// 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 current = None
714 current = None
715 return current
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 def _githavelocally(self, revision):
723 def _githavelocally(self, revision):
718 out, code = self._gitdir(['cat-file', '-e', revision])
724 out, code = self._gitdir(['cat-file', '-e', revision])
719 return code == 0
725 return code == 0
@@ -768,7 +774,8 class gitsubrepo(abstractsubrepo):
768 self._gitnodir(['clone', source, self._abspath])
774 self._gitnodir(['clone', source, self._abspath])
769 if self._githavelocally(revision):
775 if self._githavelocally(revision):
770 return
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 # try only origin: the originally cloned repo
779 # try only origin: the originally cloned repo
773 self._gitcommand(['fetch'])
780 self._gitcommand(['fetch'])
774 if not self._githavelocally(revision):
781 if not self._githavelocally(revision):
@@ -155,7 +155,7 user a pulls, merges, commits
155 added 1 changesets with 1 changes to 1 files (+1 heads)
155 added 1 changesets with 1 changes to 1 files (+1 heads)
156 (run 'hg heads' to see heads, 'hg merge' to merge)
156 (run 'hg heads' to see heads, 'hg merge' to merge)
157 $ hg merge 2>/dev/null
157 $ hg merge 2>/dev/null
158 pulling subrepo s
158 pulling subrepo s from $TESTTMP/gitroot
159 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
160 (branch merge, don't forget to commit)
160 (branch merge, don't forget to commit)
161 $ cat s/f
161 $ cat s/f
@@ -232,7 +232,7 sync to upstream git, distribute changes
232 $ cd ../tb
232 $ cd ../tb
233 $ hg pull -q
233 $ hg pull -q
234 $ hg update 2>/dev/null
234 $ hg update 2>/dev/null
235 pulling subrepo s
235 pulling subrepo s from $TESTTMP/gitroot
236 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
236 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
237 $ hg debugsub
237 $ hg debugsub
238 path s
238 path s
@@ -262,7 +262,7 archive subrepos
262 $ cd ../tc
262 $ cd ../tc
263 $ hg pull -q
263 $ hg pull -q
264 $ hg archive --subrepos -r 5 ../archive 2>/dev/null
264 $ hg archive --subrepos -r 5 ../archive 2>/dev/null
265 pulling subrepo s
265 pulling subrepo s from $TESTTMP/gitroot
266 $ cd ../archive
266 $ cd ../archive
267 $ cat s/f
267 $ cat s/f
268 f
268 f
General Comments 0
You need to be logged in to leave comments. Login now