[PATCH 4 of 7] debugobsolete: add --flags option

pierre-yves.david at logilab.fr pierre-yves.david at logilab.fr
Wed Oct 3 05:13:04 CDT 2012


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1349258125 -7200
# Node ID aca76ebc451c89cd42df1ae1fb68ca077188af6c
# Parent  90dc842ef19b1d864d82df3d2be2ad6a18a5b54e
debugobsolete: add --flags option

This options allows to specify the `flag` part of obsolete markers.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2068,11 +2068,13 @@ def debugknown(ui, repopath, *ids, **opt
     if not repo.capable('known'):
         raise util.Abort("known() not supported by target repository")
     flags = repo.known([bin(s) for s in ids])
     ui.write("%s\n" % ("".join([f and "1" or "0" for f in flags])))
 
- at command('debugobsolete', [] + commitopts2,
+ at command('debugobsolete',
+        [('', 'flags', 0, _('markers flag')),
+        ] + commitopts2,
          _('[OBSOLETED [REPLACEMENT] [REPL... ]'))
 def debugobsolete(ui, repo, precursor=None, *successors, **opts):
     """create arbitrary obsolete marker"""
     def parsenodeid(s):
         try:
@@ -2095,12 +2097,12 @@ def debugobsolete(ui, repo, precursor=No
         succs = tuple(parsenodeid(succ) for succ in successors)
         l = repo.lock()
         try:
             tr = repo.transaction('debugobsolete')
             try:
-                repo.obsstore.create(tr, parsenodeid(precursor), succs, 0,
-                                     metadata)
+                repo.obsstore.create(tr, parsenodeid(precursor), succs,
+                                     opts['flags'], metadata)
                 tr.close()
             finally:
                 tr.release()
         finally:
             l.release()
diff --git a/tests/test-debugcomplete.t b/tests/test-debugcomplete.t
--- a/tests/test-debugcomplete.t
+++ b/tests/test-debugcomplete.t
@@ -235,11 +235,11 @@ Show all commands + options
   debugignore: 
   debugindex: changelog, manifest, format
   debugindexdot: 
   debuginstall: 
   debugknown: 
-  debugobsolete: date, user
+  debugobsolete: flags, date, user
   debugpushkey: 
   debugpvec: 
   debugrebuildstate: rev
   debugrename: rev
   debugrevlog: changelog, manifest, dump


More information about the Mercurial-devel mailing list