Commits

Sebastian Sdorra committed 1b2b006

implement revision label in changeset grid for mercurial repositories

  • Participants
  • Parent commits 4462b99
  • Branches issue-287

Comments (0)

Files changed (1)

scm-plugins/scm-hg-plugin/src/main/resources/sonia/scm/hg.config.js

   
   getChangesetId: function(id, record){
     if ( this.isMercurialRepository() ){
-      // TODO implement
+      var rev = Sonia.util.getProperty(record.get('properties'), 'hg.rev');
+      if ( rev ){
+        id = rev + ':' + id;
+      }
     }
     return id;
   },
   getParentIds: function(id, record){
     var parents = record.get('parents');
     if ( this.isMercurialRepository() ){
-      // TODO implement
+      if ( parents && parents.length > 0 ){
+        var properties = record.get('properties');
+        var rev = Sonia.util.getProperty(properties, 'hg.p1.rev');
+        if (rev){
+          parents[0] = rev + ':' + parents[0];
+        }
+        if ( parents.length > 1 ){
+          rev = Sonia.util.getProperty(properties, 'hg.p2.rev');          
+          if (rev){
+            parents[1] = rev + ':' + parents[1];
+          }
+        }
+      }
     }
     return parents;
   }