QA SoftVision Team/Mobile/Writing tests: Difference between revisions

Line 161: Line 161:


= Creating a diff patch file =
= Creating a diff patch file =
All commands need to be run on the main root source folder
All commands need to be run on the main root source folder.
 
Steps to perform for new patches:
* Create a new patch
* Add or modify any files
* Refresh the repository
* Pop the patch to have a clean repository
* Push the patch back
* Export the patch
* Pop the patch to clean up the repository
 
Steps to perform for existing patches:
* Push the patch to the repository
* Add or modify any files
* Refresh the repository
* Pop the patch to have a clean repository
* Push the patch back
* Export the patch
* Pop the patch to clean up the repository
 
== Create a new patch in the Mercurial Queue ==
Merurial can create patch queue (patch stack) so the user can keep his repository clean and can add or work on multiple patches on the same repository
 
hg pull -u
hg qnew <patch name>
 
You need to do hg pull to have the repository up to date in order to create a correct diff patch


== Adding new files to be tracked by Mercurial ==
== Adding new files to be tracked by Mercurial ==
Line 169: Line 195:
  hg add mobile/android/base/tests/<test_file>
  hg add mobile/android/base/tests/<test_file>


== Creating the patch file ==
== Refresh the repository ==
When first creating a patch:
 
hg qrefresh -m "Commit message"
 
When editing patches:
 
hg qrefresh
 
 
The commit message has the general form: "Bug <number> - <Description>". The commit message should be set for a new patch and will appear in the patch file.
 
== Poping the patch ==
Removes the patch from the patch stack (Queue)
hg qpop
 
== Pushing the patch ==
Adds the last patch to the top of the queue. Alternatively you can specify a patch name to add.
 
hg push [<patch_name>]
 
== Viewing the diff file ==


  hg diff > <patch_file.patch>
  hg qdiff


== Remove files from tracking ==
== Exporting the patch ==
You need to remove the file in order to keep the repository clean of changes and conflicts
Exports the top patch in the stack to a file that can be submitted for review
Run the following command for each file added previously


  hg rm -f mobile/android/base/tests/<test_file>
  hg export tip > <patch_name.patch>
Confirmed users
905

edits