diff options
Diffstat (limited to 'subcmds')
| -rw-r--r-- | subcmds/abandon.py | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/subcmds/abandon.py b/subcmds/abandon.py index 4f976d7b..8af61327 100644 --- a/subcmds/abandon.py +++ b/subcmds/abandon.py | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | import sys | 16 | import sys |
| 17 | from command import Command | 17 | from command import Command |
| 18 | from git_command import git | 18 | from git_command import git |
| 19 | from progress import Progress | ||
| 19 | 20 | ||
| 20 | class Abandon(Command): | 21 | class Abandon(Command): |
| 21 | common = True | 22 | common = True |
| @@ -38,5 +39,23 @@ It is equivalent to "git branch -D <branchname>". | |||
| 38 | print >>sys.stderr, "error: '%s' is not a valid name" % nb | 39 | print >>sys.stderr, "error: '%s' is not a valid name" % nb |
| 39 | sys.exit(1) | 40 | sys.exit(1) |
| 40 | 41 | ||
| 41 | for project in self.GetProjects(args[1:]): | 42 | nb = args[0] |
| 42 | project.AbandonBranch(nb) | 43 | err = [] |
| 44 | all = self.GetProjects(args[1:]) | ||
| 45 | |||
| 46 | pm = Progress('Abandon %s' % nb, len(all)) | ||
| 47 | for project in all: | ||
| 48 | pm.update() | ||
| 49 | if not project.AbandonBranch(nb): | ||
| 50 | err.append(project) | ||
| 51 | pm.end() | ||
| 52 | |||
| 53 | if err: | ||
| 54 | if len(err) == len(all): | ||
| 55 | print >>sys.stderr, 'error: no project has branch %s' % nb | ||
| 56 | else: | ||
| 57 | for p in err: | ||
| 58 | print >>sys.stderr,\ | ||
| 59 | "error: %s/: cannot abandon %s" \ | ||
| 60 | % (p.relpath, nb) | ||
| 61 | sys.exit(1) | ||
