Example #1
0
		public GitRepository (VersionControlSystem vcs, FilePath path, string url) : base (vcs)
		{
			RootPath = path;
			string discovered = LibGit2Sharp.Repository.Discover (path);
			if (!string.IsNullOrEmpty (discovered))
				RootRepository = new LibGit2Sharp.Repository (discovered);
			Url = url;
		}
		public GitRepository (VersionControlSystem vcs, FilePath path, string url) : base (vcs)
		{
			RootRepository = new LibGit2Sharp.Repository (path);
			RootPath = RootRepository.Info.WorkingDirectory;
			Url = url;
		}
Example #3
0
        public GitConfigurationDialog(VersionControlSystem vcs, string repoPath, string repoUrl)
        {
            this.Build();
            this.repo         = new GitRepository(vcs, repoPath, repoUrl, false);
            this.HasSeparator = false;

            this.UseNativeContextMenus();

            // Branches list

            storeBranches               = new ListStore(typeof(Branch), typeof(string), typeof(string), typeof(string));
            listBranches.Model          = storeBranches;
            listBranches.SearchColumn   = -1;           // disable the interactive search
            listBranches.HeadersVisible = true;

            SemanticModelAttribute modelAttr = new SemanticModelAttribute("storeBranches__Branch", "storeBranches__DisplayName", "storeBranches__Tracking", "storeBranches__Name");

            TypeDescriptor.AddAttributes(storeBranches, modelAttr);

            listBranches.AppendColumn(GettextCatalog.GetString("Branch"), new CellRendererText(), "markup", 1);
            listBranches.AppendColumn(GettextCatalog.GetString("Tracking"), new CellRendererText(), "text", 2);

            listBranches.Selection.Changed += delegate {
                TreeIter it;
                bool     anythingSelected =
                    buttonRemoveBranch.Sensitive = buttonEditBranch.Sensitive = buttonSetDefaultBranch.Sensitive = listBranches.Selection.GetSelected(out it);
                if (!anythingSelected)
                {
                    return;
                }
                if (repo == null || repo.IsDisposed)
                {
                    return;
                }
                string currentBranch = repo.GetCurrentBranch();
                var    b             = (Branch)storeBranches.GetValue(it, 0);
                buttonRemoveBranch.Sensitive     = b.FriendlyName != currentBranch;
                buttonSetDefaultBranch.Sensitive = !b.IsCurrentRepositoryHead;
            };
            buttonRemoveBranch.Sensitive = buttonEditBranch.Sensitive = buttonSetDefaultBranch.Sensitive = false;

            // Sources tree

            storeRemotes               = new TreeStore(typeof(Remote), typeof(string), typeof(string), typeof(string), typeof(string));
            treeRemotes.Model          = storeRemotes;
            treeRemotes.SearchColumn   = -1;           // disable the interactive search
            treeRemotes.HeadersVisible = true;

            SemanticModelAttribute remotesModelAttr = new SemanticModelAttribute("storeRemotes__Remote", "storeRemotes__Name", "storeRemotes__Url", "storeRemotes__BranchName", "storeRemotes__FullName");

            TypeDescriptor.AddAttributes(storeRemotes, remotesModelAttr);

            treeRemotes.AppendColumn(GettextCatalog.GetString("Remote Source / Branch"), new CellRendererText(), "markup", 1);
            treeRemotes.AppendColumn(GettextCatalog.GetString("Url"), new CellRendererText(), "text", 2);

            treeRemotes.Selection.Changed += delegate {
                TreeIter it;
                bool     anythingSelected = treeRemotes.Selection.GetSelected(out it);
                buttonTrackRemote.Sensitive = false;
                buttonFetch.Sensitive       = buttonEditRemote.Sensitive = buttonRemoveRemote.Sensitive = anythingSelected;
                if (!anythingSelected)
                {
                    return;
                }
                string branchName = (string)storeRemotes.GetValue(it, 3);
                if (branchName != null)
                {
                    buttonTrackRemote.Sensitive = true;
                }
            };
            buttonTrackRemote.Sensitive = buttonFetch.Sensitive = buttonEditRemote.Sensitive = buttonRemoveRemote.Sensitive = false;

            // Tags list

            storeTags               = new ListStore(typeof(string));
            listTags.Model          = storeTags;
            listTags.SearchColumn   = -1;           // disable the interactive search
            listTags.HeadersVisible = true;

            SemanticModelAttribute tagsModelAttr = new SemanticModelAttribute("storeTags__Name");

            TypeDescriptor.AddAttributes(storeTags, tagsModelAttr);

            listTags.AppendColumn(GettextCatalog.GetString("Tag"), new CellRendererText(), "text", 0);

            listTags.Selection.Changed += delegate {
                TreeIter it;
                buttonRemoveTag.Sensitive = buttonPushTag.Sensitive = listTags.Selection.GetSelected(out it);
            };
            buttonRemoveTag.Sensitive = buttonPushTag.Sensitive = false;

            // Fill data

            FillBranches();
            FillRemotes();
            FillTags();
        }
Example #4
0
 public static void ShowConfigurationDialog(VersionControlSystem vcs, string repoPath, string repoUrl)
 {
     using (var dlg = new GitConfigurationDialog(vcs, repoPath, repoUrl))
         MessageService.ShowCustomDialog(dlg);
 }
Example #5
0
 protected override RevisionRange[] RetrieveRevisionRanges()
 {
     return(VersionControlSystem.GetFromTillHead(StartRevision, PageSize));
 }
Example #6
0
        public void Uploader()
        {
            var ci = ContinuousIntegrationServer.GetType().Name;

            if (ci.Equals("ContinuousIntegrationServer"))
            {
                Log.Warning("No CI detected.");
            }
            else if (ci.Equals("TeamCity"))
            {
                Log.Information("TeamCity detected.");
                if (string.IsNullOrWhiteSpace(ContinuousIntegrationServer.Branch))
                {
                    Log.Warning("Teamcity does not automatically make build parameters available as environment variables.\nAdd the following environment parameters to the build configuration.\nenv.TEAMCITY_BUILD_BRANCH = %teamcity.build.branch%.\nenv.TEAMCITY_BUILD_ID = %teamcity.build.id%.\nenv.TEAMCITY_BUILD_URL = %teamcity.serverUrl%/viewLog.html?buildId=%teamcity.build.id%.\nenv.TEAMCITY_BUILD_COMMIT = %system.build.vcs.number%.\nenv.TEAMCITY_BUILD_REPOSITORY = %vcsroot.<YOUR TEAMCITY VCS NAME>.url%.");
                }
            }
            else
            {
                Log.Information($"{ci} detected.");
            }

            var vcs = VersionControlSystem.GetType().Name;

            if (vcs.Equals("VersionControlSystem"))
            {
                Log.Warning("No VCS detected.");
            }
            else
            {
                Log.Information($"{vcs} detected.");
            }

            Log.Information($"Project root: {VersionControlSystem.RepoRoot}");
            if (string.IsNullOrWhiteSpace(Yaml.FileName))
            {
                Log.Information("Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml");
            }

            Log.Information("Reading reports.");
            Log.Information(string.Join("\n", Coverage.CoverageReports.Select(x => x.File)));

            if (EnviornmentVariables.GetEnviornmentVariables.Any())
            {
                Log.Information("Appending build variables");
                Log.Information(string.Join("\n", EnviornmentVariables.GetEnviornmentVariables.Select(x => x.Key.Trim()).ToArray()));
            }

            if (CommandLineCommandLineOptions.Dump)
            {
                Log.Warning("Skipping upload and dumping contents.");
                Log.Information($"url: {Url.GetUrl}");
                Log.Information(Report.Reporter);
                return;
            }

            Log.Information("Uploading Reports.");
            Log.Information($"url: {Url.GetUrl.Scheme}://{Url.GetUrl.Authority}");
            Log.Verboase($"api endpoint: {Url.GetUrl}");
            Log.Information($"query: {DisplayUrl}");
            Log.Information("Pinging Codecov");

            var response = Upload.Uploader();

            Log.Verboase($"response: {response}");
            var splitResponse = response.Split('\n');
            var s3            = new Uri(splitResponse[1]);
            var reportUrl     = splitResponse[0];

            Log.Information($"Uploading to S3 {s3.Scheme}://{s3.Authority}");
            Log.Information($"View reports at: {reportUrl}");
        }
Example #7
0
		public GitRepository (VersionControlSystem vcs, FilePath path, string url) : base (vcs)
		{
			RootPath = path;
			RootRepository = new LibGit2Sharp.Repository (path);
			Url = url;
		}