Skip to content

Commit

Permalink
Merge pull request #77 from r-devel/patch-docs
Browse files Browse the repository at this point in the history
[build website]patch docs
  • Loading branch information
hturner authored Aug 30, 2023
2 parents 2c9d1bd + fb81a11 commit 826e9c7
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/tutorials/patch_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Creating a Patch File

We can also create a patch file for the update and changes that we made to the source code.

1) Assuming we have made a change and we want to submit a patch.

If necessary, update the version of R you are working on, with the latest changes in <https://svn.r-project.org/R/trunk/>.

E.g. if the version of R you are working on is named "R-devel-working"

```bash
cd $TOP_SRCDIR/R-devel-working
svn update
cd $BUILDDIR/R-devel-working
make # this will run the configure as before
```

2) Now run R's test suite to make sure that your change has not broken anything:

```bash
make check
```

3) Then create a patch. The patch file will be saved inside the patchdir directory.

```bash
cd "$TOP_SRCDIR"
svn update
svn diff > $PATCHDIR/patch.diff
```
66 changes: 66 additions & 0 deletions docs/tutorials/update_source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
## Updating Source Code

After following through the Contribution workflow and making the following changes, we need to update it inside the source code directory. To do so, first we need to follow this steps:

#### 1) Change Directory to TOP_SRCDIR

If you are currently inside the BUILDDIR directory or root directory(/workspaces/r-dev-env) make sure to change it to TOP_SRCDIR so that we can update the changes made inside our source code.

```bash
cd $TOP_SRCDIR
```

#### 2) Update using svn

Now we want to update the source code for that we will use svn command update

```bash
svn update
```

#### 3) Check changes made using diff

To cross check the changes we made in source code. We will use this command

```bash
svn diff
```

#### 4) Revert Changes(Optional step)

In some cases, we might want to revert the changes we made. We can use the revert command

To revert the changes made in specific file, we can use

```bash
svn revert src/library/utils/R/askYesNo.R
```

To revert changes in a directory

```bash
svn revert src/lib/utils
```

To revert all local changes

```bash
svn revert -R .
```

#### 5) Change Directory and Rebuild

To rebuild the R version and reflect on the changes made, we want to change directory to BUILDDIR from TOP_SRCDIR

```bash
cd $BUILDDIR
```

#### 6) Rebuild the Source Code

Now rebuild using make command

```bash
make check
make
```
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ nav:
- 'Running R' : 'tutorials/running_r.md'
- 'Building R': 'tutorials/building_r.md'
- 'R Contribution Workflow' : 'tutorials/contribution_workflow.md'
- 'Updating Source Code' : 'tutorials/update_source.md'
- 'Creating a Patch File' : 'tutorials/patch_update.md'
- 'Multiple R Version' : 'tutorials/multi_r_compilation.md'
- 'Local Setup' : 'tutorials/localsetup.md'
- 'Restarting and Stopping' : 'tutorials/codespacestartstop.md'
Expand Down

0 comments on commit 826e9c7

Please sign in to comment.