Domanda

voglio commettere i cambiamenti di una copia di lavoro nel mio computer al repository. Il repository è in un URL e sto facendo adesso:

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);
    }
}

Ma Indifferente lavoro, quando finisce il file viene aggiunto, ma non commesso. Perché? Grazie!!! :)

È stato utile?

Soluzione

FWIW, lo faccio in questo modo:

    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;
            }
        }
    }

Poi mi chiamo come:

  repo.Add("some folder");

  ...

  repo.Commit("base working copy");

Altri suggerimenti

L'argomento elenco modifiche funziona come un filtro. saranno operati solo i file che sono contrassegnati per essere nei changelists specifiche su.

Per impegnarsi si può solo fornire più bersagli.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top