From patchwork Thu Sep 5 20:07:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [34,of,48,RFC] commitablectx: move bookmarks from workingctx From: Sean Farley X-Patchwork-Id: 2374 Message-Id: To: mercurial-devel@selenic.com Date: Thu, 05 Sep 2013 15:07:28 -0500 # HG changeset patch # User Sean Farley # Date 1376515473 18000 # Wed Aug 14 16:24:33 2013 -0500 # Node ID c1985b5d707dcef3204119ff14de74a85002e2ba # Parent 2c15df7257a82956162cb82bbe29ddfca0ed32dd commitablectx: move bookmarks from workingctx diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -998,10 +998,16 @@ t = [] for p in self.parents(): t.extend(p.tags()) return t + def bookmarks(self): + b = [] + for p in self.parents(): + b.extend(p.bookmarks()) + return b + class workingctx(commitablectx): """A workingctx object makes access to data related to the current working directory convenient. date - any valid date string or (unixtime, offset), or None. user - username string, or None. @@ -1024,16 +1030,10 @@ p = self._repo.dirstate.parents() if p[1] == nullid: p = p[:-1] return [changectx(self._repo, x) for x in p] - def bookmarks(self): - b = [] - for p in self.parents(): - b.extend(p.bookmarks()) - return b - def phase(self): phase = phases.draft # default phase to draft for p in self.parents(): phase = max(phase, p.phase()) return phase