code: def edit(config: Config, rev: str) -> None:
      """Edit revision script(s) using $EDITOR.
  
      :param config: a :class:`.Config` instance.
  
      :param rev: target revision.
  
      """
  
      script = ScriptDirectory.from_config(config)
  
      if rev == "current":
  
          def edit_current(rev, context):
              if not rev:
                  raise util.CommandError("No current revisions")
              for sc in script.get_revisions(rev):
                  util.open_in_editor(sc.path)
              return []
  
          with EnvironmentContext(config, script, fn=edit_current):
              script.run_env()
      else:
          revs = script.get_revisions(rev)
          if not revs:
              raise util.CommandError(
                  "No revision files indicated by symbol '%s'" % rev
              )
          for sc in revs:
              assert sc
              util.open_in_editor(sc.path)
  
imports: from __future__ import annotations
  import os
  from typing import List
  from typing import Optional
  from typing import TYPE_CHECKING
  from typing import Union
  from .None import autogenerate
  from .None import util
  from .runtime.environment import EnvironmentContext
  from .script import ScriptDirectory
label_desc: Use image node_id 14 for calling a global function with example usage: edit(config, rev) and returns: list