[PATCH 5 of 9 phases] qclone: add a few comment and blank line
pierre-yves.david at logilab.fr
pierre-yves.david at logilab.fr
Wed Jan 18 10:33:11 CST 2012
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1326903087 -3600
# Node ID 24aa39e56e3a87af22c3dc12ae87a916849d96d0
# Parent 80747eaf01ef03571ee8a385ea03b8586c493e92
qclone: add a few comment and blank line
This help readability.
diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -2075,17 +2075,22 @@ def clone(ui, source, dest=None, **opts)
would be created by :hg:`init --mq`.
Return 0 on success.
'''
def patchdir(repo):
+ """compute a patch repo url from a repo object"""
url = repo.url()
if url.endswith('/'):
url = url[:-1]
return url + '/.hg/patches'
+
+ # main repo (destination and sources)
if dest is None:
dest = hg.defaultdest(source)
sr = hg.repository(hg.remoteui(ui, opts), ui.expandpath(source))
+
+ # patches repo (source only)
if opts.get('patches'):
patchespath = ui.expandpath(opts.get('patches'))
else:
patchespath = patchdir(sr)
try:
@@ -2104,20 +2109,23 @@ def clone(ui, source, dest=None, **opts)
elif sr.capable('lookup'):
try:
qbase = sr.lookup('qbase')
except error.RepoError:
pass
+
ui.note(_('cloning main repository\n'))
sr, dr = hg.clone(ui, opts, sr.url(), dest,
pull=opts.get('pull'),
rev=destrev,
update=False,
stream=opts.get('uncompressed'))
+
ui.note(_('cloning patch repository\n'))
hg.clone(ui, opts, opts.get('patches') or patchdir(sr), patchdir(dr),
pull=opts.get('pull'), update=not opts.get('noupdate'),
stream=opts.get('uncompressed'))
+
if dr.local():
if qbase:
ui.note(_('stripping applied patches from destination '
'repository\n'))
dr.mq.strip(dr, [qbase], update=False, backup=None)
More information about the Mercurial-devel
mailing list