4

python script,

   root = "..."

   commit_info = svncl.propset( "myprop",
                                "Test",                                       
                                root,
                                revision=pysvn.Revision(pysvn.opt_revision_kind.head))

shows Error, pysvn._pysvn_2_7.ClientError: Path "..." does not exist in revision 0.

Seunghoon
  • 5,632
  • 5
  • 35
  • 41
user1553605
  • 1,333
  • 5
  • 24
  • 42
  • Can anyone pls give an idea to solve this Error... – user1553605 Mar 26 '13 at 04:56
  • Is "..." a valid path here? I would expect not. Second, are there any commits in this repository? Try using "." as the path instead. – Christopher Corley Mar 26 '13 at 04:59
  • Hi Corley "..." is a valid path only. There are 65 revisions in the Repository. Try using "." -> what it mean ? Can u pls... – user1553605 Mar 26 '13 at 07:21
  • Corley "..."(https://localhost/svn/Test_Repos/Test1) is a valid path only and able to set the property by using TortoiseSVN and svn.exe. There are 65 revisions in the Repository. – user1553605 Mar 26 '13 at 07:28
  • Two things strike me here: first, the head revision is being set to 0, which would lead me to believe that the path is incorrect in some way. Second, the URL you have given has the https protocol. Have you set up correct authentication? Note that PySVN (usually) doesn't error on incorrect login information. It may also be worth trying to use svn:// instead of https://. (Also, a path of just "." means the current directory the script is being ran in.) – Christopher Corley Mar 26 '13 at 14:59
  • I'm having the similar error... any news here? I am getting `Path https://myserver.com/svnrepo/prj1 does not exist in revision 0` even though I set `revision=pysvn.Revision(pysvn.opt_revision_kind.head)`. I just did branching and other command via pysvn, but propset gives this error. Any idea? – Danijel Sep 24 '15 at 14:37
  • @Danijel See my answer :) – jhasse Sep 28 '15 at 13:21
  • @user1553605 Please accept the answer. – Danijel Sep 29 '15 at 11:28

1 Answers1

2

You need to set base_revision_for_url:

commit_info = svncl.propset(
    "myprop", "Test", root,
    base_revision_for_url=svncl.revpropget("revision", root)[0].number
)

See this bug report for reference: http://pysvn.tigris.org/issues/show_bug.cgi?id=146

jhasse
  • 2,379
  • 1
  • 30
  • 40
  • This gives me `TypeError: int() argument must be a string or a number, not 'revision'`. Any idea? Documentation says: `base_revision_for_url=[0 for URL, -1 for path]` – Danijel Sep 29 '15 at 09:06
  • 1
    Great, works. I am unclear what to set for `revision` argument? For now I skip it: `info = client.propset('svn:externals', dest_externals, dest_externals_url, base_revision_for_url=client.revpropget("revision", dest_externals_url)[0].number)` – Danijel Sep 29 '15 at 11:27
  • 1
    I think that's fine. I also don't set it and it's working. – jhasse Sep 29 '15 at 15:03