[PATCH 5 of 8 phases] mq qclone: add a few comment and blank line

pierre-yves.david at logilab.fr pierre-yves.david at logilab.fr
Tue Jan 17 11:35:38 CST 2012


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1326770765 -3600
# Node ID f94ce6d6181b16c432def3d5a7eba1c604eda9ec
# Parent  e875ff85ee5a816f0a3f168be08760d5efbbeddc
mq 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
@@ -2100,17 +2100,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:
@@ -2129,20 +2134,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