Patchwork [V2] (proper intended comment) Makefile: intermediate steps work with temporary copy of hg.pot

login
register
mail settings
Submitter Simon Heimberg
Date Nov. 5, 2013, 9:29 a.m.
Message ID <3d8f013071ebf4e134cf.1383643744@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/2860/
State Superseded
Commit c845b1a95eed0d9545a33c04693f47a838412ac9
Headers show

Comments

Simon Heimberg - Nov. 5, 2013, 9:29 a.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1383641006 -3600
#      Tue Nov 05 09:43:26 2013 +0100
# Branch stable
# Node ID 3d8f013071ebf4e134cf1dec71d6a7a5d4fa1397
# Parent  2e096bfe9691bc594c925e19bf4f0c5d195b79dc
Makefile: intermediate steps work with temporary copy of hg.pot

In case of abortion or a failing step, the target file remains untouched
instead of being in an intermediate state.
Greg Ward - Nov. 7, 2013, 2:35 p.m.
On 05 November 2013, Simon Heimberg said:
> # HG changeset patch
> # User Simon Heimberg <simohe@besonet.ch>
> # Date 1383641006 -3600
> #      Tue Nov 05 09:43:26 2013 +0100
> # Branch stable
> # Node ID 3d8f013071ebf4e134cf1dec71d6a7a5d4fa1397
> # Parent  2e096bfe9691bc594c925e19bf4f0c5d195b79dc
> Makefile: intermediate steps work with temporary copy of hg.pot

Sounds like a straightforward bug fix: should that have been flagged
STABLE?

       Greg
Matt Mackall - Nov. 22, 2013, 9:27 p.m.
On Tue, 2013-11-05 at 10:29 +0100, Simon Heimberg wrote:
> # HG changeset patch
> # User Simon Heimberg <simohe@besonet.ch>
> # Date 1383641006 -3600
> #      Tue Nov 05 09:43:26 2013 +0100
> # Branch stable
> # Node ID 3d8f013071ebf4e134cf1dec71d6a7a5d4fa1397
> # Parent  2e096bfe9691bc594c925e19bf4f0c5d195b79dc
> Makefile: intermediate steps work with temporary copy of hg.pot

Queued for default, thanks. (Not on stable because the .tmp ignore rule
is on default)

Patch

diff -r 2e096bfe9691 -r 3d8f013071eb Makefile
--- a/Makefile	Tue Nov 05 09:00:31 2013 +0100
+++ b/Makefile	Tue Nov 05 09:43:26 2013 +0100
@@ -107,7 +107,7 @@ 
 	  mercurial/fileset.py mercurial/revset.py \
 	  mercurial/templatefilters.py mercurial/templatekw.py \
 	  mercurial/filemerge.py \
-	  $(DOCFILES) > i18n/hg.pot
+	  $(DOCFILES) > i18n/hg.pot~
         # All strings marked for translation in Mercurial contain
         # ASCII characters only. But some files contain string
         # literals like this '\037\213'. xgettext thinks it has to
@@ -119,8 +119,11 @@ 
 	  --msgid-bugs-address "<mercurial-devel@selenic.com>" \
 	  --copyright-holder "Matt Mackall <mpm@selenic.com> and others" \
 	  --from-code ISO-8859-1 --join --sort-by-file --add-comments=i18n: \
-	  -d hg -p i18n -o hg.pot
-	$(PYTHON) i18n/posplit i18n/hg.pot
+	  -d hg -p i18n -o hg.pot~
+	$(PYTHON) i18n/posplit i18n/hg.pot~
+        # The target file is not created before the last step. So it never is in
+        # an intermediate state.
+	mv -f i18n/hg.pot~ i18n/hg.pot
 
 %.po: i18n/hg.pot
 	msgmerge --no-location --update $@ $^