[PATCH 2 of 3] subrepo: document necessary methods for a subrepo class
durin42 at gmail.com
durin42 at gmail.com
Thu Dec 10 16:29:59 UTC 2009
# HG changeset patch
# User Augie Fackler <durin42 at gmail.com>
# Date 1260390802 21600
# Node ID 8ebccd3353517d5f65ae709db3b5442d6e1bc644
# Parent 58972474c3eb72dec11dbe0232e9100f2d1b8fa8
subrepo: document necessary methods for a subrepo class
diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -152,6 +152,21 @@
raise error.Abort('unknown subrepo source %s' % state[0])
return hgsubrepo(ctx, path, state)
+# subrepo classes need to implement the following methods:
+# __init__(self, ctx, path, state)
+# dirty(self): returns true if the dirstate of the subrepo
+# does not match current stored state
+# commit(self, text, user, date): commit the current changes
+# to the subrepo with the given log message. Use given
+# user and date if possible. Return the new state of the subrepo.
+# remove(self): remove the subrepo (should verify the dirstate
+# is not dirty first)
+# get(self, state): run whatever commands are needed to put the
+# subrepo into this state
+# merge(self, state): merge currently-saved state with the new state.
+# push(self, force): perform whatever action is analagous to 'hg push'
+# This may be a no-op on some systems.
+
class hgsubrepo(object):
def __init__(self, ctx, path, state):
self._path = path
More information about the Mercurial-devel
mailing list