Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

shlib: use repo.opener with atomic file for writing status file

like this, there is never a partialy written file

Changeset 0c1d0e0971e6

Parent 9f8691c956e3

by Simon Heimberg

Changes to one file · Browse files at 0c1d0e0971e6 Showing diff from parent 9f8691c956e3 Diff from another changeset...

Change 1 of 1 Show Entire File thgutil/​shlib.py Stacked
 
92
93
94
95
 
96
97
98
99
100
 
101
102
103
 
92
93
94
 
95
96
97
98
99
 
100
101
102
103
@@ -92,12 +92,12 @@
  dirstatus[dirname(fn)] = 'm'   for fn in removed + deleted:   dirstatus[dirname(fn)] = 'r' - f = open(repo.join("thgstatus"), 'wb') + f = repo.opener('thgstatus', 'wb', atomictemp=True)   for dn in sorted(dirstatus):   s = dirstatus[dn]   f.write(s + dn + '\n')   ui.note("%s %s\n" % (s, dn)) - f.close() + f.rename()    else:   def shell_notify(paths):