[PATCH 4 of 5] hg: add shallowroot parameters
Vishakh H
vsh426 at gmail.com
Tue Jun 29 11:15:05 CDT 2010
# HG changeset patch
# User Vishakh H <vsh426 at gmail.com>
# Date 1277827642 -19800
# Branch stable
# Node ID f4562f4182b0050fab130e5c9a77af616c792e8a
# Parent db222d2932d63634a5406708ceb94396408c0a05
hg: add shallowroot parameters
diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -179,7 +179,7 @@
_update(r, uprev)
def clone(ui, source, dest=None, pull=False, rev=None, update=True,
- stream=False, branch=None):
+ stream=False, branch=None, shallowroot=None):
"""Make a copy of an existing repository.
Create a copy of an existing repository in a new directory. The
@@ -259,7 +259,7 @@
copy = False
if src_repo.cancopy() and islocal(dest):
abspath = os.path.abspath(util.drop_scheme('file', origsource))
- copy = not pull and not rev
+ copy = not pull and not rev and not shallowroot
if copy:
try:
@@ -330,8 +330,10 @@
"support clone by revision"))
revs = [src_repo.lookup(r) for r in rev]
checkout = revs[0]
+ if shallowroot:
+ shallowroot = src_repo.lookup(shallowroot)
if dest_repo.local():
- dest_repo.clone(src_repo, heads=revs, stream=stream)
+ dest_repo.clone(src_repo, heads=revs, shallowroot=shallowroot, stream=stream)
elif src_repo.local():
src_repo.push(dest_repo, revs=revs)
else:
More information about the Mercurial-devel
mailing list