[StGit PATCH] Remove the resolved command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Catalin Marinas <catalin.marinas@xxxxxxx>

This command simply duplicates the "git add" or "git mergetool" commands
for handling conflicts.

Signed-off-by: Catalin Marinas <catalin.marinas@xxxxxxx>
---
 Documentation/tutorial.txt |    2 +
 examples/gitconfig         |    4 --
 stgit/commands/common.py   |    2 +
 stgit/commands/push.py     |    4 +-
 stgit/commands/rebase.py   |    2 +
 stgit/commands/resolved.py |   82 --------------------------------------------
 stgit/config.py            |    1 -
 t/t0002-status.sh          |    2 +
 t/t2000-sync.sh            |    4 +-
 9 files changed, 8 insertions(+), 95 deletions(-)
 delete mode 100644 stgit/commands/resolved.py

diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt
index 8e0adbf..4aa7629 100644
--- a/Documentation/tutorial.txt
+++ b/Documentation/tutorial.txt
@@ -313,7 +313,7 @@ markers.
 Now that we've resolved the conflict, we just need to tell StGit about
 it:
 
-  $ stg resolved TODO
+  $ git add TODO
   $ stg status
   M TODO
 
diff --git a/examples/gitconfig b/examples/gitconfig
index e235e14..4f56918 100644
--- a/examples/gitconfig
+++ b/examples/gitconfig
@@ -17,10 +17,6 @@
 	# Automatically sign newly created patches
 	#autosign = Signed-off-by
 
-	# Set to 'yes' if you don't want to use the 'resolved' command.
-	# 'refresh' will automatically mark the conflicts as resolved
-	#autoresolved = no
-
 	# SMTP server for sending patches
 	#smtpserver = /usr/sbin/sendmail -t -i
 	#smtpserver = localhost:25
diff --git a/stgit/commands/common.py b/stgit/commands/common.py
index 1bc162f..bc8266e 100644
--- a/stgit/commands/common.py
+++ b/stgit/commands/common.py
@@ -120,7 +120,7 @@ def check_head_top_equal(crt_series):
 def check_conflicts():
     if git.get_conflicts():
         raise CmdException('Unsolved conflicts. Please fix the conflicts'
-                           ' then use "resolve <files>" or revert the'
+                           ' then use "git add --update <files>" or revert the'
                            ' changes with "status --reset".')
 
 def print_crt_patch(crt_series, branch = None):
diff --git a/stgit/commands/push.py b/stgit/commands/push.py
index 84a93bd..d5e02e0 100644
--- a/stgit/commands/push.py
+++ b/stgit/commands/push.py
@@ -30,8 +30,8 @@ the stack. The 'push' operation allows patch reordering by commuting
 them with the three-way merge algorithm. If there are conflicts while
 pushing a patch, those conflicts are written to the work tree, and the
 command halts. Conflicts raised during the push operation have to be
-fixed and the 'resolved' command run (alternatively, you may undo the
-conflicting push with 'stg undo').
+fixed and the 'git add --update' command run (alternatively, you may
+undo the conflicting push with 'stg undo').
 
 The command also notifies when the patch becomes empty (fully merged
 upstream) or is modified (three-way merged) by the 'push' operation."""
diff --git a/stgit/commands/rebase.py b/stgit/commands/rebase.py
index a4bc6e7..b949a5c 100644
--- a/stgit/commands/rebase.py
+++ b/stgit/commands/rebase.py
@@ -31,7 +31,7 @@ Pop all patches from current stack, move the stack base to the given
 If you experience merge conflicts, resolve the problem and continue
 the rebase by executing the following sequence:
 
-        $ stg resolved -a [-i]
+        $ git add --update
         $ stg refresh
         $ stg goto top-patch
 
diff --git a/stgit/commands/resolved.py b/stgit/commands/resolved.py
deleted file mode 100644
index eba778d..0000000
--- a/stgit/commands/resolved.py
+++ /dev/null
@@ -1,82 +0,0 @@
-
-__copyright__ = """
-Copyright (C) 2005, Catalin Marinas <catalin.marinas@xxxxxxxxx>
-
-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 stgit.argparse import opt
-from stgit.commands.common import *
-from stgit.utils import *
-from stgit import argparse, stack, git, basedir
-from stgit.config import config, file_extensions
-
-help = 'Mark a file conflict as solved'
-kind = 'wc'
-usage = ['[options] [<files...>]']
-description = """
-Mark a merge conflict as resolved. The conflicts can be seen with the
-'status' command, the corresponding files being prefixed with a
-'C'."""
-
-args = [argparse.conflicting_files]
-options = [
-    opt('-a', '--all', action = 'store_true',
-        short = 'Mark all conflicts as solved'),
-    opt('-r', '--reset', metavar = '(ancestor|current|patched)',
-        args = [argparse.strings('ancestor', 'current', 'patched')],
-        short = 'Reset the file(s) to the given state'),
-    opt('-i', '--interactive', action = 'store_true',
-        short = 'Run the interactive merging tool')]
-
-directory = DirectoryHasRepository(needs_current_series = False, log = False)
-
-def func(parser, options, args):
-    """Mark the conflict as resolved
-    """
-    args = git.ls_files(args)
-    directory.cd_to_topdir()
-
-    if options.reset \
-           and options.reset not in file_extensions():
-        raise CmdException, 'Unknown reset state: %s' % options.reset
-
-    if options.all and not options.interactive:
-        resolved_all(options.reset)
-        return
-
-    conflicts = git.get_conflicts()
-
-    if len(args) != 0:
-        files = args
-    elif options.all:
-        files = conflicts
-    else:
-        parser.error('incorrect number of arguments')
-
-    if not conflicts:
-        raise CmdException, 'No more conflicts'
-
-    # check for arguments validity
-    if not options.all:
-        for filename in files:
-            if not filename in conflicts:
-                raise CmdException, 'No conflicts for "%s"' % filename
-
-    # resolved
-    if options.interactive:
-        git.mergetool(files)
-    else:
-        git.resolved(files, options.reset)
diff --git a/stgit/config.py b/stgit/config.py
index a98c303..a3dbfa5 100644
--- a/stgit/config.py
+++ b/stgit/config.py
@@ -28,7 +28,6 @@ class GitConfigException(StgException):
 
 class GitConfig:
     __defaults={
-        'stgit.autoresolved':	'no',
         'stgit.smtpserver':	'localhost:25',
         'stgit.smtpdelay':	'5',
         'stgit.pullcmd':	'git pull',
diff --git a/t/t0002-status.sh b/t/t0002-status.sh
index ffcad77..2512c53 100755
--- a/t/t0002-status.sh
+++ b/t/t0002-status.sh
@@ -145,7 +145,7 @@ A fie
 M foo/bar
 EOF
 test_expect_success 'Status after resolving the push' '
-    stg resolved -a &&
+    git add --update &&
     stg status > output.txt &&
     test_cmp expected.txt output.txt
 '
diff --git a/t/t2000-sync.sh b/t/t2000-sync.sh
index 00ea7bd..d550538 100755
--- a/t/t2000-sync.sh
+++ b/t/t2000-sync.sh
@@ -117,7 +117,7 @@ test_expect_success \
     '
     [ "$(echo $(stg series --applied --noprefix))" = "p1" ] &&
     [ "$(echo $(stg series --unapplied --noprefix))" = "p2 p3" ] &&
-    stg resolved -a &&
+    git add --update &&
     stg refresh &&
     stg goto p3
     [ "$(echo $(stg series --applied --noprefix))" = "p1 p2 p3" ] &&
@@ -135,7 +135,7 @@ test_expect_success \
     '
     [ "$(echo $(stg series --applied --noprefix))" = "p1 p2 p3" ] &&
     [ "$(echo $(stg series --unapplied --noprefix))" = "" ] &&
-    stg resolved -a &&
+    git add --update &&
     stg refresh &&
     [ "$(echo $(stg series --applied --noprefix))" = "p1 p2 p3" ] &&
     [ "$(echo $(stg series --unapplied --noprefix))" = "" ]

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]