KeyError with svnmerge.py init

View: New views
6 Messages — Rating Filter:   Alert me  

KeyError with svnmerge.py init

by Buddy Burden-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Guys,

I downloaded the latest version of svnmerge (from the link on the Wiki
page) on 6/2.  I tried it out (my first svnmerge operation!) on a
branch (that is, merging the trunk into the branch).  So I naturally
started with:

    svnmerge.py init

in my branch working copy.  This worked perfectly, and I continued on
with the merge itself and all was well.

Now, I want to merge some selected things from the branch back to the
trunk.  So I checked myself out a clean copy of the trunk, and tried
this:

[tyr:~/proj/rent] svnmerge.py init
svn+ssh://svnhost.rent.com/company/svn/rent/branches/sp_alpha_branch
Traceback (most recent call last):
  File "/usr/local/VCtools/svnmerge.py", line 2178, in ?
    main(sys.argv[1:])
  File "/usr/local/VCtools/svnmerge.py", line 2149, in main
    source_pathid = target_to_pathid(source)
  File "/usr/local/VCtools/svnmerge.py", line 847, in target_to_pathid
    root = get_repo_root(target)
  File "/usr/local/VCtools/svnmerge.py", line 824, in get_repo_root
    root = info["Repository Root"]
KeyError: 'Repository Root'

As you can see, this one didn't go so well.  I re-downloaded svnmerge
(again, from the link on the Wiki); it was a newer version, but still
give me the same error.

I searched through the list archives a bit; the only thing I saw that
was similar was an i18n problem, which I'm pretty sure doesn't apply
to me.  But, in anticipation of your next question:

[tyr:~/proj/rent] svn info
Path: .
URL: svn+ssh://svnhost.rent.com/company/svn/rent/trunk
Repository Root: svn+ssh://svnhost.rent.com/company/svn
Repository UUID: 93d52bdf-834c-0410-893d-afd306474019
Revision: 44740
Node Kind: directory
Schedule: normal
Last Changed Author: jbyramian
Last Changed Rev: 44740
Last Changed Date: 2008-06-25 13:07:09 -0700 (Wed, 25 Jun 2008)

Looks to me like the Repository Root is right there, so I'm not sure
what the problem is.

Anybody have any thoughts?  TIA.


         -- Buddy
_______________________________________________
Svnmerge mailing list
Svnmerge@...
http://www.orcaware.com/mailman/listinfo/svnmerge

Re: KeyError with svnmerge.py init

by Dustin J. Mitchell-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Try adding a "print info" on a line just before the current line 842,
and send the result?

Dustin

On Wed, Jun 25, 2008 at 10:03 PM, Buddy Burden <barefootcoder@...> wrote:

> Guys,
>
> I downloaded the latest version of svnmerge (from the link on the Wiki
> page) on 6/2.  I tried it out (my first svnmerge operation!) on a
> branch (that is, merging the trunk into the branch).  So I naturally
> started with:
>
>    svnmerge.py init
>
> in my branch working copy.  This worked perfectly, and I continued on
> with the merge itself and all was well.
>
> Now, I want to merge some selected things from the branch back to the
> trunk.  So I checked myself out a clean copy of the trunk, and tried
> this:
>
> [tyr:~/proj/rent] svnmerge.py init
> svn+ssh://svnhost.rent.com/company/svn/rent/branches/sp_alpha_branch
> Traceback (most recent call last):
>  File "/usr/local/VCtools/svnmerge.py", line 2178, in ?
>    main(sys.argv[1:])
>  File "/usr/local/VCtools/svnmerge.py", line 2149, in main
>    source_pathid = target_to_pathid(source)
>  File "/usr/local/VCtools/svnmerge.py", line 847, in target_to_pathid
>    root = get_repo_root(target)
>  File "/usr/local/VCtools/svnmerge.py", line 824, in get_repo_root
>    root = info["Repository Root"]
> KeyError: 'Repository Root'
>
> As you can see, this one didn't go so well.  I re-downloaded svnmerge
> (again, from the link on the Wiki); it was a newer version, but still
> give me the same error.
>
> I searched through the list archives a bit; the only thing I saw that
> was similar was an i18n problem, which I'm pretty sure doesn't apply
> to me.  But, in anticipation of your next question:
>
> [tyr:~/proj/rent] svn info
> Path: .
> URL: svn+ssh://svnhost.rent.com/company/svn/rent/trunk
> Repository Root: svn+ssh://svnhost.rent.com/company/svn
> Repository UUID: 93d52bdf-834c-0410-893d-afd306474019
> Revision: 44740
> Node Kind: directory
> Schedule: normal
> Last Changed Author: jbyramian
> Last Changed Rev: 44740
> Last Changed Date: 2008-06-25 13:07:09 -0700 (Wed, 25 Jun 2008)
>
> Looks to me like the Repository Root is right there, so I'm not sure
> what the problem is.
>
> Anybody have any thoughts?  TIA.
>
>
>         -- Buddy
> _______________________________________________
> Svnmerge mailing list
> Svnmerge@...
> http://www.orcaware.com/mailman/listinfo/svnmerge
>



--
Storage Software Engineer
http://www.zmanda.com
_______________________________________________
Svnmerge mailing list
Svnmerge@...
http://www.orcaware.com/mailman/listinfo/svnmerge

Parent Message unknown Re: KeyError with svnmerge.py init

by Dustin J. Mitchell-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jun 26, 2008 at 3:11 PM, Buddy Burden <barefootcoder@...> wrote:
> Dustin,
>
>> Try adding a "print info" on a line just before the current line 842,
>> and send the result?
>
> Did you mean 824?  That's where the error is.

Yep, and the print appears for me.  Try this:

Index: svnmerge.py
===================================================================
--- svnmerge.py (revision 31895)
+++ svnmerge.py (working copy)
@@ -821,6 +821,7 @@
     # Try using "svn info URL". This works only on SVN clients >= 1.2
     try:
         info = get_svninfo(url)
+        print >>sys.stderr, info
         root = info["Repository Root"]
         _cache_reporoot[root] = None
         return root

There's no buffering going on, so it should definitely be visible.

Dustin

--
Storage Software Engineer
http://www.zmanda.com
_______________________________________________
Svnmerge mailing list
Svnmerge@...
http://www.orcaware.com/mailman/listinfo/svnmerge

Re: KeyError with svnmerge.py init

by Buddy Burden-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dustin,

>  Try this:
> :
> :

It really doesn't like me putting a print there.  I get the same thing
I got before:

[tyr:~/proj/rent] svnmerge.py init
svn+ssh://svnhost.rent.com/company/svn/rent/branches/sp_alpha_branch
  File "/usr/local/VCtools/svnmerge.py", line 824
    print >>sys.stderr, info
    ^
SyntaxError: invalid syntax

Oh, wait ... it doesn't like the tabs, does it?  I am _so_ not a
Python programmer. :-D

Okay, here you go:

[tyr:~/proj/rent] svnmerge.py init
svn+ssh://svnhost.rent.com/company/svn/rent/branches/sp_alpha_branch
{}
Traceback (most recent call last):
  File "/usr/local/VCtools/svnmerge.py", line 2179, in ?
    main(sys.argv[1:])
  File "/usr/local/VCtools/svnmerge.py", line 2150, in main
    source_pathid = target_to_pathid(source)
  File "/usr/local/VCtools/svnmerge.py", line 848, in target_to_pathid
    root = get_repo_root(target)
  File "/usr/local/VCtools/svnmerge.py", line 825, in get_repo_root
    root = info["Repository Root"]
KeyError: 'Repository Root'

I'm guessing from the empty curly braces that the call to svn info is
just completely failing somehow ... ?  As I said in my original post,
running svn info from the command line seemed to work fine for me.  Is
svnmerge providing extra parameters to svn info?  Hmmm ... let's see
...

Okay, I worked this out.  My URL is incorrect!  By putting

    print 'info "%s"' % target

just above the launchsvn line in get_svninfo(), I could see exactly
what it was calling, and then running that myself I got:

[tyr:~/proj/rent] svn info
"svn+ssh://svnhost.rent.com/company/svn/rent/branches/sp_alpha_branch"
svn+ssh://svnhost.rent.com/company/svn/rent/branches/sp_alpha_branch:
(Not a valid URL)

which eventually led me to stare at the stupid thing until I realized
I was one character off.  D'oh!

So this is totally my fault, but I do wonder if it wouldn't be a good
idea to have a more user-friendly error message ... if launchsvn isn't
capturing the stderr from svn, then perhaps it should, and try to
determine if there was an error and then report that back to the user.
 Or something.

Anyways, I'm off and running again.  Thanx for all the help!


         -- Buddy
_______________________________________________
Svnmerge mailing list
Svnmerge@...
http://www.orcaware.com/mailman/listinfo/svnmerge

Re: KeyError with svnmerge.py init

by Dustin J. Mitchell-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jun 26, 2008 at 6:49 PM, Buddy Burden <barefootcoder@...> wrote:
> So this is totally my fault, but I do wonder if it wouldn't be a good
> idea to have a more user-friendly error message ... if launchsvn isn't
> capturing the stderr from svn, then perhaps it should, and try to
> determine if there was an error and then report that back to the user.
>  Or something.

Buddy makes a good point.  I think that the error is here:

dev@knuth ~/devel/projects/svnmerge/t/trunk $ svn --non-interactive
info "http://svn.r.igoro.us/foo"; echo $?
http://svn.r.igoro.us/foo:  (Not a valid URL)
0

So 'svn info' isn't telling us that anything's wrong.

Dustin

--
Storage Software Engineer
http://www.zmanda.com
_______________________________________________
Svnmerge mailing list
Svnmerge@...
http://www.orcaware.com/mailman/listinfo/svnmerge

Re: KeyError with svnmerge.py init

by Dustin J. Mitchell-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Jun 28, 2008 at 2:15 PM, Dustin J. Mitchell <dustin@...> wrote:
> dev@knuth ~/devel/projects/svnmerge/t/trunk $ svn --non-interactive
> info "http://svn.r.igoro.us/foo"; echo $?
> http://svn.r.igoro.us/foo:  (Not a valid URL)
> 0
>
> So 'svn info' isn't telling us that anything's wrong.

Attached patch gives a better error message.  Review?

This 0 exit status only seems to occur with the http scheme, so I
don't think we can test it (unless we can test against e.g.,
collab.net's server?).

Dustin

[[[
* svnmerge.py (get_svninfo): give a sensible error when 'svn info' returns
  success but no information
]]]

--
Storage Software Engineer
http://www.zmanda.com


_______________________________________________
Svnmerge mailing list
Svnmerge@...
http://www.orcaware.com/mailman/listinfo/svnmerge

url-type-error-improvement.patch (1K) Download Attachment
LightInTheBox - Buy quality products at wholesale price!