Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 50432:cc712ce3361f
bundle: abort if the user request bundling of internal changesets
See inline comments for details.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 10 Mar 2023 07:19:25 +0100 |
parents | d68462736492 |
children | c5e93c915ab6 |
comparison
equal
deleted
inserted
replaced
50431:f24c2e42e654 | 50432:cc712ce3361f |
---|---|
1663 | 1663 |
1664 if not missing: | 1664 if not missing: |
1665 scmutil.nochangesfound(ui, repo, not base and excluded) | 1665 scmutil.nochangesfound(ui, repo, not base and excluded) |
1666 return 1 | 1666 return 1 |
1667 | 1667 |
1668 # internal changeset are internal implementation details that should not | |
1669 # leave the repository. Bundling with `hg bundle` create such risk. | |
1670 bundled_internal = repo.revs(b"%ln and _internal()", missing) | |
1671 if bundled_internal: | |
1672 msg = _(b"cannot bundle internal changesets") | |
1673 hint = _(b"%d internal changesets selected") % len(bundled_internal) | |
1674 raise error.Abort(msg, hint=hint) | |
1675 | |
1668 if heads: | 1676 if heads: |
1669 outgoing = discovery.outgoing( | 1677 outgoing = discovery.outgoing( |
1670 repo, missingroots=missing, ancestorsof=heads | 1678 repo, missingroots=missing, ancestorsof=heads |
1671 ) | 1679 ) |
1672 else: | 1680 else: |