| 102 | |
| 103 | |
| 104 | def _print_untracked_files(untracked_list, relative_paths, repo): |
| 105 | pprint.msg('Untracked files:') |
| 106 | pprint.exp('these won\'t be considered for commit') |
| 107 | pprint.exp('use gl track f if you want to track changes to file f') |
| 108 | pprint.blank() |
| 109 | |
| 110 | if not untracked_list: |
| 111 | pprint.item('There are no untracked files to list') |
| 112 | return |
| 113 | |
| 114 | root = repo.root |
| 115 | for f in untracked_list: |
| 116 | exp = '' |
| 117 | color = colored.blue |
| 118 | if f.in_conflict: |
| 119 | exp = ' (with conflicts)' |
| 120 | color = colored.cyan |
| 121 | elif f.exists_at_head: |
| 122 | color = colored.magenta |
| 123 | if f.exists_in_wd: |
| 124 | exp = ' (exists at head)' |
| 125 | else: |
| 126 | exp = ' (exists at head but not in working directory)' |
| 127 | |
| 128 | fp = os.path.relpath(os.path.join(root, f.fp)) if relative_paths else f.fp |
| 129 | if fp == '.': |
| 130 | continue |
| 131 | |
| 132 | pprint.item(color(fp), opt_text=exp) |
| 133 | |
| 134 | |
| 135 | def _print_conflict_exp(op): |