Mercurial > hg
comparison hgext/shelve.py @ 20408:3392695abd68
shelve: really pass publicancestors to changegroupsubset - not the parents
publicancestors returned the parents of the public ancestors ... and
changegroupsubset used the parents of these as base for the bundle. That gave
bundles with one layer of changesets more than necessary.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Mon, 10 Feb 2014 00:52:56 +0100 |
parents | 955547eb2e20 |
children | 0b7a9940a397 |
comparison
equal
deleted
inserted
replaced
20407:955547eb2e20 | 20408:3392695abd68 |
---|---|
120 | 120 |
121 def createcmd(ui, repo, pats, opts): | 121 def createcmd(ui, repo, pats, opts): |
122 """subcommand that creates a new shelve""" | 122 """subcommand that creates a new shelve""" |
123 | 123 |
124 def publicancestors(ctx): | 124 def publicancestors(ctx): |
125 """Compute the heads of the public ancestors of a commit. | 125 """Compute the public ancestors of a commit. |
126 | 126 |
127 Much faster than the revset heads(ancestors(ctx) - draft())""" | 127 Much faster than the revset ancestors(ctx) & draft()""" |
128 seen = set([nullrev]) | 128 seen = set([nullrev]) |
129 visit = util.deque() | 129 visit = util.deque() |
130 visit.append(ctx) | 130 visit.append(ctx) |
131 while visit: | 131 while visit: |
132 ctx = visit.popleft() | 132 ctx = visit.popleft() |
133 yield ctx.node() | |
133 for parent in ctx.parents(): | 134 for parent in ctx.parents(): |
134 rev = parent.rev() | 135 rev = parent.rev() |
135 if rev not in seen: | 136 if rev not in seen: |
136 seen.add(rev) | 137 seen.add(rev) |
137 if parent.mutable(): | 138 if parent.mutable(): |
138 visit.append(parent) | 139 visit.append(parent) |
139 else: | |
140 yield parent.node() | |
141 | 140 |
142 wctx = repo[None] | 141 wctx = repo[None] |
143 parents = wctx.parents() | 142 parents = wctx.parents() |
144 if len(parents) > 1: | 143 if len(parents) > 1: |
145 raise util.Abort(_('cannot shelve while merging')) | 144 raise util.Abort(_('cannot shelve while merging')) |