[PATCH 3 of 3] subrepo: update and merge works with any git branch
Martin Geisler
mg at lazybytes.net
Sat Nov 13 15:32:54 UTC 2010
Eric Eisner <ede at MIT.EDU> writes:
> # HG changeset patch
> # User Eric Eisner <ede at mit.edu>
> # Date 1289503448 18000
> # Node ID 120a0e44565a1a6597a781f72e3beddaf470a149
> # Parent 6485c19a9601d37ff5a55385e0769ab93cf471cf
> subrepo: update and merge works with any git branch
>
> diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
> --- a/mercurial/subrepo.py
> +++ b/mercurial/subrepo.py
> @@ -688,10 +726,15 @@ class gitsubrepo(object):
> cmd = ['push']
> if force:
> cmd.append('--force')
> - # as subrepos have no notion of "where to push to" we
> - # assume origin master. This is git's default
> - self._gitcommand(cmd + ['origin', 'master', '-q'])
> - return True
> + # push the currently checked out branch
> + current, bm = self._gitbranchmap()
> + if current:
> + self._gitcommand(cmd + ['origin', current, '-q'])
> + return True
> + else:
> + self._ui.warn(_('no branch checked out in subrepo %s\n'
> + 'nothing to push' % self._path))
The self._path variable must be outside of _(...) so that the
translation is done on a fixed (constant) string.
--
Martin Geisler
Mercurial links: http://mercurial.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20101113/4e282721/attachment.asc>
More information about the Mercurial-devel
mailing list