Commits

anatoly techtonik committed 12c043c

hgpullsvn: -r option to limit number of pulled revisions

  • Participants
  • Parent commits 1661dfd

Comments (0)

Files changed (1)

hgsvn/run/hgpullsvn.py

         ui.status("No revisions after %s in SVN repo, nothing to do",
                   svn_greatest_rev)
         return
+    elif options.svn_rev != None:
+        if options.svn_rev < next_rev:
+            ui.status("All revisions up to %s are already pulled in, "
+                      "nothing to do",
+                      options.svn_rev)
+            return
+        svn_greatest_rev = options.svn_rev
 
     # Show incoming changes if in dry-run mode.
     if options.dryrun:
 
 def main():
     # Defined as entry point. Must be callable without arguments.
-    usage = "usage: %prog [-p SVN peg rev] [--help]"
+    usage = "usage: %prog [-p SVN_PEG] [--help]"
     parser = OptionParser(usage)
+    parser.add_option("-r", type="int", dest="svn_rev",
+       help="limit pull up to specified revision")
     parser.add_option("-p", "--svn-peg", type="int", dest="svn_peg",
        help="SVN peg revision to locate checkout URL")
     parser.add_option("-n", "--dry-run", dest="dryrun", default=False,