Mercurial > hgsubversion
comparison hg_delta_editor.py @ 136:cf6fe8457570
Fix an apparent regression where branch name didn't get properly stored for
commits forced on empty branches.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Thu, 11 Dec 2008 17:34:33 -0600 |
parents | 2242dd1163c6 |
children | 6f2d67bf3039 |
comparison
equal
deleted
inserted
replaced
135:e33c7a4bcebb | 136:cf6fe8457570 |
---|---|
352 continue | 352 continue |
353 p, b = self._path_and_branch_for_path(f) | 353 p, b = self._path_and_branch_for_path(f) |
354 if b not in branch_batches: | 354 if b not in branch_batches: |
355 branch_batches[b] = [] | 355 branch_batches[b] = [] |
356 branch_batches[b].append((p, f)) | 356 branch_batches[b].append((p, f)) |
357 | |
358 for branch, files in branch_batches.iteritems(): | 357 for branch, files in branch_batches.iteritems(): |
359 if branch in self.commit_branches_empty and files: | 358 if branch in self.commit_branches_empty and files: |
360 del self.commit_branches_empty[branch] | 359 del self.commit_branches_empty[branch] |
361 extra = {} | 360 extra = {} |
362 files = dict(files) | 361 files = dict(files) |
432 if ha == node.nullid: | 431 if ha == node.nullid: |
433 continue | 432 continue |
434 parent_ctx = self.repo.changectx(ha) | 433 parent_ctx = self.repo.changectx(ha) |
435 def del_all_files(*args): | 434 def del_all_files(*args): |
436 raise IOError | 435 raise IOError |
436 # True here meant nuke all files, shouldn't happen with branch closing | |
437 if self.commit_branches_empty[branch]: | |
438 assert False, 'Got asked to commit non-closed branch as empty with no files. Please report this issue.' | |
437 extra = {} | 439 extra = {} |
438 if parent_ctx.children(): | 440 if branch: |
439 # Target isn't an active head, no need to do things to it. | 441 extra['branch'] = branch |
440 continue | |
441 if branch in self.branches_to_delete: | |
442 extra['branch'] = 'closed-branch' | |
443 # True here means nuke all files | |
444 files = [] | |
445 if self.commit_branches_empty[branch]: | |
446 files = parent_ctx.manifest().keys() | |
447 current_ctx = context.memctx(self.repo, | 442 current_ctx = context.memctx(self.repo, |
448 (ha, node.nullid), | 443 (ha, node.nullid), |
449 rev.message or ' ', | 444 rev.message or ' ', |
450 files, | 445 [], |
451 del_all_files, | 446 del_all_files, |
452 '%s%s' % (rev.author, | 447 '%s%s' % (rev.author, |
453 self.author_host), | 448 self.author_host), |
454 date, | 449 date, |
455 extra) | 450 extra) |