1

I need to read the head version (or last commit) version of a file.

with this approach i get the head version of my working copy,

string workingFolder = @"C:\trunk\Projects\XML\English.xml";
SvnWorkingCopyClient workingCopyClient = new SvnWorkingCopyClient();
SvnWorkingCopyVersion version;
workingCopyClient.GetVersion(workingFolder, out version);
MessageBox.Show(version.End.ToString()); 

But i what i want is to get the head version of my working copy of the file

Deeply appreciate for your time and help

this-Me
  • 2,139
  • 6
  • 43
  • 70
  • 1
    Related to http://stackoverflow.com/questions/684953/how-to-get-latest-revision-number-from-sharpsvn – Raghuram Jan 19 '11 at 14:17
  • All the methods specified in that link gives me the head version of working copy and not specific to a file – this-Me Jan 19 '11 at 16:14

1 Answers1

0

It is the same way as retrieving revisions for a directory:

public long GetfFileRevision(string path) {
        using (SvnClient client = new SvnClient()) {
        SvnInfoEventArgs info;
        try {
            client.GetInfo(path, out info);
            if (info.Revision >= 0) return info.Revision;
        } catch (Exception) {
            return 0;
        }
        return 0;
    }
oo_dev
  • 777
  • 7
  • 20