RE: [viewvc-dev] [PATCH] Fix issue #519: "Stack trace while accessing a BDB repository if last commit deleted a file or directory"
vijayaguru guruchave <[email protected]> Tue, 29 Jan 2013 22:28:11 +0530
| Newsgroups | gmane.comp.version-control.cvs.viewcvs.devel |
|---|---|
| Message-ID | <00204DFF376536408E3A4C93718C03C2EF5848__44468.4671158486$1359478858$gmane$org@maa-exchmb.maa.corp.collab.net> |
------=_Part_3853_129173894.1359478837719 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Yes. This patch looks good. Thanks for backporting it to 1.1.18. There is a typo in r2827 log message. s/_get_changed_copyinfo/_get_change_copyinfo Thanks & Regards, Vijayaguru -----Original Message----- From: C. Michael Pilato [mailto:[email protected]] Sent: Tue 1/29/2013 8:27 PM To: Vijayaguru Guruchave Cc: [email protected] Subject: Re: [viewvc-dev] [PATCH] Fix issue #519: "Stack trace while access= ing a BDB repository if last commit deleted a file or directory" =20 On 01/29/2013 08:06 AM, vijayaguru guruchave wrote: > Hi, >=20 > This patch fixes issue #519:"Stack trace while accessing a BDB=20 > repository if last commit deleted a file or directory".[1] >=20 > The patch and log message are attached. >=20 > [1] http://viewvc.tigris.org/issues/show_bug.cgi?id=3D519 >=20 > Thanks & Regards, > Vijayaguru >=20 > P.S: I can't find an answer why we don't get any exception while=20 > accessing a FSFS repository of same directory structure. The FSFS repository doesn't exhibit the problem because FSFS sets the "copyfrom_known" flag on the 'change' structure (which means that svn_fs_copied_from() doesn't have to be called at all). Thanks for the patch, but I think the following would be a better one. Rather than fine-tuning the way we call _get_change_copyfrom() in this instance, I think it's better to just ensure that _get_change_copyfrom() is smarter about how it returns its answers. What do you think? Index: svn_repos.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- svn_repos.py=09(revision 2826) +++ svn_repos.py=09(working copy) @@ -644,11 +644,19 @@ return found_readable, found_unreadable, changedpaths.values() def _get_change_copyinfo(fsroot, path, change): + # If we know the copyfrom info, return it... if hasattr(change, 'copyfrom_known') and change.copyfrom_known: copyfrom_path =3D change.copyfrom_path copyfrom_rev =3D change.copyfrom_rev + # ...otherwise, if this change could be a copy, check the + # copyfrom info ... + elif (change.change_kind =3D=3D fs.path_change_add or + change.change_kind =3D=3D fs.path_change_replace): + copyfrom_rev, copyfrom_path =3D fs.copied_from(fsroot, path) + # ...else, there's no copyfrom info to return. else: - copyfrom_rev, copyfrom_path =3D fs.copied_from(fsroot, path) + copyfrom_rev =3D core.SVN_INVALID_REVNUM + copyfrom_path =3D None return copyfrom_path, copyfrom_rev def _simple_auth_check(fsroot): --=20 C. Michael Pilato <[email protected]> CollabNet <> www.collab.net <> Enterprise Cloud Development ------------------------------------------------------ http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=3D4251&dsMessageId=3D3= 046591 To unsubscribe from this discussion, e-mail: [[email protected]= .org]. ------=_Part_3853_129173894.1359478837719 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Diso-8859-= 1"> <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version 6.5.7653.38"= > <TITLE>RE: [viewvc-dev] [PATCH] Fix issue #519: "Stack trace while acc= essing a BDB repository if last commit deleted a file or directory"</T= ITLE> </HEAD> <BODY> <!-- Converted from text/plain format --> <P><FONT SIZE=3D2>Yes. This patch looks good. Thanks for backporting it to = 1.1.18.<BR> <BR> There is a typo in r2827 log message.<BR> s/_get_changed_copyinfo/_get_change_copyinfo<BR> <BR> Thanks & Regards,<BR> Vijayaguru<BR> <BR> <BR> <BR> -----Original Message-----<BR> From: C. Michael Pilato [<A HREF=3D"mailto:[email protected]">mailto:cmpi= [email protected]</A>]<BR> Sent: Tue 1/29/2013 8:27 PM<BR> To: Vijayaguru Guruchave<BR> Cc: [email protected]<BR> Subject: Re: [viewvc-dev] [PATCH] Fix issue #519: "Stack trace while a= ccessing a BDB repository if last commit deleted a file or directory"<= BR> <BR> On 01/29/2013 08:06 AM, vijayaguru guruchave wrote:<BR> > Hi,<BR> ><BR> > This patch fixes issue #519:"Stack trace while accessing a BDB<BR= > > repository if last commit deleted a file or directory".[1]<BR> ><BR> > The patch and log message are attached.<BR> ><BR> > [1] <A HREF=3D"http://viewvc.tigris.org/issues/show_bug.cgi?id=3D519">= http://viewvc.tigris.org/issues/show_bug.cgi?id=3D519</A><BR> ><BR> > Thanks & Regards,<BR> > Vijayaguru<BR> ><BR> > P.S: I can't find an answer why we don't get any exception while<BR> > accessing a FSFS repository of same directory structure.<BR> <BR> The FSFS repository doesn't exhibit the problem because FSFS sets the<BR> "copyfrom_known" flag on the 'change' structure (which means that= <BR> svn_fs_copied_from() doesn't have to be called at all).<BR> <BR> Thanks for the patch, but I think the following would be a better one.<BR> Rather than fine-tuning the way we call _get_change_copyfrom() in this<BR> instance, I think it's better to just ensure that _get_change_copyfrom() is= <BR> smarter about how it returns its answers. What do you think?<BR> <BR> Index: svn_repos.py<BR> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<BR> --- svn_repos.py (revision 2826)<= BR> +++ svn_repos.py (working copy)<B= R> @@ -644,11 +644,19 @@<BR> return found_readable, found_unreadabl= e, changedpaths.values()<BR> <BR> def _get_change_copyinfo(fsroot, path, change):<BR= > + # If we know the copyfrom info, return it..= .<BR> if hasattr(change, 'copyfrom_known') a= nd change.copyfrom_known:<BR> copyfrom_path =3D change.c= opyfrom_path<BR> copyfrom_rev =3D change.co= pyfrom_rev<BR> + # ...otherwise, if this change could be a c= opy, check the<BR> + # copyfrom info ...<BR> + elif (change.change_kind =3D=3D fs.path_cha= nge_add or<BR> + change.= change_kind =3D=3D fs.path_change_replace):<BR> + copyfrom_rev, copyfrom_path =3D= fs.copied_from(fsroot, path)<BR> + # ...else, there's no copyfrom info to retu= rn.<BR> else:<BR> - copyfrom_rev, copyfrom_path =3D= fs.copied_from(fsroot, path)<BR> + copyfrom_rev =3D core.SVN_INVAL= ID_REVNUM<BR> + copyfrom_path =3D None<BR> return copyfrom_path, copyfrom_rev<BR> <BR> def _simple_auth_check(fsroot):<BR> <BR> <BR> --<BR> C. Michael Pilato <[email protected]><BR> CollabNet <> www.collab.net <&= gt; Enterprise Cloud Development<BR> <BR> <BR> </FONT> </P> </BODY> </HTML> ------=_Part_3853_129173894.1359478837719--