MCPcopy
hub / github.com/gitless-vcs/gitless / _print_tracked_mod_files

Function _print_tracked_mod_files

gitless/cli/gl_status.py:69–101  ·  view source on GitHub ↗
(tracked_mod_list, relative_paths, repo)

Source from the content-addressed store, hash-verified

67
68
69def _print_tracked_mod_files(tracked_mod_list, relative_paths, repo):
70 pprint.msg('Tracked files with modifications:')
71 pprint.exp('these will be automatically considered for commit')
72 pprint.exp(
73 'use gl untrack f if you don\'t want to track changes to file f')
74 pprint.exp(
75 'if file f was committed before, use gl checkout f to discard '
76 'local changes')
77 pprint.blank()
78
79 if not tracked_mod_list:
80 pprint.item('There are no tracked files with modifications to list')
81 return
82
83 root = repo.root
84 for f in tracked_mod_list:
85 exp = ''
86 color = colored.yellow
87 if not f.exists_at_head:
88 exp = ' (new file)'
89 color = colored.green
90 elif not f.exists_in_wd:
91 exp = ' (deleted)'
92 color = colored.red
93 elif f.in_conflict:
94 exp = ' (with conflicts)'
95 color = colored.cyan
96
97 fp = os.path.relpath(os.path.join(root, f.fp)) if relative_paths else f.fp
98 if fp == '.':
99 continue
100
101 pprint.item(color(fp), opt_text=exp)
102
103
104def _print_untracked_files(untracked_list, relative_paths, repo):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected