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

stable status: fix cmdutil.matchfiles() inputs on Windows

Apparently the matcher will fixup local path separators when you apply
the matcher to the working directory, but not when it is applied to a
change context. So we much convert '\' to '/' slashes before passing filenames
to cmdutil.matchfiles.

Fixes #479

Changeset dbcaac1fcf7c

Parent 465ff6107573

by Steve Borho

Changes to one file · Browse files at dbcaac1fcf7c Showing diff from parent 465ff6107573 Diff from another changeset...

Change 1 of 3 Show Entire File hggtk/​status.py Stacked
 
845
846
847
 
848
849
850
851
 
852
853
854
 
902
903
904
905
 
 
906
907
908
 
915
916
917
918
 
919
920
921
 
845
846
847
848
849
850
851
 
852
853
854
855
 
903
904
905
 
906
907
908
909
910
 
917
918
919
 
920
921
922
923
@@ -845,10 +845,11 @@
  if not paths:   return   wfile = self.filemodel[paths[0]][FM_PATH] + pfile = util.pconvert(wfile)   difftext = [_('===== Diff to first parent =====\n')]   wctx = self.repo[None]   pctxs = wctx.parents() - matcher = cmdutil.matchfiles(self.repo, [wfile]) + matcher = cmdutil.matchfiles(self.repo, [pfile])   for s in patch.diff(self.repo, pctxs[0].node(), None,   match=matcher, opts=patch.diffopts(self.ui, self.opts)):   difftext.extend(s.splitlines(True)) @@ -902,7 +903,8 @@
  difftext = cStringIO.StringIO()   ctx = self.repo[self._node1]   try: - fctx = ctx.filectx(wfile) + pfile = util.pconvert(wfile) + fctx = ctx.filectx(pfile)   except hglib.LookupError:   fctx = None   if fctx and fctx.size() > hglib.getmaxdiffsize(self.ui): @@ -915,7 +917,7 @@
  difftext.writelines(lines)   difftext.seek(0)   else: - matcher = cmdutil.matchfiles(self.repo, [wfile]) + matcher = cmdutil.matchfiles(self.repo, [pfile])   diffopts = mdiff.diffopts(git=True, nodates=True)   for s in patch.diff(self.repo, self._node1, self._node2,   match=matcher, opts=diffopts):