# HG changeset patch # User Augie Fackler # Date 1260390802 21600 # Node ID 30d51a0df46c5e18bde8769ec89d7a3d66f7a413 # Parent 0b0a46607ac9ea8031d516a3806ba5a523cf39cf subrepo: document necessary methods for a subrepo class diff -r 0b0a46607ac9 -r 30d51a0df46c mercurial/subrepo.py --- 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