old_contents: from os.path import exists, join
  
  import click
  from giturlparse import parse
  from plumbum.cmd import git
  import yaml
  
  CONFIG_FILE = '.changes'
  DEFAULTS = {
      'changelog': 'CHANGELOG.md',
      'readme': 'README.md',
  }
  
  
  class CLI(object):
      test_command = None
      pypi = None
      skip_changelog = None
  
      def __init__(self, module_name, dry_run, debug, no_input, requirements,
                   new_version, current_version, repo_url, version_prefix):
          self.module_name = module_name
          self.dry_run = dry_run
          self.debug = debug
          self.no_input = no_input
          self.requirements = requirements
          self.new_version = (
              version_prefix + new_version
              if version_prefix
              else new_version
          )
          self.current_version = current_version
          self.repo_url = repo_url
  
          self.parsed_repo = parse(git('config --get remote.origin.url'.split(' ')))
  
  def project_config(context):
      @property
      def repo(self):
          return self.parsed_repo.repo
  
      @property
      def owner(self):
          return self.parsed_repo.owner
  
      @property
      def github(self):
          return self.parsed_repo.github
  
      @property
      def bitbucket(self):
          return self.parsed_repo.bitbucket
  
      config = {}
      config_path = join(context.module_name, CONFIG_FILE)
  
      # initialise config with defaults
      if not exists(config_path):
          config = DEFAULTS.copy()
  
          with click.open_file(config_path, 'w') as f:
              config_yaml = yaml.dump(config, default_flow_style=False)
              f.write(config_yaml)
  
      config = yaml.safe_load(click.open_file(config_path))
      return config or {}
  
new_contents: from os.path import exists, join
  
  import click
  from giturlparse import parse
  from plumbum.cmd import git
  import yaml
  
  CONFIG_FILE = '.changes'
  DEFAULTS = {
      'changelog': 'CHANGELOG.md',
      'readme': 'README.md',
  }
  
  
  class CLI(object):
      test_command = None
      pypi = None
      skip_changelog = None
  
      def __init__(self, module_name, dry_run, debug, no_input, requirements,
                   new_version, current_version, repo_url, version_prefix):
          self.module_name = module_name
          self.dry_run = dry_run
          self.debug = debug
          self.no_input = no_input
          self.requirements = requirements
          self.new_version = (
              version_prefix + new_version
              if version_prefix
              else new_version
          )
          self.current_version = current_version
          self.repo_url = repo_url
  
          self.parsed_repo = parse(git('config --get remote.origin.url'.split(' ')))
  
  
      @property
      def repo(self):
          return self.parsed_repo.repo
  
      @property
      def owner(self):
          return self.parsed_repo.owner
  
      @property
      def github(self):
          return self.parsed_repo.github
  
      @property
      def bitbucket(self):
          return self.parsed_repo.bitbucket
  
  
  def project_config(context):
      config = {}
      config_path = join(context.module_name, CONFIG_FILE)
  
      # initialise config with defaults
      if not exists(config_path):
          config = DEFAULTS.copy()
  
          with click.open_file(config_path, 'w') as f:
              config_yaml = yaml.dump(config, default_flow_style=False)
              f.write(config_yaml)
  
      config = yaml.safe_load(click.open_file(config_path))
      return config or {}
  
subject: Fix bad partial commit