public void InitializeTest() { this.VersionControl = Substitute.For<IVersionControlService>(); this.AdeNet = Substitute.For<IAdeNetService>(); this.AddReleasebranchController = new AddReleasebranchController(this.VersionControl, this.AdeNet, new TextOutputServiceDummy()); }
/// <summary> /// Returns the name of the project to which this file belongs. /// </summary> private static async Task <string> MakeProjectLine( IVersionControlService versionControlService, FileInfo file) { var relativePath = await versionControlService.GetRelativePathAsync(file); if (relativePath != null) { var parts = relativePath.DecomposePath(); if (parts.Count > 1 && parts[0].Equals("Samples", StringComparison.OrdinalIgnoreCase)) { return("ILGPU Samples"); } else if (parts.Count > 2 && parts[0].Equals("Src", StringComparison.OrdinalIgnoreCase) && parts[1].StartsWith( "ILGPU.Algorithms", StringComparison.OrdinalIgnoreCase)) { return("ILGPU Algorithms"); } } return("ILGPU"); }
public VersionControlServiceDemo(String defaultRepository, String secondaryRepository, String userName, String password) : base(defaultRepository, secondaryRepository, userName, password) { ServiceFactory serviceFactory = ServiceFactory.Instance; versionControlService = serviceFactory.GetRemoteService<IVersionControlService>(DemoServiceContext); }
public CodeTableService( IRepository <CodeTable> codeTableRepository, IVersionControlService versionControlService) { _codeTableRepository = codeTableRepository; _versionControlService = versionControlService; }
public ShowReleasebranchesController(IVersionControlService versionControlService, ITextOutputService textOutputService) { if(versionControlService == null) throw new ArgumentNullException("versionControlService"); if(textOutputService == null) throw new ArgumentNullException("textOutputService"); this.VersionControl = versionControlService; this.TextOutput = textOutputService; }
public VersionControlServiceDemo(String defaultRepository, String secondaryRepository, String userName, String password) : base(defaultRepository, secondaryRepository, userName, password) { ServiceFactory serviceFactory = ServiceFactory.Instance; versionControlService = serviceFactory.GetRemoteService <IVersionControlService>(DemoServiceContext); }
public void InitializeTest() { this.VersionControl = Substitute.For<IVersionControlService>(); this.UserInput = Substitute.For<IUserInputService>(); this.UserInput.RequestConfirmation(Arg.Any<string>()).Returns(true); this.MergeBugfixController = new MergeBugfixController(this.VersionControl, this.UserInput, new ConventionDummy()); }
public MergeBugfixController(IVersionControlService versionControlService, IUserInputService userInputService, IConvention convention) { if(versionControlService == null) throw new ArgumentNullException("versionControlService"); if(convention == null) throw new ArgumentNullException("convention"); this.VersionControl = versionControlService; this.UserInput = userInputService; this.Convention = convention; }
public void InitializeTest() { this.VersionControl = Substitute.For<IVersionControlService>(); this.AdeNetExeAdapter = Substitute.For<IAdeNetExeAdaper>(); this.BuildEngine = Substitute.For<IBuildEngineService>(); this.Database = Substitute.For<IDatabaseService>(); this.Environment = Substitute.For<IEnvironmentService>(); this.GetLatestController = new GetLatestController(this.VersionControl, this.AdeNetExeAdapter, this.BuildEngine, this.Database, this.Environment, new ConventionDummy(), new TextOutputServiceDummy()); }
public RemoveReleasebranchController(IVersionControlService versionControlService, IFileSystemAdapter fileSystemAdapter, IConvention convention, ITextOutputService textOutputService) { if(versionControlService == null) throw new ArgumentNullException("versionControlService"); if(textOutputService == null) throw new ArgumentNullException("textOutputService"); this.VersionControl = versionControlService; this.FileSystem = fileSystemAdapter; this.Convention = convention; this.TextOutput = textOutputService; }
public void InitializeTest() { this.VersionControl = Substitute.For<IVersionControlService>(); this.AdeNetExeAdapter = Substitute.For<IAdeNetExeAdaper>(); this.FileSystem = Substitute.For<IFileSystemAdapter>(); this.Database = Substitute.For<IDatabaseService>(); this.Ablage = Substitute.For<IAblageService>(); this.Environment = Substitute.For<IEnvironmentService>(); this.RemoveMappingController = new RemoveMappingController(this.VersionControl, this.AdeNetExeAdapter, this.FileSystem, this.Database, this.Ablage, this.Environment, new ConventionDummy(), new TextOutputServiceDummy()); }
public void VersionSampleObjects() { Console.WriteLine("Creating versions of sample data for VersionControlService samples."); ServiceFactory serviceFactory = ServiceFactory.Instance; IVersionControlService versionSvc = serviceFactory.GetRemoteService <IVersionControlService>(serviceDemo.DemoServiceContext); ObjectIdentitySet objIdSet = new ObjectIdentitySet(); ObjectIdentity docObjId = new ObjectIdentity(); docObjId.RepositoryName = serviceDemo.DefaultRepository; docObjId.Value = new ObjectPath(gifImageObjPath); ObjectIdentity doc1ObjId = new ObjectIdentity(); doc1ObjId.RepositoryName = serviceDemo.DefaultRepository; doc1ObjId.Value = new ObjectPath(gifImage1ObjPath); objIdSet.AddIdentity(docObjId); objIdSet.AddIdentity(doc1ObjId); OperationOptions operationOptions = new OperationOptions(); ContentProfile contentProfile = new ContentProfile(FormatFilter.ANY, null, PageFilter.ANY, -1, PageModifierFilter.ANY, null); operationOptions.ContentProfile = contentProfile; DataPackage checkinPackage = versionSvc.Checkout(objIdSet, operationOptions); Console.WriteLine("Checked out sample objects."); for (int i = 0; i <= 1; i++) { DataObject checkinObj = checkinPackage.DataObjects[i]; checkinObj.Contents = null; FileContent newContent = new FileContent(); newContent.LocalPath = gifImageFilePath; newContent.RenditionType = RenditionType.PRIMARY; newContent.Format = "gif"; checkinObj.Contents.Add(newContent); } bool retainLock = false; List <String> labels = new List <String>(); labels.Add("test_version"); versionSvc.Checkin(checkinPackage, VersionStrategy.NEXT_MINOR, retainLock, labels, operationOptions); Console.WriteLine("Checked in sample object with label 'test_version'"); }
public VersionControlsController( ILogger <VersionControlsController> logger, IVersionControlService versionControlService, IRepositoryService repositoryService, IAssetService assetService, IDependencyService dependencyService, IAssetDependencyService assetDependencyService, IVulnerabilityService vulnerabilityService) { this.logger = logger; this.versionControlService = versionControlService; this.repositoryService = repositoryService; }
public PrivilegeService( IRepository <Privilege> privilegeRepository, IRepository <Program> programRepository, IRepository <ProgramButton> programButtonRepository, IVersionControlService versionControlService, IRepository <Button> buttonRepository ) { _privilegeRepository = privilegeRepository; _programRepository = programRepository; _programButtonRepository = programButtonRepository; _versionControlService = versionControlService; _buttonRepository = buttonRepository; }
/// <summary> /// UndoCheckout di un documento in stato checkout /// </summary> /// <param name="checkOutStatus"></param> /// <param name="library"></param> /// <returns></returns> public bool UndoCheckOut(DocsPaVO.CheckInOut.CheckOutStatus checkOutStatus) { bool retValue = false; try { ObjectIdentity identity = null; // Reperimento identity del documento da sbloccare if (DocsPaQueryHelper.isStampaRegistro(checkOutStatus.DocumentNumber)) { identity = Dfs4DocsPa.getDocumentoStampaRegistroIdentityByDocNumber(checkOutStatus.DocumentNumber); } else { identity = Dfs4DocsPa.getDocumentoIdentityByDocNumber(checkOutStatus.DocumentNumber); } ObjectIdentitySet identitySet = new ObjectIdentitySet(); identitySet.Identities.Add(identity); // Reperimento degli ObjectIdentity per ciascun allegato del documento identitySet.Identities.AddRange(Dfs4DocsPa.getAllegatiDocumentoIdentities(this.GetServiceInstance <IQueryService>(false), checkOutStatus.DocumentNumber)); IVersionControlService service = this.GetServiceInstance <IVersionControlService>(false); service.CancelCheckout(identitySet); retValue = true; if (retValue) { this.ClearCheckOutStatusObject(checkOutStatus); retValue = this.SaveCheckOutDocumentProperties(checkOutStatus); if (retValue) { logger.Debug(string.Format("Documentum.UndoCheckOut: effettuato l'undocheckout del documento con id {0} e docnumber {1}", checkOutStatus.IDDocument, checkOutStatus.DocumentNumber)); } } } catch (Exception ex) { retValue = false; logger.Debug("Errore in Documentum.UndoCheckOut: " + ex.ToString()); } return(retValue); }
public GetLatestController(IVersionControlService versionControlService, IAdeNetExeAdaper adeNetExeAdapter, IBuildEngineService buildEngineService, IDatabaseService databaseService, IEnvironmentService environmentService, IConvention convention, ITextOutputService textOutputService) { if(versionControlService == null) throw new ArgumentNullException("versionControlService"); if(adeNetExeAdapter == null) throw new ArgumentNullException("adeNetExeAdapter"); if(buildEngineService == null) throw new ArgumentNullException("buildEngineService"); if(databaseService == null) throw new ArgumentNullException("databaseService"); if(environmentService == null) throw new ArgumentNullException("environmentService"); this.VersionControl = versionControlService; this.AdeNet = adeNetExeAdapter; this.BuildEngine = buildEngineService; this.Database = databaseService; this.Environment = environmentService; this.Convention = convention; this.TextOutput = textOutputService; }
public RemoveMappingController(IVersionControlService versionControlService, IAdeNetExeAdaper adeNetExeAdapter, IFileSystemAdapter fileSystemAdapter, IDatabaseService databaseService, IAblageService ablageService, IEnvironmentService environmentService, IConvention convention, ITextOutputService textOutputService) { if(versionControlService == null) throw new ArgumentNullException("versionControlService"); if(adeNetExeAdapter == null) throw new ArgumentNullException("adeNetExeAdapter"); if(fileSystemAdapter == null) throw new ArgumentNullException("fileSystemAdapter"); if(databaseService == null) throw new ArgumentNullException("databaseService"); if(ablageService == null) throw new ArgumentNullException("ablageService"); if(convention == null) throw new ArgumentNullException("convention"); this.VersionControl = versionControlService; this.AdeNetExeAdapter = adeNetExeAdapter; this.FileSystem = fileSystemAdapter; this.Database = databaseService; this.Ablage = ablageService; this.Environment = environmentService; this.Convention = convention; this.TextOutput = textOutputService; }
public StateChangeExecutorRepositories(IArtifactVersionsRepository artifactVersionsRepository, IWorkflowRepository workflowRepository, IVersionControlService versionControlService, IReuseRepository reuseRepository, ISaveArtifactRepository saveArtifactRepository, IApplicationSettingsRepository applicationSettingsRepository, IServiceLogRepository serviceLogRepository, IUsersRepository usersRepository, IWebhooksRepository webhooksRepository, IProjectMetaRepository projectMetaRepository) { ArtifactVersionsRepository = artifactVersionsRepository; WorkflowRepository = workflowRepository; VersionControlService = versionControlService; ReuseRepository = reuseRepository; SaveArtifactRepository = saveArtifactRepository; ApplicationSettingsRepository = applicationSettingsRepository; ServiceLogRepository = serviceLogRepository; UsersRepository = usersRepository; WebhooksRepository = webhooksRepository; ProjectMetaRepository = projectMetaRepository; }
/// <summary> /// Reperimento dei metadati da documentum relativamente allo stato checkedout del documento /// </summary> /// <param name="documentNumber"></param> /// <returns></returns> protected virtual CheckoutInfo GetDctmCheckOutInfo(string documentNumber) { ObjectIdentity identity = null; // Reperimento identity del documento da bloccare if (DocsPaQueryHelper.isStampaRegistro(documentNumber)) { identity = Dfs4DocsPa.getDocumentoStampaRegistroIdentityByDocNumber(documentNumber); } else { identity = Dfs4DocsPa.getDocumentoIdentityByDocNumber(documentNumber); } if (identity.ValueType == ObjectIdentityType.QUALIFICATION) { logger.Debug(((Qualification)identity.Value).GetValueAsString()); } ObjectIdentitySet identitySet = new ObjectIdentitySet(); identitySet.Identities.Add(identity); //IVersionControlService service = this.GetVersionServiceInstance(); IVersionControlService service = this.GetServiceInstance <IVersionControlService>(true); List <CheckoutInfo> checkOutInfoList = service.GetCheckoutInfo(identitySet); if (checkOutInfoList != null && checkOutInfoList.Count > 0) { return(checkOutInfoList[0]); } else { return(null); } }
/// <summary> /// Constructs a new parser instance. /// </summary> /// <param name="versionControlService">The version control service.</param> public NuspecCopyrightParser(IVersionControlService versionControlService) : base(versionControlService) { }
public void InitializeTest() { this.Convention = new ConventionDummy(); this.VersionControlAdapter = Substitute.For<ITeamFoundationVersionControlAdapter>(); this.VersionControlService = new TeamFoundationService(this.VersionControlAdapter, this.Convention, new TextOutputServiceDummy()); }
public void InitializeTest() { this.VersionControl = Substitute.For<IVersionControlService>(); this.FileSystem = Substitute.For<IFileSystemAdapter>(); this.RemoveReleasebranchController = new RemoveReleasebranchController(this.VersionControl, this.FileSystem, new ConventionDummy(), new TextOutputServiceDummy()); }
public void InitializeTest() { this.VersionControl = Substitute.For<IVersionControlService>(); this.TextOutpt = Substitute.For<ITextOutputService>(); this.ShowReleasebranchesController = new ShowReleasebranchesController(this.VersionControl, this.TextOutpt); }
/// <summary> /// Constructs a new parser instance. /// </summary> /// <param name="versionControlService">The version control service.</param> public SourceCodeCopyrightParser(IVersionControlService versionControlService) : base(versionControlService) { }
/// <summary> /// Constructs a new parser instance. /// </summary> /// <param name="versionControlService">The version control service.</param> public ReadmeCopyrightParser(IVersionControlService versionControlService) : base(versionControlService) { }
/// <summary> /// Checkin di un documento in stato checkout /// </summary> /// <param name="checkOutStatus"></param> /// <param name="library"></param> /// <returns></returns> public bool CheckIn(DocsPaVO.CheckInOut.CheckOutStatus checkOutStatus, byte[] content, string checkInComments) { bool retValue = false; try { // Creazione di un nuovo DataObject che rappresenta il documento da sbloccare DataObject dataObject = new DataObject(); dataObject.Type = ObjectTypes.DOCUMENTO; // Reperimento identity del documento da sbloccare if (DocsPaQueryHelper.isStampaRegistro(checkOutStatus.DocumentNumber)) { dataObject.Identity = Dfs4DocsPa.getDocumentoStampaRegistroIdentityByDocNumber(checkOutStatus.DocumentNumber); } else { dataObject.Identity = Dfs4DocsPa.getDocumentoIdentityByDocNumber(checkOutStatus.DocumentNumber); } List <Property> propertyList = new List <Property>(); // Impostazione numero versione propertyList.Add(new NumberProperty(TypeDocumento.NUMERO_VERSIONE, DocsPaQueryHelper.getDocumentNextVersionId(checkOutStatus.IDDocument))); // Rimozione valore proprietà p3_locked_filepath propertyList.Add(new StringProperty(TypeDocumento.CHECKOUT_LOCAL_FILE_PATH, string.Empty)); // Rimozione valore proprietà p3_locked_file_machinename propertyList.Add(new StringProperty(TypeDocumento.CHECKOUT_MACHINE_NAME, string.Empty)); dataObject.Properties = new PropertySet(); dataObject.Properties.Properties.AddRange(propertyList); // Temporaneo, inserimento contentuto file OperationOptions opts = new OperationOptions(); CheckinProfile checkInProfile = new CheckinProfile(); checkInProfile.MakeCurrent = true; checkInProfile.DeleteLocalFileHint = true; opts.Profiles.Add(checkInProfile); // Creazione di un nuovo oggetto BinaryContent BinaryContent binaryContent = new BinaryContent(); binaryContent.Value = content; string ext = System.IO.Path.GetExtension(checkOutStatus.DocumentLocation); if (ext.StartsWith(".")) { ext = ext.Substring(1); } string fileFormat = DfsHelper.getDctmFileFormat(this.GetServiceInstance <IQueryService>(false), ext); binaryContent.Format = fileFormat; dataObject.Contents.Add(binaryContent); DataPackage dataPackage = new DataPackage(dataObject); dataPackage.RepositoryName = DctmConfigurations.GetRepositoryName(); IVersionControlService service = this.GetServiceInstance <IVersionControlService>(false); VersionStrategy strategy = VersionStrategy.IMPLIED; if (!DocsPaQueryHelper.isDocumentAcquisito(checkOutStatus.IDDocument)) { strategy = VersionStrategy.SAME_VERSION; } dataPackage = service.Checkin(dataPackage, strategy, false, null, opts); retValue = (dataPackage.DataObjects.Count > 0); if (retValue) { logger.Debug(string.Format("Documentum.CheckIn: effettuato il checkin del documento con id {0} e docnumber {1}", checkOutStatus.IDDocument, checkOutStatus.DocumentNumber)); } } catch (Exception ex) { retValue = false; logger.Debug("Errore in Documentum.CheckIn: " + ex.ToString()); } return(retValue); }
/// <summary> /// Checkout di un documento /// </summary> /// <param name="checkOutStatus">Metadati relativi allo stato del documento in checkout</param> /// <param name="user"></param> /// <param name="library"></param> /// <returns></returns> public bool CheckOut(string idDocument, string documentNumber, string documentLocation, string machineName, out CheckOutStatus checkOutStatus) { checkOutStatus = null; // Determina se il documento da bloccare è di tipo stampa registro bool isStampaRegistro = (DocsPaQueryHelper.isStampaRegistro(documentNumber)); bool retValue = this.SaveCheckOutDocumentProperties(string.Empty, documentNumber, documentLocation, machineName); try { if (retValue) { ObjectIdentity identity = null; // Reperimento identity del documento da bloccare if (isStampaRegistro) { identity = Dfs4DocsPa.getDocumentoStampaRegistroIdentityByDocNumber(documentNumber); } else { identity = Dfs4DocsPa.getDocumentoIdentityByDocNumber(documentNumber); } ObjectIdentitySet identitySet = new ObjectIdentitySet(); identitySet.Identities.Add(identity); OperationOptions opts = null; if (DocsPaQueryHelper.getCountAllegati(idDocument) > 0) { // Se il documento contiene allegati, è sicuramente un virtual document CheckoutProfile checkOutProfile = new CheckoutProfile(); // Ulteriore verifica se il documento è un allegato o un documento principale checkOutProfile.CheckoutOnlyVDMRoot = !DocsPaQueryHelper.isAllegatoProfilato(documentNumber); opts = new OperationOptions(); opts.CheckoutProfile = checkOutProfile; } IVersionControlService service = this.GetServiceInstance <IVersionControlService>(false); DataPackage dataPackage = service.Checkout(identitySet, opts); // Reperimento ObjectId della versione in checkout ObjectId objectId = (ObjectId)dataPackage.DataObjects[0].Identity.Value; checkOutStatus = this.GetCheckOutStatus(objectId.Id, idDocument, documentNumber); //if (DocsPaQueryHelper.getCountAllegati(idDocument) > 0) //{ // // Workaround per gli allegati // this.UndoCheckOutAllegati(documentNumber); //} retValue = true; logger.Debug(string.Format("Documentum.CheckOut: effettuato il checkout del documento con id {0} e docnumber {1}", idDocument, documentNumber)); } } catch (Exception ex) { retValue = false; logger.Debug("Errore in Documentum.CheckOut: " + ex.ToString()); } return(retValue); }
public TFVCService(IVersionControlService versionControlService, ISolutionService solutionService) { _versionControlService = versionControlService; _solutionService = solutionService; }
/// <summary> /// Constructs a new parser instance. /// </summary> /// <param name="versionControlService">The version control service.</param> public LicenseCopyrighParser(IVersionControlService versionControlService) : base(versionControlService) { }
public VersionControlController(IVersionControlService versionControlService) { _versionControlService = versionControlService; }