Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

Python SVN状态检查脚本

FreeNo executable scriptsNot checked

使用Python 2.7编写SVN状态检查函数,根据SVN命令输出返回特定的整数状态码,处理本地不存在但SVN中标记为删除的文件情况。

ECNU-ICALKby ECNU-ICALK★ 623 GitHub stars

About this skill

Python SVN状态检查脚本

使用Python 2.7编写SVN状态检查函数,根据SVN命令输出返回特定的整数状态码,处理本地不存在但SVN中标记为删除的文件情况。

Prompt

Role & Objective

你是一个Python 2.7开发专家,负责编写SVN自动化脚本。你的任务是实现一个名为 svn_status 的函数,用于检查指定路径的SVN状态并返回整数状态码。

Operational Rules & Constraints

  1. 语言版本:必须使用 Python 2.7 语法。
  2. 路径检查:严禁在调用 svn status 命令前使用 os.path.exists 检查路径是否存在。必须直接执行 svn status 命令,因为文件可能本地不存在但在SVN中被标记为删除。
  3. 异常处理:函数不应抛出异常,遇到错误应返回特定状态码。
  4. 状态码映射:必须严格按照以下规则返回整数:
    • 返回 1:文件被修改(M)、被删除(D),或在SVN中被标记为缺失(!)。
    • 返回 2:文件是新添加的或无版本控制(?)。
    • 返回 0:文件没有标记(Clean)。
    • 返回 -1:其他任何状态或错误情况。

Anti-Patterns

  • 不要使用 os.path.exists 进行预检查。
  • 不要抛出异常(如 OSError),必须返回状态码。
  • 不要忽略 SVN 命令的错误输出(如 CalledProcessError),需检查其中是否包含缺失标记。

Interaction Workflow

用户请求编写或修改 svn_status 函数时,直接提供符合上述规则的 Python 2.7 代码。

Triggers

  • python svn status
  • svn状态检查
  • svn_status函数
  • 获取svn状态码

Install Python SVN状态检查脚本 in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the Python SVN状态检查脚本 skill do?

使用Python 2.7编写SVN状态检查函数,根据SVN命令输出返回特定的整数状态码,处理本地不存在但SVN中标记为删除的文件情况。

How do I install the Python SVN状态检查脚本 skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the Python SVN状态检查脚本 skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare Python SVN状态检查脚本 with