hg push --completed-tasks pushes active tasks

Issue #27 resolved
created an issue

Below follows a bash script that seems to make hg push a commit belonging to an active task, am I misunderstanding something? {{{



mkdir test cd test hg init echo temp > file hg add . hg com -m "initial commit" cd .. hg clone test test2 cd test2

create the task and make it active

hg task mytask hg update mytask echo temp1 > file hg com -m "task commit"

mytask is listed as active

hg task -i mytask

push refuses

hg push

this pushes the commit belonging to the active task!

hg push --completed-tasks hg log cd ../test hg log }}}

Comments (7)

  1. bobpaul

    This, indeed, looks to be exactly contrary to all documentation I've found. Is this another issue related to Mercurial API changes? Think you can try on 1.4.4?

  2. bobpaul

    It would appear this only occurs when there are no completed tasks. See the attached script. (in comment 4, sorry)

    Issue 1 -> If there is only 1 head and it's an active task, it gets pushed when you request --completed-tasks. The addition of a 2nd task hasn't affected the results you saw. Expected: push should not push anything.

    Issue 2-> If there are multiple heads but no completed tasks, push tries to push the active tasks when you request --completed-tasks, but fails because push doesn't like to create remote heads. Expected: push should not push anything.

    Eventually, when I mark "mycompletedtask" as completed, the expected behavior is seen (only "mycompletedtask" is pushed. This occurs regardless of whether "mytask" or "mycompletedtask" is checked out (good!).

  3. bobpaul

    This fixes issues 1 and 2 above. If you try to push and there's only incomplete tasks, it errors "--all or --complete" like before. HOWEVER, if you "hg push --completed-tasks" it will error "No completed tasks to push" and tell you to use --all to force.

    I did an additional test, and if you have incomplete tasks as well as a head that's not on any task, "hg push --completed-tasks" will push the taskless head. So everything checks out.

  4. Alex repo owner
    • changed status to open

    mizipzor, thanks for reporting this problem.

    bobpaul, excellent work! I've looked at the patch and it looks good.

    I would like implement your changes, but I'm not sure how you would like to be 'credited' in the changeset. If you just want 'bobpaul', I can commit it with that username. But if you want to have a different username or something (some people are picky about these things), just commit to your local repo and then perform hg export -rtip and show me the output. Another option is to fork the repo and then ask me to pull from your fork.

    Let me know how you want to do this, and thanks again.

  5. Log in to comment