# HG changeset patch # User jrice@netbeans.org # Date 1212055658 -7200 # Node ID ef0baea3d1484aebe039337bfc4991e3130ce743 # Parent a7444a15e8e9988da98bf4ef60487c2e0099805a #136073: Search History on Windows broken for single file diff -r a7444a15e8e9 -r ef0baea3d148 mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java --- a/mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java Mon May 26 13:41:37 2008 +0100 +++ b/mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java Thu May 29 12:07:38 2008 +0200 @@ -827,14 +827,19 @@ public class HgCommand { List filesShortPaths = new ArrayList(); if (list != null && !list.isEmpty()) { - if(files != null){ - for(File f: files){ + if (files != null) { + for (File f : files) { String shortPath = f.getAbsolutePath(); - if(shortPath.startsWith(rootURL) && shortPath.length() > rootURL.length()) { - filesShortPaths.add(shortPath.substring(rootURL.length()+1)); + if (shortPath.startsWith(rootURL) && shortPath.length() > rootURL.length()) { + if (Utilities.isWindows()) { + filesShortPaths.add(shortPath.substring(rootURL.length() + 1).replace(File.separatorChar, '/')); // NOI18N + } else { + filesShortPaths.add(shortPath.substring(rootURL.length() + 1)); // NOI18N + } } } } + rev = author = desc = date = id = parents = fm = fa = fd = fc = null; boolean bEnd = false; for (String s : list) {