Mercurial > hg
changeset 24492:efa094701a05
record_curses: fix ui bug for newly added file
With record's curses interface toggling and untoggling a newly added
file would lead to a confusing UI (the header was marked as partial
and the hunks as unselected). Tested additionally using the curses
interface with newly added, removed and modified files in a test repo.
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Fri, 27 Mar 2015 14:11:13 -0700 |
parents | 784b278b349c |
children | f2b87f4856bf |
files | mercurial/crecord.py |
diffstat | 1 files changed, 6 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/crecord.py Sat Mar 28 00:08:26 2015 -0500 +++ b/mercurial/crecord.py Fri Mar 27 14:11:13 2015 -0700 @@ -753,17 +753,12 @@ if isinstance(item, uiheader): item.partial = False if item.applied: - if not item.special(): - # apply all its hunks - for hnk in item.hunks: - hnk.applied = True - # apply all their hunklines - for hunkline in hnk.changedlines: - hunkline.applied = True - else: - # all children are off (but the header is on) - if len(item.allchildren()) > 0: - item.partial = True + # apply all its hunks + for hnk in item.hunks: + hnk.applied = True + # apply all their hunklines + for hunkline in hnk.changedlines: + hunkline.applied = True else: # un-apply all its hunks for hnk in item.hunks: