prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  nikola auto not working 
  I'm a newb so suspect user error, but I installed nikola v6.3.0 (pip install nikola) and have not been able to get **nikola auto** to work.
  
  Initially I was getting errors due to a more recent version of livereload (which, isn't this marked as fixed?) and resolved by forcing livereload=2.0.0. 
  
  The next problem is that the site appears not to rebuild when I save edits to a post. I have not RTFM yet (as instructed :) but when I do:
    nikola auto -b 
  
  I should be able to edit a post file (e.g. 1.rst) and on save, see the changes immediately, correct? What I see in the server log output and in Chrome dev tools shows that the browser is re-requesting a bunch of files, but I have to manually do **nikola build** to get the site to rebuild. 
  
  I'm using OS X 10.9.1, Python 2.7. Let me know if I can provide any other info; if I get it worked out I'll update the issue. 
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `nikola/plugins/command/auto.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 
  3 # Copyright © 2012-2014 Roberto Alsina and others.
  4 
  5 # Permission is hereby granted, free of charge, to any
  6 # person obtaining a copy of this software and associated
  7 # documentation files (the "Software"), to deal in the
  8 # Software without restriction, including without limitation
  9 # the rights to use, copy, modify, merge, publish,
  10 # distribute, sublicense, and/or sell copies of the
  11 # Software, and to permit persons to whom the Software is
  12 # furnished to do so, subject to the following conditions:
  13 #
  14 # The above copyright notice and this permission notice
  15 # shall be included in all copies or substantial portions of
  16 # the Software.
  17 #
  18 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
  19 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  20 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  21 # PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
  22 # OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  23 # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  24 # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  25 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  26 
  27 from __future__ import print_function, unicode_literals
  28 
  29 import os
  30 import subprocess
  31 import webbrowser
  32 
  33 from nikola.plugin_categories import Command
  34 from nikola.utils import req_missing
  35 
  36 
  37 class CommandAuto(Command):
  38     """Start debugging console."""
  39     name = "auto"
  40     doc_purpose = "automatically detect site changes, rebuild and optionally refresh a browser"
  41     cmd_options = [
  42         {
  43             'name': 'browser',
  44             'short': 'b',
  45             'type': bool,
  46             'help': 'Start a web browser.',
  47             'default': False,
  48         },
  49         {
  50             'name': 'port',
  51             'short': 'p',
  52             'long': 'port',
  53             'default': 8000,
  54             'type': int,
  55             'help': 'Port nummber (default: 8000)',
  56         },
  57     ]
  58 
  59     def _execute(self, options, args):
  60         """Start the watcher."""
  61         try:
  62             from livereload import Server
  63         except ImportError:
  64             req_missing(['livereload>=2.0.0'], 'use the "auto" command')
  65             return
  66 
  67         # Run an initial build so we are uptodate
  68         subprocess.call(("nikola", "build"))
  69 
  70         port = options and options.get('port')
  71 
  72         server = Server()
  73         server.watch('conf.py')
  74         server.watch('themes/')
  75         server.watch('templates/')
  76         server.watch(self.site.config['GALLERY_PATH'])
  77         for item in self.site.config['post_pages']:
  78             server.watch(os.path.dirname(item[0]))
  79         for item in self.site.config['FILES_FOLDERS']:
  80             server.watch(os.path.dirname(item))
  81 
  82         out_folder = self.site.config['OUTPUT_FOLDER']
  83         if options and options.get('browser'):
  84             webbrowser.open('http://localhost:{0}'.format(port))
  85 
  86         server.serve(port, None, out_folder)
  87
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/nikola/plugins/command/auto.py b/nikola/plugins/command/auto.py
  --- a/nikola/plugins/command/auto.py
  +++ b/nikola/plugins/command/auto.py
  @@ -64,20 +64,20 @@
               req_missing(['livereload>=2.0.0'], 'use the "auto" command')
               return
   
  -        # Run an initial build so we are uptodate
  +        # Run an initial build so we are up-to-date
           subprocess.call(("nikola", "build"))
   
           port = options and options.get('port')
   
           server = Server()
  -        server.watch('conf.py')
  -        server.watch('themes/')
  -        server.watch('templates/')
  +        server.watch('conf.py', 'nikola build')
  +        server.watch('themes/', 'nikola build')
  +        server.watch('templates/', 'nikola build')
           server.watch(self.site.config['GALLERY_PATH'])
           for item in self.site.config['post_pages']:
  -            server.watch(os.path.dirname(item[0]))
  +            server.watch(os.path.dirname(item[0]), 'nikola build')
           for item in self.site.config['FILES_FOLDERS']:
  -            server.watch(os.path.dirname(item))
  +            server.watch(os.path.dirname(item), 'nikola build')
   
           out_folder = self.site.config['OUTPUT_FOLDER']
           if options and options.get('browser'):
  
verification_info: {"golden_diff": "diff --git a/nikola/plugins/command/auto.py b/nikola/plugins/command/auto.py\n--- a/nikola/plugins/command/auto.py\n+++ b/nikola/plugins/command/auto.py\n@@ -64,20 +64,20 @@\n             req_missing(['livereload>=2.0.0'], 'use the \"auto\" command')\n             return\n \n-        # Run an initial build so we are uptodate\n+        # Run an initial build so we are up-to-date\n         subprocess.call((\"nikola\", \"build\"))\n \n         port = options and options.get('port')\n \n         server = Server()\n-        server.watch('conf.py')\n-        server.watch('themes/')\n-        server.watch('templates/')\n+        server.watch('conf.py', 'nikola build')\n+        server.watch('themes/', 'nikola build')\n+        server.watch('templates/', 'nikola build')\n         server.watch(self.site.config['GALLERY_PATH'])\n         for item in self.site.config['post_pages']:\n-            server.watch(os.path.dirname(item[0]))\n+            server.watch(os.path.dirname(item[0]), 'nikola build')\n         for item in self.site.config['FILES_FOLDERS']:\n-            server.watch(os.path.dirname(item))\n+            server.watch(os.path.dirname(item), 'nikola build')\n \n         out_folder = self.site.config['OUTPUT_FOLDER']\n         if options and options.get('browser'):\n", "issue": "nikola auto not working \nI'm a newb so suspect user error, but I installed nikola v6.3.0 (pip install nikola) and have not been able to get **nikola auto** to work.\n\nInitially I was getting errors due to a more recent version of livereload (which, isn't this marked as fixed?) and resolved by forcing livereload=2.0.0. \n\nThe next problem is that the site appears not to rebuild when I save edits to a post. I have not RTFM yet (as instructed :) but when I do:\n  nikola auto -b \n\nI should be able to edit a post file (e.g. 1.rst) and on save, see the changes immediately, correct? What I see in the server log output and in Chrome dev tools shows that the browser is re-requesting a bunch of files, but I have to manually do **nikola build** to get the site to rebuild. \n\nI'm using OS X 10.9.1, Python 2.7. Let me know if I can provide any other info; if I get it worked out I'll update the issue. \n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\n# Copyright \u00a9 2012-2014 Roberto Alsina and others.\n\n# Permission is hereby granted, free of charge, to any\n# person obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the\n# Software without restriction, including without limitation\n# the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the\n# Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice\n# shall be included in all copies or substantial portions of\n# the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\n# OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR\n# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfrom __future__ import print_function, unicode_literals\n\nimport os\nimport subprocess\nimport webbrowser\n\nfrom nikola.plugin_categories import Command\nfrom nikola.utils import req_missing\n\n\nclass CommandAuto(Command):\n    \"\"\"Start debugging console.\"\"\"\n    name = \"auto\"\n    doc_purpose = \"automatically detect site changes, rebuild and optionally refresh a browser\"\n    cmd_options = [\n        {\n            'name': 'browser',\n            'short': 'b',\n            'type': bool,\n            'help': 'Start a web browser.',\n            'default': False,\n        },\n        {\n            'name': 'port',\n            'short': 'p',\n            'long': 'port',\n            'default': 8000,\n            'type': int,\n            'help': 'Port nummber (default: 8000)',\n        },\n    ]\n\n    def _execute(self, options, args):\n        \"\"\"Start the watcher.\"\"\"\n        try:\n            from livereload import Server\n        except ImportError:\n            req_missing(['livereload>=2.0.0'], 'use the \"auto\" command')\n            return\n\n        # Run an initial build so we are uptodate\n        subprocess.call((\"nikola\", \"build\"))\n\n        port = options and options.get('port')\n\n        server = Server()\n        server.watch('conf.py')\n        server.watch('themes/')\n        server.watch('templates/')\n        server.watch(self.site.config['GALLERY_PATH'])\n        for item in self.site.config['post_pages']:\n            server.watch(os.path.dirname(item[0]))\n        for item in self.site.config['FILES_FOLDERS']:\n            server.watch(os.path.dirname(item))\n\n        out_folder = self.site.config['OUTPUT_FOLDER']\n        if options and options.get('browser'):\n            webbrowser.open('http://localhost:{0}'.format(port))\n\n        server.serve(port, None, out_folder)\n", "path": "nikola/plugins/command/auto.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\n# Copyright \u00a9 2012-2014 Roberto Alsina and others.\n\n# Permission is hereby granted, free of charge, to any\n# person obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the\n# Software without restriction, including without limitation\n# the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the\n# Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice\n# shall be included in all copies or substantial portions of\n# the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY\n# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\n# OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR\n# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfrom __future__ import print_function, unicode_literals\n\nimport os\nimport subprocess\nimport webbrowser\n\nfrom nikola.plugin_categories import Command\nfrom nikola.utils import req_missing\n\n\nclass CommandAuto(Command):\n    \"\"\"Start debugging console.\"\"\"\n    name = \"auto\"\n    doc_purpose = \"automatically detect site changes, rebuild and optionally refresh a browser\"\n    cmd_options = [\n        {\n            'name': 'browser',\n            'short': 'b',\n            'type': bool,\n            'help': 'Start a web browser.',\n            'default': False,\n        },\n        {\n            'name': 'port',\n            'short': 'p',\n            'long': 'port',\n            'default': 8000,\n            'type': int,\n            'help': 'Port nummber (default: 8000)',\n        },\n    ]\n\n    def _execute(self, options, args):\n        \"\"\"Start the watcher.\"\"\"\n        try:\n            from livereload import Server\n        except ImportError:\n            req_missing(['livereload>=2.0.0'], 'use the \"auto\" command')\n            return\n\n        # Run an initial build so we are up-to-date\n        subprocess.call((\"nikola\", \"build\"))\n\n        port = options and options.get('port')\n\n        server = Server()\n        server.watch('conf.py', 'nikola build')\n        server.watch('themes/', 'nikola build')\n        server.watch('templates/', 'nikola build')\n        server.watch(self.site.config['GALLERY_PATH'])\n        for item in self.site.config['post_pages']:\n            server.watch(os.path.dirname(item[0]), 'nikola build')\n        for item in self.site.config['FILES_FOLDERS']:\n            server.watch(os.path.dirname(item), 'nikola build')\n\n        out_folder = self.site.config['OUTPUT_FOLDER']\n        if options and options.get('browser'):\n            webbrowser.open('http://localhost:{0}'.format(port))\n\n        server.serve(port, None, out_folder)\n", "path": "nikola/plugins/command/auto.py"}]}