Repository: translate/pootle

Issue:
Deprecate update/sync stores
Wondering what is best with these commands.

on the one hand they are quite useful for grouping common operations

on the other, it would be better for users to learn the more powerful fs api, and grouping can be done in other ways




Discussion:
My thoughts @phlax are these:

1. We certainly need to keep them around to allow transition, even just so that scripts work and results are mostly as expected.
2. I do find myself doing, `fetch`, `resolve`, `sync`, so yes a grouping command like `update_stores` would simplify things.
3. One option would be `update_stores` does `fs-win`, and `sync_stores` does `ptl-wins`, with needed `add`'s and `rm`'s thrown in.  But while that achieves the nice grouping it overloads what people think.
4. If we want to group maybe `pootle fs update` and `pootle fs download` (sync's taken) could be the cluster equivalents?

Resolving patch:
diff --git a/pootle/apps/pootle_app/management/commands/sync_stores.py b/pootle/apps/pootle_app/management/commands/sync_stores.py
--- a/pootle/apps/pootle_app/management/commands/sync_stores.py
+++ b/pootle/apps/pootle_app/management/commands/sync_stores.py
@@ -28,9 +28,7 @@ def add_arguments(self, parser):
             action='store_true',
             dest='overwrite',
             default=False,
-            help="Don't just save translations, but "
-                 "overwrite files to reflect state in database",
-        )
+            help="This option has been removed.")
         parser.add_argument(
             '--skip-missing',
             action='store_true',
@@ -43,11 +41,21 @@ def add_arguments(self, parser):
             action='store_true',
             dest='force',
             default=False,
-            help="Don't ignore stores synced after last change",
-        )
+            help="This option has been removed.")
 
     warn_on_conflict = []
 
+    def handle(self, **options):
+        logger.warn(
+            "The sync_stores command is deprecated, use pootle fs instead")
+        if options["force"]:
+            logger.warn(
+                "The force option no longer has any affect on this command")
+        if options["overwrite"]:
+            logger.warn(
+                "The overwrite option no longer has any affect on this command")
+        super(Command, self).handle(**options)
+
     def handle_all_stores(self, translation_project, **options):
         path_glob = "%s*" % translation_project.pootle_path
         plugin = FSPlugin(translation_project.project)
@@ -64,12 +72,4 @@ def handle_all_stores(self, translation_project, **options):
                     translation_project.project.pk)
         if not options["skip_missing"]:
             plugin.add(pootle_path=path_glob, update="fs")
-        if options["overwrite"]:
-            plugin.resolve(
-                pootle_path=path_glob,
-                pootle_wins=True)
         plugin.sync(pootle_path=path_glob, update="fs")
-        if options["force"]:
-            # touch the timestamps on disk for files that
-            # werent updated
-            pass
diff --git a/pootle/apps/pootle_app/management/commands/update_stores.py b/pootle/apps/pootle_app/management/commands/update_stores.py
--- a/pootle/apps/pootle_app/management/commands/update_stores.py
+++ b/pootle/apps/pootle_app/management/commands/update_stores.py
@@ -40,9 +40,7 @@ def add_arguments(self, parser):
             action='store_true',
             dest='force',
             default=False,
-            help="Unconditionally process all files (even if they "
-                 "appear unchanged).",
-        )
+            help="This option has been removed.")
 
     def handle_translation_project(self, translation_project, **options):
         """
@@ -51,7 +49,9 @@ def handle_translation_project(self, translation_project, **options):
         plugin = FSPlugin(translation_project.project)
         plugin.add(pootle_path=path_glob, update="pootle")
         plugin.rm(pootle_path=path_glob, update="pootle")
-        plugin.resolve(pootle_path=path_glob)
+        plugin.resolve(
+            pootle_path=path_glob,
+            merge=not options["overwrite"])
         plugin.sync(pootle_path=path_glob, update="pootle")
 
     def _parse_tps_to_create(self, project):
@@ -79,6 +79,11 @@ def _create_tps_for_project(self, project):
                 project=project)
 
     def handle_all(self, **options):
+        logger.warn(
+            "The update_stores command is deprecated, use pootle fs instead")
+        if options["force"]:
+            logger.warn(
+                "The force option no longer has any affect on this command")
         projects = (
             Project.objects.filter(code__in=self.projects)
             if self.projects


Test patch:
diff --git a/tests/commands/sync_stores.py b/tests/commands/sync_stores.py
--- a/tests/commands/sync_stores.py
+++ b/tests/commands/sync_stores.py
@@ -27,7 +27,6 @@ def test_sync_stores_noargs(capfd, tmpdir):
     out, err = capfd.readouterr()
     # FIXME we should work out how to get something here
     assert out == ''
-    assert err == ''
 
 
 @pytest.mark.cmd