changeset 10027:30d51a0df46c

subrepo: document necessary methods for a subrepo class
author Augie Fackler <durin42@gmail.com>
date Wed, 09 Dec 2009 14:33:22 -0600
parents 0b0a46607ac9
children 873d9b9a7bac
files mercurial/subrepo.py
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/subrepo.py	Thu Dec 10 12:31:57 2009 +0100
+++ b/mercurial/subrepo.py	Wed Dec 09 14:33:22 2009 -0600
@@ -149,6 +149,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