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 854253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:53:46+00:00 2026-05-15T07:53:46+00:00

I have a project, where I’m forced to use ftp as a means of

  • 0

I have a project, where I’m forced to use ftp as a means of deploying the files to the live server.
I’m developing on linux, so I hacked together a bash script that makes a backup of the ftp server’s contents,
deletes all the files on the ftp, and uploads all the fresh files from the mercurial repository.
(and taking care of user uploaded files and folders, and making post-deploy changes, etc)

It’s working well, but the project is starting to get big enough to make the deployment process too long.

I’d like to modify the script to look up which files have changed, and only deploy the modified files. (the backup is fine atm as it is)

I’m using mercurial as a VCS, so my idea is to somehow request the changed files between two revisions from it, iterate over the changed files,
and upload each modified file, and delete each removed file.

I can use hg log -vr rev1:rev2, and from the output, I can carve out the changed files with grep/sed/etc.

Two problems:

I have heard the horror stories that parsing the output of ls leads to insanity, so my guess is that the same applies to here,
if I try to parse the output of hg log, the variables will undergo word-splitting, and all kinds of transformations.

hg log doesn’t tell me a file is modified/added/deleted. Differentiating between modified and deleted files would be the least.

So, what would be the correct way to do this? I’m using yafc as an ftp client, in case it’s needed, but willing to switch.

  • 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-15T07:53:46+00:00Added an answer on May 15, 2026 at 7:53 am

    You could use a custom style that does the parsing for you.

    hg log --rev rev1:rev2 --style mystyle
    

    Then pipe it to sort -u to get a unique list of files. The file “mystyle” would look like this:

    changeset = '{file_mods}{file_adds}\n'
    file_mod = '{file_mod}\n'
    file_add = '{file_add}\n'
    

    The mods and adds templates are files modified or added. There is a similar file_dels and file_del template for deleted files.

    Alternatively, you could use hg status -ma --rev rev1-1:rev2 which adds an M or an A before modified/added files. You need to pass a different revision range, one less than rev1, as it is the status since that “baseline”. Deleted files are similar – you need the -d flag and a D is added before each deleted file.

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

Sidebar

Related Questions

I have project with my resources (resx files), and I want to use them
I have project group in Eclipse. But I use debug as --> on server
I have project asp.net with namespace test and I'm using resources (files Resource.resx and
I have project I want to upgrade to .Net4 and it use BackgroundCopyManager.dll. Anyone
I have project that shows few tables and try to use JQuery dialog boxes
I have project, this contains header files like. #import Three20/TTButton.h #import Three20/TTStyle.h #import Three20/TTStyleSheet.h
We have project with a server witch have about 3000 requests at day from
We have project with lot of precanned test files, so obviously the test-jar file
I have project that consists of 8758 files. When I add them to my
I have project where i'm developing an Android App using a lot of existing

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.