<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>165440</bug_id>
          
          <creation_ts>2016-12-05 17:05:08 -0800</creation_ts>
          <short_desc>ChangeLogs become readonly after resolving a conflict</short_desc>
          <delta_ts>2016-12-12 10:18:39 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexey Proskuryakov">ap</reporter>
          <assigned_to name="Alexey Proskuryakov">ap</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>dbates</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>lforschler</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1256613</commentid>
    <comment_count>0</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2016-12-05 17:05:08 -0800</bug_when>
    <thetext>When update-webkit or resolve-ChangeLogs resolves a conflict in a ChangeLog, the file becomes read-only.

This looks like a change between svn 1.5 and svn 1.7 - &quot;older&quot; and &quot;newer&quot; files that are created on conflict are read-only, and one of these becomes the resolved file.

&lt;rdar://problem/29491002&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1256616</commentid>
    <comment_count>1</comment_count>
      <attachid>296224</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2016-12-05 17:10:34 -0800</bug_when>
    <thetext>Created attachment 296224
naive fix

It seems good enough to just use 0644 - I don&apos;t think that we need to preserve other bits here.

I&apos;m somewhat confused about how merging works on a read-only file up to this point, but it does. Perhaps the patch tool doesn&apos;t care about permissions when they can be automagically adjusted while patching?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1256696</commentid>
    <comment_count>2</comment_count>
      <attachid>296224</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2016-12-05 20:15:43 -0800</bug_when>
    <thetext>Comment on attachment 296224
naive fix

View in context: https://bugs.webkit.org/attachment.cgi?id=296224&amp;action=review

&gt; Tools/Scripts/resolve-ChangeLogs:451
&gt; +            chmod 0644, $fileNewer;

This won&apos;t work well when applying a patch to a script that has execute (+x) permissions.

Does Perl have a way to say, &quot;chmod a+w&quot; instead?

Or does svn has a command-line switch to restore its previous behavior?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1256717</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2016-12-05 20:53:09 -0800</bug_when>
    <thetext>As this is resolve-ChangeLogs scripts, I assume that it won&apos;t be used to resolve conflicts in scripts. I didn&apos;t find such a switch for svn (nor any discussion of why the change was made).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1258947</commentid>
    <comment_count>4</comment_count>
      <attachid>296224</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2016-12-11 18:40:50 -0800</bug_when>
    <thetext>Comment on attachment 296224
naive fix

View in context: https://bugs.webkit.org/attachment.cgi?id=296224&amp;action=review

I guess this is OK. I have suggestions though.

&gt;&gt; Tools/Scripts/resolve-ChangeLogs:451
&gt;&gt; +            chmod 0644, $fileNewer;
&gt; 
&gt; This won&apos;t work well when applying a patch to a script that has execute (+x) permissions.
&gt; 
&gt; Does Perl have a way to say, &quot;chmod a+w&quot; instead?
&gt; 
&gt; Or does svn has a command-line switch to restore its previous behavior?

I looked on the web a bit and I think this is a better version:

    chmod ((stat($file))[2] &amp; 0777), $fileNewer;

It tries to transfer the permissions the old file had, not including exotic permissions like setuid.

Another way to do it is to simple read $fileNewer and overwrite the contents of $file and then unlink $fileNewer instead of $file. That code would not be hard to write.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1259102</commentid>
    <comment_count>5</comment_count>
      <attachid>296224</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-12-12 10:18:35 -0800</bug_when>
    <thetext>Comment on attachment 296224
naive fix

Clearing flags on attachment: 296224

Committed r209714: &lt;http://trac.webkit.org/changeset/209714&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1259103</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-12-12 10:18:39 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>296224</attachid>
            <date>2016-12-05 17:10:34 -0800</date>
            <delta_ts>2016-12-12 10:18:35 -0800</delta_ts>
            <desc>naive fix</desc>
            <filename>ReadOnly.txt</filename>
            <type>text/plain</type>
            <size>1126</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">SW5kZXg6IFRvb2xzL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBUb29scy9DaGFuZ2VMb2cJKHJl
dmlzaW9uIDIwOTM2OCkKKysrIFRvb2xzL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwz
ICsxLDE0IEBACisyMDE2LTEyLTA1ICBBbGV4ZXkgUHJvc2t1cnlha292ICA8YXBAYXBwbGUuY29t
PgorCisgICAgICAgIENoYW5nZUxvZ3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TsKICAgICAgICAgICAgIHJlbmFt
ZSgkZmlsZU5ld2VyLCAkZmlsZSkgb3IgZGllICQhOwogICAgICAgICB9Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>