Show More
@@ -802,10 +802,29 b' class queue:' | |||
|
802 | 802 | if not wlock: |
|
803 | 803 | wlock = repo.wlock() |
|
804 | 804 | patch = self.lookup(patch) |
|
805 | if patch and self.isapplied(patch): | |
|
806 | raise util.Abort(_("patch %s is already applied") % patch) | |
|
805 | # Suppose our series file is: A B C and the current 'top' patch is B. | |
|
806 | # qpush C should be performed (moving forward) | |
|
807 | # qpush B is a NOP (no change) | |
|
808 | # qpush A is an error (can't go backwards with qpush) | |
|
809 | if patch: | |
|
810 | info = self.isapplied(patch) | |
|
811 | if info: | |
|
812 | if info[0] < len(self.applied) - 1: | |
|
813 | raise util.Abort(_("cannot push to a previous patch: %s") % | |
|
814 | patch) | |
|
815 | if info[0] < len(self.series) - 1: | |
|
816 | self.ui.warn(_('qpush: %s is already at the top\n') % patch) | |
|
817 | else: | |
|
818 | self.ui.warn(_('all patches are currently applied\n')) | |
|
819 | return | |
|
820 | ||
|
821 | # Following the above example, starting at 'top' of B: | |
|
822 | # qpush should be performed (pushes C), but a subsequent qpush without | |
|
823 | # an argument is an error (nothing to apply). This allows a loop | |
|
824 | # of "...while hg qpush..." to work as it detects an error when done | |
|
807 | 825 | if self.series_end() == len(self.series): |
|
808 |
|
|
|
826 | self.ui.warn(_('patch series already fully applied\n')) | |
|
827 | return 1 | |
|
809 | 828 | if not force: |
|
810 | 829 | self.check_localchanges(repo) |
|
811 | 830 | |
@@ -847,8 +866,12 b' class queue:' | |||
|
847 | 866 | info = self.isapplied(patch) |
|
848 | 867 | if not info: |
|
849 | 868 | raise util.Abort(_("patch %s is not applied") % patch) |
|
869 | ||
|
850 | 870 | if len(self.applied) == 0: |
|
851 | raise util.Abort(_("no patches applied")) | |
|
871 | # Allow qpop -a to work repeatedly, | |
|
872 | # but not qpop without an argument | |
|
873 | self.ui.warn(_("no patches applied\n")) | |
|
874 | return not all | |
|
852 | 875 | |
|
853 | 876 | if not update: |
|
854 | 877 | parents = repo.dirstate.parents() |
@@ -1766,7 +1789,8 b' def push(ui, repo, patch=None, **opts):' | |||
|
1766 | 1789 | |
|
1767 | 1790 | if opts['all']: |
|
1768 | 1791 | if not q.series: |
|
1769 |
|
|
|
1792 | ui.warn(_('no patches in series\n')) | |
|
1793 | return 0 | |
|
1770 | 1794 | patch = q.series[-1] |
|
1771 | 1795 | if opts['merge']: |
|
1772 | 1796 | if opts['name']: |
General Comments 0
You need to be logged in to leave comments.
Login now