From: Chuck Lever Date: Mon, 14 Nov 2005 16:50:55 +0000 (-0500) Subject: Better error message when renaming patches to same name X-Git-Tag: v0.14.3~583 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/e19173dccd972a0a7d1c6417dfd8d6711b030faf Better error message when renaming patches to same name Generate a more precise error message when trying to rename a patch to the same name. This is what we get currently: [cel@dexter main]$ stg rename nfs_direct_wait nfs_direct_wait Renaming patch "nfs_direct_wait" -> "nfs_direct_wait"...stg rename: Patch "nfs_direct_wait" already exists [cel@dexter main]$ Signed-off-by: Chuck Lever --- diff --git a/stgit/stack.py b/stgit/stack.py index 1ffeaee..0907b37 100644 --- a/stgit/stack.py +++ b/stgit/stack.py @@ -775,6 +775,9 @@ class Series: applied = self.get_applied() unapplied = self.get_unapplied() + if oldname == newname: + raise StackException, '"To" name and "from" name are the same' + if newname in applied or newname in unapplied: raise StackException, 'Patch "%s" already exists' % newname