Kiln » Unstable
Clone URL:  

Rework purge override to not delete kbfiles in the first place. This avoids reverting changes to the kbfiles.

Changeset 679381247dc8

Parent 6cdd04ab5631

by David Golub

Changes to one file · Browse files at 679381247dc8 Showing diff from parent 6cdd04ab5631 Diff from another changeset...

 
1160
1161
1162
1163
1164
1165
 
 
1166
 
 
 
 
 
 
 
 
 
 
 
1167
1168
 
1169
1170
1171
 
1160
1161
1162
 
 
 
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
 
1178
1179
1180
1181
@@ -1160,12 +1160,22 @@
    return orig(ui, repo, *pats, **opts)   -# Calling purge with --all will cause the kbfiles to be deleted, but doesn't -# re-populate them. We must do it explicitly. It doesn't hurt anything to -# be safe and update them the rest of the time after calling purge, either. +# Calling purge with --all will cause the kbfiles to be deleted. +# Override repo.status to prevent this from happening.  def override_purge(orig, ui, repo, *dirs, **opts): + oldstatus = repo.status + def override_status(node1='.', node2=None, match=None, ignored=False, + clean=False, unknown=False, listsubrepos=False): + r = oldstatus(node1, node2, match, ignored, clean, unknown, + listsubrepos) + bfdirstate = bfutil.open_bfdirstate(ui, repo) + modified, added, removed, deleted, unknown, ignored, clean = r + unknown = [f for f in unknown if bfdirstate[f] == '?'] + ignored = [f for f in ignored if bfdirstate[f] == '?'] + return modified, added, removed, deleted, unknown, ignored, clean + repo.status = override_status   orig(ui, repo, *dirs, **opts) - bfcommands.update_bfiles(repo.ui, repo) + repo.status = oldstatus    def uisetup(ui):   # Disable auto-status for some commands which assume that all