Return-Path: X-Original-To: apmail-subversion-dev-archive@minotaur.apache.org Delivered-To: apmail-subversion-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C84801895C for ; Thu, 3 Mar 2016 21:35:35 +0000 (UTC) Received: (qmail 40683 invoked by uid 500); 3 Mar 2016 21:35:35 -0000 Delivered-To: apmail-subversion-dev-archive@subversion.apache.org Received: (qmail 40629 invoked by uid 500); 3 Mar 2016 21:35:35 -0000 Mailing-List: contact dev-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@subversion.apache.org Received: (qmail 40619 invoked by uid 99); 3 Mar 2016 21:35:35 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2016 21:35:35 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id EC6151A136D for ; Thu, 3 Mar 2016 21:35:34 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.448 X-Spam-Level: * X-Spam-Status: No, score=1.448 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id P_hWmnTUhaSC for ; Thu, 3 Mar 2016 21:35:33 +0000 (UTC) Received: from mail-vk0-f44.google.com (mail-vk0-f44.google.com [209.85.213.44]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id A74365F56F for ; Thu, 3 Mar 2016 21:35:32 +0000 (UTC) Received: by mail-vk0-f44.google.com with SMTP id c3so35479614vkb.3 for ; Thu, 03 Mar 2016 13:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=PjWml9Pykx/t5a22QDMK5KyhFaiaxRs0jsBzs9ALW08=; b=w/QlXrSyZN/uhbs3NUJj4PTuYKdL4pdsauIBmRrSOg3iLEt9fqxaHXEM7pQekkHS6X I7bCvoMqlau17y/xX1NDLWhYsOr4MxJri6cPWIOVhsaYUziaYiH5O1VjoQEMl3OCapbQ ep8iTe9LN2axgzPV3F6l1l/3gFxPk/0wTE7a5GYLSWDOCg2rdcORzw7fkht6iFZNz6Ia 0NDa5LNyJ/k5tdRVZyV8f6WaZ4eS5RShSJbCkk0JlExUcpv6DebgezA5hNFyCpUzuF9y AF2ATP6QoEiOIlzK76uzPmt13q3WBWUziDewkASDRcdYSAU54va1uTHkT2KEmopgHqPQ +chQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=PjWml9Pykx/t5a22QDMK5KyhFaiaxRs0jsBzs9ALW08=; b=Z30F/do2xE9eTeaugnMJDzSGOTcBt73gODG8h+WE9wxi/MY8M2xo/MjfXAYgfc4ad9 Aq3TFhtMjAJJiEF77Sqw4GOeXVcTCUbBJiXofwMKbPVWMaXgzw0TgdvQW/EWylsk7kgK SMUnJSpqplfJ74smv6QQPbNnnzoZYqyiu662wgPkeHIEgaq76uZOwN9W0aVDDSIOCzZN xqPnqhS7cf5WNzYdoxwPYDAV492h7ZVk76SBAbqEeJqeBbjQ3fx2gqDNTvJtBJluCahr qHG7DlfV59USlmGN8RyaNNIaJGT/KfUrbQ9wDlBcccRjWFumuaZja5cVLoX+QorMm0oo RNYg== X-Gm-Message-State: AD7BkJJpjfs3P4U2QS9/Ag2G/v1CvU0APCKk2U71QbVJnialJKmbljbx3FcOX3/pRWYpm7WlbjzANkDQP1JdaA== MIME-Version: 1.0 X-Received: by 10.31.8.142 with SMTP id 136mr3855201vki.14.1457040932064; Thu, 03 Mar 2016 13:35:32 -0800 (PST) Received: by 10.31.65.131 with HTTP; Thu, 3 Mar 2016 13:35:31 -0800 (PST) In-Reply-To: References: <56D72BE5.7040203@apache.org> <01db01d174b7$cca5cc30$65f16490$@qqmail.nl> <028401d1752a$3055f170$9101d450$@qqmail.nl> <20160303141159.GB26128@zira.vinc17.org> Date: Thu, 3 Mar 2016 15:35:31 -0600 Message-ID: Subject: Re: Incomplete xml output when using --xml to non-existent server From: Naga Saketh Jaligama To: Johan Corveleyn Cc: Subversion Development Content-Type: multipart/alternative; boundary=001a114577882dd482052d2bc72b --001a114577882dd482052d2bc72b Content-Type: text/plain; charset=UTF-8 Hi All, ---------------- In my company, developers may use tortoise svn or eclipse svn or any svn client, so no matter what they use i want to enforce them to give some commit messages and jira id in it. so, i used the below pre-commit shell script in the svn server in hooks folder and tested with tortoise, it doesn't work. Can someone help me? REPOS="$1" TXN="$2" SVNLOOK=/usr/bin/svnlook CURL=/usr/bin/curl JIRAURL=http://our.jira.url:8080/rest/api/latest/issue # Make sure that the log message contains some text. LOGMSG=$($SVNLOOK log -t "$TXN" "$REPOS") echo ${LOGMSG} | grep "[a-zA-Z0-9]" > /dev/null || exit 1 check that log message starts with a JIRA ticket should have format 'FOO-123: my commit message' or 'FOO-123 my commit message' JIRAID=$(expr "${LOGMSG}" : '^\([A-Z]*-[0-9]*\)[: ].*') if [[ "$JIRAID" == "" ]] then echo "No JIRA id found in log message \"${LOGMSG}\"" >&2 echo "Please use log message of the form \"JIRA-ID: My message\"" >&2 exit 1 fi JIRAISSUE=$(${CURL} ${JIRAURL}/${JIRAID}) if [[ "${JIRAISSUE}" =~ "Issue Does Not Exist" ]] then echo "The JIRA id ${JIRAID} was not found" >&2 echo "Please use log message of the form \"JIRA-ID: My message\"" >&2 exit 1 fi ---------------- On Thu, Mar 3, 2016 at 8:42 AM, Johan Corveleyn wrote: > On Thu, Mar 3, 2016 at 3:11 PM, Vincent Lefevre > wrote: > > On 2016-03-03 10:31:52 +0100, Johan Corveleyn wrote: > >> No, of course not :-). I just gave an example where the output was > >> broken (host not found), as opposed to another error condition (server > >> reponds "URL 'X' non-existent in revision Y") where the xml response > >> is still valid. Ignoring implementation (which I always do when I'm > >> arguing about behavior), this seems quite weird to me. > > > > No, this is different. In the former case, this is a server or > > communication problem: it is not possible to output the info > > because it is not possible to know what it is. In the latter case, > > the communication is successful, so that it is possible to output > > the info. > > Agreed, it's different. But it's still weird / inconsistent IMO. > > As I said, I don't know anything about the implementation of --xml, > but it seems to me that svn could easily complete the output by > closing the root element with "". Apparently *something* goes > wrong executing the info request ... let's just cleanup nicely. > > Another example, no server communication needed: > > [[[ > C:\>svn info --xml . > > > svn: E155007: 'C:\' is not a working copy > > ]]] > > > But, go inside a working copy, and use a non-existing path: > > [[[ > C:\WorkingCopy>svn info --xml blah > > > svn: warning: W155010: The node 'C:\WorkingCopy\blah' was not found. > > > svn: E200009: Could not display info for all targets because some > targets don't exist > > ]]] > > > Why in one case and not in the other? As a user, I see no > reason for that. > > -- > Johan > --001a114577882dd482052d2bc72b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi All,


----------------=

In my company, developers may = use tortoise svn or eclipse svn or any svn client, so no matter what they u= se i want to enforce them to give some commit messages and jira id in it. s= o, i used the below pre-commit shell script in the svn server in hooks fold= er and tested with tortoise, it doesn't work. Can someone help me?

<= pre style=3D"margin-top:0px;padding:5px;border:0px;font-size:13px;overflow:= auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Luc= ida Console','Liberation Mono','DejaVu Sans Mono','= Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;wo= rd-wrap:normal;color:rgb(34,36,38);background-color:rgb(238,238,238)">REPOS=3D"$1" TXN=3D"$2" SVNLOOK=3D/usr/bin/svnlook CURL=3D/usr/bin/curl JIRAURL=3Dhttp:/= /our.jira.url:8080/rest/api/latest/issue # Make sure that the log message contains some text. LOGMSG=3D$($SVNLOOK log -t "$TXN" "$REPOS") echo ${LOGMSG} | grep "[a-zA-Z0-9]" > /dev/null || exit 1 check that log message starts with a JIRA ticket should have format 'FOO-123: my commit message' or 'FOO-123 my = commit message' JIRAID=3D$(expr "${LOGMSG}" : '^\([A-Z]*-[0-9]*\)[: ].*') if [[ "$JIRAID" =3D=3D "" ]] then echo "No JIRA id found in log message \"${LOGMSG}\"" &g= t;&2 echo "Please use log message of the form \"JIRA-ID: My message\&q= uot;" >&2 exit 1 fi JIRAISSUE=3D$(${CURL} ${JIRAURL}/${JIRAID}) if [[ "${JIRAISSUE}" =3D~ "Issue Does Not Exist" ]] then echo "The JIRA id ${JIRAID} was not found" >&2 echo "Please use log message of the form \"JIRA-ID: My message\&q= uot;" >&2 exit 1 fi
----------------
=





=




On Thu, Mar 3, 2016 at 8:42 AM, Joh= an Corveleyn <jcorvel@gmail.com> wrote:
On Thu, Mar 3, 2016 at 3:11 PM, Vincent Lefe= vre <vincent-svn@vinc17.net> wrote:
> On 2016-03-03 10:31:52 +0100, Johan Corveleyn wrote:
>> No, of course not :-). I just gave an example where the output was=
>> broken (host not found), as opposed to another error condition (se= rver
>> reponds "URL 'X' non-existent in revision Y") wh= ere the xml response
>> is still valid. Ignoring implementation (which I always do when I&= #39;m
>> arguing about behavior), this seems quite weird to me.
>
> No, this is different. In the former case, this is a server or
> communication problem: it is not possible to output the info
> because it is not possible to know what it is. In the latter case,
> the communication is successful, so that it is possible to output
> the info.

Agreed, it's different. But it's still weird / inconsistent = IMO.

As I said, I don't know anything about the implementation of --xml,
but it seems to me that svn could easily complete the output by
closing the root element with "</info>". Apparently *someth= ing* goes
wrong executing the info request ... let's just cleanup nicely.

Another example, no server communication needed:

[[[
C:\>svn info --xml .
<?xml version=3D"1.0" encoding=3D"UTF-8&= quot;?>
<info>
svn: E155007: 'C:\' is not a working copy

]]]


But, go inside a working copy, and use a non-existing path:

[[[
C:\WorkingCopy>svn info --xml blah
<?xml version=3D"1.0" encoding=3D"UTF-8&= quot;?>
<info>
svn: warning: W155010: The node 'C:\WorkingCopy\blah' was no= t found.

</info>
svn: E200009: Could not display info for all targets because some
targets don't exist

]]]


Why </info> in one case and not in the other? As a user, I see no
reason for that.

--
Johan

--001a114577882dd482052d2bc72b--