Patchwork D3016: clone: rename "rev" to "revs" since there can be many

login
register
mail settings
Submitter phabricator
Date April 2, 2018, 6:49 p.m.
Message ID <cc66c4635e9a644e7315d36667f1eddd@localhost.localdomain>
Download mbox | patch
Permalink /patch/30142/
State Not Applicable
Headers show

Comments

phabricator - April 2, 2018, 6:49 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGfbb7523115e5: clone: rename &quot;rev&quot; to &quot;revs&quot; since there can be many (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3016?vs=7507&id=7514

REVISION DETAIL
  https://phab.mercurial-scm.org/D3016

AFFECTED FILES
  hgext/mq.py
  mercurial/commands.py
  mercurial/hg.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -448,7 +448,7 @@ 
             # well. Never update because working copies aren't necessary in
             # share mode.
             clone(ui, peeropts, source, dest=sharepath, pull=True,
-                  rev=rev, update=False, stream=stream)
+                  revs=rev, update=False, stream=stream)
 
     # Resolve the value to put in [paths] section for the source.
     if islocal(source):
@@ -483,7 +483,7 @@ 
             os.mkdir(dstcachedir)
         util.copyfile(srcbranchcache, dstbranchcache)
 
-def clone(ui, peeropts, source, dest=None, pull=False, rev=None,
+def clone(ui, peeropts, source, dest=None, pull=False, revs=None,
           update=True, stream=False, branch=None, shareopts=None):
     """Make a copy of an existing repository.
 
@@ -512,7 +512,7 @@ 
     stream: stream raw data uncompressed from repository (fast over
     LAN, slow over WAN)
 
-    rev: revision to clone up to (implies pull=True)
+    revs: revision to clone up to (implies pull=True)
 
     update: update working directory after clone completes, if
     destination is local repository (True means update to default rev,
@@ -536,7 +536,7 @@ 
         srcpeer = source.peer() # in case we were called with a localrepo
         branches = (None, branch or [])
         origsource = source = srcpeer.url()
-    rev, checkout = addbranchrevs(srcpeer, srcpeer, branches, rev)
+    revs, checkout = addbranchrevs(srcpeer, srcpeer, branches, revs)
 
     if dest is None:
         dest = defaultdest(source)
@@ -587,7 +587,7 @@ 
 
         if sharepath:
             return clonewithshare(ui, peeropts, sharepath, source, srcpeer,
-                                  dest, pull=pull, rev=rev, update=update,
+                                  dest, pull=pull, rev=revs, update=update,
                                   stream=stream)
 
     srclock = destlock = cleandir = None
@@ -603,7 +603,7 @@ 
         copy = False
         if (srcrepo and srcrepo.cancopy() and islocal(dest)
             and not phases.hassecret(srcrepo)):
-            copy = not pull and not rev
+            copy = not pull and not revs
 
         if copy:
             try:
@@ -660,14 +660,15 @@ 
                                      % dest)
                 raise
 
-            revs = None
-            if rev:
+            if revs:
                 if not srcpeer.capable('lookup'):
                     raise error.Abort(_("src repository does not support "
                                        "revision lookup and so doesn't "
                                        "support clone by revision"))
-                revs = [srcpeer.lookup(r) for r in rev]
+                revs = [srcpeer.lookup(r) for r in revs]
                 checkout = revs[0]
+            else:
+                revs = None
             local = destpeer.local()
             if local:
                 u = util.url(abspath)
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1460,7 +1460,7 @@ 
     r = hg.clone(ui, opts, source, dest,
                  pull=opts.get('pull'),
                  stream=opts.get('stream') or opts.get('uncompressed'),
-                 rev=opts.get('rev'),
+                 revs=opts.get('rev'),
                  update=opts.get('updaterev') or not opts.get('noupdate'),
                  branch=opts.get('branch'),
                  shareopts=opts.get('shareopts'))
diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -2505,7 +2505,7 @@ 
     ui.note(_('cloning main repository\n'))
     sr, dr = hg.clone(ui, opts, sr.url(), dest,
                       pull=opts.get('pull'),
-                      rev=destrev,
+                      revs=destrev,
                       update=False,
                       stream=opts.get('uncompressed'))