Repository: mozilla/puente

Issue:
Add option to not create merge backup
According to https://www.gnu.org/software/gettext/manual/html_node/msgmerge-Invocation.html that should be `--backup=off` to the `msgmerge` tool.

Discussion:

Patch:
diff --git a/puente/commands.py b/puente/commands.py
index a36d035..c21cdd3 100644
--- a/puente/commands.py
+++ b/puente/commands.py
@@ -129,10 +129,11 @@ def extract_command(outputdir, domain_methods, text_domain, keywords,
     print('Done')
 
 
-def merge_command(create, base_dir, domain_methods, languages):
+def merge_command(create, backup, base_dir, domain_methods, languages):
     """
     :arg create: whether or not to create directories if they don't
         exist
+    :arg backup: whether or not to create backup .po files
     :arg base_dir: BASE_DIR setting
     :arg domain_methods: DOMAIN_METHODS setting
     :arg languages: LANGUAGES setting
@@ -213,6 +214,7 @@ def merge_command(create, base_dir, domain_methods, languages):
                 'msgmerge',
                 '--update',
                 '--width=200',
+                '--backup=%s' % ('simple' if backup else 'off'),
                 domain_po,
                 '-'
             ]
diff --git a/puente/management/commands/merge.py b/puente/management/commands/merge.py
index 74de7d9..acf9b26 100644
--- a/puente/management/commands/merge.py
+++ b/puente/management/commands/merge.py
@@ -32,11 +32,17 @@ class Command(BaseCommand):
             action='store_true', dest='create', default=False,
             help='Create locale subdirectories'
         ),
+        make_option(
+            '-b', '--backup',
+            action='store_true', dest='backup', default=False,
+            help='Create backup files of .po files'
+        ),
     )
 
     def handle(self, *args, **options):
         return merge_command(
             create=options.get('create'),
+            backup=options.get('backup'),
             base_dir=get_setting('BASE_DIR'),
             domain_methods=get_setting('DOMAIN_METHODS'),
             languages=getattr(settings, 'LANGUAGES', [])


Test patch:
diff --git a/tests/test_merge.py b/tests/test_merge.py
index 29e1456..60b46f1 100644
--- a/tests/test_merge.py
+++ b/tests/test_merge.py
@@ -65,6 +65,7 @@ class TestMergecommand:
 
         merge_command(
             create=True,
+            backup=True,
             base_dir=str(tmpdir),
             domain_methods={
                 'django': [
@@ -83,6 +84,7 @@ class TestMergecommand:
         with pytest.raises(CommandError):
             merge_command(
                 create=True,
+                backup=True,
                 base_dir=str(tmpdir),
                 domain_methods={
                     'django': [