##// END OF EJS Templates
patch: fix patch hunk/metdata synchronization (issue3384)...
patch: fix patch hunk/metdata synchronization (issue3384) Git patches are parsed in two phases: 1) extract metadata, 2) parse actual deltas and merge them with the previous metadata. We do this to avoid dependency issues like "modify a; copy a to b", where "b" must be copied from the unmodified "a". Issue3384 is caused by flaky code I wrote to synchronize the patch metadata with the emitted hunk: if (gitpatches and (gitpatches[-1][0] == afile or gitpatches[-1][1] == bfile)): gp = gitpatches.pop()[2] With a patch like: diff --git a/a b/c copy from a copy to c --- a/a +++ b/c @@ -1,1 +1,2 @@ a +a @@ -2,1 +2,2 @@ a +a diff --git a/a b/a --- a/a +++ b/a @@ -1,1 +1,2 @@ a +b the first hunk of the first block is matched with the metadata for the block "diff --git a/a b/c", then the second hunk of the first block is matched with the metadata of the second block "diff --git a/a b/a", because of the "or" in the code paste above. Turning the "or" into an "and" is not enough as we have to deal with /dev/null cases for each file. We I remove this broken piece of code: # copy/rename + modify should modify target, not source if gp.op in ('COPY', 'DELETE', 'RENAME', 'ADD') or gp.mode: afile = bfile because "afile = bfile" set "afile" to stuff like "b/file" instead of "a/file", and because this only happens for git patches, which afile/bfile are ignored anyway by applydiff(). v2: - Avoid a traceback on git metadata desynchronization

File last commit:

r14913:44382887 default
r16506:fc4e0fec stable
Show More
error.tmpl
45 lines | 1.1 KiB | application/x-cheetah | CheetahLexer
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 {header}
<title>{repo|escape}: error</title>
</head>
<body>
<div class="container">
<div class="menu">
<div class="logo">
Steven Stallion
hgweb: support alternate logo url...
r13964 <a href="{logourl}">
Angel Ezquerra
hgweb: add a "web/logoimg" setting to customize the web logo image...
r14913 <img src="{staticurl}{logoimg}" width=75 height=90 border=0 alt="mercurial" /></a>
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 </div>
<ul>
<li><a href="{url}shortlog{sessionvars%urlparameter}">log</a></li>
<li><a href="{url}graph{sessionvars%urlparameter}">graph</a></li>
<li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
Alexander Solovyov
hgweb: add separate page with bookmarks listing
r13597 <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
Augie Fackler
hgweb: add help link to templates missed in ead4e21f49f1
r12680 <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
Dan Villiom Podlaski Christiansen
setup: install translation files as package data...
r9999 </ul>
</div>
<div class="main">
<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
<h3>error</h3>
<form class="search" action="{url}log">
{sessionvars%hiddenformentry}
<p><input name="rev" id="search1" type="text" size="30"></p>
<div id="hint">find changesets by author, revision,
files, or words in the commit message</div>
</form>
<div class="description">
<p>
An error occurred while processing your request:
</p>
<p>
{error|escape}
</p>
</div>
</div>
</div>
{footer}