For your information:
---------- Forwarded message ----------
From: Watson, Chris <cwatson@ptc.com>
Date: Jan 18, 2007 1:38 PM
Subject: RE: FW: How to make projects with externals usable after the
repository has been relocated?
To: Robert Ioiart <rioiart@gmail.com>
Since it works with the example it proves it's your repo and not a
python/install problem, so that narrows down the problem set.
The script did what I needed it to do and I'm done with it, it's disposable
from my POV. I'm happy to help you to a limited extent to get it working
for you - and if you want to talk to the development team then that's fine -
as I said there is material out there - we just found it not particularly
useful.
I'm sorry I haven't been more help to you.
Chris
------------------------------
*From:* Robert Ioiart [mailto:rioiart@gmail.com]
*Sent:* 18 January 2007 11:33
*To:* Watson, Chris
*Subject:* Re: FW: How to make projects with externals usable after the
repository has been relocated?
Your example works.
The issue that I'm having is with the 600 MB repository dump.
At first the command I used was:
D:\repository porting>python cldmpReplace.py dump
file:///\tmav351x.tmav.ww011.siemens.net/did94044/IIP_CDS/Projects/PC_Tools/grADI/SVN_REPOSITORY
svn://tma0008s
It seems that the script had some problems with the escape character so I
replaced the '\' character with '/' using sed not affecting any data
lengths.
The next command I tried with the new dump is:
D:\repository porting>python cldmpReplace.py -v output.cldmp
file:////tmav351x.tmav.ww011.siemens.net/did94044/IIP_CDS/Projects/PC_Tools/grADI/SVN_REPOSITORY
svn://tma0008s
the output I got is attached.
Also I got some error output:
Traceback (most recent call last):
File "cldmpReplace.py", line 317, in <module>
main()
File "cldmpReplace.py", line 110, in main
linesOutput = processSection(linesQueue, lineNum, stringOld, stringNew)
File "cldmpReplace.py", line 189, in processSection
linesProps = processPropLines(linesProps, lineNum, stringOld, stringNew)
File "cldmpReplace.py", line 226, in processPropLines
linesProps[valueByteCountLineIndex] = "V " + "%s\n" % valueByteCountNew
UnboundLocalError: local variable 'valueByteCountLineIndex' referenced
before assignment
As a conclusion I can tell you that the script is a very good idea but
unfortunatly it's not very reliable.
Maybe we should contact the develpoment team from subversion, to get some
documentation about the dump file format and more importantly see what they
have to say about this issue with externals and porting repositories.
It could be considered that this is a logic error of subversion because it
offers support for operations with externals but it does not handle porting
at all. Maybe introducing a svnadmin command for such an operation would be
useful.
An "official" answer is needed in this issue.
I am awaiting your opinion on this matter.
All the best,
Robert.
On 1/17/07, Watson, Chris <cwatson@ptc.com> wrote:
>
> Hi,
>
> I'm not sure we have that much left of the original info we used - there
> is a file in the main subversion repository but I can't remember where it is
> exactly - I think you need to do some browsing under trunk.
>
> Sorry, I can't be more help - the tool works for us and if there is some
> differences in your repository then it will need extending to support that.
> The same dmp file here works for us - you might want to confirm it works for
> you on this first just to make sure it isn't some insane python issue.
>
> Chris
> ------------------------------
> *Sent:* 16 January 2007 15:07
> *To:* Watson, Chris
> *Subject:* RE: How to make projects with externals usable after the
> repository has been relocated?
>
>
> Chris,
>
> You can pass this along to him.
>
> Attached is a sample input file. I'm not 100% sure I respected the format
> of the dump file since this was reverse-engineered, but my approach was to
> replace the text and then adjust the number after the V up or down by the
> number of bytes I changed.
>
> Below is an excerpt from the script with some more explanation.
>
> Dan
>
>
> """
>
> cldmpReplace.py -- Replace old strings with new ones in SVN dump files
>
> This script performs string replacement within a Subversion (SVN) dump
> file. SVN dump files, which use the file extension "cldmp", have a
> specific
> format with certain constraints. For example there are imbedded byte
> totals
> that must be adjusted as content is changed.
>
> This script will only modify the contents of the "value" fields of the
> dump file (i.e. the portion between a line of the form "V <byte count>"
> and
> the line "PROPS-END"). Any occurances of the string to be replaced in
> other
> locations in the dump file outside of the value field will be ignored.
>
> Usage:
>
> cldmpReplace.py [options] <input file> <old string> <new string>
>
>
> Options:
>
> -h: Print this help message.
>
> -b: Make a backup copy of the input file.
>
> -v: Verbose mode
>
> -x: Overwrite input file. If you select this option, it is recommended
> that you also use the backup option -b. Without the -x option, an
> output file will be created that has the same name as the input file
> but with a tilde (~) at the end.
>
>
> Examples:
>
> cldmpReplace.py -h
>
> cldmpReplace.py -v file.cldmp oldstring newstring
>
> cldmpReplace.py -b -x -v file.cldmp oldstring newstring
>
>
> """
>
>
>
> ------------------------------
> *From:* Robert Ioiart [mailto:rioiart@gmail.com]
> *Sent:* 16 January 2007 12:22
> *To:* Watson, Chris
> *Subject:* Re: How to make projects with externals usable after the
> repository has been relocated?
>
>
> Do you think you could tell me about what you found out? I am considering
> debugging your script(give it to a friend who knows python :) ) or maybe
> writing a script of my own.
> You said that there are some elements that encode data length, where are
> those fileds? Could you exemplify with an example dump file?
>
> Thanks!
>
>
> On 1/16/07, Watson, Chris <cwatson@ptc.com> wrote:
> >
> > No idea we reverse engineered it
> >
> > Chris Watson
> > PTC Services Engineering
> >
> > -----Original Message-----
> > From: Robert Ioiart
> > To: Watson, Chris
> > Sent: Tue Jan 16 07:15:07 2007
> > Subject: Re: How to make projects with externals usable after the
> > repository has been relocated?
> >
> > where could I get some documentation about the format of the dump file ?
> >
> >
> >
> > On 1/16/07, Robert Ioiart <rioiart@gmail.com> wrote:
> >
> > at that line there is some binary data
> >
> >
> >
> > On 1/16/07, Watson, Chris < cwatson@ptc.com> wrote:
> >
> > What's at line 934776
> >
> > Chris
> >
> > ________________________________
> >
> > From: Robert Ioiart [mailto: rioiart@gmail.com]
> > Sent: 16 January 2007 11:21
> >
> > To: Watson, Chris
> > Subject: Re: How to make projects with externals usable
> > after the repository has been relocated?
> >
> >
> >
> > D:\repository porting>python
> > cldmpReplace.py -v dump
> > file:///\\tmav351x.tmav.ww011.siemens.net/did94044/IIP_CDS/Projects/PC_Tools/grADI/SVN_REPOSITORY
> > svn://tma0008s
> >
> > IGNORED: line 934776: Text to be replaced is outside of
> > property value.
> > IGNORED: line 936175: Text to be replaced is outside of
> > property value.
> > IGNORED: line 960081: Text to be replaced is outside of
> > property value.
> > Lines processed: 2858305
> > Duration: 0:00:51.723
> > Lines per second: 55261.8
> > Occurances ignored: 3
> > Occurances replaced: 0
> >
> >
> > On 1/16/07, Watson, Chris <cwatson@ptc.com> wrote:
> >
> > It could be - try turning on verbose mode (-v)
> > and see what it says.
> >
> > Chris
> >
> > ________________________________
> >
> > From: Robert Ioiart [mailto: rioiart@gmail.com]
> > Sent: 16 January 2007 09:54
> > To: Watson, Chris
> > Subject: Re: How to make projects with externals
> > usable after the repository has been relocated?
> >
> >
> > Ok,
> > I tried this time escaping the backslash
> > D:\repository porting>python cldmpReplace.py dump
> > file:///\\tmav351x.tmav.ww011.siemens.net/did94044/IIP_CDS/Projects/PC_Tools/grADI/SVN_REPOSITORY
> > svn://tma0008s
> >
> > Lines processed: 2858305
> > Duration: 0:00:48.727
> > Lines per second: 58659.6
> > Occurances ignored: 3
> > Occurances replaced: 0
> >
> > Why is the number of occurrences replaced 0?
> > there are tens of ocurrences of that string in the repo dump.
> >
> > Could it be that the string is too long. I looked
> > into the dump file and the string occurs but it spans multiple lines, maybe
> > this could be the reason why your script doesn't find the occurences.
> >
> > Thanks for your support,
> > Robert.
> >
> > On 1/16/07, Robert Ioiart < rioiart@gmail.com >
> > wrote:
> >
> > Hi I have a small issue with the script
> > you sent. I don't have any experience with python so I sent you the line
> > with which I called the script and what response I got.
> >
> > I suppose that it has something to do
> > with escaping characters. How should I have called the script in the example
> > bellow.
> >
> > D:\repository porting>python
> > cldmpReplace.py dump file:///tmav351x.tmav.ww011.siemens.net/did94044/IIP_CDS/Projects/PC_Tools/grADI/SVN_REPOSITORY
> > svn://tma0008s
> >
> > Traceback (most recent call last):
> > File " cldmpReplace.py", line 317, in
> > <module>
> > main()
> > File "cldmpReplace.py", line 110, in
> > main
> > linesOutput =
> > processSection(linesQueue, lineNum, stringOld, stringNew)
> > File " cldmpReplace.py", line 189, in
> > processSection
> > linesProps =
> > processPropLines(linesProps, lineNum, stringOld, stringNew)
> > File " cldmpReplace.py ", line 226, in
> > processPropLines
> > linesProps[valueByteCountLineIndex] =
> > "V " + "%s\n" % valueByteCountNew
> > UnboundLocalError: local variable
> > 'valueByteCountLineIndex' referenced before assignment
> >
> >
> >
> > Thanks in advance.
> >
> > Regards,
> > Robert.
> >
> >
> >
> >
> >
> >
> >
> >
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Jan 18 13:00:27 2007