Lines Matching defs:pState
454 * @param pState The rewrite state to work on. Can be NULL.
459 static int scmSvnRunAndGetOutput(PSCMRWSTATE pState, const char **papszArgs, bool fNormalFailureOk, char **ppszStdOut)
467 ScmVerbose(pState, 2, "executing: %s\n", pszCmdLine);
489 if (pState)
490 RTMsgError("%s: executing: %s => %Rrc\n", pState->pszFilename, pszCmdLine, rc);
511 * @param pState The rewrite state to work on.
515 static int scmSvnRun(PSCMRWSTATE pState, const char **papszArgs, bool fNormalFailureOk)
521 ScmVerbose(pState, 2, "executing: %s\n", pszCmdLine);
533 pState->pszFilename,
543 RTMsgError("%s: %s -> %Rrc\n", pState->pszFilename, pszCmdLine, rc);
553 static void scmSvnFindSvnBinary(PSCMRWSTATE pState)
586 int rc = scmSvnRunAndGetOutput(pState, apszArgs, false, &pszVersion);
607 * @param pState The rewrite state (for the name).
612 static int scmSvnConstructName(PSCMRWSTATE pState, const char *pszDir, const char *pszSuff, char *pszDst)
614 strcpy(pszDst, pState->pszFilename); /* ASSUMES sizeof(szBuf) <= sizeof(szPath) */
620 rc = RTPathAppend(pszDst, RTPATH_MAX, RTPathFilename(pState->pszFilename));
666 * @param pState The rewrite state to work on.
668 bool ScmSvnIsInWorkingCopy(PSCMRWSTATE pState)
671 scmSvnFindSvnBinary(pState);
678 int rc = scmSvnConstructName(pState, ".svn/text-base/", ".svn-base", szPath);
684 const char *apszArgs[] = { g_szSvnPath, "propget", "svn:no-such-property", pState->pszFilename, NULL };
686 int rc = scmSvnRunAndGetOutput(pState, apszArgs, true, &pszValue);
695 NOREF(pState);
733 NOREF(pState);
746 * @param pState The rewrite state to work on.
751 int ScmSvnQueryProperty(PSCMRWSTATE pState, const char *pszName, char **ppszValue)
756 size_t i = pState->cSvnPropChanges;
758 if (!strcmp(pState->paSvnPropChanges[i].pszName, pszName))
760 const char *pszValue = pState->paSvnPropChanges[i].pszValue;
770 scmSvnFindSvnBinary(pState);
777 rc = scmSvnConstructName(pState, ".svn/props/", ".svn-work", szPath);
779 rc = scmSvnConstructName(pState, ".svn/prop-base/", ".svn-base", szPath);
898 const char *apszArgs[] = { g_szSvnPath, "propget", "--strict", pszName, pState->pszFilename, NULL };
900 rc = scmSvnRunAndGetOutput(pState, apszArgs, false, &pszValue);
919 NOREF(pState);
930 * @param pState The rewrite state to work on.
934 int ScmSvnSetProperty(PSCMRWSTATE pState, const char *pszName, const char *pszValue)
939 size_t i = pState->cSvnPropChanges;
941 if (!strcmp(pState->paSvnPropChanges[i].pszName, pszName))
945 RTStrFree(pState->paSvnPropChanges[i].pszValue);
946 pState->paSvnPropChanges[i].pszValue = NULL;
954 pState->paSvnPropChanges[i].pszValue = pszCopy;
962 i = pState->cSvnPropChanges;
965 void *pvNew = RTMemRealloc(pState->paSvnPropChanges, (i + 32) * sizeof(SCMSVNPROP));
968 pState->paSvnPropChanges = (PSCMSVNPROP)pvNew;
971 pState->paSvnPropChanges[i].pszName = RTStrDup(pszName);
972 pState->paSvnPropChanges[i].pszValue = pszValue ? RTStrDup(pszValue) : NULL;
973 if ( pState->paSvnPropChanges[i].pszName
974 && (pState->paSvnPropChanges[i].pszValue || !pszValue) )
975 pState->cSvnPropChanges = i + 1;
978 RTStrFree(pState->paSvnPropChanges[i].pszName);
979 pState->paSvnPropChanges[i].pszName = NULL;
980 RTStrFree(pState->paSvnPropChanges[i].pszValue);
981 pState->paSvnPropChanges[i].pszValue = NULL;
992 * @param pState The rewrite state to work on.
995 int ScmSvnDelProperty(PSCMRWSTATE pState, const char *pszName)
997 return ScmSvnSetProperty(pState, pszName, NULL);
1005 * @param pState The rewrite state which SVN property changes
1008 int ScmSvnDisplayChanges(PSCMRWSTATE pState)
1010 size_t i = pState->cSvnPropChanges;
1013 const char *pszName = pState->paSvnPropChanges[i].pszName;
1014 const char *pszValue = pState->paSvnPropChanges[i].pszValue;
1016 ScmVerbose(pState, 0, "svn propset '%s' '%s' %s\n", pszName, pszValue, pState->pszFilename);
1018 ScmVerbose(pState, 0, "svn propdel '%s' %s\n", pszName, pState->pszFilename);
1028 * @param pState The rewrite state which SVN property changes
1031 int ScmSvnApplyChanges(PSCMRWSTATE pState)
1034 scmSvnFindSvnBinary(pState);
1039 for (size_t i = 0; i < pState->cSvnPropChanges; i++)
1043 apszArgv[1] = pState->paSvnPropChanges[i].pszValue ? "propset" : "propdel";
1044 apszArgv[2] = pState->paSvnPropChanges[i].pszName;
1046 if (pState->paSvnPropChanges[i].pszValue)
1047 apszArgv[iArg++] = pState->paSvnPropChanges[i].pszValue;
1048 apszArgv[iArg++] = pState->pszFilename;
1051 int rc = scmSvnRun(pState, apszArgv, false);