Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepo.py @ 13646:31eac42d9123
bookmarks: separate bookmarks update code from localrepo's pull.
We explicitly want to update bookmarks from a remote. This will avoid
duplicate calls to listkeys if we clone (which calls pull) and keep
bookmark related code together.
author | David Soria Parra <dsp@php.net> |
---|---|
date | Mon, 14 Mar 2011 00:10:43 +0100 |
parents | 3ab3b892d223 |
children | 4f5ed2bd1724 |
comparison
equal
deleted
inserted
replaced
13645:3786b810ea75 | 13646:31eac42d9123 |
---|---|
6 # GNU General Public License version 2 or any later version. | 6 # GNU General Public License version 2 or any later version. |
7 | 7 |
8 import errno, os, re, xml.dom.minidom, shutil, urlparse, posixpath | 8 import errno, os, re, xml.dom.minidom, shutil, urlparse, posixpath |
9 import stat, subprocess, tarfile | 9 import stat, subprocess, tarfile |
10 from i18n import _ | 10 from i18n import _ |
11 import config, util, node, error, cmdutil | 11 import config, util, node, error, cmdutil, bookmarks |
12 hg = None | 12 hg = None |
13 | 13 |
14 nullstate = ('', '', 'empty') | 14 nullstate = ('', '', 'empty') |
15 | 15 |
16 def state(ctx, ui): | 16 def state(ctx, ui): |
439 srcurl = _abssource(self._repo) | 439 srcurl = _abssource(self._repo) |
440 self._repo.ui.status(_('pulling subrepo %s from %s\n') | 440 self._repo.ui.status(_('pulling subrepo %s from %s\n') |
441 % (subrelpath(self), srcurl)) | 441 % (subrelpath(self), srcurl)) |
442 other = hg.repository(self._repo.ui, srcurl) | 442 other = hg.repository(self._repo.ui, srcurl) |
443 self._repo.pull(other) | 443 self._repo.pull(other) |
444 bookmarks.updatefromremote(self._repo.ui, self._repo, other) | |
444 | 445 |
445 def get(self, state, overwrite=False): | 446 def get(self, state, overwrite=False): |
446 self._get(state) | 447 self._get(state) |
447 source, revision, kind = state | 448 source, revision, kind = state |
448 self._repo.ui.debug("getting subrepo %s\n" % self._path) | 449 self._repo.ui.debug("getting subrepo %s\n" % self._path) |