"Hg Copy versioned item(s) here" in single folder does nothing
Created originally on Bitbucket by DavidCary
I have a (long) source file I want to break into 2 smaller files.
I was told that the best way to do this (while maintaining full history) involved the "Hg Copy versioned item(s) here" option. Is that right?
Alas, when I select that command, it does nothing.
What I did:
- Open up the working directory in the File Explorer, and confirm that the file has the green "committed" checkmark.
- Hover the mouse over the original file
- Hold down the right mouse button and drag into some whitespace inside the same folder, then let go of the button
- When the context menu pops up, choose "Hg Copy versioned item(s) here".
What I expected to happen: I expected one or the other of these two options 1a or 1b:
-
1a. A dialog box pops up, asking me what new name I want to use.
-
1b. A dialog box never pops up. Instead, TortoiseHg instantly creates a new file named "Copy of (original_filename)", exactly the same name as if I had chosen the "Copy here" option rather than "Hg Copy versioned item(s) here" option.
In either case,
-
- Eventually, the folder ends up with 1 more file than it had when I started. The new file should appear in the same folder as the original file, with a new name, but should otherwise be bit-for-bit identical to the original file.
What actually happens:
- a window briefly pops up and disappears, and the working folder is unchanged -- it has exactly the same number of files as when I started. As far as I can tell, the "Hg Copy versioned item(s) here" command does nothing, and therefore is useless.
Workaround 1. Use TortoiseSVN. With a different working directory that uses TortoiseSVN, when I go through the same steps (selecting "SVN Copy versioned item(s) here", I get a "Copy: New name for main.c" dialog box, and after I type the new name I see it has created a new file with that name, as I expected.
Could some clever programmer somehow copy the TortoiseSVN code that implements this feature, and past it into TortoiseHg?
Workaround 2:
- Create a temporary directory in the same directory as the original file
- Hover the mouse over the original file
- Hold down the right mouse button and drag onto the temporary folder, then let go of the button
- When the context menu pops up, choose "Hg Copy versioned item(s) here".
- Open the temporary folder
- Choose "TortoseHg", then "Rename file..."
- When the dialog window pops up, delete the name of the temporary directory from the destination, and also give the file a name different than the original file.
- voila!
details: I'm using the latest release: TortoiseHg version 2.0.4 with Mercurial-1.8.3, Python-2.6.6, PyQt-4.8.3, Qt-4.7.1, on Windows XP Sevice Pack 3.