Patchwork [1,of,3] templater: ignore orig/rej files

login
register
mail settings
Submitter timeless@mozdev.org
Date March 8, 2016, 7:44 p.m.
Message ID <94616d85ab4517fe0642.1457466266@waste.org>
Download mbox | patch
Permalink /patch/13687/
State Accepted
Headers show

Comments

timeless@mozdev.org - March 8, 2016, 7:44 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1456896427 0
#      Wed Mar 02 05:27:07 2016 +0000
# Node ID 94616d85ab4517fe06424dc1760844de0f4a664e
# Parent  9974b8236cac50945d7b529e7c4fae9cf4974443
templater: ignore orig/rej files
Pierre-Yves David - March 8, 2016, 8:29 p.m.
On 03/08/2016 07:44 PM, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1456896427 0
> #      Wed Mar 02 05:27:07 2016 +0000
> # Node ID 94616d85ab4517fe06424dc1760844de0f4a664e
> # Parent  9974b8236cac50945d7b529e7c4fae9cf4974443
> templater: ignore orig/rej files

Can you elaborate about what this is about?

>
> diff --git a/mercurial/templater.py b/mercurial/templater.py
> --- a/mercurial/templater.py
> +++ b/mercurial/templater.py
> @@ -853,6 +853,8 @@
>       stylelist = []
>       for file in dirlist:
>           split = file.split(".")
> +        if split[-1] in ('orig', 'rej'):
> +            continue
>           if split[0] == "map-cmdline":
>               stylelist.append(split[1])
>       return ", ".join(sorted(stylelist))
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
timeless - March 8, 2016, 8:37 p.m.
Pierre-Yves David wrote:
>>
>> templater: ignore orig/rej files
>
>
> Can you elaborate about what this is about?

"If your mercurial/templates/ directory is dirty, then the template
system would otherwise import duplicate templates from the .orig files
and potentially try to parse .rej files.

Since editing/reverting these templates isn't an unexpected action,
and since they're in .hgignore, it's best that the template system
know to skip them."
Pierre-Yves David - March 9, 2016, 5:36 p.m.
On 03/08/2016 08:37 PM, timeless wrote:
> If your mercurial/templates/ directory is dirty, then the template
> system would otherwise import duplicate templates from the .orig files
> and potentially try to parse .rej files.
>
> Since editing/reverting these templates isn't an unexpected action,
> and since they're in .hgignore, it's best that the template system
> know to skip them."

Patch 1 is on the clowncopter with this extra text, thanks.

Patch

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -853,6 +853,8 @@ 
     stylelist = []
     for file in dirlist:
         split = file.split(".")
+        if split[-1] in ('orig', 'rej'):
+            continue
         if split[0] == "map-cmdline":
             stylelist.append(split[1])
     return ", ".join(sorted(stylelist))