Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 739081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:21:33+00:00 2026-05-14T08:21:33+00:00

I have a personal Mercurial repository tracking some changes I am working on. I’d

  • 0

I have a personal Mercurial repository tracking some changes I am working on. I’d like to share these changes with a collaborator, however they don’t have/can’t get Mercurial, so I need to send the entire file set and the collaborator will merge on their end. I am looking for a way to extract the “tip” version of the subset of files that were modified between two revision numbers. Is there a way to easily do this in Mercurial?

Adding a bounty – This is still a pain for us. We often work with internal “customers” who take our source code releases as a .zip, and testing a small fix is easier to distribute as a .zip overlay than as a patch (since we often don’t know the state of their files).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T08:21:33+00:00Added an answer on May 14, 2026 at 8:21 am

    The best case scenario is to put the proper pressure on these folks to get Mercurial, but barring that, a patch is probably better than a zipped set of files, since the patch will track deletes and renames. If you still want a zip file, I’ve written a short script that makes a zip file:

    import os, subprocess, sys
    from zipfile import ZipFile, ZIP_DEFLATED
    
    def main(revfrom, revto, destination, *args):
        root, err = getoutput("hg root")
        if "no Merurial repository" in err:
            print "This script must be run from within an Hg repository"
            return
        root = root.strip()
    
        filelist, _ = getoutput("hg status --rev %s:%s" % (revfrom, revto))
        paths = []
    
        for line in filelist.split('\n'):
            try:
                (status, path) = line.split(' ', 1)
            except ValueError:
                continue
            if status != 'D':
                paths.append(path)
    
        if len(paths) < 1:
            print "No changed files could be found."
            return
    
        z = ZipFile(destination, "w", ZIP_DEFLATED)
        os.chdir(root)
        for path in paths:
            z.write(path)
        z.close()
    
        print "Done."
    
    
    def getoutput(cmd):
        p = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        return p.communicate()
    
    
    if __name__ == '__main__':
        main(*sys.argv[1:])
    

    The usage would be nameofscript.py fromrevision torevision destination. E.g., nameofscript.py 45 51 c:\updates.zip

    Sorry about the poor command line interface, but hey the script only took 25 minutes to write.

    Note: this should be run from a working directory within a repository.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Mercurial repository for a personal project, and I have been storing
I have an FTP where I would like to have my personal Maven repository,
I have several sources of tables with personal data, like this: SOURCE 1 ID,
I have a database for a web application that is home to some personal
I'm using Mercurial for personal use and am conteplating it for some distributed projects
I have a personal project that I'd like to build as an add-in for
I have a personal project which is stored in an svn repository in my
I have a personal project I'm working on that requires Microsoft SAPI5 -- text
I have a personal Git repository which I don't want to have publicly available
I am using CKEditor with KCFinder - i'd like to have personal upload files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.