From patchwork Thu Sep 5 20:07:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [33,of,48,RFC] commitablectx: move tags from workingctx From: Sean Farley X-Patchwork-Id: 2371 Message-Id: <2c15df7257a82956162c.1378411647@laptop.local> To: mercurial-devel@selenic.com Date: Thu, 05 Sep 2013 15:07:27 -0500 # HG changeset patch # User Sean Farley # Date 1376515456 18000 # Wed Aug 14 16:24:16 2013 -0500 # Node ID 2c15df7257a82956162cb82bbe29ddfca0ed32dd # Parent cdcf8a393b8f3b22c3e4e5b9c9d3499ab26a7373 commitablectx: move tags from workingctx diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -992,10 +992,16 @@ def closesbranch(self): return 'close' in self._extra def extra(self): return self._extra + def tags(self): + t = [] + for p in self.parents(): + t.extend(p.tags()) + return t + 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. @@ -1018,16 +1024,10 @@ p = self._repo.dirstate.parents() if p[1] == nullid: p = p[:-1] return [changectx(self._repo, x) for x in p] - def tags(self): - 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