Patchwork [3,of,9,RFC] localrepo: add a method to create an arbitrary mark

login
register
mail settings
Submitter Sean Farley
Date March 30, 2014, 11:09 p.m.
Message ID <1bb668ecda482ee83f31.1396220941@laptop.local>
Download mbox | patch
Permalink /patch/4150/
State Deferred
Headers show

Comments

Sean Farley - March 30, 2014, 11:09 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1396218326 18000
#      Sun Mar 30 17:25:26 2014 -0500
# Node ID 1bb668ecda482ee83f31d505c2094e6402668931
# Parent  a3a201495fe43a7c89b913680da8b2adc03cb650
localrepo: add a method to create an arbitrary mark

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -663,10 +663,18 @@  class localrepository(object):
         '''
         if namespace not in self._markers:
             # ensure a blank dictionary exists
             self._markers[namespace] = {}
 
+    def mark(self, namespace, name, node):
+        '''Add a mark to self._markers[namespace][name]
+
+        RFC: should we allow tags and bookmarks to be set this way?
+        '''
+        self._createmarkernamespace(namespace)
+        self._markers[namespace][name] = node
+
     def branchmap(self):
         '''returns a dictionary {branch: [branchheads]} with branchheads
         ordered by increasing revision number'''
         branchmap.updatecache(self)
         return self._branchcaches[self.filtername]