Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 17671:fdd0fc046cf1
clfilter: introduce a `hassecret` function
We can only use copy clone if the cloned repo do not have any secret changeset.
The current method for that is to run the "secret()" revset on the remote repo.
But with proper filtering of hidden or unserved revision by the remote this
revset won't return any revision even if some exist remotely. This changeset
adds an explicit function to know if a repo have any secret revision or not.
The other option would be to disable filtering for the query but I prefer the
approach above, lighter both regarding code and performance.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Mon, 03 Sep 2012 14:05:19 +0200 |
parents | 471f30d360ea |
children | 3d1a781b23c0 |
comparison
equal
deleted
inserted
replaced
17670:9dbd5fa6d301 | 17671:fdd0fc046cf1 |
---|---|
8 | 8 |
9 from i18n import _ | 9 from i18n import _ |
10 from lock import release | 10 from lock import release |
11 from node import hex, nullid | 11 from node import hex, nullid |
12 import localrepo, bundlerepo, httppeer, sshpeer, statichttprepo, bookmarks | 12 import localrepo, bundlerepo, httppeer, sshpeer, statichttprepo, bookmarks |
13 import lock, util, extensions, error, node, scmutil | 13 import lock, util, extensions, error, node, scmutil, phases |
14 import cmdutil, discovery | 14 import cmdutil, discovery |
15 import merge as mergemod | 15 import merge as mergemod |
16 import verify as verifymod | 16 import verify as verifymod |
17 import errno, os, shutil | 17 import errno, os, shutil |
18 | 18 |
301 if islocal(dest): | 301 if islocal(dest): |
302 dircleanup = DirCleanup(dest) | 302 dircleanup = DirCleanup(dest) |
303 | 303 |
304 copy = False | 304 copy = False |
305 if (srcrepo and srcrepo.cancopy() and islocal(dest) | 305 if (srcrepo and srcrepo.cancopy() and islocal(dest) |
306 and not srcrepo.revs("secret()")): | 306 and not phases.hassecret(srcrepo)): |
307 copy = not pull and not rev | 307 copy = not pull and not rev |
308 | 308 |
309 if copy: | 309 if copy: |
310 try: | 310 try: |
311 # we use a lock here because if we race with commit, we | 311 # we use a lock here because if we race with commit, we |