From 18eec969384783c1dfd81cd54f7d1084b4a95d0d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karl=20Hasselstr=C3=B6m?= Date: Wed, 19 Dec 2007 18:00:13 +0000 Subject: [PATCH] Remove "stg rm" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-rm can do the same job just as well. Besides, since StGit notices when a file disappears, just "rm" can also do the job. Signed-off-by: Karl Hasselström --- Documentation/tutorial.txt | 22 ++++++++++++--------- stgit/commands/rm.py | 48 ---------------------------------------------- stgit/main.py | 2 -- 3 files changed, 13 insertions(+), 59 deletions(-) delete mode 100644 stgit/commands/rm.py diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt index 43b6409..6eaa623 100644 --- a/Documentation/tutorial.txt +++ b/Documentation/tutorial.txt @@ -123,18 +123,22 @@ You can view modified files that have already been saved into a patch: stg files The 'stg refresh' command automatically notes changes to files that -already exist in the working directory, but you have to tell StGIT -explicitly if you add, remove, or rename files. -To record the addition or deletion of files in your new patch: +already exist in the working directory (it also notices if you remove +them), but you have to tell StGIT explicitly if you add or rename a +file: - git add [*] - stg rm [*] + git add new-file -To record the renaming of a file in your new patch, issue both of these -commands: +to add a file, and + + mv old-file new-file + git add new-file + +or simply + + git mv old-file new-file - stg rm - git add +to move a file. Stack manipulation: managing multiple patches diff --git a/stgit/commands/rm.py b/stgit/commands/rm.py deleted file mode 100644 index 59d098b..0000000 --- a/stgit/commands/rm.py +++ /dev/null @@ -1,48 +0,0 @@ - -__copyright__ = """ -Copyright (C) 2005, Catalin Marinas - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License version 2 as -published by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -""" - -import sys, os -from optparse import OptionParser, make_option - -from stgit.commands.common import * -from stgit.utils import * -from stgit import stack, git - - -help = 'remove files from the repository' -usage = """%prog [options] - -Remove given files from the repository. The command doesn't remove the -working copy of the file.""" - -directory = DirectoryHasRepository() -options = [make_option('-f', '--force', - help = 'force removing even if the file exists', - action = 'store_true')] - - -def func(parser, options, args): - """Remove files from the repository - """ - if len(args) < 1: - parser.error('incorrect number of arguments') - - if not crt_series.get_current(): - raise CmdException, 'No patches applied' - - git.rm(args, options.force) diff --git a/stgit/main.py b/stgit/main.py index 7f8f0c9..7701546 100644 --- a/stgit/main.py +++ b/stgit/main.py @@ -90,7 +90,6 @@ commands = Commands({ 'rename': 'rename', 'repair': 'repair', 'resolved': 'resolved', - 'rm': 'rm', 'series': 'series', 'show': 'show', 'sink': 'sink', @@ -149,7 +148,6 @@ wccommands = ( 'cp', 'diff', 'resolved', - 'rm', 'status', ) -- 2.11.0