Mercurial > public > mercurial-scm > hg
diff hgext/mq.py @ 14732:e9ed3506f066 stable
backout of d04ba50e104d: allow to qpop/push with a dirty working copy
The new behavior was breaking existing tools that relied on a sequence such as
this:
1) start with a dirty working copy
2) qimport some patch
3) try to qpush it
4) old behavior would fail at this point due to outstanding changes.
(new behavior would only fail if the outstanding changes and the patches
changes intersect)
5) innocent user qrefreshes, gets his local changes in the imported patch
It's worth considering if we can move this behavior to -f in the future.
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Fri, 24 Jun 2011 23:25:42 +0300 |
parents | 35c2cc322ba8 |
children | d3bb825ddae3 |
line wrap: on
line diff
--- a/hgext/mq.py Fri Jun 24 13:35:03 2011 -0500 +++ b/hgext/mq.py Fri Jun 24 23:25:42 2011 +0300 @@ -1134,6 +1134,8 @@ if start == len(self.series): self.ui.warn(_('patch series already fully applied\n')) return 1 + if not force: + self.checklocalchanges(repo, refresh=self.applied) if exact: if move: @@ -1172,19 +1174,6 @@ end = self.series.index(patch, start) + 1 s = self.series[start:end] - - if not force: - mm, aa, rr, dd = repo.status()[:4] - wcfiles = set(mm + aa + rr + dd) - if wcfiles: - for patchname in s: - pf = os.path.join(self.path, patchname) - patchfiles = patchmod.changedfiles(self.ui, repo, pf) - if wcfiles.intersection(patchfiles): - self.localchangesfound(self.applied) - elif mergeq: - self.checklocalchanges(refresh=self.applied) - all_files = set() try: if mergeq: @@ -1265,6 +1254,9 @@ break update = needupdate + if not force and update: + self.checklocalchanges(repo) + self.applieddirty = 1 end = len(self.applied) rev = self.applied[start].node @@ -1287,12 +1279,6 @@ qp = self.qparents(repo, rev) ctx = repo[qp] m, a, r, d = repo.status(qp, top)[:4] - parentfiles = set(m + a + r + d) - if not force and parentfiles: - mm, aa, rr, dd = repo.status()[:4] - wcfiles = set(mm + aa + rr + dd) - if wcfiles.intersection(parentfiles): - self.localchangesfound() if d: raise util.Abort(_("deletions found between repo revs")) for f in a: