| 97 | |
| 98 | |
| 99 | def _do_partial_selection(files, curr_b): |
| 100 | partials = [] |
| 101 | for fp in files: |
| 102 | f_st = curr_b.status_file(fp) |
| 103 | if not f_st.exists_at_head: |
| 104 | pprint.warn('Can\'t select segments for new file {0}'.format(fp)) |
| 105 | continue |
| 106 | if not f_st.exists_in_wd: |
| 107 | pprint.warn('Can\'t select segments for deleted file {0}'.format(fp)) |
| 108 | continue |
| 109 | |
| 110 | subprocess.call(['git', 'add', '-p', fp]) |
| 111 | # TODO: check that at least one hunk was staged |
| 112 | partials.append(fp) |
| 113 | |
| 114 | return partials |
| 115 | |
| 116 | |
| 117 | def _auto_track(files, curr_b): |