--- a/rakelib/hglib.rb Tue Jan 23 09:50:40 2018 +0000
+++ b/rakelib/hglib.rb Thu Mar 01 22:31:43 2018 +0000
@@ -344,8 +344,13 @@
# Return changeset IDs of all head revisions.
# If `branch` is given, return only heads in given
# branch.
- def heads(branch = nil)
- branch ? log("head() and branch('#{branch}')") : log('head()')
+ # If `secret_secret` is false, then changesets in
+ # secret phase are ignored (even if thet're heads
+ def heads(branch = nil, include_secret: true)
+ revset = "head()"
+ revset += " and branch('#{branch}')" if branch
+ revset += " and !secret()" if not include_secret
+ return log(revset)
end
# Return name of an active bookmark or nil if no bookmark
--- a/rakelib/scm.rb Tue Jan 23 09:50:40 2018 +0000
+++ b/rakelib/scm.rb Thu Mar 01 22:31:43 2018 +0000
@@ -167,7 +167,7 @@
if bookmarks.has_key? 'master'
revision = 'master'
else
- if hg.heads(branch).size > 1
+ if hg.heads(branch, include_secret: false).size > 1
raise CheckoutException.new("HG: Cannot checkout #{directory}: directory. The ->#{branch}<- branch has multiple heads but no bookmark named 'master'! (All other branches are ignored)")
end
end