Mercurial > hg-stable
changeset 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 | 0b79cf616e65 |
children | 617a87cb7eb2 |
files | mercurial/subrepo.py tests/test-subrepo-git.t |
diffstat | 2 files changed, 11 insertions(+), 4 deletions(-) [+] |
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):
--- a/tests/test-subrepo-git.t Tue Mar 08 08:41:39 2011 -0500 +++ b/tests/test-subrepo-git.t Tue Mar 08 15:36:56 2011 -0500 @@ -155,7 +155,7 @@ added 1 changesets with 1 changes to 1 files (+1 heads) (run 'hg heads' to see heads, 'hg merge' to merge) $ hg merge 2>/dev/null - pulling subrepo s + pulling subrepo s from $TESTTMP/gitroot 0 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) $ cat s/f @@ -232,7 +232,7 @@ $ cd ../tb $ hg pull -q $ hg update 2>/dev/null - pulling subrepo s + pulling subrepo s from $TESTTMP/gitroot 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg debugsub path s @@ -262,7 +262,7 @@ $ cd ../tc $ hg pull -q $ hg archive --subrepos -r 5 ../archive 2>/dev/null - pulling subrepo s + pulling subrepo s from $TESTTMP/gitroot $ cd ../archive $ cat s/f f