summaryrefslogtreecommitdiffstats
path: root/test/timestamps.test
blob: 09d15044a9de316f0ba1e270b733673ee51bd24d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Test how quilt behaves when patches include timestamps

$ mkdir patches

$ cat > patches/series
< unified-create.patch
< unified-update.patch
< unified-delete.patch
< context-create.patch
< context-update.patch
< context-delete.patch

$ cat > patches/unified-create.patch
< diff -ruN a/file b/file
< --- a/file	1970-01-01 01:00:00.000000000 +0100
< +++ b/file	2014-01-15 11:19:43.000000000 +0100
< @@ -0,0 +1 @@
< +new line

$ cat > patches/unified-update.patch
< diff -ruN a/file b/file
< --- a/file	2014-01-15 11:19:43.000000000 +0100
< +++ b/file	2014-01-15 11:20:17.000000000 +0100
< @@ -1 +1 @@
< -new line
< +updated line

$ cat > patches/unified-delete.patch
< diff -ruN a/file b/file
< --- a/file	2014-01-15 11:20:17.000000000 +0100
< +++ b/file	1970-01-01 01:00:00.000000000 +0100
< @@ -1 +0,0 @@
< -updated line

$ cat > patches/context-create.patch
< *** /dev/null	2014-06-24 08:55:39.152180961 +0200
< --- b/file	2014-06-26 13:08:29.608831581 +0200
< ***************
< *** 0 ****
< --- 1 ----
< + new line

$ cat > patches/context-update.patch
< *** a/file	2014-06-26 13:08:29.608831581 +0200
< --- b/file	2014-06-26 13:08:33.872849083 +0200
< ***************
< *** 1 ****
< ! new line
< --- 1 ----
< ! updated line

$ cat > patches/context-delete.patch
< *** a/file	2014-06-26 13:08:33.872849083 +0200
< --- /dev/null	2014-06-24 08:55:39.152180961 +0200
< ***************
< *** 1 ****
< - updated line
< --- 0 ----

# Test unapplied patches
$ quilt patches file
> %{P}unified-create.patch
> %{P}unified-update.patch
> %{P}unified-delete.patch
> %{P}context-create.patch
> %{P}context-update.patch
> %{P}context-delete.patch

# Make sure we don't take line counts as file names
$ quilt patches 1

$ quilt push -qa
> Applying patch %{P}unified-create.patch
> Applying patch %{P}unified-update.patch
> Applying patch %{P}unified-delete.patch
> Applying patch %{P}context-create.patch
> Applying patch %{P}context-update.patch
> Applying patch %{P}context-delete.patch
> Now at patch %{P}context-delete.patch

# Test applied patches
$ quilt patches file
> %{P}unified-create.patch
> %{P}unified-update.patch
> %{P}unified-delete.patch
> %{P}context-create.patch
> %{P}context-update.patch
> %{P}context-delete.patch