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

  • Home
  • SEARCH
  • 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 9149771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:31:20+00:00 2026-06-17T11:31:20+00:00

This is a common question I know, but I want to take it to

  • 0

This is a common question I know, but I want to take it to the next level, I know how to use bundles, but is kind of boring having to dig trough the “hg log” to see my last changes, so I want to make it automatic, checking my log trough bash/awk and identifying work/home changes trough date and mail, (I have diferent mails in .hgrc, me@work and me@home).

I already have this bash function but I have to pass the base revision manually:

hgb () {
    hg bundle --base $1 ~/changes-`date +%Y-%m-%d-%H-%M`.hg
}

So I would like something like:

mkwbundle #make work bundle for home

and:

mkhbundle #make home bundle for work

I’m just beginning at awk/sed but I’ve seen miracles, I ask before doing it with Python which is my goto tool for almost anything.

Update:

For mercurial agnostic people, this is how hg log looks like:

changeset:   28:f5200232460e
tag:         tip
user:        Manuel@home
date:        Tue Jan 15 23:39:57 2013 -0500
summary:     Adding DevTodo

changeset:   27:828dbba6830a
user:        Manuel@home
date:        Tue Jan 15 23:24:57 2013 -0500
summary:     login twig

changeset:   26:781477f86f6f
user:        Manuel@home
date:        Tue Jan 15 00:18:54 2013 -0500
summary:     UI mockup

changeset:   25:0c9365b200a8
user:        Manuel@home
date:        Mon Jan 14 23:50:22 2013 -0500
summary:     using twig blocks, remember reuse parent

changeset:   24:a1abfcfcefed
user:        Manuel@work
date:        Mon Jan 14 23:49:44 2013 -0500
summary:     smaller footer

changeset:   23:3cd12b7fb684
user:        Manuel@work
date:        Mon Jan 14 23:20:18 2013 -0500
summary:     test content width

I want to get the base revision when in work to make a bundle, let’s say I started working in rev 24 at home and made 4 changes, then I’m in 28, I want to get 24 as base rev and make a bundle, then the same at work.

EDIT: per @dhunter comment below, the expected output of the script would be:

24
  • 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-06-17T11:31:21+00:00Added an answer on June 17, 2026 at 11:31 am

    Revset version for hg bundle --base REV type of command

    Used: revsets, revsets aliases

    Task in a verbal form: find latest changeset, after which to tip changesets continuously created by another author, than sought-for changeset

    Solution:

    Iteration 1

    max(user('work')) for bundle with changesets, intended to be transferred to work (all after latest “work” is homework)

    max(user('home')) for bundle with changesets, intended to be transferred to home (all after latest “home” is workplacework)

    Iteration 2

    Compacting and beautification: I’m too lazy for too much typing. Bundleable() function-name shortened to ba() and added to in the “revsetalias” section of a Mercurial configuration file for home and work repos

     [revsetalias]
     ba('$1') = max(user('$1'))
    

    (‘$1’ instead of $1 used in order to don’t write ” around parameter – signal string – by hand)

    Results

    hg bundle --base "ba(home)" or hg bundle --base "ba(work)"

    home|work define destination, for which bundle have to be prepared

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

Sidebar

Related Questions

First, I know this is kind of common question, but I could not find
I know that this question is quite common, but its specifics are stumping me.
Okay, I know this is a common enough question, but all the solutions I've
I know this is a common question but I can't find any answer. I
I know this is a common question but I just can't seem to get
I know this may be a common question but I can't find the exact
I know this question is very common but the main point in my question
I know this is very common question but I am really stuck in this
I know this is a very common question. But I've looked through SO and
I know this is a common question and there are oodles of resources on

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.