Mercurial > public > mercurial-scm > hg-stable
diff mercurial/subrepo.py @ 13569:3ab3b892d223
subrepo: show the source that git pulls
author | Eric Eisner <ede@mit.edu> |
---|---|
date | Tue, 08 Mar 2011 15:36:56 -0500 |
parents | a2734c8322ac |
children | 31eac42d9123 |
line wrap: on
line diff
--- a/mercurial/subrepo.py Tue Mar 08 08:41:39 2011 -0500 +++ b/mercurial/subrepo.py Tue Mar 08 15:36:56 2011 -0500 @@ -714,6 +714,12 @@ current = None return current + def _gitremote(self, remote): + out = self._gitcommand(['remote', 'show', '-n', remote]) + line = out.split('\n')[1] + i = line.index('URL: ') + len('URL: ') + return line[i:] + def _githavelocally(self, revision): out, code = self._gitdir(['cat-file', '-e', revision]) return code == 0 @@ -768,7 +774,8 @@ self._gitnodir(['clone', source, self._abspath]) if self._githavelocally(revision): return - self._ui.status(_('pulling subrepo %s\n') % self._relpath) + self._ui.status(_('pulling subrepo %s from %s\n') % + (self._relpath, self._gitremote('origin'))) # try only origin: the originally cloned repo self._gitcommand(['fetch']) if not self._githavelocally(revision):