From patchwork Sun Mar 30 23:09:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2,of,9,RFC] localrepo: add a helper method for creating a marker From: Sean Farley X-Patchwork-Id: 4149 Message-Id: To: mercurial-devel@selenic.com Date: Sun, 30 Mar 2014 18:09:00 -0500 # HG changeset patch # User Sean Farley # Date 1396217998 18000 # Sun Mar 30 17:19:58 2014 -0500 # Node ID a3a201495fe43a7c89b913680da8b2adc03cb650 # Parent bd7ad5e093455aefd73e1c66ad1ea260eb3051a3 localrepo: add a helper method for creating a marker diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -655,10 +655,18 @@ class localrepository(object): for bookmark, n in self._bookmarks.iteritems(): if n == node: marks.append(bookmark) return sorted(marks) + def _createmarkernamespace(self, namespace): + '''Function to create a dictionary entry for namespace. Exists to avoid code + duplication. + ''' + if namespace not in self._markers: + # ensure a blank dictionary exists + self._markers[namespace] = {} + def branchmap(self): '''returns a dictionary {branch: [branchheads]} with branchheads ordered by increasing revision number''' branchmap.updatecache(self) return self._branchcaches[self.filtername]