Kiln » largefiles » largefiles-mercurial-truncated changes working towards inclusion in Mercurial
Clone URL:  

Use try-finally block to ensure that repo.bfstatus is reset to false.

Changeset 81a3dccbb30b

Parent d21724d20a75

by David Golub

Changes to one file · Browse files at 81a3dccbb30b Showing diff from parent d21724d20a75 Diff from another changeset...

 
78
79
80
81
82
 
 
83
84
 
85
86
87
 
575
576
577
578
579
580
 
 
 
 
 
581
582
583
 
78
79
80
 
 
81
82
83
 
84
85
86
87
 
575
576
577
 
 
 
578
579
580
581
582
583
584
585
@@ -78,10 +78,10 @@
  def filectx(self, path, fileid=None, filelog=None):   try:   result = super(bfiles_ctx, self).filectx(path, fileid, filelog) - except: - # Adding a null character will cause Mercurial to identify this + except: + # Adding a null character will cause Mercurial to identify this   # as a binary file. - result = super(bfiles_ctx, self).filectx('.kbf/' + path, fileid, filelog) + result = super(bfiles_ctx, self).filectx('.kbf/' + path, fileid, filelog)   olddata = result.data   result.data = lambda: olddata() + '\0'   return result @@ -575,9 +575,11 @@
  repo.bfstatus = False    def override_log(orig, ui, repo, *pats, **opts): - repo.bfstatus = True - orig(ui, repo, *pats, **opts) - repo.bfstatus = False + try: + repo.bfstatus = True + orig(ui, repo, *pats, **opts) + finally: + repo.bfstatus = False    def override_verify(orig, ui, repo, *pats, **opts):   bf = opts.pop('bf', False)