comparison hgext/shelve.py @ 26602:c062a9c0293c

shelve: rename 'publicancestors' to something accurate (issue4737) That function is actually not returning public ancestors at all. This is pointed by the second line of the docstring... The bundling behavior was made correct in a5141977198d but with confusion remaining regarding what each function was doing. This close issue4737, because this highlight that shelve is actually -not- bundling too much data (this was actually properly tested).
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 09 Oct 2015 15:31:50 -0700
parents 56b2bcea2529
children ca8170b5d370
comparison
equal deleted inserted replaced
26601:c5c7c686d6a6 26602:c062a9c0293c
217 repo.vfs.unlink(dirstatebackup) 217 repo.vfs.unlink(dirstatebackup)
218 218
219 def createcmd(ui, repo, pats, opts): 219 def createcmd(ui, repo, pats, opts):
220 """subcommand that creates a new shelve""" 220 """subcommand that creates a new shelve"""
221 221
222 def publicancestors(ctx): 222 def mutableancestors(ctx):
223 """Compute the public ancestors of a commit. 223 """return all mutable ancestors for ctx (included)
224 224
225 Much faster than the revset ancestors(ctx) & draft()""" 225 Much faster than the revset ancestors(ctx) & draft()"""
226 seen = set([nullrev]) 226 seen = set([nullrev])
227 visit = collections.deque() 227 visit = collections.deque()
228 visit.append(ctx) 228 visit.append(ctx)
324 "'hg status')\n") % len(stat.deleted)) 324 "'hg status')\n") % len(stat.deleted))
325 else: 325 else:
326 ui.status(_("nothing changed\n")) 326 ui.status(_("nothing changed\n"))
327 return 1 327 return 1
328 328
329 bases = list(publicancestors(repo[node])) 329 bases = list(mutableancestors(repo[node]))
330 shelvedfile(repo, name, 'hg').writebundle(bases, node) 330 shelvedfile(repo, name, 'hg').writebundle(bases, node)
331 cmdutil.export(repo, [node], 331 cmdutil.export(repo, [node],
332 fp=shelvedfile(repo, name, 'patch').opener('wb'), 332 fp=shelvedfile(repo, name, 'patch').opener('wb'),
333 opts=mdiff.diffopts(git=True)) 333 opts=mdiff.diffopts(git=True))
334 334