Question

Je veux valider les modifications d'une copie de travail dans mon ordinateur au référentiel. Le dépôt est dans une URL et ce faisant maintenant je suis:

using (SvnClient client = new SvnClient())
{
    SvnCommitArgs ca = new SvnCommitArgs();

    ca.ChangeLists.Add(workingcopydir + filename);

    ca.LogMessage = "Change";

    client.Add(workingcopydir + filename);



    try
    {
        client.Commit(workingcopydir, ca);

        //, ca, out resultado
    }
    catch (Exception exc)
    {
        MessageBox.Show(this, exc.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    }
}

Mais le travail Indifférent Fume, quand il termine le fichier est ajouté, mais pas commited. Pourquoi? Merci!!! :)

Était-ce utile?

La solution

FWIW, je le fais comme ceci:

    public bool Add (string path)
    {
        using(SvnClient client = NewSvnClient()){
            SvnAddArgs args = new SvnAddArgs();
            args.Depth = SvnDepth.Empty;
            args.AddParents = true;
            return client.Add(path, args);
        }
    }

    public bool Commit (string path, string message)
    {
        using(SvnClient client = NewSvnClient()){
            SvnCommitArgs args  = new SvnCommitArgs();

            args.LogMessage     = message;
            args.ThrowOnError   = true;
            args.ThrowOnCancel  = true;

            try { 
                return client.Commit(path, args);
            } catch(Exception e){
                if( e.InnerException != null ){
                    throw new Exception(e.InnerException.Message, e);
                }

                throw e;
            }
        }
    }

Alors je l'appelle comme:

  repo.Add("some folder");

  ...

  repo.Commit("base working copy");

Autres conseils

L'argument ChangeList fonctionne comme un filtre. Seuls les fichiers qui sont marqués pour être dans les changelists spécifiques seront opérés.

Pour commettez, vous pouvez simplement fournir des cibles multiples.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top