Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Mercurial #264

Closed
wants to merge 4 commits into from

3 participants

@pranavkm
Collaborator

First iteration for adding Mercurial support to Kudu

@amitapl amitapl commented on the diff
Kudu.Core/Deployment/DeploymentManager.cs
((12 lines not shown))
}
if (clean)
{
- tracer.Trace("Cleaning git repository");
+ tracer.Trace("Cleaning repository");
logger.Log(Resources.Log_CleaningGitRepository);
@amitapl Owner
amitapl added a note

Git here should be removed

@pranavkm Collaborator
pranavkm added a note

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Kudu.Core/Deployment/DeploymentManager.cs
((47 lines not shown))
using (tracer.Step("Creating temporary deployment"))
{
- DeploymentStatusFile statusFile = CreateStatusFile(id);
- statusFile.Message = "N/A";
- statusFile.Author = "N/A";
- statusFile.Deployer = "N/A";
- statusFile.AuthorEmail = "N/A";
- statusFile.Status = DeployStatus.Pending;
- statusFile.StatusText = statusText;
- statusFile.Save(_fileSystem);
+ var changeset = new ChangeSet(TemporaryDeploymentId, "N/A", "N/A", "N/A", DateTimeOffset.MinValue);
@amitapl Owner
amitapl added a note

Probably not related to this change but N/A should be in resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Kudu.Core/Deployment/DeploymentManager.cs
@@ -757,5 +721,21 @@ private bool IsActive(string id)
{
return id.Equals(ActiveDeploymentId, StringComparison.OrdinalIgnoreCase);
}
+
+ private IDeploymentRepository GetDeploymentRepository()
+ {
+ var trace = _traceFactory.GetTracer();
+ IRepository repository = new HgRepository(_environment.RepositoryPath, _traceFactory);
@amitapl Owner
amitapl added a note

This can probably be done only once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@amitapl amitapl commented on the diff
Kudu.Core/Infrastructure/FileSystemHelpers.cs
@@ -175,7 +175,9 @@ internal static void Copy(string sourcePath, string destinationPath, bool skipSc
internal static bool IsSourceControlFolder(string path)
{
- return path.StartsWith(".git", StringComparison.OrdinalIgnoreCase);
+ // TODO: Update kudu sync
+ return path.StartsWith(".git", StringComparison.OrdinalIgnoreCase) ||
+ path.StartsWith(".hg", StringComparison.OrdinalIgnoreCase);
@amitapl Owner
amitapl added a note

Will also require a change in the script generator to ignore .hg dir
opened issue Azure/azure-xplat-cli#149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Kudu.Core/SourceControl/DeploymentRepository.cs
@@ -0,0 +1,50 @@
+using System;
+using Kudu.Core.Tracing;
+
+namespace Kudu.Core.SourceControl
+{
+ public class DeploymentRepository : IDeploymentRepository
+ {
+ private readonly ITraceFactory _traceFactory;
@amitapl Owner
amitapl added a note

where is tracerfactory being used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Kudu.Core/Deployment/DeploymentManager.cs
@@ -757,5 +721,21 @@ private bool IsActive(string id)
{
return id.Equals(ActiveDeploymentId, StringComparison.OrdinalIgnoreCase);
}
+
+ private IDeploymentRepository GetDeploymentRepository()
+ {
+ var trace = _traceFactory.GetTracer();
+ IRepository repository = new HgRepository(_environment.RepositoryPath, _traceFactory);
+ if (repository.Exists)
+ {
+ trace.Trace("Found mercurial repository at {0}", _environment.RepositoryPath);
+ }
+ else
+ {
+ trace.Trace("Assuming git repository at {0}", _environment.RepositoryPath);
+ repository = new GitExeRepository(_environment.RepositoryPath, _environment.SiteRootPath, _traceFactory);
@amitapl Owner
amitapl added a note

What if no repository exists?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@amitapl amitapl commented on the diff
Kudu.Services.Web/Services/ServerConfiguration.cs
@@ -13,6 +13,18 @@ public string ApplicationName
}
}
+ public string HgServerRoot
@amitapl Owner
amitapl added a note

Can we make this not repository specific?

@pranavkm Collaborator
pranavkm added a note

Got rid of this. This was for a mercurial server that came back as a result of the revert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Kudu.Services/FetchHelpers/HgFetchHelper.cs
@@ -0,0 +1,27 @@
+using Kudu.Core;
+using Kudu.Core.SourceControl;
+using Kudu.Core.Tracing;
+using Kudu.Services.ServiceHookHandlers;
+
+namespace Kudu.Services
+{
+ public class HgFetchHelper
+ {
+ private readonly IEnvironment _environment;
+ private readonly ITraceFactory _traceFactory;
@amitapl Owner
amitapl added a note

not used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Kudu.Services/FetchHelpers/HgFetchHelper.cs
@@ -0,0 +1,27 @@
+using Kudu.Core;
+using Kudu.Core.SourceControl;
+using Kudu.Core.Tracing;
+using Kudu.Services.ServiceHookHandlers;
+
+namespace Kudu.Services
+{
+ public class HgFetchHelper
@amitapl Owner
amitapl added a note

can share code with GitFetchHelper

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@davidebbo davidebbo commented on the diff
Kudu.Web/Kudu.Web.csproj
@@ -384,7 +384,7 @@
<WebProjectProperties>
<UseIIS>False</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
- <DevelopmentServerPort>14905</DevelopmentServerPort>
+ <DevelopmentServerPort>4862</DevelopmentServerPort>
@davidebbo Owner

This is probably accidental and should be reverted

@pranavkm Collaborator
pranavkm added a note

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@davidebbo davidebbo commented on the diff
Kudu.Core/Infrastructure/PathUtility.cs
@@ -19,6 +19,25 @@ internal static string ResolveGitPath()
return path;
}
+ internal static string ResolveHgPath()
+ {
+ string programFiles32 = SystemEnvironment.GetFolderPath(SystemEnvironment.SpecialFolder.ProgramFilesX86);
+ string path = Path.Combine(programFiles32, "Mercurial", "hg.exe");
+
+ if (!File.Exists(path))
+ {
+ string programFiles = SystemEnvironment.GetFolderPath(SystemEnvironment.SpecialFolder.ProgramFiles);
+ path = Path.Combine(programFiles, "Mercurial", "hg.exe");
+
+ if (!File.Exists(path))
+ {
+ throw new InvalidOperationException(Resources.Error_FailedToLocateGit);
@davidebbo Owner

Should be FailedToLocateHg, not git.

@pranavkm Collaborator
pranavkm added a note

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@pranavkm pranavkm closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 2, 2013
  1. @pranavkm

    Revert "Remove mercurial support."

    pranavkm authored
    Adding unit tests for HgRepository
  2. @pranavkm
  3. @pranavkm
  4. @pranavkm

    * Modifications to service hook handlers to read git new ref values

    pranavkm authored
    * Adding unit tests for CodeBaseHq
    * Changed HgRepository to use hg.exe that allows setting path to ssh.exe
Something went wrong with that request. Please try again.