Mercurial > public > mercurial-scm > hg-stable
diff hgext/mq.py @ 11546:134eb1c97e94 stable
mq: qrepo.add(mq.added) inside save_dirty inside of doing it manually
This should make the MQ API more transparent: callers only have to
call save_dirty, and no mq.added magic or knowledge is required.
author | Nicolas Dumazet <nicdumz.commits@gmail.com> |
---|---|
date | Tue, 13 Jul 2010 22:30:01 +0900 |
parents | 958022f0f1d5 |
children | a5903e612f07 64f284da1278 |
line wrap: on
line diff
--- a/hgext/mq.py Tue Jul 06 22:22:18 2010 -0300 +++ b/hgext/mq.py Tue Jul 13 22:30:01 2010 +0900 @@ -476,6 +476,11 @@ write_list(self.full_series, self.series_path) if self.guards_dirty: write_list(self.active_guards, self.guards_path) + if self.added: + qrepo = self.qrepo() + if qrepo: + qrepo[None].add(self.added) + self.added = [] def removeundo(self, repo): undo = repo.sjoin('undo') @@ -1809,10 +1814,6 @@ git=opts['git']) finally: q.save_dirty() - qrepo = q.qrepo() - if qrepo: - qrepo[None].add(q.added) - q.added = [] if opts.get('push') and not opts.get('rev'): return q.push(repo, None)