Commits

Martin Vejnár committed 5c97ccd

Added 'hg depcommit --commit' option.

  • Participants
  • Parent commits b82e2bd

Comments (0)

Files changed (1)

             ui.write('R %s (%s %s)\n' % (dep.alias, dep.dest,
                 _readable_rev(alias.scmtype, dep.rev) if alias else dep.rev))
 
-def depcommit(ui, repo):
+def depcommit(ui, repo, commit, **commitopts):
     '''save dependency state
     
     Update the .hgdeps file to reflect the current state of dependecies.
         
         config.set_tag(rev, deplist)
         _save_config(ui, repo, config)
+        
+        if commit:
+            if not commitopts['message'] and not commitopts['logfile']:
+                commitopts['message'] = 'Updated dependency list for changeset %s' % rev[:12]
+            mercurial.commands.commit(ui, repo, '.hgdeps', **commitopts)
 
 def depalias(ui, repo, alias, location, type):
     '''bind an alias to a source location
     
     'depupdate|depup|depsclone': (depupdate, [], '[NAME]'), 
     'depstatus|depst': (depstatus, [], ''),
-    'depcommit|depci': (depcommit, [], ''), 
+    
+    'depcommit|depci':
+        (depcommit, [
+            ('C', 'commit', None, 'commit changes immediately'),
+            ] + mercurial.commands.commitopts + mercurial.commands.commitopts2,
+        '[OPTION]...'), 
     
     'depalias':
         (depalias, [