Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0.3, 2.0.4, and 2.0.5

stable thgrepo: fix crash on ids that look like pathnames

A TypeError is thrown by os.path.isfile if a (binary) changeid
starts with '/' and contains a null byte.

Changeset 5749cde33f3b

Parent 0e34c0f46776

by Wagner Bruna

Changes to one file · Browse files at 5749cde33f3b Showing diff from parent 0e34c0f46776 Diff from another changeset...

 
239
240
241
242
243
 
 
244
245
246
 
239
240
241
 
 
242
243
244
245
246
@@ -239,8 +239,8 @@
  if changeid in self.thgmqunappliedpatches:   q = self.mq # must have mq to pass the previous if   return genPatchContext(self, q.join(changeid), rev=changeid) - elif type(changeid) is str and os.path.isabs(changeid) and \ - os.path.isfile(changeid): + elif type(changeid) is str and '\0' not in changeid and \ + os.path.isabs(changeid) and os.path.isfile(changeid):   return genPatchContext(repo, changeid)     changectx = super(thgrepository, self).changectx(changeid)