We utilize streams to manage our code in Perforce. We are having issues when efforts are moved out to later releases as part of our controls requires that we have a valid/approved artifact tied to a release before we copy up to the main stream and proceed to cut the release stream.
In Perforce when you are copying code up from a development stream to the main stream is there a way to deselect change lists? When I attempt it, it appears I can deselect specific change lists, usually the last few added, but Perforce seems to not allow certain lists to be deselected, I am guessing if the file changes are included in later changes to the same file.
Is there a good way to selectively move these change sets?
You'll want to use the merge command instead of copy in this case to cherry pick the changes up to main. Copy takes files at a point in time and makes the target look like the source no matter what. Merge will let you pick around changes that aren't ready.
Related
Normally a repository in Rational Team Concert compares itself to a base Stream to know what you have added or removed since you've started working.
a side-project started (before we started using RTC), and has now finished. It has the same folder/file structure as the structure within my local repository.
Is there some way to create a patch between this local folder/file and my current RTC repository so I don't need to manually compare the two file-by-file? I'm hoping RTC would automatically handle files where one or the other (but not both) have changed - but collisions would need to be viewed so I can make sure they are handled correctly.
If you have delivered all your change sets in your repo workspace, then you can import the files into the existing project. Then, when you check in those changes, you should be able to see any changes. One tip to avoid excessive changes, is to use the Eclipse or RAD source format (CTRL+SHIFT+F). Use that to standardize the original code first. Then import, and format the new code. Check in the code, and see if you have any changes. It should only show you changes that actually have real differences (not just whitespace).
I use the hunk-by-hunk or hunk selection approach to committing: instead of commuting all changes I made to a file, I commit related parts. E.g. I wrote a function and a test, compiled to ensure it works and then commit the function and the test separately. For this I use built-in functionality in tortoiseHg and RecordExtention when in the console.
Now I have two edits separated by only one unchanged line, thus falling in hg's tolerance of one hunk. I want to commit only the former for now. How?
The record extension doesn't let you split hunks further, but the less-standard CRecord extension does.
Just to put it out there, but what you're doing is usually considered bad practice because it guarantees that you haven't run the unit tests on the files as they're being committed. That, of course, doesn't apply in all environments.
If the reason you're leaving some parts uncommitted is because they're local-only changes you always in in place (passwords, paths, etc.) they're a good candidate for a Mercurial Queues "patch". Then you'd be able to 'pop' them off, commit the whole file, and then 'push' them back on.
I have my index.cshtml file and I made a ton of changes to it. However, I want to scrap it and return to the a working (commited) version of this single file.
How can I use Mercurial to accomplish this?
I'm using Visual Studio 2011 with VisualHG.
The command is called hg revert, you should be able to find something like that in VisualHg.
It looks like you already know what the command is named (since you used it as a tag). Is it not available in VisualHg? I would guess it's available in the context menu (i.e. right click) for the file.
Right-click on the file you want to revert and select "Revert Changes", this will show the revert window where you can see the file diff and perform the reversion by clicking the "Revert" button in the botom right corner.
Most of the times, when you make a lot of modifications to a file, you may find out that some of them are useful ( I do, at least ). Of course, for reverting the whole contents of the file, you should use revert as others have suggested. If however, you think you may have something useful in your current modifications, that you'd like to keep, consider using the record extension. It's an extension that ships with Mercurial, and it will allow you to choose whether or not you want to include some (c)hunks in your next commit.
At a point in our development process we send all *.resx files to a translator. The translator usually takes a week to send back the files. During this time no one is allowed to add, remove or update any resx file.
How can I configure mercurial to enforce that policy?
Our setup: Each dev works with a local clone of our central repository.
Nice to have:
I'll turn the "policy" on and off every few weeks. So ideally, I'd like something that is easy to configure at one place and that affect all devs.
I'd rather enforce that policy at the local repository level then at the central repository level because if we prevent the "push" on the central repository, it will be harder for the dev to undo the already locally committed changeset.
Thanks
UPDATE:
More info on the translation process:
Merging is not an issue here. The translator does not change the files that we sent to him. We send him a bunch of language neutral .resx (form1.resx) and returns a bunch of language specific resx (form1.FR.resx).
Why prevent adding new resx? Adding a resx occurs when we add a new UI to our application. If we do that after the translation package has been sent, the translator won't know about the new UI and we'll end up with a new UI with no translation.
Why prevent updating resx? If the dev changes a label value from "open" to "close", he has made a very important semantic change. If he does that after the translation package has been sent, we won't get the right translation back.
You cannot stop by people from committing changes to .resx files unless you have control over their desktop machines (using a pretxncommit hook), and even then it's easily bypassed. It's much more normal to put the check on the central server at time of push using a pretxnchangegroup hook, but you're right that they'll have to fix up any changesets and re-push, which is advanced usage. In either case you'd used the AclExtension to enforce the actual restriction.
Here are two alternate ways to go about this that might work out better for you:
Clone your repository at the start of the translation process, warn developers to leave .resx alone for awhile, apply the work of the translators when they're done, and then merge those changes back into the main development repository with a merge command that always gives the incoming changes priority: X . Then use a simple hg log command to find all the changes in .resx that just got overwritten and tell the developers to re-add them. Chide them at this time.
alternately
Make the .resx files a Subrepository of the larger outer repository. Then turn off write access to that resx repository during the forbidden period. Developers will be able to commit in the outer repository but not the inner one, but clones will still get both exactly as they always did.
For what it's worth, everyone else handles this problem with simple merging, .resx is (XML) text, and it merges just fine.
When working with a DVCS it's not always easy to exactly mirror your svn experience, but there's usually a better option anyway.
You could add *.resx to the hgignore file
I am trying to have Mercurial forget a file, and all the history of that file. I have been tracking some binary files that have been changing a lot, and so my .hg/store/data folder now consists of 660MB of data that I don't want to keep pushing around.
I have considered just starting a new repository, but then I would lose all my code changes, so I have dismissed this.
You can't change that kind of history directly. Remember that most revision control software is usually designed specifically to prevent this.
If you insist, you might be able to do some cherry picking to create a new repository out of the old one, selecting specific changesets to reflect the history you want to reveal.