##// END OF EJS Templates
exchange: support declaring pull depth...
Gregory Szorc -
r40367:ac59de55 default
parent child Browse files
Show More
@@ -1316,7 +1316,7 b' class pulloperation(object):'
1316
1316
1317 def __init__(self, repo, remote, heads=None, force=False, bookmarks=(),
1317 def __init__(self, repo, remote, heads=None, force=False, bookmarks=(),
1318 remotebookmarks=None, streamclonerequested=None,
1318 remotebookmarks=None, streamclonerequested=None,
1319 includepats=None, excludepats=None):
1319 includepats=None, excludepats=None, depth=None):
1320 # repo we pull into
1320 # repo we pull into
1321 self.repo = repo
1321 self.repo = repo
1322 # repo we pull from
1322 # repo we pull from
@@ -1350,6 +1350,8 b' class pulloperation(object):'
1350 self.includepats = includepats
1350 self.includepats = includepats
1351 # Set of file patterns to exclude.
1351 # Set of file patterns to exclude.
1352 self.excludepats = excludepats
1352 self.excludepats = excludepats
1353 # Number of ancestor changesets to pull from each pulled head.
1354 self.depth = depth
1353
1355
1354 @util.propertycache
1356 @util.propertycache
1355 def pulledsubset(self):
1357 def pulledsubset(self):
@@ -1454,7 +1456,8 b' def _fullpullbundle2(repo, pullop):'
1454 pullop.rheads = set(pullop.rheads) - pullop.common
1456 pullop.rheads = set(pullop.rheads) - pullop.common
1455
1457
1456 def pull(repo, remote, heads=None, force=False, bookmarks=(), opargs=None,
1458 def pull(repo, remote, heads=None, force=False, bookmarks=(), opargs=None,
1457 streamclonerequested=None, includepats=None, excludepats=None):
1459 streamclonerequested=None, includepats=None, excludepats=None,
1460 depth=None):
1458 """Fetch repository data from a remote.
1461 """Fetch repository data from a remote.
1459
1462
1460 This is the main function used to retrieve data from a remote repository.
1463 This is the main function used to retrieve data from a remote repository.
@@ -1475,6 +1478,9 b' def pull(repo, remote, heads=None, force'
1475 ``includepats`` and ``excludepats`` define explicit file patterns to
1478 ``includepats`` and ``excludepats`` define explicit file patterns to
1476 include and exclude in storage, respectively. If not defined, narrow
1479 include and exclude in storage, respectively. If not defined, narrow
1477 patterns from the repo instance are used, if available.
1480 patterns from the repo instance are used, if available.
1481 ``depth`` is an integer indicating the DAG depth of history we're
1482 interested in. If defined, for each revision specified in ``heads``, we
1483 will fetch up to this many of its ancestors and data associated with them.
1478
1484
1479 Returns the ``pulloperation`` created for this pull.
1485 Returns the ``pulloperation`` created for this pull.
1480 """
1486 """
@@ -1495,6 +1501,7 b' def pull(repo, remote, heads=None, force'
1495 pullop = pulloperation(repo, remote, heads, force, bookmarks=bookmarks,
1501 pullop = pulloperation(repo, remote, heads, force, bookmarks=bookmarks,
1496 streamclonerequested=streamclonerequested,
1502 streamclonerequested=streamclonerequested,
1497 includepats=includepats, excludepats=excludepats,
1503 includepats=includepats, excludepats=excludepats,
1504 depth=depth,
1498 **pycompat.strkwargs(opargs))
1505 **pycompat.strkwargs(opargs))
1499
1506
1500 peerlocal = pullop.remote.local()
1507 peerlocal = pullop.remote.local()
@@ -479,7 +479,7 b' def _copycache(srcrepo, dstcachedir, fna'
479
479
480 def clone(ui, peeropts, source, dest=None, pull=False, revs=None,
480 def clone(ui, peeropts, source, dest=None, pull=False, revs=None,
481 update=True, stream=False, branch=None, shareopts=None,
481 update=True, stream=False, branch=None, shareopts=None,
482 storeincludepats=None, storeexcludepats=None):
482 storeincludepats=None, storeexcludepats=None, depth=None):
483 """Make a copy of an existing repository.
483 """Make a copy of an existing repository.
484
484
485 Create a copy of an existing repository in a new directory. The
485 Create a copy of an existing repository in a new directory. The
@@ -749,7 +749,8 b' def clone(ui, peeropts, source, dest=Non'
749 exchange.pull(local, srcpeer, revs,
749 exchange.pull(local, srcpeer, revs,
750 streamclonerequested=stream,
750 streamclonerequested=stream,
751 includepats=storeincludepats,
751 includepats=storeincludepats,
752 excludepats=storeexcludepats)
752 excludepats=storeexcludepats,
753 depth=depth)
753 elif srcrepo:
754 elif srcrepo:
754 # TODO lift restriction once exchange.push() accepts narrow
755 # TODO lift restriction once exchange.push() accepts narrow
755 # push.
756 # push.
General Comments 0
You need to be logged in to leave comments. Login now