changeset 157:43f4c91d5eaa

Implement BranchSupport interface
author Dmitry Neverov <dmitry.neverov@jetbrains.com>
date Tue, 11 Jan 2011 20:38:46 +0300
parents 3a8af53dea6b (diff) 7e36394a9c00 (current diff)
children c8af439595ba
files mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java	Tue Jan 11 20:05:22 2011 +0300
+++ b/mercurial-server/src/jetbrains/buildServer/buildTriggers/vcs/mercurial/MercurialVcsSupport.java	Tue Jan 11 20:38:46 2011 +0300
@@ -101,15 +101,16 @@
     return cfc.execute();
   }
 
-  private List<VcsChange> toVcsChanges(final List<ModifiedFile> modifiedFiles, String prevVer, String curVer) {
+  private List<VcsChange> toVcsChanges(final List<ModifiedFile> modifiedFiles, String prevVer, String curVer, CheckoutRules rules) {
     List<VcsChange> files = new ArrayList<VcsChange>();
     for (ModifiedFile mf: modifiedFiles) {
+      String normalizedPath = PathUtil.normalizeSeparator(mf.getPath());
       VcsChangeInfo.Type changeType = getChangeType(mf.getStatus());
       if (changeType == null) {
         Loggers.VCS.warn("Unable to convert status: " + mf.getStatus() + " to VCS change type");
         changeType = VcsChangeInfo.Type.NOT_CHANGED;
       }
-      files.add(new VcsChange(changeType, mf.getStatus().getName(), mf.getPath(), mf.getPath(), prevVer, curVer));
+      files.add(new VcsChange(changeType, mf.getStatus().getName(), normalizedPath, rules.map(mf.getPath()), prevVer, curVer));
     }
     return files;
   }
@@ -502,7 +503,7 @@
 
           // changeset full version will be set into VcsChange structure and
           // stored in database (note that getContent method will be invoked with this version)
-          List<VcsChange> files = toVcsChanges(modifiedFiles, prev.getFullVersion(), cur.getFullVersion());
+          List<VcsChange> files = toVcsChanges(modifiedFiles, prev.getFullVersion(), cur.getFullVersion(), checkoutRules);
           if (files.isEmpty() && !merge) continue;
           ModificationData md = new ModificationData(cur.getTimestamp(), files, cur.getDescription(), cur.getUser(), root, cur.getFullVersion(), cur.getId());
           if (merge) {