File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ class StashSubCommand(Enum):
1515
1616
1717class ColorByOptions (Enum ):
18- author = "author"
19- branch = "branch"
20- notlocal1 = "notlocal1"
21- notlocal2 = "notlocal2"
18+ AUTHOR = "author"
19+ BRANCH = "branch"
20+ NOTLOCAL1 = "notlocal1"
21+ NOTLOCAL2 = "notlocal2"
2222
2323
2424class StyleOptions (Enum ):
Original file line number Diff line number Diff line change @@ -1252,7 +1252,7 @@ def create_zone_text(
12521252 thirdColumnFilesDict [f ] = text
12531253
12541254 def color_by (self , offset = 0 ):
1255- if settings .color_by == ColorByOptions .author :
1255+ if settings .color_by == ColorByOptions .AUTHOR :
12561256 sorted_authors = sorted (
12571257 self .author_groups .keys (),
12581258 key = lambda k : len (self .author_groups [k ]),
@@ -1282,17 +1282,17 @@ def color_by(self, offset=0):
12821282 self .recenter_frame ()
12831283 self .scale_frame ()
12841284
1285- elif settings .color_by == ColorByOptions .branch :
1285+ elif settings .color_by == ColorByOptions .BRANCH :
12861286 pass
12871287
1288- elif settings .color_by == ColorByOptions .notlocal1 :
1288+ elif settings .color_by == ColorByOptions .NOTLOCAL1 :
12891289 for commit_id in self .drawnCommits :
12901290 try :
12911291 self .orig_repo .commit (commit_id )
12921292 except ValueError :
12931293 self .drawnCommits [commit_id ].set_color (m .GOLD )
12941294
1295- elif settings .color_by == ColorByOptions .notlocal2 :
1295+ elif settings .color_by == ColorByOptions .NOTLOCAL2 :
12961296 for commit_id in self .drawnCommits :
12971297 if not self .orig_repo .is_ancestor (commit_id , "HEAD" ):
12981298 self .drawnCommits [commit_id ].set_color (m .GOLD )
Original file line number Diff line number Diff line change 1212
1313from git_sim .git_sim_base_command import GitSimBaseCommand
1414from git_sim .settings import settings
15+ from git_sim .enums import ColorByOptions
1516
1617
1718class Push (GitSimBaseCommand ):
@@ -76,12 +77,12 @@ def construct(self):
7677 push_result = 1
7778 self .orig_repo = self .repo
7879 self .repo = self .remote_repo
79- settings .color_by = "notlocal1"
80+ settings .color_by = ColorByOptions . NOTLOCAL1
8081 elif "rejected" in e .stderr and ("non-fast-forward" in e .stderr ):
8182 push_result = 2
8283 self .orig_repo = self .repo
8384 self .repo = self .remote_repo
84- settings .color_by = "notlocal2"
85+ settings .color_by = ColorByOptions . NOTLOCAL2
8586 else :
8687 print (f"git-sim error: git push failed: { e .stderr } " )
8788 return
@@ -173,7 +174,7 @@ def failed_push(self, push_result):
173174 text2 .move_to (text1 .get_center ()).shift (m .DOWN / 2 )
174175
175176 text3 = m .Text (
176- f"Gold commits exist are ahead of your current branch tip (need to be pulled)." ,
177+ f"Gold commits are ahead of your current branch tip (need to be pulled)." ,
177178 font = "Monospace" ,
178179 font_size = 20 ,
179180 color = m .GOLD ,
You can’t perform that action at this time.
0 commit comments