# 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
