comparison hgext/mq.py @ 11438:88fc876a4833 stable

mq: fix qpush --move for selected guarded patches In the case of guarded patch, the patch could not be found because the full_series list contains also the guard value appended to each patch name. As we already checked that the patch is pushable above in the code, we just have to use the series list (which doesn't contains guard value) to get the patch index.
author Gilles Moris <gilles.moris@free.fr>
date Tue, 22 Jun 2010 09:49:51 +0200
parents 0f33abfccaa1
children 778377be3662
comparison
equal deleted inserted replaced
11437:9fa255c32406 11438:88fc876a4833
1044 if not force: 1044 if not force:
1045 self.check_localchanges(repo) 1045 self.check_localchanges(repo)
1046 1046
1047 if move: 1047 if move:
1048 try: 1048 try:
1049 del self.full_series[self.full_series.index(patch, start)] 1049 index = self.series.index(patch, start)
1050 fullpatch = self.full_series[index]
1051 del self.full_series[index]
1050 except ValueError: 1052 except ValueError:
1051 raise util.Abort(_("patch '%s' not found") % patch) 1053 raise util.Abort(_("patch '%s' not found") % patch)
1052 self.full_series.insert(start, patch) 1054 self.full_series.insert(start, fullpatch)
1053 self.parse_series() 1055 self.parse_series()
1054 self.series_dirty = 1 1056 self.series_dirty = 1
1055 1057
1056 self.applied_dirty = 1 1058 self.applied_dirty = 1
1057 if start > 0: 1059 if start > 0: