Hello, On 2024/09/25 19:04, Vincent Lefevre wrote: > Hi, > > On 2024-09-25 11:58:43 +0900, Yasuhito FUTATSUKI wrote: >> On 2024/09/25 9:17, Vincent Lefevre wrote: >> >> > Checking the error message might not be future-proof. >> >> Then, check the error code instead. > > It might not be future-proof either. For instance, there has been > a change in 1.7, as noted there: > > https://subversion.apache.org/docs/api/1.8/svn__error__codes_8h.html#ac8784565366c15a28d456c4997963660a46befa5b8c1fb5204fdc3921c3124b97 > > I suppose that if the error message changes, there is a high risk > that the error code might change too, like above.
At least in Subversion 1.x, we would keep effort for backward compatibility. Actually, SVN_ERR_WC_NOT_DIRECTORY can be still used as an alias for backward compatibility and its acutal error number is same as SVN_ERR_WC_NOT_WORKING_COPY. However, the worry that an error code could be splitted to more detailed errors, is reasonable. Then nothing is future-proof. We should check changes, forever. >> e.g. with Python bindings: > [...] > > For portability, it needs to be a shell script (BTW, I've seen more > breakage due to Python upgrades than anything else, so that Python > is definitely not a good solution). I used Python bindings as an example how to check symbolic error code, but not a text literal. Because it might change on environment it was built (at least it depends on APR_OS_START_USERERR comes from an include file in APR library). I have no other intension. Please use the way you like. > With the shell command, there is the error code "E155007". So I'm > wondering what is the most stable. I could not find any documentation > on the subject. One of obvious idea is check the error code for root path (assuming it is not in working copy), before checking target paths, however it root path itself is working copy, it might some other error than SVN_ERR_WC_NOT_DIRECTORY, e.g. caused by wc.db locking. Cheers, -- Yasuhito FUTATSUKI <futat...@yf.bsdclub.org>