Commits

Felipe Cuozzo committed 6da7aed

Adding support to read branch/tag name from the current WC

Comments (0)

Files changed (1)

                     fclose(fp);
                     return NULL;
                 }
+                if (fgets(line, sizeof(line), fp)) {
+                    chop_newline(line);
+                    char branch[1024];
+                    char * pbranch;
+                    if (strstr(line, "trunk") != NULL) {
+                        strcpy(branch, "trunk");
+                    }
+                    else if ((pbranch = strstr(line, "branches/")) != NULL) {
+                        strncpy(branch, pbranch+9, 1024);
+                    }
+                    else if ((pbranch = strstr(line, "tags/")) != NULL) {
+                        strncpy(branch, pbranch+5, 1024);
+                    }
+                    strtok(branch, "/");
+                    result->branch = strdup(branch);
+                    debug("read a svn trunk/branch/tag from .svn/entries: '%s'", line); 
+                }
             }
             else {
                 // XML file format (working copy created by svn < 1.4)